mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-09-30 11:31:46 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72cb2d3f43 | ||
|
|
0739e90ff2 | ||
|
|
460c684caa | ||
|
|
d64fbf9011 | ||
|
|
dfd9528847 | ||
|
|
d4d425c61d | ||
|
|
0f0c00bd03 | ||
|
|
a26006ad56 | ||
|
|
d761fa12af |
No files matched your search
@@ -1,4 +1,5 @@
|
||||
/.vscode/
|
||||
.idea
|
||||
|
||||
.DS_Store
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
lint:
|
||||
golangci-lint run -c ./golangci.yml ./...
|
||||
|
||||
test:
|
||||
go test -v --cover ./...
|
||||
|
||||
test-report:
|
||||
go test -v --cover -coverprofile=coverage.out ./...
|
||||
go tool cover -html=coverage.out
|
||||
@@ -43,6 +43,7 @@ your own custom app specific business logic and still have a single portable exe
|
||||
# go 1.18+
|
||||
go get github.com/pocketbase/pocketbase
|
||||
```
|
||||
> For Windows, you may have to use go 1.19+ due to an incorrect js mime type in the Windows Registry (see [issue#6](https://github.com/pocketbase/pocketbase/issues/6)).
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
+5
-5
@@ -24,7 +24,7 @@ func BindAdminApi(app core.App, rg *echo.Group) {
|
||||
subGroup.POST("/confirm-password-reset", api.confirmPasswordReset)
|
||||
subGroup.POST("/refresh", api.refresh, RequireAdminAuth())
|
||||
subGroup.GET("", api.list, RequireAdminAuth())
|
||||
subGroup.POST("", api.create, RequireAdminAuth())
|
||||
subGroup.POST("", api.create, RequireAdminAuthOnlyIfAny(app))
|
||||
subGroup.GET("/:id", api.view, RequireAdminAuth())
|
||||
subGroup.PATCH("/:id", api.update, RequireAdminAuth())
|
||||
subGroup.DELETE("/:id", api.delete, RequireAdminAuth())
|
||||
@@ -66,7 +66,7 @@ func (api *adminApi) refresh(c echo.Context) error {
|
||||
func (api *adminApi) emailAuth(c echo.Context) error {
|
||||
form := forms.NewAdminLogin(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
admin, submitErr := form.Submit()
|
||||
@@ -80,11 +80,11 @@ func (api *adminApi) emailAuth(c echo.Context) error {
|
||||
func (api *adminApi) requestPasswordReset(c echo.Context) error {
|
||||
form := forms.NewAdminPasswordResetRequest(api.app)
|
||||
if err := c.Bind(form); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", err)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", err)
|
||||
}
|
||||
|
||||
if err := form.Validate(); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while validating the form.", err)
|
||||
return rest.NewBadRequestError("An error occurred while validating the form.", err)
|
||||
}
|
||||
|
||||
// run in background because we don't need to show the result
|
||||
@@ -101,7 +101,7 @@ func (api *adminApi) requestPasswordReset(c echo.Context) error {
|
||||
func (api *adminApi) confirmPasswordReset(c echo.Context) error {
|
||||
form := forms.NewAdminPasswordResetConfirm(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
admin, submitErr := form.Submit()
|
||||
|
||||
+26
-1
@@ -456,12 +456,37 @@ func TestAdminDelete(t *testing.T) {
|
||||
func TestAdminCreate(t *testing.T) {
|
||||
scenarios := []tests.ApiScenario{
|
||||
{
|
||||
Name: "unauthorized",
|
||||
Name: "unauthorized (while having at least 1 existing admin)",
|
||||
Method: http.MethodPost,
|
||||
Url: "/api/admins",
|
||||
ExpectedStatus: 401,
|
||||
ExpectedContent: []string{`"data":{}`},
|
||||
},
|
||||
{
|
||||
Name: "unauthorized (while having 0 existing admins)",
|
||||
Method: http.MethodPost,
|
||||
Url: "/api/admins",
|
||||
Body: strings.NewReader(`{"email":"testnew@example.com","password":"1234567890","passwordConfirm":"1234567890","avatar":3}`),
|
||||
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
|
||||
// delete all admins
|
||||
_, err := app.Dao().DB().NewQuery("DELETE FROM {{_admins}}").Execute()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
},
|
||||
ExpectedStatus: 200,
|
||||
ExpectedContent: []string{
|
||||
`"id":`,
|
||||
`"email":"testnew@example.com"`,
|
||||
`"avatar":3`,
|
||||
},
|
||||
ExpectedEvents: map[string]int{
|
||||
"OnModelBeforeCreate": 1,
|
||||
"OnModelAfterCreate": 1,
|
||||
"OnAdminBeforeCreateRequest": 1,
|
||||
"OnAdminAfterCreateRequest": 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "authorized as user",
|
||||
Method: http.MethodPost,
|
||||
|
||||
+80
-9
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/tools/rest"
|
||||
"github.com/pocketbase/pocketbase/ui"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
// InitApi creates a configured echo instance with registered
|
||||
@@ -38,13 +39,13 @@ func InitApi(app core.App) (*echo.Echo, error) {
|
||||
var apiErr *rest.ApiError
|
||||
|
||||
switch v := err.(type) {
|
||||
case (*echo.HTTPError):
|
||||
case *echo.HTTPError:
|
||||
if v.Internal != nil && app.IsDebug() {
|
||||
log.Println(v.Internal)
|
||||
}
|
||||
msg := fmt.Sprintf("%v", v.Message)
|
||||
apiErr = rest.NewApiError(v.Code, msg, v)
|
||||
case (*rest.ApiError):
|
||||
case *rest.ApiError:
|
||||
if app.IsDebug() && v.RawData() != nil {
|
||||
log.Println(v.RawData())
|
||||
}
|
||||
@@ -71,13 +72,8 @@ func InitApi(app core.App) (*echo.Echo, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// serves /ui/dist/index.html file
|
||||
// (explicit route is used to avoid conflicts with `RemoveTrailingSlash` middleware)
|
||||
e.FileFS("/_", "index.html", ui.DistIndexHTML, middleware.Gzip())
|
||||
|
||||
// serves static files from the /ui/dist directory
|
||||
// (similar to echo.StaticFS but with gzip middleware enabled)
|
||||
e.GET("/_/*", StaticDirectoryHandler(ui.DistDirFS, false), middleware.Gzip())
|
||||
// admin ui routes
|
||||
bindStaticAdminUI(app, e)
|
||||
|
||||
// default routes
|
||||
api := e.Group("/api")
|
||||
@@ -129,3 +125,78 @@ func StaticDirectoryHandler(fileSystem fs.FS, disablePathUnescaping bool) echo.H
|
||||
return c.FileFS(name, fileSystem)
|
||||
}
|
||||
}
|
||||
|
||||
// bindStaticAdminUI registers the endpoints that serves the static admin UI.
|
||||
func bindStaticAdminUI(app core.App, e *echo.Echo) error {
|
||||
// serves /ui/dist/index.html file
|
||||
// (explicit route is used to avoid conflicts with `RemoveTrailingSlash` middleware)
|
||||
e.FileFS(
|
||||
"/_",
|
||||
"index.html",
|
||||
ui.DistIndexHTML,
|
||||
middleware.Gzip(),
|
||||
installerRedirect(app),
|
||||
)
|
||||
|
||||
// serves static files from the /ui/dist directory
|
||||
// (similar to echo.StaticFS but with gzip middleware enabled)
|
||||
e.GET(
|
||||
"/_/*",
|
||||
StaticDirectoryHandler(ui.DistDirFS, false),
|
||||
middleware.Gzip(),
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const totalAdminsCacheKey = "totalAdmins"
|
||||
|
||||
func updateTotalAdminsCache(app core.App) error {
|
||||
total, err := app.Dao().TotalAdmins()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
app.Cache().Set(totalAdminsCacheKey, total)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// installerRedirect redirects the user to the installer admin UI page
|
||||
// when the application needs some preliminary configurations to be done.
|
||||
func installerRedirect(app core.App) echo.MiddlewareFunc {
|
||||
// keep totalAdminsCacheKey value up-to-date
|
||||
app.OnAdminAfterCreateRequest().Add(func(data *core.AdminCreateEvent) error {
|
||||
return updateTotalAdminsCache(app)
|
||||
})
|
||||
app.OnAdminAfterDeleteRequest().Add(func(data *core.AdminDeleteEvent) error {
|
||||
return updateTotalAdminsCache(app)
|
||||
})
|
||||
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
// load into cache (if not already)
|
||||
if !app.Cache().Has(totalAdminsCacheKey) {
|
||||
if err := updateTotalAdminsCache(app); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
totalAdmins := cast.ToInt(app.Cache().Get(totalAdminsCacheKey))
|
||||
|
||||
_, hasInstallerParam := c.Request().URL.Query()["installer"]
|
||||
|
||||
if totalAdmins == 0 && !hasInstallerParam {
|
||||
// redirect to the installer page
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/_/?installer#")
|
||||
}
|
||||
|
||||
if totalAdmins != 0 && hasInstallerParam {
|
||||
// redirect to the home page
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/_/#/")
|
||||
}
|
||||
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,13 +1,14 @@
|
||||
package apis_test
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/tests"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/pocketbase/pocketbase/tests"
|
||||
)
|
||||
|
||||
func TestFileDownload(t *testing.T) {
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package apis
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/tools/rest"
|
||||
|
||||
+25
-3
@@ -77,6 +77,28 @@ func RequireAdminAuth() echo.MiddlewareFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// RequireAdminAuthIfAny middleware requires a request to have
|
||||
// a valid admin Authorization header set (aka. `Authorization: Admin ...`)
|
||||
// ONLY if the application has at least 1 existing Admin model.
|
||||
func RequireAdminAuthOnlyIfAny(app core.App) echo.MiddlewareFunc {
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
totalAdmins, err := app.Dao().TotalAdmins()
|
||||
if err != nil {
|
||||
return rest.NewBadRequestError("Failed to fetch admins info.", err)
|
||||
}
|
||||
|
||||
admin, _ := c.Get(ContextAdminKey).(*models.Admin)
|
||||
|
||||
if admin != nil || totalAdmins == 0 {
|
||||
return next(c)
|
||||
}
|
||||
|
||||
return rest.NewUnauthorizedError("The request requires admin authorization token to be set.", nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RequireAdminOrUserAuth middleware requires a request to have
|
||||
// a valid admin or user Authorization header set
|
||||
// (aka. `Authorization: Admin ...` or `Authorization: User ...`).
|
||||
@@ -204,11 +226,11 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc {
|
||||
|
||||
if err != nil {
|
||||
switch v := err.(type) {
|
||||
case (*echo.HTTPError):
|
||||
case *echo.HTTPError:
|
||||
status = v.Code
|
||||
meta["errorMessage"] = v.Message
|
||||
meta["errorDetails"] = fmt.Sprint(v.Internal)
|
||||
case (*rest.ApiError):
|
||||
case *rest.ApiError:
|
||||
status = v.Code
|
||||
meta["errorMessage"] = v.Message
|
||||
meta["errorDetails"] = fmt.Sprint(v.RawData())
|
||||
@@ -259,7 +281,7 @@ func ActivityLogger(app core.App) echo.MiddlewareFunc {
|
||||
// ---
|
||||
now := time.Now()
|
||||
lastLogsDeletedAt := cast.ToTime(app.Cache().Get("lastLogsDeletedAt"))
|
||||
daysDiff := (now.Sub(lastLogsDeletedAt).Hours() * 24)
|
||||
daysDiff := now.Sub(lastLogsDeletedAt).Hours() * 24
|
||||
|
||||
if daysDiff > float64(app.Settings().Logs.MaxDays) {
|
||||
deleteErr := app.LogsDao().DeleteOldRequests(now.AddDate(0, 0, -1*app.Settings().Logs.MaxDays))
|
||||
|
||||
@@ -291,6 +291,125 @@ func TestRequireAdminAuth(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRequireAdminAuthOnlyIfAny(t *testing.T) {
|
||||
scenarios := []tests.ApiScenario{
|
||||
{
|
||||
Name: "guest (while having at least 1 existing admin)",
|
||||
Method: http.MethodGet,
|
||||
Url: "/my/test",
|
||||
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
|
||||
e.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/my/test",
|
||||
Handler: func(c echo.Context) error {
|
||||
return c.String(200, "test123")
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.RequireAdminAuthOnlyIfAny(app),
|
||||
},
|
||||
})
|
||||
},
|
||||
ExpectedStatus: 401,
|
||||
ExpectedContent: []string{`"data":{}`},
|
||||
},
|
||||
{
|
||||
Name: "guest (while having 0 existing admins)",
|
||||
Method: http.MethodGet,
|
||||
Url: "/my/test",
|
||||
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
|
||||
// delete all admins
|
||||
_, err := app.Dao().DB().NewQuery("DELETE FROM {{_admins}}").Execute()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
e.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/my/test",
|
||||
Handler: func(c echo.Context) error {
|
||||
return c.String(200, "test123")
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.RequireAdminAuthOnlyIfAny(app),
|
||||
},
|
||||
})
|
||||
},
|
||||
ExpectedStatus: 200,
|
||||
ExpectedContent: []string{"test123"},
|
||||
},
|
||||
{
|
||||
Name: "expired/invalid token",
|
||||
Method: http.MethodGet,
|
||||
Url: "/my/test",
|
||||
RequestHeaders: map[string]string{
|
||||
"Authorization": "Admin eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjJiNGE5N2NjLTNmODMtNGQwMS1hMjZiLTNkNzdiYzg0MmQzYyIsInR5cGUiOiJhZG1pbiIsImV4cCI6MTY0MTAxMzIwMH0.Gp_1b5WVhqjj2o3nJhNUlJmpdiwFLXN72LbMP-26gjA",
|
||||
},
|
||||
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
|
||||
e.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/my/test",
|
||||
Handler: func(c echo.Context) error {
|
||||
return c.String(200, "test123")
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.RequireAdminAuthOnlyIfAny(app),
|
||||
},
|
||||
})
|
||||
},
|
||||
ExpectedStatus: 401,
|
||||
ExpectedContent: []string{`"data":{}`},
|
||||
},
|
||||
{
|
||||
Name: "valid user token",
|
||||
Method: http.MethodGet,
|
||||
Url: "/my/test",
|
||||
RequestHeaders: map[string]string{
|
||||
"Authorization": "User eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjRkMDE5N2NjLTJiNGEtM2Y4My1hMjZiLWQ3N2JjODQyM2QzYyIsInR5cGUiOiJ1c2VyIiwiZXhwIjoxODkzNDc0MDAwfQ.Wq5ac1q1f5WntIzEngXk22ydMj-eFgvfSRg7dhmPKic",
|
||||
},
|
||||
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
|
||||
e.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/my/test",
|
||||
Handler: func(c echo.Context) error {
|
||||
return c.String(200, "test123")
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.RequireAdminAuthOnlyIfAny(app),
|
||||
},
|
||||
})
|
||||
},
|
||||
ExpectedStatus: 401,
|
||||
ExpectedContent: []string{`"data":{}`},
|
||||
},
|
||||
{
|
||||
Name: "valid admin token",
|
||||
Method: http.MethodGet,
|
||||
Url: "/my/test",
|
||||
RequestHeaders: map[string]string{
|
||||
"Authorization": "Admin eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjJiNGE5N2NjLTNmODMtNGQwMS1hMjZiLTNkNzdiYzg0MmQzYyIsInR5cGUiOiJhZG1pbiIsImV4cCI6MTg3MzQ2Mjc5Mn0.AtRtXR6FHBrCUGkj5OffhmxLbSZaQ4L_Qgw4gfoHyfo",
|
||||
},
|
||||
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
|
||||
e.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/my/test",
|
||||
Handler: func(c echo.Context) error {
|
||||
return c.String(200, "test123")
|
||||
},
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.RequireAdminAuthOnlyIfAny(app),
|
||||
},
|
||||
})
|
||||
},
|
||||
ExpectedStatus: 200,
|
||||
ExpectedContent: []string{"test123"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, scenario := range scenarios {
|
||||
scenario.Test(t)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRequireAdminOrUserAuth(t *testing.T) {
|
||||
scenarios := []tests.ApiScenario{
|
||||
{
|
||||
|
||||
+9
-7
@@ -9,8 +9,8 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/forms"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
@@ -163,11 +163,12 @@ func (api *realtimeApi) bindEvents() {
|
||||
modelTable := data.Model.TableName()
|
||||
|
||||
var contextKey string
|
||||
if modelTable == userTable {
|
||||
switch modelTable {
|
||||
case userTable:
|
||||
contextKey = ContextUserKey
|
||||
} else if modelTable == adminTable {
|
||||
case adminTable:
|
||||
contextKey = ContextAdminKey
|
||||
} else {
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -186,11 +187,12 @@ func (api *realtimeApi) bindEvents() {
|
||||
modelTable := data.Model.TableName()
|
||||
|
||||
var contextKey string
|
||||
if modelTable == userTable {
|
||||
switch modelTable {
|
||||
case userTable:
|
||||
contextKey = ContextUserKey
|
||||
} else if modelTable == adminTable {
|
||||
case adminTable:
|
||||
contextKey = ContextAdminKey
|
||||
} else {
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,8 +6,8 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
"github.com/pocketbase/pocketbase/forms"
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ func (api *settingsApi) list(c echo.Context) error {
|
||||
func (api *settingsApi) set(c echo.Context) error {
|
||||
form := forms.NewSettingsUpsert(api.app)
|
||||
if err := c.Bind(form); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", err)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", err)
|
||||
}
|
||||
|
||||
event := &core.SettingsUpdateEvent{
|
||||
@@ -52,7 +52,7 @@ func (api *settingsApi) set(c echo.Context) error {
|
||||
|
||||
handlerErr := api.app.OnSettingsBeforeUpdateRequest().Trigger(event, func(e *core.SettingsUpdateEvent) error {
|
||||
if err := form.Submit(); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while submitting the form.", err)
|
||||
return rest.NewBadRequestError("An error occurred while submitting the form.", err)
|
||||
}
|
||||
|
||||
redactedSettings, err := api.app.Settings().RedactClone()
|
||||
|
||||
+12
-12
@@ -152,12 +152,12 @@ func (api *userApi) authMethods(c echo.Context) error {
|
||||
func (api *userApi) oauth2Auth(c echo.Context) error {
|
||||
form := forms.NewUserOauth2Login(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
user, authData, submitErr := form.Submit()
|
||||
if submitErr != nil {
|
||||
return rest.NewBadRequestError("Failed to authenticated.", submitErr)
|
||||
return rest.NewBadRequestError("Failed to authenticate.", submitErr)
|
||||
}
|
||||
|
||||
return api.authResponse(c, user, authData)
|
||||
@@ -170,7 +170,7 @@ func (api *userApi) emailAuth(c echo.Context) error {
|
||||
|
||||
form := forms.NewUserEmailLogin(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
user, submitErr := form.Submit()
|
||||
@@ -184,11 +184,11 @@ func (api *userApi) emailAuth(c echo.Context) error {
|
||||
func (api *userApi) requestPasswordReset(c echo.Context) error {
|
||||
form := forms.NewUserPasswordResetRequest(api.app)
|
||||
if err := c.Bind(form); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", err)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", err)
|
||||
}
|
||||
|
||||
if err := form.Validate(); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while validating the form.", err)
|
||||
return rest.NewBadRequestError("An error occurred while validating the form.", err)
|
||||
}
|
||||
|
||||
// run in background because we don't need to show
|
||||
@@ -205,7 +205,7 @@ func (api *userApi) requestPasswordReset(c echo.Context) error {
|
||||
func (api *userApi) confirmPasswordReset(c echo.Context) error {
|
||||
form := forms.NewUserPasswordResetConfirm(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
user, submitErr := form.Submit()
|
||||
@@ -224,7 +224,7 @@ func (api *userApi) requestEmailChange(c echo.Context) error {
|
||||
|
||||
form := forms.NewUserEmailChangeRequest(api.app, loggedUser)
|
||||
if err := c.Bind(form); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", err)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", err)
|
||||
}
|
||||
|
||||
if err := form.Submit(); err != nil {
|
||||
@@ -237,7 +237,7 @@ func (api *userApi) requestEmailChange(c echo.Context) error {
|
||||
func (api *userApi) confirmEmailChange(c echo.Context) error {
|
||||
form := forms.NewUserEmailChangeConfirm(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
user, submitErr := form.Submit()
|
||||
@@ -251,11 +251,11 @@ func (api *userApi) confirmEmailChange(c echo.Context) error {
|
||||
func (api *userApi) requestVerification(c echo.Context) error {
|
||||
form := forms.NewUserVerificationRequest(api.app)
|
||||
if err := c.Bind(form); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", err)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", err)
|
||||
}
|
||||
|
||||
if err := form.Validate(); err != nil {
|
||||
return rest.NewBadRequestError("An error occured while validating the form.", err)
|
||||
return rest.NewBadRequestError("An error occurred while validating the form.", err)
|
||||
}
|
||||
|
||||
// run in background because we don't need to show
|
||||
@@ -272,12 +272,12 @@ func (api *userApi) requestVerification(c echo.Context) error {
|
||||
func (api *userApi) confirmVerification(c echo.Context) error {
|
||||
form := forms.NewUserVerificationConfirm(api.app)
|
||||
if readErr := c.Bind(form); readErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while reading the submitted data.", readErr)
|
||||
return rest.NewBadRequestError("An error occurred while reading the submitted data.", readErr)
|
||||
}
|
||||
|
||||
user, submitErr := form.Submit()
|
||||
if submitErr != nil {
|
||||
return rest.NewBadRequestError("An error occured while submitting the form.", submitErr)
|
||||
return rest.NewBadRequestError("An error occurred while submitting the form.", submitErr)
|
||||
}
|
||||
|
||||
return api.authResponse(c, user, nil)
|
||||
|
||||
+10
-83
@@ -2,7 +2,6 @@ package cmd
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
@@ -10,14 +9,10 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/fatih/color"
|
||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||
"github.com/labstack/echo/v5/middleware"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/forms"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/tools/migrate"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/acme"
|
||||
@@ -35,18 +30,6 @@ func NewServeCommand(app core.App, showStartBanner bool) *cobra.Command {
|
||||
Use: "serve",
|
||||
Short: "Starts the web server (default to localhost:8090)",
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
router, err := apis.InitApi(app)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// configure cors
|
||||
router.Use(middleware.CORSWithConfig(middleware.CORSConfig(middleware.CORSConfig{
|
||||
Skipper: middleware.DefaultSkipper,
|
||||
AllowOrigins: allowedOrigins,
|
||||
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
|
||||
})))
|
||||
|
||||
// ensure that the latest migrations are applied before starting the server
|
||||
if err := runMigrations(app); err != nil {
|
||||
panic(err)
|
||||
@@ -61,19 +44,18 @@ func NewServeCommand(app core.App, showStartBanner bool) *cobra.Command {
|
||||
color.Yellow("=====================================")
|
||||
}
|
||||
|
||||
// if no admins are found, create the first one
|
||||
totalAdmins, err := app.Dao().TotalAdmins()
|
||||
router, err := apis.InitApi(app)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
return
|
||||
}
|
||||
if totalAdmins == 0 {
|
||||
if err := promptCreateAdmin(app); err != nil {
|
||||
log.Fatalln(err)
|
||||
return
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// configure cors
|
||||
router.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
||||
Skipper: middleware.DefaultSkipper,
|
||||
AllowOrigins: allowedOrigins,
|
||||
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
|
||||
}))
|
||||
|
||||
// start http server
|
||||
// ---
|
||||
mainAddr := httpAddr
|
||||
@@ -149,7 +131,7 @@ func NewServeCommand(app core.App, showStartBanner bool) *cobra.Command {
|
||||
&httpsAddr,
|
||||
"https",
|
||||
"",
|
||||
"api HTTPS server address (auto TLS via Let's Encrypt)\nthe incomming --http address traffic also will be redirected to this address",
|
||||
"api HTTPS server address (auto TLS via Let's Encrypt)\nthe incoming --http address traffic also will be redirected to this address",
|
||||
)
|
||||
|
||||
return command
|
||||
@@ -171,58 +153,3 @@ func runMigrations(app core.App) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func promptCreateAdmin(app core.App) error {
|
||||
color.White("-------------------------------------")
|
||||
color.Cyan("Lets create your first admin account:")
|
||||
color.White("-------------------------------------")
|
||||
|
||||
prompts := []*survey.Question{
|
||||
{
|
||||
Name: "Email",
|
||||
Prompt: &survey.Input{Message: "Email:"},
|
||||
Validate: func(val any) error {
|
||||
if err := survey.Required(val); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := is.Email.Validate(val); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Password",
|
||||
Prompt: &survey.Password{Message: "Pass (min 10 chars):"},
|
||||
Validate: func(val any) error {
|
||||
if str, ok := val.(string); !ok || len(str) < 10 {
|
||||
return errors.New("The password must be at least 10 characters.")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
result := struct {
|
||||
Email string
|
||||
Password string
|
||||
}{}
|
||||
if err := survey.Ask(prompts, &result); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
form := forms.NewAdminUpsert(app, &models.Admin{})
|
||||
form.Email = result.Email
|
||||
form.Password = result.Password
|
||||
form.PasswordConfirm = result.Password
|
||||
|
||||
if err := form.Submit(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
color.Green("Successfully created admin %s!", result.Email)
|
||||
fmt.Println("")
|
||||
|
||||
return nil
|
||||
}
|
||||
+8
-8
@@ -91,7 +91,7 @@ type App interface {
|
||||
// entry in the DB, allowing you to modify or validate the stored data.
|
||||
OnModelBeforeCreate() *hook.Hook[*ModelEvent]
|
||||
|
||||
// OnModelAfterCreate hook is triggered after successfuly
|
||||
// OnModelAfterCreate hook is triggered after successfully
|
||||
// inserting a new entry in the DB.
|
||||
OnModelAfterCreate() *hook.Hook[*ModelEvent]
|
||||
|
||||
@@ -99,7 +99,7 @@ type App interface {
|
||||
// entry in the DB, allowing you to modify or validate the stored data.
|
||||
OnModelBeforeUpdate() *hook.Hook[*ModelEvent]
|
||||
|
||||
// OnModelAfterUpdate hook is triggered after successfuly updating
|
||||
// OnModelAfterUpdate hook is triggered after successfully updating
|
||||
// existing entry in the DB.
|
||||
OnModelAfterUpdate() *hook.Hook[*ModelEvent]
|
||||
|
||||
@@ -107,7 +107,7 @@ type App interface {
|
||||
// existing entry from the DB.
|
||||
OnModelBeforeDelete() *hook.Hook[*ModelEvent]
|
||||
|
||||
// OnModelAfterDelete is triggered after successfuly deleting an
|
||||
// OnModelAfterDelete is triggered after successfully deleting an
|
||||
// existing entry from the DB.
|
||||
OnModelAfterDelete() *hook.Hook[*ModelEvent]
|
||||
|
||||
@@ -123,7 +123,7 @@ type App interface {
|
||||
OnMailerBeforeAdminResetPasswordSend() *hook.Hook[*MailerAdminEvent]
|
||||
|
||||
// OnMailerAfterAdminResetPasswordSend hook is triggered after
|
||||
// admin password reset email was successfuly sent.
|
||||
// admin password reset email was successfully sent.
|
||||
OnMailerAfterAdminResetPasswordSend() *hook.Hook[*MailerAdminEvent]
|
||||
|
||||
// OnMailerBeforeUserResetPasswordSend hook is triggered right before
|
||||
@@ -134,7 +134,7 @@ type App interface {
|
||||
OnMailerBeforeUserResetPasswordSend() *hook.Hook[*MailerUserEvent]
|
||||
|
||||
// OnMailerAfterUserResetPasswordSend hook is triggered after
|
||||
// a user password reset email was successfuly sent.
|
||||
// a user password reset email was successfully sent.
|
||||
OnMailerAfterUserResetPasswordSend() *hook.Hook[*MailerUserEvent]
|
||||
|
||||
// OnMailerBeforeUserVerificationSend hook is triggered right before
|
||||
@@ -145,7 +145,7 @@ type App interface {
|
||||
OnMailerBeforeUserVerificationSend() *hook.Hook[*MailerUserEvent]
|
||||
|
||||
// OnMailerAfterUserVerificationSend hook is triggered after a user
|
||||
// verification email was successfuly sent.
|
||||
// verification email was successfully sent.
|
||||
OnMailerAfterUserVerificationSend() *hook.Hook[*MailerUserEvent]
|
||||
|
||||
// OnMailerBeforeUserChangeEmailSend hook is triggered right before
|
||||
@@ -156,7 +156,7 @@ type App interface {
|
||||
OnMailerBeforeUserChangeEmailSend() *hook.Hook[*MailerUserEvent]
|
||||
|
||||
// OnMailerAfterUserChangeEmailSend hook is triggered after a user
|
||||
// change address email was successfuly sent.
|
||||
// change address email was successfully sent.
|
||||
OnMailerAfterUserChangeEmailSend() *hook.Hook[*MailerUserEvent]
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
@@ -180,7 +180,7 @@ type App interface {
|
||||
// Settings API event hooks
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
// OnSettingsListRequest hook is triggered on each successfull
|
||||
// OnSettingsListRequest hook is triggered on each successful
|
||||
// API Settings list request.
|
||||
//
|
||||
// Could be used to validate or modify the response before
|
||||
|
||||
+1
-1
@@ -5,8 +5,8 @@ package core
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/pocketbase/dbx"
|
||||
)
|
||||
|
||||
func connectDB(dbPath string) (*dbx.DB, error) {
|
||||
|
||||
+6
-6
@@ -148,12 +148,12 @@ func (s *Settings) Merge(other *Settings) error {
|
||||
}
|
||||
|
||||
// Clone creates a new deep copy of the current settings.
|
||||
func (c *Settings) Clone() (*Settings, error) {
|
||||
new := &Settings{}
|
||||
if err := new.Merge(c); err != nil {
|
||||
func (s *Settings) Clone() (*Settings, error) {
|
||||
settings := &Settings{}
|
||||
if err := settings.Merge(s); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return new, nil
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
// RedactClone creates a new deep copy of the current settings,
|
||||
@@ -360,11 +360,11 @@ func (c AuthProviderConfig) SetupProvider(provider auth.Provider) error {
|
||||
}
|
||||
|
||||
if c.ClientId != "" {
|
||||
provider.SetClientId(string(c.ClientId))
|
||||
provider.SetClientId(c.ClientId)
|
||||
}
|
||||
|
||||
if c.ClientSecret != "" {
|
||||
provider.SetClientSecret(string(c.ClientSecret))
|
||||
provider.SetClientSecret(c.ClientSecret)
|
||||
}
|
||||
|
||||
if c.AuthUrl != "" {
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ func (dao *Dao) FindAdminByEmail(email string) (*models.Admin, error) {
|
||||
return model, nil
|
||||
}
|
||||
|
||||
// FindAdminByEmail finds the admin associated with the provided JWT token.
|
||||
// FindAdminByToken finds the admin associated with the provided JWT token.
|
||||
//
|
||||
// Returns an error if the JWT token is invalid or expired.
|
||||
func (dao *Dao) FindAdminByToken(token string, baseTokenKey string) (*models.Admin, error) {
|
||||
|
||||
@@ -166,7 +166,6 @@ func TestDeleteCollection(t *testing.T) {
|
||||
t.Errorf("(%d) Expected hasErr %v, got %v", i, scenario.expectError, hasErr)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestSaveCollectionCreate(t *testing.T) {
|
||||
|
||||
+1
-1
@@ -309,7 +309,7 @@ func (dao *Dao) SyncRecordTableSchema(newCollection *models.Collection, oldColle
|
||||
newSchema := newCollection.Schema
|
||||
|
||||
// check for renamed table
|
||||
if strings.ToLower(oldTableName) != strings.ToLower(newTableName) {
|
||||
if !strings.EqualFold(oldTableName, newTableName) {
|
||||
_, err := dao.DB().RenameTable(oldTableName, newTableName).Execute()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -396,6 +396,9 @@ func TestSyncRecordTableSchema(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
updatedCollection, err := app.Dao().FindCollectionByNameOrId("demo")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
updatedCollection.Name = "demo_renamed"
|
||||
updatedCollection.Schema.RemoveField(updatedCollection.Schema.GetFieldByName("file").Id)
|
||||
updatedCollection.Schema.AddField(
|
||||
|
||||
@@ -107,7 +107,7 @@ func TestAdminPasswordResetConfirmSubmit(t *testing.T) {
|
||||
}
|
||||
|
||||
claims, _ := security.ParseUnverifiedJWT(s.token)
|
||||
tokenAdminId, _ := claims["id"]
|
||||
tokenAdminId := claims["id"]
|
||||
|
||||
if admin.Id != tokenAdminId {
|
||||
t.Errorf("(%d) Expected admin with id %s to be returned, got %v", i, tokenAdminId, admin)
|
||||
|
||||
@@ -95,7 +95,7 @@ func (form *CollectionUpsert) checkUniqueName(value any) error {
|
||||
return validation.NewError("validation_collection_name_exists", "Collection name must be unique (case insensitive).")
|
||||
}
|
||||
|
||||
if (form.isCreate || strings.ToLower(v) != strings.ToLower(form.collection.Name)) && form.app.Dao().HasTable(v) {
|
||||
if (form.isCreate || !strings.EqualFold(v, form.collection.Name)) && form.app.Dao().HasTable(v) {
|
||||
return validation.NewError("validation_collection_name_table_exists", "The collection name must be also unique table name.")
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ func NewRecordUpsert(app core.App, record *models.Record) *RecordUpsert {
|
||||
form.Data = map[string]any{}
|
||||
for _, field := range record.Collection().Schema.Fields() {
|
||||
form.Data[field.Name] = record.GetDataValue(field.Name)
|
||||
|
||||
}
|
||||
|
||||
return form
|
||||
@@ -147,7 +146,7 @@ func (form *RecordUpsert) LoadData(r *http.Request) error {
|
||||
|
||||
for _, field := range form.record.Collection().Schema.Fields() {
|
||||
key := field.Name
|
||||
value, _ := extendedData[key]
|
||||
value := extendedData[key]
|
||||
value = field.PrepareValue(value)
|
||||
|
||||
if field.Type == schema.FieldTypeFile {
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestNewRecordUpsert(t *testing.T) {
|
||||
|
||||
form := forms.NewRecordUpsert(app, record)
|
||||
|
||||
val, _ := form.Data["title"]
|
||||
val := form.Data["title"]
|
||||
if val != "test_value" {
|
||||
t.Errorf("Expected record data to be load, got %v", form.Data)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
// UserEmailChangeConfirm defines a user email change request form.
|
||||
// UserEmailChangeRequest defines a user email change request form.
|
||||
type UserEmailChangeRequest struct {
|
||||
app core.App
|
||||
user *models.User
|
||||
|
||||
@@ -68,7 +68,7 @@ func (form *UserOauth2Login) Submit() (*models.User, *auth.AuthUser, error) {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
config, _ := form.app.Settings().NamedAuthProviderConfigs()[form.Provider]
|
||||
config := form.app.Settings().NamedAuthProviderConfigs()[form.Provider]
|
||||
config.SetupProvider(provider)
|
||||
|
||||
provider.SetRedirectUrl(form.RedirectUrl)
|
||||
|
||||
@@ -148,7 +148,7 @@ func TestUserPasswordResetConfirmSubmit(t *testing.T) {
|
||||
}
|
||||
|
||||
claims, _ := security.ParseUnverifiedJWT(form.Token)
|
||||
tokenUserId, _ := claims["id"]
|
||||
tokenUserId := claims["id"]
|
||||
|
||||
if user.Id != tokenUserId {
|
||||
t.Errorf("(%d) Expected user with id %s, got %v", i, tokenUserId, user)
|
||||
|
||||
@@ -127,7 +127,7 @@ func TestUserVerificationConfirmSubmit(t *testing.T) {
|
||||
}
|
||||
|
||||
claims, _ := security.ParseUnverifiedJWT(form.Token)
|
||||
tokenUserId, _ := claims["id"]
|
||||
tokenUserId := claims["id"]
|
||||
|
||||
if user.Id != tokenUserId {
|
||||
t.Errorf("(%d) Expected user.Id %q, got %q", i, tokenUserId, user.Id)
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
|
||||
@@ -1189,7 +1189,7 @@ func TestRecordDataValidatorValidateRelation(t *testing.T) {
|
||||
Type: schema.FieldTypeRelation,
|
||||
Options: &schema.RelationOptions{
|
||||
MaxSelect: 3,
|
||||
CollectionId: "", // missing or nonexisting colleciton id
|
||||
CollectionId: "", // missing or non-existing collection id
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
run:
|
||||
go: 1.18
|
||||
concurrency: 4
|
||||
timeout: 10m
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- asciicheck
|
||||
- deadcode
|
||||
- depguard
|
||||
- exportloopref
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- gomodguard
|
||||
- goprintffuncname
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- nolintlint
|
||||
- prealloc
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- varcheck
|
||||
- whitespace
|
||||
@@ -3,6 +3,8 @@ package migrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
@@ -20,7 +22,14 @@ func Register(
|
||||
down func(db dbx.Builder) error,
|
||||
optFilename ...string,
|
||||
) {
|
||||
AppMigrations.Register(up, down, optFilename...)
|
||||
var optFiles []string
|
||||
if len(optFilename) > 0 {
|
||||
optFiles = optFilename
|
||||
} else {
|
||||
_, path, _, _ := runtime.Caller(1)
|
||||
optFiles = append(optFiles, filepath.Base(path))
|
||||
}
|
||||
AppMigrations.Register(up, down, optFiles...)
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@ func (m *BaseModel) GetCreated() types.DateTime {
|
||||
return m.Created
|
||||
}
|
||||
|
||||
// GetCreated returns the model's Updated datetime.
|
||||
// GetUpdated returns the model's Updated datetime.
|
||||
func (m *BaseModel) GetUpdated() types.DateTime {
|
||||
return m.Updated
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func (m *BaseModel) RefreshCreated() {
|
||||
m.Created = types.NowDateTime()
|
||||
}
|
||||
|
||||
// RefreshCreated updates the model's Created field with the current datetime.
|
||||
// RefreshUpdated updates the model's Created field with the current datetime.
|
||||
func (m *BaseModel) RefreshUpdated() {
|
||||
m.Updated = types.NowDateTime()
|
||||
}
|
||||
|
||||
+2
-2
@@ -77,12 +77,12 @@ func NewRecordsFromNullStringMaps(collection *Collection, rows []dbx.NullStringM
|
||||
return result
|
||||
}
|
||||
|
||||
// Returns the table name associated to the current Record model.
|
||||
// TableName returns the table name associated to the current Record model.
|
||||
func (m *Record) TableName() string {
|
||||
return m.collection.Name
|
||||
}
|
||||
|
||||
// Returns the Collection model associated to the current Record model.
|
||||
// Collection returns the Collection model associated to the current Record model.
|
||||
func (m *Record) Collection() *Collection {
|
||||
return m.collection
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ func (s *Schema) AddField(newField *SchemaField) {
|
||||
// checks for invalid renamed fields and field name duplications.
|
||||
func (s Schema) Validate() error {
|
||||
return validation.Validate(&s.fields, validation.Required, validation.By(func(value any) error {
|
||||
fields := s.fields // use directly the schema value to avoid unnecesary interface casting
|
||||
fields := s.fields // use directly the schema value to avoid unnecessary interface casting
|
||||
|
||||
if len(fields) == 0 {
|
||||
return validation.NewError("validation_invalid_schema", "Invalid schema format.")
|
||||
|
||||
@@ -493,9 +493,9 @@ func TestSchemaFieldPrepareValue(t *testing.T) {
|
||||
value any
|
||||
expectJson string
|
||||
}{
|
||||
{schema.SchemaField{Type: "unkown"}, "test", `"test"`},
|
||||
{schema.SchemaField{Type: "unkown"}, 123, "123"},
|
||||
{schema.SchemaField{Type: "unkown"}, []int{1, 2, 1}, "[1,2,1]"},
|
||||
{schema.SchemaField{Type: "unknown"}, "test", `"test"`},
|
||||
{schema.SchemaField{Type: "unknown"}, 123, "123"},
|
||||
{schema.SchemaField{Type: "unknown"}, []int{1, 2, 1}, "[1,2,1]"},
|
||||
|
||||
// text
|
||||
{schema.SchemaField{Type: schema.FieldTypeText}, nil, `null`},
|
||||
@@ -1281,7 +1281,6 @@ func TestFileOptionsValidate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRelationOptionsValidate(t *testing.T) {
|
||||
|
||||
scenarios := []fieldOptionsScenario{
|
||||
{
|
||||
"empty",
|
||||
|
||||
+2
-2
@@ -51,9 +51,9 @@ type PocketBase struct {
|
||||
// New creates a new PocketBase instance.
|
||||
//
|
||||
// Note that the application will not be initialized/bootstrapped yet,
|
||||
// aka. DB connections, migrations, app settings, etc. will not be accessable.
|
||||
// aka. DB connections, migrations, app settings, etc. will not be accessible.
|
||||
// Everything will be initialized when Start() is executed.
|
||||
// If you want initialize the application before calling Start(),
|
||||
// If you want to initialize the application before calling Start(),
|
||||
// then you'll have to manually call Bootstrap().
|
||||
func New() *PocketBase {
|
||||
// try to find the base executable directory and how it was run
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ func (scenario *ApiScenario) Test(t *testing.T) {
|
||||
}
|
||||
|
||||
for event, expectedCalls := range scenario.ExpectedEvents {
|
||||
actualCalls, _ := testApp.EventCalls[event]
|
||||
actualCalls := testApp.EventCalls[event]
|
||||
if actualCalls != expectedCalls {
|
||||
t.Errorf("[%s] Expected event %s to be called %d, got %d", prefix, event, expectedCalls, actualCalls)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Pacakge tests provides common helpers and mocks used in PocketBase application tests.
|
||||
// Package tests provides common helpers and mocks used in PocketBase application tests.
|
||||
package tests
|
||||
|
||||
import (
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ type Provider interface {
|
||||
// SetClientId sets the provider client's ID.
|
||||
SetClientId(clientId string)
|
||||
|
||||
// ClientId returns the provider client's app secret.
|
||||
// ClientSecret returns the provider client's app secret.
|
||||
ClientSecret() string
|
||||
|
||||
// SetClientSecret sets the provider client's app secret.
|
||||
|
||||
@@ -127,7 +127,7 @@ func (s *System) DeletePrefix(prefix string) []error {
|
||||
Prefix: prefix,
|
||||
}
|
||||
|
||||
// delete all files witht the prefix
|
||||
// delete all files with the prefix
|
||||
// ---
|
||||
iter := s.bucket.List(&opts)
|
||||
for {
|
||||
|
||||
@@ -82,7 +82,7 @@ func TestSanitize(t *testing.T) {
|
||||
{" ", ` `, "", false},
|
||||
{"", `[A-Z]`, "", false},
|
||||
{"abcABC", `[A-Z]`, "abc", false},
|
||||
{"abcABC", `[A-Z`, "", true}, // invlid pattern
|
||||
{"abcABC", `[A-Z`, "", true}, // invalid pattern
|
||||
}
|
||||
|
||||
for i, scenario := range scenarios {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
var cachedPatterns = map[string]*regexp.Regexp{}
|
||||
|
||||
// ExustInSlice checks whether a comparable element exists in a slice of the same type.
|
||||
// ExistInSlice checks whether a comparable element exists in a slice of the same type.
|
||||
func ExistInSlice[T comparable](item T, list []T) bool {
|
||||
if len(list) == 0 {
|
||||
return false
|
||||
|
||||
@@ -37,8 +37,6 @@ func NewSmtpClient(
|
||||
// SmtpClient defines a SMTP mail client structure that implements
|
||||
// `mailer.Mailer` interface.
|
||||
type SmtpClient struct {
|
||||
mail *mailyak.MailYak
|
||||
|
||||
host string
|
||||
port int
|
||||
username string
|
||||
|
||||
@@ -210,7 +210,7 @@ func (s *Provider) Exec(items any) (*Result, error) {
|
||||
s.perPage = MaxPerPage
|
||||
}
|
||||
|
||||
// normalize page accoring to the total count
|
||||
// normalize page according to the total count
|
||||
if s.page <= 0 || totalCount == 0 {
|
||||
s.page = 1
|
||||
} else if totalPages := int(math.Ceil(float64(totalCount) / float64(s.perPage))); s.page > totalPages {
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
func TestRandomString(t *testing.T) {
|
||||
generated := []string{}
|
||||
reg := regexp.MustCompile(`[a-zA-Z0-9]+`)
|
||||
|
||||
for i := 0; i < 30; i++ {
|
||||
length := 5 + i
|
||||
@@ -18,7 +19,7 @@ func TestRandomString(t *testing.T) {
|
||||
t.Errorf("(%d) Expected the length of the string to be %d, got %d", i, length, len(result))
|
||||
}
|
||||
|
||||
if match, _ := regexp.MatchString("[a-zA-Z0-9]+", result); !match {
|
||||
if match := reg.MatchString(result); !match {
|
||||
t.Errorf("(%d) The generated strings should have only [a-zA-Z0-9]+ characters, got %q", i, result)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package types_test
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func TestNowDateTime(t *testing.T) {
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
PB_BACKEND_URL = /
|
||||
PB_PROFILE_COLLECTION = profiles
|
||||
PB_RULES_SYNTAX_DOCS = https://pocketbase.io/docs/manage-collections#rules-filters-syntax
|
||||
PB_INSTALLER_PARAM = installer
|
||||
Vendored
-68
@@ -1,68 +0,0 @@
|
||||
import{S as ln,i as tn,s as sn,O as We,a as en,b as nn,c as fn,e,d as n,f as Xt,g as f,h as i,j as u,m as Dt,k as bn,t as un,l as on,n as zt,o as Ft,p as s,q as Gt,r as pn,u as Ye}from"./index.a658f3b6.js";function mn(v){let b;return{c(){b=e("p"),b.textContent="Lorem ipsum dolor sit amet..."},m(o,p){i(o,b,p)},p:Ye,d(o){o&&s(b)}}}function vn(v){let b;return{c(){b=e("h4"),b.textContent="My title",f(b,"slot","header")},m(o,p){i(o,b,p)},p:Ye,d(o){o&&s(b)}}}function dn(v){let b,o,p;return{c(){b=e("button"),b.textContent="Cancel",o=n(),p=e("button"),p.textContent="Save",f(b,"class","btn btn-secondary"),f(p,"class","btn btn-expanded")},m(m,d){i(m,b,d),i(m,o,d),i(m,p,d)},p:Ye,d(m){m&&s(b),m&&s(o),m&&s(p)}}}function xn(v){let b,o,p,m,d,Jt,Kt,_,_t,Ze,y,Qt,Ut,Vt,L,Lt,re,B,Wt,Yt,Zt,r,rt,c,ct,a,at,h,ht,g,gt,li,ti,Ht,ii,Ct,si,Mt,ei,Tt,ni,yt,fi,Bt,bi,wt,ui,kt,oi,$t,pi,Ot,mi,It,vi,Et,di,xi,_i,ll,Li,Nt,Hi,Pt,Ci,jt,Mi,At,Ti,yi,Bi,tl,wi,ki,$i,il,Oi,sl,Ii,el,Ei,nl,Ni,fl,Pi,bl,ji,Ai,Si,ul,qi,ol,Ri,pl,Xi,ml,Di,vl,zi,dl,Fi,Gi,Ji,xl,Ki,_l,Qi,Ll,Ui,Hl,Vi,Cl,Wi,Ml,Yi,Zi,ri,w,ci,k,ai,$,hi,O,gi,I,ls,E,ts,N,is,P,ss,j,es,A,ns,S,fs,q,bs,us,os,Tl,ps,yl,ms,Bl,vs,wl,ds,kl,xs,_s,Ls,$l,Hs,Ol,Cs,Il,Ms,El,Ts,Nl,ys,Bs,ws,Pl,ks,jl,$s,Al,Os,Sl,Is,ql,Es,Ns,Ps,Rl,js,Xl,As,Dl,Ss,zl,qs,Fl,Rs,Gl,Xs,Ds,zs,Jl,Fs,Kl,Gs,Ql,Js,Ul,Ks,Vl,Qs,Wl,Us,Vs,Ws,R,Ys,X,Zs,D,rs,z,cs,F,as,G,hs,gs,le,St,te,ie,se,J,H,K,Q,ee,ne,fe,Yl,be,ue,oe,Zl,pe,rl,me,C,qt,ce,U,M,V,W,ve,de,xe,cl,_e,al,Le,hl,gl,T,Y,Z,He,Ce,Me,lt,Te,tt,ye,it,Be,st,we,ke,$e,et,Oe,nt,Ie,ft,Ee,bt,Ne,Pe,je,ut,Ae,ot,Se,pt,qe,mt,Re,Xe,De,vt,ze,dt,Fe,Ge,Je,xt,Ke,x,Qe,Rt,Ue,ae;m=new We({props:{multiple:!0,searchable:!0,items:["test1","test2"]}}),y=new We({props:{searchable:!0,items:["test1","test2"]}}),B=new We({props:{disabled:!0,searchable:!0,items:["test1","test2"]}});function ge(l){v[1](l)}let he={popup:!1,$$slots:{footer:[dn],header:[vn],default:[mn]},$$scope:{ctx:v}};return v[0]!==void 0&&(he.active=v[0]),x=new en({props:he}),nn.push(()=>fn(x,"active",ge)),{c(){b=e("div"),o=e("label"),o.textContent="EXAMPLE",p=n(),Xt(m.$$.fragment),d=n(),Jt=e("hr"),Kt=n(),_=e("div"),_t=e("label"),_t.textContent="EXAMPLE",Ze=n(),Xt(y.$$.fragment),Qt=n(),Ut=e("hr"),Vt=n(),L=e("div"),Lt=e("label"),Lt.textContent="EXAMPLE",re=n(),Xt(B.$$.fragment),Wt=n(),Yt=e("hr"),Zt=n(),r=e("div"),r.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close"><i class="ri-close-line"></i></div>`,rt=n(),c=e("div"),c.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close"><i class="ri-close-line"></i></div>`,ct=n(),a=e("div"),a.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close"><i class="ri-close-line"></i></div>`,at=n(),h=e("div"),h.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close"><i class="ri-close-line"></i></div>`,ht=n(),g=e("div"),g.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close"><i class="ri-close-line"></i></div>`,gt=n(),li=e("hr"),ti=n(),Ht=e("h1"),Ht.textContent="H1 title",ii=n(),Ct=e("p"),Ct.textContent="Lorem Ipsum dolor sit amet...",si=n(),Mt=e("h2"),Mt.textContent="H2 title",ei=n(),Tt=e("p"),Tt.textContent="Lorem Ipsum dolor sit amet...",ni=n(),yt=e("h3"),yt.textContent="H3 title",fi=n(),Bt=e("p"),Bt.textContent="Lorem Ipsum dolor sit amet...",bi=n(),wt=e("h4"),wt.textContent="H4 title",ui=n(),kt=e("p"),kt.textContent="Lorem Ipsum dolor sit amet...",oi=n(),$t=e("h5"),$t.textContent="H5 title",pi=n(),Ot=e("p"),Ot.textContent="Lorem Ipsum dolor sit amet...",mi=n(),It=e("h6"),It.textContent="H6 title",vi=n(),Et=e("p"),Et.textContent="Lorem Ipsum dolor sit amet...",di=n(),xi=e("hr"),_i=n(),ll=e("div"),ll.innerHTML=`<div class="col-6">COL1</div>
|
||||
<div class="col-6">COL2</div>`,Li=n(),Nt=e("p"),Nt.innerHTML=`Lorem Ipsum is <a href="/">simply dummy</a> text of the printing and typesetting industry. Lorem Ipsum has
|
||||
been the industry's
|
||||
<strong>standard</strong> dummy text ever since the 1500s, when an unknown printer took a galley of type
|
||||
and <em>scrambled</em> it to make a type specimen book. It has survived not only five centuries, but also
|
||||
the leap into electronic typesetting, remaining<sup>1</sup> essentially<sub>2</sub> unchanged.`,Hi=n(),Pt=e("p"),Pt.textContent=`It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and
|
||||
more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum`,Ci=n(),jt=e("ul"),jt.innerHTML=`<li><small>Option 1</small></li>
|
||||
<li>Option 2</li>
|
||||
<li>Option 3</li>`,Mi=n(),At=e("ol"),At.innerHTML=`<li>Option 1</li>
|
||||
<li>Option 2</li>
|
||||
<li>Option 3</li>`,Ti=n(),yi=e("hr"),Bi=n(),tl=e("span"),tl.textContent="Lorem Ipsum",wi=n(),ki=e("hr"),$i=n(),il=e("button"),il.textContent="Button default",Oi=n(),sl=e("button"),sl.textContent="Button danger",Ii=n(),el=e("button"),el.textContent="Button warning",Ei=n(),nl=e("button"),nl.textContent="Button success",Ni=n(),fl=e("button"),fl.textContent="Button info",Pi=n(),bl=e("button"),bl.textContent="Button hint",ji=n(),Ai=e("hr"),Si=n(),ul=e("button"),ul.textContent="Button default",qi=n(),ol=e("button"),ol.textContent="Button danger",Ri=n(),pl=e("button"),pl.textContent="Button danger",Xi=n(),ml=e("button"),ml.textContent="Button success",Di=n(),vl=e("button"),vl.textContent="Button info",zi=n(),dl=e("button"),dl.textContent="Button hint",Fi=n(),Gi=e("hr"),Ji=n(),xl=e("button"),xl.textContent="Button default",Ki=n(),_l=e("button"),_l.textContent="Button danger",Qi=n(),Ll=e("button"),Ll.textContent="Button danger",Ui=n(),Hl=e("button"),Hl.textContent="Button success",Vi=n(),Cl=e("button"),Cl.textContent="Button info",Wi=n(),Ml=e("button"),Ml.textContent="Button hint",Yi=n(),Zi=e("hr"),ri=n(),w=e("button"),w.textContent="Button default",ci=n(),k=e("button"),k.textContent="Button danger",ai=n(),$=e("button"),$.textContent="Button warning",hi=n(),O=e("button"),O.textContent="Button success",gi=n(),I=e("button"),I.textContent="Button info",ls=n(),E=e("button"),E.textContent="Button hint",ts=n(),N=e("button"),N.textContent="Button default",is=n(),P=e("button"),P.textContent="Button danger",ss=n(),j=e("button"),j.textContent="Button danger",es=n(),A=e("button"),A.textContent="Button success",ns=n(),S=e("button"),S.textContent="Button info",fs=n(),q=e("button"),q.textContent="Button hint",bs=n(),us=e("hr"),os=n(),Tl=e("button"),Tl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button default</span>`,ps=n(),yl=e("button"),yl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button danger</span>`,ms=n(),Bl=e("button"),Bl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button warning</span>`,vs=n(),wl=e("button"),wl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button success</span>`,ds=n(),kl=e("button"),kl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button hint</span>`,xs=n(),_s=e("hr"),Ls=n(),$l=e("button"),$l.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button default</span>`,Hs=n(),Ol=e("button"),Ol.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button danger</span>`,Cs=n(),Il=e("button"),Il.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button warning</span>`,Ms=n(),El=e("button"),El.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button success</span>`,Ts=n(),Nl=e("button"),Nl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button hint</span>`,ys=n(),Bs=e("hr"),ws=n(),Pl=e("button"),Pl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button default</span>`,ks=n(),jl=e("button"),jl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button danger</span>`,$s=n(),Al=e("button"),Al.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button warning</span>`,Os=n(),Sl=e("button"),Sl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button success</span>`,Is=n(),ql=e("button"),ql.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button hint</span>`,Es=n(),Ns=e("hr"),Ps=n(),Rl=e("button"),Rl.innerHTML='<i class="ri-mail-line"></i>',js=n(),Xl=e("button"),Xl.innerHTML='<i class="ri-mail-line"></i>',As=n(),Dl=e("button"),Dl.innerHTML='<i class="ri-mail-line"></i>',Ss=n(),zl=e("button"),zl.innerHTML='<i class="ri-mail-line"></i>',qs=n(),Fl=e("button"),Fl.innerHTML='<i class="ri-mail-line"></i>',Rs=n(),Gl=e("button"),Gl.innerHTML='<i class="ri-mail-line"></i>',Xs=n(),Ds=e("hr"),zs=n(),Jl=e("button"),Jl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button Loading</span>`,Fs=n(),Kl=e("button"),Kl.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button Loading</span>`,Gs=n(),Ql=e("button"),Ql.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button Loading</span>`,Js=n(),Ul=e("button"),Ul.innerHTML='<i class="ri-mail-line"></i>',Ks=n(),Vl=e("button"),Vl.innerHTML='<i class="ri-mail-line"></i>',Qs=n(),Wl=e("button"),Wl.innerHTML='<i class="ri-mail-line"></i>',Us=n(),Vs=e("hr"),Ws=n(),R=e("button"),R.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button Loading</span>`,Ys=n(),X=e("button"),X.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button Loading</span>`,Zs=n(),D=e("button"),D.innerHTML=`<i class="ri-mail-line"></i>
|
||||
<span class="txt">Button Loading</span>`,rs=n(),z=e("button"),z.innerHTML='<i class="ri-mail-line"></i>',cs=n(),F=e("button"),F.innerHTML='<i class="ri-mail-line"></i>',as=n(),G=e("button"),G.innerHTML='<i class="ri-mail-line"></i>',hs=n(),gs=e("hr"),le=n(),St=e("input"),te=n(),ie=e("hr"),se=n(),J=e("select"),H=e("option"),H.textContent="Option 1",K=e("option"),K.textContent="Option 2",Q=e("option"),Q.textContent="Option 3",ee=n(),ne=e("hr"),fe=n(),Yl=e("textarea"),be=n(),ue=e("hr"),oe=n(),Zl=e("div"),Zl.innerHTML=`<label for="field_1">Name</label>
|
||||
<input type="text" id="field_1" placeholder="Name 123"/>`,pe=n(),rl=e("div"),rl.innerHTML=`<label for="field_2">Description</label>
|
||||
<textarea id="field_2"></textarea>`,me=n(),C=e("div"),qt=e("label"),qt.textContent="Choose value",ce=n(),U=e("select"),M=e("option"),M.textContent="Option 1",V=e("option"),V.textContent="Option 2",W=e("option"),W.textContent="Option 3",ve=n(),de=e("hr"),xe=n(),cl=e("div"),cl.innerHTML='<input type="text" placeholder="Lorem ipsum dolor sit amet..."/>',_e=n(),al=e("div"),al.innerHTML="<textarea></textarea>",Le=n(),hl=e("div"),gl=e("select"),T=e("option"),T.textContent="Option 1",Y=e("option"),Y.textContent="Option 2",Z=e("option"),Z.textContent="Option 3",He=n(),Ce=e("hr"),Me=n(),lt=e("div"),lt.innerHTML=`<input type="checkbox" id="field_check"/>
|
||||
<label for="field_check">I agree with the <a href="/">terms and conditions</a></label>`,Te=n(),tt=e("div"),tt.innerHTML=`<input type="radio" name="radio_check" id="field_radio1" value="1"/>
|
||||
<label for="field_radio1">Radio 1</label>`,ye=n(),it=e("div"),it.innerHTML=`<input type="radio" name="radio_check" id="field_radio2" value="2"/>
|
||||
<label for="field_radio2">Radio 2</label>`,Be=n(),st=e("div"),st.innerHTML=`<input type="checkbox" id="field_toggle"/>
|
||||
<label for="field_toggle">Toggle check</label>`,we=n(),ke=e("hr"),$e=n(),et=e("div"),et.innerHTML=`<label for="field_error">Name + error</label>
|
||||
<input type="text" id="field_error"/>
|
||||
<div class="help-block help-block-error"><p>Something went wrong</p></div>`,Oe=n(),nt=e("div"),nt.innerHTML=`<label for="field_hint">Name + hint</label>
|
||||
<input type="text" id="field_hint"/>
|
||||
<div class="help-block"><p>Lorem ipsum dolor <a href="/">sit</a> amet</p></div>`,Ie=n(),ft=e("div"),ft.innerHTML=`<input type="checkbox" id="field_check_hint"/>
|
||||
<label for="field_check_hint">Checkbox hint</label>
|
||||
<div class="help-block">Lorem ipsum</div>`,Ee=n(),bt=e("div"),bt.innerHTML=`<input type="checkbox" id="field_check_error"/>
|
||||
<label for="field_check_error">Checkbox error</label>
|
||||
<div class="help-block help-error">Lorem ipsum</div>`,Ne=n(),Pe=e("hr"),je=n(),ut=e("div"),ut.innerHTML=`<input type="checkbox" id="field_check" disabled=""/>
|
||||
<label for="field_check">I agree with the <a href="/">terms and conditions</a></label>`,Ae=n(),ot=e("div"),ot.innerHTML=`<input type="radio" name="radio_check" id="field_radio1" value="1" disabled=""/>
|
||||
<label for="field_radio1">Radio 1</label>`,Se=n(),pt=e("div"),pt.innerHTML=`<input type="radio" name="radio_check" id="field_radio2" value="2" disabled=""/>
|
||||
<label for="field_radio2">Radio 2</label>`,qe=n(),mt=e("div"),mt.innerHTML=`<input type="checkbox" id="field_toggle" disabled=""/>
|
||||
<label for="field_toggle"></label>`,Re=n(),Xe=e("hr"),De=n(),vt=e("div"),vt.innerHTML=`<label for="field_addon1">Name</label>
|
||||
<div class="form-field-addon"><i class="ri-mail-line"></i></div>
|
||||
<input disabled="" type="text" id="field_addon1"/>`,ze=n(),dt=e("div"),dt.innerHTML=`<div class="form-field-addon"><i class="ri-mail-line"></i></div>
|
||||
<input type="text"/>`,Fe=n(),Ge=e("hr"),Je=n(),xt=e("div"),xt.innerHTML=`<div class="form-field"><label for="field_group1">Name</label>
|
||||
<div class="form-field-addon"><div class="btn btn-circle btn-secondary"><i class="ri-mail-line"></i></div></div>
|
||||
<input type="text" id="field_group1"/></div>
|
||||
<div class="form-field"><label for="field_group2">Password</label>
|
||||
<div class="form-field-addon"><i class="ri-mail-line"></i></div>
|
||||
<input type="password" id="field_group2"/></div>`,Ke=n(),Xt(x.$$.fragment),f(o,"for",""),f(b,"class","form-field"),f(_t,"for",""),f(_,"class","form-field"),f(Lt,"for",""),f(L,"class","form-field disabled"),f(r,"class","alert"),f(c,"class","alert alert-info"),f(a,"class","alert alert-danger"),f(h,"class","alert alert-warning"),f(g,"class","alert alert-success"),f(ll,"class","grid"),f(il,"class","btn"),f(sl,"class","btn btn-danger"),f(el,"class","btn btn-warning"),f(nl,"class","btn btn-success"),f(fl,"class","btn btn-info"),f(bl,"class","btn btn-hint"),f(ul,"class","btn btn-secondary"),f(ol,"class","btn btn-secondary btn-danger"),f(pl,"class","btn btn-secondary btn-warning"),f(ml,"class","btn btn-secondary btn-success"),f(vl,"class","btn btn-secondary btn-info"),f(dl,"class","btn btn-secondary btn-hint"),f(xl,"class","btn btn-outline"),f(_l,"class","btn btn-outline btn-danger"),f(Ll,"class","btn btn-outline btn-warning"),f(Hl,"class","btn btn-outline btn-success"),f(Cl,"class","btn btn-outline btn-info"),f(Ml,"class","btn btn-outline btn-hint"),w.disabled=!0,f(w,"class","btn"),k.disabled=!0,f(k,"class","btn btn-danger"),$.disabled=!0,f($,"class","btn btn-warning"),O.disabled=!0,f(O,"class","btn btn-success"),I.disabled=!0,f(I,"class","btn btn-info"),E.disabled=!0,f(E,"class","btn btn-hint"),N.disabled=!0,f(N,"class","btn btn-secondary"),P.disabled=!0,f(P,"class","btn btn-secondary btn-danger"),j.disabled=!0,f(j,"class","btn btn-secondary btn-warning"),A.disabled=!0,f(A,"class","btn btn-secondary btn-success"),S.disabled=!0,f(S,"class","btn btn-secondary btn-info"),q.disabled=!0,f(q,"class","btn btn-secondary btn-hint"),f(Tl,"class","btn"),f(yl,"class","btn btn-danger"),f(Bl,"class","btn btn-warning"),f(wl,"class","btn btn-success"),f(kl,"class","btn btn-hint"),f($l,"class","btn btn-sm"),f(Ol,"class","btn btn-danger btn-sm"),f(Il,"class","btn btn-warning btn-sm"),f(El,"class","btn btn-success btn-sm"),f(Nl,"class","btn btn-hint btn-sm"),f(Pl,"class","btn btn-lg"),f(jl,"class","btn btn-danger btn-lg"),f(Al,"class","btn btn-warning btn-lg"),f(Sl,"class","btn btn-success btn-lg"),f(ql,"class","btn btn-hint btn-lg"),f(Rl,"class","btn btn-circle"),f(Xl,"class","btn btn-sm btn-circle"),f(Dl,"class","btn btn-lg btn-circle"),f(zl,"class","btn btn-secondary btn-circle"),f(Fl,"class","btn btn-secondary btn-sm btn-circle"),f(Gl,"class","btn btn-secondary btn-lg btn-circle"),f(Jl,"class","btn btn-loading"),f(Kl,"class","btn btn-loading btn-primary btn-sm"),f(Ql,"class","btn btn-loading btn-danger btn-lg"),f(Ul,"class","btn btn-loading btn-circle"),f(Vl,"class","btn btn-loading btn-primary btn-sm btn-circle"),f(Wl,"class","btn btn-loading btn-danger btn-lg btn-circle"),R.disabled=!0,f(R,"class","btn btn-loading"),X.disabled=!0,f(X,"class","btn btn-loading btn-primary btn-sm"),D.disabled=!0,f(D,"class","btn btn-loading btn-danger btn-lg"),z.disabled=!0,f(z,"class","btn btn-loading btn-circle"),F.disabled=!0,f(F,"class","btn btn-loading btn-primary btn-sm btn-circle"),G.disabled=!0,f(G,"class","btn btn-loading btn-danger btn-lg btn-circle"),f(St,"type","text"),H.__value="1",H.value=H.__value,H.selected=!0,K.__value="",K.value=K.__value,Q.__value="",Q.value=Q.__value,f(Yl,"cols","30"),f(Yl,"rows","10"),f(Zl,"class","form-field required"),f(rl,"class","form-field required"),f(qt,"for","field_3"),M.__value="1",M.value=M.__value,M.selected=!0,V.__value="",V.value=V.__value,W.__value="",W.value=W.__value,f(U,"id","field_3"),f(C,"class","form-field"),f(cl,"class","form-field"),f(al,"class","form-field"),T.__value="1",T.value=T.__value,T.selected=!0,Y.__value="",Y.value=Y.__value,Z.__value="",Z.value=Z.__value,f(hl,"class","form-field"),f(lt,"class","form-field"),f(tt,"class","form-field"),f(it,"class","form-field"),f(st,"class","form-field form-field-toggle"),f(et,"class","form-field error"),f(nt,"class","form-field"),f(ft,"class","form-field"),f(bt,"class","form-field has-error"),f(ut,"class","form-field disabled"),f(ot,"class","form-field"),f(pt,"class","form-field"),f(mt,"class","form-field form-field-toggle disabled"),f(vt,"class","form-field disabled"),f(dt,"class","form-field"),f(xt,"class","form-group")},m(l,t){i(l,b,t),u(b,o),u(b,p),Dt(m,b,null),i(l,d,t),i(l,Jt,t),i(l,Kt,t),i(l,_,t),u(_,_t),u(_,Ze),Dt(y,_,null),i(l,Qt,t),i(l,Ut,t),i(l,Vt,t),i(l,L,t),u(L,Lt),u(L,re),Dt(B,L,null),i(l,Wt,t),i(l,Yt,t),i(l,Zt,t),i(l,r,t),i(l,rt,t),i(l,c,t),i(l,ct,t),i(l,a,t),i(l,at,t),i(l,h,t),i(l,ht,t),i(l,g,t),i(l,gt,t),i(l,li,t),i(l,ti,t),i(l,Ht,t),i(l,ii,t),i(l,Ct,t),i(l,si,t),i(l,Mt,t),i(l,ei,t),i(l,Tt,t),i(l,ni,t),i(l,yt,t),i(l,fi,t),i(l,Bt,t),i(l,bi,t),i(l,wt,t),i(l,ui,t),i(l,kt,t),i(l,oi,t),i(l,$t,t),i(l,pi,t),i(l,Ot,t),i(l,mi,t),i(l,It,t),i(l,vi,t),i(l,Et,t),i(l,di,t),i(l,xi,t),i(l,_i,t),i(l,ll,t),i(l,Li,t),i(l,Nt,t),i(l,Hi,t),i(l,Pt,t),i(l,Ci,t),i(l,jt,t),i(l,Mi,t),i(l,At,t),i(l,Ti,t),i(l,yi,t),i(l,Bi,t),i(l,tl,t),i(l,wi,t),i(l,ki,t),i(l,$i,t),i(l,il,t),i(l,Oi,t),i(l,sl,t),i(l,Ii,t),i(l,el,t),i(l,Ei,t),i(l,nl,t),i(l,Ni,t),i(lLine truncated
|
||||
+9
-9
@@ -1,12 +1,12 @@
|
||||
import{S as Sa,i as va,s as Ca,e as Aa,g as Ma,h as Da,u as xn,p as Oa,M as Ta,N as Ba,P as Pa,Q as Ra,R as La,H as kn,b as Ea}from"./index.a658f3b6.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 _t(this),r=new _t(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 _t(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=Ia(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 Na(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(hr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Ri(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=Ri(this.text,Ri(i.text,hr(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 Sa,i as va,s as Ca,e as Aa,f as Ma,g as Da,y as xn,o as Oa,G as Ta,H as Ba,I as Ra,P as Pa,J as La,C as kn,K as Ea}from"./index.c63abb6b.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=Ia(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 Na(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(hr(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,hr(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&&o<this.text.length;o++){let l=this.text[o],h=r+l.length;r>e&&o&&(s+=i),e<h&&t>r&&(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<this.children.length;r++){let l=this.children[r],h=o+l.length;if(e<=h&&t>=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<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines<a>>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;r<this.children.length&&o<=t;r++){let l=this.children[r],h=o+l.length;o>e&&r&&(s+=i),e<h&&t>o&&(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 Ia(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Ri(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],h=s+l.length;h>=t&&(h>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=h+1}return e}function hr(n,e,t){return Ri(n,[""],e,t)}class _t{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?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 _t(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!="undefined"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},_t.prototype[Symbol.iterator]=zo.prototype[Symbol.iterator]=qo.prototype[Symbol.iterator]=function(){return this});class Na{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;n<Dt.length;n++)Dt[n]+=Dt[n-1];function Va(n){for(let e=1;e<Dt.length;e+=2)if(Dt[e]>n)return Dt[e-1]<=n;return!1}function ar(n){return n>=127462&&n<=127487}const cr=8205;function Ae(n,e,t=!0,i=!0){return(t?Ko:Fa)(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<n.length;){let s=re(n,e);if(i==cr||s==cr||t&&Va(s))e+=ve(s),i=s;else if(ar(s)){let r=0,o=e-2;for(;o>=0&&ar(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Fa(n,e,t){for(;e>0;){let i=Ko(n,e-2,t);if(i<e)return i;e--}return 0}function Uo(n){return n>=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 Ps(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 Kn=/\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 We{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Un(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s)
Line truncated
|
||||
`}get readOnly(){return this.facet(tl)}phrase(e,...t){for(let i of this.facet(V.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(Xo))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Xa(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let h=Ae(t,o,!1);if(r(t.slice(h,o))!=ce.Word)break;o=h}for(;l<s;){let h=Ae(t,l);if(r(t.slice(l,h))!=ce.Word)break;l=h}return o==l?null:m.range(o+i,l+i)}}V.allowMultipleSelections=Yo;V.tabSize=T.define({combine:n=>n.length?n[0]:4});V.lineSeparator=_o;V.readOnly=tl;V.phrases=T.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});V.languageData=Xo;V.changeFilter=Qo;V.transactionFilter=Zo;V.transactionExtender=el;_e.reconfigure=H.define();function Ht(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class pt{eq(e){return this==e}range(e,t=e){return ni.create(e,t,this)}}pt.prototype.startSide=pt.prototype.endSide=0;pt.prototype.point=!1;pt.prototype.mapMode=me.TrackDel;class ni{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ni(e,t,i)}}function Yn(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Es{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Es(s,r,i,l):null,pos:o}}}class Y{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new Y(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Yn)),this.isEmpty)return t.length?Y.of(t):this;let l=new sl(this,null,-1).goto(0),h=0,a=[],c=new gt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(ni.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?Y.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new Y(i,t,r||Y.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return si.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return si.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),h=dr(o,l,i),a=new qt(o,h,r),c=new qt(l
Line truncated
|
||||
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],h=o+l.length;o>e&&r&&(s+=i),e<h&&t>o&&(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 Ia(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<n.length&&s<=i;r++){let l=n[r],h=s+l.length;h>=t&&(h>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=h+1}return e}function hr(n,e,t){return Pi(n,[""],e,t)}class Zt{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?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!="undefined"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},Zt.prototype[Symbol.iterator]=zo.prototype[Symbol.iterator]=qo.prototype[Symbol.iterator]=function(){return this});class Na{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;n<Dt.length;n++)Dt[n]+=Dt[n-1];function Va(n){for(let e=1;e<Dt.length;e+=2)if(Dt[e]>n)return Dt[e-1]<=n;return!1}function ar(n){return n>=127462&&n<=127487}const cr=8205;function Ae(n,e,t=!0,i=!0){return(t?Ko:Fa)(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<n.length;){let s=re(n,e);if(i==cr||s==cr||t&&Va(s))e+=ve(s),i=s;else if(ar(s)){let r=0,o=e-2;for(;o>=0&&ar(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Fa(n,e,t){for(;e>0;){let i=Ko(n,e-2,t);if(i<e)return i;e--}return 0}function Uo(n){return n>=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 Kn=/\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 We{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Un(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s)
Line truncated
|
||||
`}get readOnly(){return this.facet(tl)}phrase(e,...t){for(let i of this.facet(V.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(Xo))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Xa(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let h=Ae(t,o,!1);if(r(t.slice(h,o))!=ce.Word)break;o=h}for(;l<s;){let h=Ae(t,l);if(r(t.slice(l,h))!=ce.Word)break;l=h}return o==l?null:m.range(o+i,l+i)}}V.allowMultipleSelections=Yo;V.tabSize=T.define({combine:n=>n.length?n[0]:4});V.lineSeparator=_o;V.readOnly=tl;V.phrases=T.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});V.languageData=Xo;V.changeFilter=Qo;V.transactionFilter=Zo;V.transactionExtender=el;_e.reconfigure=H.define();function zt(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class pt{eq(e){return this==e}range(e,t=e){return ri.create(e,t,this)}}pt.prototype.startSide=pt.prototype.endSide=0;pt.prototype.point=!1;pt.prototype.mapMode=me.TrackDel;class ri{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ri(e,t,i)}}function Yn(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Es{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Es(s,r,i,l):null,pos:o}}}class Y{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new Y(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Yn)),this.isEmpty)return t.length?Y.of(t):this;let l=new sl(this,null,-1).goto(0),h=0,a=[],c=new gt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(ri.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?Y.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new Y(i,t,r||Y.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),h=dr(o,l,i),a=new Ut(o,h,r),c=new Ut(l
Line truncated
|
||||
`)}static newName(){let e=yr[mr]||1;return yr[mr]=e+1,Zn+e.toString(36)}static mount(e,t){(e[es]||new _a(e)).mount(Array.isArray(t)?t:[t])}}let bi=null;class _a{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet!="undefined"){if(bi)return e.adoptedStyleSheets=[bi.sheet].concat(e.adoptedStyleSheets),e[es]=bi;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),bi=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[es]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h<o.rules.length;h++)t.insertRule(o.rules[h],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=r}}}var rt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Pt={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},br=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Qa=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),Za=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),wr=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),ec=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tc=br&&(wr||+br[1]<57)||Za&≀for(var oe=0;oe<10;oe++)rt[48+oe]=rt[96+oe]=String(oe);for(var oe=1;oe<=24;oe++)rt[oe+111]="F"+oe;for(var oe=65;oe<=90;oe++)rt[oe]=String.fromCharCode(oe+32),Pt[oe]=String.fromCharCode(oe);for(var vn in rt)Pt.hasOwnProperty(vn)||(Pt[vn]=rt[vn]);function ic(n){var e=tc&&(n.ctrlKey||n.altKey||n.metaKey)||(Qa||ec)&&n.shiftKey&&n.key&&n.key.length==1,t=!e&&n.key||(n.shiftKey?Pt:rt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Hi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Rt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function nc(){let n=document.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function ts(n,e){if(!e.anchorNode)return!1;try{return Rt(n,e.anchorNode)}catch{return!1}}function ri(n){return n.nodeType==3?oi(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Wi(n,e,t,i){return t?xr(n,e,t,i,-1)||xr(n,e,t,i,1):!1}function is(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function xr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:zi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=is(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?zi(n):0}else return!1}}function zi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const rl={left:0,right:0,top:0,bottom:0};function on(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function sc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function rc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=sc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let g=e.bottom-e.top,y=f.bottom-f.top;p=(s=="center"&&g<=y?e.top+g/2-y/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-y+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{if(p){let g=c.scrollTop;c.scrollTop+=p,p=c.scrollTop-g}if(d){let g=c.scrollLeft;c.scrollLeft+=d,d=c.scrollLeft-g}e={left:e.left-d,top:e.top-p,right:e.right-d,bottom:e.bottom-p}}if(u)break;c=c.assignedSlot||c.parentNode,i=s="nearest"}else if(c.nodeType==11)c=c.host;else break}class oc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let vt=null;function ol(n){if(n.setActive)return n.setActive();if(vt)return n.focus(vt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(vt==null?{get preventScroll(){return vt={preventScroll:!0},!0}}:void 0),!vt){vt=!1;for(let t=0;t<e.length;){let iLine truncated
|
||||
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=m.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function Pc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==ce.Space&&(s=o),s==o}}function Rc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return m.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Il(n,{x:f,y:p},!1,r);if(p<h.top||p>h.bottom||(r<0?g<s:g>s))return m.cursor(g,e.assoc,void 0,o)}}function Dn(n,e,t){let i=n.state.facet(Dl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.from<l&&(t=e.from>t.from?m.cursor(o,1):m.cursor(l,-1),s=!0)});if(!s)return t}}class Lc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in ie){let i=ie[t];e.contentDOM.addEventListener(t,s=>{!Vr(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))}),this.registeredEvents.push(t)}M.chrome&&M.chrome_version>=102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!Vr(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Pe(t.state,o)}}return!1}runScrollHandlers(e,t){for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Pe(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(M.android&&M.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return M.ios&&(i=Nl.find(s=>s.keyCode==t.keyCode))&&!(t.ctrlKey||t.altKey||t.metaKey)&&!t.synthetic?(this.pendingIOSKey=i,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Zt(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!M.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Nl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Vl=[16,17,18,20,91,92,224,225];class Ec{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(V.allowMultipleSelections)&&Ic(e,t),this.dragMove=Nc(e,t),this.dragging=Vc(e,t)&&Fs(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.i
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\uFEFF\uFFF9-\uFFFC]`,ws),Of={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bn=null;function Tf(){var n;if(Bn==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Bn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Bn||!1}const Ii=T.define({combine(n){let e=Ht(n,{render:null,specialChars:Df,addSpecialChars:null});return(e.replaceTabs=!Tf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ws)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ws)),e}});function Bf(n={}){return[Ii.of(n),Pf()]}let so=null;function Pf(){return so||(so=ue.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ii)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Mf({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=re(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=ui(o.text,l,i-o.from);return P.replace({widget:new If((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new Ef(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ii);n.startState.facet(Ii)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Rf="\u2022";function Lf(n){return n>=32?Rf:n==10?"\u2424":String.fromCharCode(9216+n)}class Ef extends xt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Lf(this.code),i=e.state.phrase("Control character")+" "+(Of[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class If extends xt{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Nf extends xt{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function ro(n){return ue.fromClass(class{constructor(e){this.view=e,this.placeholder=P.set([P.widget({widget:new Nf(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:e=>e.decorations})}const xs=2e3;function Vf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>xs||t.off>xs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(m.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=Qn(a.text,o,n.tabSize,!0);if(c>-1){let f=Qn(a.text,l,n.tabSize);r.push(m.range(a.from+c,a.from+f))}}}return r}function Ff(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function oo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>xs?-1:s==i.length?Ff(n,e.clientX):ui(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Hf(n,e){let t=oo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=oo(n,s);if(!l)return i;let h=Vf(n.state,t,l);return h.length?o?m.create(h.concat(i.ranges)):m.create(h):i}}:null}function Wf(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Hf(t,i):null)}const Pn="-10000px";class zf{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[]
Line truncated
|
||||
`;this.styleTag.textContent=r}}}var rt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Rt={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},br=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Qa=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),Za=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),wr=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),ec=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tc=br&&(wr||+br[1]<57)||Za&≀for(var oe=0;oe<10;oe++)rt[48+oe]=rt[96+oe]=String(oe);for(var oe=1;oe<=24;oe++)rt[oe+111]="F"+oe;for(var oe=65;oe<=90;oe++)rt[oe]=String.fromCharCode(oe+32),Rt[oe]=String.fromCharCode(oe);for(var vn in rt)Rt.hasOwnProperty(vn)||(Rt[vn]=rt[vn]);function ic(n){var e=tc&&(n.ctrlKey||n.altKey||n.metaKey)||(Qa||ec)&&n.shiftKey&&n.key&&n.key.length==1,t=!e&&n.key||(n.shiftKey?Rt:rt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Hi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Pt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function nc(){let n=document.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function ts(n,e){if(!e.anchorNode)return!1;try{return Pt(n,e.anchorNode)}catch{return!1}}function li(n){return n.nodeType==3?Lt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Wi(n,e,t,i){return t?xr(n,e,t,i,-1)||xr(n,e,t,i,1):!1}function is(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function xr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:zi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=is(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?zi(n):0}else return!1}}function zi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const rl={left:0,right:0,top:0,bottom:0};function on(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function sc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function rc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=sc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let g=e.bottom-e.top,y=f.bottom-f.top;p=(s=="center"&&g<=y?e.top+g/2-y/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-y+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{if(p){let g=c.scrollTop;c.scrollTop+=p,p=c.scrollTop-g}if(d){let g=c.scrollLeft;c.scrollLeft+=d,d=c.scrollLeft-g}e={left:e.left-d,top:e.top-p,right:e.right-d,bottom:e.bottom-p}}if(u)break;c=c.assignedSlot||c.parentNode,i=s="nearest"}else if(c.nodeType==11)c=c.host;else break}class oc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let vt=null;function ol(n){if(n.setActive)return n.setActive();if(vt)return n.focus(vt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(vt==null?{get preventScroll(){return vt={preventScroll:!0},!0}}:void 0),!vt){vt=!1;for(let t=0;t<e.length;){let iLine truncated
|
||||
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=m.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function Pc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==ce.Space&&(s=o),s==o}}function Lc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return m.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Il(n,{x:f,y:p},!1,r);if(p<h.top||p>h.bottom||(r<0?g<s:g>s))return m.cursor(g,e.assoc,void 0,o)}}function Dn(n,e,t){let i=n.state.facet(Dl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.from<l&&(t=e.from>t.from?m.cursor(o,1):m.cursor(l,-1),s=!0)});if(!s)return t}}class Ec{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in ie){let i=ie[t];e.contentDOM.addEventListener(t,s=>{!Vr(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))}),this.registeredEvents.push(t)}M.chrome&&M.chrome_version>=102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!Vr(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Re(t.state,o)}}return!1}runScrollHandlers(e,t){for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Re(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(M.android&&M.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return M.ios&&(i=Nl.find(s=>s.keyCode==t.keyCode))&&!(t.ctrlKey||t.altKey||t.metaKey)&&!t.synthetic?(this.pendingIOSKey=i,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,ti(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!M.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Nl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Vl=[16,17,18,20,91,92,224,225];class Ic{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(V.allowMultipleSelections)&&Nc(e,t),this.dragMove=Vc(e,t),this.dragging=Fc(e,t)&&Fs(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.i
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\uFEFF\uFFF9-\uFFFC]`,ws),Bf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bn=null;function Rf(){var n;if(Bn==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Bn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Bn||!1}const Ii=T.define({combine(n){let e=zt(n,{render:null,specialChars:Tf,addSpecialChars:null});return(e.replaceTabs=!Rf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ws)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ws)),e}});function Pf(n={}){return[Ii.of(n),Lf()]}let so=null;function Lf(){return so||(so=ue.fromClass(class{constructor(n){this.view=n,this.decorations=R.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ii)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Of({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=re(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=ui(o.text,l,i-o.from);return R.replace({widget:new Vf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=R.replace({widget:new Nf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ii);n.startState.facet(Ii)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Ef="\u2022";function If(n){return n>=32?Ef:n==10?"\u2424":String.fromCharCode(9216+n)}class Nf extends xt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=If(this.code),i=e.state.phrase("Control character")+" "+(Bf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Vf extends xt{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Ff extends xt{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function ro(n){return ue.fromClass(class{constructor(e){this.view=e,this.placeholder=R.set([R.widget({widget:new Ff(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?R.none:this.placeholder}},{decorations:e=>e.decorations})}const xs=2e3;function Hf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>xs||t.off>xs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(m.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=Qn(a.text,o,n.tabSize,!0);if(c>-1){let f=Qn(a.text,l,n.tabSize);r.push(m.range(a.from+c,a.from+f))}}}return r}function Wf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function oo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>xs?-1:s==i.length?Wf(n,e.clientX):ui(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function zf(n,e){let t=oo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=oo(n,s);if(!l)return i;let h=Hf(n.state,t,l);return h.length?o?m.create(h.concat(i.ranges)):m.create(h):i}}:null}function qf(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?zf(t,i):null)}const Rn="-10000px";class Kf{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[]
Line truncated
|
||||
`&&(t="");else{let i=t.indexOf(`
|
||||
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new bh(t,e?e.state.tabSize:4,e?bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=xh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=_.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Fu,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new _(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new _(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function xh(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Xs=Object.create(null),ai=[we.none],Fu=new zs(ai),yo=[],kh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])kh[n]=vh(Xs,e);class Sh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),kh)}resolve(e){return e?this.table[e]||(this.table[e]=vh(this.extra,e)):0}}const Hu=new Sh(Xs);function Fn(n,e){yo.indexOf(n)>-1||(yo.push(n),console.warn(e))}function vh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||k[r];o?typeof o=="function"?t?t=o(t):Fn(r,`Modifier ${r} used at start of tag`):t?Fn(r,`Tag ${r} used as modifier`):t=o:Fn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=we.define({id:ai.length,name:i,props:[ru({[i]:t})]});return ai.push(s),s.id}function Wu(n){let e=we.define({id:ai.length,name:"Document",props:[hi.add(()=>n)]});return ai.push(e),e}const zu=n=>{let e=_s(n.state);return e.line?qu(n):e.block?Uu(n):!1};function Ys(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const qu=Ys(Ju,0),Ku=Ys(Ch,0),Uu=Ys((n,e)=>Ch(n,e,Gu(e)),0);function _s(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const jt=50;function ju(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-jt,i),o=n.sliceDoc(s,s+jt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*jt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+jt),f=n.sliceDoc(s-jt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Gu(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Ch(n,e,t=e.selection.ranges){let i=t.map(r=>_s(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>ju(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function Ju(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=_s(e,a).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new sp(this):new np(this)}getCursor(e,t=0,i=e.length){return this.regexp?Mt(this,e,t,i):At(this,e,t,i)}}class la{constructor(e){this.spec=e}}function At(n,e,t,i){return new Ft(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class np extends la{constructor(e){super(e)}nextMatch(e,t,i){let s=At(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=At(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=At(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=At(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=At(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Mt(n,e,t,i){return new na(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class sp extends la{nextMatch(e,t,i){let s=Mt(this.spec,e,i,e.length).next();return s.done&&(s=Mt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Mt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Mt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Mt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const ci=H.define(),tr=H.define(),it=ke.define({create(n){return new zn(Ts(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ci)?n=new zn(t.value.create(),n.panel):t.is(tr)&&(n=new zn(n.query,t.value?ir:null));return n},provide:n=>Gi.from(n,e=>e.panel)});class zn{constructor(e,t){this.query=e,this.panel=t}}const rp=P.mark({class:"cm-searchMatch"}),op=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lp=ue.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(it))}update(n){let e=n.state.field(it);(e!=n.startState.field(it)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return P.none;let{view:t}=this,i=new gt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state.doc,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?op:rp)})}return i.finish()}},{decorations:n=>n.decorations});function pi(n){return e=>{let t=e.state.field(it,!1);return t&&t.query.spec.valid?n(e,t):ha(e)}}const en=pi((n,{query:e})=>{let{from:t,to:i}=n.state.selection.main,s=e.nextMatch(n.state.doc,t,i);return!s||s.from==t&&s.to==i?!1:(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:nr(n,s),userEvent:"select.search"}),!0)}),tn=pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main,r=e.prevMatch(t.doc,i,s);return r?(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:nr(n,r),userEvent:"select.search"}),!0):!1}),hp=pi((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),ap=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Ft(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select.search.matches"})),!0},Ro=pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t.doc,i,i);if(!r)return!1;let o=[],l,h,a=[];if(r.from==i&&r.to==s&&(h=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:h}),r=e.nextMatch(t.doc,r.from,r.to),a.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-h.length;l={anchor:r.from-c,head:r.to-c},a.push(nr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:a,userEvent:"input.replace"}),!0}),cp=pi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;re
Line truncated
|
||||
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new bh(t,e?e.state.tabSize:4,e?bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=xh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=_.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Wu,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new _(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new _(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function xh(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Xs=Object.create(null),ci=[we.none],Wu=new zs(ci),yo=[],kh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])kh[n]=vh(Xs,e);class Sh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),kh)}resolve(e){return e?this.table[e]||(this.table[e]=vh(this.extra,e)):0}}const zu=new Sh(Xs);function Fn(n,e){yo.indexOf(n)>-1||(yo.push(n),console.warn(e))}function vh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||k[r];o?typeof o=="function"?t?t=o(t):Fn(r,`Modifier ${r} used at start of tag`):t?Fn(r,`Tag ${r} used as modifier`):t=o:Fn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=we.define({id:ci.length,name:i,props:[lu({[i]:t})]});return ci.push(s),s.id}function qu(n){let e=we.define({id:ci.length,name:"Document",props:[ai.add(()=>n)]});return ci.push(e),e}const Ku=n=>{let e=_s(n.state);return e.line?Uu(n):e.block?Gu(n):!1};function Ys(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Uu=Ys(Xu,0),ju=Ys(Ch,0),Gu=Ys((n,e)=>Ch(n,e,$u(e)),0);function _s(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Jt=50;function Ju(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Jt,i),o=n.sliceDoc(s,s+Jt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*Jt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Jt),f=n.sliceDoc(s-Jt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function $u(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Ch(n,e,t=e.selection.ranges){let i=t.map(r=>_s(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Ju(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function Xu(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=_s(e,a).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new op(this):new rp(this)}getCursor(e,t=0,i=e.length){return this.regexp?Mt(this,e,t,i):At(this,e,t,i)}}class la{constructor(e){this.spec=e}}function At(n,e,t,i){return new Ht(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class rp extends la{constructor(e){super(e)}nextMatch(e,t,i){let s=At(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=At(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=At(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=At(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=At(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Mt(n,e,t,i){return new na(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class op extends la{nextMatch(e,t,i){let s=Mt(this.spec,e,i,e.length).next();return s.done&&(s=Mt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Mt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Mt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Mt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const fi=H.define(),tr=H.define(),it=ke.define({create(n){return new zn(Ts(n).create(),null)},update(n,e){for(let t of e.effects)t.is(fi)?n=new zn(t.value.create(),n.panel):t.is(tr)&&(n=new zn(n.query,t.value?ir:null));return n},provide:n=>Gi.from(n,e=>e.panel)});class zn{constructor(e,t){this.query=e,this.panel=t}}const lp=R.mark({class:"cm-searchMatch"}),hp=R.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ap=ue.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(it))}update(n){let e=n.state.field(it);(e!=n.startState.field(it)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return R.none;let{view:t}=this,i=new gt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state.doc,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?hp:lp)})}return i.finish()}},{decorations:n=>n.decorations});function pi(n){return e=>{let t=e.state.field(it,!1);return t&&t.query.spec.valid?n(e,t):ha(e)}}const en=pi((n,{query:e})=>{let{from:t,to:i}=n.state.selection.main,s=e.nextMatch(n.state.doc,t,i);return!s||s.from==t&&s.to==i?!1:(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:nr(n,s),userEvent:"select.search"}),!0)}),tn=pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main,r=e.prevMatch(t.doc,i,s);return r?(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:nr(n,r),userEvent:"select.search"}),!0):!1}),cp=pi((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),fp=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Ht(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select.search.matches"})),!0},Po=pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t.doc,i,i);if(!r)return!1;let o=[],l,h,a=[];if(r.from==i&&r.to==s&&(h=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:h}),r=e.nextMatch(t.doc,r.from,r.to),a.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-h.length;l={anchor:r.from-c,head:r.to-c},a.push(nr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:a,userEvent:"input.replace"}),!0}),up=pi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;re
Line truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{S as t,i as n,s as o,K as a}from"./index.a658f3b6.js";function l(e){return a("/collections"),[]}class c extends t{constructor(s){super(),n(this,s,l,null,o,{})}}export{c as default};
|
||||
@@ -1,2 +0,0 @@
|
||||
import{S as I,i as K,s as L,F as W,f as F,m as H,n as B,o as J,q as N,H as M,D as q,e as c,g as u,h as b,j as _,E as O,p as w,z,d as k,A as D,B as T,C as Q,k as U,v as V,I as X,y as E,J as Y,K as Z,G as S}from"./index.a658f3b6.js";function G(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&&O(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=T(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=T(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,A,h,m=f[3]&&G(f);return r=new z({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new z({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(),F(r.$$.fragment),p=k(),F(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],D(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),H(r,e,null),_(e,p),H(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,C,$),_(C,v),P=!0,A||(h=[T(e,"submit",Q(f[4])),U(V.call(null,v))],A=!0)},p(a,$){a[3]?m?m.p(a,$):(m=G(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const j={};$&769&&(j.$$scope={dirty:$,ctx:a}),r.$set(j);const y={};$&770&&(y.$$scope={dirty:$,ctx:a}),d.$set(y),(!P||$&4)&&(i.disabled=a[2]),$&4&&D(i,"btn-loading",a[2])},i(a){P||(B(r.$$.fragment,a),B(d.$$.fragment,a),P=!0)},o(a){J(r.$$.fragment,a),J(d.$$.fragment,a),P=!1},d(a){a&&w(e),m&&m.d(),N(r),N(d),a&&w(R),a&&w(C),A=!1,X(h)}}}function se(f){let e,o;return e=new W({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){F(e.$$.fragment)},m(s,l){H(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(B(e.$$.fragment,s),o=!0)},o(s){J(e.$$.fragment,s),o=!1},d(s){N(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 E.Admins.confirmPasswordReset(l==null?void 0:l.token,t,r),Y("Successfully set a new admin password."),Z("/")}catch(g){E.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 I{constructor(e){super(),K(this,e,le,se,L,{params:5})}}export{ae as default};
|
||||
@@ -0,0 +1,2 @@
|
||||
import{S as E,i as G,s as I,F as K,c as F,m as B,t as H,a as N,d as T,C as M,w as q,e as c,f as u,g as b,h as _,x as O,o as w,q as J,b as k,r as L,u as h,v as Q,j as U,l as V,A as X,p as W,B as Y,D as Z,z as S}from"./index.c63abb6b.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&&O(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,A,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(),F(r.$$.fragment),p=k(),F(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,A||(j=[h(e,"submit",Q(f[4])),U(V.call(null,v))],A=!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),A=!1,X(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){F(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),Y("Successfully set a new admin password."),Z("/")}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};
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
import{S,i as B,s as M,F as T,f as A,m as E,n as w,o as y,q as H,d as g,e as _,g as p,h as k,j as d,k as j,v as z,w as D,x as G,p as v,y as C,z as N,A as F,B as L,C as I,D as h,E as J,u as P,G as R}from"./index.a658f3b6.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new N({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=`<h4 class="m-b-xs">Forgotten admin password</h4>
|
||||
<p>Enter the email associated with your account and we\u2019ll send you a recovery link:</p>`,n=g(),A(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),E(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=L(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),H(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='<i class="ri-checkbox-circle-line"></i>',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=L(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=j(z.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),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 T({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){A(e.$$.fragment)},m(n,l){E(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){H(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 S{constructor(e){super(),B(this,e,W,V,M,{})}}export{Y as default};
|
||||
import{S as E,i as M,s as T,F as j,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 z,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as A,v as I,w as h,x as J,y as P,z as R}from"./index.c63abb6b.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=`<h4 class="m-b-xs">Forgotten admin password</h4>
|
||||
<p>Enter the email associated with your account and we\u2019ll send you a recovery link:</p>`,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=A(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='<i class="ri-checkbox-circle-line"></i>',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=A(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=z(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 j({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 E{constructor(e){super(),M(this,e,W,V,T,{})}}export{Y as default};
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import{S as z,i as A,s as B,F as D,f as S,m as U,n as $,o as v,q as j,H as G,L as J,h as _,w as M,x as N,p as b,y as P,D as y,e as m,g as d,j as g,E as R,z as W,d as C,A as F,B as E,C as Y,u as h,G as L}from"./index.a658f3b6.js";function I(r){let e,s,t,l,n,o,c,a,i,u,k,q,p=r[3]&&T(r);return o=new W({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],F(a,"btn-loading",r[1])},m(f,w){_(f,e,w),g(e,s),g(s,t),g(t,l),p&&p.m(t,null),g(e,n),U(o,e,null),g(e,c),g(e,a),g(a,i),u=!0,k||(q=E(e,"submit",Y(r[4])),k=!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 H={};w&769&&(H.$$scope={dirty:w,ctx:f}),o.$set(H),(!u||w&2)&&(a.disabled=f[1]),w&2&&F(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),k=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
import{S as J,i as M,s as N,F as R,c as S,m as U,t as $,a as v,d as z,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,w as y,e as m,f as d,h as k,x as B,q as D,b as C,r as H,u as E,v as G,y as h,z as T}from"./index.c63abb6b.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 D({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),U(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||(q=E(e,"submit",G(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(),z(o),g=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Email address changed</p>
|
||||
<p>You can now sign in with your new email address.</p></div>`,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),g(s,t)},p(l,n){n&8&&R(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),g(e,s),_(i,l,u),_(i,n,u),L(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]&&L(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=J()},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):(M(),v(o[u],1,1,()=>{o[u]=null}),N(),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 D({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(t,l){U(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 P.Users.confirmEmailChange(l==null?void 0:l.token,n),s(2,c=!0)}catch(k){P.errorResponseHandler(k)}s(1,o=!1)}}const i=()=>window.close();function u(){n=this.value,s(0,n)}return r.$$set=k=>{"params"in k&&s(5,l=k.params)},r.$$.update=()=>{r.$$.dirty&32&&s(3,t=G.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,t,a,l,i,u]}class x extends z{constructor(e){super(),A(this,e,X,V,B,{params:5})}}export{x as default};
|
||||
<p>You can now sign in with your new email address.</p></div>`,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&&B(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 R({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(t,l){U(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){z(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 J{constructor(e){super(),M(this,e,X,V,N,{params:5})}}export{x as default};
|
||||
@@ -1,4 +0,0 @@
|
||||
import{S as D,i as E,s as G,F as J,f as F,m as L,n as P,o as q,q as N,H as M,L as W,h as _,w as Y,x as I,p as m,y as j,D as y,e as b,j as w,E as K,z,d as C,g as c,A,B as R,C as O,u as h,G as H}from"./index.a658f3b6.js";function Q(r){let e,l,t,n,s,o,p,a,i,u,v,g,k,S,d=r[4]&&B(r);return o=new z({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),a=new z({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{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(a.$$.fragment),i=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=r[2],A(u,"btn-loading",r[2])},m(f,$){_(f,e,$),w(e,l),w(l,t),w(t,n),d&&d.m(t,null),w(e,s),L(o,e,null),w(e,p),L(a,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(S=R(e,"submit",O(r[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=B(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 U={};$&3074&&(U.$$scope={dirty:$,ctx:f}),a.$set(U),(!g||$&4)&&(u.disabled=f[2]),$&4&&A(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(),N(o),N(a),k=!1,S()}}}function V(r){let e,l,t,n,s;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Password changed</p>
|
||||
<p>You can now sign in with your new password.</p></div>`,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",r[7]),n=!0)},p:h,i:h,o:h,d(o){o&&m(e),o&&m(l),o&&m(t),n=!1,s()}}}function B(r){let e,l,t;return{c(){e=y("for "),l=b("strong"),t=y(r[4])},m(n,s){_(n,e,s),_(n,l,s),w(l,t)},p(n,s){s&16&&K(t,n[4])},d(n){n&&m(e),n&&m(l)}}}function X(r){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=r[10]),c(s,"type","password"),c(s,"id",o=r[10]),s.required=!0,s.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,s,u),H(s,r[0]),s.focus(),p||(a=R(s,"input",r[8]),p=!0)},p(i,u){u&1024&&t!==(t=i[10])&&c(e,"for",t),u&1024&&o!==(o=i[10])&&c(s,"id",o),u&1&&s.value!==i[0]&&H(s,i[0])},d(i){i&&m(e),i&&m(n),i&&m(s),p=!1,a()}}}function Z(r){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=r[10]),c(s,"type","password"),c(s,"id",o=r[10]),s.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,s,u),H(s,r[1]),p||(a=R(s,"input",r[9]),p=!0)},p(i,u){u&1024&&t!==(t=i[10])&&c(e,"for",t),u&1024&&o!==(o=i[10])&&c(s,"id",o),u&2&&s.value!==i[1]&&H(s,i[1])},d(i){i&&m(e),i&&m(n),i&&m(s),p=!1,a()}}}function x(r){let e,l,t,n;const s=[V,Q],o=[];function p(a,i){return a[3]?0:1}return e=p(r),l=o[e]=s[e](r),{c(){l.c(),t=W()},m(a,i){o[e].m(a,i),_(a,t,i),n=!0},p(a,i){let u=e;e=p(a),e===u?o[e].p(a,i):(Y(),q(o[u],1,1,()=>{o[u]=null}),I(),l=o[e],l?l.p(a,i):(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(r){let e,l;return e=new J({props:{nobranding:!0,$$slots:{default:[x]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment)},m(t,n){L(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(r,e,l){let t,{params:n}=e,s="",o="",p=!1,a=!1;async function i(){if(!p){l(2,p=!0);try{await j.Users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,a=!0)}catch(k){j.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 r.$$set=k=>{"params"in k&&l(6,n=k.params)},r.$$.update=()=>{r.$$.dirty&64&&l(4,t=M.getJWTPayload(n==null?void 0:n.token).email||"")},[s,o,p,a,t,i,n,u,v,g]}class le extends D{constructor(e){super(),E(this,e,te,ee,G,{params:6})}}export{le as default};
|
||||
@@ -0,0 +1,4 @@
|
||||
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 z,w as y,e as b,h as w,x as K,q as E,b as C,f as c,r as J,u as h,v as O,y as F,z as R}from"./index.c63abb6b.js";function Q(i){let e,l,t,n,s,o,p,a,r,u,v,g,k,L,d=i[4]&&M(i);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),a=new E({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],J(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",O(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=M(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 U={};$&3074&&(U.$$scope={dirty:$,ctx:f}),a.$set(U),(!g||$&4)&&(u.disabled=f[2]),$&4&&J(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=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Password changed</p>
|
||||
<p>You can now sign in with your new password.</p></div>`,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 M(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&&K(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 z.Users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,a=!0)}catch(k){z.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};
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
import{S as k,i as v,s as y,F as w,f as x,m as C,n as g,o as L,q as $,y as H,L as M,h as r,p as a,e as u,d as m,g as f,B as _,u as p}from"./index.a658f3b6.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
|
||||
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.c63abb6b.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
|
||||
<div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,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=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Successfully verified email address.</p></div>`,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='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function q(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 F(o){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[q]},$$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){L(t.$$.fragment,e),s=!1},d(e){$(t,e)}}}function U(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 B extends k{constructor(t){super(),v(this,t,U,F,y,{params:2})}}export{B as default};
|
||||
<div class="content txt-bold"><p>Successfully verified email address.</p></div>`,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='<div class="loader loader-lg"><em>Please wait...</em></div>',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 U(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 V(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 E extends k{constructor(t){super(),v(this,t,V,U,y,{params:2})}}export{E as default};
|
||||
Vendored
-363
@@ -1,363 +0,0 @@
|
||||
const I1=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerpolicy&&(r.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?r.credentials="include":o.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(o){if(o.ep)return;o.ep=!0;const r=t(o);fetch(o.href,r)}};I1();function le(){}const Vr=n=>n;function ut(n,e){for(const t in e)n[t]=e[t];return n}function Ib(n){return n()}function bc(){return Object.create(null)}function rt(n){n.forEach(Ib)}function Yn(n){return typeof n=="function"}function Ee(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let rl;function Qn(n,e){return rl||(rl=document.createElement("a")),rl.href=e,n===rl.href}function R1(n){return Object.keys(n).length===0}function Rb(n,...e){if(n==null)return le;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function pn(n,e,t){n.$$.on_destroy.push(Rb(e,t))}function $n(n,e,t,i){if(n){const o=Nb(n,e,t,i);return n[0](o)}}function Nb(n,e,t,i){return n[1]&&i?ut(t.ctx.slice(),n[1](i(e))):t.ctx}function An(n,e,t,i){if(n[2]&&i){const o=n[2](i(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const r=[],l=Math.max(e.dirty.length,o.length);for(let s=0;s<l;s+=1)r[s]=e.dirty[s]|o[s];return r}return e.dirty|o}return e.dirty}function Dn(n,e,t,i,o,r){if(o){const l=Nb(e,t,i,r);n.p(l,o)}}function On(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function ui(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Wt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function gc(n){return n==null?"":n}function jb(n,e,t){return n.set(t),e}function Xe(n){return n&&Yn(n.destroy)?n.destroy:le}const zb=typeof window!="undefined";let vs=zb?()=>window.performance.now():()=>Date.now(),gf=zb?n=>requestAnimationFrame(n):le;const Lo=new Set;function Hb(n){Lo.forEach(e=>{e.c(n)||(Lo.delete(e),e.f())}),Lo.size!==0&&gf(Hb)}function ys(n){let e;return Lo.size===0&&gf(Hb),{promise:new Promise(t=>{Lo.add(e={c:n,f:t})}),abort(){Lo.delete(e)}}}function m(n,e){n.appendChild(e)}function qb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function N1(n){const e=g("style");return j1(qb(n),e),e.sheet}function j1(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function qn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function g(n){return document.createElement(n)}function j(n){return document.createTextNode(n)}function $(){return j(" ")}function lt(){return j("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Gt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Vn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Vb(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 ci(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 z1(n){return Array.from(n.childNodes)}function ge(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function _c(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ne(n,e,t){n.classList[t?"add":"remove"](e)}function Bb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(n,t,i,e),o}const Kl=new Map;let Jl=0;function H1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function q1(n,e){const t={stylesheet:N1(e),rules:{}};return Kl.set(n,t),t}function Er(n,e,t,i,o,r,l,s=0){const a=16.666/i;let f=`{
|
||||
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*r(_);f+=_*100+`%{${l(y,1-y)}}
|
||||
`}const c=f+`100% {${l(t,1-t)}}
|
||||
}`,u=`__svelte_${H1(c)}_${s}`,d=qb(n),{stylesheet:h,rules:b}=Kl.get(d)||q1(d,n);b[u]||(b[u]=!0,h.insertRule(`@keyframes ${u} ${c}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${u} ${i}ms linear ${o}ms 1 both`,Jl+=1,u}function Pr(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),o=t.length-i.length;o&&(n.style.animation=i.join(", "),Jl-=o,Jl||V1())}function V1(){gf(()=>{Jl||(Kl.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),Kl.clear())})}function B1(n,e,t,i){if(!e)return le;const o=n.getBoundingClientRect();if(e.left===o.left&&e.right===o.right&&e.top===o.top&&e.bottom===o.bottom)return le;const{delay:r=0,duration:l=300,easing:s=Vr,start:a=vs()+r,end:f=a+l,tick:c=le,css:u}=t(n,{from:e,to:o},i);let d=!0,h=!1,b;function v(){u&&(b=Er(n,0,1,l,r,s,u)),r||(h=!0)}function _(){u&&Pr(n,b),d=!1}return ys(y=>{if(!h&&y>=a&&(h=!0),h&&y>=f&&(c(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*s(S/l);c(C,1-C)}return!0}),v(),c(0,1),_}function U1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,o=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Ub(n,o)}}function Ub(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),o=i.transform==="none"?"":i.transform;n.style.transform=`${o} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Fr;function wr(n){Fr=n}function ks(){if(!Fr)throw new Error("Function called outside component initialization");return Fr}function di(n){ks().$$.on_mount.push(n)}function W1(n){ks().$$.after_update.push(n)}function Y1(n){ks().$$.on_destroy.push(n)}function yn(){const n=ks();return(e,t,{cancelable:i=!1}={})=>{const o=n.$$.callbacks[e];if(o){const r=Bb(e,t,{cancelable:i});return o.slice().forEach(l=>{l.call(n,r)}),!r.defaultPrevented}return!0}}function ft(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const br=[],he=[],Rl=[],Da=[],Wb=Promise.resolve();let Oa=!1;function Yb(){Oa||(Oa=!0,Wb.then(Gb))}function Bi(){return Yb(),Wb}function Dt(n){Rl.push(n)}function Re(n){Da.push(n)}const Is=new Set;let ll=0;function Gb(){const n=Fr;do{for(;ll<br.length;){const e=br[ll];ll++,wr(e),G1(e.$$)}for(wr(null),br.length=0,ll=0;he.length;)he.pop()();for(let e=0;e<Rl.length;e+=1){const t=Rl[e];Is.has(t)||(Is.add(t),t())}Rl.length=0}while(br.length);for(;Da.length;)Da.pop()();Oa=!1,Is.clear(),wr(n)}function G1(n){if(n.fragment!==null){n.update(),rt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let tr;function _f(){return tr||(tr=Promise.resolve(),tr.then(()=>{tr=null})),tr}function fo(n,e,t){n.dispatchEvent(Bb(`${e?"intro":"outro"}${t}`))}const Nl=new Set;let si;function Ae(){si={r:0,c:[],p:si}}function De(){si.r||rt(si.c),si=si.p}function T(n,e){n&&n.i&&(Nl.delete(n),n.i(e))}function F(n,e,t,i){if(n&&n.o){if(Nl.has(n))return;Nl.add(n),si.c.push(()=>{Nl.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}}const vf={duration:0};function yf(n,e,t){let i=e(n,t),o=!1,r,l,s=0;function a(){r&&Pr(n,r)}function f(){const{delay:u=0,duration:d=300,easing:h=Vr,tick:b=le,css:v}=i||vf;v&&(r=Er(n,0,1,d,u,h,v,s++)),b(0,1);const _=vs()+u,y=_+d;l&&l.abort(),o=!0,Dt(()=>fo(n,!0,"start")),l=ys(S=>{if(o){if(S>=y)return b(1,0),fo(n,!0,"end"),a(),o=!1;if(S>=_){const C=h((S-_)/d);b(C,1-C)}}return o})}let c=!1;return{start(){c||(c=!0,Pr(n),Yn(i)?(i=i(),_f().then(f)):f())},invalidate(){c=!1},end(){o&&(a(),o=!1)}}}function Kb(n,e,t){let i=e(n,t),o=!0,r;const l=si;l.r+=1;function s(){const{delay:a=0,duration:f=300,easing:c=Vr,tick:u=le,css:d}=i||vf;d&&(r=Er(n,1,0,f,a,c,d));const h=vs()+a,b=h+f;Dt(()=>fo(n,!1,"start")),ys(v=>{if(o){if(v>=b)return u(0,1),fo(n,!1,"end"),--l.r||rt(l.c),!1;if(v>=h){const _=c((v-h)/f);u(1-_,_)}}return o})}return Yn(i)?_f().then(()=>{i=i(),s()}):s(),{end(a){a&&i.tick&&i.tick(1,0),o&&(r&&Pr(n,r),o=!1)}}}function ct(n,e,t,i){let o=e(n,t),r=i?0:1,l=null,s=null,a=null;function f(){a&&Pr(n,a)}function c(d,h){const b=d.b-r;return h*=Math.abs(b),{a:r,b:d.b,d:b,duration:h,start:d.start,end:d.start+h,group:d.group}}function u(d){const{delay:h=0,duration:b=300,easing:v=Vr,tick:_=le,css:y}=o||vf,S={start:vs()+h,b:d};d||(S.group=si,si.r+=1),l||s?s=S:(y&&(f(),a=Er(n,r,d,b,h,v,y)),d&&_(0,1),l=c(S,b),Dt(()=>fo(n,d,"start")),ys(C=>{if(s&&C>s.start&&(l=c(s,b),s=null,fo(n,l.b,"start"),y&&(f(),a=Er(n,r,l.b,l.duration,0,v,o.css))),l){if(C>=l.end)_(r=l.b,1-r),fo(n,l.b,"end"),s||(l.b?f():--l.group.r||rt(l.group.c)),l=null;else if(C>=l.start){const x=C-l.start;r=l.a+l.d*v(x/l.duration),_(r,1-r)}}return!!(l||s)}))}return{run(d){Yn(o)?_f().then(()=>{o=o(),u(d)}):u(d)},end(){f(),l=s=null}}}function an(n,e){n.d(1),e.delete(n.key)}function Pt(n,e){F(n,1,1,()=>{e.delete(n.key)})}function K1(n,e){n.f(),Pt(n,e)}function st(n,e,t,i,o,r,l,s,a,f,c,u){let d=n.length,h=r.length,b=
Line truncated
|
||||
`),function(r){if(i=r.indexOf(":"),e=js.trim(r.substr(0,i)).toLowerCase(),t=js.trim(r.substr(i+1)),e){if(o[e]&&m_.indexOf(e)>=0)return;o[e]=e==="set-cookie"?(o[e]?o[e]:[]).concat([t]):o[e]?o[e]+", "+t:t}}),o},w_=b_,zs=og,S_=function(n){return new Promise(function(e,t){var i=n.data,o=n.headers,r=n.responseType;fl.isFormData(i)&&delete o["Content-Type"];var l=new XMLHttpRequest;if(n.auth){var s=n.auth.username||"",a=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+a)}var f=y_(n.baseURL,n.url);function c(){if(l){var d="getAllResponseHeaders"in l?k_(l.getAllResponseHeaders()):null,h={data:r&&r!=="text"&&r!=="json"?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:d,config:n,request:l};g_(e,t,h),l=null}}if(l.open(n.method.toUpperCase(),v_(f,n.params,n.paramsSerializer),!0),l.timeout=n.timeout,"onloadend"in l?l.onloadend=c:l.onreadystatechange=function(){l&&l.readyState===4&&(l.status!==0||l.responseURL&&l.responseURL.indexOf("file:")===0)&&setTimeout(c)},l.onabort=function(){l&&(t(zs("Request aborted",n,"ECONNABORTED",l)),l=null)},l.onerror=function(){t(zs("Network Error",n,null,l)),l=null},l.ontimeout=function(){var d="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(d=n.timeoutErrorMessage),t(zs(d,n,n.transitional&&n.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},fl.isStandardBrowserEnv()){var u=(n.withCredentials||w_(f))&&n.xsrfCookieName?__.read(n.xsrfCookieName):void 0;u&&(o[n.xsrfHeaderName]=u)}"setRequestHeader"in l&&fl.forEach(o,function(d,h){i===void 0&&h.toLowerCase()==="content-type"?delete o[h]:l.setRequestHeader(h,d)}),fl.isUndefined(n.withCredentials)||(l.withCredentials=!!n.withCredentials),r&&r!=="json"&&(l.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&l.addEventListener("progress",n.onDownloadProgress),typeof n.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then(function(d){l&&(l.abort(),t(d),l=null)}),i||(i=null),l.send(i)})},Qt=Pn,Dc=function(n,e){f_.forEach(n,function(t,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[i])})},C_=ig,x_={"Content-Type":"application/x-www-form-urlencoded"};function Oc(n,e){!Qt.isUndefined(n)&&Qt.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var Tc,Hl={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(Tc=S_),Tc),transformRequest:[function(n,e){return Dc(e,"Accept"),Dc(e,"Content-Type"),Qt.isFormData(n)||Qt.isArrayBuffer(n)||Qt.isBuffer(n)||Qt.isStream(n)||Qt.isFile(n)||Qt.isBlob(n)?n:Qt.isArrayBufferView(n)?n.buffer:Qt.isURLSearchParams(n)?(Oc(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Qt.isObject(n)||e&&e["Content-Type"]==="application/json"?(Oc(e,"application/json"),function(t,i,o){if(Qt.isString(t))try{return(i||JSON.parse)(t),Qt.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}(n)):n}],transformResponse:[function(n){var e=this.transitional,t=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,o=!t&&this.responseType==="json";if(o||i&&Qt.isString(n)&&n.length)try{return JSON.parse(n)}catch(r){if(o)throw r.name==="SyntaxError"?C_(r,this,"E_JSON_PARSE"):r}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};Hl.headers={common:{Accept:"application/json, text/plain, */*"}},Qt.forEach(["delete","get","head"],function(n){Hl.headers[n]={}}),Qt.forEach(["post","put","patch"],function(n){Hl.headers[n]=Qt.merge(x_)});var kf=Hl,M_=Pn,$_=kf,rg=function(n){return!(!n||!n.__CANCEL__)},Ec=Pn,Hs=function(n,e,t){var i=this||$_;return M_.forEach(t,function(o){n=o.call(i,n,e)}),n},A_=rg,D_=kf;function qs(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var on=Pn,lg=function(n,e){e=e||{};var t={},i=["url","method","data"],o=["headers","auth","proxy","params"],r=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],l=["validateStatus"];function s(u,d){return on.isPlainObject(u)&&on.isPlainObject(d)?on.merge(u,d):on.isPlainObject(d)?on.merge({},d):on.isArray(d)?d.slice():d}function a(u){on.isUndefined(e[u])?on.isUndefined(n[u])||(t[u]=s(void 0,n[u])):t[u]=s(n[u],e[u])}on.forEach(i,function(u){on.isUndefined(e[u])||(t[u]=s(void 0,e[u]))}),on.forEach(o,a),on.forEach(r,function(u){on.isUndefined(e[u])?on.isUndefined(n[u])||(t[u]=s(void 0,n[u])):t[u]=s(void 0,e[u])}),on.forEach(l,function(u){u in e?t[u]=s(n[u],e[u]):
Line truncated
|
||||
`+e.prev+e.base;return t+ri.call(n,","+t)+`
|
||||
`+e.prev}function pl(n,e){var t=Ia(n),i=[];if(t){i.length=n.length;for(var o=0;o<n.length;o++)i[o]=Ei(n,o)?e(n[o],n):""}var r,l=typeof Js=="function"?Js(n):[];if(Vo){r={};for(var s=0;s<l.length;s++)r["$"+l[s]]=l[s]}for(var a in n)Ei(n,a)&&(t&&String(Number(a))===a&&a<n.length||Vo&&r["$"+a]instanceof Symbol||(bg.call(/[^\w$]/,a)?i.push(e(a,n)+": "+e(n[a],n)):i.push(a+": "+e(n[a],n))));if(typeof Js=="function")for(var f=0;f<l.length;f++)gg.call(n,l[f])&&i.push("["+e(l[f])+"]: "+e(n[l[f]],n));return i}var kg,Af=Cf,Ko=function(n,e){var t=hg(n,!!e);return typeof t=="function"&&Q_(n,".prototype.")>-1?mg(t):t},dv=function n(e,t,i,o){var r=t||{};if(Ei(r,"quoteStyle")&&r.quoteStyle!=="single"&&r.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ei(r,"maxStringLength")&&(typeof r.maxStringLength=="number"?r.maxStringLength<0&&r.maxStringLength!==1/0:r.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!Ei(r,"customInspect")||r.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ei(r,"indent")&&r.indent!==null&&r.indent!==" "&&!(parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ei(r,"numericSeparator")&&typeof r.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=r.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return yg(e,r);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return s?Wc(e,a):a}if(typeof e=="bigint"){var f=String(e)+"n";return s?Wc(e,f):f}var c=r.depth===void 0?5:r.depth;if(i===void 0&&(i=0),i>=c&&c>0&&typeof e=="object")return Ia(e)?"[Array]":"[Object]";var u=function(R,G){var U;if(R.indent===" ")U=" ";else{if(!(typeof R.indent=="number"&&R.indent>0))return null;U=ri.call(Array(R.indent+1)," ")}return{base:U,prev:ri.call(Array(G+1),U)}}(r,i);if(o===void 0)o=[];else if(Jc(o,e)>=0)return"[Circular]";function d(R,G,U){if(G&&(o=av.call(o)).push(G),U){var z={depth:r.depth};return Ei(r,"quoteStyle")&&(z.quoteStyle=r.quoteStyle),n(R,z,i+1,o)}return n(R,r,i+1,o)}if(typeof e=="function"&&!Kc(e)){var h=function(R){if(R.name)return R.name;var G=lv.call(rv.call(R),/^function\s*([\w$]+)/);return G?G[1]:null}(e),b=pl(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(b.length>0?" { "+ri.call(b,", ")+" }":"")}if(vg(e)){var v=Vo?Ri.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fa.call(e);return typeof e!="object"||Vo?v:or(v)}if(function(R){return!R||typeof R!="object"?!1:typeof HTMLElement!="undefined"&&R instanceof HTMLElement?!0:typeof R.nodeName=="string"&&typeof R.getAttribute=="function"}(e)){for(var _="<"+qc.call(String(e.nodeName)),y=e.attributes||[],S=0;S<y.length;S++)_+=" "+y[S].name+"="+_g(fv(y[S].value),"double",r);return _+=">",e.childNodes&&e.childNodes.length&&(_+="..."),_+="</"+qc.call(String(e.nodeName))+">"}if(Ia(e)){if(e.length===0)return"[]";var C=pl(e,d);return u&&!function(R){for(var G=0;G<R.length;G++)if(Jc(R[G],`
|
||||
`)>=0)return!1;return!0}(C)?"["+Ra(C,u)+"]":"[ "+ri.call(C,", ")+" ]"}if(function(R){return!(Pi(R)!=="[object Error]"||rn&&typeof R=="object"&&rn in R)}(e)){var x=pl(e,d);return"cause"in Error.prototype||!("cause"in e)||gg.call(e,"cause")?x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ri.call(x,", ")+" }":"{ ["+String(e)+"] "+ri.call(Vc.call("[cause]: "+d(e.cause),x),", ")+" }"}if(typeof e=="object"&&l){if(Gc&&typeof e[Gc]=="function"&&La)return La(e,{depth:c-i});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(R){if(!ul||!R||typeof R!="object")return!1;try{ul.call(R);try{dl.call(R)}catch{return!0}return R instanceof Map}catch{}return!1}(e)){var M=[];return tv.call(e,function(R,G){M.push(d(G,e,!0)+" => "+d(R,e))}),Zc("Map",ul.call(e),M,u)}if(function(R){if(!dl||!R||typeof R!="object")return!1;try{dl.call(R);try{ul.call(R)}catch{return!0}return R instanceof Set}catch{}return!1}(e)){var A=[];return nv.call(e,function(R){A.push(d(R,e))}),Zc("Set",dl.call(e),A,u)}if(function(R){if(!nr||!R||typeof R!="object")return!1;try{nr.call(R,nr);try{ir.call(R,ir)}catch{return!0}return R instanceof WeakMap}catch{}return!1}(e))return Zs("WeakMap");if(function(R){if(!ir||!R||typeof R!="object")return!1;try{ir.call(R,ir);try{nr.call(R,nr)}catch{return!0}return R instanceof WeakSet}catch{}return!1}(e))return Zs("WeakSet");if(function(R){if(!Hc||!R||typeof R!="object")return!1;try{return Hc.call(R),!0}catch{}return!1}(e))return Zs("WeakRef");if(function(R){return!(Pi(R)!=="[object Number]"||rn&&typeof R=="object"&&rn in R)}(e))return or(d(Number(e)));if(function(R){if(!R||typeof R!="object"||!Ks)return!1;try{return Ks.call(R),!0}catch{}return!1}(e))return or(d(Ks.call(e)));if(function(R){return!(Pi(R)!=="[object Boolean]"||rn&&typeof R=="object"&&rn in R)}(e))return or(iv.call(e));if(function(R){return!(Pi(R)!=="[object String]"||rn&&typeof R=="object"&&rn in R)}(e))return or(d(String(e)));if(!function(R){return!(Pi(R)!=="[object Date]"||rn&&typeof R=="object"&&rn in R)}(e)&&!Kc(e)){var O=pl(e,d),D=Uc?Uc(e)===Object.prototype:e instanceof Object||e.constructor===Object,E=e instanceof Object?"":"null prototype",P=!D&&rn&&Object(e)===e&&rn in e?$f.call(Pi(e),8,-1):E?"Object":"",I=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(P||E?"["+ri.call(Vc.call([],P||[],E||[]),": ")+"] ":"");return O.length===0?I+"{}":u?I+"{"+Ra(O,u)+"}":I+"{ "+ri.call(O,", ")+" }"}return String(e)},pv=Af("%TypeError%"),hl=Af("%WeakMap%",!0),ml=Af("%Map%",!0),hv=Ko("WeakMap.prototype.get",!0),mv=Ko("WeakMap.prototype.set",!0),bv=Ko("WeakMap.prototype.has",!0),gv=Ko("Map.prototype.get",!0),_v=Ko("Map.prototype.set",!0),vv=Ko("Map.prototype.has",!0),Xs=function(n,e){for(var t,i=n;(t=i.next)!==null;i=t)if(t.key===e)return i.next=t.next,t.next=n.next,n.next=t,t},yv=String.prototype.replace,kv=/%20/g,Xc="RFC3986",Df={default:Xc,formatters:{RFC1738:function(n){return yv.call(n,kv,"+")},RFC3986:function(n){return String(n)}},RFC1738:"RFC1738",RFC3986:Xc},wv=Df,Qs=Object.prototype.hasOwnProperty,Ji=Array.isArray,ii=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),Qc=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},i=0;i<n.length;++i)n[i]!==void 0&&(t[i]=n[i]);return t},wg={arrayToObject:Qc,assign:function(n,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},n)},combine:function(n,e){return[].concat(n,e)},compact:function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],i=0;i<e.length;++i)for(var o=e[i],r=o.obj[o.prop],l=Object.keys(r),s=0;s<l.length;++s){var a=l[s],f=r[a];typeof f=="object"&&f!==null&&t.indexOf(f)===-1&&(e.push({obj:r,prop:a}),t.push(f))}return function(c){for(;c.length>1;){var u=c.pop(),d=u.obj[u.prop];if(Ji(d)){for(var h=[],b=0;b<d.length;++b)d[b]!==void 0&&h.push(d[b]);u.obj[u.prop]=h}}}(e),n},decode:function(n,e,t){var i=n.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},encode:function(n,e,t,i,o){if(n.length===0)return n;var r=n;if(typeof n=="symbol"?r=Symbol.prototype.toString.call(n):typeof n!="string"&&(r=String(n)),t==="iso-8859-1")return escape(r).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var l="",s=0;s<r.length;++s){var a=r.charCodeAt(s);a===45||a===46||a===95||a===126||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||o===wv.RFC1738&&(a===40||a===41)?l+=r.charAt(s):a<128?l+=ii[a]:a<2048?l+=ii[192|a>>6]+ii[128|63&a]:a<55296||a>=57344?l+=ii[224|a>>12]+ii[128|a>>6&63]+ii[128|63&a]:(s+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(s)),l+=ii[240|a>>18]+ii[128|a>>12&63]+ii[128|a>>6&63]+ii[128|63&a])}return l},isBuffer:function(n){return!(!n||typeof n!="object")&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},isRegExp:function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},maybeMap:function(n,e){if(Ji(n)){for(var t=[],i=0;i<n.length;
Line truncated
|
||||
transform: ${f} translate(${(1-u)*o}px, ${(1-u)*r}px);
|
||||
opacity: ${a-c*d}`}}function fn(n,{delay:e=0,duration:t=400,easing:i=As}={}){const o=getComputedStyle(n),r=+o.opacity,l=parseFloat(o.height),s=parseFloat(o.paddingTop),a=parseFloat(o.paddingBottom),f=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),u=parseFloat(o.borderTopWidth),d=parseFloat(o.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*r};height: ${h*l}px;padding-top: ${h*s}px;padding-bottom: ${h*a}px;margin-top: ${h*f}px;margin-bottom: ${h*c}px;border-top-width: ${h*u}px;border-bottom-width: ${h*d}px;`}}function Bn(n,{delay:e=0,duration:t=400,easing:i=As,start:o=0,opacity:r=0}={}){const l=getComputedStyle(n),s=+l.opacity,a=l.transform==="none"?"":l.transform,f=1-o,c=s*(1-r);return{delay:e,duration:t,easing:i,css:(u,d)=>`
|
||||
transform: ${a} scale(${1-f*d});
|
||||
opacity: ${s-c*d}
|
||||
`}}function Y2(n){let e,t,i,o;return{c(){e=g("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(r,l){w(r,e,l),n[13](e),Me(e,n[7]),i||(o=X(e,"input",n[14]),i=!0)},p(r,l){l&3&&t!==(t=r[0]||r[1])&&p(e,"placeholder",t),l&128&&e.value!==r[7]&&Me(e,r[7])},i:le,o:le,d(r){r&&k(e),n[13](null),i=!1,o()}}}function G2(n){let e,t,i,o;function r(a){n[12](a)}var l=n[4];function s(a){let f={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return l&&(e=new l(s(n)),he.push(()=>Fe(e,"value",r)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=lt()},m(a,f){e&&H(e,a,f),w(a,i,f),o=!0},p(a,f){const c={};if(f&8&&(c.extraAutocompleteKeys=a[3]),f&4&&(c.baseCollection=a[2]),f&3&&(c.placeholder=a[0]||a[1]),!t&&f&128&&(t=!0,c.value=a[7],Re(()=>t=!1)),l!==(l=a[4])){if(e){Ae();const u=e;F(u.$$.fragment,1,0,()=>{q(u,1)}),De()}l?(e=new l(s(a)),he.push(()=>Fe(e,"value",r)),e.$on("submit",a[10]),V(e.$$.fragment),T(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else l&&e.$set(c)},i(a){o||(e&&T(e.$$.fragment,a),o=!0)},o(a){e&&F(e.$$.fragment,a),o=!1},d(a){a&&k(i),e&&q(e,a)}}}function Ou(n){let e,t,i,o,r,l,s=n[7]!==n[0]&&Tu();return{c(){s&&s.c(),e=$(),t=g("button"),t.innerHTML='<span class="txt">Clear</span>',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,f){s&&s.m(a,f),w(a,e,f),w(a,t,f),o=!0,r||(l=X(t,"click",n[15]),r=!0)},p(a,f){a[7]!==a[0]?s?f&129&&T(s,1):(s=Tu(),s.c(),T(s,1),s.m(e.parentNode,e)):s&&(Ae(),F(s,1,1,()=>{s=null}),De())},i(a){o||(T(s),Dt(()=>{i||(i=ct(t,ti,{duration:150,x:5},!0)),i.run(1)}),o=!0)},o(a){F(s),i||(i=ct(t,ti,{duration:150,x:5},!1)),i.run(0),o=!1},d(a){s&&s.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),r=!1,l()}}}function Tu(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(o,r){w(o,e,r),i=!0},i(o){i||(Dt(()=>{t||(t=ct(e,ti,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(o){t||(t=ct(e,ti,{duration:150,x:5},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end()}}}function K2(n){let e,t,i,o,r,l,s,a,f,c,u;const d=[G2,Y2],h=[];function b(_,y){return _[4]&&!_[5]?0:1}l=b(n),s=h[l]=d[l](n);let v=(n[0].length||n[7].length)&&Ou(n);return{c(){e=g("div"),t=g("form"),i=g("label"),o=g("i"),r=$(),s.c(),a=$(),v&&v.c(),p(o,"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(_,y){w(_,e,y),m(e,t),m(t,i),m(i,o),m(t,r),h[l].m(t,null),m(t,a),v&&v.m(t,null),f=!0,c||(u=[X(t,"submit",Gt(n[10])),X(e,"click",Vn(n[11]))],c=!0)},p(_,[y]){let S=l;l=b(_),l===S?h[l].p(_,y):(Ae(),F(h[S],1,1,()=>{h[S]=null}),De(),s=h[l],s?s.p(_,y):(s=h[l]=d[l](_),s.c()),T(s,1),s.m(t,a)),_[0].length||_[7].length?v?(v.p(_,y),y&129&&T(v,1)):(v=Ou(_),v.c(),T(v,1),v.m(t,null)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){f||(T(s),T(v),f=!0)},o(_){F(s),F(v),f=!1},d(_){_&&k(e),h[l].d(),v&&v.d(),c=!1,rt(u)}}}function J2(n,e,t){const i=yn(),o="search_"+B.randomString(7);let{value:r=""}=e,{placeholder:l='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:s=new En}=e,{extraAutocompleteKeys:a=[]}=e,f,c=!1,u,d="";function h(M=!0){t(7,d=""),M&&(u==null||u.focus()),i("clear")}function b(){t(0,r=d),i("submit",r)}async function v(){f||c||(t(5,c=!0),t(4,f=(await _i(()=>import("./FilterAutocompleteInput.3cd8dab2.js"),[])).default),t(5,c=!1))}di(()=>{v()});function _(M){ft.call(this,n,M)}function y(M){d=M,t(7,d),t(0,r)}function S(M){he[M?"unshift":"push"](()=>{u=M,t(6,u)})}function C(){d=this.value,t(7,d),t(0,r)}const x=()=>{h(!1),b()};return n.$$set=M=>{"value"in M&&t(0,r=M.value),"placeholder"in M&&t(1,l=M.placeholder),"autocompleteCollection"in M&&t(2,s=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof r=="string"&&t(7,d=r)},[r,l,s,a,f,c,u,d,o,h,b,_,y,S,C,x]}class Ds extends Ie{constructor(e){super(),Le(this,e,J2,K2,Ee,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Z2(n){let e,t,i,o,r;const l=n[6].default,s=$n(l,n,n[5],null);return{c(){e=g("th"),s&&s.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ne(e,"col-sort-disabled",n[3]),ne(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ne(e,"sort-desc",n[0]==="-"+n[2]),ne(e,"sort-asc",n[0]==="+"+n[2])},m(a,f){w(a,e,f),s&&s.m(e,null),i=!0,o||(r=[X(e,"click",n[7]),X(e,"keydown",n[8])],o=!0)},p(a,[f]){s&&s.p&&(!i||f&32)&&Dn(s,l,a,a[5],i?An(l,a[5],f,null):On(a[5]),null),(!i||f&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),f&10&&ne(e,"col-sort-disabled",a[3]),f&7&&ne(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),f&7&&ne(e,"sort-desc",a[0]==="-"+a[2]),f&7&&ne(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(T(s,a),i=!0)},o(a){F(s,a),i=!1},d(a){a&&k(e),s&&s.d(a),o=!1,rt(r)}}}function X2(n,e,t){let{$$slots:i={},$$scope:o}=e,{class:r=""}=e,
Line truncated
|
||||
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function ok(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function rk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function lk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function sk(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function Pu(n){let e;function t(r,l){return r[6]?fk:ak}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function ak(n){var s;let e,t,i,o,r,l=((s=n[0])==null?void 0:s.length)&&Fu(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No logs found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[0])!=null&&c.length?l?l.p(a,f):(l=Fu(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function fk(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Fu(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function Lu(n){let e;return{c(){e=g("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 Iu(n,e){var oe,J,$e;let t,i,o,r=((oe=e[21].method)==null?void 0:oe.toUpperCase())+"",l,s,a,f,c,u=e[21].url+"",d,h,b,v,_,y,S=(e[21].referer||"N/A")+"",C,x,M,A,O,D=e[21].status+"",E,P,I,R,G,U,z,K,Y,W,te=(((J=e[21].meta)==null?void 0:J.errorMessage)||(($e=e[21].meta)==null?void 0:$e.errorData))&&Lu();R=new Ci({props:{date:e[21].created}});function ce(){return e[16](e[21])}function ve(...ee){return e[17](e[21],...ee)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("span"),l=j(r),a=$(),f=g("td"),c=g("span"),d=j(u),b=$(),te&&te.c(),v=$(),_=g("td"),y=g("span"),C=j(S),M=$(),A=g("td"),O=g("span"),E=j(D),P=$(),I=g("td"),V(R.$$.fragment),G=$(),U=g("td"),U.innerHTML='<i class="ri-arrow-right-line"></i>',z=$(),p(o,"class",s="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(c,"class","txt txt-ellipsis"),p(c,"title",h=e[21].url),p(f,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",x=e[21].referer),ne(y,"txt-hint",!e[21].referer),p(_,"class","col-type-text col-field-referer"),p(O,"class","label"),ne(O,"label-danger",e[21].status>=400),p(A,"class","col-type-number col-field-status"),p(I,"class","col-type-date col-field-created"),p(U,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,_e){w(ee,t,_e),m(t,i),m(i,o),m(o,l),m(t,a),m(t,f),m(f,c),m(c,d),m(f,b),te&&te.m(f,null),m(t,v),m(t,_),m(_,y),m(y,C),m(t,M),m(t,A),m(A,O),m(O,E),m(t,P),m(t,I),H(R,I,null),m(t,G),m(t,U),m(t,z),K=!0,Y||(W=[X(t,"click",ce),X(t,"keydown",ve)],Y=!0)},p(ee,_e){var ie,ye,Ne;e=ee,(!K||_e&8)&&r!==(r=((ie=e[21].method)==null?void 0:ie.toUpperCase())+"")&&ge(l,r),(!K||_e&8&&s!==(s="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(o,"class",s),(!K||_e&8)&&u!==(u=e[21].url+"")&&ge(d,u),(!K||_e&8&&h!==(h=e[21].url))&&p(c,"title",h),((ye=e[21].meta)==null?void 0:ye.errorMessage)||((Ne=e[21].meta)==null?void 0:Ne.errorData)?te||(te=Lu(),te.c(),te.m(f,null)):te&&(te.d(1),te=null),(!K||_e&8)&&S!==(S=(e[21].referer||"N/A")+"")&&ge(C,S),(!K||_e&8&&x!==(x=e[21].referer))&&p(y,"title",x),_e&8&&ne(y,"txt-hint",!e[21].referer),(!K||_e&8)&&D!==(D=e[21].status+"")&&ge(E,D),_e&8&&ne(O,"label-danger",e[21].status>=400);const fe={};_e&8&&(fe.date=e[21].created),R.$set(fe)},i(ee){K||(T(R.$$.fragment,ee),K=!0)},o(ee){F(R.$$.fragment,ee),K=!1},d(ee){ee&&k(t),te&&te.d(),q(R),Y=!1,rt(W)}}}function Ru(n){let e,t,i=n[3].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a&8&&i!==(i=s[3].length+"")&&ge(o,i),a&16&&ge(l,s[4])},d(s){s&&k(e)}}}function Nu(n){let e,t,i,o,r=n[4]-n[3].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[6]),ne(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[19]),a=!0)},p(c,u){u&24&&r!==(r=c[4]-c[3].length+"")&&ge(l,r),u&64&&ne(t,"btn-loading",c[6]),u&64&&ne(t,"btn-disabled",c[6])},d(c){c&&k(e),a=!1,f()}}}function ck(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O=[],D=new Map,E,P,I,R;function G(ie){n[11](ie)}let U={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[ik]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),r=new en({props:U}),he.push(()=>Fe(r,"sort",G));function z(ie){n[12](ie)}let K={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[ok]},$$scope:{ctx:n}};n[1]!==void 0&&(K.sort=n[1]),a=new en({props:K}),he.push(()=>Fe(a,"sort",z));function Y(ie){n[13](ie)}let W={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[rk]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),u=new en({props:W}),he.push(()=>Fe(u,"sort",Y));function te(ie){n[14](ie)}let ce={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[lk]},$$scope:{ctx:n}};n[1]!==void 0&&(ce.sort=n[1]),b=new en({props:ce}),he.push(()=>Fe(b,"sort",te));function ve(ie){n[15](ie)}let oe={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[sk]},$$scope:{ctx:n}};n[1]!==void 0&&(oe.sort=n[1]),y=new en({props:oe}),he.push(()=>Fe(y,"sort",ve));let J=n[3];const $e=ie=>ie[21].id;for(let ie=0;ie<J.length;ie+=1){let ye=Eu(n,J,ie),Ne=$e(ye);D.set(Ne,O[ie]=Iu(Ne,ye))}let ee=
Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/const T0=function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame}();function E0(n,e,t){const i=t||(l=>Array.prototype.slice.call(l));let o=!1,r=[];return function(...l){r=i(l),o||(o=!0,T0.call(window,()=>{o=!1,n.apply(e,r)}))}}function pk(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const hk=n=>n==="start"?"left":n==="end"?"right":"center",ju=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function mi(){}const mk=function(){let n=0;return function(){return n++}}();function xt(n){return n===null||typeof n=="undefined"}function Et(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 Ht=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Ht(n)?n:e}function ht(n,e){return typeof n=="undefined"?e:n}const bk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,P0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Ct(n,e,t,i){let o,r,l;if(Et(n))if(r=n.length,i)for(o=r-1;o>=0;o--)e.call(t,n[o],o);else for(o=0;o<r;o++)e.call(t,n[o],o);else if(dt(n))for(l=Object.keys(n),r=l.length,o=0;o<r;o++)e.call(t,n[l[o]],l[o])}function ls(n,e){let t,i,o,r;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(o=n[t],r=e[t],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function ss(n){if(Et(n))return n.map(ss);if(dt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let o=0;for(;o<i;++o)e[t[o]]=ss(n[t[o]]);return e}return n}function F0(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function gk(n,e,t,i){if(!F0(n))return;const o=e[n],r=t[n];dt(o)&&dt(r)?Lr(o,r,i):e[n]=ss(r)}function Lr(n,e,t){const i=Et(e)?e:[e],o=i.length;if(!dt(n))return n;t=t||{};const r=t.merger||gk;for(let l=0;l<o;++l){if(e=i[l],!dt(e))continue;const s=Object.keys(e);for(let a=0,f=s.length;a<f;++a)r(s[a],n,e,t)}return n}function Mr(n,e){return Lr(n,e,{merger:_k})}function _k(n,e,t){if(!F0(n))return;const i=e[n],o=t[n];dt(i)&&dt(o)?Mr(i,o):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ss(o))}const vk="",yk=".";function zu(n,e){const t=n.indexOf(yk,e);return t===-1?n.length:t}function qi(n,e){if(e===vk)return n;let t=0,i=zu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=zu(e,t);return n}function Vf(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Un=n=>typeof n!="undefined",Vi=n=>typeof n=="function",Hu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function kk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const jt=Math.PI,Tt=2*jt,wk=Tt+jt,as=Number.POSITIVE_INFINITY,Sk=jt/180,Nt=jt/2,fr=jt/4,qu=jt*2/3,zn=Math.log10,ai=Math.sign;function Vu(n){const e=Math.round(n);n=$r(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Ck(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((o,r)=>o-r).pop(),e}function Ir(n){return!isNaN(parseFloat(n))&&isFinite(n)}function $r(n,e,t){return Math.abs(n-e)<t}function xk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function L0(n,e,t){let i,o,r;for(i=0,o=n.length;i<o;i++)r=n[i][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function Xn(n){return n*(jt/180)}function Bf(n){return n*(180/jt)}function Bu(n){if(!Ht(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function I0(n,e){const t=e.x-n.x,i=e.y-n.y,o=Math.sqrt(t*t+i*i);let r=Math.atan2(i,t);return r<-.5*jt&&(r+=Tt),{angle:r,distance:o}}function Qa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Mk(n,e){return(n-e+wk)%Tt-jt}function Cn(n){return(n%Tt+Tt)%Tt}function Rr(n,e,t,i){const o=Cn(n),r=Cn(e),l=Cn(t),s=Cn(r-o),a=Cn(l-o),f=Cn(o-r),c=Cn(o-l);return o===r||o===l||i&&r===l||s>a&&f<c}function sn(n,e,t){return Math.max(e,Math.min(t,n))}function $k(n){return sn(n,-32768,32767)}function Nr(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const kl=n=>n===0||n===1,Uu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Tt/t)),Wu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Tt/t)+1,Ar={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*Nt)+1,easeOutSine:n=>Math.sin(n*Nt),easeInOutSine:n=>-.5*(Math.cos(jt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1Line truncated
|
||||
* @kurkle/color v0.2.1
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2022 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/function Jr(n){return n+.5|0}const Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function yr(n){return Ni(Jr(n*2.55),0,255)}function Hi(n){return Ni(Jr(n*255),0,255)}function yi(n){return Ni(Jr(n/2.55)/100,0,1)}function Yu(n){return Ni(Jr(n*100),0,100)}const In={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},ef=[..."0123456789ABCDEF"],Ak=n=>ef[n&15],Dk=n=>ef[(n&240)>>4]+ef[n&15],wl=n=>(n&240)>>4===(n&15),Ok=n=>wl(n.r)&&wl(n.g)&&wl(n.b)&&wl(n.a);function Tk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const Ek=(n,e)=>n<255?e(n):"";function Pk(n){var e=Ok(n)?Ak:Dk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Ek(n.a,e):void 0}const Fk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function R0(n,e,t){const i=e*Math.min(t,1-t),o=(r,l=(r+n/30)%12)=>t-i*Math.max(Math.min(l-3,9-l,1),-1);return[o(0),o(8),o(4)]}function Lk(n,e,t){const i=(o,r=(o+n/60)%6)=>t-t*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Ik(n,e,t){const i=R0(n,1,.5);let o;for(e+t>1&&(o=1/(e+t),e*=o,t*=o),o=0;o<3;o++)i[o]*=1-e-t,i[o]+=e;return i}function Rk(n,e,t,i,o){return n===o?(e-t)/i+(e<t?6:0):e===o?(t-n)/i+2:(n-e)/i+4}function Uf(n){const t=n.r/255,i=n.g/255,o=n.b/255,r=Math.max(t,i,o),l=Math.min(t,i,o),s=(r+l)/2;let a,f,c;return r!==l&&(c=r-l,f=s>.5?c/(2-r-l):c/(r+l),a=Rk(t,i,o,c,r),a=a*60+.5),[a|0,f||0,s]}function Wf(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Hi)}function Yf(n,e,t){return Wf(R0,n,e,t)}function Nk(n,e,t){return Wf(Ik,n,e,t)}function jk(n,e,t){return Wf(Lk,n,e,t)}function N0(n){return(n%360+360)%360}function zk(n){const e=Fk.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?yr(+e[5]):Hi(+e[5]));const o=N0(+e[2]),r=+e[3]/100,l=+e[4]/100;return e[1]==="hwb"?i=Nk(o,r,l):e[1]==="hsv"?i=jk(o,r,l):i=Yf(o,r,l),{r:i[0],g:i[1],b:i[2],a:t}}function Hk(n,e){var t=Uf(n);t[0]=N0(t[0]+e),t=Yf(t),n.r=t[0],n.g=t[1],n.b=t[2]}function qk(n){if(!n)return;const e=Uf(n),t=e[0],i=Yu(e[1]),o=Yu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${o}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${o}%)`}const Gu={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"},Ku={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 Vk(){const n={},e=Object.keys(Ku),t=Object.keys(Gu);let i,o,r,l,s;for(i=0;i<e.length;i++){for(l=s=e[i],o=0;o<t.length;o++)r=t[o]Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/class Yw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,o){const r=t.listeners[o],l=t.duration;r.forEach(s=>s({chart:e,initial:t.initial,numSteps:l,currentStep:Math.min(i-t.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=T0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,o)=>{if(!i.running||!i.items.length)return;const r=i.items;let l=r.length-1,s=!1,a;for(;l>=0;--l)a=r[l],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),s=!0):(r[l]=r[r.length-1],r.pop());s&&(o.draw(),this._notify(o,i,e,"progress")),r.length||(i.running=!1,this._notify(o,i,e,"complete"),i.initial=!1),t+=r.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,o)=>Math.max(i,o._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 o=i.length-1;for(;o>=0;--o)i[o].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var bi=new Yw;const ad="transparent",Gw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Zu(n||ad),o=i.valid&&Zu(e||ad);return o&&o.valid?o.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Kw{constructor(e,t,i,o){const r=t[i];o=xl([e.to,o,r,e.from]);const l=xl([e.from,r,o]);this._active=!0,this._fn=e.fn||Gw[e.type||typeof l],this._easing=Ar[e.easing]||Ar.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=l,this._to=o,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const o=this._target[this._prop],r=i-this._start,l=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=xl([e.to,t,o,e.from]),this._from=xl([e.from,o,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,o=this._prop,r=this._from,l=this._loop,s=this._to;let a;if(this._active=r!==s&&(l||t<i),!this._active){this._target[o]=s,this._notify(!0);return}if(t<0){this._target[o]=r;return}a=t/i%2,a=l&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[o]=this._fn(r,s,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 o=0;o<i.length;o++)i[o][t]()}}const Jw=["x","y","borderWidth","radius","tension"],Zw=["color","borderColor","backgroundColor"];mt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Xw=Object.keys(mt.animation);mt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});mt.set("animations",{colors:{type:"color",properties:Zw},numbers:{type:"number",properties:Jw}});mt.describe("animations",{_fallback:"animation"});mt.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 t1{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 o=e[i];if(!dt(o))return;const r={};for(const l of Xw)r[l]=o[l];(Et(o.properties)&&o.properties||[i]).forEach(l=>{(l===i||!t.has(l))&&t.set(l,r)})})}_animateOptions(e,t){const i=t.options,o=e3(e,i);if(!o)return[];const r=this._createAnimations(o,i);return i.$shared&&Qw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,t){const i=this._properties,o=[],r=e.$animations||(e.$animations={}),l=Object.keys(t),s=Date.now();let a;for(a=l.length-1;a>=0;--a){const f=l[a];if(f.charAt(0)==="$")continue;if(f==="options"){o.push(...this._animateOptions(e,t));continue}const c=t[f];let u=r[f];const d=i.get(f);if(u)if(d&&u.active()){u.update(d,c,s);continue}else u.cancel();if(!d||!d.duration){e[f]=c;continue}r[f]=u=new Kw(d,e,f,c),o.push(u)}return o}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return bi.add(this._chart,i),!0}}function Qw(n,e){const t=[]Line truncated
|
||||
`)>-1?n.split(`
|
||||
`):n}function b4(n,e){const{element:t,datasetIndex:i,index:o}=e,r=n.getDatasetMeta(i).controller,{label:l,value:s}=r.getLabelAndValue(o);return{chart:n,label:l,parsed:r.getParsed(o),raw:n.data.datasets[i].data[o],formattedValue:s,dataset:r.getDataset(),dataIndex:o,datasetIndex:i,element:t}}function Nd(n,e){const t=n.chart.ctx,{body:i,footer:o,title:r}=n,{boxWidth:l,boxHeight:s}=e,a=Mn(e.bodyFont),f=Mn(e.titleFont),c=Mn(e.footerFont),u=r.length,d=o.length,h=i.length,b=Wn(e.padding);let v=b.height,_=0,y=i.reduce((x,M)=>x+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,u&&(v+=u*f.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),y){const x=e.displayColors?Math.max(s,a.lineHeight):a.lineHeight;v+=h*x+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(x){_=Math.max(_,t.measureText(x).width+S)};return t.save(),t.font=f.string,Ct(n.title,C),t.font=a.string,Ct(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?l+2+e.boxPadding:0,Ct(i,x=>{Ct(x.before,C),Ct(x.lines,C),Ct(x.after,C)}),S=0,t.font=c.string,Ct(n.footer,C),t.restore(),_+=b.width,{width:_,height:v}}function g4(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function _4(n,e,t,i){const{x:o,width:r}=i,l=t.caretSize+t.caretPadding;if(n==="left"&&o+r+l>e.width||n==="right"&&o-r-l<0)return!0}function v4(n,e,t,i){const{x:o,width:r}=t,{width:l,chartArea:{left:s,right:a}}=n;let f="center";return i==="center"?f=o<=(s+a)/2?"left":"right":o<=r/2?f="left":o>=l-r/2&&(f="right"),_4(f,n,e,t)&&(f="center"),f}function jd(n,e,t){const i=t.yAlign||e.yAlign||g4(n,t);return{xAlign:t.xAlign||e.xAlign||v4(n,e,t,i),yAlign:i}}function y4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function k4(n,e,t){let{y:i,height:o}=n;return e==="top"?i+=t:e==="bottom"?i-=o+t:i-=o/2,i}function zd(n,e,t,i){const{caretSize:o,caretPadding:r,cornerRadius:l}=n,{xAlign:s,yAlign:a}=t,f=o+r,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:h}=jo(l);let b=y4(e,s);const v=k4(e,a,f);return a==="center"?s==="left"?b+=f:s==="right"&&(b-=f):s==="left"?b-=Math.max(c,d)+o:s==="right"&&(b+=Math.max(u,h)+o),{x:sn(b,0,i.width-e.width),y:sn(v,0,i.height-e.height)}}function El(n,e,t){const i=Wn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return oi([],gi(n))}function w4(n,e,t){return Wi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function qd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class cf extends $i{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()),o=i.enabled&&t.options.animation&&i.animations,r=new t1(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=w4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,o=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),l=i.afterTitle.apply(this,[e]);let s=[];return s=oi(s,gi(o)),s=oi(s,gi(r)),s=oi(s,gi(l)),s}getBeforeBody(e,t){return Hd(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,o=[];return Ct(e,r=>{const l={before:[],lines:[],after:[]},s=qd(i,r);oi(l.before,gi(s.beforeLabel.call(this,r))),oi(l.lines,s.label.call(this,r)),oi(l.after,gi(s.afterLabel.call(this,r))),o.push(l)}),o}getAfterBody(e,t){return Hd(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,o=i.beforeFooter.apply(this,[e]),r=i.footer.apply(this,[e]),l=i.afterFooter.apply(this,[e]);let s=[];return s=oi(s,gi(o)),s=oi(s,gi(r)),s=oi(s,gi(l)),s}_createItems(e){const t=this._active,i=this.chart.data,o=[],r=[],l=[];let s=[],a,f;for(a=0,f=t.length;a<f;++a)s.push(b4(this.chart,t[a]));return e.filter&&(s=s.filter((c,u,d)=>e.filter(c,u,d,i))),e.itemSort&&(s=s.sort((c,u)=>e.itemSort(c,u,i))),Ct(s,c=>{const u=qd(e.callbacks,c);o.push(u.labelColor.call(this,c)),r.push(u.labelPointStyle.call(this,c)),l.push(u.labelTextColor.call(this,c))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=l,this.dataPoints=s,s}update(e,t){const i=this.options.setContext(this.getContext()),o=this._active;l
Line truncated
|
||||
* chartjs-adapter-luxon v1.1.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2021 chartjs-adapter-luxon Contributors
|
||||
* Released under the MIT license
|
||||
*/const V4={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};r1._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},formats:function(){return V4},parse:function(n,e){const t=this.options;if(n===null||typeof n=="undefined")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Jd(n){let e,t,i;return{c(){e=g("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(o,r){w(o,e,r),i=!0},i(o){i||(Dt(()=>{t||(t=ct(e,Bn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){t||(t=ct(e,Bn,{duration:150},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end()}}}function B4(n){let e,t,i=n[1]===1?"log":"logs",o;return{c(){e=j(n[1]),t=$(),o=j(i)},m(r,l){w(r,e,l),w(r,t,l),w(r,o,l)},p(r,l){l&2&&ge(e,r[1]),l&2&&i!==(i=r[1]===1?"log":"logs")&&ge(o,i)},d(r){r&&k(e),r&&k(t),r&&k(o)}}}function U4(n){let e;return{c(){e=j("Loading...")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function W4(n){let e,t,i,o,r,l,s=n[2]&&Jd();function a(u,d){return u[2]?U4:B4}let f=a(n),c=f(n);return{c(){e=g("div"),s&&s.c(),t=$(),i=g("canvas"),o=$(),r=g("div"),c.c(),p(i,"class","chart-canvas svelte-vh4sl8"),_c(i,"height","250px"),_c(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ne(e,"loading",n[2]),p(r,"class","txt-hint m-t-xs txt-right")},m(u,d){w(u,e,d),s&&s.m(e,null),m(e,t),m(e,i),n[8](i),w(u,o,d),w(u,r,d),c.m(r,null),l=!0},p(u,[d]){u[2]?s?d&4&&T(s,1):(s=Jd(),s.c(),T(s,1),s.m(e,t)):s&&(Ae(),F(s,1,1,()=>{s=null}),De()),d&4&&ne(e,"loading",u[2]),f===(f=a(u))&&c?c.p(u,d):(c.d(1),c=f(u),c&&(c.c(),c.m(r,null)))},i(u){l||(T(s),l=!0)},o(u){F(s),l=!1},d(u){u&&k(e),s&&s.d(),n[8](null),u&&k(o),u&&k(r),c.d()}}}function Y4(n,e,t){let{filter:i=""}=e,{presets:o=""}=e,r,l,s=[],a=0,f=!1;async function c(){return t(2,f=!0),Se.Logs.getRequestsStats({filter:[o,i].filter(Boolean).join("&&")}).then(h=>{u();for(let b of h)s.push({x:B.getDateTime(b.date).toLocal().toJSDate(),y:b.total}),t(1,a+=b.total);s.push({x:new Date,y:void 0})}).catch(h=>{h!==null&&(u(),console.warn(h),Se.errorResponseHandler(h,!1))}).finally(()=>{t(2,f=!1)})}function u(){t(1,a=0),t(7,s=[])}di(()=>(bs.register(Yi,Es,Qr,cc,tl,m4,S4),t(6,l=new bs(r,{type:"line",data:{datasets:[{label:"Total requests",data:s,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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}}}})),()=>l==null?void 0:l.destroy()));function d(h){he[h?"unshift":"push"](()=>{r=h,t(0,r)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,o=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i!="undefined"||typeof o!="undefined")&&c(),n.$$.dirty&192&&typeof s!="undefined"&&l&&(t(6,l.data.datasets[0].data=s,l),l.update())},[r,a,f,i,o,c,l,s,d]}class G4 extends Ie{constructor(e){super(),Le(this,e,Y4,W4,Ee,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Zd=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},M1={exports:{}};(function(n){var e=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
*
|
||||
* @license MIT <https://opensource.org/licenses/MIT>
|
||||
* @author Lea Verou <https://lea.verou.me>
|
||||
* @namespace
|
||||
* @public
|
||||
*/var t=function(i){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,l={},s={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(/</g,"<").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++r}),S.__id},clone:function S(C,x){x=x||{};var M,A;switch(s.util.type(C)){case"Object":if(A=s.util.objId(C),x[A])return x[A];M={},x[A]=M;for(var O in C)C.hasOwnProperty(O)&&(M[O]=S(C[O],x));return M;case"Array":return A=s.util.objId(C),x[A]?x[A]:(M=[],x[A]=M,C.forEach(function(D,E){M[E]=S(D,x)}),M);default:return C}},getLanguage:function(S){for(;S;){var C=o.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(o,"gi"),""),S.classList.add("language-"+C)},currentScript:function(){if(typeof document=="undefined")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 x in C)if(C[x].src==S)return C[x]}return null}},isActive:function(S,C,x){for(var M="no-"+C;S;){var A=S.classList;if(A.contains(C))return!0;if(A.contains(M))return!1;S=S.parentElement}return!!x}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(S,C){var x=s.util.clone(s.languages[S]);for(var M in C)x[M]=C[M];return x},insertBefore:function(S,C,x,M){M=M||s.languages;var A=M[S],O={};for(var D in A)if(A.hasOwnProperty(D)){if(D==C)for(var E in x)x.hasOwnProperty(E)&&(O[E]=x[E]);x.hasOwnProperty(D)||(O[D]=A[D])}var P=M[S];return M[S]=O,s.languages.DFS(s.languages,function(I,R){R===P&&I!=S&&(this[I]=O)}),O},DFS:function S(C,x,M,A){A=A||{};var O=s.util.objId;for(var D in C)if(C.hasOwnProperty(D)){x.call(C,D,C[D],M||D);var E=C[D],P=s.util.type(E);P==="Object"&&!A[O(E)]?(A[O(E)]=!0,S(E,x,null,A)):P==="Array"&&!A[O(E)]&&(A[O(E)]=!0,S(E,x,D,A))}}},plugins:{},highlightAll:function(S,C){s.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,x){var M={callback:x,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};s.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),s.hooks.run("before-all-elements-highlight",M);for(var A=0,O;O=M.elements[A++];)s.highlightElement(O,C===!0,M.callback)},highlightElement:function(S,C,x){var M=s.util.getLanguage(S),A=s.languages[M];s.util.setLanguage(S,M);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&s.util.setLanguage(O,M);var D=S.textContent,E={element:S,language:M,grammar:A,code:D};function P(R){E.highlightedCode=R,s.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,s.hooks.run("after-highlight",E),s.hooks.run("complete",E),x&&x.call(E.element)}if(s.hooks.run("before-sanity-check",E),O=E.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!E.code){s.hooks.run("complete",E),x&&x.call(E.element);return}if(s.hooks.run("before-highlight",E),!E.grammar){P(s.util.encode(E.code));return}if(C&&i.Worker){var I=new Worker(s.filename);I.onmessage=function(R){P(R.data)},I.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else P(s.highlight(E.code,E.grammar,E.language))},highlight:function(S,C,x){var M={code:S,grammar:C,language:x};if(s.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=s.tokenize(M.code,M.grammar),s.hooks.run("after-tokenize",M),a.stringify(s.util.encode(M.tokens),M.language)},tokenize:function(S,C){var x=C.rest;if(x){for(var M in x)C[M]=x[M];delete C.rest}var A=new u;return d(A,A.head,S),c(S,A,C,A.head,0),b(A)},hooks:{all:{},add:function(S,C){var x=s.hooks.all;x[S]=x[S]||[],x[S].push(C)},run:function(S,C){var x=s.hooks.all[S];if(!(!x||!x.length))for(var M=0,A;A=x[M++];)A(C)}},Token:a};i.Prism=s;function a(S,C,x,M){this.type=S,this.content=C,this.alias=x,this.length=(M||"").length|0}a.stringify=function S(C,x){if(typeof C=="string")return C;if(Array.isArray(C)){var M="";return C.forEach(function(P){M+=S(P,x)}),M}var A={type:C.type,content:S(C.content,x),tag:"span",classes:["token",C.type],attributes:{},language:x},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(A.classes,O):A.classes.push(O)),s.hooks.run("wrap",A);var D="";for(var E in A.attributes)D+=" "+E+'="'+(A.attributes[E]||"").replace(/"/g,""")+'"';return"<"+A.tag+' class="'+A.classes.join(" ")+'"'+D+">"+A.content+"</"+A.tag+">"};function f(S,C,x,M){S.lastIndex=C;var A=S.exec(x);if(A&&M&&A[1]){var O=A[1].length;A.index+=O,A[0]=A[0].slice(O)}retLine truncated
|
||||
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(E+1))}y.textContent=A,t.highlightElement(y)},function(A){_.setAttribute(s,c),y.textContent=A})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(u),S=0,C;C=y[S++];)t.highlightElement(C)}};var b=!1;t.fileHighlight=function(){b||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),b=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(M1);var mr=M1.exports,K4={exports:{}};(function(n){(function(){if(typeof Prism=="undefined")return;var e=Object.assign||function(r,l){for(var s in l)l.hasOwnProperty(s)&&(r[s]=l[s]);return r};function t(r){this.defaults=e({},r)}function i(r){return r.replace(/-(\w)/g,function(l,s){return s.toUpperCase()})}function o(r){for(var l=0,s=0;s<r.length;++s)r.charCodeAt(s)==" ".charCodeAt(0)&&(l+=3);return r.length+l}t.prototype={setDefaults:function(r){this.defaults=e(this.defaults,r)},normalize:function(r,l){l=e(this.defaults,l);for(var s in l){var a=i(s);s!=="normalize"&&a!=="setDefaults"&&l[s]&&this[a]&&(r=this[a].call(this,r,l[s]))}return r},leftTrim:function(r){return r.replace(/^\s+/,"")},rightTrim:function(r){return r.replace(/\s+$/,"")},tabsToSpaces:function(r,l){return l=l|0||4,r.replace(/\t/g,new Array(++l).join(" "))},spacesToTabs:function(r,l){return l=l|0||4,r.replace(RegExp(" {"+l+"}","g")," ")},removeTrailing:function(r){return r.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(r){return r.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(r){var l=r.match(/^[^\S\n\r]*(?=\S)/gm);return!l||!l[0].length||(l.sort(function(s,a){return s.length-a.length}),!l[0].length)?r:r.replace(RegExp("^"+l[0],"gm"),"")},indent:function(r,l){return r.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++l).join(" ")+"$&")},breakLines:function(r,l){l=l===!0?80:l|0||80;for(var s=r.split(`
|
||||
`),a=0;a<s.length;++a)if(!(o(s[a])<=l)){for(var f=s[a].split(/(\s+)/g),c=0,u=0;u<f.length;++u){var d=o(f[u]);c+=d,c>l&&(f[u]=`
|
||||
`+f[u],c=d)}s[a]=f.join("")}return s.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(r){var l=Prism.plugins.NormalizeWhitespace;if(!(r.settings&&r.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(r.element,"whitespace-normalization",!0)){if((!r.element||!r.element.parentNode)&&r.code){r.code=l.normalize(r.code,r.settings);return}var s=r.element.parentNode;if(!(!r.code||!s||s.nodeName.toLowerCase()!=="pre")){for(var a=s.childNodes,f="",c="",u=!1,d=0;d<a.length;++d){var h=a[d];h==r.element?u=!0:h.nodeName==="#text"&&(u?c+=h.nodeValue:f+=h.nodeValue,s.removeChild(h),--d)}if(!r.element.children.length||!Prism.plugins.KeepMarkup)r.code=f+r.code+c,r.code=l.normalize(r.code,r.settings);else{var b=f+r.element.innerHTML+c;r.element.innerHTML=l.normalize(b,r.settings),r.code=r.element.textContent}}}})})()})(K4);function J4(n){let e,t;return{c(){e=g("div"),t=g("code"),p(t,"class","svelte-tv7jme"),p(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,o){w(i,e,o),m(e,t),t.innerHTML=n[0]},p(i,[o]){o&1&&(t.innerHTML=i[0])},i:le,o:le,d(i){i&&k(e)}}}function Z4(n,e,t){let{content:i=""}=e,{language:o="javascript"}=e,r="";function l(s){return s=typeof s=="string"?s:"",s=mr.plugins.NormalizeWhitespace.normalize(s,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),mr.highlight(s,mr.languages[o]||mr.languages.javascript,o)}return n.$$set=s=>{"content"in s&&t(1,i=s.content),"language"in s&&t(2,o=s.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof mr!="undefined"&&i&&t(0,r=l(i))},[r,i,o]}class tn extends Ie{constructor(e){super(),Le(this,e,Z4,J4,Ee,{content:1,language:2})}}const X4=n=>({}),Xd=n=>({}),Q4=n=>({}),Qd=n=>({});function ep(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C=n[4]&&!n[2]&&tp(n);const x=n[18].header,M=$n(x,n,n[17],Qd);let A=n[4]&&n[2]&&np(n);const O=n[18].default,D=$n(O,n,n[17],null),E=n[18].footer,P=$n(E,n,n[17],Xd);return{c(){e=g("div"),t=g("div"),o=$(),r=g("div"),l=g("div"),C&&C.c(),s=$(),M&&M.c(),a=$(),A&&A.c(),f=$(),c=g("div"),D&&D.c(),u=$(),d=g("div"),P&&P.c(),p(t,"class","overlay"),p(l,"class","overlay-panel-section panel-header"),p(c,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(r,"class",h="overlay-panel "+n[1]+" "+n[8]),ne(r,"popup",n[2]),p(e,"class","overlay-panel-container"),ne(e,"padded",n[2]),ne(e,"active",n[0])},m(I,R){w(I,e,R),m(e,t),m(e,o),m(e,r),m(r,l),C&&C.m(l,null),m(l,s),M&&M.m(l,null),m(l,a),A&&A.m(l,null),m(r,f),m(r,c),D&&D.m(c,null),n[20](c),m(r,u),m(r,d),P&&P.m(d,null),_=!0,y||(S=[X(t,"click",Gt(n[19])),X(c,"scroll",n[21])],y=!0)},p(I,R){n=I,n[4]&&!n[2]?C?C.p(n,R):(C=tp(n),C.c(),C.m(l,s)):C&&(C.d(1),C=null),M&&M.p&&(!_||R&131072)&&Dn(M,x,n,n[17],_?An(x,n[17],R,Q4):On(n[17]),Qd),n[4]&&n[2]?A?A.p(n,R):(A=np(n),A.c(),A.m(l,null)):A&&(A.d(1),A=null),D&&D.p&&(!_||R&131072)&&Dn(D,O,n,n[17],_?An(O,n[17],R,null):On(n[17]),null),P&&P.p&&(!_||R&131072)&&Dn(P,E,n,n[17],_?An(E,n[17],R,X4):On(n[17]),Xd),(!_||R&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(r,"class",h),R&262&&ne(r,"popup",n[2]),R&4&&ne(e,"padded",n[2]),R&1&&ne(e,"active",n[0])},i(I){_||(Dt(()=>{i||(i=ct(t,rs,{duration:Eo,opacity:0},!0)),i.run(1)}),T(M,I),T(D,I),T(P,I),Dt(()=>{v&&v.end(1),b=yf(r,ti,n[2]?{duration:Eo,y:-10}:{duration:Eo,x:50}),b.start()}),_=!0)},o(I){i||(i=ct(t,rs,{duration:Eo,opacity:0},!1)),i.run(0),F(M,I),F(D,I),F(P,I),b&&b.invalidate(),v=Kb(r,ti,n[2]?{duration:Eo,y:10}:{duration:Eo,x:50}),_=!1},d(I){I&&k(e),I&&i&&i.end(),C&&C.d(),M&&M.d(I),A&&A.d(),D&&D.d(I),n[20](null),P&&P.d(I),I&&v&&v.end(),y=!1,rt(S)}}}function tp(n){let e,t,i;return{c(){e=g("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(o,r){w(o,e,r),t||(i=X(e,"click",Gt(n[5])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function np(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(o,r){w(o,e,r),t||(i=X(e,"click",Gt(n[5])),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function eC(n){let e,t,i,o,r=n[0]&&ep(n);return{c(){e=g("div"),r&&r.c(),p(e,"class","overlay-panel-wrapper")},m(l,s){w(l,e,s),r&&r.m(e,null),n[22](e),t=!0,i||(o=[X(window,"resize",n[10]),X(window,"keydown",n[9])],i=!0)},p(l,[s]){l[0]?r?(r.p(l,s),s&1&&T(r,1)):(r=ep(l),r.c(),T(r,1),r.m(e,null)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){t||(T(r),t=!0)},o(l){F(r),t=!1},d(l){l&&k(e),r&&r.d(),n[22](null),i=!1,rt(o)}}}let no;function $1(){return no=no||document.querySelector(".overlays"),no||(no=document.createElement("div"),no.classList.add("overlays"),document.body.appendChild(no)),no}let Eo=150;function ip(){return 1e3+$1().querySelectorAll(".overlay-panel-container.active").length}function tC(n,e,t){let{$$slots:i={},$$scope:o}=e,{class:r=""}=e,{active:l=!1}=e,{popup:s=!1}=e,{overlayClose:a=!0}=e,{btnClose:f=!0}=e,{escClose:c=!0}=e,{beforeOpen:u=void
Line truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&16&&r!==(r=_[4]))&&p(e,"for",r);const S={};y&16&&(S.id=_[4]),y&1&&(S.disabled=!B.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function r5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[3](_)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Only domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[4]+".options.onlyDomains"),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Domains that are ONLY allowed as value.
|
||||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&16&&r!==(r=_[4]+".options.onlyDomains"))&&p(e,"for",r);const S={};y&16&&(S.id=_[4]+".options.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function l5(n){let e,t,i,o,r,l,s;return i=new je({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[o5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[r5,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(e,"class","grid")},m(a,f){w(a,e,f),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),s=!0},p(a,[f]){const c={};f&2&&(c.name="schema."+a[1]+".options.exceptDomains"),f&49&&(c.$$scope={dirty:f,ctx:a}),i.$set(c);const u={};f&2&&(u.name="schema."+a[1]+".options.onlyDomains"),f&49&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(T(i.$$.fragment,a),T(l.$$.fragment,a),s=!0)},o(a){F(i.$$.fragment,a),F(l.$$.fragment,a),s=!1},d(a){a&&k(e),q(i),q(l)}}}function s5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){n.$$.not_equal(o.exceptDomains,s)&&(o.exceptDomains=s,t(0,o))}function l(s){n.$$.not_equal(o.onlyDomains,s)&&(o.onlyDomains=s,t(0,o))}return n.$$set=s=>{"key"in s&&t(1,i=s.key),"options"in s&&t(0,o=s.options)},[o,i,r,l]}class O1 extends Ie{constructor(e){super(),Le(this,e,s5,l5,Ee,{key:1,options:0})}}function a5(n){let e,t,i,o;function r(a){n[2](a)}function l(a){n[3](a)}let s={};return n[0]!==void 0&&(s.key=n[0]),n[1]!==void 0&&(s.options=n[1]),e=new O1({props:s}),he.push(()=>Fe(e,"key",r)),he.push(()=>Fe(e,"options",l)),{c(){V(e.$$.fragment)},m(a,f){H(e,a,f),o=!0},p(a,[f]){const c={};!t&&f&1&&(t=!0,c.key=a[0],Re(()=>t=!1)),!i&&f&2&&(i=!0,c.options=a[1],Re(()=>i=!1)),e.$set(c)},i(a){o||(T(e.$$.fragment,a),o=!0)},o(a){F(e.$$.fragment,a),o=!1},d(a){q(e,a)}}}function f5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(s){i=s,t(0,i)}function l(s){o=s,t(1,o)}return n.$$set=s=>{"key"in s&&t(0,i=s.key),"options"in s&&t(1,o=s.options)},[i,o,r,l]}class c5 extends Ie{constructor(e){super(),Le(this,e,f5,a5,Ee,{key:0,options:1})}}var Sa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],zo={_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!="undefined"&&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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Hr={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:"Clic
Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+N.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function ce(){t.calendarContainer.classList.add("hasWeeks");var L=wt("div","flatpickr-weekwrapper");L.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var N=wt("div","flatpickr-weeks");return L.appendChild(N),{weekWrapper:L,weekNumbers:N}}function ve(L,N){N===void 0&&(N=!0);var Q=N?L:L-t.currentMonth;Q<0&&t._hidePrevMonthArrow===!0||Q>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=Q,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ot("onYearChange"),G()),R(),ot("onMonthChange"),Ze())}function oe(L,N){if(L===void 0&&(L=!0),N===void 0&&(N=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,N===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var Q=$a(t.config),de=Q.hours,Te=Q.minutes,Ue=Q.seconds;h(de,Te,Ue)}t.redraw(),L&&ot("onChange")}function J(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ot("onClose")}function $e(){t.config!==void 0&&ot("onDestroy");for(var L=t._handlers.length;L--;)t._handlers[L].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 N=t.calendarContainer.parentNode;if(N.lastChild&&N.removeChild(N.lastChild),N.parentNode){for(;N.firstChild;)N.parentNode.insertBefore(N.firstChild,N);N.parentNode.removeChild(N)}}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(Q){try{delete t[Q]}catch{}})}function ee(L){return t.calendarContainer.contains(L)}function _e(L){if(t.isOpen&&!t.config.inline){var N=wn(L),Q=ee(N),de=N===t.input||N===t.altInput||t.element.contains(N)||L.path&&L.path.indexOf&&(~L.path.indexOf(t.input)||~L.path.indexOf(t.altInput)),Te=!de&&!Q&&!ee(L.relatedTarget),Ue=!t.config.ignoredFocusElements.some(function(tt){return tt.contains(N)});Te&&Ue&&(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 fe(L){if(!(!L||t.config.minDate&&L<t.config.minDate.getFullYear()||t.config.maxDate&&L>t.config.maxDate.getFullYear())){var N=L,Q=t.currentYear!==N;t.currentYear=N||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)),Q&&(t.redraw(),ot("onYearChange"),G())}}function ie(L,N){var Q;N===void 0&&(N=!0);var de=t.parseDate(L,void 0,N);if(t.config.minDate&&de&&Sn(de,t.config.minDate,N!==void 0?N:!t.minDateHasTime)<0||t.config.maxDate&&de&&Sn(de,t.config.maxDate,N!==void 0?N:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===void 0)return!1;for(var Te=!!t.config.enable,Ue=(Q=t.config.enable)!==null&&Q!==void 0?Q:t.config.disable,tt=0,Ge=void 0;tt<Ue.length;tt++){if(Ge=Ue[tt],typeof Ge=="function"&&Ge(de))return Te;if(Ge instanceof Date&&de!==void 0&&Ge.getTime()===de.getTime())return Te;if(typeof Ge=="string"){var nt=t.parseDate(Ge,void 0,!0);return nt&&nt.getTime()===de.getTime()?Te:!Te}else if(typeof Ge=="object"&&de!==void 0&&Ge.from&&Ge.to&&de.getTime()>=Ge.from.getTime()&&de.getTime()<=Ge.to.getTime())return Te}return!Te}function ye(L){return t.daysContainer!==void 0?L.className.indexOf("hidden")===-1&&L.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(L):!1}function Ne(L){var N=L.target===t._input,Q=t._input.value.trimEnd()!==Kt();N&&Q&&!(L.relatedTarget&&ee(L.relatedTarget))&&t.setDate(t._input.value,!0,L.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Pe(L){var N=
Line truncated
|
||||
`),d=g("span"),h=g("span"),h.textContent="Choose presets",b=$(),V(v.$$.fragment),p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[9]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(c,"class","help-block")},m(M,A){w(M,e,A),m(e,t),m(e,i),m(e,o),w(M,l,A),H(s,M,A),w(M,f,A),w(M,c,A),m(c,u),m(c,d),m(d,h),m(d,b),H(v,d,null),_=!0,y||(S=Xe(St.call(null,o,{text:`Allow uploading files ONLY with the listed mime types.
|
||||
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,A){(!_||A&512&&r!==(r=M[9]))&&p(e,"for",r);const O={};A&512&&(O.id=M[9]),!a&&A&1&&(a=!0,O.value=M[0].mimeTypes,Re(()=>a=!1)),s.$set(O);const D={};A&1025&&(D.$$scope={dirty:A,ctx:M}),v.$set(D)},i(M){_||(T(s.$$.fragment,M),T(v.$$.fragment,M),_=!0)},o(M){F(s.$$.fragment,M),F(v.$$.fragment,M),_=!1},d(M){M&&k(e),M&&k(l),q(s,M),M&&k(f),M&&k(c),q(v),y=!1,S()}}}function R5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[8](_)}let v={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Thumb sizes",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[9]),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(_,y){(!u||y&512&&r!==(r=_[9]))&&p(e,"for",r);const S={};y&512&&(S.id=_[9]),!a&&y&1&&(a=!0,S.value=_[0].thumbs,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function N5(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;return i=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[P5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[F5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[I5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[R5,({uniqueId:b})=>({9:b}),({uniqueId:b})=>b?512:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(r,"class","col-sm-6"),p(a,"class","col-sm-12"),p(u,"class","col-sm-12"),p(e,"class","grid")},m(b,v){w(b,e,v),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),h=!0},p(b,[v]){const _={};v&2&&(_.name="schema."+b[1]+".options.maxSize"),v&1537&&(_.$$scope={dirty:v,ctx:b}),i.$set(_);const y={};v&2&&(y.name="schema."+b[1]+".options.maxSelect"),v&1537&&(y.$$scope={dirty:v,ctx:b}),l.$set(y);const S={};v&2&&(S.name="schema."+b[1]+".options.mimeTypes"),v&1537&&(S.$$scope={dirty:v,ctx:b}),f.$set(S);const C={};v&2&&(C.name="schema."+b[1]+".options.thumbs"),v&1537&&(C.$$scope={dirty:v,ctx:b}),d.$set(C)},i(b){h||(T(i.$$.fragment,b),T(l.$$.fragment,b),T(f.$$.fragment,b),T(d.$$.fragment,b),h=!0)},o(b){F(i.$$.fragment,b),F(l.$$.fragment,b),F(f.$$.fragment,b),F(d.$$.fragment,b),h=!1},d(b){b&&k(e),q(i),q(l),q(f),q(d)}}}function j5(n,e,t){let{key:i=""}=e,{options:o={}}=e;function r(){o.maxSize=At(this.value),t(0,o)}function l(){o.maxSelect=At(this.value),t(0,o)}function s(d){n.$$.not_equal(o.mimeTypes,d)&&(o.mimeTypes=d,t(0,o))}const a=()=>{t(0,o.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],o)},f=()=>{t(0,o.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],o)},c=()=>{t(0,o.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],o)};function u(d){n.$$.not_equal(o.thumbs,d)&&(o.thumbs=d,t(0,o))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,o=d.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(o)&&t(0,o={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[o,i,r,l,s,a,f,c,u]}class z5 extends Ie{constructor(e){super(),Le(this,e,j5,N5,Ee,{key:1,options:0})}}function H5(n){let e,t,i,o,r,l,s;function a(c){n[5](c)}let f={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&&(f.keyOfSelected=n[0].collectionId),r=new yo({props:f}),he.push(()=>Fe(r,"keyOfSelected",a)),{c(){e=g("label"),t=j("Collection"),o=$(),V(r.$$.fragment),p(e,"for",i=n[9])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&512&&i!==(i=c[9]))&&p(e,"for",i);const d={};u&8&&(d.searchable=c[3].length>5),u&4&&(d.selectPlaceholder=c[2]?"Loading...":"Select collection"),u&8&&(d.items=c[3]),!l&&u&1&&(l=!0,d.keyOfSelected=c[0].collectionId,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function q5(n){let e,t,i,o,r,l,s,a;return{c(
Line truncated
|
||||
<code>@request.query.*</code>
|
||||
<code>@request.data.*</code>
|
||||
<code>@request.user.*</code>`,C=$(),x=g("hr"),M=$(),A=g("p"),A.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=$(),D=g("div"),D.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",E=$(),P=g("hr"),I=$(),R=g("p"),R.innerHTML=`Example rule:
|
||||
<br/>
|
||||
<code>@request.user.id!=null && created>"2022-01-01 00:00:00"</code>`,p(o,"class","m-b-0"),p(l,"class","inline-flex flex-gap-5"),p(b,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(x,"class","m-t-10 m-b-5"),p(A,"class","m-b-0"),p(D,"class","inline-flex flex-gap-5"),p(P,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Y,W){w(Y,e,W),m(e,t),m(t,i),m(i,o),m(i,r),m(i,l),m(l,s),m(l,a),m(l,f),m(l,c),m(l,u),m(l,d);for(let te=0;te<K.length;te+=1)K[te].m(l,null);m(i,h),m(i,b),m(i,v),m(i,_),m(i,y),m(i,S),m(i,C),m(i,x),m(i,M),m(i,A),m(i,O),m(i,D),m(i,E),m(i,P),m(i,I),m(i,R),U=!0},p(Y,W){if(W&1){z=Y[0].schema;let te;for(te=0;te<z.length;te+=1){const ce=Bp(Y,z,te);K[te]?K[te].p(ce,W):(K[te]=Wp(ce),K[te].c(),K[te].m(l,null))}for(;te<K.length;te+=1)K[te].d(1);K.length=z.length}},i(Y){U||(Y&&Dt(()=>{G||(G=ct(e,fn,{duration:150},!0)),G.run(1)}),U=!0)},o(Y){Y&&(G||(G=ct(e,fn,{duration:150},!1)),G.run(0)),U=!1},d(Y){Y&&k(e),qn(K,Y),Y&&G&&G.end()}}}function kx(n){let e,t=n[19].name+"",i;return{c(){e=g("code"),i=j(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){r&1&&t!==(t=o[19].name+"")&&ge(i,t)},d(o){o&&k(e)}}}function wx(n){let e,t=n[19].name+"",i,o;return{c(){e=g("code"),i=j(t),o=j(".*")},m(r,l){w(r,e,l),m(e,i),m(e,o)},p(r,l){l&1&&t!==(t=r[19].name+"")&&ge(i,t)},d(r){r&&k(e)}}}function Wp(n){let e;function t(r,l){return r[19].type==="relation"||r[19].type==="user"?wx:kx}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function Sx(n){let e=[],t=new Map,i,o,r=Object.entries(n[6]);const l=s=>s[14];for(let s=0;s<r.length;s+=1){let a=Vp(n,r,s),f=l(a);t.set(f,e[s]=Yp(f,a))}return{c(){for(let s=0;s<e.length;s+=1)e[s].c();i=lt()},m(s,a){for(let f=0;f<e.length;f+=1)e[f].m(s,a);w(s,i,a),o=!0},p(s,a){a&262235&&(r=Object.entries(s[6]),Ae(),e=st(e,a,l,1,s,r,t,i.parentNode,Pt,Yp,i,Vp),De())},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(e[a]);o=!0}},o(s){for(let a=0;a<e.length;a+=1)F(e[a]);o=!1},d(s){for(let a=0;a<e.length;a+=1)e[a].d(s);s&&k(i)}}}function Cx(n){let e;return{c(){e=g("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function xx(n){let e,t,i;function o(){return n[9](n[14])}return{c(){e=g("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Lock and set to Admins only")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function Mx(n){let e,t,i;function o(){return n[8](n[14])}return{c(){e=g("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(r,l){w(r,e,l),t||(i=[Xe(St.call(null,e,"Unlock and set custom rule")),X(e,"click",o)],t=!0)},p(r,l){n=r},d(r){r&&k(e),t=!1,rt(i)}}}function $x(n){let e;return{c(){e=j("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ax(n){let e;return{c(){e=j("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dx(n){let e,t=n[15]+"",i,o,r=Ii(n[0][n[14]])?"Admins only":"Custom rule",l,s,a,f,c=n[14],u,d,h,b,v,_,y;function S(){return n[10](n[14])}const C=()=>n[11](f,c),x=()=>n[11](null,c);function M(I){n[12](I,n[14])}var A=n[4];function O(I){let R={baseCollection:I[0],disabled:Ii(I[0][I[14]])};return I[0][I[14]]!==void 0&&(R.value=I[0][I[14]]),{props:R}}A&&(f=new A(O(n)),C(),he.push(()=>Fe(f,"value",M)));function D(I,R){return R&1&&(b=null),b==null&&(b=!!Ii(I[0][I[14]])),b?Ax:$x}let E=D(n,-1),P=E(n);return{c(){e=g("label"),i=j(t),o=j(" - "),l=j(r),a=$(),f&&V(f.$$.fragment),d=$(),h=g("div"),P.c(),p(e,"for",s=n[18]),p(h,"class","help-block")},m(I,R){w(I,e,R),m(e,i),m(e,o),m(e,l),w(I,a,R),f&&H(f,I,R),w(I,d,R),w(I,h,R),P.m(h,null),v=!0,_||(y=X(e,"click",S),_=!0)},p(I,R){n=I,(!v||R&1)&&r!==(r=Ii(n[0][n[14]])?"Admins only":"Custom rule")&&ge(l,r),(!v||R&262144&&s!==(s=n[18]))&&p(e,"for",s),c!==n[14]&&(x(),c=n[14],C());const G={};if(R&1&&(G.baseCollection=n[0]),R&1&&(G.disabled=Ii(n[0][n[14]])),!u&&R&65&&(u=!0,G.value=n[0][n[14]],Re(()=>u=!1)),A!==(A=n[4])){if(f){Ae();const U=f;F(U.$$.fragment,1,0,()=>{q(U,1)}),De()}A?(f=new A(O(n)),C(),he.push(()=>Fe(f,"value",M)),V(f.$$.fragment),T(f.$$.fragment,1),H(f,d.parentNode,d)):f=null}else A&&f.$set(G);E!==(E=D(n,R))&&(P.d(1),P=E(n),P&&(P.c(),P.m(h,null)))},i(I){v||(f&&T(f.$$.fragment,I),v=!0)},o(I){f&&F(f.$$.fragment,I),v=!1},d(I){I&&k(e),I&&k(a),x(),f&&q(f,I),I&&k(d),I&&k(h),P.d(),_=!1,y()}}}function Yp(n,e){let t,i,o,r,l,s,a,f;function c(h,b){return b&1&&(r=null),r==null&&(r=!!Ii(h[0][h[14]])),r?Mx:xx}let u=c(e,-1),d=u(e);return s=new je({props:{class:"form-field rule-field m-0 "+(Ii(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{defaLine truncated
|
||||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||||
</a>.`,o=$(),r=g("span"),s=j(l),a=$(),_&&_.c(),f=$(),u.c(),d=lt(),p(r,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(x,M){w(x,e,M),m(e,t),m(t,i),m(t,o),m(t,r),m(r,s),m(e,a),_&&_.m(e,null),w(x,f,M),S[c].m(x,M),w(x,d,M),h=!0,b||(v=X(r,"click",n[7]),b=!0)},p(x,[M]){(!h||M&4)&&l!==(l=x[2]?"Hide available fields":"Show available fields")&&ge(s,l),x[2]?_?(_.p(x,M),M&4&&T(_,1)):(_=Up(x),_.c(),T(_,1),_.m(e,null)):_&&(Ae(),F(_,1,1,()=>{_=null}),De());let A=c;c=C(x),c===A?S[c].p(x,M):(Ae(),F(S[A],1,1,()=>{S[A]=null}),De(),u=S[c],u?u.p(x,M):(u=S[c]=y[c](x),u.c()),T(u,1),u.m(d.parentNode,d))},i(x){h||(T(_),T(u),h=!0)},o(x){F(_),F(u),h=!1},d(x){x&&k(e),_&&_.d(),x&&k(f),S[c].d(x),x&&k(d),b=!1,v()}}}function Ii(n){return n===null}function Tx(n,e,t){let{collection:i=new En}=e,o={},r=!1,l={},s,a=!1;const f={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function c(){t(5,a=!0);try{t(4,s=(await _i(()=>import("./FilterAutocompleteInput.3cd8dab2.js"),[])).default)}catch(y){console.warn(y),t(4,s=null)}t(5,a=!1)}di(()=>{c()});const u=()=>t(2,r=!r),d=async y=>{var S;t(0,i[y]=o[y]||"",i),await Bi(),(S=l[y])==null||S.focus()},h=y=>{t(1,o[y]=i[y],o),t(0,i[y]=null,i)},b=y=>{var S;return(S=l[y])==null?void 0:S.focus()};function v(y,S){he[y?"unshift":"push"](()=>{l[S]=y,t(3,l)})}function _(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,o,r,l,s,a,f,u,d,h,b,v,_]}class Ex extends Ie{constructor(e){super(),Le(this,e,Tx,Ox,Ee,{collection:0})}}function Gp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jp(n){let e;return{c(){e=g("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 Zp(n){let e,t,i,o,r=n[1].originalName+"",l,s,a,f,c,u=n[1].name+"",d;return{c(){e=g("li"),t=g("div"),i=j(`Renamed collection
|
||||
`),o=g("strong"),l=j(r),s=$(),a=g("i"),f=$(),c=g("strong"),d=j(u),p(o,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(c,"class","txt"),p(t,"class","inline-flex")},m(h,b){w(h,e,b),m(e,t),m(t,i),m(t,o),m(o,l),m(t,s),m(t,a),m(t,f),m(t,c),m(c,d)},p(h,b){b&2&&r!==(r=h[1].originalName+"")&&ge(l,r),b&2&&u!==(u=h[1].name+"")&&ge(d,u)},d(h){h&&k(e)}}}function Xp(n){let e,t,i,o,r=n[14].originalName+"",l,s,a,f,c,u=n[14].name+"",d;return{c(){e=g("li"),t=g("div"),i=j(`Renamed field
|
||||
`),o=g("strong"),l=j(r),s=$(),a=g("i"),f=$(),c=g("strong"),d=j(u),p(o,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(c,"class","txt"),p(t,"class","inline-flex")},m(h,b){w(h,e,b),m(e,t),m(t,i),m(t,o),m(o,l),m(t,s),m(t,a),m(t,f),m(t,c),m(c,d)},p(h,b){b&16&&r!==(r=h[14].originalName+"")&&ge(l,r),b&16&&u!==(u=h[14].name+"")&&ge(d,u)},d(h){h&&k(e)}}}function Qp(n){let e,t,i,o=n[14].name+"",r,l;return{c(){e=g("li"),t=j("Removed field "),i=g("span"),r=j(o),l=$(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(s,a){w(s,e,a),m(e,t),m(e,i),m(i,r),m(e,l)},p(s,a){a&8&&o!==(o=s[14].name+"")&&ge(r,o)},d(s){s&&k(e)}}}function Px(n){let e,t,i,o,r,l,s,a,f,c,u,d,h=n[3].length&&Jp(),b=n[5]&&Zp(n),v=n[4],_=[];for(let C=0;C<v.length;C+=1)_[C]=Xp(Kp(n,v,C));let y=n[3],S=[];for(let C=0;C<y.length;C+=1)S[C]=Qp(Gp(n,y,C));return{c(){e=g("div"),t=g("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=$(),o=g("div"),r=g("p"),r.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||||
update it manually!`,l=$(),h&&h.c(),s=$(),a=g("h6"),a.textContent="Changes:",f=$(),c=g("ul"),b&&b.c(),u=$();for(let C=0;C<_.length;C+=1)_[C].c();d=$();for(let C=0;C<S.length;C+=1)S[C].c();p(t,"class","icon"),p(o,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(c,"class","changes-list svelte-1ghly2p")},m(C,x){w(C,e,x),m(e,t),m(e,i),m(e,o),m(o,r),m(o,l),h&&h.m(o,null),w(C,s,x),w(C,a,x),w(C,f,x),w(C,c,x),b&&b.m(c,null),m(c,u);for(let M=0;M<_.length;M+=1)_[M].m(c,null);m(c,d);for(let M=0;M<S.length;M+=1)S[M].m(c,null)},p(C,x){if(C[3].length?h||(h=Jp(),h.c(),h.m(o,null)):h&&(h.d(1),h=null),C[5]?b?b.p(C,x):(b=Zp(C),b.c(),b.m(c,u)):b&&(b.d(1),b=null),x&16){v=C[4];let M;for(M=0;M<v.length;M+=1){const A=Kp(C,v,M);_[M]?_[M].p(A,x):(_[M]=Xp(A),_[M].c(),_[M].m(c,d))}for(;M<_.length;M+=1)_[M].d(1);_.length=v.length}if(x&8){y=C[3];let M;for(M=0;M<y.length;M+=1){const A=Gp(C,y,M);S[M]?S[M].p(A,x):(S[M]=Qp(A),S[M].c(),S[M].m(c,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(s),C&&k(a),C&&k(f),C&&k(c),b&&b.d(),qn(_,C),qn(S,C)}}}function Fx(n){let e;return{c(){e=g("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Lx(n){let e,t,i,o,r;return{c(){e=g("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),i=g("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),e.focus(),o||(r=[X(e,"click",n[8]),X(i,"click",n[9])],o=!0)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),o=!1,rt(r)}}}function Ix(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[Lx],header:[Fx],default:[Px]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&524346&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[10](null),q(e,o)}}}function Rx(n,e,t){let i,o,r;const l=yn();let s,a;async function f(y){t(1,a=y),await Bi(),!i&&!o.length&&!r.length?u():s==null||s.show()}function c(){s==null||s.hide()}function u(){c(),l("confirm")}const d=()=>c(),h=()=>u();function b(y){he[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){ft.call(this,n,y)}function _(y){ft.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,o=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,r=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[c,a,s,r,o,i,u,f,d,h,b,v,_]}class Nx extends Ie{constructor(e){super(),Le(this,e,Rx,Ix,Ee,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function eh(n){let e,t,i,o;function r(s){n[26](s)}let l={};return n[2]!==void 0&&(l.collection=n[2]),t=new Ex({props:l}),he.push(()=>Fe(t,"collection",r)),{c(){e=g("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(s,a){w(s,e,a),H(t,e,null),o=!0},p(s,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=s[2],Re(()=>i=!1)),t.$set(f)},i(s){o||(T(t.$$.fragment,s),o=!0)},o(s){F(t.$$.fragment,s),o=!1},d(s){s&&k(e),q(t)}}}function jx(n){let e,t,i,o,r,l;function s(c){n[25](c)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new yx({props:a}),he.push(()=>Fe(i,"collection",s));let f=n[9]===qr&&eh(n);return{c(){e=g("div"),t=g("div"),V(i.$$.fragment),r=$(),f&&f.c(),p(t,"class","tab-item"),ne(t,"active",n[9]===ho),p(e,"class","tabs-content svelte-b10vi")},m(c,u){w(c,e,u),m(e,t),H(i,t,null),m(e,r),f&&f.m(e,null),l=!0},p(c,u){const d={};!o&&u[0]&4&&(o=!0,d.collection=c[2],Re(()=>o=!1)),i.$set(d),u[0]&512&&ne(t,"active",c[9]===ho),c[9]===qr?f?(f.p(c,u),u[0]&512&&T(f,1)):(f=eh(c),f.c(),T(f,1),f.m(e,null)):f&&(Ae(),F(f,1,1,()=>{f=null}),De())},i(c){l||(T(i.$$.fragment,c),T(f),l=!0)},o(c){F(i.$$.fragment,c),F(f),l=!1},d(c){c&&k(e),q(i),f&&f.d()}}}function th(n){let e,t,i,o,r,l,s;return l=new vo({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[zx]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=$(),i=g("button"),o=g("i"),r=$(),V(l.$$.fragment),p(e,"class","flex-fill"),p(o,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),m(i,o),m(i,r),H(l,i,null),s=!0},p(a,f){const c={};f[1]&256&&(c.$$scope={dirty:f,ctx:a}),l.$set(c)},i(a){s||(T(l.$$.fragment,a),s=!0)},o(a){F(l.$$.fragment,a),s=!1},d(a){a&&k(e),a&&k(t),a&&k(i),q(l)}}}function zx(n){let e,t,i;return{c(){e=g("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[20]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function nh(n){let e;return{c(){e=g("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hx(n){let e,t,i,o,r,l,s,a,f,c,u,d,h=n[2].system&&nh();return{c(){e=g("label"),t=j("Name"),o=$(),r=g("input"),f=$(),h&&h.c(),c=lt(),p(e,"for",i=n[38]),p(r,"type","text"),p(r,"id",l=n[38]),r.required=!0,r.disabled=n[11],p(r,"spellcheck","false"),r.autofocus=s=n[2].isNew,p(r,"placeholder",'eg. "posts"'),r.value=a=n[2].name},m(b,v){w(b,e,v),m(e,t),w(b,o,v),w(b,r,v),w(b,f,v),h&&h.m(b,v),w(b,c,v),n[2].isNew&&r.focus(),u||(d=X(r,"input",n[21]),u=!0)},p(b,v){v[1]&128&&i!==(i=b[38])&&p(e,"for",i),v[1]&128&&l!==(l=b[38])&&p(r,"id",l),v[0]&2048&&(r.disabled=b[11]),v[0]&4&&s!==(s=b[2].isNew)&&(r.autofocus=s),v[0]&4&&a!==(a=b[2].name)&&r.value!==a&&(r.value=a),b[2].system?h||(h=nh(),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(f),h&&h.d(b),b&&k(c),u=!1,d()}}}function ih(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,n[12])),r=!0)},p(s,a){t&&Yn(t.update)&&a[0]&4096&&t.update.call(null,s[12])},i(s){o||(s&&Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){s&&(i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0)),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function oh(n){let e,t,i,o,r;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(l,s){w(l,e,s),i=!0,o||(r=Xe(St.call(null,e,"Has errors")),o=!0)},i(l){i||(l&&Dt(()=>{t||(t=ct(e,Bn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(l){l&&(t||(t=ct(e,Bn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end(),o=!1,r()}}}function qx(n){var I,R,G,U,z,K;let e,t=n[2].isNew?"New collection":"Edit collection",i,o,r,l,s,a,f,c,u,d,h,b,v=!B.isEmpty((I=n[4])==null?void 0:I.schema),_,y,S,C,x=!B.isEmpty((R=n[4])==null?void 0:R.listRule)||!B.isEmpty((G=n[4])==null?void 0:G.viewRule)||!B.isEmpty((U=n[4])==null?void 0:U.createRule)||!B.isEmpty((z=n[4])==null?void 0:z.updateRule)||!B.isEmpty((K=n[4])==null?void 0:K.deleteRule),M,A,O,D=!n[2].isNew&&!n[2].system&&th(n);s=new je({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[Hx,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let E=v&&ih(n),P=x&&oh();return{c(){e=g("h4"),i=j(t),o=$(),D&&D.c(),r=$(),l=g("form"),V(s.$$.fragment),a=$(),f=g("input"),c=$(),u=g("div"),d=g("button"),h=g("span"),h.textContent="Fields",b=$(),E&&E.c(),_=$(),y=g("button"),S=g("span"),S.textContent="API Rules",C=$(),P&&P.c(),p(f,"type","submit"),p(f,"class","hidden"),p(f,"tabindex","-1"),p(l,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ne(d,"active",n[9]===ho),p(S,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ne(y,"active",n[9]===qr),p(u,"class","tabs-header stretched")},m(Y,W){w(Y,e,W),m(e,i),w(Y,o,W),D&&D.m(Y,W),w(Y,r,W),w(Y,l,W),H(s,l,null),m(l,a),m(l,f),w(Y,c,W),w(Y,u,W),m(u,d),m(d,h),m(d,b),E&&E.m(d,null),m(u,_),m(u,y),m(y,S),m(y,C),P&&P.m(y,null),M=!0,A||(O=[X(l,"submit",Gt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],A=!0)},p(Y,W){var ce,ve,oe,J,$e,ee;(!M||W[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ge(i,t),!Y[2].isNew&&!Y[2].system?D?(D.p(Y,W),W[0]&4&&T(D,1)):(D=th(Y),D.c(),T(D,1),D.m(r.parentNode,r)):D&&(Ae(),F(D,1,1,()=>{D=null}),De());const te={};W[0]&2048&&(te.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),W[0]&2052|W[1]&384&&(te.$$scope={dirty:W,ctx:Y}),s.$set(te),W[0]&16&&(v=!B.isEmpty((ce=Y[4])==null?void 0:ce.schema)),v?E?(E.p(Y,W),W[0]&16&&T(E,1)):(E=ih(Y),E.c(),T(E,1),E.m(d,null)):E&&(Ae(),F(E,1,1,()=>{E=null}),De()),W[0]&512&&ne(d,"active",Y[9]===ho),W[0]&16&&(x=!B.isEmpty((ve=Y[4])==null?void 0:ve.listRule)||!B.isEmpty((oe=Y[4])==null?void 0:oe.viewRule)||!B.isEmpty((J=Y[4])==null?void 0:J.createRule)||!B.isEmpty(($e=Y[4])==null?void 0:$e.updateRule)||!B.isEmpty((ee=Y[4])==null?void 0:ee.deleteRule)),x?P?W[0]&16&&T(P,1):(P=oh(),P.c(),T(P,1),P.m(y,null)):P&&(Ae(),F(P,1,1,()=>{P=null}),De()),W[0]&512&&ne(y,"active",Y[9]===qr)},i(Y){M||(T(D),T(s.$$.fragment,Y),T(E),T(P),M=!0)},o(Y){F(D),F(s.$$.fragment,Y),F(E),F(P),M=!1},d(Y){Y&&k(e),Y&&k(o),D&&D.d(Y),Y&&k(r),Y&&k(l),q(s),Y&&k(c),Y&&k(u),E&&E.d(),P&&P.d(),A=!1,rt(O)}}}function Vx(n){let e,t,i,o,r,l=n[2].isNew?"Create":"Save changes",s,a,f,c;return{c(){e=g("button"),t=g("span"),t.textContent="Cancel",i=$(),o=g("button"),r=g("span"),s=j(l),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=a=!n[10]||n[7],ne(o,"btn-loading",n[7])},m(u,d){w(u,e,d),m(e,t),w(u,i,d),w(u,o,d),m(o,r),m(r,s),f||(c=[X(e,"click",n[18]),X(o,"click",n[19Line truncated
|
||||
<span class="txt">New collection</span>`,y=$(),V(S.$$.fragment),p(r,"type","button"),p(r,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ne(r,"hidden",!n[4]),p(o,"class","form-field-addon"),p(s,"type","text"),p(s,"placeholder","Search collections..."),p(i,"class","form-field search"),ne(i,"active",n[4]),p(t,"class","sidebar-header"),p(f,"class","m-t-5 m-b-xs"),p(u,"class","sidebar-content"),p(_,"type","button"),p(_,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,o),m(o,r),m(i,l),m(i,s),Me(s,n[0]),m(e,a),m(e,f),m(e,c),m(e,u);for(let R=0;R<d.length;R+=1)d[R].m(u,null);D&&D.m(u,null),m(e,b),m(e,v),m(v,_),w(P,y,I),H(S,P,I),C=!0,x||(M=[X(r,"click",n[8]),X(s,"input",n[9]),X(_,"click",n[11])],x=!0)},p(P,[I]){I&16&&ne(r,"hidden",!P[4]),I&1&&s.value!==P[0]&&Me(s,P[0]),I&16&&ne(i,"active",P[4]),I&106&&(A=P[3],d=st(d,I,O,1,P,A,h,u,an,ah,null,rh),!A.length&&D?D.p(P,I):A.length?D&&(D.d(1),D=null):(D=lh(P),D.c(),D.m(u,null)));const R={};S.$set(R)},i(P){C||(T(S.$$.fragment,P),C=!0)},o(P){F(S.$$.fragment,P),C=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();D&&D.d(),P&&k(y),n[12](null),q(S,P),x=!1,rt(M)}}}function Kx(n,e,t){let i,o,r,l,s;pn(n,fi,_=>t(5,l=_)),pn(n,Go,_=>t(7,s=_));let a,f="";function c(_){jb(fi,l=_,l)}const u=()=>t(0,f="");function d(){f=this.value,t(0,f)}const h=_=>c(_),b=()=>a==null?void 0:a.show();function v(_){he[_?"unshift":"push"](()=>{a=_,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,o=f!==""),n.$$.dirty&131&&t(3,r=s.filter(_=>_.name!="profiles"&&(_.id==f||_.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,a,r,o,l,c,s,u,d,h,b,v]}class Jx extends Ie{constructor(e){super(),Le(this,e,Kx,Gx,Ee,{})}}function Zx(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He;return{c(){e=g("p"),e.innerHTML=`The syntax basically follows the format
|
||||
<code><span class="txt-success">OPERAND</span>
|
||||
<span class="txt-danger">OPERATOR</span>
|
||||
<span class="txt-success">OPERAND</span></code>, where:`,t=$(),i=g("ul"),o=g("li"),o.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||||
quoted), number, null, true, false`,r=$(),l=g("li"),s=g("code"),s.textContent="OPERATOR",a=j(` - is one of:
|
||||
`),f=g("br"),c=$(),u=g("ul"),d=g("li"),h=g("code"),h.textContent="=",b=$(),v=g("span"),v.textContent="Equal",_=$(),y=g("li"),S=g("code"),S.textContent="!=",C=$(),x=g("span"),x.textContent="NOT equal",M=$(),A=g("li"),O=g("code"),O.textContent=">",D=$(),E=g("span"),E.textContent="Greater than",P=$(),I=g("li"),R=g("code"),R.textContent=">=",G=$(),U=g("span"),U.textContent="Greater than or equal",z=$(),K=g("li"),Y=g("code"),Y.textContent="<",W=$(),te=g("span"),te.textContent="Less than or equal",ce=$(),ve=g("li"),oe=g("code"),oe.textContent="<=",J=$(),$e=g("span"),$e.textContent="Less than or equal",ee=$(),_e=g("li"),fe=g("code"),fe.textContent="~",ie=$(),ye=g("span"),ye.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||||
match)`,Ne=$(),Pe=g("li"),ze=g("code"),ze.textContent="!~",se=$(),re=g("span"),re.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ke=$(),He=g("p"),He.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(s,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p(x,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(E,"class","txt-hint"),p(R,"class","filter-op svelte-1w7s5nw"),p(U,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(te,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p($e,"class","txt-hint"),p(fe,"class","filter-op svelte-1w7s5nw"),p(ye,"class","txt-hint"),p(ze,"class","filter-op svelte-1w7s5nw"),p(re,"class","txt-hint")},m(qe,Je){w(qe,e,Je),w(qe,t,Je),w(qe,i,Je),m(i,o),m(i,r),m(i,l),m(l,s),m(l,a),m(l,f),m(l,c),m(l,u),m(u,d),m(d,h),m(d,b),m(d,v),m(u,_),m(u,y),m(y,S),m(y,C),m(y,x),m(u,M),m(u,A),m(A,O),m(A,D),m(A,E),m(u,P),m(u,I),m(I,R),m(I,G),m(I,U),m(u,z),m(u,K),m(K,Y),m(K,W),m(K,te),m(u,ce),m(u,ve),m(ve,oe),m(ve,J),m(ve,$e),m(u,ee),m(u,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(u,Ne),m(u,Pe),m(Pe,ze),m(Pe,se),m(Pe,re),w(qe,ke,Je),w(qe,He,Je)},p:le,i:le,o:le,d(qe){qe&&k(e),qe&&k(t),qe&&k(i),qe&&k(ke),qe&&k(He)}}}class Xx extends Ie{constructor(e){super(),Le(this,e,null,Zx,Ee,{})}}function fh(n,e,t){const i=n.slice();return i[8]=e[t],i}function ch(n,e,t){const i=n.slice();return i[8]=e[t],i}function uh(n,e,t){const i=n.slice();return i[13]=e[t],i}function dh(n,e,t){const i=n.slice();return i[13]=e[t],i}function ph(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hh(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function mh(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function bh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("div"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function gh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function Qx(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y=n[0].name+"",S,C,x,M,A,O,D,E=[],P=new Map,I,R,G=[],U=new Map,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He,qe,Je,be,Oe,Z,ae,Ve,yt,it,bt,at,vt,qt,Mt,$t,me,Ce,Ye,ot,cn,ue,we,Ze,Kt,zt,ni,pe,L,N,Q,de,Te,Ue,tt,Ge,nt=[],Ke=new Map,et,gt,Ft=[],nn=new Map,Fn,Vt=n[1]&&ph(),wo=n[4];const So=xe=>xe[13].lang;for(let xe=0;xe<wo.length;xe+=1){let We=dh(n,wo,xe),Ot=So(We);P.set(Ot,E[xe]=hh(Ot,We))}let Gi=n[4];const nl=xe=>xe[13].lang;for(let xe=0;xe<Gi.length;xe+=1){let We=uh(n,Gi,xe),Ot=nl(We);U.set(Ot,G[xe]=mh(Ot,We))}be=new tn({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),vt=new tn({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),Mt=new Xx({}),Ze=new tn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let Co=n[5];const il=xe=>xe[8].code;for(let xe=0;xe<Co.length;xe+=1){let We=ch(n,Co,xe),Ot=il(We);Ke.set(Ot,nt[xe]=bh(Ot,We))}let Ki=n[5];const ol=xe=>xe[8].code;for(let xe=0;xe<Ki.length;xe+=1){let We=fh(n,Ki,xe),Ot=ol(We);nn.set(Ot,Ft[xe]=gh(Ot,We))}return{c(){e=g("div"),t=g("strong"),t.textContent="GET",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records"),u=$(),Vt&&Vt.c(),d=$(),h=g("div"),b=g("p"),v=j("Fetch a paginated "),_=g("strong"),S=j(y),C=j(" records list."),x=$(),M=g("div"),M.textContent="Client SDKs example",A=$(),O=g("div"),D=g("div");for(let xe=0;xe<E.length;xe+=1)E[xe].c();I=$(),R=g("div");for(let xe=0;xe<G.length;xe+=1)G[xe].c();z=$(),K=g("div"),K.textContent="Query parameters",Y=$(),W=g("table"),te=g("thead"),te.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,ce=$(),ve=g("tbody"),oe=g("tr"),oe.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,J=$(),$e=g("tr"),$e.innerHTML=`<td>perPage</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>Specify the max returned records per page (default to 30).</td>`,ee=$(),_e=g("tr"),fe=g("td"),fe.textContent="sort",ie=$(),ye=g("td"),ye.innerHTML='<span class="label">String</span>',Ne=$(),Pe=g("td"),ze=j("Specify the records order attribute(s). "),se=g("br"),re=j(`
|
||||
Add `),ke=g("code"),ke.textContent="-",He=j(" / "),qe=g("code"),qe.textContent="+",Je=j(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),V(be.$$.fragment),Oe=$(),Z=g("tr"),ae=g("td"),ae.textContent="filter",Ve=$(),yt=g("td"),yt.innerHTML='<span class="label">String</span>',it=$(),bt=g("td"),at=j(`Filter the returned records. Ex.:
|
||||
`),V(vt.$$.fragment),qt=$(),V(Mt.$$.fragment),$t=$(),me=g("tr"),Ce=g("td"),Ce.textContent="expand",Ye=$(),ot=g("td"),ot.innerHTML='<span class="label">String</span>',cn=$(),ue=g("td"),we=j(`Auto expand nested record relations. Ex.:
|
||||
`),V(Ze.$$.fragment),Kt=j(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),zt=g("br"),ni=j(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),pe=g("code"),pe.textContent="@expand",L=j(" property (eg. "),N=g("code"),N.textContent='"@expand": {"rel1": {...}, ...}',Q=j(")."),de=$(),Te=g("div"),Te.textContent="Responses",Ue=$(),tt=g("div"),Ge=g("div");for(let xe=0;xe<nt.length;xe+=1)nt[xe].c();et=$(),gt=g("div");for(let xe=0;xe<Ft.length;xe+=1)Ft[xe].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(D,"class","tabs-header compact left"),p(R,"class","tabs-content"),p(O,"class","tabs m-b-lg"),p(K,"class","section-title"),p(W,"class","table-compact table-border m-b-lg"),p(Te,"class","section-title"),p(Ge,"class","tabs-header compact left"),p(gt,"class","tabs-content"),p(tt,"class","tabs")},m(xe,We){w(xe,e,We),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(e,u),Vt&&Vt.m(e,null),w(xe,d,We),w(xe,h,We),m(h,b),m(b,v),m(b,_),m(_,S),m(b,C),w(xe,x,We),w(xe,M,We),w(xe,A,We),w(xe,O,We),m(O,D);for(let Ot=0;Ot<E.length;Ot+=1)E[Ot].m(D,null);m(O,I),m(O,R);for(let Ot=0;Ot<G.length;Ot+=1)G[Ot].m(R,null);w(xe,z,We),w(xe,K,We),w(xe,Y,We),w(xe,W,We),m(W,te),m(W,ce),m(W,ve),m(ve,oe),m(ve,J),m(ve,$e),m(ve,ee),m(ve,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(_e,Ne),m(_e,Pe),m(Pe,ze),m(Pe,se),m(Pe,re),m(Pe,ke),m(Pe,He),m(Pe,qe),m(Pe,Je),H(be,Pe,null),m(ve,Oe),m(ve,Z),m(Z,ae),m(Z,Ve),m(Z,yt),m(Z,it),m(Z,bt),m(bt,at),H(vt,bt,null),m(bt,qt),H(Mt,bt,null),m(ve,$t),m(ve,me),m(me,Ce),m(me,Ye),m(me,ot),m(me,cn),m(me,ue),m(ue,we),H(Ze,ue,null),m(ue,Kt),m(ue,zt),m(ue,ni),m(ue,pe),m(ue,L),m(ue,N),m(ue,Q),w(xe,de,We),w(xe,Te,We),w(xe,Ue,We),w(xe,tt,We),m(tt,Ge);for(let Ot=0;Ot<nt.length;Ot+=1)nt[Ot].m(Ge,null);m(tt,et),m(tt,gt);for(let Ot=0;Ot<Ft.length;Ot+=1)Ft[Ot].m(gt,null);Fn=!0},p(xe,[We]){(!Fn||We&1)&&a!==(a=xe[0].name+"")&&ge(f,a),xe[1]?Vt||(Vt=ph(),Vt.c(),Vt.m(e,null)):Vt&&(Vt.d(1),Vt=null),(!Fn||We&1)&&y!==(y=xe[0].name+"")&&ge(S,y),We&24&&(wo=xe[4],E=st(E,We,So,1,xe,wo,P,D,an,hh,null,dh)),We&24&&(Gi=xe[4],Ae(),G=st(G,We,nl,1,xe,Gi,U,R,Pt,mh,null,uh),De()),We&36&&(Co=xe[5],nt=st(nt,We,il,1,xe,Co,Ke,Ge,an,bh,null,ch)),We&36&&(Ki=xe[5],Ae(),Ft=st(Ft,We,ol,1,xe,Ki,nn,gt,Pt,gh,null,fh),De())},i(xe){if(!Fn){for(let We=0;We<Gi.length;We+=1)T(G[We]);T(be.$$.fragment,xe),T(vt.$$.fragment,xe),T(Mt.$$.fragment,xe),T(Ze.$$.fragment,xe);for(let We=0;We<Ki.length;We+=1)T(Ft[We]);Fn=!0}},o(xe){for(let We=0;We<G.length;We+=1)F(G[We]);F(be.$$.fragment,xe),F(vt.$$.fragment,xe),F(Mt.$$.fragment,xe),F(Ze.$$.fragment,xe);for(let We=0;We<Ft.length;We+=1)F(Ft[We]);Fn=!1},d(xe){xe&&k(e),Vt&&Vt.d(),xe&&k(d),xe&&k(h),xe&&k(x),xe&&k(M),xe&&k(A),xe&&k(O);for(let We=0;We<E.length;We+=1)E[We].d();for(let We=0;We<G.length;We+=1)G[We].d();xe&&k(z),xe&&k(K),xe&&k(Y),xe&&k(W),q(be),q(vt),q(Mt),q(Ze),xe&&k(de),xe&&k(Te),xe&&k(Ue),xe&&k(tt);for(let We=0;We<nt.length;We+=1)nt[We].d();for(let We=0;We<Ft.length;We+=1)Ft[We].d()}}}function e6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.listRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(o),B.dummyCollectionRecord(o)]},null,2)}),s.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&s.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),s.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${Se.baseUrl}");
|
||||
|
||||
client.Records.getList("${o==null?void 0:o.name}", { page: 2 })
|
||||
.then(function (list) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
client.Records.getFullList("${o==null?void 0:o.name}", 200 /* batch size */);
|
||||
.then(function (records) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[o,i,r,l,a,s,f,c]}class t6 extends Ie{constructor(e){super(),Le(this,e,e6,Qx,Ee,{collection:0})}}function _h(n,e,t){const i=n.slice();return i[8]=e[t],i}function vh(n,e,t){const i=n.slice();return i[8]=e[t],i}function yh(n,e,t){const i=n.slice();return i[13]=e[t],i}function kh(n,e,t){const i=n.slice();return i[13]=e[t],i}function wh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sh(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function Ch(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function xh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Mh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function n6(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P=[],I=new Map,R,G,U=[],z=new Map,K,Y,W,te,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe,ze,se,re,ke,He,qe,Je,be,Oe,Z,ae,Ve,yt,it,bt,at=[],vt=new Map,qt,Mt,$t=[],me=new Map,Ce,Ye=n[1]&&wh(),ot=n[4];const cn=pe=>pe[13].lang;for(let pe=0;pe<ot.length;pe+=1){let L=kh(n,ot,pe),N=cn(L);I.set(N,P[pe]=Sh(N,L))}let ue=n[4];const we=pe=>pe[13].lang;for(let pe=0;pe<ue.length;pe+=1){let L=yh(n,ue,pe),N=we(L);z.set(N,U[pe]=Ch(N,L))}re=new tn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let Ze=n[5];const Kt=pe=>pe[8].code;for(let pe=0;pe<Ze.length;pe+=1){let L=vh(n,Ze,pe),N=Kt(L);vt.set(N,at[pe]=xh(N,L))}let zt=n[5];const ni=pe=>pe[8].code;for(let pe=0;pe<zt.length;pe+=1){let L=_h(n,zt,pe),N=ni(L);me.set(N,$t[pe]=Mh(N,L))}return{c(){e=g("div"),t=g("strong"),t.textContent="GET",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),Ye&&Ye.c(),h=$(),b=g("div"),v=g("p"),_=j("Fetch a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("div"),A.textContent="Client SDKs example",O=$(),D=g("div"),E=g("div");for(let pe=0;pe<P.length;pe+=1)P[pe].c();R=$(),G=g("div");for(let pe=0;pe<U.length;pe+=1)U[pe].c();K=$(),Y=g("div"),Y.textContent="Path Parameters",W=$(),te=g("table"),te.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,ce=$(),ve=g("div"),ve.textContent="Query parameters",oe=$(),J=g("table"),$e=g("thead"),$e.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,ee=$(),_e=g("tbody"),fe=g("tr"),ie=g("td"),ie.textContent="expand",ye=$(),Ne=g("td"),Ne.innerHTML='<span class="label">String</span>',Pe=$(),ze=g("td"),se=j(`Auto expand nested record relations. Ex.:
|
||||
`),V(re.$$.fragment),ke=j(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),He=g("br"),qe=j(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Je=g("code"),Je.textContent="@expand",be=j(" property (eg. "),Oe=g("code"),Oe.textContent='"@expand": {"rel1": {...}, ...}',Z=j(")."),ae=$(),Ve=g("div"),Ve.textContent="Responses",yt=$(),it=g("div"),bt=g("div");for(let pe=0;pe<at.length;pe+=1)at[pe].c();qt=$(),Mt=g("div");for(let pe=0;pe<$t.length;pe+=1)$t[pe].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-info"),p(b,"class","content m-b-base"),p(A,"class","section-title"),p(E,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(Y,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(Ve,"class","section-title"),p(bt,"class","tabs-header compact left"),p(Mt,"class","tabs-content"),p(it,"class","tabs")},m(pe,L){w(pe,e,L),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),Ye&&Ye.m(e,null),w(pe,h,L),w(pe,b,L),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),w(pe,M,L),w(pe,A,L),w(pe,O,L),w(pe,D,L),m(D,E);for(let N=0;N<P.length;N+=1)P[N].m(E,null);m(D,R),m(D,G);for(let N=0;N<U.length;N+=1)U[N].m(G,null);w(pe,K,L),w(pe,Y,L),w(pe,W,L),w(pe,te,L),w(pe,ce,L),w(pe,ve,L),w(pe,oe,L),w(pe,J,L),m(J,$e),m(J,ee),m(J,_e),m(_e,fe),m(fe,ie),m(fe,ye),m(fe,Ne),m(fe,Pe),m(fe,ze),m(ze,se),H(re,ze,null),m(ze,ke),m(ze,He),m(ze,qe),m(ze,Je),m(ze,be),m(ze,Oe),m(ze,Z),w(pe,ae,L),w(pe,Ve,L),w(pe,yt,L),w(pe,it,L),m(it,bt);for(let N=0;N<at.length;N+=1)at[N].m(bt,null);m(it,qt),m(it,Mt);for(let N=0;N<$t.length;N+=1)$t[N].m(Mt,null);Ce=!0},p(pe,[L]){(!Ce||L&1)&&a!==(a=pe[0].name+"")&&ge(f,a),pe[1]?Ye||(Ye=wh(),Ye.c(),Ye.m(e,null)):Ye&&(Ye.d(1),Ye=null),(!Ce||L&1)&&S!==(S=pe[0].name+"")&&ge(C,S),L&24&&(ot=pe[4],P=st(P,L,cn,1,pe,ot,I,E,an,Sh,null,kh)),L&24&&(ue=pe[4],Ae(),U=st(U,L,we,1,pe,ue,z,G,Pt,Ch,null,yh),De()),L&36&&(Ze=pe[5],at=st(at,L,Kt,1,pe,Ze,vt,bt,an,xh,null,vh)),L&36&&(zt=pe[5],Ae(),$t=st($t,L,ni,1,pe,zt,me,Mt,Pt,Mh,null,_h),De())},i(pe){if(!Ce){for(let L=0;L<ue.length;L+=1)T(U[L]);T(re.$$.fragment,pe);for(let L=0;L<zt.length;L+=1)T($t[L]);Ce=!0}},o(pe){for(let L=0;L<U.length;L+=1)F(U[L]);F(re.$$.fragment,pe);for(let L=0;L<$t.length;L+=1)F($t[L]);Ce=!1},d(pe){pe&&k(e),Ye&&Ye.d(),pe&&k(h),pe&&k(b),pe&&k(M),pe&&k(A),pe&&k(O),pe&&k(D);for(let L=0;L<P.length;L+=1)P[L].d();for(let L=0;L<U.length;L+=1)U[L].d();pe&&k(K),pe&&k(Y),pe&&k(W),pe&&k(te),pe&&k(ce),pe&&k(ve),pe&&k(oe),pe&&k(J),q(re),pe&&k(ae),pe&&k(Ve),pe&&k(yt),pe&&k(it);for(let L=0;L<at.length;L+=1)at[L].d();for(let L=0;L<$t.length;L+=1)$t[L].d()}}}function i6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.viewRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)}),i&&s.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),s.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${Se.baseUrl}");
|
||||
|
||||
client.Records.getOne("${o==null?void 0:o.name}", "RECORD_ID")
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[o,i,r,l,a,s,f,c]}class o6 extends Ie{constructor(e){super(),Le(this,e,i6,n6,Ee,{collection:0})}}function $h(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[8]=e[t],i}function Dh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Th(n,e,t){const i=n.slice();return i[16]=e[t],i}function Eh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ph(n,e){let t,i=e[16].lang+"",o,r,l,s;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[16].lang+"")&&ge(o,i),c&20&&ne(t,"active",e[2]===e[16].lang)},d(f){f&&k(t),l=!1,s()}}}function Fh(n,e){let t,i,o,r;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[16].code),i.$set(a),s&20&&ne(t,"active",e[2]===e[16].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function r6(n){let e;return{c(){e=g("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function l6(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function s6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("User "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function a6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("Relation record "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function f6(n){let e,t,i,o,r;return{c(){e=j("FormData object."),t=g("br"),i=j(`
|
||||
Set to `),o=g("code"),o.textContent="null",r=j(" to delete already uploaded file(s).")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),w(l,o,s),w(l,r,s)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),l&&k(o),l&&k(r)}}}function c6(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function u6(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function d6(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function p6(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function h6(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Lh(n,e){let t,i,o,r,l,s=e[13].name+"",a,f,c,u,d=B.getFieldValueType(e[13])+"",h,b,v,_;function y(O,D){return O[13].required?l6:r6}let S=y(e),C=S(e);function x(O,D){if(O[13].type==="text")return h6;if(O[13].type==="number")return p6;if(O[13].type==="json")return d6;if(O[13].type==="email")return u6;if(O[13].type==="url")return c6;if(O[13].type==="file")return f6;if(O[13].type==="relation")return a6;if(O[13].type==="user")return s6}let M=x(e),A=M&&M(e);return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),C.c(),r=$(),l=g("span"),a=j(s),f=$(),c=g("td"),u=g("span"),h=j(d),b=$(),v=g("td"),A&&A.c(),_=$(),p(o,"class","inline-flex"),p(u,"class","label"),this.first=t},m(O,D){w(O,t,D),m(t,i),m(i,o),C.m(o,null),m(o,r),m(o,l),m(l,a),m(t,f),m(t,c),m(c,u),m(u,h),m(t,b),m(t,v),A&&A.m(v,null),m(t,_)},p(O,D){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(o,r))),D&1&&s!==(s=e[13].name+"")&&ge(a,s),D&1&&d!==(d=B.getFieldValueType(e[13])+"")&&ge(h,d),M===(M=x(e))&&A?A.p(e,D):(A&&A.d(1),A=M&&M(e),A&&(A.c(),A.m(v,null)))},d(O){O&&k(t),C.d(),A&&A.d()}}}function Ih(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&8&&i!==(i=e[8].code+"")&&ge(o,i),c&10&&ne(t,"active",e[1]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Rh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&8&&(a.content=e[8].body),i.$set(a),s&10&&ne(t,"active",e[1]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function m6(n){var $t;let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y=n[0].name+"",S,C,x,M,A,O,D,E,P,I,R,G=[],U=new Map,z,K,Y=[],W=new Map,te,ce,ve,oe,J,$e,ee,_e=[],fe=new Map,ie,ye,Ne,Pe,ze,se=[],re=new Map,ke,He,qe=[],Je=new Map,be,Oe=n[5]&&Eh(),Z=n[4];const ae=me=>me[16].lang;for(let me=0;me<Z.length;me+=1){let Ce=Th(n,Z,me),Ye=ae(Ce);U.set(Ye,G[me]=Ph(Ye,Ce))}let Ve=n[4];const yt=me=>me[16].lang;for(let me=0;me<Ve.length;me+=1){let Ce=Oh(n,Ve,me),Ye=yt(Ce);W.set(Ye,Y[me]=Fh(Ye,Ce))}let it=($t=n[0])==null?void 0:$t.schema;const bt=me=>me[13].name;for(let me=0;me<it.length;me+=1){let Ce=Dh(n,it,me),Ye=bt(Ce);fe.set(Ye,_e[me]=Lh(Ye,Ce))}let at=n[3];const vt=me=>me[8].code;for(let me=0;me<at.length;me+=1){let Ce=Ah(n,at,me),Ye=vt(Ce);re.set(Ye,se[me]=Ih(Ye,Ce))}let qt=n[3];const Mt=me=>me[8].code;for(let me=0;me<qt.length;me+=1){let Ce=$h(n,qt,me),Ye=Mt(Ce);Je.set(Ye,qe[me]=Rh(Ye,Ce))}return{c(){e=g("div"),t=g("strong"),t.textContent="POST",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records"),u=$(),Oe&&Oe.c(),d=$(),h=g("div"),b=g("p"),v=j("Create a new "),_=g("strong"),S=j(y),C=j(" record."),x=$(),M=g("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,A=$(),O=g("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",D=$(),E=g("div"),E.textContent="Client SDKs example",P=$(),I=g("div"),R=g("div");for(let me=0;me<G.length;me+=1)G[me].c();z=$(),K=g("div");for(let me=0;me<Y.length;me+=1)Y[me].c();te=$(),ce=g("div"),ce.textContent="Body Parameters",ve=$(),oe=g("table"),J=g("thead"),J.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,$e=$(),ee=g("tbody");for(let me=0;me<_e.length;me+=1)_e[me].c();ie=$(),ye=g("div"),ye.textContent="Responses",Ne=$(),Pe=g("div"),ze=g("div");for(let me=0;me<se.length;me+=1)se[me].c();ke=$(),He=g("div");for(let me=0;me<qe.length;me+=1)qe[me].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(E,"class","section-title"),p(R,"class","tabs-header compact left"),p(K,"class","tabs-content"),p(I,"class","tabs m-b-lg"),p(ce,"class","section-title"),p(oe,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(ze,"class","tabs-header compact left"),p(He,"class","tabs-content"),p(Pe,"class","tabs")},m(me,Ce){w(me,e,Ce),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(e,u),Oe&&Oe.m(e,null),w(me,d,Ce),w(me,h,Ce),m(h,b),m(b,v),m(b,_),m(_,S),m(b,C),m(h,x),m(h,M),m(h,A),m(h,O),w(me,D,Ce),w(me,E,Ce),w(me,P,Ce),w(me,I,Ce),m(I,R);for(let Ye=0;Ye<G.length;Ye+=1)G[Ye].m(R,null);m(I,z),m(I,K);for(let Ye=0;Ye<Y.length;Ye+=1)Y[Ye].m(K,null);w(me,te,Ce),w(me,ce,Ce),w(me,ve,Ce),w(me,oe,Ce),m(oe,J),m(oe,$e),m(oe,ee);for(let Ye=0;Ye<_e.length;Ye+=1)_e[Ye].m(ee,null);w(me,ie,Ce),w(me,ye,Ce),w(me,Ne,Ce),w(me,Pe,Ce),m(Pe,ze);for(let Ye=0;Ye<se.length;Ye+=1)se[Ye].m(ze,null);m(Pe,ke),m(Pe,He);for(let Ye=0;Ye<qe.length;Ye+=1)qe[Ye].m(He,null);be=!0},p(me,[Ce]){var Ye;(!be||Ce&1)&&a!==(a=me[0].name+"")&&ge(f,a),me[5]?Oe||(Oe=Eh(),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null),(!be||Ce&1)&&y!==(y=me[0].name+"")&&ge(S,y),Ce&20&&(Z=me[4],G=st(G,Ce,ae,1,me,Z,U,R,an,Ph,null,Th)),Ce&20&&(Ve=me[4],Ae(),Y=st(Y,Ce,yt,1,me,Ve,W,K,Pt,Fh,null,Oh),De()),Ce&1&&(it=(Ye=me[0])==null?void 0:Ye.schema,_e=st(_e,Ce,bt,1,me,it,fe,ee,an,Lh,null,Dh)),Ce&10&&(at=me[3],se=st(se,Ce,vt,1,me,at,re,ze,an,Ih,null,Ah)),Ce&10&&(qt=me[3],Ae(),qe=st(qe,Ce,Mt,1,me,qt,Je,He,Pt,Rh,null,$h),De())},i(me){if(!be){for(let Ce=0;Ce<Ve.length;Ce+=1)T(Y[Ce]);for(let Ce=0;Ce<qt.length;Ce+=1)T(qe[Ce]);be=!0}},o(me){for(let Ce=0;Ce<Y.length;Ce+=1)F(Y[Ce]);for(let Ce=0;Ce<qe.length;Ce+=1)F(qe[Ce]);be=!1},d(me){me&&k(e),Oe&&Oe.d(),me&&k(d),me&&k(h),me&&k(D),me&&k(E),me&&k(P),me&&k(I);for(let Ce=0;Ce<G.length;Ce+=1)G[Ce].d();for(let Ce=0;Ce<Y.length;Ce+=1)Y[Ce].d();me&&k(te),me&&k(ce),me&&k(ve),me&&k(oe);for(let Ce=0;Ce<_e.length;Ce+=1)_e[Ce].d();me&&k(ie),me&&k(ye),me&&k(Ne),me&&k(Pe);for(let Ce=0;Ce<se.length;Ce+=1)se[Ce].d();for(let Ce=0;Ce<qe.length;Ce+=1)qe[Ce].d()}}}function b6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(2,l=u.lang),c=u=>t(1,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{var u,d;n.$$.dirty&1&&t(5,i=(o==null?void 0:o.createRule)===null),n.$$.dirty&1&&t(3,s=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to create record.",
|
||||
"data": {
|
||||
"${(d=(u=o==null?void 0:o.schema)==null?void 0:u[0])==null?void 0:d.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${Se.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.create("${o==null?void 0:o.name}", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[o,r,l,s,a,i,f,c]}class g6 extends Ie{constructor(e){super(),Le(this,e,b6,m6,Ee,{collection:0})}}function Nh(n,e,t){const i=n.slice();return i[8]=e[t],i}function jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[16]=e[t],i}function qh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Vh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bh(n,e){let t,i=e[16].lang+"",o,r,l,s;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[16].lang+"")&&ge(o,i),c&20&&ne(t,"active",e[2]===e[16].lang)},d(f){f&&k(t),l=!1,s()}}}function Uh(n,e){let t,i,o,r;return i=new tn({props:{content:e[16].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[16].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[16].code),i.$set(a),s&20&&ne(t,"active",e[2]===e[16].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function _6(n){let e;return{c(){e=g("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function v6(n){let e;return{c(){e=g("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function y6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("User "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function k6(n){var r;let e,t=((r=n[13].options)==null?void 0:r.maxSelect)>1?"ids":"id",i,o;return{c(){e=j("Relation record "),i=j(t),o=j(".")},m(l,s){w(l,e,s),w(l,i,s),w(l,o,s)},p(l,s){var a;s&1&&t!==(t=((a=l[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ge(i,t)},d(l){l&&k(e),l&&k(i),l&&k(o)}}}function w6(n){let e,t,i,o,r;return{c(){e=j("FormData object."),t=g("br"),i=j(`
|
||||
Set to `),o=g("code"),o.textContent="null",r=j(" to delete already uploaded file(s).")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s),w(l,o,s),w(l,r,s)},p:le,d(l){l&&k(e),l&&k(t),l&&k(i),l&&k(o),l&&k(r)}}}function S6(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function C6(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function x6(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function M6(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function $6(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Wh(n,e){let t,i,o,r,l,s=e[13].name+"",a,f,c,u,d=B.getFieldValueType(e[13])+"",h,b,v,_;function y(O,D){return O[13].required?v6:_6}let S=y(e),C=S(e);function x(O,D){if(O[13].type==="text")return $6;if(O[13].type==="number")return M6;if(O[13].type==="json")return x6;if(O[13].type==="email")return C6;if(O[13].type==="url")return S6;if(O[13].type==="file")return w6;if(O[13].type==="relation")return k6;if(O[13].type==="user")return y6}let M=x(e),A=M&&M(e);return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),C.c(),r=$(),l=g("span"),a=j(s),f=$(),c=g("td"),u=g("span"),h=j(d),b=$(),v=g("td"),A&&A.c(),_=$(),p(o,"class","inline-flex"),p(u,"class","label"),this.first=t},m(O,D){w(O,t,D),m(t,i),m(i,o),C.m(o,null),m(o,r),m(o,l),m(l,a),m(t,f),m(t,c),m(c,u),m(u,h),m(t,b),m(t,v),A&&A.m(v,null),m(t,_)},p(O,D){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(o,r))),D&1&&s!==(s=e[13].name+"")&&ge(a,s),D&1&&d!==(d=B.getFieldValueType(e[13])+"")&&ge(h,d),M===(M=x(e))&&A?A.p(e,D):(A&&A.d(1),A=M&&M(e),A&&(A.c(),A.m(v,null)))},d(O){O&&k(t),C.d(),A&&A.d()}}}function Yh(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&8&&i!==(i=e[8].code+"")&&ge(o,i),c&10&&ne(t,"active",e[1]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function Gh(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&8&&(a.content=e[8].body),i.$set(a),s&10&&ne(t,"active",e[1]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function A6(n){var cn;let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P,I,R,G,U=[],z=new Map,K,Y,W=[],te=new Map,ce,ve,oe,J,$e,ee,_e,fe,ie,ye,Ne,Pe=[],ze=new Map,se,re,ke,He,qe,Je=[],be=new Map,Oe,Z,ae=[],Ve=new Map,yt,it=n[5]&&Vh(),bt=n[4];const at=ue=>ue[16].lang;for(let ue=0;ue<bt.length;ue+=1){let we=qh(n,bt,ue),Ze=at(we);z.set(Ze,U[ue]=Bh(Ze,we))}let vt=n[4];const qt=ue=>ue[16].lang;for(let ue=0;ue<vt.length;ue+=1){let we=Hh(n,vt,ue),Ze=qt(we);te.set(Ze,W[ue]=Uh(Ze,we))}let Mt=(cn=n[0])==null?void 0:cn.schema;const $t=ue=>ue[13].name;for(let ue=0;ue<Mt.length;ue+=1){let we=zh(n,Mt,ue),Ze=$t(we);ze.set(Ze,Pe[ue]=Wh(Ze,we))}let me=n[3];const Ce=ue=>ue[8].code;for(let ue=0;ue<me.length;ue+=1){let we=jh(n,me,ue),Ze=Ce(we);be.set(Ze,Je[ue]=Yh(Ze,we))}let Ye=n[3];const ot=ue=>ue[8].code;for(let ue=0;ue<Ye.length;ue+=1){let we=Nh(n,Ye,ue),Ze=ot(we);Ve.set(Ze,ae[ue]=Gh(Ze,we))}return{c(){e=g("div"),t=g("strong"),t.textContent="PATCH",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),it&&it.c(),h=$(),b=g("div"),v=g("p"),_=j("Update a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("p"),A.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,O=$(),D=g("p"),D.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=$(),P=g("div"),P.textContent="Client SDKs example",I=$(),R=g("div"),G=g("div");for(let ue=0;ue<U.length;ue+=1)U[ue].c();K=$(),Y=g("div");for(let ue=0;ue<W.length;ue+=1)W[ue].c();ce=$(),ve=g("div"),ve.textContent="Path parameters",oe=$(),J=g("table"),J.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to update.</td></tr></tbody>`,$e=$(),ee=g("div"),ee.textContent="Body Parameters",_e=$(),fe=g("table"),ie=g("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||||
<th width="60%">Type</th>
|
||||
<th width="50%">Description</th></tr>`,ye=$(),Ne=g("tbody");for(let ue=0;ue<Pe.length;ue+=1)Pe[ue].c();se=$(),re=g("div"),re.textContent="Responses",ke=$(),He=g("div"),qe=g("div");for(let ue=0;ue<Je.length;ue+=1)Je[ue].c();Oe=$(),Z=g("div");for(let ue=0;ue<ae.length;ue+=1)ae[ue].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-warning"),p(b,"class","content m-b-base"),p(P,"class","section-title"),p(G,"class","tabs-header compact left"),p(Y,"class","tabs-content"),p(R,"class","tabs m-b-lg"),p(ve,"class","section-title"),p(J,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(fe,"class","table-compact table-border m-b-lg"),p(re,"class","section-title"),p(qe,"class","tabs-header compact left"),p(Z,"class","tabs-content"),p(He,"class","tabs")},m(ue,we){w(ue,e,we),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),it&&it.m(e,null),w(ue,h,we),w(ue,b,we),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),m(b,M),m(b,A),m(b,O),m(b,D),w(ue,E,we),w(ue,P,we),w(ue,I,we),w(ue,R,we),m(R,G);for(let Ze=0;Ze<U.length;Ze+=1)U[Ze].m(G,null);m(R,K),m(R,Y);for(let Ze=0;Ze<W.length;Ze+=1)W[Ze].m(Y,null);w(ue,ce,we),w(ue,ve,we),w(ue,oe,we),w(ue,J,we),w(ue,$e,we),w(ue,ee,we),w(ue,_e,we),w(ue,fe,we),m(fe,ie),m(fe,ye),m(fe,Ne);for(let Ze=0;Ze<Pe.length;Ze+=1)Pe[Ze].m(Ne,null);w(ue,se,we),w(ue,re,we),w(ue,ke,we),w(ue,He,we),m(He,qe);for(let Ze=0;Ze<Je.length;Ze+=1)Je[Ze].m(qe,null);m(He,Oe),m(He,Z);for(let Ze=0;Ze<ae.length;Ze+=1)ae[Ze].m(Z,null);yt=!0},p(ue,[we]){var Ze;(!yt||we&1)&&a!==(a=ue[0].name+"")&&ge(f,a),ue[5]?it||(it=Vh(),it.c(),it.m(e,null)):it&&(it.d(1),it=null),(!yt||we&1)&&S!==(S=ue[0].name+"")&&ge(C,S),we&20&&(bt=ue[4],U=st(U,we,at,1,ue,bt,z,G,an,Bh,null,qh)),we&20&&(vt=ue[4],Ae(),W=st(W,we,qt,1,ue,vt,te,Y,Pt,Uh,null,Hh),De()),we&1&&(Mt=(Ze=ue[0])==null?void 0:Ze.schema,Pe=st(Pe,we,$t,1,ue,Mt,ze,Ne,an,Wh,null,zh)),we&10&&(me=ue[3],Je=st(Je,we,Ce,1,ue,me,be,qe,an,Yh,null,jh)),we&10&&(Ye=ue[3],Ae(),ae=st(ae,we,ot,1,ue,Ye,Ve,Z,Pt,Gh,null,Nh),De())},i(ue){if(!yt){for(let we=0;we<vt.length;we+=1)T(W[we]);for(let we=0;we<Ye.length;we+=1)T(ae[we]);yt=!0}},o(ue){for(let we=0;we<W.length;we+=1)F(W[we]);for(let we=0;we<ae.length;we+=1)F(ae[we]);yt=!1},d(ue){ue&&k(e),it&&it.d(),ue&&k(h),ue&&k(b),ue&&k(E),ue&&k(P),ue&&k(I),ue&&k(R);for(let we=0;we<U.length;we+=1)U[we].d();for(let we=0;we<W.length;we+=1)W[we].d();ue&&k(ce),ue&&k(ve),ue&&k(oe),ue&&k(J),ue&&k($e),ue&&k(ee),ue&&k(_e),ue&&k(fe);for(let we=0;we<Pe.length;we+=1)Pe[we].d();ue&&k(se),ue&&k(re),ue&&k(ke),ue&&k(He);for(let we=0;we<Je.length;we+=1)Je[we].d();for(let we=0;we<ae.length;we+=1)ae[we].d()}}}function D6(n,e,t){let i,{collection:o=new En}=e,r=200,l="JavaScript",s=[],a=[];const f=u=>t(2,l=u.lang),c=u=>t(1,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{var u,d;n.$$.dirty&1&&t(5,i=(o==null?void 0:o.updateRule)===null),n.$$.dirty&1&&t(3,s=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(o),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
"data": {
|
||||
"${(d=(u=o==null?void 0:o.schema)==null?void 0:u[0])==null?void 0:d.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": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${Se.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.update("${o==null?void 0:o.name}", "RECORD_ID", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[o,r,l,s,a,i,f,c]}class O6 extends Ie{constructor(e){super(),Le(this,e,D6,A6,Ee,{collection:0})}}function Kh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Qh(n){let e;return{c(){e=g("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function em(n,e){let t,i=e[13].lang+"",o,r,l,s;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&16&&i!==(i=e[13].lang+"")&&ge(o,i),c&24&&ne(t,"active",e[3]===e[13].lang)},d(f){f&&k(t),l=!1,s()}}}function tm(n,e){let t,i,o,r;return i=new tn({props:{content:e[13].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[3]===e[13].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&16&&(a.content=e[13].code),i.$set(a),s&24&&ne(t,"active",e[3]===e[13].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function nm(n,e){let t,i=e[8].code+"",o,r,l,s;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&36&&ne(t,"active",e[2]===e[8].code)},d(f){f&&k(t),l=!1,s()}}}function im(n,e){let t,i,o,r;return i=new tn({props:{content:e[8].body}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[2]===e[8].code),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l,s&36&&ne(t,"active",e[2]===e[8].code)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function T6(n){let e,t,i,o,r,l,s,a=n[0].name+"",f,c,u,d,h,b,v,_,y,S=n[0].name+"",C,x,M,A,O,D,E,P=[],I=new Map,R,G,U=[],z=new Map,K,Y,W,te,ce,ve,oe,J,$e,ee=[],_e=new Map,fe,ie,ye=[],Ne=new Map,Pe,ze=n[1]&&Qh(),se=n[4];const re=Z=>Z[13].lang;for(let Z=0;Z<se.length;Z+=1){let ae=Xh(n,se,Z),Ve=re(ae);I.set(Ve,P[Z]=em(Ve,ae))}let ke=n[4];const He=Z=>Z[13].lang;for(let Z=0;Z<ke.length;Z+=1){let ae=Zh(n,ke,Z),Ve=He(ae);z.set(Ve,U[Z]=tm(Ve,ae))}let qe=n[5];const Je=Z=>Z[8].code;for(let Z=0;Z<qe.length;Z+=1){let ae=Jh(n,qe,Z),Ve=Je(ae);_e.set(Ve,ee[Z]=nm(Ve,ae))}let be=n[5];const Oe=Z=>Z[8].code;for(let Z=0;Z<be.length;Z+=1){let ae=Kh(n,be,Z),Ve=Oe(ae);Ne.set(Ve,ye[Z]=im(Ve,ae))}return{c(){e=g("div"),t=g("strong"),t.textContent="DELETE",i=$(),o=g("div"),r=g("p"),l=j("/api/collections/"),s=g("strong"),f=j(a),c=j("/records/"),u=g("strong"),u.textContent=":id",d=$(),ze&&ze.c(),h=$(),b=g("div"),v=g("p"),_=j("Delete a single "),y=g("strong"),C=j(S),x=j(" record."),M=$(),A=g("div"),A.textContent="Client SDKs example",O=$(),D=g("div"),E=g("div");for(let Z=0;Z<P.length;Z+=1)P[Z].c();R=$(),G=g("div");for(let Z=0;Z<U.length;Z+=1)U[Z].c();K=$(),Y=g("div"),Y.textContent="Path parameters",W=$(),te=g("table"),te.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,ce=$(),ve=g("div"),ve.textContent="Responses",oe=$(),J=g("div"),$e=g("div");for(let Z=0;Z<ee.length;Z+=1)ee[Z].c();fe=$(),ie=g("div");for(let Z=0;Z<ye.length;Z+=1)ye[Z].c();p(t,"class","label label-primary"),p(o,"class","content"),p(e,"class","alert alert-danger"),p(b,"class","content m-b-base"),p(A,"class","section-title"),p(E,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(Y,"class","section-title"),p(te,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p($e,"class","tabs-header compact left"),p(ie,"class","tabs-content"),p(J,"class","tabs")},m(Z,ae){w(Z,e,ae),m(e,t),m(e,i),m(e,o),m(o,r),m(r,l),m(r,s),m(s,f),m(r,c),m(r,u),m(e,d),ze&&ze.m(e,null),w(Z,h,ae),w(Z,b,ae),m(b,v),m(v,_),m(v,y),m(y,C),m(v,x),w(Z,M,ae),w(Z,A,ae),w(Z,O,ae),w(Z,D,ae),m(D,E);for(let Ve=0;Ve<P.length;Ve+=1)P[Ve].m(E,null);m(D,R),m(D,G);for(let Ve=0;Ve<U.length;Ve+=1)U[Ve].m(G,null);w(Z,K,ae),w(Z,Y,ae),w(Z,W,ae),w(Z,te,ae),w(Z,ce,ae),w(Z,ve,ae),w(Z,oe,ae),w(Z,J,ae),m(J,$e);for(let Ve=0;Ve<ee.length;Ve+=1)ee[Ve].m($e,null);m(J,fe),m(J,ie);for(let Ve=0;Ve<ye.length;Ve+=1)ye[Ve].m(ie,null);Pe=!0},p(Z,[ae]){(!Pe||ae&1)&&a!==(a=Z[0].name+"")&&ge(f,a),Z[1]?ze||(ze=Qh(),ze.c(),ze.m(e,null)):ze&&(ze.d(1),ze=null),(!Pe||ae&1)&&S!==(S=Z[0].name+"")&&ge(C,S),ae&24&&(se=Z[4],P=st(P,ae,re,1,Z,se,I,E,an,em,null,Xh)),ae&24&&(ke=Z[4],Ae(),U=st(U,ae,He,1,Z,ke,z,G,Pt,tm,null,Zh),De()),ae&36&&(qe=Z[5],ee=st(ee,ae,Je,1,Z,qe,_e,$e,an,nm,null,Jh)),ae&36&&(be=Z[5],Ae(),ye=st(ye,ae,Oe,1,Z,be,Ne,ie,Pt,im,null,Kh),De())},i(Z){if(!Pe){for(let ae=0;ae<ke.length;ae+=1)T(U[ae]);for(let ae=0;ae<be.length;ae+=1)T(ye[ae]);Pe=!0}},o(Z){for(let ae=0;ae<U.length;ae+=1)F(U[ae]);for(let ae=0;ae<ye.length;ae+=1)F(ye[ae]);Pe=!1},d(Z){Z&&k(e),ze&&ze.d(),Z&&k(h),Z&&k(b),Z&&k(M),Z&&k(A),Z&&k(O),Z&&k(D);for(let ae=0;ae<P.length;ae+=1)P[ae].d();for(let ae=0;ae<U.length;ae+=1)U[ae].d();Z&&k(K),Z&&k(Y),Z&&k(W),Z&&k(te),Z&&k(ce),Z&&k(ve),Z&&k(oe),Z&&k(J);for(let ae=0;ae<ee.length;ae+=1)ee[ae].d();for(let ae=0;ae<ye.length;ae+=1)ye[ae].d()}}}function E6(n,e,t){let i,{collection:o=new En}=e,r=204,l="JavaScript",s=[],a=[];const f=u=>t(3,l=u.lang),c=u=>t(2,r=u.code);return n.$$set=u=>{"collection"in u&&t(0,o=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(o==null?void 0:o.deleteRule)===null),n.$$.dirty&3&&o!=null&&o.id&&(s.push({code:204,body:`
|
||||
null
|
||||
`}),s.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&&s.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),s.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${Se.baseUrl}");
|
||||
|
||||
client.Records.delete("${o==null?void 0:o.name}", "RECORD_ID")
|
||||
.then(function () {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[o,i,r,l,a,s,f,c]}class P6 extends Ie{constructor(e){super(),Le(this,e,E6,T6,Ee,{collection:0})}}function om(n,e,t){const i=n.slice();return i[4]=e[t],i}function rm(n,e,t){const i=n.slice();return i[4]=e[t],i}function lm(n,e){let t,i=e[4].lang+"",o,r,l,s;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=g("button"),o=j(i),r=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(f,c){w(f,t,c),m(t,o),m(t,r),l||(s=X(t,"click",a),l=!0)},p(f,c){e=f,c&4&&i!==(i=e[4].lang+"")&&ge(o,i),c&6&&ne(t,"active",e[1]===e[4].lang)},d(f){f&&k(t),l=!1,s()}}}function sm(n,e){let t,i,o,r;return i=new tn({props:{content:e[4].code}}),{key:n,first:null,c(){t=g("div"),V(i.$$.fragment),o=$(),p(t,"class","tab-item"),ne(t,"active",e[1]===e[4].lang),this.first=t},m(l,s){w(l,t,s),H(i,t,null),m(t,o),r=!0},p(l,s){e=l;const a={};s&4&&(a.content=e[4].code),i.$set(a),s&6&&ne(t,"active",e[1]===e[4].lang)},i(l){r||(T(i.$$.fragment,l),r=!0)},o(l){F(i.$$.fragment,l),r=!1},d(l){l&&k(t),q(i)}}}function F6(n){let e,t,i,o,r,l,s,a,f=[],c=new Map,u,d,h=[],b=new Map,v,_,y,S,C,x=n[2];const M=D=>D[4].lang;for(let D=0;D<x.length;D+=1){let E=rm(n,x,D),P=M(E);c.set(P,f[D]=lm(P,E))}let A=n[2];const O=D=>D[4].lang;for(let D=0;D<A.length;D+=1){let E=om(n,A,D),P=O(E);b.set(P,h[D]=sm(P,E))}return S=new tn({props:{content:JSON.stringify({action:"create",record:B.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=g("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,t=$(),i=g("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p>
|
||||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p></div></div>`,o=$(),r=g("div"),r.textContent="Client SDKs example",l=$(),s=g("div"),a=g("div");for(let D=0;D<f.length;D+=1)f[D].c();u=$(),d=g("div");for(let D=0;D<h.length;D+=1)h[D].c();v=$(),_=g("div"),_.textContent="Event data format",y=$(),V(S.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(r,"class","section-title"),p(a,"class","tabs-header compact left"),p(d,"class","tabs-content"),p(s,"class","tabs m-b-base"),p(_,"class","section-title")},m(D,E){w(D,e,E),w(D,t,E),w(D,i,E),w(D,o,E),w(D,r,E),w(D,l,E),w(D,s,E),m(s,a);for(let P=0;P<f.length;P+=1)f[P].m(a,null);m(s,u),m(s,d);for(let P=0;P<h.length;P+=1)h[P].m(d,null);w(D,v,E),w(D,_,E),w(D,y,E),H(S,D,E),C=!0},p(D,[E]){E&6&&(x=D[2],f=st(f,E,M,1,D,x,c,a,an,lm,null,rm)),E&6&&(A=D[2],Ae(),h=st(h,E,O,1,D,A,b,d,Pt,sm,null,om),De());const P={};E&1&&(P.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(D[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(P)},i(D){if(!C){for(let E=0;E<A.length;E+=1)T(h[E]);T(S.$$.fragment,D),C=!0}},o(D){for(let E=0;E<h.length;E+=1)F(h[E]);F(S.$$.fragment,D),C=!1},d(D){D&&k(e),D&&k(t),D&&k(i),D&&k(o),D&&k(r),D&&k(l),D&&k(s);for(let E=0;E<f.length;E+=1)f[E].d();for(let E=0;E<h.length;E+=1)h[E].d();D&&k(v),D&&k(_),D&&k(y),q(S,D)}}}function L6(n,e,t){let{collection:i=new En}=e,o="JavaScript",r=[];const l=s=>t(1,o=s.lang);return n.$$set=s=>{"collection"in s&&t(0,i=s.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,r=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${Se.baseUrl}");
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.Users.authViaEmail("test@example.com", "123456");
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
|
||||
console.log(e.data);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
|
||||
console.log(e.data);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.Realtime.unsubscribe() // remove all subscriptions
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
|
||||
`}])},[i,o,r,l]}class I6 extends Ie{constructor(e){super(),Le(this,e,L6,F6,Ee,{collection:0})}}function am(n,e,t){const i=n.slice();return i[14]=e[t],i}function fm(n,e,t){const i=n.slice();return i[14]=e[t],i}function cm(n){let e,t,i,o;var r=n[14].component;function l(s){return{props:{collection:s[3]}}}return r&&(t=new r(l(n))),{c(){e=g("div"),t&&V(t.$$.fragment),i=$(),p(e,"class","tab-item active")},m(s,a){w(s,e,a),t&&H(t,e,null),m(e,i),o=!0},p(s,a){const f={};if(a&8&&(f.collection=s[3]),r!==(r=s[14].component)){if(t){Ae();const c=t;F(c.$$.fragment,1,0,()=>{q(c,1)}),De()}r?(t=new r(l(s)),V(t.$$.fragment),T(t.$$.fragment,1),H(t,e,i)):t=null}else r&&t.$set(f)},i(s){o||(t&&T(t.$$.fragment,s),o=!0)},o(s){t&&F(t.$$.fragment,s),o=!1},d(s){s&&k(e),t&&q(t)}}}function um(n,e){let t,i,o,r=e[4]===e[14].id&&cm(e);return{key:n,first:null,c(){t=lt(),r&&r.c(),i=lt(),this.first=t},m(l,s){w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){e=l,e[4]===e[14].id?r?(r.p(e,s),s&16&&T(r,1)):(r=cm(e),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(r),o=!0)},o(l){F(r),o=!1},d(l){l&&k(t),r&&r.d(l),l&&k(i)}}}function R6(n){let e,t=[],i=new Map,o,r=n[5];const l=s=>s[14].id;for(let s=0;s<r.length;s+=1){let a=am(n,r,s),f=l(a);i.set(f,t[s]=um(f,a))}return{c(){e=g("div");for(let s=0;s<t.length;s+=1)t[s].c();p(e,"class","tabs-content")},m(s,a){w(s,e,a);for(let f=0;f<t.length;f+=1)t[f].m(e,null);o=!0},p(s,a){a&56&&(r=s[5],Ae(),t=st(t,a,l,1,s,r,i,e,Pt,um,null,am),De())},i(s){if(!o){for(let a=0;a<r.length;a+=1)T(t[a]);o=!0}},o(s){for(let a=0;a<t.length;a+=1)F(t[a]);o=!1},d(s){s&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dm(n,e){let t,i,o=e[14].label+"",r,l,s,a;function f(){return e[9](e[14])}function c(...u){return e[10](e[14],...u)}return{key:n,first:null,c(){t=g("button"),i=g("span"),r=j(o),l=$(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ne(t,"active",e[4]===e[14].id),this.first=t},m(u,d){w(u,t,d),m(t,i),m(i,r),m(t,l),s||(a=[X(t,"click",f),X(t,"keydown",Vb(c))],s=!0)},p(u,d){e=u,d&48&&ne(t,"active",e[4]===e[14].id)},d(u){u&&k(t),s=!1,rt(a)}}}function N6(n){let e,t,i=n[3].name+"",o,r,l,s,a=[],f=new Map,c=n[5];const u=d=>d[14].id;for(let d=0;d<c.length;d+=1){let h=fm(n,c,d),b=u(h);f.set(b,a[d]=dm(b,h))}return{c(){e=g("h4"),t=g("strong"),o=j(i),r=j(" records API"),l=$(),s=g("div");for(let d=0;d<a.length;d+=1)a[d].c();p(s,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,o),m(e,r),w(d,l,h),w(d,s,h);for(let b=0;b<a.length;b+=1)a[b].m(s,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ge(o,i),h&114&&(c=d[5],a=st(a,h,u,1,d,c,f,s,an,dm,null,fm))},d(d){d&&k(e),d&&k(l),d&&k(s);for(let h=0;h<a.length;h+=1)a[h].d()}}}function j6(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[8]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function z6(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[j6],header:[N6],default:[R6]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,[r]){const l={};r&524312&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[11](null),q(e,o)}}}function H6(n,e,t){const i=[{id:"list",label:"List",component:t6},{id:"view",label:"View",component:o6},{id:"create",label:"Create",component:g6},{id:"update",label:"Update",component:O6},{id:"delete",label:"Delete",component:P6},{id:"realtime",label:"Realtime",component:I6}];let o,r=new En,l=i[0].id;function s(y){return t(3,r=y),f(i[0].id),o==null?void 0:o.show()}function a(){return o==null?void 0:o.hide()}function f(y){t(4,l=y)}function c(y,S){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),f(S))}const u=()=>a(),d=y=>f(y.id),h=(y,S)=>c(S,y.id);function b(y){he[y?"unshift":"push"](()=>{o=y,t(2,o)})}function v(y){ft.call(this,n,y)}function _(y){ft.call(this,n,y)}return[a,f,o,r,l,i,c,s,u,d,h,b,v,_]}class q6 extends Ie{constructor(e){super(),Le(this,e,H6,z6,Ee,{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 V6(n){let e,t,i,o=[n[3]],r={};for(let l=0;l<o.length;l+=1)r=ut(r,o[l]);return{c(){e=g("textarea"),ci(e,r),ne(e,"svelte-1x1pbts",!0)},m(l,s){w(l,e,s),e.autofocus&&e.focus(),n[5](e),Me(e,n[0]),t||(i=[X(e,"input",n[6]),X(e,"keydown",n[2])],t=!0)},p(l,[s]){ci(e,r=bn(o,[s&8&&l[3]])),s&1&&Me(e,l[0]),ne(e,"svelte-1x1pbts",!0)},i:le,o:le,d(l){l&&k(e),n[5](null),t=!1,rt(i)}}}function B6(n,e,t){const i=["value","maxHeight"];let o=Wt(e,i),{value:r=""}=e,{maxHeight:l=200}=e,s,a;function f(){clearTimeout(a),a=setTimeout(()=>{s&&(t(1,s.style.height="",s),t(1,s.style.height=Math.min(s.scrollHeight+2,l)+"px",s))},0)}function c(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const b=s.closest("form");b
Line truncated
|
||||
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(o,"type","button"),p(o,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(s,a){w(s,e,a),m(e,t),n[18](t),m(e,i),m(e,o),r||(l=[X(t,"change",n[19]),X(o,"click",n[20])],r=!0)},p(s,a){a&32&&(t.multiple=s[5])},d(s){s&&k(e),n[18](null),r=!1,rt(l)}}}function zM(n){let e,t,i,o,r,l=n[3].name+"",s,a,f,c,u=[],d=new Map,h,b,v,_=n[4];const y=A=>A[28];for(let A=0;A<_.length;A+=1){let O=mm(n,_,A),D=y(O);d.set(D,u[A]=bm(D,O))}let S=n[0],C=[];for(let A=0;A<S.length;A+=1)C[A]=gm(hm(n,S,A));const x=A=>F(C[A],1,1,()=>{C[A]=null});let M=!n[9]&&_m(n);return{c(){e=g("label"),t=g("i"),o=$(),r=g("span"),s=j(l),f=$(),c=g("div");for(let A=0;A<u.length;A+=1)u[A].c();h=$();for(let A=0;A<C.length;A+=1)C[A].c();b=$(),M&&M.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(r,"class","txt"),p(e,"for",a=n[24]),p(c,"class","files-list")},m(A,O){w(A,e,O),m(e,t),m(e,o),m(e,r),m(r,s),w(A,f,O),w(A,c,O);for(let D=0;D<u.length;D+=1)u[D].m(c,null);m(c,h);for(let D=0;D<C.length;D+=1)C[D].m(c,null);m(c,b),M&&M.m(c,null),n[21](c),v=!0},p(A,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(A[3].type)))&&p(t,"class",i),(!v||O&8)&&l!==(l=A[3].name+"")&&ge(s,l),(!v||O&16777216&&a!==(a=A[24]))&&p(e,"for",a),O&3222&&(_=A[4],Ae(),u=st(u,O,y,1,A,_,d,c,Pt,bm,h,mm),De()),O&4097){S=A[0];let D;for(D=0;D<S.length;D+=1){const E=hm(A,S,D);C[D]?(C[D].p(E,O),T(C[D],1)):(C[D]=gm(E),C[D].c(),T(C[D],1),C[D].m(c,b))}for(Ae(),D=S.length;D<C.length;D+=1)x(D);De()}A[9]?M&&(M.d(1),M=null):M?M.p(A,O):(M=_m(A),M.c(),M.m(c,null))},i(A){if(!v){for(let O=0;O<_.length;O+=1)T(u[O]);for(let O=0;O<S.length;O+=1)T(C[O]);v=!0}},o(A){for(let O=0;O<u.length;O+=1)F(u[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)F(C[O]);v=!1},d(A){A&&k(e),A&&k(f),A&&k(c);for(let O=0;O<u.length;O+=1)u[O].d();qn(C,A),M&&M.d(),n[21](null)}}}function HM(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[zM,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}});let r={};return i=new PM({props:r}),n[22](i),{c(){V(e.$$.fragment),t=$(),V(i.$$.fragment)},m(l,s){H(e,l,s),w(l,t,s),H(i,l,s),o=!0},p(l,[s]){const a={};s&8&&(a.class="form-field form-field-file "+(l[3].required?"required":"")),s&8&&(a.name=l[3].name),s&1090520063&&(a.$$scope={dirty:s,ctx:l}),e.$set(a);const f={};i.$set(f)},i(l){o||(T(e.$$.fragment,l),T(i.$$.fragment,l),o=!0)},o(l){F(e.$$.fragment,l),F(i.$$.fragment,l),o=!1},d(l){q(e,l),l&&k(t),n[22](null),q(i,l)}}}function qM(n,e,t){let i,o,r,{record:l}=e,{value:s=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:f=[]}=e,{field:c=new kn}=e,u,d,h;function b(I){B.removeByValue(f,I),t(1,f)}function v(I){B.pushUnique(f,I),t(1,f)}function _(I){B.isEmpty(a[I])||a.splice(I,1),t(0,a)}function y(){h==null||h.dispatchEvent(new CustomEvent("change",{detail:{value:s,uploadedFiles:a,deletedFileIndexes:f},bubbles:!0}))}const S=I=>B.hasImageExtension(I)?d==null?void 0:d.show(Se.Records.getFileUrl(l,I)):!1,C=I=>b(I),x=I=>v(I),M=I=>_(I);function A(I){he[I?"unshift":"push"](()=>{u=I,t(6,u)})}const O=()=>{for(let I of u.files)a.push(I);t(0,a),t(6,u.value=null,u)},D=()=>u==null?void 0:u.click();function E(I){he[I?"unshift":"push"](()=>{h=I,t(8,h)})}function P(I){he[I?"unshift":"push"](()=>{d=I,t(7,d)})}return n.$$set=I=>{"record"in I&&t(2,l=I.record),"value"in I&&t(13,s=I.value),"uploadedFiles"in I&&t(0,a=I.uploadedFiles),"deletedFileIndexes"in I&&t(1,f=I.deletedFileIndexes),"field"in I&&t(3,c=I.field)},n.$$.update=()=>{var I,R;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(f)||t(1,f=B.toArray(f))),n.$$.dirty&8&&t(5,i=((I=c.options)==null?void 0:I.maxSelect)>1),n.$$.dirty&8224&&(typeof s=="undefined"||s===null)&&t(13,s=i?[]:null),n.$$.dirty&8192&&t(4,o=B.toArray(s)),n.$$.dirty&27&&t(9,r=(o.length||a.length)&&((R=c.options)==null?void 0:R.maxSelect)<=o.length+a.length-f.length),n.$$.dirty&3&&(a!==-1||f!==-1)&&y()},[a,f,l,c,o,i,u,d,h,r,b,v,_,s,S,C,x,M,A,O,D,E,P]}class VM extends Ie{constructor(e){super(),Le(this,e,qM,HM,Ee,{record:2,value:13,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function vm(n){let e,t;return{c(){e=g("small"),t=j(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,o){w(i,e,o),m(e,t)},p(i,o){o&2&&ge(t,i[1])},d(i){i&&k(e)}}}function BM(n){let e,t,i,o,r,l=n[0].id+"",s,a,f,c,u=n[1]!==""&&n[1]!==n[0].id&&vm(n);return{c(){e=g("i"),i=$(),o=g("div"),r=g("div"),s=j(l),a=$(),u&&u.c(),p(e,"class","ri-information-line link-hint"),p(r,"class","block txt-ellipsis"),p(o,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,o,h),m(o,r),m(r,s),m(o,a),u&&u.m(o,null),f||(c=Xe(t=St.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),f=!0)},p(d,[h]){t&&Yn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&l!==(l=d[0].id+"")&&ge(s,l),d[1]!==""&&Line truncated
|
||||
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function d$(n){let e,t,i;function o(l){n[31](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new c$({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function p$(n){let e,t,i;function o(l){n[30](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new e$({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function h$(n){let e,t,i,o,r;function l(c){n[27](c,n[40])}function s(c){n[28](c,n[40])}function a(c){n[29](c,n[40])}let f={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(f.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(f.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(f.deletedFileIndexes=n[4][n[40].name]),e=new VM({props:f}),he.push(()=>Fe(e,"value",l)),he.push(()=>Fe(e,"uploadedFiles",s)),he.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(c,u){H(e,c,u),r=!0},p(c,u){n=c;const d={};u[0]&1&&(d.field=n[40]),u[0]&4&&(d.record=n[2]),!t&&u[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&u[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!o&&u[0]&17&&(o=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>o=!1)),e.$set(d)},i(c){r||(T(e.$$.fragment,c),r=!0)},o(c){F(e.$$.fragment,c),r=!1},d(c){q(e,c)}}}function m$(n){let e,t,i;function o(l){n[26](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new SM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function b$(n){let e,t,i;function o(l){n[25](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new vM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function g$(n){let e,t,i;function o(l){n[24](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new mM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function _$(n){let e,t,i;function o(l){n[23](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new uM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function v$(n){let e,t,i;function o(l){n[22](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new sM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function y$(n){let e,t,i;function o(l){n[21](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new iM({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function k$(n){let e,t,i;function o(l){n[20](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new Q6({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;const a={};s[0]&1&&(a.field=n[40]),!t&&s[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(l){i||(T(e.$$.fragment,l),i=!0)},o(l){F(e.$$.fragment,l),i=!1},d(l){q(e,l)}}}function w$(n){let e,t,i;function o(l){n[19](l,n[40])}let r={field:n[40]};return n[2][n[40].name]!==void 0&&(r.value=n[2][n[40].name]),e=new K6({props:r}),he.push(()=>Fe(e,"value",o)),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),i=!0},p(l,s){n=l;
Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[18]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function x$(n){let e,t=n[2].isNew?"New":"Edit",i,o,r=n[0].name+"",l,s,a,f,c,u=!n[2].isNew&&n[9]&&Am(n);return{c(){e=g("h4"),i=j(t),o=$(),l=j(r),s=j(" record"),a=$(),u&&u.c(),f=lt()},m(d,h){w(d,e,h),m(e,i),m(e,o),m(e,l),m(e,s),w(d,a,h),u&&u.m(d,h),w(d,f,h),c=!0},p(d,h){(!c||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ge(i,t),(!c||h[0]&1)&&r!==(r=d[0].name+"")&&ge(l,r),!d[2].isNew&&d[9]?u?(u.p(d,h),h[0]&516&&T(u,1)):(u=Am(d),u.c(),T(u,1),u.m(f.parentNode,f)):u&&(Ae(),F(u,1,1,()=>{u=null}),De())},i(d){c||(T(u),c=!0)},o(d){F(u),c=!1},d(d){d&&k(e),d&&k(a),u&&u.d(d),d&&k(f)}}}function M$(n){let e,t,i,o,r,l=n[2].isNew?"Create":"Save changes",s,a,f,c;return{c(){e=g("button"),t=g("span"),t.textContent="Cancel",i=$(),o=g("button"),r=g("span"),s=j(l),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[11]),p(o,"class","btn btn-expanded"),o.disabled=a=!n[10]||n[7],ne(o,"btn-loading",n[7])},m(u,d){w(u,e,d),m(e,t),w(u,i,d),w(u,o,d),m(o,r),m(r,s),f||(c=X(e,"click",n[17]),f=!0)},p(u,d){d[0]&128&&(e.disabled=u[7]),d[0]&4&&l!==(l=u[2].isNew?"Create":"Save changes")&&ge(s,l),d[0]&1152&&a!==(a=!u[10]||u[7])&&(o.disabled=a),d[0]&128&&ne(o,"btn-loading",u[7])},d(u){u&&k(e),u&&k(i),u&&k(o),f=!1,c()}}}function $$(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[M$],header:[x$],default:[S$]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&288&&(l.beforeHide=o[32]),r[0]&1693|r[1]&8192&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[33](null),q(e,o)}}}function Dm(n){return JSON.stringify(n)}function A$(n,e,t){let i,o,r,l;const s=yn(),a="record_"+B.randomString(5);let{collection:f}=e,c,u=null,d=new Ql,h=!1,b=!1,v={},_={},y="";function S(fe){return x(fe),t(8,b=!0),c==null?void 0:c.show()}function C(){return c==null?void 0:c.hide()}function x(fe){Ui({}),u=fe||{},t(2,d=fe!=null&&fe.clone?fe.clone():new Ql),t(3,v={}),t(4,_={}),t(15,y=Dm(d))}function M(){if(h||!o)return;t(7,h=!0);const fe=O();let ie;d.isNew?ie=Se.Records.create(f==null?void 0:f.id,fe):ie=Se.Records.update(f==null?void 0:f.id,d.id,fe),ie.then(async ye=>{hn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,b=!1),C(),s("save",ye)}).catch(ye=>{Se.errorResponseHandler(ye)}).finally(()=>{t(7,h=!1)})}function A(){!(u!=null&&u.id)||xi("Do you really want to delete the selected record?",()=>Se.Records.delete(u["@collectionId"],u.id).then(()=>{C(),hn("Successfully deleted record."),s("delete",u)}).catch(fe=>{Se.errorResponseHandler(fe)}))}function O(){const fe=(d==null?void 0:d.export())||{},ie=new FormData,ye={};for(const Ne of(f==null?void 0:f.schema)||[])ye[Ne.name]=Ne;for(const Ne in fe)!ye[Ne]||(typeof fe[Ne]=="undefined"&&(fe[Ne]=null),B.addValueToFormData(ie,Ne,fe[Ne]));for(const Ne in v){const Pe=B.toArray(v[Ne]);for(const ze of Pe)ie.append(Ne,ze)}for(const Ne in _){const Pe=B.toArray(_[Ne]);for(const ze of Pe)ie.append(Ne+"."+ze,"")}return ie}const D=()=>C(),E=()=>A();function P(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function I(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function R(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function G(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function U(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function z(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function K(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function Y(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function W(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function te(fe,ie){n.$$.not_equal(v[ie.name],fe)&&(v[ie.name]=fe,t(3,v))}function ce(fe,ie){n.$$.not_equal(_[ie.name],fe)&&(_[ie.name]=fe,t(4,_))}function ve(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function oe(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}const J=()=>o&&b?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,b=!1),C()}),!1):!0;function $e(fe){he[fe?"unshift":"push"](()=>{c=fe,t(6,c)})}function ee(fe){ft.call(this,n,fe)}function _e(fe){ft.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,f=fe.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=B.hasNonEmptyProps(v)||B.hasNonEmptyProps(_)),n.$$.dirty[0]&98308&&t(5,o=i||y!=Dm(d)),n.$$.dirty[0]&36&&t(10,r=d.isNew||o),n.$$.dirty[0]&1&&t(9,l=(f==null?void 0:f.name)!=="profiles")},[f,C,d,v,_,o,c,h,b,l,r,a,M,A,S,y,i,D,E,P,I,R,G,U,z,K,Y,W,te,ce,ve,oe,J,$e,ee,_e]}class F1 extends Ie{constructor(e){super(),Le(this,e,A$,$$,Ee,{collLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Hm(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[28]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function qm(n,e){let t,i,o;return i=new L1({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l[0]&8&&(s.record=e[35]),l[0]&2048&&(s.field=e[38]),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function Vm(n,e){let t,i,o,r,l,s,a,f,c,u,d,h,b,v=[],_=new Map,y,S,C,x,M,A,O,D,E,P,I,R;function G(){return e[25](e[35])}h=new Ls({props:{id:e[35].id}});let U=e[11];const z=W=>W[38].name;for(let W=0;W<U.length;W+=1){let te=Rm(e,U,W),ce=z(te);_.set(ce,v[W]=qm(ce,te))}C=new Ci({props:{date:e[35].created}}),A=new Ci({props:{date:e[35].updated}});function K(){return e[26](e[35])}function Y(...W){return e[27](e[35],...W)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("div"),r=g("input"),a=$(),f=g("label"),u=$(),d=g("td"),V(h.$$.fragment),b=$();for(let W=0;W<v.length;W+=1)v[W].c();y=$(),S=g("td"),V(C.$$.fragment),x=$(),M=g("td"),V(A.$$.fragment),O=$(),D=g("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',E=$(),p(r,"type","checkbox"),p(r,"id",l="checkbox_"+e[35].id),r.checked=s=e[5][e[35].id],p(f,"for",c="checkbox_"+e[35].id),p(o,"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(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(W,te){w(W,t,te),m(t,i),m(i,o),m(o,r),m(o,a),m(o,f),m(t,u),m(t,d),H(h,d,null),m(t,b);for(let ce=0;ce<v.length;ce+=1)v[ce].m(t,null);m(t,y),m(t,S),H(C,S,null),m(t,x),m(t,M),H(A,M,null),m(t,O),m(t,D),m(t,E),P=!0,I||(R=[X(r,"change",G),X(o,"click",Vn(e[19])),X(t,"click",K),X(t,"keydown",Y)],I=!0)},p(W,te){e=W,(!P||te[0]&8&&l!==(l="checkbox_"+e[35].id))&&p(r,"id",l),(!P||te[0]&40&&s!==(s=e[5][e[35].id]))&&(r.checked=s),(!P||te[0]&8&&c!==(c="checkbox_"+e[35].id))&&p(f,"for",c);const ce={};te[0]&8&&(ce.id=e[35].id),h.$set(ce),te[0]&2056&&(U=e[11],Ae(),v=st(v,te,z,1,e,U,_,t,Pt,qm,y,Rm),De());const ve={};te[0]&8&&(ve.date=e[35].created),C.$set(ve);const oe={};te[0]&8&&(oe.date=e[35].updated),A.$set(oe)},i(W){if(!P){T(h.$$.fragment,W);for(let te=0;te<U.length;te+=1)T(v[te]);T(C.$$.fragment,W),T(A.$$.fragment,W),P=!0}},o(W){F(h.$$.fragment,W);for(let te=0;te<v.length;te+=1)F(v[te]);F(C.$$.fragment,W),F(A.$$.fragment,W),P=!1},d(W){W&&k(t),q(h);for(let te=0;te<v.length;te+=1)v[te].d();q(C),q(A),I=!1,rt(R)}}}function Bm(n){let e,t,i=n[3].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a[0]&8&&i!==(i=s[3].length+"")&&ge(o,i),a[0]&16&&ge(l,s[4])},d(s){s&&k(e)}}}function Um(n){let e,t,i,o,r=n[4]-n[3].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[8]),ne(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[29]),a=!0)},p(c,u){u[0]&24&&r!==(r=c[4]-c[3].length+"")&&ge(l,r),u[0]&256&&ne(t,"btn-loading",c[8]),u[0]&256&&ne(t,"btn-disabled",c[8])},d(c){c&&k(e),a=!1,f()}}}function Wm(n){let e,t,i,o,r,l,s=n[6]===1?"record":"records",a,f,c,u,d,h,b,v,_,y,S;return{c(){e=g("div"),t=g("div"),i=j("Selected "),o=g("strong"),r=j(n[6]),l=$(),a=j(s),f=$(),c=g("button"),c.innerHTML='<span class="txt">Reset</span>',u=$(),d=g("div"),h=$(),b=g("button"),b.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(c,"type","button"),p(c,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ne(c,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(b,"type","button"),p(b,"class","btn btn-sm btn-secondary btn-danger"),ne(b,"btn-loading",n[9]),ne(b,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(C,x){w(C,e,x),m(e,t),m(t,i),m(t,o),m(o,r),m(t,l),m(t,a),m(e,f),m(e,c),m(e,u),m(e,d),m(e,h),m(e,b),_=!0,y||(S=[X(c,"click",n[30]),X(b,"click",n[31])],y=!0)},p(C,x){(!_||x[0]&64)&&ge(r,C[6]),(!_||x[0]&64)&&s!==(s=C[6]===1?"record":"records")&&ge(a,s),x[0]&512&&ne(c,"btn-disabled",C[9]),x[0]&512&&ne(b,"btn-loading",C[9]),x[0]&512&&ne(b,"btn-disabled",C[9])},i(C){_||(C&&Dt(()=>{v||(v=ct(e,ti,{duration:150,y:5},!0)),v.run(1)}),_=!0)},o(C){C&&(v||(v=ct(e,ti,{duration:150,y:5},!1)),v.run(0)),_=!1},d(C){C&&k(e),C&&v&&v.end(),y=!1,rt(S)}}}function J$(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v=[],_=new Map,y,S,C,x,M,A,O,D,E,P,I=[],R=new Map,G,U,z,K,Y,W,te;function ce(re){n[21](re)}let ve={class:"col-type-text col-field-
Line truncated
|
||||
<span class="txt">API Preview</span>`,_=$(),y=g("button"),y.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New record</span>`,S=$(),V(C.$$.fragment),x=$(),V(M.$$.fragment),p(l,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(r,"class","breadcrumbs"),p(d,"type","button"),p(d,"class","btn btn-secondary btn-circle"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(b,"class","btns-group"),p(o,"class","page-header"),p(i,"class","page-wrapper")},m(U,z){H(e,U,z),w(U,t,z),w(U,i,z),m(i,o),m(o,r),m(r,l),m(r,s),m(r,a),m(a,c),m(o,u),m(o,d),m(o,h),m(o,b),m(b,v),m(b,_),m(b,y),m(i,S),H(C,i,null),m(i,x),H(M,i,null),D=!0,E||(P=[Xe(St.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(v,"click",n[13]),X(y,"click",n[14])],E=!0)},p(U,z){(!D||z&4)&&f!==(f=U[2].name+"")&&ge(c,f);const K={};z&1&&(K.value=U[0]),z&4&&(K.autocompleteCollection=U[2]),C.$set(K);const Y={};z&4&&(Y.collection=U[2]),!A&&z&1&&(A=!0,Y.filter=U[0],Re(()=>A=!1)),!O&&z&2&&(O=!0,Y.sort=U[1],Re(()=>O=!1)),M.$set(Y)},i(U){D||(T(e.$$.fragment,U),T(C.$$.fragment,U),T(M.$$.fragment,U),D=!0)},o(U){F(e.$$.fragment,U),F(C.$$.fragment,U),F(M.$$.fragment,U),D=!1},d(U){q(e,U),U&&k(t),U&&k(i),q(C),n[16](null),q(M),E=!1,rt(P)}}}function eA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("div"),t=g("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=$(),o=g("h1"),o.textContent="Create your first collection to add records!",r=$(),l=g("button"),l.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(o,"class","m-b-10"),p(l,"type","button"),p(l,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,o),m(e,r),m(e,l),s||(a=X(l,"click",n[11]),s=!0)},p:le,i:le,o:le,d(f){f&&k(e),s=!1,a()}}}function tA(n){let e;return{c(){e=g("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function nA(n){let e,t,i,o,r,l,s,a,f;const c=[tA,eA,Q$],u=[];function d(_,y){return _[8]?0:_[7].length?2:1}e=d(n),t=u[e]=c[e](n);let h={};o=new hc({props:h}),n[20](o);let b={};l=new q6({props:b}),n[21](l);let v={collection:n[2]};return a=new F1({props:v}),n[22](a),a.$on("save",n[23]),a.$on("delete",n[24]),{c(){t.c(),i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment)},m(_,y){u[e].m(_,y),w(_,i,y),H(o,_,y),w(_,r,y),H(l,_,y),w(_,s,y),H(a,_,y),f=!0},p(_,[y]){let S=e;e=d(_),e===S?u[e].p(_,y):(Ae(),F(u[S],1,1,()=>{u[S]=null}),De(),t=u[e],t?t.p(_,y):(t=u[e]=c[e](_),t.c()),T(t,1),t.m(i.parentNode,i));const C={};o.$set(C);const x={};l.$set(x);const M={};y&4&&(M.collection=_[2]),a.$set(M)},i(_){f||(T(t),T(o.$$.fragment,_),T(l.$$.fragment,_),T(a.$$.fragment,_),f=!0)},o(_){F(t),F(o.$$.fragment,_),F(l.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){u[e].d(_),_&&k(i),n[20](null),q(o,_),_&&k(r),n[21](null),q(l,_),_&&k(s),n[22](null),q(a,_)}}}function iA(n,e,t){var G;let i,o,r,l;pn(n,fi,U=>t(2,o=U)),pn(n,Go,U=>t(10,r=U)),pn(n,pf,U=>t(8,l=U));const s=B.getQueryParams((G=window.location)==null?void 0:G.href);let a,f,c,u,d=s.filter||"",h=s.sort||"-created",b=s.collectionId;B.setDocumentTitle("Collections"),_C(b);const v=()=>a==null?void 0:a.show(),_=()=>a==null?void 0:a.show(o),y=()=>f==null?void 0:f.show(o),S=()=>c==null?void 0:c.show(),C=U=>t(0,d=U.detail);function x(U){he[U?"unshift":"push"](()=>{u=U,t(6,u)})}function M(U){d=U,t(0,d),t(2,o),t(9,b)}function A(U){h=U,t(1,h),t(2,o),t(9,b)}const O=U=>c==null?void 0:c.show(U==null?void 0:U.detail);function D(U){he[U?"unshift":"push"](()=>{a=U,t(3,a)})}function E(U){he[U?"unshift":"push"](()=>{f=U,t(4,f)})}function P(U){he[U?"unshift":"push"](()=>{c=U,t(5,c)})}const I=()=>u==null?void 0:u.load(),R=()=>u==null?void 0:u.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=r.filter(U=>U.name!="profiles")),n.$$.dirty&516&&(o==null?void 0:o.id)&&b!=o.id&&(t(9,b=o.id),t(1,h="-created"),t(0,d="")),n.$$.dirty&7&&(h||d||(o==null?void 0:o.id))&&B.replaceClientQueryParams({collectionId:o==null?void 0:o.id,filter:d,sort:h})},[d,h,o,a,f,c,u,i,l,b,r,v,_,y,S,C,x,M,A,O,D,E,P,I,R]}class oA extends Ie{constructor(e){super(),Le(this,e,iA,nA,Ee,{})}}function Ym(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[rA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&2|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function rA(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="ID",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"for",r=n[31]),p(s,"type","text"),p(s,"id",a=n[31]),s.value=f=n[1].id,s.disabled=!0},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),w(c,l,u),w(c,s,u)},p(c,u){u[1]&1&&r!==(r=c[31])&&p(e,"for",r),u[1]&1&&a!==(a=c[31])&&p(s,"id",a),u[0]&2&&f!==(f=c[1].id)&&s.value!==f&&(s.value=f)},d(c){c&&k(e),c&&k(l),c&&k(s)}}}function Gm(n){let e,t,i,o;return{c(){e=g("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(r,l){w(r,e,l),i||(o=Xe(t=St.call(null,e,"Verified")),i=!0)},d(r){r&&k(e),i=!1,o()}}}function lA(n){let e,t,i,o,r,l,s,a,f,c,u,d=n[1].verified&&Gm();return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Email",l=$(),d&&d.c(),s=$(),a=g("input"),p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"for",r=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",f=n[31]),a.required=!0},m(h,b){w(h,e,b),m(e,t),m(e,i),m(e,o),w(h,l,b),d&&d.m(h,b),w(h,s,b),w(h,a,b),Me(a,n[2]),c||(u=X(a,"input",n[19]),c=!0)},p(h,b){b[1]&1&&r!==(r=h[31])&&p(e,"for",r),h[1].verified?d||(d=Gm(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),b[1]&1&&f!==(f=h[31])&&p(a,"id",f),b[0]&4&&a.value!==h[2]&&Me(a,h[2])},d(h){h&&k(e),h&&k(l),d&&d.d(h),h&&k(s),h&&k(a),c=!1,u()}}}function Km(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[sA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&8|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function sA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(o,"for",l=n[31])},m(f,c){w(f,e,c),e.checked=n[3],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[20]),s=!0)},p(f,c){c[1]&1&&t!==(t=f[31])&&p(e,"id",t),c[0]&8&&(e.checked=f[3]),c[1]&1&&l!==(l=f[31])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Jm(n){let e,t,i,o,r,l,s,a,f;return o=new je({props:{class:"form-field required",name:"pasLine truncated
|
||||
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[16]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function pA(n){let e,t,i,o,r=!n[1].verified&&Qm(n);return{c(){r&&r.c(),e=$(),t=g("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(l,s){r&&r.m(l,s),w(l,e,s),w(l,t,s),i||(o=X(t,"click",n[17]),i=!0)},p(l,s){l[1].verified?r&&(r.d(1),r=null):r?r.p(l,s):(r=Qm(l),r.c(),r.m(e.parentNode,e))},d(l){r&&r.d(l),l&&k(e),l&&k(t),i=!1,o()}}}function hA(n){let e,t,i,o,r,l,s=n[1].isNew?"Create":"Save changes",a,f,c,u,d,h=!n[1].isNew&&Xm(n);return{c(){h&&h.c(),e=$(),t=g("button"),i=g("span"),i.textContent="Cancel",o=$(),r=g("button"),l=g("span"),a=j(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(l,"class","txt"),p(r,"type","submit"),p(r,"form",n[11]),p(r,"class","btn btn-expanded"),r.disabled=f=!n[10]||n[5],ne(r,"btn-loading",n[5])},m(b,v){h&&h.m(b,v),w(b,e,v),w(b,t,v),m(t,i),w(b,o,v),w(b,r,v),m(r,l),m(l,a),c=!0,u||(d=X(t,"click",n[18]),u=!0)},p(b,v){b[1].isNew?h&&(Ae(),F(h,1,1,()=>{h=null}),De()):h?(h.p(b,v),v[0]&2&&T(h,1)):(h=Xm(b),h.c(),T(h,1),h.m(e.parentNode,e)),(!c||v[0]&32)&&(t.disabled=b[5]),(!c||v[0]&2)&&s!==(s=b[1].isNew?"Create":"Save changes")&&ge(a,s),(!c||v[0]&1056&&f!==(f=!b[10]||b[5]))&&(r.disabled=f),v[0]&32&&ne(r,"btn-loading",b[5])},i(b){c||(T(h),c=!0)},o(b){F(h),c=!1},d(b){h&&h.d(b),b&&k(e),b&&k(t),b&&k(o),b&&k(r),u=!1,d()}}}function mA(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[hA],header:[dA],default:[uA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&1088&&(l.beforeHide=o[24]),r[0]&1966|r[1]&2&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[25](null),q(e,o)}}}function bA(n,e,t){let i;const o=yn(),r="user_"+B.randomString(5);let l,s=new es,a=!1,f=!1,c="",u="",d="",h=!1,b=!0;function v(W){return y(W),t(6,f=!0),l==null?void 0:l.show()}function _(){return l==null?void 0:l.hide()}function y(W){Ui({}),t(1,s=W!=null&&W.clone?W.clone():new es),S()}function S(){t(3,h=!1),t(9,b=!0),t(2,c=(s==null?void 0:s.email)||""),t(7,u=""),t(8,d="")}function C(){if(a||!i)return;t(5,a=!0);const W={email:c};(s.isNew||h)&&(W.password=u,W.passwordConfirm=d);let te;s.isNew?te=Se.Users.create(W):te=Se.Users.update(s.id,W),te.then(async ce=>{b&&M(!1),t(6,f=!1),_(),hn(s.isNew?"Successfully created user.":"Successfully updated user."),o("save",ce)}).catch(ce=>{Se.errorResponseHandler(ce)}).finally(()=>{t(5,a=!1)})}function x(){!(s!=null&&s.id)||xi("Do you really want to delete the selected user?",()=>Se.Users.delete(s.id).then(()=>{t(6,f=!1),_(),hn("Successfully deleted user."),o("delete",s)}).catch(W=>{Se.errorResponseHandler(W)}))}function M(W=!0){return Se.Users.requestVerification(s.isNew?c:s.email).then(()=>{t(6,f=!1),_(),W&&hn(`Successfully sent verification email to ${s.email}.`)}).catch(te=>{Se.errorResponseHandler(te)})}const A=()=>M(),O=()=>x(),D=()=>_();function E(){c=this.value,t(2,c)}function P(){h=this.checked,t(3,h)}function I(){u=this.value,t(7,u)}function R(){d=this.value,t(8,d)}function G(){b=this.checked,t(9,b)}const U=()=>i&&f?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,f=!1),_()}),!1):!0;function z(W){he[W?"unshift":"push"](()=>{l=W,t(4,l)})}function K(W){ft.call(this,n,W)}function Y(W){ft.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=s.isNew&&c!=""||h||c!==s.email)},[_,s,c,h,l,a,f,u,d,b,i,r,C,x,M,v,A,O,D,E,P,I,R,G,U,z,K,Y]}class gA extends Ie{constructor(e){super(),Le(this,e,bA,mA,Ee,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function eb(n,e,t){const i=n.slice();return i[37]=e[t],i}function tb(n,e,t){const i=n.slice();return i[40]=e[t],i}function nb(n,e,t){const i=n.slice();return i[40]=e[t],i}function _A(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O=[],D=new Map,E,P,I,R,G,U,z,K,Y,W,te=[],ce=new Map,ve,oe,J,$e,ee;u=new Ds({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),u.$on("submit",n[17]);function _e(Z){n[18](Z)}let fe={class:"col-type-text col-field-id",name:"id",$$slots:{default:[yA]},$$scope:{ctx:n}};n[4]!==void 0&&(fe.sort=n[4]),y=new en({props:fe}),he.push(()=>Fe(y,"sort",_e));function ie(Z){n[19](Z)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[kA]},$$scope:{ctx:n}};n[4]!==void 0&&(ye.sort=n[4]),x=new en({props:ye}),he.push(()=>Fe(x,"sort",ie));let Ne=n[12];const Pe=Z=>Z[40].name;for(let Z=0;Z<Ne.length;Z+=1){let ae=nb(n,Ne,Z),Ve=Pe(ae);D.set(Ve,O[Z]=ib(Ve,ae))}function ze(Z){n[20](Z)}let se={class:"col-type-date col-field-created",name:"created",$$slots:{default:[wA]},$$scope:{ctx:n}};n[4]!==void 0&&(se.sort=n[4]),P=new en({props:se}),he.push(()=>Fe(P,"sort",ze));function re(Z){n[21](Z)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[SA]},$$scope:{ctx:n}};n[4]!==void 0&&(ke.sort=n[4]),G=new en({props:ke}),he.push(()=>Fe(G,"sort",rLine truncated
|
||||
<span class="txt">New user</span>`,c=$(),V(u.$$.fragment),d=$(),h=g("div"),b=g("table"),v=g("thead"),_=g("tr"),V(y.$$.fragment),C=$(),V(x.$$.fragment),A=$();for(let Z=0;Z<O.length;Z+=1)O[Z].c();E=$(),V(P.$$.fragment),R=$(),V(G.$$.fragment),z=$(),K=g("th"),Y=$(),W=g("tbody");for(let Z=0;Z<te.length;Z+=1)te[Z].c();Je&&Je.c(),ve=$(),be&&be.c(),oe=$(),Oe&&Oe.c(),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"class","btn btn-secondary btn-circle"),p(s,"class","flex-fill"),p(f,"type","button"),p(f,"class","btn btn-expanded"),p(t,"class","page-header"),p(K,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[10]),p(h,"class","table-wrapper"),p(e,"class","page-wrapper")},m(Z,ae){w(Z,e,ae),m(e,t),m(t,i),m(t,o),m(t,r),m(t,l),m(t,s),m(t,a),m(t,f),m(e,c),H(u,e,null),m(e,d),m(e,h),m(h,b),m(b,v),m(v,_),H(y,_,null),m(_,C),H(x,_,null),m(_,A);for(let Ve=0;Ve<O.length;Ve+=1)O[Ve].m(_,null);m(_,E),H(P,_,null),m(_,R),H(G,_,null),m(_,z),m(_,K),m(b,Y),m(b,W);for(let Ve=0;Ve<te.length;Ve+=1)te[Ve].m(W,null);Je&&Je.m(W,null),m(e,ve),be&&be.m(e,null),m(e,oe),Oe&&Oe.m(e,null),J=!0,$e||(ee=[Xe(St.call(null,r,{text:"Edit profile collection",position:"right"})),X(r,"click",n[15]),X(f,"click",n[16])],$e=!0)},p(Z,ae){const Ve={};ae[0]&8&&(Ve.value=Z[3]),u.$set(Ve);const yt={};ae[1]&16384&&(yt.$$scope={dirty:ae,ctx:Z}),!S&&ae[0]&16&&(S=!0,yt.sort=Z[4],Re(()=>S=!1)),y.$set(yt);const it={};ae[1]&16384&&(it.$$scope={dirty:ae,ctx:Z}),!M&&ae[0]&16&&(M=!0,it.sort=Z[4],Re(()=>M=!1)),x.$set(it),ae[0]&4096&&(Ne=Z[12],O=st(O,ae,Pe,1,Z,Ne,D,_,an,ib,E,nb));const bt={};ae[1]&16384&&(bt.$$scope={dirty:ae,ctx:Z}),!I&&ae[0]&16&&(I=!0,bt.sort=Z[4],Re(()=>I=!1)),P.$set(bt);const at={};ae[1]&16384&&(at.$$scope={dirty:ae,ctx:Z}),!U&&ae[0]&16&&(U=!0,at.sort=Z[4],Re(()=>U=!1)),G.$set(at),ae[0]&5450&&(He=Z[1],Ae(),te=st(te,ae,qe,1,Z,He,ce,W,Pt,sb,null,eb),De(),!He.length&&Je?Je.p(Z,ae):He.length?Je&&(Je.d(1),Je=null):(Je=ob(Z),Je.c(),Je.m(W,null))),ae[0]&1024&&ne(b,"table-loading",Z[10]),Z[1].length?be?be.p(Z,ae):(be=ab(Z),be.c(),be.m(e,oe)):be&&(be.d(1),be=null),Z[1].length&&Z[13]?Oe?Oe.p(Z,ae):(Oe=fb(Z),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null)},i(Z){if(!J){T(u.$$.fragment,Z),T(y.$$.fragment,Z),T(x.$$.fragment,Z),T(P.$$.fragment,Z),T(G.$$.fragment,Z);for(let ae=0;ae<He.length;ae+=1)T(te[ae]);J=!0}},o(Z){F(u.$$.fragment,Z),F(y.$$.fragment,Z),F(x.$$.fragment,Z),F(P.$$.fragment,Z),F(G.$$.fragment,Z);for(let ae=0;ae<te.length;ae+=1)F(te[ae]);J=!1},d(Z){Z&&k(e),q(u),q(y),q(x);for(let ae=0;ae<O.length;ae+=1)O[ae].d();q(P),q(G);for(let ae=0;ae<te.length;ae+=1)te[ae].d();Je&&Je.d(),be&&be.d(),Oe&&Oe.d(),$e=!1,rt(ee)}}}function vA(n){let e;return{c(){e=g("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function yA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function kA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function ib(n,e){let t,i,o,r,l,s,a,f=e[40].name+"",c,u,d;return{key:n,first:null,c(){t=g("th"),i=g("div"),o=g("i"),l=$(),s=g("span"),a=j("profile."),c=j(f),p(o,"class",r=B.getFieldTypeIcon(e[40].type)),p(s,"class","txt"),p(i,"class","col-header-content"),p(t,"class",u="col-type-"+e[40].type+" col-field-"+e[40].name),p(t,"name",d=e[40].name),this.first=t},m(h,b){w(h,t,b),m(t,i),m(i,o),m(i,l),m(i,s),m(s,a),m(s,c)},p(h,b){e=h,b[0]&4096&&r!==(r=B.getFieldTypeIcon(e[40].type))&&p(o,"class",r),b[0]&4096&&f!==(f=e[40].name+"")&&ge(c,f),b[0]&4096&&u!==(u="col-type-"+e[40].type+" col-field-"+e[40].name)&&p(t,"class",u),b[0]&4096&&d!==(d=e[40].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function wA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function SA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function ob(n){let e;function t(r,l){return r[10]?xA:CA}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function CA(n){var s;let e,t,i,o,r,l=((s=n[3])==null?void 0:s.length)&&rb(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No users found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,f){w(a,e,f),m(e,t),m(t,i),m(t,o),l&&l.m(t,null),m(e,r)},p(a,f){var c;(c=a[3])!=null&&c.length?l?l.p(a,f):(l=rb(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(a){a&&k(e),l&&l.d()}}}function xA(n){let e;return{c(){e=g("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function rb(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[24]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function lb(n,e){let t,i,o;return i=new L1({props:{field:e[40],record:e[37].profile||{}}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l[0]&4096&&(s.field=e[40]),l[0]&2&&(s.record=e[37].profile||{}),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function sb(n,e){let t,i,o,r,l,s,a,f=e[37].email+"",c,u,d,h,b=e[37].verified?"Verified":"Unverified",v,_,y=[],S=new Map,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y;o=new Ls({props:{id:e[37].id}});let W=e[12];const te=oe=>oe[40].name;for(let oe=0;oe<W.length;oe+=1){let J=tb(e,W,oe),$e=te(J);S.set($e,y[oe]=lb($e,J))}M=new Ci({props:{date:e[37].created}}),D=new Ci({props:{date:e[37].updated}});function ce(){return e[22](e[37])}function ve(){return e[23](e[37])}return{key:n,first:null,c(){t=g("tr"),i=g("td"),V(o.$$.fragment),r=$(),l=g("td"),s=g("div"),a=g("span"),c=j(f),d=$(),h=g("span"),v=j(b),_=$();for(let oe=0;oe<y.length;oe+=1)y[oe].c();C=$(),x=g("td"),V(M.$$.fragment),A=$(),O=g("td"),V(D.$$.fragment),E=$(),P=g("td"),I=g("button"),I.innerHTML=`<i class="ri-user-settings-line"></i>
|
||||
<span class="txt">Edit user</span>`,R=$(),G=g("button"),G.innerHTML=`<i class="ri-profile-line"></i>
|
||||
<span class="txt">Edit profile</span>`,U=$(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",u=e[37].email),p(h,"class","label"),ne(h,"label-success",e[37].verified),ne(h,"label-warning",!e[37].verified),p(s,"class","inline-flex"),p(l,"class","col-type-email col-field-email"),p(x,"class","col-type-date col-field-created"),p(O,"class","col-type-date col-field-updated"),p(I,"type","button"),p(I,"class","btn btn-sm btn-outline"),p(G,"type","button"),p(G,"class","btn btn-sm m-l-10"),p(P,"class","col-type-action min-width"),this.first=t},m(oe,J){w(oe,t,J),m(t,i),H(o,i,null),m(t,r),m(t,l),m(l,s),m(s,a),m(a,c),m(s,d),m(s,h),m(h,v),m(t,_);for(let $e=0;$e<y.length;$e+=1)y[$e].m(t,null);m(t,C),m(t,x),H(M,x,null),m(t,A),m(t,O),H(D,O,null),m(t,E),m(t,P),m(P,I),m(P,R),m(P,G),m(t,U),z=!0,K||(Y=[X(I,"click",Vn(ce)),X(G,"click",Vn(ve))],K=!0)},p(oe,J){e=oe;const $e={};J[0]&2&&($e.id=e[37].id),o.$set($e),(!z||J[0]&2)&&f!==(f=e[37].email+"")&&ge(c,f),(!z||J[0]&2&&u!==(u=e[37].email))&&p(a,"title",u),(!z||J[0]&2)&&b!==(b=e[37].verified?"Verified":"Unverified")&&ge(v,b),J[0]&2&&ne(h,"label-success",e[37].verified),J[0]&2&&ne(h,"label-warning",!e[37].verified),J[0]&4098&&(W=e[12],Ae(),y=st(y,J,te,1,e,W,S,t,Pt,lb,C,tb),De());const ee={};J[0]&2&&(ee.date=e[37].created),M.$set(ee);const _e={};J[0]&2&&(_e.date=e[37].updated),D.$set(_e)},i(oe){if(!z){T(o.$$.fragment,oe);for(let J=0;J<W.length;J+=1)T(y[J]);T(M.$$.fragment,oe),T(D.$$.fragment,oe),z=!0}},o(oe){F(o.$$.fragment,oe);for(let J=0;J<y.length;J+=1)F(y[J]);F(M.$$.fragment,oe),F(D.$$.fragment,oe),z=!1},d(oe){oe&&k(t),q(o);for(let J=0;J<y.length;J+=1)y[J].d();q(M),q(D),K=!1,rt(Y)}}}function ab(n){let e,t,i=n[1].length+"",o,r,l;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),l=j(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(s,a){w(s,e,a),m(e,t),m(e,o),m(e,r),m(e,l)},p(s,a){a[0]&2&&i!==(i=s[1].length+"")&&ge(o,i),a[0]&4&&ge(l,s[2])},d(s){s&&k(e)}}}function fb(n){let e,t,i,o,r=n[2]-n[1].length+"",l,s,a,f;return{c(){e=g("div"),t=g("button"),i=g("span"),o=j("Load more ("),l=j(r),s=j(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ne(t,"btn-loading",n[10]),ne(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(c,u){w(c,e,u),m(e,t),m(t,i),m(i,o),m(i,l),m(i,s),a||(f=X(t,"click",n[25]),a=!0)},p(c,u){u[0]&6&&r!==(r=c[2]-c[1].length+"")&&ge(l,r),u[0]&1024&&ne(t,"btn-loading",c[10]),u[0]&1024&&ne(t,"btn-disabled",c[10])},d(c){c&&k(e),a=!1,f()}}}function MA(n){let e,t,i,o,r,l,s,a,f;const c=[vA,_A],u=[];function d(_,y){return _[11]?0:1}e=d(n),t=u[e]=c[e](n);let h={};o=new gA({props:h}),n[26](o),o.$on("save",n[27]),o.$on("delete",n[28]);let b={};l=new hc({props:b}),n[29](l),l.$on("save",n[30]);let v={collection:n[5]};return a=new F1({props:v}),n[31](a),a.$on("save",n[32]),{c(){t.c(),i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment)},m(_,y){u[e].m(_,y),w(_,i,y),H(o,_,y),w(_,r,y),H(l,_,y),w(_,s,y),H(a,_,y),f=!0},p(_,y){let S=e;e=d(_),e===S?u[e].p(_,y):(Ae(),F(u[S],1,1,()=>{u[S]=null}),De(),t=u[e],t?t.p(_,y):(t=u[e]=c[e](_),t.c()),T(t,1),t.m(i.parentNode,i));const C={};o.$set(C);const x={};l.$set(x);const M={};y[0]&32&&(M.collection=_[5]),a.$set(M)},i(_){f||(T(t),T(o.$$.fragment,_),T(l.$$.fragment,_),T(a.$$.fragment,_),f=!0)},o(_){F(t),F(o.$$.fragment,_),F(l.$$.fragment,_),F(a.$$.fragment,_),f=!1},d(_){u[e].d(_),_&&k(i),n[26](null),q(o,_),_&&k(r),n[29](null),q(l,_),_&&k(s),n[31](null),q(a,_)}}}function $A(n,e,t){var $e;let i,o;const r=B.getQueryParams(($e=window.location)==null?void 0:$e.href),l=["id","userId","created","updated"];let s,a,f,c=[],u=1,d=0,h=!1,b=r.filter||"",v=r.sort||"-created",_=new En,y=!1;B.setDocumentTitle("Users"),M();async function S(ee=1){return t(10,h=!0),Se.Users.getList(ee,50,{sort:v||"-created",filter:b}).then(_e=>{ee<=1&&C(),t(10,h=!1),t(1,c=c.concat(_e.items)),t(9,u=_e.page),t(2,d=_e.totalItems)}).catch(_e=>{_e!==null&&(t(10,h=!1),console.warn(_e),C(),Se.errorResponseHandler(_e,!1))})}function C(){t(1,c=[]),t(9,u=1),t(2,d=0)}function x(ee){const _e=c.find(fe=>fe.id===(ee==null?void 0:ee.userId));_e&&(_e.profile=ee),t(1,c)}async function M(){t(11,y=!0);try{t(5,_=await Se.Collections.getOne("profiles"))}catch(ee){Se.errorResponseHandler(ee)}t(11,y=!1)}const A=()=>a==null?void 0:a.show(_),O=()=>s==null?void 0:s.show(),D=ee=>t(3,b=ee.detail);function E(ee){v=ee,t(4,v)}function P(ee){v=ee,t(4,v)}function I(ee){v=ee,t(4,v)}function R(ee){v=ee,t(4,v)}const G=ee=>s==null?void 0:s.show(ee),U=ee=>f==null?void 0:f.show(ee.profile),z=()=>t(3,b=""),K=()=>S(u+1);function Y(ee){he[ee?"unshift":"push"](()=>{s=ee,t(6,s)})}const W=()=>S(),te=()=>S();function ce(ee){he[ee?"unshift":"push"](()=>{a=ee,t(7,a)})}const ve=ee=>t(5,_=ee.detail);function oe(ee){he[ee?"unshift":"push"](()=>{f=ee,t(8,f)})}const J=ee=>x(ee.detail);return n.$$.update=()=>{var ee;n.$$.dirty[0]&24&&v!==-1&&b!==-1&&(B.replaceClientQueryParams({filter:b,soLine truncated
|
||||
<span class="txt">Application</span>`,l=$(),s=g("a"),s.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||||
<span class="txt">Mail settings</span>`,a=$(),f=g("a"),f.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||||
<span class="txt">Files storage</span>`,c=$(),u=g("div"),u.textContent="Authentication",d=$(),h=g("a"),h.innerHTML=`<i class="ri-lock-password-line"></i>
|
||||
<span class="txt">Auth providers</span>`,b=$(),v=g("a"),v.innerHTML=`<i class="ri-key-line"></i>
|
||||
<span class="txt">Token options</span>`,_=$(),y=g("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
|
||||
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(r,"href","/settings"),p(r,"class","sidebar-list-item"),p(s,"href","/settings/mail"),p(s,"class","sidebar-list-item"),p(f,"href","/settings/storage"),p(f,"class","sidebar-list-item"),p(u,"class","sidebar-title"),p(h,"href","/settings/auth-providers"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/tokens"),p(v,"class","sidebar-list-item"),p(y,"href","/settings/admins"),p(y,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(x,M){w(x,e,M),m(e,t),m(t,i),m(t,o),m(t,r),m(t,l),m(t,s),m(t,a),m(t,f),m(t,c),m(t,u),m(t,d),m(t,h),m(t,b),m(t,v),m(t,_),m(t,y),S||(C=[Xe(li.call(null,r,{path:"/settings"})),Xe(xn.call(null,r)),Xe(li.call(null,s,{path:"/settings/mail/?.*"})),Xe(xn.call(null,s)),Xe(li.call(null,f,{path:"/settings/storage/?.*"})),Xe(xn.call(null,f)),Xe(li.call(null,h,{path:"/settings/auth-providers/?.*"})),Xe(xn.call(null,h)),Xe(li.call(null,v,{path:"/settings/tokens/?.*"})),Xe(xn.call(null,v)),Xe(li.call(null,y,{path:"/settings/admins/?.*"})),Xe(xn.call(null,y))],S=!0)},p:le,i:le,o:le,d(x){x&&k(e),S=!1,rt(C)}}}class er extends Ie{constructor(e){super(),Le(this,e,null,DA,Ee,{})}}function cb(n,e,t){const i=n.slice();return i[31]=e[t],i}function ub(n){let e,t;return e=new je({props:{class:"form-field disabled",name:"id",$$slots:{default:[OA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1073741826|o[1]&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function OA(n){let e,t,i,o,r,l,s,a,f;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="ID",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","text"),p(s,"id",a=n[30]),s.value=f=n[1].id,s.disabled=!0},m(c,u){w(c,e,u),m(e,t),m(e,i),m(e,o),w(c,l,u),w(c,s,u)},p(c,u){u[0]&1073741824&&r!==(r=c[30])&&p(e,"for",r),u[0]&1073741824&&a!==(a=c[30])&&p(s,"id",a),u[0]&2&&f!==(f=c[1].id)&&s.value!==f&&(s.value=f)},d(c){c&&k(e),c&&k(l),c&&k(s)}}}function db(n){let e,t,i,o,r,l,s,a;function f(){return n[17](n[31])}function c(...u){return n[18](n[31],...u)}return{c(){e=g("figure"),t=g("img"),r=$(),Qn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt",o="Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,d){w(u,e,d),m(e,t),m(e,r),s||(a=[X(e,"click",f),X(e,"keydown",c)],s=!0)},p(u,d){n=u,d[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),s=!1,rt(a)}}}function TA(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=g("i"),i=$(),o=g("span"),o.textContent="Email",l=$(),s=g("input"),p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"for",r=n[30]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",a=n[30]),s.required=!0},m(u,d){w(u,e,d),m(e,t),m(e,i),m(e,o),w(u,l,d),w(u,s,d),Me(s,n[3]),f||(c=X(s,"input",n[19]),f=!0)},p(u,d){d[0]&1073741824&&r!==(r=u[30])&&p(e,"for",r),d[0]&1073741824&&a!==(a=u[30])&&p(s,"id",a),d[0]&8&&s.value!==u[3]&&Me(s,u[3])},d(u){u&&k(e),u&&k(l),u&&k(s),f=!1,c()}}}function pb(n){let e,t;return e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[EA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,o){const r={};o[0]&1073741840|o[1]&8&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function EA(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(o,"for",l=n[30])},m(f,c){w(f,e,c),e.checked=n[4],w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[20]),s=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&16&&(e.checked=f[4]),c[0]&1073741824&&l!==(l=f[30])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function hb(n){let e,t,i,o,r,l,s,a,f;return o=new je({props:{class:"form-field required",name:"password",$$slots:{default:[PA,({uniqueId:c})=>({30:c}),({uniqueId:c})=>[c?1073741824:0]]},$$scope:{ctx:n}}}),s=new je({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[FA,({uniqueId:c})=>({30:c}),({uniqueId:c})=>[c?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),i=g("div"),V(o.$$.fragment),r=$(),l=g("div"),V(s.$$.fragment),p(i,"class","col-sm-6"),p(l,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(c,u){w(c,e,u),m(e,t),m(t,i),H(o,i,null),m(t,r),m(t,l),H(s,l,null),f=!0},p(c,u){const d={};u[0]&1073742080|u[1]&8&&(d.$$scope={dirty:u,ctx:c}),o.$set(d);const h={};u[0]&1073742336|u[1]&8&&(h.$$scope={dirty:u,ctx:c}),s.$set(h)},i(c){f||(T(o.$$.fragment,c),T(s.$$.fragment,c),Dt(()=>{a||(a=ct(t,fn,{duration:150},!0)),a.Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function NA(n){let e,t,i,o,r,l,s=n[1].isNew?"Create":"Save changes",a,f,c,u,d,h=!n[1].isNew&&mb(n);return{c(){h&&h.c(),e=$(),t=g("button"),i=g("span"),i.textContent="Cancel",o=$(),r=g("button"),l=g("span"),a=j(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(l,"class","txt"),p(r,"type","submit"),p(r,"form",n[11]),p(r,"class","btn btn-expanded"),r.disabled=f=!n[10]||n[6],ne(r,"btn-loading",n[6])},m(b,v){h&&h.m(b,v),w(b,e,v),w(b,t,v),m(t,i),w(b,o,v),w(b,r,v),m(r,l),m(l,a),c=!0,u||(d=X(t,"click",n[16]),u=!0)},p(b,v){b[1].isNew?h&&(Ae(),F(h,1,1,()=>{h=null}),De()):h?(h.p(b,v),v[0]&2&&T(h,1)):(h=mb(b),h.c(),T(h,1),h.m(e.parentNode,e)),(!c||v[0]&64)&&(t.disabled=b[6]),(!c||v[0]&2)&&s!==(s=b[1].isNew?"Create":"Save changes")&&ge(a,s),(!c||v[0]&1088&&f!==(f=!b[10]||b[6]))&&(r.disabled=f),v[0]&64&&ne(r,"btn-loading",b[6])},i(b){c||(T(h),c=!0)},o(b){F(h),c=!1},d(b){h&&h.d(b),b&&k(e),b&&k(t),b&&k(o),b&&k(r),u=!1,d()}}}function jA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[NA],header:[IA],default:[LA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),t=!0},p(o,r){const l={};r[0]&1152&&(l.beforeHide=o[23]),r[0]&1886|r[1]&8&&(l.$$scope={dirty:r,ctx:o}),e.$set(l)},i(o){t||(T(e.$$.fragment,o),t=!0)},o(o){F(e.$$.fragment,o),t=!1},d(o){n[24](null),q(e,o)}}}function zA(n,e,t){let i;const o=yn(),r="admin_"+B.randomString(5);let l,s=new Bo,a=!1,f=!1,c=0,u="",d="",h="",b=!1;function v(Y){return y(Y),t(7,f=!0),l==null?void 0:l.show()}function _(){return l==null?void 0:l.hide()}function y(Y){Ui({}),t(1,s=Y!=null&&Y.clone?Y.clone():new Bo),S()}function S(){t(4,b=!1),t(3,u=(s==null?void 0:s.email)||""),t(2,c=(s==null?void 0:s.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const Y={email:u,avatar:c};(s.isNew||b)&&(Y.password=d,Y.passwordConfirm=h);let W;s.isNew?W=Se.Admins.create(Y):W=Se.Admins.update(s.id,Y),W.then(async te=>{var ce;t(7,f=!1),_(),hn(s.isNew?"Successfully created admin.":"Successfully updated admin."),o("save",te),((ce=Se.AuthStore.model)==null?void 0:ce.id)===te.id&&Se.AuthStore.save(Se.AuthStore.token,te)}).catch(te=>{Se.errorResponseHandler(te)}).finally(()=>{t(6,a=!1)})}function x(){!(s!=null&&s.id)||xi("Do you really want to delete the selected admin?",()=>Se.Admins.delete(s.id).then(()=>{t(7,f=!1),_(),hn("Successfully deleted admin."),o("delete",s)}).catch(Y=>{Se.errorResponseHandler(Y)}))}const M=()=>x(),A=()=>_(),O=Y=>t(2,c=Y),D=(Y,W)=>{(W.code==="Enter"||W.code==="Space")&&(W.preventDefault(),t(2,c=Y))};function E(){u=this.value,t(3,u)}function P(){b=this.checked,t(4,b)}function I(){d=this.value,t(8,d)}function R(){h=this.value,t(9,h)}const G=()=>i&&f?(xi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,f=!1),_()}),!1):!0;function U(Y){he[Y?"unshift":"push"](()=>{l=Y,t(5,l)})}function z(Y){ft.call(this,n,Y)}function K(Y){ft.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=s.isNew&&u!=""||b||u!==s.email||c!==s.avatar)},[_,s,c,u,b,l,a,f,d,h,i,r,C,x,v,M,A,O,D,E,P,I,R,G,U,z,K]}class HA extends Ie{constructor(e){super(),Le(this,e,zA,jA,Ee,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function bb(n,e,t){const i=n.slice();return i[21]=e[t],i}function qA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function VA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function BA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function UA(n){let e,t,i,o;return{c(){e=g("div"),t=g("i"),i=$(),o=g("span"),o.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(o,"class","txt"),p(e,"class","col-header-content")},m(r,l){w(r,e,l),m(e,t),m(e,i),m(e,o)},p:le,d(r){r&&k(e)}}}function gb(n){let e;function t(r,l){return r[5]?YA:WA}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,l){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},d(r){o.d(r),r&&k(e)}}}function WA(n){var s;let e,t,i,o,r,l=((s=n[1])==null?void 0:s.length)&&_b(n);return{c(){e=g("tr"),t=g("td"),i=g("h6"),i.textContent="No admins found.",o=$(),l&&l.c(),r=$(),p(t,"colspan","99"),p(t,"class","txt-cenLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function _b(n){let e,t,i;return{c(){e=g("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(o,r){w(o,e,r),t||(i=X(e,"click",n[15]),t=!0)},p:le,d(o){o&&k(e),t=!1,i()}}}function vb(n){let e;return{c(){e=g("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yb(n,e){let t,i,o,r,l,s,a,f,c,u,d,h,b=e[21].email+"",v,_,y,S,C,x,M,A,O,D,E,P,I,R;f=new Ls({props:{id:e[21].id}});let G=e[21].id===e[6].id&&vb();C=new Ci({props:{date:e[21].created}}),A=new Ci({props:{date:e[21].updated}});function U(){return e[13](e[21])}function z(...K){return e[14](e[21],...K)}return{key:n,first:null,c(){t=g("tr"),i=g("td"),o=g("figure"),r=g("img"),s=$(),a=g("td"),V(f.$$.fragment),c=$(),G&&G.c(),u=$(),d=g("td"),h=g("span"),v=j(b),y=$(),S=g("td"),V(C.$$.fragment),x=$(),M=g("td"),V(A.$$.fragment),O=$(),D=g("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',E=$(),Qn(r.src,l="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg")||p(r,"src",l),p(r,"alt","Admin avatar"),p(o,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",_=e[21].email),p(d,"class","col-type-email col-field-email"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,Y){w(K,t,Y),m(t,i),m(i,o),m(o,r),m(t,s),m(t,a),H(f,a,null),m(a,c),G&&G.m(a,null),m(t,u),m(t,d),m(d,h),m(h,v),m(t,y),m(t,S),H(C,S,null),m(t,x),m(t,M),H(A,M,null),m(t,O),m(t,D),m(t,E),P=!0,I||(R=[X(t,"click",U),X(t,"keydown",z)],I=!0)},p(K,Y){e=K,(!P||Y&16&&!Qn(r.src,l="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg"))&&p(r,"src",l);const W={};Y&16&&(W.id=e[21].id),f.$set(W),e[21].id===e[6].id?G||(G=vb(),G.c(),G.m(a,null)):G&&(G.d(1),G=null),(!P||Y&16)&&b!==(b=e[21].email+"")&&ge(v,b),(!P||Y&16&&_!==(_=e[21].email))&&p(h,"title",_);const te={};Y&16&&(te.date=e[21].created),C.$set(te);const ce={};Y&16&&(ce.date=e[21].updated),A.$set(ce)},i(K){P||(T(f.$$.fragment,K),T(C.$$.fragment,K),T(A.$$.fragment,K),P=!0)},o(K){F(f.$$.fragment,K),F(C.$$.fragment,K),F(A.$$.fragment,K),P=!1},d(K){K&&k(t),q(f),G&&G.d(),q(C),q(A),I=!1,rt(R)}}}function kb(n){let e,t,i=n[4].length+"",o,r,l=n[4].length+"",s;return{c(){e=g("small"),t=j("Showing "),o=j(i),r=j(" of "),s=j(l),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,f){w(a,e,f),m(e,t),m(e,o),m(e,r),m(e,s)},p(a,f){f&16&&i!==(i=a[4].length+"")&&ge(o,i),f&16&&l!==(l=a[4].length+"")&&ge(s,l)},d(a){a&&k(e)}}}function GA(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G,U,z,K,Y,W=[],te=new Map,ce,ve,oe,J,$e,ee;e=new er({}),u=new Ds({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),u.$on("submit",n[8]);function _e(be){n[9](be)}let fe={class:"col-type-text",name:"id",$$slots:{default:[qA]},$$scope:{ctx:n}};n[2]!==void 0&&(fe.sort=n[2]),C=new en({props:fe}),he.push(()=>Fe(C,"sort",_e));function ie(be){n[10](be)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VA]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),A=new en({props:ye}),he.push(()=>Fe(A,"sort",ie));function Ne(be){n[11](be)}let Pe={class:"col-type-date col-field-created",name:"created",$$slots:{default:[BA]},$$scope:{ctx:n}};n[2]!==void 0&&(Pe.sort=n[2]),E=new en({props:Pe}),he.push(()=>Fe(E,"sort",Ne));function ze(be){n[12](be)}let se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[UA]},$$scope:{ctx:n}};n[2]!==void 0&&(se.sort=n[2]),R=new en({props:se}),he.push(()=>Fe(R,"sort",ze));let re=n[4];const ke=be=>be[21].id;for(let be=0;be<re.length;be+=1){let Oe=bb(n,re,be),Z=ke(Oe);te.set(Z,W[be]=yb(Z,Oe))}let He=null;re.length||(He=gb(n));let qe=n[4].length&&kb(n),Je={};return oe=new HA({props:Je}),n[16](oe),oe.$on("save",n[17]),oe.$on("delete",n[18]),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),r=g("nav"),r.innerHTML=`<div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Admins</div>`,l=$(),s=g("div"),a=$(),f=g("button"),f.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New admin</span>`,c=$(),V(u.$$.fragment),d=$(),h=g("div"),b=g("table"),v=g("thead"),_=g("tr"),y=g("th"),S=$(),V(C.$$.fragment),M=$(),V(A.$$.fragment),D=$(),V(E.$$.fragment),I=$(),V(R.$$.fragment),U=$(),z=g("th"),K=$(),Y=g("tbody");for(let be=0;be<W.length;be+=1)W[be].c();He&&He.c(),ce=$(),qe&&qe.c(),ve=$(),V(oe.$$.fragment),p(r,"class","breadcrumbs"),p(s,"class","flex-fill"),p(f,"type","button"),p(f,"class","btn btn-expanded"),p(o,"class","page-header"),p(y,"class","min-width"),p(z,"class","col-type-action min-width"),p(b,"class","table"),ne(b,"table-loading",n[5]),p(h,"class","table-wrapper"),p(i,"class","page-wrapper")},m(be,Oe){H(e,be,Oe),w(be,t,Oe),w(be,i,Oe),m(i,o),m(o,r),m(o,l),m(o,s),m(o,a),m(o,f),m(i,c),H(u,i,null),m(i,d),m(i,h),m(h,b),m(b,v),m(v,_),m(_,y),m(_,S),H(C,_,null),m(_,M),H(A,_,null),m(_,D),H(E,_,null),m(_,I),H(R,_,null),m(_,U),m(_,z),m(b,K),m(b,Y);for(let Z=0;Z<W.length;Z+=1)W[Z].m(Y,null);He&&He.m(Y,null),m(i,ce),qe&&qe.m(i,null),w(be,ve,Oe),H(oe,be,Oe),J=!0,$e||(ee=X(f,"click",n[7]),$e=!0)},p(be,[Oe]){const Z={};Oe&2&&(Z.value=be[1]),u.$set(Z);const ae={};Oe&16777216&&(ae.$$scope={dirty:Oe,ctx:be}),!x&&Oe&4&&(x=!0,ae.sort=be[2],Re(()=>x=!1)),C.$set(ae);const Ve={};Oe&16777216&&(Ve.$$scope={dirty:Oe,ctx:be}),!O&&Oe&4&&(O=!0,Ve.sort=be[2],Re(()=>O=!1)),A.$set(Ve);const yt={};Oe&16777216&&(yt.$$scope={dirty:Oe,ctx:be}),!P&&Oe&4&&(P=!0,yt.sort=be[2],Re(()=>P=!1)),E.$set(yt);const it={};Oe&16777216&&(it.$$scope={dirty:Oe,ctx:be}),!G&&Oe&4&&(G=!0,it.sort=be[2],Re(()=>G=!1)),R.$set(it),Oe&122&&(re=be[4],Ae(),W=st(W,Oe,ke,1,be,re,te,Y,Pt,yb,null,bb),De(),!re.length&&He?He.p(be,Oe):re.length?He&&(He.d(1),He=null):(He=gb(be),He.c(),He.m(Y,null))),Oe&32&&ne(b,"table-loading",be[5]),be[4].length?qe?qe.p(be,Oe):(qe=kb(be),qe.c(),qe.m(i,null)):qe&&(qe.d(1),qe=null);const bt={};oe.$set(bt)},i(be){if(!J){T(e.$$.fragment,be),T(u.$$.fragment,be),T(C.$$.fragment,be),T(A.$$.fragment,be),T(E.$$.fragment,be),T(R.$$.fragment,be);for(let Oe=0;Oe<re.length;Oe+=1)T(W[Oe]);T(oe.$$.fragment,be),J=!0}},o(be){F(e.$$.fragment,be),F(u.$$.fragment,be),F(C.$$.fragment,be),F(A.$$.fragment,be),F(E.$$.fragment,be),F(R.$$.fragment,be);for(let Oe=0;Oe<W.length;Oe+=1)F(W[Oe]);F(oe.$$.fragment,be),J=!1},d(be){q(e,be),be&&k(t),be&&k(i),q(u),q(C),q(A),q(E),q(R);for(let Oe=0;Oe<W.length;Oe+=1)W[Oe].d();He&&He.d(),qe&&qe.d(),be&&k(ve),n[16](null),q(oe,be),$e=!1,ee()}}}function KA(n,e,t){var D;let i;pn(n,qf,E=>t(6,i=E));const o=B.getQueryParams((D=window.location)==null?void 0:D.href);let r,l=[],s=!1,a=o.filter||"",f=o.sort||"-created";B.setDocumentTitle("Admins");function c(){return t(5,s=!0),t(4,l=[]),Se.Admins.getFullList(100,{sort:f||"-created",filter:a}).then(E=>{t(4,l=E),t(5,s=!1)}).catch(E=>{E!==null&&(t(5,s=!1),console.warn(E),u(),Se.errorResponseHandler(E,!1))})}function u(){t(4,l=[])}const d=()=>r==null?void 0:r.show(),h=E=>t(1,a=E.detail);function b(E){f=E,t(2,f)}function v(E){f=E,t(2,f)}function _(E){f=E,t(2,f)}function y(E){f=E,t(2,f)}const S=E=>r==null?void 0:r.show(E),C=(E,P)=>{(P.code==="Enter"||P.code==="Space")&&(P.preventDefault(),r==null||r.show(E))},x=()=>t(1,a="");function M(E){he[E?"unshift":"push"](()=>{r=E,t(3,r)})}const A=()=>c(),O=()=>c();return n.$$.update=()=>{n.$$.dirty&6&&f!==-1&&a!==-1&&(B.replaceClientQueryParams({filter:a,sort:f}),c())},[c,a,f,r,l,s,i,d,h,b,v,_,y,S,C,x,M,A,O]}class JA extends Ie{constructor(e){super(),Le(this,e,KA,GA,Ee,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function wb(n){let e,t,i;return{c(){e=g("div"),e.innerHTML=`<figure class="logo"><img src="/_/images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
|
||||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=$(),i=g("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r)},d(o){o&&k(e),o&&k(t),o&&k(i)}}}function ZA(n){let e,t,i,o,r,l,s,a,f=!n[0]&&wb();const c=n[2].default,u=$n(c,n,n[1],null);return{c(){e=g("div"),t=g("div"),i=$(),o=g("div"),f&&f.c(),r=$(),u&&u.c(),l=$(),s=g("div"),p(t,"class","flex-fill"),p(o,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(s,"class","flex-fill"),p(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,o),f&&f.m(o,null),m(o,r),u&&u.m(o,null),m(e,l),m(e,s),a=!0},p(d,[h]){d[0]?f&&(f.d(1),f=null):f||(f=wb(),f.c(),f.m(o,r)),u&&u.p&&(!a||h&2)&&Dn(u,c,d,d[1],a?An(c,d[1],h,null):On(d[1]),null)},i(d){a||(T(u,d),a=!0)},o(d){F(u,d),a=!1},d(d){d&&k(e),f&&f.d(),u&&u.d(d)}}}function XA(n,e,t){let{$$slots:i={},$$scope:o}=e,{nobranding:r=!1}=e;return n.$$set=l=>{"nobranding"in l&&t(0,r=l.nobranding),"$$scope"in l&&t(1,o=l.$$scope)},[r,o,i]}class QA extends Ie{constructor(e){super(),Le(this,e,XA,ZA,Ee,{nobranding:0})}}function eD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Email"),o=$(),r=g("input"),p(e,"for",i=n[7]),p(r,"type","email"),p(r,"id",l=n[7]),r.required=!0,r.autofocus=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0]),r.focus(),s||(a=X(r,"input",n[4]),s=!0)},p(f,c){c&128&&i!==(i=f[7])&&p(e,"for",i),c&128&&l!==(l=f[7])&&p(r,"id",l),c&1&&r.value!==f[0]&&Me(r,f[0])},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function tD(n){let e,t,i,o,r,l,s,a,f,c,u;return{c(){e=g("label"),t=j("Password"),o=$(),r=g("input"),s=$(),a=g("div"),f=g("a"),f.textContent="Forgotten password?",p(e,"for",i=n[7]),p(r,"type","password"),p(r,"id",l=n[7]),r.required=!0,p(f,"href","/request-password-reset"),p(f,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,o,h),w(d,r,h),Me(r,n[1]),w(d,s,h),w(d,a,h),m(a,f),c||(u=[X(r,"input",n[5]),Xe(xn.call(null,f))],c=!0)},p(d,h){h&128&&i!==(i=d[7])&&p(e,"for",i),h&128&&l!==(l=d[7])&&p(r,"id",l),h&2&&r.value!==d[1]&&Me(r,d[1])},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(s),d&&k(a),c=!1,rt(u)}}}function nD(n){let e,t,i,o,r,l,s,a,f,c,u;return o=new je({props:{class:"form-field required",name:"email",$$slots:{default:[eD,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"password",$$slots:{default:[tD,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=g("form"),t=g("div"),t.innerHTML="<h4>Admin sign in</h4>",i=$(),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),a=g("button"),a.innerHTML=`<span class="txt">Login</span>
|
||||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ne(a,"btn-disabled",n[2]),ne(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(o,e,null),m(e,r),H(l,e,null),m(e,s),m(e,a),f=!0,c||(u=X(e,"submit",Gt(n[3])),c=!0)},p(d,h){const b={};h&385&&(b.$$scope={dirty:h,ctx:d}),o.$set(b);const v={};h&386&&(v.$$scope={dirty:h,ctx:d}),l.$set(v),h&4&&ne(a,"btn-disabled",d[2]),h&4&&ne(a,"btn-loading",d[2])},i(d){f||(T(o.$$.fragment,d),T(l.$$.fragment,d),f=!0)},o(d){F(o.$$.fragment,d),F(l.$$.fragment,d),f=!1},d(d){d&&k(e),q(o),q(l),c=!1,u()}}}function iD(n){let e,t;return e=new QA({props:{$$slots:{default:[nD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,o){H(e,i,o),t=!0},p(i,[o]){const r={};o&263&&(r.$$scope={dirty:o,ctx:i}),e.$set(r)},i(i){t||(T(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function oD(n,e,t){var c;const i=B.getQueryParams((c=window.location)==null?void 0:c.href);let o=i.demoEmail||"",r=i.demoPassword||"",l=!1;function s(){if(!l)return t(2,l=!0),Se.Admins.authViaEmail(o,r).then(()=>{Ss("/")}).catch(()=>{M0("Invalid login credentials.")}).finally(()=>{t(2,l=!1)})}function a(){o=this.value,t(0,o)}function f(){r=this.value,t(1,r)}return[o,r,l,s,a,f]}class rD extends Ie{constructor(e){super(),Le(this,e,oD,iD,Ee,{})}}function lD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S;return i=new je({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[aD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[fD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[cD,({uniqueId:C})=>({12:C}),({uniqueId:C})=>C?4096:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),V(a.$$.fragment),f=$(),c=g("div"),u=g("div"),d=$(),h=g("button"),b=g("span"),b.textContent="Save changes",p(t,"class","col-lg-6"),p(r,"class","col-lg-6"),p(u,"class","flex-fill"),p(b,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=v=!n[3]||n[2],ne(h,"btn-loading",n[2]),p(c,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,x){w(C,e,x),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),H(a,e,null),m(e,f),m(e,c),m(c,u),m(c,d),m(c,h),m(h,b),_=!0,y||(S=X(h,"click",n[9]),y=!0)},p(C,x){const M={};x&12289&&(M.$$scope={dirty:x,ctx:C}),i.$set(M);const A={};x&12289&&(A.$$scope={dirty:x,ctx:C}),l.$set(A);const O={};x&12289&&(O.$$scope={dirty:x,ctx:C}),a.$set(O),(!_||x&12&&v!==(v=!C[3]||C[2]))&&(h.disabled=v),x&4&&ne(h,"btn-loading",C[2])},i(C){_||(T(i.$$.fragment,C),T(l.$$.fragment,C),T(a.$$.fragment,C),_=!0)},o(C){F(i.$$.fragment,C),F(l.$$.fragment,C),F(a.$$.fragment,C),_=!1},d(C){C&&k(e),q(i),q(l),q(a),y=!1,S()}}}function sD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function aD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Application name"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","text"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.appName),s||(a=X(r,"input",n[6]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&r.value!==f[0].meta.appName&&Me(r,f[0].meta.appName)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function fD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Application url"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","text"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.appUrl),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&r.value!==f[0].meta.appUrl&&Me(r,f[0].meta.appUrl)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function cD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Logs max days retention"),o=$(),r=g("input"),p(e,"for",i=n[12]),p(r,"type","number"),p(r,"id",l=n[12]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].logs.maxDays),s||(a=X(r,"input",n[8]),s=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&l!==(l=f[12])&&p(r,"id",l),c&1&&At(r.value)!==f[0].logs.maxDays&&Me(r,f[0].logs.maxDays)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function uD(n){let e,t,i,o,r,l,s,a,f,c,u,d;e=new er({});const h=[sD,lD],b=[];function v(_,y){return _[1]?0:1}return a=v(n),f=b[a]=h[a](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Application</div></nav>`,r=$(),l=g("div"),s=g("form"),f.c(),p(o,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(_,y){H(e,_,y),w(_,t,y),w(_,i,y),m(i,o),m(i,r),m(i,l),m(l,s),b[a].m(s,null),c=!0,u||(d=X(s,"submit",Gt(n[4])),u=!0)},p(_,[y]){let S=a;a=v(_),a===S?b[a].p(_,y):(Ae(),F(b[S],1,1,()=>{b[S]=null}),De(),f=b[a],f?f.p(_,y):(f=b[a]=h[a](_),f.c()),T(f,1),f.m(s,null))},i(_){c||(T(e.$$.fragment,_),T(f),c=!0)},o(_){F(e.$$.fragment,_),F(f),c=!1},d(_){q(e,_),_&&k(t),_&&k(i),b[a].d(),u=!1,d()}}}function dD(n,e,t){let i,o={},r=!1,l=!1,s="";B.setDocumentTitle("Application settings"),a();async function a(){t(1,r=!0);try{const v=await Se.Settings.getAll()||{};c(v)}catch(v){Se.errorResponseHandler(v)}t(1,r=!1)}async function f(){if(!(l||!i)){t(2,l=!0);try{const v=await Se.Settings.update(B.filterRedactedProps(o));c(v),hn("Successfully saved application settings.")}catch(v){Se.errorResponseHandler(v)}t(2,l=!1)}}function c(v={}){t(0,o={meta:(v==null?void 0:v.meta)||{},logs:(v==null?void 0:v.logs)||{}}),t(5,s=JSON.stringify(o))}function u(){o.meta.appName=this.value,t(0,o)}function d(){o.meta.appUrl=this.value,t(0,o)}function h(){o.logs.maxDays=At(this.value),t(0,o)}const b=()=>f();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=s!=JSON.stringify(o))},[o,r,l,i,f,s,u,d,h,b]}class pD extends Ie{constructor(e){super(),Le(this,e,dD,uD,Ee,{})}}function hD(n){let e,t,i,o=[{type:"password"},{autocomplete:"new-password"},n[5]],r={};for(let l=0;l<o.length;l+=1)r=ut(r,o[l]);return{c(){e=g("input"),ci(e,r)},m(l,s){w(l,e,s),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(l,s){ci(e,r=bn(o,[{type:"password"},{autocomplete:"new-password"},s&32&&l[5]])),s&1&&e.value!==l[0]&&Me(e,l[0])},d(l){l&&k(e),n[7](null),t=!1,i()}}}function mD(n){let e,t,i,o,r,l,s=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let f=0;f<s.length;f+=1)a=ut(a,s[f]);return{c(){e=g("div"),t=g("button"),t.innerHTML='<i class="ri-key-line"></i>',i=$(),o=g("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),ci(o,a)},m(f,c){w(f,e,c),m(e,t),w(f,i,c),w(f,o,c),o.autofocus&&o.focus(),r||(l=[Xe(St.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],r=!0)},p(f,c){ci(o,a=bn(s,[{readOnly:!0},{type:"text"},c&2&&{placeholder:f[1]},c&32&&f[5]]))},d(f){f&&k(e),f&&k(i),f&&k(o),r=!1,rt(l)}}}function bD(n){let e;function t(r,l){return r[3]?mD:hD}let i=t(n),o=i(n);return{c(){o.c(),e=lt()},m(r,l){o.m(r,l),w(r,e,l)},p(r,[l]){i===(i=t(r))&&o?o.p(r,l):(o.d(1),o=i(r),o&&(o.c(),o.m(e.parentNode,e)))},i:le,o:le,d(r){o.d(r),r&&k(e)}}}function gD(n,e,t){const i=["value","mask"];let o=Wt(e,i),{value:r=""}=e,{mask:l="******"}=e,s,a=!1;async function f(){t(0,r=""),t(3,a=!1),await Bi(),s==null||s.focus()}const c=()=>f();function u(h){he[h?"unshift":"push"](()=>{s=h,t(2,s)})}function d(){r=this.value,t(0,r)}return n.$$set=h=>{e=ut(ut({},e),ui(h)),t(5,o=Wt(e,i)),"value"in h&&t(0,r=h.value),"mask"in h&&t(1,l=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&r===l&&t(3,a=!0)},[r,l,s,a,f,o,c,u,d]}class mc extends Ie{constructor(e){super(),Le(this,e,gD,bD,Ee,{value:0,mask:1})}}function _D(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C,x,M,A,O,D,E,P,I,R,G;i=new je({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[yD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[kD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[wD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),c=new je({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[SD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[CD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}}),S=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[xD,({uniqueId:z})=>({22:z}),({uniqueId:z})=>z?4194304:0]},$$scope:{ctx:n}}});let U=n[0].smtp.enabled&&Sb(n);return{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),V(a.$$.fragment),f=$(),V(c.$$.fragment),u=$(),V(d.$$.fragment),h=$(),b=g("hr"),v=$(),_=g("div"),_.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
|
||||
<br/>
|
||||
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||||
below.</strong></p>`,y=$(),V(S.$$.fragment),C=$(),U&&U.c(),x=$(),M=g("div"),A=g("div"),O=$(),D=g("button"),E=g("span"),E.textContent="Save changes",p(t,"class","col-lg-6"),p(r,"class","col-lg-6"),p(e,"class","grid"),p(_,"class","content m-b-sm"),p(A,"class","flex-fill"),p(E,"class","txt"),p(D,"type","submit"),p(D,"class","btn btn-expanded"),D.disabled=P=!n[3]||n[2],ne(D,"btn-loading",n[2]),p(M,"class","flex")},m(z,K){w(z,e,K),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),H(a,e,null),m(e,f),H(c,e,null),m(e,u),H(d,e,null),w(z,h,K),w(z,b,K),w(z,v,K),w(z,_,K),w(z,y,K),H(S,z,K),w(z,C,K),U&&U.m(z,K),w(z,x,K),w(z,M,K),m(M,A),m(M,O),m(M,D),m(D,E),I=!0,R||(G=X(D,"click",n[18]),R=!0)},p(z,K){const Y={};K&12582913&&(Y.$$scope={dirty:K,ctx:z}),i.$set(Y);const W={};K&12582913&&(W.$$scope={dirty:K,ctx:z}),l.$set(W);const te={};K&12582913&&(te.$$scope={dirty:K,ctx:z}),a.$set(te);const ce={};K&12582913&&(ce.$$scope={dirty:K,ctx:z}),c.$set(ce);const ve={};K&12582913&&(ve.$$scope={dirty:K,ctx:z}),d.$set(ve);const oe={};K&12582913&&(oe.$$scope={dirty:K,ctx:z}),S.$set(oe),z[0].smtp.enabled?U?(U.p(z,K),K&1&&T(U,1)):(U=Sb(z),U.c(),T(U,1),U.m(x.parentNode,x)):U&&(Ae(),F(U,1,1,()=>{U=null}),De()),(!I||K&12&&P!==(P=!z[3]||z[2]))&&(D.disabled=P),K&4&&ne(D,"btn-loading",z[2])},i(z){I||(T(i.$$.fragment,z),T(l.$$.fragment,z),T(a.$$.fragment,z),T(c.$$.fragment,z),T(d.$$.fragment,z),T(S.$$.fragment,z),T(U),I=!0)},o(z){F(i.$$.fragment,z),F(l.$$.fragment,z),F(a.$$.fragment,z),F(c.$$.fragment,z),F(d.$$.fragment,z),F(S.$$.fragment,z),F(U),I=!1},d(z){z&&k(e),q(i),q(l),q(a),q(c),q(d),z&&k(h),z&&k(b),z&&k(v),z&&k(_),z&&k(y),q(S,z),z&&k(C),U&&U.d(z),z&&k(x),z&&k(M),R=!1,G()}}}function vD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function yD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Sender name"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.senderName),s||(a=X(r,"input",n[7]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].meta.senderName&&Me(r,f[0].meta.senderName)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function kD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Sender address"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","email"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].meta.senderAddress),s||(a=X(r,"input",n[8]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].meta.senderAddress&&Me(r,f[0].meta.senderAddress)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function wD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User verification page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userVerificationUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[9]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userVerificationUrl&&Me(r,u[0].meta.userVerificationUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function SD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User reset password page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userResetPasswordUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[10]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userResetPasswordUrl&&Me(r,u[0].meta.userResetPasswordUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function CD(n){let e,t,i,o,r,l,s,a,f,c;return{c(){e=g("label"),t=j("User confirm email change page url"),o=$(),r=g("input"),s=$(),a=g("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
|
||||
parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0,p(a,"class","help-block")},m(u,d){w(u,e,d),m(e,t),w(u,o,d),w(u,r,d),Me(r,n[0].meta.userConfirmEmailChangeUrl),w(u,s,d),w(u,a,d),f||(c=X(r,"input",n[11]),f=!0)},p(u,d){d&4194304&&i!==(i=u[22])&&p(e,"for",i),d&4194304&&l!==(l=u[22])&&p(r,"id",l),d&1&&r.value!==u[0].meta.userConfirmEmailChangeUrl&&Me(r,u[0].meta.userConfirmEmailChangeUrl)},d(u){u&&k(e),u&&k(o),u&&k(r),u&&k(s),u&&k(a),f=!1,c()}}}function xD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[22]),e.required=!0,p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].smtp.enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[12]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].smtp.enabled),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Sb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return i=new je({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[MD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[$D,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[AD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field",name:"smtp.username",$$slots:{default:[DD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),v=new je({props:{class:"form-field",name:"smtp.password",$$slots:{default:[OD,({uniqueId:x})=>({22:x}),({uniqueId:x})=>x?4194304:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),h=$(),b=g("div"),V(v.$$.fragment),_=$(),y=g("div"),p(t,"class","col-lg-6"),p(r,"class","col-lg-3"),p(a,"class","col-lg-3"),p(u,"class","col-lg-6"),p(b,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(x,M){w(x,e,M),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),m(e,c),m(e,u),H(d,u,null),m(e,h),m(e,b),H(v,b,null),m(e,_),m(e,y),C=!0},p(x,M){const A={};M&12582913&&(A.$$scope={dirty:M,ctx:x}),i.$set(A);const O={};M&12582913&&(O.$$scope={dirty:M,ctx:x}),l.$set(O);const D={};M&12582913&&(D.$$scope={dirty:M,ctx:x}),f.$set(D);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:x}),d.$set(E);const P={};M&12582913&&(P.$$scope={dirty:M,ctx:x}),v.$set(P)},i(x){C||(T(i.$$.fragment,x),T(l.$$.fragment,x),T(f.$$.fragment,x),T(d.$$.fragment,x),T(v.$$.fragment,x),x&&Dt(()=>{S||(S=ct(e,fn,{duration:150},!0)),S.run(1)}),C=!0)},o(x){F(i.$$.fragment,x),F(l.$$.fragment,x),F(f.$$.fragment,x),F(d.$$.fragment,x),F(v.$$.fragment,x),x&&(S||(S=ct(e,fn,{duration:150},!1)),S.run(0)),C=!1},d(x){x&&k(e),q(i),q(l),q(f),q(d),q(v),x&&S&&S.end()}}}function MD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("SMTP server host"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.host),s||(a=X(r,"input",n[13]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].smtp.host&&Me(r,f[0].smtp.host)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function $D(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Port"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","number"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.port),s||(a=X(r,"input",n[14]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&At(r.value)!==f[0].smtp.port&&Me(r,f[0].smtp.port)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function AD(n){let e,t,i,o,r,l,s;function a(c){n[15](c)}let f={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(f.keyOfSelected=n[0].smtp.tls),r=new yo({props:f}),he.push(()=>Fe(r,"keyOfSelected",a)),{c(){e=g("label"),t=j("TLS Encryption"),o=$(),V(r.$$.fragment),p(e,"for",i=n[22])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&4194304&&i!==(i=c[22]))&&p(e,"for",i);const d={};u&4194304&&(d.id=c[22]),!l&&u&1&&(l=!0,d.keyOfSelected=c[0].smtp.tls,Re(()=>l=!1)),r.$set(d)},i(c){s||(T(r.$$.fragment,c),s=!0)},o(c){F(r.$$.fragment,c),s=!1},d(c){c&&k(e),c&&k(o),q(r,c)}}}function DD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Username"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].smtp.username),s||(a=X(r,"input",n[16]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].smtp.username&&Me(r,f[0].smtp.username)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function OD(n){let e,t,i,o,r,l,s;function a(c){n[17](c)}let f={id:Line truncated
|
||||
<div class="breadcrumb-item">Mail settings</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[19])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function ED(n,e,t){let i;const o=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let r={},l=!1,s=!1,a="";B.setDocumentTitle("Mail settings"),f();async function f(){t(1,l=!0);try{const E=await Se.Settings.getAll()||{};u(E)}catch(E){Se.errorResponseHandler(E)}t(1,l=!1)}async function c(){if(!(s||!i)){t(2,s=!0);try{const E=await Se.Settings.update(B.filterRedactedProps(r));u(E),hn("Successfully saved mail settings.")}catch(E){Se.errorResponseHandler(E)}t(2,s=!1)}}function u(E={}){t(0,r={meta:(E==null?void 0:E.meta)||{},smtp:(E==null?void 0:E.smtp)||{}}),t(6,a=JSON.stringify(r))}function d(){r.meta.senderName=this.value,t(0,r)}function h(){r.meta.senderAddress=this.value,t(0,r)}function b(){r.meta.userVerificationUrl=this.value,t(0,r)}function v(){r.meta.userResetPasswordUrl=this.value,t(0,r)}function _(){r.meta.userConfirmEmailChangeUrl=this.value,t(0,r)}function y(){r.smtp.enabled=this.checked,t(0,r)}function S(){r.smtp.host=this.value,t(0,r)}function C(){r.smtp.port=At(this.value),t(0,r)}function x(E){n.$$.not_equal(r.smtp.tls,E)&&(r.smtp.tls=E,t(0,r))}function M(){r.smtp.username=this.value,t(0,r)}function A(E){n.$$.not_equal(r.smtp.password,E)&&(r.smtp.password=E,t(0,r))}const O=()=>c(),D=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(r))},[r,l,s,i,o,c,a,d,h,b,v,_,y,S,C,x,M,A,O,D]}class PD extends Ie{constructor(e){super(),Le(this,e,ED,TD,Ee,{})}}function FD(n){let e,t,i,o,r,l,s,a,f,c,u,d;e=new je({props:{class:"form-field form-field-toggle",$$slots:{default:[ID,({uniqueId:b})=>({15:b}),({uniqueId:b})=>b?32768:0]},$$scope:{ctx:n}}});let h=n[0].enabled&&Cb(n);return{c(){V(e.$$.fragment),t=$(),h&&h.c(),i=$(),o=g("div"),r=g("div"),l=$(),s=g("button"),a=g("span"),a.textContent="Save changes",p(r,"class","flex-fill"),p(a,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=f=!n[3]||n[2],ne(s,"btn-loading",n[2]),p(o,"class","flex")},m(b,v){H(e,b,v),w(b,t,v),h&&h.m(b,v),w(b,i,v),w(b,o,v),m(o,r),m(o,l),m(o,s),m(s,a),c=!0,u||(d=X(s,"click",n[12]),u=!0)},p(b,v){const _={};v&98305&&(_.$$scope={dirty:v,ctx:b}),e.$set(_),b[0].enabled?h?(h.p(b,v),v&1&&T(h,1)):(h=Cb(b),h.c(),T(h,1),h.m(i.parentNode,i)):h&&(Ae(),F(h,1,1,()=>{h=null}),De()),(!c||v&12&&f!==(f=!b[3]||b[2]))&&(s.disabled=f),v&4&&ne(s,"btn-loading",b[2])},i(b){c||(T(e.$$.fragment,b),T(h),c=!0)},o(b){F(e.$$.fragment,b),F(h),c=!1},d(b){q(e,b),b&&k(t),h&&h.d(b),b&&k(i),b&&k(o),u=!1,d()}}}function LD(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function ID(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[15]),e.required=!0,p(o,"for",l=n[15])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[6]),s=!0)},p(f,c){c&32768&&t!==(t=f[15])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&32768&&l!==(l=f[15])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function Cb(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b,v,_,y,S,C;return i=new je({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[RD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ND,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field required",name:"s3.region",$$slots:{default:[jD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),d=new je({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[zD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),v=new je({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[HD,({uniqueId:x})=>({15:x}),({uniqueId:x})=>x?32768:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),c=$(),u=g("div"),V(d.$$.fragment),h=$(),b=g("div"),V(v.$$.fragment),_=$(),y=g("div"),p(t,"class","col-lg-12"),p(r,"class","col-lg-6"),p(a,"class","col-lg-6"),p(u,"class","col-lg-6"),p(b,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(x,M){w(x,e,M),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),mLine truncated
|
||||
<div class="breadcrumb-item">Files storage</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||||
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[4])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function VD(n,e,t){let i,o={},r=!1,l=!1,s="";B.setDocumentTitle("Files storage"),a();async function a(){t(1,r=!0);try{const S=await Se.Settings.getAll()||{};c(S)}catch(S){Se.errorResponseHandler(S)}t(1,r=!1)}async function f(){if(!(l||!i)){t(2,l=!0);try{const S=await Se.Settings.update(B.filterRedactedProps({s3:o}));c(S),Ui({}),hn("Successfully saved Files storage settings.")}catch(S){Se.errorResponseHandler(S)}t(2,l=!1)}}function c(S={}){t(0,o=(S==null?void 0:S.s3)||{}),t(5,s=JSON.stringify(o))}function u(){o.enabled=this.checked,t(0,o)}function d(){o.endpoint=this.value,t(0,o)}function h(){o.bucket=this.value,t(0,o)}function b(){o.region=this.value,t(0,o)}function v(){o.accessKey=this.value,t(0,o)}function _(S){n.$$.not_equal(o.secret,S)&&(o.secret=S,t(0,o))}const y=()=>f();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=s!=JSON.stringify(o))},[o,r,l,i,f,s,u,d,h,b,v,_,y]}class BD extends Ie{constructor(e){super(),Le(this,e,VD,qD,Ee,{})}}function UD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(o,"for",l=n[16])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[8]),s=!0)},p(f,c){c&65536&&t!==(t=f[16])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&65536&&l!==(l=f[16])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function xb(n){let e,t,i,o,r,l,s,a,f,c,u;return i=new je({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[WD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),l=new je({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[YD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),f=new je({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[GD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=g("div"),t=g("div"),V(i.$$.fragment),o=$(),r=g("div"),V(l.$$.fragment),s=$(),a=g("div"),V(f.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(r,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),H(i,t,null),m(e,o),m(e,r),H(l,r,null),m(e,s),m(e,a),H(f,a,null),u=!0},p(d,h){const b={};h&196609&&(b.$$scope={dirty:h,ctx:d}),i.$set(b);const v={};h&1&&(v.class="form-field "+(B.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),l.$set(v);const _={};h&1&&(_.class="form-field "+(B.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(_.$$scope={dirty:h,ctx:d}),f.$set(_)},i(d){u||(T(i.$$.fragment,d),T(l.$$.fragment,d),T(f.$$.fragment,d),d&&Dt(()=>{c||(c=ct(e,fn,{duration:150},!0)),c.run(1)}),u=!0)},o(d){F(i.$$.fragment,d),F(l.$$.fragment,d),F(f.$$.fragment,d),d&&(c||(c=ct(e,fn,{duration:150},!1)),c.run(0)),u=!1},d(d){d&&k(e),q(i),q(l),q(f),d&&c&&c.end()}}}function WD(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Minimum password length"),o=$(),r=g("input"),p(e,"for",i=n[16]),p(r,"type","number"),p(r,"id",l=n[16]),r.required=!0,p(r,"min","5"),p(r,"max","200")},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].minPasswordLength),s||(a=X(r,"input",n[9]),s=!0)},p(f,c){c&65536&&i!==(i=f[16])&&p(e,"for",i),c&65536&&l!==(l=f[16])&&p(r,"id",l),c&1&&At(r.value)!==f[0].minPasswordLength&&Me(r,f[0].minPasswordLength)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function YD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[10](_)}let v={id:n[16],disabled:!B.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Except domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[16]),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Email domains that are NOT allowed to sign up.
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&65536&&r!==(r=_[16]))&&p(e,"for",r);const S={};y&65536&&(S.id=_[16]),y&1&&(S.disabled=!B.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function GD(n){let e,t,i,o,r,l,s,a,f,c,u,d,h;function b(_){n[11](_)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),s=new ko({props:v}),he.push(()=>Fe(s,"value",b)),{c(){e=g("label"),t=g("span"),t.textContent="Only domains",i=$(),o=g("i"),l=$(),V(s.$$.fragment),f=$(),c=g("div"),c.textContent="Use comma as separator.",p(t,"class","txt"),p(o,"class","ri-information-line link-hint"),p(e,"for",r=n[16]+".config.onlyDomains"),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),w(_,l,y),H(s,_,y),w(_,f,y),w(_,c,y),u=!0,d||(h=Xe(St.call(null,o,{text:`Email domains that are ONLY allowed to sign up.
|
||||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!u||y&65536&&r!==(r=_[16]+".config.onlyDomains"))&&p(e,"for",r);const S={};y&65536&&(S.id=_[16]+".config.onlyDomains"),y&1&&(S.disabled=!B.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Re(()=>a=!1)),s.$set(S)},i(_){u||(T(s.$$.fragment,_),u=!0)},o(_){F(s.$$.fragment,_),u=!1},d(_){_&&k(e),_&&k(l),q(s,_),_&&k(f),_&&k(c),d=!1,h()}}}function KD(n){let e,t,i,o;e=new je({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[UD,({uniqueId:l})=>({16:l}),({uniqueId:l})=>l?65536:0]},$$scope:{ctx:n}}});let r=n[0].enabled&&xb(n);return{c(){V(e.$$.fragment),t=$(),r&&r.c(),i=lt()},m(l,s){H(e,l,s),w(l,t,s),r&&r.m(l,s),w(l,i,s),o=!0},p(l,s){const a={};s&196609&&(a.$$scope={dirty:s,ctx:l}),e.$set(a),l[0].enabled?r?(r.p(l,s),s&1&&T(r,1)):(r=xb(l),r.c(),T(r,1),r.m(i.parentNode,i)):r&&(Ae(),F(r,1,1,()=>{r=null}),De())},i(l){o||(T(e.$$.fragment,l),T(r),o=!0)},o(l){F(e.$$.fragment,l),F(r),o=!1},d(l){q(e,l),l&&k(t),r&&r.d(l),l&&k(i)}}}function JD(n){let e;return{c(){e=g("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZD(n){let e;return{c(){e=g("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mb(n){let e,t,i,o,r,l;return{c(){e=g("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(s,a){w(s,e,a),o=!0,r||(l=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),r=!0)},i(s){o||(Dt(()=>{i||(i=ct(e,Bn,{duration:150,start:.7},!0)),i.run(1)}),o=!0)},o(s){i||(i=ct(e,Bn,{duration:150,start:.7},!1)),i.run(0),o=!1},d(s){s&&k(e),s&&i&&i.end(),r=!1,l()}}}function XD(n){let e,t,i,o,r,l,s;function a(d,h){return d[0].enabled?ZD:JD}let f=a(n),c=f(n),u=n[2]&&Mb();return{c(){e=g("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||||
<span class="txt">Email/Password</span>`,t=$(),c.c(),i=$(),o=g("div"),r=$(),u&&u.c(),l=lt(),p(e,"class","inline-flex"),p(o,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),c.m(d,h),w(d,i,h),w(d,o,h),w(d,r,h),u&&u.m(d,h),w(d,l,h),s=!0},p(d,h){f!==(f=a(d))&&(c.d(1),c=f(d),c&&(c.c(),c.m(i.parentNode,i))),d[2]?u?h&4&&T(u,1):(u=Mb(),u.c(),T(u,1),u.m(l.parentNode,l)):u&&(Ae(),F(u,1,1,()=>{u=null}),De())},i(d){s||(T(u),s=!0)},o(d){F(u),s=!1},d(d){d&&k(e),d&&k(t),c.d(d),d&&k(i),d&&k(o),d&&k(r),u&&u.d(d),d&&k(l)}}}function QD(n){let e,t;const i=[n[3]];let o={$$slots:{header:[XD],default:[KD]},$$scope:{ctx:n}};for(let r=0;r<i.length;r+=1)o=ut(o,i[r]);return e=new dc({props:o}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(r,l){H(e,r,l),t=!0},p(r,[l]){const s=l&8?bn(i,[pi(r[3])]):{};l&131077&&(s.$$scope={dirty:l,ctx:r}),e.$set(s)},i(r){t||(T(e.$$.fragment,r),t=!0)},o(r){F(e.$$.fragment,r),t=!1},d(r){n[12](null),q(e,r)}}}function eO(n,e,t){let i;const o=["config","expand","collapse","collapseSiblings"];let r=Wt(e,o),l;pn(n,go,x=>t(7,l=x));let{config:s={}}=e,a;function f(){a==null||a.expand()}function c(){a==null||a.collapse()}function u(){a==null||a.collapseSiblings()}function d(){s.enabled=this.checked,t(0,s)}function h(){s.minPasswordLength=At(this.value),t(0,s)}function b(x){n.$$.not_equal(s.exceptDomains,x)&&(s.exceptDomains=x,t(0,s))}function v(x){n.$$.not_equal(s.onlyDomains,x)&&(s.onlyDomains=x,t(0,s))}function _(x){he[x?"unshift":"push"](()=>{a=x,t(1,a)})}function y(x){ft.call(this,n,x)}function S(x){ft.call(this,n,x)}function C(x){ft.call(this,n,x)}return n.$$set=x=>{e=ut(ut({},e),ui(x)),t(3,r=Wt(e,o)),"config"in x&&t(0,s=x.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(l==null?void 0:l.emailPassword))},[s,a,i,r,f,c,u,l,d,h,b,v,_,y,S,C]}class tO extends Ie{constructor(e){super(),Le(this,e,eO,QD,Ee,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function nO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("input"),i=$(),o=g("label"),r=j("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(o,"for",l=n[22])},m(f,c){w(f,e,c),e.checked=n[0].enabled,w(f,i,c),w(f,o,c),m(o,r),s||(a=X(e,"change",n[11]),s=!0)},p(f,c){c&4194304&&t!==(t=f[22])&&p(e,"id",t),c&1&&(e.checked=f[0].enabled),c&4194304&&l!==(l=f[22])&&p(o,"for",l)},d(f){f&&k(e),f&&k(i),f&&k(o),s=!1,a()}}}function $b(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;r=new je({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[iO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),a=new je({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[oO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),u=new je({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[rO,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Ab(n);return{c(){e=g("div"),t=g("div"),i=$(),o=g("div"),V(r.$$.fragment),l=$(),s=g("div"),V(a.$$.fragment),f=$(),c=g("div"),V(u.$$.fragment),d=$(),v&&v.c(),p(t,"class","col-12 spacing"),p(o,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(_,y){w(_,e,y),m(e,t),m(e,i),m(e,o),H(r,o,null),m(e,l),m(e,s),H(a,s,null),m(e,f),m(e,c),H(u,c,null),m(e,d),v&&v.m(e,null),b=!0},p(_,y){const S={};y&2&&(S.name=_[1]+".clientId"),y&12582913&&(S.$$scope={dirty:y,ctx:_}),r.$set(S);const C={};y&2&&(C.name=_[1]+".clientSecret"),y&12582913&&(C.$$scope={dirty:y,ctx:_}),a.$set(C);const x={};y&2&&(x.name=_[1]+".allowRegistrations"),y&12582913&&(x.$$scope={dirty:y,ctx:_}),u.$set(x),_[4]?v?(v.p(_,y),y&16&&T(v,1)):(v=Ab(_),v.c(),T(v,1),v.m(e,null)):v&&(Ae(),F(v,1,1,()=>{v=null}),De())},i(_){b||(T(r.$$.fragment,_),T(a.$$.fragment,_),T(u.$$.fragment,_),T(v),_&&Dt(()=>{h||(h=ct(e,fn,{duration:200},!0)),h.run(1)}),b=!0)},o(_){F(r.$$.fragment,_),F(a.$$.fragment,_),F(u.$$.fragment,_),F(v),_&&(h||(h=ct(e,fn,{duration:200},!1)),h.run(0)),b=!1},d(_){_&&k(e),q(r),q(a),q(u),v&&v.d(),_&&h&&h.end()}}}function iO(n){let e,t,i,o,r,l,s,a;return{c(){e=g("label"),t=j("Client ID"),o=$(),r=g("input"),p(e,"for",i=n[22]),p(r,"type","text"),p(r,"id",l=n[22]),r.required=!0},m(f,c){w(f,e,c),m(e,t),w(f,o,c),w(f,r,c),Me(r,n[0].clientId),s||(a=X(r,"input",n[12]),s=!0)},p(f,c){c&4194304&&i!==(i=f[22])&&p(e,"for",i),c&4194304&&l!==(l=f[22])&&p(r,"id",l),c&1&&r.value!==f[0].clientId&&Me(r,f[0].clientId)},d(f){f&&k(e),f&&k(o),f&&k(r),s=!1,a()}}}function oO(n){let e,t,i,o,r,l,s;function a(c){n[13](c)}let f={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(f.value=n[0].clientSecret),r=new mc({props:f}),he.push(()=>Fe(r,"value",a)),{c(){e=g("label"),t=j("Client Secret"),o=$(),V(r.$$.fragment),p(e,"for",i=n[22])},m(c,u){w(c,e,u),m(e,t),w(c,o,u),H(r,c,u),s=!0},p(c,u){(!s||u&4194304&&i!==(i=c[22]))&&p(e,"for",i);const d={};u&4194304&&(d.id=c[22]),!l&&u&Line truncated
|
||||
<div class="breadcrumb-item">Auth providers</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","m-b-base"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[5])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function _O(n,e,t){let i,o,r={},l=!1,s=!1,a="";B.setDocumentTitle("Auth providers"),f();async function f(){t(2,l=!0);try{const C=await Se.Settings.getAll()||{};u(C)}catch(C){Se.errorResponseHandler(C)}t(2,l=!1)}async function c(){if(!(s||!i)){t(3,s=!0);try{const C=await Se.Settings.update(B.filterRedactedProps(r));u(C),Ui({}),o==null||o.collapseSiblings(),hn("Successfully updated auth providers.")}catch(C){Se.errorResponseHandler(C)}t(3,s=!1)}}function u(C){C=C||{},t(0,r={}),t(0,r.emailAuth=Object.assign({enabled:!0},C.emailAuth),r);const x=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of x)t(0,r[M]=Object.assign({enabled:!1,allowRegistrations:!0},C[M]),r);t(6,a=JSON.stringify(r))}function d(C){he[C?"unshift":"push"](()=>{o=C,t(1,o)})}function h(C){n.$$.not_equal(r.emailAuth,C)&&(r.emailAuth=C,t(0,r))}function b(C){n.$$.not_equal(r.googleAuth,C)&&(r.googleAuth=C,t(0,r))}function v(C){n.$$.not_equal(r.facebookAuth,C)&&(r.facebookAuth=C,t(0,r))}function _(C){n.$$.not_equal(r.githubAuth,C)&&(r.githubAuth=C,t(0,r))}function y(C){n.$$.not_equal(r.gitlabAuth,C)&&(r.gitlabAuth=C,t(0,r))}const S=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(r))},[r,o,l,s,i,c,a,d,h,b,v,_,y,S]}class vO extends Ie{constructor(e){super(),Le(this,e,_O,gO,Ee,{})}}function Tb(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function yO(n){let e=[],t=new Map,i,o,r,l,s,a,f,c,u,d,h=n[4];const b=v=>v[12].key;for(let v=0;v<h.length;v+=1){let _=Tb(n,h,v),y=b(_);t.set(y,e[v]=Eb(y,_))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=$(),o=g("div"),r=g("div"),l=$(),s=g("button"),a=g("span"),a.textContent="Save changes",p(r,"class","flex-fill"),p(a,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=f=!n[3]||n[2],ne(s,"btn-loading",n[2]),p(o,"class","flex")},m(v,_){for(let y=0;y<e.length;y+=1)e[y].m(v,_);w(v,i,_),w(v,o,_),m(o,r),m(o,l),m(o,s),m(s,a),c=!0,u||(d=X(s,"click",n[9]),u=!0)},p(v,_){_&32785&&(h=v[4],Ae(),e=st(e,_,b,1,v,h,t,i.parentNode,Pt,Eb,i,Tb),De()),(!c||_&12&&f!==(f=!v[3]||v[2]))&&(s.disabled=f),_&4&&ne(s,"btn-loading",v[2])},i(v){if(!c){for(let _=0;_<h.length;_+=1)T(e[_]);c=!0}},o(v){for(let _=0;_<e.length;_+=1)F(e[_]);c=!1},d(v){for(let _=0;_<e.length;_+=1)e[_].d(v);v&&k(i),v&&k(o),u=!1,d()}}}function kO(n){let e;return{c(){e=g("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function wO(n){let e,t=n[12].label+"",i,o,r,l,s,a,f,c,u,d,h;function b(){n[7].call(s,n[12])}function v(){return n[8](n[12])}return{c(){e=g("label"),i=j(t),o=j(" duration (in seconds)"),l=$(),s=g("input"),f=$(),c=g("div"),u=g("span"),u.textContent="Invalidate all previously issued tokens",p(e,"for",r=n[15]),p(s,"type","number"),p(s,"id",a=n[15]),s.required=!0,p(u,"class","link-primary"),ne(u,"txt-success",n[0][n[12].key].secret),p(c,"class","help-block")},m(_,y){w(_,e,y),m(e,i),m(e,o),w(_,l,y),w(_,s,y),Me(s,n[0][n[12].key].duration),w(_,f,y),w(_,c,y),m(c,u),d||(h=[X(s,"input",b),X(u,"click",v)],d=!0)},p(_,y){n=_,y&32768&&r!==(r=n[15])&&p(e,"for",r),y&32768&&a!==(a=n[15])&&p(s,"id",a),y&17&&At(s.value)!==n[0][n[12].key].duration&&Me(s,n[0][n[12].key].duration),y&17&&ne(u,"txt-success",n[0][n[12].key].secret)},d(_){_&&k(e),_&&k(l),_&&k(s),_&&k(f),_&&k(c),d=!1,rt(h)}}}function Eb(n,e){let t,i,o;return i=new je({props:{class:"form-field required",name:e[12].key+".duration",$$slots:{default:[wO,({uniqueId:r})=>({15:r}),({uniqueId:r})=>r?32768:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=lt(),V(i.$$.fragment),this.first=t},m(r,l){w(r,t,l),H(i,r,l),o=!0},p(r,l){e=r;const s={};l&98305&&(s.$$scope={dirty:l,ctx:e}),i.$set(s)},i(r){o||(T(i.$$.fragment,r),o=!0)},o(r){F(i.$$.fragment,r),o=!1},d(r){r&&k(t),q(i,r)}}}function SO(n){let e,t,i,o,r,l,s,a,f,c,u,d,h,b;e=new er({});const v=[kO,yO],_=[];function y(S,C){return S[1]?0:1}return c=y(n),u=_[c]=v[c](n),{c(){V(e.$$.fragment),t=$(),i=g("main"),o=g("header"),o.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Token options</div></nav>`,r=$(),l=g("div"),s=g("form"),a=g("div"),a.innerHTML="<p>Adjust common token options.</p>",f=$(),u.c(),p(o,"class","page-header"),p(a,"class","content m-b-sm txt-xl"),p(s,"class","panel"),p(s,"autocomplete","off"),p(l,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){H(e,S,C),w(S,t,C),w(S,i,C),m(i,o),m(i,r),m(i,l),m(l,s),m(s,a),m(s,f),_[c].m(s,null),d=!0,h||(b=X(s,"submit",Gt(n[5])),h=!0)},p(S,[C]){let x=c;c=y(S),c===x?_[c].p(S,C):(Ae(),F(_[x],1,1,()=>{_[x]=null}),De(),u=_[c],u?u.p(S,C):(u=_[c]=v[c](S),u.c()),T(u,1),u.m(s,null))},i(S){d||(T(e.$$.fragment,S),T(u),d=!0)},o(S){F(e.$$.fragment,S),F(u),d=!1},d(S){q(e,S),S&&k(t),S&&k(i),_[c].d(),h=!1,b()}}}function CO(n,e,t){let i;const o=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let r={},l=!1,s=!1,a="";B.setDocumentTitle("Token options"),f();async function f(){t(1,l=!0);try{const v=await Se.Settings.getAll()||{};u(v)}catch(v){Se.errorResponseHandler(v)}t(1,l=!1)}async function c(){if(!(s||!i)){t(2,s=!0);try{const v=await Se.Settings.update(B.filterRedactedProps(r));u(v),hn("Successfully saved tokens options.")}catch(v){Se.errorResponseHandler(v)}t(2,s=!1)}}function u(v){var _;v=v||{},t(0,r={});for(const y of o)t(0,r[y.key]={duration:((_=v[y.key])==null?void 0:_.duration)||0},r);t(6,a=JSON.stringify(r))}function d(v){r[v.key].duration=At(this.value),t(0,r)}const h=v=>{r[v.key].secret?(delete r[v.key].secret,t(0,r)):t(0,r[v.key].secret=B.randomString(50),r)},b=()=>c();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(r))},[r,l,s,i,o,c,a,d,h,b]}class xO extends Ie{constructor(e){super(),Le(this,e,CO,SO,Ee,{})}}const MO={"/_elements":Zt({asyncComponent:()=>_i(()=>import("./Elements.fba5cef6.js"),[])}),"/login":Zt({component:rD,conditions:[n=>!Se.AuthStore.isValid]}),"/request-password-reset":Zt({asyncComponent:()=>_i(()=>import("./PageAdminRequestPasswordReset.45866e03.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>_i(()=>import("./PageAdminConfirmPasswordReset.6f7f63d0.js"),[]),conditions:[n=>!Se.AuthStore.isValid]}),"/collections":Zt({component:oA,conditions:[n=>Se.AuthStore.isValid]}),"/logs":Zt({component:mC,conditions:[n=>Se.AuthStore.isValid]}),"/users":Zt({component:AA,conditions:[n=>Se.AuthStore.isValid]}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmPasswordReset.6d56895b.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmVerification.8d023a32.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>_i(()=>import("./PageUserConfirmEmailChange.a2624070.js"),[]),conditions:[()=>(Se.logout(!1),!0)]}),"/settings":Zt({component:pD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/admins":Zt({component:JA,conditions:[n=>Se.AuthStore.isValid]}),"/settings/mail":Zt({component:PD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/storage":Zt({component:BD,conditions:[n=>Se.AuthStore.isValid]}),"/settings/auth-providers":Zt({component:vO,conditions:[n=>Se.AuthStore.isValid]}),"/settings/tokens":Zt({component:xO,conditions:[n=>Se.AuthStore.isValid]}),"*":Zt({asyncComponent:()=>_i(()=>import("./NotFoundPage.899a1d8c.js"),[])})};function $O(n,{from:e,to:t},i={}){const o=getComputedStyle(n),r=o.transform==="none"?"":o.transform,[l,s]=o.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),f=e.top+e.height*s/t.height-(t.top+s),{delay:c=0,duration:u=h=>Math.sqrt(h)*120,easing:d=As}=i;return{delay:c,duration:Yn(u)?u(Math.sqrt(a*a+f*f)):u,easing:d,css:(h,b)=>{const v=b*a,_=b*f,y=h+b*e.width/t.width,S=h+b*e.height/t.height;return`transform: ${r} translate(${v}px, ${_}px) scale(${y}, ${S});`}}}function Pb(n,e,t){const i=n.slice();return i[2]=e[t],i}function AO(n){let e;return{c(){e=g("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function DO(n){let e;return{c(){e=g("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function OO(n){let e;return{c(){e=g("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fb(n,e){let t,i,o,r,l=e[2].message+"",s,a,f,c,u,d,h=le,b,v,_;function y(M,A){return M[2].type==="info"?OO:M[2].type==="success"?DO:AO}let S=y(e),C=S(e);function x(){return e[1](e[2])}return{key:n,first:null,c(){t=g("div"),i=g("div"),C.c(),o=$(),r=g("div"),s=j(l),a=$(),f=g("div"),f.innerHTML='<i class="ri-close-line"></i>',c=$(),p(i,"class","icon"),p(r,"class","content"),p(f,"class","close"),p(t,"class","alert txt-break"),ne(t,"alert-info",eLine truncated
|
||||
<span class="txt">Manage admins</span>`,t=$(),i=g("hr"),o=$(),r=g("div"),r.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||||
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(a,f){w(a,e,f),w(a,t,f),w(a,i,f),w(a,o,f),w(a,r,f),l||(s=[Xe(xn.call(null,e)),X(r,"click",n[3])],l=!0)},p:le,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(o),a&&k(r),l=!1,rt(s)}}}function zO(n){var u;let e,t,i,o,r,l,s,a,f,c=((u=n[0])==null?void 0:u.id)&&Lb(n);return o=new n_({props:{routes:MO}}),o.$on("routeLoading",n[1]),o.$on("conditionsFailed",n[2]),l=new PO({}),a=new NO({}),{c(){e=g("div"),c&&c.c(),t=$(),i=g("div"),V(o.$$.fragment),r=$(),V(l.$$.fragment),s=$(),V(a.$$.fragment),p(i,"class","app-body"),p(e,"class","app-layout")},m(d,h){w(d,e,h),c&&c.m(e,null),m(e,t),m(e,i),H(o,i,null),w(d,r,h),H(l,d,h),w(d,s,h),H(a,d,h),f=!0},p(d,[h]){var b;(b=d[0])!=null&&b.id?c?(c.p(d,h),h&1&&T(c,1)):(c=Lb(d),c.c(),T(c,1),c.m(e,t)):c&&(Ae(),F(c,1,1,()=>{c=null}),De())},i(d){f||(T(c),T(o.$$.fragment,d),T(l.$$.fragment,d),T(a.$$.fragment,d),f=!0)},o(d){F(c),F(o.$$.fragment,d),F(l.$$.fragment,d),F(a.$$.fragment,d),f=!1},d(d){d&&k(e),c&&c.d(),q(o),d&&k(r),q(l,d),d&&k(s),q(a,d)}}}function HO(n,e,t){let i;pn(n,qf,a=>t(0,i=a));let o;function r(a){var f,c;((f=a==null?void 0:a.detail)==null?void 0:f.location)!==o&&(o=(c=a==null?void 0:a.detail)==null?void 0:c.location,B.setDocumentTitle(""),Ui({}),A1())}function l(){Se.AuthStore.isValid?Ss("/"):Se.logout()}function s(){Se.logout()}return[i,r,l,s]}class qO extends Ie{constructor(e){super(),Le(this,e,HO,zO,Ee,{})}}new qO({target:document.getElementById("app")});export{ne as A,X as B,Gt as C,j as D,ge as E,QA as F,Me as G,B as H,rt as I,hn as J,Ss as K,lt as L,pn as M,Go as N,yo as O,yn as P,En as Q,di as R,Ie as S,Ai as a,he as b,Fe as c,$ as d,g as e,V as f,p as g,w as h,Le as i,m as j,Xe as k,Re as l,H as m,T as n,F as o,k as p,q,VO as r,Ee as s,St as t,le as u,xn as v,Ae as w,De as x,Se as y,je as z};
|
||||
Vendored
+364
@@ -0,0 +1,364 @@
|
||||
const Hb=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 r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).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)}};Hb();function re(){}const Ul=n=>n;function ct(n,e){for(const t in e)n[t]=e[t];return n}function Rg(n){return n()}function gf(){return Object.create(null)}function rt(n){n.forEach(Rg)}function Jn(n){return typeof n=="function"}function Ae(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let rr;function ei(n,e){return rr||(rr=document.createElement("a")),rr.href=e,n===rr.href}function qb(n){return Object.keys(n).length===0}function jg(n,...e){if(n==null)return re;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function hn(n,e,t){n.$$.on_destroy.push(jg(e,t))}function Tn(n,e,t,i){if(n){const s=Hg(n,e,t,i);return n[0](s)}}function Hg(n,e,t,i){return n[1]&&i?ct(t.ctx.slice(),n[1](i(e))):t.ctx}function Dn(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=[],r=Math.max(e.dirty.length,s.length);for(let o=0;o<r;o+=1)l[o]=e.dirty[o]|s[o];return l}return e.dirty|s}return e.dirty}function An(n,e,t,i,s,l){if(s){const r=Hg(e,t,i,l);n.p(r,s)}}function En(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function di(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Yt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function _f(n){return n==null?"":n}function qg(n,e,t){return n.set(t),e}function Xe(n){return n&&Jn(n.destroy)?n.destroy:re}const Vg=typeof window!="undefined";let ko=Vg?()=>window.performance.now():()=>Date.now(),_u=Vg?n=>requestAnimationFrame(n):re;const Is=new Set;function zg(n){Is.forEach(e=>{e.c(n)||(Is.delete(e),e.f())}),Is.size!==0&&_u(zg)}function wo(n){let e;return Is.size===0&&_u(zg),{promise:new Promise(t=>{Is.add(e={c:n,f:t})}),abort(){Is.delete(e)}}}function m(n,e){n.appendChild(e)}function Bg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Vb(n){const e=_("style");return zb(Bg(n),e),e.sheet}function zb(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Bn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function H(n){return document.createTextNode(n)}function O(){return H(" ")}function lt(){return H("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Kt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Un(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Ug(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 ci(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 Tt(n){return n===""?null:+n}function Bb(n){return Array.from(n.childNodes)}function _e(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function $e(n,e){n.value=e==null?"":e}function bf(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function Wg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const Zr=new Map;let xr=0;function Ub(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Wb(n,e){const t={stylesheet:Vb(e),rules:{}};return Zr.set(n,t),t}function Ll(n,e,t,i,s,l,r,o=0){const a=16.666/i;let u=`{
|
||||
`;for(let b=0;b<=1;b+=a){const v=e+(t-e)*l(b);u+=b*100+`%{${r(v,1-v)}}
|
||||
`}const f=u+`100% {${r(t,1-t)}}
|
||||
}`,c=`__svelte_${Ub(f)}_${o}`,d=Bg(n),{stylesheet:h,rules:g}=Zr.get(d)||Wb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const y=n.style.animation||"";return n.style.animation=`${y?`${y}, `:""}${c} ${i}ms linear ${s}ms 1 both`,xr+=1,c}function Fl(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(", "),xr-=s,xr||Yb())}function Yb(){_u(()=>{xr||(Zr.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),Zr.clear())})}function Kb(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:r=300,easing:o=Ul,start:a=ko()+l,end:u=a+r,tick:f=re,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function y(){c&&(g=Ll(n,0,1,r,l,o,c)),l||(h=!0)}function b(){c&&Fl(n,g),d=!1}return wo(v=>{if(!h&&v>=a&&(h=!0),h&&v>=u&&(f(1,0),b()),!d)return!1;if(h){const S=v-a,$=0+1*o(S/r);f($,1-$)}return!0}),y(),f(0,1),b}function Jb(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,Yg(n,s)}}function Yg(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 Il;function Sl(n){Il=n}function So(){if(!Il)throw new Error("Function called outside component initialization");return Il}function pi(n){So().$$.on_mount.push(n)}function Gb(n){So().$$.after_update.push(n)}function Zb(n){So().$$.on_destroy.push(n)}function _n(){const n=So();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Wg(e,t,{cancelable:i});return s.slice().forEach(r=>{r.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 _l=[],he=[],jr=[],Aa=[],Kg=Promise.resolve();let Ea=!1;function Jg(){Ea||(Ea=!0,Kg.then(Gg))}function Mi(){return Jg(),Kg}function Dt(n){jr.push(n)}function je(n){Aa.push(n)}const Ro=new Set;let or=0;function Gg(){const n=Il;do{for(;or<_l.length;){const e=_l[or];or++,Sl(e),xb(e.$$)}for(Sl(null),_l.length=0,or=0;he.length;)he.pop()();for(let e=0;e<jr.length;e+=1){const t=jr[e];Ro.has(t)||(Ro.add(t),t())}jr.length=0}while(_l.length);for(;Aa.length;)Aa.pop()();Ea=!1,Ro.clear(),Sl(n)}function xb(n){if(n.fragment!==null){n.update(),rt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let nl;function bu(){return nl||(nl=Promise.resolve(),nl.then(()=>{nl=null})),nl}function fs(n,e,t){n.dispatchEvent(Wg(`${e?"intro":"outro"}${t}`))}const Hr=new Set;let ai;function Oe(){ai={r:0,c:[],p:ai}}function Te(){ai.r||rt(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(Hr.delete(n),n.i(e))}function F(n,e,t,i){if(n&&n.o){if(Hr.has(n))return;Hr.add(n),ai.c.push(()=>{Hr.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const yu={duration:0};function vu(n,e,t){let i=e(n,t),s=!1,l,r,o=0;function a(){l&&Fl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=Ul,tick:g=re,css:y}=i||yu;y&&(l=Ll(n,0,1,d,c,h,y,o++)),g(0,1);const b=ko()+c,v=b+d;r&&r.abort(),s=!0,Dt(()=>fs(n,!0,"start")),r=wo(S=>{if(s){if(S>=v)return g(1,0),fs(n,!0,"end"),a(),s=!1;if(S>=b){const $=h((S-b)/d);g($,1-$)}}return s})}let f=!1;return{start(){f||(f=!0,Fl(n),Jn(i)?(i=i(),bu().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Zg(n,e,t){let i=e(n,t),s=!0,l;const r=ai;r.r+=1;function o(){const{delay:a=0,duration:u=300,easing:f=Ul,tick:c=re,css:d}=i||yu;d&&(l=Ll(n,1,0,u,a,f,d));const h=ko()+a,g=h+u;Dt(()=>fs(n,!1,"start")),wo(y=>{if(s){if(y>=g)return c(0,1),fs(n,!1,"end"),--r.r||rt(r.c),!1;if(y>=h){const b=f((y-h)/u);c(1-b,b)}}return s})}return Jn(i)?bu().then(()=>{i=i(),o()}):o(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&Fl(n,l),s=!1)}}}function ft(n,e,t,i){let s=e(n,t),l=i?0:1,r=null,o=null,a=null;function u(){a&&Fl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:y=Ul,tick:b=re,css:v}=s||yu,S={start:ko()+h,b:d};d||(S.group=ai,ai.r+=1),r||o?o=S:(v&&(u(),a=Ll(n,l,d,g,h,y,v)),d&&b(0,1),r=f(S,g),Dt(()=>fs(n,d,"start")),wo($=>{if(o&&$>o.start&&(r=f(o,g),o=null,fs(n,r.b,"start"),v&&(u(),a=Ll(n,l,r.b,r.duration,0,y,s.css))),r){if($>=r.end)b(l=r.b,1-l),fs(n,r.b,"end"),o||(r.b?u():--r.group.r||rt(r.group.c)),r=null;else if($>=r.start){const C=$-r.start;l=r.a+r.d*y(C/r.duration),b(l,1-l)}}return!!(r||o)}))}return{run(d){Jn(s)?bu().then(()=>{s=s(),c(d)}):c(d)},end(){u(),r=o=null}}}function an(n,e){n.d(1),e.delete(n.key)}function Lt(n,e){F(n,1,1,()=>{e.delete(n.key)})}function Xb(n,e){n.f(),Lt(n,e)}function ot(n,e,t,i,s,l,r,o,a,u,f,c){let d=n.length,h=
Line truncated
|
||||
`),function(l){if(i=l.indexOf(":"),e=qo.trim(l.substr(0,i)).toLowerCase(),t=qo.trim(l.substr(i+1)),e){if(s[e]&&b1.indexOf(e)>=0)return;s[e]=e==="set-cookie"?(s[e]?s[e]:[]).concat([t]):s[e]?s[e]+", "+t:t}}),s},C1=y1,Vo=l_,M1=function(n){return new Promise(function(e,t){var i=n.data,s=n.headers,l=n.responseType;fr.isFormData(i)&&delete s["Content-Type"];var r=new XMLHttpRequest;if(n.auth){var o=n.auth.username||"",a=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";s.Authorization="Basic "+btoa(o+":"+a)}var u=S1(n.baseURL,n.url);function f(){if(r){var d="getAllResponseHeaders"in r?$1(r.getAllResponseHeaders()):null,h={data:l&&l!=="text"&&l!=="json"?r.response:r.responseText,status:r.status,statusText:r.statusText,headers:d,config:n,request:r};v1(e,t,h),r=null}}if(r.open(n.method.toUpperCase(),w1(u,n.params,n.paramsSerializer),!0),r.timeout=n.timeout,"onloadend"in r?r.onloadend=f:r.onreadystatechange=function(){r&&r.readyState===4&&(r.status!==0||r.responseURL&&r.responseURL.indexOf("file:")===0)&&setTimeout(f)},r.onabort=function(){r&&(t(Vo("Request aborted",n,"ECONNABORTED",r)),r=null)},r.onerror=function(){t(Vo("Network Error",n,null,r)),r=null},r.ontimeout=function(){var d="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(d=n.timeoutErrorMessage),t(Vo(d,n,n.transitional&&n.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",r)),r=null},fr.isStandardBrowserEnv()){var c=(n.withCredentials||C1(u))&&n.xsrfCookieName?k1.read(n.xsrfCookieName):void 0;c&&(s[n.xsrfHeaderName]=c)}"setRequestHeader"in r&&fr.forEach(s,function(d,h){i===void 0&&h.toLowerCase()==="content-type"?delete s[h]:r.setRequestHeader(h,d)}),fr.isUndefined(n.withCredentials)||(r.withCredentials=!!n.withCredentials),l&&l!=="json"&&(r.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&r.addEventListener("progress",n.onDownloadProgress),typeof n.onUploadProgress=="function"&&r.upload&&r.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then(function(d){r&&(r.abort(),t(d),r=null)}),i||(i=null),r.send(i)})},Xt=Fn,Df=function(n,e){d1.forEach(n,function(t,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[i])})},O1=s_,T1={"Content-Type":"application/x-www-form-urlencoded"};function Af(n,e){!Xt.isUndefined(n)&&Xt.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var Ef,zr={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(Ef=M1),Ef),transformRequest:[function(n,e){return Df(e,"Accept"),Df(e,"Content-Type"),Xt.isFormData(n)||Xt.isArrayBuffer(n)||Xt.isBuffer(n)||Xt.isStream(n)||Xt.isFile(n)||Xt.isBlob(n)?n:Xt.isArrayBufferView(n)?n.buffer:Xt.isURLSearchParams(n)?(Af(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Xt.isObject(n)||e&&e["Content-Type"]==="application/json"?(Af(e,"application/json"),function(t,i,s){if(Xt.isString(t))try{return(i||JSON.parse)(t),Xt.trim(t)}catch(l){if(l.name!=="SyntaxError")throw l}return(s||JSON.stringify)(t)}(n)):n}],transformResponse:[function(n){var e=this.transitional,t=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!t&&this.responseType==="json";if(s||i&&Xt.isString(n)&&n.length)try{return JSON.parse(n)}catch(l){if(s)throw l.name==="SyntaxError"?O1(l,this,"E_JSON_PARSE"):l}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};zr.headers={common:{Accept:"application/json, text/plain, */*"}},Xt.forEach(["delete","get","head"],function(n){zr.headers[n]={}}),Xt.forEach(["post","put","patch"],function(n){zr.headers[n]=Xt.merge(T1)});var ku=zr,D1=Fn,A1=ku,r_=function(n){return!(!n||!n.__CANCEL__)},Pf=Fn,zo=function(n,e,t){var i=this||A1;return D1.forEach(t,function(s){n=s.call(i,n,e)}),n},E1=r_,P1=ku;function Bo(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var sn=Fn,o_=function(n,e){e=e||{};var t={},i=["url","method","data"],s=["headers","auth","proxy","params"],l=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],r=["validateStatus"];function o(c,d){return sn.isPlainObject(c)&&sn.isPlainObject(d)?sn.merge(c,d):sn.isPlainObject(d)?sn.merge({},d):sn.isArray(d)?d.slice():d}function a(c){sn.isUndefined(e[c])?sn.isUndefined(n[c])||(t[c]=o(void 0,n[c])):t[c]=o(n[c],e[c])}sn.forEach(i,function(c){sn.isUndefined(e[c])||(t[c]=o(void 0,e[c]))}),sn.forEach(s,a),sn.forEach(l,function(c){sn.isUndefined(e[c])?sn.isUndefined(n[c])||(t[c]=o(void 0,n[c])):t[c]=o(void 0,e[c])}),sn.forEach(r,function(c){c in e?t[c]=o(n[c],e[c]):
Line truncated
|
||||
`+e.prev+e.base;return t+ri.call(n,","+t)+`
|
||||
`+e.prev}function hr(n,e){var t=Ra(n),i=[];if(t){i.length=n.length;for(var s=0;s<n.length;s++)i[s]=Li(n,s)?e(n[s],n):""}var l,r=typeof xo=="function"?xo(n):[];if(Bs){l={};for(var o=0;o<r.length;o++)l["$"+r[o]]=r[o]}for(var a in n)Li(n,a)&&(t&&String(Number(a))===a&&a<n.length||Bs&&l["$"+a]instanceof Symbol||(__.call(/[^\w$]/,a)?i.push(e(a,n)+": "+e(n[a],n)):i.push(a+": "+e(n[a],n))));if(typeof xo=="function")for(var u=0;u<r.length;u++)b_.call(n,r[u])&&i.push("["+e(r[u])+"]: "+e(n[r[u]],n));return i}var w_,Tu=$u,Zs=function(n,e){var t=m_(n,!!e);return typeof t=="function"&&ny(n,".prototype.")>-1?g_(t):t},my=function n(e,t,i,s){var l=t||{};if(Li(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Li(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var r=!Li(l,"customInspect")||l.customInspect;if(typeof r!="boolean"&&r!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Li(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Li(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=l.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return k_(e,l);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return o?Yf(e,a):a}if(typeof e=="bigint"){var u=String(e)+"n";return o?Yf(e,u):u}var f=l.depth===void 0?5:l.depth;if(i===void 0&&(i=0),i>=f&&f>0&&typeof e=="object")return Ra(e)?"[Array]":"[Object]";var c=function(R,J){var W;if(R.indent===" ")W=" ";else{if(!(typeof R.indent=="number"&&R.indent>0))return null;W=ri.call(Array(R.indent+1)," ")}return{base:W,prev:ri.call(Array(J+1),W)}}(l,i);if(s===void 0)s=[];else if(Zf(s,e)>=0)return"[Circular]";function d(R,J,W){if(J&&(s=cy.call(s)).push(J),W){var q={depth:l.depth};return Li(l,"quoteStyle")&&(q.quoteStyle=l.quoteStyle),n(R,q,i+1,s)}return n(R,l,i+1,s)}if(typeof e=="function"&&!Gf(e)){var h=function(R){if(R.name)return R.name;var J=uy.call(ay.call(R),/^function\s*([\w$]+)/);return J?J[1]:null}(e),g=hr(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(g.length>0?" { "+ri.call(g,", ")+" }":"")}if(v_(e)){var y=Bs?ji.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ia.call(e);return typeof e!="object"||Bs?y:ll(y)}if(function(R){return!R||typeof R!="object"?!1:typeof HTMLElement!="undefined"&&R instanceof HTMLElement?!0:typeof R.nodeName=="string"&&typeof R.getAttribute=="function"}(e)){for(var b="<"+zf.call(String(e.nodeName)),v=e.attributes||[],S=0;S<v.length;S++)b+=" "+v[S].name+"="+y_(dy(v[S].value),"double",l);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+zf.call(String(e.nodeName))+">"}if(Ra(e)){if(e.length===0)return"[]";var $=hr(e,d);return c&&!function(R){for(var J=0;J<R.length;J++)if(Zf(R[J],`
|
||||
`)>=0)return!1;return!0}($)?"["+ja($,c)+"]":"[ "+ri.call($,", ")+" ]"}if(function(R){return!(Fi(R)!=="[object Error]"||ln&&typeof R=="object"&&ln in R)}(e)){var C=hr(e,d);return"cause"in Error.prototype||!("cause"in e)||b_.call(e,"cause")?C.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ri.call(C,", ")+" }":"{ ["+String(e)+"] "+ri.call(Bf.call("[cause]: "+d(e.cause),C),", ")+" }"}if(typeof e=="object"&&r){if(Jf&&typeof e[Jf]=="function"&&Na)return Na(e,{depth:f-i});if(r!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(R){if(!dr||!R||typeof R!="object")return!1;try{dr.call(R);try{pr.call(R)}catch{return!0}return R instanceof Map}catch{}return!1}(e)){var M=[];return sy.call(e,function(R,J){M.push(d(J,e,!0)+" => "+d(R,e))}),xf("Map",dr.call(e),M,c)}if(function(R){if(!pr||!R||typeof R!="object")return!1;try{pr.call(R);try{dr.call(R)}catch{return!0}return R instanceof Set}catch{}return!1}(e)){var T=[];return ly.call(e,function(R){T.push(d(R,e))}),xf("Set",pr.call(e),T,c)}if(function(R){if(!il||!R||typeof R!="object")return!1;try{il.call(R,il);try{sl.call(R,sl)}catch{return!0}return R instanceof WeakMap}catch{}return!1}(e))return Xo("WeakMap");if(function(R){if(!sl||!R||typeof R!="object")return!1;try{sl.call(R,sl);try{il.call(R,il)}catch{return!0}return R instanceof WeakSet}catch{}return!1}(e))return Xo("WeakSet");if(function(R){if(!Vf||!R||typeof R!="object")return!1;try{return Vf.call(R),!0}catch{}return!1}(e))return Xo("WeakRef");if(function(R){return!(Fi(R)!=="[object Number]"||ln&&typeof R=="object"&&ln in R)}(e))return ll(d(Number(e)));if(function(R){if(!R||typeof R!="object"||!Zo)return!1;try{return Zo.call(R),!0}catch{}return!1}(e))return ll(d(Zo.call(e)));if(function(R){return!(Fi(R)!=="[object Boolean]"||ln&&typeof R=="object"&&ln in R)}(e))return ll(ry.call(e));if(function(R){return!(Fi(R)!=="[object String]"||ln&&typeof R=="object"&&ln in R)}(e))return ll(d(String(e)));if(!function(R){return!(Fi(R)!=="[object Date]"||ln&&typeof R=="object"&&ln in R)}(e)&&!Gf(e)){var E=hr(e,d),D=Wf?Wf(e)===Object.prototype:e instanceof Object||e.constructor===Object,P=e instanceof Object?"":"null prototype",L=!D&&ln&&Object(e)===e&&ln in e?Ou.call(Fi(e),8,-1):P?"Object":"",N=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(L||P?"["+ri.call(Bf.call([],L||[],P||[]),": ")+"] ":"");return E.length===0?N+"{}":c?N+"{"+ja(E,c)+"}":N+"{ "+ri.call(E,", ")+" }"}return String(e)},gy=Tu("%TypeError%"),mr=Tu("%WeakMap%",!0),gr=Tu("%Map%",!0),_y=Zs("WeakMap.prototype.get",!0),by=Zs("WeakMap.prototype.set",!0),yy=Zs("WeakMap.prototype.has",!0),vy=Zs("Map.prototype.get",!0),ky=Zs("Map.prototype.set",!0),wy=Zs("Map.prototype.has",!0),Qo=function(n,e){for(var t,i=n;(t=i.next)!==null;i=t)if(t.key===e)return i.next=t.next,t.next=n.next,n.next=t,t},Sy=String.prototype.replace,$y=/%20/g,Xf="RFC3986",Du={default:Xf,formatters:{RFC1738:function(n){return Sy.call(n,$y,"+")},RFC3986:function(n){return String(n)}},RFC1738:"RFC1738",RFC3986:Xf},Cy=Du,ea=Object.prototype.hasOwnProperty,Zi=Array.isArray,si=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),Qf=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},i=0;i<n.length;++i)n[i]!==void 0&&(t[i]=n[i]);return t},S_={arrayToObject:Qf,assign:function(n,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},n)},combine:function(n,e){return[].concat(n,e)},compact:function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],i=0;i<e.length;++i)for(var s=e[i],l=s.obj[s.prop],r=Object.keys(l),o=0;o<r.length;++o){var a=r[o],u=l[a];typeof u=="object"&&u!==null&&t.indexOf(u)===-1&&(e.push({obj:l,prop:a}),t.push(u))}return function(f){for(;f.length>1;){var c=f.pop(),d=c.obj[c.prop];if(Zi(d)){for(var h=[],g=0;g<d.length;++g)d[g]!==void 0&&h.push(d[g]);c.obj[c.prop]=h}}}(e),n},decode:function(n,e,t){var i=n.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},encode:function(n,e,t,i,s){if(n.length===0)return n;var l=n;if(typeof n=="symbol"?l=Symbol.prototype.toString.call(n):typeof n!="string"&&(l=String(n)),t==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var r="",o=0;o<l.length;++o){var a=l.charCodeAt(o);a===45||a===46||a===95||a===126||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||s===Cy.RFC1738&&(a===40||a===41)?r+=l.charAt(o):a<128?r+=si[a]:a<2048?r+=si[192|a>>6]+si[128|63&a]:a<55296||a>=57344?r+=si[224|a>>12]+si[128|a>>6&63]+si[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&l.charCodeAt(o)),r+=si[240|a>>18]+si[128|a>>12&63]+si[128|a>>6&63]+si[128|63&a])}return r},isBuffer:function(n){return!(!n||typeof n!="object")&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},isRegExp:function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},maybeMap:function(n,e){if(Zi(n)){for(var t=[],i=0;i<n.length;
Line truncated
|
||||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=O(),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 Uk(n){let e,t,i,s,l,r,o,a,u=!n[0]&&Mc();const f=n[2].default,c=Tn(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=O(),s=_("div"),u&&u.c(),l=O(),c&&c.c(),r=O(),o=_("div"),p(t,"class","flex-fill"),p(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(o,"class","flex-fill"),p(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,r),m(e,o),a=!0},p(d,[h]){d[0]?u&&(u.d(1),u=null):u||(u=Mc(),u.c(),u.m(s,l)),c&&c.p&&(!a||h&2)&&An(c,f,d,d[1],a?Dn(f,d[1],h,null):En(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){F(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function Wk(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=r=>{"nobranding"in r&&t(0,l=r.nobranding),"$$scope"in r&&t(1,s=r.$$scope)},[l,s,i]}class P0 extends Fe{constructor(e){super(),Le(this,e,Wk,Uk,Ae,{nobranding:0})}}function Oc(n,e,t){const i=n.slice();return i[11]=e[t],i}const Yk=n=>({}),Tc=n=>({uniqueId:n[3]});function Kk(n){let e=(n[11]||lo)+"",t;return{c(){t=H(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||lo)+"")&&_e(t,e)},d(i){i&&k(t)}}}function Jk(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||lo)+"",t;return{c(){t=H(e)},m(l,r){w(l,t,r)},p(l,r){var o,a;r&4&&e!==(e=(((o=l[11])==null?void 0:o.message)||((a=l[11])==null?void 0:a.code)||lo)+"")&&_e(t,e)},d(l){l&&k(t)}}}function Dc(n){let e,t;function i(r,o){return typeof r[11]=="object"?Jk:Kk}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=O(),p(e,"class","help-block help-block-error")},m(r,o){w(r,e,o),l.m(e,null),m(e,t)},p(r,o){s===(s=i(r))&&l?l.p(r,o):(l.d(1),l=s(r),l&&(l.c(),l.m(e,t)))},d(r){r&&k(e),l.d()}}}function Gk(n){let e,t,i,s,l;const r=n[7].default,o=Tn(r,n,n[6],Tc);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Dc(Oc(n,a,f));return{c(){e=_("div"),o&&o.c(),t=O();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),Q(e,"error",n[2].length)},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=X(e,"click",n[8]),s=!0)},p(f,[c]){if(o&&o.p&&(!i||c&64)&&An(o,r,f,f[6],i?Dn(r,f[6],c,Yk):En(f[6]),Tc),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Oc(f,a,d);u[d]?u[d].p(h,c):(u[d]=Dc(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&Q(e,"error",f[2].length)},i(f){i||(A(o,f),i=!0)},o(f){F(o,f),i=!1},d(f){f&&k(e),o&&o.d(f),Bn(u,f),n[9](null),s=!1,l()}}}const lo="Invalid value";function Zk(n,e,t){let i;hn(n,_s,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const r="field_"+U.randomString(7);let{name:o=""}=e,{class:a=void 0}=e,u,f=[];function c(){E0(o)}pi(()=>(u.addEventListener("change",c),()=>{u.removeEventListener("change",c)}));function d(g){ut.call(this,n,g)}function h(g){he[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,o=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=U.toArray(U.getNestedVal(i,o)))},[a,u,f,r,o,i,l,s,d,h]}class Ne extends Fe{constructor(e){super(),Le(this,e,Zk,Gk,Ae,{name:4,class:0})}}function xk(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Email"),s=O(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",r=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0]),l.focus(),o||(a=X(l,"input",n[5]),o=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&r!==(r=u[9])&&p(l,"id",r),f&1&&l.value!==u[0]&&$e(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function Xk(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("Password"),s=O(),l=_("input"),o=O(),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",r=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[1]),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&r!==(r=c[9])&&p(l,"id",r),d&2&&l.value!==c[1]&&$e(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function Qk(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Password confirm"),s=O(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",r=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[2]),o||(a=X(l,"input",n[7]),o=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&r!==(r=u[9])&&p(l,"id",r),f&4&&l.value!==u[2]&&$e(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function e2(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;return s=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[xk,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),r=new Ne({props:{Line truncated
|
||||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,y){w(g,e,y),m(e,t),m(e,i),V(s,e,null),m(e,l),V(r,e,null),m(e,o),V(a,e,null),m(e,u),m(e,f),c=!0,d||(h=X(e,"submit",Kt(n[4])),d=!0)},p(g,[y]){const b={};y&1537&&(b.$$scope={dirty:y,ctx:g}),s.$set(b);const v={};y&1538&&(v.$$scope={dirty:y,ctx:g}),r.$set(v);const S={};y&1540&&(S.$$scope={dirty:y,ctx:g}),a.$set(S),y&8&&Q(f,"btn-disabled",g[3]),y&8&&Q(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(r.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){F(s.$$.fragment,g),F(r.$$.fragment,g),F(a.$$.fragment,g),c=!1},d(g){g&&k(e),z(s),z(r),z(a),d=!1,h()}}}function t2(n,e,t){const i=_n();let s="",l="",r="",o=!1;async function a(){if(!o){t(3,o=!0);try{await we.Admins.create({email:s,password:l,passwordConfirm:r}),await we.Admins.authViaEmail(s,l),i("submit")}catch(d){we.errorResponseHandler(d)}t(3,o=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){r=this.value,t(2,r)}return[s,l,r,o,a,u,f,c]}class n2 extends Fe{constructor(e){super(),Le(this,e,t2,e2,Ae,{})}}function Ac(n){let e,t;return e=new P0({props:{$$slots:{default:[i2]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function i2(n){let e,t;return e=new n2({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:re,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function s2(n){let e,t,i=n[0]&&Ac(n);return{c(){i&&i.c(),e=lt()},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&&A(i,1)):(i=Ac(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Oe(),F(i,1,1,()=>{i=null}),Te())},i(s){t||(A(i),t=!0)},o(s){F(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function l2(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.AuthStore.isValid?Gs("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await Mi(),window.location.search=""}]}class r2 extends Fe{constructor(e){super(),Le(this,e,l2,s2,Ae,{})}}let xa,Qi;const Xa="app-tooltip";function Ec(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Vi(){return Qi=Qi||document.querySelector("."+Xa),Qi||(Qi=document.createElement("div"),Qi.classList.add(Xa),document.body.appendChild(Qi)),Qi}function L0(n,e){let t=Vi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Qa();return}t.textContent=e.text,t.className=Xa+" active",e.class&&t.classList.add(e.class),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),r=0,o=0,a=5;e.position=="left"?(r=l.top+l.height/2-i/2,o=l.left-s-a):e.position=="right"?(r=l.top+l.height/2-i/2,o=l.right+a):e.position=="top"?(r=l.top-i-a,o=l.left+l.width/2-s/2):e.position=="top-left"?(r=l.top-i-a,o=l.left):e.position=="top-right"?(r=l.top-i-a,o=l.right-s):e.position=="bottom-left"?(r=l.top+l.height+a,o=l.left):e.position=="bottom-right"?(r=l.top+l.height+a,o=l.right-s):(r=l.top+l.height+a,o=l.left+l.width/2-s/2),o+s>document.documentElement.clientWidth&&(o=document.documentElement.clientWidth-s),o=o>=0?o:0,r+i>document.documentElement.clientHeight&&(r=document.documentElement.clientHeight-i),r=r>=0?r:0,t.style.top=r+"px",t.style.left=o+"px"}function Qa(){clearTimeout(xa),Vi().classList.remove("active"),Vi().activeNode=void 0}function o2(n,e){Vi().activeNode=n,clearTimeout(xa),xa=setTimeout(()=>{Vi().classList.add("active"),L0(n,e)},isNaN(e.delay)?250:e.delay)}function St(n,e){let t=Ec(e);function i(){o2(n,t)}function s(){Qa()}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),Vi(),{update(l){var r,o;t=Ec(l),(o=(r=Vi())==null?void 0:r.activeNode)!=null&&o.contains(n)&&L0(n,t)},destroy(){var l,r;(r=(l=Vi())==null?void 0:l.activeNode)!=null&&r.contains(n)&&Qa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Do(n){const e=n-1;return e*e*e+1}function ro(n,{delay:e=0,duration:t=400,easing:i=Ul}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ni(n,{delay:e=0,duration:t=400,easing:i=Do,x:s=0,y:l=0,opacity:r=0}={}){const o=getComputedStyle(n),a=+o.opacity,u=o.transform==="none"?"":o.transform,f=a*(1-r);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 un(n,{delay:e=0,duration:t=400,easing:i=Do}={}){const s=getComputedStyle(n),l=+s.opacity,r=parseFloat(s.height),o=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*r}px;padding-top: ${h*o}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 Wn(n,{delay:e=0,duration:t=400,easing:i=Do,start:s=0,opacity:l=0}={}){const r=getComputedStyle(n),o=+r.opacity,a=r.transform==="none"?"":r.transform,u=1-s,f=o*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
|
||||
transform: ${a} scale(${1-u*d});
|
||||
opacity: ${o-f*d}
|
||||
`}}function a2(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,r){w(l,e,r),n[13](e),$e(e,n[7]),i||(s=X(e,"input",n[14]),i=!0)},p(l,r){r&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),r&128&&e.value!==l[7]&&$e(e,l[7])},i:re,o:re,d(l){l&&k(e),n[13](null),i=!1,s()}}}function u2(n){let e,t,i,s;function l(a){n[12](a)}var r=n[4];function o(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 r&&(e=new r(o(n)),he.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=lt()},m(a,u){e&&V(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],je(()=>t=!1)),r!==(r=a[4])){if(e){Oe();const c=e;F(c.$$.fragment,1,0,()=>{z(c,1)}),Te()}r?(e=new r(o(a)),he.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else r&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&F(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&z(e,a)}}}function Pc(n){let e,t,i,s,l,r,o=n[7]!==n[0]&&Lc();return{c(){o&&o.c(),e=O(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',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){o&&o.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(r=X(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?o?u&129&&A(o,1):(o=Lc(),o.c(),A(o,1),o.m(e.parentNode,e)):o&&(Oe(),F(o,1,1,()=>{o=null}),Te())},i(a){s||(A(o),Dt(()=>{i||(i=ft(t,ni,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){F(o),i||(i=ft(t,ni,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){o&&o.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,r()}}}function Lc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',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||(Dt(()=>{t||(t=ft(e,ni,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ft(e,ni,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function f2(n){let e,t,i,s,l,r,o,a,u,f,c;const d=[u2,a2],h=[];function g(b,v){return b[4]&&!b[5]?0:1}r=g(n),o=h[r]=d[r](n);let y=(n[0].length||n[7].length)&&Pc(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=O(),o.c(),a=O(),y&&y.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,v){w(b,e,v),m(e,t),m(t,i),m(i,s),m(t,l),h[r].m(t,null),m(t,a),y&&y.m(t,null),u=!0,f||(c=[X(t,"submit",Kt(n[10])),X(e,"click",Un(n[11]))],f=!0)},p(b,[v]){let S=r;r=g(b),r===S?h[r].p(b,v):(Oe(),F(h[S],1,1,()=>{h[S]=null}),Te(),o=h[r],o?o.p(b,v):(o=h[r]=d[r](b),o.c()),A(o,1),o.m(t,a)),b[0].length||b[7].length?y?(y.p(b,v),v&129&&A(y,1)):(y=Pc(b),y.c(),A(y,1),y.m(t,null)):y&&(Oe(),F(y,1,1,()=>{y=null}),Te())},i(b){u||(A(o),A(y),u=!0)},o(b){F(o),F(y),u=!1},d(b){b&&k(e),h[r].d(),y&&y.d(),f=!1,rt(c)}}}function c2(n,e,t){const i=_n(),s="search_"+U.randomString(7);let{value:l=""}=e,{placeholder:r='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:o=new Ln}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function y(){u||f||(t(5,f=!0),t(4,u=(await rs(()=>import("./FilterAutocompleteInput.2b66e437.js"),[])).default),t(5,f=!1))}pi(()=>{y()});function b(M){ut.call(this,n,M)}function v(M){d=M,t(7,d),t(0,l)}function S(M){he[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const C=()=>{h(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,r=M.placeholder),"autocompleteCollection"in M&&t(2,o=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,r,o,a,u,f,c,d,s,h,g,b,v,S,$,C]}class Ao extends Fe{constructor(e){super(),Le(this,e,c2,f2,Ae,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function d2(n){let e,t,i,s,l;const r=n[6].default,o=Tn(r,n,n[5],null);return{c(){e=_("th"),o&&o.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),o&&o.m(e,null),i=!0,s||(l=[X(e,"click",n[7]),X(e,"keydown",n[8])],s=!0)},p(a,[u]){o&&o.p&&(!i||u&32)&&An(o,r,a,a[5],i?Dn(r,a[5],u,null):En(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),u&10&&Q(e,"col-sort-disabled",a[3]),u&7&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&Q(e,"sort-desc",a[0]==="-"+a[2]),u&7&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(o,a),i=!0)},o(a){F(o,a),i=!1},d(a){a&&k(e),o&&o.d(a),s=!1,rt(l)}}}function p2(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:r}
Line truncated
|
||||
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function y2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="url",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function v2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="referer",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function k2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="status",p(t,"class",U.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function w2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function Ic(n){let e;function t(l,r){return l[6]?$2:S2}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function S2(n){var o;let e,t,i,s,l,r=((o=n[0])==null?void 0:o.length)&&Nc(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),r&&r.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?r?r.p(a,u):(r=Nc(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function $2(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Nc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Rc(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 jc(n,e){var se,Z,De;let t,i,s,l=((se=e[21].method)==null?void 0:se.toUpperCase())+"",r,o,a,u,f,c=e[21].url+"",d,h,g,y,b,v,S=(e[21].referer||"N/A")+"",$,C,M,T,E,D=e[21].status+"",P,L,N,R,J,W,q,G,K,Y,ne=(((Z=e[21].meta)==null?void 0:Z.errorMessage)||((De=e[21].meta)==null?void 0:De.errorData))&&Rc();R=new $i({props:{date:e[21].created}});function fe(){return e[16](e[21])}function ye(...te){return e[17](e[21],...te)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),r=H(l),a=O(),u=_("td"),f=_("span"),d=H(c),g=O(),ne&&ne.c(),y=O(),b=_("td"),v=_("span"),$=H(S),M=O(),T=_("td"),E=_("span"),P=H(D),L=O(),N=_("td"),B(R.$$.fragment),J=O(),W=_("td"),W.innerHTML='<i class="ri-arrow-right-line"></i>',q=O(),p(s,"class",o="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(v,"class","txt txt-ellipsis"),p(v,"title",C=e[21].referer),Q(v,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","label"),Q(E,"label-danger",e[21].status>=400),p(T,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(W,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,be){w(te,t,be),m(t,i),m(i,s),m(s,r),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ne&&ne.m(u,null),m(t,y),m(t,b),m(b,v),m(v,$),m(t,M),m(t,T),m(T,E),m(E,P),m(t,L),m(t,N),V(R,N,null),m(t,J),m(t,W),m(t,q),G=!0,K||(Y=[X(t,"click",fe),X(t,"keydown",ye)],K=!0)},p(te,be){var ie,ve,He;e=te,(!G||be&8)&&l!==(l=((ie=e[21].method)==null?void 0:ie.toUpperCase())+"")&&_e(r,l),(!G||be&8&&o!==(o="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",o),(!G||be&8)&&c!==(c=e[21].url+"")&&_e(d,c),(!G||be&8&&h!==(h=e[21].url))&&p(f,"title",h),((ve=e[21].meta)==null?void 0:ve.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?ne||(ne=Rc(),ne.c(),ne.m(u,null)):ne&&(ne.d(1),ne=null),(!G||be&8)&&S!==(S=(e[21].referer||"N/A")+"")&&_e($,S),(!G||be&8&&C!==(C=e[21].referer))&&p(v,"title",C),be&8&&Q(v,"txt-hint",!e[21].referer),(!G||be&8)&&D!==(D=e[21].status+"")&&_e(P,D),be&8&&Q(E,"label-danger",e[21].status>=400);const ue={};be&8&&(ue.date=e[21].created),R.$set(ue)},i(te){G||(A(R.$$.fragment,te),G=!0)},o(te){F(R.$$.fragment,te),G=!1},d(te){te&&k(t),ne&&ne.d(),z(R),K=!1,rt(Y)}}}function Hc(n){let e,t,i=n[3].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a&8&&i!==(i=o[3].length+"")&&_e(s,i),a&16&&_e(r,o[4])},d(o){o&&k(e)}}}function qc(n){let e,t,i,s,l=n[4]-n[3].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[6]),Q(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=X(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&_e(r,l),c&64&&Q(t,"btn-loading",f[6]),c&64&&Q(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function C2(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$,C,M,T,E=[],D=new Map,P,L,N,R;function J(ie){n[11](ie)}let W={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[b2]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),l=new Qt({props:W}),he.push(()=>Re(l,"sort",J));function q(ie){n[12](ie)}let G={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[y2]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),a=new Qt({props:G}),he.push(()=>Re(a,"sort",q));function K(ie){n[13](ie)}let Y={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[v2]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),c=new Qt({props:Y}),he.push(()=>Re(c,"sort",K));function ne(ie){n[14](ie)}let fe={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[k2]},$$scope:{ctx:n}};n[1]!==void 0&&(fe.sort=n[1]),g=new Qt({props:fe}),he.push(()=>Re(g,"sort",ne));function ye(ie){n[15](ie)}let se={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[w2]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),v=new Qt({props:se}),he.push(()=>Re(v,"sort",ye));let Z=n[3];const De=ie=>ie[21].id;for(let ie=0;ie<Z.length;ie+=1){let ve=Fc(n,Z,ie),He=De(ve);D.set(He,E[ie]=jc(He,ve))}let te=null;Z.l
Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/const F0=function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame}();function I0(n,e,t){const i=t||(r=>Array.prototype.slice.call(r));let s=!1,l=[];return function(...r){l=i(r),s||(s=!0,F0.call(window,()=>{s=!1,n.apply(e,l)}))}}function T2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const D2=n=>n==="start"?"left":n==="end"?"right":"center",Vc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function gi(){}const A2=function(){let n=0;return function(){return n++}}();function Ct(n){return n===null||typeof n=="undefined"}function Pt(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 Vt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return Vt(n)?n:e}function ht(n,e){return typeof n=="undefined"?e:n}const E2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,N0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function $t(n,e,t,i){let s,l,r;if(Pt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(dt(n))for(r=Object.keys(n),l=r.length,s=0;s<l;s++)e.call(t,n[r[s]],r[s])}function oo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function ao(n){if(Pt(n))return n.map(ao);if(dt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=ao(n[t[s]]);return e}return n}function R0(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function P2(n,e,t,i){if(!R0(n))return;const s=e[n],l=t[n];dt(s)&&dt(l)?Nl(s,l,i):e[n]=ao(l)}function Nl(n,e,t){const i=Pt(e)?e:[e],s=i.length;if(!dt(n))return n;t=t||{};const l=t.merger||P2;for(let r=0;r<s;++r){if(e=i[r],!dt(e))continue;const o=Object.keys(e);for(let a=0,u=o.length;a<u;++a)l(o[a],n,e,t)}return n}function Ol(n,e){return Nl(n,e,{merger:L2})}function L2(n,e,t){if(!R0(n))return;const i=e[n],s=t[n];dt(i)&&dt(s)?Ol(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ao(s))}const F2="",I2=".";function zc(n,e){const t=n.indexOf(I2,e);return t===-1?n.length:t}function Bi(n,e){if(e===F2)return n;let t=0,i=zc(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=zc(e,t);return n}function zu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Yn=n=>typeof n!="undefined",Ui=n=>typeof n=="function",Bc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function N2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ht=Math.PI,Et=2*Ht,R2=Et+Ht,uo=Number.POSITIVE_INFINITY,j2=Ht/180,jt=Ht/2,fl=Ht/4,Uc=Ht*2/3,Vn=Math.log10,ui=Math.sign;function Wc(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 H2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Rl(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Tl(n,e,t){return Math.abs(n-e)<t}function q2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function j0(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(Ht/180)}function Bu(n){return n*(180/Ht)}function Yc(n){if(!Vt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function H0(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Ht&&(l+=Et),{angle:l,distance:s}}function eu(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function V2(n,e){return(n-e+R2)%Et-Ht}function Cn(n){return(n%Et+Et)%Et}function jl(n,e,t,i){const s=Cn(n),l=Cn(e),r=Cn(t),o=Cn(l-s),a=Cn(r-s),u=Cn(s-l),f=Cn(s-r);return s===l||s===r||i&&l===r||o>a&&u<f}function on(n,e,t){return Math.max(e,Math.min(t,n))}function z2(n){return on(n,-32768,32767)}function Hl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const wr=n=>n===0||n===1,Kc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Et/t)),Jc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Et/t)+1,Dl={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*jt)+1,easeOutSine:n=>Math.sin(n*jt),easeInOutSine:n=>-.5*(Math.cos(Ht*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1Line truncated
|
||||
* @kurkle/color v0.2.1
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2022 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/function xl(n){return n+.5|0}const Hi=(n,e,t)=>Math.max(Math.min(n,t),e);function kl(n){return Hi(xl(n*2.55),0,255)}function zi(n){return Hi(xl(n*255),0,255)}function vi(n){return Hi(xl(n/2.55)/100,0,1)}function Gc(n){return Hi(xl(n*100),0,100)}const Rn={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},tu=[..."0123456789ABCDEF"],B2=n=>tu[n&15],U2=n=>tu[(n&240)>>4]+tu[n&15],Sr=n=>(n&240)>>4===(n&15),W2=n=>Sr(n.r)&&Sr(n.g)&&Sr(n.b)&&Sr(n.a);function Y2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Rn[n[1]]*17,g:255&Rn[n[2]]*17,b:255&Rn[n[3]]*17,a:e===5?Rn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Rn[n[1]]<<4|Rn[n[2]],g:Rn[n[3]]<<4|Rn[n[4]],b:Rn[n[5]]<<4|Rn[n[6]],a:e===9?Rn[n[7]]<<4|Rn[n[8]]:255})),t}const K2=(n,e)=>n<255?e(n):"";function J2(n){var e=W2(n)?B2:U2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+K2(n.a,e):void 0}const G2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function q0(n,e,t){const i=e*Math.min(t,1-t),s=(l,r=(l+n/30)%12)=>t-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Z2(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 x2(n,e,t){const i=q0(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 X2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Uu(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),r=Math.min(t,i,s),o=(l+r)/2;let a,u,f;return l!==r&&(f=l-r,u=o>.5?f/(2-l-r):f/(l+r),a=X2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,o]}function Wu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(zi)}function Yu(n,e,t){return Wu(q0,n,e,t)}function Q2(n,e,t){return Wu(x2,n,e,t)}function ew(n,e,t){return Wu(Z2,n,e,t)}function V0(n){return(n%360+360)%360}function tw(n){const e=G2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?kl(+e[5]):zi(+e[5]));const s=V0(+e[2]),l=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?i=Q2(s,l,r):e[1]==="hsv"?i=ew(s,l,r):i=Yu(s,l,r),{r:i[0],g:i[1],b:i[2],a:t}}function nw(n,e){var t=Uu(n);t[0]=V0(t[0]+e),t=Yu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function iw(n){if(!n)return;const e=Uu(n),t=e[0],i=Gc(e[1]),s=Gc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${vi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Zc={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"},xc={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 sw(){const n={},e=Object.keys(xc),t=Object.keys(Zc);let i,s,l,r,o;for(i=0;i<e.length;i++){for(r=o=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/class aS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],r=t.duration;l.forEach(o=>o({chart:e,initial:t.initial,numSteps:r,currentStep:Math.min(i-t.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=F0.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 r=l.length-1,o=!1,a;for(;r>=0;--r)a=l[r],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),o=!0):(l[r]=l[l.length-1],l.pop());o&&(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 aS;const fd="transparent",uS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Qc(n||fd),s=i.valid&&Qc(e||fd);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class fS{constructor(e,t,i,s){const l=t[i];s=Mr([e.to,s,l,e.from]);const r=Mr([e.from,l,s]);this._active=!0,this._fn=e.fn||uS[e.type||typeof r],this._easing=Dl[e.easing]||Dl.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=r,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,r=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Mr([e.to,t,s,e.from]),this._from=Mr([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,r=this._loop,o=this._to;let a;if(this._active=l!==o&&(r||t<i),!this._active){this._target[s]=o,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,o,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;s<i.length;s++)i[s][t]()}}const cS=["x","y","borderWidth","radius","tension"],dS=["color","borderColor","backgroundColor"];mt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const pS=Object.keys(mt.animation);mt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});mt.set("animations",{colors:{type:"color",properties:dS},numbers:{type:"number",properties:cS}});mt.describe("animations",{_fallback:"animation"});mt.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 sb{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 r of pS)l[r]=s[r];(Pt(s.properties)&&s.properties||[i]).forEach(r=>{(r===i||!t.has(r))&&t.set(r,l)})})}_animateOptions(e,t){const i=t.options,s=mS(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&hS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),r=Object.keys(t),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const u=r[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,o);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new fS(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 hS(n,e){const t=[]Line truncated
|
||||
`)>-1?n.split(`
|
||||
`):n}function EC(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:r,value:o}=l.getLabelAndValue(s);return{chart:n,label:r,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function qd(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:r,boxHeight:o}=e,a=On(e.bodyFont),u=On(e.titleFont),f=On(e.footerFont),c=l.length,d=s.length,h=i.length,g=Kn(e.padding);let y=g.height,b=0,v=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,c&&(y+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),v){const C=e.displayColors?Math.max(o,a.lineHeight):a.lineHeight;y+=h*C+(v-h)*a.lineHeight+(v-1)*e.bodySpacing}d&&(y+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(C){b=Math.max(b,t.measureText(C).width+S)};return t.save(),t.font=u.string,$t(n.title,$),t.font=a.string,$t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?r+2+e.boxPadding:0,$t(i,C=>{$t(C.before,$),$t(C.lines,$),$t(C.after,$)}),S=0,t.font=f.string,$t(n.footer,$),t.restore(),b+=g.width,{width:b,height:y}}function PC(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function LC(n,e,t,i){const{x:s,width:l}=i,r=t.caretSize+t.caretPadding;if(n==="left"&&s+l+r>e.width||n==="right"&&s-l-r<0)return!0}function FC(n,e,t,i){const{x:s,width:l}=t,{width:r,chartArea:{left:o,right:a}}=n;let u="center";return i==="center"?u=s<=(o+a)/2?"left":"right":s<=l/2?u="left":s>=r-l/2&&(u="right"),LC(u,n,e,t)&&(u="center"),u}function Vd(n,e,t){const i=t.yAlign||e.yAlign||PC(n,t);return{xAlign:t.xAlign||e.xAlign||FC(n,e,t,i),yAlign:i}}function IC(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function NC(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function zd(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:r}=n,{xAlign:o,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=Hs(r);let g=IC(e,o);const y=NC(e,a,u);return a==="center"?o==="left"?g+=u:o==="right"&&(g-=u):o==="left"?g-=Math.max(f,d)+s:o==="right"&&(g+=Math.max(c,h)+s),{x:on(g,0,i.width-e.width),y:on(y,0,i.height-e.height)}}function Lr(n,e,t){const i=Kn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Bd(n){return li([],bi(n))}function RC(n,e,t){return Yi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Ud(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class fu extends Ti{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 sb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=RC(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]),r=i.afterTitle.apply(this,[e]);let o=[];return o=li(o,bi(s)),o=li(o,bi(l)),o=li(o,bi(r)),o}getBeforeBody(e,t){return Bd(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return $t(e,l=>{const r={before:[],lines:[],after:[]},o=Ud(i,l);li(r.before,bi(o.beforeLabel.call(this,l))),li(r.lines,o.label.call(this,l)),li(r.after,bi(o.afterLabel.call(this,l))),s.push(r)}),s}getAfterBody(e,t){return Bd(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]),r=i.afterFooter.apply(this,[e]);let o=[];return o=li(o,bi(s)),o=li(o,bi(l)),o=li(o,bi(r)),o}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],r=[];let o=[],a,u;for(a=0,u=t.length;a<u;++a)o.push(EC(this.chart,t[a]));return e.filter&&(o=o.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(o=o.sort((f,c)=>e.itemSort(f,c,i))),$t(o,f=>{const c=Ud(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),r.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=r,this.dataPoints=o,o}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;l
Line truncated
|
||||
* chartjs-adapter-luxon v1.1.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2021 chartjs-adapter-luxon Contributors
|
||||
* Released under the MIT license
|
||||
*/const s3={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};ab._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},formats:function(){return s3},parse:function(n,e){const t=this.options;if(n===null||typeof n=="undefined")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Xd(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ft(e,Wn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=ft(e,Wn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function l3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=H(n[1]),t=O(),s=H(i)},m(l,r){w(l,e,r),w(l,t,r),w(l,s,r)},p(l,r){r&2&&_e(e,l[1]),r&2&&i!==(i=l[1]===1?"log":"logs")&&_e(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function r3(n){let e;return{c(){e=H("Loading...")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function o3(n){let e,t,i,s,l,r,o=n[2]&&Xd();function a(c,d){return c[2]?r3:l3}let u=a(n),f=u(n);return{c(){e=_("div"),o&&o.c(),t=O(),i=_("canvas"),s=O(),l=_("div"),f.c(),p(i,"class","chart-canvas svelte-vh4sl8"),bf(i,"height","250px"),bf(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),r=!0},p(c,[d]){c[2]?o?d&4&&A(o,1):(o=Xd(),o.c(),A(o,1),o.m(e,t)):o&&(Oe(),F(o,1,1,()=>{o=null}),Te()),d&4&&Q(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){r||(A(o),r=!0)},o(c){F(o),r=!1},d(c){c&&k(e),o&&o.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function a3(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,r,o=[],a=0,u=!1;async function f(){return t(2,u=!0),we.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)o.push({x:U.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);o.push({x:new Date,y:void 0})}).catch(h=>{h!==null&&(c(),console.warn(h),we.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,o=[])}pi(()=>(bo.register(Ki,Lo,er,ff,nr,AC,jC),t(6,r=new bo(l,{type:"line",data:{datasets:[{label:"Total requests",data:o,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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}}}})),()=>r==null?void 0:r.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!="undefined"||typeof s!="undefined")&&f(),n.$$.dirty&192&&typeof o!="undefined"&&r&&(t(6,r.data.datasets[0].data=o,r),r.update())},[l,a,u,i,s,f,r,o,d]}class u3 extends Fe{constructor(e){super(),Le(this,e,a3,o3,Ae,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Qd=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Db={exports:{}};(function(n){var e=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
*
|
||||
* @license MIT <https://opensource.org/licenses/MIT>
|
||||
* @author Lea Verou <https://lea.verou.me>
|
||||
* @namespace
|
||||
* @public
|
||||
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,r={},o={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S($,C){C=C||{};var M,T;switch(o.util.type($)){case"Object":if(T=o.util.objId($),C[T])return C[T];M={},C[T]=M;for(var E in $)$.hasOwnProperty(E)&&(M[E]=S($[E],C));return M;case"Array":return T=o.util.objId($),C[T]?C[T]:(M=[],C[T]=M,$.forEach(function(D,P){M[P]=S(D,C)}),M);default:return $}},getLanguage:function(S){for(;S;){var $=s.exec(S.className);if($)return $[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,$){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+$)},currentScript:function(){if(typeof document=="undefined")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 $=document.getElementsByTagName("script");for(var C in $)if($[C].src==S)return $[C]}return null}},isActive:function(S,$,C){for(var M="no-"+$;S;){var T=S.classList;if(T.contains($))return!0;if(T.contains(M))return!1;S=S.parentElement}return!!C}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(S,$){var C=o.util.clone(o.languages[S]);for(var M in $)C[M]=$[M];return C},insertBefore:function(S,$,C,M){M=M||o.languages;var T=M[S],E={};for(var D in T)if(T.hasOwnProperty(D)){if(D==$)for(var P in C)C.hasOwnProperty(P)&&(E[P]=C[P]);C.hasOwnProperty(D)||(E[D]=T[D])}var L=M[S];return M[S]=E,o.languages.DFS(o.languages,function(N,R){R===L&&N!=S&&(this[N]=E)}),E},DFS:function S($,C,M,T){T=T||{};var E=o.util.objId;for(var D in $)if($.hasOwnProperty(D)){C.call($,D,$[D],M||D);var P=$[D],L=o.util.type(P);L==="Object"&&!T[E(P)]?(T[E(P)]=!0,S(P,C,null,T)):L==="Array"&&!T[E(P)]&&(T[E(P)]=!0,S(P,C,D,T))}}},plugins:{},highlightAll:function(S,$){o.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,C){var M={callback:C,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),o.hooks.run("before-all-elements-highlight",M);for(var T=0,E;E=M.elements[T++];)o.highlightElement(E,$===!0,M.callback)},highlightElement:function(S,$,C){var M=o.util.getLanguage(S),T=o.languages[M];o.util.setLanguage(S,M);var E=S.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(E,M);var D=S.textContent,P={element:S,language:M,grammar:T,code:D};function L(R){P.highlightedCode=R,o.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,o.hooks.run("after-highlight",P),o.hooks.run("complete",P),C&&C.call(P.element)}if(o.hooks.run("before-sanity-check",P),E=P.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!P.code){o.hooks.run("complete",P),C&&C.call(P.element);return}if(o.hooks.run("before-highlight",P),!P.grammar){L(o.util.encode(P.code));return}if($&&i.Worker){var N=new Worker(o.filename);N.onmessage=function(R){L(R.data)},N.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(o.highlight(P.code,P.grammar,P.language))},highlight:function(S,$,C){var M={code:S,grammar:$,language:C};if(o.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=o.tokenize(M.code,M.grammar),o.hooks.run("after-tokenize",M),a.stringify(o.util.encode(M.tokens),M.language)},tokenize:function(S,$){var C=$.rest;if(C){for(var M in C)$[M]=C[M];delete $.rest}var T=new c;return d(T,T.head,S),f(S,T,$,T.head,0),g(T)},hooks:{all:{},add:function(S,$){var C=o.hooks.all;C[S]=C[S]||[],C[S].push($)},run:function(S,$){var C=o.hooks.all[S];if(!(!C||!C.length))for(var M=0,T;T=C[M++];)T($)}},Token:a};i.Prism=o;function a(S,$,C,M){this.type=S,this.content=$,this.alias=C,this.length=(M||"").length|0}a.stringify=function S($,C){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(L){M+=S(L,C)}),M}var T={type:$.type,content:S($.content,C),tag:"span",classes:["token",$.type],attributes:{},language:C},E=$.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(T.classes,E):T.classes.push(E)),o.hooks.run("wrap",T);var D="";for(var P in T.attributes)D+=" "+P+'="'+(T.attributes[P]||"").replace(/"/g,""")+'"';return"<"+T.tag+' class="'+T.classes.join(" ")+'"'+D+">"+T.content+"</"+T.tag+">"};function u(S,$,C,M){S.lastIndex=$;var T=S.exec(C);if(T&&M&&T[1]){var E=T[1].length;T.index+=E,T[0]=T[0].slice(E)}retLine truncated
|
||||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}v.textContent=T,t.highlightElement(v)},function(T){b.setAttribute(o,f),v.textContent=T})}}),t.plugins.fileHighlight={highlight:function(b){for(var v=(b||document).querySelectorAll(c),S=0,$;$=v[S++];)t.highlightElement($)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(Db);var gl=Db.exports,f3={exports:{}};(function(n){(function(){if(typeof Prism=="undefined")return;var e=Object.assign||function(l,r){for(var o in r)r.hasOwnProperty(o)&&(l[o]=r[o]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(r,o){return o.toUpperCase()})}function s(l){for(var r=0,o=0;o<l.length;++o)l.charCodeAt(o)==" ".charCodeAt(0)&&(r+=3);return l.length+r}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,r){r=e(this.defaults,r);for(var o in r){var a=i(o);o!=="normalize"&&a!=="setDefaults"&&r[o]&&this[a]&&(l=this[a].call(this,l,r[o]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,r){return r=r|0||4,l.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(l,r){return r=r|0||4,l.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var r=l.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(o,a){return o.length-a.length}),!r[0].length)?l:l.replace(RegExp("^"+r[0],"gm"),"")},indent:function(l,r){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(l,r){r=r===!0?80:r|0||80;for(var o=l.split(`
|
||||
`),a=0;a<o.length;++a)if(!(s(o[a])<=r)){for(var u=o[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>r&&(u[c]=`
|
||||
`+u[c],f=d)}o[a]=u.join("")}return o.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 r=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=r.normalize(l.code,l.settings);return}var o=l.element.parentNode;if(!(!l.code||!o||o.nodeName.toLowerCase()!=="pre")){for(var a=o.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,o.removeChild(h),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=r.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=r.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(f3);function c3(n){let e,t;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-tv7jme"),p(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:re,o:re,d(i){i&&k(e)}}}function d3(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function r(o){return o=typeof o=="string"?o:"",o=gl.plugins.NormalizeWhitespace.normalize(o,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),gl.highlight(o,gl.languages[s]||gl.languages.javascript,s)}return n.$$set=o=>{"content"in o&&t(1,i=o.content),"language"in o&&t(2,s=o.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof gl!="undefined"&&i&&t(0,l=r(i))},[l,i,s]}class en extends Fe{constructor(e){super(),Le(this,e,d3,c3,Ae,{content:1,language:2})}}const p3=n=>({}),ep=n=>({}),h3=n=>({}),tp=n=>({});function np(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$=n[4]&&!n[2]&&ip(n);const C=n[18].header,M=Tn(C,n,n[17],tp);let T=n[4]&&n[2]&&sp(n);const E=n[18].default,D=Tn(E,n,n[17],null),P=n[18].footer,L=Tn(P,n,n[17],ep);return{c(){e=_("div"),t=_("div"),s=O(),l=_("div"),r=_("div"),$&&$.c(),o=O(),M&&M.c(),a=O(),T&&T.c(),u=O(),f=_("div"),D&&D.c(),c=O(),d=_("div"),L&&L.c(),p(t,"class","overlay"),p(r,"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]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,R){w(N,e,R),m(e,t),m(e,s),m(e,l),m(l,r),$&&$.m(r,null),m(r,o),M&&M.m(r,null),m(r,a),T&&T.m(r,null),m(l,u),m(l,f),D&&D.m(f,null),n[20](f),m(l,c),m(l,d),L&&L.m(d,null),b=!0,v||(S=[X(t,"click",Kt(n[19])),X(f,"scroll",n[21])],v=!0)},p(N,R){n=N,n[4]&&!n[2]?$?$.p(n,R):($=ip(n),$.c(),$.m(r,o)):$&&($.d(1),$=null),M&&M.p&&(!b||R&131072)&&An(M,C,n,n[17],b?Dn(C,n[17],R,h3):En(n[17]),tp),n[4]&&n[2]?T?T.p(n,R):(T=sp(n),T.c(),T.m(r,null)):T&&(T.d(1),T=null),D&&D.p&&(!b||R&131072)&&An(D,E,n,n[17],b?Dn(E,n[17],R,null):En(n[17]),null),L&&L.p&&(!b||R&131072)&&An(L,P,n,n[17],b?Dn(P,n[17],R,p3):En(n[17]),ep),(!b||R&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),R&262&&Q(l,"popup",n[2]),R&4&&Q(e,"padded",n[2]),R&1&&Q(e,"active",n[0])},i(N){b||(Dt(()=>{i||(i=ft(t,ro,{duration:Ps,opacity:0},!0)),i.run(1)}),A(M,N),A(D,N),A(L,N),Dt(()=>{y&&y.end(1),g=vu(l,ni,n[2]?{duration:Ps,y:-10}:{duration:Ps,x:50}),g.start()}),b=!0)},o(N){i||(i=ft(t,ro,{duration:Ps,opacity:0},!1)),i.run(0),F(M,N),F(D,N),F(L,N),g&&g.invalidate(),y=Zg(l,ni,n[2]?{duration:Ps,y:10}:{duration:Ps,x:50}),b=!1},d(N){N&&k(e),N&&i&&i.end(),$&&$.d(),M&&M.d(N),T&&T.d(),D&&D.d(N),n[20](null),L&&L.d(N),N&&y&&y.end(),v=!1,rt(S)}}}function ip(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=X(e,"click",Kt(n[5])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function sp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',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=X(e,"click",Kt(n[5])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function m3(n){let e,t,i,s,l=n[0]&&np(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(r,o){w(r,e,o),l&&l.m(e,null),n[22](e),t=!0,i||(s=[X(window,"resize",n[10]),X(window,"keydown",n[9])],i=!0)},p(r,[o]){r[0]?l?(l.p(r,o),o&1&&A(l,1)):(l=np(r),l.c(),A(l,1),l.m(e,null)):l&&(Oe(),F(l,1,1,()=>{l=null}),Te())},i(r){t||(A(l),t=!0)},o(r){F(l),t=!1},d(r){r&&k(e),l&&l.d(),n[22](null),i=!1,rt(s)}}}let ns;function Ab(){return ns=ns||document.querySelector(".overlays"),ns||(ns=document.createElement("div"),ns.classList.add("overlays"),document.body.appendChild(ns)),ns}let Ps=150;function lp(){return 1e3+Ab().querySelectorAll(".overlay-panel-container.active").length}function g3(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:r=!1}=e,{popup:o=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{
Line truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&16&&l!==(l=b[4]))&&p(e,"for",l);const S={};v&16&&(S.id=b[4]),v&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&v&1&&(a=!0,S.value=b[0].exceptDomains,je(()=>a=!1)),o.$set(S)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function v4(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[3](b)}let y={id:n[4]+".options.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(y.value=n[0].onlyDomains),o=new ks({props:y}),he.push(()=>Re(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),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,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:`Domains that are ONLY allowed as value.
|
||||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const S={};v&16&&(S.id=b[4]+".options.onlyDomains"),v&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&v&1&&(a=!0,S.value=b[0].onlyDomains,je(()=>a=!1)),o.$set(S)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function k4(n){let e,t,i,s,l,r,o;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[y4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[v4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),o=!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}),r.$set(c)},i(a){o||(A(i.$$.fragment,a),A(r.$$.fragment,a),o=!0)},o(a){F(i.$$.fragment,a),F(r.$$.fragment,a),o=!1},d(a){a&&k(e),z(i),z(r)}}}function w4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(o){n.$$.not_equal(s.exceptDomains,o)&&(s.exceptDomains=o,t(0,s))}function r(o){n.$$.not_equal(s.onlyDomains,o)&&(s.onlyDomains=o,t(0,s))}return n.$$set=o=>{"key"in o&&t(1,i=o.key),"options"in o&&t(0,s=o.options)},[s,i,l,r]}class Lb extends Fe{constructor(e){super(),Le(this,e,w4,k4,Ae,{key:1,options:0})}}function S4(n){let e,t,i,s;function l(a){n[2](a)}function r(a){n[3](a)}let o={};return n[0]!==void 0&&(o.key=n[0]),n[1]!==void 0&&(o.options=n[1]),e=new Lb({props:o}),he.push(()=>Re(e,"key",l)),he.push(()=>Re(e,"options",r)),{c(){B(e.$$.fragment)},m(a,u){V(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],je(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],je(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){F(e.$$.fragment,a),s=!1},d(a){z(e,a)}}}function $4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(o){i=o,t(0,i)}function r(o){s=o,t(1,s)}return n.$$set=o=>{"key"in o&&t(0,i=o.key),"options"in o&&t(1,s=o.options)},[i,s,l,r]}class C4 extends Fe{constructor(e){super(),Le(this,e,$4,S4,Ae,{key:0,options:1})}}var $a=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],qs={_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!="undefined"&&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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},zl={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:"Clic
Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+j.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var I=wt("div","flatpickr-weekwrapper");I.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var j=wt("div","flatpickr-weeks");return I.appendChild(j),{weekWrapper:I,weekNumbers:j}}function ye(I,j){j===void 0&&(j=!0);var ee=j?I:I-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,st("onYearChange"),J()),R(),st("onMonthChange"),xe())}function se(I,j){if(I===void 0&&(I=!0),j===void 0&&(j=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,j===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Ta(t.config),de=ee.hours,Pe=ee.minutes,We=ee.seconds;h(de,Pe,We)}t.redraw(),I&&st("onChange")}function Z(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),st("onClose")}function De(){t.config!==void 0&&st("onDestroy");for(var I=t._handlers.length;I--;)t._handlers[I].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 j=t.calendarContainer.parentNode;if(j.lastChild&&j.removeChild(j.lastChild),j.parentNode){for(;j.firstChild;)j.parentNode.insertBefore(j.firstChild,j);j.parentNode.removeChild(j)}}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(ee){try{delete t[ee]}catch{}})}function te(I){return t.calendarContainer.contains(I)}function be(I){if(t.isOpen&&!t.config.inline){var j=Sn(I),ee=te(j),de=j===t.input||j===t.altInput||t.element.contains(j)||I.path&&I.path.indexOf&&(~I.path.indexOf(t.input)||~I.path.indexOf(t.altInput)),Pe=!de&&!ee&&!te(I.relatedTarget),We=!t.config.ignoredFocusElements.some(function(tt){return tt.contains(j)});Pe&&We&&(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 ue(I){if(!(!I||t.config.minDate&&I<t.config.minDate.getFullYear()||t.config.maxDate&&I>t.config.maxDate.getFullYear())){var j=I,ee=t.currentYear!==j;t.currentYear=j||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)),ee&&(t.redraw(),st("onYearChange"),J())}}function ie(I,j){var ee;j===void 0&&(j=!0);var de=t.parseDate(I,void 0,j);if(t.config.minDate&&de&&$n(de,t.config.minDate,j!==void 0?j:!t.minDateHasTime)<0||t.config.maxDate&&de&&$n(de,t.config.maxDate,j!==void 0?j:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===void 0)return!1;for(var Pe=!!t.config.enable,We=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,tt=0,Je=void 0;tt<We.length;tt++){if(Je=We[tt],typeof Je=="function"&&Je(de))return Pe;if(Je instanceof Date&&de!==void 0&&Je.getTime()===de.getTime())return Pe;if(typeof Je=="string"){var nt=t.parseDate(Je,void 0,!0);return nt&&nt.getTime()===de.getTime()?Pe:!Pe}else if(typeof Je=="object"&&de!==void 0&&Je.from&&Je.to&&de.getTime()>=Je.from.getTime()&&de.getTime()<=Je.to.getTime())return Pe}return!Pe}function ve(I){return t.daysContainer!==void 0?I.className.indexOf("hidden")===-1&&I.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(I):!1}function He(I){var j=I.target===t._input,ee=t._input.value.trimEnd()!==Gt();j&&ee&&!(I.relatedTarget&&te(I.relatedTarget))&&t.setDate(t._input.value,!0,I.target===t.altInput?t.config.altFormat:t.config.dateFormat)}f
Line truncated
|
||||
`),d=_("span"),h=_("span"),h.textContent="Choose presets",g=O(),B(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m(M,T){w(M,e,T),m(e,t),m(e,i),m(e,s),w(M,r,T),V(o,M,T),w(M,u,T),w(M,f,T),m(f,c),m(f,d),m(d,h),m(d,g),V(y,d,null),b=!0,v||(S=Xe(St.call(null,s,{text:`Allow uploading files ONLY with the listed mime types.
|
||||
Leave empty for no restriction.`,position:"top"})),v=!0)},p(M,T){(!b||T&512&&l!==(l=M[9]))&&p(e,"for",l);const E={};T&512&&(E.id=M[9]),!a&&T&1&&(a=!0,E.value=M[0].mimeTypes,je(()=>a=!1)),o.$set(E);const D={};T&1025&&(D.$$scope={dirty:T,ctx:M}),y.$set(D)},i(M){b||(A(o.$$.fragment,M),A(y.$$.fragment,M),b=!0)},o(M){F(o.$$.fragment,M),F(y.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(r),z(o,M),M&&k(u),M&&k(f),z(y),v=!1,S()}}}function X4(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[8](b)}let y={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(y.value=n[0].thumbs),o=new ks({props:y}),he.push(()=>Re(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),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[9]),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,v){(!c||v&512&&l!==(l=b[9]))&&p(e,"for",l);const S={};v&512&&(S.id=b[9]),!a&&v&1&&(a=!0,S.value=b[0].thumbs,je(()=>a=!1)),o.$set(S)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function Q4(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[J4,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[G4,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[x4,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[X4,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(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(g,y){w(g,e,y),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),h=!0},p(g,[y]){const b={};y&2&&(b.name="schema."+g[1]+".options.maxSize"),y&1537&&(b.$$scope={dirty:y,ctx:g}),i.$set(b);const v={};y&2&&(v.name="schema."+g[1]+".options.maxSelect"),y&1537&&(v.$$scope={dirty:y,ctx:g}),r.$set(v);const S={};y&2&&(S.name="schema."+g[1]+".options.mimeTypes"),y&1537&&(S.$$scope={dirty:y,ctx:g}),u.$set(S);const $={};y&2&&($.name="schema."+g[1]+".options.thumbs"),y&1537&&($.$$scope={dirty:y,ctx:g}),d.$set($)},i(g){h||(A(i.$$.fragment,g),A(r.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){F(i.$$.fragment,g),F(r.$$.fragment,g),F(u.$$.fragment,g),F(d.$$.fragment,g),h=!1},d(g){g&&k(e),z(i),z(r),z(u),z(d)}}}function eM(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Tt(this.value),t(0,s)}function r(){s.maxSelect=Tt(this.value),t(0,s)}function o(d){n.$$.not_equal(s.mimeTypes,d)&&(s.mimeTypes=d,t(0,s))}const a=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},u=()=>{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)},f=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function c(d){n.$$.not_equal(s.thumbs,d)&&(s.thumbs=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,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,r,o,a,u,f,c]}class tM extends Fe{constructor(e){super(),Le(this,e,eM,Q4,Ae,{key:1,options:0})}}function nM(n){let e,t,i,s,l,r,o;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 vs({props:u}),he.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=H("Collection"),s=O(),B(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||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]),!r&&c&1&&(r=!0,d.keyOfSelected=f[0].collectionId,je(()=>r=!1)),l.$set(d)},i(f){o||(A(l.$$.fragment,f),o=!0)},o(f){F(l.$$.fragment,f),o=!1},d(f){f&&k(e),f&&k(s),z(l,f)}}}function iM(n){let e,t,i,s,l,r,o,a;return{c(
Line truncated
|
||||
<code>@request.query.*</code>
|
||||
<code>@request.data.*</code>
|
||||
<code>@request.user.*</code>`,$=O(),C=_("hr"),M=O(),T=_("p"),T.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=O(),D=_("div"),D.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=O(),L=_("hr"),N=O(),R=_("p"),R.innerHTML=`Example rule:
|
||||
<br/>
|
||||
<code>@request.user.id!=null && created>"2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(r,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(T,"class","m-b-0"),p(D,"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(K,Y){w(K,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,r),m(r,o),m(r,a),m(r,u),m(r,f),m(r,c),m(r,d);for(let ne=0;ne<G.length;ne+=1)G[ne].m(r,null);m(i,h),m(i,g),m(i,y),m(i,b),m(i,v),m(i,S),m(i,$),m(i,C),m(i,M),m(i,T),m(i,E),m(i,D),m(i,P),m(i,L),m(i,N),m(i,R),W=!0},p(K,Y){if(Y&1){q=K[0].schema;let ne;for(ne=0;ne<q.length;ne+=1){const fe=Yp(K,q,ne);G[ne]?G[ne].p(fe,Y):(G[ne]=Jp(fe),G[ne].c(),G[ne].m(r,null))}for(;ne<G.length;ne+=1)G[ne].d(1);G.length=q.length}},i(K){W||(K&&Dt(()=>{J||(J=ft(e,un,{duration:150},!0)),J.run(1)}),W=!0)},o(K){K&&(J||(J=ft(e,un,{duration:150},!1)),J.run(0)),W=!1},d(K){K&&k(e),Bn(G,K),K&&J&&J.end()}}}function NM(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=H(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&_e(i,t)},d(s){s&&k(e)}}}function RM(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=H(t),s=H(".*")},m(l,r){w(l,e,r),m(e,i),m(e,s)},p(l,r){r&1&&t!==(t=l[19].name+"")&&_e(i,t)},d(l){l&&k(e)}}}function Jp(n){let e;function t(l,r){return l[19].type==="relation"||l[19].type==="user"?RM:NM}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function jM(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const r=o=>o[14];for(let o=0;o<l.length;o+=1){let a=Wp(n,l,o),u=r(a);t.set(u,e[o]=Gp(u,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=lt()},m(o,a){for(let u=0;u<e.length;u+=1)e[u].m(o,a);w(o,i,a),s=!0},p(o,a){a&262235&&(l=Object.entries(o[6]),Oe(),e=ot(e,a,r,1,o,l,t,i.parentNode,Lt,Gp,i,Wp),Te())},i(o){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)F(e[a]);s=!1},d(o){for(let a=0;a<e.length;a+=1)e[a].d(o);o&&k(i)}}}function HM(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function qM(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,r){w(l,e,r),t||(i=[Xe(St.call(null,e,"Lock and set to Admins only")),X(e,"click",s)],t=!0)},p(l,r){n=l},d(l){l&&k(e),t=!1,rt(i)}}}function VM(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,r){w(l,e,r),t||(i=[Xe(St.call(null,e,"Unlock and set custom rule")),X(e,"click",s)],t=!0)},p(l,r){n=l},d(l){l&&k(e),t=!1,rt(i)}}}function zM(n){let e;return{c(){e=H("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function BM(n){let e;return{c(){e=H("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function UM(n){let e,t=n[15]+"",i,s,l=Ri(n[0][n[14]])?"Admins only":"Custom rule",r,o,a,u,f=n[14],c,d,h,g,y,b,v;function S(){return n[10](n[14])}const $=()=>n[11](u,f),C=()=>n[11](null,f);function M(N){n[12](N,n[14])}var T=n[4];function E(N){let R={baseCollection:N[0],disabled:Ri(N[0][N[14]])};return N[0][N[14]]!==void 0&&(R.value=N[0][N[14]]),{props:R}}T&&(u=new T(E(n)),$(),he.push(()=>Re(u,"value",M)));function D(N,R){return R&1&&(g=null),g==null&&(g=!!Ri(N[0][N[14]])),g?BM:zM}let P=D(n,-1),L=P(n);return{c(){e=_("label"),i=H(t),s=H(" - "),r=H(l),a=O(),u&&B(u.$$.fragment),d=O(),h=_("div"),L.c(),p(e,"for",o=n[18]),p(h,"class","help-block")},m(N,R){w(N,e,R),m(e,i),m(e,s),m(e,r),w(N,a,R),u&&V(u,N,R),w(N,d,R),w(N,h,R),L.m(h,null),y=!0,b||(v=X(e,"click",S),b=!0)},p(N,R){n=N,(!y||R&1)&&l!==(l=Ri(n[0][n[14]])?"Admins only":"Custom rule")&&_e(r,l),(!y||R&262144&&o!==(o=n[18]))&&p(e,"for",o),f!==n[14]&&(C(),f=n[14],$());const J={};if(R&1&&(J.baseCollection=n[0]),R&1&&(J.disabled=Ri(n[0][n[14]])),!c&&R&65&&(c=!0,J.value=n[0][n[14]],je(()=>c=!1)),T!==(T=n[4])){if(u){Oe();const W=u;F(W.$$.fragment,1,0,()=>{z(W,1)}),Te()}T?(u=new T(E(n)),$(),he.push(()=>Re(u,"value",M)),B(u.$$.fragment),A(u.$$.fragment,1),V(u,d.parentNode,d)):u=null}else T&&u.$set(J);P!==(P=D(n,R))&&(L.d(1),L=P(n),L&&(L.c(),L.m(h,null)))},i(N){y||(u&&A(u.$$.fragment,N),y=!0)},o(N){u&&F(u.$$.fragment,N),y=!1},d(N){N&&k(e),N&&k(a),C(),u&&z(u,N),N&&k(d),N&&k(h),L.d(),b=!1,v()}}}function Gp(n,e){let t,i,s,l,r,o,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Ri(h[0][h[14]])),l?VM:qM}let c=f(e,-1),d=c(e);return o=new Ne({props:{class:"form-field rule-field m-0 "+(Ri(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{defaLine truncated
|
||||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||||
</a>.`,s=O(),l=_("span"),o=H(r),a=O(),b&&b.c(),u=O(),c.c(),d=lt(),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(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,a),b&&b.m(e,null),w(C,u,M),S[f].m(C,M),w(C,d,M),h=!0,g||(y=X(l,"click",n[7]),g=!0)},p(C,[M]){(!h||M&4)&&r!==(r=C[2]?"Hide available fields":"Show available fields")&&_e(o,r),C[2]?b?(b.p(C,M),M&4&&A(b,1)):(b=Kp(C),b.c(),A(b,1),b.m(e,null)):b&&(Oe(),F(b,1,1,()=>{b=null}),Te());let T=f;f=$(C),f===T?S[f].p(C,M):(Oe(),F(S[T],1,1,()=>{S[T]=null}),Te(),c=S[f],c?c.p(C,M):(c=S[f]=v[f](C),c.c()),A(c,1),c.m(d.parentNode,d))},i(C){h||(A(b),A(c),h=!0)},o(C){F(b),F(c),h=!1},d(C){C&&k(e),b&&b.d(),C&&k(u),S[f].d(C),C&&k(d),g=!1,y()}}}function Ri(n){return n===null}function YM(n,e,t){let{collection:i=new Ln}=e,s={},l=!1,r={},o,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,o=(await rs(()=>import("./FilterAutocompleteInput.2b66e437.js"),[])).default)}catch(v){console.warn(v),t(4,o=null)}t(5,a=!1)}pi(()=>{f()});const c=()=>t(2,l=!l),d=async v=>{var S;t(0,i[v]=s[v]||"",i),await Mi(),(S=r[v])==null||S.focus()},h=v=>{t(1,s[v]=i[v],s),t(0,i[v]=null,i)},g=v=>{var S;return(S=r[v])==null?void 0:S.focus()};function y(v,S){he[v?"unshift":"push"](()=>{r[S]=v,t(3,r)})}function b(v,S){n.$$.not_equal(i[S],v)&&(i[S]=v,t(0,i))}return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},[i,s,l,r,o,a,u,c,d,h,g,y,b]}class KM extends Fe{constructor(e){super(),Le(this,e,YM,WM,Ae,{collection:0})}}function Zp(n,e,t){const i=n.slice();return i[14]=e[t],i}function xp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xp(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 Qp(n){let e,t,i,s,l=n[1].originalName+"",r,o,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=H(`Renamed collection
|
||||
`),s=_("strong"),r=H(l),o=O(),a=_("i"),u=O(),f=_("strong"),d=H(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,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,r),m(t,o),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&_e(r,l),g&2&&c!==(c=h[1].name+"")&&_e(d,c)},d(h){h&&k(e)}}}function eh(n){let e,t,i,s,l=n[14].originalName+"",r,o,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=H(`Renamed field
|
||||
`),s=_("strong"),r=H(l),o=O(),a=_("i"),u=O(),f=_("strong"),d=H(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,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,r),m(t,o),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&_e(r,l),g&16&&c!==(c=h[14].name+"")&&_e(d,c)},d(h){h&&k(e)}}}function th(n){let e,t,i,s=n[14].name+"",l,r;return{c(){e=_("li"),t=H("Removed field "),i=_("span"),l=H(s),r=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(o,a){w(o,e,a),m(e,t),m(e,i),m(i,l),m(e,r)},p(o,a){a&8&&s!==(s=o[14].name+"")&&_e(l,s)},d(o){o&&k(e)}}}function JM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h=n[3].length&&Xp(),g=n[5]&&Qp(n),y=n[4],b=[];for(let $=0;$<y.length;$+=1)b[$]=eh(xp(n,y,$));let v=n[3],S=[];for(let $=0;$<v.length;$+=1)S[$]=th(Zp(n,v,$));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),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!`,r=O(),h&&h.c(),o=O(),a=_("h6"),a.textContent="Changes:",u=O(),f=_("ul"),g&&g.c(),c=O();for(let $=0;$<b.length;$+=1)b[$].c();d=O();for(let $=0;$<S.length;$+=1)S[$].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m($,C){w($,e,C),m(e,t),m(e,i),m(e,s),m(s,l),m(s,r),h&&h.m(s,null),w($,o,C),w($,a,C),w($,u,C),w($,f,C),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<S.length;M+=1)S[M].m(f,null)},p($,C){if($[3].length?h||(h=Xp(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),$[5]?g?g.p($,C):(g=Qp($),g.c(),g.m(f,c)):g&&(g.d(1),g=null),C&16){y=$[4];let M;for(M=0;M<y.length;M+=1){const T=xp($,y,M);b[M]?b[M].p(T,C):(b[M]=eh(T),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=y.length}if(C&8){v=$[3];let M;for(M=0;M<v.length;M+=1){const T=Zp($,v,M);S[M]?S[M].p(T,C):(S[M]=th(T),S[M].c(),S[M].m(f,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=v.length}},d($){$&&k(e),h&&h.d(),$&&k(o),$&&k(a),$&&k(u),$&&k(f),g&&g.d(),Bn(b,$),Bn(S,$)}}}function GM(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function ZM(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),e.focus(),s||(l=[X(e,"click",n[8]),X(i,"click",n[9])],s=!0)},p:re,d(r){r&&k(e),r&&k(t),r&&k(i),s=!1,rt(l)}}}function xM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[ZM],header:[GM],default:[JM]},$$scope:{ctx:n}};return e=new Di({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const r={};l&524346&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[10](null),z(e,s)}}}function XM(n,e,t){let i,s,l;const r=_n();let o,a;async function u(v){t(1,a=v),await Mi(),!i&&!s.length&&!l.length?c():o==null||o.show()}function f(){o==null||o.hide()}function c(){f(),r("confirm")}const d=()=>f(),h=()=>c();function g(v){he[v?"unshift":"push"](()=>{o=v,t(2,o)})}function y(v){ut.call(this,n,v)}function b(v){ut.call(this,n,v)}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(v=>v.id&&!v.toDelete&&v.originalName!=v.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(v=>v.id&&v.toDelete))||[])},[f,a,o,l,s,i,c,u,d,h,g,y,b]}class QM extends Fe{constructor(e){super(),Le(this,e,XM,xM,Ae,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function nh(n){let e,t,i,s;function l(o){n[26](o)}let r={};return n[2]!==void 0&&(r.collection=n[2]),t=new KM({props:r}),he.push(()=>Re(t,"collection",l)),{c(){e=_("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(o,a){w(o,e,a),V(t,e,null),s=!0},p(o,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=o[2],je(()=>i=!1)),t.$set(u)},i(o){s||(A(t.$$.fragment,o),s=!0)},o(o){F(t.$$.fragment,o),s=!1},d(o){o&&k(e),z(t)}}}function eO(n){let e,t,i,s,l,r;function o(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new IM({props:a}),he.push(()=>Re(i,"collection",o));let u=n[9]===Bl&&nh(n);return{c(){e=_("div"),t=_("div"),B(i.$$.fragment),l=O(),u&&u.c(),p(t,"class","tab-item"),Q(t,"active",n[9]===hs),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),V(i,t,null),m(e,l),u&&u.m(e,null),r=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],je(()=>s=!1)),i.$set(d),c[0]&512&&Q(t,"active",f[9]===hs),f[9]===Bl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=nh(f),u.c(),A(u,1),u.m(e,null)):u&&(Oe(),F(u,1,1,()=>{u=null}),Te())},i(f){r||(A(i.$$.fragment,f),A(u),r=!0)},o(f){F(i.$$.fragment,f),F(u),r=!1},d(f){f&&k(e),z(i),u&&u.d()}}}function ih(n){let e,t,i,s,l,r,o;return r=new ys({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[tO]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=O(),i=_("button"),s=_("i"),l=O(),B(r.$$.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),m(i,s),m(i,l),V(r,i,null),o=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),r.$set(f)},i(a){o||(A(r.$$.fragment,a),o=!0)},o(a){F(r.$$.fragment,a),o=!1},d(a){a&&k(e),a&&k(t),a&&k(i),z(r)}}}function tO(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function sh(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 nO(n){let e,t,i,s,l,r,o,a,u,f,c,d,h=n[2].system&&sh();return{c(){e=_("label"),t=H("Name"),s=O(),l=_("input"),u=O(),h&&h.c(),f=lt(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",r=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=o=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,y){w(g,e,y),m(e,t),w(g,s,y),w(g,l,y),w(g,u,y),h&&h.m(g,y),w(g,f,y),n[2].isNew&&l.focus(),c||(d=X(l,"input",n[21]),c=!0)},p(g,y){y[1]&128&&i!==(i=g[38])&&p(e,"for",i),y[1]&128&&r!==(r=g[38])&&p(l,"id",r),y[0]&2048&&(l.disabled=g[11]),y[0]&4&&o!==(o=g[2].isNew)&&(l.autofocus=o),y[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=sh(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function lh(n){let e,t,i,s,l,r;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,a){w(o,e,a),s=!0,l||(r=Xe(t=St.call(null,e,n[12])),l=!0)},p(o,a){t&&Jn(t.update)&&a[0]&4096&&t.update.call(null,o[12])},i(o){s||(o&&Dt(()=>{i||(i=ft(e,Wn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(o){o&&(i||(i=ft(e,Wn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(o){o&&k(e),o&&i&&i.end(),l=!1,r()}}}function rh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,o){w(r,e,o),i=!0,s||(l=Xe(St.call(null,e,"Has errors")),s=!0)},i(r){i||(r&&Dt(()=>{t||(t=ft(e,Wn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(r){r&&(t||(t=ft(e,Wn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(r){r&&k(e),r&&t&&t.end(),s=!1,l()}}}function iO(n){var N,R,J,W,q,G;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,r,o,a,u,f,c,d,h,g,y=!U.isEmpty((N=n[4])==null?void 0:N.schema),b,v,S,$,C=!U.isEmpty((R=n[4])==null?void 0:R.listRule)||!U.isEmpty((J=n[4])==null?void 0:J.viewRule)||!U.isEmpty((W=n[4])==null?void 0:W.createRule)||!U.isEmpty((q=n[4])==null?void 0:q.updateRule)||!U.isEmpty((G=n[4])==null?void 0:G.deleteRule),M,T,E,D=!n[2].isNew&&!n[2].system&&ih(n);o=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[nO,({uniqueId:K})=>({38:K}),({uniqueId:K})=>[0,K?128:0]]},$$scope:{ctx:n}}});let P=y&&lh(n),L=C&&rh();return{c(){e=_("h4"),i=H(t),s=O(),D&&D.c(),l=O(),r=_("form"),B(o.$$.fragment),a=O(),u=_("input"),f=O(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=O(),P&&P.c(),b=O(),v=_("button"),S=_("span"),S.textContent="API Rules",$=O(),L&&L.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(r,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[9]===hs),p(S,"class","txt"),p(v,"type","button"),p(v,"class","tab-item"),Q(v,"active",n[9]===Bl),p(c,"class","tabs-header stretched")},m(K,Y){w(K,e,Y),m(e,i),w(K,s,Y),D&&D.m(K,Y),w(K,l,Y),w(K,r,Y),V(o,r,null),m(r,a),m(r,u),w(K,f,Y),w(K,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,v),m(v,S),m(v,$),L&&L.m(v,null),M=!0,T||(E=[X(r,"submit",Kt(n[22])),X(d,"click",n[23]),X(v,"click",n[24])],T=!0)},p(K,Y){var fe,ye,se,Z,De,te;(!M||Y[0]&4)&&t!==(t=K[2].isNew?"New collection":"Edit collection")&&_e(i,t),!K[2].isNew&&!K[2].system?D?(D.p(K,Y),Y[0]&4&&A(D,1)):(D=ih(K),D.c(),A(D,1),D.m(l.parentNode,l)):D&&(Oe(),F(D,1,1,()=>{D=null}),Te());const ne={};Y[0]&2048&&(ne.class="form-field required m-b-0 "+(K[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(ne.$$scope={dirty:Y,ctx:K}),o.$set(ne),Y[0]&16&&(y=!U.isEmpty((fe=K[4])==null?void 0:fe.schema)),y?P?(P.p(K,Y),Y[0]&16&&A(P,1)):(P=lh(K),P.c(),A(P,1),P.m(d,null)):P&&(Oe(),F(P,1,1,()=>{P=null}),Te()),Y[0]&512&&Q(d,"active",K[9]===hs),Y[0]&16&&(C=!U.isEmpty((ye=K[4])==null?void 0:ye.listRule)||!U.isEmpty((se=K[4])==null?void 0:se.viewRule)||!U.isEmpty((Z=K[4])==null?void 0:Z.createRule)||!U.isEmpty((De=K[4])==null?void 0:De.updateRule)||!U.isEmpty((te=K[4])==null?void 0:te.deleteRule)),C?L?Y[0]&16&&A(L,1):(L=rh(),L.c(),A(L,1),L.m(v,null)):L&&(Oe(),F(L,1,1,()=>{L=null}),Te()),Y[0]&512&&Q(v,"active",K[9]===Bl)},i(K){M||(A(D),A(o.$$.fragment,K),A(P),A(L),M=!0)},o(K){F(D),F(o.$$.fragment,K),F(P),F(L),M=!1},d(K){K&&k(e),K&&k(s),D&&D.d(K),K&&k(l),K&&k(r),z(o),K&&k(f),K&&k(c),P&&P.d(),L&&L.d(),T=!1,rt(E)}}}function sO(n){let e,t,i,s,l,r=n[2].isNew?"Create":"Save changes",o,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=O(),s=_("button"),l=_("span"),o=H(r),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],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,o),u||(f=[X(e,"click",n[18]),X(s,"click",n[19])],uLine truncated
|
||||
<span class="txt">New collection</span>`,v=O(),B(S.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),Q(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(i,"class","form-field search"),Q(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(y,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(L,N){w(L,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,r),m(i,o),$e(o,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let R=0;R<d.length;R+=1)d[R].m(c,null);D&&D.m(c,null),m(e,g),m(e,y),m(y,b),w(L,v,N),V(S,L,N),$=!0,C||(M=[X(l,"click",n[8]),X(o,"input",n[9]),X(b,"click",n[11])],C=!0)},p(L,[N]){N&16&&Q(l,"hidden",!L[4]),N&1&&o.value!==L[0]&&$e(o,L[0]),N&16&&Q(i,"active",L[4]),N&106&&(T=L[3],d=ot(d,N,E,1,L,T,h,c,an,fh,null,oh),!T.length&&D?D.p(L,N):T.length?D&&(D.d(1),D=null):(D=ah(L),D.c(),D.m(c,null)));const R={};S.$set(R)},i(L){$||(A(S.$$.fragment,L),$=!0)},o(L){F(S.$$.fragment,L),$=!1},d(L){L&&k(e);for(let N=0;N<d.length;N+=1)d[N].d();D&&D.d(),L&&k(v),n[12](null),z(S,L),C=!1,rt(M)}}}function fO(n,e,t){let i,s,l,r,o;hn(n,fi,b=>t(5,r=b)),hn(n,Js,b=>t(7,o=b));let a,u="";function f(b){qg(fi,r=b,r)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),g=()=>a==null?void 0:a.show();function y(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=o.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,r,f,o,c,d,h,g,y]}class cO extends Fe{constructor(e){super(),Le(this,e,fO,uO,Ae,{})}}function dO(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$,C,M,T,E,D,P,L,N,R,J,W,q,G,K,Y,ne,fe,ye,se,Z,De,te,be,ue,ie,ve,He,Ie,qe,oe,le,ke,Ve;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||||
<code><span class="txt-success">OPERAND</span>
|
||||
<span class="txt-danger">OPERATOR</span>
|
||||
<span class="txt-success">OPERAND</span></code>, where:`,t=O(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||||
quoted), number, null, true, false`,l=O(),r=_("li"),o=_("code"),o.textContent="OPERATOR",a=H(` - is one of:
|
||||
`),u=_("br"),f=O(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=O(),y=_("span"),y.textContent="Equal",b=O(),v=_("li"),S=_("code"),S.textContent="!=",$=O(),C=_("span"),C.textContent="NOT equal",M=O(),T=_("li"),E=_("code"),E.textContent=">",D=O(),P=_("span"),P.textContent="Greater than",L=O(),N=_("li"),R=_("code"),R.textContent=">=",J=O(),W=_("span"),W.textContent="Greater than or equal",q=O(),G=_("li"),K=_("code"),K.textContent="<",Y=O(),ne=_("span"),ne.textContent="Less than or equal",fe=O(),ye=_("li"),se=_("code"),se.textContent="<=",Z=O(),De=_("span"),De.textContent="Less than or equal",te=O(),be=_("li"),ue=_("code"),ue.textContent="~",ie=O(),ve=_("span"),ve.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||||
match)`,He=O(),Ie=_("li"),qe=_("code"),qe.textContent="!~",oe=O(),le=_("span"),le.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ke=O(),Ve=_("p"),Ve.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(o,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(y,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p(C,"class","txt-hint"),p(E,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(R,"class","filter-op svelte-1w7s5nw"),p(W,"class","txt-hint"),p(K,"class","filter-op svelte-1w7s5nw"),p(ne,"class","txt-hint"),p(se,"class","filter-op svelte-1w7s5nw"),p(De,"class","txt-hint"),p(ue,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(qe,"class","filter-op svelte-1w7s5nw"),p(le,"class","txt-hint")},m(ze,Ze){w(ze,e,Ze),w(ze,t,Ze),w(ze,i,Ze),m(i,s),m(i,l),m(i,r),m(r,o),m(r,a),m(r,u),m(r,f),m(r,c),m(c,d),m(d,h),m(d,g),m(d,y),m(c,b),m(c,v),m(v,S),m(v,$),m(v,C),m(c,M),m(c,T),m(T,E),m(T,D),m(T,P),m(c,L),m(c,N),m(N,R),m(N,J),m(N,W),m(c,q),m(c,G),m(G,K),m(G,Y),m(G,ne),m(c,fe),m(c,ye),m(ye,se),m(ye,Z),m(ye,De),m(c,te),m(c,be),m(be,ue),m(be,ie),m(be,ve),m(c,He),m(c,Ie),m(Ie,qe),m(Ie,oe),m(Ie,le),w(ze,ke,Ze),w(ze,Ve,Ze)},p:re,i:re,o:re,d(ze){ze&&k(e),ze&&k(t),ze&&k(i),ze&&k(ke),ze&&k(Ve)}}}class pO extends Fe{constructor(e){super(),Le(this,e,null,dO,Ae,{})}}function ch(n,e,t){const i=n.slice();return i[8]=e[t],i}function dh(n,e,t){const i=n.slice();return i[8]=e[t],i}function ph(n,e,t){const i=n.slice();return i[13]=e[t],i}function hh(n,e,t){const i=n.slice();return i[13]=e[t],i}function mh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function gh(n,e){let t,i=e[13].lang+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&Q(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function _h(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&Q(t,"active",e[3]===e[13].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function bh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&36&&Q(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function yh(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&Q(t,"active",e[2]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function hO(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v=n[0].name+"",S,$,C,M,T,E,D,P=[],L=new Map,N,R,J=[],W=new Map,q,G,K,Y,ne,fe,ye,se,Z,De,te,be,ue,ie,ve,He,Ie,qe,oe,le,ke,Ve,ze,Ze,ge,Ee,x,ae,Be,vt,it,gt,at,yt,zt,Mt,Ot,me,Ce,Ke,st,fn,ce,Se,xe,Gt,qt,ii,pe,I,j,ee,de,Pe,We,tt,Je,nt=[],Ge=new Map,et,_t,Ft=[],tn=new Map,In,Bt=n[1]&&mh(),ws=n[4];const Ss=Me=>Me[13].lang;for(let Me=0;Me<ws.length;Me+=1){let Ye=hh(n,ws,Me),At=Ss(Ye);L.set(At,P[Me]=gh(At,Ye))}let Ji=n[4];const ir=Me=>Me[13].lang;for(let Me=0;Me<Ji.length;Me+=1){let Ye=ph(n,Ji,Me),At=ir(Ye);W.set(At,J[Me]=_h(At,Ye))}ge=new en({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),yt=new en({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),Mt=new pO({}),xe=new en({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let $s=n[5];const sr=Me=>Me[8].code;for(let Me=0;Me<$s.length;Me+=1){let Ye=dh(n,$s,Me),At=sr(Ye);Ge.set(At,nt[Me]=bh(At,Ye))}let Gi=n[5];const lr=Me=>Me[8].code;for(let Me=0;Me<Gi.length;Me+=1){let Ye=ch(n,Gi,Me),At=lr(Ye);tn.set(At,Ft[Me]=yh(At,Ye))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records"),c=O(),Bt&&Bt.c(),d=O(),h=_("div"),g=_("p"),y=H("Fetch a paginated "),b=_("strong"),S=H(v),$=H(" records list."),C=O(),M=_("div"),M.textContent="Client SDKs example",T=O(),E=_("div"),D=_("div");for(let Me=0;Me<P.length;Me+=1)P[Me].c();N=O(),R=_("div");for(let Me=0;Me<J.length;Me+=1)J[Me].c();q=O(),G=_("div"),G.textContent="Query parameters",K=O(),Y=_("table"),ne=_("thead"),ne.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,fe=O(),ye=_("tbody"),se=_("tr"),se.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,Z=O(),De=_("tr"),De.innerHTML=`<td>perPage</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>Specify the max returned records per page (default to 30).</td>`,te=O(),be=_("tr"),ue=_("td"),ue.textContent="sort",ie=O(),ve=_("td"),ve.innerHTML='<span class="label">String</span>',He=O(),Ie=_("td"),qe=H("Specify the records order attribute(s). "),oe=_("br"),le=H(`
|
||||
Add `),ke=_("code"),ke.textContent="-",Ve=H(" / "),ze=_("code"),ze.textContent="+",Ze=H(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),B(ge.$$.fragment),Ee=O(),x=_("tr"),ae=_("td"),ae.textContent="filter",Be=O(),vt=_("td"),vt.innerHTML='<span class="label">String</span>',it=O(),gt=_("td"),at=H(`Filter the returned records. Ex.:
|
||||
`),B(yt.$$.fragment),zt=O(),B(Mt.$$.fragment),Ot=O(),me=_("tr"),Ce=_("td"),Ce.textContent="expand",Ke=O(),st=_("td"),st.innerHTML='<span class="label">String</span>',fn=O(),ce=_("td"),Se=H(`Auto expand nested record relations. Ex.:
|
||||
`),B(xe.$$.fragment),Gt=H(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),qt=_("br"),ii=H(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),pe=_("code"),pe.textContent="@expand",I=H(" property (eg. "),j=_("code"),j.textContent='"@expand": {"rel1": {...}, ...}',ee=H(")."),de=O(),Pe=_("div"),Pe.textContent="Responses",We=O(),tt=_("div"),Je=_("div");for(let Me=0;Me<nt.length;Me+=1)nt[Me].c();et=O(),_t=_("div");for(let Me=0;Me<Ft.length;Me+=1)Ft[Me].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(D,"class","tabs-header compact left"),p(R,"class","tabs-content"),p(E,"class","tabs m-b-lg"),p(G,"class","section-title"),p(Y,"class","table-compact table-border m-b-lg"),p(Pe,"class","section-title"),p(Je,"class","tabs-header compact left"),p(_t,"class","tabs-content"),p(tt,"class","tabs")},m(Me,Ye){w(Me,e,Ye),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(e,c),Bt&&Bt.m(e,null),w(Me,d,Ye),w(Me,h,Ye),m(h,g),m(g,y),m(g,b),m(b,S),m(g,$),w(Me,C,Ye),w(Me,M,Ye),w(Me,T,Ye),w(Me,E,Ye),m(E,D);for(let At=0;At<P.length;At+=1)P[At].m(D,null);m(E,N),m(E,R);for(let At=0;At<J.length;At+=1)J[At].m(R,null);w(Me,q,Ye),w(Me,G,Ye),w(Me,K,Ye),w(Me,Y,Ye),m(Y,ne),m(Y,fe),m(Y,ye),m(ye,se),m(ye,Z),m(ye,De),m(ye,te),m(ye,be),m(be,ue),m(be,ie),m(be,ve),m(be,He),m(be,Ie),m(Ie,qe),m(Ie,oe),m(Ie,le),m(Ie,ke),m(Ie,Ve),m(Ie,ze),m(Ie,Ze),V(ge,Ie,null),m(ye,Ee),m(ye,x),m(x,ae),m(x,Be),m(x,vt),m(x,it),m(x,gt),m(gt,at),V(yt,gt,null),m(gt,zt),V(Mt,gt,null),m(ye,Ot),m(ye,me),m(me,Ce),m(me,Ke),m(me,st),m(me,fn),m(me,ce),m(ce,Se),V(xe,ce,null),m(ce,Gt),m(ce,qt),m(ce,ii),m(ce,pe),m(ce,I),m(ce,j),m(ce,ee),w(Me,de,Ye),w(Me,Pe,Ye),w(Me,We,Ye),w(Me,tt,Ye),m(tt,Je);for(let At=0;At<nt.length;At+=1)nt[At].m(Je,null);m(tt,et),m(tt,_t);for(let At=0;At<Ft.length;At+=1)Ft[At].m(_t,null);In=!0},p(Me,[Ye]){(!In||Ye&1)&&a!==(a=Me[0].name+"")&&_e(u,a),Me[1]?Bt||(Bt=mh(),Bt.c(),Bt.m(e,null)):Bt&&(Bt.d(1),Bt=null),(!In||Ye&1)&&v!==(v=Me[0].name+"")&&_e(S,v),Ye&24&&(ws=Me[4],P=ot(P,Ye,Ss,1,Me,ws,L,D,an,gh,null,hh)),Ye&24&&(Ji=Me[4],Oe(),J=ot(J,Ye,ir,1,Me,Ji,W,R,Lt,_h,null,ph),Te()),Ye&36&&($s=Me[5],nt=ot(nt,Ye,sr,1,Me,$s,Ge,Je,an,bh,null,dh)),Ye&36&&(Gi=Me[5],Oe(),Ft=ot(Ft,Ye,lr,1,Me,Gi,tn,_t,Lt,yh,null,ch),Te())},i(Me){if(!In){for(let Ye=0;Ye<Ji.length;Ye+=1)A(J[Ye]);A(ge.$$.fragment,Me),A(yt.$$.fragment,Me),A(Mt.$$.fragment,Me),A(xe.$$.fragment,Me);for(let Ye=0;Ye<Gi.length;Ye+=1)A(Ft[Ye]);In=!0}},o(Me){for(let Ye=0;Ye<J.length;Ye+=1)F(J[Ye]);F(ge.$$.fragment,Me),F(yt.$$.fragment,Me),F(Mt.$$.fragment,Me),F(xe.$$.fragment,Me);for(let Ye=0;Ye<Ft.length;Ye+=1)F(Ft[Ye]);In=!1},d(Me){Me&&k(e),Bt&&Bt.d(),Me&&k(d),Me&&k(h),Me&&k(C),Me&&k(M),Me&&k(T),Me&&k(E);for(let Ye=0;Ye<P.length;Ye+=1)P[Ye].d();for(let Ye=0;Ye<J.length;Ye+=1)J[Ye].d();Me&&k(q),Me&&k(G),Me&&k(K),Me&&k(Y),z(ge),z(yt),z(Mt),z(xe),Me&&k(de),Me&&k(Pe),Me&&k(We),Me&&k(tt);for(let Ye=0;Ye<nt.length;Ye+=1)nt[Ye].d();for(let Ye=0;Ye<Ft.length;Ye+=1)Ft[Ye].d()}}}function mO(n,e,t){let i,{collection:s=new Ln}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[U.dummyCollectionRecord(s),U.dummyCollectionRecord(s)]},null,2)}),o.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&o.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),o.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${we.baseUrl}");
|
||||
|
||||
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
|
||||
.then(function (list) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */);
|
||||
.then(function (records) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,r,a,o,u,f]}class gO extends Fe{constructor(e){super(),Le(this,e,mO,hO,Ae,{collection:0})}}function vh(n,e,t){const i=n.slice();return i[8]=e[t],i}function kh(n,e,t){const i=n.slice();return i[8]=e[t],i}function wh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[13]=e[t],i}function $h(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ch(n,e){let t,i=e[13].lang+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&Q(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function Mh(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&Q(t,"active",e[3]===e[13].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function Oh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&36&&Q(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Th(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&Q(t,"active",e[2]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function _O(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,S=n[0].name+"",$,C,M,T,E,D,P,L=[],N=new Map,R,J,W=[],q=new Map,G,K,Y,ne,fe,ye,se,Z,De,te,be,ue,ie,ve,He,Ie,qe,oe,le,ke,Ve,ze,Ze,ge,Ee,x,ae,Be,vt,it,gt,at=[],yt=new Map,zt,Mt,Ot=[],me=new Map,Ce,Ke=n[1]&&$h(),st=n[4];const fn=pe=>pe[13].lang;for(let pe=0;pe<st.length;pe+=1){let I=Sh(n,st,pe),j=fn(I);N.set(j,L[pe]=Ch(j,I))}let ce=n[4];const Se=pe=>pe[13].lang;for(let pe=0;pe<ce.length;pe+=1){let I=wh(n,ce,pe),j=Se(I);q.set(j,W[pe]=Mh(j,I))}le=new en({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let xe=n[5];const Gt=pe=>pe[8].code;for(let pe=0;pe<xe.length;pe+=1){let I=kh(n,xe,pe),j=Gt(I);yt.set(j,at[pe]=Oh(j,I))}let qt=n[5];const ii=pe=>pe[8].code;for(let pe=0;pe<qt.length;pe+=1){let I=vh(n,qt,pe),j=ii(I);me.set(j,Ot[pe]=Th(j,I))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),Ke&&Ke.c(),h=O(),g=_("div"),y=_("p"),b=H("Fetch a single "),v=_("strong"),$=H(S),C=H(" record."),M=O(),T=_("div"),T.textContent="Client SDKs example",E=O(),D=_("div"),P=_("div");for(let pe=0;pe<L.length;pe+=1)L[pe].c();R=O(),J=_("div");for(let pe=0;pe<W.length;pe+=1)W[pe].c();G=O(),K=_("div"),K.textContent="Path Parameters",Y=O(),ne=_("table"),ne.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,fe=O(),ye=_("div"),ye.textContent="Query parameters",se=O(),Z=_("table"),De=_("thead"),De.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,te=O(),be=_("tbody"),ue=_("tr"),ie=_("td"),ie.textContent="expand",ve=O(),He=_("td"),He.innerHTML='<span class="label">String</span>',Ie=O(),qe=_("td"),oe=H(`Auto expand nested record relations. Ex.:
|
||||
`),B(le.$$.fragment),ke=H(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Ve=_("br"),ze=H(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Ze=_("code"),Ze.textContent="@expand",ge=H(" property (eg. "),Ee=_("code"),Ee.textContent='"@expand": {"rel1": {...}, ...}',x=H(")."),ae=O(),Be=_("div"),Be.textContent="Responses",vt=O(),it=_("div"),gt=_("div");for(let pe=0;pe<at.length;pe+=1)at[pe].c();zt=O(),Mt=_("div");for(let pe=0;pe<Ot.length;pe+=1)Ot[pe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","tabs-header compact left"),p(J,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(K,"class","section-title"),p(ne,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(Z,"class","table-compact table-border m-b-lg"),p(Be,"class","section-title"),p(gt,"class","tabs-header compact left"),p(Mt,"class","tabs-content"),p(it,"class","tabs")},m(pe,I){w(pe,e,I),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),Ke&&Ke.m(e,null),w(pe,h,I),w(pe,g,I),m(g,y),m(y,b),m(y,v),m(v,$),m(y,C),w(pe,M,I),w(pe,T,I),w(pe,E,I),w(pe,D,I),m(D,P);for(let j=0;j<L.length;j+=1)L[j].m(P,null);m(D,R),m(D,J);for(let j=0;j<W.length;j+=1)W[j].m(J,null);w(pe,G,I),w(pe,K,I),w(pe,Y,I),w(pe,ne,I),w(pe,fe,I),w(pe,ye,I),w(pe,se,I),w(pe,Z,I),m(Z,De),m(Z,te),m(Z,be),m(be,ue),m(ue,ie),m(ue,ve),m(ue,He),m(ue,Ie),m(ue,qe),m(qe,oe),V(le,qe,null),m(qe,ke),m(qe,Ve),m(qe,ze),m(qe,Ze),m(qe,ge),m(qe,Ee),m(qe,x),w(pe,ae,I),w(pe,Be,I),w(pe,vt,I),w(pe,it,I),m(it,gt);for(let j=0;j<at.length;j+=1)at[j].m(gt,null);m(it,zt),m(it,Mt);for(let j=0;j<Ot.length;j+=1)Ot[j].m(Mt,null);Ce=!0},p(pe,[I]){(!Ce||I&1)&&a!==(a=pe[0].name+"")&&_e(u,a),pe[1]?Ke||(Ke=$h(),Ke.c(),Ke.m(e,null)):Ke&&(Ke.d(1),Ke=null),(!Ce||I&1)&&S!==(S=pe[0].name+"")&&_e($,S),I&24&&(st=pe[4],L=ot(L,I,fn,1,pe,st,N,P,an,Ch,null,Sh)),I&24&&(ce=pe[4],Oe(),W=ot(W,I,Se,1,pe,ce,q,J,Lt,Mh,null,wh),Te()),I&36&&(xe=pe[5],at=ot(at,I,Gt,1,pe,xe,yt,gt,an,Oh,null,kh)),I&36&&(qt=pe[5],Oe(),Ot=ot(Ot,I,ii,1,pe,qt,me,Mt,Lt,Th,null,vh),Te())},i(pe){if(!Ce){for(let I=0;I<ce.length;I+=1)A(W[I]);A(le.$$.fragment,pe);for(let I=0;I<qt.length;I+=1)A(Ot[I]);Ce=!0}},o(pe){for(let I=0;I<W.length;I+=1)F(W[I]);F(le.$$.fragment,pe);for(let I=0;I<Ot.length;I+=1)F(Ot[I]);Ce=!1},d(pe){pe&&k(e),Ke&&Ke.d(),pe&&k(h),pe&&k(g),pe&&k(M),pe&&k(T),pe&&k(E),pe&&k(D);for(let I=0;I<L.length;I+=1)L[I].d();for(let I=0;I<W.length;I+=1)W[I].d();pe&&k(G),pe&&k(K),pe&&k(Y),pe&&k(ne),pe&&k(fe),pe&&k(ye),pe&&k(se),pe&&k(Z),z(le),pe&&k(ae),pe&&k(Be),pe&&k(vt),pe&&k(it);for(let I=0;I<at.length;I+=1)at[I].d();for(let I=0;I<Ot.length;I+=1)Ot[I].d()}}}function bO(n,e,t){let i,{collection:s=new Ln}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)}),i&&o.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),o.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${we.baseUrl}");
|
||||
|
||||
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,r,a,o,u,f]}class yO extends Fe{constructor(e){super(),Le(this,e,bO,_O,Ae,{collection:0})}}function Dh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[8]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ph(n,e,t){const i=n.slice();return i[16]=e[t],i}function Lh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Fh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ih(n,e){let t,i=e[16].lang+"",s,l,r,o;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&_e(s,i),f&20&&Q(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),r=!1,o()}}}function Nh(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[16].code),i.$set(a),o&20&&Q(t,"active",e[2]===e[16].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function vO(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 kO(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 wO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("User "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function SO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("Relation record "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function $O(n){let e,t,i,s,l;return{c(){e=H("FormData object."),t=_("br"),i=H(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=H(" to delete already uploaded file(s).")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),w(r,s,o),w(r,l,o)},p:re,d(r){r&&k(e),r&&k(t),r&&k(i),r&&k(s),r&&k(l)}}}function CO(n){let e;return{c(){e=H("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function MO(n){let e;return{c(){e=H("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function OO(n){let e;return{c(){e=H("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function TO(n){let e;return{c(){e=H("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function DO(n){let e;return{c(){e=H("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Rh(n,e){let t,i,s,l,r,o=e[13].name+"",a,u,f,c,d=U.getFieldValueType(e[13])+"",h,g,y,b;function v(E,D){return E[13].required?kO:vO}let S=v(e),$=S(e);function C(E,D){if(E[13].type==="text")return DO;if(E[13].type==="number")return TO;if(E[13].type==="json")return OO;if(E[13].type==="email")return MO;if(E[13].type==="url")return CO;if(E[13].type==="file")return $O;if(E[13].type==="relation")return SO;if(E[13].type==="user")return wO}let M=C(e),T=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=O(),r=_("span"),a=H(o),u=O(),f=_("td"),c=_("span"),h=H(d),g=O(),y=_("td"),T&&T.c(),b=O(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,D){w(E,t,D),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,r),m(r,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,y),T&&T.m(y,null),m(t,b)},p(E,D){e=E,S!==(S=v(e))&&($.d(1),$=S(e),$&&($.c(),$.m(s,l))),D&1&&o!==(o=e[13].name+"")&&_e(a,o),D&1&&d!==(d=U.getFieldValueType(e[13])+"")&&_e(h,d),M===(M=C(e))&&T?T.p(e,D):(T&&T.d(1),T=M&&M(e),T&&(T.c(),T.m(y,null)))},d(E){E&&k(t),$.d(),T&&T.d()}}}function jh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&_e(s,i),f&10&&Q(t,"active",e[1]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Hh(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&8&&(a.content=e[8].body),i.$set(a),o&10&&Q(t,"active",e[1]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function AO(n){var Ot;let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v=n[0].name+"",S,$,C,M,T,E,D,P,L,N,R,J=[],W=new Map,q,G,K=[],Y=new Map,ne,fe,ye,se,Z,De,te,be=[],ue=new Map,ie,ve,He,Ie,qe,oe=[],le=new Map,ke,Ve,ze=[],Ze=new Map,ge,Ee=n[5]&&Fh(),x=n[4];const ae=me=>me[16].lang;for(let me=0;me<x.length;me+=1){let Ce=Lh(n,x,me),Ke=ae(Ce);W.set(Ke,J[me]=Ih(Ke,Ce))}let Be=n[4];const vt=me=>me[16].lang;for(let me=0;me<Be.length;me+=1){let Ce=Ph(n,Be,me),Ke=vt(Ce);Y.set(Ke,K[me]=Nh(Ke,Ce))}let it=(Ot=n[0])==null?void 0:Ot.schema;const gt=me=>me[13].name;for(let me=0;me<it.length;me+=1){let Ce=Eh(n,it,me),Ke=gt(Ce);ue.set(Ke,be[me]=Rh(Ke,Ce))}let at=n[3];const yt=me=>me[8].code;for(let me=0;me<at.length;me+=1){let Ce=Ah(n,at,me),Ke=yt(Ce);le.set(Ke,oe[me]=jh(Ke,Ce))}let zt=n[3];const Mt=me=>me[8].code;for(let me=0;me<zt.length;me+=1){let Ce=Dh(n,zt,me),Ke=Mt(Ce);Ze.set(Ke,ze[me]=Hh(Ke,Ce))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records"),c=O(),Ee&&Ee.c(),d=O(),h=_("div"),g=_("p"),y=H("Create a new "),b=_("strong"),S=H(v),$=H(" record."),C=O(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,T=O(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",D=O(),P=_("div"),P.textContent="Client SDKs example",L=O(),N=_("div"),R=_("div");for(let me=0;me<J.length;me+=1)J[me].c();q=O(),G=_("div");for(let me=0;me<K.length;me+=1)K[me].c();ne=O(),fe=_("div"),fe.textContent="Body Parameters",ye=O(),se=_("table"),Z=_("thead"),Z.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,De=O(),te=_("tbody");for(let me=0;me<be.length;me+=1)be[me].c();ie=O(),ve=_("div"),ve.textContent="Responses",He=O(),Ie=_("div"),qe=_("div");for(let me=0;me<oe.length;me+=1)oe[me].c();ke=O(),Ve=_("div");for(let me=0;me<ze.length;me+=1)ze[me].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(R,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(N,"class","tabs m-b-lg"),p(fe,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(qe,"class","tabs-header compact left"),p(Ve,"class","tabs-content"),p(Ie,"class","tabs")},m(me,Ce){w(me,e,Ce),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(e,c),Ee&&Ee.m(e,null),w(me,d,Ce),w(me,h,Ce),m(h,g),m(g,y),m(g,b),m(b,S),m(g,$),m(h,C),m(h,M),m(h,T),m(h,E),w(me,D,Ce),w(me,P,Ce),w(me,L,Ce),w(me,N,Ce),m(N,R);for(let Ke=0;Ke<J.length;Ke+=1)J[Ke].m(R,null);m(N,q),m(N,G);for(let Ke=0;Ke<K.length;Ke+=1)K[Ke].m(G,null);w(me,ne,Ce),w(me,fe,Ce),w(me,ye,Ce),w(me,se,Ce),m(se,Z),m(se,De),m(se,te);for(let Ke=0;Ke<be.length;Ke+=1)be[Ke].m(te,null);w(me,ie,Ce),w(me,ve,Ce),w(me,He,Ce),w(me,Ie,Ce),m(Ie,qe);for(let Ke=0;Ke<oe.length;Ke+=1)oe[Ke].m(qe,null);m(Ie,ke),m(Ie,Ve);for(let Ke=0;Ke<ze.length;Ke+=1)ze[Ke].m(Ve,null);ge=!0},p(me,[Ce]){var Ke;(!ge||Ce&1)&&a!==(a=me[0].name+"")&&_e(u,a),me[5]?Ee||(Ee=Fh(),Ee.c(),Ee.m(e,null)):Ee&&(Ee.d(1),Ee=null),(!ge||Ce&1)&&v!==(v=me[0].name+"")&&_e(S,v),Ce&20&&(x=me[4],J=ot(J,Ce,ae,1,me,x,W,R,an,Ih,null,Lh)),Ce&20&&(Be=me[4],Oe(),K=ot(K,Ce,vt,1,me,Be,Y,G,Lt,Nh,null,Ph),Te()),Ce&1&&(it=(Ke=me[0])==null?void 0:Ke.schema,be=ot(be,Ce,gt,1,me,it,ue,te,an,Rh,null,Eh)),Ce&10&&(at=me[3],oe=ot(oe,Ce,yt,1,me,at,le,qe,an,jh,null,Ah)),Ce&10&&(zt=me[3],Oe(),ze=ot(ze,Ce,Mt,1,me,zt,Ze,Ve,Lt,Hh,null,Dh),Te())},i(me){if(!ge){for(let Ce=0;Ce<Be.length;Ce+=1)A(K[Ce]);for(let Ce=0;Ce<zt.length;Ce+=1)A(ze[Ce]);ge=!0}},o(me){for(let Ce=0;Ce<K.length;Ce+=1)F(K[Ce]);for(let Ce=0;Ce<ze.length;Ce+=1)F(ze[Ce]);ge=!1},d(me){me&&k(e),Ee&&Ee.d(),me&&k(d),me&&k(h),me&&k(D),me&&k(P),me&&k(L),me&&k(N);for(let Ce=0;Ce<J.length;Ce+=1)J[Ce].d();for(let Ce=0;Ce<K.length;Ce+=1)K[Ce].d();me&&k(ne),me&&k(fe),me&&k(ye),me&&k(se);for(let Ce=0;Ce<be.length;Ce+=1)be[Ce].d();me&&k(ie),me&&k(ve),me&&k(He),me&&k(Ie);for(let Ce=0;Ce<oe.length;Ce+=1)oe[Ce].d();for(let Ce=0;Ce<ze.length;Ce+=1)ze[Ce].d()}}}function EO(n,e,t){let i,{collection:s=new Ln}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(2,r=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,o=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to create record.",
|
||||
"data": {
|
||||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${we.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.create("${s==null?void 0:s.name}", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,l,r,o,a,i,u,f]}class PO extends Fe{constructor(e){super(),Le(this,e,EO,AO,Ae,{collection:0})}}function qh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Vh(n,e,t){const i=n.slice();return i[8]=e[t],i}function zh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Bh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Wh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yh(n,e){let t,i=e[16].lang+"",s,l,r,o;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&_e(s,i),f&20&&Q(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),r=!1,o()}}}function Kh(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[16].code),i.$set(a),o&20&&Q(t,"active",e[2]===e[16].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function LO(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 FO(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 IO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("User "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function NO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("Relation record "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function RO(n){let e,t,i,s,l;return{c(){e=H("FormData object."),t=_("br"),i=H(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=H(" to delete already uploaded file(s).")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),w(r,s,o),w(r,l,o)},p:re,d(r){r&&k(e),r&&k(t),r&&k(i),r&&k(s),r&&k(l)}}}function jO(n){let e;return{c(){e=H("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function HO(n){let e;return{c(){e=H("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function qO(n){let e;return{c(){e=H("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function VO(n){let e;return{c(){e=H("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function zO(n){let e;return{c(){e=H("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Jh(n,e){let t,i,s,l,r,o=e[13].name+"",a,u,f,c,d=U.getFieldValueType(e[13])+"",h,g,y,b;function v(E,D){return E[13].required?FO:LO}let S=v(e),$=S(e);function C(E,D){if(E[13].type==="text")return zO;if(E[13].type==="number")return VO;if(E[13].type==="json")return qO;if(E[13].type==="email")return HO;if(E[13].type==="url")return jO;if(E[13].type==="file")return RO;if(E[13].type==="relation")return NO;if(E[13].type==="user")return IO}let M=C(e),T=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=O(),r=_("span"),a=H(o),u=O(),f=_("td"),c=_("span"),h=H(d),g=O(),y=_("td"),T&&T.c(),b=O(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,D){w(E,t,D),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,r),m(r,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,y),T&&T.m(y,null),m(t,b)},p(E,D){e=E,S!==(S=v(e))&&($.d(1),$=S(e),$&&($.c(),$.m(s,l))),D&1&&o!==(o=e[13].name+"")&&_e(a,o),D&1&&d!==(d=U.getFieldValueType(e[13])+"")&&_e(h,d),M===(M=C(e))&&T?T.p(e,D):(T&&T.d(1),T=M&&M(e),T&&(T.c(),T.m(y,null)))},d(E){E&&k(t),$.d(),T&&T.d()}}}function Gh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&_e(s,i),f&10&&Q(t,"active",e[1]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Zh(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&8&&(a.content=e[8].body),i.$set(a),o&10&&Q(t,"active",e[1]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function BO(n){var fn;let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,S=n[0].name+"",$,C,M,T,E,D,P,L,N,R,J,W=[],q=new Map,G,K,Y=[],ne=new Map,fe,ye,se,Z,De,te,be,ue,ie,ve,He,Ie=[],qe=new Map,oe,le,ke,Ve,ze,Ze=[],ge=new Map,Ee,x,ae=[],Be=new Map,vt,it=n[5]&&Wh(),gt=n[4];const at=ce=>ce[16].lang;for(let ce=0;ce<gt.length;ce+=1){let Se=Uh(n,gt,ce),xe=at(Se);q.set(xe,W[ce]=Yh(xe,Se))}let yt=n[4];const zt=ce=>ce[16].lang;for(let ce=0;ce<yt.length;ce+=1){let Se=Bh(n,yt,ce),xe=zt(Se);ne.set(xe,Y[ce]=Kh(xe,Se))}let Mt=(fn=n[0])==null?void 0:fn.schema;const Ot=ce=>ce[13].name;for(let ce=0;ce<Mt.length;ce+=1){let Se=zh(n,Mt,ce),xe=Ot(Se);qe.set(xe,Ie[ce]=Jh(xe,Se))}let me=n[3];const Ce=ce=>ce[8].code;for(let ce=0;ce<me.length;ce+=1){let Se=Vh(n,me,ce),xe=Ce(Se);ge.set(xe,Ze[ce]=Gh(xe,Se))}let Ke=n[3];const st=ce=>ce[8].code;for(let ce=0;ce<Ke.length;ce+=1){let Se=qh(n,Ke,ce),xe=st(Se);Be.set(xe,ae[ce]=Zh(xe,Se))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),it&&it.c(),h=O(),g=_("div"),y=_("p"),b=H("Update a single "),v=_("strong"),$=H(S),C=H(" record."),M=O(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,E=O(),D=_("p"),D.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=O(),L=_("div"),L.textContent="Client SDKs example",N=O(),R=_("div"),J=_("div");for(let ce=0;ce<W.length;ce+=1)W[ce].c();G=O(),K=_("div");for(let ce=0;ce<Y.length;ce+=1)Y[ce].c();fe=O(),ye=_("div"),ye.textContent="Path parameters",se=O(),Z=_("table"),Z.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to update.</td></tr></tbody>`,De=O(),te=_("div"),te.textContent="Body Parameters",be=O(),ue=_("table"),ie=_("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||||
<th width="60%">Type</th>
|
||||
<th width="50%">Description</th></tr>`,ve=O(),He=_("tbody");for(let ce=0;ce<Ie.length;ce+=1)Ie[ce].c();oe=O(),le=_("div"),le.textContent="Responses",ke=O(),Ve=_("div"),ze=_("div");for(let ce=0;ce<Ze.length;ce+=1)Ze[ce].c();Ee=O(),x=_("div");for(let ce=0;ce<ae.length;ce+=1)ae[ce].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(L,"class","section-title"),p(J,"class","tabs-header compact left"),p(K,"class","tabs-content"),p(R,"class","tabs m-b-lg"),p(ye,"class","section-title"),p(Z,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(ue,"class","table-compact table-border m-b-lg"),p(le,"class","section-title"),p(ze,"class","tabs-header compact left"),p(x,"class","tabs-content"),p(Ve,"class","tabs")},m(ce,Se){w(ce,e,Se),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),it&&it.m(e,null),w(ce,h,Se),w(ce,g,Se),m(g,y),m(y,b),m(y,v),m(v,$),m(y,C),m(g,M),m(g,T),m(g,E),m(g,D),w(ce,P,Se),w(ce,L,Se),w(ce,N,Se),w(ce,R,Se),m(R,J);for(let xe=0;xe<W.length;xe+=1)W[xe].m(J,null);m(R,G),m(R,K);for(let xe=0;xe<Y.length;xe+=1)Y[xe].m(K,null);w(ce,fe,Se),w(ce,ye,Se),w(ce,se,Se),w(ce,Z,Se),w(ce,De,Se),w(ce,te,Se),w(ce,be,Se),w(ce,ue,Se),m(ue,ie),m(ue,ve),m(ue,He);for(let xe=0;xe<Ie.length;xe+=1)Ie[xe].m(He,null);w(ce,oe,Se),w(ce,le,Se),w(ce,ke,Se),w(ce,Ve,Se),m(Ve,ze);for(let xe=0;xe<Ze.length;xe+=1)Ze[xe].m(ze,null);m(Ve,Ee),m(Ve,x);for(let xe=0;xe<ae.length;xe+=1)ae[xe].m(x,null);vt=!0},p(ce,[Se]){var xe;(!vt||Se&1)&&a!==(a=ce[0].name+"")&&_e(u,a),ce[5]?it||(it=Wh(),it.c(),it.m(e,null)):it&&(it.d(1),it=null),(!vt||Se&1)&&S!==(S=ce[0].name+"")&&_e($,S),Se&20&&(gt=ce[4],W=ot(W,Se,at,1,ce,gt,q,J,an,Yh,null,Uh)),Se&20&&(yt=ce[4],Oe(),Y=ot(Y,Se,zt,1,ce,yt,ne,K,Lt,Kh,null,Bh),Te()),Se&1&&(Mt=(xe=ce[0])==null?void 0:xe.schema,Ie=ot(Ie,Se,Ot,1,ce,Mt,qe,He,an,Jh,null,zh)),Se&10&&(me=ce[3],Ze=ot(Ze,Se,Ce,1,ce,me,ge,ze,an,Gh,null,Vh)),Se&10&&(Ke=ce[3],Oe(),ae=ot(ae,Se,st,1,ce,Ke,Be,x,Lt,Zh,null,qh),Te())},i(ce){if(!vt){for(let Se=0;Se<yt.length;Se+=1)A(Y[Se]);for(let Se=0;Se<Ke.length;Se+=1)A(ae[Se]);vt=!0}},o(ce){for(let Se=0;Se<Y.length;Se+=1)F(Y[Se]);for(let Se=0;Se<ae.length;Se+=1)F(ae[Se]);vt=!1},d(ce){ce&&k(e),it&&it.d(),ce&&k(h),ce&&k(g),ce&&k(P),ce&&k(L),ce&&k(N),ce&&k(R);for(let Se=0;Se<W.length;Se+=1)W[Se].d();for(let Se=0;Se<Y.length;Se+=1)Y[Se].d();ce&&k(fe),ce&&k(ye),ce&&k(se),ce&&k(Z),ce&&k(De),ce&&k(te),ce&&k(be),ce&&k(ue);for(let Se=0;Se<Ie.length;Se+=1)Ie[Se].d();ce&&k(oe),ce&&k(le),ce&&k(ke),ce&&k(Ve);for(let Se=0;Se<Ze.length;Se+=1)Ze[Se].d();for(let Se=0;Se<ae.length;Se+=1)ae[Se].d()}}}function UO(n,e,t){let i,{collection:s=new Ln}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(2,r=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,o=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
"data": {
|
||||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.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": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${we.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,l,r,o,a,i,u,f]}class WO extends Fe{constructor(e){super(),Le(this,e,UO,BO,Ae,{collection:0})}}function xh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[13]=e[t],i}function em(n,e,t){const i=n.slice();return i[13]=e[t],i}function tm(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nm(n,e){let t,i=e[13].lang+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&Q(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function im(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&Q(t,"active",e[3]===e[13].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function sm(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&36&&Q(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function lm(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&Q(t,"active",e[2]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function YO(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,S=n[0].name+"",$,C,M,T,E,D,P,L=[],N=new Map,R,J,W=[],q=new Map,G,K,Y,ne,fe,ye,se,Z,De,te=[],be=new Map,ue,ie,ve=[],He=new Map,Ie,qe=n[1]&&tm(),oe=n[4];const le=x=>x[13].lang;for(let x=0;x<oe.length;x+=1){let ae=em(n,oe,x),Be=le(ae);N.set(Be,L[x]=nm(Be,ae))}let ke=n[4];const Ve=x=>x[13].lang;for(let x=0;x<ke.length;x+=1){let ae=Qh(n,ke,x),Be=Ve(ae);q.set(Be,W[x]=im(Be,ae))}let ze=n[5];const Ze=x=>x[8].code;for(let x=0;x<ze.length;x+=1){let ae=Xh(n,ze,x),Be=Ze(ae);be.set(Be,te[x]=sm(Be,ae))}let ge=n[5];const Ee=x=>x[8].code;for(let x=0;x<ge.length;x+=1){let ae=xh(n,ge,x),Be=Ee(ae);He.set(Be,ve[x]=lm(Be,ae))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),qe&&qe.c(),h=O(),g=_("div"),y=_("p"),b=H("Delete a single "),v=_("strong"),$=H(S),C=H(" record."),M=O(),T=_("div"),T.textContent="Client SDKs example",E=O(),D=_("div"),P=_("div");for(let x=0;x<L.length;x+=1)L[x].c();R=O(),J=_("div");for(let x=0;x<W.length;x+=1)W[x].c();G=O(),K=_("div"),K.textContent="Path parameters",Y=O(),ne=_("table"),ne.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,fe=O(),ye=_("div"),ye.textContent="Responses",se=O(),Z=_("div"),De=_("div");for(let x=0;x<te.length;x+=1)te[x].c();ue=O(),ie=_("div");for(let x=0;x<ve.length;x+=1)ve[x].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","tabs-header compact left"),p(J,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(K,"class","section-title"),p(ne,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(De,"class","tabs-header compact left"),p(ie,"class","tabs-content"),p(Z,"class","tabs")},m(x,ae){w(x,e,ae),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),qe&&qe.m(e,null),w(x,h,ae),w(x,g,ae),m(g,y),m(y,b),m(y,v),m(v,$),m(y,C),w(x,M,ae),w(x,T,ae),w(x,E,ae),w(x,D,ae),m(D,P);for(let Be=0;Be<L.length;Be+=1)L[Be].m(P,null);m(D,R),m(D,J);for(let Be=0;Be<W.length;Be+=1)W[Be].m(J,null);w(x,G,ae),w(x,K,ae),w(x,Y,ae),w(x,ne,ae),w(x,fe,ae),w(x,ye,ae),w(x,se,ae),w(x,Z,ae),m(Z,De);for(let Be=0;Be<te.length;Be+=1)te[Be].m(De,null);m(Z,ue),m(Z,ie);for(let Be=0;Be<ve.length;Be+=1)ve[Be].m(ie,null);Ie=!0},p(x,[ae]){(!Ie||ae&1)&&a!==(a=x[0].name+"")&&_e(u,a),x[1]?qe||(qe=tm(),qe.c(),qe.m(e,null)):qe&&(qe.d(1),qe=null),(!Ie||ae&1)&&S!==(S=x[0].name+"")&&_e($,S),ae&24&&(oe=x[4],L=ot(L,ae,le,1,x,oe,N,P,an,nm,null,em)),ae&24&&(ke=x[4],Oe(),W=ot(W,ae,Ve,1,x,ke,q,J,Lt,im,null,Qh),Te()),ae&36&&(ze=x[5],te=ot(te,ae,Ze,1,x,ze,be,De,an,sm,null,Xh)),ae&36&&(ge=x[5],Oe(),ve=ot(ve,ae,Ee,1,x,ge,He,ie,Lt,lm,null,xh),Te())},i(x){if(!Ie){for(let ae=0;ae<ke.length;ae+=1)A(W[ae]);for(let ae=0;ae<ge.length;ae+=1)A(ve[ae]);Ie=!0}},o(x){for(let ae=0;ae<W.length;ae+=1)F(W[ae]);for(let ae=0;ae<ve.length;ae+=1)F(ve[ae]);Ie=!1},d(x){x&&k(e),qe&&qe.d(),x&&k(h),x&&k(g),x&&k(M),x&&k(T),x&&k(E),x&&k(D);for(let ae=0;ae<L.length;ae+=1)L[ae].d();for(let ae=0;ae<W.length;ae+=1)W[ae].d();x&&k(G),x&&k(K),x&&k(Y),x&&k(ne),x&&k(fe),x&&k(ye),x&&k(se),x&&k(Z);for(let ae=0;ae<te.length;ae+=1)te[ae].d();for(let ae=0;ae<ve.length;ae+=1)ve[ae].d()}}}function KO(n,e,t){let i,{collection:s=new Ln}=e,l=204,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:204,body:`
|
||||
null
|
||||
`}),o.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&&o.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),o.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${we.baseUrl}");
|
||||
|
||||
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
|
||||
.then(function () {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,r,a,o,u,f]}class JO extends Fe{constructor(e){super(),Le(this,e,KO,YO,Ae,{collection:0})}}function rm(n,e,t){const i=n.slice();return i[4]=e[t],i}function om(n,e,t){const i=n.slice();return i[4]=e[t],i}function am(n,e){let t,i=e[4].lang+"",s,l,r,o;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),Q(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=X(t,"click",a),r=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&_e(s,i),f&6&&Q(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),r=!1,o()}}}function um(n,e){let t,i,s,l;return i=new en({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),Q(t,"active",e[1]===e[4].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&4&&(a.content=e[4].code),i.$set(a),o&6&&Q(t,"active",e[1]===e[4].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function GO(n){let e,t,i,s,l,r,o,a,u=[],f=new Map,c,d,h=[],g=new Map,y,b,v,S,$,C=n[2];const M=D=>D[4].lang;for(let D=0;D<C.length;D+=1){let P=om(n,C,D),L=M(P);f.set(L,u[D]=am(L,P))}let T=n[2];const E=D=>D[4].lang;for(let D=0;D<T.length;D+=1){let P=rm(n,T,D),L=E(P);g.set(L,h[D]=um(L,P))}return S=new en({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=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,t=O(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p>
|
||||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p></div></div>`,s=O(),l=_("div"),l.textContent="Client SDKs example",r=O(),o=_("div"),a=_("div");for(let D=0;D<u.length;D+=1)u[D].c();c=O(),d=_("div");for(let D=0;D<h.length;D+=1)h[D].c();y=O(),b=_("div"),b.textContent="Event data format",v=O(),B(S.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(a,"class","tabs-header compact left"),p(d,"class","tabs-content"),p(o,"class","tabs m-b-base"),p(b,"class","section-title")},m(D,P){w(D,e,P),w(D,t,P),w(D,i,P),w(D,s,P),w(D,l,P),w(D,r,P),w(D,o,P),m(o,a);for(let L=0;L<u.length;L+=1)u[L].m(a,null);m(o,c),m(o,d);for(let L=0;L<h.length;L+=1)h[L].m(d,null);w(D,y,P),w(D,b,P),w(D,v,P),V(S,D,P),$=!0},p(D,[P]){P&6&&(C=D[2],u=ot(u,P,M,1,D,C,f,a,an,am,null,om)),P&6&&(T=D[2],Oe(),h=ot(h,P,E,1,D,T,g,d,Lt,um,null,rm),Te());const L={};P&1&&(L.content=JSON.stringify({action:"create",record:U.dummyCollectionRecord(D[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(L)},i(D){if(!$){for(let P=0;P<T.length;P+=1)A(h[P]);A(S.$$.fragment,D),$=!0}},o(D){for(let P=0;P<h.length;P+=1)F(h[P]);F(S.$$.fragment,D),$=!1},d(D){D&&k(e),D&&k(t),D&&k(i),D&&k(s),D&&k(l),D&&k(r),D&&k(o);for(let P=0;P<u.length;P+=1)u[P].d();for(let P=0;P<h.length;P+=1)h[P].d();D&&k(y),D&&k(b),D&&k(v),z(S,D)}}}function ZO(n,e,t){let{collection:i=new Ln}=e,s="JavaScript",l=[];const r=o=>t(1,s=o.lang);return n.$$set=o=>{"collection"in o&&t(0,i=o.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${we.baseUrl}");
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.Users.authViaEmail("test@example.com", "123456");
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.Realtime.unsubscribe() // remove all subscriptions
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
|
||||
`}])},[i,s,l,r]}class xO extends Fe{constructor(e){super(),Le(this,e,ZO,GO,Ae,{collection:0})}}function fm(n,e,t){const i=n.slice();return i[14]=e[t],i}function cm(n,e,t){const i=n.slice();return i[14]=e[t],i}function dm(n){let e,t,i,s;var l=n[14].component;function r(o){return{props:{collection:o[3]}}}return l&&(t=new l(r(n))),{c(){e=_("div"),t&&B(t.$$.fragment),i=O(),p(e,"class","tab-item active")},m(o,a){w(o,e,a),t&&V(t,e,null),m(e,i),s=!0},p(o,a){const u={};if(a&8&&(u.collection=o[3]),l!==(l=o[14].component)){if(t){Oe();const f=t;F(f.$$.fragment,1,0,()=>{z(f,1)}),Te()}l?(t=new l(r(o)),B(t.$$.fragment),A(t.$$.fragment,1),V(t,e,i)):t=null}else l&&t.$set(u)},i(o){s||(t&&A(t.$$.fragment,o),s=!0)},o(o){t&&F(t.$$.fragment,o),s=!1},d(o){o&&k(e),t&&z(t)}}}function pm(n,e){let t,i,s,l=e[4]===e[14].id&&dm(e);return{key:n,first:null,c(){t=lt(),l&&l.c(),i=lt(),this.first=t},m(r,o){w(r,t,o),l&&l.m(r,o),w(r,i,o),s=!0},p(r,o){e=r,e[4]===e[14].id?l?(l.p(e,o),o&16&&A(l,1)):(l=dm(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Oe(),F(l,1,1,()=>{l=null}),Te())},i(r){s||(A(l),s=!0)},o(r){F(l),s=!1},d(r){r&&k(t),l&&l.d(r),r&&k(i)}}}function XO(n){let e,t=[],i=new Map,s,l=n[5];const r=o=>o[14].id;for(let o=0;o<l.length;o+=1){let a=fm(n,l,o),u=r(a);i.set(u,t[o]=pm(u,a))}return{c(){e=_("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","tabs-content")},m(o,a){w(o,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(o,a){a&56&&(l=o[5],Oe(),t=ot(t,a,r,1,o,l,i,e,Lt,pm,null,fm),Te())},i(o){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(o){for(let a=0;a<t.length;a+=1)F(t[a]);s=!1},d(o){o&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function hm(n,e){let t,i,s=e[14].label+"",l,r,o,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=H(s),r=O(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),Q(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,r),o||(a=[X(t,"click",u),X(t,"keydown",Ug(f))],o=!0)},p(c,d){e=c,d&48&&Q(t,"active",e[4]===e[14].id)},d(c){c&&k(t),o=!1,rt(a)}}}function QO(n){let e,t,i=n[3].name+"",s,l,r,o,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=cm(n,f,d),g=c(h);u.set(g,a[d]=hm(g,h))}return{c(){e=_("h4"),t=_("strong"),s=H(i),l=H(" records API"),r=O(),o=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(o,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,r,h),w(d,o,h);for(let g=0;g<a.length;g+=1)a[g].m(o,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&_e(s,i),h&114&&(f=d[5],a=ot(a,h,c,1,d,f,u,o,an,hm,null,cm))},d(d){d&&k(e),d&&k(r),d&&k(o);for(let h=0;h<a.length;h+=1)a[h].d()}}}function eT(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function tT(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[eT],header:[QO],default:[XO]},$$scope:{ctx:n}};return e=new Di({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const r={};l&524312&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[11](null),z(e,s)}}}function nT(n,e,t){const i=[{id:"list",label:"List",component:gO},{id:"view",label:"View",component:yO},{id:"create",label:"Create",component:PO},{id:"update",label:"Update",component:WO},{id:"delete",label:"Delete",component:JO},{id:"realtime",label:"Realtime",component:xO}];let s,l=new Ln,r=i[0].id;function o(v){return t(3,l=v),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(v){t(4,r=v)}function f(v,S){(v.code==="Enter"||v.code==="Space")&&(v.preventDefault(),u(S))}const c=()=>a(),d=v=>u(v.id),h=(v,S)=>f(S,v.id);function g(v){he[v?"unshift":"push"](()=>{s=v,t(2,s)})}function y(v){ut.call(this,n,v)}function b(v){ut.call(this,n,v)}return[a,u,s,l,r,i,f,o,c,d,h,g,y,b]}class iT extends Fe{constructor(e){super(),Le(this,e,nT,tT,Ae,{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 sT(n){let e,t,i,s=[n[3]],l={};for(let r=0;r<s.length;r+=1)l=ct(l,s[r]);return{c(){e=_("textarea"),ci(e,l),Q(e,"svelte-1x1pbts",!0)},m(r,o){w(r,e,o),e.autofocus&&e.focus(),n[5](e),$e(e,n[0]),t||(i=[X(e,"input",n[6]),X(e,"keydown",n[2])],t=!0)},p(r,[o]){ci(e,l=bn(s,[o&8&&r[3]])),o&1&&$e(e,r[0]),Q(e,"svelte-1x1pbts",!0)},i:re,o:re,d(r){r&&k(e),n[5](null),t=!1,rt(i)}}}function lT(n,e,t){const i=["value","maxHeight"];let s=Yt(e,i),{value:l=""}=e,{maxHeight:r=200}=e,o,a;function u(){clearTimeout(a),a=setTimeout(()=>{o&&(t(1,o.style.height="",o),t(1,o.style.height=Math.min(o.scrollHeight+2,r)+"px",o))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const g=o.closest("form");g!=nu
Line truncated
|
||||
<span class="txt">Upload new file</span>`,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(o,a){w(o,e,a),m(e,t),n[18](t),m(e,i),m(e,s),l||(r=[X(t,"change",n[19]),X(s,"click",n[20])],l=!0)},p(o,a){a&32&&(t.multiple=o[5])},d(o){o&&k(e),n[18](null),l=!1,rt(r)}}}function tD(n){let e,t,i,s,l,r=n[3].name+"",o,a,u,f,c=[],d=new Map,h,g,y,b=n[4];const v=T=>T[28];for(let T=0;T<b.length;T+=1){let E=_m(n,b,T),D=v(E);d.set(D,c[T]=bm(D,E))}let S=n[0],$=[];for(let T=0;T<S.length;T+=1)$[T]=ym(gm(n,S,T));const C=T=>F($[T],1,1,()=>{$[T]=null});let M=!n[9]&&vm(n);return{c(){e=_("label"),t=_("i"),s=O(),l=_("span"),o=H(r),u=O(),f=_("div");for(let T=0;T<c.length;T+=1)c[T].c();h=O();for(let T=0;T<$.length;T+=1)$[T].c();g=O(),M&&M.c(),p(t,"class",i=U.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[24]),p(f,"class","files-list")},m(T,E){w(T,e,E),m(e,t),m(e,s),m(e,l),m(l,o),w(T,u,E),w(T,f,E);for(let D=0;D<c.length;D+=1)c[D].m(f,null);m(f,h);for(let D=0;D<$.length;D+=1)$[D].m(f,null);m(f,g),M&&M.m(f,null),n[21](f),y=!0},p(T,E){if((!y||E&8&&i!==(i=U.getFieldTypeIcon(T[3].type)))&&p(t,"class",i),(!y||E&8)&&r!==(r=T[3].name+"")&&_e(o,r),(!y||E&16777216&&a!==(a=T[24]))&&p(e,"for",a),E&3222&&(b=T[4],Oe(),c=ot(c,E,v,1,T,b,d,f,Lt,bm,h,_m),Te()),E&4097){S=T[0];let D;for(D=0;D<S.length;D+=1){const P=gm(T,S,D);$[D]?($[D].p(P,E),A($[D],1)):($[D]=ym(P),$[D].c(),A($[D],1),$[D].m(f,g))}for(Oe(),D=S.length;D<$.length;D+=1)C(D);Te()}T[9]?M&&(M.d(1),M=null):M?M.p(T,E):(M=vm(T),M.c(),M.m(f,null))},i(T){if(!y){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<S.length;E+=1)A($[E]);y=!0}},o(T){for(let E=0;E<c.length;E+=1)F(c[E]);$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)F($[E]);y=!1},d(T){T&&k(e),T&&k(u),T&&k(f);for(let E=0;E<c.length;E+=1)c[E].d();Bn($,T),M&&M.d(),n[21](null)}}}function nD(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[tD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}});let l={};return i=new JT({props:l}),n[22](i),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(r,o){V(e,r,o),w(r,t,o),V(i,r,o),s=!0},p(r,[o]){const a={};o&8&&(a.class="form-field form-field-file "+(r[3].required?"required":"")),o&8&&(a.name=r[3].name),o&1090520063&&(a.$$scope={dirty:o,ctx:r}),e.$set(a);const u={};i.$set(u)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){F(e.$$.fragment,r),F(i.$$.fragment,r),s=!1},d(r){z(e,r),r&&k(t),n[22](null),z(i,r)}}}function iD(n,e,t){let i,s,l,{record:r}=e,{value:o=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new wn}=e,c,d,h;function g(N){U.removeByValue(u,N),t(1,u)}function y(N){U.pushUnique(u,N),t(1,u)}function b(N){U.isEmpty(a[N])||a.splice(N,1),t(0,a)}function v(){h==null||h.dispatchEvent(new CustomEvent("change",{detail:{value:o,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const S=N=>U.hasImageExtension(N)?d==null?void 0:d.show(we.Records.getFileUrl(r,N)):!1,$=N=>g(N),C=N=>y(N),M=N=>b(N);function T(N){he[N?"unshift":"push"](()=>{c=N,t(6,c)})}const E=()=>{for(let N of c.files)a.push(N);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function P(N){he[N?"unshift":"push"](()=>{h=N,t(8,h)})}function L(N){he[N?"unshift":"push"](()=>{d=N,t(7,d)})}return n.$$set=N=>{"record"in N&&t(2,r=N.record),"value"in N&&t(13,o=N.value),"uploadedFiles"in N&&t(0,a=N.uploadedFiles),"deletedFileIndexes"in N&&t(1,u=N.deletedFileIndexes),"field"in N&&t(3,f=N.field)},n.$$.update=()=>{var N,R;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=((N=f.options)==null?void 0:N.maxSelect)>1),n.$$.dirty&8224&&(typeof o=="undefined"||o===null)&&t(13,o=i?[]:null),n.$$.dirty&8192&&t(4,s=U.toArray(o)),n.$$.dirty&27&&t(9,l=(s.length||a.length)&&((R=f.options)==null?void 0:R.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&v()},[a,u,r,f,s,i,c,d,h,l,g,y,b,o,S,$,C,M,T,E,D,P,L]}class sD extends Fe{constructor(e){super(),Le(this,e,iD,nD,Ae,{record:2,value:13,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function km(n){let e,t;return{c(){e=_("small"),t=H(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&_e(t,i[1])},d(i){i&&k(e)}}}function lD(n){let e,t,i,s,l,r=n[0].id+"",o,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&km(n);return{c(){e=_("i"),i=O(),s=_("div"),l=_("div"),o=H(r),a=O(),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),m(s,l),m(l,o),m(s,a),c&&c.m(s,null),u||(f=Xe(t=St.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Jn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&r!==(r=d[0].id+"")&&_e(o,r),d[1]!==""&&Line truncated
|
||||
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function OD(n){let e,t,i;function s(r){n[31](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new CD({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function TD(n){let e,t,i;function s(r){n[30](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new mD({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function DD(n){let e,t,i,s,l;function r(f){n[27](f,n[40])}function o(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 sD({props:u}),he.push(()=>Re(e,"value",r)),he.push(()=>Re(e,"uploadedFiles",o)),he.push(()=>Re(e,"deletedFileIndexes",a)),{c(){B(e.$$.fragment)},m(f,c){V(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],je(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],je(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],je(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){F(e.$$.fragment,f),l=!1},d(f){z(e,f)}}}function AD(n){let e,t,i;function s(r){n[26](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new jT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ED(n){let e,t,i;function s(r){n[25](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new FT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function PD(n){let e,t,i;function s(r){n[24](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new AT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function LD(n){let e,t,i;function s(r){n[23](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new MT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function FD(n){let e,t,i;function s(r){n[22](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new wT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ID(n){let e,t,i;function s(r){n[21](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new bT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ND(n){let e,t,i;function s(r){n[20](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new hT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function RD(n){let e,t,i;function s(r){n[19](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new fT({props:l}),he.push(()=>Re(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;
Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function qD(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",r,o,a,u,f,c=!n[2].isNew&&n[9]&&Am(n);return{c(){e=_("h4"),i=H(t),s=O(),r=H(l),o=H(" record"),a=O(),c&&c.c(),u=lt()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,r),m(e,o),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")&&_e(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&_e(r,l),!d[2].isNew&&d[9]?c?(c.p(d,h),h[0]&516&&A(c,1)):(c=Am(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Oe(),F(c,1,1,()=>{c=null}),Te())},i(d){f||(A(c),f=!0)},o(d){F(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function VD(n){let e,t,i,s,l,r=n[2].isNew?"Create":"Save changes",o,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=O(),s=_("button"),l=_("span"),o=H(r),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[10]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,o),u||(f=X(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&r!==(r=c[2].isNew?"Create":"Save changes")&&_e(o,r),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&Q(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function zD(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[VD],header:[qD],default:[jD]},$$scope:{ctx:n}};return e=new Di({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&288&&(r.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[33](null),z(e,s)}}}function Em(n){return JSON.stringify(n)}function BD(n,e,t){let i,s,l,r;const o=_n(),a="record_"+U.randomString(5);let{collection:u}=e,f,c=null,d=new eo,h=!1,g=!1,y={},b={},v="";function S(ue){return C(ue),t(8,g=!0),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}function C(ue){Wi({}),c=ue||{},t(2,d=ue!=null&&ue.clone?ue.clone():new eo),t(3,y={}),t(4,b={}),t(15,v=Em(d))}function M(){if(h||!s)return;t(7,h=!0);const ue=E();let ie;d.isNew?ie=we.Records.create(u==null?void 0:u.id,ue):ie=we.Records.update(u==null?void 0:u.id,d.id,ue),ie.then(async ve=>{mn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),$(),o("save",ve)}).catch(ve=>{we.errorResponseHandler(ve)}).finally(()=>{t(7,h=!1)})}function T(){!(c!=null&&c.id)||Ci("Do you really want to delete the selected record?",()=>we.Records.delete(c["@collectionId"],c.id).then(()=>{$(),mn("Successfully deleted record."),o("delete",c)}).catch(ue=>{we.errorResponseHandler(ue)}))}function E(){const ue=(d==null?void 0:d.export())||{},ie=new FormData,ve={};for(const He of(u==null?void 0:u.schema)||[])ve[He.name]=He;for(const He in ue)!ve[He]||(typeof ue[He]=="undefined"&&(ue[He]=null),U.addValueToFormData(ie,He,ue[He]));for(const He in y){const Ie=U.toArray(y[He]);for(const qe of Ie)ie.append(He,qe)}for(const He in b){const Ie=U.toArray(b[He]);for(const qe of Ie)ie.append(He+"."+qe,"")}return ie}const D=()=>$(),P=()=>T();function L(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function N(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function R(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function J(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function W(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function q(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function G(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function K(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function Y(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function ne(ue,ie){n.$$.not_equal(y[ie.name],ue)&&(y[ie.name]=ue,t(3,y))}function fe(ue,ie){n.$$.not_equal(b[ie.name],ue)&&(b[ie.name]=ue,t(4,b))}function ye(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}function se(ue,ie){n.$$.not_equal(d[ie.name],ue)&&(d[ie.name]=ue,t(2,d))}const Z=()=>s&&g?(Ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),$()}),!1):!0;function De(ue){he[ue?"unshift":"push"](()=>{f=ue,t(6,f)})}function te(ue){ut.call(this,n,ue)}function be(ue){ut.call(this,n,ue)}return n.$$set=ue=>{"collection"in ue&&t(0,u=ue.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=U.hasNonEmptyProps(y)||U.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||v!=Em(d)),n.$$.dirty[0]&36&&t(10,l=d.isNew||s),n.$$.dirty[0]&1&&t(9,r=(u==null?void 0:u.name)!=="profiles")},[u,$,d,y,b,s,f,h,g,r,l,a,M,T,S,v,i,D,P,L,N,R,J,W,q,G,K,Y,ne,fe,ye,se,Z,De,te,be]}class Rb extends Fe{constructor(e){super(),Le(this,e,BD,zD,Ae,{collecLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Bm(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Um(n,e){let t,i,s;return i=new jb({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=lt(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r[0]&8&&(o.record=e[35]),r[0]&2048&&(o.field=e[38]),i.$set(o)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function Wm(n,e){let t,i,s,l,r,o,a,u,f,c,d,h,g,y=[],b=new Map,v,S,$,C,M,T,E,D,P,L,N,R;function J(){return e[25](e[35])}h=new No({props:{id:e[35].id}});let W=e[11];const q=Y=>Y[38].name;for(let Y=0;Y<W.length;Y+=1){let ne=Hm(e,W,Y),fe=q(ne);b.set(fe,y[Y]=Um(fe,ne))}$=new $i({props:{date:e[35].created}}),T=new $i({props:{date:e[35].updated}});function G(){return e[26](e[35])}function K(...Y){return e[27](e[35],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=O(),u=_("label"),c=O(),d=_("td"),B(h.$$.fragment),g=O();for(let Y=0;Y<y.length;Y+=1)y[Y].c();v=O(),S=_("td"),B($.$$.fragment),C=O(),M=_("td"),B(T.$$.fragment),E=O(),D=_("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',P=O(),p(l,"type","checkbox"),p(l,"id",r="checkbox_"+e[35].id),l.checked=o=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(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,ne){w(Y,t,ne),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),V(h,d,null),m(t,g);for(let fe=0;fe<y.length;fe+=1)y[fe].m(t,null);m(t,v),m(t,S),V($,S,null),m(t,C),m(t,M),V(T,M,null),m(t,E),m(t,D),m(t,P),L=!0,N||(R=[X(l,"change",J),X(s,"click",Un(e[19])),X(t,"click",G),X(t,"keydown",K)],N=!0)},p(Y,ne){e=Y,(!L||ne[0]&8&&r!==(r="checkbox_"+e[35].id))&&p(l,"id",r),(!L||ne[0]&40&&o!==(o=e[5][e[35].id]))&&(l.checked=o),(!L||ne[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const fe={};ne[0]&8&&(fe.id=e[35].id),h.$set(fe),ne[0]&2056&&(W=e[11],Oe(),y=ot(y,ne,q,1,e,W,b,t,Lt,Um,v,Hm),Te());const ye={};ne[0]&8&&(ye.date=e[35].created),$.$set(ye);const se={};ne[0]&8&&(se.date=e[35].updated),T.$set(se)},i(Y){if(!L){A(h.$$.fragment,Y);for(let ne=0;ne<W.length;ne+=1)A(y[ne]);A($.$$.fragment,Y),A(T.$$.fragment,Y),L=!0}},o(Y){F(h.$$.fragment,Y);for(let ne=0;ne<y.length;ne+=1)F(y[ne]);F($.$$.fragment,Y),F(T.$$.fragment,Y),L=!1},d(Y){Y&&k(t),z(h);for(let ne=0;ne<y.length;ne+=1)y[ne].d();z($),z(T),N=!1,rt(R)}}}function Ym(n){let e,t,i=n[3].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a[0]&8&&i!==(i=o[3].length+"")&&_e(s,i),a[0]&16&&_e(r,o[4])},d(o){o&&k(e)}}}function Km(n){let e,t,i,s,l=n[4]-n[3].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[8]),Q(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=X(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&_e(r,l),c[0]&256&&Q(t,"btn-loading",f[8]),c[0]&256&&Q(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Jm(n){let e,t,i,s,l,r,o=n[6]===1?"record":"records",a,u,f,c,d,h,g,y,b,v,S;return{c(){e=_("div"),t=_("div"),i=H("Selected "),s=_("strong"),l=H(n[6]),r=O(),a=H(o),u=O(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=O(),d=_("div"),h=O(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),Q(g,"btn-loading",n[9]),Q(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m($,C){w($,e,C),m(e,t),m(t,i),m(t,s),m(s,l),m(t,r),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,v||(S=[X(f,"click",n[30]),X(g,"click",n[31])],v=!0)},p($,C){(!b||C[0]&64)&&_e(l,$[6]),(!b||C[0]&64)&&o!==(o=$[6]===1?"record":"records")&&_e(a,o),C[0]&512&&Q(f,"btn-disabled",$[9]),C[0]&512&&Q(g,"btn-loading",$[9]),C[0]&512&&Q(g,"btn-disabled",$[9])},i($){b||($&&Dt(()=>{y||(y=ft(e,ni,{duration:150,y:5},!0)),y.run(1)}),b=!0)},o($){$&&(y||(y=ft(e,ni,{duration:150,y:5},!1)),y.run(0)),b=!1},d($){$&&k(e),$&&y&&y.end(),v=!1,rt(S)}}}function cA(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y=[],b=new Map,v,S,$,C,M,T,E,D,P,L,N=[],R=new Map,J,W,q,G,K,Y,ne;function fe(le){n[21](le)}let ye={class:"col-type-text col-field-id",name:"
Line truncated
|
||||
<span class="txt">API Preview</span>`,b=O(),v=_("button"),v.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New record</span>`,S=O(),B($.$$.fragment),C=O(),B(M.$$.fragment),p(r,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(d,"type","button"),p(d,"class","btn btn-secondary btn-circle"),p(y,"type","button"),p(y,"class","btn btn-outline"),p(v,"type","button"),p(v,"class","btn btn-expanded"),p(g,"class","btns-group"),p(s,"class","page-header"),p(i,"class","page-wrapper")},m(W,q){V(e,W,q),w(W,t,q),w(W,i,q),m(i,s),m(s,l),m(l,r),m(l,o),m(l,a),m(a,f),m(s,c),m(s,d),m(s,h),m(s,g),m(g,y),m(g,b),m(g,v),m(i,S),V($,i,null),m(i,C),V(M,i,null),D=!0,P||(L=[Xe(St.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(y,"click",n[13]),X(v,"click",n[14])],P=!0)},p(W,q){(!D||q&4)&&u!==(u=W[2].name+"")&&_e(f,u);const G={};q&1&&(G.value=W[0]),q&4&&(G.autocompleteCollection=W[2]),$.$set(G);const K={};q&4&&(K.collection=W[2]),!T&&q&1&&(T=!0,K.filter=W[0],je(()=>T=!1)),!E&&q&2&&(E=!0,K.sort=W[1],je(()=>E=!1)),M.$set(K)},i(W){D||(A(e.$$.fragment,W),A($.$$.fragment,W),A(M.$$.fragment,W),D=!0)},o(W){F(e.$$.fragment,W),F($.$$.fragment,W),F(M.$$.fragment,W),D=!1},d(W){z(e,W),W&&k(t),W&&k(i),z($),n[16](null),z(M),P=!1,rt(L)}}}function mA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),s=_("h1"),s.textContent="Create your first collection to add records!",l=O(),r=_("button"),r.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(s,"class","m-b-10"),p(r,"type","button"),p(r,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,r),o||(a=X(r,"click",n[11]),o=!0)},p:re,i:re,o:re,d(u){u&&k(e),o=!1,a()}}}function gA(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading collections...</h1>`,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 _A(n){let e,t,i,s,l,r,o,a,u;const f=[gA,mA,hA],c=[];function d(b,v){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new hf({props:h}),n[20](s);let g={};r=new iT({props:g}),n[21](r);let y={collection:n[2]};return a=new Rb({props:y}),n[22](a),a.$on("save",n[23]),a.$on("delete",n[24]),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment)},m(b,v){c[e].m(b,v),w(b,i,v),V(s,b,v),w(b,l,v),V(r,b,v),w(b,o,v),V(a,b,v),u=!0},p(b,[v]){let S=e;e=d(b),e===S?c[e].p(b,v):(Oe(),F(c[S],1,1,()=>{c[S]=null}),Te(),t=c[e],t?t.p(b,v):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const C={};r.$set(C);const M={};v&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(r.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){F(t),F(s.$$.fragment,b),F(r.$$.fragment,b),F(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[20](null),z(s,b),b&&k(l),n[21](null),z(r,b),b&&k(o),n[22](null),z(a,b)}}}function bA(n,e,t){var J;let i,s,l,r;hn(n,fi,W=>t(2,s=W)),hn(n,Js,W=>t(10,l=W)),hn(n,pu,W=>t(8,r=W));const o=U.getQueryParams((J=window.location)==null?void 0:J.href);let a,u,f,c,d=o.filter||"",h=o.sort||"-created",g=o.collectionId;U.setDocumentTitle("Collections"),L3(g);const y=()=>a==null?void 0:a.show(),b=()=>a==null?void 0:a.show(s),v=()=>u==null?void 0:u.show(s),S=()=>f==null?void 0:f.show(),$=W=>t(0,d=W.detail);function C(W){he[W?"unshift":"push"](()=>{c=W,t(6,c)})}function M(W){d=W,t(0,d),t(2,s),t(9,g)}function T(W){h=W,t(1,h),t(2,s),t(9,g)}const E=W=>f==null?void 0:f.show(W==null?void 0:W.detail);function D(W){he[W?"unshift":"push"](()=>{a=W,t(3,a)})}function P(W){he[W?"unshift":"push"](()=>{u=W,t(4,u)})}function L(W){he[W?"unshift":"push"](()=>{f=W,t(5,f)})}const N=()=>c==null?void 0:c.load(),R=()=>c==null?void 0:c.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(W=>W.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&g!=s.id&&(t(9,g=s.id),t(1,h="-created"),t(0,d="")),n.$$.dirty&7&&(h||d||(s==null?void 0:s.id))&&U.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:d,sort:h})},[d,h,s,a,u,f,c,i,r,g,l,y,b,v,S,$,C,M,T,E,D,P,L,N,R]}class yA extends Fe{constructor(e){super(),Le(this,e,bA,_A,Ae,{})}}function Gm(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[vA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function vA(n){let e,t,i,s,l,r,o,a,u;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="ID",r=O(),o=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(o,"type","text"),p(o,"id",a=n[31]),o.value=u=n[1].id,o.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,r,c),w(f,o,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(o,"id",a),c[0]&2&&u!==(u=f[1].id)&&o.value!==u&&(o.value=u)},d(f){f&&k(e),f&&k(r),f&&k(o)}}}function Zm(n){let e,t,i,s;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(l,r){w(l,e,r),i||(s=Xe(t=St.call(null,e,"Verified")),i=!0)},d(l){l&&k(e),i=!1,s()}}}function kA(n){let e,t,i,s,l,r,o,a,u,f,c,d=n[1].verified&&Zm();return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="Email",r=O(),d&&d.c(),o=O(),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,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,r,g),d&&d.m(h,g),w(h,o,g),w(h,a,g),$e(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Zm(),d.c(),d.m(o.parentNode,o)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=h[31])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&$e(a,h[2])},d(h){h&&k(e),h&&k(r),d&&d.d(h),h&&k(o),h&&k(a),f=!1,c()}}}function xm(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[wA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function wA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",r=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[20]),o=!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&&r!==(r=u[31])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Xm(n){let e,t,i,s,l,r,o,a,u;return s=new Ne({props:{class:"form-field required",name:"pasLine truncated
|
||||
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function TA(n){let e,t,i,s,l=!n[1].verified&&tg(n);return{c(){l&&l.c(),e=O(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(r,o){l&&l.m(r,o),w(r,e,o),w(r,t,o),i||(s=X(t,"click",n[17]),i=!0)},p(r,o){r[1].verified?l&&(l.d(1),l=null):l?l.p(r,o):(l=tg(r),l.c(),l.m(e.parentNode,e))},d(r){l&&l.d(r),r&&k(e),r&&k(t),i=!1,s()}}}function DA(n){let e,t,i,s,l,r,o=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&eg(n);return{c(){h&&h.c(),e=O(),t=_("button"),i=_("span"),i.textContent="Cancel",s=O(),l=_("button"),r=_("span"),a=H(o),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],Q(l,"btn-loading",n[5])},m(g,y){h&&h.m(g,y),w(g,e,y),w(g,t,y),m(t,i),w(g,s,y),w(g,l,y),m(l,r),m(r,a),f=!0,c||(d=X(t,"click",n[18]),c=!0)},p(g,y){g[1].isNew?h&&(Oe(),F(h,1,1,()=>{h=null}),Te()):h?(h.p(g,y),y[0]&2&&A(h,1)):(h=eg(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||y[0]&32)&&(t.disabled=g[5]),(!f||y[0]&2)&&o!==(o=g[1].isNew?"Create":"Save changes")&&_e(a,o),(!f||y[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),y[0]&32&&Q(l,"btn-loading",g[5])},i(g){f||(A(h),f=!0)},o(g){F(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function AA(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[DA],header:[OA],default:[MA]},$$scope:{ctx:n}};return e=new Di({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&1088&&(r.beforeHide=s[24]),l[0]&1966|l[1]&2&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[25](null),z(e,s)}}}function EA(n,e,t){let i;const s=_n(),l="user_"+U.randomString(5);let r,o=new to,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function y(Y){return v(Y),t(6,u=!0),r==null?void 0:r.show()}function b(){return r==null?void 0:r.hide()}function v(Y){Wi({}),t(1,o=Y!=null&&Y.clone?Y.clone():new to),S()}function S(){t(3,h=!1),t(9,g=!0),t(2,f=(o==null?void 0:o.email)||""),t(7,c=""),t(8,d="")}function $(){if(a||!i)return;t(5,a=!0);const Y={email:f};(o.isNew||h)&&(Y.password=c,Y.passwordConfirm=d);let ne;o.isNew?ne=we.Users.create(Y):ne=we.Users.update(o.id,Y),ne.then(async fe=>{g&&M(!1),t(6,u=!1),b(),mn(o.isNew?"Successfully created user.":"Successfully updated user."),s("save",fe)}).catch(fe=>{we.errorResponseHandler(fe)}).finally(()=>{t(5,a=!1)})}function C(){!(o!=null&&o.id)||Ci("Do you really want to delete the selected user?",()=>we.Users.delete(o.id).then(()=>{t(6,u=!1),b(),mn("Successfully deleted user."),s("delete",o)}).catch(Y=>{we.errorResponseHandler(Y)}))}function M(Y=!0){return we.Users.requestVerification(o.isNew?f:o.email).then(()=>{t(6,u=!1),b(),Y&&mn(`Successfully sent verification email to ${o.email}.`)}).catch(ne=>{we.errorResponseHandler(ne)})}const T=()=>M(),E=()=>C(),D=()=>b();function P(){f=this.value,t(2,f)}function L(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function R(){d=this.value,t(8,d)}function J(){g=this.checked,t(9,g)}const W=()=>i&&u?(Ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function q(Y){he[Y?"unshift":"push"](()=>{r=Y,t(4,r)})}function G(Y){ut.call(this,n,Y)}function K(Y){ut.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=o.isNew&&f!=""||h||f!==o.email)},[b,o,f,h,r,a,u,c,d,g,i,l,$,C,M,y,T,E,D,P,L,N,R,J,W,q,G,K]}class PA extends Fe{constructor(e){super(),Le(this,e,EA,AA,Ae,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ng(n,e,t){const i=n.slice();return i[37]=e[t],i}function ig(n,e,t){const i=n.slice();return i[40]=e[t],i}function sg(n,e,t){const i=n.slice();return i[40]=e[t],i}function LA(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$,C,M,T,E=[],D=new Map,P,L,N,R,J,W,q,G,K,Y,ne=[],fe=new Map,ye,se,Z,De,te;c=new Ao({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),c.$on("submit",n[17]);function be(x){n[18](x)}let ue={class:"col-type-text col-field-id",name:"id",$$slots:{default:[IA]},$$scope:{ctx:n}};n[4]!==void 0&&(ue.sort=n[4]),v=new Qt({props:ue}),he.push(()=>Re(v,"sort",be));function ie(x){n[19](x)}let ve={class:"col-type-email col-field-email",name:"email",$$slots:{default:[NA]},$$scope:{ctx:n}};n[4]!==void 0&&(ve.sort=n[4]),C=new Qt({props:ve}),he.push(()=>Re(C,"sort",ie));let He=n[12];const Ie=x=>x[40].name;for(let x=0;x<He.length;x+=1){let ae=sg(n,He,x),Be=Ie(ae);D.set(Be,E[x]=lg(Be,ae))}function qe(x){n[20](x)}let oe={class:"col-type-date col-field-created",name:"created",$$slots:{default:[RA]},$$scope:{ctx:n}};n[4]!==void 0&&(oe.sort=n[4]),L=new Qt({props:oe}),he.push(()=>Re(L,"sort",qe));function le(x){n[21](x)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[jA]},$$scope:{ctx:n}};n[4]!==void 0&&(ke.sort=n[4]),J=new Qt({props:ke}),he.push(()=>Re(J,"sort",le)Line truncated
|
||||
<span class="txt">New user</span>`,f=O(),B(c.$$.fragment),d=O(),h=_("div"),g=_("table"),y=_("thead"),b=_("tr"),B(v.$$.fragment),$=O(),B(C.$$.fragment),T=O();for(let x=0;x<E.length;x+=1)E[x].c();P=O(),B(L.$$.fragment),R=O(),B(J.$$.fragment),q=O(),G=_("th"),K=O(),Y=_("tbody");for(let x=0;x<ne.length;x+=1)ne[x].c();Ze&&Ze.c(),ye=O(),ge&&ge.c(),se=O(),Ee&&Ee.c(),p(i,"class","breadcrumbs"),p(l,"type","button"),p(l,"class","btn btn-secondary btn-circle"),p(o,"class","flex-fill"),p(u,"type","button"),p(u,"class","btn btn-expanded"),p(t,"class","page-header"),p(G,"class","col-type-action min-width"),p(g,"class","table"),Q(g,"table-loading",n[10]),p(h,"class","table-wrapper"),p(e,"class","page-wrapper")},m(x,ae){w(x,e,ae),m(e,t),m(t,i),m(t,s),m(t,l),m(t,r),m(t,o),m(t,a),m(t,u),m(e,f),V(c,e,null),m(e,d),m(e,h),m(h,g),m(g,y),m(y,b),V(v,b,null),m(b,$),V(C,b,null),m(b,T);for(let Be=0;Be<E.length;Be+=1)E[Be].m(b,null);m(b,P),V(L,b,null),m(b,R),V(J,b,null),m(b,q),m(b,G),m(g,K),m(g,Y);for(let Be=0;Be<ne.length;Be+=1)ne[Be].m(Y,null);Ze&&Ze.m(Y,null),m(e,ye),ge&&ge.m(e,null),m(e,se),Ee&&Ee.m(e,null),Z=!0,De||(te=[Xe(St.call(null,l,{text:"Edit profile collection",position:"right"})),X(l,"click",n[15]),X(u,"click",n[16])],De=!0)},p(x,ae){const Be={};ae[0]&8&&(Be.value=x[3]),c.$set(Be);const vt={};ae[1]&16384&&(vt.$$scope={dirty:ae,ctx:x}),!S&&ae[0]&16&&(S=!0,vt.sort=x[4],je(()=>S=!1)),v.$set(vt);const it={};ae[1]&16384&&(it.$$scope={dirty:ae,ctx:x}),!M&&ae[0]&16&&(M=!0,it.sort=x[4],je(()=>M=!1)),C.$set(it),ae[0]&4096&&(He=x[12],E=ot(E,ae,Ie,1,x,He,D,b,an,lg,P,sg));const gt={};ae[1]&16384&&(gt.$$scope={dirty:ae,ctx:x}),!N&&ae[0]&16&&(N=!0,gt.sort=x[4],je(()=>N=!1)),L.$set(gt);const at={};ae[1]&16384&&(at.$$scope={dirty:ae,ctx:x}),!W&&ae[0]&16&&(W=!0,at.sort=x[4],je(()=>W=!1)),J.$set(at),ae[0]&5450&&(Ve=x[1],Oe(),ne=ot(ne,ae,ze,1,x,Ve,fe,Y,Lt,ug,null,ng),Te(),!Ve.length&&Ze?Ze.p(x,ae):Ve.length?Ze&&(Ze.d(1),Ze=null):(Ze=rg(x),Ze.c(),Ze.m(Y,null))),ae[0]&1024&&Q(g,"table-loading",x[10]),x[1].length?ge?ge.p(x,ae):(ge=fg(x),ge.c(),ge.m(e,se)):ge&&(ge.d(1),ge=null),x[1].length&&x[13]?Ee?Ee.p(x,ae):(Ee=cg(x),Ee.c(),Ee.m(e,null)):Ee&&(Ee.d(1),Ee=null)},i(x){if(!Z){A(c.$$.fragment,x),A(v.$$.fragment,x),A(C.$$.fragment,x),A(L.$$.fragment,x),A(J.$$.fragment,x);for(let ae=0;ae<Ve.length;ae+=1)A(ne[ae]);Z=!0}},o(x){F(c.$$.fragment,x),F(v.$$.fragment,x),F(C.$$.fragment,x),F(L.$$.fragment,x),F(J.$$.fragment,x);for(let ae=0;ae<ne.length;ae+=1)F(ne[ae]);Z=!1},d(x){x&&k(e),z(c),z(v),z(C);for(let ae=0;ae<E.length;ae+=1)E[ae].d();z(L),z(J);for(let ae=0;ae<ne.length;ae+=1)ne[ae].d();Ze&&Ze.d(),ge&&ge.d(),Ee&&Ee.d(),De=!1,rt(te)}}}function FA(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading users...</h1>`,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 IA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function NA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function lg(n,e){let t,i,s,l,r,o,a,u=e[40].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),r=O(),o=_("span"),a=H("profile."),f=H(u),p(s,"class",l=U.getFieldTypeIcon(e[40].type)),p(o,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[40].type+" col-field-"+e[40].name),p(t,"name",d=e[40].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,r),m(i,o),m(o,a),m(o,f)},p(h,g){e=h,g[0]&4096&&l!==(l=U.getFieldTypeIcon(e[40].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[40].name+"")&&_e(f,u),g[0]&4096&&c!==(c="col-type-"+e[40].type+" col-field-"+e[40].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[40].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function RA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function jA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="updated",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function rg(n){let e;function t(l,r){return l[10]?qA:HA}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function HA(n){var o;let e,t,i,s,l,r=((o=n[3])==null?void 0:o.length)&&og(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),r&&r.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?r?r.p(a,u):(r=og(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function qA(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function og(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[24]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function ag(n,e){let t,i,s;return i=new jb({props:{field:e[40],record:e[37].profile||{}}}),{key:n,first:null,c(){t=lt(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r[0]&4096&&(o.field=e[40]),r[0]&2&&(o.record=e[37].profile||{}),i.$set(o)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function ug(n,e){let t,i,s,l,r,o,a,u=e[37].email+"",f,c,d,h,g=e[37].verified?"Verified":"Unverified",y,b,v=[],S=new Map,$,C,M,T,E,D,P,L,N,R,J,W,q,G,K;s=new No({props:{id:e[37].id}});let Y=e[12];const ne=se=>se[40].name;for(let se=0;se<Y.length;se+=1){let Z=ig(e,Y,se),De=ne(Z);S.set(De,v[se]=ag(De,Z))}M=new $i({props:{date:e[37].created}}),D=new $i({props:{date:e[37].updated}});function fe(){return e[22](e[37])}function ye(){return e[23](e[37])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),B(s.$$.fragment),l=O(),r=_("td"),o=_("div"),a=_("span"),f=H(u),d=O(),h=_("span"),y=H(g),b=O();for(let se=0;se<v.length;se+=1)v[se].c();$=O(),C=_("td"),B(M.$$.fragment),T=O(),E=_("td"),B(D.$$.fragment),P=O(),L=_("td"),N=_("button"),N.innerHTML=`<i class="ri-user-settings-line"></i>
|
||||
<span class="txt">Edit user</span>`,R=O(),J=_("button"),J.innerHTML=`<i class="ri-profile-line"></i>
|
||||
<span class="txt">Edit profile</span>`,W=O(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[37].email),p(h,"class","label"),Q(h,"label-success",e[37].verified),Q(h,"label-warning",!e[37].verified),p(o,"class","inline-flex"),p(r,"class","col-type-email col-field-email"),p(C,"class","col-type-date col-field-created"),p(E,"class","col-type-date col-field-updated"),p(N,"type","button"),p(N,"class","btn btn-sm btn-outline"),p(J,"type","button"),p(J,"class","btn btn-sm m-l-10"),p(L,"class","col-type-action min-width"),this.first=t},m(se,Z){w(se,t,Z),m(t,i),V(s,i,null),m(t,l),m(t,r),m(r,o),m(o,a),m(a,f),m(o,d),m(o,h),m(h,y),m(t,b);for(let De=0;De<v.length;De+=1)v[De].m(t,null);m(t,$),m(t,C),V(M,C,null),m(t,T),m(t,E),V(D,E,null),m(t,P),m(t,L),m(L,N),m(L,R),m(L,J),m(t,W),q=!0,G||(K=[X(N,"click",Un(fe)),X(J,"click",Un(ye))],G=!0)},p(se,Z){e=se;const De={};Z[0]&2&&(De.id=e[37].id),s.$set(De),(!q||Z[0]&2)&&u!==(u=e[37].email+"")&&_e(f,u),(!q||Z[0]&2&&c!==(c=e[37].email))&&p(a,"title",c),(!q||Z[0]&2)&&g!==(g=e[37].verified?"Verified":"Unverified")&&_e(y,g),Z[0]&2&&Q(h,"label-success",e[37].verified),Z[0]&2&&Q(h,"label-warning",!e[37].verified),Z[0]&4098&&(Y=e[12],Oe(),v=ot(v,Z,ne,1,e,Y,S,t,Lt,ag,$,ig),Te());const te={};Z[0]&2&&(te.date=e[37].created),M.$set(te);const be={};Z[0]&2&&(be.date=e[37].updated),D.$set(be)},i(se){if(!q){A(s.$$.fragment,se);for(let Z=0;Z<Y.length;Z+=1)A(v[Z]);A(M.$$.fragment,se),A(D.$$.fragment,se),q=!0}},o(se){F(s.$$.fragment,se);for(let Z=0;Z<v.length;Z+=1)F(v[Z]);F(M.$$.fragment,se),F(D.$$.fragment,se),q=!1},d(se){se&&k(t),z(s);for(let Z=0;Z<v.length;Z+=1)v[Z].d();z(M),z(D),G=!1,rt(K)}}}function fg(n){let e,t,i=n[1].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a[0]&2&&i!==(i=o[1].length+"")&&_e(s,i),a[0]&4&&_e(r,o[2])},d(o){o&&k(e)}}}function cg(n){let e,t,i,s,l=n[2]-n[1].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[10]),Q(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=X(t,"click",n[25]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&_e(r,l),c[0]&1024&&Q(t,"btn-loading",f[10]),c[0]&1024&&Q(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function VA(n){let e,t,i,s,l,r,o,a,u;const f=[FA,LA],c=[];function d(b,v){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let h={};s=new PA({props:h}),n[26](s),s.$on("save",n[27]),s.$on("delete",n[28]);let g={};r=new hf({props:g}),n[29](r),r.$on("save",n[30]);let y={collection:n[5]};return a=new Rb({props:y}),n[31](a),a.$on("save",n[32]),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment)},m(b,v){c[e].m(b,v),w(b,i,v),V(s,b,v),w(b,l,v),V(r,b,v),w(b,o,v),V(a,b,v),u=!0},p(b,v){let S=e;e=d(b),e===S?c[e].p(b,v):(Oe(),F(c[S],1,1,()=>{c[S]=null}),Te(),t=c[e],t?t.p(b,v):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const C={};r.$set(C);const M={};v[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(r.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){F(t),F(s.$$.fragment,b),F(r.$$.fragment,b),F(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[26](null),z(s,b),b&&k(l),n[29](null),z(r,b),b&&k(o),n[31](null),z(a,b)}}}function zA(n,e,t){var De;let i,s;const l=U.getQueryParams((De=window.location)==null?void 0:De.href),r=["id","userId","created","updated"];let o,a,u,f=[],c=1,d=0,h=!1,g=l.filter||"",y=l.sort||"-created",b=new Ln,v=!1;U.setDocumentTitle("Users"),M();async function S(te=1){return t(10,h=!0),we.Users.getList(te,50,{sort:y||"-created",filter:g}).then(be=>{te<=1&&$(),t(10,h=!1),t(1,f=f.concat(be.items)),t(9,c=be.page),t(2,d=be.totalItems)}).catch(be=>{be!==null&&(t(10,h=!1),console.warn(be),$(),we.errorResponseHandler(be,!1))})}function $(){t(1,f=[]),t(9,c=1),t(2,d=0)}function C(te){const be=f.find(ue=>ue.id===(te==null?void 0:te.userId));be&&(be.profile=te),t(1,f)}async function M(){t(11,v=!0);try{t(5,b=await we.Collections.getOne("profiles"))}catch(te){we.errorResponseHandler(te)}t(11,v=!1)}const T=()=>a==null?void 0:a.show(b),E=()=>o==null?void 0:o.show(),D=te=>t(3,g=te.detail);function P(te){y=te,t(4,y)}function L(te){y=te,t(4,y)}function N(te){y=te,t(4,y)}function R(te){y=te,t(4,y)}const J=te=>o==null?void 0:o.show(te),W=te=>u==null?void 0:u.show(te.profile),q=()=>t(3,g=""),G=()=>S(c+1);function K(te){he[te?"unshift":"push"](()=>{o=te,t(6,o)})}const Y=()=>S(),ne=()=>S();function fe(te){he[te?"unshift":"push"](()=>{a=te,t(7,a)})}const ye=te=>t(5,b=te.detail);function se(te){he[te?"unshift":"push"](()=>{u=te,t(8,u)})}const Z=te=>C(te.detail);return n.$$.update=()=>{var te;n.$$.dirty[0]&24&&y!==-1&&g!==-1&&(U.replaceClientQueryParams({filter:g,sort:y}),SLine truncated
|
||||
<span class="txt">Application</span>`,r=O(),o=_("a"),o.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||||
<span class="txt">Mail settings</span>`,a=O(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||||
<span class="txt">Files storage</span>`,f=O(),c=_("div"),c.textContent="Authentication",d=O(),h=_("a"),h.innerHTML=`<i class="ri-lock-password-line"></i>
|
||||
<span class="txt">Auth providers</span>`,g=O(),y=_("a"),y.innerHTML=`<i class="ri-key-line"></i>
|
||||
<span class="txt">Token options</span>`,b=O(),v=_("a"),v.innerHTML=`<i class="ri-shield-user-line"></i>
|
||||
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/auth-providers"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(v,"href","/settings/admins"),p(v,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(t,r),m(t,o),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,y),m(t,b),m(t,v),S||($=[Xe(oi.call(null,l,{path:"/settings"})),Xe(Mn.call(null,l)),Xe(oi.call(null,o,{path:"/settings/mail/?.*"})),Xe(Mn.call(null,o)),Xe(oi.call(null,u,{path:"/settings/storage/?.*"})),Xe(Mn.call(null,u)),Xe(oi.call(null,h,{path:"/settings/auth-providers/?.*"})),Xe(Mn.call(null,h)),Xe(oi.call(null,y,{path:"/settings/tokens/?.*"})),Xe(Mn.call(null,y)),Xe(oi.call(null,v,{path:"/settings/admins/?.*"})),Xe(Mn.call(null,v))],S=!0)},p:re,i:re,o:re,d(C){C&&k(e),S=!1,rt($)}}}class tl extends Fe{constructor(e){super(),Le(this,e,null,UA,Ae,{})}}function dg(n,e,t){const i=n.slice();return i[31]=e[t],i}function pg(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[WA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function WA(n){let e,t,i,s,l,r,o,a,u;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="ID",r=O(),o=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(o,"type","text"),p(o,"id",a=n[30]),o.value=u=n[1].id,o.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,r,c),w(f,o,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(o,"id",a),c[0]&2&&u!==(u=f[1].id)&&o.value!==u&&(o.value=u)},d(f){f&&k(e),f&&k(r),f&&k(o)}}}function hg(n){let e,t,i,s,l,r,o,a;function u(){return n[17](n[31])}function f(...c){return n[18](n[31],...c)}return{c(){e=_("figure"),t=_("img"),l=O(),ei(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt",s="Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",r="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(c,d){w(c,e,d),m(e,t),m(e,l),o||(a=[X(e,"click",u),X(e,"keydown",f)],o=!0)},p(c,d){n=c,d[0]&4&&r!==(r="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",r)},d(c){c&&k(e),o=!1,rt(a)}}}function YA(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="Email",r=O(),o=_("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(o,"type","email"),p(o,"autocomplete","off"),p(o,"id",a=n[30]),o.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,r,d),w(c,o,d),$e(o,n[3]),u||(f=X(o,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(o,"id",a),d[0]&8&&o.value!==c[3]&&$e(o,c[3])},d(c){c&&k(e),c&&k(r),c&&k(o),u=!1,f()}}}function mg(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[KA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function KA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",r=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[20]),o=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function gg(n){let e,t,i,s,l,r,o,a,u;return s=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[JA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[GA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),B(s.$$.fragment),l=O(),r=_("div"),B(o.$$.fragment),p(i,"class","col-sm-6"),p(r,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),V(s,i,null),m(t,l),m(t,r),V(o,r,null),u=!0},p(f,c){const d={};c[0]&1073742080|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742336|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),o.$set(h)},i(f){u||(A(s.$$.fragment,f),A(o.$$.fragment,f),Dt(()=>{a||(a=ft(t,un,{duration:150},!0)),a.Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function QA(n){let e,t,i,s,l,r,o=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&_g(n);return{c(){h&&h.c(),e=O(),t=_("button"),i=_("span"),i.textContent="Cancel",s=O(),l=_("button"),r=_("span"),a=H(o),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(g,y){h&&h.m(g,y),w(g,e,y),w(g,t,y),m(t,i),w(g,s,y),w(g,l,y),m(l,r),m(r,a),f=!0,c||(d=X(t,"click",n[16]),c=!0)},p(g,y){g[1].isNew?h&&(Oe(),F(h,1,1,()=>{h=null}),Te()):h?(h.p(g,y),y[0]&2&&A(h,1)):(h=_g(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||y[0]&64)&&(t.disabled=g[6]),(!f||y[0]&2)&&o!==(o=g[1].isNew?"Create":"Save changes")&&_e(a,o),(!f||y[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),y[0]&64&&Q(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){F(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function eE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[QA],header:[xA],default:[ZA]},$$scope:{ctx:n}};return e=new Di({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&1152&&(r.beforeHide=s[23]),l[0]&1886|l[1]&8&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[24](null),z(e,s)}}}function tE(n,e,t){let i;const s=_n(),l="admin_"+U.randomString(5);let r,o=new Us,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function y(K){return v(K),t(7,u=!0),r==null?void 0:r.show()}function b(){return r==null?void 0:r.hide()}function v(K){Wi({}),t(1,o=K!=null&&K.clone?K.clone():new Us),S()}function S(){t(4,g=!1),t(3,c=(o==null?void 0:o.email)||""),t(2,f=(o==null?void 0:o.avatar)||0),t(8,d=""),t(9,h="")}function $(){if(a||!i)return;t(6,a=!0);const K={email:c,avatar:f};(o.isNew||g)&&(K.password=d,K.passwordConfirm=h);let Y;o.isNew?Y=we.Admins.create(K):Y=we.Admins.update(o.id,K),Y.then(async ne=>{var fe;t(7,u=!1),b(),mn(o.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((fe=we.AuthStore.model)==null?void 0:fe.id)===ne.id&&we.AuthStore.save(we.AuthStore.token,ne)}).catch(ne=>{we.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function C(){!(o!=null&&o.id)||Ci("Do you really want to delete the selected admin?",()=>we.Admins.delete(o.id).then(()=>{t(7,u=!1),b(),mn("Successfully deleted admin."),s("delete",o)}).catch(K=>{we.errorResponseHandler(K)}))}const M=()=>C(),T=()=>b(),E=K=>t(2,f=K),D=(K,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=K))};function P(){c=this.value,t(3,c)}function L(){g=this.checked,t(4,g)}function N(){d=this.value,t(8,d)}function R(){h=this.value,t(9,h)}const J=()=>i&&u?(Ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function W(K){he[K?"unshift":"push"](()=>{r=K,t(5,r)})}function q(K){ut.call(this,n,K)}function G(K){ut.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=o.isNew&&c!=""||g||c!==o.email||f!==o.avatar)},[b,o,f,c,g,r,a,u,d,h,i,l,$,C,y,M,T,E,D,P,L,N,R,J,W,q,G]}class nE extends Fe{constructor(e){super(),Le(this,e,tE,eE,Ae,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function bg(n,e,t){const i=n.slice();return i[21]=e[t],i}function iE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function sE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function lE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function rE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="updated",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:re,d(l){l&&k(e)}}}function yg(n){let e;function t(l,r){return l[5]?aE:oE}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function oE(n){var o;let e,t,i,s,l,r=((o=n[1])==null?void 0:o.length)&&vg(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-centeLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function vg(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function kg(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wg(n,e){let t,i,s,l,r,o,a,u,f,c,d,h,g=e[21].email+"",y,b,v,S,$,C,M,T,E,D,P,L,N,R;u=new No({props:{id:e[21].id}});let J=e[21].id===e[6].id&&kg();$=new $i({props:{date:e[21].created}}),T=new $i({props:{date:e[21].updated}});function W(){return e[13](e[21])}function q(...G){return e[14](e[21],...G)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),o=O(),a=_("td"),B(u.$$.fragment),f=O(),J&&J.c(),c=O(),d=_("td"),h=_("span"),y=H(g),v=O(),S=_("td"),B($.$$.fragment),C=O(),M=_("td"),B(T.$$.fragment),E=O(),D=_("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',P=O(),ei(l.src,r="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg")||p(l,"src",r),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[21].email),p(d,"class","col-type-email col-field-email"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(G,K){w(G,t,K),m(t,i),m(i,s),m(s,l),m(t,o),m(t,a),V(u,a,null),m(a,f),J&&J.m(a,null),m(t,c),m(t,d),m(d,h),m(h,y),m(t,v),m(t,S),V($,S,null),m(t,C),m(t,M),V(T,M,null),m(t,E),m(t,D),m(t,P),L=!0,N||(R=[X(t,"click",W),X(t,"keydown",q)],N=!0)},p(G,K){e=G,(!L||K&16&&!ei(l.src,r="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg"))&&p(l,"src",r);const Y={};K&16&&(Y.id=e[21].id),u.$set(Y),e[21].id===e[6].id?J||(J=kg(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!L||K&16)&&g!==(g=e[21].email+"")&&_e(y,g),(!L||K&16&&b!==(b=e[21].email))&&p(h,"title",b);const ne={};K&16&&(ne.date=e[21].created),$.$set(ne);const fe={};K&16&&(fe.date=e[21].updated),T.$set(fe)},i(G){L||(A(u.$$.fragment,G),A($.$$.fragment,G),A(T.$$.fragment,G),L=!0)},o(G){F(u.$$.fragment,G),F($.$$.fragment,G),F(T.$$.fragment,G),L=!1},d(G){G&&k(t),z(u),J&&J.d(),z($),z(T),N=!1,rt(R)}}}function Sg(n){let e,t,i=n[4].length+"",s,l,r=n[4].length+"",o;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),o=H(r),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,o)},p(a,u){u&16&&i!==(i=a[4].length+"")&&_e(s,i),u&16&&r!==(r=a[4].length+"")&&_e(o,r)},d(a){a&&k(e)}}}function uE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$,C,M,T,E,D,P,L,N,R,J,W,q,G,K,Y=[],ne=new Map,fe,ye,se,Z,De,te;e=new tl({}),c=new Ao({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),c.$on("submit",n[8]);function be(ge){n[9](ge)}let ue={class:"col-type-text",name:"id",$$slots:{default:[iE]},$$scope:{ctx:n}};n[2]!==void 0&&(ue.sort=n[2]),$=new Qt({props:ue}),he.push(()=>Re($,"sort",be));function ie(ge){n[10](ge)}let ve={class:"col-type-email col-field-email",name:"email",$$slots:{default:[sE]},$$scope:{ctx:n}};n[2]!==void 0&&(ve.sort=n[2]),T=new Qt({props:ve}),he.push(()=>Re(T,"sort",ie));function He(ge){n[11](ge)}let Ie={class:"col-type-date col-field-created",name:"created",$$slots:{default:[lE]},$$scope:{ctx:n}};n[2]!==void 0&&(Ie.sort=n[2]),P=new Qt({props:Ie}),he.push(()=>Re(P,"sort",He));function qe(ge){n[12](ge)}let oe={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[rE]},$$scope:{ctx:n}};n[2]!==void 0&&(oe.sort=n[2]),R=new Qt({props:oe}),he.push(()=>Re(R,"sort",qe));let le=n[4];const ke=ge=>ge[21].id;for(let ge=0;ge<le.length;ge+=1){let Ee=bg(n,le,ge),x=ke(Ee);ne.set(x,Y[ge]=wg(x,Ee))}let Ve=null;le.length||(Ve=yg(n));let ze=n[4].length&&Sg(n),Ze={};return se=new nE({props:Ze}),n[16](se),se.$on("save",n[17]),se.$on("delete",n[18]),{c(){B(e.$$.fragment),t=O(),i=_("main"),s=_("header"),l=_("nav"),l.innerHTML=`<div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Admins</div>`,r=O(),o=_("div"),a=O(),u=_("button"),u.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New admin</span>`,f=O(),B(c.$$.fragment),d=O(),h=_("div"),g=_("table"),y=_("thead"),b=_("tr"),v=_("th"),S=O(),B($.$$.fragment),M=O(),B(T.$$.fragment),D=O(),B(P.$$.fragment),N=O(),B(R.$$.fragment),W=O(),q=_("th"),G=O(),K=_("tbody");for(let ge=0;ge<Y.length;ge+=1)Y[ge].c();Ve&&Ve.c(),fe=O(),ze&&ze.c(),ye=O(),B(se.$$.fragment),p(l,"class","breadcrumbs"),p(o,"class","flex-fill"),p(u,"type","button"),p(u,"class","btn btn-expanded"),p(s,"class","page-header"),p(v,"class","min-width"),p(q,"class","col-type-action min-width"),p(g,"class","table"),Q(g,"table-loading",n[5]),p(h,"class","table-wrapper"),p(i,"class","page-wrapper")},m(ge,Ee){V(e,ge,Ee),w(ge,t,Ee),w(ge,i,Ee),m(i,s),m(s,l),m(s,r),m(s,o),m(s,a),m(s,u),m(i,f),V(c,i,null),m(i,d),m(i,h),m(h,g),m(g,y),m(y,b),m(b,v),m(b,S),V($,b,null),m(b,M),V(T,b,null),m(b,D),V(P,b,null),m(b,N),V(R,b,null),m(b,W),m(b,q),m(g,G),m(g,K);for(let x=0;x<Y.length;x+=1)Y[x].m(K,null);Ve&&Ve.m(K,null),m(i,fe),ze&&ze.m(i,null),w(ge,ye,Ee),V(se,ge,Ee),Z=!0,De||(te=X(u,"click",n[7]),De=!0)},p(ge,[Ee]){const x={};Ee&2&&(x.value=ge[1]),c.$set(x);const ae={};Ee&16777216&&(ae.$$scope={dirty:Ee,ctx:ge}),!C&&Ee&4&&(C=!0,ae.sort=ge[2],je(()=>C=!1)),$.$set(ae);const Be={};Ee&16777216&&(Be.$$scope={dirty:Ee,ctx:ge}),!E&&Ee&4&&(E=!0,Be.sort=ge[2],je(()=>E=!1)),T.$set(Be);const vt={};Ee&16777216&&(vt.$$scope={dirty:Ee,ctx:ge}),!L&&Ee&4&&(L=!0,vt.sort=ge[2],je(()=>L=!1)),P.$set(vt);const it={};Ee&16777216&&(it.$$scope={dirty:Ee,ctx:ge}),!J&&Ee&4&&(J=!0,it.sort=ge[2],je(()=>J=!1)),R.$set(it),Ee&122&&(le=ge[4],Oe(),Y=ot(Y,Ee,ke,1,ge,le,ne,K,Lt,wg,null,bg),Te(),!le.length&&Ve?Ve.p(ge,Ee):le.length?Ve&&(Ve.d(1),Ve=null):(Ve=yg(ge),Ve.c(),Ve.m(K,null))),Ee&32&&Q(g,"table-loading",ge[5]),ge[4].length?ze?ze.p(ge,Ee):(ze=Sg(ge),ze.c(),ze.m(i,null)):ze&&(ze.d(1),ze=null);const gt={};se.$set(gt)},i(ge){if(!Z){A(e.$$.fragment,ge),A(c.$$.fragment,ge),A($.$$.fragment,ge),A(T.$$.fragment,ge),A(P.$$.fragment,ge),A(R.$$.fragment,ge);for(let Ee=0;Ee<le.length;Ee+=1)A(Y[Ee]);A(se.$$.fragment,ge),Z=!0}},o(ge){F(e.$$.fragment,ge),F(c.$$.fragment,ge),F($.$$.fragment,ge),F(T.$$.fragment,ge),F(P.$$.fragment,ge),F(R.$$.fragment,ge);for(let Ee=0;Ee<Y.length;Ee+=1)F(Y[Ee]);F(se.$$.fragment,ge),Z=!1},d(ge){z(e,ge),ge&&k(t),ge&&k(i),z(c),z($),z(T),z(P),z(R);for(let Ee=0;Ee<Y.length;Ee+=1)Y[Ee].d();Ve&&Ve.d(),ze&&ze.d(),ge&&k(ye),n[16](null),z(se,ge),De=!1,te()}}}function fE(n,e,t){var D;let i;hn(n,Vu,P=>t(6,i=P));const s=U.getQueryParams((D=window.location)==null?void 0:D.href);let l,r=[],o=!1,a=s.filter||"",u=s.sort||"-created";U.setDocumentTitle("Admins");function f(){return t(5,o=!0),t(4,r=[]),we.Admins.getFullList(100,{sort:u||"-created",filter:a}).then(P=>{t(4,r=P),t(5,o=!1)}).catch(P=>{P!==null&&(t(5,o=!1),console.warn(P),c(),we.errorResponseHandler(P,!1))})}function c(){t(4,r=[])}const d=()=>l==null?void 0:l.show(),h=P=>t(1,a=P.detail);function g(P){u=P,t(2,u)}function y(P){u=P,t(2,u)}function b(P){u=P,t(2,u)}function v(P){u=P,t(2,u)}const S=P=>l==null?void 0:l.show(P),$=(P,L)=>{(L.code==="Enter"||L.code==="Space")&&(L.preventDefault(),l==null||l.show(P))},C=()=>t(1,a="");function M(P){he[P?"unshift":"push"](()=>{l=P,t(3,l)})}const T=()=>f(),E=()=>f();return n.$$.update=()=>{n.$$.dirty&6&&u!==-1&&a!==-1&&(U.replaceClientQueryParams({filter:a,sort:u}),f())},[f,a,u,l,r,o,i,d,h,g,y,b,v,S,$,C,M,T,E]}class cE extends Fe{constructor(e){super(),Le(this,e,fE,uE,Ae,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function dE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Email"),s=O(),l=_("input"),p(e,"for",i=n[7]),p(l,"type","email"),p(l,"id",r=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0]),l.focus(),o||(a=X(l,"input",n[4]),o=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&r!==(r=u[7])&&p(l,"id",r),f&1&&l.value!==u[0]&&$e(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function pE(n){let e,t,i,s,l,r,o,a,u,f,c;return{c(){e=_("label"),t=H("Password"),s=O(),l=_("input"),o=O(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[7]),p(l,"type","password"),p(l,"id",r=n[7]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),$e(l,n[1]),w(d,o,h),w(d,a,h),m(a,u),f||(c=[X(l,"input",n[5]),Xe(Mn.call(null,u))],f=!0)},p(d,h){h&128&&i!==(i=d[7])&&p(e,"for",i),h&128&&r!==(r=d[7])&&p(l,"id",r),h&2&&l.value!==d[1]&&$e(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(o),d&&k(a),f=!1,rt(c)}}}function hE(n){let e,t,i,s,l,r,o,a,u,f,c;return s=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[dE,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[pE,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),a=_("butLine truncated
|
||||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),V(s,e,null),m(e,l),V(r,e,null),m(e,o),m(e,a),u=!0,f||(c=X(e,"submit",Kt(n[3])),f=!0)},p(d,h){const g={};h&385&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const y={};h&386&&(y.$$scope={dirty:h,ctx:d}),r.$set(y),h&4&&Q(a,"btn-disabled",d[2]),h&4&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(r.$$.fragment,d),u=!0)},o(d){F(s.$$.fragment,d),F(r.$$.fragment,d),u=!1},d(d){d&&k(e),z(s),z(r),f=!1,c()}}}function mE(n){let e,t;return e=new P0({props:{$$slots:{default:[hE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function gE(n,e,t){var f;const i=U.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",r=!1;function o(){if(!r)return t(2,r=!0),we.Admins.authViaEmail(s,l).then(()=>{Gs("/")}).catch(()=>{O0("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,r,o,a,u]}class _E extends Fe{constructor(e){super(),Le(this,e,gE,mE,Ae,{})}}function bE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S;return i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[vE,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[kE,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[wE,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),B(a.$$.fragment),u=O(),f=_("div"),c=_("div"),d=O(),h=_("button"),g=_("span"),g.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(g,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=y=!n[3]||n[2],Q(h,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m($,C){w($,e,C),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),V(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,h),m(h,g),b=!0,v||(S=X(h,"click",n[9]),v=!0)},p($,C){const M={};C&12289&&(M.$$scope={dirty:C,ctx:$}),i.$set(M);const T={};C&12289&&(T.$$scope={dirty:C,ctx:$}),r.$set(T);const E={};C&12289&&(E.$$scope={dirty:C,ctx:$}),a.$set(E),(!b||C&12&&y!==(y=!$[3]||$[2]))&&(h.disabled=y),C&4&&Q(h,"btn-loading",$[2])},i($){b||(A(i.$$.fragment,$),A(r.$$.fragment,$),A(a.$$.fragment,$),b=!0)},o($){F(i.$$.fragment,$),F(r.$$.fragment,$),F(a.$$.fragment,$),b=!1},d($){$&&k(e),z(i),z(r),z(a),v=!1,S()}}}function yE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function vE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Application name"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.appName),o||(a=X(l,"input",n[6]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&l.value!==u[0].meta.appName&&$e(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function kE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Application url"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.appUrl),o||(a=X(l,"input",n[7]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&l.value!==u[0].meta.appUrl&&$e(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function wE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Logs max days retention"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].logs.maxDays),o||(a=X(l,"input",n[8]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&Tt(l.value)!==u[0].logs.maxDays&&$e(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function SE(n){let e,t,i,s,l,r,o,a,u,f,c,d;e=new tl({});const h=[yE,bE],g=[];function y(b,v){return b[1]?0:1}return a=y(n),u=g[a]=h[a](n),{c(){B(e.$$.fragment),t=O(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Application</div></nav>`,l=O(),r=_("div"),o=_("form"),u.c(),p(s,"class","page-header"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(b,v){V(e,b,v),w(b,t,v),w(b,i,v),m(i,s),m(i,l),m(i,r),m(r,o),g[a].m(o,null),f=!0,c||(d=X(o,"submit",Kt(n[4])),c=!0)},p(b,[v]){let S=a;a=y(b),a===S?g[a].p(b,v):(Oe(),F(g[S],1,1,()=>{g[S]=null}),Te(),u=g[a],u?u.p(b,v):(u=g[a]=h[a](b),u.c()),A(u,1),u.m(o,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){F(e.$$.fragment,b),F(u),f=!1},d(b){z(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function $E(n,e,t){let i,s={},l=!1,r=!1,o="";U.setDocumentTitle("Application settings"),a();async function a(){t(1,l=!0);try{const y=await we.Settings.getAll()||{};f(y)}catch(y){we.errorResponseHandler(y)}t(1,l=!1)}async function u(){if(!(r||!i)){t(2,r=!0);try{const y=await we.Settings.update(U.filterRedactedProps(s));f(y),mn("Successfully saved application settings.")}catch(y){we.errorResponseHandler(y)}t(2,r=!1)}}function f(y={}){t(0,s={meta:(y==null?void 0:y.meta)||{},logs:(y==null?void 0:y.logs)||{}}),t(5,o=JSON.stringify(s))}function c(){s.meta.appName=this.value,t(0,s)}function d(){s.meta.appUrl=this.value,t(0,s)}function h(){s.logs.maxDays=Tt(this.value),t(0,s)}const g=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=o!=JSON.stringify(s))},[s,l,r,i,u,o,c,d,h,g]}class CE extends Fe{constructor(e){super(),Le(this,e,$E,SE,Ae,{})}}function ME(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let r=0;r<s.length;r+=1)l=ct(l,s[r]);return{c(){e=_("input"),ci(e,l)},m(r,o){w(r,e,o),e.autofocus&&e.focus(),n[7](e),$e(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(r,o){ci(e,l=bn(s,[{type:"password"},{autocomplete:"new-password"},o&32&&r[5]])),o&1&&e.value!==r[0]&&$e(e,r[0])},d(r){r&&k(e),n[7](null),t=!1,i()}}}function OE(n){let e,t,i,s,l,r,o=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<o.length;u+=1)a=ct(a,o[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),ci(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(r=[Xe(St.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){ci(s,a=bn(o,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,rt(r)}}}function TE(n){let e;function t(l,r){return l[3]?OE:ME}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},m(l,r){s.m(l,r),w(l,e,r)},p(l,[r]){i===(i=t(l))&&s?s.p(l,r):(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 DE(n,e,t){const i=["value","mask"];let s=Yt(e,i),{value:l=""}=e,{mask:r="******"}=e,o,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Mi(),o==null||o.focus()}const f=()=>u();function c(h){he[h?"unshift":"push"](()=>{o=h,t(2,o)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ct(ct({},e),di(h)),t(5,s=Yt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,r=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===r&&t(3,a=!0)},[l,r,o,a,u,s,f,c,d]}class mf extends Fe{constructor(e){super(),Le(this,e,DE,TE,Ae,{value:0,mask:1})}}function AE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$,C,M,T,E,D,P,L,N,R,J;i=new Ne({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[PE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[LE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[FE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),f=new Ne({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[IE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[NE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),S=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[RE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}});let W=n[0].smtp.enabled&&$g(n);return{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),B(a.$$.fragment),u=O(),B(f.$$.fragment),c=O(),B(d.$$.fragment),h=O(),g=_("hr"),y=O(),b=_("div"),b.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
|
||||
<br/>
|
||||
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||||
below.</strong></p>`,v=O(),B(S.$$.fragment),$=O(),W&&W.c(),C=O(),M=_("div"),T=_("div"),E=O(),D=_("button"),P=_("span"),P.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid"),p(b,"class","content m-b-sm"),p(T,"class","flex-fill"),p(P,"class","txt"),p(D,"type","submit"),p(D,"class","btn btn-expanded"),D.disabled=L=!n[3]||n[2],Q(D,"btn-loading",n[2]),p(M,"class","flex")},m(q,G){w(q,e,G),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),V(a,e,null),m(e,u),V(f,e,null),m(e,c),V(d,e,null),w(q,h,G),w(q,g,G),w(q,y,G),w(q,b,G),w(q,v,G),V(S,q,G),w(q,$,G),W&&W.m(q,G),w(q,C,G),w(q,M,G),m(M,T),m(M,E),m(M,D),m(D,P),N=!0,R||(J=X(D,"click",n[18]),R=!0)},p(q,G){const K={};G&12582913&&(K.$$scope={dirty:G,ctx:q}),i.$set(K);const Y={};G&12582913&&(Y.$$scope={dirty:G,ctx:q}),r.$set(Y);const ne={};G&12582913&&(ne.$$scope={dirty:G,ctx:q}),a.$set(ne);const fe={};G&12582913&&(fe.$$scope={dirty:G,ctx:q}),f.$set(fe);const ye={};G&12582913&&(ye.$$scope={dirty:G,ctx:q}),d.$set(ye);const se={};G&12582913&&(se.$$scope={dirty:G,ctx:q}),S.$set(se),q[0].smtp.enabled?W?(W.p(q,G),G&1&&A(W,1)):(W=$g(q),W.c(),A(W,1),W.m(C.parentNode,C)):W&&(Oe(),F(W,1,1,()=>{W=null}),Te()),(!N||G&12&&L!==(L=!q[3]||q[2]))&&(D.disabled=L),G&4&&Q(D,"btn-loading",q[2])},i(q){N||(A(i.$$.fragment,q),A(r.$$.fragment,q),A(a.$$.fragment,q),A(f.$$.fragment,q),A(d.$$.fragment,q),A(S.$$.fragment,q),A(W),N=!0)},o(q){F(i.$$.fragment,q),F(r.$$.fragment,q),F(a.$$.fragment,q),F(f.$$.fragment,q),F(d.$$.fragment,q),F(S.$$.fragment,q),F(W),N=!1},d(q){q&&k(e),z(i),z(r),z(a),z(f),z(d),q&&k(h),q&&k(g),q&&k(y),q&&k(b),q&&k(v),z(S,q),q&&k($),W&&W.d(q),q&&k(C),q&&k(M),R=!1,J()}}}function EE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function PE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Sender name"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.senderName),o||(a=X(l,"input",n[7]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].meta.senderName&&$e(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function LE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Sender address"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","email"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.senderAddress),o||(a=X(l,"input",n[8]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].meta.senderAddress&&$e(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function FE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User verification page url"),s=O(),l=_("input"),o=O(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userVerificationUrl),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[9]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userVerificationUrl&&$e(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function IE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User reset password page url"),s=O(),l=_("input"),o=O(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userResetPasswordUrl),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[10]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&$e(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function NE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User confirm email change page url"),s=O(),l=_("input"),o=O(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
|
||||
parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userConfirmEmailChangeUrl),w(c,o,d),w(c,a,d),u||(f=X(l,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&$e(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function RE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[22]),e.required=!0,p(s,"for",r=n[22])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[12]),o=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&4194304&&r!==(r=u[22])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function $g(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$;return i=new Ne({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[jE,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[HE,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[qE,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"smtp.username",$$slots:{default:[VE,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),y=new Ne({props:{class:"form-field",name:"smtp.password",$$slots:{default:[zE,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),h=O(),g=_("div"),B(y.$$.fragment),b=O(),v=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(v,"class","col-lg-12"),p(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),m(e,h),m(e,g),V(y,g,null),m(e,b),m(e,v),$=!0},p(C,M){const T={};M&12582913&&(T.$$scope={dirty:M,ctx:C}),i.$set(T);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:C}),r.$set(E);const D={};M&12582913&&(D.$$scope={dirty:M,ctx:C}),u.$set(D);const P={};M&12582913&&(P.$$scope={dirty:M,ctx:C}),d.$set(P);const L={};M&12582913&&(L.$$scope={dirty:M,ctx:C}),y.$set(L)},i(C){$||(A(i.$$.fragment,C),A(r.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(y.$$.fragment,C),C&&Dt(()=>{S||(S=ft(e,un,{duration:150},!0)),S.run(1)}),$=!0)},o(C){F(i.$$.fragment,C),F(r.$$.fragment,C),F(u.$$.fragment,C),F(d.$$.fragment,C),F(y.$$.fragment,C),C&&(S||(S=ft(e,un,{duration:150},!1)),S.run(0)),$=!1},d(C){C&&k(e),z(i),z(r),z(u),z(d),z(y),C&&S&&S.end()}}}function jE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("SMTP server host"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.host),o||(a=X(l,"input",n[13]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].smtp.host&&$e(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function HE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Port"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.port),o||(a=X(l,"input",n[14]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&Tt(l.value)!==u[0].smtp.port&&$e(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function qE(n){let e,t,i,s,l,r,o;function a(f){n[15](f)}let u={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new vs({props:u}),he.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=H("TLS Encryption"),s=O(),B(l.$$.fragment),p(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||c&4194304&&i!==(i=f[22]))&&p(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!r&&c&1&&(r=!0,d.keyOfSelected=f[0].smtp.tls,je(()=>r=!1)),l.$set(d)},i(f){o||(A(l.$$.fragment,f),o=!0)},o(f){F(l.$$.fragment,f),o=!1},d(f){f&&k(e),f&&k(s),z(l,f)}}}function VE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Username"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.username),o||(a=X(l,"input",n[16]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].smtp.username&&$e(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function zE(n){let e,t,i,s,l,r,o;function a(f){n[17](f)}let u={id:Line truncated
|
||||
<div class="breadcrumb-item">Mail settings</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,$){V(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Kt(n[19])),h=!0)},p(S,[$]){let C=f;f=v(S),f===C?b[f].p(S,$):(Oe(),F(b[C],1,1,()=>{b[C]=null}),Te(),c=b[f],c?c.p(S,$):(c=b[f]=y[f](S),c.c()),A(c,1),c.m(o,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function UE(n,e,t){let i;const s=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let l={},r=!1,o=!1,a="";U.setDocumentTitle("Mail settings"),u();async function u(){t(1,r=!0);try{const P=await we.Settings.getAll()||{};c(P)}catch(P){we.errorResponseHandler(P)}t(1,r=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const P=await we.Settings.update(U.filterRedactedProps(l));c(P),mn("Successfully saved mail settings.")}catch(P){we.errorResponseHandler(P)}t(2,o=!1)}}function c(P={}){t(0,l={meta:(P==null?void 0:P.meta)||{},smtp:(P==null?void 0:P.smtp)||{}}),t(6,a=JSON.stringify(l))}function d(){l.meta.senderName=this.value,t(0,l)}function h(){l.meta.senderAddress=this.value,t(0,l)}function g(){l.meta.userVerificationUrl=this.value,t(0,l)}function y(){l.meta.userResetPasswordUrl=this.value,t(0,l)}function b(){l.meta.userConfirmEmailChangeUrl=this.value,t(0,l)}function v(){l.smtp.enabled=this.checked,t(0,l)}function S(){l.smtp.host=this.value,t(0,l)}function $(){l.smtp.port=Tt(this.value),t(0,l)}function C(P){n.$$.not_equal(l.smtp.tls,P)&&(l.smtp.tls=P,t(0,l))}function M(){l.smtp.username=this.value,t(0,l)}function T(P){n.$$.not_equal(l.smtp.password,P)&&(l.smtp.password=P,t(0,l))}const E=()=>f(),D=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,r,o,i,s,f,a,d,h,g,y,b,v,S,$,C,M,T,E,D]}class WE extends Fe{constructor(e){super(),Le(this,e,UE,BE,Ae,{})}}function YE(n){let e,t,i,s,l,r,o,a,u,f,c,d;e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[JE,({uniqueId:g})=>({15:g}),({uniqueId:g})=>g?32768:0]},$$scope:{ctx:n}}});let h=n[0].enabled&&Cg(n);return{c(){B(e.$$.fragment),t=O(),h&&h.c(),i=O(),s=_("div"),l=_("div"),r=O(),o=_("button"),a=_("span"),a.textContent="Save changes",p(l,"class","flex-fill"),p(a,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[3]||n[2],Q(o,"btn-loading",n[2]),p(s,"class","flex")},m(g,y){V(e,g,y),w(g,t,y),h&&h.m(g,y),w(g,i,y),w(g,s,y),m(s,l),m(s,r),m(s,o),m(o,a),f=!0,c||(d=X(o,"click",n[12]),c=!0)},p(g,y){const b={};y&98305&&(b.$$scope={dirty:y,ctx:g}),e.$set(b),g[0].enabled?h?(h.p(g,y),y&1&&A(h,1)):(h=Cg(g),h.c(),A(h,1),h.m(i.parentNode,i)):h&&(Oe(),F(h,1,1,()=>{h=null}),Te()),(!f||y&12&&u!==(u=!g[3]||g[2]))&&(o.disabled=u),y&4&&Q(o,"btn-loading",g[2])},i(g){f||(A(e.$$.fragment,g),A(h),f=!0)},o(g){F(e.$$.fragment,g),F(h),f=!1},d(g){z(e,g),g&&k(t),h&&h.d(g),g&&k(i),g&&k(s),c=!1,d()}}}function KE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function JE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[15]),e.required=!0,p(s,"for",r=n[15])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[6]),o=!0)},p(u,f){f&32768&&t!==(t=u[15])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&32768&&r!==(r=u[15])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Cg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,S,$;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[GE,({uniqueId:C})=>({15:C}),({uniqueId:C})=>C?32768:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[ZE,({uniqueId:C})=>({15:C}),({uniqueId:C})=>C?32768:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[xE,({uniqueId:C})=>({15:C}),({uniqueId:C})=>C?32768:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[XE,({uniqueId:C})=>({15:C}),({uniqueId:C})=>C?32768:0]},$$scope:{ctx:n}}}),y=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[QE,({uniqueId:C})=>({15:C}),({uniqueId:C})=>C?32768:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),h=O(),g=_("div"),B(y.$$.fragment),b=O(),v=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(v,"class","col-lg-12"),p(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(eLine truncated
|
||||
<div class="breadcrumb-item">Files storage</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||||
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,$){V(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Kt(n[4])),h=!0)},p(S,[$]){let C=f;f=v(S),f===C?b[f].p(S,$):(Oe(),F(b[C],1,1,()=>{b[C]=null}),Te(),c=b[f],c?c.p(S,$):(c=b[f]=y[f](S),c.c()),A(c,1),c.m(o,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function tP(n,e,t){let i,s={},l=!1,r=!1,o="";U.setDocumentTitle("Files storage"),a();async function a(){t(1,l=!0);try{const S=await we.Settings.getAll()||{};f(S)}catch(S){we.errorResponseHandler(S)}t(1,l=!1)}async function u(){if(!(r||!i)){t(2,r=!0);try{const S=await we.Settings.update(U.filterRedactedProps({s3:s}));f(S),Wi({}),mn("Successfully saved Files storage settings.")}catch(S){we.errorResponseHandler(S)}t(2,r=!1)}}function f(S={}){t(0,s=(S==null?void 0:S.s3)||{}),t(5,o=JSON.stringify(s))}function c(){s.enabled=this.checked,t(0,s)}function d(){s.endpoint=this.value,t(0,s)}function h(){s.bucket=this.value,t(0,s)}function g(){s.region=this.value,t(0,s)}function y(){s.accessKey=this.value,t(0,s)}function b(S){n.$$.not_equal(s.secret,S)&&(s.secret=S,t(0,s))}const v=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=o!=JSON.stringify(s))},[s,l,r,i,u,o,c,d,h,g,y,b,v]}class nP extends Fe{constructor(e){super(),Le(this,e,tP,eP,Ae,{})}}function iP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",r=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[8]),o=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&r!==(r=u[16])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Mg(n){let e,t,i,s,l,r,o,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[sP,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field "+(U.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[lP,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field "+(U.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[rP,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const y={};h&1&&(y.class="form-field "+(U.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(y.$$scope={dirty:h,ctx:d}),r.$set(y);const b={};h&1&&(b.class="form-field "+(U.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(r.$$.fragment,d),A(u.$$.fragment,d),d&&Dt(()=>{f||(f=ft(e,un,{duration:150},!0)),f.run(1)}),c=!0)},o(d){F(i.$$.fragment,d),F(r.$$.fragment,d),F(u.$$.fragment,d),d&&(f||(f=ft(e,un,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),z(i),z(r),z(u),d&&f&&f.end()}}}function sP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Minimum password length"),s=O(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",r=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].minPasswordLength),o||(a=X(l,"input",n[9]),o=!0)},p(u,f){f&65536&&i!==(i=u[16])&&p(e,"for",i),f&65536&&r!==(r=u[16])&&p(l,"id",r),f&1&&Tt(l.value)!==u[0].minPasswordLength&&$e(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function lP(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[10](b)}let y={id:n[16],disabled:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(y.value=n[0].exceptDomains),o=new ks({props:y}),he.push(()=>Re(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),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[16]),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:`Email domains that are NOT allowed to sign up.
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&65536&&l!==(l=b[16]))&&p(e,"for",l);const S={};v&65536&&(S.id=b[16]),v&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&v&1&&(a=!0,S.value=b[0].exceptDomains,je(()=>a=!1)),o.$set(S)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function rP(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[11](b)}let y={id:n[16]+".config.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(y.value=n[0].onlyDomains),o=new ks({props:y}),he.push(()=>Re(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),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[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
|
||||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const S={};v&65536&&(S.id=b[16]+".config.onlyDomains"),v&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&v&1&&(a=!0,S.value=b[0].onlyDomains,je(()=>a=!1)),o.$set(S)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function oP(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[iP,({uniqueId:r})=>({16:r}),({uniqueId:r})=>r?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Mg(n);return{c(){B(e.$$.fragment),t=O(),l&&l.c(),i=lt()},m(r,o){V(e,r,o),w(r,t,o),l&&l.m(r,o),w(r,i,o),s=!0},p(r,o){const a={};o&196609&&(a.$$scope={dirty:o,ctx:r}),e.$set(a),r[0].enabled?l?(l.p(r,o),o&1&&A(l,1)):(l=Mg(r),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Oe(),F(l,1,1,()=>{l=null}),Te())},i(r){s||(A(e.$$.fragment,r),A(l),s=!0)},o(r){F(e.$$.fragment,r),F(l),s=!1},d(r){z(e,r),r&&k(t),l&&l.d(r),r&&k(i)}}}function aP(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uP(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Og(n){let e,t,i,s,l,r;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,a){w(o,e,a),s=!0,l||(r=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){s||(Dt(()=>{i||(i=ft(e,Wn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(o){i||(i=ft(e,Wn,{duration:150,start:.7},!1)),i.run(0),s=!1},d(o){o&&k(e),o&&i&&i.end(),l=!1,r()}}}function fP(n){let e,t,i,s,l,r,o;function a(d,h){return d[0].enabled?uP:aP}let u=a(n),f=u(n),c=n[2]&&Og();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||||
<span class="txt">Email/Password</span>`,t=O(),f.c(),i=O(),s=_("div"),l=O(),c&&c.c(),r=lt(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,r,h),o=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=Og(),c.c(),A(c,1),c.m(r.parentNode,r)):c&&(Oe(),F(c,1,1,()=>{c=null}),Te())},i(d){o||(A(c),o=!0)},o(d){F(c),o=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(r)}}}function cP(n){let e,t;const i=[n[3]];let s={$$slots:{header:[fP],default:[oP]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ct(s,i[l]);return e=new df({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){B(e.$$.fragment)},m(l,r){V(e,l,r),t=!0},p(l,[r]){const o=r&8?bn(i,[hi(l[3])]):{};r&131077&&(o.$$scope={dirty:r,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){F(e.$$.fragment,l),t=!1},d(l){n[12](null),z(e,l)}}}function dP(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Yt(e,s),r;hn(n,_s,C=>t(7,r=C));let{config:o={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){o.enabled=this.checked,t(0,o)}function h(){o.minPasswordLength=Tt(this.value),t(0,o)}function g(C){n.$$.not_equal(o.exceptDomains,C)&&(o.exceptDomains=C,t(0,o))}function y(C){n.$$.not_equal(o.onlyDomains,C)&&(o.onlyDomains=C,t(0,o))}function b(C){he[C?"unshift":"push"](()=>{a=C,t(1,a)})}function v(C){ut.call(this,n,C)}function S(C){ut.call(this,n,C)}function $(C){ut.call(this,n,C)}return n.$$set=C=>{e=ct(ct({},e),di(C)),t(3,l=Yt(e,s)),"config"in C&&t(0,o=C.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!U.isEmpty(r==null?void 0:r.emailPassword))},[o,a,i,l,u,f,c,r,d,h,g,y,b,v,S,$]}class pP extends Fe{constructor(e){super(),Le(this,e,dP,cP,Ae,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function hP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"for",r=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=X(e,"change",n[11]),o=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&r!==(r=u[22])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Tg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[mP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[gP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[_P,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let y=n[4]&&Dg(n);return{c(){e=_("div"),t=_("div"),i=O(),s=_("div"),B(l.$$.fragment),r=O(),o=_("div"),B(a.$$.fragment),u=O(),f=_("div"),B(c.$$.fragment),d=O(),y&&y.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),V(l,s,null),m(e,r),m(e,o),V(a,o,null),m(e,u),m(e,f),V(c,f,null),m(e,d),y&&y.m(e,null),g=!0},p(b,v){const S={};v&2&&(S.name=b[1]+".clientId"),v&12582913&&(S.$$scope={dirty:v,ctx:b}),l.$set(S);const $={};v&2&&($.name=b[1]+".clientSecret"),v&12582913&&($.$$scope={dirty:v,ctx:b}),a.$set($);const C={};v&2&&(C.name=b[1]+".allowRegistrations"),v&12582913&&(C.$$scope={dirty:v,ctx:b}),c.$set(C),b[4]?y?(y.p(b,v),v&16&&A(y,1)):(y=Dg(b),y.c(),A(y,1),y.m(e,null)):y&&(Oe(),F(y,1,1,()=>{y=null}),Te())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(y),b&&Dt(()=>{h||(h=ft(e,un,{duration:200},!0)),h.run(1)}),g=!0)},o(b){F(l.$$.fragment,b),F(a.$$.fragment,b),F(c.$$.fragment,b),F(y),b&&(h||(h=ft(e,un,{duration:200},!1)),h.run(0)),g=!1},d(b){b&&k(e),z(l),z(a),z(c),y&&y.d(),b&&h&&h.end()}}}function mP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Client ID"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].clientId),o||(a=X(l,"input",n[12]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].clientId&&$e(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function gP(n){let e,t,i,s,l,r,o;function a(f){n[13](f)}let u={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new mf({props:u}),he.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=H("Client Secret"),s=O(),B(l.$$.fragment),p(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||c&4194304&&i!==(i=f[22]))&&p(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!r&&c&Line truncated
|
||||
<div class="breadcrumb-item">Auth providers</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,$){V(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Kt(n[5])),h=!0)},p(S,[$]){let C=f;f=v(S),f===C?b[f].p(S,$):(Oe(),F(b[C],1,1,()=>{b[C]=null}),Te(),c=b[f],c?c.p(S,$):(c=b[f]=y[f](S),c.c()),A(c,1),c.m(o,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function AP(n,e,t){let i,s,l={},r=!1,o=!1,a="";U.setDocumentTitle("Auth providers"),u();async function u(){t(2,r=!0);try{const $=await we.Settings.getAll()||{};c($)}catch($){we.errorResponseHandler($)}t(2,r=!1)}async function f(){if(!(o||!i)){t(3,o=!0);try{const $=await we.Settings.update(U.filterRedactedProps(l));c($),Wi({}),s==null||s.collapseSiblings(),mn("Successfully updated auth providers.")}catch($){we.errorResponseHandler($)}t(3,o=!1)}}function c($){$=$||{},t(0,l={}),t(0,l.emailAuth=Object.assign({enabled:!0},$.emailAuth),l);const C=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of C)t(0,l[M]=Object.assign({enabled:!1,allowRegistrations:!0},$[M]),l);t(6,a=JSON.stringify(l))}function d($){he[$?"unshift":"push"](()=>{s=$,t(1,s)})}function h($){n.$$.not_equal(l.emailAuth,$)&&(l.emailAuth=$,t(0,l))}function g($){n.$$.not_equal(l.googleAuth,$)&&(l.googleAuth=$,t(0,l))}function y($){n.$$.not_equal(l.facebookAuth,$)&&(l.facebookAuth=$,t(0,l))}function b($){n.$$.not_equal(l.githubAuth,$)&&(l.githubAuth=$,t(0,l))}function v($){n.$$.not_equal(l.gitlabAuth,$)&&(l.gitlabAuth=$,t(0,l))}const S=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(l))},[l,s,r,o,i,f,a,d,h,g,y,b,v,S]}class EP extends Fe{constructor(e){super(),Le(this,e,AP,DP,Ae,{})}}function Pg(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function PP(n){let e=[],t=new Map,i,s,l,r,o,a,u,f,c,d,h=n[4];const g=y=>y[12].key;for(let y=0;y<h.length;y+=1){let b=Pg(n,h,y),v=g(b);t.set(v,e[y]=Lg(v,b))}return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=O(),s=_("div"),l=_("div"),r=O(),o=_("button"),a=_("span"),a.textContent="Save changes",p(l,"class","flex-fill"),p(a,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[3]||n[2],Q(o,"btn-loading",n[2]),p(s,"class","flex")},m(y,b){for(let v=0;v<e.length;v+=1)e[v].m(y,b);w(y,i,b),w(y,s,b),m(s,l),m(s,r),m(s,o),m(o,a),f=!0,c||(d=X(o,"click",n[9]),c=!0)},p(y,b){b&32785&&(h=y[4],Oe(),e=ot(e,b,g,1,y,h,t,i.parentNode,Lt,Lg,i,Pg),Te()),(!f||b&12&&u!==(u=!y[3]||y[2]))&&(o.disabled=u),b&4&&Q(o,"btn-loading",y[2])},i(y){if(!f){for(let b=0;b<h.length;b+=1)A(e[b]);f=!0}},o(y){for(let b=0;b<e.length;b+=1)F(e[b]);f=!1},d(y){for(let b=0;b<e.length;b+=1)e[b].d(y);y&&k(i),y&&k(s),c=!1,d()}}}function LP(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function FP(n){let e,t=n[12].label+"",i,s,l,r,o,a,u,f,c,d,h;function g(){n[7].call(o,n[12])}function y(){return n[8](n[12])}return{c(){e=_("label"),i=H(t),s=H(" duration (in seconds)"),r=O(),o=_("input"),u=O(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[15]),p(o,"type","number"),p(o,"id",a=n[15]),o.required=!0,p(c,"class","link-primary"),Q(c,"txt-success",n[0][n[12].key].secret),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,i),m(e,s),w(b,r,v),w(b,o,v),$e(o,n[0][n[12].key].duration),w(b,u,v),w(b,f,v),m(f,c),d||(h=[X(o,"input",g),X(c,"click",y)],d=!0)},p(b,v){n=b,v&32768&&l!==(l=n[15])&&p(e,"for",l),v&32768&&a!==(a=n[15])&&p(o,"id",a),v&17&&Tt(o.value)!==n[0][n[12].key].duration&&$e(o,n[0][n[12].key].duration),v&17&&Q(c,"txt-success",n[0][n[12].key].secret)},d(b){b&&k(e),b&&k(r),b&&k(o),b&&k(u),b&&k(f),d=!1,rt(h)}}}function Lg(n,e){let t,i,s;return i=new Ne({props:{class:"form-field required",name:e[12].key+".duration",$$slots:{default:[FP,({uniqueId:l})=>({15:l}),({uniqueId:l})=>l?32768:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=lt(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r&98305&&(o.$$scope={dirty:r,ctx:e}),i.$set(o)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function IP(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g;e=new tl({});const y=[LP,PP],b=[];function v(S,$){return S[1]?0:1}return f=v(n),c=b[f]=y[f](n),{c(){B(e.$$.fragment),t=O(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Token options</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML="<p>Adjust common token options.</p>",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content m-b-sm txt-xl"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(S,$){V(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=X(o,"submit",Kt(n[5])),h=!0)},p(S,[$]){let C=f;f=v(S),f===C?b[f].p(S,$):(Oe(),F(b[C],1,1,()=>{b[C]=null}),Te(),c=b[f],c?c.p(S,$):(c=b[f]=y[f](S),c.c()),A(c,1),c.m(o,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){F(e.$$.fragment,S),F(c),d=!1},d(S){z(e,S),S&&k(t),S&&k(i),b[f].d(),h=!1,g()}}}function NP(n,e,t){let i;const s=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let l={},r=!1,o=!1,a="";U.setDocumentTitle("Token options"),u();async function u(){t(1,r=!0);try{const y=await we.Settings.getAll()||{};c(y)}catch(y){we.errorResponseHandler(y)}t(1,r=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const y=await we.Settings.update(U.filterRedactedProps(l));c(y),mn("Successfully saved tokens options.")}catch(y){we.errorResponseHandler(y)}t(2,o=!1)}}function c(y){var b;y=y||{},t(0,l={});for(const v of s)t(0,l[v.key]={duration:((b=y[v.key])==null?void 0:b.duration)||0},l);t(6,a=JSON.stringify(l))}function d(y){l[y.key].duration=Tt(this.value),t(0,l)}const h=y=>{l[y.key].secret?(delete l[y.key].secret,t(0,l)):t(0,l[y.key].secret=U.randomString(50),l)},g=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,r,o,i,s,f,a,d,h,g]}class RP extends Fe{constructor(e){super(),Le(this,e,NP,IP,Ae,{})}}const dn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Gs("/"):!0}],jP={"/login":nn({component:_E,conditions:dn.concat([n=>!we.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":nn({asyncComponent:()=>rs(()=>import("./PageAdminRequestPasswordReset.ee789533.js"),[]),conditions:dn.concat([n=>!we.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":nn({asyncComponent:()=>rs(()=>import("./PageAdminConfirmPasswordReset.c5e4eccc.js"),[]),conditions:dn.concat([n=>!we.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":nn({component:yA,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":nn({component:A3,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users":nn({component:BA,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":nn({asyncComponent:()=>rs(()=>import("./PageUserConfirmPasswordReset.cc57a238.js"),[]),conditions:dn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":nn({asyncComponent:()=>rs(()=>import("./PageUserConfirmVerification.cde40736.js"),[]),conditions:dn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":nn({asyncComponent:()=>rs(()=>import("./PageUserConfirmEmailChange.921f1555.js"),[]),conditions:dn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":nn({component:CE,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":nn({component:cE,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":nn({component:WE,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":nn({component:nP,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":nn({component:EP,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":nn({component:RP,conditions:dn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"*":nn({component:r2,userData:{showAppSidebar:!1}})};function HP(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[r,o]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*r/t.width-(t.left+r),u=e.top+e.height*o/t.height-(t.top+o),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Do}=i;return{delay:f,duration:Jn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const y=g*a,b=g*u,v=h+g*e.width/t.width,S=h+g*e.height/t.height;return`transform: ${l} translate(${y}px, ${b}px) scale(${v}, ${S});`}}}function Fg(n,e,t){const i=n.slice();return i[2]=e[t],i}function qP(n){let e;return{c(){e=_("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function VP(n){let e;return{c(){e=_("i"),p(e,"class","ri-chLine truncated
|
||||
<span class="txt">Manage admins</span>`,t=O(),i=_("hr"),s=O(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||||
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),r||(o=[Xe(Mn.call(null,e)),X(l,"click",n[4])],r=!0)},p:re,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),r=!1,rt(o)}}}function XP(n){var c;let e,t,i,s,l,r,o,a,u,f=((c=n[1])==null?void 0:c.id)&&n[0]&&Ng(n);return s=new l1({props:{routes:jP}}),s.$on("routeLoading",n[2]),s.$on("conditionsFailed",n[3]),r=new WP({}),a=new ZP({}),{c(){e=_("div"),f&&f.c(),t=O(),i=_("div"),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment),p(i,"class","app-body"),p(e,"class","app-layout")},m(d,h){w(d,e,h),f&&f.m(e,null),m(e,t),m(e,i),V(s,i,null),w(d,l,h),V(r,d,h),w(d,o,h),V(a,d,h),u=!0},p(d,[h]){var g;((g=d[1])==null?void 0:g.id)&&d[0]?f?(f.p(d,h),h&3&&A(f,1)):(f=Ng(d),f.c(),A(f,1),f.m(e,t)):f&&(Oe(),F(f,1,1,()=>{f=null}),Te())},i(d){u||(A(f),A(s.$$.fragment,d),A(r.$$.fragment,d),A(a.$$.fragment,d),u=!0)},o(d){F(f),F(s.$$.fragment,d),F(r.$$.fragment,d),F(a.$$.fragment,d),u=!1},d(d){d&&k(e),f&&f.d(),z(s),d&&k(l),z(r,d),d&&k(o),z(a,d)}}}function QP(n,e,t){let i;hn(n,Vu,u=>t(1,i=u));let s,l=!1;function r(u){var f,c,d,h;((f=u==null?void 0:u.detail)==null?void 0:f.location)!==s&&(t(0,l=!!((d=(c=u==null?void 0:u.detail)==null?void 0:c.userData)!=null&&d.showAppSidebar)),s=(h=u==null?void 0:u.detail)==null?void 0:h.location,U.setDocumentTitle(""),Wi({}),Eb())}function o(){Gs("/")}function a(){we.logout()}return[l,i,r,o,a]}class eL extends Fe{constructor(e){super(),Le(this,e,QP,XP,Ae,{})}}new eL({target:document.getElementById("app")});export{rt as A,mn as B,U as C,Gs as D,lt as E,P0 as F,hn as G,Js as H,_n as I,pi as J,he as K,Ln as P,Fe as S,F as a,O as b,B as c,z as d,_ as e,p as f,w as g,m as h,Le as i,Xe as j,Oe as k,Mn as l,V as m,Te as n,k as o,we as p,Ne as q,Q as r,Ae as s,A as t,X as u,Kt as v,H as w,_e as x,re as y,$e as z};
|
||||
@@ -1 +1 @@
|
||||
@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #adb3b8;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #edf0f3;--baseAlt2Color: #dee3e8;--baseAlt3Color: #a9b4bc;--baseAlt4Color: #7c868d;--infoColor: #3da9fc;--infoAltColor: #d8eefe;--successColor: #2cb67d;--successAltColor: #daf6ea;--dangerColor: #ef4565;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffe7d6;--overlayColor: rgba(88, 95, 101, .3);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .05);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 24px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03"}.ri-4k-line:before{content:"\ea04"}.ri-a-b:befoLine truncated
|
||||
@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #adb3b8;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #edf0f3;--baseAlt2Color: #dee3e8;--baseAlt3Color: #a9b4bc;--baseAlt4Color: #7c868d;--infoColor: #3da9fc;--infoAltColor: #d8eefe;--successColor: #2cb67d;--successAltColor: #daf6ea;--dangerColor: #ef4565;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffe7d6;--overlayColor: rgba(88, 95, 101, .3);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .05);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 24px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03"}.ri-4k-line:before{content:"\ea04"}.ri-a-b:befoLine truncated
|
||||
Vendored
+2
-2
@@ -20,8 +20,8 @@
|
||||
window.Prism = window.Prism || {};
|
||||
window.Prism.manual = true;
|
||||
</script>
|
||||
<script type="module" crossorigin src="/_/assets/index.a658f3b6.js"></script>
|
||||
<link rel="stylesheet" href="/_/assets/index.a5726992.css">
|
||||
<script type="module" crossorigin src="/_/assets/index.c63abb6b.js"></script>
|
||||
<link rel="stylesheet" href="/_/assets/index.d97a62dd.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ var distDir embed.FS
|
||||
//go:embed dist/index.html
|
||||
var indexHTML embed.FS
|
||||
|
||||
// DistDirFS contains the embeded dist directory files (without the "dist" prefix)
|
||||
// DistDirFS contains the embedded dist directory files (without the "dist" prefix)
|
||||
var DistDirFS = echo.MustSubFS(distDir, "dist")
|
||||
|
||||
// DistIndexHTML contains the embeded dist/index.html file (without the "dist" prefix)
|
||||
// DistIndexHTML contains the embedded dist/index.html file (without the "dist" prefix)
|
||||
var DistIndexHTML = echo.MustSubFS(indexHTML, "dist")
|
||||
Generated
+37
-37
@@ -17,7 +17,7 @@
|
||||
"chart.js": "^3.7.1",
|
||||
"chartjs-adapter-luxon": "^1.1.0",
|
||||
"luxon": "^2.3.2",
|
||||
"pocketbase": "^0.1.1",
|
||||
"pocketbase": "^0.1.2",
|
||||
"prismjs": "^1.28.0",
|
||||
"sass": "^1.45.0",
|
||||
"svelte": "^3.44.0",
|
||||
@@ -27,9 +27,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/autocomplete": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.0.3.tgz",
|
||||
"integrity": "sha512-JTSBDC4tUyR8iRmCwQJaYpTXtOZmRn4gKjw1Fu4xIatFPqTJ7m0QRCdkdbzlvMovzjTiuHp4a8WUEB1c/LtiHg==",
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.0.4.tgz",
|
||||
"integrity": "sha512-uP7UodCRykPNwSAN+wYa/AS9gJI/V47echCAXUYgCgBXy3l19nwO7W/d29COtG/dfAsjBOhMDeh3Ms8Y5VZbrA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
@@ -97,9 +97,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@codemirror/view": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.0.2.tgz",
|
||||
"integrity": "sha512-mnVT/q1JvKPjpmjXJNeCi/xHyaJ3abGJsumIVpdQ1nE1MXAyHf7GHWt8QpWMUvDiqF0j+inkhVR2OviTdFFX7Q==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.0.3.tgz",
|
||||
"integrity": "sha512-1gDBymhbx2DZzwnR/rNUu1LiQqjxBJtFiB+4uLR6tHQ6vKhTIwUsP5uZUQ7SM7JxVx3UihMynnTqjcsC+mczZg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
@@ -922,9 +922,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/pocketbase": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.1.1.tgz",
|
||||
"integrity": "sha512-OW7h88+TS+TvBSdFTBq67x4TLdIET3KFqstTa+ufHKYv0wU3mdSnQO8yK/I05ExvY2XYWMH8csyB34W7+e9wDA==",
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.1.2.tgz",
|
||||
"integrity": "sha512-FnxpKttOsS0bfo0z6u20LgEPfvG/ItxbK/bOUnaCOov8rHs5qWP6al3cS0vGkieFOo0jqWwrexo4yzPIxnYsHw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
@@ -1018,9 +1018,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "2.75.7",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz",
|
||||
"integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==",
|
||||
"version": "2.76.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.76.0.tgz",
|
||||
"integrity": "sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
@@ -1097,9 +1097,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte": {
|
||||
"version": "3.48.0",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.48.0.tgz",
|
||||
"integrity": "sha512-fN2YRm/bGumvjUpu6yI3BpvZnpIm9I6A7HR4oUNYd7ggYyIwSA/BX7DJ+UXXffLp6XNcUijyLvttbPVCYa/3xQ==",
|
||||
"version": "3.49.0",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz",
|
||||
"integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
@@ -1154,9 +1154,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "2.9.13",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.13.tgz",
|
||||
"integrity": "sha512-AsOBAaT0AD7Mhe8DuK+/kE4aWYFMx/i0ZNi98hJclxb4e0OhQcZYUrvLjIaQ8e59Ui7txcvKMiJC1yftqpQoDw==",
|
||||
"version": "2.9.14",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.14.tgz",
|
||||
"integrity": "sha512-P/UCjSpSMcE54r4mPak55hWAZPlyfS369svib/gpmz8/01L822lMPOJ/RYW6tLCe1RPvMvOsJ17erf55bKp4Hw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.14.27",
|
||||
@@ -1199,9 +1199,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.0.3.tgz",
|
||||
"integrity": "sha512-JTSBDC4tUyR8iRmCwQJaYpTXtOZmRn4gKjw1Fu4xIatFPqTJ7m0QRCdkdbzlvMovzjTiuHp4a8WUEB1c/LtiHg==",
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.0.4.tgz",
|
||||
"integrity": "sha512-uP7UodCRykPNwSAN+wYa/AS9gJI/V47echCAXUYgCgBXy3l19nwO7W/d29COtG/dfAsjBOhMDeh3Ms8Y5VZbrA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
@@ -1263,9 +1263,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@codemirror/view": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.0.2.tgz",
|
||||
"integrity": "sha512-mnVT/q1JvKPjpmjXJNeCi/xHyaJ3abGJsumIVpdQ1nE1MXAyHf7GHWt8QpWMUvDiqF0j+inkhVR2OviTdFFX7Q==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.0.3.tgz",
|
||||
"integrity": "sha512-1gDBymhbx2DZzwnR/rNUu1LiQqjxBJtFiB+4uLR6tHQ6vKhTIwUsP5uZUQ7SM7JxVx3UihMynnTqjcsC+mczZg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
@@ -1767,9 +1767,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"pocketbase": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.1.1.tgz",
|
||||
"integrity": "sha512-OW7h88+TS+TvBSdFTBq67x4TLdIET3KFqstTa+ufHKYv0wU3mdSnQO8yK/I05ExvY2XYWMH8csyB34W7+e9wDA==",
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.1.2.tgz",
|
||||
"integrity": "sha512-FnxpKttOsS0bfo0z6u20LgEPfvG/ItxbK/bOUnaCOov8rHs5qWP6al3cS0vGkieFOo0jqWwrexo4yzPIxnYsHw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"axios": "^0.21.1",
|
||||
@@ -1829,9 +1829,9 @@
|
||||
}
|
||||
},
|
||||
"rollup": {
|
||||
"version": "2.75.7",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.75.7.tgz",
|
||||
"integrity": "sha512-VSE1iy0eaAYNCxEXaleThdFXqZJ42qDBatAwrfnPlENEZ8erQ+0LYX4JXOLPceWfZpV1VtZwZ3dFCuOZiSyFtQ==",
|
||||
"version": "2.76.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.76.0.tgz",
|
||||
"integrity": "sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fsevents": "~2.3.2"
|
||||
@@ -1884,9 +1884,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"svelte": {
|
||||
"version": "3.48.0",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.48.0.tgz",
|
||||
"integrity": "sha512-fN2YRm/bGumvjUpu6yI3BpvZnpIm9I6A7HR4oUNYd7ggYyIwSA/BX7DJ+UXXffLp6XNcUijyLvttbPVCYa/3xQ==",
|
||||
"version": "3.49.0",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz",
|
||||
"integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==",
|
||||
"dev": true
|
||||
},
|
||||
"svelte-flatpickr": {
|
||||
@@ -1924,9 +1924,9 @@
|
||||
}
|
||||
},
|
||||
"vite": {
|
||||
"version": "2.9.13",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.13.tgz",
|
||||
"integrity": "sha512-AsOBAaT0AD7Mhe8DuK+/kE4aWYFMx/i0ZNi98hJclxb4e0OhQcZYUrvLjIaQ8e59Ui7txcvKMiJC1yftqpQoDw==",
|
||||
"version": "2.9.14",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.14.tgz",
|
||||
"integrity": "sha512-P/UCjSpSMcE54r4mPak55hWAZPlyfS369svib/gpmz8/01L822lMPOJ/RYW6tLCe1RPvMvOsJ17erf55bKp4Hw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esbuild": "^0.14.27",
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
"chart.js": "^3.7.1",
|
||||
"chartjs-adapter-luxon": "^1.1.0",
|
||||
"luxon": "^2.3.2",
|
||||
"pocketbase": "^0.1.1",
|
||||
"pocketbase": "^0.1.2",
|
||||
"prismjs": "^1.28.0",
|
||||
"sass": "^1.45.0",
|
||||
"svelte": "^3.44.0",
|
||||
|
||||
+6
-6
@@ -16,11 +16,15 @@
|
||||
|
||||
let oldLocation = undefined;
|
||||
|
||||
let showAppSidebar = false;
|
||||
|
||||
function handleRouteLoading(e) {
|
||||
if (e?.detail?.location === oldLocation) {
|
||||
return; // not an actual change
|
||||
}
|
||||
|
||||
showAppSidebar = !!e?.detail?.userData?.showAppSidebar;
|
||||
|
||||
oldLocation = e?.detail?.location;
|
||||
|
||||
// resets
|
||||
@@ -30,11 +34,7 @@
|
||||
}
|
||||
|
||||
function handleRouteFailure() {
|
||||
if (ApiClient.AuthStore.isValid) {
|
||||
replace("/");
|
||||
} else {
|
||||
ApiClient.logout();
|
||||
}
|
||||
replace("/");
|
||||
}
|
||||
|
||||
function logout() {
|
||||
@@ -43,7 +43,7 @@
|
||||
</script>
|
||||
|
||||
<div class="app-layout">
|
||||
{#if $admin?.id}
|
||||
{#if $admin?.id && showAppSidebar}
|
||||
<aside class="app-sidebar">
|
||||
<a href="/" class="logo logo-sm" use:link>
|
||||
<img
|
||||
|
||||
@@ -1,487 +0,0 @@
|
||||
<script>
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
|
||||
import OverlayPanel from "@/components/base/OverlayPanel.svelte";
|
||||
import { addInfoToast } from "@/stores/toasts";
|
||||
|
||||
let popupActive = true;
|
||||
|
||||
setTimeout(function () {
|
||||
addInfoToast("Hello world");
|
||||
}, 500);
|
||||
</script>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="">EXAMPLE</label>
|
||||
<ObjectSelect multiple searchable items={["test1", "test2"]} />
|
||||
</div>
|
||||
<hr />
|
||||
<div class="form-field">
|
||||
<label for="">EXAMPLE</label>
|
||||
<ObjectSelect searchable items={["test1", "test2"]} />
|
||||
</div>
|
||||
<hr />
|
||||
<div class="form-field disabled">
|
||||
<label for="">EXAMPLE</label>
|
||||
<ObjectSelect disabled searchable items={["test1", "test2"]} />
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div class="alert">
|
||||
<div class="icon">
|
||||
<i class="ri-information-line" />
|
||||
</div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close">
|
||||
<i class="ri-close-line" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<div class="icon">
|
||||
<i class="ri-information-line" />
|
||||
</div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close">
|
||||
<i class="ri-close-line" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<div class="icon">
|
||||
<i class="ri-information-line" />
|
||||
</div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close">
|
||||
<i class="ri-close-line" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
<div class="icon">
|
||||
<i class="ri-error-warning-line" />
|
||||
</div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close">
|
||||
<i class="ri-close-line" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-success">
|
||||
<div class="icon">
|
||||
<i class="ri-checkbox-circle-line" />
|
||||
</div>
|
||||
<div class="content">Hello world!</div>
|
||||
<div class="close">
|
||||
<i class="ri-close-line" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h1>H1 title</h1>
|
||||
<p>Lorem Ipsum dolor sit amet...</p>
|
||||
<h2>H2 title</h2>
|
||||
<p>Lorem Ipsum dolor sit amet...</p>
|
||||
<h3>H3 title</h3>
|
||||
<p>Lorem Ipsum dolor sit amet...</p>
|
||||
<h4>H4 title</h4>
|
||||
<p>Lorem Ipsum dolor sit amet...</p>
|
||||
<h5>H5 title</h5>
|
||||
<p>Lorem Ipsum dolor sit amet...</p>
|
||||
<h6>H6 title</h6>
|
||||
<p>Lorem Ipsum dolor sit amet...</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="grid">
|
||||
<div class="col-6">COL1</div>
|
||||
<div class="col-6">COL2</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Lorem Ipsum is <a href="/">simply dummy</a> text of the printing and typesetting industry. Lorem Ipsum has
|
||||
been the industry's
|
||||
<strong>standard</strong> dummy text ever since the 1500s, when an unknown printer took a galley of type
|
||||
and <em>scrambled</em> it to make a type specimen book. It has survived not only five centuries, but also
|
||||
the leap into electronic typesetting, remaining<sup>1</sup> essentially<sub>2</sub> unchanged.
|
||||
</p>
|
||||
<p>
|
||||
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and
|
||||
more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><small>Option 1</small></li>
|
||||
<li>Option 2</li>
|
||||
<li>Option 3</li>
|
||||
</ul>
|
||||
|
||||
<ol>
|
||||
<li>Option 1</li>
|
||||
<li>Option 2</li>
|
||||
<li>Option 3</li>
|
||||
</ol>
|
||||
|
||||
<hr />
|
||||
|
||||
<span use:tooltip={"My tooltip"}>Lorem Ipsum</span>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn">Button default</button>
|
||||
<button class="btn btn-danger">Button danger</button>
|
||||
<button class="btn btn-warning">Button warning</button>
|
||||
<button class="btn btn-success">Button success</button>
|
||||
<button class="btn btn-info">Button info</button>
|
||||
<button class="btn btn-hint">Button hint</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn btn-secondary">Button default</button>
|
||||
<button class="btn btn-secondary btn-danger">Button danger</button>
|
||||
<button class="btn btn-secondary btn-warning">Button danger</button>
|
||||
<button class="btn btn-secondary btn-success">Button success</button>
|
||||
<button class="btn btn-secondary btn-info">Button info</button>
|
||||
<button class="btn btn-secondary btn-hint">Button hint</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn btn-outline">Button default</button>
|
||||
<button class="btn btn-outline btn-danger">Button danger</button>
|
||||
<button class="btn btn-outline btn-warning">Button danger</button>
|
||||
<button class="btn btn-outline btn-success">Button success</button>
|
||||
<button class="btn btn-outline btn-info">Button info</button>
|
||||
<button class="btn btn-outline btn-hint">Button hint</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button disabled class="btn">Button default</button>
|
||||
<button disabled class="btn btn-danger">Button danger</button>
|
||||
<button disabled class="btn btn-warning">Button warning</button>
|
||||
<button disabled class="btn btn-success">Button success</button>
|
||||
<button disabled class="btn btn-info">Button info</button>
|
||||
<button disabled class="btn btn-hint">Button hint</button>
|
||||
|
||||
<button disabled class="btn btn-secondary">Button default</button>
|
||||
<button disabled class="btn btn-secondary btn-danger">Button danger</button>
|
||||
<button disabled class="btn btn-secondary btn-warning">Button danger</button>
|
||||
<button disabled class="btn btn-secondary btn-success">Button success</button>
|
||||
<button disabled class="btn btn-secondary btn-info">Button info</button>
|
||||
<button disabled class="btn btn-secondary btn-hint">Button hint</button>
|
||||
<hr />
|
||||
|
||||
<button class="btn">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button default</span>
|
||||
</button>
|
||||
<button class="btn btn-danger">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button danger</span>
|
||||
</button>
|
||||
<button class="btn btn-warning">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button warning</span>
|
||||
</button>
|
||||
<button class="btn btn-success">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button success</span>
|
||||
</button>
|
||||
<button class="btn btn-hint">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button hint</span>
|
||||
</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button default</span>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button danger</span>
|
||||
</button>
|
||||
<button class="btn btn-warning btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button warning</span>
|
||||
</button>
|
||||
<button class="btn btn-success btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button success</span>
|
||||
</button>
|
||||
<button class="btn btn-hint btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button hint</span>
|
||||
</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button default</span>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button danger</span>
|
||||
</button>
|
||||
<button class="btn btn-warning btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button warning</span>
|
||||
</button>
|
||||
<button class="btn btn-success btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button success</span>
|
||||
</button>
|
||||
<button class="btn btn-hint btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button hint</span>
|
||||
</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button class="btn btn-sm btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button class="btn btn-lg btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
|
||||
<button class="btn btn-secondary btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-sm btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button class="btn btn-secondary btn-lg btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button class="btn btn-loading">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button Loading</span>
|
||||
</button>
|
||||
<button class="btn btn-loading btn-primary btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button Loading</span>
|
||||
</button>
|
||||
<button class="btn btn-loading btn-danger btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button Loading</span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-loading btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button class="btn btn-loading btn-primary btn-sm btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button class="btn btn-loading btn-danger btn-lg btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<button disabled class="btn btn-loading">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button Loading</span>
|
||||
</button>
|
||||
<button disabled class="btn btn-loading btn-primary btn-sm">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button Loading</span>
|
||||
</button>
|
||||
<button disabled class="btn btn-loading btn-danger btn-lg">
|
||||
<i class="ri-mail-line" />
|
||||
<span class="txt">Button Loading</span>
|
||||
</button>
|
||||
|
||||
<button disabled class="btn btn-loading btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button disabled class="btn btn-loading btn-primary btn-sm btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
<button disabled class="btn btn-loading btn-danger btn-lg btn-circle">
|
||||
<i class="ri-mail-line" />
|
||||
</button>
|
||||
|
||||
<hr />
|
||||
|
||||
<input type="text" />
|
||||
|
||||
<hr />
|
||||
<select>
|
||||
<option value="1" selected>Option 1</option>
|
||||
<option value="">Option 2</option>
|
||||
<option value="">Option 3</option>
|
||||
</select>
|
||||
<hr />
|
||||
|
||||
<textarea cols="30" rows="10" />
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-field required">
|
||||
<label for="field_1">Name</label>
|
||||
<input type="text" id="field_1" placeholder="Name 123" />
|
||||
</div>
|
||||
|
||||
<div class="form-field required">
|
||||
<label for="field_2">Description</label>
|
||||
<textarea id="field_2" />
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="field_3">Choose value</label>
|
||||
<select id="field_3">
|
||||
<option value="1" selected>Option 1</option>
|
||||
<option value="">Option 2</option>
|
||||
<option value="">Option 3</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-field">
|
||||
<input type="text" placeholder="Lorem ipsum dolor sit amet..." />
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<textarea />
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<select>
|
||||
<option value="1" selected>Option 1</option>
|
||||
<option value="">Option 2</option>
|
||||
<option value="">Option 3</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-field">
|
||||
<input type="checkbox" id="field_check" />
|
||||
<label for="field_check">
|
||||
I agree with the <a href="/">terms and conditions</a>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<input type="radio" name="radio_check" id="field_radio1" value="1" />
|
||||
<label for="field_radio1">Radio 1</label>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<input type="radio" name="radio_check" id="field_radio2" value="2" />
|
||||
<label for="field_radio2">Radio 2</label>
|
||||
</div>
|
||||
|
||||
<div class="form-field form-field-toggle">
|
||||
<input type="checkbox" id="field_toggle" />
|
||||
<label for="field_toggle">Toggle check</label>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-field error">
|
||||
<label for="field_error">Name + error</label>
|
||||
<input type="text" id="field_error" />
|
||||
<div class="help-block help-block-error">
|
||||
<p>Something went wrong</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="field_hint">Name + hint</label>
|
||||
<input type="text" id="field_hint" />
|
||||
<div class="help-block">
|
||||
<p>Lorem ipsum dolor <a href="/">sit</a> amet</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<input type="checkbox" id="field_check_hint" />
|
||||
<label for="field_check_hint">Checkbox hint</label>
|
||||
<div class="help-block">Lorem ipsum</div>
|
||||
</div>
|
||||
|
||||
<div class="form-field has-error">
|
||||
<input type="checkbox" id="field_check_error" />
|
||||
<label for="field_check_error">Checkbox error</label>
|
||||
<div class="help-block help-error">Lorem ipsum</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-field disabled">
|
||||
<input type="checkbox" id="field_check" disabled />
|
||||
<label for="field_check">
|
||||
I agree with the <a href="/">terms and conditions</a>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<input type="radio" name="radio_check" id="field_radio1" value="1" disabled />
|
||||
<label for="field_radio1">Radio 1</label>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<input type="radio" name="radio_check" id="field_radio2" value="2" disabled />
|
||||
<label for="field_radio2">Radio 2</label>
|
||||
</div>
|
||||
|
||||
<div class="form-field form-field-toggle disabled">
|
||||
<input type="checkbox" id="field_toggle" disabled />
|
||||
<label for="field_toggle" />
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-field disabled">
|
||||
<label for="field_addon1">Name</label>
|
||||
<div class="form-field-addon">
|
||||
<i class="ri-mail-line" />
|
||||
</div>
|
||||
<input disabled type="text" id="field_addon1" />
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<div class="form-field-addon">
|
||||
<i class="ri-mail-line" />
|
||||
</div>
|
||||
<input type="text" />
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-field">
|
||||
<label for="field_group1">Name</label>
|
||||
<div class="form-field-addon">
|
||||
<div class="btn btn-circle btn-secondary">
|
||||
<i class="ri-mail-line" />
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" id="field_group1" />
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label for="field_group2">Password</label>
|
||||
<div class="form-field-addon">
|
||||
<i class="ri-mail-line" />
|
||||
</div>
|
||||
<input type="password" id="field_group2" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<OverlayPanel bind:active={popupActive} popup={false}>
|
||||
<h4 slot="header">My title</h4>
|
||||
<p>Lorem ipsum dolor sit amet...</p>
|
||||
<svelte:fragment slot="footer">
|
||||
<button class="btn btn-secondary">Cancel</button>
|
||||
<button class="btn btn-expanded">Save</button>
|
||||
</svelte:fragment>
|
||||
</OverlayPanel>
|
||||
@@ -1,5 +0,0 @@
|
||||
<script>
|
||||
import { replace } from "svelte-spa-router";
|
||||
|
||||
replace("/collections");
|
||||
</script>
|
||||
@@ -0,0 +1,43 @@
|
||||
<script>
|
||||
import { tick } from "svelte";
|
||||
import { replace } from "svelte-spa-router";
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import FullPage from "@/components/base/FullPage.svelte";
|
||||
import Installer from "@/components/base/Installer.svelte";
|
||||
|
||||
let showInstaller = false;
|
||||
|
||||
handler();
|
||||
|
||||
function handler() {
|
||||
showInstaller = false;
|
||||
|
||||
const realQueryParams = new URLSearchParams(window.location.search);
|
||||
if (realQueryParams.has(import.meta.env.PB_INSTALLER_PARAM)) {
|
||||
ApiClient.logout(false);
|
||||
showInstaller = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ApiClient.AuthStore.isValid) {
|
||||
replace("/collections");
|
||||
} else {
|
||||
ApiClient.logout();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if showInstaller}
|
||||
<FullPage>
|
||||
<Installer
|
||||
on:submit={async () => {
|
||||
showInstaller = false;
|
||||
|
||||
await tick();
|
||||
|
||||
// clear the installer param
|
||||
window.location.search = "";
|
||||
}}
|
||||
/>
|
||||
</FullPage>
|
||||
{/if}
|
||||
@@ -0,0 +1,76 @@
|
||||
<script>
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import Field from "@/components/base/Field.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
let email = "";
|
||||
let password = "";
|
||||
let passwordConfirm = "";
|
||||
let isLoading = false;
|
||||
|
||||
async function submit() {
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading = true;
|
||||
|
||||
try {
|
||||
await ApiClient.Admins.create({
|
||||
email,
|
||||
password,
|
||||
passwordConfirm,
|
||||
});
|
||||
|
||||
await ApiClient.Admins.authViaEmail(email, password);
|
||||
|
||||
dispatch("submit");
|
||||
} catch (err) {
|
||||
ApiClient.errorResponseHandler(err);
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<form class="block" autocomplete="off" on:submit|preventDefault={submit}>
|
||||
<div class="content txt-center m-b-base">
|
||||
<h4>Create your first admin account in order to continue</h4>
|
||||
</div>
|
||||
|
||||
<Field class="form-field required" name="email" let:uniqueId>
|
||||
<label for={uniqueId}>Email</label>
|
||||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<input type="email" autocomplete="off" id={uniqueId} bind:value={email} required autofocus />
|
||||
</Field>
|
||||
|
||||
<Field class="form-field required" name="password" let:uniqueId>
|
||||
<label for={uniqueId}>Password</label>
|
||||
<input
|
||||
type="password"
|
||||
autocomplete="new-password"
|
||||
minlength="10"
|
||||
id={uniqueId}
|
||||
bind:value={password}
|
||||
required
|
||||
/>
|
||||
<div class="help-block">Minimum 10 characters.</div>
|
||||
</Field>
|
||||
|
||||
<Field class="form-field required" name="passwordConfirm" let:uniqueId>
|
||||
<label for={uniqueId}>Password confirm</label>
|
||||
<input type="password" minlength="10" id={uniqueId} bind:value={passwordConfirm} required />
|
||||
</Field>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-lg btn-block btn-next"
|
||||
class:btn-disabled={isLoading}
|
||||
class:btn-loading={isLoading}
|
||||
>
|
||||
<span class="txt">Create and login</span>
|
||||
<i class="ri-arrow-right-line" />
|
||||
</button>
|
||||
</form>
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.Realtime.subscribe("${collection?.name}", function (e) {
|
||||
console.log(e.data);
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.Realtime.subscribe("${collection?.name}/RECORD_ID", function (e) {
|
||||
console.log(e.data);
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
required={field.required}
|
||||
min={field.options?.min}
|
||||
max={field.options?.max}
|
||||
step="any"
|
||||
bind:value
|
||||
/>
|
||||
</Field>
|
||||
+49
-23
@@ -1,5 +1,7 @@
|
||||
import { replace } from "svelte-spa-router";
|
||||
import { wrap } from "svelte-spa-router/wrap";
|
||||
import ApiClient from "@/utils/ApiClient";
|
||||
import PageIndex from "@/components/PageIndex.svelte";
|
||||
import PageLogs from "@/components/logs/PageLogs.svelte";
|
||||
import PageRecords from "@/components/records/PageRecords.svelte";
|
||||
import PageUsers from "@/components/users/PageUsers.svelte";
|
||||
@@ -11,107 +13,131 @@ import PageStorage from "@/components/settings/PageStorage.svelte";
|
||||
import PageAuthProviders from "@/components/settings/PageAuthProviders.svelte";
|
||||
import PageTokenOptions from "@/components/settings/PageTokenOptions.svelte";
|
||||
|
||||
const routes = {
|
||||
"/_elements": wrap({
|
||||
asyncComponent: () => import("@/components/Elements.svelte"),
|
||||
}),
|
||||
const baseConditions = [
|
||||
async (details) => {
|
||||
const realQueryParams = new URLSearchParams(window.location.search);
|
||||
|
||||
if (details.location !== "/" && realQueryParams.has(import.meta.env.PB_INSTALLER_PARAM)) {
|
||||
return replace("/")
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
];
|
||||
|
||||
const routes = {
|
||||
"/login": wrap({
|
||||
component: PageAdminLogin,
|
||||
conditions: [(_) => !ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => !ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
|
||||
"/request-password-reset": wrap({
|
||||
asyncComponent: () => import("@/components/admins/PageAdminRequestPasswordReset.svelte"),
|
||||
conditions: [(_) => !ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => !ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
|
||||
"/confirm-password-reset/:token": wrap({
|
||||
asyncComponent: () => import("@/components/admins/PageAdminConfirmPasswordReset.svelte"),
|
||||
conditions: [(_) => !ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => !ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
|
||||
"/collections": wrap({
|
||||
component: PageRecords,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/logs": wrap({
|
||||
component: PageLogs,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/users": wrap({
|
||||
component: PageUsers,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/users/confirm-password-reset/:token": wrap({
|
||||
asyncComponent: () => import("@/components/users/PageUserConfirmPasswordReset.svelte"),
|
||||
conditions: [
|
||||
conditions: baseConditions.concat([
|
||||
() => {
|
||||
// ensure that there is no authenticated user/admin model
|
||||
ApiClient.logout(false);
|
||||
return true;
|
||||
},
|
||||
],
|
||||
]),
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
|
||||
"/users/confirm-verification/:token": wrap({
|
||||
asyncComponent: () => import("@/components/users/PageUserConfirmVerification.svelte"),
|
||||
conditions: [
|
||||
conditions: baseConditions.concat([
|
||||
() => {
|
||||
// ensure that there is no authenticated user/admin model
|
||||
ApiClient.logout(false);
|
||||
return true;
|
||||
},
|
||||
],
|
||||
]),
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
|
||||
"/users/confirm-email-change/:token": wrap({
|
||||
asyncComponent: () => import("@/components/users/PageUserConfirmEmailChange.svelte"),
|
||||
conditions: [
|
||||
conditions: baseConditions.concat([
|
||||
() => {
|
||||
// ensure that there is no authenticated user/admin model
|
||||
ApiClient.logout(false);
|
||||
return true;
|
||||
},
|
||||
],
|
||||
]),
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
|
||||
"/settings": wrap({
|
||||
component: PageApplication,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/settings/admins": wrap({
|
||||
component: PageAdmins,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/settings/mail": wrap({
|
||||
component: PageMail,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/settings/storage": wrap({
|
||||
component: PageStorage,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/settings/auth-providers": wrap({
|
||||
component: PageAuthProviders,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
"/settings/tokens": wrap({
|
||||
component: PageTokenOptions,
|
||||
conditions: [(_) => ApiClient.AuthStore.isValid],
|
||||
conditions: baseConditions.concat([(_) => ApiClient.AuthStore.isValid]),
|
||||
userData: { showAppSidebar: true },
|
||||
}),
|
||||
|
||||
// fallback
|
||||
"*": wrap({
|
||||
asyncComponent: () => import("@/components/NotFoundPage.svelte"),
|
||||
component: PageIndex,
|
||||
userData: { showAppSidebar: false },
|
||||
}),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user