diff --git a/pkg/db/fixtures/namespaces.yml b/pkg/db/fixtures/namespaces.yml index 9d3c5511..133026d4 100644 --- a/pkg/db/fixtures/namespaces.yml +++ b/pkg/db/fixtures/namespaces.yml @@ -1,83 +1,83 @@ - id: 1 - name: testnamespace + title: testnamespace description: Lorem Ipsum owner_id: 1 updated: 0 created: 0 - id: 2 - name: testnamespace2 + title: testnamespace2 description: Lorem Ipsum owner_id: 2 updated: 0 created: 0 - id: 3 - name: testnamespace3 + title: testnamespace3 description: Lorem Ipsum owner_id: 3 updated: 0 created: 0 - id: 6 - name: testnamespace6 + title: testnamespace6 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 7 - name: testnamespace7 + title: testnamespace7 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 8 - name: testnamespace8 + title: testnamespace8 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 9 - name: testnamespace9 + title: testnamespace9 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 10 - name: testnamespace10 + title: testnamespace10 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 11 - name: testnamespace11 + title: testnamespace11 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 12 - name: testnamespace12 + title: testnamespace12 description: Lorem Ipsum owner_id: 6 updated: 0 created: 0 - id: 13 - name: testnamespace13 + title: testnamespace13 description: Lorem Ipsum owner_id: 7 updated: 0 created: 0 - id: 14 - name: testnamespace14 + title: testnamespace14 description: Lorem Ipsum owner_id: 7 updated: 0 created: 0 - id: 15 - name: testnamespace15 + title: testnamespace15 description: Lorem Ipsum owner_id: 13 updated: 0 created: 0 - id: 16 - name: Archived testnamespace16 + title: Archived testnamespace16 owner_id: 1 is_archived: 1 updated: 0 diff --git a/pkg/db/fixtures/tasks.yml b/pkg/db/fixtures/tasks.yml index 5e54030c..237ed9bd 100644 --- a/pkg/db/fixtures/tasks.yml +++ b/pkg/db/fixtures/tasks.yml @@ -1,5 +1,5 @@ - id: 1 - text: 'task #1' + title: 'task #1' description: 'Lorem Ipsum' done: false created_by_id: 1 @@ -9,7 +9,7 @@ updated: 1543626724 bucket_id: 1 - id: 2 - text: 'task #2 done' + title: 'task #2 done' done: true created_by_id: 1 list_id: 1 @@ -18,7 +18,7 @@ updated: 1543626724 bucket_id: 1 - id: 3 - text: 'task #3 high prio' + title: 'task #3 high prio' done: false created_by_id: 1 list_id: 1 @@ -28,7 +28,7 @@ priority: 100 bucket_id: 2 - id: 4 - text: 'task #4 low prio' + title: 'task #4 low prio' done: false created_by_id: 1 list_id: 1 @@ -38,7 +38,7 @@ priority: 1 bucket_id: 2 - id: 5 - text: 'task #5 higher due date' + title: 'task #5 higher due date' done: false created_by_id: 1 list_id: 1 @@ -48,7 +48,7 @@ due_date_unix: 1543636724 bucket_id: 2 - id: 6 - text: 'task #6 lower due date' + title: 'task #6 lower due date' done: false created_by_id: 1 list_id: 1 @@ -58,7 +58,7 @@ due_date_unix: 1543616724 bucket_id: 3 - id: 7 - text: 'task #7 with start date' + title: 'task #7 with start date' done: false created_by_id: 1 list_id: 1 @@ -68,7 +68,7 @@ start_date_unix: 1544600000 bucket_id: 3 - id: 8 - text: 'task #8 with end date' + title: 'task #8 with end date' done: false created_by_id: 1 list_id: 1 @@ -78,7 +78,7 @@ end_date_unix: 1544700000 bucket_id: 3 - id: 9 - text: 'task #9 with start and end date' + title: 'task #9 with start and end date' done: false created_by_id: 1 list_id: 1 @@ -89,7 +89,7 @@ end_date_unix: 1544700000 bucket_id: 1 - id: 10 - text: 'task #10 basic' + title: 'task #10 basic' done: false created_by_id: 1 list_id: 1 @@ -98,7 +98,7 @@ created: 1543626724 updated: 1543626724 - id: 11 - text: 'task #11 basic' + title: 'task #11 basic' done: false created_by_id: 1 list_id: 1 @@ -107,7 +107,7 @@ created: 1543626724 updated: 1543626724 - id: 12 - text: 'task #12 basic' + title: 'task #12 basic' done: false created_by_id: 1 list_id: 1 @@ -116,7 +116,7 @@ created: 1543626724 updated: 1543626724 - id: 13 - text: 'task #13 basic other list' + title: 'task #13 basic other list' done: false created_by_id: 1 list_id: 2 @@ -125,7 +125,7 @@ created: 1543626724 updated: 1543626724 - id: 14 - text: 'task #14 basic other list' + title: 'task #14 basic other list' done: false created_by_id: 5 list_id: 5 @@ -134,7 +134,7 @@ created: 1543626724 updated: 1543626724 - id: 15 - text: 'task #15' + title: 'task #15' done: false created_by_id: 6 list_id: 6 @@ -143,7 +143,7 @@ created: 1543626724 updated: 1543626724 - id: 16 - text: 'task #16' + title: 'task #16' done: false created_by_id: 6 list_id: 7 @@ -152,7 +152,7 @@ created: 1543626724 updated: 1543626724 - id: 17 - text: 'task #17' + title: 'task #17' done: false created_by_id: 6 list_id: 8 @@ -161,7 +161,7 @@ created: 1543626724 updated: 1543626724 - id: 18 - text: 'task #18' + title: 'task #18' done: false created_by_id: 6 list_id: 9 @@ -170,7 +170,7 @@ created: 1543626724 updated: 1543626724 - id: 19 - text: 'task #19' + title: 'task #19' done: false created_by_id: 6 list_id: 10 @@ -179,7 +179,7 @@ created: 1543626724 updated: 1543626724 - id: 20 - text: 'task #20' + title: 'task #20' done: false created_by_id: 6 list_id: 11 @@ -188,7 +188,7 @@ created: 1543626724 updated: 1543626724 - id: 21 - text: 'task #21' + title: 'task #21' done: false created_by_id: 6 list_id: 12 @@ -197,7 +197,7 @@ created: 1543626724 updated: 1543626724 - id: 22 - text: 'task #22' + title: 'task #22' done: false created_by_id: 6 list_id: 13 @@ -206,7 +206,7 @@ created: 1543626724 updated: 1543626724 - id: 23 - text: 'task #23' + title: 'task #23' done: false created_by_id: 6 list_id: 14 @@ -215,7 +215,7 @@ created: 1543626724 updated: 1543626724 - id: 24 - text: 'task #24' + title: 'task #24' done: false created_by_id: 6 list_id: 15 @@ -224,7 +224,7 @@ created: 1543626724 updated: 1543626724 - id: 25 - text: 'task #25' + title: 'task #25' done: false created_by_id: 6 list_id: 16 @@ -233,7 +233,7 @@ created: 1543626724 updated: 1543626724 - id: 26 - text: 'task #26' + title: 'task #26' done: false created_by_id: 6 list_id: 17 @@ -242,7 +242,7 @@ created: 1543626724 updated: 1543626724 - id: 27 - text: 'task #27 with reminders' + title: 'task #27 with reminders' done: false created_by_id: 1 list_id: 1 @@ -251,7 +251,7 @@ created: 1543626724 updated: 1543626724 - id: 28 - text: 'task #28 with repeat after' + title: 'task #28 with repeat after' done: false created_by_id: 1 repeat_after: 3600 @@ -261,7 +261,7 @@ created: 1543626724 updated: 1543626724 - id: 29 - text: 'task #29 with parent task (1)' + title: 'task #29 with parent task (1)' done: false created_by_id: 1 list_id: 1 @@ -270,7 +270,7 @@ created: 1543626724 updated: 1543626724 - id: 30 - text: 'task #30 with assignees' + title: 'task #30 with assignees' done: false created_by_id: 1 list_id: 1 @@ -279,7 +279,7 @@ created: 1543626724 updated: 1543626724 - id: 31 - text: 'task #31 with color' + title: 'task #31 with color' done: false created_by_id: 1 list_id: 1 @@ -289,7 +289,7 @@ created: 1543626724 updated: 1543626724 - id: 32 - text: 'task #32' + title: 'task #32' done: false created_by_id: 1 list_id: 3 @@ -298,7 +298,7 @@ created: 1543626724 updated: 1543626724 - id: 33 - text: 'task #33 with percent done' + title: 'task #33 with percent done' done: false created_by_id: 1 list_id: 1 @@ -309,7 +309,7 @@ updated: 1543626724 # This task is forbidden for user1 - id: 34 - text: 'task #34' + title: 'task #34' done: false created_by_id: 13 list_id: 20 @@ -318,7 +318,7 @@ created: 1543626724 updated: 1543626724 - id: 35 - text: 'task #35' + title: 'task #35' done: false created_by_id: 1 list_id: 21 @@ -327,7 +327,7 @@ created: 1543626724 updated: 1543626724 - id: 36 - text: 'task #36' + title: 'task #36' done: false created_by_id: 1 list_id: 22 diff --git a/pkg/integrations/archived_test.go b/pkg/integrations/archived_test.go index 0099f801..f1716dd1 100644 --- a/pkg/integrations/archived_test.go +++ b/pkg/integrations/archived_test.go @@ -107,12 +107,12 @@ func TestArchived(t *testing.T) { t.Run("namespace", func(t *testing.T) { t.Run("not editable", func(t *testing.T) { - _, err := testNamespaceHandler.testUpdateWithUser(nil, map[string]string{"namespace": "16"}, `{"name":"TestIpsum","is_archived":true}`) + _, err := testNamespaceHandler.testUpdateWithUser(nil, map[string]string{"namespace": "16"}, `{"title":"TestIpsum","is_archived":true}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeNamespaceIsArchived) }) t.Run("unarchivable", func(t *testing.T) { - rec, err := testNamespaceHandler.testUpdateWithUser(nil, map[string]string{"namespace": "16"}, `{"name":"TestIpsum","is_archived":false}`) + rec, err := testNamespaceHandler.testUpdateWithUser(nil, map[string]string{"namespace": "16"}, `{"title":"TestIpsum","is_archived":false}`) assert.NoError(t, err) assert.Contains(t, rec.Body.String(), `"is_archived":false`) }) @@ -124,12 +124,12 @@ func TestArchived(t *testing.T) { t.Run("should not appear in the list", func(t *testing.T) { rec, err := testNamespaceHandler.testReadAllWithUser(nil, nil) assert.NoError(t, err) - assert.NotContains(t, rec.Body.String(), `"name":"Archived testnamespace16"`) + assert.NotContains(t, rec.Body.String(), `"title":"Archived testnamespace16"`) }) t.Run("should appear in the list if explicitly requested", func(t *testing.T) { rec, err := testNamespaceHandler.testReadAllWithUser(url.Values{"is_archived": []string{"true"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"name":"Archived testnamespace16"`) + assert.Contains(t, rec.Body.String(), `"title":"Archived testnamespace16"`) }) }) @@ -138,7 +138,7 @@ func TestArchived(t *testing.T) { taskTests := func(taskID string, errCode int, t *testing.T) { t.Run("task", func(t *testing.T) { t.Run("edit task", func(t *testing.T) { - _, err := testTaskHandler.testUpdateWithUser(nil, map[string]string{"listtask": taskID}, `{"text":"TestIpsum"}`) + _, err := testTaskHandler.testUpdateWithUser(nil, map[string]string{"listtask": taskID}, `{"title":"TestIpsum"}`) assert.Error(t, err) assertHandlerErrorCode(t, err, errCode) }) @@ -202,7 +202,7 @@ func TestArchived(t *testing.T) { assertHandlerErrorCode(t, err, models.ErrCodeNamespaceIsArchived) }) t.Run("no new tasks", func(t *testing.T) { - _, err := testTaskHandler.testCreateWithUser(nil, map[string]string{"list": "21"}, `{"text":"Lorem"}`) + _, err := testTaskHandler.testCreateWithUser(nil, map[string]string{"list": "21"}, `{"title":"Lorem"}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeNamespaceIsArchived) }) @@ -222,7 +222,7 @@ func TestArchived(t *testing.T) { assertHandlerErrorCode(t, err, models.ErrCodeListIsArchived) }) t.Run("no new tasks", func(t *testing.T) { - _, err := testTaskHandler.testCreateWithUser(nil, map[string]string{"list": "22"}, `{"text":"Lorem"}`) + _, err := testTaskHandler.testCreateWithUser(nil, map[string]string{"list": "22"}, `{"title":"Lorem"}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeListIsArchived) }) diff --git a/pkg/integrations/link_sharing_test.go b/pkg/integrations/link_sharing_test.go index 5d5aa285..2cb61312 100644 --- a/pkg/integrations/link_sharing_test.go +++ b/pkg/integrations/link_sharing_test.go @@ -585,36 +585,36 @@ func TestLinkSharing(t *testing.T) { }) t.Run("Create", func(t *testing.T) { t.Run("Shared readonly", func(t *testing.T) { - _, err := testHandlerTaskReadOnly.testCreateWithLinkShare(nil, map[string]string{"list": "1"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandlerTaskReadOnly.testCreateWithLinkShare(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared write", func(t *testing.T) { - rec, err := testHandlerTaskWrite.testCreateWithLinkShare(nil, map[string]string{"list": "2"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandlerTaskWrite.testCreateWithLinkShare(nil, map[string]string{"list": "2"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared admin", func(t *testing.T) { - rec, err := testHandlerTaskAdmin.testCreateWithLinkShare(nil, map[string]string{"list": "3"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandlerTaskAdmin.testCreateWithLinkShare(nil, map[string]string{"list": "3"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) }) t.Run("Update", func(t *testing.T) { t.Run("Shared readonly", func(t *testing.T) { - _, err := testHandlerTaskReadOnly.testUpdateWithLinkShare(nil, map[string]string{"listtask": "1"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandlerTaskReadOnly.testUpdateWithLinkShare(nil, map[string]string{"listtask": "1"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared write", func(t *testing.T) { - rec, err := testHandlerTaskWrite.testUpdateWithLinkShare(nil, map[string]string{"listtask": "13"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandlerTaskWrite.testUpdateWithLinkShare(nil, map[string]string{"listtask": "13"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared admin", func(t *testing.T) { - rec, err := testHandlerTaskAdmin.testUpdateWithLinkShare(nil, map[string]string{"listtask": "32"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandlerTaskAdmin.testUpdateWithLinkShare(nil, map[string]string{"listtask": "32"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) }) @@ -847,34 +847,34 @@ func TestLinkSharing(t *testing.T) { }) t.Run("Create", func(t *testing.T) { t.Run("Shared readonly", func(t *testing.T) { - _, err := testHandlerNamespaceReadOnly.testCreateWithLinkShare(nil, nil, `{"name":"LoremIpsum"}`) + _, err := testHandlerNamespaceReadOnly.testCreateWithLinkShare(nil, nil, `{"title":"LoremIpsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared write", func(t *testing.T) { - _, err := testHandlerNamespaceWrite.testCreateWithLinkShare(nil, nil, `{"name":"LoremIpsum"}`) + _, err := testHandlerNamespaceWrite.testCreateWithLinkShare(nil, nil, `{"title":"LoremIpsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared admin", func(t *testing.T) { - _, err := testHandlerNamespaceAdmin.testCreateWithLinkShare(nil, nil, `{"name":"LoremIpsum"}`) + _, err := testHandlerNamespaceAdmin.testCreateWithLinkShare(nil, nil, `{"title":"LoremIpsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) }) t.Run("Update", func(t *testing.T) { t.Run("Shared readonly", func(t *testing.T) { - _, err := testHandlerNamespaceReadOnly.testUpdateWithLinkShare(nil, map[string]string{"namespace": "1"}, `{"name":"LoremIpsum"}`) + _, err := testHandlerNamespaceReadOnly.testUpdateWithLinkShare(nil, map[string]string{"namespace": "1"}, `{"title":"LoremIpsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared write", func(t *testing.T) { - _, err := testHandlerNamespaceWrite.testUpdateWithLinkShare(nil, map[string]string{"namespace": "2"}, `{"name":"LoremIpsum"}`) + _, err := testHandlerNamespaceWrite.testUpdateWithLinkShare(nil, map[string]string{"namespace": "2"}, `{"title":"LoremIpsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared admin", func(t *testing.T) { - _, err := testHandlerNamespaceAdmin.testUpdateWithLinkShare(nil, map[string]string{"namespace": "3"}, `{"name":"LoremIpsum"}`) + _, err := testHandlerNamespaceAdmin.testUpdateWithLinkShare(nil, map[string]string{"namespace": "3"}, `{"title":"LoremIpsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) diff --git a/pkg/integrations/task_collection_test.go b/pkg/integrations/task_collection_test.go index ce90c7b1..bc8f5065 100644 --- a/pkg/integrations/task_collection_test.go +++ b/pkg/integrations/task_collection_test.go @@ -113,49 +113,49 @@ func TestTaskCollection(t *testing.T) { t.Run("by priority", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"priority"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":33,"text":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"text":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"text":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":33,"title":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"title":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"title":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("by priority desc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"priority"}, "order_by": []string{"desc"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `[{"id":3,"text":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"text":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1`) + assert.Contains(t, rec.Body.String(), `[{"id":3,"title":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"title":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1`) }) t.Run("by priority asc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"priority"}, "order_by": []string{"asc"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":33,"text":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"text":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"text":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":33,"title":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"title":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"title":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) // should equal duedate asc t.Run("by due_date", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date_unix"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("by duedate desc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date_unix"}, "order_by": []string{"desc"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `[{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":6,"text":"task #6 lower due date`) + assert.Contains(t, rec.Body.String(), `[{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":6,"title":"task #6 lower due date`) }) // Due date without unix suffix t.Run("by duedate asc without _unix suffix", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date"}, "order_by": []string{"asc"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("by due_date without _unix suffix", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("by duedate desc without _unix suffix", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date"}, "order_by": []string{"desc"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `[{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":6,"text":"task #6 lower due date`) + assert.Contains(t, rec.Body.String(), `[{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":6,"title":"task #6 lower due date`) }) t.Run("by duedate asc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date_unix"}, "order_by": []string{"asc"}}, urlParams) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("invalid sort parameter", func(t *testing.T) { _, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"loremipsum"}}, urlParams) @@ -171,10 +171,10 @@ func TestTaskCollection(t *testing.T) { // Invalid parameter should not sort at all rec, err := testHandler.testReadAllWithUser(url.Values{"sort": []string{"loremipsum"}}, urlParams) assert.NoError(t, err) - assert.NotContains(t, rec.Body.String(), `[{"id":3,"text":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":4,"text":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1`) - assert.NotContains(t, rec.Body.String(), `{"id":4,"text":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":3,"text":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) - assert.NotContains(t, rec.Body.String(), `[{"id":5,"text":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":6,"text":"task #6 lower due date"`) - assert.NotContains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"due_date":1543616724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) + assert.NotContains(t, rec.Body.String(), `[{"id":3,"title":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":4,"title":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1`) + assert.NotContains(t, rec.Body.String(), `{"id":4,"title":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":3,"title":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) + assert.NotContains(t, rec.Body.String(), `[{"id":5,"title":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":6,"title":"task #6 lower due date"`) + assert.NotContains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"due_date":1543616724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) }) }) t.Run("Date range", func(t *testing.T) { @@ -304,42 +304,42 @@ func TestTaskCollection(t *testing.T) { t.Run("by priority", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"priority"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":33,"text":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"text":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"text":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":33,"title":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"title":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"title":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("by priority desc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"priority"}, "order_by": []string{"desc"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `[{"id":3,"text":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"text":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1`) + assert.Contains(t, rec.Body.String(), `[{"id":3,"title":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"title":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1`) }) t.Run("by priority asc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"priority"}, "order_by": []string{"asc"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":33,"text":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"text":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"text":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":33,"title":"task #33 with percent done","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0.5,"identifier":"test1-17","index":17,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":1,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":4,"title":"task #4 low prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":1,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-4","index":4,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":3,"title":"task #3 high prio","description":"","done":false,"done_at":null,"due_date":null,"reminder_dates":null,"list_id":1,"repeat_after":0,"priority":100,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-3","index":3,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) // should equal duedate asc t.Run("by due_date", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date_unix"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("by duedate desc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date_unix"}, "order_by": []string{"desc"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `[{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":6,"text":"task #6 lower due date`) + assert.Contains(t, rec.Body.String(), `[{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":6,"title":"task #6 lower due date`) }) t.Run("by duedate asc", func(t *testing.T) { rec, err := testHandler.testReadAllWithUser(url.Values{"sort_by": []string{"due_date_unix"}, "order_by": []string{"asc"}}, nil) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) + assert.Contains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"done_at":null,"due_date":"2018-11-30T22:25:24Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-6","index":6,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":3,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"done_at":null,"due_date":"2018-12-01T03:58:44Z","reminder_dates":null,"list_id":1,"repeat_after":0,"priority":0,"start_date":null,"end_date":null,"assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"test1-5","index":5,"related_tasks":{},"attachments":null,"created":"2018-12-01T01:12:04Z","updated":"2018-12-01T01:12:04Z","bucket_id":2,"position":0,"created_by":{"id":1,"username":"user1","created":null,"updated":null}}]`) }) t.Run("invalid parameter", func(t *testing.T) { // Invalid parameter should not sort at all rec, err := testHandler.testReadAllWithUser(url.Values{"sort": []string{"loremipsum"}}, nil) assert.NoError(t, err) - assert.NotContains(t, rec.Body.String(), `[{"id":3,"text":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":4,"text":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1`) - assert.NotContains(t, rec.Body.String(), `{"id":4,"text":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":3,"text":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) - assert.NotContains(t, rec.Body.String(), `[{"id":5,"text":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":6,"text":"task #6 lower due date"`) - assert.NotContains(t, rec.Body.String(), `{"id":6,"text":"task #6 lower due date","description":"","done":false,"due_date":1543616724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":5,"text":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) + assert.NotContains(t, rec.Body.String(), `[{"id":3,"title":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":4,"title":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1`) + assert.NotContains(t, rec.Body.String(), `{"id":4,"title":"task #4 low prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":1,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":3,"title":"task #3 high prio","description":"","done":false,"due_date":0,"reminder_dates":null,"repeat_after":0,"priority":100,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) + assert.NotContains(t, rec.Body.String(), `[{"id":5,"title":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":6,"title":"task #6 lower due date"`) + assert.NotContains(t, rec.Body.String(), `{"id":6,"title":"task #6 lower due date","description":"","done":false,"due_date":1543616724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"hex_color":"","created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}},{"id":5,"title":"task #5 higher due date","description":"","done":false,"due_date":1543636724,"reminder_dates":null,"repeat_after":0,"priority":0,"start_date":0,"end_date":0,"assignees":null,"labels":null,"created":1543626724,"updated":1543626724,"created_by":{"id":0,"username":"","email":"","created":0,"updated":0}}]`) }) }) t.Run("Date range", func(t *testing.T) { diff --git a/pkg/integrations/task_test.go b/pkg/integrations/task_test.go index a428a7bf..08b113ab 100644 --- a/pkg/integrations/task_test.go +++ b/pkg/integrations/task_test.go @@ -36,11 +36,11 @@ func TestTask(t *testing.T) { // ^TestTask$/^Update$/^Update_task_items$/^Removing_Assignees_null$ t.Run("Update", func(t *testing.T) { t.Run("Update task items", func(t *testing.T) { - t.Run("Text", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "1"}, `{"text":"Lorem Ipsum"}`) + t.Run("Title", func(t *testing.T) { + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "1"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) - assert.NotContains(t, rec.Body.String(), `"text":"task #1"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) + assert.NotContains(t, rec.Body.String(), `"title":"task #1"`) }) t.Run("Description", func(t *testing.T) { rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "1"}, `{"description":"Dolor sit amet"}`) @@ -195,78 +195,78 @@ func TestTask(t *testing.T) { }) t.Run("Nonexisting", func(t *testing.T) { - _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "99999"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "99999"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeTaskDoesNotExist) }) t.Run("Rights check", func(t *testing.T) { t.Run("Forbidden", func(t *testing.T) { - _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "14"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "14"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via Team readonly", func(t *testing.T) { - _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "15"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "15"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via Team write", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "16"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "16"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via Team admin", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "17"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "17"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via User readonly", func(t *testing.T) { - _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "18"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "18"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via User write", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "19"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "19"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via User admin", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "20"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "20"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceTeam readonly", func(t *testing.T) { - _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "21"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "21"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via NamespaceTeam write", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "22"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "22"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceTeam admin", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "23"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "23"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceUser readonly", func(t *testing.T) { - _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "24"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "24"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via NamespaceUser write", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "25"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "25"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceUser admin", func(t *testing.T) { - rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "26"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testUpdateWithUser(nil, map[string]string{"listtask": "26"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) }) t.Run("Move to other list", func(t *testing.T) { @@ -390,100 +390,100 @@ func TestTask(t *testing.T) { }) t.Run("Create", func(t *testing.T) { t.Run("Normal", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Nonexisting", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "9999"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "9999"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeListDoesNotExist) }) t.Run("Rights check", func(t *testing.T) { t.Run("Forbidden", func(t *testing.T) { // Owned by user13 - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "20"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "20"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via Team readonly", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "6"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "6"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via Team write", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "7"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "7"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via Team admin", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "8"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "8"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via User readonly", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "9"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "9"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via User write", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "10"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "10"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via User admin", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "11"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "11"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceTeam readonly", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "12"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "12"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via NamespaceTeam write", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "13"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "13"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceTeam admin", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "14"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "14"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceUser readonly", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "15"}, `{"text":"Lorem Ipsum"}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "15"}, `{"title":"Lorem Ipsum"}`) assert.Error(t, err) assert.Contains(t, err.(*echo.HTTPError).Message, `Forbidden`) }) t.Run("Shared Via NamespaceUser write", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "16"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "16"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) t.Run("Shared Via NamespaceUser admin", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "17"}, `{"text":"Lorem Ipsum"}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "17"}, `{"title":"Lorem Ipsum"}`) assert.NoError(t, err) - assert.Contains(t, rec.Body.String(), `"text":"Lorem Ipsum"`) + assert.Contains(t, rec.Body.String(), `"title":"Lorem Ipsum"`) }) }) t.Run("Bucket", func(t *testing.T) { t.Run("Normal", func(t *testing.T) { - rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"text":"Lorem Ipsum","bucket_id":2}`) + rec, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum","bucket_id":2}`) assert.NoError(t, err) assert.Contains(t, rec.Body.String(), `"bucket_id":2`) assert.NotContains(t, rec.Body.String(), `"bucket_id":1`) }) t.Run("Different List", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"text":"Lorem Ipsum","bucket_id":4}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum","bucket_id":4}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeBucketDoesNotBelongToList) }) t.Run("Nonexisting Bucket", func(t *testing.T) { - _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"text":"Lorem Ipsum","bucket_id":9999}`) + _, err := testHandler.testCreateWithUser(nil, map[string]string{"list": "1"}, `{"title":"Lorem Ipsum","bucket_id":9999}`) assert.Error(t, err) assertHandlerErrorCode(t, err, models.ErrCodeBucketDoesNotExist) }) diff --git a/pkg/migration/20200515172220.go b/pkg/migration/20200515172220.go new file mode 100644 index 00000000..63c7f715 --- /dev/null +++ b/pkg/migration/20200515172220.go @@ -0,0 +1,120 @@ +// Vikunja is a to-do list application to facilitate your life. +// Copyright 2018-2020 Vikunja and contributors. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package migration + +import ( + "code.vikunja.io/api/pkg/config" + "src.techknowlogick.com/xormigrate" + "xorm.io/xorm" +) + +type task20200515172220 struct { + ID int64 `xorm:"int(11) autoincr not null unique pk"` + Title string `xorm:"varchar(250) null"` + Text string `xorm:"varchar(250) not null"` +} + +func (t *task20200515172220) TableName() string { + return "tasks" +} + +// We can't do the migration if the title column is not null but has a default value of null, +// so we initialize it as null and change it after migrating. +type task20200515172221 struct { + Title string `xorm:"varchar(250) not null"` +} + +func (t *task20200515172221) TableName() string { + return "tasks" +} + +func init() { + migrations = append(migrations, &xormigrate.Migration{ + ID: "20200515172220", + Description: "Change task text to title", + Migrate: func(tx *xorm.Engine) error { + err := tx.Sync2(task20200515172220{}) + if err != nil { + return err + } + + tasks := []*task20200515172220{} + err = tx.Find(&tasks) + if err != nil { + return err + } + + for _, task := range tasks { + task.Title = task.Text + _, err = tx.Where("id = ?", task.ID).Update(task) + if err != nil { + return err + } + } + + err = tx.Sync2(task20200515172221{}) + if err != nil { + return err + } + + // sqlite is not able to drop columns. To have inserting new tasks still work, we drop the column manually. + if config.DatabaseType.GetString() == "sqlite" { + _, err = tx.Exec(` +create table tasks_dg_tmp +( + id INTEGER not null + primary key autoincrement, + description TEXT, + done INTEGER, + done_at_unix INTEGER, + due_date_unix INTEGER, + created_by_id INTEGER not null, + list_id INTEGER not null, + repeat_after INTEGER, + priority INTEGER, + start_date_unix INTEGER, + end_date_unix INTEGER, + hex_color TEXT, + percent_done REAL, + "index" INTEGER default 0 not null, + uid TEXT, + created INTEGER not null, + updated INTEGER not null, + bucket_id INTEGER, + position REAL, + title TEXT +); + +insert into tasks_dg_tmp(id, description, done, done_at_unix, due_date_unix, created_by_id, list_id, repeat_after, priority, start_date_unix, end_date_unix, hex_color, percent_done, "index", uid, created, updated, bucket_id, position, title) select id, description, done, done_at_unix, due_date_unix, created_by_id, list_id, repeat_after, priority, start_date_unix, end_date_unix, hex_color, percent_done, "index", uid, created, updated, bucket_id, position, title from tasks; + +drop table tasks; + +alter table tasks_dg_tmp rename to tasks; + +create unique index tasks_id_uindex + on tasks (id); +`) + return err + } + + return dropTableColum(tx, "tasks", "text") + }, + Rollback: func(tx *xorm.Engine) error { + return nil + }, + }) +} diff --git a/pkg/migration/20200515195546.go b/pkg/migration/20200515195546.go new file mode 100644 index 00000000..e519c50a --- /dev/null +++ b/pkg/migration/20200515195546.go @@ -0,0 +1,108 @@ +// Vikunja is a to-do list application to facilitate your life. +// Copyright 2018-2020 Vikunja and contributors. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package migration + +import ( + "code.vikunja.io/api/pkg/config" + "src.techknowlogick.com/xormigrate" + "xorm.io/xorm" +) + +type namespace20200515195546 struct { + ID int64 `xorm:"int(11) autoincr not null unique pk"` + Title string `xorm:"varchar(250) null"` + Name string `xorm:"varchar(250) not null"` +} + +func (t *namespace20200515195546) TableName() string { + return "namespaces" +} + +// We can't do the migration if the title column is not null but has a default value of null, +// so we initialize it as null and change it after migrating. +type namespace20200515195547 struct { + Title string `xorm:"varchar(250) not null"` +} + +func (t *namespace20200515195547) TableName() string { + return "namespaces" +} + +func init() { + migrations = append(migrations, &xormigrate.Migration{ + ID: "20200515195546", + Description: "Change namespace name to title", + Migrate: func(tx *xorm.Engine) error { + err := tx.Sync2(namespace20200515195546{}) + if err != nil { + return err + } + + namespaces := []*namespace20200515195546{} + err = tx.Find(&namespaces) + if err != nil { + return err + } + + for _, n := range namespaces { + n.Title = n.Name + _, err = tx.Where("id = ?", n.ID).Update(n) + if err != nil { + return err + } + } + + err = tx.Sync2(namespace20200515195547{}) + if err != nil { + return err + } + + // sqlite is not able to drop columns. To have inserting new namespaces still work, we drop the column manually. + if config.DatabaseType.GetString() == "sqlite" { + _, err = tx.Exec(` +create table namespaces_dg_tmp +( + id INTEGER not null + primary key autoincrement, + description TEXT, + owner_id INTEGER not null, + created INTEGER not null, + updated INTEGER not null, + is_archived INTEGER default 0 not null, + hex_color TEXT, + title TEXT +); + +insert into namespaces_dg_tmp(id, description, owner_id, created, updated, is_archived, hex_color, title) select id, description, owner_id, created, updated, is_archived, hex_color, title from namespaces; + +drop table namespaces; + +alter table namespaces_dg_tmp rename to namespaces; + +create unique index UQE_namespaces_id + on namespaces (id); +`) + return err + } + + return dropTableColum(tx, "namespaces", "name") + }, + Rollback: func(tx *xorm.Engine) error { + return nil + }, + }) +} diff --git a/pkg/models/bulk_task.go b/pkg/models/bulk_task.go index de374576..1991ed0e 100644 --- a/pkg/models/bulk_task.go +++ b/pkg/models/bulk_task.go @@ -110,7 +110,7 @@ func (bt *BulkTask) Update() (err error) { } _, err = sess.ID(oldtask.ID). - Cols("text", + Cols("title", "description", "done", "due_date_unix", diff --git a/pkg/models/bulk_task_test.go b/pkg/models/bulk_task_test.go index 39aa9f84..58fc5bc9 100644 --- a/pkg/models/bulk_task_test.go +++ b/pkg/models/bulk_task_test.go @@ -24,7 +24,7 @@ func TestBulkTask_Update(t *testing.T) { fields: fields{ IDs: []int64{10, 11, 12}, Task: Task{ - Text: "bulkupdated", + Title: "bulkupdated", }, User: &user.User{ID: 1}, }, @@ -34,7 +34,7 @@ func TestBulkTask_Update(t *testing.T) { fields: fields{ IDs: []int64{10, 11, 12, 13}, Task: Task{ - Text: "bulkupdated", + Title: "bulkupdated", }, User: &user.User{ID: 1}, }, @@ -45,7 +45,7 @@ func TestBulkTask_Update(t *testing.T) { fields: fields{ IDs: []int64{}, Task: Task{ - Text: "bulkupdated", + Title: "bulkupdated", }, User: &user.User{ID: 1}, }, diff --git a/pkg/models/error.go b/pkg/models/error.go index 8809b495..d0eeea42 100644 --- a/pkg/models/error.go +++ b/pkg/models/error.go @@ -268,7 +268,7 @@ func IsErrTaskCannotBeEmpty(err error) bool { } func (err ErrTaskCannotBeEmpty) Error() string { - return fmt.Sprintf("List task text cannot be empty.") + return fmt.Sprintf("List task title cannot be empty.") } // ErrCodeTaskCannotBeEmpty holds the unique world-error code of this error @@ -276,7 +276,7 @@ const ErrCodeTaskCannotBeEmpty = 4001 // HTTPError holds the http error description func (err ErrTaskCannotBeEmpty) HTTPError() web.HTTPError { - return web.HTTPError{HTTPCode: http.StatusBadRequest, Code: ErrCodeTaskCannotBeEmpty, Message: "You must provide at least a list task text."} + return web.HTTPError{HTTPCode: http.StatusBadRequest, Code: ErrCodeTaskCannotBeEmpty, Message: "You must provide at least a list task title."} } // ErrTaskDoesNotExist represents a "ErrListDoesNotExist" kind of error. Used if the list does not exist. diff --git a/pkg/models/namespace.go b/pkg/models/namespace.go index 26856e7f..4d841acb 100644 --- a/pkg/models/namespace.go +++ b/pkg/models/namespace.go @@ -31,7 +31,7 @@ type Namespace struct { // The unique, numeric id of this namespace. ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"` // The name of this namespace. - Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"` + Title string `xorm:"varchar(250) not null" json:"title" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"` // The description of the namespace Description string `xorm:"longtext null" json:"description"` OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"` @@ -57,7 +57,7 @@ type Namespace struct { // PseudoNamespace is a pseudo namespace used to hold shared lists var PseudoNamespace = Namespace{ ID: -1, - Name: "Shared Lists", + Title: "Shared Lists", Description: "Lists of other users shared with you via teams or directly.", Created: timeutil.FromTime(time.Now()), Updated: timeutil.FromTime(time.Now()), @@ -201,7 +201,7 @@ func (n *Namespace) ReadAll(a web.Auth, search string, page int, perPage int) (r Or("namespaces.owner_id = ?", doer.ID). Or("users_namespace.user_id = ?", doer.ID). GroupBy("namespaces.id"). - Where("namespaces.name LIKE ?", "%"+search+"%"). + Where("namespaces.title LIKE ?", "%"+search+"%"). Where(isArchivedCond) if limit > 0 { query = query.Limit(limit, start) @@ -301,7 +301,7 @@ func (n *Namespace) ReadAll(a web.Auth, search string, page int, perPage int) (r Or("users_namespace.user_id = ?", doer.ID). And("namespaces.is_archived = false"). GroupBy("namespaces.id"). - Where("namespaces.name LIKE ?", "%"+search+"%"). + Where("namespaces.title LIKE ?", "%"+search+"%"). Count(&NamespaceWithLists{}) if err != nil { return all, 0, 0, err @@ -325,7 +325,7 @@ func (n *Namespace) ReadAll(a web.Auth, search string, page int, perPage int) (r // @Router /namespaces [put] func (n *Namespace) Create(a web.Auth) (err error) { // Check if we have at least a name - if n.Name == "" { + if n.Title == "" { return ErrNamespaceNameCannotBeEmpty{NamespaceID: 0, UserID: a.GetID()} } n.ID = 0 // This would otherwise prevent the creation of new lists after one was created @@ -418,7 +418,7 @@ func (n *Namespace) Delete() (err error) { // @Router /namespace/{id} [post] func (n *Namespace) Update() (err error) { // Check if we have at least a name - if n.Name == "" { + if n.Title == "" { return ErrNamespaceNameCannotBeEmpty{NamespaceID: n.ID} } diff --git a/pkg/models/namespace_test.go b/pkg/models/namespace_test.go index 91a2ac74..f5b88ab3 100644 --- a/pkg/models/namespace_test.go +++ b/pkg/models/namespace_test.go @@ -32,7 +32,7 @@ func TestNamespace_Create(t *testing.T) { // Dummy namespace dummynamespace := Namespace{ - Name: "Test", + Title: "Test", Description: "Lorem Ipsum", } @@ -52,7 +52,7 @@ func TestNamespace_Create(t *testing.T) { assert.True(t, allowed) err = dummynamespace.ReadOne() assert.NoError(t, err) - assert.Equal(t, dummynamespace.Name, "Test") + assert.Equal(t, dummynamespace.Title, "Test") // Try creating one without a name n2 := Namespace{} @@ -92,13 +92,13 @@ func TestNamespace_Create(t *testing.T) { assert.True(t, user.IsErrUserDoesNotExist(err)) // Try updating without a name - dummynamespace.Name = "" + dummynamespace.Title = "" err = dummynamespace.Update() assert.Error(t, err) assert.True(t, IsErrNamespaceNameCannotBeEmpty(err)) // Try updating a nonexistant one - n := Namespace{ID: 284729, Name: "Lorem"} + n := Namespace{ID: 284729, Title: "Lorem"} err = n.Update() assert.Error(t, err) assert.True(t, IsErrNamespaceDoesNotExist(err)) diff --git a/pkg/models/task_collection.go b/pkg/models/task_collection.go index 2abe2628..9180f8bd 100644 --- a/pkg/models/task_collection.go +++ b/pkg/models/task_collection.go @@ -54,7 +54,7 @@ func validateTaskField(fieldName string) error { switch fieldName { case taskPropertyID, - taskPropertyText, + taskPropertyTitle, taskPropertyDescription, taskPropertyDone, taskPropertyDoneAtUnix, @@ -87,7 +87,7 @@ func validateTaskField(fieldName string) error { // @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." // @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." // @Param s query string false "Search tasks by task text." -// @Param sort_by query string false "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `text`, `description`, `done`, `done_at_unix`, `due_date_unix`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date_unix`, `end_date_unix`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`." +// @Param sort_by query string false "The sorting parameter. You can pass this multiple times to get the tasks ordered by multiple different parametes, along with `order_by`. Possible values to sort by are `id`, `title`, `description`, `done`, `done_at_unix`, `due_date_unix`, `created_by_id`, `list_id`, `repeat_after`, `priority`, `start_date_unix`, `end_date_unix`, `hex_color`, `percent_done`, `uid`, `created`, `updated`. Default is `id`." // @Param order_by query string false "The ordering parameter. Possible values to order by are `asc` or `desc`. Default is `asc`." // @Param filter_by query string false "The name of the field to filter by. Accepts an array for multiple filters which will be chanied together, all supplied filter must match." // @Param filter_value query string false "The value to filter for." diff --git a/pkg/models/task_collection_sort.go b/pkg/models/task_collection_sort.go index 5413c0d1..56266208 100644 --- a/pkg/models/task_collection_sort.go +++ b/pkg/models/task_collection_sort.go @@ -27,7 +27,7 @@ type ( const ( taskPropertyID string = "id" - taskPropertyText string = "text" + taskPropertyTitle string = "title" taskPropertyDescription string = "description" taskPropertyDone string = "done" taskPropertyDoneAtUnix string = "done_at_unix" diff --git a/pkg/models/task_collection_sort_test.go b/pkg/models/task_collection_sort_test.go index 606b6664..8ed275d2 100644 --- a/pkg/models/task_collection_sort_test.go +++ b/pkg/models/task_collection_sort_test.go @@ -43,7 +43,7 @@ func TestSortParamValidation(t *testing.T) { t.Run("Test valid sort by", func(t *testing.T) { for _, test := range []string{ taskPropertyID, - taskPropertyText, + taskPropertyTitle, taskPropertyDescription, taskPropertyDone, taskPropertyDoneAtUnix, diff --git a/pkg/models/task_collection_test.go b/pkg/models/task_collection_test.go index 13b72252..56b3ca74 100644 --- a/pkg/models/task_collection_test.go +++ b/pkg/models/task_collection_test.go @@ -49,7 +49,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { // We use individual variables for the tasks here to be able to rearrange or remove ones more easily task1 := &Task{ ID: 1, - Text: "task #1", + Title: "task #1", Description: "Lorem Ipsum", Identifier: "test1-1", Index: 1, @@ -71,7 +71,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { RelationKindSubtask: { { ID: 29, - Text: "task #29 with parent task (1)", + Title: "task #29 with parent task (1)", Index: 14, CreatedByID: 1, ListID: 1, @@ -109,7 +109,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task2 := &Task{ ID: 2, - Text: "task #2 done", + Title: "task #2 done", Identifier: "test1-2", Index: 2, Done: true, @@ -133,7 +133,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task3 := &Task{ ID: 3, - Text: "task #3 high prio", + Title: "task #3 high prio", Identifier: "test1-3", Index: 3, CreatedByID: 1, @@ -147,7 +147,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task4 := &Task{ ID: 4, - Text: "task #4 low prio", + Title: "task #4 low prio", Identifier: "test1-4", Index: 4, CreatedByID: 1, @@ -161,7 +161,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task5 := &Task{ ID: 5, - Text: "task #5 higher due date", + Title: "task #5 higher due date", Identifier: "test1-5", Index: 5, CreatedByID: 1, @@ -175,7 +175,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task6 := &Task{ ID: 6, - Text: "task #6 lower due date", + Title: "task #6 lower due date", Identifier: "test1-6", Index: 6, CreatedByID: 1, @@ -189,7 +189,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task7 := &Task{ ID: 7, - Text: "task #7 with start date", + Title: "task #7 with start date", Identifier: "test1-7", Index: 7, CreatedByID: 1, @@ -203,7 +203,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task8 := &Task{ ID: 8, - Text: "task #8 with end date", + Title: "task #8 with end date", Identifier: "test1-8", Index: 8, CreatedByID: 1, @@ -217,7 +217,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task9 := &Task{ ID: 9, - Text: "task #9 with start and end date", + Title: "task #9 with start and end date", Identifier: "test1-9", Index: 9, CreatedByID: 1, @@ -232,7 +232,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task10 := &Task{ ID: 10, - Text: "task #10 basic", + Title: "task #10 basic", Identifier: "test1-10", Index: 10, CreatedByID: 1, @@ -245,7 +245,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task11 := &Task{ ID: 11, - Text: "task #11 basic", + Title: "task #11 basic", Identifier: "test1-11", Index: 11, CreatedByID: 1, @@ -258,7 +258,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task12 := &Task{ ID: 12, - Text: "task #12 basic", + Title: "task #12 basic", Identifier: "test1-12", Index: 12, CreatedByID: 1, @@ -271,7 +271,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task15 := &Task{ ID: 15, - Text: "task #15", + Title: "task #15", Identifier: "test6-1", Index: 1, CreatedByID: 6, @@ -284,7 +284,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task16 := &Task{ ID: 16, - Text: "task #16", + Title: "task #16", Identifier: "test7-1", Index: 1, CreatedByID: 6, @@ -297,7 +297,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task17 := &Task{ ID: 17, - Text: "task #17", + Title: "task #17", Identifier: "test8-1", Index: 1, CreatedByID: 6, @@ -310,7 +310,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task18 := &Task{ ID: 18, - Text: "task #18", + Title: "task #18", Identifier: "test9-1", Index: 1, CreatedByID: 6, @@ -323,7 +323,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task19 := &Task{ ID: 19, - Text: "task #19", + Title: "task #19", Identifier: "test10-1", Index: 1, CreatedByID: 6, @@ -336,7 +336,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task20 := &Task{ ID: 20, - Text: "task #20", + Title: "task #20", Identifier: "test11-1", Index: 1, CreatedByID: 6, @@ -349,7 +349,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task21 := &Task{ ID: 21, - Text: "task #21", + Title: "task #21", Identifier: "test12-1", Index: 1, CreatedByID: 6, @@ -362,7 +362,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task22 := &Task{ ID: 22, - Text: "task #22", + Title: "task #22", Identifier: "test13-1", Index: 1, CreatedByID: 6, @@ -375,7 +375,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task23 := &Task{ ID: 23, - Text: "task #23", + Title: "task #23", Identifier: "test14-1", Index: 1, CreatedByID: 6, @@ -388,7 +388,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task24 := &Task{ ID: 24, - Text: "task #24", + Title: "task #24", Identifier: "test15-1", Index: 1, CreatedByID: 6, @@ -401,7 +401,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task25 := &Task{ ID: 25, - Text: "task #25", + Title: "task #25", Identifier: "test16-1", Index: 1, CreatedByID: 6, @@ -414,7 +414,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task26 := &Task{ ID: 26, - Text: "task #26", + Title: "task #26", Identifier: "test17-1", Index: 1, CreatedByID: 6, @@ -427,7 +427,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task27 := &Task{ ID: 27, - Text: "task #27 with reminders", + Title: "task #27 with reminders", Identifier: "test1-12", Index: 12, CreatedByID: 1, @@ -441,7 +441,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task28 := &Task{ ID: 28, - Text: "task #28 with repeat after", + Title: "task #28 with repeat after", Identifier: "test1-13", Index: 13, CreatedByID: 1, @@ -455,7 +455,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task29 := &Task{ ID: 29, - Text: "task #29 with parent task (1)", + Title: "task #29 with parent task (1)", Identifier: "test1-14", Index: 14, CreatedByID: 1, @@ -465,7 +465,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { RelationKindParenttask: { { ID: 1, - Text: "task #1", + Title: "task #1", Description: "Lorem Ipsum", Index: 1, CreatedByID: 1, @@ -482,7 +482,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task30 := &Task{ ID: 30, - Text: "task #30 with assignees", + Title: "task #30 with assignees", Identifier: "test1-15", Index: 15, CreatedByID: 1, @@ -499,7 +499,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task31 := &Task{ ID: 31, - Text: "task #31 with color", + Title: "task #31 with color", Identifier: "test1-16", Index: 16, HexColor: "f0f0f0", @@ -513,7 +513,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task32 := &Task{ ID: 32, - Text: "task #32", + Title: "task #32", Identifier: "test3-1", Index: 1, CreatedByID: 1, @@ -526,7 +526,7 @@ func TestTaskCollection_ReadAll(t *testing.T) { } task33 := &Task{ ID: 33, - Text: "task #33 with percent done", + Title: "task #33 with percent done", Identifier: "test1-17", Index: 17, CreatedByID: 1, diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index d33ea233..1d2e5b27 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -37,7 +37,7 @@ type Task struct { // The unique, numeric id of this task. ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"listtask"` // The task text. This is what you'll see in the list. - Text string `xorm:"varchar(250) not null" json:"text" valid:"runelength(3|250)" minLength:"3" maxLength:"250"` + Title string `xorm:"varchar(250) not null" json:"title" valid:"runelength(3|250)" minLength:"3" maxLength:"250"` // The task description. Description string `xorm:"longtext null" json:"description"` // Whether a task is done or not. @@ -242,11 +242,11 @@ func getRawTasksForLists(lists []*List, opts *taskOptions) (tasks []*Task, resul // See https://stackoverflow.com/q/7005302/10924593 // Seems okay to use that now, we may need to find a better solution overall in the future. if config.DatabaseType.GetString() == "postgres" { - query = query.Where("text ILIKE ?", "%"+opts.search+"%") - queryCount = queryCount.Where("text ILIKE ?", "%"+opts.search+"%") + query = query.Where("title ILIKE ?", "%"+opts.search+"%") + queryCount = queryCount.Where("title ILIKE ?", "%"+opts.search+"%") } else { - query = query.Where("text LIKE ?", "%"+opts.search+"%") - queryCount = queryCount.Where("text LIKE ?", "%"+opts.search+"%") + query = query.Where("title LIKE ?", "%"+opts.search+"%") + queryCount = queryCount.Where("title LIKE ?", "%"+opts.search+"%") } } @@ -554,7 +554,7 @@ func (t *Task) Create(a web.Auth) (err error) { t.ID = 0 // Check if we have at least a text - if t.Text == "" { + if t.Title == "" { return ErrTaskCannotBeEmpty{} } @@ -758,7 +758,7 @@ func (t *Task) Update() (err error) { } _, err = x.ID(t.ID). - Cols("text", + Cols("title", "description", "done", "due_date_unix", diff --git a/pkg/models/tasks_test.go b/pkg/models/tasks_test.go index c7dd36e5..8bce9a12 100644 --- a/pkg/models/tasks_test.go +++ b/pkg/models/tasks_test.go @@ -36,7 +36,7 @@ func TestTask_Create(t *testing.T) { t.Run("normal", func(t *testing.T) { db.LoadAndAssertFixtures(t) task := &Task{ - Text: "Lorem", + Title: "Lorem", Description: "Lorem Ipsum Dolor", ListID: 1, } @@ -51,10 +51,10 @@ func TestTask_Create(t *testing.T) { assert.Equal(t, int64(1), task.BucketID) }) - t.Run("empty text", func(t *testing.T) { + t.Run("empty title", func(t *testing.T) { db.LoadAndAssertFixtures(t) task := &Task{ - Text: "", + Title: "", Description: "Lorem Ipsum Dolor", ListID: 1, } @@ -65,7 +65,7 @@ func TestTask_Create(t *testing.T) { t.Run("nonexistant list", func(t *testing.T) { db.LoadAndAssertFixtures(t) task := &Task{ - Text: "Test", + Title: "Test", Description: "Lorem Ipsum Dolor", ListID: 9999999, } @@ -77,7 +77,7 @@ func TestTask_Create(t *testing.T) { db.LoadAndAssertFixtures(t) nUser := &user.User{ID: 99999999} task := &Task{ - Text: "Test", + Title: "Test", Description: "Lorem Ipsum Dolor", ListID: 1, } @@ -92,7 +92,7 @@ func TestTask_Update(t *testing.T) { db.LoadAndAssertFixtures(t) task := &Task{ ID: 1, - Text: "test10000", + Title: "test10000", Description: "Lorem Ipsum Dolor", ListID: 1, } @@ -103,7 +103,7 @@ func TestTask_Update(t *testing.T) { db.LoadAndAssertFixtures(t) task := &Task{ ID: 9999999, - Text: "test10000", + Title: "test10000", Description: "Lorem Ipsum Dolor", ListID: 1, } @@ -215,7 +215,7 @@ func TestTask_ReadOne(t *testing.T) { task := &Task{ID: 1} err := task.ReadOne() assert.NoError(t, err) - assert.Equal(t, "task #1", task.Text) + assert.Equal(t, "task #1", task.Title) }) t.Run("nonexisting", func(t *testing.T) { db.LoadAndAssertFixtures(t) diff --git a/pkg/modules/migration/create_from_structure_test.go b/pkg/modules/migration/create_from_structure_test.go index 73a0eb66..2b235da3 100644 --- a/pkg/modules/migration/create_from_structure_test.go +++ b/pkg/modules/migration/create_from_structure_test.go @@ -34,7 +34,7 @@ func TestInsertFromStructure(t *testing.T) { testStructure := []*models.NamespaceWithLists{ { Namespace: models.Namespace{ - Name: "Test1", + Title: "Test1", Description: "Lorem Ipsum", }, Lists: []*models.List{ @@ -43,22 +43,22 @@ func TestInsertFromStructure(t *testing.T) { Description: "Something", Tasks: []*models.Task{ { - Text: "Task1", + Title: "Task1", Description: "Lorem", }, { - Text: "Task with related tasks", + Title: "Task with related tasks", RelatedTasks: map[models.RelationKind][]*models.Task{ models.RelationKindSubtask: { { - Text: "Related to task with related task", + Title: "Related to task with related task", Description: "As subtask", }, }, }, }, { - Text: "Task with attachments", + Title: "Task with attachments", Attachments: []*models.TaskAttachment{ { File: &files.File{ diff --git a/pkg/modules/migration/migrator.go b/pkg/modules/migration/migrator.go index 059a2be5..26742193 100644 --- a/pkg/modules/migration/migrator.go +++ b/pkg/modules/migration/migrator.go @@ -30,7 +30,7 @@ type Migrator interface { // The use case for this are Oauth flows, where the server token should remain hidden and not // known to the frontend. AuthURL() string - // Name holds the name of the migration. + // Title holds the name of the migration. // This is used to show the name to users and to keep track of users who already migrated. Name() string } diff --git a/pkg/modules/migration/wunderlist/wunderlist.go b/pkg/modules/migration/wunderlist/wunderlist.go index 6f09dc99..8d18b048 100644 --- a/pkg/modules/migration/wunderlist/wunderlist.go +++ b/pkg/modules/migration/wunderlist/wunderlist.go @@ -152,7 +152,7 @@ func convertListForFolder(listID int, list *list, content *wunderlistContents) ( for _, t := range content.tasks { if t.ListID == listID { newTask := &models.Task{ - Text: t.Title, + Title: t.Title, Created: timeutil.FromTime(t.CreatedAt), Done: t.Completed, } @@ -217,7 +217,7 @@ func convertListForFolder(listID int, list *list, content *wunderlistContents) ( newTask.RelatedTasks = make(models.RelatedTaskMap) } newTask.RelatedTasks[models.RelationKindSubtask] = append(newTask.RelatedTasks[models.RelationKindSubtask], &models.Task{ - Text: s.Title, + Title: s.Title, }) } } @@ -247,7 +247,7 @@ func convertWunderlistToVikunja(content *wunderlistContents) (fullVikunjaHierach for _, folder := range content.folders { namespace := &models.NamespaceWithLists{ Namespace: models.Namespace{ - Name: folder.Title, + Title: folder.Title, Created: timeutil.FromTime(folder.CreatedAt), Updated: timeutil.FromTime(folder.UpdatedAt), }, @@ -274,7 +274,7 @@ func convertWunderlistToVikunja(content *wunderlistContents) (fullVikunjaHierach if len(listMap) > 0 { newNamespace := &models.NamespaceWithLists{ Namespace: models.Namespace{ - Name: "Migrated from wunderlist", + Title: "Migrated from wunderlist", }, } diff --git a/pkg/modules/migration/wunderlist/wunderlist_test.go b/pkg/modules/migration/wunderlist/wunderlist_test.go index 405d6150..7b3fc6d0 100644 --- a/pkg/modules/migration/wunderlist/wunderlist_test.go +++ b/pkg/modules/migration/wunderlist/wunderlist_test.go @@ -192,7 +192,7 @@ func TestWunderlistParsing(t *testing.T) { expectedHierachie := []*models.NamespaceWithLists{ { Namespace: models.Namespace{ - Name: "Lorem Ipsum", + Title: "Lorem Ipsum", Created: timeutil.FromTime(time1), Updated: timeutil.FromTime(time2), }, @@ -202,7 +202,7 @@ func TestWunderlistParsing(t *testing.T) { Title: "Lorem1", Tasks: []*models.Task{ { - Text: "Ipsum1", + Title: "Ipsum1", DueDate: 1378339200, Created: timeutil.FromTime(time1), Description: "Lorem Ipsum dolor sit amet", @@ -222,17 +222,17 @@ func TestWunderlistParsing(t *testing.T) { Reminders: []timeutil.TimeStamp{timeutil.FromTime(time4)}, }, { - Text: "Ipsum2", + Title: "Ipsum2", DueDate: 1378339200, Created: timeutil.FromTime(time1), Description: "Lorem Ipsum dolor sit amet", RelatedTasks: map[models.RelationKind][]*models.Task{ models.RelationKindSubtask: { { - Text: "LoremSub1", + Title: "LoremSub1", }, { - Text: "LoremSub2", + Title: "LoremSub2", }, }, }, @@ -244,7 +244,7 @@ func TestWunderlistParsing(t *testing.T) { Title: "Lorem2", Tasks: []*models.Task{ { - Text: "Ipsum3", + Title: "Ipsum3", Done: true, DoneAt: timeutil.FromTime(time1), DueDate: 1378339200, @@ -265,14 +265,14 @@ func TestWunderlistParsing(t *testing.T) { }, }, { - Text: "Ipsum4", + Title: "Ipsum4", DueDate: 1378339200, Created: timeutil.FromTime(time1), Reminders: []timeutil.TimeStamp{timeutil.FromTime(time3)}, RelatedTasks: map[models.RelationKind][]*models.Task{ models.RelationKindSubtask: { { - Text: "LoremSub3", + Title: "LoremSub3", }, }, }, @@ -284,26 +284,26 @@ func TestWunderlistParsing(t *testing.T) { Title: "Lorem3", Tasks: []*models.Task{ { - Text: "Ipsum5", + Title: "Ipsum5", DueDate: 1378339200, Created: timeutil.FromTime(time1), }, { - Text: "Ipsum6", + Title: "Ipsum6", DueDate: 1378339200, Created: timeutil.FromTime(time1), Done: true, DoneAt: timeutil.FromTime(time1), }, { - Text: "Ipsum7", + Title: "Ipsum7", DueDate: 1378339200, Created: timeutil.FromTime(time1), Done: true, DoneAt: timeutil.FromTime(time1), }, { - Text: "Ipsum8", + Title: "Ipsum8", DueDate: 1378339200, Created: timeutil.FromTime(time1), }, @@ -314,14 +314,14 @@ func TestWunderlistParsing(t *testing.T) { Title: "Lorem4", Tasks: []*models.Task{ { - Text: "Ipsum9", + Title: "Ipsum9", DueDate: 1378339200, Created: timeutil.FromTime(time1), Done: true, DoneAt: timeutil.FromTime(time1), }, { - Text: "Ipsum10", + Title: "Ipsum10", DueDate: 1378339200, Created: timeutil.FromTime(time1), Done: true, @@ -333,7 +333,7 @@ func TestWunderlistParsing(t *testing.T) { }, { Namespace: models.Namespace{ - Name: "Migrated from wunderlist", + Title: "Migrated from wunderlist", }, Lists: []*models.List{ { diff --git a/pkg/routes/api/v1/docs.go b/pkg/routes/api/v1/docs.go index 3702f630..29de0e86 100644 --- a/pkg/routes/api/v1/docs.go +++ b/pkg/routes/api/v1/docs.go @@ -111,7 +111,7 @@ e.exports=function(){"use strict";var e="function"==typeof Symbol&&"symbol"==typ object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;le._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new r(i.length),s=0;se._pos&&(e.push(new r(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===l.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,n(6),n(9).Buffer,n(4))},function(e,t,n){(t=e.exports=n(110)).Stream=t,t.Readable=t,t.Writable=n(114),t.Duplex=n(30),t.Transform=n(116),t.PassThrough=n(229)},function(e,t,n){"use strict";(function(t,r){var o=n(49);e.exports=b;var i,a=n(101);b.ReadableState=v;n(111).EventEmitter;var s=function(e,t){return e.listeners(t).length},l=n(112),c=n(50).Buffer,u=t.Uint8Array||function(){};var p=n(38);p.inherits=n(20);var f=n(223),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var h,m=n(224),g=n(113);p.inherits(b,l);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(30));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n(115).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(30),!(this instanceof b))return new b(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),l.call(this)}function w(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):O(e,a)):x(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(_,e):_(e))}function _(e){d("emit readable"),e.emit("readable"),A(e)}function O(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,o=t.needReadable;return d("need readable",o),(0===t.length||t.length-e0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:b;function c(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",p),e.removeListener("error",g),e.removeListener("unpipe",c),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",m),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function u(){d("onend"),e.end()}i.endEmitted?o.nextTick(l):n.once("end",l),e.on("unpipe",c);var p=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,A(e))}}(n);e.on("drain",p);var f=!1;var h=!1;function m(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function g(t){d("onerror",t),b(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),b()}function v(){d("onfinish"),e.removeListener("close",y),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",y),e.once("finish",v),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function o(){this.removeListener(e,o),n||(n=!0,t.apply(this,arguments))}return o.listener=t,this.on(e,o),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){e.exports=n(111).EventEmitter},function(e,t,n){"use strict";var r=n(49);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t,r,o){var i=n(49);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,l=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;v.WritableState=y;var c=n(38);c.inherits=n(20);var u={deprecate:n(228)},p=n(112),f=n(50).Buffer,d=o.Uint8Array||function(){};var h,m=n(113);function g(){}function y(e,t){s=s||n(30),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=!1===e.decodeStrings;this.decodeStrings=!p,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,o);else{var a=k(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||x(e,n),r?l(w,e,n,a,o):w(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||n(30),!(h.call(v,this)||this instanceof s))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),p.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,l=!0;n;)o[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;o.allBuffers=l,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,p=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,u,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=k(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(v,p),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===v&&(e&&e._writableState instanceof y)}})):h=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof d);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=g),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(6),n(226).setImmediate,n(4))},function(e,t,n){"use strict";var r=n(50).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=p,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--r=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=i;var r=n(30),o=n(38);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._transformState={afterTransform:function(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length0?l:s;i.sort(c),i.run(c,"parse",e).then(function(n){!n.plugin.allowEmpty&&(i=n.result,void 0===i||"object"==typeof i&&0===Object.keys(i).length||"string"==typeof i&&0===i.trim().length||t.isBuffer(i)&&0===i.length)?a(r.syntax('Error parsing "%s" as %s. \nParsed value is empty',e.url,n.plugin.name)):o(n);var i},function(t){t?(t=t instanceof Error?t:new Error(t),a(r.syntax(t,"Error parsing %s",e.url))):a(r.syntax("Unable to parse %s",e.url))})})}(l,a)}).then(function(e){return s.value=e.result,e.result})}catch(e){return Promise.reject(e)}}}).call(this,n(9).Buffer)},function(e,t,n){"use strict";(function(t,n){var r=t.process&&n.nextTick||t.setImmediate||function(e){setTimeout(e,0)};e.exports=function(e,t){return e?void t.then(function(t){r(function(){e(null,t)})},function(t){r(function(){e(t)})}):t}}).call(this,n(4),n(6))},function(e,t){},function(t,n){t.exports=e},function(e,t,n){"use strict";e.exports={isRef:function(e,t){return"$ref"===t&&!!e&&"string"==typeof e[t]}}},function(e,t,n){"use strict";var r=n(76).jpescape;e.exports={recurse:function e(t,n,o){if(n||(n={depth:0}),n.depth||(n=Object.assign({},{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1},n)),"object"==typeof t){var i=n.path;for(var a in t){if(n.key=a,n.path=n.path+"/"+encodeURIComponent(r(a)),n.identityPath=n.seen.get(t[a]),n.identity=void 0!==n.identityPath,o(t,a,n),"object"==typeof t[a]&&!n.identity){n.identityDetection&&!Array.isArray(t[a])&&null!==t[a]&&n.seen.set(t[a],n.path);var s={};s.parent=t,s.path=n.path,s.depth=n.depth?n.depth+1:1,s.pkey=a,s.payload=n.payload,s.seen=n.seen,s.identity=!1,s.identityDetection=n.identityDetection,e(t[a],s,o)}n.path=i}}}}},function(e,t,n){"use strict";(function(t){var r=n(46),o=t.env.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"",yellow:"",green:"",normal:""};function i(e){for(var t=[],n=function(e){t.find(function(t,n,o){return function(e,t){function n(e,t){return r.dump(e)===r.dump(Object.assign({},e,t))}return n(e,t)&&n(t,e)}(t,e)})||t.push(e)},o=0,i=e;o":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","џ":"dz","Ґ":"G","ґ":"g","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","‘":"\'","’":"\'","“":"\\"","”":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₹":"indian rupee","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial"}');function t(t,n){if("string"!=typeof t)throw new Error("slugify: string argument expected");n="string"==typeof n?{replacement:n}:n||{};var r=t.split("").reduce(function(t,r){return t+(e[r]||r).replace(n.remove||/[^\w\s$*_+~.()'"!\-:@]/g,"")},"").trim().replace(/[-\s]+/g,n.replacement||"-");return n.lower?r.toLowerCase():r}return t.extend=function(t){for(var n in t)e[n]=t[n]},t},e.exports=r(),e.exports.default=r()},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"css",function(){return ye}),n.d(t,"keyframes",function(){return it}),n.d(t,"createGlobalStyle",function(){return rt}),n.d(t,"isStyledComponent",function(){return O}),n.d(t,"ThemeConsumer",function(){return Ye}),n.d(t,"ThemeContext",function(){return He}),n.d(t,"ThemeProvider",function(){return Ve}),n.d(t,"withTheme",function(){return at}),n.d(t,"ServerStyleSheet",function(){return Qe}),n.d(t,"StyleSheetManager",function(){return Ke}),n.d(t,"__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS",function(){return st});var r=n(78),o=n.n(r),i=n(127),a=n.n(i),s=n(0),l=n.n(s),c=n(128),u=n(54),p=n(39),f=(n(11),n(13),n(133)),d=function(e,t){for(var n=[e[0]],r=0,o=t.length;r=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},w=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},x=function(e){return"object"===(void 0===e?"undefined":h(e))&&e.constructor===Object},k=Object.freeze([]),E=Object.freeze({});function S(e){return"function"==typeof e}function _(e){return e.displayName||e.name||"Component"}function O(e){return e&&"string"==typeof e.styledComponentId}var C=void 0!==e&&e.env.SC_ATTR||"data-styled",T="undefined"!=typeof window&&"HTMLElement"in window,j="boolean"==typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY||!1,A={};var I=function(e){function t(n){m(this,t);for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i0&&-1!==n.slice(0,t).indexOf(z)&&n.slice(t-z.length,t)!==z?"."+B:e};M.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(z)>0&&(n[0]=n[0].replace($,W))},U,F]),L.use([U,F]);function q(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(N,""),i=t&&n?n+" "+t+" { "+o+" }":o;return B=r,z=t,$=new RegExp("\\"+z+"\\b","g"),M(n||!t?"":t,i)}var H=function(){return n.nc},Y=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},V=function(e,t){e[t]=Object.create(null)},Q=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},G=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},X=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets.length,n=0;n"+e()+""}},te=function(e,t){return function(){var n,r=((n={})[C]=G(t),n["data-styled-version"]="4.1.1",n),o=H();return o&&(r.nonce=o),l.a.createElement("style",y({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e){return document.createTextNode(J(e))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=J(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=y({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:Q(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),Y(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",V(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(T&&!n){var i=function(e,t,n){var r=document.createElement("style");r.setAttribute(C,""),r.setAttribute("data-styled-version","4.1.1");var o=H();if(o&&r.setAttribute("nonce",o),r.appendChild(document.createTextNode("")),e&&!t)e.appendChild(r);else{if(!t||!e||!t.parentNode)throw new I(6);t.parentNode.insertBefore(r,n?t:t.nextSibling)}return r}(e,t,r);return j?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},s=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new I(5)},css:s,getIds:ne(r),hasNameForId:Q(n),insertMarker:a,insertRules:function(e,r,s){for(var l=a(e),c=[],u=r.length,p=0;p0&&(i=!0,t().insertRules(e+"-import",c))},removeRules:function(a){var s=r[a];if(void 0!==s){var l=re(a);e.replaceChild(l,s),r[a]=l,V(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(s,n),toHTML:ee(s,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,s=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),V(n,e),r[e])},l=function(){var t=X(e).cssRules,n="";for(var i in r){n+=J(i);for(var a=r[i],s=Z(o,a),l=s-o[a];l0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,Y(n,r,c)},removeRules:function(s){var l=r[s];if(void 0!==l){var c=o[l];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(X(e),Z(o,l)-1,c),o[l]=0,V(n,s),i&&a&&t().removeRules(s+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o)}return oe()},ae=/\s+/,se=void 0;se=T?j?40:1e3:-1;var le=0,ce=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},le+=1,this.id=le,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!T||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+C+'][data-styled-version="4.1.1"]'),o=r.length;if(!o)return this;for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];ce=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map(function(e){for(var n=e.getIds(),r=e.clone(),o=0;o1?t-1:0),r=1;r=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var be=52,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>be;n=Math.floor(n/be))t=we(n%be)+t;return we(n%be)+t}function ke(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:E,r=!!n&&e.theme===n.theme;return e.theme&&!r?e.theme:t||n.theme},Te=/[[\].#*$><+~=|^:(),"'` + "`" + `-]+/g,je=/(^-|-$)/g;function Ae(e){return e.replace(Te,"-").replace(je,"")}function Ie(e){return"string"==typeof e}var Pe={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Re={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ne=((Ee={})[u.ForwardRef]={$$typeof:!0,render:!0},Ee),Le=Object.defineProperty,Me=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,Fe=void 0===De?function(){return[]}:De,Ue=Object.getOwnPropertyDescriptor,Be=Object.getPrototypeOf,ze=Object.prototype,$e=Array.prototype;function We(e,t,n){if("string"!=typeof t){var r=Be(t);r&&r!==ze&&We(e,r,n);for(var o=$e.concat(Me(t),Fe(t)),i=Ne[e.$$typeof]||Pe,a=Ne[t.$$typeof]||Pe,s=o.length,l=void 0,c=void 0;s--;)if(c=o[s],!(Re[c]||n&&n[c]||a&&a[c]||i&&i[c])&&(l=Ue(t,c)))try{Le(e,c,l)}catch(e){}return e}return e}var qe=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}},He=Object(s.createContext)(),Ye=He.Consumer,Ve=function(e){function t(n){m(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(p.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return v(t,e),t.prototype.render=function(){return this.props.children?l.a.createElement(He.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return l.a.createElement(He.Provider,{value:t},l.a.Children.only(this.props.children))},t.prototype.getTheme=function(e,t){if(S(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":h(e)))throw new I(8);return y({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(s.Component),Qe=function(){function e(){m(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}return e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new I(2);return l.a.createElement(Ke,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new I(3)},e}(),Ge=Object(s.createContext)(),Xe=Ge.Consumer,Ke=function(e){function t(n){m(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(p.a)(r.getContext),r}return v(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new I(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return l.a.createElement(Ge.Provider,{value:this.getContext(n,r)},t)},t}(s.Component),Je=(new Set,{});qe(function(){return console.warn('The "innerRef" API has been removed in styled-components v4 in favor of React 16 ref forwarding, use "ref" instead like a typical component.')}),qe(function(e,t){return console.warn('Functions as object-form attrs({}) keys are now deprecated and will be removed in a future version of styled-components. Switch to the new attrs(props => ({})) syntax instead for easier and more powerful composition. The attrs key in question is "'+e+'" on component "'+t+'".')}),qe(function(e,t){return console.warn("It looks like you've used a non styled-component as the value for the \""+e+'" prop in an object-form attrs constructor of "'+t+"\".\nYou should use the new function-form attrs constructor which avoids this issue: attrs(props => ({ yourStuff }))\nTo continue using the deprecated object syntax, you'll need to wrap your component prop in a function to make it available inside the styled component (you'll still get the deprecation warning though.)\nFor example, { "+e+": () => InnerComponent } instead of { "+e+": InnerComponent }")});var Ze=function(e){function t(){m(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return v(t,e),t.prototype.render=function(){return l.a.createElement(Xe,null,this.renderOuter)},t.prototype.renderOuter=function(e){return this.styleSheet=e,this.props.forwardedClass.componentStyle.isStatic?this.renderInner():l.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedClass,n=t.componentStyle,r=t.defaultProps,o=t.styledComponentId,i=t.target,a=void 0;a=n.isStatic?this.generateAndInjectStyles(E,this.props,this.styleSheet):void 0!==e?this.generateAndInjectStyles(Ce(this.props,e,r),this.props,this.styleSheet):this.generateAndInjectStyles(this.props.theme||E,this.props,this.styleSheet);var l=this.props.as||this.attrs.as||i,c=Ie(l),u={},p=y({},this.attrs,this.props),d=void 0;for(d in p)"forwardedClass"!==d&&"as"!==d&&("forwardedRef"===d?u.ref=p[d]:c&&!Object(f.a)(d)||(u[d]=p[d]));return this.props.style&&this.attrs.style&&(u.style=y({},this.attrs.style,this.props.style)),u.className=[this.props.className,o,this.attrs.className,a].filter(Boolean).join(" "),Object(s.createElement)(l,u)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=y({},t,{theme:e});return n.length?(this.attrs={},n.forEach(function(e){var n,i=e,a=!1,s=void 0,l=void 0;for(l in S(i)&&(i=i(t),a=!0),i)s=i[l],a||!S(s)||(n=s)&&n.prototype&&n.prototype.isReactComponent||O(s)||(s=s(o)),r.attrs[l]=s,o[l]=s}),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ue.master,r=t.forwardedClass,o=r.attrs,i=r.componentStyle;r.warnTooManyClasses;return i.isStatic&&!o.length?i.generateAndInjectStyles(E,n):i.generateAndInjectStyles(this.buildExecutionContext(e,t,o),n)},t}(s.Component);function et(e,t,n){var r=O(e),o=!Ie(e),i=t.displayName,a=void 0===i?function(e){return Ie(e)?"styled."+e:"Styled("+_(e)+")"}(e):i,s=t.componentId,c=void 0===s?function(e,t,n){var r="string"!=typeof t?"sc":Ae(t),o=(Je[r]||0)+1;Je[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Oe,t.displayName,t.parentComponentId):s,u=t.ParentComponent,p=void 0===u?Ze:u,f=t.attrs,d=void 0===f?k:f,h=t.displayName&&t.componentId?Ae(t.displayName)+"-"+t.componentId:t.componentId||c,m=r&&e.attrs?Array.prototype.concat(e.attrs,d).filter(Boolean):d,g=new Oe(r?e.componentStyle.rules.concat(n):n,m,h),v=l.a.forwardRef(function(e,t){return l.a.createElement(p,y({},e,{forwardedClass:v,forwardedRef:t}))});return v.attrs=m,v.componentStyle=g,v.displayName=a,v.styledComponentId=h,v.target=r?e.target:e,v.withComponent=function(e){var r=t.componentId,o=b(t,["componentId"]),i=r&&r+"-"+(Ie(e)?e:Ae(_(e)));return et(e,y({},o,{attrs:m,componentId:i,ParentComponent:p}),n)},v.toString=function(){return"."+v.styledComponentId},o&&We(v,e,{attrs:!0,componentStyle:!0,displayName:!0,styledComponentId:!0,target:!0,withComponent:!0}),v}var tt=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(!Object(u.isValidElementType)(n))throw new I(1,String(n));var o=function(){return t(n,r,ye.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,y({},r,o))},o.attrs=function(o){return e(t,n,y({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(et,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){tt[e]=tt(e)});var nt=function(){function e(t,n){m(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}return e.prototype.createStyles=function(e,t){var n=q(ge(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)},e}();function rt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1&&k("Lost properties from oneOf",e,n),delete e.oneOf)}e.type&&Array.isArray(e.type)&&1===e.type.length&&(e.type=e.type[0])}else x("(Patchable) schema type must not be an array",n);e.type&&"null"===e.type&&(delete e.type,e.nullable=!0),"array"!==e.type||e.items||(e.items={}),"boolean"==typeof e.required&&(e.required&&e.name&&(void 0===t.required&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&"string"==typeof e.xml.namespace&&(e.xml.namespace||delete e.xml.namespace)}(e,n,t)})}function S(e,t,n){var o,i=n.payload.options;if(p(e,t))if(e[t].startsWith("#/components/"));else if(e[t].startsWith("#/definitions/")){var a=e[t].replace("#/definitions/","").split("/");(b=r.schemas[decodeURIComponent(a[0])])?a[0]=b:k("Could not resolve reference "+e[t],e,i),e[t]="#/components/schemas/"+a.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+y.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+y.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){var s=f(c.jptr(i.openapi,e[t]));if(!1===s)k("direct $ref not found "+e[t],e,i);else if(i.refmap[e[t]])e[t]=i.refmap[e[t]];else{var l=e[t],u="schemas",d=(l=(l=(l=(l=l.replace("/properties/headers/","")).replace("/properties/responses/","")).replace("/properties/parameters/","")).replace("/properties/schemas/","")).lastIndexOf("/schema");if("schemas"===(u=l.indexOf("/headers/")>d?"headers":l.indexOf("/responses/")>d?"responses":l.indexOf("/example")>d?"examples":l.indexOf("/parameters/")>d?"parameters":"schemas")&&E(s,i),"responses"!==u){var h=u.substr(0,u.length-1);"parameter"===h&&s.name&&s.name===y.sanitise(s.name)&&(h=encodeURIComponent(s.name));var m=1;for(e["x-miro"]&&(o=(o=e["x-miro"]).indexOf("#")>=0?o.split("#")[1].split("/").pop():o.split("/").pop().split(".")[0],h=encodeURIComponent(y.sanitise(o)),m="");c.jptr(i.openapi,"#/components/"+u+"/"+h+m);)m=""===m?2:++m;var g="#/components/"+u+"/"+h+m,v="";"examples"===u&&(s={value:s},v="/value"),c.jptr(i.openapi,g,s),i.refmap[e[t]]=g+v,e[t]=g+v}}}if(delete e["x-miro"],"x-ms-odata"===t&&"string"==typeof e[t]&&e[t].startsWith("#/")){var b;a=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/");(b=r.schemas[decodeURIComponent(a[0])])?a[0]=b:k("Could not resolve reference "+e[t],e,i),e[t]="#/components/schemas/"+a.join("/")}}function _(e){for(var t in e)for(var n in e[t]){var r=y.sanitise(n);n!=r&&(e[t][r]=e[t][n],delete e[t][n])}}function O(e,t){if("basic"===e.type&&(e.type="http",e.scheme="basic"),"oauth2"===e.type){var n={},r=e.flow;"application"===e.flow&&(r="clientCredentials"),"accessCode"===e.flow&&(r="authorizationCode"),void 0!==e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),void 0!==e.tokenUrl&&(n.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),n.scopes=e.scopes||{},e.flows={},e.flows[r]=n,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,void 0!==e.name&&(t.patch?delete e.name:x("(Patchable) oauth2 securitySchemes should not have name property",t))}}function C(e){return!e["x-s2o-delete"]}function T(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&e.items.collectionFormat&&e.items.type&&"array"!=e.items.type&&(e.items.collectionFormat!=e.collectionFormat&&k("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),void 0!==e.collectionFormat&&("array"!=e.type&&(t.patch?delete e.collectionFormat:x("(Patchable) collectionFormat is only applicable to header.type array",t)),"csv"===e.collectionFormat&&(e.style="simple"),"ssv"===e.collectionFormat&&k("collectionFormat:ssv is no longer supported for headers",e,t),"pipes"===e.collectionFormat&&k("collectionFormat:pipes is no longer supported for headers",e,t),"multi"===e.collectionFormat&&(e.explode=!0),"tsv"===e.collectionFormat&&(k("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),delete e.type;for(var n=0,r=y.parameterTypeProperties;n=0){var n=e.$ref.split("#/parameters/");e.$ref=n[0]+"#/components/parameters/"+y.sanitise(n[1])}e.$ref.indexOf("#/definitions/")>=0&&k("Definition used as parameter",e,t)}function A(e,t,n,r,o,i){var a={},s=!0,l=(t&&t.consumes||o.consumes||[]).filter(y.uniqueOnly);if(e.$ref&&"string"==typeof e.$ref){j(e,i);var c=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),p=!1;if((O=o.components.parameters[c])&&!O["x-s2o-delete"]||!e.$ref.startsWith("#/")||(e["x-s2o-delete"]=!0,p=!0),p){var d=e.$ref,m=u(o,e.$ref);!m&&d.startsWith("#/")?k("Could not resolve reference "+d,e,i):m&&(e=m)}}if(e.name||e.in){"boolean"==typeof e["x-deprecated"]&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),void 0!==e["x-example"]&&(e.example=e["x-example"],delete e["x-example"]),"body"==e.in||e.type||(i.patch?e.type="string":x("(Patchable) parameter.type is mandatory for non-body parameters",i)),e.type&&"object"==typeof e.type&&e.type.$ref&&(e.type=u(o,e.type.$ref)),e.description&&"object"==typeof e.description&&e.description.$ref&&(e.description=u(o,e.description.$ref)),null===e.description&&delete e.description;var g=e.collectionFormat;if(e.collectionFormat&&("array"!=e.type&&(i.patch?delete e.collectionFormat:x("(Patchable) collectionFormat is only applicable to param.type array",i)),"csv"!==e.collectionFormat||"query"!==e.in&&"cookie"!==e.in||(e.style="form",e.explode=!1),"csv"!==e.collectionFormat||"path"!==e.in&&"header"!==e.in||(e.style="simple"),"ssv"===e.collectionFormat&&("query"===e.in?e.style="spaceDelimited":k("collectionFormat:ssv is no longer supported except for in:query parameters",e,i)),"pipes"===e.collectionFormat&&("query"===e.in?e.style="pipeDelimited":k("collectionFormat:pipes is no longer supported except for in:query parameters",e,i)),"multi"===e.collectionFormat&&(e.explode=!0),"tsv"===e.collectionFormat&&(k("collectionFormat:tsv is no longer supported",e,i),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&"object"!=e.type&&"body"!=e.type&&"formData"!=e.in)if(e.items&&e.schema)k("parameter has array,items and schema",e,i);else{e.schema&&"object"==typeof e.schema||(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,h(e.schema.items,null,function(t,n,r){"collectionFormat"===n&&"string"==typeof t[n]&&(g&&t[n]!==g&&k("Nested collectionFormats are not supported",e,i),delete t[n])}));for(var v=0,b=y.parameterTypeProperties;v=0&&(S="multipart/form-data"),a.content[S]={},e.schema)a.content[S].schema=e.schema,e.schema.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{a.content[S].schema={},a.content[S].schema.type="object",a.content[S].schema.properties={},a.content[S].schema.properties[e.name]={};var _=a.content[S].schema,O=a.content[S].schema.properties[e.name];e.description&&(O.description=e.description),e.example&&(O.example=e.example),e.type&&(O.type=e.type);for(var C=0,T=y.parameterTypeProperties;C0&&(e["x-s2o-delete"]=!0,t&&(t.requestBody&&s?(t.requestBody["x-s2o-overloaded"]=!0,k("Operation "+(t.operationId||r)+" has multiple requestBodies",t,i)):(t.requestBody=Object.assign({},t.requestBody),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&a.content["multipart/form-data"]?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,a.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(a.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&a.content["application/x-www-form-urlencoded"]?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,a.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(a.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,a),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=y.sanitiseAll(t.operationId)))))));delete e.type;for(var R=0,N=y.parameterTypeProperties;R=0?k("definition used as response: "+e.$ref,e,o):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+y.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if(void 0===e.description||null===e.description||""===e.description&&o.patch)if(o.patch){var i=v.find(function(e){return e.code===t});"object"!=typeof e||Array.isArray(e)||(e.description=i?i.phrase:"")}else x("(Patchable) response.description is mandatory",o);if(e.schema){E(e.schema,o),e.schema.$ref&&"string"==typeof e.schema.$ref&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+y.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/",""))));var a=(n&&n.produces||r.produces||[]).filter(y.uniqueOnly);a.length||a.push("*/*"),e.content={};for(var s=0,l=a;s=0||"x-amazon-apigateway-any-method"===l){var p=s[l];if(p.parameters&&Array.isArray(p.parameters)){if(s.parameters)for(var d=function(e){"string"==typeof e.$ref&&(j(e,n),e=u(o,e.$ref)),p.parameters.find(function(t,n,r){return t.name===e.name&&t.in===e.in})||"formData"!==e.in&&"body"!==e.in&&"file"!==e.type||A(e,p,0,a,o,n)},h=0,m=s.parameters;h1){i="";for(k.name||(k.name="requestBody",i=b++);v.indexOf(k.name+i)>=0;)i=i?++i:2;for(var s in k.name=k.name+i,v.push(k.name),e.components.requestBodies[k.name]=f(k.body),k.refs){var C={};C.$ref="#/components/requestBodies/"+k.name,c.jptr(e,k.refs[s],C)}}}return e.components.responses&&0===Object.keys(e.components.responses).length&&delete e.components.responses,e.components.parameters&&0===Object.keys(e.components.parameters).length&&delete e.components.parameters,e.components.examples&&0===Object.keys(e.components.examples).length&&delete e.components.examples,e.components.requestBodies&&0===Object.keys(e.components.requestBodies).length&&delete e.components.requestBodies,e.components.securitySchemes&&0===Object.keys(e.components.securitySchemes).length&&delete e.components.securitySchemes,e.components.headers&&0===Object.keys(e.components.headers).length&&delete e.components.headers,e.components.schemas&&0===Object.keys(e.components.schemas).length&&delete e.components.schemas,e.components&&0===Object.keys(e.components).length&&delete e.components,e}function N(e){e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,function(t,n){e.variables||(e.variables={}),e.variables[n]={default:"unknown"}})}function L(e,t,n){if(void 0===e.info||null===e.info){if(!t.patch)return n(new Error("(Patchable) info object is mandatory"));e.info={version:"",title:""}}if("object"!=typeof e.info||Array.isArray(e.info))return n(new Error("info must be an object"));if(void 0===e.info.title||null===e.info.title){if(!t.patch)return n(new Error("(Patchable) info.title cannot be null"));e.info.title=""}if(void 0===e.info.version||null===e.info.version){if(!t.patch)return n(new Error("(Patchable) info.version cannot be null"));e.info.version=""}if("string"!=typeof e.info.version){if(!t.patch)return n(new Error("(Patchable) info.version must be a string"));e.info.version=e.info.version.toString()}if(void 0!==e.info.logo){if(!t.patch)return n(new Error("(Patchable) info should not have logo property"));e.info["x-logo"]=e.info.logo,delete e.info.logo}if(void 0!==e.info.termsOfService){if(null===e.info.termsOfService){if(!t.patch)return n(new Error("(Patchable) info.termsOfService cannot be null"));e.info.termsOfService=""}if(i.URL&&t.whatwg)try{i.URL.parse(e.info.termsOfService)}catch(r){if(!t.patch)return n(new Error("(Patchable) info.termsOfService must be a URL"));delete e.info.termsOfService}}}function M(e,t,n){if(void 0===e.paths){if(!t.patch)return n(new Error("(Patchable) paths object is mandatory"));e.paths={}}}function D(e,t,n){return a(n,new Promise(function(n,r){if(t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=r,t.cache||(t.cache={}),e.openapi&&"string"==typeof e.openapi&&e.openapi.startsWith("3."))return t.openapi=d(e),L(t.openapi,t,r),M(t.openapi,t,r),void m.optionalResolve(t).then(function(){return t.direct?n(t.openapi):n(t)}).catch(function(e){console.warn(e),r(e)});if(!e.swagger||"2.0"!=e.swagger)return r(new Error("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));var o=t.openapi={};if(o.openapi=w,t.origin){o["x-origin"]||(o["x-origin"]=[]);var i={};i.url=t.source||t.origin,i.format="swagger",i.version=e.swagger,i.converter={},i.converter.url="https://github.com/mermade/oas-kit",i.converter.version=b,o["x-origin"].push(i)}if(delete(o=Object.assign(o,d(e))).swagger,e.host)for(var a=0,s=e.schemes||[""];a/gm,d=/^data-[\-\w.\u00B7-\uFFFF]/,h=/^aria-[\-\w]+$/,m=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,g=/^(?:\w+script|data):/i,y=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function b(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:w(),E=function(e){return x(e)};if(E.version="1.0.8",E.removed=[],!k||!k.document||9!==k.document.nodeType)return E.isSupported=!1,E;var S=k.document,_=!1,O=!1,C=k.document,T=k.DocumentFragment,j=k.HTMLTemplateElement,A=k.Node,I=k.NodeFilter,P=k.NamedNodeMap,R=void 0===P?k.NamedNodeMap||k.MozNamedAttrMap:P,N=k.Text,L=k.Comment,M=k.DOMParser;if("function"==typeof j){var D=C.createElement("template");D.content&&D.content.ownerDocument&&(C=D.content.ownerDocument)}var F=C,U=F.implementation,B=F.createNodeIterator,z=F.getElementsByTagName,$=F.createDocumentFragment,W=S.importNode,q={};E.isSupported=U&&void 0!==U.createHTMLDocument&&9!==C.documentMode;var H=p,Y=f,V=d,Q=h,G=g,X=y,K=m,J=null,Z=c({},[].concat(b(e),b(t),b(n),b(r),b(o))),ee=null,te=c({},[].concat(b(i),b(a),b(s),b(l))),ne=null,re=null,oe=!0,ie=!0,ae=!1,se=!1,le=!1,ce=!1,ue=!1,pe=!1,fe=!1,de=!1,he=!1,me=!0,ge=!0,ye=!1,ve={},be=c({},["audio","head","math","script","style","template","svg","video"]),we=c({},["audio","video","img","source","image"]),xe=c({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),ke=null,Ee=C.createElement("form"),Se=function(p){"object"!==(void 0===p?"undefined":v(p))&&(p={}),J="ALLOWED_TAGS"in p?c({},p.ALLOWED_TAGS):Z,ee="ALLOWED_ATTR"in p?c({},p.ALLOWED_ATTR):te,ne="FORBID_TAGS"in p?c({},p.FORBID_TAGS):{},re="FORBID_ATTR"in p?c({},p.FORBID_ATTR):{},ve="USE_PROFILES"in p&&p.USE_PROFILES,oe=!1!==p.ALLOW_ARIA_ATTR,ie=!1!==p.ALLOW_DATA_ATTR,ae=p.ALLOW_UNKNOWN_PROTOCOLS||!1,se=p.SAFE_FOR_JQUERY||!1,le=p.SAFE_FOR_TEMPLATES||!1,ce=p.WHOLE_DOCUMENT||!1,fe=p.RETURN_DOM||!1,de=p.RETURN_DOM_FRAGMENT||!1,he=p.RETURN_DOM_IMPORT||!1,pe=p.FORCE_BODY||!1,me=!1!==p.SANITIZE_DOM,ge=!1!==p.KEEP_CONTENT,ye=p.IN_PLACE||!1,K=p.ALLOWED_URI_REGEXP||K,le&&(ie=!1),de&&(fe=!0),ve&&(J=c({},[].concat(b(o))),ee=[],!0===ve.html&&(c(J,e),c(ee,i)),!0===ve.svg&&(c(J,t),c(ee,a),c(ee,l)),!0===ve.svgFilters&&(c(J,n),c(ee,a),c(ee,l)),!0===ve.mathMl&&(c(J,r),c(ee,s),c(ee,l))),p.ADD_TAGS&&(J===Z&&(J=u(J)),c(J,p.ADD_TAGS)),p.ADD_ATTR&&(ee===te&&(ee=u(ee)),c(ee,p.ADD_ATTR)),p.ADD_URI_SAFE_ATTR&&c(xe,p.ADD_URI_SAFE_ATTR),ge&&(J["#text"]=!0),ce&&c(J,["html","head","body"]),J.table&&c(J,["tbody"]),Object&&"freeze"in Object&&Object.freeze(p),ke=p},_e=function(e){E.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},Oe=function(e,t){try{E.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){E.removed.push({attribute:null,from:t})}t.removeAttribute(e)},Ce=function(e){var t=void 0;if(pe&&(e=""+e),_)try{t=(new M).parseFromString(e,"text/html")}catch(e){}if(O&&c(ne,["title"]),!t||!t.documentElement){var n=t=U.createHTMLDocument(""),r=n.body;r.parentNode.removeChild(r.parentNode.firstElementChild),r.outerHTML=e}return z.call(t,ce?"html":"body")[0]};E.isSupported&&(function(){try{var e=Ce('

');e.querySelector("svg img")&&(_=!0)}catch(e){}}(),function(){try{var e=Ce("</title><img>");e.querySelector("title").textContent.match(/<\/title/)&&(O=!0)}catch(e){}}());var Te=function(e){return B.call(e.ownerDocument||e,e,I.SHOW_ELEMENT|I.SHOW_COMMENT|I.SHOW_TEXT,function(){return I.FILTER_ACCEPT},!1)},je=function(e){return"object"===(void 0===A?"undefined":v(A))?e instanceof A:e&&"object"===(void 0===e?"undefined":v(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ae=function(e,t,n){q[e]&&q[e].forEach(function(e){e.call(E,t,n,ke)})},Ie=function(e){var t,n=void 0;if(Ae("beforeSanitizeElements",e,null),!((t=e)instanceof N||t instanceof L||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof R&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute))return _e(e),!0;var r=e.nodeName.toLowerCase();if(Ae("uponSanitizeElement",e,{tagName:r,allowedTags:J}),!J[r]||ne[r]){if(ge&&!be[r]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(e){}return _e(e),!0}return!se||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(E.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),le&&3===e.nodeType&&(n=(n=(n=e.textContent).replace(H," ")).replace(Y," "),e.textContent!==n&&(E.removed.push({element:e.cloneNode()}),e.textContent=n)),Ae("afterSanitizeElements",e,null),!1},Pe=function(e,t,n){if(me&&("id"===t||"name"===t)&&(n in C||n in Ee))return!1;if(le&&(n=(n=n.replace(H," ")).replace(Y," ")),ie&&V.test(t));else if(oe&&Q.test(t));else{if(!ee[t]||re[t])return!1;if(xe[t]);else if(K.test(n.replace(X,"")));else if("src"!==t&&"xlink:href"!==t||"script"===e||0!==n.indexOf("data:")||!we[e])if(ae&&!G.test(n.replace(X,"")));else if(n)return!1}return!0},Re=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0;Ae("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(n=t.value.trim(),r=c.toLowerCase(),s.attrName=r,s.attrValue=n,s.keepAttr=!0,Ae("uponSanitizeAttribute",e,s),n=s.attrValue,"name"===r&&"IMG"===e.nodeName&&a.id)o=a.id,a=Array.prototype.slice.apply(a),Oe("id",e),Oe(c,e),a.indexOf(o)>i&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===n&&(ee[r]||!re[r]))continue;"id"===c&&e.setAttribute(c,""),Oe(c,e)}if(s.keepAttr){var p=e.nodeName.toLowerCase();if(Pe(p,r,n))try{u?e.setAttributeNS(u,c,n):e.setAttribute(c,n),E.removed.pop()}catch(e){}}}Ae("afterSanitizeAttributes",e,null)}},Ne=function e(t){var n=void 0,r=Te(t);for(Ae("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ae("uponSanitizeShadowNode",n,null),Ie(n)||(n.content instanceof T&&e(n.content),Re(n));Ae("afterSanitizeShadowDOM",t,null)};return E.sanitize=function(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,a=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!je(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!E.isSupported){if("object"===v(k.toStaticHTML)||"function"==typeof k.toStaticHTML){if("string"==typeof e)return k.toStaticHTML(e);if(je(e))return k.toStaticHTML(e.outerHTML)}return e}if(ue||Se(t),E.removed=[],ye);else if(e instanceof A)n=Ce("\x3c!--\x3e"),1===(r=n.ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?n=r:n.appendChild(r);else{if(!fe&&!ce&&-1===e.indexOf("<"))return e;if(!(n=Ce(e)))return fe?null:""}n&&pe&&_e(n.firstChild);for(var s=Te(ye?e:n);o=s.nextNode();)3===o.nodeType&&o===i||Ie(o)||(o.content instanceof T&&Ne(o.content),Re(o),i=o);if(ye)return e;if(fe){if(de)for(a=$.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return he&&(a=W.call(S,a,!0)),a}return ce?n.outerHTML:n.innerHTML},E.setConfig=function(e){Se(e),ue=!0},E.clearConfig=function(){ke=null,ue=!1},E.isValidAttribute=function(e,t,n){ke||Se({});var r=e.toLowerCase(),o=t.toLowerCase();return Pe(r,o,n)},E.addHook=function(e,t){"function"==typeof t&&(q[e]=q[e]||[],q[e].push(t))},E.removeHook=function(e){q[e]&&q[e].pop()},E.removeHooks=function(e){q[e]&&(q[e]=[])},E.removeAllHooks=function(){q={}},E}()}()},function(e,t,n){"use strict";var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class)|(on[A-Z].*)|((data|aria|x)-.*))$/i,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}(r.test.bind(r));t.a=o},function(e,t,n){n(135),e.exports=n(270)},function(e,t,n){"use strict";n.r(t);n(136),n(154),n(159),n(162),n(165),n(167),n(173)},function(e,t,n){n(56),n(83),n(86),n(144),e.exports=n(7).Promise},function(e,t,n){var r=n(61),o=n(43);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(i=s.charCodeAt(l))<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(63),o=n(42),i=n(36),a={};n(22)(a,n(2)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(16),o=n(14),i=n(34);e.exports=n(17)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,l=0;s>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(28),o=n(35),i=n(141);e.exports=function(e){return function(t,n,a){var s,l=r(t),c=o(l.length),u=i(a,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var r=n(61),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(23),o=n(67),i=n(65)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(87),o=n(88),i=n(33),a=n(28);e.exports=n(62)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,o,i,a,s=n(31),l=n(5),c=n(24),u=n(57),p=n(18),f=n(8),d=n(44),h=n(68),m=n(69),g=n(148),y=n(89).set,v=n(150)(),b=n(90),w=n(151),x=n(152),k=n(153),E=l.TypeError,S=l.process,_=S&&S.versions,O=_&&_.v8||"",C=l.Promise,T="process"==u(S),j=function(){},A=o=b.f,I=!!function(){try{var e=C.resolve(1),t=(e.constructor={})[n(2)("species")]=function(e){e(j,j)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(j)instanceof t&&0!==O.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},R=function(e,t){if(!e._n){e._n=!0;var n=e._c;v(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(o||(2==e._h&&M(e),e._h=1),!0===s?n=r:(u&&u.enter(),n=s(r),u&&(u.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=P(n))?i.call(n,l,c):l(n)):c(r)}catch(e){u&&!a&&u.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){y.call(l,function(){var t,n,r,o=e._v,i=L(e);if(i&&(t=w(function(){T?S.emit("unhandledRejection",o,e):(n=l.onunhandledrejection)?n({promise:e,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=T||L(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){y.call(l,function(){var t;T?S.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),R(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=P(e))?v(function(){var r={_w:n,_d:!1};try{t.call(e,c(F,r,1),c(D,r,1))}catch(e){D.call(r,e)}}):(n._v=e,n._s=1,R(n,!1))}catch(e){D.call({_w:n,_d:!1},e)}}};I||(C=function(e){h(this,C,"Promise","_h"),d(e),r.call(this);try{e(c(F,this,1),c(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(70)(C.prototype,{then:function(e,t){var n=A(g(this,C));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(F,e,1),this.reject=c(D,e,1)},b.f=A=function(e){return e===C||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!I,{Promise:C}),n(36)(C,"Promise"),n(91)("Promise"),a=n(7).Promise,p(p.S+p.F*!I,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!I),"Promise",{resolve:function(e){return k(s&&this===a?C:this,e)}}),p(p.S+p.F*!(I&&n(92)(function(e){C.all(e).catch(j)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,o=w(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){var r=n(14);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(33),o=n(2)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(57),o=n(2)("iterator"),i=n(33);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(14),o=n(44),i=n(2)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(5),o=n(89).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,l="process"==n(26)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(l&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(5).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(14),o=n(8),i=n(90);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){n(155),e.exports=n(7).Array.find},function(e,t,n){"use strict";var r=n(18),o=n(156)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1}),r(r.P+r.F*i,"Array",{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(87)("find")},function(e,t,n){var r=n(24),o=n(64),i=n(67),a=n(35),s=n(157);e.exports=function(e,t){var n=1==e,l=2==e,c=3==e,u=4==e,p=6==e,f=5==e||p,d=t||s;return function(t,s,h){for(var m,g,y=i(t),v=o(y),b=r(s,h,3),w=a(v.length),x=0,k=n?d(t,w):l?d(t,0):void 0;w>x;x++)if((f||x in v)&&(g=b(m=v[x],x,y),e))if(n)k[x]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:k.push(m)}else if(u)return!1;return p?-1:c||u?u:k}}},function(e,t,n){var r=n(158);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(8),o=n(93),i=n(2)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){n(160),e.exports=n(7).Object.assign},function(e,t,n){var r=n(18);r(r.S+r.F,"Object",{assign:n(161)})},function(e,t,n){"use strict";var r=n(34),o=n(71),i=n(45),a=n(67),s=n(64),l=Object.assign;e.exports=!l||n(27)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r})?function(e,t){for(var n=a(e),l=arguments.length,c=1,u=o.f,p=i.f;l>c;)for(var f,d=s(arguments[c++]),h=u?r(d).concat(u(d)):r(d),m=h.length,g=0;m>g;)p.call(d,f=h[g++])&&(n[f]=d[f]);return n}:l},function(e,t,n){n(163),e.exports=n(7).String.endsWith},function(e,t,n){"use strict";var r=n(18),o=n(35),i=n(94),a="".endsWith;r(r.P+r.F*n(95)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),s=void 0===n?r:Math.min(o(n),r),l=String(e);return a?a.call(t,l,s):t.slice(s-l.length,s)===l}})},function(e,t,n){var r=n(8),o=n(26),i=n(2)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){n(166),e.exports=n(7).String.startsWith},function(e,t,n){"use strict";var r=n(18),o=n(35),i=n(94),a="".startsWith;r(r.P+r.F*n(95)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){n(56),n(83),n(86),n(168),e.exports=n(7).Map},function(e,t,n){"use strict";var r=n(169),o=n(96);e.exports=n(170)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(16).f,o=n(63),i=n(70),a=n(24),s=n(68),l=n(69),c=n(62),u=n(88),p=n(91),f=n(17),d=n(72).fastKey,h=n(96),m=f?"_s":"size",g=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var u=e(function(e,r){s(e,u,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,null!=r&&l(r,n,e[c],e)});return i(u.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=h(this,t),r=g(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(h(this,t),e)}}),f&&r(u.prototype,"size",{get:function(){return h(this,t)[m]}}),u},def:function(e,t,n){var r,o,i=g(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:g,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?u(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,u(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){"use strict";var r=n(5),o=n(18),i=n(21),a=n(70),s=n(72),l=n(69),c=n(68),u=n(8),p=n(27),f=n(92),d=n(36),h=n(171);e.exports=function(e,t,n,m,g,y){var v=r[e],b=v,w=g?"set":"add",x=b&&b.prototype,k={},E=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(y&&!u(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(y&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!u(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(y||x.forEach&&!p(function(){(new b).entries().next()}))){var S=new b,_=S[w](y?{}:-0,1)!=S,O=p(function(){S.has(1)}),C=f(function(e){new b(e)}),T=!y&&p(function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)});C||((b=t(function(t,n){c(t,b,e);var r=h(new v,t,b);return null!=n&&l(n,g,r[w],r),r})).prototype=x,x.constructor=b),(O||T)&&(E("delete"),E("has"),g&&E("get")),(T||_)&&E(w),y&&x.clear&&delete x.clear}else b=m.getConstructor(t,e,g,w),a(b.prototype,n),s.NEED=!0;return d(b,e),k[e]=b,o(o.G+o.W+o.F*(b!=v),k),y||m.setStrong(b,e,g),b}},function(e,t,n){var r=n(8),o=n(172).set;e.exports=function(e,t,n){var i,a=t.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(e,i),e}},function(e,t,n){var r=n(8),o=n(14),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(24)(Function.call,n(97).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){n(174),n(56),e.exports=n(7).Symbol},function(e,t,n){"use strict";var r=n(5),o=n(23),i=n(17),a=n(18),s=n(21),l=n(72).KEY,c=n(27),u=n(58),p=n(36),f=n(32),d=n(2),h=n(98),m=n(175),g=n(176),y=n(93),v=n(14),b=n(8),w=n(28),x=n(60),k=n(42),E=n(63),S=n(177),_=n(97),O=n(16),C=n(34),T=_.f,j=O.f,A=S.f,I=r.Symbol,P=r.JSON,R=P&&P.stringify,N=d("_hidden"),L=d("toPrimitive"),M={}.propertyIsEnumerable,D=u("symbol-registry"),F=u("symbols"),U=u("op-symbols"),B=Object.prototype,z="function"==typeof I,$=r.QObject,W=!$||!$.prototype||!$.prototype.findChild,q=i&&c(function(){return 7!=E(j({},"a",{get:function(){return j(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=T(B,t);r&&delete B[t],j(e,t,n),r&&e!==B&&j(B,t,r)}:j,H=function(e){var t=F[e]=E(I.prototype);return t._k=e,t},Y=z&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},V=function(e,t,n){return e===B&&V(U,t,n),v(e),t=x(t,!0),v(n),o(F,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=E(n,{enumerable:k(0,!1)})):(o(e,N)||j(e,N,k(1,{})),e[N][t]=!0),q(e,t,n)):j(e,t,n)},Q=function(e,t){v(e);for(var n,r=g(t=w(t)),o=0,i=r.length;i>o;)V(e,n=r[o++],t[n]);return e},G=function(e){var t=M.call(this,e=x(e,!0));return!(this===B&&o(F,e)&&!o(U,e))&&(!(t||!o(this,e)||!o(F,e)||o(this,N)&&this[N][e])||t)},X=function(e,t){if(e=w(e),t=x(t,!0),e!==B||!o(F,t)||o(U,t)){var n=T(e,t);return!n||!o(F,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},K=function(e){for(var t,n=A(w(e)),r=[],i=0;n.length>i;)o(F,t=n[i++])||t==N||t==l||r.push(t);return r},J=function(e){for(var t,n=e===B,r=A(n?U:w(e)),i=[],a=0;r.length>a;)!o(F,t=r[a++])||n&&!o(B,t)||i.push(F[t]);return i};z||(s((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(U,n),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),q(this,e,k(1,n))};return i&&W&&q(B,e,{configurable:!0,set:t}),H(e)}).prototype,"toString",function(){return this._k}),_.f=X,O.f=V,n(99).f=S.f=K,n(45).f=G,n(71).f=J,i&&!n(31)&&s(B,"propertyIsEnumerable",G,!0),h.f=function(e){return H(d(e))}),a(a.G+a.W+a.F*!z,{Symbol:I});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Z.length>ee;)d(Z[ee++]);for(var te=C(d.store),ne=0;te.length>ne;)m(te[ne++]);a(a.S+a.F*!z,"Symbol",{for:function(e){return o(D,e+="")?D[e]:D[e]=I(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in D)if(D[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!z,"Object",{create:function(e,t){return void 0===t?E(e):Q(E(e),t)},defineProperty:V,defineProperties:Q,getOwnPropertyDescriptor:X,getOwnPropertyNames:K,getOwnPropertySymbols:J}),P&&a(a.S+a.F*(!z||c(function(){var e=I();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!Y(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,R.apply(P,r)}}),I.prototype[L]||n(22)(I.prototype,L,I.prototype.valueOf),p(I,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t,n){var r=n(5),o=n(7),i=n(31),a=n(98),s=n(16).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(34),o=n(71),i=n(45);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),l=i.f,c=0;s.length>c;)l.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var r=n(28),o=n(99).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){"use strict"; +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))o.call(n,c)&&(s[c]=n[c]);if(r){a=r(n);for(var u=0;u<a.length;u++)i.call(n,a[u])&&(s[a[u]]=n[a[u]])}}return s}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(193),o=n(194),i=n(217),a=n(218),s=n(219),l=n(221);function c(e){u(this,c.defaults),u(this,e)}function u(e,t){if(p(t))for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r],i=t[o],a=e[o];p(i)?e[o]=u(a||{},i):void 0!==i&&(e[o]=i)}return e}function p(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}e.exports=c,c.defaults={parse:{json:r,yaml:o,text:i,binary:a},resolve:{file:s,http:l,external:!0},dereference:{circular:!0}}},function(e,t,n){"use strict";var r=n(46),o=n(25);e.exports={parse:function(e,t){try{return r.safeLoad(e)}catch(e){throw e instanceof Error?e:o(e,e.message)}},stringify:function(e,t,n){try{var i=("string"==typeof n?n.length:n)||2;return r.safeDump(e,{indent:i})}catch(e){throw e instanceof Error?e:o(e,e.message)}}}},function(e,t,n){"use strict";var r=n(29);e.exports=new r({include:[n(105)]})},function(e,t,n){"use strict";var r=n(29);e.exports=new r({include:[n(73)],implicit:[n(201),n(202),n(203),n(204)]})},function(e,t,n){(function(e){var r=n(222),o=n(108),i=n(231),a=n(232),s=n(10),l=t;l.request=function(t,n){t="string"==typeof t?s.parse(t):i(t);var o=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||o,l=t.hostname||t.host,c=t.port,u=t.path||"/";l&&-1!==l.indexOf(":")&&(l="["+l+"]"),t.url=(l?a+"//"+l:"")+(c?":"+c:"")+u,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var p=new r(t);return n&&p.on("response",n),p},l.get=function(e,t){var n=l.request(e,t);return n.end(),n},l.ClientRequest=r,l.IncomingMessage=o.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=a,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(4))},function(e,t,n){(function(e){t.fetch=s(e.fetch)&&s(e.ReadableStream),t.writableStream=s(e.WritableStream),t.abortController=s(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var n;function r(){if(void 0!==n)return n;if(e.XMLHttpRequest){n=new e.XMLHttpRequest;try{n.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function o(e){var t=r();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var i=void 0!==e.ArrayBuffer,a=i&&s(e.ArrayBuffer.prototype.slice);function s(e){return"function"==typeof e}t.arraybuffer=t.fetch||i&&o("arraybuffer"),t.msstream=!t.fetch&&a&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!r()&&s(r().overrideMimeType),t.vbArray=s(e.VBArray),n=null}).call(this,n(4))},function(e,t,n){(function(e,r,o){var i=n(107),a=n(20),s=n(109),l=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(t,n,a,l){var c=this;if(s.Readable.call(c),c._mode=a,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){e.nextTick(function(){c.emit("close")})}),"fetch"===a){if(c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=n.statusText,n.headers.forEach(function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)}),i.writableStream){var u=new WritableStream({write:function(e){return new Promise(function(t,n){c._destroyed?n():c.push(new r(e))?t():c._resumeFetch=t})},close:function(){o.clearTimeout(l),c._destroyed||c.push(null)},abort:function(e){c._destroyed||c.emit("error",e)}});try{return void n.body.pipeTo(u).catch(function(e){o.clearTimeout(l),c._destroyed||c.emit("error",e)})}catch(e){}}var p=n.body.getReader();!function e(){p.read().then(function(t){if(!c._destroyed){if(t.done)return o.clearTimeout(l),void c.push(null);c.push(new r(t.value)),e()}}).catch(function(e){o.clearTimeout(l),c._destroyed||c.emit("error",e)})}()}else{if(c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===c.headers[n]&&(c.headers[n]=[]),c.headers[n].push(t[2])):void 0!==c.headers[n]?c.headers[n]+=", "+t[2]:c.headers[n]=t[2],c.rawHeaders.push(t[1],t[2])}}),c._charset="x-user-defined",!i.overrideMimeType){var f=c.rawHeaders["mime-type"];if(f){var d=f.match(/;\s*charset=([^;])(;|$)/);d&&(c._charset=d[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};a(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==l.DONE)break;try{n=new o.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new r(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new r(i.length),s=0;s<i.length;s++)a[s]=255&i.charCodeAt(s);e.push(a)}else e.push(i,e._charset);e._pos=n.length}break;case"arraybuffer":if(t.readyState!==l.DONE||!t.response)break;n=t.response,e.push(new r(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=t.response,t.readyState!==l.LOADING||!n)break;e.push(new r(new Uint8Array(n)));break;case"ms-stream":if(n=t.response,t.readyState!==l.LOADING)break;var c=new o.MSStreamReader;c.onprogress=function(){c.result.byteLength>e._pos&&(e.push(new r(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===l.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,n(6),n(9).Buffer,n(4))},function(e,t,n){(t=e.exports=n(110)).Stream=t,t.Readable=t,t.Writable=n(114),t.Duplex=n(30),t.Transform=n(116),t.PassThrough=n(229)},function(e,t,n){"use strict";(function(t,r){var o=n(49);e.exports=b;var i,a=n(101);b.ReadableState=v;n(111).EventEmitter;var s=function(e,t){return e.listeners(t).length},l=n(112),c=n(50).Buffer,u=t.Uint8Array||function(){};var p=n(38);p.inherits=n(20);var f=n(223),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var h,m=n(224),g=n(113);p.inherits(b,l);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(30));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n(115).StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(30),!(this instanceof b))return new b(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),l.call(this)}function w(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):O(e,a)):x(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function x(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),O(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),w(this,e,t,!1,n)},b.prototype.unshift=function(e){return w(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return h||(h=n(115).StringDecoder),this._readableState.decoder=new h(e),this._readableState.encoding=e,this};var k=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(_,e):_(e))}function _(e){d("emit readable"),e.emit("readable"),A(e)}function O(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function T(e){d("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,o=t.needReadable;return d("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",o=!0),t.ended||t.reading?d("reading or ended",o=!1):o&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(n,t))),null===(r=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:b;function c(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",p),e.removeListener("error",g),e.removeListener("unpipe",c),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",m),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function u(){d("onend"),e.end()}i.endEmitted?o.nextTick(l):n.once("end",l),e.on("unpipe",c);var p=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,A(e))}}(n);e.on("drain",p);var f=!1;var h=!1;function m(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function g(t){d("onerror",t),b(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),b()}function v(){d("onfinish"),e.removeListener("close",y),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",y),e.once("finish",v),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=N(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=l.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):o.nextTick(T,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(j,e,t))}(this,e)),this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(d("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<y.length;i++)e.on(y[i],this.emit.bind(this,y[i]));return this._read=function(t){d("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=I}).call(this,n(4),n(6))},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,a,s,l,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(i(n=this._events[e]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),a=(c=n.slice()).length,l=0;l<a;l++)c[l].apply(this,s);return!0},n.prototype.addListener=function(e,t){var a;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(a=i(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&a>0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function o(){this.removeListener(e,o),n||(n=!0,t.apply(this,arguments))}return o.listener=t,this.on(e,o),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){e.exports=n(111).EventEmitter},function(e,t,n){"use strict";var r=n(49);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t,r,o){var i=n(49);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,l=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;v.WritableState=y;var c=n(38);c.inherits=n(20);var u={deprecate:n(228)},p=n(112),f=n(50).Buffer,d=o.Uint8Array||function(){};var h,m=n(113);function g(){}function y(e,t){s=s||n(30),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=!1===e.decodeStrings;this.decodeStrings=!p,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,o);else{var a=k(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||x(e,n),r?l(w,e,n,a,o):w(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||n(30),!(h.call(v,this)||this instanceof s))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),p.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,l=!0;n;)o[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;o.allBuffers=l,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,p=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,u,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=k(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(v,p),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===v&&(e&&e._writableState instanceof y)}})):h=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof d);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=g),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,o,i);return l}(this,o,s,e,t,n)),a},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||x(this,e))},v.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(6),n(226).setImmediate,n(4))},function(e,t,n){"use strict";var r=n(50).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=p,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=i;var r=n(30),o=n(38);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._transformState={afterTransform:function(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",a)}function a(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){s(e,t,n)}):s(this,null,null)}function s(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(20),o.inherits(i,r),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},i.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},i.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},i.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";(function(t){var r=n(25),o=n(19),i=n(235);e.exports=function(e,n,a){try{e=o.stripHash(e);var s=n._add(e),l={url:e,extension:o.getExtension(e)};return function(e,t){return new Promise(function(n,o){var a=i.all(t.resolve);a=i.filter(a,"canRead",e),i.sort(a),i.run(a,"read",e).then(n,function(t){!t||t instanceof SyntaxError?o(r.syntax('Unable to resolve $ref pointer "%s"',e.url)):o(t)})})}(l,a).then(function(e){return s.pathType=e.plugin.name,l.data=e.result,function(e,n){return new Promise(function(o,a){var s=i.all(n.parse),l=i.filter(s,"canParse",e),c=l.length>0?l:s;i.sort(c),i.run(c,"parse",e).then(function(n){!n.plugin.allowEmpty&&(i=n.result,void 0===i||"object"==typeof i&&0===Object.keys(i).length||"string"==typeof i&&0===i.trim().length||t.isBuffer(i)&&0===i.length)?a(r.syntax('Error parsing "%s" as %s. \nParsed value is empty',e.url,n.plugin.name)):o(n);var i},function(t){t?(t=t instanceof Error?t:new Error(t),a(r.syntax(t,"Error parsing %s",e.url))):a(r.syntax("Unable to parse %s",e.url))})})}(l,a)}).then(function(e){return s.value=e.result,e.result})}catch(e){return Promise.reject(e)}}}).call(this,n(9).Buffer)},function(e,t,n){"use strict";(function(t,n){var r=t.process&&n.nextTick||t.setImmediate||function(e){setTimeout(e,0)};e.exports=function(e,t){return e?void t.then(function(t){r(function(){e(null,t)})},function(t){r(function(){e(t)})}):t}}).call(this,n(4),n(6))},function(e,t){},function(t,n){t.exports=e},function(e,t,n){"use strict";e.exports={isRef:function(e,t){return"$ref"===t&&!!e&&"string"==typeof e[t]}}},function(e,t,n){"use strict";var r=n(76).jpescape;e.exports={recurse:function e(t,n,o){if(n||(n={depth:0}),n.depth||(n=Object.assign({},{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1},n)),"object"==typeof t){var i=n.path;for(var a in t){if(n.key=a,n.path=n.path+"/"+encodeURIComponent(r(a)),n.identityPath=n.seen.get(t[a]),n.identity=void 0!==n.identityPath,o(t,a,n),"object"==typeof t[a]&&!n.identity){n.identityDetection&&!Array.isArray(t[a])&&null!==t[a]&&n.seen.set(t[a],n.path);var s={};s.parent=t,s.path=n.path,s.depth=n.depth?n.depth+1:1,s.pkey=a,s.payload=n.payload,s.seen=n.seen,s.identity=!1,s.identityDetection=n.identityDetection,e(t[a],s,o)}n.path=i}}}}},function(e,t,n){"use strict";(function(t){var r=n(46),o=t.env.NODE_DISABLE_COLORS?{red:"",yellow:"",green:"",normal:""}:{red:"",yellow:"",green:"",normal:""};function i(e){for(var t=[],n=function(e){t.find(function(t,n,o){return function(e,t){function n(e,t){return r.dump(e)===r.dump(Object.assign({},e,t))}return n(e,t)&&n(t,e)}(t,e)})||t.push(e)},o=0,i=e;o<i.length;o++){n(i[o])}return t}String.prototype.toCamelCase=function(){return this.toLowerCase().replace(/[-_ \/\.](.)/g,function(e,t){return t.toUpperCase()})};function a(e){var t=(e=e.replace("[]","Array")).split("/");return t[0]=t[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),t.join("/")}e.exports={colour:o,uniqueOnly:function(e,t,n){return n.indexOf(e)===t},hasDuplicates:function(e){return new Set(e).size!==e.length},allSame:function(e){return new Set(e).size<=1},distinctArray:function(e){return e.length===i(e).length},hash:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},parameterTypeProperties:["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],arrayProperties:["items","minItems","maxItems","uniqueItems"],httpMethods:["get","post","put","delete","patch","head","options","trace"],sanitise:a,sanitiseAll:function(e){return a(e.split("/").join("_"))}}}).call(this,n(6))},function(e,t){e.exports=function(){}},function(e,t,n){var r;r=function(){var e=JSON.parse('{"$":"dollar","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","џ":"dz","Ґ":"G","ґ":"g","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","‘":"\'","’":"\'","“":"\\"","”":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₹":"indian rupee","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial"}');function t(t,n){if("string"!=typeof t)throw new Error("slugify: string argument expected");n="string"==typeof n?{replacement:n}:n||{};var r=t.split("").reduce(function(t,r){return t+(e[r]||r).replace(n.remove||/[^\w\s$*_+~.()'"!\-:@]/g,"")},"").trim().replace(/[-\s]+/g,n.replacement||"-");return n.lower?r.toLowerCase():r}return t.extend=function(t){for(var n in t)e[n]=t[n]},t},e.exports=r(),e.exports.default=r()},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"css",function(){return ye}),n.d(t,"keyframes",function(){return it}),n.d(t,"createGlobalStyle",function(){return rt}),n.d(t,"isStyledComponent",function(){return O}),n.d(t,"ThemeConsumer",function(){return Ye}),n.d(t,"ThemeContext",function(){return He}),n.d(t,"ThemeProvider",function(){return Ve}),n.d(t,"withTheme",function(){return at}),n.d(t,"ServerStyleSheet",function(){return Qe}),n.d(t,"StyleSheetManager",function(){return Ke}),n.d(t,"__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS",function(){return st});var r=n(78),o=n.n(r),i=n(127),a=n.n(i),s=n(0),l=n.n(s),c=n(128),u=n(54),p=n(39),f=(n(11),n(13),n(133)),d=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},b=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},w=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},x=function(e){return"object"===(void 0===e?"undefined":h(e))&&e.constructor===Object},k=Object.freeze([]),E=Object.freeze({});function S(e){return"function"==typeof e}function _(e){return e.displayName||e.name||"Component"}function O(e){return e&&"string"==typeof e.styledComponentId}var C=void 0!==e&&e.env.SC_ATTR||"data-styled",T="undefined"!=typeof window&&"HTMLElement"in window,j="boolean"==typeof SC_DISABLE_SPEEDY&&SC_DISABLE_SPEEDY||!1,A={};var I=function(e){function t(n){m(this,t);for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var a=w(this,e.call(this,"An error occurred. See https://github.com/styled-components/styled-components/blob/master/src/utils/errors.md#"+n+" for more information. "+(o?"Additional arguments: "+o.join(", "):"")));return w(a)}return v(t,e),t}(Error),P=/^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm,R=function(e){var t=""+(e||""),n=[];return t.replace(P,function(e,t,r){return n.push({componentId:t,matchIndex:r}),e}),n.map(function(e,r){var o=e.componentId,i=e.matchIndex,a=n[r+1];return{componentId:o,cssFromDOM:a?t.slice(i,a.matchIndex):t.slice(i)}})},N=/^\s*\/\/.*$/gm,L=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!1,compress:!1,semicolon:!0}),M=new o.a({global:!1,cascade:!0,keyframe:!1,prefix:!0,compress:!1,semicolon:!1}),D=[],F=function(e){if(-2===e){var t=D;return D=[],t}},U=a()(function(e){D.push(e)}),B=void 0,z=void 0,$=void 0,W=function(e,t,n){return t>0&&-1!==n.slice(0,t).indexOf(z)&&n.slice(t-z.length,t)!==z?"."+B:e};M.use([function(e,t,n){2===e&&n.length&&n[0].lastIndexOf(z)>0&&(n[0]=n[0].replace($,W))},U,F]),L.use([U,F]);function q(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&",o=e.join("").replace(N,""),i=t&&n?n+" "+t+" { "+o+" }":o;return B=r,z=t,$=new RegExp("\\"+z+"\\b","g"),M(n||!t?"":t,i)}var H=function(){return n.nc},Y=function(e,t,n){n&&((e[t]||(e[t]=Object.create(null)))[n]=!0)},V=function(e,t){e[t]=Object.create(null)},Q=function(e){return function(t,n){return void 0!==e[t]&&e[t][n]}},G=function(e){var t="";for(var n in e)t+=Object.keys(e[n]).join(" ")+" ";return t.trim()},X=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets.length,n=0;n<t;n+=1){var r=document.styleSheets[n];if(r.ownerNode===e)return r}throw new I(10)},K=function(e,t,n){if(!t)return!1;var r=e.cssRules.length;try{e.insertRule(t,n<=r?n:r)}catch(e){return!1}return!0},J=function(e){return"\n/* sc-component-id: "+e+" */\n"},Z=function(e,t){for(var n=0,r=0;r<=t;r+=1)n+=e[r];return n},ee=function(e,t){return function(n){var r=H();return"<style "+[r&&'nonce="'+r+'"',C+'="'+G(t)+'"','data-styled-version="4.1.1"',n].filter(Boolean).join(" ")+">"+e()+"</style>"}},te=function(e,t){return function(){var n,r=((n={})[C]=G(t),n["data-styled-version"]="4.1.1",n),o=H();return o&&(r.nonce=o),l.a.createElement("style",y({},r,{dangerouslySetInnerHTML:{__html:e()}}))}},ne=function(e){return function(){return Object.keys(e)}},re=function(e){return document.createTextNode(J(e))},oe=function e(t,n){var r=void 0===t?Object.create(null):t,o=void 0===n?Object.create(null):n,i=function(e){var t=o[e];return void 0!==t?t:o[e]=[""]},a=function(){var e="";for(var t in o){var n=o[t][0];n&&(e+=J(t)+n)}return e};return{clone:function(){var t=function(e){var t=Object.create(null);for(var n in e)t[n]=y({},e[n]);return t}(r),n=Object.create(null);for(var i in o)n[i]=[o[i][0]];return e(t,n)},css:a,getIds:ne(o),hasNameForId:Q(r),insertMarker:i,insertRules:function(e,t,n){i(e)[0]+=t.join(" "),Y(r,e,n)},removeRules:function(e){var t=o[e];void 0!==t&&(t[0]="",V(r,e))},sealed:!1,styleTag:null,toElement:te(a,r),toHTML:ee(a,r)}},ie=function(e,t,n,r,o){if(T&&!n){var i=function(e,t,n){var r=document.createElement("style");r.setAttribute(C,""),r.setAttribute("data-styled-version","4.1.1");var o=H();if(o&&r.setAttribute("nonce",o),r.appendChild(document.createTextNode("")),e&&!t)e.appendChild(r);else{if(!t||!e||!t.parentNode)throw new I(6);t.parentNode.insertBefore(r,n?t:t.nextSibling)}return r}(e,t,r);return j?function(e,t){var n=Object.create(null),r=Object.create(null),o=void 0!==t,i=!1,a=function(t){var o=r[t];return void 0!==o?o:(r[t]=re(t),e.appendChild(r[t]),n[t]=Object.create(null),r[t])},s=function(){var e="";for(var t in r)e+=r[t].data;return e};return{clone:function(){throw new I(5)},css:s,getIds:ne(r),hasNameForId:Q(n),insertMarker:a,insertRules:function(e,r,s){for(var l=a(e),c=[],u=r.length,p=0;p<u;p+=1){var f=r[p],d=o;if(d&&-1!==f.indexOf("@import"))c.push(f);else{d=!1;var h=p===u-1?"":" ";l.appendData(""+f+h)}}Y(n,e,s),o&&c.length>0&&(i=!0,t().insertRules(e+"-import",c))},removeRules:function(a){var s=r[a];if(void 0!==s){var l=re(a);e.replaceChild(l,s),r[a]=l,V(n,a),o&&i&&t().removeRules(a+"-import")}},sealed:!1,styleTag:e,toElement:te(s,n),toHTML:ee(s,n)}}(i,o):function(e,t){var n=Object.create(null),r=Object.create(null),o=[],i=void 0!==t,a=!1,s=function(e){var t=r[e];return void 0!==t?t:(r[e]=o.length,o.push(0),V(n,e),r[e])},l=function(){var t=X(e).cssRules,n="";for(var i in r){n+=J(i);for(var a=r[i],s=Z(o,a),l=s-o[a];l<s;l+=1){var c=t[l];void 0!==c&&(n+=c.cssText)}}return n};return{clone:function(){throw new I(5)},css:l,getIds:ne(r),hasNameForId:Q(n),insertMarker:s,insertRules:function(r,l,c){for(var u=s(r),p=X(e),f=Z(o,u),d=0,h=[],m=l.length,g=0;g<m;g+=1){var y=l[g],v=i;v&&-1!==y.indexOf("@import")?h.push(y):K(p,y,f+d)&&(v=!1,d+=1)}i&&h.length>0&&(a=!0,t().insertRules(r+"-import",h)),o[u]+=d,Y(n,r,c)},removeRules:function(s){var l=r[s];if(void 0!==l){var c=o[l];!function(e,t,n){for(var r=t-n,o=t;o>r;o-=1)e.deleteRule(o)}(X(e),Z(o,l)-1,c),o[l]=0,V(n,s),i&&a&&t().removeRules(s+"-import")}},sealed:!1,styleTag:e,toElement:te(l,n),toHTML:ee(l,n)}}(i,o)}return oe()},ae=/\s+/,se=void 0;se=T?j?40:1e3:-1;var le=0,ce=void 0,ue=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T?document.head:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e),this.getImportRuleTag=function(){var e=t.importRuleTag;if(void 0!==e)return e;var n=t.tags[0];return t.importRuleTag=ie(t.target,n?n.styleTag:null,t.forceServer,!0)},le+=1,this.id=le,this.forceServer=r,this.target=r?null:n,this.tagMap={},this.deferred={},this.rehydratedNames={},this.ignoreRehydratedNames={},this.tags=[],this.capacity=1,this.clones=[]}return e.prototype.rehydrate=function(){if(!T||this.forceServer)return this;var e=[],t=[],n=!1,r=document.querySelectorAll("style["+C+'][data-styled-version="4.1.1"]'),o=r.length;if(!o)return this;for(var i=0;i<o;i+=1){var a=r[i];n||(n=!!a.getAttribute("data-styled-streamed"));for(var s,l=(a.getAttribute(C)||"").trim().split(ae),c=l.length,u=0;u<c;u+=1)s=l[u],this.rehydratedNames[s]=!0;t.push.apply(t,R(a.textContent)),e.push(a)}var p=t.length;if(!p)return this;var f=this.makeTag(null);!function(e,t,n){for(var r=0,o=n.length;r<o;r+=1){var i=n[r],a=i.componentId,s=i.cssFromDOM,l=L("",s);e.insertRules(a,l)}for(var c=0,u=t.length;c<u;c+=1){var p=t[c];p.parentNode&&p.parentNode.removeChild(p)}}(f,e,t),this.capacity=Math.max(1,se-p),this.tags.push(f);for(var d=0;d<p;d+=1)this.tagMap[t[d].componentId]=f;return this},e.reset=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ce=new e(void 0,t).rehydrate()},e.prototype.clone=function(){var t=new e(this.target,this.forceServer);return this.clones.push(t),t.tags=this.tags.map(function(e){for(var n=e.getIds(),r=e.clone(),o=0;o<n.length;o+=1)t.tagMap[n[o]]=r;return r}),t.rehydratedNames=y({},this.rehydratedNames),t.deferred=y({},this.deferred),t},e.prototype.sealAllTags=function(){this.capacity=1,this.tags.forEach(function(e){e.sealed=!0})},e.prototype.makeTag=function(e){var t=e?e.styleTag:null;return ie(this.target,t,this.forceServer,!1,this.getImportRuleTag)},e.prototype.getTagForId=function(e){var t=this.tagMap[e];if(void 0!==t&&!t.sealed)return t;var n=this.tags[this.tags.length-1];return this.capacity-=1,0===this.capacity&&(this.capacity=se,n=this.makeTag(n),this.tags.push(n)),this.tagMap[e]=n},e.prototype.hasId=function(e){return void 0!==this.tagMap[e]},e.prototype.hasNameForId=function(e,t){if(void 0===this.ignoreRehydratedNames[e]&&this.rehydratedNames[t])return!0;var n=this.tagMap[e];return void 0!==n&&n.hasNameForId(e,t)},e.prototype.deferredInject=function(e,t){if(void 0===this.tagMap[e]){for(var n=this.clones,r=0;r<n.length;r+=1)n[r].deferredInject(e,t);this.getTagForId(e).insertMarker(e),this.deferred[e]=t}},e.prototype.inject=function(e,t,n){for(var r=this.clones,o=0;o<r.length;o+=1)r[o].inject(e,t,n);var i=this.getTagForId(e);if(void 0!==this.deferred[e]){var a=this.deferred[e].concat(t);i.insertRules(e,a,n),this.deferred[e]=void 0}else i.insertRules(e,t,n)},e.prototype.remove=function(e){var t=this.tagMap[e];if(void 0!==t){for(var n=this.clones,r=0;r<n.length;r+=1)n[r].remove(e);t.removeRules(e),this.ignoreRehydratedNames[e]=!0,this.deferred[e]=void 0}},e.prototype.toHTML=function(){return this.tags.map(function(e){return e.toHTML()}).join("")},e.prototype.toReactElements=function(){var e=this.id;return this.tags.map(function(t,n){var r="sc-"+e+"-"+n;return Object(s.cloneElement)(t.toElement(),{key:r})})},g(e,null,[{key:"master",get:function(){return ce||(ce=(new e).rehydrate())}},{key:"instance",get:function(){return e.master}}]),e}(),pe=function(){function e(t,n){var r=this;m(this,e),this.inject=function(e){e.hasNameForId(r.id,r.name)||e.inject(r.id,r.rules,r.name)},this.toString=function(){throw new I(12,String(r.name))},this.name=t,this.rules=n,this.id="sc-keyframes-"+t}return e.prototype.getName=function(){return this.name},e}(),fe=/([A-Z])/g,de=/^ms-/;var he=function(e){return null==e||!1===e||""===e},me=function e(t,n){var r=Object.keys(t).filter(function(e){return!he(t[e])}).map(function(n){return x(t[n])?e(t[n],n):n.replace(fe,"-$1").toLowerCase().replace(de,"-ms-")+": "+(r=n,null==(o=t[n])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in c.a?String(o).trim():o+"px")+";";var r,o}).join(" ");return n?n+" {\n "+r+"\n}":r};function ge(e,t,n){if(Array.isArray(e)){for(var r,o=[],i=0,a=e.length;i<a;i+=1)null!==(r=ge(e[i],t,n))&&(Array.isArray(r)?o.push.apply(o,r):o.push(r));return o}if(he(e))return null;if(O(e))return"."+e.styledComponentId;if(S(e)){if(t){var s=!1;try{Object(u.isElement)(new e(t))&&(s=!0)}catch(e){}if(s)throw new I(13,_(e));return ge(e(t),t,n)}return e}return e instanceof pe?n?(e.inject(n),e.getName()):e:x(e)?me(e):e.toString()}function ye(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S(e)||x(e)?ge(d(k,[e].concat(n))):ge(d(e,n))}function ve(e){for(var t,n=0|e.length,r=0|n,o=0;n>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return((r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16))^r>>>15)>>>0}var be=52,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function xe(e){var t="",n=void 0;for(n=e;n>be;n=Math.floor(n/be))t=we(n%be)+t;return we(n%be)+t}function ke(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(Array.isArray(r)&&!ke(r,t))return!1;if(S(r)&&!O(r))return!1}return!t.some(function(e){return S(e)||function(e){for(var t in e)if(S(e[t]))return!0;return!1}(e)})}var Ee,Se=!1,_e=function(e){return xe(ve(e))},Oe=function(){function e(t,n,r){m(this,e),this.rules=t,this.isStatic=!Se&&ke(t,n),this.componentId=r,ue.master.hasId(r)||ue.master.deferredInject(r,[])}return e.prototype.generateAndInjectStyles=function(e,t){var n=this.isStatic,r=this.componentId,o=this.lastClassName;if(T&&n&&"string"==typeof o&&t.hasNameForId(r,o))return o;var i=ge(this.rules,e,t),a=_e(this.componentId+i.join(""));return t.hasNameForId(r,a)||t.inject(this.componentId,q(i,"."+a,void 0,r),a),this.lastClassName=a,a},e.generateName=function(e){return _e(e)},e}(),Ce=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E,r=!!n&&e.theme===n.theme;return e.theme&&!r?e.theme:t||n.theme},Te=/[[\].#*$><+~=|^:(),"'` + "`" + `-]+/g,je=/(^-|-$)/g;function Ae(e){return e.replace(Te,"-").replace(je,"")}function Ie(e){return"string"==typeof e}var Pe={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},Re={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ne=((Ee={})[u.ForwardRef]={$$typeof:!0,render:!0},Ee),Le=Object.defineProperty,Me=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,Fe=void 0===De?function(){return[]}:De,Ue=Object.getOwnPropertyDescriptor,Be=Object.getPrototypeOf,ze=Object.prototype,$e=Array.prototype;function We(e,t,n){if("string"!=typeof t){var r=Be(t);r&&r!==ze&&We(e,r,n);for(var o=$e.concat(Me(t),Fe(t)),i=Ne[e.$$typeof]||Pe,a=Ne[t.$$typeof]||Pe,s=o.length,l=void 0,c=void 0;s--;)if(c=o[s],!(Re[c]||n&&n[c]||a&&a[c]||i&&i[c])&&(l=Ue(t,c)))try{Le(e,c,l)}catch(e){}return e}return e}var qe=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}},He=Object(s.createContext)(),Ye=He.Consumer,Ve=function(e){function t(n){m(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(p.a)(r.getContext.bind(r)),r.renderInner=r.renderInner.bind(r),r}return v(t,e),t.prototype.render=function(){return this.props.children?l.a.createElement(He.Consumer,null,this.renderInner):null},t.prototype.renderInner=function(e){var t=this.getContext(this.props.theme,e);return l.a.createElement(He.Provider,{value:t},l.a.Children.only(this.props.children))},t.prototype.getTheme=function(e,t){if(S(e))return e(t);if(null===e||Array.isArray(e)||"object"!==(void 0===e?"undefined":h(e)))throw new I(8);return y({},t,e)},t.prototype.getContext=function(e,t){return this.getTheme(e,t)},t}(s.Component),Qe=function(){function e(){m(this,e),this.masterSheet=ue.master,this.instance=this.masterSheet.clone(),this.sealed=!1}return e.prototype.seal=function(){if(!this.sealed){var e=this.masterSheet.clones.indexOf(this.instance);this.masterSheet.clones.splice(e,1),this.sealed=!0}},e.prototype.collectStyles=function(e){if(this.sealed)throw new I(2);return l.a.createElement(Ke,{sheet:this.instance},e)},e.prototype.getStyleTags=function(){return this.seal(),this.instance.toHTML()},e.prototype.getStyleElement=function(){return this.seal(),this.instance.toReactElements()},e.prototype.interleaveWithNodeStream=function(e){throw new I(3)},e}(),Ge=Object(s.createContext)(),Xe=Ge.Consumer,Ke=function(e){function t(n){m(this,t);var r=w(this,e.call(this,n));return r.getContext=Object(p.a)(r.getContext),r}return v(t,e),t.prototype.getContext=function(e,t){if(e)return e;if(t)return new ue(t);throw new I(4)},t.prototype.render=function(){var e=this.props,t=e.children,n=e.sheet,r=e.target;return l.a.createElement(Ge.Provider,{value:this.getContext(n,r)},t)},t}(s.Component),Je=(new Set,{});qe(function(){return console.warn('The "innerRef" API has been removed in styled-components v4 in favor of React 16 ref forwarding, use "ref" instead like a typical component.')}),qe(function(e,t){return console.warn('Functions as object-form attrs({}) keys are now deprecated and will be removed in a future version of styled-components. Switch to the new attrs(props => ({})) syntax instead for easier and more powerful composition. The attrs key in question is "'+e+'" on component "'+t+'".')}),qe(function(e,t){return console.warn("It looks like you've used a non styled-component as the value for the \""+e+'" prop in an object-form attrs constructor of "'+t+"\".\nYou should use the new function-form attrs constructor which avoids this issue: attrs(props => ({ yourStuff }))\nTo continue using the deprecated object syntax, you'll need to wrap your component prop in a function to make it available inside the styled component (you'll still get the deprecation warning though.)\nFor example, { "+e+": () => InnerComponent } instead of { "+e+": InnerComponent }")});var Ze=function(e){function t(){m(this,t);var n=w(this,e.call(this));return n.attrs={},n.renderOuter=n.renderOuter.bind(n),n.renderInner=n.renderInner.bind(n),n}return v(t,e),t.prototype.render=function(){return l.a.createElement(Xe,null,this.renderOuter)},t.prototype.renderOuter=function(e){return this.styleSheet=e,this.props.forwardedClass.componentStyle.isStatic?this.renderInner():l.a.createElement(Ye,null,this.renderInner)},t.prototype.renderInner=function(e){var t=this.props.forwardedClass,n=t.componentStyle,r=t.defaultProps,o=t.styledComponentId,i=t.target,a=void 0;a=n.isStatic?this.generateAndInjectStyles(E,this.props,this.styleSheet):void 0!==e?this.generateAndInjectStyles(Ce(this.props,e,r),this.props,this.styleSheet):this.generateAndInjectStyles(this.props.theme||E,this.props,this.styleSheet);var l=this.props.as||this.attrs.as||i,c=Ie(l),u={},p=y({},this.attrs,this.props),d=void 0;for(d in p)"forwardedClass"!==d&&"as"!==d&&("forwardedRef"===d?u.ref=p[d]:c&&!Object(f.a)(d)||(u[d]=p[d]));return this.props.style&&this.attrs.style&&(u.style=y({},this.attrs.style,this.props.style)),u.className=[this.props.className,o,this.attrs.className,a].filter(Boolean).join(" "),Object(s.createElement)(l,u)},t.prototype.buildExecutionContext=function(e,t,n){var r=this,o=y({},t,{theme:e});return n.length?(this.attrs={},n.forEach(function(e){var n,i=e,a=!1,s=void 0,l=void 0;for(l in S(i)&&(i=i(t),a=!0),i)s=i[l],a||!S(s)||(n=s)&&n.prototype&&n.prototype.isReactComponent||O(s)||(s=s(o)),r.attrs[l]=s,o[l]=s}),o):o},t.prototype.generateAndInjectStyles=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ue.master,r=t.forwardedClass,o=r.attrs,i=r.componentStyle;r.warnTooManyClasses;return i.isStatic&&!o.length?i.generateAndInjectStyles(E,n):i.generateAndInjectStyles(this.buildExecutionContext(e,t,o),n)},t}(s.Component);function et(e,t,n){var r=O(e),o=!Ie(e),i=t.displayName,a=void 0===i?function(e){return Ie(e)?"styled."+e:"Styled("+_(e)+")"}(e):i,s=t.componentId,c=void 0===s?function(e,t,n){var r="string"!=typeof t?"sc":Ae(t),o=(Je[r]||0)+1;Je[r]=o;var i=r+"-"+e.generateName(r+o);return n?n+"-"+i:i}(Oe,t.displayName,t.parentComponentId):s,u=t.ParentComponent,p=void 0===u?Ze:u,f=t.attrs,d=void 0===f?k:f,h=t.displayName&&t.componentId?Ae(t.displayName)+"-"+t.componentId:t.componentId||c,m=r&&e.attrs?Array.prototype.concat(e.attrs,d).filter(Boolean):d,g=new Oe(r?e.componentStyle.rules.concat(n):n,m,h),v=l.a.forwardRef(function(e,t){return l.a.createElement(p,y({},e,{forwardedClass:v,forwardedRef:t}))});return v.attrs=m,v.componentStyle=g,v.displayName=a,v.styledComponentId=h,v.target=r?e.target:e,v.withComponent=function(e){var r=t.componentId,o=b(t,["componentId"]),i=r&&r+"-"+(Ie(e)?e:Ae(_(e)));return et(e,y({},o,{attrs:m,componentId:i,ParentComponent:p}),n)},v.toString=function(){return"."+v.styledComponentId},o&&We(v,e,{attrs:!0,componentStyle:!0,displayName:!0,styledComponentId:!0,target:!0,withComponent:!0}),v}var tt=function(e){return function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(!Object(u.isValidElementType)(n))throw new I(1,String(n));var o=function(){return t(n,r,ye.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,y({},r,o))},o.attrs=function(o){return e(t,n,y({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(et,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){tt[e]=tt(e)});var nt=function(){function e(t,n){m(this,e),this.rules=t,this.componentId=n,this.isStatic=ke(t,k),ue.master.hasId(n)||ue.master.deferredInject(n,[])}return e.prototype.createStyles=function(e,t){var n=q(ge(this.rules,e,t),"");t.inject(this.componentId,n)},e.prototype.removeStyles=function(e){var t=this.componentId;e.hasId(t)&&e.remove(t)},e.prototype.renderStyles=function(e,t){this.removeStyles(t),this.createStyles(e,t)},e}();function rt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=ye.apply(void 0,[e].concat(n)),i="sc-global-"+ve(JSON.stringify(o)),a=new nt(o,i),s=function(e){function t(){m(this,t);var n=w(this,e.call(this)),r=n.constructor,o=r.globalStyle,i=r.styledComponentId;return T&&(window.scCGSHMRCache[i]=(window.scCGSHMRCache[i]||0)+1),n.state={globalStyle:o,styledComponentId:i},n}return v(t,e),t.prototype.componentDidMount=function(){0},t.prototype.componentWillUnmount=function(){window.scCGSHMRCache[this.state.styledComponentId]&&(window.scCGSHMRCache[this.state.styledComponentId]-=1),0===window.scCGSHMRCache[this.state.styledComponentId]&&this.state.globalStyle.removeStyles(this.styleSheet)},t.prototype.render=function(){var e=this;return l.a.createElement(Xe,null,function(t){e.styleSheet=t||ue.master;var n=e.state.globalStyle;return n.isStatic?(n.renderStyles(A,e.styleSheet),null):l.a.createElement(Ye,null,function(t){var r=e.constructor.defaultProps,o=y({},e.props);return void 0!==t&&(o.theme=Ce(e.props,t,r)),n.renderStyles(o,e.styleSheet),null})})},t}(l.a.Component);return s.defaultProps={suppressMultiMountWarning:!1},s.globalStyle=a,s.styledComponentId=i,s}T&&(window.scCGSHMRCache={});var ot=function(e){return e.replace(/\s|\\n/g,"")};function it(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=ye.apply(void 0,[e].concat(n)),i=xe(ve(ot(JSON.stringify(o))));return new pe(i,q(o,i,"@keyframes"))}var at=function(e){var t=l.a.forwardRef(function(t,n){return l.a.createElement(Ye,null,function(r){var o=e.defaultProps,i=Ce(t,r,o);return l.a.createElement(e,y({},t,{theme:i,ref:n}))})});return We(t,e),t.displayName="WithTheme("+_(e)+")",t},st={StyleSheet:ue};t.default=tt}.call(this,n(6))},function(e,t,n){e.exports=function(){"use strict";return function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,s,l,c,u,p){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(o[0]+r),"";default:return r+(0===p?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}}()},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t,n){"use strict";(function(t){n(102);var r=n(234),o=n(117),i=n(236),a=n(237),s=n(238),l=n(239),c=n(19),u=n(118),p=n(25);function f(){this.schema=null,this.$refs=new r}e.exports=f,e.exports.YAML=n(103),f.parse=function(e,t,n,r){var o=new this;return o.parse.apply(o,arguments)},f.prototype.parse=function(e,n,a,s){var l,f=i(arguments);if(!f.path&&!f.schema){var d=p("Expected a file path, URL, or object. Got %s",f.path||f.schema);return u(f.callback,Promise.reject(d))}this.schema=null,this.$refs=new r;var h="http";if(c.isFileSystemPath(f.path)&&(f.path=c.fromFileSystemPath(f.path),h="file"),f.path=c.resolve(c.cwd(),f.path),f.schema&&"object"==typeof f.schema){var m=this.$refs._add(f.path);m.value=f.schema,m.pathType=h,l=Promise.resolve(f.schema)}else l=o(f.path,this.$refs,f.options);var g=this;return l.then(function(e){if(!e||"object"!=typeof e||t.isBuffer(e))throw p.syntax('"%s" is not a valid JSON Schema',g.$refs._root$Ref.path||e);return g.schema=e,u(f.callback,Promise.resolve(g.schema))}).catch(function(e){return u(f.callback,Promise.reject(e))})},f.resolve=function(e,t,n,r){var o=new this;return o.resolve.apply(o,arguments)},f.prototype.resolve=function(e,t,n,r){var o=this,s=i(arguments);return this.parse(s.path,s.schema,s.options).then(function(){return a(o,s.options)}).then(function(){return u(s.callback,Promise.resolve(o.$refs))}).catch(function(e){return u(s.callback,Promise.reject(e))})},f.bundle=function(e,t,n,r){var o=new this;return o.bundle.apply(o,arguments)},f.prototype.bundle=function(e,t,n,r){var o=this,a=i(arguments);return this.resolve(a.path,a.schema,a.options).then(function(){return s(o,a.options),u(a.callback,Promise.resolve(o.schema))}).catch(function(e){return u(a.callback,Promise.reject(e))})},f.dereference=function(e,t,n,r){var o=new this;return o.dereference.apply(o,arguments)},f.prototype.dereference=function(e,t,n,r){var o=this,a=i(arguments);return this.resolve(a.path,a.schema,a.options).then(function(){return l(o,a.options),u(a.callback,Promise.resolve(o.schema))}).catch(function(e){return u(a.callback,Promise.reject(e))})}}).call(this,n(9).Buffer)},function(e,t,n){"use strict";var r,o=n(119),i=n(10),a=(n(52),n(118)),s=n(120),l=n(46),c=n(76),u=c.jptr,p=n(121).isRef,f=n(77).clone,d=n(77).circularClone,h=n(122).recurse,m=n(240),g=n(243),y=n(123),v=n(244).statusCodes,b=n(245).version,w="3.0.0";function x(e,t){var n=new Error(e);if(n.options=t,!t.promise)throw n;t.promise.reject(n)}function k(e,t,n){n.warnOnly?t[n.warnProperty||"x-s2o-warning"]=e:x(e,n)}function E(e,t){g.walkSchema(e,{},{},function(e,n,r){!function(e,t){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),"boolean"==typeof e["x-nullable"]&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),"object"==typeof e["x-discriminator"]&&"string"==typeof e["x-discriminator"].propertyName)for(var n in e.discriminator=e["x-discriminator"],delete e["x-discriminator"],e.discriminator.mapping){var r=e.discriminator.mapping[n];r.startsWith("#/definitions/")&&(e.discriminator.mapping[n]=r.replace("#/definitions/","#/components/schemas/"))}}(e),function(e,t,n){if(e.discriminator&&"string"==typeof e.discriminator&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(0===e.items.length?e.items={}:1===e.items.length?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type))if(n.patch){if(0===e.type.length)delete e.type;else{e.oneOf||(e.oneOf=[]);for(var r=0,o=e.type;r<o.length;r++){var i=o[r],a={};if("null"===i)e.nullable=!0;else{a.type=i;for(var s=0,l=y.arrayProperties;s<l.length;s++){var c=l[s];void 0!==e.prop&&(a[c]=e[c],delete e[c])}}a.type&&e.oneOf.push(a)}delete e.type,0===e.oneOf.length?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&k("Lost properties from oneOf",e,n),delete e.oneOf)}e.type&&Array.isArray(e.type)&&1===e.type.length&&(e.type=e.type[0])}else x("(Patchable) schema type must not be an array",n);e.type&&"null"===e.type&&(delete e.type,e.nullable=!0),"array"!==e.type||e.items||(e.items={}),"boolean"==typeof e.required&&(e.required&&e.name&&(void 0===t.required&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&"string"==typeof e.xml.namespace&&(e.xml.namespace||delete e.xml.namespace)}(e,n,t)})}function S(e,t,n){var o,i=n.payload.options;if(p(e,t))if(e[t].startsWith("#/components/"));else if(e[t].startsWith("#/definitions/")){var a=e[t].replace("#/definitions/","").split("/");(b=r.schemas[decodeURIComponent(a[0])])?a[0]=b:k("Could not resolve reference "+e[t],e,i),e[t]="#/components/schemas/"+a.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+y.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+y.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){var s=f(c.jptr(i.openapi,e[t]));if(!1===s)k("direct $ref not found "+e[t],e,i);else if(i.refmap[e[t]])e[t]=i.refmap[e[t]];else{var l=e[t],u="schemas",d=(l=(l=(l=(l=l.replace("/properties/headers/","")).replace("/properties/responses/","")).replace("/properties/parameters/","")).replace("/properties/schemas/","")).lastIndexOf("/schema");if("schemas"===(u=l.indexOf("/headers/")>d?"headers":l.indexOf("/responses/")>d?"responses":l.indexOf("/example")>d?"examples":l.indexOf("/parameters/")>d?"parameters":"schemas")&&E(s,i),"responses"!==u){var h=u.substr(0,u.length-1);"parameter"===h&&s.name&&s.name===y.sanitise(s.name)&&(h=encodeURIComponent(s.name));var m=1;for(e["x-miro"]&&(o=(o=e["x-miro"]).indexOf("#")>=0?o.split("#")[1].split("/").pop():o.split("/").pop().split(".")[0],h=encodeURIComponent(y.sanitise(o)),m="");c.jptr(i.openapi,"#/components/"+u+"/"+h+m);)m=""===m?2:++m;var g="#/components/"+u+"/"+h+m,v="";"examples"===u&&(s={value:s},v="/value"),c.jptr(i.openapi,g,s),i.refmap[e[t]]=g+v,e[t]=g+v}}}if(delete e["x-miro"],"x-ms-odata"===t&&"string"==typeof e[t]&&e[t].startsWith("#/")){var b;a=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/");(b=r.schemas[decodeURIComponent(a[0])])?a[0]=b:k("Could not resolve reference "+e[t],e,i),e[t]="#/components/schemas/"+a.join("/")}}function _(e){for(var t in e)for(var n in e[t]){var r=y.sanitise(n);n!=r&&(e[t][r]=e[t][n],delete e[t][n])}}function O(e,t){if("basic"===e.type&&(e.type="http",e.scheme="basic"),"oauth2"===e.type){var n={},r=e.flow;"application"===e.flow&&(r="clientCredentials"),"accessCode"===e.flow&&(r="authorizationCode"),void 0!==e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),void 0!==e.tokenUrl&&(n.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),n.scopes=e.scopes||{},e.flows={},e.flows[r]=n,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,void 0!==e.name&&(t.patch?delete e.name:x("(Patchable) oauth2 securitySchemes should not have name property",t))}}function C(e){return!e["x-s2o-delete"]}function T(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&e.items.collectionFormat&&e.items.type&&"array"!=e.items.type&&(e.items.collectionFormat!=e.collectionFormat&&k("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),void 0!==e.collectionFormat&&("array"!=e.type&&(t.patch?delete e.collectionFormat:x("(Patchable) collectionFormat is only applicable to header.type array",t)),"csv"===e.collectionFormat&&(e.style="simple"),"ssv"===e.collectionFormat&&k("collectionFormat:ssv is no longer supported for headers",e,t),"pipes"===e.collectionFormat&&k("collectionFormat:pipes is no longer supported for headers",e,t),"multi"===e.collectionFormat&&(e.explode=!0),"tsv"===e.collectionFormat&&(k("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),delete e.type;for(var n=0,r=y.parameterTypeProperties;n<r.length;n++){void 0!==e[a=r[n]]&&(e.schema[a]=e[a],delete e[a])}for(var o=0,i=y.arrayProperties;o<i.length;o++){var a;void 0!==e[a=i[o]]&&(e.schema[a]=e[a],delete e[a])}}}function j(e,t){if(e.$ref.indexOf("#/parameters/")>=0){var n=e.$ref.split("#/parameters/");e.$ref=n[0]+"#/components/parameters/"+y.sanitise(n[1])}e.$ref.indexOf("#/definitions/")>=0&&k("Definition used as parameter",e,t)}function A(e,t,n,r,o,i){var a={},s=!0,l=(t&&t.consumes||o.consumes||[]).filter(y.uniqueOnly);if(e.$ref&&"string"==typeof e.$ref){j(e,i);var c=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),p=!1;if((O=o.components.parameters[c])&&!O["x-s2o-delete"]||!e.$ref.startsWith("#/")||(e["x-s2o-delete"]=!0,p=!0),p){var d=e.$ref,m=u(o,e.$ref);!m&&d.startsWith("#/")?k("Could not resolve reference "+d,e,i):m&&(e=m)}}if(e.name||e.in){"boolean"==typeof e["x-deprecated"]&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),void 0!==e["x-example"]&&(e.example=e["x-example"],delete e["x-example"]),"body"==e.in||e.type||(i.patch?e.type="string":x("(Patchable) parameter.type is mandatory for non-body parameters",i)),e.type&&"object"==typeof e.type&&e.type.$ref&&(e.type=u(o,e.type.$ref)),e.description&&"object"==typeof e.description&&e.description.$ref&&(e.description=u(o,e.description.$ref)),null===e.description&&delete e.description;var g=e.collectionFormat;if(e.collectionFormat&&("array"!=e.type&&(i.patch?delete e.collectionFormat:x("(Patchable) collectionFormat is only applicable to param.type array",i)),"csv"!==e.collectionFormat||"query"!==e.in&&"cookie"!==e.in||(e.style="form",e.explode=!1),"csv"!==e.collectionFormat||"path"!==e.in&&"header"!==e.in||(e.style="simple"),"ssv"===e.collectionFormat&&("query"===e.in?e.style="spaceDelimited":k("collectionFormat:ssv is no longer supported except for in:query parameters",e,i)),"pipes"===e.collectionFormat&&("query"===e.in?e.style="pipeDelimited":k("collectionFormat:pipes is no longer supported except for in:query parameters",e,i)),"multi"===e.collectionFormat&&(e.explode=!0),"tsv"===e.collectionFormat&&(k("collectionFormat:tsv is no longer supported",e,i),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&"object"!=e.type&&"body"!=e.type&&"formData"!=e.in)if(e.items&&e.schema)k("parameter has array,items and schema",e,i);else{e.schema&&"object"==typeof e.schema||(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,h(e.schema.items,null,function(t,n,r){"collectionFormat"===n&&"string"==typeof t[n]&&(g&&t[n]!==g&&k("Nested collectionFormats are not supported",e,i),delete t[n])}));for(var v=0,b=y.parameterTypeProperties;v<b.length;v++){var w=b[v];void 0!==e[w]&&(e.schema[w]=e[w]),delete e[w]}}e.schema&&E(e.schema,i),e["x-ms-skip-url-encoding"]&&"query"===e.in&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if("formData"===e.in){s=!1,a.content={};var S="application/x-www-form-urlencoded";if(l.length&&l.indexOf("multipart/form-data")>=0&&(S="multipart/form-data"),a.content[S]={},e.schema)a.content[S].schema=e.schema,e.schema.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{a.content[S].schema={},a.content[S].schema.type="object",a.content[S].schema.properties={},a.content[S].schema.properties[e.name]={};var _=a.content[S].schema,O=a.content[S].schema.properties[e.name];e.description&&(O.description=e.description),e.example&&(O.example=e.example),e.type&&(O.type=e.type);for(var C=0,T=y.parameterTypeProperties;C<T.length;C++){w=T[C];void 0!==e[w]&&(O[w]=e[w])}!0===e.required&&(_.required||(_.required=[]),_.required.push(e.name)),void 0!==e.default&&(O.default=e.default),O.properties&&(O.properties=e.properties),e.allOf&&(O.allOf=e.allOf),"array"===e.type&&e.items&&(O.items=e.items,O.items.collectionFormat&&delete O.items.collectionFormat),"file"===e.type&&(O.type="string",O.format="binary")}}else"file"===e.type&&(e.required&&(a.required=e.required),a.content={},a.content["application/octet-stream"]={},a.content["application/octet-stream"].schema={},a.content["application/octet-stream"].schema.type="string",a.content["application/octet-stream"].schema.format="binary");if("body"===e.in){a.content={},e.name&&(a["x-s2o-name"]=(t&&t.operationId?y.sanitiseAll(t.operationId):"")+("_"+e.name).toCamelCase()),e.description&&(a.description=e.description),e.required&&(a.required=e.required),e.schema&&e.schema.$ref?a["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")):e.schema&&"array"===e.schema.type&&e.schema.items&&e.schema.items.$ref&&(a["x-s2o-name"]=decodeURIComponent(e.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),l.length||l.push("application/json");for(var A=0,I=l;A<I.length;A++){var P=I[A];a.content[P]={},a.content[P].schema=f(e.schema)||{},E(a.content[P].schema,i)}}Object.keys(a).length>0&&(e["x-s2o-delete"]=!0,t&&(t.requestBody&&s?(t.requestBody["x-s2o-overloaded"]=!0,k("Operation "+(t.operationId||r)+" has multiple requestBodies",t,i)):(t.requestBody=Object.assign({},t.requestBody),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&a.content["multipart/form-data"]?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,a.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(a.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&a.content["application/x-www-form-urlencoded"]?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,a.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(a.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,a),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=y.sanitiseAll(t.operationId)))))));delete e.type;for(var R=0,N=y.parameterTypeProperties;R<N.length;R++){w=N[R];delete e[w]}return"path"!==e.in||void 0!==e.required&&!0===e.required||(i.patch?e.required=!0:x("(Patchable) path parameters must be required:true",i)),a}function I(e,t,n,r,o){if(e.$ref&&"string"==typeof e.$ref)e.$ref.indexOf("#/definitions/")>=0?k("definition used as response: "+e.$ref,e,o):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+y.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if(void 0===e.description||null===e.description||""===e.description&&o.patch)if(o.patch){var i=v.find(function(e){return e.code===t});"object"!=typeof e||Array.isArray(e)||(e.description=i?i.phrase:"")}else x("(Patchable) response.description is mandatory",o);if(e.schema){E(e.schema,o),e.schema.$ref&&"string"==typeof e.schema.$ref&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+y.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/",""))));var a=(n&&n.produces||r.produces||[]).filter(y.uniqueOnly);a.length||a.push("*/*"),e.content={};for(var s=0,l=a;s<l.length;s++){var c=l[s];if(e.content[c]={},e.content[c].schema=f(e.schema),e.examples&&e.examples[c]){var u={};u.value=e.examples[c],e.content[c].examples={},e.content[c].examples.response=u,delete e.examples[c]}"file"===e.content[c].schema.type&&(e.content[c].schema={type:"string",format:"binary"})}delete e.schema}for(var c in e.examples)e.content||(e.content={}),e.content[c]||(e.content[c]={}),e.content[c].examples={},e.content[c].examples.response={},e.content[c].examples.response.value=e.examples[c];if(delete e.examples,e.headers)for(var p in e.headers)"status code"===p.toLowerCase()?o.patch?delete e.headers[p]:x('(Patchable) "Status Code" is not a valid header',o):T(e.headers[p],o)}}function P(e,t,n,r,o){for(var a in e){var s=e[a];for(var l in s["x-trace"]&&"object"==typeof s["x-trace"]&&(s.trace=s["x-trace"],delete s["x-trace"]),s["x-summary"]&&"string"==typeof s["x-summary"]&&(s.summary=s["x-summary"],delete s["x-summary"]),s["x-description"]&&"string"==typeof s["x-description"]&&(s.description=s["x-description"],delete s["x-description"]),s["x-servers"]&&Array.isArray(s["x-servers"])&&(s.servers=s["x-servers"],delete s["x-servers"]),s)if(y.httpMethods.indexOf(l)>=0||"x-amazon-apigateway-any-method"===l){var p=s[l];if(p.parameters&&Array.isArray(p.parameters)){if(s.parameters)for(var d=function(e){"string"==typeof e.$ref&&(j(e,n),e=u(o,e.$ref)),p.parameters.find(function(t,n,r){return t.name===e.name&&t.in===e.in})||"formData"!==e.in&&"body"!==e.in&&"file"!==e.type||A(e,p,0,a,o,n)},h=0,m=s.parameters;h<m.length;h++){d(J=m[h])}for(var g=0,v=p.parameters;g<v.length;g++){A(J=v[g],p,0,l+":"+a,o,n)}n.debug||(p.parameters=p.parameters.filter(C))}if(null===p.parameters&&delete p.parameters,p.security&&_(p.security),!p.responses){var b={description:"Default response"};p.responses={default:b}}for(var w in p.responses){I(p.responses[w],w,p,o,n)}if(p["x-servers"]&&Array.isArray(p["x-servers"]))p.servers=p["x-servers"],delete p["x-servers"];else if(p.schemes&&p.schemes.length)for(var x=0,k=p.schemes;x<k.length;x++){var E=k[x];if(!o.schemes||o.schemes.indexOf(E)<0){p.servers||(p.servers=[]);for(var S=0,O=o.servers;S<O.length;S++){var T=O[S],P=f(T),R=i.parse(P.url);R.protocol=E,P.url=R.format(),p.servers.push(P)}}}if(n.debug&&(p["x-s2o-consumes"]=p.consumes||[],p["x-s2o-produces"]=p.produces||[]),delete p.consumes,delete p.produces,delete p.schemes,p["x-ms-examples"]){for(var N in p["x-ms-examples"]){var L=p["x-ms-examples"][N],M=y.sanitiseAll(N);if(L.parameters)for(var D in L.parameters)for(var F=L.parameters[D],U=0,B=(p.parameters||[]).concat(s.parameters||[]);U<B.length;U++){(J=B[U]).$ref&&(J=c.jptr(o,J.$ref)),J.name!==D||J.example||(J.examples||(J.examples={}),J.examples[N]={value:F})}if(L.responses)for(var w in L.responses){if(L.responses[w].headers)for(var z in L.responses[w].headers){F=L.responses[w].headers[z];for(var $ in p.responses[w].headers){if($===z)p.responses[w].headers[$].example=F}}if(L.responses[w].body&&(o.components.examples[M]={value:f(L.responses[w].body)},p.responses[w]&&p.responses[w].content))for(var W in p.responses[w].content){var q=p.responses[w].content[W];q.examples||(q.examples={}),q.examples[N]={$ref:"#/components/examples/"+M}}}}delete p["x-ms-examples"]}if(p.parameters&&0===p.parameters.length&&delete p.parameters,p.requestBody){var H=p.operationId?y.sanitiseAll(p.operationId):y.sanitiseAll(l+a).toCamelCase(),Y=y.sanitise(p.requestBody["x-s2o-name"]||H||"");delete p.requestBody["x-s2o-name"];var V=JSON.stringify(p.requestBody),Q=y.hash(V);if(!r[Q]){var G={};G.name=Y,G.body=p.requestBody,G.refs=[],r[Q]=G}var X="#/"+t+"/"+encodeURIComponent(c.jpescape(a))+"/"+l+"/requestBody";r[Q].refs.push(X)}}if(null===s.parameters&&delete s.parameters,s.parameters){for(var K in s.parameters){var J;A(J=s.parameters[K],null,0,a,o,n)}n.debug||(s.parameters=s.parameters.filter(C))}}}function R(e,t){var n={};for(var o in r={schemas:{}},e.security&&_(e.security),e.components.securitySchemes){o!=(l=y.sanitise(o))&&(e.components.securitySchemes[l]&&x("Duplicate sanitised securityScheme name "+l,t),e.components.securitySchemes[l]=e.components.securitySchemes[o],delete e.components.securitySchemes[o]),O(e.components.securitySchemes[l],t)}for(var o in e.components.schemas){var i="";if(o!=(l=y.sanitiseAll(o))){for(;e.components.schemas[l+i];)i=i?++i:2;e.components.schemas[l+i]=e.components.schemas[o],delete e.components.schemas[o]}r.schemas[o]=l+i,E(e.components.schemas[l+i],t)}for(var a in t.refmap={},h(e,{payload:{options:t}},S),function(e,t){for(var n in t.refmap)c.jptr(e,n,{$ref:t.refmap[n]})}(e,t),e.components.parameters){a!=(l=y.sanitise(a))&&(e.components.parameters[l]&&x("Duplicate sanitised parameter name "+l,t),e.components.parameters[l]=e.components.parameters[a],delete e.components.parameters[a]),A(e.components.parameters[l],null,0,l,e,t)}for(var s in e.components.responses){var l;s!=(l=y.sanitise(s))&&(e.components.responses[l]&&x("Duplicate sanitised response name "+l,t),e.components.responses[l]=e.components.responses[s],delete e.components.responses[s]);var u=e.components.responses[l];if(I(u,l,null,e,t),u.headers)for(var p in u.headers)"status code"===p.toLowerCase()?t.patch?delete u.headers[p]:x('(Patchable) "Status Code" is not a valid header',t):T(u.headers[p],t)}for(var s in e.components.requestBodies){var d=e.components.requestBodies[s],m=JSON.stringify(d),g=y.hash(m);(k={}).name=s,k.body=d,k.refs=[],n[g]=k}if(P(e.paths,"paths",t,n,e),e["x-ms-paths"]&&P(e["x-ms-paths"],"x-ms-paths",t,n,e),!t.debug)for(var a in e.components.parameters){e.components.parameters[a]["x-s2o-delete"]&&delete e.components.parameters[a]}t.debug&&(e["x-s2o-consumes"]=e.consumes||[],e["x-s2o-produces"]=e.produces||[]),delete e.consumes,delete e.produces,delete e.schemes;var v=[];e.components.requestBodies={};var b=1;for(var w in n){var k;if((k=n[w]).refs.length>1){i="";for(k.name||(k.name="requestBody",i=b++);v.indexOf(k.name+i)>=0;)i=i?++i:2;for(var s in k.name=k.name+i,v.push(k.name),e.components.requestBodies[k.name]=f(k.body),k.refs){var C={};C.$ref="#/components/requestBodies/"+k.name,c.jptr(e,k.refs[s],C)}}}return e.components.responses&&0===Object.keys(e.components.responses).length&&delete e.components.responses,e.components.parameters&&0===Object.keys(e.components.parameters).length&&delete e.components.parameters,e.components.examples&&0===Object.keys(e.components.examples).length&&delete e.components.examples,e.components.requestBodies&&0===Object.keys(e.components.requestBodies).length&&delete e.components.requestBodies,e.components.securitySchemes&&0===Object.keys(e.components.securitySchemes).length&&delete e.components.securitySchemes,e.components.headers&&0===Object.keys(e.components.headers).length&&delete e.components.headers,e.components.schemas&&0===Object.keys(e.components.schemas).length&&delete e.components.schemas,e.components&&0===Object.keys(e.components).length&&delete e.components,e}function N(e){e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,function(t,n){e.variables||(e.variables={}),e.variables[n]={default:"unknown"}})}function L(e,t,n){if(void 0===e.info||null===e.info){if(!t.patch)return n(new Error("(Patchable) info object is mandatory"));e.info={version:"",title:""}}if("object"!=typeof e.info||Array.isArray(e.info))return n(new Error("info must be an object"));if(void 0===e.info.title||null===e.info.title){if(!t.patch)return n(new Error("(Patchable) info.title cannot be null"));e.info.title=""}if(void 0===e.info.version||null===e.info.version){if(!t.patch)return n(new Error("(Patchable) info.version cannot be null"));e.info.version=""}if("string"!=typeof e.info.version){if(!t.patch)return n(new Error("(Patchable) info.version must be a string"));e.info.version=e.info.version.toString()}if(void 0!==e.info.logo){if(!t.patch)return n(new Error("(Patchable) info should not have logo property"));e.info["x-logo"]=e.info.logo,delete e.info.logo}if(void 0!==e.info.termsOfService){if(null===e.info.termsOfService){if(!t.patch)return n(new Error("(Patchable) info.termsOfService cannot be null"));e.info.termsOfService=""}if(i.URL&&t.whatwg)try{i.URL.parse(e.info.termsOfService)}catch(r){if(!t.patch)return n(new Error("(Patchable) info.termsOfService must be a URL"));delete e.info.termsOfService}}}function M(e,t,n){if(void 0===e.paths){if(!t.patch)return n(new Error("(Patchable) paths object is mandatory"));e.paths={}}}function D(e,t,n){return a(n,new Promise(function(n,r){if(t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=r,t.cache||(t.cache={}),e.openapi&&"string"==typeof e.openapi&&e.openapi.startsWith("3."))return t.openapi=d(e),L(t.openapi,t,r),M(t.openapi,t,r),void m.optionalResolve(t).then(function(){return t.direct?n(t.openapi):n(t)}).catch(function(e){console.warn(e),r(e)});if(!e.swagger||"2.0"!=e.swagger)return r(new Error("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));var o=t.openapi={};if(o.openapi=w,t.origin){o["x-origin"]||(o["x-origin"]=[]);var i={};i.url=t.source||t.origin,i.format="swagger",i.version=e.swagger,i.converter={},i.converter.url="https://github.com/mermade/oas-kit",i.converter.version=b,o["x-origin"].push(i)}if(delete(o=Object.assign(o,d(e))).swagger,e.host)for(var a=0,s=e.schemes||[""];a<s.length;a++){var l=s[a];(p={}).url=(l?l+":":"")+"//"+e.host+(e.basePath?e.basePath:""),N(p),o.servers||(o.servers=[]),o.servers.push(p)}else if(e.basePath){(p={}).url=e.basePath,N(p),o.servers||(o.servers=[]),o.servers.push(p)}if(delete o.host,delete o.basePath,o["x-servers"]&&Array.isArray(o["x-servers"])&&(o.servers=o["x-servers"],delete o["x-servers"]),e["x-ms-parameterized-host"]){var c=e["x-ms-parameterized-host"],p={};for(var h in p.url=c.hostTemplate,p.variables={},c.parameters){var g=c.parameters[h];g.$ref&&(g=f(u(o,g.$ref))),h.startsWith("x-")||(delete g.required,delete g.type,delete g.in,void 0===g.default&&(g.enum?g.default=g.enum[0]:g.default=""),p.variables[g.name]=g,delete g.name)}o.servers||(o.servers=[]),o.servers.push(p),delete o["x-ms-parameterized-host"]}L(o,t,r),M(o,t,r),o.components={},o["x-callbacks"]&&(o.components.callbacks=o["x-callbacks"],delete o["x-callbacks"]),o.components.examples={},o.components.headers={},o["x-links"]&&(o.components.links=o["x-links"],delete o["x-links"]),o.components.parameters=o.parameters||{},o.components.responses=o.responses||{},o.components.requestBodies={},o.components.securitySchemes=o.securityDefinitions||{},o.components.schemas=o.definitions||{},delete o.definitions,delete o.responses,delete o.parameters,delete o.securityDefinitions,m.optionalResolve(t).then(function(){R(o,t),t.direct?n(t.openapi):n(t)}).catch(function(e){console.warn(e),r(e)})}))}function F(e,t,n){return a(n,new Promise(function(n,r){var o=null;try{o=JSON.parse(e)}catch(n){try{o=l.safeLoad(e,{json:!0}),t.sourceYaml=!0}catch(e){}}o?(t.original=o,D(o,t).then(function(e){return n(e)}).catch(function(e){return r(e)})):r(new Error("Could not parse string"))}))}e.exports={targetVersion:w,convert:D,convertObj:D,convertUrl:function(e,t,n){return a(n,new Promise(function(n,r){t.origin=!0,t.source||(t.source=e),t.verbose&&console.log("GET "+e),s(e,{agent:t.agent}).then(function(e){if(200!==e.status)throw new Error("Received status code "+e.status);return e.text()}).then(function(e){F(e,t).then(function(e){return n(e)}).catch(function(e){return r(e)})}).catch(function(e){r(e)})}))},convertStr:F,convertFile:function(e,t,n){return a(n,new Promise(function(n,r){o.readFile(e,t.encoding||"utf8",function(o,i){o?r(o):(t.sourceFile=e,F(i,t).then(function(e){return n(e)}).catch(function(e){return r(e)}))})}))},convertStream:function(e,t,n){return a(n,new Promise(function(n,r){var o="";e.on("data",function(e){o+=e}).on("end",function(){F(o,t).then(function(e){return n(e)}).catch(function(e){return r(e)})})}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=l(o),a=l(n(13)),s=l(n(12));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u="Select...",p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={selected:n.parseValue(e.value,e.options)||{label:void 0===e.placeholder?u:e.placeholder,value:""},isOpen:!1},n.mounted=!0,n.handleDocumentClick=n.handleDocumentClick.bind(n),n.fireChangeEvent=n.fireChangeEvent.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Component),r(t,[{key:"componentWillReceiveProps",value:function(e){if(e.value){var t=this.parseValue(e.value,e.options);t!==this.state.selected&&this.setState({selected:t})}else this.setState({selected:{label:void 0===e.placeholder?u:e.placeholder,value:""}})}},{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleDocumentClick,!1),document.addEventListener("touchend",this.handleDocumentClick,!1)}},{key:"componentWillUnmount",value:function(){this.mounted=!1,document.removeEventListener("click",this.handleDocumentClick,!1),document.removeEventListener("touchend",this.handleDocumentClick,!1)}},{key:"handleMouseDown",value:function(e){this.props.onFocus&&"function"==typeof this.props.onFocus&&this.props.onFocus(this.state.isOpen),"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),this.props.disabled||this.setState({isOpen:!this.state.isOpen}))}},{key:"parseValue",value:function(e,t){var n=void 0;if("string"==typeof e)for(var r=0,o=t.length;r<o;r++)if("group"===t[r].type){var i=t[r].items.filter(function(t){return t.value===e});i.length&&(n=i[0])}else void 0!==t[r].value&&t[r].value===e&&(n=t[r]);return n||e}},{key:"setValue",value:function(e,t){var n={selected:{value:e,label:t},isOpen:!1};this.fireChangeEvent(n),this.setState(n)}},{key:"fireChangeEvent",value:function(e){e.selected!==this.state.selected&&this.props.onChange&&this.props.onChange(e.selected)}},{key:"renderOption",value:function(e){var t,n=e.value;void 0===n&&(n=e.label||e);var r=e.label||e.value||e,o=(c(t={},this.props.baseClassName+"-option",!0),c(t,e.className,!!e.className),c(t,"is-selected",n===this.state.selected.value||n===this.state.selected),t),a=(0,s.default)(o);return i.default.createElement("div",{key:n,className:a,onMouseDown:this.setValue.bind(this,n,r),onClick:this.setValue.bind(this,n,r)},r)}},{key:"buildMenu",value:function(){var e=this,t=this.props,n=t.options,r=t.baseClassName,o=n.map(function(t){if("group"===t.type){var n=i.default.createElement("div",{className:r+"-title"},t.name),o=t.items.map(function(t){return e.renderOption(t)});return i.default.createElement("div",{className:r+"-group",key:t.name},n,o)}return e.renderOption(t)});return o.length?o:i.default.createElement("div",{className:r+"-noresults"},"No options found")}},{key:"handleDocumentClick",value:function(e){this.mounted&&(a.default.findDOMNode(this).contains(e.target)||this.state.isOpen&&this.setState({isOpen:!1}))}},{key:"isValueSelected",value:function(){return"string"==typeof this.state.selected||""!==this.state.selected.value}},{key:"render",value:function(){var e,t,n,r,o,a=this.props,l=a.baseClassName,u=a.controlClassName,p=a.placeholderClassName,f=a.menuClassName,d=a.arrowClassName,h=a.arrowClosed,m=a.arrowOpen,g=a.className,y=this.props.disabled?"Dropdown-disabled":"",v="string"==typeof this.state.selected?this.state.selected:this.state.selected.label,b=(0,s.default)((c(e={},l+"-root",!0),c(e,g,!!g),c(e,"is-open",this.state.isOpen),e)),w=(0,s.default)((c(t={},l+"-control",!0),c(t,u,!!u),c(t,y,!!y),t)),x=(0,s.default)((c(n={},l+"-placeholder",!0),c(n,p,!!p),c(n,"is-selected",this.isValueSelected()),n)),k=(0,s.default)((c(r={},l+"-menu",!0),c(r,f,!!f),r)),E=(0,s.default)((c(o={},l+"-arrow",!0),c(o,d,!!d),o)),S=i.default.createElement("div",{className:x},v),_=this.state.isOpen?i.default.createElement("div",{className:k},this.buildMenu()):null;return i.default.createElement("div",{className:b},i.default.createElement("div",{className:w,onMouseDown:this.handleMouseDown.bind(this),onTouchEnd:this.handleMouseDown.bind(this)},S,i.default.createElement("div",{className:l+"-arrow-wrapper"},m&&h?this.state.isOpen?m:h:i.default.createElement("span",{className:E}))),_)}}]),t}();p.defaultProps={baseClassName:"Dropdown"},t.default=p},function(e,t,n){e.exports=function(){"use strict";var e=["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"],t=["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"],n=["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"],r=["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"],o=["#text"],i=["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"],a=["accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"],s=["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"],l=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"];function c(e,t){for(var n=t.length;n--;)"string"==typeof t[n]&&(t[n]=t[n].toLowerCase()),e[t[n]]=!0;return e}function u(e){var t={},n=void 0;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}var p=/\{\{[\s\S]*|[\s\S]*\}\}/gm,f=/<%[\s\S]*|[\s\S]*%>/gm,d=/^data-[\-\w.\u00B7-\uFFFF]/,h=/^aria-[\-\w]+$/,m=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,g=/^(?:\w+script|data):/i,y=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function b(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var w=function(){return"undefined"==typeof window?null:window};return function x(){var k=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w(),E=function(e){return x(e)};if(E.version="1.0.8",E.removed=[],!k||!k.document||9!==k.document.nodeType)return E.isSupported=!1,E;var S=k.document,_=!1,O=!1,C=k.document,T=k.DocumentFragment,j=k.HTMLTemplateElement,A=k.Node,I=k.NodeFilter,P=k.NamedNodeMap,R=void 0===P?k.NamedNodeMap||k.MozNamedAttrMap:P,N=k.Title,L=k.Comment,M=k.DOMParser;if("function"==typeof j){var D=C.createElement("template");D.content&&D.content.ownerDocument&&(C=D.content.ownerDocument)}var F=C,U=F.implementation,B=F.createNodeIterator,z=F.getElementsByTagName,$=F.createDocumentFragment,W=S.importNode,q={};E.isSupported=U&&void 0!==U.createHTMLDocument&&9!==C.documentMode;var H=p,Y=f,V=d,Q=h,G=g,X=y,K=m,J=null,Z=c({},[].concat(b(e),b(t),b(n),b(r),b(o))),ee=null,te=c({},[].concat(b(i),b(a),b(s),b(l))),ne=null,re=null,oe=!0,ie=!0,ae=!1,se=!1,le=!1,ce=!1,ue=!1,pe=!1,fe=!1,de=!1,he=!1,me=!0,ge=!0,ye=!1,ve={},be=c({},["audio","head","math","script","style","template","svg","video"]),we=c({},["audio","video","img","source","image"]),xe=c({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),ke=null,Ee=C.createElement("form"),Se=function(p){"object"!==(void 0===p?"undefined":v(p))&&(p={}),J="ALLOWED_TAGS"in p?c({},p.ALLOWED_TAGS):Z,ee="ALLOWED_ATTR"in p?c({},p.ALLOWED_ATTR):te,ne="FORBID_TAGS"in p?c({},p.FORBID_TAGS):{},re="FORBID_ATTR"in p?c({},p.FORBID_ATTR):{},ve="USE_PROFILES"in p&&p.USE_PROFILES,oe=!1!==p.ALLOW_ARIA_ATTR,ie=!1!==p.ALLOW_DATA_ATTR,ae=p.ALLOW_UNKNOWN_PROTOCOLS||!1,se=p.SAFE_FOR_JQUERY||!1,le=p.SAFE_FOR_TEMPLATES||!1,ce=p.WHOLE_DOCUMENT||!1,fe=p.RETURN_DOM||!1,de=p.RETURN_DOM_FRAGMENT||!1,he=p.RETURN_DOM_IMPORT||!1,pe=p.FORCE_BODY||!1,me=!1!==p.SANITIZE_DOM,ge=!1!==p.KEEP_CONTENT,ye=p.IN_PLACE||!1,K=p.ALLOWED_URI_REGEXP||K,le&&(ie=!1),de&&(fe=!0),ve&&(J=c({},[].concat(b(o))),ee=[],!0===ve.html&&(c(J,e),c(ee,i)),!0===ve.svg&&(c(J,t),c(ee,a),c(ee,l)),!0===ve.svgFilters&&(c(J,n),c(ee,a),c(ee,l)),!0===ve.mathMl&&(c(J,r),c(ee,s),c(ee,l))),p.ADD_TAGS&&(J===Z&&(J=u(J)),c(J,p.ADD_TAGS)),p.ADD_ATTR&&(ee===te&&(ee=u(ee)),c(ee,p.ADD_ATTR)),p.ADD_URI_SAFE_ATTR&&c(xe,p.ADD_URI_SAFE_ATTR),ge&&(J["#text"]=!0),ce&&c(J,["html","head","body"]),J.table&&c(J,["tbody"]),Object&&"freeze"in Object&&Object.freeze(p),ke=p},_e=function(e){E.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},Oe=function(e,t){try{E.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){E.removed.push({attribute:null,from:t})}t.removeAttribute(e)},Ce=function(e){var t=void 0;if(pe&&(e="<remove></remove>"+e),_)try{t=(new M).parseFromString(e,"text/html")}catch(e){}if(O&&c(ne,["title"]),!t||!t.documentElement){var n=t=U.createHTMLDocument(""),r=n.body;r.parentNode.removeChild(r.parentNode.firstElementChild),r.outerHTML=e}return z.call(t,ce?"html":"body")[0]};E.isSupported&&(function(){try{var e=Ce('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">');e.querySelector("svg img")&&(_=!0)}catch(e){}}(),function(){try{var e=Ce("<x/><title></title><img>");e.querySelector("title").textContent.match(/<\/title/)&&(O=!0)}catch(e){}}());var Te=function(e){return B.call(e.ownerDocument||e,e,I.SHOW_ELEMENT|I.SHOW_COMMENT|I.SHOW_TEXT,function(){return I.FILTER_ACCEPT},!1)},je=function(e){return"object"===(void 0===A?"undefined":v(A))?e instanceof A:e&&"object"===(void 0===e?"undefined":v(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ae=function(e,t,n){q[e]&&q[e].forEach(function(e){e.call(E,t,n,ke)})},Ie=function(e){var t,n=void 0;if(Ae("beforeSanitizeElements",e,null),!((t=e)instanceof N||t instanceof L||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof R&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute))return _e(e),!0;var r=e.nodeName.toLowerCase();if(Ae("uponSanitizeElement",e,{tagName:r,allowedTags:J}),!J[r]||ne[r]){if(ge&&!be[r]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(e){}return _e(e),!0}return!se||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(E.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),le&&3===e.nodeType&&(n=(n=(n=e.textContent).replace(H," ")).replace(Y," "),e.textContent!==n&&(E.removed.push({element:e.cloneNode()}),e.textContent=n)),Ae("afterSanitizeElements",e,null),!1},Pe=function(e,t,n){if(me&&("id"===t||"name"===t)&&(n in C||n in Ee))return!1;if(le&&(n=(n=n.replace(H," ")).replace(Y," ")),ie&&V.test(t));else if(oe&&Q.test(t));else{if(!ee[t]||re[t])return!1;if(xe[t]);else if(K.test(n.replace(X,"")));else if("src"!==t&&"xlink:href"!==t||"script"===e||0!==n.indexOf("data:")||!we[e])if(ae&&!G.test(n.replace(X,"")));else if(n)return!1}return!0},Re=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0;Ae("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(n=t.value.trim(),r=c.toLowerCase(),s.attrName=r,s.attrValue=n,s.keepAttr=!0,Ae("uponSanitizeAttribute",e,s),n=s.attrValue,"name"===r&&"IMG"===e.nodeName&&a.id)o=a.id,a=Array.prototype.slice.apply(a),Oe("id",e),Oe(c,e),a.indexOf(o)>i&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===n&&(ee[r]||!re[r]))continue;"id"===c&&e.setAttribute(c,""),Oe(c,e)}if(s.keepAttr){var p=e.nodeName.toLowerCase();if(Pe(p,r,n))try{u?e.setAttributeNS(u,c,n):e.setAttribute(c,n),E.removed.pop()}catch(e){}}}Ae("afterSanitizeAttributes",e,null)}},Ne=function e(t){var n=void 0,r=Te(t);for(Ae("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ae("uponSanitizeShadowNode",n,null),Ie(n)||(n.content instanceof T&&e(n.content),Re(n));Ae("afterSanitizeShadowDOM",t,null)};return E.sanitize=function(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,a=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!je(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!E.isSupported){if("object"===v(k.toStaticHTML)||"function"==typeof k.toStaticHTML){if("string"==typeof e)return k.toStaticHTML(e);if(je(e))return k.toStaticHTML(e.outerHTML)}return e}if(ue||Se(t),E.removed=[],ye);else if(e instanceof A)n=Ce("\x3c!--\x3e"),1===(r=n.ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?n=r:n.appendChild(r);else{if(!fe&&!ce&&-1===e.indexOf("<"))return e;if(!(n=Ce(e)))return fe?null:""}n&&pe&&_e(n.firstChild);for(var s=Te(ye?e:n);o=s.nextNode();)3===o.nodeType&&o===i||Ie(o)||(o.content instanceof T&&Ne(o.content),Re(o),i=o);if(ye)return e;if(fe){if(de)for(a=$.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return he&&(a=W.call(S,a,!0)),a}return ce?n.outerHTML:n.innerHTML},E.setConfig=function(e){Se(e),ue=!0},E.clearConfig=function(){ke=null,ue=!1},E.isValidAttribute=function(e,t,n){ke||Se({});var r=e.toLowerCase(),o=t.toLowerCase();return Pe(r,o,n)},E.addHook=function(e,t){"function"==typeof t&&(q[e]=q[e]||[],q[e].push(t))},E.removeHook=function(e){q[e]&&q[e].pop()},E.removeHooks=function(e){q[e]&&(q[e]=[])},E.removeAllHooks=function(){q={}},E}()}()},function(e,t,n){"use strict";var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class)|(on[A-Z].*)|((data|aria|x)-.*))$/i,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}(r.test.bind(r));t.a=o},function(e,t,n){n(135),e.exports=n(270)},function(e,t,n){"use strict";n.r(t);n(136),n(154),n(159),n(162),n(165),n(167),n(173)},function(e,t,n){n(56),n(83),n(86),n(144),e.exports=n(7).Promise},function(e,t,n){var r=n(61),o=n(43);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(i=s.charCodeAt(l))<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(63),o=n(42),i=n(36),a={};n(22)(a,n(2)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(16),o=n(14),i=n(34);e.exports=n(17)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,l=0;s>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(28),o=n(35),i=n(141);e.exports=function(e){return function(t,n,a){var s,l=r(t),c=o(l.length),u=i(a,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var r=n(61),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(23),o=n(67),i=n(65)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(87),o=n(88),i=n(33),a=n(28);e.exports=n(62)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,o,i,a,s=n(31),l=n(5),c=n(24),u=n(57),p=n(18),f=n(8),d=n(44),h=n(68),m=n(69),g=n(148),y=n(89).set,v=n(150)(),b=n(90),w=n(151),x=n(152),k=n(153),E=l.TypeError,S=l.process,_=S&&S.versions,O=_&&_.v8||"",C=l.Promise,T="process"==u(S),j=function(){},A=o=b.f,I=!!function(){try{var e=C.resolve(1),t=(e.constructor={})[n(2)("species")]=function(e){e(j,j)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(j)instanceof t&&0!==O.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},R=function(e,t){if(!e._n){e._n=!0;var n=e._c;v(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(o||(2==e._h&&M(e),e._h=1),!0===s?n=r:(u&&u.enter(),n=s(r),u&&(u.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=P(n))?i.call(n,l,c):l(n)):c(r)}catch(e){u&&!a&&u.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){y.call(l,function(){var t,n,r,o=e._v,i=L(e);if(i&&(t=w(function(){T?S.emit("unhandledRejection",o,e):(n=l.onunhandledrejection)?n({promise:e,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=T||L(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){y.call(l,function(){var t;T?S.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),R(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=P(e))?v(function(){var r={_w:n,_d:!1};try{t.call(e,c(F,r,1),c(D,r,1))}catch(e){D.call(r,e)}}):(n._v=e,n._s=1,R(n,!1))}catch(e){D.call({_w:n,_d:!1},e)}}};I||(C=function(e){h(this,C,"Promise","_h"),d(e),r.call(this);try{e(c(F,this,1),c(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(70)(C.prototype,{then:function(e,t){var n=A(g(this,C));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(F,e,1),this.reject=c(D,e,1)},b.f=A=function(e){return e===C||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!I,{Promise:C}),n(36)(C,"Promise"),n(91)("Promise"),a=n(7).Promise,p(p.S+p.F*!I,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!I),"Promise",{resolve:function(e){return k(s&&this===a?C:this,e)}}),p(p.S+p.F*!(I&&n(92)(function(e){C.all(e).catch(j)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,o=w(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t,n){var r=n(14);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(33),o=n(2)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(57),o=n(2)("iterator"),i=n(33);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(14),o=n(44),i=n(2)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(5),o=n(89).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,l="process"==n(26)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(l&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(5).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(14),o=n(8),i=n(90);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){n(155),e.exports=n(7).Array.find},function(e,t,n){"use strict";var r=n(18),o=n(156)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1}),r(r.P+r.F*i,"Array",{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n(87)("find")},function(e,t,n){var r=n(24),o=n(64),i=n(67),a=n(35),s=n(157);e.exports=function(e,t){var n=1==e,l=2==e,c=3==e,u=4==e,p=6==e,f=5==e||p,d=t||s;return function(t,s,h){for(var m,g,y=i(t),v=o(y),b=r(s,h,3),w=a(v.length),x=0,k=n?d(t,w):l?d(t,0):void 0;w>x;x++)if((f||x in v)&&(g=b(m=v[x],x,y),e))if(n)k[x]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:k.push(m)}else if(u)return!1;return p?-1:c||u?u:k}}},function(e,t,n){var r=n(158);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(8),o=n(93),i=n(2)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){n(160),e.exports=n(7).Object.assign},function(e,t,n){var r=n(18);r(r.S+r.F,"Object",{assign:n(161)})},function(e,t,n){"use strict";var r=n(34),o=n(71),i=n(45),a=n(67),s=n(64),l=Object.assign;e.exports=!l||n(27)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r})?function(e,t){for(var n=a(e),l=arguments.length,c=1,u=o.f,p=i.f;l>c;)for(var f,d=s(arguments[c++]),h=u?r(d).concat(u(d)):r(d),m=h.length,g=0;m>g;)p.call(d,f=h[g++])&&(n[f]=d[f]);return n}:l},function(e,t,n){n(163),e.exports=n(7).String.endsWith},function(e,t,n){"use strict";var r=n(18),o=n(35),i=n(94),a="".endsWith;r(r.P+r.F*n(95)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),s=void 0===n?r:Math.min(o(n),r),l=String(e);return a?a.call(t,l,s):t.slice(s-l.length,s)===l}})},function(e,t,n){var r=n(8),o=n(26),i=n(2)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){n(166),e.exports=n(7).String.startsWith},function(e,t,n){"use strict";var r=n(18),o=n(35),i=n(94),a="".startsWith;r(r.P+r.F*n(95)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){n(56),n(83),n(86),n(168),e.exports=n(7).Map},function(e,t,n){"use strict";var r=n(169),o=n(96);e.exports=n(170)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(16).f,o=n(63),i=n(70),a=n(24),s=n(68),l=n(69),c=n(62),u=n(88),p=n(91),f=n(17),d=n(72).fastKey,h=n(96),m=f?"_s":"size",g=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var u=e(function(e,r){s(e,u,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,null!=r&&l(r,n,e[c],e)});return i(u.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=h(this,t),r=g(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(h(this,t),e)}}),f&&r(u.prototype,"size",{get:function(){return h(this,t)[m]}}),u},def:function(e,t,n){var r,o,i=g(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:g,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?u(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,u(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){"use strict";var r=n(5),o=n(18),i=n(21),a=n(70),s=n(72),l=n(69),c=n(68),u=n(8),p=n(27),f=n(92),d=n(36),h=n(171);e.exports=function(e,t,n,m,g,y){var v=r[e],b=v,w=g?"set":"add",x=b&&b.prototype,k={},E=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(y&&!u(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(y&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!u(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(y||x.forEach&&!p(function(){(new b).entries().next()}))){var S=new b,_=S[w](y?{}:-0,1)!=S,O=p(function(){S.has(1)}),C=f(function(e){new b(e)}),T=!y&&p(function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)});C||((b=t(function(t,n){c(t,b,e);var r=h(new v,t,b);return null!=n&&l(n,g,r[w],r),r})).prototype=x,x.constructor=b),(O||T)&&(E("delete"),E("has"),g&&E("get")),(T||_)&&E(w),y&&x.clear&&delete x.clear}else b=m.getConstructor(t,e,g,w),a(b.prototype,n),s.NEED=!0;return d(b,e),k[e]=b,o(o.G+o.W+o.F*(b!=v),k),y||m.setStrong(b,e,g),b}},function(e,t,n){var r=n(8),o=n(172).set;e.exports=function(e,t,n){var i,a=t.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(e,i),e}},function(e,t,n){var r=n(8),o=n(14),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(24)(Function.call,n(97).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){n(174),n(56),e.exports=n(7).Symbol},function(e,t,n){"use strict";var r=n(5),o=n(23),i=n(17),a=n(18),s=n(21),l=n(72).KEY,c=n(27),u=n(58),p=n(36),f=n(32),d=n(2),h=n(98),m=n(175),g=n(176),y=n(93),v=n(14),b=n(8),w=n(28),x=n(60),k=n(42),E=n(63),S=n(177),_=n(97),O=n(16),C=n(34),T=_.f,j=O.f,A=S.f,I=r.Symbol,P=r.JSON,R=P&&P.stringify,N=d("_hidden"),L=d("toPrimitive"),M={}.propertyIsEnumerable,D=u("symbol-registry"),F=u("symbols"),U=u("op-symbols"),B=Object.prototype,z="function"==typeof I,$=r.QObject,W=!$||!$.prototype||!$.prototype.findChild,q=i&&c(function(){return 7!=E(j({},"a",{get:function(){return j(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=T(B,t);r&&delete B[t],j(e,t,n),r&&e!==B&&j(B,t,r)}:j,H=function(e){var t=F[e]=E(I.prototype);return t._k=e,t},Y=z&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},V=function(e,t,n){return e===B&&V(U,t,n),v(e),t=x(t,!0),v(n),o(F,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=E(n,{enumerable:k(0,!1)})):(o(e,N)||j(e,N,k(1,{})),e[N][t]=!0),q(e,t,n)):j(e,t,n)},Q=function(e,t){v(e);for(var n,r=g(t=w(t)),o=0,i=r.length;i>o;)V(e,n=r[o++],t[n]);return e},G=function(e){var t=M.call(this,e=x(e,!0));return!(this===B&&o(F,e)&&!o(U,e))&&(!(t||!o(this,e)||!o(F,e)||o(this,N)&&this[N][e])||t)},X=function(e,t){if(e=w(e),t=x(t,!0),e!==B||!o(F,t)||o(U,t)){var n=T(e,t);return!n||!o(F,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},K=function(e){for(var t,n=A(w(e)),r=[],i=0;n.length>i;)o(F,t=n[i++])||t==N||t==l||r.push(t);return r},J=function(e){for(var t,n=e===B,r=A(n?U:w(e)),i=[],a=0;r.length>a;)!o(F,t=r[a++])||n&&!o(B,t)||i.push(F[t]);return i};z||(s((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(U,n),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),q(this,e,k(1,n))};return i&&W&&q(B,e,{configurable:!0,set:t}),H(e)}).prototype,"toString",function(){return this._k}),_.f=X,O.f=V,n(99).f=S.f=K,n(45).f=G,n(71).f=J,i&&!n(31)&&s(B,"propertyIsEnumerable",G,!0),h.f=function(e){return H(d(e))}),a(a.G+a.W+a.F*!z,{Symbol:I});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Z.length>ee;)d(Z[ee++]);for(var te=C(d.store),ne=0;te.length>ne;)m(te[ne++]);a(a.S+a.F*!z,"Symbol",{for:function(e){return o(D,e+="")?D[e]:D[e]=I(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in D)if(D[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!z,"Object",{create:function(e,t){return void 0===t?E(e):Q(E(e),t)},defineProperty:V,defineProperties:Q,getOwnPropertyDescriptor:X,getOwnPropertyNames:K,getOwnPropertySymbols:J}),P&&a(a.S+a.F*(!z||c(function(){var e=I();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!Y(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,R.apply(P,r)}}),I.prototype[L]||n(22)(I.prototype,L,I.prototype.valueOf),p(I,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t,n){var r=n(5),o=n(7),i=n(31),a=n(98),s=n(16).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(34),o=n(71),i=n(45);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),l=i.f,c=0;s.length>c;)l.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var r=n(28),o=n(99).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){"use strict"; /** @license React v16.6.1 * react.production.min.js * diff --git a/pkg/routes/api/v1/user_add_update.go b/pkg/routes/api/v1/user_add_update.go index 88b2b121..291019e9 100644 --- a/pkg/routes/api/v1/user_add_update.go +++ b/pkg/routes/api/v1/user_add_update.go @@ -53,7 +53,7 @@ func RegisterUser(c echo.Context) error { } // Add its namespace - newN := &models.Namespace{Name: newUser.Username, Description: newUser.Username + "'s namespace.", Owner: newUser} + newN := &models.Namespace{Title: newUser.Username, Description: newUser.Username + "'s namespace.", Owner: newUser} err = newN.Create(newUser) if err != nil { return handler.HandleHTTPError(err, c) diff --git a/pkg/routes/caldav/listStorageProvider.go b/pkg/routes/caldav/listStorageProvider.go index 394009da..d030c00a 100644 --- a/pkg/routes/caldav/listStorageProvider.go +++ b/pkg/routes/caldav/listStorageProvider.go @@ -137,7 +137,7 @@ func (vcls *VikunjaCaldavListStorage) GetResourcesByList(rpaths []string) ([]dat task: t, } r := data.NewResource(getTaskURL(t), &rr) - r.Name = t.Text + r.Name = t.Title resources = append(resources, r) } @@ -159,7 +159,7 @@ func (vcls *VikunjaCaldavListStorage) GetResourcesByFilters(rpath string, filter isCollection: false, } r := data.NewResource(getTaskURL(t), &rr) - r.Name = t.Text + r.Name = t.Title resources = append(resources, r) } return resources, nil diff --git a/pkg/routes/caldav/parsing.go b/pkg/routes/caldav/parsing.go index 886d6c4f..4108dbb4 100644 --- a/pkg/routes/caldav/parsing.go +++ b/pkg/routes/caldav/parsing.go @@ -37,7 +37,7 @@ func getCaldavTodosForTasks(list *models.List) string { caldavtodos = append(caldavtodos, &caldav.Todo{ Timestamp: t.Updated, UID: t.UID, - Summary: t.Text, + Summary: t.Title, Description: t.Description, Completed: t.DoneAt, // Organizer: &t.CreatedBy, // Disabled until we figure out how this works @@ -91,7 +91,7 @@ func parseTaskFromVTODO(content string) (vTask *models.Task, err error) { vTask = &models.Task{ UID: task["UID"], - Text: task["SUMMARY"], + Title: task["SUMMARY"], Description: task["DESCRIPTION"], Priority: priority, DueDate: caldavTimeToTimestamp(task["DUE"]),