From 20dd6fd67dc18c9604ad3e6a4e230061ac321730 Mon Sep 17 00:00:00 2001 From: vjeantet Date: Thu, 10 Sep 2020 21:29:59 +0200 Subject: netlify cms support --- exampleSite/config-template.toml | 25 +- exampleSite/config.toml | 22 +- exampleSite/content/_layout/netlifycms/_index.md | 4 + exampleSite/content/_layout/netlifycms/config.md | 10 + exampleSite/content/_layout/netlifycms/root.md | 20 + .../examples/page without next page/_index.md | 2 +- exampleSite/static/admin/config.yml | 40 -- exampleSite/static/admin/index.html | 17 - exampleSite/static/admin/shortcode/alert.js | 44 -- exampleSite/static/admin/shortcode/button.js | 45 -- exampleSite/static/admin/shortcode/expand.js | 33 -- exampleSite/static/admin/shortcode/panel.js | 49 -- layouts/_default/single.netlifyyaml.yml | 48 ++ layouts/partials/body-article-sidepage.html | 2 +- layouts/shortcodes/static.html | 5 + static/admin/shortcode/alert.js | 44 ++ static/admin/shortcode/button.js | 45 ++ static/admin/shortcode/expand.js | 33 ++ static/admin/shortcode/panel.js | 49 ++ .../vendor/netlify-cms/2.10.56-dist/netlify-cms.js | 600 +++++++++++++++++++++ 20 files changed, 905 insertions(+), 232 deletions(-) create mode 100644 exampleSite/content/_layout/netlifycms/_index.md create mode 100644 exampleSite/content/_layout/netlifycms/config.md create mode 100644 exampleSite/content/_layout/netlifycms/root.md delete mode 100644 exampleSite/static/admin/config.yml delete mode 100644 exampleSite/static/admin/index.html delete mode 100644 exampleSite/static/admin/shortcode/alert.js delete mode 100644 exampleSite/static/admin/shortcode/button.js delete mode 100644 exampleSite/static/admin/shortcode/expand.js delete mode 100644 exampleSite/static/admin/shortcode/panel.js create mode 100644 layouts/_default/single.netlifyyaml.yml create mode 100644 layouts/shortcodes/static.html create mode 100644 static/admin/shortcode/alert.js create mode 100644 static/admin/shortcode/button.js create mode 100644 static/admin/shortcode/expand.js create mode 100644 static/admin/shortcode/panel.js create mode 100644 static/vendor/netlify-cms/2.10.56-dist/netlify-cms.js diff --git a/exampleSite/config-template.toml b/exampleSite/config-template.toml index 5ec5a61..60f11be 100644 --- a/exampleSite/config-template.toml +++ b/exampleSite/config-template.toml @@ -27,9 +27,32 @@ disableSearch = false # default is false disableNavChevron = false # set true to hide next/prev chevron, default is false menushortcutsnewtab = false # set true to open shortcuts links to a new tab/window -editURL = "https://github.com/vjeantet/hugo-theme-docport/edit/master/exampleSite/content/" +#editURL = "https://github.com/vjeantet/hugo-theme-docport/edit/master/exampleSite/content/" enableGitInfo = true +# NetlifyCMS Options +#editWithNetlifyCMSURL = "admin/#/collections/pages/entries/" +#netlifycms_backend_name = "github" +#netlifycms_backend_repo = "vjeantet/hugo-theme-docport" +#netlifycms_backend_branch = "master" +#netlifycms_backend_open_authoring = true +#netlifycms_backend_authtype = " implicit" +#netlifycms_backend_api_id = "L4M2L3K4ML23K4ML3K42LK342L3M4K23MLK42L3MK4" +#netlifycms_backend_api_root = " https://xxxxxxxxxx/api/v4" +#netlifycms_backend_base_url = "https://xxxxxxxxxxxxx" +#netlifycms_backend_auth_endpoint = "oauth/authorize" + +[mediaTypes] + [mediaTypes."application/netlifyconfig"] + suffixes = ["yml"] + +[outputFormats] +[outputFormats.netlifyyaml] +mediaType = "application/netlifyconfig" +isPlainText = true +isHTML = false +notAlternative = true + [markup.goldmark.renderer] unsafe = true diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a0567a3..669853e 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -33,9 +33,29 @@ disableNavChevron = false # set true to hide next/prev chevron, default is false menushortcutsnewtab = false # set true to open shortcuts links to a new tab/window #editURL = "https://github.com/vjeantet/hugo-theme-docport/edit/master/exampleSite/content/" -editWithNetlifyCMSURL = "https://docport.netlify.app/admin/#/collections/pages/entries/" +editWithNetlifyCMSURL = "admin/#/collections/pages/entries/" enableGitInfo = true +netlifycms_backend_name = "github" +netlifycms_backend_repo = "vjeantet/hugo-theme-docport" +netlifycms_backend_branch = "master" +netlifycms_backend_open_authoring = true +#netlifycms_backend_authtype = " implicit" +#netlifycms_backend_api_id = "L4M2L3K4ML23K4ML3K42LK342L3M4K23MLK42L3MK4" +#netlifycms_backend_api_root = " https://xxxxxxxxxx/api/v4" +#netlifycms_backend_base_url = "https://xxxxxxxxxxxxx" +#netlifycms_backend_auth_endpoint = "oauth/authorize" + +[mediaTypes] + [mediaTypes."application/netlifyconfig"] + suffixes = ["yml"] + +[outputFormats] +[outputFormats.netlifyyaml] +mediaType = "application/netlifyconfig" +isPlainText = true +isHTML = false +notAlternative = true [outputs] home = [ "HTML", "RSS", "JSON"] diff --git a/exampleSite/content/_layout/netlifycms/_index.md b/exampleSite/content/_layout/netlifycms/_index.md new file mode 100644 index 0000000..a0b7431 --- /dev/null +++ b/exampleSite/content/_layout/netlifycms/_index.md @@ -0,0 +1,4 @@ +--- + +--- +fake \ No newline at end of file diff --git a/exampleSite/content/_layout/netlifycms/config.md b/exampleSite/content/_layout/netlifycms/config.md new file mode 100644 index 0000000..e344010 --- /dev/null +++ b/exampleSite/content/_layout/netlifycms/config.md @@ -0,0 +1,10 @@ +--- +title: "Netlify config file" +url: /admin/config.yml +outputs: + - netlifyyaml + +netlifycms_content_folder : "exampleSite/content" + +--- + diff --git a/exampleSite/content/_layout/netlifycms/root.md b/exampleSite/content/_layout/netlifycms/root.md new file mode 100644 index 0000000..c12b7cb --- /dev/null +++ b/exampleSite/content/_layout/netlifycms/root.md @@ -0,0 +1,20 @@ +--- +render: raw +title: Content Manager +url: /admin/index.html +--- + + + + + + + + + + + + + + + diff --git a/exampleSite/content/examples/page without next page/_index.md b/exampleSite/content/examples/page without next page/_index.md index 165b946..563406e 100644 --- a/exampleSite/content/examples/page without next page/_index.md +++ b/exampleSite/content/examples/page without next page/_index.md @@ -22,7 +22,7 @@ hide: nextpage ## Chapter 2 -[Click here to GOTO to the next example]({{%relref "page without any"%}}) +[Click here to GOTO to the next example]({{%relref "page-without-any"%}}) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, diff --git a/exampleSite/static/admin/config.yml b/exampleSite/static/admin/config.yml deleted file mode 100644 index 4719e46..0000000 --- a/exampleSite/static/admin/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -backend: - name: github - repo: vjeantet/hugo-theme-docport - open_authoring: true -media_folder: static/images/uploads -public_folder: /images/uploads -publish_mode: editorial_workflow -site_url: https://docport.netlify.app -nested: - depth: 100 # max depth to show in the collection tree - summary: '{{title}}' # optional summary for a tree node, defaults to the inferred title field -collections: - - name: 'pages' - label: 'Home' - label_singular: 'Page' - folder: 'exampleSite/content' - create: true - media_folder: '' - public_folder: '' - nested: - depth: 100 # max depth to show in the collection tree - summary: '{{title}}' # how menu is displayed in menu tree - summary: '{{title}}' # how page names are displayed - editor: - preview: true - fields: - - { label: 'Title', name: 'title', widget: 'string', default: '' } - - { label: 'Description', name: 'description', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { label: 'Order', name: 'weight', widget: 'number', default: 10,required: false } - - { label: 'Body', name: 'body', widget: 'markdown' } - - { label: 'Hide page components', name: 'hide', widget: 'select',required: false, multiple: true, hint: 'Choose how to layout your content', options: [{ label: "Header", value: "header" },{ label: "Left menu ", value: "nav" }, { label: "breadcrumb", value: "breadcrumb" }, { label: "right bar with table of content", value: "breadcrumb" }, { label: "Next Page Helper", value: "nextpage" }, { label: "footer", value: "footer" }]} - - { label: 'Force display as a subpage ?', name: 'subpage', widget: 'boolean',required: false, default: false, hint: 'Display this page as subcontent' } - - { label: 'Is Hidden ?', name: 'hidden', widget: 'boolean',required: false, default: false, hint: 'Hide this page from any menu' } - - { label: 'Menu Entry Head', name: 'head', widget: 'string', required: false, hint: 'Display something before menu entry' } - - { label: 'Menu label Prefix', name: 'pre', widget: 'string', required: false, hint: 'Display something before menu label' } - - { label: 'Menu label Suffix', name: 'post', widget: 'string', required: false, hint: 'Display something after menu label' } - - { label: 'Menu - Always open', name: 'alwaysopen', widget: 'boolean', required: false, default: false, hint: 'Open menu by default' } - meta: { path: { widget: string, label: 'Path', index_file: '_index', pattern: ['.*', "Error"] } } - diff --git a/exampleSite/static/admin/index.html b/exampleSite/static/admin/index.html deleted file mode 100644 index bf5704b..0000000 --- a/exampleSite/static/admin/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Content Manager - - - - - - - - - - - \ No newline at end of file diff --git a/exampleSite/static/admin/shortcode/alert.js b/exampleSite/static/admin/shortcode/alert.js deleted file mode 100644 index 2c3a471..0000000 --- a/exampleSite/static/admin/shortcode/alert.js +++ /dev/null @@ -1,44 +0,0 @@ -CMS.registerEditorComponent({ - // Internal id of the component - id: "alert", - // Visible label - label: "Alert", - hint:"", - // Fields the user need to fill out when adding an instance of the component - fields: [ - { - name: 'theme', - label: 'Theme', - widget: 'select', - default:'info', - options: [ - { label: "info", value: "info" }, - { label: "success ", value: "success" }, - { label: "warning", value: "warning" }, - { label: "danger", value: "danger" } - ] - }, - { label: 'Text', name: 'text', widget: 'markdown' } - ], - // Pattern to identify a block as being an instance of this component - pattern: /{{% alert theme="(\w+)" %}}(.*?){{% \/alert %}}/s, - - // Function to extract data elements from the regexp match - fromBlock: function(match) { - return { - theme: match[1], - text: match[2] - }; - }, - // Function to create a text block from an instance of this component - toBlock: function(obj) { - return '{{% alert theme="'+obj.theme+'" %}}'+obj.text+'{{% /alert %}}'; - }, - // Preview output for this component. Can either be a string or a React component - // (component gives better render performance) - toPreview: function(obj) { - return ( - ' alert '+obj.theme+' -- '+obj.text+'' - ); - } -}); \ No newline at end of file diff --git a/exampleSite/static/admin/shortcode/button.js b/exampleSite/static/admin/shortcode/button.js deleted file mode 100644 index 458df1b..0000000 --- a/exampleSite/static/admin/shortcode/button.js +++ /dev/null @@ -1,45 +0,0 @@ -CMS.registerEditorComponent({ - // Internal id of the component - id: "button", - // Visible label - label: "Button", - // Fields the user need to fill out when adding an instance of the component - fields: [ - { - label: 'Theme', - name: 'theme', - widget: 'select', - default:'info', - options: [ - { label: "info", value: "info" }, - { label: "success ", value: "success" }, - { label: "warning", value: "warning" }, - { label: "danger", value: "danger" } - ] - }, - { label: 'Link', name: 'href', widget: 'string' }, - { label: 'Text to display', name: 'label', widget: 'string' } - ], - // Pattern to identify a block as being an instance of this component - pattern: /^{{\< button href="(.*?)" theme="(\w+)" \>}}(.*?){{\< \/button \>}}/s, - - // Function to extract data elements from the regexp match - fromBlock: function(match) { - return { - href: match[1], - theme: match[2], - label: match[3] - }; - }, - // Function to create a text block from an instance of this component - toBlock: function(obj) { - return '{{< button href="'+obj.href+'" theme="'+obj.theme+'" >}}'+obj.label+'{{< /button >}}' - }, - // Preview output for this component. Can either be a string or a React component - // (component gives better render performance) - toPreview: function(obj) { - return ( - ' button['+obj.label+'] --> '+obj.href+'
' - ); - } -}); \ No newline at end of file diff --git a/exampleSite/static/admin/shortcode/expand.js b/exampleSite/static/admin/shortcode/expand.js deleted file mode 100644 index e665254..0000000 --- a/exampleSite/static/admin/shortcode/expand.js +++ /dev/null @@ -1,33 +0,0 @@ -CMS.registerEditorComponent({ - // Internal id of the component - id: "expand", - // Visible label - label: "Expand", - // Fields the user need to fill out when adding an instance of the component - fields: [ - { label: 'Label', name: 'label', default:'Expand me !', widget: 'string' }, - { label: 'Text to expand', name: 'text', widget: 'markdown' } - ], - // Pattern to identify a block as being an instance of this component - pattern: /^{{% expand "(\w+)" %}}(.*?){{% \/expand %}}/s, - - - // Function to extract data elements from the regexp match - fromBlock: function(match) { - return { - label: match[1], - text: match[2] - }; - }, - // Function to create a text block from an instance of this component - toBlock: function(obj) { - return '{{% expand "'+obj.label+'" %}}'+obj.text+'{{% /expand %}}'; - }, - // Preview output for this component. Can either be a string or a React component - // (component gives better render performance) - toPreview: function(obj) { - return ( - ' expand : '+obj.label+' -- '+obj.text+'' - ); - } -}); \ No newline at end of file diff --git a/exampleSite/static/admin/shortcode/panel.js b/exampleSite/static/admin/shortcode/panel.js deleted file mode 100644 index cf63dbe..0000000 --- a/exampleSite/static/admin/shortcode/panel.js +++ /dev/null @@ -1,49 +0,0 @@ -CMS.registerEditorComponent({ - // Internal id of the component - id: "panel", - // Visible label - label: "Panel", - // Fields the user need to fill out when adding an instance of the component - fields: [ - { - name: 'theme', - label: 'Theme', - widget: 'select', - default:'info', - options: [ - { label: "info", value: "info" }, - { label: "success ", value: "success" }, - { label: "warning", value: "warning" }, - { label: "danger", value: "danger" } - ] - }, - { label: 'Header', name: 'header', default:'', widget: 'string' }, - { label: 'Footer', name: 'footer', default:'', widget: 'string' }, - { label: 'Text to expand', name: 'text', widget: 'markdown' } - ], - // Pattern to identify a block as being an instance of this component - // pattern: /^{{% expand "(\w+)" %}}(.*?){{% \/expand %}}/s, - pattern: /^{{% panel theme="(\w+)" header="(\w+)" footer="(\w+)" %}}(.*?){{% \/panel %}}/s, - - - // Function to extract data elements from the regexp match - fromBlock: function(match) { - return { - theme: match[1], - header: match[2], - footer: match[3], - text: match[4] - }; - }, - // Function to create a text block from an instance of this component - toBlock: function(obj) { - return '{{% panel theme="'+obj.theme+'" header="'+obj.header+'" footer="'+obj.footer+'" %}}'+obj.text+'{{% /panel %}}'; - }, - // Preview output for this component. Can either be a string or a React component - // (component gives better render performance) - toPreview: function(obj) { - return ( - ' panel : '+obj.header+' -- '+obj.text+'' - ); - } -}); \ No newline at end of file diff --git a/layouts/_default/single.netlifyyaml.yml b/layouts/_default/single.netlifyyaml.yml new file mode 100644 index 0000000..5ca29a1 --- /dev/null +++ b/layouts/_default/single.netlifyyaml.yml @@ -0,0 +1,48 @@ +media_folder: "static/images/uploads" # Media files will be stored in the repo under images/uploads +public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads +publish_mode: editorial_workflow +backend: + {{if ne nil .Site.Params.netlifycms_backend_name}}name: {{.Site.Params.netlifycms_backend_name}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_repo}} + repo: {{.Site.Params.netlifycms_backend_repo}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_branch}} + branch: {{.Site.Params.netlifycms_backend_branch}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_authtype}} + auth_type: {{.Site.Params.netlifycms_backend_authtype}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_api_id}} + app_id: {{.Site.Params.netlifycms_backend_api_id}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_api_root}} + api_root: {{.Site.Params.netlifycms_backend_api_root}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_base_url}} + base_url: {{.Site.Params.netlifycms_backend_base_url}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_auth_endpoint}} + auth_endpoint: {{.Site.Params.netlifycms_backend_auth_endpoint}}{{end}} + {{- if ne nil .Site.Params.netlifycms_backend_open_authoring}} + open_authoring: {{.Site.Params.netlifycms_backend_open_authoring}}{{end}} + +collections: + - name: "pages" + label: "Pages" + folder: "{{.Params.netlifycms_content_folder}}" + create: true + media_folder: '' + public_folder: '' + editor: + preview: true + nested: { depth: 100 } # accepts an optional summary template + fields: + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Description', name: 'description', widget: 'string' } + - { label: "Publish Date", name: "date", widget: "datetime"} + - { label: 'Order', name: 'weight', widget: 'number', default: 10,required: false } + - { label: "Body", name: "body", widget: "markdown"} + - { label: 'Is Hidden ?', name: 'hidden', widget: 'boolean',required: false, default: false, hint: 'Hide this page from any menu' } + - { label: 'Hide page components', name: 'hide', widget: 'select',required: false, multiple: true, hint: 'Choose how to layout your content', options: [{ label: "Header", value: "header" },{ label: "Left menu ", value: "nav" }, { label: "breadcrumb", value: "breadcrumb" }, { label: "right bar with table of content", value: "breadcrumb" }, { label: "Next Page Helper", value: "nextpage" }, { label: "footer", value: "footer" }]} + - { label: 'Render', name: 'render', widget: 'select',required: false, hint: 'Choose how to layout your content', options: [{ label: "Default (empty value)", value: "" },{ label: "Raw - Full HTML", value: "raw" }]} + - { label: 'Force display as a subpage ?', name: 'subpage', widget: 'boolean',required: false, default: false, hint: 'Display this page as subcontent' } + - { label: 'Menu Entry Head', name: 'head', widget: 'string', required: false, hint: 'Display something before menu entry' } + - { label: 'Menu label Prefix', name: 'pre', widget: 'string', required: false, hint: 'Display something before menu label' } + - { label: 'Menu label Suffix', name: 'post', widget: 'string', required: false, hint: 'Display something after menu label' } + - { label: 'Menu - Always open', name: 'alwaysopen', widget: 'boolean', required: false, default: false, hint: 'Open menu by default' } + - { label: 'Redirection', name: 'redirect', widget: 'string', required: false } + meta: { path: { widget: string, label: 'Path', index_file: '_index', pattern: ['.*', "Error"] } } diff --git a/layouts/partials/body-article-sidepage.html b/layouts/partials/body-article-sidepage.html index d675571..6f2e0f2 100644 --- a/layouts/partials/body-article-sidepage.html +++ b/layouts/partials/body-article-sidepage.html @@ -25,7 +25,7 @@ {{ if .Site.Params.editWithNetlifyCMSURL }}
  • - + {{T "Edit-this-page"}}
  • diff --git a/layouts/shortcodes/static.html b/layouts/shortcodes/static.html new file mode 100644 index 0000000..f73e477 --- /dev/null +++ b/layouts/shortcodes/static.html @@ -0,0 +1,5 @@ +{{- .Scratch.Set "path" (.Get 0) -}} +{{- if hasPrefix (.Scratch.Get "path") "/" -}} + {{- .Scratch.Set "path" (slicestr (.Scratch.Get "path") 1) -}} +{{- end -}} +{{- .Scratch.Get "path" | absLangURL -}} \ No newline at end of file diff --git a/static/admin/shortcode/alert.js b/static/admin/shortcode/alert.js new file mode 100644 index 0000000..2c3a471 --- /dev/null +++ b/static/admin/shortcode/alert.js @@ -0,0 +1,44 @@ +CMS.registerEditorComponent({ + // Internal id of the component + id: "alert", + // Visible label + label: "Alert", + hint:"", + // Fields the user need to fill out when adding an instance of the component + fields: [ + { + name: 'theme', + label: 'Theme', + widget: 'select', + default:'info', + options: [ + { label: "info", value: "info" }, + { label: "success ", value: "success" }, + { label: "warning", value: "warning" }, + { label: "danger", value: "danger" } + ] + }, + { label: 'Text', name: 'text', widget: 'markdown' } + ], + // Pattern to identify a block as being an instance of this component + pattern: /{{% alert theme="(\w+)" %}}(.*?){{% \/alert %}}/s, + + // Function to extract data elements from the regexp match + fromBlock: function(match) { + return { + theme: match[1], + text: match[2] + }; + }, + // Function to create a text block from an instance of this component + toBlock: function(obj) { + return '{{% alert theme="'+obj.theme+'" %}}'+obj.text+'{{% /alert %}}'; + }, + // Preview output for this component. Can either be a string or a React component + // (component gives better render performance) + toPreview: function(obj) { + return ( + ' alert '+obj.theme+' -- '+obj.text+'' + ); + } +}); \ No newline at end of file diff --git a/static/admin/shortcode/button.js b/static/admin/shortcode/button.js new file mode 100644 index 0000000..458df1b --- /dev/null +++ b/static/admin/shortcode/button.js @@ -0,0 +1,45 @@ +CMS.registerEditorComponent({ + // Internal id of the component + id: "button", + // Visible label + label: "Button", + // Fields the user need to fill out when adding an instance of the component + fields: [ + { + label: 'Theme', + name: 'theme', + widget: 'select', + default:'info', + options: [ + { label: "info", value: "info" }, + { label: "success ", value: "success" }, + { label: "warning", value: "warning" }, + { label: "danger", value: "danger" } + ] + }, + { label: 'Link', name: 'href', widget: 'string' }, + { label: 'Text to display', name: 'label', widget: 'string' } + ], + // Pattern to identify a block as being an instance of this component + pattern: /^{{\< button href="(.*?)" theme="(\w+)" \>}}(.*?){{\< \/button \>}}/s, + + // Function to extract data elements from the regexp match + fromBlock: function(match) { + return { + href: match[1], + theme: match[2], + label: match[3] + }; + }, + // Function to create a text block from an instance of this component + toBlock: function(obj) { + return '{{< button href="'+obj.href+'" theme="'+obj.theme+'" >}}'+obj.label+'{{< /button >}}' + }, + // Preview output for this component. Can either be a string or a React component + // (component gives better render performance) + toPreview: function(obj) { + return ( + ' button['+obj.label+'] --> '+obj.href+'
    ' + ); + } +}); \ No newline at end of file diff --git a/static/admin/shortcode/expand.js b/static/admin/shortcode/expand.js new file mode 100644 index 0000000..e665254 --- /dev/null +++ b/static/admin/shortcode/expand.js @@ -0,0 +1,33 @@ +CMS.registerEditorComponent({ + // Internal id of the component + id: "expand", + // Visible label + label: "Expand", + // Fields the user need to fill out when adding an instance of the component + fields: [ + { label: 'Label', name: 'label', default:'Expand me !', widget: 'string' }, + { label: 'Text to expand', name: 'text', widget: 'markdown' } + ], + // Pattern to identify a block as being an instance of this component + pattern: /^{{% expand "(\w+)" %}}(.*?){{% \/expand %}}/s, + + + // Function to extract data elements from the regexp match + fromBlock: function(match) { + return { + label: match[1], + text: match[2] + }; + }, + // Function to create a text block from an instance of this component + toBlock: function(obj) { + return '{{% expand "'+obj.label+'" %}}'+obj.text+'{{% /expand %}}'; + }, + // Preview output for this component. Can either be a string or a React component + // (component gives better render performance) + toPreview: function(obj) { + return ( + ' expand : '+obj.label+' -- '+obj.text+'' + ); + } +}); \ No newline at end of file diff --git a/static/admin/shortcode/panel.js b/static/admin/shortcode/panel.js new file mode 100644 index 0000000..cf63dbe --- /dev/null +++ b/static/admin/shortcode/panel.js @@ -0,0 +1,49 @@ +CMS.registerEditorComponent({ + // Internal id of the component + id: "panel", + // Visible label + label: "Panel", + // Fields the user need to fill out when adding an instance of the component + fields: [ + { + name: 'theme', + label: 'Theme', + widget: 'select', + default:'info', + options: [ + { label: "info", value: "info" }, + { label: "success ", value: "success" }, + { label: "warning", value: "warning" }, + { label: "danger", value: "danger" } + ] + }, + { label: 'Header', name: 'header', default:'', widget: 'string' }, + { label: 'Footer', name: 'footer', default:'', widget: 'string' }, + { label: 'Text to expand', name: 'text', widget: 'markdown' } + ], + // Pattern to identify a block as being an instance of this component + // pattern: /^{{% expand "(\w+)" %}}(.*?){{% \/expand %}}/s, + pattern: /^{{% panel theme="(\w+)" header="(\w+)" footer="(\w+)" %}}(.*?){{% \/panel %}}/s, + + + // Function to extract data elements from the regexp match + fromBlock: function(match) { + return { + theme: match[1], + header: match[2], + footer: match[3], + text: match[4] + }; + }, + // Function to create a text block from an instance of this component + toBlock: function(obj) { + return '{{% panel theme="'+obj.theme+'" header="'+obj.header+'" footer="'+obj.footer+'" %}}'+obj.text+'{{% /panel %}}'; + }, + // Preview output for this component. Can either be a string or a React component + // (component gives better render performance) + toPreview: function(obj) { + return ( + ' panel : '+obj.header+' -- '+obj.text+'' + ); + } +}); \ No newline at end of file diff --git a/static/vendor/netlify-cms/2.10.56-dist/netlify-cms.js b/static/vendor/netlify-cms/2.10.56-dist/netlify-cms.js new file mode 100644 index 0000000..85d0e4e --- /dev/null +++ b/static/vendor/netlify-cms/2.10.56-dist/netlify-cms.js @@ -0,0 +1,600 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("NetlifyCms",[],t):"object"==typeof exports?exports.NetlifyCms=t():e.NetlifyCms=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1681)}([function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return j})),n.d(t,"c",(function(){return z})),n.d(t,"d",(function(){return I})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return F})),n.d(t,"g",(function(){return E})),n.d(t,"h",(function(){return r})),n.d(t,"i",(function(){return a})),n.d(t,"j",(function(){return i})),n.d(t,"k",(function(){return T})),n.d(t,"l",(function(){return s})),n.d(t,"m",(function(){return B})),n.d(t,"n",(function(){return N})),n.d(t,"o",(function(){return y})),n.d(t,"p",(function(){return D})),n.d(t,"q",(function(){return l})),n.d(t,"r",(function(){return g})),n.d(t,"s",(function(){return v})),n.d(t,"t",(function(){return u})),n.d(t,"u",(function(){return C})),n.d(t,"v",(function(){return L})),n.d(t,"w",(function(){return h})),n.d(t,"x",(function(){return b})),n.d(t,"y",(function(){return m}));var S={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},O={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"},T="tag:yaml.org,2002:",C={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"};function A(e){for(var t=[0],n=e.indexOf("\n");-1!==n;)n+=1,t.push(n),n=e.indexOf("\n",n);return t}function P(e){var t,n;return"string"==typeof e?(t=A(e),n=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||(e.lineStarts=A(e.context.src)),t=e.lineStarts,n=e.context.src)),{lineStarts:t,src:n}}function R(e,t){if("number"!=typeof e||e<0)return null;var n=P(t),r=n.lineStarts,i=n.src;if(!r||!i||e>i.length)return null;for(var o=0;o=1)||e>r.length)return null;for(var o=r[e-1],a=r[e];a&&a>o&&"\n"===i[a-1];)--a;return i.slice(o,a)}var I=function(){function e(t,n){i(this,e),this.start=t,this.end=n||t}return a(e,null,[{key:"copy",value:function(t){return new e(t.start,t.end)}}]),a(e,[{key:"isEmpty",value:function(){return"number"!=typeof this.start||!this.end||this.end<=this.start}},{key:"setOrigRange",value:function(e,t){var n=this.start,r=this.end;if(0===e.length||r<=e[0])return this.origStart=n,this.origEnd=r,t;for(var i=t;in);)++i;this.origStart=n+i;for(var o=i;i=r);)++i;return this.origEnd=r+i,o}}]),e}(),j=function(){function e(t,n,r){i(this,e),Object.defineProperty(this,"context",{value:r||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=n||[],this.type=t,this.value=null}return a(e,null,[{key:"addStringTerminator",value:function(t,n,r){if("\n"===r[r.length-1])return r;var i=e.endOfWhiteSpace(t,n);return i>=t.length||"\n"===t[i]?r+"\n":r}},{key:"atDocumentBoundary",value:function(e,t,n){var r=e[t];if(!r)return!0;var i=e[t-1];if(i&&"\n"!==i)return!1;if(n){if(r!==n)return!1}else if(r!==S.DIRECTIVES_END&&r!==S.DOCUMENT_END)return!1;var o=e[t+1],a=e[t+2];if(o!==r||a!==r)return!1;var s=e[t+3];return!s||"\n"===s||"\t"===s||" "===s}},{key:"endOfIdentifier",value:function(e,t){for(var n=e[t],r="<"===n,i=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];n&&-1===i.indexOf(n);)n=e[t+=1];return r&&">"===n&&(t+=1),t}},{key:"endOfIndent",value:function(e,t){for(var n=e[t];" "===n;)n=e[t+=1];return t}},{key:"endOfLine",value:function(e,t){for(var n=e[t];n&&"\n"!==n;)n=e[t+=1];return t}},{key:"endOfWhiteSpace",value:function(e,t){for(var n=e[t];"\t"===n||" "===n;)n=e[t+=1];return t}},{key:"startOfLine",value:function(e,t){var n=e[t-1];if("\n"===n)return t;for(;n&&"\n"!==n;)n=e[t-=1];return t+1}},{key:"endOfBlockIndent",value:function(t,n,r){var i=e.endOfIndent(t,r);if(i>r+n)return i;var o=e.endOfWhiteSpace(t,i),a=t[o];return a&&"\n"!==a?null:o}},{key:"atBlank",value:function(e,t,n){var r=e[t];return"\n"===r||"\t"===r||" "===r||n&&!r}},{key:"nextNodeIsIndented",value:function(e,t,n){return!(!e||t<0)&&(t>0||n&&"-"===e)}},{key:"normalizeOffset",value:function(t,n){var r=t[n];return r?"\n"!==r&&"\n"===t[n-1]?n-1:e.endOfWhiteSpace(t,n):n}},{key:"foldNewline",value:function(t,n,r){for(var i=0,o=!1,a="",s=t[n+1];" "===s||"\t"===s||"\n"===s;){switch(s){case"\n":i=0,n+=1,a+="\n";break;case"\t":i<=r&&(o=!0),n=e.endOfWhiteSpace(t,n+2)-1;break;case" ":i+=1,n+=1}s=t[n+1]}return a||(a=" "),s&&i<=r&&(o=!0),{fold:a,offset:n,error:o}}}]),a(e,[{key:"getPropValue",value:function(e,t,n){if(!this.context)return null;var r=this.context.src,i=this.props[e];return i&&r[i.start]===t?r.slice(i.start+(n?1:0),i.end):null}},{key:"commentHasRequiredWhitespace",value:function(t){var n=this.context.src;if(this.header&&t===this.header.end)return!1;if(!this.valueRange)return!1;var r=this.valueRange.end;return t!==r||e.atBlank(n,r-1)}},{key:"parseComment",value:function(t){var n=this.context.src;if(n[t]===S.COMMENT){var r=e.endOfLine(n,t+1),i=new I(t,r);return this.props.push(i),r}return t}},{key:"setOrigRanges",value:function(e,t){return this.range&&(t=this.range.setOrigRange(e,t)),this.valueRange&&this.valueRange.setOrigRange(e,t),this.props.forEach((function(n){return n.setOrigRange(e,t)})),t}},{key:"toString",value:function(){var t=this.context.src,n=this.range,r=this.value;if(null!=r)return r;var i=t.slice(n.start,n.end);return e.addStringTerminator(t,n.end,i)}},{key:"anchor",get:function(){for(var e=0;e0?e.join("\n"):null}},{key:"hasComment",get:function(){if(this.context)for(var e=this.context.src,t=0;t2&&void 0!==arguments[2]?arguments[2]:80,o=M(n.line,t);if(!o)return null;var a=n.col;if(o.length>i)if(a<=i-10)o=o.substr(0,i-1)+"…";else{var s=Math.round(i/2);o.length>a+s&&(o=o.substr(0,a+s-1)+"…"),a-=o.length-i,o="…"+o.substr(1-i)}var l=1,u="";r&&(r.line===n.line&&a+(r.col-n.col)<=i+1?l=r.col-n.col:(l=Math.min(o.length+1,i)-a,u="…"));var c=a>1?" ".repeat(a-1):"",d="^".repeat(l);return"".concat(o,"\n").concat(c).concat(d).concat(u)}(this.linePos,e);a&&(this.message+=":\n\n".concat(a,"\n"))}delete this.source}}}]),n}(p(Error)),L=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLReferenceError",e,r)}return n}(D),N=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLSemanticError",e,r)}return n}(D),F=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLSyntaxError",e,r)}return n}(D),B=function(e){l(n,e);var t=g(n);function n(e,r){return i(this,n),t.call(this,"YAMLWarning",e,r)}return n}(D),z=function(e){l(n,e);var t=g(n);function n(){return i(this,n),t.apply(this,arguments)}return a(n,[{key:"parseBlockValue",value:function(e){for(var t=this.context,r=t.indent,i=t.inFlow,o=t.src,a=e,s=e,l=o[a];"\n"===l&&!j.atDocumentBoundary(o,a+1);l=o[a]){var u=j.endOfBlockIndent(o,r,a+1);if(null===u||"#"===o[u])break;a="\n"===o[u]?u:s=n.endOfLine(o,u,i)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=s,s}},{key:"parse",value:function(e,t){this.context=e;var r=e.inFlow,i=e.src,o=t,a=i[o];return a&&"#"!==a&&"\n"!==a&&(o=n.endOfLine(i,t,r)),this.valueRange=new I(t,o),o=j.endOfWhiteSpace(i,o),o=this.parseComment(o),this.hasComment&&!this.valueRange.isEmpty()||(o=this.parseBlockValue(o)),o}},{key:"strValue",get:function(){if(!this.valueRange||!this.context)return null;for(var e=this.valueRange,t=e.start,n=e.end,r=this.context.src,i=r[n-1];tu?r.slice(u,a+1):s)}else o+=s}var d=r[t];switch(d){case"\t":return{errors:[new N(this,"Plain value cannot start with a tab character")],str:o};case"@":case"`":var f="Plain value cannot start with reserved character ".concat(d);return{errors:[new N(this,f)],str:o};default:return o}}}],[{key:"endOfLine",value:function(e,t,n){for(var r=e[t],i=t;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){var o=e[i+1];if(":"===r&&(!o||"\n"===o||"\t"===o||" "===o||n&&","===o))break;if((" "===r||"\t"===r)&&"#"===o)break;i+=1,r=o}return i}}]),n}(j)},function(e,t,n){"use strict";e.exports=n(684)},function(e,t,n){e.exports=n(692)()},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return f})),n.d(t,"i",(function(){return p})),n.d(t,"j",(function(){return h})),n.d(t,"k",(function(){return m})),n.d(t,"l",(function(){return g})),n.d(t,"m",(function(){return v})),n.d(t,"n",(function(){return y})),n.d(t,"o",(function(){return b})),n.d(t,"p",(function(){return _})),n.d(t,"q",(function(){return w})),n.d(t,"r",(function(){return x})),n.d(t,"s",(function(){return E})),n.d(t,"t",(function(){return O})),n.d(t,"u",(function(){return T})),n.d(t,"v",(function(){return C})),n.d(t,"w",(function(){return A})),n.d(t,"x",(function(){return P})),n.d(t,"y",(function(){return R})),n.d(t,"z",(function(){return M})),n.d(t,"A",(function(){return I})),n.d(t,"B",(function(){return j})),n.d(t,"C",(function(){return D})),n.d(t,"D",(function(){return L})),n.d(t,"E",(function(){return N})),n.d(t,"F",(function(){return F})),n.d(t,"H",(function(){return B})),n.d(t,"I",(function(){return z})),n.d(t,"J",(function(){return U})),n.d(t,"G",(function(){return q})),n.d(t,"a",(function(){return H}));var r=n(27),i=n(176),o=n(55);function a(e){for(var t=h(),n=0,r=e.length;ni&&(u|=o.a.RIGHT),la&&(u|=o.a.ABOVE),u===o.a.UNKNOWN&&(u=o.a.INTERSECTING),u}function h(){return[1/0,1/0,-1/0,-1/0]}function m(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function g(e){return m(1/0,1/0,-1/0,-1/0,e)}function v(e,t){var n=e[0],r=e[1];return m(n,r,n,r,t)}function y(e,t){return k(g(t),e)}function b(e,t,n,r,i){return E(g(i),e,t,n,r)}function _(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function w(e,t){return t[0]e[2]&&(e[2]=t[2]),t[1]e[3]&&(e[3]=t[3]),e}function x(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function k(e,t){for(var n=0,r=t.length;nt[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function B(e){return e[2]=u&&s<=d),r||!(a&o.a.RIGHT)||i&o.a.RIGHT||(r=(l=v-(g-d)*y)>=c&&l<=f),r||!(a&o.a.BELOW)||i&o.a.BELOW||(r=(s=g-(v-c)/y)>=u&&s<=d),r||!(a&o.a.LEFT)||i&o.a.LEFT||(r=(l=v-(g-u)*y)>=c&&l<=f)}return r}function H(e,t,n){var r=[e[0],e[1],e[0],e[3],e[2],e[1],e[2],e[3]];return t(r,r,2),function(e,t,n){return m(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}([r[0],r[2],r[4],r[6]],[r[1],r[3],r[5],r[7]],n)}},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:q(e)}function r(e){return s(e)?e:H(e)}function i(e){return l(e)?e:W(e)}function o(e){return a(e)&&!u(e)?e:V(e)}function a(e){return!(!e||!e[d])}function s(e){return!(!e||!e[f])}function l(e){return!(!e||!e[p])}function u(e){return s(e)||l(e)}function c(e){return!(!e||!e[h])}t(r,n),t(i,n),t(o,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=l,n.isAssociative=u,n.isOrdered=c,n.Keyed=r,n.Indexed=i,n.Set=o;var d="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",h="@@__IMMUTABLE_ORDERED__@@",m={},g={value:!1},v={value:!1};function y(e){return e.value=!1,e}function b(e){e&&(e.value=!0)}function _(){}function w(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?x(e)+t:t}function E(){return!0}function S(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function O(e,t){return C(e,t,0)}function T(e,t){return C(e,t,t)}function C(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var A,P,R,M="function"==typeof Symbol&&Symbol.iterator,I=M||"@@iterator";function j(e){this.next=e}function D(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function L(){return{value:void 0,done:!0}}function N(e){return!!z(e)}function F(e){return e&&"function"==typeof e.next}function B(e){var t=z(e);return t&&t.call(e)}function z(e){var t=e&&(M&&e[M]||e["@@iterator"]);if("function"==typeof t)return t}function U(e){return e&&"number"==typeof e.length}function q(e){return null==e?X():a(e)?e.toSeq():function(e){var t=ee(e)||"object"==typeof e&&new G(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function H(e){return null==e?X().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():J(e)}function W(e){return null==e?X():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():Z(e)}function V(e){return(null==e?X():a(e)?s(e)?e.entrySeq():e:Z(e)).toSetSeq()}function $(e){this._array=e,this.size=e.length}function G(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function K(e){this._iterable=e,this.size=e.length||e.size}function Y(e){this._iterator=e,this._iteratorCache=[]}function Q(e){return!(!e||!e["@@__IMMUTABLE_SEQ__@@"])}function X(){return A||(A=new $([]))}function J(e){var t=Array.isArray(e)?new $(e).fromEntrySeq():F(e)?new Y(e).fromEntrySeq():N(e)?new K(e).fromEntrySeq():"object"==typeof e?new G(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function Z(e){var t=ee(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ee(e){return U(e)?new $(e):F(e)?new Y(e):N(e)?new K(e):void 0}function te(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ne(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new j((function(){var e=i[n?o-a:a];return a++>o?{value:void 0,done:!0}:D(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function re(e,t){return t?function e(t,n,r,i){return Array.isArray(n)?t.call(i,r,W(n).map((function(r,i){return e(t,r,i,n)}))):oe(n)?t.call(i,r,H(n).map((function(r,i){return e(t,r,i,n)}))):n}(t,e,"",{"":e}):ie(e)}function ie(e){return Array.isArray(e)?W(e).map(ie).toList():oe(e)?H(e).map(ie).toMap():e}function oe(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ae(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function se(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||l(e)!==l(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(c(e)){var r=e.entries();return t.every((function(e,t){var i=r.next().value;return i&&ae(i[1],e)&&(n||ae(i[0],t))}))&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var d=!0,f=t.__iterate((function(t,r){if(n?!e.has(t):i?!ae(t,e.get(r,m)):!ae(e.get(r,m),t))return d=!1,!1}));return d&&e.size===f}function le(e,t){if(!(this instanceof le))return new le(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(P)return P;P=this}}function ue(e,t){if(!e)throw new Error(t)}function ce(e,t,n){if(!(this instanceof ce))return new ce(e,t,n);if(ue(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?{value:void 0,done:!0}:D(e,i,n[t?r-i++:i++])}))},t(G,H),G.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},G.prototype.has=function(e){return this._object.hasOwnProperty(e)},G.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},G.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new j((function(){var a=r[t?i-o:o];return o++>i?{value:void 0,done:!0}:D(e,a,n[a])}))},G.prototype[h]=!0,t(K,W),K.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=B(this._iterable),r=0;if(F(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},K.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=B(this._iterable);if(!F(n))return new j(L);var r=0;return new j((function(){var t=n.next();return t.done?t:D(e,r++,t.value)}))},t(Y,W),Y.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return D(e,i,r[i++])}))},t(le,W),le.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},le.prototype.get=function(e,t){return this.has(e)?this._value:t},le.prototype.includes=function(e){return ae(this._value,e)},le.prototype.slice=function(e,t){var n=this.size;return S(e,t,n)?this:new le(this._value,T(t,n)-O(e,n))},le.prototype.reverse=function(){return this},le.prototype.indexOf=function(e){return ae(this._value,e)?0:-1},le.prototype.lastIndexOf=function(e){return ae(this._value,e)?this.size:-1},le.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?{value:void 0,done:!0}:D(e,o++,a)}))},ce.prototype.equals=function(e){return e instanceof ce?this._start===e._start&&this._end===e._end&&this._step===e._step:se(this,e)},t(de,n),t(fe,de),t(pe,de),t(he,de),de.Keyed=fe,de.Indexed=pe,de.Set=he;var me="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ge(e){return e>>>1&1073741824|3221225471&e}function ve(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ge(n)}if("string"===t)return e.length>Se?function(e){var t=Ce[e];return void 0===t&&(t=ye(e),Te===Oe&&(Te=0,Ce={}),Te++,Ce[e]=t),t}(e):ye(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(xe&&void 0!==(t=be.get(e)))return t;if(void 0!==(t=e[Ee]))return t;if(!we){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ee]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++ke,1073741824&ke&&(ke=0),xe)be.set(e,t);else{if(void 0!==_e&&!1===_e(e))throw new Error("Non-extensible objects are not allowed as keys.");if(we)Object.defineProperty(e,Ee,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ee]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ee]=t}}return t}(e);if("function"==typeof e.toString)return ye(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ye(e){for(var t=0,n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Pe.prototype.toString=function(){return this.__toString("Map {","}")},Pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Pe.prototype.set=function(e,t){return Ve(this,e,t)},Pe.prototype.setIn=function(e,t){return this.updateIn(e,m,(function(){return t}))},Pe.prototype.remove=function(e){return Ve(this,e,m)},Pe.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return m}))},Pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,i){var o=t===m,a=n.next();if(a.done){var s=o?r:t,l=i(s);return l===s?t:l}ue(o||t&&t.set,"invalid keyPath");var u=a.value,c=o?m:t.get(u,m),d=e(c,n,r,i);return d===c?t:d===m?t.remove(u):(o?We():t).set(u,d)}(this,Yt(e),t,n);return r===m?void 0:r},Pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):We()},Pe.prototype.merge=function(){return Ye(this,void 0,arguments)},Pe.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ye(this,t,n)},Pe.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,We(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Pe.prototype.mergeDeep=function(){return Ye(this,Qe,arguments)},Pe.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ye(this,Xe(t),n)},Pe.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,We(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Pe.prototype.sort=function(e){return wt(Ft(this,e))},Pe.prototype.sortBy=function(e,t){return wt(Ft(this,t,e))},Pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},Pe.prototype.asImmutable=function(){return this.__ensureOwner()},Pe.prototype.wasAltered=function(){return this.__altered},Pe.prototype.__iterator=function(e,t){return new ze(this,e,t)},Pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?He(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Pe.isMap=Re;var Me,Ie="@@__IMMUTABLE_MAP__@@",je=Pe.prototype;function De(e,t){this.ownerID=e,this.entries=t}function Le(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Ne(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Fe(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Be(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ze(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&qe(e._root)}function Ue(e,t){return D(e,t[0],t[1])}function qe(e,t){return{node:e,index:0,__prev:t}}function He(e,t,n,r){var i=Object.create(je);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function We(){return Me||(Me=He(0))}function Ve(e,t,n){var r,i;if(e._root){var o=y(g),a=y(v);if(r=$e(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===m?-1:1:0)}else{if(n===m)return e;i=1,r=new De(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?He(i,r):We()}function $e(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===m?e:(b(s),b(a),new Be(t,r,[i,o]))}function Ge(e){return e.constructor===Be||e.constructor===Fe}function Ke(e,t,n,r,i){if(e.keyHash===r)return new Fe(t,r,[e.entry,i]);var o,a=31&(0===n?e.keyHash:e.keyHash>>>n),s=31&(0===n?r:r>>>n);return new Le(t,1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function et(e,t,n,r){var i=r?e:w(e);return i[t]=n,i}je[Ie]=!0,je.delete=je.remove,je.removeIn=je.deleteIn,De.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=tt)return function(e,t,n,r){e||(e=new _);for(var i=new Be(e,ve(n),[n,r]),o=0;o>>e)),o=this.bitmap;return 0==(o&i)?r:this.nodes[Ze(o&i-1)].get(e+5,t,n,r)},Le.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=ve(r));var s=31&(0===t?n:n>>>t),l=1<=nt)return function(e,t,n,r,i){for(var o=0,a=new Array(32),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new Ne(e,o+1,a)}(e,f,u,s,h);if(c&&!h&&2===f.length&&Ge(f[1^d]))return f[1^d];if(c&&h&&1===f.length&&Ge(h))return h;var g=e&&e===this.ownerID,v=c?h?u:u^l:u|l,y=c?h?et(f,d,h,g):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a>>e),o=this.nodes[i];return o?o.get(e+5,t,n,r):r},Ne.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=ve(r));var s=31&(0===t?n:n>>>t),l=i===m,u=this.nodes,c=u[s];if(l&&!c)return this;var d=$e(c,e,t+5,n,r,i,o,a);if(d===c)return this;var f=this.count;if(c){if(!d&&--f0&&r<32?pt(0,r,5,null,new lt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function ot(e){return!(!e||!e[at])}t(it,pe),it.of=function(){return this(arguments)},it.prototype.toString=function(){return this.__toString("List [","]")},it.prototype.get=function(e,t){if((e=k(this,e))>=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?yt(e,t).set(0,n):yt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,i=e._root,o=y(v);return t>=_t(e._capacity)?r=mt(r,e.__ownerID,0,t,n,o):i=mt(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):pt(e._origin,e._capacity,e._level,i,r):e}(this,e,t)},it.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},it.prototype.insert=function(e,t){return this.splice(e,0,t)},it.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):ht()},it.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){yt(n,0,t+e.length);for(var r=0;r>>t&31;if(r>=this.array.length)return new lt([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-5,n))===a&&o)return this}if(o&&!i)return this;var s=gt(this,e);if(!o)for(var l=0;l>>t&31;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-5,n))===o&&i===this.array.length-1)return this}var a=gt(this,e);return a.array.splice(i+1),r&&(a.array[i]=r),a};var ut,ct,dt={};function ft(e,t){var n=e._origin,r=e._capacity,i=_t(r),o=e._tail;return a(e._root,e._level,0);function a(e,s,l){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,l=a>n?0:n-a,u=r-a;return u>32&&(u=32),function(){if(l===u)return dt;var e=t?--u:l++;return s&&s[e]}}(e,l):function(e,i,o){var s,l=e&&e.array,u=o>n?0:n-o>>i,c=1+(r-o>>i);return c>32&&(c=32),function(){for(;;){if(s){var e=s();if(e!==dt)return e;s=null}if(u===c)return dt;var n=t?--c:u++;s=a(l&&l[n],i-5,o+(n<>>n&31,l=e&&s0){var u=e&&e.array[s],c=mt(u,t,n-5,r,i,o);return c===u?e:((a=gt(e,t)).array[s]=c,a)}return l&&e.array[s]===i?e:(b(o),a=gt(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function gt(e,t){return t&&e&&t===e.ownerID?e:new lt(e?e.array.slice():[],t)}function vt(e,t){if(t>=_t(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&31],r-=5;return n}}function yt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new _,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var l=e._level,u=e._root,c=0;a+c<0;)u=new lt(u&&u.array.length?[void 0,u]:[],r),c+=1<<(l+=5);c&&(a+=c,i+=c,s+=c,o+=c);for(var d=_t(o),f=_t(s);f>=1<d?new lt([],r):p;if(p&&f>d&&a5;g-=5){var v=d>>>g&31;m=m.array[v]=gt(m.array[v],r)}m.array[d>>>5&31]=p}if(s=f)a-=f,s-=f,l=5,u=null,h=h&&h.removeBefore(r,0,a);else if(a>i||f>>l&31;if(y!==f>>>l&31)break;y&&(c+=(1<i&&(u=u.removeBefore(r,l,a-c)),u&&fo&&(o=u.size),a(l)||(u=u.map((function(e){return re(e)}))),r.push(u)}return o>e.size&&(e=e.setSize(o)),Je(e,t,r)}function _t(e){return e<32?0:e-1>>>5<<5}function wt(e){return null==e?Et():xt(e)?e:Et().withMutations((function(t){var n=r(e);Ae(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function xt(e){return Re(e)&&c(e)}function kt(e,t,n,r){var i=Object.create(wt.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function Et(){return ct||(ct=kt(We(),ht()))}function St(e,t,n){var r,i,o=e._map,a=e._list,s=o.get(t),l=void 0!==s;if(n===m){if(!l)return e;a.size>=32&&a.size>=2*o.size?(r=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(l){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):kt(r,i)}function Ot(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Tt(e){this._iter=e,this.size=e.size}function Ct(e){this._iter=e,this.size=e.size}function At(e){this._iter=e,this.size=e.size}function Pt(e){var t=$t(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Gt,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(2===t){var r=e.__iterator(t,n);return new j((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,n)},t}function Rt(e,t,n){var r=$t(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,m);return o===m?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate((function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)}),i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(2,i);return new j((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return D(r,s,t.call(n,a[1],s,e),i)}))},r}function Mt(e,t){var n=$t(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Pt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Gt,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function It(e,t,n,r){var i=$t(e);return r&&(i.has=function(r){var i=e.get(r,m);return i!==m&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,m);return o!==m&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,l){if(t.call(n,e,o,l))return s++,i(e,r?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(2,o),s=0;return new j((function(){for(;;){var o=a.next();if(o.done)return o;var l=o.value,u=l[0],c=l[1];if(t.call(n,c,u,e))return D(i,r?u:s++,c,o)}}))},i}function jt(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),S(t,n,i))return e;var o=O(t,i),a=T(n,i);if(o!=o||a!=a)return jt(e.toSeq().cacheResult(),t,n,r);var s,l=a-o;l==l&&(s=l<0?0:l);var u=$t(e);return u.size=0===s?s:e.size&&s||void 0,!r&&Q(e)&&s>=0&&(u.get=function(t,n){return(t=k(this,t))>=0&&ts)return{value:void 0,done:!0};var e=i.next();return r||1===t?e:D(t,l-1,0===t?void 0:e.value[1],e)}))},u}function Dt(e,t,n,r){var i=$t(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,l=0;return e.__iterate((function(e,o,u){if(!s||!(s=t.call(n,e,o,u)))return l++,i(e,r?o:l-1,a)})),l},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(2,o),l=!0,u=0;return new j((function(){var e,o,c;do{if((e=s.next()).done)return r||1===i?e:D(i,u++,0===i?void 0:e.value[1],e);var d=e.value;o=d[0],c=d[1],l&&(l=t.call(n,c,o,a))}while(l);return 2===i?e:D(i,o,c,e)}))},i}function Lt(e,t){var n=s(e),i=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?J(e):Z(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&s(o)||l(e)&&l(o))return o}var u=new $(i);return n?u=u.toKeyedSeq():l(e)||(u=u.toSetSeq()),(u=u.flatten(!0)).size=i.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),u}function Nt(e,t,n){var r=$t(e);return r.__iterateUncached=function(r,i){var o=0,s=!1;return function e(l,u){var c=this;l.__iterate((function(i,l){return(!t||u0}function Ut(e,t,r){var i=$t(e);return i.size=new $(r).map((function(e){return e.size})).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map((function(e){return e=n(e),B(i?e.reverse():e)})),a=0,s=!1;return new j((function(){var n;return s||(n=o.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:D(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},i}function qt(e,t){return Q(e)?t:e.constructor(t)}function Ht(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Wt(e){return Ae(e.size),x(e)}function Vt(e){return s(e)?r:l(e)?i:o}function $t(e){return Object.create((s(e)?H:l(e)?W:V).prototype)}function Gt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):q.prototype.cacheResult.call(this)}function Kt(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):wn(e,t)},gn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;Ae(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):wn(t,n)},gn.prototype.pop=function(){return this.slice(1)},gn.prototype.unshift=function(){return this.push.apply(this,arguments)},gn.prototype.unshiftAll=function(e){return this.pushAll(e)},gn.prototype.shift=function(){return this.pop.apply(this,arguments)},gn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):xn()},gn.prototype.slice=function(e,t){if(S(e,t,this.size))return this;var n=O(e,this.size);if(T(t,this.size)!==this.size)return pe.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):wn(r,i)},gn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?wn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},gn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},gn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new j((function(){if(r){var t=r.value;return r=r.next,D(e,n++,t)}return{value:void 0,done:!0}}))},gn.isStack=vn;var yn,bn="@@__IMMUTABLE_STACK__@@",_n=gn.prototype;function wn(e,t,n,r){var i=Object.create(_n);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function xn(){return yn||(yn=wn(0))}function kn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}_n[bn]=!0,_n.withMutations=je.withMutations,_n.asMutable=je.asMutable,_n.asImmutable=je.asImmutable,_n.wasAltered=je.wasAltered,n.Iterator=j,kn(n,{toArray:function(){Ae(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Tt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Ot(this,!0)},toMap:function(){return Pe(this.toKeyedSeq())},toObject:function(){Ae(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return wt(this.toKeyedSeq())},toOrderedSet:function(){return cn(s(this)?this.valueSeq():this)},toSet:function(){return tn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Ct(this)},toSeq:function(){return l(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return gn(s(this)?this.valueSeq():this)},toList:function(){return it(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return qt(this,Lt(this,t))},includes:function(e){return this.some((function(t){return ae(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Ae(this.size);var n=!0;return this.__iterate((function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1})),n},filter:function(e,t){return qt(this,It(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Ae(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ae(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return qt(this,Rt(this,e,t))},reduce:function(e,t,n){var r,i;return Ae(this.size),arguments.length<2?i=!0:r=t,this.__iterate((function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return qt(this,Mt(this,!0))},slice:function(e,t){return qt(this,jt(this,e,t,!0))},some:function(e,t){return!this.every(Cn(e),t)},sort:function(e){return qt(this,Ft(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return x(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Pe().asMutable();return e.__iterate((function(i,o){r.update(t.call(n,i,o,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return se(this,e)},entrySeq:function(){var e=this;if(e._cache)return new $(e._cache);var t=e.toSeq().map(Tn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Cn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(E)},flatMap:function(e,t){return qt(this,function(e,t,n){var r=Vt(e);return e.toSeq().map((function(i,o){return r(t.call(n,i,o,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return qt(this,Nt(this,e,!0))},fromEntrySeq:function(){return new At(this)},get:function(e,t){return this.find((function(t,n){return ae(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,i=Yt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,m):m)===m)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),i=(c(e)?wt():Pe()).asMutable();e.__iterate((function(o,a){i.update(t.call(n,o,a,e),(function(e){return(e=e||[]).push(r?[a,o]:o),e}))}));var o=Vt(e);return i.map((function(t){return qt(e,o(t))}))}(this,e,t)},has:function(e){return this.get(e,m)!==m},hasIn:function(e){return this.getIn(e,m)!==m},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ae(t,e)}))},keySeq:function(){return this.toSeq().map(On).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Bt(this,e)},maxBy:function(e,t){return Bt(this,t,e)},min:function(e){return Bt(this,e?An(e):Mn)},minBy:function(e,t){return Bt(this,t?An(t):Mn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return qt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return qt(this,Dt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Cn(e),t)},sortBy:function(e,t){return qt(this,Ft(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return qt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return qt(this,function(e,t,n){var r=$t(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate((function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)})),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(2,i),s=!0;return new j((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,l=i[0],u=i[1];return t.call(n,u,l,o)?2===r?e:D(r,l,u,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Cn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=c(e),n=s(e),r=t?1:0;return function(e,t){return t=me(t,3432918353),t=me(t<<15|t>>>-15,461845907),t=me(t<<13|t>>>-13,5),t=me((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ge((t=me(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+In(ve(e),ve(t))|0}:function(e,t){r=r+In(ve(e),ve(t))|0}:t?function(e){r=31*r+ve(e)|0}:function(e){r=r+ve(e)|0}),r)}(this))}});var En=n.prototype;En[d]=!0,En[I]=En.values,En.__toJS=En.toArray,En.__toStringMapper=Pn,En.inspect=En.toSource=function(){return this.toString()},En.chain=En.flatMap,En.contains=En.includes,kn(r,{flip:function(){return qt(this,Pt(this))},mapEntries:function(e,t){var n=this,r=0;return qt(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return qt(this,this.toSeq().flip().map((function(r,i){return e.call(t,r,i,n)})).flip())}});var Sn=r.prototype;function On(e,t){return t}function Tn(e,t){return[t,e]}function Cn(e){return function(){return!e.apply(this,arguments)}}function An(e){return function(){return-e.apply(this,arguments)}}function Pn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Rn(){return w(arguments)}function Mn(e,t){return et?-1:0}function In(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Sn[f]=!0,Sn[I]=En.entries,Sn.__toJS=En.toObject,Sn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Pn(e)},kn(i,{toKeyedSeq:function(){return new Ot(this,!1)},filter:function(e,t){return qt(this,It(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return qt(this,Mt(this,!1))},slice:function(e,t){return qt(this,jt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=O(e,e<0?this.count():this.size);var r=this.slice(0,e);return qt(this,1===n?r:r.concat(w(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return qt(this,Nt(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e=15&&(d=!1,l=!0);var x=y&&(u||d&&(null==w||w<12.11)),k=n||a&&s>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,O=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return T(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(D=function(e){try{e.select()}catch(e){}});var B=function(){this.id=null,this.f=null,this.time=0,this.handler=L(this.onTimeout,this)};function z(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var $=[""];function G(e){for(;$.length<=e;)$.push(K($)+" ");return $[e]}function K(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Z(e))||t.test(e):Z(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ae=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ae=i)}return null!=r?r:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u,c=a.length,d=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function he(e,t){var n=fe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function ye(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){be(e),_e(e)}function ke(e){return e.target||e.srcElement}function Ee(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Se,Oe,Te=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Ce(e){if(null==Se){var t=A("span","​");C(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Se?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=Oe)return Oe;var t=C(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var Pe,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Me=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Pe=A("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),je=null,De={},Le={};function Ne(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),De[e]=t}function Fe(e){if("string"==typeof e&&Le.hasOwnProperty(e))e=Le[e];else if(e&&"string"==typeof e.name&&Le.hasOwnProperty(e.name)){var t=Le[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Be(e,t){t=Fe(t);var n=De[t.name];if(!n)return Be(e,"text/plain");var r=n(e,t);if(ze.hasOwnProperty(t.name)){var i=ze[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var ze={};function Ue(e,t){N(t,ze.hasOwnProperty(e)?ze[e]:ze[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function He(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function We(e,t,n){return!e.startState||e.startState(t,n)}var Ve=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function $e(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?et(n,$e(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,$e(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r=this.string.length},Ve.prototype.sol=function(){return this.pos==this.lineStart},Ve.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ve.prototype.next=function(){if(this.post},Ve.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ve.prototype.skipToEnd=function(){this.pos=this.string.length},Ve.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ve.prototype.backUp=function(e){this.pos-=e},Ve.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ve.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ve.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ve.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ve.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function dt(e,t,n,r){var i=[e.state.modeGen],o={};_t(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,u=0;n.state=!0,_t(e,t.text,s.mode,n,(function(e,t){for(var n=l;ue&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&qe(e.doc.mode,r.state),o=dt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ct(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=$e(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ut?u.lookAhead:0)<=o.modeFrontier))return s;var c=F(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}(e,t,n),a=o>r.first&&$e(r,o-1).stateAfter,s=a?ct.fromSaved(r,a,o):new ct(r,We(r.mode),o);return r.iter(o,t,(function(n){ht(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,n){return t instanceof ut?new ct(e,qe(e.mode,t.state),n,t.lookAhead):new ct(e,qe(e.mode,t),n)},ct.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=$e(a,(t=st(a,t)).line),u=pt(e,t.line,n),c=new Ve(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&ht(e,t,r,d.pos),d.pos=t.length,l=null):l=bt(gt(n,d,r.state,f),o),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||c!=l){for(;u=t:o.to>t);(r||(r=[])).push(new kt(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;bt)&&(!n||Mt(n,o.marker)<0)&&(n=o.marker)}return n}function Nt(e,t,n,r,i){var o=$e(e,t),a=xt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,n)>=0:tt(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(u.from,r)<=0:tt(u.from,r)<0)))return!0}}}function Ft(e){for(var t;t=jt(e);)e=t.find(-1,!0).line;return e}function Bt(e,t){var n=$e(e,t),r=Ft(n);return n==r?t:Qe(r)}function zt(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!Ut(e,r))return t;for(;n=Dt(r);)r=n.find(1,!0).line;return Qe(r)+1}function Ut(e,t){var n=xt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var $t=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,Ct(e)}$t.prototype.lineNo=function(){return Qe(this)},ye($t);var Kt={},Yt={};function Qt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Kt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Zt,Ae(e.display.measure)&&(a=ue(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,ft(e,o,t!=e.display.externalMeasured&&Qe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=j(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=j(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ce(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function Jt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=u=c=s="",f=null,d=null,v=1/0;for(var y=[],b=void 0,_=0;_h||x.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&v>w.to&&(v=w.to,u=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&w.from==h&&(c+=" "+x.startStyle),x.endStyle&&w.to==v&&(b||(b=[])).push(x.endStyle,w.to),x.title&&((f||(f={})).title=x.title),x.attributes)for(var k in x.attributes)(f||(f={}))[k]=x.attributes[k];x.collapsed&&(!d||Mt(d.marker,x)<0)&&(d=w)}else w.from>h&&v>w.from&&(v=w.from)}if(b)for(var E=0;E=p)break;for(var O=Math.min(p,v);;){if(g){var T=h+g.length;if(!d){var C=T>O?g.slice(0,O-h):g;t.addToken(t,C,a?a+l:l,c,h+C.length==v?u:"",s,f)}if(T>=O){g=g.slice(O-h),h=O;break}h=T,c=""}g=i.slice(o,o=n[m++]),a=Qt(n[m++],t.cm.options)}}else for(var A=1;An)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Pn(e,t,n,r){return In(e,Mn(e,t),n,r)}function Rn(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Ln(t.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;u&&re(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var p;u>0&&(d=r="right"),i=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+ir(e.display),top:h.top,bottom:h.bottom}:Dn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function Fn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=se(s,l,u),f=ae,p=c(l,d,"before"==u);return null!=f&&(p.other=c(l,f,"before"!=u)),p}function Kn(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=$e(e.doc,t.line),i=Ht(r)+kn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Yn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Qn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,-1,-1);var i=Xe(r,n),o=r.first+r.size-1;if(i>o)return Yn(r.first+r.size-1,$e(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=$e(r,i);;){var s=er(e,a,i,t,n),l=Lt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=$e(r,i=u.line)}}function Xn(e,t,n,r){r-=Hn(t);var i=t.text.length,o=oe((function(t){return In(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return In(e,n,t).top>r}),o,i)}}function Jn(e,t,n,r){return n||(n=Mn(e,t)),Xn(e,t,n,Wn(e,t,In(e,n,r),"line").top)}function Zn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Ht(t);var o=Mn(e,t),a=Hn(t),s=0,l=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?nr:tr)(e,t,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,p,h=null,m=null,g=oe((function(t){var n=In(e,o,t);return n.top+=a,n.bottom+=a,!!Zn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),v=!1;if(m){var y=r-m.left=_.bottom?1:0}return Yn(n,g=ie(t.text,g,1),p,v,r-f)}function tr(e,t,n,r,i,o,a){var s=oe((function(s){var l=i[s],u=1!=l.level;return Zn(Gn(e,et(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=Gn(e,et(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Zn(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function nr(e,t,n,r,i,o,a){var s=Xn(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f=u||p.to<=l)){var h=In(e,r,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,m=hm)&&(c=p,d=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==jn){jn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)jn.appendChild(document.createTextNode("x")),jn.appendChild(A("br"));jn.appendChild(document.createTextNode("x"))}C(e.measure,jn);var n=jn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");C(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Ut(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=$e(e.doc,u.line).text).length==u.ch){var c=F(l,l.length,e.options.tabSize)-l.length;u=et(u.line,Math.max(0,Math.round((o-Sn(e.display).left)/ir(e.display))-c))}return u}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)xt&&Bt(e.doc,t)i.viewFrom?pr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)pr(e);else if(t<=i.viewFrom){var o=hr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):pr(e)}else if(n>=i.viewTo){var a=hr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):pr(e)}else{var s=hr(e,t,t,-1),l=hr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):pr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[cr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==z(a,n)&&a.push(n)}}}function pr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hr(e,t,n,r){var i,o=cr(e,t),a=e.display.view;if(!xt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Bt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,(function(e,t,i,d){var g="ltr"==i,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),b=null==n&&0==e,_=null==r&&t==f,w=0==d,x=!m||d==m.length-1;if(y.top-v.top<=3){var k=(u?_:b)&&x,E=(u?b:_)&&w?s:(g?v:y).left,S=k?l:(g?y:v).right;c(E,v.top,S-E,v.bottom)}else{var O,T,C,A;g?(O=u&&b&&w?s:v.left,T=u?l:h(e,i,"before"),C=u?s:h(t,i,"after"),A=u&&_&&x?l:y.right):(O=u?h(e,i,"before"):s,T=!u&&b&&w?l:v.right,C=!u&&_&&x?s:y.left,A=u?h(t,i,"after"):l),c(O,v.top,T-O,v.bottom),v.bottom0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function xr(e){e.state.focused||(e.display.input.focus(),Er(e))}function kr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Sr(e))}),100)}function Er(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wr(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,O(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Or(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||f<-.005)&&(Ye(i.line,l),Tr(i.line),i.rest))for(var p=0;pe.display.sizerWidth){var h=Math.ceil(u/ir(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Tr(e){if(e.widgets)for(var t=0;t=a&&(o=Xe(t,Ht($e(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Ar(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Cn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+En(n),l=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Tn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+d-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function Pr(e,t){null!=t&&(Ir(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Rr(e){Ir(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mr(e,t,n){null==t&&null==n||Ir(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ir(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,jr(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function jr(e,t,n,r){var i=Ar(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mr(e,i.scrollLeft,i.scrollTop)}function Dr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||li(e,{top:t}),Lr(e,t,!0),n&&li(e),ri(e,100))}function Lr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Nr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+En(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+On(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Br=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new B,this.disableVert=new B},Br.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var zr=function(){};function Ur(e,t){t||(t=Fr(e));var n=e.display.barWidth,r=e.display.barHeight;qr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Or(e),qr(e,Fr(e)),n=e.display.barWidth,r=e.display.barHeight}function qr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}zr.prototype.update=function(){return{bottom:0,right:0}},zr.prototype.setScrollLeft=function(){},zr.prototype.setScrollTop=function(){},zr.prototype.clear=function(){};var Hr={native:Br,null:zr};function Wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Nr(e,t):Dr(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Vr=0;function $r(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Gr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yr(e){e.updatedDisplay=e.mustUpdate&&ai(e.cm,e.update)}function Qr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Or(t),e.barMeasure=Fr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+On(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-kn(e.display))+"px;\n height: "+(t.bottom-t.top+On(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Gn(e,t),l=n&&n!=t?Gn(e,n):s,u=Ar(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(Dr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Nr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a=e.display.viewTo)){var n=+new Date+e.options.workTime,r=pt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?qe(t.mode,r.state):null,l=dt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&fn)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Zr(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;fi(e)&&(pr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),xt&&(o=Bt(e.doc,o),a=zt(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,cr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ht($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=mr(e);if(!s&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=M();if(!t||!R(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&R(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(p=!1),cn(e,f,c,n)),p&&(T(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Ze(e.options,c)))),a=f.node.nextSibling}else{var h=vn(e,f,c,n);o.insertBefore(h,a)}c+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=M()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function si(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e))r&&(t.visible=Cr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+En(e.display)-Cn(e),n.top)}),t.visible=Cr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ai(e,t))break;Or(e);var i=Fr(e);gr(e),Ur(e,i),ci(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function li(e,t){var n=new oi(e,t);if(ai(e,n)){Or(e),si(e,n);var r=Fr(e);gr(e),Ur(e,r),ci(e,r),n.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+On(e)+"px"}function di(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)e:for(var f=t.target,p=a.view;f!=s;f=f.parentNode)for(var h=0;h=0&&tt(e,r.to())<=0)return n}return-1};var ki=function(e,t){this.anchor=e,this.head=t};function Ei(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=z(t,i);for(var o=1;o0:l>=0){var u=ot(s.from(),a.from()),c=it(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new ki(d?c:u,d?u:c))}}return new xi(t,n)}function Si(e,t){return new xi([new ki(e,t||e)],0)}function Oi(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ti(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Oi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Oi(t).ch-t.to.ch),et(n,r)}function Ci(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function ji(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Bi(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(i,i.lastOp==r)))a=K(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Oi(t):o.changes.push(Fi(e,t));else{var l=K(i.done);for(l&&l.ranges||qi(e.sel,i.done),o={changes:[Fi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||he(e,"historyAdded")}function Ui(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,K(i.done),t))?i.done[i.done.length-1]=t:qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Bi(i.undone)}function qi(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Hi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Wi(e){if(!e)return null;for(var t,n=0;n-1&&(K(s)[d]=u[d],delete u[d])}}}return r}function Gi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new ki(i,t)}return new ki(n||t,t)}function Ki(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Zi(e,new xi([Gi(e.sel.primary(),t,n,i)],0),r)}function Yi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(he(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=ao(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=tt(d,n))&&(r<0?f<0:f>0))return io(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?u:c)&&(p=ao(e,p,r,p.line==t.line?o:null)),p?io(e,p,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,a=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||$e(e,t.line)).text.length?t.line0)){var c=[l,1],d=tt(u.from,s.from),f=tt(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)co(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Ci(e,t);zi(e,t,n,e.cm?e.cm.curOp.id:NaN),ho(e,t,n,Ot(e,t));var r=[];ji(e,(function(e,n){n||-1!=z(r,e.history)||(yo(e.history,t),r.push(e.history)),ho(e,t,null,Ot(e,t))}))}}function fo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u=0;--p){var h=f(p);if(h)return h.v}}}}function po(e,t){if(0!=t&&(e.first+=t,e.sel=new xi(Y(e.sel.ranges,(function(e){return new ki(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:et(o,$e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ge(e,t.from,t.to),n||(n=Ci(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=Qe(Ft($e(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Ii(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=Wt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=$e(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead1||!(this.children[0]instanceof _o))){var s=[];this.collapse(s),this.children=[new _o(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Nt(e,t.line,t,n,o)||t.line!=n.line&&Nt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");xt=!0}o.addToHistory&&zi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Ft(e)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ye(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new kt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ut(e,t)&&Ye(t,0)})),o.clearOnEnter&&de(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Eo,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)dr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)fr(u,c,"text");o.atomic&&no(u.doc),ln(u,"markerAdded",u,o)}return o}So.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&$r(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Gr(e),this.parent&&this.parent.clear()}},So.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)uo(this,r[l]);s?Ji(this,s):this.cm&&Rr(this.cm)})),undo:ni((function(){fo(this,"undo")})),redo:ni((function(){fo(this,"redo")})),undoSelection:ni((function(){fo(this,"undo",!0)})),redoSelection:ni((function(){fo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),eo(t.doc,Si(n,n)),f)for(var p=0;p=0;t--)mo(e.doc,"",r[t].from,r[t].to,"+delete");Rr(e)}))}function Jo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Zo(e,t,n){var r=Jo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(n,t.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=Mn(t,n);a=i<0?n.text.length-1:0;var c=In(t,u,a).top;a=oe((function(e){return In(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Jo(n,a,1))}else a=i<0?s.to:s.from;return new et(r,a,l)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Ho.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ho.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ho.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ho.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ho.default=y?Ho.macDefault:Ho.pcDefault;var ta={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Xo(e,(function(t){if(t.empty()){var n=$e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=$e(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new ki(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Zr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(tt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,u=ei(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",u),pe(i.wrapper.ownerDocument,"mousemove",c),pe(i.scroller,"dragstart",d),pe(i.scroller,"drop",u),o||(be(t),r.addNew||Ki(e.doc,n,null,null,r.extend),l&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),de(i.wrapper.ownerDocument,"mouseup",u),de(i.wrapper.ownerDocument,"mousemove",c),de(i.scroller,"dragstart",d),de(i.scroller,"drop",u),kr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,s,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?u[s]:new ki(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new ki(n,n)),n=ur(e,t,!0,!0),s=-1;else{var c=va(e,n,r.unit);a=r.extend?Gi(a,c.anchor,c.head,r.extend):c}r.addNew?-1==s?(s=u.length,Zi(o,Ei(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==r.unit&&!r.extend?(Zi(o,Ei(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Qi(o,s,a,H):(s=0,Zi(o,new xi([a],0),H),l=o.sel);var d=n;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],u=e.options.tabSize,c=F($e(o,n.line).text,n.ch,u),f=F($e(o,t.line).text,t.ch,u),p=Math.min(c,f),h=Math.max(c,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=$e(o,m).text,y=V(v,p,u);p==h?i.push(new ki(et(m,y),et(m,y))):v.length>y&&i.push(new ki(et(m,y),et(m,V(v,h,u))))}i.length||i.push(new ki(n,n)),Zi(o,Ei(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,_=a,w=va(e,t,r.unit),x=_.anchor;tt(w.anchor,x)>0?(b=w.head,x=ot(_.from(),w.anchor)):(b=w.anchor,x=it(_.to(),w.head));var k=l.ranges.slice(0);k[s]=function(e,t){var n=t.anchor,r=t.head,i=$e(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ue(i);if(!o)return t;var a=se(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=se(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new ki(new et(n.line,h,m),r)}(e,new ki(st(o,x),b)),Zi(o,Ei(e,k,s),H)}}var p=i.wrapper.getBoundingClientRect(),h=0;function m(t){e.state.selectingText=!1,h=1/0,t&&(be(t),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",g),pe(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=ei(e,(function(t){0!==t.buttons&&Ee(t)?function t(n){var a=++h,s=ur(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,d)){e.curOp.focus=M(),f(s);var l=Cr(i,o);(s.line>=l.to||s.linep.bottom?20:0;u&&setTimeout(ei(e,(function(){h==a&&(i.scroller.scrollTop+=u,t(n))})),50)}}(t):m(t)})),v=ei(e,m);e.state.selectingText=v,de(i.wrapper.ownerDocument,"mousemove",g),de(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):ke(e)==n.scroller&&be(e):2==i?(r&&Ki(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):kr(t)))}}function va(e,t,n){if("char"==n)return new ki(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ki(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new ki(r.from,r.to)}function ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,n))return we(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return he(e,n,e,Xe(e.doc,o),e.display.gutterSpecs[l].className,t),we(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function _a(e,t){xn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var xa={toString:function(){return"CodeMirror.Init"}},ka={},Ea={};function Sa(e,t,n){if(!t!=!(n&&n!=xa)){var r=e.display.dragFunctions,i=t?de:pe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Oa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),Vt(e)),lr(e),dr(e),zn(e),setTimeout((function(){return Ur(e)}),100)}function Ta(e,t){var n=this;if(!(this instanceof Ta))return new Ta(e,t);this.options=t=t?N(t):{},N(ka,t,!1);var r=t.value;"string"==typeof r?r=new Ro(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ta.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new B,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",ei(e,ga)),de(t.scroller,"dblclick",a&&s<11?ei(e,(function(t){if(!me(e,t)){var n=ur(e,t);if(n&&!ba(e,t)&&!xn(e.display,t)){be(t);var r=e.findWordAt(n);Ki(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||be(t)}),de(t.scroller,"contextmenu",(function(t){return _a(e,t)})),de(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||_a(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}de(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ba(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!xn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new ki(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new ki(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}i()})),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Dr(e,t.scroller.scrollTop),Nr(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return wi(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return wi(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||xe(t)},over:function(t){me(e,t)||(function(e,t){var n=ur(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,r)}}(e,t),xe(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Mo<100))xe(t);else if(!me(e,t)&&!xn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Io),leave:function(t){me(e,t)||jo(e)}};var l=t.input.getField();de(l,"keyup",(function(t){return da.call(e,t)})),de(l,"keydown",ei(e,ca)),de(l,"keypress",ei(e,fa)),de(l,"focus",(function(t){return Er(e,t)})),de(l,"blur",(function(t){return Sr(e,t)}))}(this),No(),$r(this),this.curOp.forceUpdate=!0,Di(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(L(Er,this),20):Sr(this),Ea)Ea.hasOwnProperty(u)&&Ea[u](this,t[u],xa);fi(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?F($e(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/a);p;--p)f+=a,d+="\t";if(fa,l=Re(t),u=null;if(s&&r.ranges.length>1)if(Pa&&Pa.text.join("\n")==t){if(r.ranges.length%Pa.text.length==0){u=[];for(var c=0;c=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=et(h.line,h.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min($e(o,m.line).text.length,m.ch+K(l).length)):s&&Pa&&Pa.lineWise&&Pa.text.join("\n")==l.join("\n")&&(h=m=et(h.line,0)));var g={from:h,to:m,text:u?u[f%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};uo(e.doc,g),ln(e,"inputRead",e,g)}t&&!s&&ja(e,t),Rr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zr(t,(function(){return Ma(t,n,0,null,"paste")})),!0}function ja(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Aa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test($e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Aa(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function Da(e){for(var t=[],n=[],r=0;r=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=se(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=c.begin)){var p=d?"before":"after";return new et(n.line,f,p)}}var h=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==g||r>0&&g==t.text.length||!(m=h(r>0?0:i.length-1,r,u(g)))?null:m}(e.cm,s,t,n):Zo(s,t,n))){if(r||!function(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new et(n,t.ch,t.sticky),s=$e(e,n))}())return!1;t=ea(i,e.cm,s,t.line,l)}else t=o;return!0}if("char"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var c=null,d="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||u(!p);p=!1){var h=s.text.charAt(t.ch)||"\n",m=ee(h,f)?"w":d&&"\n"==h?"n":!d||/\s/.test(h)?null:"p";if(!d||p||m||(m="s"),c&&c!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(c=m),n>0&&!u(!p))break}var g=oo(e,t,o,a,!0);return nt(o,g)&&(g.hitSide=!0),g}function Ba(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Qn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var za=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(e,t){var n=Rn(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),i=An(n,r,t.line),o=ue(r,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var s=Ln(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function qa(e,t){return t&&(e.bad=!0),e}function Ha(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return qa(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Ua(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=et(a.line-1,$e(r.doc,a.line-1).length)),s.ch==$e(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=cr(r,a.line))?(t=Qe(i.view[0].line),n=i.view[0].node):(t=Qe(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=cr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=Qe(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function c(e){e&&(u(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void c(n);var o,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(et(r,0),et(i+1,0),(g=+f,function(e){return e.id==g}));return void(p.length&&(o=p[0].find(0))&&c(Ge(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&u();for(var m=0;m1&&f.length>1;)if(K(d)==K(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);pa.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var w=et(t,p),x=et(l,f.length?K(f).length-h:0);return d.length>1||d[0]||tt(w,x)?(mo(r.doc,d,w,x,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},za.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zr(this.cm,(function(){return dr(e.cm)}))},za.prototype.setUneditable=function(e){e.contentEditable="false"},za.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},za.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0;var Va=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null};Va.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!me(r,e)){if(r.somethingSelected())Ra({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Da(r);Ra({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,q):(n.prevInput="",i.value=t.text.join("\n"),D(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),de(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(i,"paste",(function(e){me(r,e)||Ia(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(i,"cut",o),de(i,"copy",o),de(e.scroller,"paste",(function(t){if(!xn(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),de(e.lineSpace,"selectstart",(function(t){xn(e,t)||be(t)})),de(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),de(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Va.prototype.createField=function(e){this.wrapper=Na(),this.textarea=this.wrapper.firstChild},Va.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Va.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=Gn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Va.prototype.showSelection=function(e){var t=this.cm.display;C(t.cursorDiv,e.cursors),C(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Va.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&D(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Va.prototype.getField=function(){return this.textarea},Va.prototype.supportsTouch=function(){return!1},Va.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Va.prototype.blur=function(){this.textarea.blur()},Va.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Va.prototype.receivedFocus=function(){this.slowPoll()},Va.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Va.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Va.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Me(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Va.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Va.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Va.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ur(n,e),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Zi)(n.doc,Si(o),q);var c,f=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),k){xe(e);var m=function(){pe(window,"mouseup",m),setTimeout(v,20)};de(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(n,so)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Va.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Va.prototype.setUneditable=function(){},Va.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=xa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=xa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Pi(e)}),!0),n("indentUnit",2,Pi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ri(e),zn(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)mo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=xa&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){wa(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Qo(t),i=n!=xa&&Qo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Oa,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=pi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Ur(e)}),!0),n("scrollbarStyle","native",(function(e){Wr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Sr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Sa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ri,!0),n("addModeClass",!1,Ri,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ri,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ta),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),he(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Aa(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Rr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Qi(this.doc,r,new ki(o,u[r].to()),q)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=ft(this,$e(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=$e(this.doc,e)}else r=e;return Wn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ht(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,l=this.display,u=(e=Gn(this,st(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)u=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),f=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(o=this,a={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Ar(o,a)).scrollTop&&Dr(o,s.scrollTop),null!=s.scrollLeft&&Nr(o,s.scrollLeft))},triggerOnKeyDown:ti(ca),triggerOnKeyPress:ti(fa),triggerOnKeyUp:da,triggerOnMouseDown:ti(ga),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:ti((function(e){ja(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&lr(this),he(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Di(this,e),zn(this),this.display.input.reset(),Mr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ta);var $a="iter insert remove copy getEditor constructor".split(" ");for(var Ga in Ro.prototype)Ro.prototype.hasOwnProperty(Ga)&&z($a,Ga)<0&&(Ta.prototype[Ga]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ro.prototype[Ga]));return ye(Ro),Ta.inputStyles={textarea:Va,contenteditable:za},Ta.defineMode=function(e){Ta.defaults.mode||"null"==e||(Ta.defaults.mode=e),Ne.apply(this,arguments)},Ta.defineMIME=function(e,t){Le[e]=t},Ta.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ta.defineMIME("text/plain","null"),Ta.defineExtension=function(e,t){Ta.prototype[e]=t},Ta.defineDocExtension=function(e,t){Ro.prototype[e]=t},Ta.fromTextArea=function(e,t){if((t=t?N(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=M();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ta((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=pe,e.on=de,e.wheelEventPixels=_i,e.Doc=Ro,e.splitLines=Re,e.countColumn=F,e.findColumn=V,e.isWordChar=Z,e.Pass=U,e.signal=he,e.Line=$t,e.changeEnd=Oi,e.scrollbarModel=Hr,e.Pos=et,e.cmpPos=tt,e.modes=De,e.mimeModes=Le,e.resolveMode=Fe,e.getMode=Be,e.modeExtensions=ze,e.extendMode=Ue,e.copyState=qe,e.startState=We,e.innerMode=He,e.commands=ta,e.keyMap=Ho,e.keyName=Yo,e.isModifierKey=Go,e.lookupKey=$o,e.normalizeKeyMap=Vo,e.StringStream=Ve,e.SharedTextMarker=To,e.TextMarker=So,e.LineWidget=xo,e.e_preventDefault=be,e.e_stopPropagation=_e,e.e_stop=xe,e.addClass=I,e.contains=R,e.rmClass=O,e.keyNames=Bo}(Ta),Ta.version="5.56.0",Ta}()},function(e,t,n){"use strict";function r(){return function(){throw new Error("Unimplemented abstract method.")}()}n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}));var i=0;function o(e){return e.ol_uid||(e.ol_uid=String(++i))}var a="5.3.3"},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return u})); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;--i){var o=t[i],a=Number.isInteger(o)&&o>=0?[]:{};a[o]=r,r=a}return e.createNode(r,!1)}var u=function(e){return null==e||"object"===Object(r.h)(e)&&e[Symbol.iterator]().next().done},c=function(e){Object(r.q)(n,e);var t=Object(r.r)(n);function n(e){var i;return Object(r.j)(this,n),i=t.call(this),Object(r.l)(Object(r.w)(i),"items",[]),i.schema=e,i}return Object(r.i)(n,[{key:"addIn",value:function(e,t){if(u(e))this.add(t);else{var i=Object(r.x)(e),o=i[0],a=i.slice(1),s=this.get(o,!0);if(s instanceof n)s.addIn(a,t);else{if(void 0!==s||!this.schema)throw new Error("Expected YAML collection at ".concat(o,". Remaining path: ").concat(a));this.set(o,l(this.schema,a,t))}}}},{key:"deleteIn",value:function(e){var t=Object(r.x)(e),i=t[0],o=t.slice(1);if(0===o.length)return this.delete(i);var a=this.get(i,!0);if(a instanceof n)return a.deleteIn(o);throw new Error("Expected YAML collection at ".concat(i,". Remaining path: ").concat(o))}},{key:"getIn",value:function(e,t){var i=Object(r.x)(e),o=i[0],a=i.slice(1),l=this.get(o,!0);return 0===a.length?!t&&l instanceof s?l.value:l:l instanceof n?l.getIn(a,t):void 0}},{key:"hasAllNullValues",value:function(){return this.items.every((function(e){if(!e||"PAIR"!==e.type)return!1;var t=e.value;return null==t||t instanceof s&&null==t.value&&!t.commentBefore&&!t.comment&&!t.tag}))}},{key:"hasIn",value:function(e){var t=Object(r.x)(e),i=t[0],o=t.slice(1);if(0===o.length)return this.has(i);var a=this.get(i,!0);return a instanceof n&&a.hasIn(o)}},{key:"setIn",value:function(e,t){var i=Object(r.x)(e),o=i[0],a=i.slice(1);if(0===a.length)this.set(o,t);else{var s=this.get(o,!0);if(s instanceof n)s.setIn(a,t);else{if(void 0!==s||!this.schema)throw new Error("Expected YAML collection at ".concat(o,". Remaining path: ").concat(a));this.set(o,l(this.schema,a,t))}}}},{key:"toJSON",value:function(){return null}},{key:"toString",value:function(e,t,o,a){var s=this,l=t.blockItem,u=t.flowChars,c=t.isMap,d=t.itemIndent,f=e,p=f.indent,h=f.indentStep,m=f.stringify,g=this.type===r.e.FLOW_MAP||this.type===r.e.FLOW_SEQ||e.inFlow;g&&(d+=h);var v=c&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:v,indent:d,inFlow:g,type:null});var y,b=!1,_=!1,w=this.items.reduce((function(t,n,r){var o;n&&(!b&&n.spaceBefore&&t.push({type:"comment",str:""}),n.commentBefore&&n.commentBefore.match(/^.*$/gm).forEach((function(e){t.push({type:"comment",str:"#".concat(e)})})),n.comment&&(o=n.comment),g&&(!b&&n.spaceBefore||n.commentBefore||n.comment||n.key&&(n.key.commentBefore||n.key.comment)||n.value&&(n.value.commentBefore||n.value.comment))&&(_=!0)),b=!1;var a=m(n,e,(function(){return o=null}),(function(){return b=!0}));return g&&!_&&a.includes("\n")&&(_=!0),g&&rn.maxFlowStringSingleLineLength){y=x;var S,O=Object(r.g)(E);try{for(O.s();!(S=O.n()).done;){var T=S.value;y+=T?"\n".concat(h).concat(p).concat(T):"\n"}}catch(e){O.e(e)}finally{O.f()}y+="\n".concat(p).concat(k)}else y="".concat(x," ").concat(E.join(" ")," ").concat(k)}else{var C=w.map(l);y=C.shift();var A,P=Object(r.g)(C);try{for(P.s();!(A=P.n()).done;){var R=A.value;y+=R?"\n".concat(p).concat(R):"\n"}}catch(e){P.e(e)}finally{P.f()}}return this.comment?(y+="\n"+this.comment.replace(/^/gm,"".concat(p,"#")),o&&o()):b&&a&&a(),y}}]),n}(o);function d(e){var t=e instanceof s?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null}Object(r.l)(c,"maxFlowStringSingleLineLength",60);var f=function(e){Object(r.q)(n,e);var t=Object(r.r)(n);function n(){return Object(r.j)(this,n),t.apply(this,arguments)}return Object(r.i)(n,[{key:"add",value:function(e){this.items.push(e)}},{key:"delete",value:function(e){var t=d(e);return"number"==typeof t&&this.items.splice(t,1).length>0}},{key:"get",value:function(e,t){var n=d(e);if("number"==typeof n){var r=this.items[n];return!t&&r instanceof s?r.value:r}}},{key:"has",value:function(e){var t=d(e);return"number"==typeof t&&t1&&void 0!==arguments[1]?arguments[1]:null;return Object(r.j)(this,n),(i=t.call(this)).key=e,i.value=o,i.type=n.Type.PAIR,i}return Object(r.i)(n,[{key:"addToJSMap",value:function(e,t){var n=a(this.key,"",e);if(t instanceof Map){var i=a(this.value,n,e);t.set(n,i)}else if(t instanceof Set)t.add(n);else{var s=function(e,t,n){return null===t?"":"object"!==Object(r.h)(t)?String(t):e instanceof o&&n&&n.doc?e.toString({anchors:{},doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(t)}(this.key,n,e);t[s]=a(this.value,s,e)}return t}},{key:"toJSON",value:function(e,t){var n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}},{key:"toString",value:function(e,t,n){if(!e||!e.doc)return JSON.stringify(this);var a=e.doc.options,l=a.indent,u=a.indentSeq,d=a.simpleKeys,p=this.key,h=this.value,m=p instanceof o&&p.comment;if(d){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(p instanceof c){throw new Error("With simple keys, collection cannot be used as a key value")}}var g=!d&&(!p||m||p instanceof c||p.type===r.e.BLOCK_FOLDED||p.type===r.e.BLOCK_LITERAL),v=e,y=v.doc,b=v.indent,_=v.indentStep,w=v.stringify;e=Object.assign({},e,{implicitKey:!g,indent:b+_});var x=!1,k=w(p,e,(function(){return m=null}),(function(){return x=!0}));if(k=i(k,e.indent,m),e.allNullValues&&!d)return this.comment?(k=i(k,e.indent,this.comment),t&&t()):x&&!m&&n&&n(),e.inFlow?k:"? ".concat(k);k=g?"? ".concat(k,"\n").concat(b,":"):"".concat(k,":"),this.comment&&(k=i(k,e.indent,this.comment),t&&t());var E="",S=null;if(h instanceof o){if(h.spaceBefore&&(E="\n"),h.commentBefore){var O=h.commentBefore.replace(/^/gm,"".concat(e.indent,"#"));E+="\n".concat(O)}S=h.comment}else h&&"object"===Object(r.h)(h)&&(h=y.schema.createNode(h,!0));e.implicitKey=!1,!g&&!this.comment&&h instanceof s&&(e.indentAtStart=k.length+1),x=!1,!u&&l>=2&&!e.inFlow&&!g&&h instanceof f&&h.type!==r.e.FLOW_SEQ&&!h.tag&&!y.anchors.getName(h)&&(e.indent=e.indent.substr(2));var T=w(h,e,(function(){return S=null}),(function(){return x=!0})),C=" ";if(E||this.comment)C="".concat(E,"\n").concat(e.indent);else if(!g&&h instanceof c){("["===T[0]||"{"===T[0])&&!T.includes("\n")||(C="\n".concat(e.indent))}return x&&!S&&n&&n(),i(k+C+T,e.indent,S)}},{key:"commentBefore",get:function(){return this.key instanceof o?this.key.commentBefore:void 0},set:function(e){if(null==this.key&&(this.key=new s(null)),!(this.key instanceof o)){throw new Error("Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.")}this.key.commentBefore=e}}]),n}(o);Object(r.l)(p,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var h=function e(t,n){if(t instanceof m){var i=n.get(t.source);return i.count*i.aliasCount}if(t instanceof c){var o,a=0,s=Object(r.g)(t.items);try{for(s.s();!(o=s.n()).done;){var l=e(o.value,n);l>a&&(a=l)}}catch(e){s.e(e)}finally{s.f()}return a}if(t instanceof p){var u=e(t.key,n),d=e(t.value,n);return Math.max(u,d)}return 1},m=function(e){Object(r.q)(n,e);var t=Object(r.r)(n);function n(e){var i;return Object(r.j)(this,n),(i=t.call(this)).source=e,i.type=r.e.ALIAS,i}return Object(r.i)(n,null,[{key:"stringify",value:function(e,t){var n=e.range,r=e.source,i=t.anchors,o=t.doc,a=t.implicitKey,s=t.inStringifyKey,l=Object.keys(i).find((function(e){return i[e]===r}));if(!l&&s&&(l=o.anchors.getName(r)||o.anchors.newName()),l)return"*".concat(l).concat(a?" ":"");var u=o.anchors.getName(r)?"Alias node must be after source node":"Source node not found for alias node";throw new Error("".concat(u," [").concat(n,"]"))}}]),Object(r.i)(n,[{key:"toJSON",value:function(e,t){if(!t)return a(this.source,e,t);var n=t.anchors,i=t.maxAliasCount,o=n.get(this.source);if(!o||void 0===o.res){var s="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new r.v(this.cstNode,s):new ReferenceError(s)}if(i>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=h(this.source,n)),o.count*o.aliasCount>i)){var l="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new r.v(this.cstNode,l):new ReferenceError(l)}return o.res}},{key:"toString",value:function(e){return n.stringify(this,e)}},{key:"tag",set:function(e){throw new Error("Alias nodes cannot have tags")}}]),n}(o);function g(e,t){var n,i=t instanceof s?t.value:t,o=Object(r.g)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a instanceof p){if(a.key===t||a.key===i)return a;if(a.key&&a.key.value===i)return a}}}catch(e){o.e(e)}finally{o.f()}}Object(r.l)(m,"default",!0);var v=function(e){Object(r.q)(n,e);var t=Object(r.r)(n);function n(){return Object(r.j)(this,n),t.apply(this,arguments)}return Object(r.i)(n,[{key:"add",value:function(e,t){e?e instanceof p||(e=new p(e.key||e,e.value)):e=new p(e);var n=g(this.items,e.key),r=this.schema&&this.schema.sortMapEntries;if(n){if(!t)throw new Error("Key ".concat(e.key," already set"));n.value=e.value}else if(r){var i=this.items.findIndex((function(t){return r(e,t)<0}));-1===i?this.items.push(e):this.items.splice(i,0,e)}else this.items.push(e)}},{key:"delete",value:function(e){var t=g(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}},{key:"get",value:function(e,t){var n=g(this.items,e),r=n&&n.value;return!t&&r instanceof s?r.value:r}},{key:"has",value:function(e){return!!g(this.items,e)}},{key:"set",value:function(e,t){this.add(new p(e,t),!0)}},{key:"toJSON",value:function(e,t,n){var i=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(i);var o,a=Object(r.g)(this.items);try{for(a.s();!(o=a.n()).done;){o.value.addToJSMap(t,i)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"toString",value:function(e,t,i){if(!e)return JSON.stringify(this);var o,a=Object(r.g)(this.items);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!(s instanceof p))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(s)," instead"))}}catch(e){a.e(e)}finally{a.f()}return Object(r.s)(Object(r.t)(n.prototype),"toString",this).call(this,e,{blockItem:function(e){return e.str},flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},t,i)}}]),n}(c),y=function(e){Object(r.q)(n,e);var t=Object(r.r)(n);function n(e){var i;if(Object(r.j)(this,n),e instanceof p){var o=e.value;o instanceof f||((o=new f).items.push(e.value),o.range=e.value.range),(i=t.call(this,e.key,o)).range=e.range}else i=t.call(this,new s("<<"),new f);return i.type=p.Type.MERGE_PAIR,Object(r.y)(i)}return Object(r.i)(n,[{key:"addToJSMap",value:function(e,t){var n,i=Object(r.g)(this.value.items);try{for(i.s();!(n=i.n()).done;){var o=n.value.source;if(!(o instanceof v))throw new Error("Merge sources must be maps");var a,s=o.toJSON(null,e,Map),l=Object(r.g)(s);try{for(l.s();!(a=l.n()).done;){var u=Object(r.o)(a.value,2),c=u[0],d=u[1];t instanceof Map?t.has(c)||t.set(c,d):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||(t[c]=d)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"toString",value:function(e,t){var i=this.value;if(i.items.length>1)return Object(r.s)(Object(r.t)(n.prototype),"toString",this).call(this,e,t);this.value=i.items[0];var o=Object(r.s)(Object(r.t)(n.prototype),"toString",this).call(this,e,t);return this.value=i,o}}]),n}(p),b={defaultType:r.e.BLOCK_LITERAL,lineWidth:76},_={trueStr:"true",falseStr:"false"},w={asBigInt:!1},x={nullStr:"null"},k={defaultType:r.e.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function E(e,t,n){var i,o=Object(r.g)(t);try{for(o.s();!(i=o.n()).done;){var a=i.value,l=a.format,u=a.test,c=a.resolve;if(u){var d=e.match(u);if(d){var f=c.apply(null,d);return f instanceof s||(f=new s(f)),l&&(f.format=l),f}}}}catch(e){o.e(e)}finally{o.f()}return n&&(e=n(e)),new s(e)}var S=function(e,t){for(var n=e[t+1];" "===n||"\t"===n;){do{n=e[t+=1]}while(n&&"\n"!==n);n=e[t+1]}return t};function O(e,t,n,r){var i=r.indentAtStart,o=r.lineWidth,a=void 0===o?80:o,s=r.minContentWidth,l=void 0===s?20:s,u=r.onFold,c=r.onOverflow;if(!a||a<0)return e;var d=Math.max(1+l,1+a-t.length);if(e.length<=d)return e;var f,p=[],h={},m=a-("number"==typeof i?i:t.length),g=void 0,v=void 0,y=!1,b=-1;for("block"===n&&-1!==(b=S(e,b))&&(m=b+d);f=e[b+=1];){if("quoted"===n&&"\\"===f)switch(e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}if("\n"===f)"block"===n&&(b=S(e,b)),m=b+d,g=void 0;else{if(" "===f&&v&&" "!==v&&"\n"!==v&&"\t"!==v){var _=e[b+1];_&&" "!==_&&"\n"!==_&&"\t"!==_&&(g=b)}if(b>=m)if(g)p.push(g),m=g+d,g=void 0;else if("quoted"===n){for(;" "===v||"\t"===v;)v=f,f=e[b+=1],y=!0;p.push(b-2),h[b-2]=!0,m=b-2+d,g=void 0}else y=!0}v=f}if(y&&c&&c(),0===p.length)return e;u&&u();for(var w=e.slice(0,p[0]),x=0;xt)return!0;if(n-(i=r+1)<=t)return!1}return!0}(s,k.fold.lineWidth-l.length)),d=c?"|":">";if(!s)return d+"\n";var f="",p="";if(s=s.replace(/[\n\t ]*$/,(function(e){var t=e.indexOf("\n");return-1===t?d+="-":s!==e&&t===e.length-1||(d+="+",i&&i()),p=e.replace(/\n$/,""),""})).replace(/^[\n ]*/,(function(e){-1!==e.indexOf(" ")&&(d+=u);var t=e.match(/ +$/);return t?(f=e.slice(0,-t[0].length),t[0]):(f=e,"")})),p&&(p=p.replace(/\n+(?!\n|$)/g,"$&".concat(l))),f&&(f=f.replace(/\n+/g,"$&".concat(l))),o&&(d+=" #"+o.replace(/ ?[\r\n]+/g," "),n&&n()),!s)return"".concat(d).concat(u,"\n").concat(l).concat(p);if(c)return s=s.replace(/\n+/g,"$&".concat(l)),"".concat(d,"\n").concat(l).concat(f).concat(s).concat(p);s=s.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,"$&".concat(l));var h=O("".concat(f).concat(s).concat(p),l,"block",k.fold);return"".concat(d,"\n").concat(l).concat(h)}function M(e,t,n,i){var o=k.defaultType,a=t.implicitKey,s=t.inFlow,l=e,u=l.type,c=l.value;"string"!=typeof c&&(c=String(c),e=Object.assign({},e,{value:c}));var d=function(o){switch(o){case r.e.BLOCK_FOLDED:case r.e.BLOCK_LITERAL:return R(e,t,n,i);case r.e.QUOTE_DOUBLE:return A(c,t);case r.e.QUOTE_SINGLE:return P(c,t);case r.e.PLAIN:return function(e,t,n,i){var o=e.comment,a=e.type,s=e.value,l=t.actualString,u=t.implicitKey,c=t.indent,d=t.inFlow;if(u&&/[\n[\]{},]/.test(s)||d&&/[[\]{},]/.test(s))return A(s,t);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return u||d||-1===s.indexOf("\n")?-1!==s.indexOf('"')&&-1===s.indexOf("'")?P(s,t):A(s,t):R(e,t,n,i);if(!u&&!d&&a!==r.e.PLAIN&&-1!==s.indexOf("\n"))return R(e,t,n,i);if(""===c&&C(s))return t.forceBlockIndent=!0,R(e,t,n,i);var f=s.replace(/\n+/g,"$&\n".concat(c));if(l){var p=t.doc.schema.tags;if("string"!=typeof E(f,p,p.scalarFallback).value)return A(s,t)}var h=u?f:O(f,c,"flow",T(t));return!o||d||-1===h.indexOf("\n")&&-1===o.indexOf("\n")?h:(n&&n(),function(e,t,n){if(!n)return e;var r=n.replace(/[\s\S]^/gm,"$&".concat(t,"#"));return"#".concat(r,"\n").concat(t).concat(e)}(h,c,o))}(e,t,n,i);default:return null}};u!==r.e.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(c)?u=r.e.QUOTE_DOUBLE:!a&&!s||u!==r.e.BLOCK_FOLDED&&u!==r.e.BLOCK_LITERAL||(u=r.e.QUOTE_DOUBLE);var f=d(u);if(null===f&&null===(f=d(o)))throw new Error("Unsupported default string type ".concat(o));return f}function I(e){var t=e.format,n=e.minFractionDigits,r=e.tag,i=e.value;if("bigint"==typeof i)return String(i);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";var o=JSON.stringify(i);if(!t&&n&&(!r||"tag:yaml.org,2002:float"===r)&&/^\d/.test(o)){var a=o.indexOf(".");a<0&&(a=o.length,o+=".");for(var s=n-(o.length-a-1);s-- >0;)o+="0"}return o}function j(e,t){var n,i,o;switch(t.type){case r.e.FLOW_MAP:n="}",i="flow map";break;case r.e.FLOW_SEQ:n="]",i="flow sequence";break;default:return void e.push(new r.n(t,"Not a flow collection!?"))}for(var a=t.items.length-1;a>=0;--a){var s=t.items[a];if(!s||s.type!==r.e.COMMENT){o=s;break}}if(o&&o.char!==n){var l,u="Expected ".concat(i," to end with ").concat(n);"number"==typeof o.offset?(l=new r.n(t,u)).offset=o.offset+1:(l=new r.n(o,u),o.range&&o.range.end&&(l.offset=o.range.end-o.range.start)),e.push(l)}}function D(e,t){var n=t.context.src[t.range.start-1];if("\n"!==n&&"\t"!==n&&" "!==n){e.push(new r.n(t,"Comments must be separated from other tokens by white space characters"))}}function L(e,t){var n=String(t),i=n.substr(0,8)+"..."+n.substr(-8);return new r.n(e,'The "'.concat(i,'" key is too long'))}function N(e,t){var n,i=Object(r.g)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.afterKey,s=o.before,l=o.comment,u=e.items[s];u?(a&&u.value&&(u=u.value),void 0===l?!a&&u.commentBefore||(u.spaceBefore=!0):u.commentBefore?u.commentBefore+="\n"+l:u.commentBefore=l):void 0!==l&&(e.comment?e.comment+="\n"+l:e.comment=l)}}catch(e){i.e(e)}finally{i.f()}}function F(e,t){var n=t.strValue;return n?"string"==typeof n?n:(n.errors.forEach((function(n){n.source||(n.source=t),e.errors.push(n)})),n.str):""}function B(e,t){var n=t.tag,i=t.type,o=!1;if(n){var a=n.handle,s=n.suffix,l=n.verbatim;if(l){if("!"!==l&&"!!"!==l)return l;var u="Verbatim tags aren't resolved, so ".concat(l," is invalid.");e.errors.push(new r.n(t,u))}else if("!"!==a||s)try{return function(e,t){var n=t.tag,i=n.handle,o=n.suffix,a=e.tagPrefixes.find((function(e){return e.handle===i}));if(!a){var s=e.getDefaults().tagPrefixes;if(s&&(a=s.find((function(e){return e.handle===i}))),!a)throw new r.n(t,"The ".concat(i," tag handle is non-default and was not declared."))}if(!o)throw new r.n(t,"The ".concat(i," tag has no suffix."));if("!"===i&&"1.0"===(e.version||e.options.version)){if("^"===o[0])return e.warnings.push(new r.m(t,"YAML 1.0 ^ tag expansion is not supported")),o;if(/[:/]/.test(o)){var l=o.match(/^([a-z0-9-]+)\/(.*)/i);return l?"tag:".concat(l[1],".yaml.org,2002:").concat(l[2]):"tag:".concat(o)}}return a.prefix+decodeURIComponent(o)}(e,t)}catch(t){e.errors.push(t)}else o=!0}switch(i){case r.e.BLOCK_FOLDED:case r.e.BLOCK_LITERAL:case r.e.QUOTE_DOUBLE:case r.e.QUOTE_SINGLE:return r.u.STR;case r.e.FLOW_MAP:case r.e.MAP:return r.u.MAP;case r.e.FLOW_SEQ:case r.e.SEQ:return r.u.SEQ;case r.e.PLAIN:return o?r.u.STR:null;default:return null}}function z(e,t,n){var i,o=e.schema.tags,a=[],l=Object(r.g)(o);try{for(l.s();!(i=l.n()).done;){var u=i.value;if(u.tag===n){if(!u.test){var d=u.resolve(e,t);return d instanceof c?d:new s(d)}a.push(u)}}}catch(e){l.e(e)}finally{l.f()}var f=F(e,t);return"string"==typeof f&&a.length>0?E(f,a,o.scalarFallback):null}function U(e,t,n){try{var i=z(e,t,n);if(i)return n&&t.tag&&(i.tag=n),i}catch(n){return n.source||(n.source=t),e.errors.push(n),null}try{var o=function(e){switch(e.type){case r.e.FLOW_MAP:case r.e.MAP:return r.u.MAP;case r.e.FLOW_SEQ:case r.e.SEQ:return r.u.SEQ;default:return r.u.STR}}(t);if(!o)throw new Error("The tag ".concat(n," is unavailable"));var a="The tag ".concat(n," is unavailable, falling back to ").concat(o);e.warnings.push(new r.m(t,a));var s=z(e,t,o);return s.tag=n,s}catch(n){var l=new r.v(t,n.message);return l.stack=n.stack,e.errors.push(l),null}}function q(e,t){var n,i={before:[],after:[]},o=!1,a=!1,s=function(e){if(!e)return!1;var t=e.type;return t===r.e.MAP_KEY||t===r.e.MAP_VALUE||t===r.e.SEQ_ITEM}(t.context.parent)?t.context.parent.props.concat(t.props):t.props,l=Object(r.g)(s);try{for(l.s();!(n=l.n()).done;){var u=n.value,c=u.start,d=u.end;switch(t.context.src[c]){case r.a.COMMENT:if(!t.commentHasRequiredWhitespace(c)){e.push(new r.n(t,"Comments must be separated from other tokens by white space characters"))}var f=t.header,p=t.valueRange;(p&&(c>p.start||f&&c>f.start)?i.after:i.before).push(t.context.src.slice(c+1,d));break;case r.a.ANCHOR:if(o){e.push(new r.n(t,"A node can have at most one anchor"))}o=!0;break;case r.a.TAG:if(a){e.push(new r.n(t,"A node can have at most one tag"))}a=!0}}}catch(e){l.e(e)}finally{l.f()}return{comments:i,hasAnchor:o,hasTag:a}}function H(e,t){if(!t)return null;t.error&&e.errors.push(t.error);var n=q(e.errors,t),i=n.comments,o=n.hasAnchor,a=n.hasTag;if(o){var s=e.anchors,l=t.anchor,u=s.getNode(l);u&&(s.map[s.newName(l)]=u),s.map[l]=t}if(t.type===r.e.ALIAS&&(o||a)){e.errors.push(new r.n(t,"An alias node must not specify any properties"))}var c=function(e,t){var n=e.anchors,i=e.errors,o=e.schema;if(t.type===r.e.ALIAS){var a=t.rawValue,s=n.getNode(a);if(!s){var l="Aliased anchor not found: ".concat(a);return i.push(new r.v(t,l)),null}var u=new m(s);return n._cstAliases.push(u),u}var c=B(e,t);if(c)return U(e,t,c);if(t.type!==r.e.PLAIN){var d="Failed to resolve ".concat(t.type," node here");return i.push(new r.f(t,d)),null}try{return E(F(e,t),o.tags,o.tags.scalarFallback)}catch(e){return e.source||(e.source=t),i.push(e),null}}(e,t);if(c){c.range=[t.range.start,t.range.end],e.options.keepCstNodes&&(c.cstNode=t),e.options.keepNodeTypes&&(c.type=t.type);var d=i.before.join("\n");d&&(c.commentBefore=c.commentBefore?"".concat(c.commentBefore,"\n").concat(d):d);var f=i.after.join("\n");f&&(c.comment=c.comment?"".concat(c.comment,"\n").concat(f):f)}return t.resolved=c}function W(e,t){if(t.type!==r.e.MAP&&t.type!==r.e.FLOW_MAP){var n="A ".concat(t.type," node cannot be resolved as a mapping");return e.errors.push(new r.f(t,n)),null}var i=t.type===r.e.FLOW_MAP?function(e,t){for(var n=[],i=[],o=void 0,a=!1,s="{",l=0;l0){(u=new r.c(r.e.PLAIN,[])).context={parent:l,src:l.context.src};var c=l.range.start+1;if(u.range={start:c,end:c},u.valueRange={start:c,end:c},"number"==typeof l.range.origStart){var d=l.range.origStart+1;u.range.origStart=u.range.origEnd=d,u.valueRange.origStart=u.valueRange.origEnd=d}}var f=new p(o,H(e,u));V(l,f),i.push(f),o&&"number"==typeof a&&l.range.start>a+1024&&e.errors.push(L(t,o)),o=void 0,a=null;break;default:void 0!==o&&i.push(new p(o)),o=H(e,l),a=l.range.start,l.error&&e.errors.push(l.error);e:for(var h=s+1;;++h){var m=t.items[h];switch(m&&m.type){case r.e.BLANK_LINE:case r.e.COMMENT:continue e;case r.e.MAP_VALUE:break e;default:e.errors.push(new r.n(l,"Implicit map keys need to be followed by map values"));break e}}if(l.valueRangeContainsNewline){e.errors.push(new r.n(l,"Implicit map keys need to be on a single line"))}}}void 0!==o&&i.push(new p(o));return{comments:n,items:i}}(e,t),o=i.comments,a=i.items,s=new v;s.items=a,N(s,o);for(var l=!1,u=0;ui.valueRange.start)return!1;if(o[s]!==r.a.COMMENT)return!1;for(var l=n;ls+1024&&e.errors.push(L(t,a));for(var v=u.context.src,y=s;yr&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0p)&&(B=(q=q.replace(" ",":")).length),00){var r=n.connection.filter?n.connection.filter:[];r.sort();var i=t,o={};return r.forEach((function(e){o[e]=i[e]})),n.connection.key+"("+JSON.stringify(o)+")"}return n.connection.key}var a=e;if(t){var l=s()(t);a+="("+l+")"}return n&&Object.keys(n).forEach((function(e){-1===c.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?a+="@"+e+"("+JSON.stringify(n[e])+")":a+="@"+e)})),a}function f(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return l(n,r,i,t)})),n}return null}function p(e){return e.alias?e.alias.value:e.name.value}function h(e){return"Field"===e.kind}function m(e){return"InlineFragment"===e.kind}function g(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function v(e,t){return void 0===t&&(t=!1),Object(o.a)({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function y(e){return null!=e&&"object"==typeof e&&"json"===e.type}function b(e,t){if(e.directives&&e.directives.length){var n={};return e.directives.forEach((function(e){n[e.name.value]=f(e,t)})),n}return null}function _(e,t){return void 0===t&&(t={}),(n=e.directives,n?n.filter(k).map((function(e){var t=e.arguments;e.name.value,Object(i.b)(t&&1===t.length,14);var n=t[0];Object(i.b)(n.name&&"if"===n.name.value,15);var r=n.value;return Object(i.b)(r&&("Variable"===r.kind||"BooleanValue"===r.kind),16),{directive:e,ifArgument:n}})):[]).every((function(e){var n=e.directive,r=e.ifArgument,o=!1;return"Variable"===r.value.kind?(o=t[r.value.name.value],Object(i.b)(void 0!==o,13)):o=r.value.value,"skip"===n.name.value?!o:o}));var n}function w(e,t){return function(e){var t=[];return Object(r.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function x(e){return e&&w(["client"],e)&&w(["export"],e)}function k(e){var t=e.name.value;return"skip"===t||"include"===t}function E(e,t){var n=t,r=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.a(11);"FragmentDefinition"===e.kind&&r.push(e)})),void 0===n&&(Object(i.b)(1===r.length,12),n=r[0].name.value),Object(o.a)(Object(o.a)({},e),{definitions:Object(o.f)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],e.definitions)})}function S(e){for(var t=[],n=1;n1){var r=[];t=ie(t,r);for(var i=1;i1?(n=i,r=o):u>0&&(n+=s*u,r+=l*u)}return a(e,t,n,r)}function a(e,t,n,r){var i=n-e,o=r-t;return i*i+o*o}function s(e){for(var t=e.length,n=0;ni&&(i=a,r=o)}if(0===i)return null;var s=e[r];e[r]=e[n],e[n]=s;for(var l=n+1;l=0;f--){d[f]=e[f][t]/e[f][f];for(var p=f-1;p>=0;p--)e[p][t]-=e[p][f]*d[f]}return d}function l(e){return 180*e/Math.PI}function u(e){return e*Math.PI/180}function c(e,t){var n=e%t;return n*t<0?n+t:n}function d(e,t,n){return e+n*(t-e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Dropdown",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DropdownItem",{enumerable:!0,get:function(){return r.DropdownItem}}),Object.defineProperty(t,"DropdownCheckedItem",{enumerable:!0,get:function(){return r.DropdownCheckedItem}}),Object.defineProperty(t,"DropdownButton",{enumerable:!0,get:function(){return r.DropdownButton}}),Object.defineProperty(t,"StyledDropdownButton",{enumerable:!0,get:function(){return r.StyledDropdownButton}}),Object.defineProperty(t,"Icon",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"ListItemTopBar",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"Loader",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"FieldLabel",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"IconButton",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Toggle",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"ToggleContainer",{enumerable:!0,get:function(){return u.ToggleContainer}}),Object.defineProperty(t,"ToggleBackground",{enumerable:!0,get:function(){return u.ToggleBackground}}),Object.defineProperty(t,"ToggleHandle",{enumerable:!0,get:function(){return u.ToggleHandle}}),Object.defineProperty(t,"AuthenticationPage",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"WidgetPreviewContainer",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"ObjectWidgetTopBar",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"GoBackButton",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"fonts",{enumerable:!0,get:function(){return h.fonts}}),Object.defineProperty(t,"colorsRaw",{enumerable:!0,get:function(){return h.colorsRaw}}),Object.defineProperty(t,"colors",{enumerable:!0,get:function(){return h.colors}}),Object.defineProperty(t,"lengths",{enumerable:!0,get:function(){return h.lengths}}),Object.defineProperty(t,"components",{enumerable:!0,get:function(){return h.components}}),Object.defineProperty(t,"buttons",{enumerable:!0,get:function(){return h.buttons}}),Object.defineProperty(t,"text",{enumerable:!0,get:function(){return h.text}}),Object.defineProperty(t,"shadows",{enumerable:!0,get:function(){return h.shadows}}),Object.defineProperty(t,"borders",{enumerable:!0,get:function(){return h.borders}}),Object.defineProperty(t,"transitions",{enumerable:!0,get:function(){return h.transitions}}),Object.defineProperty(t,"effects",{enumerable:!0,get:function(){return h.effects}}),Object.defineProperty(t,"zIndex",{enumerable:!0,get:function(){return h.zIndex}}),Object.defineProperty(t,"reactSelectStyles",{enumerable:!0,get:function(){return h.reactSelectStyles}}),Object.defineProperty(t,"GlobalStyles",{enumerable:!0,get:function(){return h.GlobalStyles}}),t.NetlifyCmsUiDefault=void 0;var r=v(n(528)),i=m(n(167)),o=m(n(1014)),a=m(n(1015)),s=m(n(1016)),l=m(n(1017)),u=v(n(1018)),c=m(n(1020)),d=m(n(1021)),f=m(n(1022)),p=m(n(534)),h=n(111);function m(e){return e&&e.__esModule?e:{default:e}}function g(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return g=function(){return e},e}function v(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=g();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}const y={Dropdown:r.default,DropdownItem:r.DropdownItem,DropdownCheckedItem:r.DropdownCheckedItem,DropdownButton:r.DropdownButton,StyledDropdownButton:r.StyledDropdownButton,ListItemTopBar:o.default,FieldLabel:s.default,Icon:i.default,IconButton:l.default,Loader:a.default,Toggle:u.default,ToggleContainer:u.ToggleContainer,ToggleBackground:u.ToggleBackground,ToggleHandle:u.ToggleHandle,AuthenticationPage:c.default,WidgetPreviewContainer:d.default,ObjectWidgetTopBar:f.default,fonts:h.fonts,colorsRaw:h.colorsRaw,colors:h.colors,lengths:h.lengths,components:h.components,buttons:h.buttons,shadows:h.shadows,text:h.text,borders:h.borders,transitions:h.transitions,effects:h.effects,zIndex:h.zIndex,reactSelectStyles:h.reactSelectStyles,GlobalStyles:h.GlobalStyles};t.NetlifyCmsUiDefault=y},function(e,t,n){"use strict";t.a={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4,ABORT:5}},function(e,t,n){"use strict";n.r(t);var r=n(665),i=n.n(r),o=n(1);var a=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|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|decoding|default|defer|dir|disabled|disablePictureInPicture|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|loading|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|inert|itemProp|itemScope|itemType|itemID|itemRef|on|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|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return a.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),l=n(11),u=n(131),c=n(129),d=s,f=function(e){return"theme"!==e&&"innerRef"!==e},p=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?d:f};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C=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},A=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},P=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);to)return 1}return e.size===t.size?0:null}function M(e){if(null==e)return null;if(r.List.isList(e))return e;if(Array.isArray(e))return Object(r.List)(e);throw new Error("Paths can only be created from arrays or lists, but you passed: "+e)}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:B(e,t),r=e.slice(0,n),i=t.slice(0,n);return[r,i]}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size-1;return D(e,0-t,n)}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size-1,r=e.get(n),i=r+t,o=e.set(n,i);return o}function L(e,t){var n=I(e,t),r=A(n,2),i=r[0],o=r[1];return e.sizel},isPath:function(e){return(r.List.isList(e)||Array.isArray(e))&&e.every((function(e){return"number"==typeof e}))},isSibling:function(e,t){if(e.size!==t.size)return!1;var n=e.butLast(),r=t.butLast();return n.equals(r)},isYounger:F,lift:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.slice(0,-1*t);return n},drop:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.slice(t);return n},max:function(e,t){return Math.max(e.size,t.size)},min:B,relate:function(e,t){for(var n=[],r=0;r=i&&(e=j(e=D(e,1,a),i,a+1))),"move_node"===n){var c=t.newPath;if(N(o,c))return Object(r.List)([e]);u||s?e=F(o,c)&&o.sizee.offset||1===z.compare(this.path,e.path))}},{key:"isAfterRange",value:function(e){return!this.isUnset&&this.isAfterPoint(e.end)}},{key:"isAtEndOfRange",value:function(e){return!this.isUnset&&this.equals(e.end)}},{key:"isAtStartOfRange",value:function(e){return!this.isUnset&&this.equals(e.start)}},{key:"isBeforePoint",value:function(e){return!this.isUnset&&(this.key===e.key&&this.offset0&&void 0!==arguments[0]?arguments[0]:1;if(0===e)return this;if(e<0)return this.moveForward(-e);var t=this.setOffset(this.offset-e);return t}},{key:"moveForward",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(0===e)return this;if(e<0)return this.moveBackward(-e);var t=this.setOffset(this.offset+e);return t}},{key:"moveTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.key;"number"==typeof e?(t=e,e=this.path):"string"==typeof e?e=(n=e)===this.key?this.path:null:n=e.equals(this.path)?this.key:null;var r=this.merge({key:n,path:e,offset:t});return r}},{key:"moveToStartOfNode",value:function(e){var t=e.getFirstText();return this.moveTo(t.key,0)}},{key:"moveToEndOfNode",value:function(e){var t=e.getLastText();return this.moveTo(t.key,t.text.length)}},{key:"normalize",value:function(e){if(null==this.key&&null==this.path)return this.setOffset(null);var n=this.key,r=this.offset,i=this.path,o=i&&e.getNode(i);if(!o&&(o=e.getNode(n)))return this.merge({path:e.getPath(n)});if(!o){Object(a.a)(!1,"A point's `path` or `key` invalid and was reset!");var s=e.getFirstText();return s?this.merge({key:s.key,offset:0,path:e.getPath(s.key)}):t.create()}if("text"!==o.object){Object(a.a)(!1,"A point should not reference a non-text node!");var l=o.getTextAtOffset(r),u=o.getOffset(l.key);return this.merge({offset:r-u,key:l.key,path:e.getPath(l.key)})}o&&i&&n&&n!==o.key&&Object(a.a)(!1,"A point's `key` did not match its `path`!");var c=this.merge({key:o.key,path:null==i?e.getPath(o.key):i,offset:null==r?0:Math.min(r,o.text.length)});if(c.offset===o.text.length){var d=e.getClosestBlock(c.path).getNextText();d&&(c=c.merge({key:d.key,path:e.getPath(d.key),offset:0}))}return c}},{key:"setKey",value:function(e){return null!=e&&(e=_.create(e)),this.set("key",e)}},{key:"setOffset",value:function(e){return this.set("offset",e)}},{key:"setPath",value:function(e){return null!=e&&(e=z.create(e)),this.set("path",e)}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,key:this.key,offset:this.offset,path:this.path&&this.path.toArray()};return e.preserveKeys||delete t.key,t}},{key:"unset",value:function(){return this.merge({key:null,offset:null,path:null})}},{key:"isSet",get:function(){return null!=this.key&&null!=this.offset&&null!=this.path}},{key:"isUnset",get:function(){return!this.isSet}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isPoint(e))return e;if(o()(e))return t.fromJSON(e);throw new Error("`Point.create` only accepts objects or points, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isPoint(e))return{key:e.key,offset:e.offset,path:e.path};if(o()(e)){var n={};return"key"in e&&(n.key=e.key),"offset"in e&&(n.offset=e.offset),"path"in e&&(n.path=z.create(e.path)),"path"in e&&!("key"in e)&&(n.key=null),"key"in e&&!("path"in e)&&(n.path=null),n}throw new Error("`Point.createProperties` only accepts objects or points, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.key,r=void 0===n?null:n,i=e.offset,o=void 0===i?null:i,a=e.path,s=void 0===a?null:a;return new t({key:r,offset:o,path:z.create(s)})}}]),t}(Object(r.Record)(U)),H=function(){function e(){x(this,e)}return k(e,null,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.Map.isMap(t))return t;if(o()(t))return e.fromJSON(t);throw new Error("`Data.create` only accepts objects or maps, but you passed it: "+t)}},{key:"fromJSON",value:function(e){return new r.Map(e)}}]),e}();H.fromJS=H.fromJSON;var W={data:void 0,type:void 0},V=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"toJSON",value:function(){return{object:this.object,type:this.type,data:this.data.toJSON()}}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isMark(e))return e;if("string"==typeof e&&(e={type:e}),o()(e))return t.fromJSON(e);throw new Error("`Mark.create` only accepts objects, strings or marks, but you passed it: "+e)}},{key:"createSet",value:function(e){if(r.Set.isSet(e)||Array.isArray(e))return new r.Set(e.map(t.create));if(null==e)return Object(r.Set)();throw new Error("`Mark.createSet` only accepts sets, arrays or null, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isMark(e))return{data:e.data,type:e.type};if("string"==typeof e)return{type:e};if(o()(e)){var n={};return"type"in e&&(n.type=e.type),"data"in e&&(n.data=H.create(e.data)),n}throw new Error("`Mark.createProperties` only accepts objects, strings or marks, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.data,i=void 0===n?{}:n,o=e.type;if("string"!=typeof o)throw new Error("`Mark.fromJS` requires a `type` string.");return new t({type:o,data:new r.Map(i)})}},{key:"isMarkSet",value:function(e){return r.Set.isSet(e)&&e.every((function(e){return t.isMark(e)}))}}]),t}(Object(r.Record)(W)),$={type:void 0,data:void 0,anchor:void 0,focus:void 0},G=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"setProperties",value:function(e){return e=t.createProperties(e),this.merge(e)}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,type:this.type,data:this.data.toJSON(),anchor:this.anchor.toJSON(e),focus:this.focus.toJSON(e)};return t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isDecoration(e))return e;if(Z.isRange(e))return t.fromJSON(Z.createProperties(e));if(o()(e))return t.fromJSON(e);throw new Error("`Decoration.create` only accepts objects or decorations, but you passed it: "+e)}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Decoration.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isDecoration(e))return{type:e.type,data:e.data,anchor:q.createProperties(e.anchor),focus:q.createProperties(e.focus),mark:V.create(e.mark)};if(o()(e)){var n={};return"type"in e&&(n.type=e.type),"data"in e&&(n.data=H.create(e.data)),"anchor"in e&&(n.anchor=q.create(e.anchor)),"focus"in e&&(n.focus=q.create(e.focus)),n}throw new Error("`Decoration.createProperties` only accepts objects or decorations, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.anchor,r=e.focus,i=e.type,o=e.data;if(e.mark&&!i&&(Object(a.a)(!1,"As of slate@0.47 the `decoration.mark` property has been changed to `decoration.type` and `decoration.data` directly."),i=e.mark.type,o=e.mark.data),!i)throw new Error("Decorations must be created with a `type`, but you passed: "+JSON.stringify(e));return new t({type:i,data:H.create(o||{}),anchor:q.fromJSON(n||{}),focus:q.fromJSON(r||{})})}}]),t}(Object(r.Record)($)),K={anchor:void 0,focus:void 0,isFocused:void 0,marks:void 0},Y=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"setIsFocused",value:function(e){return this.set("isFocused",e)}},{key:"setMarks",value:function(e){return this.set("marks",e)}},{key:"setProperties",value:function(e){var n=e=t.createProperties(e),r=n.anchor,i=n.focus,o=T(n,["anchor","focus"]);return r&&(o.anchor=q.create(r)),i&&(o.focus=q.create(i)),this.merge(o)}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,anchor:this.anchor.toJSON(e),focus:this.focus.toJSON(e),isFocused:this.isFocused,marks:null==this.marks?null:this.marks.toArray().map((function(e){return e.toJSON()}))};return t}},{key:"isBlurred",get:function(){return!this.isFocused}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isSelection(e))return e;if(Z.isRange(e))return t.fromJSON(Z.createProperties(e));if(o()(e))return t.fromJSON(e);throw new Error("`Selection.create` only accepts objects, ranges or selections, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isSelection(e))return{anchor:q.createProperties(e.anchor),focus:q.createProperties(e.focus),isFocused:e.isFocused,marks:e.marks};if(Z.isRange(e))return{anchor:q.createProperties(e.anchor),focus:q.createProperties(e.focus)};if(o()(e)){var n={};return"anchor"in e&&(n.anchor=q.create(e.anchor)),"focus"in e&&(n.focus=q.create(e.focus)),"isFocused"in e&&(n.isFocused=e.isFocused),"marks"in e&&(n.marks=null==e.marks?null:V.createSet(e.marks)),n}throw new Error("`Selection.createProperties` only accepts objects, ranges or selections, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.anchor,i=e.focus,o=e.isFocused,a=void 0!==o&&o,s=e.marks,l=void 0===s?null:s;return new t({anchor:q.fromJSON(n||{}),focus:q.fromJSON(i||{}),isFocused:a,marks:null==l?null:new r.Set(l.map(V.fromJSON))})}}]),t}(Object(r.Record)(K)),Q={annotation:"@@__SLATE_ANNOTATION__@@",block:"@@__SLATE_BLOCK__@@",change:"@@__SLATE_CHANGE__@@",decoration:"@@__SLATE_DECORATION__@@",document:"@@__SLATE_DOCUMENT__@@",editor:"@@__SLATE_EDITOR__@@",inline:"@@__SLATE_INLINE__@@",leaf:"@@__SLATE_LEAF__@@",mark:"@@__SLATE_MARK__@@",operation:"@@__SLATE_OPERATION__@@",point:"@@__SLATE_POINT__@@",range:"@@__SLATE_RANGE__@@",selection:"@@__SLATE_SELECTION__@@",text:"@@__SLATE_TEXT__@@",value:"@@__SLATE_VALUE__@@"};function X(e,t){return!(!t||!t[Q[e]])}var J={anchor:void 0,focus:void 0},Z=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,anchor:this.anchor.toJSON(e),focus:this.focus.toJSON(e)};return t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isRange(e))return"range"===e.object?e:t.fromJSON(t.createProperties(e));if(o()(e))return t.fromJSON(e);throw new Error("`Range.create` only accepts objects or ranges, but you passed it: "+e)}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Range.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isRange(e))return{anchor:q.createProperties(e.anchor),focus:q.createProperties(e.focus)};if(o()(e)){var n={};return"anchor"in e&&(n.anchor=q.create(e.anchor)),"focus"in e&&(n.focus=q.create(e.focus)),n}throw new Error("`Range.createProperties` only accepts objects, annotations, decorations, ranges or selections, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.anchor,r=e.focus;return new t({anchor:q.fromJSON(n||{}),focus:q.fromJSON(r||{})})}},{key:"isRange",value:function(e){return X("range",e)||G.isDecoration(e)||Y.isSelection(e)}}]),t}(Object(r.Record)(J)),ee={key:void 0,type:void 0,data:void 0,anchor:void 0,focus:void 0},te=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"setProperties",value:function(e){return e=t.createProperties(e),this.merge(e)}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,key:this.key,type:this.type,data:this.data.toJSON(),anchor:this.anchor.toJSON(e),focus:this.focus.toJSON(e)};return t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isAnnotation(e))return e;if(Z.isRange(e))return t.fromJSON(Z.createProperties(e));if(o()(e))return t.fromJSON(e);throw new Error("`Annotation.create` only accepts objects or annotations, but you passed it: "+e)}},{key:"createMap",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.Map.isMap(e))return e;if(o()(e)){var n={};for(var i in e){var a=e[i],s=t.create(a);n[i]=s}return Object(r.Map)(n)}throw new Error("`Annotation.createMap` only accepts arrays or lists, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isAnnotation(e))return{key:e.key,type:e.type,data:e.data,anchor:q.createProperties(e.anchor),focus:q.createProperties(e.focus)};if(o()(e)){var n={};return"key"in e&&(n.key=e.key),"type"in e&&(n.type=e.type),"data"in e&&(n.data=H.create(e.data)),"anchor"in e&&(n.anchor=q.create(e.anchor)),"focus"in e&&(n.focus=q.create(e.focus)),n}throw new Error("`Annotation.createProperties` only accepts objects or annotations, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.key,r=e.type,i=e.data,o=e.anchor,a=e.focus;if(!n)throw new Error("Annotations must be created with a `key`, but you passed: "+JSON.stringify(e));if(!r)throw new Error("Annotations must be created with a `type`, but you passed: "+JSON.stringify(e));return new t({key:n,type:r,data:H.create(i||{}),anchor:q.fromJSON(o||{}),focus:q.fromJSON(a||{})})}}]),t}(Object(r.Record)(ee)),ne={data:void 0,key:void 0,nodes:void 0},re=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,data:this.data.toJSON(),nodes:this.nodes.toArray().map((function(t){return t.toJSON(e)}))};return e.preserveKeys&&(t.key=this.key),t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isDocument(e))return e;if((r.List.isList(e)||Array.isArray(e))&&(e={nodes:e}),o()(e))return t.fromJSON(e);throw new Error("`Document.create` only accepts objects, arrays, lists or documents, but you passed it: "+e)}},{key:"fromJSON",value:function(e){if(t.isDocument(e))return e;var n=e.data,i=void 0===n?{}:n,o=e.key,a=void 0===o?_.create():o,s=e.nodes,l=void 0===s?[]:s;return new t({key:a,data:new r.Map(i),nodes:ue.createList(l)})}}]),t}(Object(r.Record)(ne)),ie={data:void 0,key:void 0,nodes:void 0,type:void 0},oe=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,type:this.type,data:this.data.toJSON(),nodes:this.nodes.toArray().map((function(t){return t.toJSON(e)}))};return e.preserveKeys&&(t.key=this.key),t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isInline(e))return e;if("string"==typeof e&&(e={type:e}),o()(e))return t.fromJSON(e);throw new Error("`Inline.create` only accepts objects, strings or inlines, but you passed it: "+e)}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Inline.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"fromJSON",value:function(e){if(t.isInline(e))return e;var n=e.data,i=void 0===n?{}:n,o=e.key,a=void 0===o?_.create():o,s=e.nodes,l=void 0===s?[]:s,u=e.type;if("string"!=typeof u)throw new Error("`Inline.fromJS` requires a `type` string.");return new t({key:a,type:u,data:new r.Map(i),nodes:ue.createList(l)})}},{key:"isInlineList",value:function(e){return r.List.isList(e)&&e.every((function(e){return t.isInline(e)}))}}]),t}(Object(r.Record)(ie)),ae={key:void 0,marks:void 0,text:void 0},se=Object(r.Record)({text:void 0,marks:void 0,annotations:void 0,decorations:void 0}),le=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"addMark",value:function(e){e=V.create(e);var t=this.marks.add(e);return this.set("marks",t)}},{key:"addMarks",value:function(e){return e=V.createSet(e),this.set("marks",this.marks.union(e))}},{key:"getLeaves",value:function(e,t){var n=[{text:this.text,marks:this.marks,annotations:[],decorations:[]}],i=function(e,t){return[{text:e.text.slice(0,t),marks:e.marks,annotations:[].concat(P(e.annotations)),decorations:[].concat(P(e.decorations))},{text:e.text.slice(t),marks:e.marks,annotations:[].concat(P(e.annotations)),decorations:[].concat(P(e.decorations))}]},o=function(r){var o="annotations"===r?e.values():t,a=!0,s=!1,l=void 0;try{for(var u,c=o[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var d=u.value,f=d.start,p=d.end,h=[],m=0,g=!0,v=!1,y=void 0;try{for(var b,_=n[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){var w=b.value,x=w.text.length,k=m;if(m+=x,f.offset<=k&&p.offset>=k+x)w[r].push(d),h.push(w);else if(f.offset>k+x||p.offsetk){var P=i(E,f.offset-k),R=A(P,2);S=R[0],E=R[1]}E[r].push(d),S&&h.push(S),h.push(E),O&&h.push(O)}}}catch(e){v=!0,y=e}finally{try{!g&&_.return&&_.return()}finally{if(v)throw y}}n=h}}catch(e){s=!0,l=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}};return o("annotations"),o("decorations"),n=n.map((function(e){return new se(S({},e,{annotations:Object(r.List)(e.annotations),decorations:Object(r.List)(e.decorations)}))})),Object(r.List)(n)}},{key:"insertText",value:function(e,t){var n=this.text,r=n.slice(0,e)+t+n.slice(e);return this.set("text",r)}},{key:"removeMark",value:function(e){e=V.create(e);var t=this.marks.remove(e);return this.set("marks",t)}},{key:"removeText",value:function(e,t){var n=this.text,r=n.slice(0,e)+n.slice(e+t);return this.set("text",r)}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,text:this.text,marks:this.marks.toArray().map((function(e){return e.toJSON()}))};return e.preserveKeys&&(t.key=this.key),t}},{key:"setMark",value:function(e,t){var n=this.marks,r=V.create(e),i=r.merge(t),o=n.remove(r).add(i);return this.set("marks",o)}},{key:"splitText",value:function(e){var t=this.text;return[this.set("text",t.slice(0,e)),this.set("text",t.slice(e)).regenerateKey()]}},{key:"mergeText",value:function(e){var t=this.text+e.text;return this.set("text",t)}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(t.isText(e))return e;if("string"==typeof e&&(e={text:e}),o()(e))return t.fromJSON(e);throw new Error("`Text.create` only accepts objects, arrays, strings or texts, but you passed it: "+e)}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Text.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"fromJSON",value:function(e){if(t.isText(e))return e;Object(s.a)(null==e.leaves,"As of slate@0.46, the `leaves` property of text nodes has been removed! Each individual leaf should be created as a text node instead.");var n=e.text,r=void 0===n?"":n,i=e.marks,o=void 0===i?[]:i,a=e.key;return new t({key:void 0===a?_.create():a,text:r,marks:V.createSet(o)})}},{key:"isTextList",value:function(e){return r.List.isList(e)&&e.every((function(e){return t.isText(e)}))}}]),t}(Object(r.Record)(ae)),ue=function(){function e(){x(this,e)}return k(e,null,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.isNode(t))return t;if(o()(t)){var n=t.object;switch(!n&&t.kind&&(Object(a.a)(!1,"As of slate@0.32.0, the `kind` property of Slate objects has been renamed to `object`."),n=t.kind),n){case"block":return de.create(t);case"document":return re.create(t);case"inline":return oe.create(t);case"text":return le.create(t);default:throw new Error("`Node.create` requires a `object` string.")}}throw new Error("`Node.create` only accepts objects or nodes but you passed it: "+t)}},{key:"createList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(t)||Array.isArray(t)){var n=[];t.forEach((function(t){if(t&&"text"===t.object&&t.leaves&&Array.isArray(t.leaves)){Object(a.a)(!1,"As of slate@0.46, the `leaves` property of Text nodes has been removed. Instead, each text node contains a string of text and a unique set of marks and leaves are unnecessary.");var r=le.createList(t.leaves).toArray();n=n.concat(r)}else{var i=e.create(t);n.push(i)}}));var i=Object(r.List)(n);return i}throw new Error("`Node.createList` only accepts lists or arrays, but you passed it: "+t)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(de.isBlock(e)||oe.isInline(e))return{data:e.data,type:e.type};if("string"==typeof e)return{type:e};if(o()(e)){var t={};return"type"in e&&(t.type=e.type),"data"in e&&(t.data=H.create(e.data)),t}throw new Error("`Node.createProperties` only accepts objects, strings, blocks or inlines, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var t=e.object;switch(!t&&e.kind&&(Object(a.a)(!1,"As of slate@0.32.0, the `kind` property of Slate objects has been renamed to `object`."),t=e.kind),t){case"block":return de.fromJSON(e);case"document":return re.fromJSON(e);case"inline":return oe.fromJSON(e);case"text":return le.fromJSON(e);default:throw new Error("`Node.fromJSON` requires an `object` of either 'block', 'document', 'inline' or 'text', but you passed: "+e)}}},{key:"isNode",value:function(e){return de.isBlock(e)||re.isDocument(e)||oe.isInline(e)||le.isText(e)}},{key:"isNodeList",value:function(t){return r.List.isList(t)&&t.every((function(t){return e.isNode(t)}))}}]),e}(),ce={data:void 0,key:void 0,nodes:void 0,type:void 0},de=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,type:this.type,data:this.data.toJSON(),nodes:this.nodes.toArray().map((function(t){return t.toJSON(e)}))};return e.preserveKeys&&(t.key=this.key),t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isBlock(e))return e;if("string"==typeof e&&(e={type:e}),o()(e))return t.fromJSON(e);throw new Error("`Block.create` only accepts objects, strings or blocks, but you passed it: "+e)}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Block.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"fromJSON",value:function(e){if(t.isBlock(e))return e;var n=e.data,i=void 0===n?{}:n,o=e.key,a=void 0===o?_.create():o,s=e.nodes,l=void 0===s?[]:s,u=e.type;if("string"!=typeof u)throw new Error("`Block.fromJSON` requires a `type` string.");return new t({key:a,type:u,data:Object(r.Map)(i),nodes:ue.createList(l)})}},{key:"isBlockList",value:function(e){return r.List.isList(e)&&e.every((function(e){return t.isBlock(e)}))}}]),t}(Object(r.Record)(ce)),fe={annotations:void 0,data:void 0,document:void 0,selection:void 0},pe=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"addAnnotation",value:function(e){e=te.create(e);var t=this,n=t,r=n.annotations,i=n.document,o=e.key;return e=e.updatePoints((function(e){return e.normalize(i)})),r=r.set(o,e),t=t.set("annotations",r)}},{key:"addMark",value:function(e,t){t=V.create(t);var n=this,r=n.document;return r=r.addMark(e,t),n=n.set("document",r)}},{key:"insertNode",value:function(e,t){var n=this,r=n.document;return r=r.insertNode(e,t),n=(n=n.set("document",r)).mapRanges((function(e){return e.updatePoints((function(e){return e.setPath(null)}))}))}},{key:"insertText",value:function(e,t,n){var r=this,i=r.document,o=i.assertNode(e);return i=i.insertText(e,t,n),o=i.assertNode(e),r=(r=r.set("document",i)).mapPoints((function(e){return e.key===o.key&&e.offset>=t?e.setOffset(e.offset+n.length):e}))}},{key:"mergeNode",value:function(e){var t=this,n=t.document,r=n.mergeNode(e);e=n.resolvePath(e);var i=z.decrement(e),o=n.getNode(i),a=n.getNode(e);return t=(t=t.set("document",r)).mapRanges((function(e){if("text"===a.object){var t=o.text.length;e.anchor.key===a.key&&(e=e.moveAnchorTo(o.key,t+e.anchor.offset)),e.focus.key===a.key&&(e=e.moveFocusTo(o.key,t+e.focus.offset))}return e=e.updatePoints((function(e){return e.setPath(null)}))}))}},{key:"moveNode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this,i=r,o=i.document;return z.isEqual(e,t)?r:(o=o.moveNode(e,t,n),r=(r=r.set("document",o)).mapPoints((function(e){return e.setPath(null)})))}},{key:"removeAnnotation",value:function(e){e=te.create(e);var t=this,n=t.annotations,r=e.key;return n=n.delete(r),t=t.set("annotations",n)}},{key:"removeMark",value:function(e,t){t=V.create(t);var n=this,r=n.document;return r=r.removeMark(e,t),n=n.set("document",r)}},{key:"removeNode",value:function(e){var t=this,n=t.document,r=n.assertNode(e),i="text"===r.object?r:r.getFirstText()||r,o="text"===r.object?r:r.getLastText()||r,a=n.getPreviousText(i.key),s=n.getNextText(o.key);return n=n.removeNode(e),t=(t=t.set("document",n)).mapRanges((function(e){var t=e,n=t.anchor,i=t.focus;return r.hasNode(n.key)&&(e=a?e.moveAnchorTo(a.key,a.text.length):s?e.moveAnchorTo(s.key,0):e.unset()),r.hasNode(i.key)&&(e=a?e.moveFocusTo(a.key,a.text.length):s?e.moveFocusTo(s.key,0):e.unset()),e=e.updatePoints((function(e){return e.setPath(null)}))}))}},{key:"removeText",value:function(e,t,n){var r=this,i=r.document,o=i.assertNode(e);i=i.removeText(e,t,n),r=r.set("document",i);var a=n.length,s=t,l=t+a;return r=r.mapPoints((function(e){return e.key!==o.key?e:e.offset>=l?e.setOffset(e.offset-a):e.offset>s?e.setOffset(s):e}))}},{key:"setAnnotation",value:function(e,t){t=te.createProperties(t);var n=te.create(e),r=n.merge(t),i=this,o=i.annotations,a=n.key;return o=o.set(a,r),i=i.set("annotations",o)}},{key:"setNode",value:function(e,t){var n=this,r=n.document;return r=r.setNode(e,t),n=n.set("document",r)}},{key:"setMark",value:function(e,t,n){var r=this,i=r.document;return i=i.setMark(e,t,n),r=r.set("document",i)}},{key:"setProperties",value:function(e){var t=this,n=t.document,r=e.data,i=e.annotations,o={};return r&&(o.data=r),i&&(o.annotations=i.map((function(e){return e.isSet?e:n.resolveAnnotation(e)}))),t=t.merge(o)}},{key:"setSelection",value:function(e){var t=this,n=t,r=n.document,i=n.selection,o=i.setProperties(e);return i=r.resolveSelection(o),t=t.set("selection",i)}},{key:"splitNode",value:function(e,t,n){var r=this,i=r.document,o=i.splitNode(e,t,n),a=i.assertNode(e);return r=(r=r.set("document",o)).mapRanges((function(e){var n=o.getNextText(a.key),r=e,i=r.anchor,s=r.focus;return a.key===i.key&&t<=i.offset&&(e=e.moveAnchorTo(n.key,i.offset-t)),a.key===s.key&&t<=s.offset&&(e=e.moveFocusTo(n.key,s.offset-t)),e=e.updatePoints((function(e){return e.setPath(null)}))}))}},{key:"mapRanges",value:function(e){var t=this,n=t,r=n.document,i=n.selection,o=n.annotations,a=i.isSet?e(i):i;a||(a=i.unset()),a!==i&&(a=r.createSelection(a)),t=t.set("selection",a);var s=o.map((function(t){var n=t.isSet?e(t):t;return n&&n!==t&&(n=r.createAnnotation(n)),n}));return s=s.filter((function(e){return!!e})),t=t.set("annotations",s)}},{key:"mapPoints",value:function(e){return this.mapRanges((function(t){return t.updatePoints(e)}))}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,document:this.document.toJSON(e)};return e.preserveData&&(t.data=this.data.toJSON(e)),e.preserveAnnotations&&(t.annotations=this.annotations.map((function(t){return t.toJSON(e)})).toObject()),e.preserveSelection&&(t.selection=this.selection.toJSON(e)),t}},{key:"change",value:function(){Object(s.a)(!1,"As of Slate 0.42.0, value object are no longer schema-aware, and the `value.change()` method is no longer available. Use the `editor.change()` method on the new `Editor` controller instead.")}},{key:"startBlock",get:function(){return this.selection.start.key&&this.document.getClosestBlock(this.selection.start.key)}},{key:"endBlock",get:function(){return this.selection.end.key&&this.document.getClosestBlock(this.selection.end.key)}},{key:"anchorBlock",get:function(){return this.selection.anchor.key&&this.document.getClosestBlock(this.selection.anchor.key)}},{key:"focusBlock",get:function(){return this.selection.focus.key&&this.document.getClosestBlock(this.selection.focus.key)}},{key:"startInline",get:function(){return this.selection.start.key&&this.document.getClosestInline(this.selection.start.key)}},{key:"endInline",get:function(){return this.selection.end.key&&this.document.getClosestInline(this.selection.end.key)}},{key:"anchorInline",get:function(){return this.selection.anchor.key&&this.document.getClosestInline(this.selection.anchor.key)}},{key:"focusInline",get:function(){return this.selection.focus.key&&this.document.getClosestInline(this.selection.focus.key)}},{key:"startText",get:function(){return this.selection.start.key&&this.document.getDescendant(this.selection.start.key)}},{key:"endText",get:function(){return this.selection.end.key&&this.document.getDescendant(this.selection.end.key)}},{key:"anchorText",get:function(){return this.selection.anchor.key&&this.document.getDescendant(this.selection.anchor.key)}},{key:"focusText",get:function(){return this.selection.focus.key&&this.document.getDescendant(this.selection.focus.key)}},{key:"nextBlock",get:function(){return this.selection.end.key&&this.document.getNextBlock(this.selection.end.key)}},{key:"previousBlock",get:function(){return this.selection.start.key&&this.document.getPreviousBlock(this.selection.start.key)}},{key:"nextInline",get:function(){return this.selection.end.key&&this.document.getNextInline(this.selection.end.key)}},{key:"previousInline",get:function(){return this.selection.start.key&&this.document.getPreviousInline(this.selection.start.key)}},{key:"nextText",get:function(){return this.selection.end.key&&this.document.getNextText(this.selection.end.key)}},{key:"previousText",get:function(){return this.selection.start.key&&this.document.getPreviousText(this.selection.start.key)}},{key:"marks",get:function(){return this.selection.isUnset?new r.Set:this.selection.marks||this.document.getMarksAtRange(this.selection)}},{key:"activeMarks",get:function(){return this.selection.isUnset?new r.Set:this.selection.marks||this.document.getActiveMarksAtRange(this.selection)}},{key:"blocks",get:function(){return this.selection.isUnset?new r.List:this.document.getLeafBlocksAtRange(this.selection)}},{key:"fragment",get:function(){return this.selection.isUnset?re.create():this.document.getFragmentAtRange(this.selection)}},{key:"inlines",get:function(){return this.selection.isUnset?new r.List:this.document.getLeafInlinesAtRange(this.selection)}},{key:"texts",get:function(){return this.selection.isUnset?new r.List:this.document.getTextsAtRange(this.selection)}},{key:"history",get:function(){Object(s.a)(!1,"As of Slate 0.42.0, the `value.history` model no longer exists, and the history is stored in `value.data` instead using plugins.")}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.isValue(e))return e;if(o()(e))return t.fromJSON(e,n);throw new Error("`Value.create` only accepts objects or values, but you passed it: "+e)}},{key:"createProperties",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isValue(e))return{annotations:e.annotations,data:e.data};if(o()(e)){var n={};return"annotations"in e&&(n.annotations=te.createMap(e.annotations)),"data"in e&&(n.data=H.create(e.data)),n}throw new Error("`Value.createProperties` only accepts objects or values, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.data,r=void 0===n?{}:n,i=e.annotations,o=void 0===i?{}:i,a=e.document,s=void 0===a?{}:a,l=e.selection,u=void 0===l?{}:l;if(r=H.fromJSON(r),u=(s=re.fromJSON(s)).createSelection(u),o=te.createMap(o),u.isUnset){var c=s.getFirstText();c&&(u=u.moveToStartOfNode(c)),u=s.createSelection(u)}return new t({annotations:o,data:r,document:s,selection:u})}}]),t}(Object(r.Record)(fe)),he=u()("slate:operation:apply");function me(e,t){var n=(t=_e.create(t)).type;switch(he(n,t),n){case"add_annotation":var r=t.annotation;return e.addAnnotation(r);case"add_mark":var i=t,o=i.path,a=i.mark;return e.addMark(o,a);case"insert_node":var s=t,l=s.path,u=s.node;return e.insertNode(l,u);case"insert_text":var c=t,d=c.path,f=c.offset,p=c.text,h=c.marks;return e.insertText(d,f,p,h);case"merge_node":var m=t.path;return e.mergeNode(m);case"move_node":var g=t,v=g.path,y=g.newPath;return e.moveNode(v,y);case"remove_annotation":var b=t.annotation;return e.removeAnnotation(b);case"remove_mark":var _=t,w=_.path,x=_.mark;return e.removeMark(w,x);case"remove_node":var k=t.path;return e.removeNode(k);case"remove_text":var E=t,S=E.path,O=E.offset,T=E.text;return e.removeText(S,O,T);case"set_annotation":var C=t,A=C.properties,P=C.newProperties;return e.setAnnotation(A,P);case"set_mark":var R=t,M=R.path,I=R.properties,j=R.newProperties;return e.setMark(M,I,j);case"set_node":var D=t,L=D.path,N=D.newProperties;return e.setNode(L,N);case"set_selection":var F=t.newProperties;return e.setSelection(F);case"set_value":var B=t.newProperties;return e.setProperties(B);case"split_node":var z=t,U=z.path,q=z.position,H=z.properties;return e.splitNode(U,q,H);default:throw new Error('Unknown operation type: "'+n+'".')}}var ge=u()("slate:operation:invert");function ve(e){var t=(e=_e.create(e)).type;switch(ge(t,e),t){case"move_node":var n=e,r=n.newPath,i=n.path;if(z.isEqual(r,i))return e;var o=z.transform(i,e).first(),a=z.transform(z.increment(i),e).first();return e.set("path",o).set("newPath",a);case"merge_node":var s=e.path,l=z.decrement(s);return e.set("type","split_node").set("path",l);case"split_node":var u=e.path,c=z.increment(u);return e.set("type","merge_node").set("path",c);case"set_annotation":case"set_node":case"set_value":case"set_selection":case"set_mark":var d=e,f=d.properties,p=d.newProperties;return e.set("properties",p).set("newProperties",f);case"insert_node":case"insert_text":return e.set("type",t.replace("insert_","remove_"));case"remove_node":case"remove_text":return e.set("type",t.replace("remove_","insert_"));case"add_annotation":case"add_mark":return e.set("type",t.replace("add_","remove_"));case"remove_annotation":case"remove_mark":return e.set("type",t.replace("remove_","add_"));default:throw new Error('Unknown operation type: "'+t+'".')}}var ye={add_mark:["path","mark","data"],add_annotation:["annotation","data"],insert_node:["path","node","data"],insert_text:["path","offset","text","data"],merge_node:["path","position","properties","target","data"],move_node:["path","newPath","data"],remove_annotation:["annotation","data"],remove_mark:["path","mark","data"],remove_node:["path","node","data"],remove_text:["path","offset","text","data"],set_annotation:["properties","newProperties","data"],set_mark:["path","properties","newProperties","data"],set_node:["path","properties","newProperties","data"],set_selection:["properties","newProperties","data"],set_value:["properties","newProperties","data"],split_node:["path","position","properties","target","data"]},be={annotation:void 0,data:void 0,length:void 0,mark:void 0,marks:void 0,newPath:void 0,newProperties:void 0,node:void 0,offset:void 0,path:void 0,position:void 0,properties:void 0,target:void 0,text:void 0,type:void 0},_e=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"apply",value:function(e){return me(e,this)}},{key:"invert",value:function(){return ve(this)}},{key:"toJSON",value:function(){var e=this.object,t=this.type,n={object:e,type:t},r=ye[t],i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=this[u];if("annotation"!==u&&"mark"!==u&&"marks"!==u&&"node"!==u&&"path"!==u&&"newPath"!==u||(c=c.toJSON()),"properties"===u&&"merge_node"===t){var d={};"data"in c&&(d.data=c.data.toJS()),"type"in c&&(d.type=c.type),c=d}if(("properties"===u||"newProperties"===u)&&"set_annotation"===t){var f={};"anchor"in c&&(f.anchor=c.anchor.toJS()),"focus"in c&&(f.focus=c.focus.toJS()),"key"in c&&(f.key=c.key),"data"in c&&(f.data=c.data.toJS()),"type"in c&&(f.type=c.type),c=f}if(("properties"===u||"newProperties"===u)&&"set_mark"===t){var p={};"data"in c&&(p.data=c.data.toJS()),"type"in c&&(p.type=c.type),c=p}if(("properties"===u||"newProperties"===u)&&"set_node"===t){var h={};"data"in c&&(h.data=c.data.toJS()),"type"in c&&(h.type=c.type),c=h}if(("properties"===u||"newProperties"===u)&&"set_selection"===t){var m={};"anchor"in c&&(m.anchor=c.anchor.toJSON()),"focus"in c&&(m.focus=c.focus.toJSON()),"isFocused"in c&&(m.isFocused=c.isFocused),"marks"in c&&(m.marks=c.marks&&c.marks.toJSON()),c=m}if(("properties"===u||"newProperties"===u)&&"set_value"===t){var g={};"data"in c&&(g.data=c.data.toJS()),c=g}if("properties"===u&&"split_node"===t){var v={};"data"in c&&(v.data=c.data.toJS()),"type"in c&&(v.type=c.type),c=v}"data"===u&&(c=c.toJSON()),n[u]=c}}catch(e){o=!0,a=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw a}}return n}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isOperation(e))return e;if(o()(e))return t.fromJSON(e);throw new Error("`Operation.create` only accepts objects or operations, but you passed it: "+e)}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Operation.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"fromJSON",value:function(e){if(t.isOperation(e))return e;var n=e.type,i=ye[n],o={type:n};if(!i)throw new Error('`Operation.fromJSON` was passed an unrecognized operation type: "'+n+'"');var a=!0,s=!1,l=void 0;try{for(var u,c=i[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var d=u.value,f=e[d];if("data"===d&&void 0===f&&(f={}),void 0===f)throw new Error('`Operation.fromJSON` was passed a "'+n+'" operation without the required "'+d+'" attribute.');"annotation"===d&&(f=te.create(f)),"path"!==d&&"newPath"!==d||(f=z.create(f)),"mark"===d&&(f=V.create(f)),"node"===d&&(f=ue.create(f)),"properties"!==d&&"newProperties"!==d||"set_annotation"!==n||(f=te.createProperties(f)),"properties"!==d&&"newProperties"!==d||"set_mark"!==n||(f=V.createProperties(f)),"properties"!==d&&"newProperties"!==d||"set_node"!==n&&"merge_node"!==n&&"split_node"!==n||(f=ue.createProperties(f)),"properties"!==d&&"newProperties"!==d||"set_selection"!==n||(f=Y.createProperties(f)),"properties"!==d&&"newProperties"!==d||"set_value"!==n||(f=pe.createProperties(f)),"data"===d&&(f=Object(r.Map)(f)),o[d]=f}}catch(e){s=!0,l=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}return new t(o)}},{key:"isOperationList",value:function(e){return r.List.isList(e)&&e.every((function(e){return t.isOperation(e)}))}}]),t}(Object(r.Record)(be)),we={operations:void 0,value:void 0},xe=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,value:this.value.toJSON(e),operations:this.operations.toArray().map((function(t){return t.toJSON(e)}))};return t}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isChange(e))return e;if(o()(e))return t.fromJSON(e);throw new Error("`Change.create` only accepts objects or changes, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.value,r=e.operations,i=void 0===r?[]:r;return new t({value:pe.create(n),operations:_e.createList(i)})}}]),t}(Object(r.Record)(we));function ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};function t(t,n,r){var i=t.type,o=t.args,a=e[i];if(!a)return r();n.command.apply(n,[a].concat(P(o)))}function n(t,n){for(var r in e)t.registerCommand(r);return n()}return{onCommand:t,onConstruct:n}}var Ee=/\s/,Se=/['\u2018\u2019]/,Oe=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/;function Te(e){return 55296<=e&&e<=57343}function Ce(e,t,n){if(55356===e){var r=t.charCodeAt(n+1);return r<=57343&&r>=57339}return!1}function Ae(e){return e<=65039&&e>=65024}function Pe(e,t){if(Ee.test(e))return!1;if(Se.test(e)){var n=t.charAt(0),r=Re(n);if(Pe(n=t.slice(0,r),t.slice(r)))return!0}return!Oe.test(e)}function Re(e){return Te(e.charCodeAt(0))?2:1}function Me(e,t,n){var r,i=0;if(""===e)return 1;for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:1;return e=e.slice(0,t),Me(e=Object(c.reverse)(e),n)},getCharOffsetForward:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Me(e=e.slice(t),n,!0)},getWordOffset:Ie,getWordOffsetBackward:function(e,t){return e=e.slice(0,t),Ie(e=Object(c.reverse)(e))},getWordOffsetForward:function(e,t){return Ie(e=e.slice(t))},isSurrogate:Te,isWord:Pe};function De(e,t){t.isExpanded&&e.deleteAtRange(t);var n=e.value.document,r=t,i=r.start,o=r.end;return t=n.hasDescendant(i.path)?t.moveToStart():t.moveTo(o.path,0).normalize(n)}var Le={addMarkAtRange:function(e,t,n){if(!t.isCollapsed){var r=e.value.document,i=t.start,o=t.end,a=r.getTextsAtRange(t);e.withoutNormalizing((function(){a.forEach((function(t){var r=t.key,a=0,s=t.text.length;r===i.key&&(a=i.offset),r===o.key&&(s=o.offset),r===i.key&&r===o.key&&(s=o.offset-i.offset),e.addMarkByKey(r,a,s,n)}))}))}},addMarksAtRange:function(e,t,n){n.forEach((function(n){return e.addMarkAtRange(t,n)}))},deleteAtRange:function(e,t){e.snapshotSelection();var n=e.value,r=t.start,i=t.end,o=r.key,a=r.offset,s=i.key,l=i.offset,u=n.document,c=u.hasVoidParent(o,e),d=u.hasVoidParent(s,e),f=u.getClosestBlock(o),p=u.getClosestBlock(s),h=0===a&&0===l&&!1===c&&o===f.getFirstText().key&&s===p.getFirstText().key&&o!==s;if(h&&d){var m=u.getPreviousText(s);s=m.key,l=m.text.length,d=u.hasVoidParent(s,e)}e.withoutNormalizing((function(){for(;c;){var t=u.getClosestVoid(o,e),n=u.getNextText(o);if(e.removeNodeByKey(t.key),o===s)return;if(!n)return;u=e.value.document,o=n.key,a=0,c=u.hasVoidParent(o,e)}for(;d;){var r=u.getClosestVoid(s,e),i=u.getPreviousText(s);e.removeNodeByKey(r.key),u=e.value.document,s=i.key,l=i.text.length,d=u.hasVoidParent(s,e)}if(o===s&&h)e.removeNodeByKey(f.key);else if(o!==s){f=u.getClosestBlock(o),p=u.getClosestBlock(s);var m=u.getNode(o),g=u.getNode(s),v=m.text.length-a,y=l,b=u.getCommonAncestor(o,s),_=b.getFurthestChild(o),w=b.getFurthestChild(s),x=u.getParent(f.key),k=x.nodes.indexOf(f),E=x.nodes.indexOf(p),S=void 0;for(S=m;S.key!==_.key;){var O=u.getParent(S.key),T=O.nodes.indexOf(S);O.nodes.slice(T+1).reverse().forEach((function(t){e.removeNodeByKey(t.key)})),S=O}var C=b.nodes.indexOf(_),P=b.nodes.indexOf(w);for(b.nodes.slice(C+1,P).reverse().forEach((function(t){e.removeNodeByKey(t.key)})),S=g;S.key!==w.key;){var R=u.getParent(S.key),M=R.nodes.indexOf(S);R.nodes.slice(0,M).reverse().forEach((function(t){e.removeNodeByKey(t.key)})),S=R}if(0!==v&&e.removeTextByKey(o,a,v),0!==y&&e.removeTextByKey(s,0,l),f.key!==p.key){u=e.value.document;var I=void 0,j=!0,D=!1,L=void 0;try{for(var N,F=u.ancestors(p.key)[Symbol.iterator]();!(j=(N=F.next()).done);j=!0){var B=N.value,z=A(B,1)[0];if(z.nodes.size>1)break;I=z}}catch(e){D=!0,L=e}finally{try{!j&&F.return&&F.return()}finally{if(D)throw L}}E!==k+1&&e.moveNodeByKey(p.key,x.key,k+1),h?e.removeNodeByKey(f.key):e.mergeNodeByKey(p.key),I&&e.removeNodeByKey(I.key)}}else{var U=a,q=l-a;e.removeTextByKey(o,U,q)}}))},deleteBackwardAtRange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(0!==n){var r=e.value,i=r.document,o=t,a=o.start,s=o.focus;if(t.isExpanded)e.deleteAtRange(t);else{var l=i.getClosestVoid(a.path,e);if(l)e.removeNodeByKey(l.key);else if(!a.isAtStartOfNode(i)){var u=i.getClosestBlock(a.path);if(1!==i.nodes.size&&u&&""===u.text&&1===u.nodes.size)e.removeNodeByKey(u.key);else{var c=i.getDescendant(a.path);if(a.isAtStartOfNode(c)){var d=i.getPreviousText(c.key),f=i.getClosestInline(c.key);f&&""===d.text&&(d=i.getPreviousText(d.key));var p=i.getClosestBlock(d.key),h=i.getClosestVoid(d.key,e);if(h)return void e.removeNodeByKey(h.key);if(1===n&&p!==u)return t=t.moveAnchorTo(d.key,d.text.length),void e.deleteAtRange(t)}if(n<=s.offset)return t=t.moveFocusBackward(n),void e.deleteAtRange(t);for(var m=c,g=0,v=s.offset;n>v;){var y=v+(m=i.getPreviousText(m.key)).text.length;if(n<=y){g=y-n;break}v=y}t=t.moveAnchorTo(m.key,g),e.deleteAtRange(t)}}}}},deleteCharBackwardAtRange:function(e,t){if(t.isExpanded)e.deleteAtRange(t);else{var n=e.value.document,r=t.start,i=n.getClosestBlock(r.path),o=i.getOffset(r.key)+r.offset,a=i.text,s=je.getCharOffsetBackward(a,o);e.deleteBackwardAtRange(t,s)}},deleteCharForwardAtRange:function(e,t){if(t.isExpanded)e.deleteAtRange(t);else{var n=e.value.document,r=t.start,i=n.getClosestBlock(r.path),o=i.getOffset(r.key)+r.offset,a=i.text,s=je.getCharOffsetForward(a,o);e.deleteForwardAtRange(t,s)}},deleteForwardAtRange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(0!==n){var r=e.value,i=r.document,o=t,a=o.start,s=o.focus;if(t.isExpanded)e.deleteAtRange(t);else{var l=i.getClosestVoid(a.path,e);if(l)e.removeNodeByKey(l.key);else{var u=i.getClosestBlock(a.path);if(u&&!e.isVoid(u)&&""===u.text&&1!==i.nodes.size){var c=i.getNextBlock(u.key);return e.removeNodeByKey(u.key),void(c&&c.key&&e.moveToStartOfNode(c))}if(!a.isAtEndOfNode(i)){var d=i.getDescendant(a.path);if(a.isAtEndOfNode(d)){var f=i.getNextText(d.key),p=i.getClosestBlock(f.key),h=i.getClosestVoid(f.key,e);if(h)return void e.removeNodeByKey(h.key);if(1===n&&p!==u)return t=t.moveFocusTo(f.key,0),void e.deleteAtRange(t)}if(n<=d.text.length-s.offset)return t=t.moveFocusForward(n),void e.deleteAtRange(t);for(var m=d,g=s.offset,v=d.text.length-s.offset;n>v;){var y=v+(m=i.getNextText(m.key)).text.length;if(n<=y){g=n-v;break}v=y}t=t.moveFocusTo(m.key,g),e.deleteAtRange(t)}}}}},deleteLineBackwardAtRange:function(e,t){if(t.isExpanded)e.deleteAtRange(t);else{var n=e.value.document,r=t.start,i=n.getClosestBlock(r.path).getOffset(r.key)+r.offset;e.deleteBackwardAtRange(t,i)}},deleteLineForwardAtRange:function(e,t){if(t.isExpanded)e.deleteAtRange(t);else{var n=e.value.document,r=t.start,i=n.getClosestBlock(r.path),o=i.getOffset(r.key)+r.offset;e.deleteForwardAtRange(t,i.text.length-o)}},deleteWordBackwardAtRange:function(e,t){if(t.isExpanded)e.deleteAtRange(t);else{var n=e.value.document,r=t.start,i=n.getClosestBlock(r.path),o=i.getOffset(r.key)+r.offset,a=i.text,s=0===o?1:je.getWordOffsetBackward(a,o);e.deleteBackwardAtRange(t,s)}},deleteWordForwardAtRange:function(e,t){if(t.isExpanded)e.deleteAtRange(t);else{var n=e.value.document,r=t.start,i=n.getClosestBlock(r.path),o=i.getOffset(r.key)+r.offset,a=i.text,s=je.getWordOffsetForward(a,o),l=0===s?1:s;e.deleteForwardAtRange(t,l)}},insertBlockAtRange:function(e,t,n){t=De(e,t),n=de.create(n);var r=e.value.document,i=t.start,o=i.key,a=i.offset,s=r.getClosestBlock(o),l=r.getClosestInline(o),u=r.getParent(s.key),c=u.nodes.indexOf(s),d=Ne(e,t);if("before"===d)e.insertNodeByKey(u.key,c,n);else if("behind"===d)e.insertNodeByKey(u.key,c+1,n);else{if(l&&e.isVoid(l)){var f=i.isAtEndOfNode(l),p=f?r.getNextText(o):r.getPreviousText(o),h=f?t.moveToStartOfNode(p):t.moveToEndOfNode(p);o=h.start.key,a=h.start.offset}e.withoutNormalizing((function(){e.splitDescendantsByKey(s.key,o,a),e.insertNodeByKey(u.key,c+1,n)}))}}},Ne=function(e,t){var n=e.value.document,r=t.start,i=r.key,o=n.getClosestBlock(i),a=n.getClosestInline(i);return e.isVoid(o)?r.isAtEndOfNode(o)?"behind":"before":a||""!==o.text?r.isAtStartOfNode(o)?"before":r.isAtEndOfNode(o)?"behind":"split":"behind"};Le.insertFragmentAtRange=function(e,t,n){e.withoutNormalizing((function(){if(t=De(e,t),n.nodes.size){n=n.mapDescendants((function(e){return e.regenerateKey()}));var i=t.start,o=e.value.document,a=o.getDescendant(i.path),s=o.getClosestBlock(a.key),l=s.getFurthestChild(a.key),u=i.isAtStartOfNode(s),c=o.getParent(s.key),d=c.nodes.indexOf(s),f=n.getBlocks(),p=n.nodes.first(),h=n.nodes.last(),m=f.first(),g=f.last(),v=Fe(n,o,s.key);if(m===g&&e.isVoid(m))e.insertBlockAtRange(t,m);else if(v!==n||!p.hasBlockChildren()&&!h.hasBlockChildren()){if(m!==g){var y=v.getFurthest(m.key,(function(e){return 1===e.nodes.size}))||m,b=c.nodes.indexOf(s);v.removeNode(y.key).nodes.forEach((function(t,n){var r=b+n+1;e.insertNodeByKey(c.key,r,t)}))}if(0!==i.offset&&e.splitDescendantsByKey(l.key,i.key,i.offset),a=(o=e.value.document).getDescendant(i.key),l=(s=o.getClosestBlock(i.key)).getFurthestChild(a.key),m!==g){var _=u?l:s.getNextSibling(l.key),w=_?s.nodes.skipUntil((function(e){return e.key===_.key})):Object(r.List)(),x=g.nodes.size;w.forEach((function(t,n){var r=x+n;e.moveNodeByKey(t.key,g.key,r)}))}if(e.isVoid(s)||""!==s.text||s.findDescendant((function(t){return e.isVoid(t)}))){var k=s.getFurthestChild(a.key),E=s.nodes.indexOf(k);m.nodes.forEach((function(t,n){var r=0===i.offset?0:1,o=E+n+r;e.insertNodeByKey(s.key,o,t)}))}else e.removeNodeByKey(s.key),e.insertNodeByKey(c.key,d,m)}else{("before"===Ne(e,t)?n.nodes:n.nodes.reverse()).forEach((function(n){e.insertBlockAtRange(t,n)}))}}}))};var Fe=function(e,t,n){var r=function(e,t){return t.size>=e.size&&e.every((function(e,n){return t.get(n).type===e.type}))},i=function(e,t){return e.getAncestors(t).slice(1).push(e.getNode(t)).reverse()},o=function(e){for(var t=e;1===t.nodes.size&&"block"===t.nodes.first().object;)t=t.nodes.first();return t===e?null:t}(e);return o?function(t,n){var i=t.size-n.size;if(i<0)return e;for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:1,r=t=De(e,t),i=r.start,o=r.end,a=e.value,s=a,l=s.document,u=l.assertDescendant(i.path),c=l.getClosestBlock(u.key),d=0;c&&"block"===c.object&&d2&&void 0!==arguments[2]?arguments[2]:1/0,r=t=De(e,t),i=r.start,o=e.value,a=o.document,s=a.assertDescendant(i.path),l=a.getClosestInline(s.key),u=0;l&&"inline"===l.object&&u3&&void 0!==arguments[3]?arguments[3]:n,i=t.start,o=t.end,a=t.moveToStart(),s=t.moveToEnd();i.path.equals(o.path)&&(s=s.moveForward(n.length)),e.withoutNormalizing((function(){e.insertTextAtRange(a,n),e.insertTextAtRange(s,r)}))};var Be={addMarkByPath:function(e,t,n,r,i){i=V.create(i),e.addMarksByPath(t,n,r,[i])},addMarksByPath:function(e,t,n,r,i){if((i=V.createSet(i)).size){var o=e.value.document.assertNode(t);e.withoutNormalizing((function(){n+r0&&(e.splitNodeByPath(t,n),t=z.increment(t),n=0),i.forEach((function(n){e.applyOperation({type:"add_mark",path:t,mark:V.create(n)})}))}))}},replaceMarksByPath:function(e,t,n,r,i){var o=V.createSet(i),a=e.value.document.assertNode(t);a.marks.equals(o)||e.withoutNormalizing((function(){n+r0&&(e.splitNodeByPath(t,n),t=z.increment(t),n=0);var i=o.subtract(a.marks);a.marks.subtract(o).forEach((function(n){e.applyOperation({type:"remove_mark",path:t,mark:V.create(n)})})),i.forEach((function(n){e.applyOperation({type:"add_mark",path:t,mark:V.create(n)})}))}))},insertFragmentByPath:function(e,t,n,r){r.nodes.forEach((function(r,i){e.insertNodeByPath(t,n+i,r)}))},insertNodeByPath:function(e,t,n,r){e.applyOperation({type:"insert_node",path:t.concat(n),node:r})},insertTextByPath:function(e,t,n,r,i){var o=e.value,a=o.annotations;o.document.assertNode(t),e.withoutNormalizing((function(){var o=!0,s=!1,l=void 0;try{for(var u,c=a.values()[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var d=u.value,f=d.start,p=d.end;e.isAtomic(d)&&(f.path.equals(t)&&f.offsetn)&&e.removeAnnotation(d))}}catch(e){s=!0,l=e}finally{try{!o&&c.return&&c.return()}finally{if(s)throw l}}e.applyOperation({type:"insert_text",path:t,offset:n,text:r}),i&&e.replaceMarksByPath(t,n,r.length,i)}))},mergeNodeByPath:function(e,t){var n=e.value.document,r=n.getDescendant(t),i=n.getPreviousSibling(t);if(!i)throw new Error('Unable to merge node with path "'+t+'", because it has no previous sibling.');var o="text"===i.object?i.text.length:i.nodes.size;e.applyOperation({type:"merge_node",path:t,position:o,properties:{type:r.type,data:r.data},target:null})},moveNodeByPath:function(e,t,n,r){if(z.isEqual(t,n))return e;var i=n.concat(r);if(z.isEqual(t,i))return e;e.applyOperation({type:"move_node",path:t,newPath:i})},removeMarkByPath:function(e,t,n,r,i){i=V.create(i),e.removeMarksByPath(t,n,r,[i])},removeMarksByPath:function(e,t,n,r,i){if((i=V.createSet(i)).size){var o=e.value.document.assertNode(t);i.intersect(o.marks).isEmpty()||e.withoutNormalizing((function(){n+r0&&(e.splitNodeByPath(t,n),t=z.increment(t),n=0),i.forEach((function(i){e.applyOperation({type:"remove_mark",path:t,offset:n,length:r,mark:i})}))}))}},removeAllMarksByPath:function(e,t){var n=e.state.document.assertNode(t);e.withoutNormalizing((function(){if("text"!==n.object){var r=!0,i=!1,o=void 0;try{for(var a,s=n.texts()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u=A(l,2),c=u[0],d=u[1],f=t.concat(d);e.removeMarksByPath(f,0,c.text.length,c.marks)}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}}else e.removeMarksByPath(t,0,n.text.length,n.marks)}))},removeNodeByPath:function(e,t){var n=e.value.document.assertNode(t);e.applyOperation({type:"remove_node",path:t,node:n})},removeTextByPath:function(e,t,n,r){var i=e.value,o=i.document,a=i.annotations,s=o.assertNode(t).text.slice(n,n+r);e.withoutNormalizing((function(){var r=!0,i=!1,o=void 0;try{for(var l,u=a.values()[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var c=l.value,d=c.start,f=c.end;e.isAtomic(c)&&(d.path.equals(t)&&d.offsetn)&&e.removeAnnotation(c))}}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}e.applyOperation({type:"remove_text",path:t,offset:n,text:s})}))},replaceNodeByPath:function(e,t,n){n=ue.create(n);var r=t.last(),i=z.lift(t);e.withoutNormalizing((function(){e.removeNodeByPath(t),e.insertNodeByPath(i,r,n)}))},replaceTextByPath:function(e,t,n,r,i,o){e.withoutNormalizing((function(){e.removeTextByPath(t,n,r),e.insertTextByPath(t,n,i,o)}))},setMarkByPath:function(e,t,n,r,i,o){i=V.create(i),o=V.createProperties(o);var a=e.value.document.assertNode(t);e.withoutNormalizing((function(){n+r0&&(e.splitNodeByPath(t,n),t=z.increment(t),n=0),e.applyOperation({type:"set_mark",path:t,properties:i,newProperties:o})}))},setNodeByPath:function(e,t,n){var r=e.value.document.assertNode(t);n=ue.createProperties(n);var i=f()(r,Object.keys(n));e.applyOperation({type:"set_node",path:t,properties:i,newProperties:n})},setTextByPath:function(e,t,n,r){var i=e.value.document.assertNode(t).text.length;e.replaceTextByPath(t,0,i,n,r)},splitNodeByPath:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.target,o=void 0===i?null:i,a=e.value,s=a.document,l=s.getDescendant(t);e.applyOperation({type:"split_node",path:t,position:n,target:o,properties:{type:l.type,data:l.data}})},splitDescendantsByPath:function(e,t,n,r){if(t.equals(n))e.splitNodeByPath(n,r);else{var i=e.value.document,o=r,a=n;e.withoutNormalizing((function(){e.splitNodeByKey(n,r);var s=!0,l=!1,u=void 0;try{for(var c,d=i.ancestors(n)[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var f=c.value,p=A(f,2)[1],h=o;if(o=a.last()+1,a=p,e.splitNodeByPath(p,o,{target:h}),p.equals(t))break}}catch(e){l=!0,u=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw u}}}))}},unwrapInlineByPath:function(e,t,n){var r=e.value,i=r.document,o=r.selection,a=i.assertNode(t),s=a.getFirstText(),l=a.getLastText(),u=o.moveToRangeOfNode(s,l);e.unwrapInlineAtRange(u,n)},unwrapBlockByPath:function(e,t,n){var r=e.value,i=r.document,o=r.selection,a=i.assertNode(t),s=a.getFirstText(),l=a.getLastText(),u=o.moveToRangeOfNode(s,l);e.unwrapBlockAtRange(u,n)},unwrapNodeByPath:function(e,t){var n=e.value.document;n.assertNode(t);var r=z.lift(t),i=n.assertNode(r),o=t.last(),a=r.last(),s=z.lift(r),l=0===o,u=o===i.nodes.size-1;e.withoutNormalizing((function(){if(1===i.nodes.size)e.moveNodeByPath(t,s,a+1),e.removeNodeByPath(r);else if(l)e.moveNodeByPath(t,s,a);else if(u)e.moveNodeByPath(t,s,a+1);else{var n=z.increment(t,1,r.size-1);n=n.set(n.size-1,0),e.splitNodeByPath(r,o),e.moveNodeByPath(n,s,a+1)}}))},unwrapChildrenByPath:function(e,t){t=z.create(t);var n=e.value.document.assertNode(t),r=z.lift(t),i=t.last(),o=n.nodes;e.withoutNormalizing((function(){o.reverse().forEach((function(n,a){var s=o.size-a-1,l=t.push(s);e.moveNodeByPath(l,r,i+1)})),e.removeNodeByPath(t)}))},wrapBlockByPath:function(e,t,n){n=(n=de.create(n)).set("nodes",n.nodes.clear());var r=z.lift(t),i=t.last(),o=z.increment(t);e.withoutNormalizing((function(){e.insertNodeByPath(r,i,n),e.moveNodeByPath(o,t,0)}))},wrapInlineByPath:function(e,t,n){n=(n=oe.create(n)).set("nodes",n.nodes.clear());var r=z.lift(t),i=t.last(),o=z.increment(t);e.withoutNormalizing((function(){e.insertNodeByPath(r,i,n),e.moveNodeByPath(o,t,0)}))},wrapNodeByPath:function(e,t,n){"block"===(n=ue.create(n)).object?e.wrapBlockByPath(t,n):"inline"===n.object&&e.wrapInlineByPath(t,n)}},ze=function(e){Be[e+"ByKey"]=function(t,n){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;o3?r-3:0),o=3;o3?r-3:0),o=3;o100&&(c=c.takeLast(100)),e.withoutSaving((function(){var t=Object(r.List)(),n=i.set("undos",c).set("redos",t);e.setData(n)}))}},$e.redo=function(e){var t=e.value.data,n=t.get("redos")||Object(r.List)(),i=t.get("undos")||Object(r.List)(),o=n.last();o&&e.withoutSaving((function(){e.withoutNormalizing((function(){o.forEach((function(t){var n=t,r=n.type,i=n.newProperties;"set_selection"===r&&(t=t.set("newProperties",h()(i,"isFocused"))),e.applyOperation(t)})),n=n.pop(),i=i.push(o);var r=t.set("undos",i).set("redos",n);e.setData(r)}))}))},$e.undo=function(e){var t=e.value.data,n=t.get("redos")||Object(r.List)(),i=t.get("undos")||Object(r.List)(),o=i.last();o&&e.withoutSaving((function(){e.withoutNormalizing((function(){o.slice().reverse().map((function(e){return e.invert()})).forEach((function(t){var n=t,r=n.type,i=n.newProperties;"set_selection"===r&&(t=t.set("newProperties",h()(i,"isFocused"))),e.applyOperation(t)})),n=n.push(o),i=i.pop();var r=t.set("undos",i).set("redos",n);e.setData(r)}))}))},$e.withoutMerging=function(e,t){var n=e.tmp.merge;e.tmp.merge=!1,t(e),e.tmp.merge=n},$e.withoutSaving=function(e,t){var n=e.tmp.save;e.tmp.save=!1,t(e),e.tmp.save=n};var Ge={};function Ke(e,t){for(var n,r=arguments.length,i=Array(r>2?r-2:0),o=2;o2&&void 0!==arguments[2]?arguments[2]:1;if(0!==n){if(n<0)return Je(e,t,-n);var r=t.slice(0,1).toUpperCase()+t.slice(1),i=e.value,o=i.document,a=i.selection,s=a[t],l=o.hasVoidParent(s.path,e);if(!l&&s.offset-n>=0){var u=a["move"+r+"Backward"](n);e.select(u)}else{var c=o.getPreviousText(s.path);if(c){var d=o.getClosestBlock(s.path),f=d.hasNode(c.key),p=c&&o.hasVoidParent(c.key,e);if(e["move"+r+"ToEndOfNode"](c),!l&&!p&&f){var h=e.value.selection["move"+r+"Backward"](n);e.select(h)}}}}}function Je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(0!==n){if(n<0)return Xe(e,t,-n);var r=t.slice(0,1).toUpperCase()+t.slice(1),i=e.value,o=i.document,a=i.selection,s=a[t],l=o.getNode(s.path),u=o.hasVoidParent(s.path,e);if(!u&&s.offset+n<=l.text.length){var c=a["move"+r+"Forward"](n);e.select(c)}else{var d=o.getNextText(s.path);if(d){var f=o.getClosestBlock(s.path),p=f.hasNode(d.key),h=o.hasVoidParent(d.key,e);if(e["move"+r+"ToStartOfNode"](d),!u&&!h&&p){var m=e.value.selection["move"+r+"Forward"](n);e.select(m)}}}}}function Ze(e,t){var n=e.value,r=n.document,i=n.selection[t],o=r.getClosestBlock(i.key),a=o.getOffset(i.key)+i.offset,s=o.text,l=je.getWordOffsetBackward(s,a);e.command(Xe,t,l>0?l:1)}function et(e,t){var n=e.value,r=n.document,i=n.selection[t],o=r.getClosestBlock(i.key),a=o.getOffset(i.key)+i.offset,s=o.text,l=je.getWordOffsetForward(s,a);e.command(Je,t,l>0?l:1)}Ge.blur=function(e){e.select({isFocused:!1})},Ge.deselect=function(e){var t=Y.create();e.select(t)},Ge.focus=function(e){e.select({isFocused:!0})},Ge.flip=function(e){e.command(Ke,"flip")},Ge.moveAnchorBackward=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:1;if(0!==t){var n=e.value,r=n.document,i=n.selection,o=i.start,a=r.getClosestBlock(o.key),s=a.getOffset(o.key),l=s+o.offset,u=a.text,c=je.getCharOffsetBackward(u,l,t);e.moveAnchorBackward(c).moveFocusBackward(c)}},Ge.moveWordBackward=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:1;if(0!==t){var n=e.value,r=n.document,i=n.selection,o=i.start,a=r.getClosestBlock(o.path),s=a.getOffset(o.key),l=s+o.offset,u=a.text,c=je.getCharOffsetForward(u,l,t);e.moveAnchorForward(c).moveFocusForward(c)}},Ge.moveWordForward=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:{};t=Y.createProperties(t);var i=n.snapshot,o=void 0!==i&&i,a=e.value,s=a.document,l=a.selection,u={},c=l.setProperties(t);for(var d in c=s.resolveSelection(c),t=f()(c,Object.keys(t)))!0!==o&&Object(r.is)(t[d],l[d])||(u[d]=t[d]);if(l.marks&&!u.marks&&(u.anchor||u.focus)&&(u.marks=null),0!==Object.keys(u).length){var p=f()(l.toJSON(),Object.keys(u));e.applyOperation({type:"set_selection",value:a,properties:p,newProperties:u},o?{skip:!1,merge:!1}:{})}},Ge.setAnchor=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{};function t(t,n){for(var r in e)t.registerQuery(r);return n()}function n(t,n,r){var i=t.type,o=t.args,a=e[i];if(!a)return r();var s=a.apply(void 0,[n].concat(P(o)));return void 0===s?r():s}return{onConstruct:t,onQuery:n}}tt.setData=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.value,r=pe.createProperties({data:t}),i=f()(n,Object.keys(r));e.applyOperation({type:"set_value",properties:i,newProperties:r})},tt.addAnnotation=function(e,t){t=te.create(t),e.applyOperation({type:"add_annotation",annotation:t})},tt.removeAnnotation=function(e,t){t=te.create(t),e.applyOperation({type:"remove_annotation",annotation:t})},tt.setAnnotation=function(e,t,n){t=te.create(t),n=te.createProperties(n),e.applyOperation({type:"set_annotation",properties:t,newProperties:n})},tt.setAnnotations=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.value,r=pe.createProperties({annotations:t}),i=f()(n,Object.keys(r));e.applyOperation({type:"set_value",properties:i,newProperties:r})};var rt=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(this,t);var r=C(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));for(var i in r.code=e,n)r[i]=n[i];return Error.captureStackTrace?Error.captureStackTrace(r,r.constructor):r.stack=(new Error).stack,r}return O(t,e),t}(Error);function it(e){var t=e.rules,n=e.document,r=e.blocks,i=e.inlines,o=e.marks,a=e.annotations,s=e.decorations,l=[];if(t&&(l=l.concat(t)),n&&l.push(S({match:[{object:"document"}]},n)),r)for(var u in r)l.push(S({match:[{object:"block",type:u}]},r[u]));if(i)for(var c in i)l.push(S({match:[{object:"inline",type:c}]},i[c]));if(o)for(var d in o)l.push(S({match:[{object:"mark",type:d}]},o[d]));if(a)for(var f in a)l.push(S({match:[{object:"annotation",type:f}]},a[f]));if(s)for(var p in s)l.push(S({match:[{object:"decoration",type:p}]},s[p]));function h(e,t,n){var r=l.filter((function(t){return ot(e,t.match)})),i=at(e,r,l,{every:!0});return i?new rt(i.code,i):n()}return[{normalizeNode:function(e,t,n){var r=h(e,t,(function(){}));return r?function(){var e=r.rule,n=t.operations.size;e.normalize&&e.normalize(t,r),t.operations.size===n&&function(e,t){var n=t.code,r=t.node,i=t.child,o=t.next,a=t.previous,s=t.key,l=t.mark;switch(n){case"child_max_invalid":case"child_object_invalid":case"child_type_invalid":case"child_unknown":case"first_child_object_invalid":case"first_child_type_invalid":case"last_child_object_invalid":case"last_child_type_invalid":return"text"===i.object&&"block"===r.object&&1===r.nodes.size?e.removeNodeByKey(r.key):e.removeNodeByKey(i.key);case"previous_sibling_object_invalid":case"previous_sibling_type_invalid":return"text"===a.object&&"block"===r.object&&1===r.nodes.size?e.removeNodeByKey(r.key):e.removeNodeByKey(a.key);case"next_sibling_object_invalid":case"next_sibling_type_invalid":return"text"===o.object&&"block"===r.object&&1===r.nodes.size?e.removeNodeByKey(r.key):e.removeNodeByKey(o.key);case"child_min_invalid":case"node_text_invalid":case"parent_object_invalid":case"parent_type_invalid":return"document"===r.object?r.nodes.forEach((function(t){return e.removeNodeByKey(t.key)})):e.removeNodeByKey(r.key);case"node_data_invalid":return void 0===r.data.get(s)&&"document"!==r.object?e.removeNodeByKey(r.key):e.setNodeByKey(r.key,{data:r.data.delete(s)});case"node_mark_invalid":return r.getTexts().forEach((function(t){return e.removeMarkByKey(t.key,0,t.text.length,l)}));default:e.removeNodeByKey(r.key)}}(t,r)}:n()},validateNode:h},nt({isAtomic:function(e,t){var n=l.find((function(e){return"isAtomic"in e&&ot(t,e.match)}));return n&&n.isAtomic},isVoid:function(e,t){var n=l.find((function(e){return"isVoid"in e&&ot(t,e.match)}));return n&&n.isVoid}})]}function ot(e,t){return!at(e,t)}function at(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.every,o=void 0!==i&&i,a=r.match,s=void 0===a?null:a;if("function"==typeof t){var l=t(e,s);return l?null:yt("node_invalid",{rule:t,node:e})}if(Array.isArray(t)){var u=t.length?t:[{}],c=void 0,d=!0,f=!1,p=void 0;try{for(var h,m=u[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){var g=h.value,v=at(e,g,n);if(c=c||v,o&&v)return v;if(!o&&!v)return}}catch(e){f=!0,p=e}finally{try{!d&&m.return&&m.return()}finally{if(f)throw p}}return c}var y=st(e,t)||lt(e,t)||ut(e,t)||ct(e,t)||dt(e,t)||ft(e,t)||pt(e,t)||ht(e,t,n);return y}function st(e,t){if(null!=t.object&&t.object!==e.object&&("function"!=typeof t.object||!t.object(e.object)))return yt("node_object_invalid",{rule:t,node:e})}function lt(e,t){if(null!=t.type&&t.type!==e.type&&("function"!=typeof t.type||!t.type(e.type)))return yt("node_type_invalid",{rule:t,node:e})}function ut(e,t){if(null!=t.data&&null!=e.data){if("function"==typeof t.data){if(t.data(e.data))return;return yt("node_data_invalid",{rule:t,node:e})}for(var n in t.data){var r=t.data[n],i=e.data&&e.data.get(n);if(!("function"==typeof r?r(i):r===i))return yt("node_data_invalid",{rule:t,node:e,key:n,value:i})}}}function ct(e,t){if(null!=t.marks){var n="text"===e.object?e.marks.toArray():e.getMarks().toArray(),r=function(n){return t.marks.some((function(e){return"function"==typeof e.type?e.type(n.type):e.type===n.type}))?"continue":{v:yt("node_mark_invalid",{rule:t,node:e,mark:n})}},i=!0,o=!1,a=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=r(s.value);switch(u){case"continue":continue;default:if("object"===(void 0===u?"undefined":w(u)))return u.v}}}catch(e){o=!0,a=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw a}}}}function dt(e,t){if(null!=t.text){var n=e.text;if(!("function"==typeof t.text?t.text(n):t.text.test(n)))return yt("node_text_invalid",{rule:t,node:e,text:n})}}function ft(e,t){if(null!=t.first){var n=e.nodes.first();if(n){var r=at(n,t.first);if(r)return r.rule=t,r.node=e,r.child=n,r.code=r.code.replace("node_","first_child_"),r}}}function pt(e,t){if(null!=t.last){var n=e.nodes.last();if(n){var r=at(n,t.last);if(r)return r.rule=t,r.node=e,r.child=n,r.code=r.code.replace("node_","last_child_"),r}}}function ht(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(null!=e.nodes){var r=e.nodes,i=null!=t.nodes?t.nodes.slice():[],o=0,a=0,s=null,l=-1,u=null,c=null,d=null,f=null,p=null;for(null!=t.nodes&&v();y();){var h=mt(e,d,n)||gt(e,d,f,l,n)||vt(e,d,p,l,n);if(h)return h;if(null!=t.nodes){if(!u)return yt("child_unknown",{rule:t,node:e,child:d,index:l});if(u.match){var m=at(d,u.match);if(m){if(null!=c&&o-1>c)return b(),yt("child_max_invalid",{rule:t,node:e,index:l,child:r.get(l),count:o,limit:c});var g=s;if(v()){if(a-1>=g){l-=1;continue}return null==at(d,u.match)?(b(),yt("child_min_invalid",{rule:t,node:e,index:l,count:a-1,limit:g})):(m.rule=t,m.node=e,m.child=d,m.index=l,m.code=m.code.replace("node_","child_"),m)}return null!=c&&o>c?yt("child_unknown",{rule:t,node:e,child:d,index:l}):(m.rule=t,m.node=e,m.child=d,m.index=l,m.code=m.code.replace("node_","child_"),m)}}}}if(null!=c&&o>c)return yt("child_max_invalid",{rule:t,node:e,index:l-1,count:o,child:r.get(l-1),limit:c});if(null!=t.nodes)do{if(o0&&(l-=1,o=a)}}function mt(e,t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(null!=l.parent&&ot(t,l.match)){var u=at(e,l.parent);if(u)return u.rule=l,u.parent=e,u.node=t,u.code=u.code.replace("node_","parent_"),u}}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}}function gt(e,t,n,r,i){if(n){var o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;if(null!=c.previous&&ot(t,c.match)){var d=at(n,c.previous);if(d)return d.rule=c,d.node=e,d.child=t,d.index=r,d.previous=n,d.code=d.code.replace("node_","previous_sibling_"),d}}}catch(e){a=!0,s=e}finally{try{!o&&u.return&&u.return()}finally{if(a)throw s}}}}function vt(e,t,n,r,i){if(n){var o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;if(null!=c.next&&ot(t,c.match)){var d=at(n,c.next,[],{match:t});if(d)return d.rule=c,d.node=e,d.child=t,d.index=r,d.next=n,d.code=d.code.replace("node_","next_sibling_"),d}}}catch(e){a=!0,s=e}finally{try{!o&&u.return&&u.return()}finally{if(a)throw s}}}}function yt(e,t){return S({code:e},t)}function bt(e){e.value.selection.isExpanded&&e.delete()}var _t={};function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.plugins,n=void 0===t?[]:t,r=ke(S({},Le,Be,$e,Ge,tt,_t)),i=nt({isAtomic:function(){return!1},isVoid:function(){return!1}}),o=it({rules:[{match:{object:"document"},nodes:[{match:{object:"block"}}]},{match:{object:"block",first:{object:"block"}},nodes:[{match:{object:"block"}}]},{match:{object:"block",first:[{object:"inline"},{object:"text"}]},nodes:[{match:[{object:"inline"},{object:"text"}]}]},{match:{object:"inline"},nodes:[{match:[{object:"inline"},{object:"text"}]}]},{match:[{object:"block"},{object:"inline"}],nodes:[{min:1}],normalize:function(e,t){var n=t.code,r=t.node;"child_min_invalid"===n&&r.nodes.isEmpty()&&e.insertNodeByKey(r.key,0,le.create())}},{match:{object:"block"},first:[{object:"block"},{object:"text"}],last:[{object:"block"},{object:"text"}],normalize:function(e,t){var n=t.code,r=t.node,i=le.create(),o=void 0;if("first_child_object_invalid"===n)o=0;else{if("last_child_object_invalid"!==n)return;o=r.nodes.size}e.insertNodeByKey(r.key,o,i)}},{match:{object:"inline"},first:[{object:"block"},{object:"text"}],last:[{object:"block"},{object:"text"}],previous:[{object:"block"},{object:"text"}],next:[{object:"block"},{object:"text"}],normalize:function(e,t){var n=t.code,r=t.node,i=t.index,o=le.create(),a=void 0;if("first_child_object_invalid"===n)a=0;else if("last_child_object_invalid"===n)a=r.nodes.size;else if("previous_sibling_object_invalid"===n)a=i;else{if("next_sibling_object_invalid"!==n)return;a=i+1}e.insertNodeByKey(r.key,a,o)}},{match:{object:"text"},next:function(e,t){return"text"!==e.object||!t.marks.equals(e.marks)},normalize:function(e,t){var n=t.code,r=t.next;"next_sibling_invalid"===n&&e.mergeNodeByKey(r.key)}},{match:{object:"text"},previous:function(e){return"text"!==e.object||""!==e.text},next:function(e){return"text"!==e.object||""!==e.text},normalize:function(e,t){var n=t.code,r=t.next,i=t.previous;"next_sibling_invalid"===n?e.removeNodeByKey(r.key):"previous_sibling_invalid"===n&&e.removeNodeByKey(i.key)}}]});return[o].concat(P(n),[r,i])}_t.addMark=function(e,t){t=V.create(t);var n=e.value,r=n.document,i=n.selection;if(i.isExpanded)e.addMarkAtRange(i,t);else if(i.marks){var o=i.marks.add(t),a=i.set("marks",o);e.select(a)}else{var s=r.getActiveMarksAtRange(i).add(t),l=i.set("marks",s);e.select(l)}},_t.addMarks=function(e,t){t.forEach((function(t){return e.addMark(t)}))},_t.delete=function(e){var t=e.value.selection;e.deleteAtRange(t),e.moveToFocus()},_t.deleteBackward=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.value,r=n.selection;r.isExpanded?e.delete():e.deleteBackwardAtRange(r,t)},_t.deleteCharBackward=function(e){var t=e.value.selection;t.isExpanded?e.delete():e.deleteCharBackwardAtRange(t)},_t.deleteLineBackward=function(e){var t=e.value.selection;t.isExpanded?e.delete():e.deleteLineBackwardAtRange(t)},_t.deleteWordBackward=function(e){var t=e.value.selection;t.isExpanded?e.delete():e.deleteWordBackwardAtRange(t)},_t.deleteForward=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.value,r=n.selection;r.isExpanded?e.delete():e.deleteForwardAtRange(r,t)},_t.deleteCharForward=function(e){var t=e.value.selection;t.isExpanded?e.delete():e.deleteCharForwardAtRange(t)},_t.deleteLineForward=function(e){var t=e.value.selection;t.isExpanded?e.delete():e.deleteLineForwardAtRange(t)},_t.deleteWordForward=function(e){var t=e.value.selection;t.isExpanded?e.delete():e.deleteWordForwardAtRange(t)},_t.insertBlock=function(e,t){bt(e),t=de.create(t);var n=e.value.selection;e.insertBlockAtRange(n,t);var r=e.value.document.getNode(t.key);r&&e.moveToEndOfNode(r)},_t.insertFragment=function(e,t){if(t.nodes.size){bt(e);var n=e.value,r=n,i=r.document,o=r.selection,a=o.start,s=Array.from(i.texts(),(function(e){return A(e,1)[0].key}));e.insertFragmentAtRange(o,t);var l=(i=(n=e.value).document).getTexts().filter((function(e){return!s.includes(e.key)}));if(0!==l.size){var u=t.text.length,c=i.getNode(a.key)||l.first(),d=l.last()||c;if(c!==d){var f=i.getCommonAncestor(c.key,d.key),p=f.getOffset(c.key)+(a.key===c.key?a.offset:0);d=f.getTextAtOffset(p+u-1)||d,e.moveTo(d.key,p+u-f.getOffset(d.key))}else e.moveTo(d.key,u)}}},_t.insertInline=function(e,t){bt(e),t=oe.create(t);var n=e.value.selection;e.insertInlineAtRange(n,t);var r=e.value.document.getNode(t.key);r&&e.moveToEndOfNode(r)},_t.insertText=function(e,t,n){bt(e);var r=e.value,i=r.document,o=r.selection;n=n||o.marks||i.getInsertMarksAtRange(o),e.withoutNormalizing((function(){e.insertTextAtRange(o,t,n),o.marks&&i!==e.value.document&&e.select({marks:null})}))},_t.removeMark=function(e,t){t=V.create(t);var n=e.value,r=n.document,i=n.selection;if(i.isExpanded)e.removeMarkAtRange(i,t);else if(i.marks){var o=i.marks.remove(t),a=i.set("marks",o);e.select(a)}else{var s=r.getActiveMarksAtRange(i).remove(t),l=i.set("marks",s);e.select(l)}},_t.replaceMark=function(e,t,n){e.removeMark(t),e.addMark(n)},_t.setBlocks=function(e,t){var n=e.value.selection;e.setBlocksAtRange(n,t)},_t.setInlines=function(e,t){var n=e.value.selection;e.setInlinesAtRange(n,t)},_t.splitBlock=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;bt(e);var n=e.value,r=n.selection,i=n.document,o=r.marks||i.getInsertMarksAtRange(r);e.splitBlockAtRange(r,t).moveToEnd(),o&&0!==o.size&&e.select({marks:o})},_t.splitInline=function(e,t){bt(e);var n=e.value.selection;e.splitInlineAtRange(n,t)},_t.toggleMark=function(e,t){t=V.create(t),e.value.activeMarks.has(t)?e.removeMark(t):e.addMark(t)},_t.unwrapBlock=function(e,t){var n=e.value.selection;e.unwrapBlockAtRange(n,t)},_t.unwrapInline=function(e,t){var n=e.value.selection;e.unwrapInlineAtRange(n,t)},_t.wrapBlock=function(e,t){var n=e.value.selection;e.wrapBlockAtRange(n,t)},_t.wrapInline=function(e,t){var n=e.value.selection;e.wrapInlineAtRange(n,t)},_t.wrapText=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.value,i=r.selection;e.wrapTextAtRange(i,t,n),i.isCollapsed&&e.moveStartBackward(t.length),e.moveEndBackward(n.length),i.isForward!==e.value.selection.isForward&&e.flip()};var xt=u()("slate:editor"),kt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x(this,e);var i=n.controller,o=void 0===i?this:i,a=n.construct,s=void 0===a||a,l=t.onChange,u=void 0===l?function(){}:l,c=t.plugins,d=void 0===c?[]:c,f=t.readOnly,p=void 0!==f&&f,h=t.value,m=void 0===h?pe.create():h;this.controller=o,this.middleware={},this.onChange=u,this.operations=Object(r.List)(),this.readOnly=null,this.value=null,this.tmp={dirty:[],flushing:!1,merge:null,normalize:!0,save:!0};var g=wt({plugins:d});Ot(this,g),s&&(this.run("onConstruct"),this.setReadOnly(p),this.setValue(m,n))}return k(e,[{key:"applyOperation",value:function(e){var t=this,n=this.operations,r=this.controller,i=this.value;o()(e)&&(e=S({},e,{value:i})),e=_e.create(e),this.withoutNormalizing((function(){r.save(e),i=t.value})),xt("apply",{operation:e}),this.value=e.apply(i),this.operations=n.push(e);var a=function(e){var t=e.type,n=e.node,r=e.path,i=e.newPath;switch(t){case"add_mark":case"insert_text":case"remove_mark":case"remove_text":case"set_mark":case"set_node":var o=z.getAncestors(r).toArray();return[].concat(P(o),[r]);case"insert_node":var a=n.getKeysToPathsTable(),s=Object.values(a).map((function(e){return r.concat(e)})),l=z.getAncestors(r).toArray();return[].concat(P(l),[r],P(s));case"split_node":var u=z.getAncestors(r).toArray(),c=z.increment(r);return[].concat(P(u),[r,c]);case"merge_node":var d=z.getAncestors(r).toArray(),f=z.decrement(r);return[].concat(P(d),[f]);case"move_node":if(z.isEqual(r,i))return[];var p=z.getAncestors(r).reduce((function(t,n){return t.push.apply(t,P(z.transform(n,e).toArray())),t}),[]),h=z.getAncestors(i).reduce((function(t,n){return t.push.apply(t,P(z.transform(n,e).toArray())),t}),[]);return[].concat(P(p),P(h));case"remove_node":var m=z.getAncestors(r).toArray();return[].concat(P(m));default:return[]}}(e),s=this.tmp.dirty.map((function(t){return t=z.create(t),z.transform(t,e).toArray()})),l={},u=Array.prototype.concat.apply(a,s);return this.tmp.dirty=[],u.forEach((function(e){var n=e.join(",");l[n]||t.tmp.dirty.push(e),l[n]=!0})),this.tmp.flushing||(this.tmp.flushing=!0,Promise.resolve().then((function(){return t.flush()}))),r}},{key:"flush",value:function(){this.run("onChange");var e=this.value,t=this.operations,n=this.controller,i={value:e,operations:t};return this.operations=Object(r.List)(),this.tmp.flushing=!1,this.onChange(i),n}},{key:"command",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},n=t.normalize,r=void 0===n?e!==this.value:n;return this.value=e,r&&this.normalize(),this}},{key:"withoutNormalizing",value:function(e){var t=this.controller,n=this.tmp.normalize;return this.tmp.normalize=!1,e(t),this.tmp.normalize=n,Et(this),t}},{key:"change",value:function(e){Object(a.a)(!1,"As of Slate 0.43 the `change` object has been replaced with `editor`, so the `editor.change()` method is deprecated.`");for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.a)(!1,"As of slate@0.41 the `change.getFlag` method has been deprecated."),void 0!==t[e]?t[e]:this.tmp[e]}},{key:"unsetOperationFlag",value:function(e){return Object(a.a)(!1,"As of slate@0.41 the `change.unsetOperationFlag` method has been deprecated."),delete this.tmp[e],this}},{key:"withoutNormalization",value:function(e){return Object(a.a)(!1,"As of slate@0.41 the `change.withoutNormalization` helper has been renamed to `change.withoutNormalizing`."),this.withoutNormalizing(e)}},{key:"editor",get:function(){return Object(a.a)(!1,"As of Slate 0.43 the `change` object has been replaced with `editor`, so you don't need to access `change.editor`."),this.controller}}]),e}();function Et(e){e.tmp.normalize&&e.tmp.dirty.length&&e.withoutNormalizing((function(){for(;e.tmp.dirty.length;){var t=e.tmp.dirty.pop();St(e,t)}}))}function St(e,t){for(var n=e.controller,r=e.value,i=r.document,o=i.assertNode(t),a=0,s=100+("text"===o.object?1:o.nodes.size);o;){var l=o.normalize(n);if(!l)break;l(n),i=(r=e.value).document;var u=o.key,c=i.getDescendant(t);if(c&&c.key===u)o=c;else{if(!(c=i.getDescendant(u)))break;o=c,t=i.getPath(u)}if(++a>s)throw new Error("A schema rule could not be normalized after sufficient iterations. This is usually due to a `rule.normalize` or `plugin.normalizeNode` function of a schema being incorrectly written, causing an infinite loop.")}}function Ot(e,t){if(Array.isArray(t))t.forEach((function(t){return Ot(e,t)}));else if(null!=t){var n=t.commands,r=t.queries,i=t.schema,o=T(t,["commands","queries","schema"]);if(n){var a=ke(n);Ot(e,a)}if(r){var s=nt(r);Ot(e,s)}if(i){var l=it(i);Ot(e,l)}for(var u in o){var c=o[u];(e.middleware[u]=e.middleware[u]||[]).push(c)}}}var Tt={marks:void 0,text:void 0},Ct=function(e){function t(){return x(this,t),C(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),k(t,[{key:"updateMark",value:function(e,t){var n=this.marks;if(t.equals(e))return this;if(!n.has(e))return this;var r=n.withMutations((function(n){n.remove(e).add(t)}));return this.set("marks",r)}},{key:"addMark",value:function(e){var t=this.marks;return this.set("marks",t.add(e))}},{key:"addMarks",value:function(e){var t=this.marks;return this.set("marks",t.union(e))}},{key:"insertText",value:function(e,t){var n=this.text,r=n.slice(0,e)+t+n.slice(e);return this.set("text",r)}},{key:"removeMark",value:function(e){var t=this.marks;return this.set("marks",t.remove(e))}},{key:"toJSON",value:function(){return{object:this.object,text:this.text,marks:this.marks.toArray().map((function(e){return e.toJSON()}))}}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(a.a)(!1,"As of slate@0.47 the `Leaf` model is deprecated."),t.isLeaf(e))return e;if("string"==typeof e&&(e={text:e}),o()(e))return t.fromJSON(e);throw new Error("`Leaf.create` only accepts objects, strings or leaves, but you passed it: "+e)}},{key:"createLeaves",value:function(e){if(e.size<=1)return e;var t=!1,n=Object(r.List)().withMutations((function(n){e.findLast((function(e,r){var i=n.first();if(i){if(i.marks.equals(e.marks))return t=!0,void n.set(0,i.set("text",""+e.text+i.text));if(""===i.text)return t=!0,void n.set(0,e);if(""===e.text)return void(t=!0)}n.unshift(e)}))}));return t?n:e}},{key:"splitLeaves",value:function(e,t){if(t<0)return[Object(r.List)(),e];if(0===e.size)return[Object(r.List)(),Object(r.List)()];var n=0,i=-1,o=void 0,a=void 0;return e.find((function(e){i++;var r=n,s=e.text;if((n+=s.length)t)return!1;var l=t-r;return o=e.set("text",s.slice(0,l)),a=e.set("text",s.slice(l)),!0})),o?""===o.text?0===i?[r.List.of(o),e]:[e.take(i),e.skip(i)]:""===a.text?i===e.size-1?[e,r.List.of(a)]:[e.take(i+1),e.skip(i+1)]:[e.take(i).push(o),e.skip(i+1).unshift(a)]:[e,Object(r.List)()]}},{key:"createList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.List.isList(e)||Array.isArray(e)){var n=new r.List(e.map(t.create));return n}throw new Error("`Leaf.createList` only accepts arrays or lists, but you passed it: "+e)}},{key:"fromJSON",value:function(e){var n=e.text,i=void 0===n?"":n,o=e.marks,a=void 0===o?[]:o;return new t({text:i,marks:Object(r.Set)(a.map(V.fromJSON))})}},{key:"isLeafList",value:function(e){return r.List.isList(e)&&e.every((function(e){return t.isLeaf(e)}))}}]),t}(Object(r.Record)(Tt));function At(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=!0,u=!1,c=void 0;try{for(var d,f=Object.getOwnPropertyNames(e)[Symbol.iterator]();!(l=(d=f.next()).done);l=!0){var p=d.value;if(!s.hasOwnProperty(p)){var h=Object.getOwnPropertyDescriptor(e,p);Object.defineProperty(s,p,h)}}}catch(e){u=!0,c=e}finally{try{!l&&f.return&&f.return()}finally{if(u)throw c}}var m=!0,g=!1,v=void 0;try{for(var y,b=Object.getOwnPropertyNames(e.prototype)[Symbol.iterator]();!(m=(y=b.next()).done);m=!0){var _=y.value;if(!s.prototype.hasOwnProperty(_)){h=Object.getOwnPropertyDescriptor(e.prototype,_);Object.defineProperty(s.prototype,_,h)}}}catch(e){g=!0,v=e}finally{try{!m&&b.return&&b.return()}finally{if(g)throw v}}}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}Object.entries({Annotation:te,Block:de,Change:xe,Decoration:G,Document:re,Editor:kt,Inline:oe,Leaf:Ct,Mark:V,Node:ue,Operation:_e,Point:q,Range:Z,Selection:Y,Text:le,Value:pe}).forEach((function(e){var t,n,r,i,o=A(e,2),a=o[0],s=o[1];return At((t=a.toLowerCase(),n=Q[t],r="is"+t.charAt(0).toUpperCase()+t.slice(1),(i=function(){function e(){x(this,e)}return k(e,[{key:"object",get:function(){return t}}]),e}())[r]=X.bind(null,t),i.prototype[n]=!0,i),[s])})),At(function(){function e(){x(this,e)}return k(e,[{key:"toJS",value:function(){return this.toJSON.apply(this,arguments)}}],[{key:"fromJS",value:function(){return this.fromJSON.apply(this,arguments)}}]),e}(),[te,de,G,re,oe,Ct,V,ue,_e,q,Z,Y,le,pe]);var Pt=!0,Rt=Symbol("LEAF"),Mt=Symbol("STORE_KEY"),It=Symbol("undefined"),jt=Symbol("null"),Dt=new WeakMap;function Lt(e,t){var n=function(t){var n=e[t];if(!n)throw new Error('Object does not have a property named "'+t+'".');e[t]=function(){for(var e=arguments.length,r=Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=e.onlyLeaves,n=e.onlyRoots,r=e.onlyTypes,i=e.match,o=T(e,["onlyLeaves","onlyRoots","onlyTypes","match"]),a=this.descendants(S({includeDocument:!1,includeInlines:!1,includeTexts:!1},o,{match:function(e,o){return!(r&&!r.includes(e.type))&&((!n||1===o.size)&&(!(t&&!e.isLeafBlock())&&!(i&&!i(e,o))))}}));return a}},{key:"createAnnotation",value:function(e){return e=te.createProperties(e),this.resolveAnnotation(e)}},{key:"createDecoration",value:function(e){return e=G.createProperties(e),this.resolveDecoration(e)}},{key:"createIterable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.direction,n=void 0===t?"forward":t,r=e.downward,i=void 0===r||r,o=e.upward,a=void 0===o||o,s=e.includeBlocks,l=void 0===s||s,u=e.includeDocument,c=void 0===u||u,d=e.includeInlines,f=void 0===d||d,p=e.includeRoot,h=void 0!==p&&p,m=e.includeTarget,g=void 0===m?!!e.range:m,v=e.includeTargetAncestors,y=void 0!==v&&v,b=e.includeTexts,_=void 0===b||b,w=e.match,x=void 0===w?null:w,k=this,S=null,O=null;e.range?(O=k.resolveRange(e.range),S=k.resolvePath(O.start.path)):e.path&&(S=k.resolvePath(e.path));var T=S&&k.assertNode(S),C="undefined"==typeof window?qt.Set:window.Set;return E({},Symbol.iterator,(function(){var e=new C,t=O&&O.start.path,r=O&&O.end.path,o=S,s=T,u=!1,d=!1,p=!1,m=function(){return o&&s?(h||s!==k)&&(l||"block"!==s.object)&&(c||"document"!==s.object)&&(f||"inline"!==s.object)&&(_||"text"!==s.object)?x&&!x(s,o)?v():{value:[s,o],done:!1}:v():{done:!0}},v=function l(){if(!o||!s)return m();if(t&&!d)return p?o.size===t.size-1?(d=!0,o=S,s=T,l()):(o=t.slice(0,o.size+1),s=k.assertNode(o),m()):(p=!0,o=z.create([]),s=k,m());if(g&&!u)return u=!0,m();if(r&&o.equals(r))return s=null,o=null,l();if(i&&s.nodes&&s.nodes.size&&!e.has(s)){e.add(s);var c="forward"===n?0:s.nodes.size-1;return o=o.push(c),s=k.assertNode(o),m()}if("forward"===n){var f=z.increment(o),h=k.getNode(f);if(h)return o=f,s=h,m()}if("backward"===n&&0!==o.last()){var v=z.decrement(o),b=k.getNode(v);if(b)return o=v,s=b,m()}return a&&o.size?(o=z.lift(o),s=k.assertNode(o),e.has(s)?l():(e.add(s),y?m():l())):(o=null,s=null,l())};return{next:v}}))}},{key:"createPoint",value:function(e){return e=q.createProperties(e),this.resolvePoint(e)}},{key:"createRange",value:function(e){return e=Z.createProperties(e),this.resolveRange(e)}},{key:"createSelection",value:function(e){return e=Y.createProperties(e),this.resolveSelection(e)}},{key:"descendants",value:function(e){return this.createIterable(S({path:[]},e))}},{key:"filterDescendants",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht,t=[],n=!0,i=!1,o=void 0;try{for(var a,s=this.descendants()[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var l=a.value,u=A(l,2),c=u[0],d=u[1];e(c,d)&&t.push(c)}}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return Object(r.List)(t)}},{key:"findDescendant",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht,t=!0,n=!1,r=void 0;try{for(var i,o=this.descendants()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=A(a,2),l=s[0],u=s[1];if(e(l,u))return l}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}return null}},{key:"forEachDescendant",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht,t=!0,n=!1,r=void 0;try{for(var i,o=this.descendants()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=e.apply(void 0,P(a));if(!1===s)return}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}},{key:"getActiveMarksAtRange",value:function(e){if((e=this.resolveRange(e)).isUnset)return Object(r.Set)();if(e.isCollapsed){var t=e.start;return this.getInsertMarksAtPoint(t)}var n=e,i=n.start,o=n.end,a=i.path,s=i.offset,l=o.path,u=o.offset,c=this.getDescendant(a),d=this.getDescendant(l);if(!a.equals(l)){for(;!a.equals(l)&&0===u;){var f=this.texts({path:l,direction:"backward"}),p=A(f,1),h=A(p[0],2);d=h[0],l=h[1],u=d.text.length}for(;!a.equals(l)&&s===c.text.length;){var m=this.texts({path:a}),g=A(m,1),v=A(g[0],2);c=v[0],a=v[1],s=0}}if(a.equals(l))return c.marks;var y=c.marks;if(0===y.size)return Object(r.Set)();var b=d.marks,_=y.intersect(b);if(0===_.size)return _;var w=this.texts({path:a}),x=A(w,1),k=A(x[0],2);for(c=k[0],a=k[1];!a.equals(l);){if(0!==c.text.length&&0===(_=_.intersect(c.marks)).size)return Object(r.Set)();var E=this.texts({path:a}),S=A(E,1),O=A(S[0],2);c=O[0],a=O[1]}return _}},{key:"getAncestors",value:function(e){var t=this.ancestors(e),n=Array.from(t,(function(e){return A(e,1)[0]})).reverse();return Object(r.List)(n)}},{key:"getBlocks",value:function(){var e=this.blocks({onlyLeaves:!0}),t=Array.from(e,(function(e){return A(e,1)[0]}));return Object(r.List)(t)}},{key:"getBlocksByType",value:function(e){var t=this.blocks({onlyLeaves:!0,onlyTypes:[e]}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getChild",value:function(e){return!(e=this.resolvePath(e))||e.size>1?null:this.nodes.get(e.first())}},{key:"getClosest",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.ancestors(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=A(s,2),u=l[0];if(t(u,l[1]))return u}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return null}},{key:"getClosestBlock",value:function(e){return this.getClosest(e,(function(e){return"block"===e.object}))}},{key:"getClosestInline",value:function(e){return this.getClosest(e,(function(e){return"inline"===e.object}))}},{key:"getClosestVoid",value:function(e,t){return Object(s.a)(!pe.isValue(t),"As of Slate 0.42.0, the `node.getClosestVoid` method takes an `editor` instead of a `value`."),this.getClosest(e,(function(e){return t.isVoid(e)}))}},{key:"getCommonAncestor",value:function(e,t){if(e=this.resolvePath(e),t=this.resolvePath(t),!e||!t)return null;var n=z.relate(e,t);return this.getNode(n)}},{key:"getDecorations",value:function(e){var t=e.run("decorateNode",this);return t=G.createList(t)}},{key:"getDepth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!(e=this.resolvePath(e)))return null;var n=this.getNode(e),r=n?e.size-1+t:null;return r}},{key:"getDescendant",value:function(e){if(!(e=this.resolvePath(e))||!e.size)return null;var t=this;return e.forEach((function(e){return!!(t=t.getIn(["nodes",e]))})),t}},{key:"getDescendantsAtRange",value:function(e){var t=this.descendants({range:e}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getFragmentAtRange",value:function(e){if((e=this.resolveRange(e)).isUnset)return re.create();for(var t=e,n=t.start,r=t.end,i=this,o=r.path,a=r.offset,s="end";o.size;){var l=o.last();i=i.splitNode(o,a),a=l+1,(o=z.lift(o)).size||"end"!==s||(o=n.path,a=n.offset,s="start")}var u=n.path.first()+1,c=r.path.first()+2,d=i.nodes.slice(u,c);return re.create({nodes:d})}},{key:"getFurthest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ht,n=this.ancestors(e),r=Array.from(n).reverse(),i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=A(u,2),d=c[0],f=c[1];if(t(d,f))return d}}catch(e){o=!0,a=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw a}}return null}},{key:"getFurthestBlock",value:function(e){return this.getFurthest(e,(function(e){return"block"===e.object}))}},{key:"getFurthestChild",value:function(e){return(e=this.resolvePath(e))&&e.size?this.nodes.get(e.first()):null}},{key:"getFurthestInline",value:function(e){return this.getFurthest(e,(function(e){return"inline"===e.object}))}},{key:"getInlines",value:function(){var e=this.inlines({onlyLeaves:!0}),t=Array.from(e,(function(e){return A(e,1)[0]}));return Object(r.List)(t)}},{key:"getInlinesByType",value:function(e){var t=this.inlines({onlyLeaves:!0,onlyTypes:[e]}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getInsertMarksAtPoint",value:function(e){var t=e=this.resolvePoint(e),n=t.path,r=t.offset,i=this.getDescendant(n);if(0!==r)return i.marks;var o=void 0,a=void 0,s=!0,l=!1,u=void 0;try{for(var c,d=this.ancestors(n)[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var f=c.value,p=A(f,2),h=p[0],m=p[1];"block"===h.object&&(o=h,a=m)}}catch(e){l=!0,u=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw u}}var g=z.drop(n,a.size),v=o.texts({path:g,direction:"backward"}),y=A(v,1)[0];return y?A(y,1)[0].marks:i.marks}},{key:"getInsertMarksAtRange",value:function(e){var t=(e=this.resolveRange(e)).start;return e.isUnset?Object(r.Set)():e.isCollapsed?this.getInsertMarksAtPoint(t):this.getDescendant(t.path).marks}},{key:"getLeafBlocksAtRange",value:function(e){var t=this.blocks({range:e,onlyLeaves:!0}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getLeafInlinesAtRange",value:function(e){var t=this.inlines({range:e,onlyLeaves:!0}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getNodesToPathsMap",value:function(){var e="undefined"==typeof window?new qt.Map:new window.Map;return e.set(this,z.create([])),this.forEachDescendant((function(t,n){e.set(t,n)})),e}},{key:"getMarks",value:function(){var e=this.marks(),t=Array.from(e,(function(e){return A(e,1)[0]}));return Object(r.OrderedSet)(t)}},{key:"getMarksAtRange",value:function(e){var t=this.marks({range:e}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.OrderedSet)(n)}},{key:"getMarksByType",value:function(e){var t=this.marks({onlyTypes:[e]}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.OrderedSet)(n)}},{key:"getNextBlock",value:function(e){var t=this.blocks({path:e,onlyLeaves:!0}),n=A(t,1)[0];return n?n[0]:null}},{key:"getNextNode",value:function(e){var t=this.createIterable({path:e,downward:!1}),n=A(t,1)[0];return n?n[0]:null}},{key:"getNextSibling",value:function(e){var t=this.siblings(e),n=A(t,1)[0];return n?n[0]:null}},{key:"getNextText",value:function(e){var t=this.texts({path:e}),n=A(t,1)[0];return n?n[0]:null}},{key:"getOffset",value:function(e){e=this.resolvePath(e),this.assertDescendant(e);var t=e.first(),n=this.nodes.slice(0,t).reduce((function(e,t){return e+t.text.length}),0);return 1===e.size?n:n+this.nodes.get(t).getOffset(z.drop(e))}},{key:"getOffsetAtRange",value:function(e){if((e=this.resolveRange(e)).isUnset)throw new Error("The range cannot be unset to calculcate its offset.");if(e.isExpanded)throw new Error("The range must be collapsed to calculcate its offset.");var t=e.start;return this.getOffset(t.path)+t.offset}},{key:"getParent",value:function(e){if(!(e=this.resolvePath(e)))return null;if(!e.size)return null;var t=z.lift(e);return this.getNode(t)}},{key:"getPreviousBlock",value:function(e){var t=this.blocks({path:e,onlyLeaves:!0,direction:"backward"}),n=A(t,1)[0];return n?n[0]:null}},{key:"getPreviousNode",value:function(e){var t=this.createIterable({path:e,downward:!1,direction:"backward"}),n=A(t,1)[0];return n?n[0]:null}},{key:"getPreviousSibling",value:function(e){var t=this.siblings(e,{direction:"backward"}),n=A(t,1)[0];return n?n[0]:null}},{key:"getPreviousText",value:function(e){var t=this.texts({path:e,direction:"backward"}),n=A(t,1)[0];return n?n[0]:null}},{key:"getRootBlocksAtRange",value:function(e){var t=this.blocks({range:e,onlyRoots:!0}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getRootInlinesAtRange",value:function(e){var t=this.inlines({range:e,onlyRoots:!0}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"getTextAtOffset",value:function(e){if(0===e)return this.getFirstText();if(e===this.text.length)return this.getLastText();if(e<0||e>this.text.length)return null;var t=0,n=!0,r=!1,i=void 0;try{for(var o,a=this.texts()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=A(s,1)[0];if((t+=l.text.length)>e)return l}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return null}},{key:"getTextDirection",value:function(){var e=g()(this.text);return"neutral"===e?null:e}},{key:"getTexts",value:function(){var e=this.texts(),t=Array.from(e,(function(e){return A(e,1)[0]}));return Object(r.List)(t)}},{key:"getTextsAtRange",value:function(e){var t=this.texts({range:e}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"hasBlockChildren",value:function(){return!(!this.nodes||!this.nodes.find((function(e){return"block"===e.object})))}},{key:"hasChild",value:function(e){return!!this.getChild(e)}},{key:"hasInlineChildren",value:function(){return!(!this.nodes||!this.nodes.find((function(e){return"inline"===e.object||"text"===e.object})))}},{key:"hasDescendant",value:function(e){return!!this.getDescendant(e)}},{key:"hasVoidParent",value:function(e,t){return Object(s.a)(!pe.isValue(t),"As of Slate 0.42.0, the `node.hasVoidParent` method takes an `editor` instead of a `value`."),!!this.getClosestVoid(e,t)}},{key:"inlines",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onlyLeaves,r=t.onlyRoots,i=t.onlyTypes,o=t.match,a=T(t,["onlyLeaves","onlyRoots","onlyTypes","match"]),s=this.descendants(S({includeBlocks:!1,includeTexts:!1,includeDocument:!1},a,{match:function(t,a){return!(i&&!i.includes(t.type))&&(!(n&&!t.isLeafInline())&&((!r||"block"===e.getParent(a).object)&&!(o&&!o(t,a))))}}));return s}},{key:"insertNode",value:function(e,t){var n=(e=this.resolvePath(e)).last(),r=z.lift(e),i=this.assertNode(r),o=i.nodes.splice(n,0,t);return i=i.set("nodes",o),this.replaceNode(r,i)}},{key:"insertText",value:function(e,t,n){e=this.resolvePath(e);var r=this.assertDescendant(e);return r=r.insertText(t,n),this.replaceNode(e,r)}},{key:"isLeafBlock",value:function(){return"block"===this.object&&!this.nodes.some((function(e){return"block"===e.object}))}},{key:"isLeafInline",value:function(){return"inline"===this.object&&!this.nodes.some((function(e){return"inline"===e.object}))}},{key:"isInRange",value:function(e,t){if(e=this.resolvePath(e),(t=this.resolveRange(t)).isUnset)return!1;var n=z.compare(e,t.start.path),r=z.compare(e,t.end.path),i=-1!==n&&1!==r;return i}},{key:"mapChildren",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht,n=this.nodes;n.forEach((function(r,i){var o=t(r,i,e.nodes);o!==r&&(n=n.set(o.key,o))}));var r=this.set("nodes",n);return r}},{key:"mapDescendants",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ht,n=this.nodes;n.forEach((function(r,i){var o=r;"text"!==o.object&&(o=o.mapDescendants(t)),(o=t(o,i,e.nodes))!==r&&(n=n.set(i,o))}));var r=this.set("nodes",n);return r}},{key:"marks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onlyTypes,n=void 0===t?null:t,r=e.match,i=T(e,["onlyTypes","match"]),o=this.texts(i);return E({},Symbol.iterator,(function(){var e=o[Symbol.iterator](),t=null,i=null,a=[];return{next:function o(){if(a.length){var s=a.shift();return n&&!n.includes(s.type)||r&&!r(s,t,i)?o():{value:[s,t,i],done:!1}}var l=e.next(),u=l.value;if(l.done)return{done:!0};var c=A(u,2);return t=c[0],i=c[1],a=t.marks.toArray(),o()}}}))}},{key:"mergeNode",value:function(e){var t=this.assertNode(e);if(0===(e=this.resolvePath(e)).last())throw new Error("Unable to merge node because it has no previous sibling: "+t);var n=z.decrement(e),r=this.assertNode(n);if(r.object!==t.object)throw new Error("Unable to merge two different kinds of nodes: "+r+" and "+t);var i="text"===r.object?r.mergeText(t):r.set("nodes",r.nodes.concat(t.nodes)),o=this;return o=(o=(o=o.removeNode(e)).removeNode(n)).insertNode(n,i)}},{key:"moveNode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.assertNode(e);e=this.resolvePath(e),t=this.resolvePath(t,n);var i=z.lift(t);this.assertNode(i);var o=_e.create({type:"move_node",path:e,newPath:t});t=z.transform(e,o).first();var a=this;return a=(a=a.removeNode(e)).insertNode(t,r)}},{key:"removeMark",value:function(e,t){e=this.resolvePath(e);var n=this.assertDescendant(e);return n=n.removeMark(t),this.replaceNode(e,n)}},{key:"removeNode",value:function(e){this.assertDescendant(e);var t=(e=this.resolvePath(e)).flatMap((function(e){return["nodes",e]}));return this.deleteIn(t)}},{key:"removeText",value:function(e,t,n){var r=this.assertDescendant(e);return r=r.removeText(t,n.length),this.replaceNode(e,r)}},{key:"replaceNode",value:function(e,t){if(!(e=this.resolvePath(e)))throw new Error("Unable to replace a node because it could not be found in the first place: "+e);if(!e.size)return t;this.assertNode(e);var n=e.flatMap((function(e){return["nodes",e]}));return this.setIn(n,t)}},{key:"resolveAnnotation",value:function(e){return e=(e=te.create(e)).normalize(this)}},{key:"resolveDecoration",value:function(e){return e=(e=G.create(e)).normalize(this)}},{key:"resolvePoint",value:function(e){return e=(e=q.create(e)).normalize(this)}},{key:"resolveRange",value:function(e){return e=(e=Z.create(e)).normalize(this)}},{key:"resolveSelection",value:function(e){return e=(e=Y.create(e)).normalize(this)}},{key:"setNode",value:function(e,t){var n=this.assertNode(e);return n=n.merge(t),this.replaceNode(e,n)}},{key:"setMark",value:function(e,t,n){e=this.resolvePath(e);var r=this.assertDescendant(e);return r=r.setMark(t,n),this.replaceNode(e,r)}},{key:"siblings",value:function(e,t){return this.createIterable(S({path:e,upward:!1,downward:!1},t))}},{key:"splitNode",value:function(e,t,n){var r=this.assertNode(e);e=this.resolvePath(e);var i=void 0,o=void 0;if("text"===r.object){var a=r.splitText(t),s=A(a,2);i=s[0],o=s[1]}else{var l=r.nodes.take(t),u=r.nodes.skip(t);i=r.set("nodes",l),o=r.set("nodes",u).regenerateKey()}n&&"text"!==r.object&&(o=o.merge(n));var c=this;return c=(c=(c=c.removeNode(e)).insertNode(e,o)).insertNode(e,i)}},{key:"texts",value:function(e){return this.descendants(S({includeBlocks:!1,includeInlines:!1,includeDocument:!1},e))}},{key:"getBlocksAtRange",value:function(e){return Object(a.a)(!1,"As of slate@0.44 the `node.getBlocksAtRange` method has been renamed to `getLeafBlocksAtRange`."),this.getLeafBlocksAtRange(e)}},{key:"getBlocksAtRangeAsArray",value:function(e){return Object(a.a)(!1,"As of slate@0.44 the `node.getBlocksAtRangeAsArray` method has been renamed to `getLeafBlocksAtRangeAsArray`."),this.getLeafBlocksAtRangeAsArray(e)}},{key:"getInlinesAtRange",value:function(e){return Object(a.a)(!1,"As of slate@0.44 the `node.getInlinesAtRange` method has been renamed to `getLeafInlinesAtRange`."),this.getLeafInlinesAtRange(e)}},{key:"getInlinesAtRangeAsArray",value:function(e){return Object(a.a)(!1,"As of slate@0.44 the `node.getInlinesAtRangeAsArray` method has been renamed to `getLeafInlinesAtRangeAsArray`."),this.getLeafInlinesAtRangeAsArray(e)}},{key:"getNextTextAndPath",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getNextTextAndPath` method has been renamed to `getNextTextEntry`."),this.getNextTextEntry(e)}},{key:"getNextDeepMatchingNodeAndPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};Object(a.a)(!1,"As of slate@0.47, the `getNextDeepMatchingNodeAndPath` method is deprecated.");var n=this.getNextMatchingNodeAndPath(e);if(!n)return null;for(var r=A(n,2),i=r[0],o=r[1],s=void 0,l=function(){return s="text"!==i.object&&i.findFirstDescendantAndPath(t,o)};l(s);){var u=s,c=A(u,2);i=c[0],o=c[1]}return i?t(i)?[i,o]:this.getNextDeepMatchingNodeAndPath(n[1],t):null}},{key:"getPreviousTextAndPath",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getPreviousTextAndPath` method has been renamed to `getPreviousTextEntry`."),this.getPreviousTextEntry(e)}},{key:"findFirstDescendantAndPath",value:function(e,t){return Object(a.a)(!1,"As of slate@0.47, the `findFirstDescendantAndPath` method is deprecated."),this.findDescendantAndPath(e,t,!1)}},{key:"getPreviousMatchingNodeAndPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};if(Object(a.a)(!1,"As of slate@0.47, the `getPreviousMatchingNodeAndPath` method is deprecated."),!e)return null;for(var n=e.size;n>0;n--){var r=e.slice(0,n);if(0!==r.last()){for(var i=z.decrement(r),o=this.getNode(i);o&&!t(o);)i=z.decrement(i),o=this.getNode(i);if(o)return[o,i]}}return null}},{key:"getPreviousDeepMatchingNodeAndPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};Object(a.a)(!1,"As of slate@0.47, the `getPreviousDeepMatchingNodeAndPath` method is deprecated.");var n=this.getPreviousMatchingNodeAndPath(e);if(!n)return null;for(var r=A(n,2),i=r[0],o=r[1],s=void 0,l=function(){return s="text"!==i.object&&i.findLastDescendantAndPath(t,o)};l(s);){var u=s,c=A(u,2);i=c[0],o=c[1]}return i?t(i)?[i,o]:this.getPreviousDeepMatchingNodeAndPath(n[1],t):null}},{key:"findLastDescendantAndPath",value:function(e,t){return Object(a.a)(!1,"As of slate@0.47, the `findLastDescendantAndPath` method is deprecated."),this.findDescendantAndPath(e,t,!0)}},{key:"findDescendantAndPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z.create([]),n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object(a.a)(!1,"As of slate@0.47, the `findDescendantAndPath` method is deprecated.");var r=void 0,i=void 0;return this.forEachDescendantWithPath((function(t,n,o){if(e(t,n,o))return r=t,i=n,!1}),t,n),r?[r,i]:null}},{key:"forEachDescendantWithPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z.create([]),n=arguments[2];Object(a.a)(!1,"As of slate@0.47, the `forEachDescendantWithPath` method is deprecated.");var r=this.nodes,i=void 0;return n&&(r=r.reverse()),r.forEach((function(o,a){var s=t.concat(a);return!1===e(o,s,r)?(i=!1,!1):"text"!==o.object?i=o.forEachDescendantWithPath(e,s,n):void 0})),i}},{key:"getNextMatchingNodeAndPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};if(Object(a.a)(!1,"As of slate@0.47, the `getNextMatchingNodeAndPath` method is deprecated."),!e)return null;for(var n=e.size;n>0;n--){for(var r=e.slice(0,n),i=z.increment(r),o=this.getNode(i);o&&!t(o);)i=z.increment(i),o=this.getNode(i);if(o)return[o,i]}return null}},{key:"getSelectionIndexes",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Object(a.a)(!1,"As of slate@0.47, the `getSelectionIndexes` method is deprecated.");var n=e.start,r=e.end;if(!t)return null;if(e.isUnset)return null;if(n.path.equals(r.path)){var i=this.getFurthestAncestor(n.path),o=i?this.nodes.indexOf(i):null;return{start:o,end:o+1}}var s=null,l=null;return this.nodes.forEach((function(e,t){return"text"===e.object?(null==s&&e.key===n.key&&(s=t),null==l&&e.key===r.key&&(l=t+1)):(null==s&&e.hasDescendant(n.key)&&(s=t),null==l&&e.hasDescendant(r.key)&&(l=t+1)),null==s||null==l})),t&&null==s&&(s=0),t&&null==l&&(l=this.nodes.size),null==s?null:{start:s,end:l}}},{key:"getTextsBetweenPositionsAsArray",value:function(e,t){return Object(a.a)(!1,"As of slate@0.47, the `getTextsBetweenPositionsAsArray` method is deprecated."),e=this.resolvePath(e),t=this.resolvePath(t),this.getTextsBetweenPathPositionsAsArray(e,t)}},{key:"getOrderedMarksBetweenPositions",value:function(e,t,n,i){Object(a.a)(!1,"As of slate@0.47, the `getOrderedMarksBetweenPositions` method is deprecated."),e=this.resolvePath(e),n=this.resolvePath(n);var o=this.getDescendant(e);if(z.isEqual(e,n))return o.marks;var s=this.getTextsBetweenPathPositionsAsArray(e,n);return Object(r.OrderedSet)().withMutations((function(e){s.forEach((function(t){e.union(t.marks)}))}))}},{key:"getTextsBetweenPathPositionsAsArray",value:function(e,t){if(Object(a.a)(!1,"As of slate@0.47, the `getTextsBetweenPathPositionsAsArray` method is deprecated."),e&&t&&z.isEqual(e,t))return[this.getDescendant(e)];if(!e&&!t)return this.getTextsAsArray();var n=e?e.get(0,0):0,r=t?t.get(0,this.nodes.size-1):this.nodes.size-1,i=[];return this.nodes.slice(n,r+1).forEach((function(o,a){if("text"===o.object)i.push(o);else{var s=e&&0===a?z.drop(e):null,l=t&&a===r-n?z.drop(t):null;i=i.concat(o.getTextsBetweenPathPositionsAsArray(s,l))}})),i}},{key:"getFurthestAncestor",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getFurthestAncestor` method has been renamed to `getFurthestChild`."),this.getFurthestChild(e)}},{key:"getLeafBlocksAtRangeAsArray",value:function(e){if(Object(a.a)(!1,"As of slate@0.47, the `getLeafBlocksAtRangeAsArray` method is deprecated."),(e=this.resolveRange(e)).isUnset)return[];var t=e,n=t.start,r=t.end;return this.getLeafBlocksBetweenPathPositionsAsArray(n.path,r.path)}},{key:"getLeafBlocksBetweenPathPositionsAsArray",value:function(e,t){if(Object(a.a)(!1,"As of slate@0.47, the `getLeafBlocksBetweenPathPositionsAsArray` method is deprecated."),e&&t&&z.isEqual(e,t))return[this.getClosestBlock(e)];if(!e&&!t)return this.getBlocksAsArray();var n=e?e.get(0,0):0,r=t?t.get(0,this.nodes.size-1):this.nodes.size-1,i=[];return this.nodes.slice(n,r+1).forEach((function(o,a){if("block"===o.object)if(o.isLeafBlock())i.push(o);else{var s=e&&0===a?z.drop(e):null,l=t&&a===r-n?z.drop(t):null;i=i.concat(o.getLeafBlocksBetweenPathPositionsAsArray(s,l))}})),i}},{key:"getBlocksAsArray",value:function(){Object(a.a)(!1,"As of slate@0.47, the `getBlocksAsArray` method is deprecated.");var e=this.blocks({onlyLeaves:!0});return Array.from(e,(function(e){return A(e,1)[0]}))}},{key:"getBlocksByTypeAsArray",value:function(e){Object(a.a)(!1,"As of slate@0.47, the `getBlocksByTypeAsArray` method is deprecated.");var t=this.blocks({onlyLeaves:!0,onlyTypes:[e]});return Array.from(t,(function(e){return A(e,1)[0]}))}},{key:"getFurthestOnlyChildAncestor",value:function(e){Object(a.a)(!1,"As of slate@0.47, the `getFurthestOnlyChildAncestor` method is deprecated.");var t=this.getAncestors(e);return t&&t.rest().reverse().takeUntil((function(e){return e.nodes.size>1})).last()||null}},{key:"getInlinesAsArray",value:function(){return Object(a.a)(!1,"As of slate@0.47, the `getInlinesAsArray` method is deprecated."),Array.from(this.inlines({onlyLeaves:!0}),(function(e){return A(e,1)[0]}))}},{key:"getInlinesByTypeAsArray",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getInlinesByTypeAsArray` method is deprecated."),Array.from(this.inlines({onlyLeaves:!0,onlyTypes:[e]}),(function(e){return A(e,1)[0]}))}},{key:"getLeafInlinesAtRangeAsArray",value:function(e){var t=this;return Object(a.a)(!1,"As of slate@0.47, the `getLeafInlinesAtRangeAsArray` method is deprecated."),(e=this.resolveRange(e)).isUnset?[]:this.getTextsAtRangeAsArray(e).map((function(e){return t.getClosestInline(e.key)})).filter((function(e){return e}))}},{key:"getOrderedMarks",value:function(){return Object(a.a)(!1,"As of slate@0.47, the `getOrderedMarks` method has been folded into `getMarks`, which will now return an ordered set."),this.getMarks()}},{key:"getOrderedMarksAtRange",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getOrderedMarksAtRange` method has been folded into `getMarksAtRange`, which will now return an ordered set."),this.getMarksAtRange(e)}},{key:"getOrderedMarksByType",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getOrderedMarksByType` method has been folded into `getMarksByType`, which will now return an ordered set."),this.getMarksByType(e)}},{key:"getMarksByTypeAsArray",value:function(e){return Object(a.a)(!1,"As of slate@0.47, the `getMarksByTypeAsArray` method is deprecated."),this.nodes.reduce((function(t,n){return"text"===n.object?t.concat(n.marks.filter((function(t){return t.type===e}))):t.concat(n.getMarksByTypeAsArray(e))}),[])}},{key:"getMarksAsArray",value:function(){var e;Object(a.a)(!1,"As of slate@0.47, the `getMarksAsArray` method is deprecated.");var t=[],n=!0,r=!1,i=void 0;try{for(var o,s=this.texts()[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var l=o.value,u=A(l,1)[0];t.push(u.marks.toArray())}}catch(e){r=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw i}}return(e=[]).concat.apply(e,t)}},{key:"getRootInlinesAtRangeAsArray",value:function(e){var t=this;return Object(a.a)(!1,"As of slate@0.47, the `getRootInlinesAtRangeAsArray` method is deprecated."),(e=this.resolveRange(e)).isUnset?Object(r.List)():this.getTextsAtRangeAsArray(e).map((function(e){return t.getFurthestInline(e.key)})).filter((function(e){return e}))}},{key:"getTextsAsArray",value:function(){Object(a.a)(!1,"As of slate@0.47, the `getTextsAsArray` method is deprecated.");var e=this.texts();return Array.from(e,(function(e){return A(e,1)[0]}))}},{key:"getTextsAtRangeAsArray",value:function(e){Object(a.a)(!1,"As of slate@0.47, the `getTextsAtRangeAsArray` method is deprecated.");var t=this.texts({range:e});return Array.from(t,(function(e){return A(e,1)[0]}))}},{key:"getMarksAtPosition",value:function(e,t){Object(a.a)(!1,"As of slate@0.47, the `getMarksAtPosition` method is deprecated."),e=this.resolvePath(e);var n=this.getDescendant(e).marks;if(0!==t)return Object(r.OrderedSet)(n);var i=this.getClosestBlock(e);if(""===i.text)return Object(r.OrderedSet)(n);var o=this.texts({path:e,direction:"backward"}),s=A(o,1)[0];if(!s)return Object(r.OrderedSet)();var l=A(s,2),u=l[0],c=l[1];return i.hasDescendant(c)?Object(r.OrderedSet)(u.marks):Object(r.OrderedSet)(n)}},{key:"getNodesAtRange",value:function(e){Object(a.a)(!1,"As of slate@0.47, the `getNodesAtRange` method has been renamed to `getDescendantsAtRange`.");var t=this.descendants({range:e}),n=Array.from(t,(function(e){return A(e,1)[0]}));return Object(r.List)(n)}},{key:"isNodeInRange",value:function(e,t){return Object(a.a)(!1,"As of slate@0.47, the `isNodeInRange` method has been renamed to `isInRange`."),this.isInRange(e,t)}},{key:"text",get:function(){return this.getText()}}]),e}(),Vt=function(e){Wt.prototype["assert"+e]=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:e,n=this.setPoints([this.anchor.moveToStartOfNode(e),this.focus.moveToEndOfNode(t)]);return n}},{key:"moveToStart",value:function(){return this.setEnd(this.start)}},{key:"moveToStartOfNode",value:function(e){return this.updatePoints((function(t){return t.moveToStartOfNode(e)}))}},{key:"normalize",value:function(e){return this.updatePoints((function(t){return t.normalize(e)}))}},{key:"setAnchor",value:function(e){return this.set("anchor",e)}},{key:"setEnd",value:function(e){return this.isBackward?this.setAnchor(e):this.setFocus(e)}},{key:"setFocus",value:function(e){return this.set("focus",e)}},{key:"setPoints",value:function(e){var t=A(e,2),n=t[0],r=t[1];return this.set("anchor",n).set("focus",r)}},{key:"updatePoints",value:function(e){var t=this.anchor,n=this.focus;return t=e(t),n=e(n),this.merge({anchor:t,focus:n})}},{key:"setStart",value:function(e){return this.isBackward?this.setFocus(e):this.setAnchor(e)}},{key:"setProperties",value:function(e){var t=e=Z.createProperties(e),n=t.anchor,r=t.focus,i=T(t,["anchor","focus"]);return n&&(i.anchor=q.create(n)),r&&(i.focus=q.create(r)),this.merge(i)}},{key:"toJSON",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={object:this.object,anchor:this.anchor.toJSON(e),focus:this.focus.toJSON(e)};return t}},{key:"toRange",value:function(){var e=Z.createProperties(this);return Z.create(e)}},{key:"unset",value:function(){return this.updatePoints((function(e){return e.unset()}))}},{key:"isCollapsed",get:function(){return this.anchor===this.focus||this.anchor.key===this.focus.key&&this.anchor.offset===this.focus.offset}},{key:"isExpanded",get:function(){return!this.isCollapsed}},{key:"isBackward",get:function(){var e=this.isUnset,t=this.anchor,n=this.focus;return e?null:t.key===n.key?t.offset>n.offset:z.isBefore(n.path,t.path)}},{key:"isForward",get:function(){var e=this.isBackward;return null==e?null:!e}},{key:"isUnset",get:function(){var e=this.anchor,t=this.focus;return e.isUnset||t.isUnset}},{key:"isSet",get:function(){return!this.isUnset}},{key:"start",get:function(){return this.isBackward?this.focus:this.anchor}},{key:"end",get:function(){return this.isBackward?this.anchor:this.focus}}]),e}(),[te,G,Z,Y]);var Xt={Annotation:te,Block:de,Change:xe,Data:H,Decoration:G,Document:re,Editor:kt,Inline:oe,KeyUtils:_,Leaf:Ct,Mark:V,Node:ue,Operation:_e,PathUtils:z,Point:q,Range:Z,resetMemoization:Bt,Selection:Y,Text:le,TextUtils:je,useMemoization:zt,Value:pe};t.default=Xt}.call(this,n(43))},function(e,t,n){"use strict";var r,i=n(4),o=function(){invariant(!1,"ImmutablePropTypes type checking code is stripped in production.")};o.isRequired=o;var a=function(){return o};function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof i.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function l(e){function t(t,n,r,i,o,a){for(var s=arguments.length,l=Array(s>6?s-6:0),u=6;u>",null!=n[r])return e.apply(void 0,[n,r,i,o,a].concat(l));var c=o;return t?new Error("Required "+c+" `"+a+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function u(e,t){return n="Iterable."+e,r=function(e){return i.Iterable.isIterable(e)&&t(e)},l((function(e,t,i,o,a){var l=e[t];if(!r(l)){var u=s(l);return new Error("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+i+"`, expected `"+n+"`.")}return null}));var n,r}(r={listOf:a,mapOf:a,orderedMapOf:a,setOf:a,orderedSetOf:a,stackOf:a,iterableOf:a,recordOf:a,shape:a,contains:a,mapContains:a,orderedMapContains:a,list:o,map:o,orderedMap:o,set:o,orderedSet:o,stack:o,seq:o,record:o,iterable:o}).iterable.indexed=u("Indexed",i.Iterable.isIndexed),r.iterable.keyed=u("Keyed",i.Iterable.isKeyed),e.exports=r},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){for(var r,o,a=n||i,s=0,l=e.length,u=!1;s>1)],t))<0?s=r+1:(l=r,u=!o);return u?s:~s}function i(e,t){return e>t?1:e=0}function a(e,t,n){var r,i=e.length;if(e[0]<=t)return 0;if(t<=e[i-1])return i-1;if(n>0){for(r=1;r-1;return r&&e.splice(n,1),r}function c(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r0||n&&0===o)}))}n.d(t,"a",(function(){return r})),n.d(t,"g",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"i",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"h",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"j",(function(){return d})),n.d(t,"e",(function(){return f}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(294);function i(e,t){if(!e)throw new r.a(t)}},function(e,t,n){"use strict";var r=n(14);t.a={SINGLECLICK:"singleclick",CLICK:r.a.CLICK,DBLCLICK:r.a.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},function(e,t,n){"use strict";t.a={ANIMATING:0,INTERACTING:1}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a.a})),n.d(t,"d",(function(){return A})),n.d(t,"e",(function(){return P})),n.d(t,"b",(function(){return M})),n.d(t,"c",(function(){return I})),n.d(t,"f",(function(){return D})),n.d(t,"g",(function(){return L})),n.d(t,"h",(function(){return N}));var r=n(238),i=n(3),o=n(15),a=n(56),s=function(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit};s.prototype.canWrapX=function(){return this.canWrapX_},s.prototype.getCode=function(){return this.code_},s.prototype.getExtent=function(){return this.extent_},s.prototype.getUnits=function(){return this.units_},s.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||a.a[this.units_]},s.prototype.getWorldExtent=function(){return this.worldExtent_},s.prototype.getAxisOrientation=function(){return this.axisOrientation_},s.prototype.isGlobal=function(){return this.global_},s.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)},s.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},s.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},s.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)},s.prototype.setWorldExtent=function(e){this.worldExtent_=e},s.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},s.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var l=s,u=6378137*Math.PI,c=[-u,-u,u,u],d=[-180,-85,180,85],f=function(e){function t(t){e.call(this,{code:t,units:a.b.METERS,extent:c,global:!0,worldExtent:d,getPointResolution:function(e,t){return e/Object(o.b)(t[1]/6378137)}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(l),p=[new f("EPSG:3857"),new f("EPSG:102100"),new f("EPSG:102113"),new f("EPSG:900913"),new f("urn:ogc:def:crs:EPSG:6.18:3:3857"),new f("urn:ogc:def:crs:EPSG::3857"),new f("http://www.opengis.net/gml/srs/epsg.xml#3857")];function h(e,t,n){var r=e.length,i=n>1?n:2,o=t;void 0===o&&(o=i>2?e.slice():new Array(r));for(var a=u,s=0;sa?l=a:l<-a&&(l=-a),o[s+1]=l}return o}function m(e,t,n){var r=e.length,i=n>1?n:2,o=t;void 0===o&&(o=i>2?e.slice():new Array(r));for(var a=0;a + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var r=n(1231);function i(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==i(e)&&("function"==typeof(t=e.constructor)&&(!1!==i(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(1235);e.exports=function(e){if(t=e,t&&t.window===t)return e;var t;var n=r(e);if(i){n.parentWindow.execScript("document._parentWindow = window;","Javascript");var o=n._parentWindow;return n._parentWindow=null,o}return n.defaultView||n.parentWindow};var i=n(1236)},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return _})),n.d(t,"c",(function(){return E})),n.d(t,"d",(function(){return C})),n.d(t,"e",(function(){return v})),n.d(t,"f",(function(){return j})),n.d(t,"g",(function(){return D})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return k})),n.d(t,"j",(function(){return T})),n.d(t,"k",(function(){return F})),n.d(t,"l",(function(){return B})),n.d(t,"m",(function(){return z})),n.d(t,"n",(function(){return U})),n.d(t,"o",(function(){return L}));var r=n(63),i=n(1),o=n.n(i),a=(n(2),n(93)),s=n(412),l=n(33),u=n(32),c=n(413),d=n.n(c),f=(n(174),n(57)),p=n(127),h=n.n(p),m=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router-History"),g=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router"),v=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(r.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return o.a.createElement(g.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o.a.createElement(m.Provider,{children:this.props.children||null,value:this.props.history}))},t}(o.a.Component);var y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i0?e.animate({rotation:t,anchor:n,duration:r,easing:i.b}):e.rotate(t,n)}}function d(e,t,n,r,i){t=e.constrainResolution(t,0,i),p(e,t,n,r)}function f(e,t,n,r){var i=e.getResolution(),o=e.constrainResolution(i,t,0);if(void 0!==o){var s=e.getResolutions();o=Object(a.a)(o,e.getMinResolution()||s[s.length-1],e.getMaxResolution()||s[0])}if(n&&void 0!==o&&o!==i){var l=e.getCenter(),u=e.calculateCenterZoom(o,n);u=e.constrainCenter(u),n=[(o*l[0]-i*u[0])/(o-i),(o*l[1]-i*u[1])/(o-i)]}p(e,o,n,r)}function p(e,t,n,r){if(t){var o=e.getResolution(),a=e.getCenter();if(void 0!==o&&a&&t!==o&&r)e.animate({resolution:t,anchor:n,duration:r,easing:i.b});else{if(n){var s=e.calculateCenterZoom(t,n);e.setCenter(s)}e.setResolution(t)}}}t.a=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"I18n",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"translate",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"useTranslate",{enumerable:!0,get:function(){return o.default}});var r=a(n(982)),i=a(n(997)),o=a(n(998));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(689)},function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var r=function(e){this.propagationStopped,this.type=e,this.target=null};function i(e){e.stopPropagation()}r.prototype.preventDefault=function(){this.propagationStopped=!0},r.prototype.stopPropagation=function(){this.propagationStopped=!0},t.a=r},function(e,t,n){"use strict";t.a={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",SOURCE:"source"}},function(e,t,n){"use strict";t.a={IDLE:0,LOADING:1,LOADED:2,ERROR:3}},function(e,t){e.exports=function(){for(var e={},t=0;t=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"e",(function(){return u}));var r,i,o="ol-hidden",a="ol-unselectable",s="ol-control",l="ol-collapsed",u=(i={},function(e){if(r||(r=document.createElement("div").style),!(e in i)){r.font=e;var t=r.fontFamily;if(r.font="",!t)return null;i[e]=t.split(/,\s?/)}return i[e]})},function(e,t,n){"use strict";var r=n(220),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){a[String(t)]=e}))})),a),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){"use strict";var r=n(179);e.exports=function(e,t,n){var i;null!=n||"object"==typeof t&&!Array.isArray(t)||(n=t,t={});i=r({type:String(e)},t),Array.isArray(n)?i.children=n:null!=n&&(i.value=String(n));return i}},function(e,t,n){"use strict";n.r(t),n.d(t,"Provider",(function(){return c})),n.d(t,"connectAdvanced",(function(){return E})),n.d(t,"ReactReduxContext",(function(){return o})),n.d(t,"connect",(function(){return U})),n.d(t,"batch",(function(){return X.unstable_batchedUpdates})),n.d(t,"useDispatch",(function(){return $})),n.d(t,"createDispatchHook",(function(){return V})),n.d(t,"useSelector",(function(){return Q})),n.d(t,"createSelectorHook",(function(){return K})),n.d(t,"useStore",(function(){return W})),n.d(t,"createStoreHook",(function(){return H})),n.d(t,"shallowEqual",(function(){return O}));var r=n(1),i=n.n(r),o=(n(2),i.a.createContext(null));var a=function(e){e()},s={notify:function(){}};function l(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var u=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=s,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=l())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=s)},e}();var c=function(e){var t=e.store,n=e.context,a=e.children,s=Object(r.useMemo)((function(){var e=new u(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),l=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=s.subscription;return e.trySubscribe(),l!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[s,l]);var c=n||o;return i.a.createElement(c.Provider,{value:s},a)},d=n(32),f=n(57),p=n(127),h=n.n(p),m=n(174),g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,v=[],y=[null,null];function b(e,t){var n=e[1];return[t.payload,n+1]}function _(e,t,n){g((function(){return e.apply(void 0,t)}),n)}function w(e,t,n,r,i,o,a){e.current=r,t.current=i,n.current=!1,o.current&&(o.current=null,a())}function x(e,t,n,r,i,o,a,s,l,u){if(e){var c=!1,d=null,f=function(){if(!c){var e,n,f=t.getState();try{e=r(f,i.current)}catch(e){n=e,d=e}n||(d=null),e===o.current?a.current||l():(o.current=e,s.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=f,n.trySubscribe(),f();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var k=function(){return[null,0]};function E(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,s=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,l=n.methodName,c=void 0===l?"connectAdvanced":l,p=n.renderCountProp,g=void 0===p?void 0:p,E=n.shouldHandleStateChanges,S=void 0===E||E,O=n.storeKey,T=void 0===O?"store":O,C=(n.withRef,n.forwardRef),A=void 0!==C&&C,P=n.context,R=void 0===P?o:P,M=Object(f.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),I=R;return function(t){var n=t.displayName||t.name||"Component",o=s(n),a=Object(d.a)({},M,{getDisplayName:s,methodName:c,renderCountProp:g,shouldHandleStateChanges:S,storeKey:T,displayName:o,wrappedComponentName:n,WrappedComponent:t}),l=M.pure;var p=l?r.useMemo:function(e){return e()};function E(n){var o=Object(r.useMemo)((function(){var e=n.reactReduxForwardedRef,t=Object(f.a)(n,["reactReduxForwardedRef"]);return[n.context,e,t]}),[n]),s=o[0],l=o[1],c=o[2],h=Object(r.useMemo)((function(){return s&&s.Consumer&&Object(m.isContextConsumer)(i.a.createElement(s.Consumer,null))?s:I}),[s,I]),g=Object(r.useContext)(h),E=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(g)&&Boolean(g.store);var O=E?n.store:g.store,T=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,a)}(O)}),[O]),C=Object(r.useMemo)((function(){if(!S)return y;var e=new u(O,E?null:g.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[O,E,g]),A=C[0],P=C[1],R=Object(r.useMemo)((function(){return E?g:Object(d.a)({},g,{subscription:A})}),[E,g,A]),M=Object(r.useReducer)(b,v,k),j=M[0][0],D=M[1];if(j&&j.error)throw j.error;var L=Object(r.useRef)(),N=Object(r.useRef)(c),F=Object(r.useRef)(),B=Object(r.useRef)(!1),z=p((function(){return F.current&&c===N.current?F.current:T(O.getState(),c)}),[O,j,c]);_(w,[N,L,B,c,z,F,P]),_(x,[S,O,A,T,N,L,B,F,P,D],[O,A,T]);var U=Object(r.useMemo)((function(){return i.a.createElement(t,Object(d.a)({},z,{ref:l}))}),[l,t,z]);return Object(r.useMemo)((function(){return S?i.a.createElement(h.Provider,{value:R},U):U}),[h,U,R])}var O=l?i.a.memo(E):E;if(O.WrappedComponent=t,O.displayName=o,A){var C=i.a.forwardRef((function(e,t){return i.a.createElement(O,Object(d.a)({},e,{reactReduxForwardedRef:t}))}));return C.displayName=o,C.WrappedComponent=t,h()(C,t)}return h()(O,t)}}function S(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function O(e,t){if(S(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function B(e,t){return e===t}function z(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?E:n,i=t.mapStateToPropsFactories,o=void 0===i?M:i,a=t.mapDispatchToPropsFactories,s=void 0===a?R:a,l=t.mergePropsFactories,u=void 0===l?j:l,c=t.selectorFactory,p=void 0===c?N:c;return function(e,t,n,i){void 0===i&&(i={});var a=i,l=a.pure,c=void 0===l||l,h=a.areStatesEqual,m=void 0===h?B:h,g=a.areOwnPropsEqual,v=void 0===g?O:g,y=a.areStatePropsEqual,b=void 0===y?O:y,_=a.areMergedPropsEqual,w=void 0===_?O:_,x=Object(f.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),k=F(e,o,"mapStateToProps"),E=F(t,s,"mapDispatchToProps"),S=F(n,u,"mergeProps");return r(p,Object(d.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:E,initMergeProps:S,pure:c,areStatesEqual:m,areOwnPropsEqual:v,areStatePropsEqual:b,areMergedPropsEqual:w},x))}}var U=z();function q(){return Object(r.useContext)(o)}function H(e){void 0===e&&(e=o);var t=e===o?q:function(){return Object(r.useContext)(e)};return function(){return t().store}}var W=H();function V(e){void 0===e&&(e=o);var t=e===o?W:H(e);return function(){return t().dispatch}}var $=V(),G=function(e,t){return e===t};function K(e){void 0===e&&(e=o);var t=e===o?q:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=G);var i=t(),o=function(e,t,n,i){var o,a=Object(r.useReducer)((function(e){return e+1}),0)[1],s=Object(r.useMemo)((function(){return new u(n,i)}),[n,i]),l=Object(r.useRef)(),c=Object(r.useRef)(),d=Object(r.useRef)(),f=Object(r.useRef)(),p=n.getState();try{o=e!==c.current||p!==d.current||l.current?e(p):f.current}catch(e){throw l.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+l.current.stack+"\n\n"),e}return g((function(){c.current=e,d.current=p,f.current=o,l.current=void 0})),g((function(){function e(){try{var e=c.current(n.getState());if(t(e,f.current))return;f.current=e}catch(e){l.current=e}a()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}}),[n,s]),o}(e,n,i.store,i.subscription);return Object(r.useDebugValue)(o),o}}var Y,Q=K(),X=n(49);Y=X.unstable_batchedUpdates,a=Y},function(e,t,n){"use strict";n.d(t,"b",(function(){return d}));var r=n(6),i=n(3),o=n(298),a=n(40),s=n(78),l=n(22),u=function(e){function t(){e.call(this),this.layout=a.a.XY,this.stride=2,this.flatCoordinates=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeExtent=function(e){return Object(i.o)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t.prototype.getCoordinates=function(){return Object(r.b)()},t.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t.prototype.getLayout=function(){return this.layout},t.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&(Object(l.b)(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length1){throw new i.n(t,"Each pair must have its own sequence indicator")}var s=a.items[0]||new o.e;a.commentBefore&&(s.commentBefore=s.commentBefore?"".concat(a.commentBefore,"\n").concat(s.commentBefore):a.commentBefore),a.comment&&(s.comment=s.comment?"".concat(a.comment,"\n").concat(s.comment):a.comment),a=s}n.items[r]=a instanceof o.e?a:new o.e(a)}}return n}function l(e,t,n){var r=new o.g(e);r.tag="tag:yaml.org,2002:pairs";var a,s=Object(i.g)(t);try{for(s.s();!(a=s.n()).done;){var l=a.value,u=void 0,c=void 0;if(Array.isArray(l)){if(2!==l.length)throw new TypeError("Expected [key, value] tuple: ".concat(l));u=l[0],c=l[1]}else if(l&&l instanceof Object){var d=Object.keys(l);if(1!==d.length)throw new TypeError("Expected { key: value } tuple: ".concat(l));c=l[u=d[0]]}else u=l;var f=e.createPair(u,c,n);r.items.push(f)}}catch(e){s.e(e)}finally{s.f()}return r}var u={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:s,createNode:l},c=function(e){Object(i.q)(n,e);var t=Object(i.r)(n);function n(){var e;return Object(i.j)(this,n),e=t.call(this),Object(i.l)(Object(i.w)(e),"add",o.k.prototype.add.bind(Object(i.w)(e))),Object(i.l)(Object(i.w)(e),"delete",o.k.prototype.delete.bind(Object(i.w)(e))),Object(i.l)(Object(i.w)(e),"get",o.k.prototype.get.bind(Object(i.w)(e))),Object(i.l)(Object(i.w)(e),"has",o.k.prototype.has.bind(Object(i.w)(e))),Object(i.l)(Object(i.w)(e),"set",o.k.prototype.set.bind(Object(i.w)(e))),e.tag=n.tag,e}return Object(i.i)(n,[{key:"toJSON",value:function(e,t){var n=new Map;t&&t.onCreate&&t.onCreate(n);var r,a=Object(i.g)(this.items);try{for(a.s();!(r=a.n()).done;){var s=r.value,l=void 0,u=void 0;if(s instanceof o.e?(l=Object(o.w)(s.key,"",t),u=Object(o.w)(s.value,l,t)):l=Object(o.w)(s,"",t),n.has(l))throw new Error("Ordered maps must not include duplicate keys");n.set(l,u)}}catch(e){a.e(e)}finally{a.f()}return n}}]),n}(o.g);Object(i.l)(c,"tag","tag:yaml.org,2002:omap");var d={identify:function(e){return e instanceof Map},nodeClass:c,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(e,t){var n,r=s(e,t),a=[],l=Object(i.g)(r.items);try{for(l.s();!(n=l.n()).done;){var u=n.value.key;if(u instanceof o.f){if(a.includes(u.value)){throw new i.n(t,"Ordered maps must not include duplicate keys")}a.push(u.value)}}}catch(e){l.e(e)}finally{l.f()}return Object.assign(new c,r)},createNode:function(e,t,n){var r=l(e,t,n),i=new c;return i.items=r.items,i}},f=function(e){Object(i.q)(n,e);var t=Object(i.r)(n);function n(){var e;return Object(i.j)(this,n),(e=t.call(this)).tag=n.tag,e}return Object(i.i)(n,[{key:"add",value:function(e){var t=e instanceof o.e?e:new o.e(e);Object(o.s)(this.items,t.key)||this.items.push(t)}},{key:"get",value:function(e,t){var n=Object(o.s)(this.items,e);return!t&&n instanceof o.e?n.key instanceof o.f?n.key.value:n.key:n}},{key:"set",value:function(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(Object(i.h)(t)));var n=Object(o.s)(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new o.e(e))}},{key:"toJSON",value:function(e,t){return Object(i.s)(Object(i.t)(n.prototype),"toJSON",this).call(this,e,t,Set)}},{key:"toString",value:function(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return Object(i.s)(Object(i.t)(n.prototype),"toString",this).call(this,e,t,r);throw new Error("Set items must all have null values")}}]),n}(o.k);Object(i.l)(f,"tag","tag:yaml.org,2002:set");var p={identify:function(e){return e instanceof Set},nodeClass:f,default:!1,tag:"tag:yaml.org,2002:set",resolve:function(e,t){var n=Object(o.n)(e,t);if(!n.hasAllNullValues())throw new i.n(t,"Set items must all have null values");return Object.assign(new f,n)},createNode:function(e,t,n){var r,o=new f,a=Object(i.g)(t);try{for(a.s();!(r=a.n()).done;){var s=r.value;o.items.push(e.createPair(s,null,n))}}catch(e){a.e(e)}finally{a.f()}return o}},h=function(e,t){var n=t.split(":").reduce((function(e,t){return 60*e+Number(t)}),0);return"-"===e?-n:n},m=function(e){var t=e.value;if(isNaN(t)||!isFinite(t))return Object(o.r)(t);var n="";t<0&&(n="-",t=Math.abs(t));var r=[t%60];return t<60?r.unshift(0):(t=Math.round((t-r[0])/60),r.unshift(t%60),t>=60&&(t=Math.round((t-r[0])/60),r.unshift(t))),n+r.map((function(e){return e<10?"0"+String(e):String(e)})).join(":").replace(/000000\d*$/,"")},g={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:function(e,t,n){return h(t,n.replace(/_/g,""))},stringify:m},v={identify:function(e){return"number"==typeof e},default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:function(e,t,n){return h(t,n.replace(/_/g,""))},stringify:m},y={identify:function(e){return e instanceof Date},default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:function(e,t,n,r,i,o,a,s,l){s&&(s=(s+"00").substr(1,3));var u=Date.UTC(t,n-1,r,i||0,o||0,a||0,s||0);if(l&&"Z"!==l){var c=h(l[0],l.slice(1));Math.abs(c)<30&&(c*=60),u-=6e4*c}return new Date(u)},stringify:function(e){return e.value.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")}};function b(e){var t=void 0!==r&&r.env||{};return e?"undefined"!=typeof YAML_SILENCE_DEPRECATION_WARNINGS?!YAML_SILENCE_DEPRECATION_WARNINGS:!t.YAML_SILENCE_DEPRECATION_WARNINGS:"undefined"!=typeof YAML_SILENCE_WARNINGS?!YAML_SILENCE_WARNINGS:!t.YAML_SILENCE_WARNINGS}function _(e,t){if(b(!1)){var n=void 0!==r&&r.emitWarning;n?n(e,t):console.warn(t?"".concat(t,": ").concat(e):e)}}var w={};function x(e,t){if(!w[e]&&b(!0)){w[e]=!0;var n="The option '".concat(e,"' will be removed in a future release");_(n+=t?", use '".concat(t,"' instead."):".","DeprecationWarning")}}}).call(this,n(157).Buffer,n(70))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.selectHasMetaPath=t.selectFieldsComments=t.selectViewFilters=t.selectSortDataPath=t.selectSortableFields=t.selectDefaultSortableFields=t.COMMIT_DATE=t.COMMIT_AUTHOR=t.selectEntryCollectionTitle=t.selectInferedField=t.selectIdentifier=t.updateFieldByKey=t.traverseFields=t.selectField=t.getFieldsNames=t.selectTemplateName=t.selectAllowDeletion=t.selectAllowNewEntries=t.selectEntrySlug=t.selectEntryPath=t.selectFileEntryLabel=t.selectFolderEntryExtension=t.selectFields=t.selectMediaFolders=t.selectFieldsWithMediaFolders=void 0;var r=h(n(485)),i=h(n(82)),o=n(4),a=h(n(895)),s=n(160),l=n(486),u=n(487),c=n(328),d=n(104),f=n(166),p=n(271);function h(e){return e&&e.__esModule?e:{default:e}}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t(e.get("extension")||(0,i.default)(c.formatExtensions,e.get("format")||"frontmatter")).replace(/^\./,""),fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){var n;const i=e.get("folder").replace(/\/$/,"");return null===(n=t.split(i+"/").pop())||void 0===n?void 0:n.replace(new RegExp(`\\.${(0,r.default)(this.entryExtension(e))}$`),"")},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[l.FILES]:{fileForEntry(e,t){const n=e.get("files");return n&&n.filter(e=>(null==e?void 0:e.get("name"))===t).get(0)},fields(e,t){const n=this.fileForEntry(e,t);return n&&n.get("fields")},entryPath(e,t){const n=this.fileForEntry(e,t);return n&&n.get("file")},entrySlug(e,t){const n=e.get("files").filter(e=>(null==e?void 0:e.get("file"))===t).get(0);return n&&n.get("name")},entryLabel(e,t){const n=this.fileForEntry(e,t);return n&&n.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}},_=e=>e.reduce((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){var n;const r=null===(n=t.get("fields"))||void 0===n?void 0:n.toArray();e=[...e,..._(r)]}else if(t.has("field")){const n=t.get("field");e=[...e,..._([n])]}else if(t.has("types")){var r;const n=null===(r=t.get("types"))||void 0===r?void 0:r.toArray();e=[...e,..._(n)]}return e},[]),w=(e,t)=>{var n;return null===(n=e.get("files"))||void 0===n?void 0:n.toArray().filter(e=>e.get("name")===t)[0]},x=(e,t)=>{if(e.has("folder")){const t=e.get("fields").toArray();return _(t)}if(e.has("files")){var n;const r=(null===(n=w(e,t))||void 0===n?void 0:n.get("fields").toArray())||[];return _(r)}return[]};t.selectFieldsWithMediaFolders=x;t.selectMediaFolders=(e,t,n)=>{const r=x(t,n.get("slug")).map(r=>(0,d.selectMediaFolder)(e.config,t,n,r));if(t.has("files")){w(t,n.get("slug"))&&r.unshift((0,d.selectMediaFolder)(e.config,t,n,void 0))}return t.has("media_folder")&&(t=t.delete("files"),r.unshift((0,d.selectMediaFolder)(e.config,t,n,void 0))),(0,o.Set)(r).toArray()};t.selectFields=(e,t)=>b[e.get("type")].fields(e,t);t.selectFolderEntryExtension=e=>b[l.FOLDER].entryExtension(e);const k=(e,t)=>b[l.FILES].entryLabel(e,t);t.selectFileEntryLabel=k;t.selectEntryPath=(e,t)=>b[e.get("type")].entryPath(e,t);t.selectEntrySlug=(e,t)=>b[e.get("type")].entrySlug(e,t);t.selectAllowNewEntries=e=>b[e.get("type")].allowNewEntries(e);t.selectAllowDeletion=e=>b[e.get("type")].allowDeletion(e);t.selectTemplateName=(e,t)=>b[e.get("type")].templateName(e,t);const E=(e,t="")=>{let n=e.map(e=>`${t}${e.get("name")}`);return e.forEach((e,t)=>{if(e.has("fields")){var r;const i=null===(r=e.get("fields"))||void 0===r?void 0:r.toArray();n=[...n,...E(i,n[t]+".")]}else if(e.has("field")){const r=e.get("field");n=[...n,...E([r],n[t]+".")]}else if(e.has("types")){var i;const r=null===(i=e.get("types"))||void 0===i?void 0:i.toArray();n=[...n,...E(r,n[t]+".")]}}),n};t.getFieldsNames=E;const S=(e,t)=>{const n=y(t);let r,i,a=e.get("fields",(0,o.List)()).toArray();for(;(r=n.shift())&&a;){var s,l,u,c,d;if(i=a.find(e=>e.get("name")===r),null===(s=i)||void 0===s?void 0:s.has("fields"))a=null===(c=i)||void 0===c||null===(d=c.get("fields"))||void 0===d?void 0:d.toArray();else if(null===(l=i)||void 0===l?void 0:l.has("field")){var f;a=[null===(f=i)||void 0===f?void 0:f.get("field")]}else if(null===(u=i)||void 0===u?void 0:u.has("types")){var p,h;a=null===(p=i)||void 0===p||null===(h=p.get("types"))||void 0===h?void 0:h.toArray()}}return i};t.selectField=S;const O=(e,t,n=(()=>!1))=>n()?e:e=e.map(e=>{const r=t(e);return n()?r:r.has("fields")?r.set("fields",O(r.get("fields"),t,n)):r.has("field")?r.set("field",O((0,o.List)([r.get("field")]),t,n).get(0)):r.has("types")?r.set("types",O(r.get("types"),t,n)):r}).toList();t.traverseFields=O;t.updateFieldByKey=(e,t,n)=>{const r=S(e,t);if(!r)return e;let i=!1;return e=e.set("fields",O(e.get("fields",(0,o.List)()),e=>{const t=e;return t===r?(i=!0,n(t)):t},()=>i))};const T=e=>{const t=e.get("identifier_field"),n=t?[t,...u.IDENTIFIER_FIELDS]:u.IDENTIFIER_FIELDS,r=E(e.get("fields",(0,o.List)()).toArray());return n.find(e=>r.find(t=>(null==t?void 0:t.toLowerCase().trim())===e.toLowerCase().trim()))};t.selectIdentifier=T;const C=(e,t)=>{if("title"===t&&e.get("identifier_field"))return T(e);const n=u.INFERABLE_FIELDS[t],r=e.get("fields");let i;if(!r||!n)return null;const o=r.filter(e=>(null==e?void 0:e.get("widget","string"))===n.type).map(e=>null==e?void 0:e.get("name"));if(i=o.filter(e=>-1!==n.synonyms.indexOf(e)),i&&i.size>0)return i.first();return i=r.filter(e=>-1!==n.secondaryTypes.indexOf(null==e?void 0:e.get("widget","string"))).map(e=>null==e?void 0:e.get("name")).filter(e=>-1!==n.synonyms.indexOf(e)),i&&i.size>0?i.first():n.fallbackToFirstField&&o.size>0?o.first():(n.showError&&(0,a.default)(`The Field ${t} is missing for the collection “${e.get("name")}”`,`Netlify CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`),null)};t.selectInferedField=C;t.selectEntryCollectionTitle=(e,t)=>{const n=e.get("summary");if(n)return(0,p.summaryFormatter)(n,t,e);if(e.get("type")==l.FILES){const n=k(e,t.get("slug"));if(n)return n}const r=t.get("data"),i=C(e,"title");return i&&r.getIn(y(i))};t.COMMIT_AUTHOR="commit_author";t.COMMIT_DATE="commit_date";t.selectDefaultSortableFields=(e,t)=>{let n=u.SORTABLE_FIELDS.map(n=>{const r=C(e,n);return t.isGitBackend()&&"author"===n&&!r?"commit_author":r}).filter(Boolean);return t.isGitBackend()&&(n=["commit_date",...n]),n};t.selectSortableFields=(e,t)=>e.get("sortableFields").toArray().map(n=>{if("commit_date"===n)return{key:n,field:{name:n,label:t("collection.defaultFields.updatedOn.label")}};const r=S(e,n);return"commit_author"!==n||r?{key:n,field:null==r?void 0:r.toJS()}:{key:n,field:{name:n,label:t("collection.defaultFields.author.label")}}}).filter(e=>!!e.field).map(e=>g(g({},e.field),{},{key:e.key}));t.selectSortDataPath=(e,t)=>"commit_date"===t?"updatedOn":"commit_author"!==t||S(e,t)?"data."+t:"author";t.selectViewFilters=e=>e.get("view_filters").toJS();t.selectFieldsComments=(e,t)=>{let n=[];if(e.has("folder"))n=e.get("fields").toArray();else if(e.has("files")){n=e.get("files").find(e=>(null==e?void 0:e.get("name"))===t.get("slug")).get("fields").toArray()}const r={};return E(n).forEach(t=>{const n=S(e,t);(null==n?void 0:n.has("comment"))&&(r[t]=n.get("comment"))}),r};t.selectHasMetaPath=e=>{var t;return e.has("folder")&&e.get("type")===l.FOLDER&&e.has("meta")&&(null===(t=e.get("meta"))||void 0===t?void 0:t.has("path"))};var A=(e=null,t)=>{switch(t.type){case s.CONFIG_SUCCESS:return(t.payload?t.payload.get("collections"):(0,o.List)()).toOrderedMap().map(e=>{const t=e;return t.has("folder")?t.set("type",l.FOLDER):t.has("files")?t.set("type",l.FILES):void 0}).mapKeys((e,t)=>t.get("name"));default:return e}};t.default=A},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(28),i=n(47),o=n(22),a=function(e){function t(t){var n=t||{};e.call(this,n),n.handleDownEvent&&(this.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(this.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(this.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(this.handleUpEvent=n.handleUpEvent),n.stopDown&&(this.stopDown=n.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.handleDownEvent=function(e){return!1},t.prototype.handleDragEvent=function(e){},t.prototype.handleEvent=function(e){if(!e.pointerEvent)return!0;var t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==r.a.POINTERDRAG)this.handleDragEvent(e);else if(e.type==r.a.POINTERUP){var n=this.handleUpEvent(e);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(e.type==r.a.POINTERDOWN){var i=this.handleDownEvent(e);i&&e.preventDefault(),this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==r.a.POINTERMOVE&&this.handleMoveEvent(e);return!t},t.prototype.handleMoveEvent=function(e){},t.prototype.handleUpEvent=function(e){return!1},t.prototype.stopDown=function(e){return e},t.prototype.updateTrackedPointers_=function(e){if(function(e){var t=e.type;return t===r.a.POINTERDOWN||t===r.a.POINTERDRAG||t===r.a.POINTERUP}(e)){var t=e.pointerEvent,n=t.pointerId.toString();e.type==r.a.POINTERUP?delete this.trackedPointers_[n]:(e.type==r.a.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=t),this.targetPointers=Object(o.c)(this.trackedPointers_)}},t}(i.a);function s(e){for(var t=e.length,n=0,r=0,i=0;i1)for(var n=1;n0;)this.pop()},t.prototype.extend=function(e){for(var t=0,n=e.length;t1)l=n;else{if(p>0){for(var h=0;ho&&(o=c),a=l,s=u}return o}function a(e,t,n,r,i){for(var a=0,s=n.length;a=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function o(e,t){var n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,o=e[1]*n+e[0]*r;return e[0]=i,e[1]=o,e}function a(e,t){return e[0]*=t,e[1]*=t,e}function s(e,t){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(e,t,n){"use strict";n.d(t,"c",(function(){return w})),n.d(t,"b",(function(){return x})),n.d(t,"d",(function(){return k}));var r=n(26),i=n(3),o=n(40),a=n(10),s=n(62),l=n(202),u=n(77),c=n(72),d=n(73),f=n(96),p=function(e){function t(t,n){e.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===n||Array.isArray(t[0])?this.setCoordinates(t,n):this.setFlatCoordinates(n,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,n,r){return r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(1234)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(70))},function(e,t,n){var r=n(210);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){"use strict"; +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */var r,i="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,i="";else if(i.length>=n)return i.substr(0,n);for(;n>i.length&&t>1;)1&t&&(i+=e),t>>=1,e+=e;return i=(i+=e).substr(0,n)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,o,a=t.children||[],s=a.length,l=[],u=-1;for(;++u=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var o=t.isAbsolute(e),a="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!o).join("/"))||o||(e="."),e&&a&&(e+="/"),(o?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l=1;--o)if(47===(t=e.charCodeAt(o))){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=a+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(70))},function(e,t,n){"use strict";e.exports=function(e){return i.test("number"==typeof e?r(e):e.charAt(0))};var r=String.fromCharCode,i=/\s/},function(e,t,n){"use strict";function r(e){return e[0]>0&&e[1]>0}function i(e,t,n){return void 0===n&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function o(e,t){return Array.isArray(e)?e:(void 0===t?t=[e,e]:t[0]=t[1]=e,t)}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,r=void 0,u=Array.isArray(e),c=[e],d=-1,f=[],p=void 0,h=void 0,m=void 0,g=[],v=[],y=e;do{var b=++d===c.length,_=b&&0!==f.length;if(b){if(h=0===v.length?void 0:g[g.length-1],p=m,m=v.pop(),_){if(u)p=p.slice();else{for(var w={},x=0,k=Object.keys(p);x=0;f--){var p=a[f];"."===p?o(a,f):".."===p?(o(a,f),d++):d&&(o(a,f),d--)}if(!u)for(;d--;d)a.unshift("..");!u||""===a[0]||a[0]&&i(a[0])||a.unshift("");var h=a.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var l=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},u=n(33);function c(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function m(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function g(e,t,n,i){var o;"string"==typeof e?(o=h(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function v(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function y(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),d({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=g(e,t,f(),_.location);c.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(_.entries[_.index]=r,d({action:"REPLACE",location:r}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=_.index+e;return t>=0&&t<_.entries.length},block:function(e){return void 0===e&&(e=!1),c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return _}},function(e,t,n){"use strict";var r=n(201),i=n(9),o=n(31),a=n(50),s=function(e){function t(){e.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.addEventListener=function(e,t){var n=this.listeners_[e];n||(n=this.listeners_[e]=[]),-1===n.indexOf(t)&&n.push(t)},t.prototype.dispatchEvent=function(e){var t="string"==typeof e?new a.a(e):e,n=t.type;t.target=this;var r,i=this.listeners_[n];if(i){n in this.dispatching_||(this.dispatching_[n]=0,this.pendingRemovals_[n]=0),++this.dispatching_[n];for(var s=0,l=i.length;s0},t.prototype.removeEventListener=function(e,t){var n=this.listeners_[e];if(n){var r=n.indexOf(t);e in this.pendingRemovals_?(n[r]=o.c,++this.pendingRemovals_[e]):(n.splice(r,1),0===n.length&&delete this.listeners_[e])}},t}(r.a);t.a=s},function(e,t,n){"use strict";t.a={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(15);function i(e,t,n,i,o,a,s){var l=(n-t)/i;if(l<3){for(;t0;){for(var f=c.pop(),p=c.pop(),h=0,m=e[p],g=e[p+1],v=e[f],y=e[f+1],b=p+i;bh&&(d=b,h=x)}h>o&&(u[(d-t)/i]=1,p+i0&&g>h)&&(m<0&&v0&&v>m)?(l=f,u=p):(o[s++]=l,o[s++]=u,c=l,d=u,l=f,u=p)}}return o[s++]=l,o[s++]=u,s}function l(e,t,n,r,i,o,a,l){for(var u=0,c=n.length;uo&&(u-s)*(o-l)-(i-s)*(c-l)>0&&a++:c<=o&&(u-s)*(o-l)-(i-s)*(c-l)<0&&a--,s=u,l=c}return 0!==a}function a(e,t,n,r,i,a){if(0===n.length)return!1;if(!o(e,t,n[0],r,i,a))return!1;for(var s=1,l=n.length;sa.selectEntry(e.entries,t,n);t.selectEntries=(e,t)=>a.selectEntries(e.entries,t);t.selectPublishedSlugs=(e,t)=>a.selectPublishedSlugs(e.entries,t);t.selectSearchedEntries=(e,t)=>{const n=e.search.get("entryIds");return n&&n.filter(({collection:e})=>-1!==t.indexOf(e)).map(({collection:t,slug:n})=>a.selectEntry(e.entries,t,n))};t.selectDeployPreview=(e,t,n)=>h.selectDeployPreview(e.deploys,t,n);t.selectUnpublishedEntry=(e,t,n)=>l.selectUnpublishedEntry(e.editorialWorkflow,t,n);t.selectUnpublishedEntriesByStatus=(e,t)=>l.selectUnpublishedEntriesByStatus(e.editorialWorkflow,t);t.selectUnpublishedSlugs=(e,t)=>l.selectUnpublishedSlugs(e.editorialWorkflow,t);t.selectIntegration=(e,t,n)=>o.selectIntegration(e.integrations,t,n)},function(e,t,n){var r=n(181),i=n(714),o=n(715),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(740),i=n(761),o=n(215),a=n(44),s=n(763);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.statusDescriptions=t.status=t.Statues=t.EDITORIAL_WORKFLOW=t.SIMPLE=void 0;var r=n(4);t.SIMPLE="simple";t.EDITORIAL_WORKFLOW="editorial_workflow";const i={DRAFT:"draft",PENDING_REVIEW:"pending_review",PENDING_PUBLISH:"pending_publish"};t.Statues=i;const o=(0,r.OrderedMap)(i);t.status=o;const a=(0,r.Map)({[o.get("DRAFT")]:"Draft",[o.get("PENDING_REVIEW")]:"Waiting for Review",[o.get("PENDING_PUBLISH")]:"Waiting to go live"});t.statusDescriptions=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.selectEditingDraft=t.selectMediaFilePublicPath=t.selectMediaFilePath=t.selectMediaFolder=t.selectIsFetching=t.selectEntriesLoaded=t.selectEntryByPath=t.selectEntries=t.selectPublishedSlugs=t.selectEntry=t.selectViewStyle=t.selectEntriesFilterFields=t.selectEntriesSortFields=t.selectEntriesFilter=t.selectEntriesSort=void 0;var r=y(n(488)),i=y(n(426)),o=y(n(211)),a=y(n(262)),s=y(n(138)),l=n(4),u=n(89),c=n(123),d=n(272),f=n(360),p=n(271),h=n(37),m=n(67),g=n(166),v=n(362);function y(e){return e&&e.__esModule?e:{default:e}}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t{const e=localStorage.getItem("netlify-cms.entries.sort");if(e)try{const t=JSON.parse(e);let n=(0,l.Map)();return Object.entries(t).forEach(([e,t])=>{let r=(0,l.OrderedMap)();(0,o.default)(Object.values(t),["index"]).forEach(e=>{const{key:t,direction:n}=e;r=r.set(t,(0,l.fromJS)({key:t,direction:n}))}),n=n.set(e,r)}),n}catch(e){return(0,l.Map)()}return(0,l.Map)()}),P=e=>{if(e){const t={};e.keySeq().forEach(n=>{const r=n;e.get(r).valueSeq().toJS().map((e,t)=>_(_({},e),{},{index:t})).forEach(e=>{(0,i.default)(t,[r,e.key],e)})}),localStorage.setItem("netlify-cms.entries.sort",JSON.stringify(t))}else localStorage.removeItem("netlify-cms.entries.sort")},R=(0,a.default)(()=>{const e=localStorage.getItem(C);return e||(localStorage.setItem(C,v.VIEW_STYLE_LIST),v.VIEW_STYLE_LIST)}),M=e=>{e?localStorage.setItem(C,e):localStorage.removeItem(C)},I=(e,t)=>{const n=e.get("sort");return null==n?void 0:n.get(t)};t.selectEntriesSort=I;const j=(e,t)=>{const n=e.get("filter");return(null==n?void 0:n.get(t))||(0,l.Map)()};t.selectEntriesFilter=j;const D=(e,t)=>{const n=I(e,t);return(null==n?void 0:n.valueSeq().filter(e=>(null==e?void 0:e.get("direction"))!==f.SortDirection.None).toArray())||[]};t.selectEntriesSortFields=D;const L=(e,t)=>{const n=j(e,t);return(null==n?void 0:n.valueSeq().filter(e=>!0===(null==e?void 0:e.get("active"))).toArray())||[]};t.selectEntriesFilterFields=L;t.selectViewStyle=e=>e.get("viewStyle");const N=(e,t,n)=>e.getIn(["entities",`${t}.${n}`]);t.selectEntry=N;const F=(e,t)=>e.getIn(["pages",t,"ids"],(0,l.List)());t.selectPublishedSlugs=F;t.selectEntries=(e,t)=>{const n=t.get("name"),i=F(e,n);let o=i&&i.map(t=>N(e,n,t));const a=D(e,n);if(a&&a.length>0){const e=a.map(e=>(0,m.selectSortDataPath)(t,e.get("key"))),n=a.map(e=>e.get("direction")===f.SortDirection.Ascending?"asc":"desc");o=(0,l.fromJS)((0,r.default)(o.toJS(),e,n))}const s=L(e,n);return s&&s.length>0&&(o=o.filter(e=>s.every(t=>{const n=t.get("pattern"),r=t.get("field"),i=(e.get("data")||(0,l.Map)()).getIn(x(r));return void 0!==i&&new RegExp(String(n)).test(String(i))})).toList()),o};t.selectEntryByPath=(e,t,n)=>{const r=F(e,t),i=r&&r.map(n=>N(e,t,n));return i&&i.find(e=>(null==e?void 0:e.get("path"))===n)};t.selectEntriesLoaded=(e,t)=>!!e.getIn(["pages",t]);t.selectIsFetching=(e,t)=>e.getIn(["pages",t,"isFetching"],!1);const B=(e,t)=>e.find(e=>(null==e?void 0:e.get("name"))===t),z=(e,t,n,r)=>{if(!t)return!1;if(r&&r.has(e))return!0;if(t.has("files")){const r=B(t.get("files"),n);if(r&&r.has(e))return!0}return!!t.has(e)},U=(e,t,n,r,i,o,a)=>{const s=o.filter(e=>e===i)[0];if(s)return(0,p.folderFormatter)(s.has(e)?s.get(e):`{{${e}}}`,r,n,a,e,t.get("slug"));for(let s of o){s.has(e)||(s=s.set(e,`{{${e}}}`));const o=(0,p.folderFormatter)(s.get(e),r,n,a,e,t.get("slug"));let l=null;if(s.has("fields")?l=U(e,t,n,r,i,s.get("fields").toArray(),o):s.has("field")?l=U(e,t,n,r,i,[s.get("field")],o):s.has("types")&&(l=U(e,t,n,r,i,s.get("types").toArray(),o)),null!=l)return l}return null},q=(e,t,n,r,i)=>{let o=t.get(e);if(n.has(e)||(n=n.set(e,`{{${e}}}`)),n.has("files")){o=(0,p.folderFormatter)(n.get(e),r,n,o,e,t.get("slug"));let a=B(n.get("files"),null==r?void 0:r.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),o=(0,p.folderFormatter)(a.get(e),r,n,o,e,t.get("slug")),i)){const s=U(e,t,n,r,i,a.get("fields").toArray(),o);null!==s&&(o=s)}}else if(o=(0,p.folderFormatter)(n.get(e),r,n,o,e,t.get("slug")),i){const a=U(e,t,n,r,i,n.get("fields").toArray(),o);null!==a&&(o=a)}return o},H=(e,t,n,r)=>{const i="media_folder";let o=e.get(i);if(z(i,t,null==n?void 0:n.get("slug"),r)){const a=q(i,e,t,n,r);if(a.startsWith("/"))o=(0,u.join)(a);else{const e=null==n?void 0:n.get("path");o=e?(0,u.join)((0,u.dirname)(e),a):(0,u.join)(t.get("folder"),"DRAFT_MEDIA_FILES")}}return(0,s.default)(o,"/")};t.selectMediaFolder=H;t.selectMediaFilePath=(e,t,n,r,i)=>{if((0,h.isAbsolutePath)(r))return r;const o=H(e,t,n,i);return(0,u.join)(o,(0,h.basename)(r))};t.selectMediaFilePublicPath=(e,t,n,r,i)=>{if((0,h.isAbsolutePath)(n))return n;const o="public_folder";let a=e.get(o);return z(o,t,null==r?void 0:r.get("slug"),i)&&(a=q(o,e,t,r,i)),(0,u.join)(a,(0,h.basename)(n))};t.selectEditingDraft=e=>{const t=e.get("entry");return t&&!t.isEmpty()};var W=(e=(0,l.Map)({entities:(0,l.Map)(),pages:(0,l.Map)(),sort:A(),viewStyle:R()}),t)=>{switch(t.type){case c.ENTRY_REQUEST:{const n=t.payload;return e.setIn(["entities",`${n.collection}.${n.slug}`,"isFetching"],!0)}case c.ENTRY_SUCCESS:{const n=t.payload;return k=n.collection,T=n.entry.slug,e.withMutations(e=>{e.setIn(["entities",`${k}.${T}`],(0,l.fromJS)(n.entry));const t=e.getIn(["pages",k,"ids"],(0,l.List)());t.includes(T)||e.setIn(["pages",k,"ids"],t.unshift(T))})}case c.ENTRIES_REQUEST:{const n=t.payload;return e.withMutations(e=>{e.setIn(["pages",n.collection,"isFetching"],!0)})}case c.ENTRIES_SUCCESS:{const n=t.payload;return k=n.collection,E=n.entries,S=n.append,O=n.page,e.withMutations(e=>{E.forEach(t=>e.setIn(["entities",`${k}.${t.slug}`],(0,l.fromJS)(t).set("isFetching",!1)));const t=(0,l.List)(E.map(e=>e.slug));e.setIn(["pages",k],(0,l.Map)({page:O,ids:S?e.getIn(["pages",k,"ids"],(0,l.List)()).concat(t):t}))})}case c.ENTRIES_FAILURE:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case c.ENTRY_FAILURE:{const n=t.payload;return e.withMutations(e=>{e.setIn(["entities",`${n.collection}.${n.slug}`,"isFetching"],!1),e.setIn(["entities",`${n.collection}.${n.slug}`,"error"],n.error.message)})}case d.SEARCH_ENTRIES_SUCCESS:{const n=t.payload;return E=n.entries,e.withMutations(e=>{E.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,l.fromJS)(t).set("isFetching",!1)))})}case c.ENTRY_DELETE_SUCCESS:{const n=t.payload;return e.withMutations(e=>{e.deleteIn(["entities",`${n.collectionName}.${n.entrySlug}`]),e.updateIn(["pages",n.collectionName,"ids"],e=>e.filter(e=>e!==n.entrySlug))})}case c.SORT_ENTRIES_REQUEST:{const n=t.payload,{collection:r,key:i,direction:o}=n,a=e.withMutations(e=>{const t=(0,l.OrderedMap)({[i]:(0,l.Map)({key:i,direction:o})});e.setIn(["sort",r],t),e.setIn(["pages",r,"isFetching"],!0),e.deleteIn(["pages",r,"page"])});return P(a.get("sort")),a}case c.FILTER_ENTRIES_SUCCESS:case c.SORT_ENTRIES_SUCCESS:{const n=t.payload,{collection:r,entries:i}=n;E=i;return e.withMutations(e=>{E.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,l.fromJS)(t).set("isFetching",!1))),e.setIn(["pages",r,"isFetching"],!1);const t=(0,l.List)(E.map(e=>e.slug));e.setIn(["pages",r],(0,l.Map)({page:1,ids:t}))})}case c.SORT_ENTRIES_FAILURE:{const n=t.payload,{collection:r,key:i}=n,o=e.withMutations(e=>{e.deleteIn(["sort",r,i]),e.setIn(["pages",r,"isFetching"],!1)});return P(o.get("sort")),o}case c.FILTER_ENTRIES_REQUEST:{const n=t.payload,{collection:r,filter:i}=n;return e.withMutations(e=>{const t=e.getIn(["filter",r,i.id],(0,l.fromJS)(i));e.setIn(["filter",r,t.get("id")],t.set("active",!t.get("active")))})}case c.FILTER_ENTRIES_FAILURE:{const n=t.payload,{collection:r,filter:i}=n;return e.withMutations(e=>{e.deleteIn(["filter",r,i.id]),e.setIn(["pages",r,"isFetching"],!1)})}case c.CHANGE_VIEW_STYLE:{const n=t.payload,{style:r}=n,i=e.withMutations(e=>{e.setIn(["viewStyle"],r)});return M(i.get("viewStyle")),i}default:return e}};t.default=W},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),i={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},o={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:r?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},a={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=1;s<20;s++)a["f"+s]=111+s;function l(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return u(e,t)})),i=function(e){return r.some((function(t){return c(t,e)}))};return null==n?i:i(n)}function u(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),a=o.length;for(var s in i)r[i[s]]=!1;var l=!0,u=!1,c=void 0;try{for(var p,h=o[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var m=p.value,g=m.endsWith("?")&&m.length>1;g&&(m=m.slice(0,-1));var v=f(m),y=i[v];1!==a&&y||(n?r.key=v:r.which=d(m)),y&&(r[y]=!g||null)}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}return r}function c(e,t){for(var n in e){var r=e[n],i=void 0;if(null!=r&&((null!=(i="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&i!==r))return!1}return!0}function d(e){return e=f(e),a[e]||e.toUpperCase().charCodeAt(0)}function f(e){return e=e.toLowerCase(),e=o[e]||e}t.default=l,t.isHotkey=l,t.isCodeHotkey=function(e,t){return l(e,t)},t.isKeyHotkey=function(e,t){return l(e,{byKey:!0},t)},t.parseHotkey=u,t.compareHotkey=c,t.toKeyCode=d,t.toKeyName=f},function(e,t,n){"use strict";e.exports=function(e,t){var n;if(null!=t&&"string"!=typeof t&&("object"!=typeof t||0===t.length))throw new Error("Expected `string` or `Array.` for `tagNames`, not `"+t+"`");if(!e||"object"!=typeof e||"element"!==e.type||"string"!=typeof e.tagName)return!1;if(null==t)return!0;if(n=e.tagName,"string"==typeof t)return n===t;return-1!==t.indexOf(n)}},function(e,t,n){"use strict";n.r(t),n.d(t,"TemplateTag",(function(){return l})),n.d(t,"trimResultTransformer",(function(){return u})),n.d(t,"stripIndentTransformer",(function(){return d})),n.d(t,"replaceResultTransformer",(function(){return f})),n.d(t,"replaceSubstitutionTransformer",(function(){return p})),n.d(t,"replaceStringTransformer",(function(){return h})),n.d(t,"inlineArrayTransformer",(function(){return g})),n.d(t,"splitStringTransformer",(function(){return v})),n.d(t,"removeNonPrintingValuesTransformer",(function(){return b})),n.d(t,"commaLists",(function(){return _})),n.d(t,"commaListsAnd",(function(){return w})),n.d(t,"commaListsOr",(function(){return x})),n.d(t,"html",(function(){return k})),n.d(t,"codeBlock",(function(){return k})),n.d(t,"source",(function(){return k})),n.d(t,"safeHtml",(function(){return E})),n.d(t,"oneLine",(function(){return S})),n.d(t,"oneLineTrim",(function(){return O})),n.d(t,"oneLineCommaLists",(function(){return T})),n.d(t,"oneLineCommaListsOr",(function(){return C})),n.d(t,"oneLineCommaListsAnd",(function(){return A})),n.d(t,"inlineLists",(function(){return P})),n.d(t,"oneLineInlineLists",(function(){return R})),n.d(t,"stripIndent",(function(){return M})),n.d(t,"stripIndents",(function(){return I}));var r,i,o=function(){function e(e,t){for(var n=0;n1?n-1:0),i=1;i0&&Array.isArray(r[0])&&(r=r[0]),this.transformers=r.map((function(e){return"function"==typeof e?e():e})),this.tag}return o(e,[{key:"interimTag",value:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var n=t.match(/^[^\S\n]*(?=\S)/gm),r=n&&Math.min.apply(Math,c(n.map((function(e){return e.length}))));if(r){var i=new RegExp("^.{"+r+"}","gm");return t.replace(i,"")}return t}if("all"===e)return t.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+e)}}},f=function(e,t){return{onEndResult:function(n){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return n.replace(e,t)}}},p=function(e,t){return{onSubstitution:function(n,r){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==n?n:n.toString().replace(e,t)}}},h=function(e,t){return{onString:function(n){if(null==e||null==t)throw new Error("replaceStringTransformer requires at least 2 arguments.");return n.replace(e,t)}}},m={separator:"",conjunction:"",serial:!1},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;return{onSubstitution:function(t,n){if(Array.isArray(t)){var r=t.length,i=e.separator,o=e.conjunction,a=e.serial,s=n.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),o&&r>1){var l=t.lastIndexOf(i);t=t.slice(0,l)+(a?i:"")+" "+o+t.slice(l+1)}}return t}}},v=function(e){return{onSubstitution:function(t,n){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}},y=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e},b=function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(y):y(e)?e:""}}},_=new l(g({separator:","}),d,u),w=new l(g({separator:",",conjunction:"and"}),d,u),x=new l(g({separator:",",conjunction:"or"}),d,u),k=new l(v("\n"),b,g,d,u),E=new l(v("\n"),g,d,u,p(/&/g,"&"),p(//g,">"),p(/"/g,"""),p(/'/g,"'"),p(/`/g,"`")),S=new l(f(/(?:\n(?:\s*))+/g," "),u),O=new l(f(/(?:\n\s*)/g,""),u),T=new l(g({separator:","}),f(/(?:\s+)/g," "),u),C=new l(g({separator:",",conjunction:"or"}),f(/(?:\s+)/g," "),u),A=new l(g({separator:",",conjunction:"and"}),f(/(?:\s+)/g," "),u),P=new l(g,d,u),R=new l(g,f(/(?:\s+)/g," "),u),M=new l(d,u),I=new l(d("all"),u)},function(e,t,n){"use strict";n.d(t,"b",(function(){return p}));var r=n(9),i=n(14),o=n(6),a=n(35),s=n(296),l=n(51),u=n(22),c=n(86),d=n(95),f=function(e){function t(t){var n=Object(u.a)({},t);delete n.source,e.call(this,n),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),Object(r.a)(this,Object(a.b)(l.a.SOURCE),this.handleSourcePropertyChange_,this);var i=t.source?t.source:null;this.setSource(i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getLayersArray=function(e){var t=e||[];return t.push(this),t},t.prototype.getLayerStatesArray=function(e){var t=e||[];return t.push(this.getLayerState()),t},t.prototype.getSource=function(){return this.get(l.a.SOURCE)||null},t.prototype.getSourceState=function(){var e=this.getSource();return e?e.getState():d.a.UNDEFINED},t.prototype.handleSourceChange_=function(){this.changed()},t.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Object(r.e)(this.sourceChangeKey_),this.sourceChangeKey_=null);var e=this.getSource();e&&(this.sourceChangeKey_=Object(r.a)(e,i.a.CHANGE,this.handleSourceChange_,this)),this.changed()},t.prototype.setMap=function(e){this.mapPrecomposeKey_&&(Object(r.e)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(Object(r.e)(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=Object(r.a)(e,c.a.PRECOMPOSE,(function(e){var t=e,n=this.getLayerState();n.managed=!1,void 0===this.getZIndex()&&(n.zIndex=1/0),t.frameState.layerStatesArray.push(n),t.frameState.layerStates[Object(o.c)(this)]=n}),this),this.mapRenderKey_=Object(r.a)(this,i.a.CHANGE,e.render,e),this.changed())},t.prototype.setSource=function(e){this.set(l.a.SOURCE,e)},t}(s.a);function p(e,t){return e.visible&&t>=e.minResolution&&ta(a({},e),{},{border:0,boxShadow:"none",padding:"9px 0 9px 12px"}),option:(e,t)=>a(a({},e),{},{backgroundColor:t.isSelected?""+c.active:t.isFocused?""+c.activeBackground:"transparent",paddingLeft:"22px"}),menu:e=>a(a({},e),{},{right:0,zIndex:300}),container:e=>a(a({},e),{},{padding:"0 !important"}),indicatorSeparator:(e,t)=>t.hasValue&&t.selectProps.isClearable?a(a({},e),{},{backgroundColor:""+c.textFieldBorder}):{display:"none"},dropdownIndicator:e=>a(a({},e),{},{color:""+c.controlLabel}),clearIndicator:e=>a(a({},e),{},{color:""+c.controlLabel}),multiValue:e=>a(a({},e),{},{backgroundColor:c.background}),multiValueLabel:e=>a(a({},e),{},{color:c.textLead,fontWeight:500}),multiValueRemove:e=>a(a({},e),{},{color:c.controlLabel,":hover":{color:c.errorText,backgroundColor:c.errorBackground}})};t.reactSelectStyles=E;t.zIndex={zIndex0:0,zIndex1:1,zIndex2:2,zIndex10:10,zIndex100:100,zIndex200:200,zIndex299:299,zIndex300:300,zIndex1000:1e3,zIndex10000:1e4,zIndex99999:99999};t.GlobalStyles=()=>(0,i.jsx)(i.Global,{styles:(0,i.css)("*,*:before,*:after{box-sizing:border-box;}:focus{outline:-webkit-focus-ring-color auto ",d.borderRadius,";}[data-whatintent='mouse'] *:focus{outline:none;}input{border:0;}body{font-family:",l.primary,";font-weight:normal;background-color:",c.background,";color:",c.text,";margin:0;}ul,ol{padding-left:0;}h1,h2,h3,h4,h5,h6,p{font-family:",l.primary,";color:",c.textLead,";font-size:15px;line-height:1.5;margin-top:0;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1{font-size:24px;letter-spacing:0.4px;color:",c.textLead,";}a,button{font-size:14px;font-weight:500;}a{color:",c.text,";text-decoration:none;}img{max-width:100%;}textarea{resize:none;};label:GlobalStyles;")})},function(e,t,n){"use strict";e.exports=function(e,t){return e.wrapText?t:t.replace(r," ")};var r=/\r?\n|\r/g},function(e,t,n){"use strict";t.a={PROPERTYCHANGE:"propertychange"}},function(e,t,n){"use strict";var r=n(3),i=n(10),o=n(62),a=n(72),s=n(15),l=function(e){function t(t,n){e.call(this),this.setCoordinates(t,n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,n,r){var i=this.flatCoordinates,o=Object(s.f)(e,t,i[0],i[1]);if(o=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t{const n=(0,i.default)(t.data,e);if(n)return String(n);{const n=e.split(".")[0];return t[n]?t[n]:""}},z=e=>t=>e.reduce((e,n)=>{const r=B(n,t);return r?`${e} ${r}`:e},"");t.extractSearchFields=z;const U=(e,t)=>e.reduce((e,n)=>{const r=t.reduce((e,t)=>{const r=L({data:n.data,path:t});return e.push(...r),e},[]);for(let t=0;t{const t=e.map(e=>e.field),n={},o=e.reduce((e,t)=>{if(!e[t.slug]){const{field:r}=t,i=P(t,["field"]);e[t.slug]=i,n[t.slug]=(0,d.Set)()}const r=t.field.split(".");let i=e[t.slug].data;for(let e=0;e{const a=o[e].data;for(const o of n[e].toArray()){const e=(0,i.default)(a,o),n=e.filter((e,n)=>t.some(e=>(e+".").startsWith(`${o}.${n}.`)));n.sort((n,r)=>{const i=e.indexOf(n),a=e.indexOf(r),s=`${o}.${i}.`,l=`${o}.${a}.`;return t.findIndex(e=>(e+".").startsWith(s))-t.findIndex(e=>(e+".").startsWith(l))}),(0,r.default)(a,o,n)}}),Object.values(o)};t.mergeExpandedEntries=q;const H=(e,t)=>e.score>t.score?-1:e.score{const n=e.get("folder",""),r=t.toLowerCase().replace(n.toLowerCase(),"");return(0,k.join)((0,k.dirname)((0,a.default)(r,"/")),(0,k.basename)(r,(0,k.extname)(t)))};t.slugFromCustomPath=W;const V=(e,t)=>{if(!(0,v.selectHasMetaPath)(t))return e;return(0,k.dirname)(e).substr(t.get("folder").length+1)||"/"};class ${constructor(e,{backendName:t,authStore:n=null,config:r}={}){if(I(this,"implementation",void 0),I(this,"backendName",void 0),I(this,"authStore",void 0),I(this,"config",void 0),I(this,"user",void 0),I(this,"backupSync",void 0),I(this,"updateUserCredentials",e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user=M(M({},t),e),this.authStore.store(this.user),this.user}),I(this,"getToken",()=>this.implementation.getToken()),this.deleteAnonymousBackup(),this.config=r,this.implementation=e.init(this.config.toJS(),{useWorkflow:(0,h.selectUseWorkflow)(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:E.status.first()}),this.backendName=t,this.authStore=n,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,x.asyncLock)()}async status(){let e={auth:{status:!1},api:{status:!1,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every(e=>!0===e.status))return e;await new Promise(e=>setTimeout(e,1e3*t))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then(e=>(this.user=M(M({},e),{},{backendName:this.backendName}),this.authStore.store(this.user),this.user)):Promise.resolve(null)}isGitBackend(){var e,t;return(null===(e=(t=this.implementation).isGitBackend)||void 0===e?void 0:e.call(t))||!1}authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then(e=>(this.user=M(M({},e),{},{backendName:this.backendName}),this.authStore&&this.authStore.store(this.user),this.user))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}async entryExist(e,t,n,r){const i=r&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:n}).catch(e=>e instanceof x.EditorialWorkflowError&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e));if(i)return i;return await this.implementation.getEntry(t).then(({data:e})=>e).catch(()=>Promise.resolve(!1))}async generateUniqueSlug(e,t,n,r,i){const o=n.get("slug");let a;a=i?W(e,i):(0,w.slugFormatter)(e,t,o);let s=1,l=a;for(;r.includes(l)||await this.entryExist(e,(0,v.selectEntryPath)(e,l),l,(0,h.selectUseWorkflow)(n));)l=`${a}${(0,b.sanitizeChar)(" ",o)}${s++}`;return l}processEntries(e,t){const n=t.get("filter"),r=e.map(e=>(0,y.createEntry)(t.get("name"),(0,v.selectEntrySlug)(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn})).map(this.entryWithFormat(t));return n?this.filterEntries({entries:r},n):r}async listEntries(e){var t;const n=(0,v.selectFolderEntryExtension)(e);let r;const i=e.get("type");if(i===O.FOLDER)r=()=>{var t;const r=(null===(t=e.get("nested"))||void 0===t?void 0:t.get("depth"))||(0,x.getPathDepth)(e.get("path",""));return this.implementation.entriesByFolder(e.get("folder"),n,r)};else{if(i!==O.FILES)throw new Error("Unknown collection type: "+i);{const t=e.get("files").map(e=>({path:e.get("file"),label:e.get("label")})).toArray();r=()=>this.implementation.entriesByFiles(t)}}const o=await r(),a=x.Cursor.create(o[x.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(o,e),pagination:null===(t=a.meta)||void 0===t?void 0:t.get("page"),cursor:a}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){var t;const n=(0,v.selectFolderEntryExtension)(e),r=(null===(t=e.get("nested"))||void 0===t?void 0:t.get("depth"))||(0,x.getPathDepth)(e.get("path",""));return this.implementation.allEntriesByFolder(e.get("folder"),n,r).then(t=>this.processEntries(t,e))}const n=await this.listEntries(e),{entries:r}=n;let{cursor:i}=n;for(;i&&i.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(i,"next");r.push(...e),i=t}return r}async search(e,t){const n=[],r=e.map(async e=>{const n=e.get("summary",""),r=j(n);let i=[];var o;e.get("type")===O.FILES?null===(o=e.get("files"))||void 0===o||o.forEach(e=>{const t=e.get("fields").map(e=>e.get("name")).toArray();i=[...i,...t]}):i=[(0,v.selectInferedField)(e,"title"),(0,v.selectInferedField)(e,"shortTitle"),(0,v.selectInferedField)(e,"author"),...r.map(t=>D[t]?(0,v.selectInferedField)(e,"date"):t)];const a=i.filter(Boolean),l=await this.listAllEntries(e);return f.filter(t,l,{extract:z((0,s.default)(a))})}).map(e=>e.catch(e=>(n.push(e),[]))),i=await Promise.all(r).then(e=>(0,u.default)(e));if(n.length>0)throw new Error({message:"Errors ocurred while searching entries locally!",errors:n});return{entries:i.filter(({score:e})=>e>5).sort(H).map(e=>e.original)}}async query(e,t,n,r,i){let o=await this.listAllEntries(e);r&&(o=o.filter(e=>e.slug===r));const a=U(o,t);let s=f.filter(n,a,{extract:e=>B(e.field,e)}).sort(H).map(e=>e.original);void 0!==i&&i>0&&(s=s.slice(0,i));return{query:n,hits:q(s)}}traverseCursor(e,t){const[n,r]=e.unwrapData(),i=n.get("collection");return this.implementation.traverseCursor(r,t).then(async({entries:e,cursor:t})=>({entries:this.processEntries(e,i),cursor:x.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:i})}))}async getLocalDraftBackup(e,t){const n=F(e.get("name"),t),r=await x.localForage.getItem(n);if(!r||!r.raw.trim())return{};const{raw:i,path:o}=r;let{mediaFiles:a=[]}=r;a=a.map(e=>e.file?M(M({},e),{},{url:URL.createObjectURL(e.file)}):e);const s=(0,v.selectFileEntryLabel)(e,t);return{entry:this.entryWithFormat(e)((0,y.createEntry)(e.get("name"),t,o,{raw:i,label:s,mediaFiles:a,meta:{path:V(o,e)}}))}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const n=F(t.get("name"),e.get("slug")),r=this.entryToRaw(t,e);if(!r.trim())return;const i=await Promise.all(e.get("mediaFiles").toJS().map(async e=>{var t;if(null===(t=e.url)||void 0===t?void 0:t.startsWith("blob:")){const t=await fetch(e.url).then(e=>e.blob());return M(M({},e),{},{file:(0,x.blobToFileObj)(e.name,t)})}return e}));await x.localForage.setItem(n,{raw:r,path:e.get("path"),mediaFiles:i});return await x.localForage.setItem(F(),r)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{await this.backupSync.acquire(),await x.localForage.removeItem(F(e.get("name"),t)),t&&await x.localForage.removeItem(F(e.get("name")));return await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return x.localForage.removeItem(F())}async getEntry(e,t,n){const r=(0,v.selectEntryPath)(t,n),i=(0,v.selectFileEntryLabel)(t,n),o=await this.implementation.getEntry(r);let a=(0,y.createEntry)(t.get("name"),n,o.file.path,{raw:o.data,label:i,mediaFiles:[],meta:{path:V(o.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const n=(0,p.resolveFormat)(e,t);if(t&&void 0!==t.raw){const e=n&&(0,c.default)(n.fromFile.bind(n,t.raw))||{};return(0,l.default)(e)&&console.error(e),Object.assign(t,{data:(0,l.default)(e)?{}:e})}return n.fromFile(t)}}async processUnpublishedEntry(e,t,n){const{slug:r}=t;let i;if(e.get("type")===O.FILES){const t=e.get("files").find(e=>(null==e?void 0:e.get("name"))===r);i=(0,k.extname)(t.get("file"))}else i=(0,v.selectFolderEntryExtension)(e);const a=(0,o.default)(t.diffs.filter(e=>e.path.endsWith(i)),e=>e.path.length);let s="",l=!1,u=r;if(a.length<=0){const t=await this.implementation.getEntry((0,v.selectEntryPath)(e,r));s=t.data,u=t.file.path}else{const n=a[0];s=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,n.path,n.id),l=n.newFile,u=n.path}const c=[];if(n){const n=t.diffs.filter(e=>!e.path.endsWith(i)),o=await Promise.all(n.map(t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),r,t.path,t.id)));c.push(...o.map(e=>M(M({},e),{},{draft:!0})))}const d=(0,y.createEntry)(e.get("name"),r,u,{raw:s,isModification:!l,label:e&&(0,v.selectFileEntryLabel)(e,r),mediaFiles:c,updatedOn:t.updatedAt,status:t.status,meta:{path:V(u,e)}});return this.entryWithFormat(e)(d)}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries();return{pagination:0,entries:(await Promise.all(t.map(async t=>{const n=await this.implementation.unpublishedEntry({id:t}),r=n.collection,i=e.find(e=>e.get("name")===r);if(!i)return console.warn(`Missing collection '${r}' for unpublished entry '${t}'`),null;return await this.processUnpublishedEntry(i,n,!1)}))).filter(Boolean)}}async processEntry(e,t,n){const r=(0,g.selectIntegration)(e.integrations,null,"assetStore"),i=(0,v.selectMediaFolders)(e,t,(0,d.fromJS)(n));if(i.length>0&&!r){const e=await Promise.all(i.map(e=>this.implementation.getMedia(e)));n.mediaFiles=n.mediaFiles.concat(...e)}else n.mediaFiles=n.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return n}async unpublishedEntry(e,t,n){const r=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:n});let i=await this.processUnpublishedEntry(t,r,!0);return i=await this.processEntry(e,t,i),i}getDeploy(e,t,n){const r=this.config.get("site_url");if(r&&!1!==this.config.get("show_preview_links"))return{url:(0,w.previewUrlFormatter)(r,e,t,this.config.get("slug"),n),status:"SUCCESS"}}async getDeployPreview(e,t,n,{maxAttempts:r=1,interval:i=5e3}={}){if(!this.implementation.getDeployPreview||!1===this.config.get("show_preview_links"))return;let o,a=0;for(;!o&&asetTimeout(()=>e(),i));return o?{url:(0,w.previewUrlFormatter)(o.url,e,t,this.config.get("slug"),n),status:o.status?o.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:n,assetProxies:r,usedSlugs:i,unpublished:o=!1,status:a}){const s=await this.invokePreSaveEvent(n.get("entry")),l=s&&n.setIn(["entry","data"],s)||n,u=l.getIn(["entry","newRecord"])||!1,c=(0,h.selectUseWorkflow)(e);let d;const f=(0,T.selectCustomPath)(t,l);if(u){if(!(0,v.selectAllowNewEntries)(t))throw new Error("Not allowed to create new entries in this collection");const n=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,i,f),o=f||(0,v.selectEntryPath)(t,n);d={path:o,slug:n,raw:this.entryToRaw(t,l.get("entry"))},r.map(n=>{const r=n.path,i=(0,m.selectMediaFilePath)(e,t,l.get("entry").set("path",o),r,n.field);n.path=i})}else{const e=l.getIn(["entry","slug"]);d={path:l.getIn(["entry","path"]),slug:f&&!c?W(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f}}const p=await this.currentUser(),g=M({newEntry:u,commitMessage:(0,w.commitMessageFormatter)(u?"create":"update",e,{collection:t,slug:d.slug,path:d.path,authorLogin:p.login,authorName:p.name},p.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:c},{unpublished:o,status:a});return c||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry(d,r,g),await this.invokePostSaveEvent(l.get("entry")),c||await this.invokePostPublishEvent(l.get("entry")),d.slug}async invokeEventWithEntry(e,t){const{login:n,name:r}=await this.currentUser();return await(0,_.invokeEvent)({name:e,data:{entry:t,author:{login:n,name:r}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const n=await this.currentUser(),r={commitMessage:(0,w.commitMessageFormatter)("uploadMedia",e,{path:t.path,authorLogin:n.login,authorName:n.name},n.useOpenAuthoring)};return this.implementation.persistMedia(t,r)}async deleteEntry(e,t,n){const r=(0,v.selectEntryPath)(t,n);if(!(0,v.selectAllowDeletion)(t))throw new Error("Not allowed to delete entries in this collection");const i=e.config,o=await this.currentUser(),a=(0,w.commitMessageFormatter)("delete",i,{collection:t,slug:n,path:r,authorLogin:o.login,authorName:o.name},o.useOpenAuthoring),s=(0,m.selectEntry)(e.entries,t.get("name"),n);await this.invokePreUnpublishEvent(s);const l=await this.implementation.deleteFile(r,a);return await this.invokePostUnpublishEvent(s),l}async deleteMedia(e,t){const n=await this.currentUser(),r=(0,w.commitMessageFormatter)("deleteMedia",e,{path:t,authorLogin:n.login,authorName:n.name},n.useOpenAuthoring);return this.implementation.deleteFile(t,r)}persistUnpublishedEntry(e){return this.persistEntry(M(M({},e),{},{unpublished:!0}))}updateUnpublishedEntryStatus(e,t,n){return this.implementation.updateUnpublishedEntryStatus(e,t,n)}async publishUnpublishedEntry(e){const t=e.get("collection"),n=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,n),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const n=(0,p.resolveFormat)(e,t.toJS()),r=this.fieldsOrder(e,t),i=(0,v.selectFieldsComments)(e,t);return n&&n.toFile(t.get("data").toJS(),r,i)}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map(e=>e.get("name")).toArray();const n=(e.get("files")||(0,d.List)()).filter(e=>e.get("name")===t.get("slug")).get(0);if(null==n)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return n.get("fields").map(e=>e.get("name")).toArray()}filterEntries(e,t){return e.entries.filter(e=>{const n=e.data[t.get("field")];return Array.isArray(n)?n.includes(t.get("value")):n===t.get("value")})}}function G(e){const t=e.getIn(["backend","name"]);if(null==t)throw new Error("No backend defined in configuration");const n=new N,r=(0,_.getBackend)(t);if(r)return new $(r,{backendName:t,authStore:n,config:e});throw new Error("Backend not found: "+t)}t.Backend=$;const K=function(){let e;return t=>e||(e=G(t))}();t.currentBackend=K},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t{p[e]=[]});const h={backends:{},templates:{},previewStyles:[],widgets:{},editorComponents:(0,r.Map)(),widgetValueSerializers:{},mediaLibraries:[],locales:{},eventHandlers:p};var m={registerPreviewStyle:g,getPreviewStyles:v,registerPreviewTemplate:y,getPreviewTemplate:b,registerWidget:_,getWidget:w,getWidgets:x,resolveWidget:k,registerEditorComponent:E,getEditorComponents:S,registerWidgetValueSerializer:O,getWidgetValueSerializer:T,registerBackend:C,getBackend:A,registerMediaLibrary:P,getMediaLibrary:R,registerLocale:N,getLocale:F,registerEventListener:j,removeEventListener:L,getEventListeners:I,invokeEvent:D};function g(e,t){h.previewStyles.push(c(c({},t),{},{value:e}))}function v(){return h.previewStyles}function y(e,t){h.templates[e]=t}function b(e){return h.templates[e]}function _(e,t,n,r={}){if(Array.isArray(e))e.forEach(e=>{"object"!=typeof e?console.error("Cannot register widget: "+e):_(e)});else if("string"==typeof e){const i="string"==typeof t?h.widgets[t].control:t;h.widgets[e]={control:i,preview:n,schema:r}}else if("object"==typeof e){const{name:t,controlComponent:n,previewComponent:r,schema:i={},allowMapValue:a,globalStyles:s}=e,u=l(e,["name","controlComponent","previewComponent","schema","allowMapValue","globalStyles"]);if(h.widgets[t]&&console.warn(o.oneLine` + Multiple widgets registered with name "${t}". Only the last widget registered with + this name will be used. + `),!n)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);h.widgets[t]=c({control:n,preview:r,schema:i,globalStyles:s,allowMapValue:a},u)}else console.error("`registerWidget` failed, called with incorrect arguments.")}function w(e){return h.widgets[e]}function x(){return(0,i.default)(Object.entries(h.widgets),e=>e.map(([e,t])=>c({name:e},t)))}function k(e){return w(e||"string")||w("unknown")}function E(e){const t=(0,a.default)(e);if("code-block"===t.type){const e=h.editorComponents.find(e=>"code-block"===e.type);e&&(console.warn(o.oneLine` + Only one editor component of type "code-block" may be registered. Previously registered code + block component(s) will be overwritten. + `),h.editorComponents=h.editorComponents.delete(e.id))}h.editorComponents=h.editorComponents.set(t.id,t)}function S(){return h.editorComponents}function O(e,t){h.widgetValueSerializers[e]=t}function T(e){return h.widgetValueSerializers[e]}function C(e,t){e&&t?h.backends[e]?console.error(`Backend [${e}] already registered. Please choose a different name.`):h.backends[e]={init:(...e)=>new t(...e)}:console.error("Backend parameters invalid. example: CMS.registerBackend('myBackend', BackendClass)")}function A(e){return h.backends[e]}function P(e,t){if(h.mediaLibraries.find(t=>e.name===t.name))throw new Error(`A media library named ${e.name} has already been registered.`);h.mediaLibraries.push(c(c({},e),{},{options:t}))}function R(e){return h.mediaLibraries.find(t=>t.name===e)}function M(e){if(!f.includes(e))throw new Error(`Invalid event name '${e}'`)}function I(e){return M(e),[...h.eventHandlers[e]]}function j({name:e,handler:t},n={}){M(e),h.eventHandlers[e].push({handler:t,options:n})}async function D({name:e,data:t}){M(e);const n=h.eventHandlers[e];for(const{handler:r,options:i}of n)try{return await r(t,i)}catch(t){console.warn(`Failed running handler for event ${e} with message: ${t.message}`)}}function L({name:e,handler:t}){M(e),h.eventHandlers[e]=t?h.eventHandlers[e].filter(e=>e.handler!==t):[]}function N(e,t){e&&t?h.locales[e]=t:console.error("Locale parameters invalid. example: CMS.registerLocale('locale', phrases)")}function F(e){return h.locales[e]}t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.entryLoading=A,t.entryLoaded=P,t.entryLoadError=R,t.entriesLoading=M,t.entriesLoaded=I,t.entriesFailed=j,t.sortByField=L,t.filterByField=function(e,t){return async(n,r)=>{const i=r(),o=(0,_.selectIsFetching)(i.entries,e.get("name"));if(n({type:"FILTER_ENTRIES_REQUEST",payload:{collection:e.get("name"),filter:t}}),!o)try{const r=await D(i,e);n({type:"FILTER_ENTRIES_SUCCESS",payload:{collection:e.get("name"),filter:t,entries:r}})}catch(r){n({type:"FILTER_ENTRIES_FAILURE",payload:{collection:e.get("name"),filter:t,error:r}})}}},t.changeViewStyle=function(e){return{type:"CHANGE_VIEW_STYLE",payload:{style:e}}},t.entryPersisting=N,t.entryPersisted=F,t.entryPersistFail=B,t.entryDeleting=z,t.entryDeleted=U,t.entryDeleteFail=q,t.emptyDraftCreated=H,t.createDraftFromEntry=W,t.draftDuplicateEntry=V,t.discardDraft=function(){return{type:"DRAFT_DISCARD"}},t.changeDraftField=function(e,t,n,r){return{type:"DRAFT_CHANGE_FIELD",payload:{field:e,value:t,metadata:n,entries:r}}},t.changeDraftFieldValidation=function(e,t){return{type:"DRAFT_VALIDATION_ERRORS",payload:{uniquefieldId:e,errors:t}}},t.clearFieldErrors=function(){return{type:"DRAFT_CLEAR_ERRORS"}},t.localBackupRetrieved=$,t.loadLocalBackup=function(){return{type:"DRAFT_CREATE_FROM_LOCAL_BACKUP"}},t.addDraftEntryMediaFile=function(e){return{type:"ADD_DRAFT_ENTRY_MEDIA_FILE",payload:e}},t.removeDraftEntryMediaFile=function({id:e}){return{type:"REMOVE_DRAFT_ENTRY_MEDIA_FILE",payload:{id:e}}},t.persistLocalBackup=function(e,t){return(n,r)=>{const i=r();return(0,s.currentBackend)(i.config).persistLocalDraftBackup(e,t)}},t.createDraftDuplicateFromEntry=function(e){return t=>{t((0,b.waitUntil)({predicate:({type:e})=>"DRAFT_CREATE_EMPTY"===e,run:()=>t(V(e))}))}},t.retrieveLocalBackup=function(e,t){return async(n,r)=>{const o=r(),a=(0,s.currentBackend)(o.config),{entry:l}=await a.getLocalDraftBackup(e,t);if(l){const t=l.mediaFiles||[],o=await Promise.all(t.map(t=>t.file||t.url?(0,h.createAssetProxy)({path:t.path,file:t.file,url:t.url,field:t.field}):(0,g.getAsset)({collection:e,entry:(0,i.fromJS)(l),path:t.path,field:t.field})(n,r)));return n((0,g.addAssets)(o)),n($(l))}}},t.deleteLocalBackup=function(e,t){return(n,r)=>{const i=r();return(0,s.currentBackend)(i.config).deleteLocalDraftBackup(e,t)}},t.loadEntry=G,t.tryLoadEntry=K,t.loadEntries=X,t.traverseCollectionCursor=function(e,t){return async(n,r)=>{const i=r(),o=e.get("name");if(i.entries.getIn(["pages",""+o,"isFetching"]))return;const a=(0,s.currentBackend)(i.config),{action:l,append:u}=Y.has(t)?Y.get(t).toJS():{action:t,append:!1},c=(0,d.selectCollectionEntriesCursor)(i.cursors,e.get("name"));if(c.meta.get("usingOldPaginationAPI",!1))return n(X(e,c.data.get("nextPage")));try{var f;n(M(e));const{entries:t,cursor:r}=await function(e,t,n){if(!t.actions.has(n))throw new Error(`The current cursor does not support the pagination action "${n}".`);return e.traverseCursor(t,n)}(a,c,l),i=null===(f=r.meta)||void 0===f?void 0:f.get("page");return n(I(e,t,i,Q(r),u))}catch(t){return console.error(t),n(C({message:{details:t,key:"ui.toast.onFailToLoadEntries"},kind:"danger",dismissAfter:8e3})),Promise.reject(n(j(e,t)))}}},t.createEmptyDraft=function(e,t){return async(n,r)=>{new URLSearchParams(t).forEach((t,n)=>{e=(0,c.updateFieldByKey)(e,n,e=>e.set("default",(e=>{if(["true","True","TRUE"].includes(e))return!0;if(["false","False","FALSE"].includes(e))return!1;return(e=>e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"))(e)})(t)))});const o=e.get("fields",(0,i.List)()),a=J(o.filter(e=>!e.get("meta")).toList()),l=J(o.filter(e=>!0===e.get("meta")).toList()),u=r(),d=(0,s.currentBackend)(u.config);e.has("media_folder")||await(0,y.waitForMediaLibraryToLoad)(n,r());let f=(0,p.createEntry)(e.get("name"),"","",{data:a,mediaFiles:[],meta:l});f=await d.processEntry(u,e,f),n(H(f))}},t.createEmptyDraftData=J,t.getMediaAssets=Z,t.persistEntry=function(e){return async(t,n)=>{const r=n(),i=r.entryDraft,o=i.get("fieldsErrors"),l=(0,u.selectPublishedSlugs)(r,e.get("name"));if(!o.isEmpty()){return o.some(e=>e.some(e=>e.type&&e.type===m.default.PRESENCE))&&t(C({message:{key:"ui.toast.missingRequiredField"},kind:"danger",dismissAfter:8e3})),Promise.reject()}const d=(0,s.currentBackend)(r.config),f=i.get("entry"),p=Z({entry:f}),h=(0,c.selectFields)(e,f.get("slug")),g=(0,a.serializeValues)(i.getIn(["entry","data"]),h),v=f.set("data",g),b=i.set("entry",v);return t(N(e,v)),d.persistEntry({config:r.config,collection:e,entryDraft:b,assetProxies:p,usedSlugs:l}).then(n=>{t(C({message:{key:"ui.toast.entrySaved"},kind:"success",dismissAfter:4e3})),p.length>0&&t((0,y.loadMedia)()),t(F(e,v,n)),e.has("nested")&&t(X(e)),f.get("slug")!==n&&(t(G(e,n)),(0,x.navigateToEntry)(e.get("name"),n))}).catch(n=>(console.error(n),t(C({message:{details:n,key:"ui.toast.onFailToPersist"},kind:"danger",dismissAfter:8e3})),Promise.reject(t(B(e,v,n)))))}},t.deleteEntry=function(e,t){return(n,r)=>{const i=r(),o=(0,s.currentBackend)(i.config);return n(z(e,t)),o.deleteEntry(i,e,t).then(()=>n(U(e,t))).catch(r=>(n(C({message:{details:r,key:"ui.toast.onFailToDelete"},kind:"danger",dismissAfter:8e3})),console.error(r),Promise.reject(n(q(e,t,r)))))}},t.validateMetaField=function(e,t,n,r,o){if(n.get("meta")&&"path"===n.get("name")){var a;if(!r)return ee(r,"invalidPath",o);const n=r.split("/").map((0,k.getProcessSegment)(e.config.get("slug"))).join("/");if(r!==n)return ee(r,"invalidPath",o);const s=(0,w.selectCustomPath)(t,(0,i.fromJS)({entry:{meta:{path:r}}})),l=s?(0,_.selectEntryByPath)(e.entries,t.get("name"),s):void 0,u=null==l?void 0:l.get("path"),c=null===(a=e.entryDraft)||void 0===a?void 0:a.getIn(["entry","path"]);if(u&&u!==c)return ee(r,"pathExists",o)}return{error:!1}},t.CHANGE_VIEW_STYLE=t.REMOVE_DRAFT_ENTRY_MEDIA_FILE=t.ADD_DRAFT_ENTRY_MEDIA_FILE=t.ENTRY_DELETE_FAILURE=t.ENTRY_DELETE_SUCCESS=t.ENTRY_DELETE_REQUEST=t.ENTRY_PERSIST_FAILURE=t.ENTRY_PERSIST_SUCCESS=t.ENTRY_PERSIST_REQUEST=t.DRAFT_CREATE_DUPLICATE_FROM_ENTRY=t.DRAFT_CREATE_FROM_LOCAL_BACKUP=t.DRAFT_LOCAL_BACKUP_RETRIEVED=t.DRAFT_CLEAR_ERRORS=t.DRAFT_VALIDATION_ERRORS=t.DRAFT_CHANGE_FIELD=t.DRAFT_DISCARD=t.DRAFT_CREATE_EMPTY=t.DRAFT_CREATE_FROM_ENTRY=t.FILTER_ENTRIES_FAILURE=t.FILTER_ENTRIES_SUCCESS=t.FILTER_ENTRIES_REQUEST=t.SORT_ENTRIES_FAILURE=t.SORT_ENTRIES_SUCCESS=t.SORT_ENTRIES_REQUEST=t.ENTRIES_FAILURE=t.ENTRIES_SUCCESS=t.ENTRIES_REQUEST=t.ENTRY_FAILURE=t.ENTRY_SUCCESS=t.ENTRY_REQUEST=void 0;var r=E(n(263)),i=n(4),o=n(133),a=n(490),s=n(119),l=n(344),u=n(100),c=n(67),d=n(358),f=n(37),p=n(345),h=n(219),m=E(n(359)),g=n(165),v=n(360),y=n(141),b=n(515),_=n(104),w=n(361),x=n(152),k=n(271);function E(e){return e&&e.__esModule?e:{default:e}}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t{const n=(0,s.currentBackend)(e.config),r=(0,u.selectIntegration)(e,t.get("name"),"listEntries"),i=r?(0,l.getIntegrationProvider)(e.integrations,n.getToken,r):n;return await i.listAllEntries(t)};function L(e,t,n=v.SortDirection.Ascending){return async(r,i)=>{const o=i(),a=(0,_.selectIsFetching)(o.entries,e.get("name"));if(r({type:"SORT_ENTRIES_REQUEST",payload:{collection:e.get("name"),key:t,direction:n}}),!a)try{const i=await D(o,e);r({type:"SORT_ENTRIES_SUCCESS",payload:{collection:e.get("name"),key:t,direction:n,entries:i}})}catch(i){r({type:"SORT_ENTRIES_FAILURE",payload:{collection:e.get("name"),key:t,direction:n,error:i}})}}}function N(e,t){return{type:"ENTRY_PERSIST_REQUEST",payload:{collectionName:e.get("name"),entrySlug:t.get("slug")}}}function F(e,t,n){return{type:"ENTRY_PERSIST_SUCCESS",payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),slug:n}}}function B(e,t,n){return{type:"ENTRY_PERSIST_FAILURE",error:"Failed to persist entry",payload:{collectionName:e.get("name"),entrySlug:t.get("slug"),error:n.toString()}}}function z(e,t){return{type:"ENTRY_DELETE_REQUEST",payload:{collectionName:e.get("name"),entrySlug:t}}}function U(e,t){return{type:"ENTRY_DELETE_SUCCESS",payload:{collectionName:e.get("name"),entrySlug:t}}}function q(e,t,n){return{type:"ENTRY_DELETE_FAILURE",payload:{collectionName:e.get("name"),entrySlug:t,error:n.toString()}}}function H(e){return{type:"DRAFT_CREATE_EMPTY",payload:e}}function W(e){return{type:"DRAFT_CREATE_FROM_ENTRY",payload:{entry:e}}}function V(e){return{type:"DRAFT_CREATE_DUPLICATE_FROM_ENTRY",payload:(0,p.createEntry)(e.get("collection"),"","",{data:e.get("data"),mediaFiles:e.get("mediaFiles").toJS()})}}function $(e){return{type:"DRAFT_LOCAL_BACKUP_RETRIEVED",payload:{entry:e}}}function G(e,t){return async(n,r)=>{await(0,y.waitForMediaLibraryToLoad)(n,r()),n(A(e,t));try{const i=await K(r(),e,t);n(P(e,i)),n(W(i))}catch(r){console.error(r),n(C({message:{details:r.message,key:"ui.toast.onFailToLoadEntries"},kind:"danger",dismissAfter:8e3})),n(R(r,e,t))}}}async function K(e,t,n){const r=(0,s.currentBackend)(e.config);return await r.getEntry(e,t,n)}const Y=(0,i.fromJS)({append_next:{action:"next",append:!0}}),Q=e=>f.Cursor.create(e).updateStore("actions",e=>e.union(Y.filter(t=>e.has(t.get("action"))).keySeq()));function X(e,t=0){return async(n,r)=>{if(e.get("isFetching"))return;const i=r(),o=(0,_.selectEntriesSortFields)(i.entries,e.get("name"));if(o&&o.length>0){const t=o[0];return n(L(e,t.get("key"),t.get("direction")))}const a=(0,s.currentBackend)(i.config),c=(0,u.selectIntegration)(i,e.get("name"),"listEntries"),d=c?(0,l.getIntegrationProvider)(i.integrations,a.getToken,c):a,p=!!(t&&!isNaN(t)&&t>0);n(M(e));try{let r=await(e.has("nested")?d.listAllEntries(e).then(e=>({entries:e})):d.listEntries(e,t));r=O(O({},r),{},{cursor:c?f.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):f.Cursor.create(r.cursor)}),n(I(e,r.cursor.meta.get("usingOldPaginationAPI")?r.entries.reverse():r.entries,r.pagination,Q(r.cursor),p))}catch(t){return n(C({message:{details:t,key:"ui.toast.onFailToLoadEntries"},kind:"danger",dismissAfter:8e3})),Promise.reject(n(j(e,t)))}}}function J(e,t=!0){return e.reduce((e,n)=>{const o=e,a=n,s=a.get("field")||a.get("fields"),l="list"==a.get("widget"),u=a.get("name"),c=a.get("default",null),d=e=>[[{}],{}].some(t=>(0,r.default)(e,t));if(i.List.isList(s)){const e=l?[J(s)]:J(s);return d(e)?l&&i.List.isList(c)&&c.isEmpty()&&(o[u]=c):o[u]=e,o}if(i.Map.isMap(s)){const e=l?[J((0,i.List)([s]),!1)]:J((0,i.List)([s]));return d(e)?l&&i.List.isList(c)&&c.isEmpty()&&(o[u]=c):o[u]=e,o}if(null!==c){if(!t)return c;o[u]=c}return o},{})}function Z({entry:e}){return e.get("mediaFiles").toArray().filter(e=>e.get("draft")).map(e=>(0,h.createAssetProxy)({path:e.get("path"),file:e.get("file"),url:e.get("url")}))}const ee=(e,t,n)=>({error:{type:m.default.CUSTOM,message:n("editor.editorControlPane.widget."+t,{path:e})}})},function(e,t,n){var r=n(907)();e.exports=r},function(e,t,n){"use strict";class r{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const r of Object.keys(n))"function"==typeof n[r]&&(t[r]=e[r],e[r]=n[r])}_getOverriddenMethods(){throw new Error("Not implemented")}}r.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}e.defineMode("htmlmixed",(function(n,a){var s=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),l={},u=a&&a.tags,c=a&&a.scriptTypes;if(o(t,l),u&&o(u,l),c)for(var d=c.length-1;d>=0;d--)l.script.unshift(["type",c[d].matches,c[d].mode]);function f(t,o){var a,u=s.token(t,o.htmlState),c=/\btag\b/.test(u);if(c&&!/[<>\s\/]/.test(t.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&c&&/>$/.test(t.current())){var d=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==t.current()&&function(e,t){for(var n=0;n-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}(e,g,t.localMode.token(e,t.localState))},o.localMode=h,o.localState=e.startState(h,s.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return u}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:e.startState(s)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(s,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?s.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||s}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(n(5),n(233),n(198),n(232))},function(e,t,n){"use strict";var r=n(174),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),g=0;g=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},i={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};var o=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},u=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return s(e)?e:e.replace(o,"-$&").toLowerCase()})),c=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,(function(e,t,n){return f={name:t,styles:n,next:f},t}))}return 1===i[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return f={name:n.name,styles:n.styles,next:f},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)f={name:i.name,styles:i.styles,next:f},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,E=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,M=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},j={};function D(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(j[e]=i),t&&(j[t[0]]=function(){return P(i.apply(this,arguments),t[1],t[2])}),n&&(j[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function L(e,t){return e.isValid()?(t=N(t,e.localeData()),I[t]=I[t]||function(e){var t,n,r,i=e.match(R);for(t=0,n=i.length;t=0&&M.test(e);)e=e.replace(M,r),M.lastIndex=0,n-=1;return e}var F={};function B(e,t){var n=e.toLowerCase();F[n]=F[n+"s"]=F[t]=e}function z(e){return"string"==typeof e?F[e]||F[e.toLowerCase()]:void 0}function U(e){var t,n,r={};for(n in e)a(e,n)&&(t=z(n))&&(r[t]=e[n]);return r}var q={};function H(e,t){q[e]=t}function W(e){return e%4==0&&e%100!=0||e%400==0}function V(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function $(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=V(t)),n}function G(e,t){return function(n){return null!=n?(Y(this,e,n),r.updateOffset(this,t),this):K(this,e)}}function K(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Y(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&W(e.year())&&1===e.month()&&29===e.date()?(n=$(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),we(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var Q,X=/\d/,J=/\d\d/,Z=/\d{3}/,ee=/\d{4}/,te=/[+-]?\d{6}/,ne=/\d\d?/,re=/\d\d\d\d?/,ie=/\d\d\d\d\d\d?/,oe=/\d{1,3}/,ae=/\d{1,4}/,se=/[+-]?\d{1,6}/,le=/\d+/,ue=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,de=/Z|[+-]\d\d(?::?\d\d)?/gi,fe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,n){Q[e]=T(t)?t:function(e,r){return e&&n?n:t}}function he(e,t){return a(Q,e)?Q[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,i){return t||n||r||i}))))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Q={};var ge,ve={};function ye(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),u(t)&&(r=function(e,n){n[t]=$(e)}),n=0;n68?1900:2e3)};var Me=G("FullYear",!0);function Ie(e,t,n,r,i,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,o,a),s}function je(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function De(e,t,n){var r=7+t-n;return-(7+je(e,0,r).getUTCDay()-t)%7+r-1}function Le(e,t,n,r,i){var o,a,s=1+7*(t-1)+(7+n-r)%7+De(e,r,i);return s<=0?a=Re(o=e-1)+s:s>Re(e)?(o=e+1,a=s-Re(e)):(o=e,a=s),{year:o,dayOfYear:a}}function Ne(e,t,n){var r,i,o=De(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?r=a+Fe(i=e.year()-1,t,n):a>Fe(e.year(),t,n)?(r=a-Fe(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function Fe(e,t,n){var r=De(e,t,n),i=De(e+1,t,n);return(Re(e)-r+i)/7}function Be(e,t){return e.slice(t,7).concat(e.slice(0,t))}D("w",["ww",2],"wo","week"),D("W",["WW",2],"Wo","isoWeek"),B("week","w"),B("isoWeek","W"),H("week",5),H("isoWeek",5),pe("w",ne),pe("ww",ne,J),pe("W",ne),pe("WW",ne,J),be(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=$(e)})),D("d",0,"do","day"),D("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),D("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),D("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),D("e",0,0,"weekday"),D("E",0,0,"isoWeekday"),B("day","d"),B("weekday","e"),B("isoWeekday","E"),H("day",11),H("weekday",11),H("isoWeekday",11),pe("d",ne),pe("e",ne),pe("E",ne),pe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),pe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),pe("dddd",(function(e,t){return t.weekdaysRegex(e)})),be(["dd","ddd","dddd"],(function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:h(n).invalidWeekday=e})),be(["d","e","E"],(function(e,t,n,r){t[r]=$(e)}));var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ue="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),qe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),He=fe,We=fe,Ve=fe;function $e(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=ge.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=ge.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=ge.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=ge.call(this._weekdaysParse,a))||-1!==(i=ge.call(this._shortWeekdaysParse,a))||-1!==(i=ge.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=ge.call(this._shortWeekdaysParse,a))||-1!==(i=ge.call(this._weekdaysParse,a))||-1!==(i=ge.call(this._minWeekdaysParse,a))?i:null:-1!==(i=ge.call(this._minWeekdaysParse,a))||-1!==(i=ge.call(this._weekdaysParse,a))||-1!==(i=ge.call(this._shortWeekdaysParse,a))?i:null}function Ge(){function e(e,t){return t.length-e.length}var t,n,r,i,o,a=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=me(this.weekdaysMin(n,"")),i=me(this.weekdaysShort(n,"")),o=me(this.weekdays(n,"")),a.push(r),s.push(i),l.push(o),u.push(r),u.push(i),u.push(o);a.sort(e),s.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Ye(e,t){D(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Qe(e,t){return t._meridiemParse}D("H",["HH",2],0,"hour"),D("h",["hh",2],0,Ke),D("k",["kk",2],0,(function(){return this.hours()||24})),D("hmm",0,0,(function(){return""+Ke.apply(this)+P(this.minutes(),2)})),D("hmmss",0,0,(function(){return""+Ke.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)})),D("Hmm",0,0,(function(){return""+this.hours()+P(this.minutes(),2)})),D("Hmmss",0,0,(function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)})),Ye("a",!0),Ye("A",!1),B("hour","h"),H("hour",13),pe("a",Qe),pe("A",Qe),pe("H",ne),pe("h",ne),pe("k",ne),pe("HH",ne,J),pe("hh",ne,J),pe("kk",ne,J),pe("hmm",re),pe("hmmss",ie),pe("Hmm",re),pe("Hmmss",ie),ye(["H","HH"],3),ye(["k","kk"],(function(e,t,n){var r=$(e);t[3]=24===r?0:r})),ye(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ye(["h","hh"],(function(e,t,n){t[3]=$(e),h(n).bigHour=!0})),ye("hmm",(function(e,t,n){var r=e.length-2;t[3]=$(e.substr(0,r)),t[4]=$(e.substr(r)),h(n).bigHour=!0})),ye("hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[3]=$(e.substr(0,r)),t[4]=$(e.substr(r,2)),t[5]=$(e.substr(i)),h(n).bigHour=!0})),ye("Hmm",(function(e,t,n){var r=e.length-2;t[3]=$(e.substr(0,r)),t[4]=$(e.substr(r))})),ye("Hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[3]=$(e.substr(0,r)),t[4]=$(e.substr(r,2)),t[5]=$(e.substr(i))}));var Xe,Je=G("Hours",!0),Ze={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:xe,monthsShort:ke,week:{dow:0,doy:6},weekdays:ze,weekdaysMin:qe,weekdaysShort:Ue,meridiemParse:/[ap]\.?m?\.?/i},et={},tt={};function nt(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=it(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&nt(i,n)>=t-1)break;t--}o++}return Xe}(e)}function lt(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>we(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,h(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),h(e)._overflowWeeks&&-1===t&&(t=7),h(e)._overflowWeekday&&-1===t&&(t=8),h(e).overflow=t),e}var ut=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ct=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dt=/Z|[+-]\d\d(?::?\d\d)?/,ft=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ht=/^\/?Date\((-?\d+)/i,mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e){var t,n,r,i,o,a,s=e._i,l=ut.exec(s)||ct.exec(s);if(l){for(h(e).iso=!0,t=0,n=ft.length;t7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,u=Ne(St(),o,a),n=_t(t.gg,e._a[0],u.year),r=_t(t.w,u.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(l=!0)):i=o),r<1||r>Fe(n,o,a)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=Le(n,r,i,o,a),e._a[0]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=_t(e._a[0],i[0]),(e._dayOfYear>Re(a)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=je(a,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=i[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?je:Ie).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(h(e).weekdayMismatch=!0)}}function xt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],h(e).empty=!0;var t,n,i,o,a,s,l=""+e._i,u=l.length,c=0;for(i=N(e._f,e._locale).match(R)||[],t=0;t0&&h(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),c+=n.length),j[o]?(n?h(e).empty=!1:h(e).unusedTokens.push(o),_e(o,n,e)):e._strict&&!n&&h(e).unusedTokens.push(o);h(e).charsLeftOver=u-c,l.length>0&&h(e).unusedInput.push(l),e._a[3]<=12&&!0===h(e).bigHour&&e._a[3]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(s=h(e).era)&&(e._a[0]=e._locale.erasConvertYear(s,e._a[0])),wt(e),lt(e)}else bt(e);else vt(e)}function kt(e){var t=e._i,n=e._f;return e._locale=e._locale||st(e._l),null===t||void 0===n&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new _(lt(t)):(c(t)?e._d=t:i(n)?function(e){var t,n,r,i,o,a,s=!1;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:g()}));function Ct(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return St();for(n=t[0],r=1;r=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function rn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function on(e,t){return t.erasAbbrRegex(e)}function an(){var e,t,n=[],r=[],i=[],o=[],a=this.eras();for(e=0,t=a.length;e(o=Fe(e,r,i))&&(t=o),un.call(this,e,t,n,r,i))}function un(e,t,n,r,i){var o=Le(e,t,n,r,i),a=je(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}D("N",0,0,"eraAbbr"),D("NN",0,0,"eraAbbr"),D("NNN",0,0,"eraAbbr"),D("NNNN",0,0,"eraName"),D("NNNNN",0,0,"eraNarrow"),D("y",["y",1],"yo","eraYear"),D("y",["yy",2],0,"eraYear"),D("y",["yyy",3],0,"eraYear"),D("y",["yyyy",4],0,"eraYear"),pe("N",on),pe("NN",on),pe("NNN",on),pe("NNNN",(function(e,t){return t.erasNameRegex(e)})),pe("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ye(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?h(n).era=i:h(n).invalidEra=e})),pe("y",le),pe("yy",le),pe("yyy",le),pe("yyyy",le),pe("yo",(function(e,t){return t._eraYearOrdinalRegex||le})),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],(function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,i):t[0]=parseInt(e,10)})),D(0,["gg",2],0,(function(){return this.weekYear()%100})),D(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),sn("gggg","weekYear"),sn("ggggg","weekYear"),sn("GGGG","isoWeekYear"),sn("GGGGG","isoWeekYear"),B("weekYear","gg"),B("isoWeekYear","GG"),H("weekYear",1),H("isoWeekYear",1),pe("G",ue),pe("g",ue),pe("GG",ne,J),pe("gg",ne,J),pe("GGGG",ae,ee),pe("gggg",ae,ee),pe("GGGGG",se,te),pe("ggggg",se,te),be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=$(e)})),be(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),D("Q",0,"Qo","quarter"),B("quarter","Q"),H("quarter",7),pe("Q",X),ye("Q",(function(e,t){t[1]=3*($(e)-1)})),D("D",["DD",2],"Do","date"),B("date","D"),H("date",9),pe("D",ne),pe("DD",ne,J),pe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ye(["D","DD"],2),ye("Do",(function(e,t){t[2]=$(e.match(ne)[0])}));var cn=G("Date",!0);D("DDD",["DDDD",3],"DDDo","dayOfYear"),B("dayOfYear","DDD"),H("dayOfYear",4),pe("DDD",oe),pe("DDDD",Z),ye(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=$(e)})),D("m",["mm",2],0,"minute"),B("minute","m"),H("minute",14),pe("m",ne),pe("mm",ne,J),ye(["m","mm"],4);var dn=G("Minutes",!1);D("s",["ss",2],0,"second"),B("second","s"),H("second",15),pe("s",ne),pe("ss",ne,J),ye(["s","ss"],5);var fn,pn,hn=G("Seconds",!1);for(D("S",0,0,(function(){return~~(this.millisecond()/100)})),D(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),D(0,["SSS",3],0,"millisecond"),D(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),D(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),D(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),D(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),D(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),D(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),B("millisecond","ms"),H("millisecond",16),pe("S",oe,X),pe("SS",oe,J),pe("SSS",oe,Z),fn="SSSS";fn.length<=9;fn+="S")pe(fn,le);function mn(e,t){t[6]=$(1e3*("0."+e))}for(fn="S";fn.length<=9;fn+="S")ye(fn,mn);pn=G("Milliseconds",!1),D("z",0,0,"zoneAbbr"),D("zz",0,0,"zoneName");var gn=_.prototype;function vn(e){return e}gn.add=$t,gn.calendar=function(e,t){1===arguments.length&&(Yt(arguments[0])?(e=arguments[0],t=void 0):Qt(arguments[0])&&(t=arguments[0],e=void 0));var n=e||St(),i=Lt(n,this).startOf("day"),o=r.calendarFormat(this,i)||"sameElse",a=t&&(T(t[o])?t[o].call(this,n):t[o]);return this.format(a||this.localeData().calendar(o,this,St(n)))},gn.clone=function(){return new _(this)},gn.diff=function(e,t,n){var r,i,o;if(!this.isValid())return NaN;if(!(r=Lt(e,this)).isValid())return NaN;switch(i=6e4*(r.utcOffset()-this.utcOffset()),t=z(t)){case"year":o=Xt(this,r)/12;break;case"month":o=Xt(this,r);break;case"quarter":o=Xt(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:V(o)},gn.endOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?rn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},gn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=L(this,e);return this.localeData().postformat(t)},gn.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||St(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},gn.fromNow=function(e){return this.from(St(),e)},gn.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||St(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},gn.toNow=function(e){return this.to(St(),e)},gn.get=function(e){return T(this[e=z(e)])?this[e]():this},gn.invalidAt=function(){return h(this).overflow},gn.isAfter=function(e,t){var n=w(e)?e:St(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?L(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",L(n,"Z")):L(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},gn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",i="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(gn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),gn.toJSON=function(){return this.isValid()?this.toISOString():null},gn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},gn.unix=function(){return Math.floor(this.valueOf()/1e3)},gn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},gn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},gn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},gn.isLocal=function(){return!!this.isValid()&&!this._isUTC},gn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},gn.isUtc=Ft,gn.isUTC=Ft,gn.zoneAbbr=function(){return this._isUTC?"UTC":""},gn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},gn.dates=k("dates accessor is deprecated. Use date instead.",cn),gn.months=k("months accessor is deprecated. Use month instead",Ae),gn.years=k("years accessor is deprecated. Use year instead",Me),gn.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),gn.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=kt(t))._a?(e=t._isUTC?p(t._a):St(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,i=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(r=0;r0):this._isDSTShifted=!1,this._isDSTShifted}));var yn=A.prototype;function bn(e,t,n,r){var i=st(),o=p().set(r,t);return i[n](o,e)}function _n(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=bn(e,r,n,"month");return i}function wn(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var i,o=st(),a=e?o._week.dow:0,s=[];if(null!=n)return bn(t,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=bn(t,(i+a)%7,r,"day");return s}yn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return T(r)?r.call(t,n):r},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=vn,yn.postformat=vn,yn.relativeTime=function(e,t,n,r){var i=this._relativeTime[n];return T(i)?i(e,t,n,r):i.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)a(e,n)&&(T(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.eras=function(e,t){var n,i,o,a=this._eras||st("en")._eras;for(n=0,i=a.length;n=0)return l[r]},yn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},yn.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},yn.erasNameRegex=function(e){return a(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},yn.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},yn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ee).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ee.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var r,i,o;if(this._monthsParseExact)return Te.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},yn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Pe.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Oe),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Pe.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=Se),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Ne(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Be(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?Be(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?Be(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var r,i,o;if(this._weekdaysParseExact)return $e.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=He),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=We),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ve),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ot("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===$(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",ot),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",st);var xn=Math.abs;function kn(e,t,n,r){var i=Ut(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function En(e){return e<0?Math.floor(e):Math.ceil(e)}function Sn(e){return 4800*e/146097}function On(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var Cn=Tn("ms"),An=Tn("s"),Pn=Tn("m"),Rn=Tn("h"),Mn=Tn("d"),In=Tn("w"),jn=Tn("M"),Dn=Tn("Q"),Ln=Tn("y");function Nn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Fn=Nn("milliseconds"),Bn=Nn("seconds"),zn=Nn("minutes"),Un=Nn("hours"),qn=Nn("days"),Hn=Nn("months"),Wn=Nn("years"),Vn=Math.round,$n={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Gn(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}var Kn=Math.abs;function Yn(e){return(e>0)-(e<0)||+e}function Qn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,o,a,s,l=Kn(this._milliseconds)/1e3,u=Kn(this._days),c=Kn(this._months),d=this.asSeconds();return d?(e=V(l/60),t=V(e/60),l%=60,e%=60,n=V(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=Yn(this._months)!==Yn(d)?"-":"",a=Yn(this._days)!==Yn(d)?"-":"",s=Yn(this._milliseconds)!==Yn(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?a+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var Xn=Pt.prototype;return Xn.isValid=function(){return this._isValid},Xn.abs=function(){var e=this._data;return this._milliseconds=xn(this._milliseconds),this._days=xn(this._days),this._months=xn(this._months),e.milliseconds=xn(e.milliseconds),e.seconds=xn(e.seconds),e.minutes=xn(e.minutes),e.hours=xn(e.hours),e.months=xn(e.months),e.years=xn(e.years),this},Xn.add=function(e,t){return kn(this,e,t,1)},Xn.subtract=function(e,t){return kn(this,e,t,-1)},Xn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=z(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Sn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(On(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Xn.asMilliseconds=Cn,Xn.asSeconds=An,Xn.asMinutes=Pn,Xn.asHours=Rn,Xn.asDays=Mn,Xn.asWeeks=In,Xn.asMonths=jn,Xn.asQuarters=Dn,Xn.asYears=Ln,Xn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*$(this._months/12):NaN},Xn._bubble=function(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*En(On(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=V(o/1e3),l.seconds=e%60,t=V(e/60),l.minutes=t%60,n=V(t/60),l.hours=n%24,a+=V(n/24),i=V(Sn(a)),s+=i,a-=En(On(i)),r=V(s/12),s%=12,l.days=a,l.months=s,l.years=r,this},Xn.clone=function(){return Ut(this)},Xn.get=function(e){return e=z(e),this.isValid()?this[e+"s"]():NaN},Xn.milliseconds=Fn,Xn.seconds=Bn,Xn.minutes=zn,Xn.hours=Un,Xn.days=qn,Xn.weeks=function(){return V(this.days()/7)},Xn.months=Hn,Xn.years=Wn,Xn.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=$n;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(o=Object.assign({},$n,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=this.localeData(),r=function(e,t,n,r){var i=Ut(e).abs(),o=Vn(i.as("s")),a=Vn(i.as("m")),s=Vn(i.as("h")),l=Vn(i.as("d")),u=Vn(i.as("M")),c=Vn(i.as("w")),d=Vn(i.as("y")),f=o<=n.ss&&["s",o]||o0,f[4]=r,Gn.apply(null,f)}(this,!i,o,n),i&&(r=n.pastFuture(+this,r)),n.postformat(r)},Xn.toISOString=Qn,Xn.toString=Qn,Xn.toJSON=Qn,Xn.locale=Jt,Xn.localeData=en,Xn.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qn),Xn.lang=Zt,D("X",0,0,"unix"),D("x",0,0,"valueOf"),pe("x",ue),pe("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ye("x",(function(e,t,n){n._d=new Date($(e))})), +//! moment.js +r.version="2.27.0",t=St,r.fn=gn,r.min=function(){var e=[].slice.call(arguments,0);return Ct("isBefore",e)},r.max=function(){var e=[].slice.call(arguments,0);return Ct("isAfter",e)},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return St(1e3*e)},r.months=function(e,t){return _n(e,t,"months")},r.isDate=c,r.locale=ot,r.invalid=g,r.duration=Ut,r.isMoment=w,r.weekdays=function(e,t,n){return wn(e,t,n,"weekdays")},r.parseZone=function(){return St.apply(null,arguments).parseZone()},r.localeData=st,r.isDuration=Rt,r.monthsShort=function(e,t){return _n(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return wn(e,t,n,"weekdaysMin")},r.defineLocale=at,r.updateLocale=function(e,t){if(null!=t){var n,r,i=Ze;null!=et[e]&&null!=et[e].parentLocale?et[e].set(C(et[e]._config,t)):(null!=(r=it(e))&&(i=r._config),t=C(i,t),null==r&&(t.abbr=e),(n=new A(t)).parentLocale=et[e],et[e]=n),ot(e)}else null!=et[e]&&(null!=et[e].parentLocale?(et[e]=et[e].parentLocale,e===ot()&&ot(e)):null!=et[e]&&delete et[e]);return et[e]},r.locales=function(){return E(et)},r.weekdaysShort=function(e,t,n){return wn(e,t,n,"weekdaysShort")},r.normalizeUnits=z,r.relativeTimeRounding=function(e){return void 0===e?Vn:"function"==typeof e&&(Vn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==$n[e]&&(void 0===t?$n[e]:($n[e]=t,"s"===e&&($n.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=gn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}).call(this,n(135)(e))},function(e,t,n){var r=n(968),i=n(969);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMediaLibrary=function(e){const t={show:e.show||(()=>{}),hide:e.hide||(()=>{}),onClearControl:e.onClearControl||(()=>{}),onRemoveControl:e.onRemoveControl||(()=>{}),enableStandalone:e.enableStandalone||(()=>{})};return{type:"MEDIA_LIBRARY_CREATE",payload:t}},t.clearMediaControl=function(e){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");r&&r.onClearControl({id:e})}},t.removeMediaControl=function(e){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");r&&r.onRemoveControl({id:e})}},t.openMediaLibrary=function(e={}){return(t,n)=>{const i=n().mediaLibrary.get("externalLibrary");if(i){const{controlID:t,value:n,config:o=(0,r.Map)(),allowMultiple:a,forImage:s}=e;i.show({id:t,value:n,config:o.toJS(),allowMultiple:a,imagesOnly:s})}t({type:"MEDIA_LIBRARY_OPEN",payload:e})}},t.closeMediaLibrary=function(){return(e,t)=>{const n=t().mediaLibrary.get("externalLibrary");n&&n.hide(),e({type:"MEDIA_LIBRARY_CLOSE"})}},t.insertMedia=function(e,t){return(n,r)=>{const i=r(),o=i.config,a=i.entryDraft.get("entry"),s=i.entryDraft.getIn(["entry","collection"]),l=i.collections.get(s);n({type:"MEDIA_INSERT",payload:{mediaPath:e=Array.isArray(e)?e.map(e=>(0,u.selectMediaFilePublicPath)(o,l,e,a,t)):(0,u.selectMediaFilePublicPath)(o,l,e,a,t)}})}},t.removeInsertedMedia=function(e){return{type:"MEDIA_REMOVE_INSERTED",payload:{controlID:e}}},t.loadMedia=function(e={}){const{delay:t=0,query:n="",page:r=1,privateUpload:i}=e;return async(e,o)=>{const s=o(),u=(0,a.currentBackend)(s.config),c=(0,l.selectIntegration)(s,null,"assetStore");if(c){const t=(0,d.getIntegrationProvider)(s.integrations,u.getToken,c);e(k(r));try{const o=await t.retrieve(n,r,i);return e(E(o,{page:r,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:n,privateUpload:i}))}catch(t){return e(S({privateUpload:i}))}}e(k(r));const f=()=>u.getMedia().then(t=>e(E(t))).catch(t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(E([]))):e(S())});return t>0?new Promise(e=>{setTimeout(()=>e(f()),t)}):f()}},t.persistMedia=function(e,t={}){const{privateUpload:n,field:r}=t;return async(t,i)=>{const m=i(),g=(0,a.currentBackend)(m.config),v=(0,l.selectIntegration)(m,null,"assetStore"),y=(0,c.selectMediaFiles)(m,r),x=(0,h.sanitizeSlug)(e.name.toLowerCase(),m.config.get("slug")),k=y.find(e=>e.name.toLowerCase()===x),E=(0,u.selectEditingDraft)(m.entryDraft);if(!v&&k){if(!window.confirm(k.name+" already exists. Do you want to replace it?"))return;await t(w(k,{privateUpload:n}))}!v&&E||t(O());try{let i,a;if(v)try{const t=(0,d.getIntegrationProvider)(m.integrations,g.getToken,v),r=await t.upload(e,n);i=(0,s.createAssetProxy)({url:r.asset.url,path:r.asset.url})}catch(t){i=(0,s.createAssetProxy)({file:e,path:x})}else{if(n)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=m.entryDraft.get("entry"),n=m.collections.get(null==t?void 0:t.get("collection")),o=(0,u.selectMediaFilePath)(m.config,n,t,x,r);i=(0,s.createAssetProxy)({file:e,path:o,field:r})}}if(t((0,f.addAsset)(i)),v){a=_({id:await(0,o.getBlobSHA)(e),file:e,assetProxy:i,draft:!1})}else{if(E){return a=_({id:await(0,o.getBlobSHA)(e),file:e,assetProxy:i,draft:E}),t((0,p.addDraftEntryMediaFile)(a))}a=await g.persistMedia(m.config,i)}return t(T(a,{privateUpload:n}))}catch(e){return console.error(e),t(b({message:"Failed to persist media: "+e,kind:"danger",dismissAfter:8e3})),t(C({privateUpload:n}))}}},t.deleteMedia=w,t.getMediaFile=async function(e,t){const n=(0,a.currentBackend)(e.config),{url:r}=await n.getMediaFile(t);return{url:r}},t.loadMediaDisplayURL=x,t.mediaLoading=k,t.mediaLoaded=E,t.mediaLoadFailed=S,t.mediaPersisting=O,t.mediaPersisted=T,t.mediaPersistFailed=C,t.mediaDeleting=A,t.mediaDeleted=P,t.mediaDeleteFailed=R,t.mediaDisplayURLRequest=M,t.mediaDisplayURLSuccess=I,t.mediaDisplayURLFailure=j,t.waitForMediaLibraryToLoad=async function(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await(0,m.waitUntilWithTimeout)(e,e=>({predicate:({type:e})=>"MEDIA_LOAD_SUCCESS"===e||"MEDIA_LOAD_FAILURE"===e,run:()=>e()}))},t.getMediaDisplayURL=async function(e,t,n){const r=(0,c.selectMediaDisplayURL)(t,n.id);let i;if(r.get("url"))i=r.get("url");else if(r.get("err"))i=null;else{const t=n.id,o=(0,m.waitUntilWithTimeout)(e,e=>({predicate:({type:e,payload:n})=>("MEDIA_DISPLAY_URL_SUCCESS"===e||"MEDIA_DISPLAY_URL_FAILURE"===e)&&n.key===t,run:(t,n,r)=>e(r.payload.url)}));r.get("isFetching")||e(x(n)),i=await o}return i},t.MEDIA_DISPLAY_URL_FAILURE=t.MEDIA_DISPLAY_URL_SUCCESS=t.MEDIA_DISPLAY_URL_REQUEST=t.MEDIA_DELETE_FAILURE=t.MEDIA_DELETE_SUCCESS=t.MEDIA_DELETE_REQUEST=t.MEDIA_PERSIST_FAILURE=t.MEDIA_PERSIST_SUCCESS=t.MEDIA_PERSIST_REQUEST=t.MEDIA_LOAD_FAILURE=t.MEDIA_LOAD_SUCCESS=t.MEDIA_LOAD_REQUEST=t.MEDIA_REMOVE_INSERTED=t.MEDIA_INSERT=t.MEDIA_LIBRARY_CREATE=t.MEDIA_LIBRARY_CLOSE=t.MEDIA_LIBRARY_OPEN=void 0;var r=n(4),i=n(133),o=n(37),a=n(119),s=n(219),l=n(100),u=n(104),c=n(270),d=n(344),f=n(165),p=n(123),h=n(164),m=n(515);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t{const i=r(),o=(0,a.currentBackend)(i.config),s=(0,l.selectIntegration)(i,null,"assetStore");if(s){const r=(0,d.getIntegrationProvider)(i.integrations,o.getToken,s);t(A());try{return await r.delete(e.id),t(P(e,{privateUpload:n}))}catch(e){return console.error(e),t(b({message:"Failed to delete media: "+e.message,kind:"danger",dismissAfter:8e3})),t(R({privateUpload:n}))}}try{if(e.draft)t((0,f.removeAsset)(e.path)),t((0,p.removeDraftEntryMediaFile)({id:e.id}));else{const n=(0,u.selectEditingDraft)(i.entryDraft);t(A()),t((0,f.removeAsset)(e.path)),await o.deleteMedia(i.config,e.path),t(P(e)),n&&t((0,p.removeDraftEntryMediaFile)({id:e.id}))}}catch(e){return console.error(e),t(b({message:"Failed to delete media: "+e.message,kind:"danger",dismissAfter:8e3})),t(R())}}}function x(e){return async(t,n)=>{const{displayURL:r,id:i}=e,o=n(),s=(0,c.selectMediaDisplayURL)(o,i);if(!i||!r||s.get("url")||s.get("isFetching")||s.get("err"))return Promise.resolve();if("string"==typeof r)return t(M(i)),void t(I(i,r));try{const e=(0,a.currentBackend)(o.config);t(M(i));const n=await e.getMediaDisplayURL(r);if(!n)throw new Error("No display URL was returned!");t(I(i,n))}catch(e){t(j(i,e))}}}function k(e){return{type:"MEDIA_LOAD_REQUEST",payload:{page:e}}}function E(e,t={}){return{type:"MEDIA_LOAD_SUCCESS",payload:v({files:e},t)}}function S(e={}){const{privateUpload:t}=e;return{type:"MEDIA_LOAD_FAILURE",payload:{privateUpload:t}}}function O(){return{type:"MEDIA_PERSIST_REQUEST"}}function T(e,t={}){const{privateUpload:n}=t;return{type:"MEDIA_PERSIST_SUCCESS",payload:{file:e,privateUpload:n}}}function C(e={}){const{privateUpload:t}=e;return{type:"MEDIA_PERSIST_FAILURE",payload:{privateUpload:t}}}function A(){return{type:"MEDIA_DELETE_REQUEST"}}function P(e,t={}){const{privateUpload:n}=t;return{type:"MEDIA_DELETE_SUCCESS",payload:{file:e,privateUpload:n}}}function R(e={}){const{privateUpload:t}=e;return{type:"MEDIA_DELETE_FAILURE",payload:{privateUpload:t}}}function M(e){return{type:"MEDIA_DISPLAY_URL_REQUEST",payload:{key:e}}}function I(e,t){return{type:"MEDIA_DISPLAY_URL_SUCCESS",payload:{key:e,url:t}}}function j(e,t){return console.error(t),{type:"MEDIA_DISPLAY_URL_FAILURE",payload:{key:e,err:t}}}t.MEDIA_DISPLAY_URL_FAILURE="MEDIA_DISPLAY_URL_FAILURE"},function(e,t,n){var r=n(320),i=n(185),o=n(213),a=n(44),s=n(136),l=n(214),u=n(251),c=n(249),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},function(e,t,n){"use strict";var r=n(1),i=n(685);if(void 0===r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var o=(new r.Component).updater;e.exports=i(r.Component,r.isValidElement,o)},function(e,t,n){var r=n(120),i=n(355),o=n(585),a=n(154),s=n(190),l=n(1233),u=n(265),c=n(356),d=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=a(t,e),u||(u=t.length>1),t})),s(e,c(e),n),u&&(n=i(n,7,l));for(var d=t.length;d--;)o(n,t[d]);return n}));e.exports=d},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(3),i=n(98),o=n(299);function a(e,t,n,i,a){var s=Object(r.s)(Object(r.j)(),e,t,n,i);return!!Object(r.F)(a,s)&&(!!Object(r.g)(a,s)||(s[0]>=a[0]&&s[2]<=a[2]||(s[1]>=a[1]&&s[3]<=a[3]||Object(o.a)(e,t,n,i,(function(e,t){return Object(r.G)(a,e,t)})))))}function s(e,t,n,r,i){for(var o=0,s=n.length;o0}function o(e,t,n,r,o){for(var a=void 0!==o&&o,s=0,l=n.length;sr.push("/collections/"+e);t.navigateToNewEntry=e=>r.replace(`/collections/${e}/new`);t.navigateToEntry=(e,t)=>r.replace(`/collections/${e}/entries/${t}`);var i=r;t.default=i},function(e,t,n){var r=n(713),i=n(718);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(44),i=n(313),o=n(431),a=n(109);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(181),i=n(120),o=n(44),a=n(182),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var r=n(777),i=n(778),o=n(462);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,o){return o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(43))},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";var r=n(258),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var o=Object.create(n(218));o.inherits=n(158);var a=n(466),s=n(336);o.inherits(d,a);for(var l=i(s.prototype),u=0;u{e(x());try{const n=t().config,r=(()=>{const e=document.querySelector('link[rel="cms-config-url"]');if(e&&{"text/yaml":"yaml","application/x-yaml":"yaml"}[e.type]&&(0,i.default)(e,"href")){const t=(0,i.default)(e,"href");return console.log(`Using config file path: "${t}"`),t}return"config.yml"})(),o=n&&n.size>1,a=n&&!1===n.get("load_config_file")?{}:await async function(e,t){const n=await fetch(e,{credentials:"same-origin"}).catch(e=>e);if(n instanceof Error||200!==n.status){if(t)return _("");throw new Error(`Failed to load config.yml (${n.status||n})`)}const r=n.headers.get("Content-Type")||"Not-Found";if(-1===r.indexOf("yaml")&&(console.log(`Response for ${e} was not yaml. (Content-Type: ${r})`),t))return _("");return _(await n.text())}(r,o);let s=b(n,a);(0,d.validateConfig)(s.toJS()),s=await O(s);e(E(y(s))),e((0,u.authenticateUser)())}catch(t){throw e(k(t)),t}}},t.CONFIG_MERGE=t.CONFIG_FAILURE=t.CONFIG_SUCCESS=t.CONFIG_REQUEST=void 0;var r=m(n(257)),i=m(n(82)),o=m(n(138)),a=m(n(121)),s=m(n(329)),l=n(4),u=n(208),c=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=h();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(103)),d=n(834),f=n(67),p=n(119);function h(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return h=function(){return e},e}function m(e){return e&&e.__esModule?e:{default:e}}t.CONFIG_REQUEST="CONFIG_REQUEST";t.CONFIG_SUCCESS="CONFIG_SUCCESS";t.CONFIG_FAILURE="CONFIG_FAILURE";t.CONFIG_MERGE="CONFIG_MERGE";const g=e=>(e.has("media_folder")&&!e.has("public_folder")&&(e=e.set("public_folder",e.get("media_folder"))),e),v={publish_mode:c.SIMPLE};function y(e){return(0,l.Map)(v).mergeDeep(e).withMutations(t=>{!t.get("display_url")&&t.get("site_url")&&t.set("display_url",t.get("site_url"));const n="/"+(0,a.default)(t.get("media_folder"),"/");t.has("public_folder")||t.set("public_folder",n),t.getIn(["slug","encoding"])||t.setIn(["slug","encoding"],"unicode"),t.getIn(["slug","clean_accents"])||t.setIn(["slug","clean_accents"],!1),t.getIn(["slug","sanitize_replacement"])||t.setIn(["slug","sanitize_replacement"],"-"),t.set("collections",t.get("collections").map(t=>{t.has("publish")||(t=t.set("publish",!0));const n=t.get("folder");if(n)if(t.has("path")&&!t.has("media_folder")&&(t=t.set("media_folder","")),(t=(t=(t=g(t)).set("fields",(0,f.traverseFields)(t.get("fields"),g))).set("folder",(0,o.default)(n,"/"))).has("meta")){const e=t.get("fields"),n=[];t.get("meta").forEach((e,t)=>{const r=e.withMutations(e=>{e.set("name",t),e.set("meta",!0),e.set("required",!0)});n.push(r)}),t=t.set("fields",(0,l.fromJS)([]).concat(n,e))}else t=t.set("meta",(0,l.Map)());const r=t.get("files");if(r&&(t=(t=(t=t.delete("nested")).delete("meta")).set("files",r.map(e=>(e=e.set("file",(0,a.default)(e.get("file"),"/")),e=(e=g(e)).set("fields",(0,f.traverseFields)(e.get("fields"),g)))))),!t.has("sortableFields")){const n=(0,p.resolveBackend)(e),r=(0,f.selectDefaultSortableFields)(t,n);t=t.set("sortableFields",(0,l.fromJS)(r))}return t=t.has("view_filters")?t.set("view_filters",t.get("view_filters").map(e=>e.set("id",`${e.get("field")}__${e.get("pattern")}`))):t.set("view_filters",(0,l.fromJS)([]))}))})}function b(e,t){const n=(0,l.fromJS)(t)||(0,l.Map)();return e?e.mergeDeep(n):n}function _(e){const t=s.default.parse(e,{maxAliasCount:-1,prettyErrors:!0,merge:!0});return"string"==typeof CMS_ENV&&t[CMS_ENV]&&Object.keys(t[CMS_ENV]).forEach(e=>{t[e]=t[CMS_ENV][e]}),t}function w(e){return{type:"CONFIG_SUCCESS",payload:e}}function x(){return{type:"CONFIG_REQUEST"}}function k(e){return{type:"CONFIG_FAILURE",error:"Error loading config",payload:e}}function E(e){return t=>{t(w(e))}}async function S(e){if(["localhost","127.0.0.1",...(null==e?void 0:e.allowed_hosts)||[]].includes(location.hostname)){let t;const n="http://localhost:8081/api/v1";!0===e?t=n:(0,r.default)(e)&&(t=e.url||n.replace("localhost",location.hostname));try{console.log(`Looking for Netlify CMS Proxy Server at '${t}'`);const{repo:e,publish_modes:n,type:r}=await fetch(""+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"info"})}).then(e=>e.json());if("string"==typeof e&&Array.isArray(n)&&"string"==typeof r)return console.log(`Detected Netlify CMS Proxy Server at '${t}' with repo: '${e}'`),{proxyUrl:t,publish_modes:n,type:r}}catch{console.log(`Netlify CMS Proxy Server not detected at '${t}'`)}}return{}}async function O(e){if(e.has("local_backend")){const{proxyUrl:t,publish_modes:n,type:r}=await S(e.toJS().local_backend);if(t&&(e=b(e,{backend:{name:"proxy",proxy_url:t}})).has("publish_mode")&&!n.includes(e.get("publish_mode"))){const t=n[0];console.log(`'${e.get("publish_mode")}' is not supported by '${r}' backend, switching to '${t}'`),e=b(e,{publish_mode:t})}}return e}},function(e,t,n){var r=n(120),i=n(102),o=n(448),a=n(44);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(155),i=n(253),o=n(455),a=n(254),s=n(109),l=/\s+$/;e.exports=function(e,t,n){if((e=s(e))&&(n||void 0===t))return e.replace(l,"");if(!e||!(t=r(t)))return e;var u=a(e),c=o(u,a(t))+1;return i(u,0,c).join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCollectionUrl=function(e,t){return h("/collections/"+e,t)},t.getNewEntryUrl=function(e,t){return h(`/collections/${e}/new`,t)},t.addParams=function(e,t){const n=s.default.parse(e,!0);return n.query=f(f({},n.query),t),s.default.format(n)},t.stripProtocol=function(e){const t=e.indexOf("//");return t>-1?e.slice(t+2):e},t.getCharReplacer=b,t.sanitizeURI=_,t.sanitizeChar=function(e,t){const n=t.get("encoding"),r=t.get("sanitize_replacement");return b(n,r)(e)},t.sanitizeSlug=function(e,t){if(!(0,a.default)(e))throw new Error("The input slug must be a string.");const n=t.get("encoding"),s=t.get("clean_accents"),c=t.get("sanitize_replacement"),d=(0,i.default)([...s?[l.default.remove]:[],(0,r.default)(_,{replacement:c,encoding:n}),(0,r.default)(u.default,{replacement:c})])(e),f=new RegExp(`(?:${(0,o.default)(c)})+`,"g"),p=new RegExp((0,o.default)(c)+"$"),h=new RegExp("^"+(0,o.default)(c));return d.replace(f,c).replace(h,"").replace(p,"")};var r=c(n(514)),i=c(n(124)),o=c(n(485)),a=c(n(353)),s=c(n(957)),l=c(n(963)),u=c(n(964));function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;tm.test(e),y=e=>m.test(e)||g.test(e);function b(e,t){let n;if("unicode"===e)n=y;else{if("ascii"!==e)throw new Error('`options.encoding` must be "unicode" or "ascii".');n=v}if(!Array.from(t).every(n))throw new Error("The replacement character(s) (options.replacement) is itself unsafe.");return e=>n(e)?e:t}function _(e,{replacement:t="",encoding:n="unicode"}={}){if(!(0,a.default)(e))throw new Error("The input slug must be a string.");if(!(0,a.default)(t))throw new Error("`options.replacement` must be a string.");return Array.from(e).map(b(n,t)).join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addAssets=function(e){return{type:"ADD_ASSETS",payload:e}},t.addAsset=l,t.removeAsset=function(e){return{type:"REMOVE_ASSET",payload:e}},t.loadAssetRequest=u,t.loadAssetSuccess=c,t.loadAssetFailure=d,t.loadAsset=f,t.boundGetAsset=function(e,t,n){return(r,i)=>e(h({collection:t,entry:n,path:r,field:i}))},t.getAsset=h,t.LOAD_ASSET_FAILURE=t.LOAD_ASSET_SUCCESS=t.LOAD_ASSET_REQUEST=t.REMOVE_ASSET=t.ADD_ASSET=t.ADD_ASSETS=void 0;var r=n(219),i=n(37),o=n(104),a=n(270),s=n(141);t.ADD_ASSETS="ADD_ASSETS";t.ADD_ASSET="ADD_ASSET";t.REMOVE_ASSET="REMOVE_ASSET";t.LOAD_ASSET_REQUEST="LOAD_ASSET_REQUEST";t.LOAD_ASSET_SUCCESS="LOAD_ASSET_SUCCESS";function l(e){return{type:"ADD_ASSET",payload:e}}function u(e){return{type:"LOAD_ASSET_REQUEST",payload:{path:e}}}function c(e){return{type:"LOAD_ASSET_SUCCESS",payload:{path:e}}}function d(e,t){return{type:"LOAD_ASSET_FAILURE",payload:{path:e,error:t}}}function f(e){return async(t,n)=>{try{t(u(e)),await(0,s.waitForMediaLibraryToLoad)(t,n());const i=(0,a.selectMediaFileByPath)(n(),e);if(i){const o=await(0,s.getMediaDisplayURL)(t,n(),i);t(l((0,r.createAssetProxy)({path:e,url:o||e})))}else{const{url:i}=await(0,s.getMediaFile)(n(),e);t(l((0,r.createAssetProxy)({path:e,url:i})))}t(c(e))}catch(n){t(d(e,n))}}}t.LOAD_ASSET_FAILURE="LOAD_ASSET_FAILURE";const p=(0,r.createAssetProxy)({path:"empty.svg",file:new File([''],"empty.svg",{type:"image/svg+xml"})});function h({collection:e,entry:t,path:n,field:a}){return(s,u)=>{if(!n)return p;const c=u(),d=(0,o.selectMediaFilePath)(c.config,e,t,n,a);let{asset:h,isLoading:m,error:g}=c.medias.get(d)||{};return m?p:h||((0,i.isAbsolutePath)(d)||g?(h=(0,r.createAssetProxy)({path:d,url:n}),s(l(h))):(s(f(d)),h=p),h)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringTemplate=t.NetlifyCmsLibWidgets=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n(970));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}t.stringTemplate=r;const o={stringTemplate:r};t.NetlifyCmsLibWidgets=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(18)),i=(s(n(1)),s(n(2))),o=s(n(1011)),a=n(11);function s(e){return e&&e.__esModule?e:{default:e}}const l=(0,r.default)("span",{target:"ei6fm2r0",label:"IconWrapper"})("display:inline-block;line-height:0;width:",e=>e.size,";height:",e=>e.size,";transform:",e=>`rotate(${e.rotation})`,";& path:not(.no-fill),& circle:not(.no-fill),& polygon:not(.no-fill),& rect:not(.no-fill){fill:currentColor;}& path.clipped{fill:transparent;}svg{width:100%;height:100%;}"),u=(e,t)=>{if(!e||!t)return"0deg";const n={right:90,down:180,left:270,up:360};return n[t]-n[e]+"deg"},c={xsmall:"12px",small:"18px",medium:"24px",large:"32px"},d=({type:e,direction:t,size:n="medium",className:r})=>{const i=o.default[e].image;return(0,a.jsx)(l,{className:r,size:c[n]||n,rotation:u(o.default[e].direction,t)},(0,a.jsx)(i,null))};d.propTypes={type:i.default.string.isRequired,direction:i.default.oneOf(["right","down","left","up"]),size:i.default.string,className:i.default.string};var f=(0,r.default)(d,{target:"ei6fm2r1"})("");t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INIT_COORDS="dnd-core/INIT_COORDS",t.BEGIN_DRAG="dnd-core/BEGIN_DRAG",t.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",t.HOVER="dnd-core/HOVER",t.DROP="dnd-core/DROP",t.END_DRAG="dnd-core/END_DRAG"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e},t.noop=function(){},t.isPlainObject=function(e){if(!function(e){return"object"==typeof e&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},function(e,t,n){var r=n(137),i=n(222),o=n(267),a=n(223),s=r((function(e,t){var n=a(t,o(s));return i(e,32,void 0,t,n)}));s.placeholder={},e.exports=s},function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t,n){"use strict";function r(e){if("string"==typeof e)return function(e){return function(t){return Boolean(t&&t.type===e)}}(e);if(null==e)return a;if("object"==typeof e)return("length"in e?o:i)(e);if("function"==typeof e)return e;throw new Error("Expected function, string, or object as test")}function i(e){return function(t){var n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function o(e){var t=function(e){for(var t=[],n=e.length,i=-1;++ithis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},r.prototype.getHeight=function(){return this.maxY-this.minY+1},r.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},r.prototype.getWidth=function(){return this.maxX-this.minX+1},r.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},t.b=r},function(e,t,n){"use strict";var r=n(27),i=n(9),o=n(14),a=n(35),s=function(e){function t(t){if(e.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,Object(i.a)(this,Object(a.b)(this.geometryName_),this.handleGeometryChanged_,this),t)if("function"==typeof t.getSimplifiedGeometry){var n=t;this.setGeometry(n)}else{var r=t;this.setProperties(r)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){var e=new t(this.getProperties());e.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&e.setGeometry(n.clone());var r=this.getStyle();return r&&e.setStyle(r),e},t.prototype.getGeometry=function(){return this.get(this.geometryName_)},t.prototype.getId=function(){return this.id_},t.prototype.getGeometryName=function(){return this.geometryName_},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.handleGeometryChange_=function(){this.changed()},t.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Object(i.e)(this.geometryChangeKey_),this.geometryChangeKey_=null);var e=this.getGeometry();e&&(this.geometryChangeKey_=Object(i.a)(e,o.a.CHANGE,this.handleGeometryChange_,this)),this.changed()},t.prototype.setGeometry=function(e){this.set(this.geometryName_,e)},t.prototype.setStyle=function(e){this.style_=e,this.styleFunction_=e?function(e){if("function"==typeof e)return e;var t;Array.isArray(e)?t=e:(Object(r.a)("function"==typeof e.getZIndex,41),t=[e]);return function(){return t}}(e):void 0,this.changed()},t.prototype.setId=function(e){this.id_=e,this.changed()},t.prototype.setGeometryName=function(e){Object(i.c)(this,Object(a.b)(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=e,Object(i.a)(this,Object(a.b)(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},t}(a.a);t.a=s},function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}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,s,l=a(e),u=1;u-1&&e%1==0&&e=t)throw new Error("Cannot access property/index "+r+" levels up, current level is "+t);return n[t-r]}if(r>t)throw new Error("Cannot access data "+r+" levels up, current level is "+t);if(o="data"+(t-r||""),!i)return o}for(var s=o,u=i.split("/"),c=0;c=2&&("function"==typeof arguments[1]?n.task=arguments[1]:n.n=arguments[1]);var r=n.task;if(n.task=function(){r(t.leave)},t.current+n.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(n);t.current+=n.n-e,n.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var n=t.queue[0];n.n+t.current>t.capacity||(t.queue.shift(),t.current+=n.n,r(n.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()}).call(this,n(70))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DragSource",{enumerable:!0,get:function(){return r.DragSource}}),Object.defineProperty(t,"DropTarget",{enumerable:!0,get:function(){return r.DropTarget}}),Object.defineProperty(t,"HTML5DragDrop",{enumerable:!0,get:function(){return r.HTML5DragDrop}}),Object.defineProperty(t,"ErrorBoundary",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"FileUploadButton",{enumerable:!0,get:function(){return o.FileUploadButton}}),Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return a.Modal}}),Object.defineProperty(t,"Toast",{enumerable:!0,get:function(){return s.default}});var r=n(1023),i=l(n(1075)),o=n(1083),a=n(1084),s=l(n(1093));function l(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e,t,n){return t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e)},t.without=function(e,t){return e.filter((function(e){return e!==t}))},t.isString=function(e){return"string"==typeof e},t.isObject=function(e){return"object"==typeof e},t.xor=function(e,t){var n=new Map,r=function(e){return n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var i=[];return n.forEach((function(e,t){1===e&&i.push(t)})),i},t.intersection=function(e,t){return e.filter((function(e){return t.indexOf(e)>-1}))}},function(e,t,n){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}},function(e,t,n){"use strict";e.exports=function(e,t){var n=[],i=-1,o=e.length;t&&n.push(r("text","\n"));for(;++i!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,n){return r=e,i=n,t}function m(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(s&&"@"==e.peek()&&e.match(p))return t.tokenize=m,h("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=m),h("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return h("number","number");if("."==r&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return h(r);if("="==r&&e.eat(">"))return h("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return h("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),h("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),h("comment","comment")):Ge(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),h("regexp","string-2")):(e.eat("="),h("operator","operator",e.current()));if("`"==r)return t.tokenize=v,v(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),h("meta","meta");if("#"==r&&e.eatWhile(c))return h("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),h("comment","comment");if(f.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?h("."):h("operator","operator",e.current());if(c.test(r)){e.eatWhile(c);var i=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return h(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return h("async","keyword",i)}return h("variable","variable",i)}}function g(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return h("comment","comment")}function v(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return h("quasi","string-2",e.current())}function y(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(c.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function _(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function w(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var x={state:null,column:null,marked:null,cc:null};function k(){for(var e=arguments.length-1;e>=0;e--)x.cc.push(arguments[e])}function E(){return k.apply(null,arguments),!0}function S(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function O(e){var t=x.state;if(x.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new C(r,n.vars,!0):null}return S(t,n.vars)?n:new C(n.prev,new A(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!S(e,t.localVars))return void(t.localVars=new A(e,t.localVars));n.globalVars&&!S(e,t.globalVars)&&(t.globalVars=new A(e,t.globalVars))}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function C(e,t,n){this.prev=e,this.vars=t,this.block=n}function A(e,t){this.name=e,this.next=t}var P=new A("this",new A("arguments",null));function R(){x.state.context=new C(x.state.context,x.state.localVars,!1),x.state.localVars=P}function M(){x.state.context=new C(x.state.context,x.state.localVars,!0),x.state.localVars=null}function I(){x.state.localVars=x.state.context.vars,x.state.context=x.state.context.prev}function j(e,t){var n=function(){var n=x.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new _(r,x.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function D(){var e=x.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function L(e){return function t(n){return n==e?E():";"==e||"}"==n||")"==n||"]"==n?k():E(t)}}function N(e,t){return"var"==e?E(j("vardef",t),ye,L(";"),D):"keyword a"==e?E(j("form"),U,N,D):"keyword b"==e?E(j("form"),N,D):"keyword d"==e?x.stream.match(/^\s*$/,!1)?E():E(j("stat"),H,L(";"),D):"debugger"==e?E(L(";")):"{"==e?E(j("}"),M,oe,D,I):";"==e?E():"if"==e?("else"==x.state.lexical.info&&x.state.cc[x.state.cc.length-1]==D&&x.state.cc.pop()(),E(j("form"),U,N,D,Ee)):"function"==e?E(Ce):"for"==e?E(j("form"),Se,N,D):"class"==e||u&&"interface"==t?(x.marked="keyword",E(j("form","class"==e?e:t),Ie,D)):"variable"==e?u&&"declare"==t?(x.marked="keyword",E(N)):u&&("module"==t||"enum"==t||"type"==t)&&x.stream.match(/^\s*\w/,!1)?(x.marked="keyword","enum"==t?E(Ve):"type"==t?E(Pe,L("operator"),ce,L(";")):E(j("form"),be,L("{"),j("}"),oe,D,D)):u&&"namespace"==t?(x.marked="keyword",E(j("form"),B,N,D)):u&&"abstract"==t?(x.marked="keyword",E(N)):E(j("stat"),J):"switch"==e?E(j("form"),U,L("{"),j("}","switch"),M,oe,D,D,I):"case"==e?E(B,L(":")):"default"==e?E(L(":")):"catch"==e?E(j("form"),R,F,N,D,I):"export"==e?E(j("stat"),Ne,D):"import"==e?E(j("stat"),Be,D):"async"==e?E(N):"@"==t?E(B,N):k(j("stat"),B,L(";"),D)}function F(e){if("("==e)return E(Re,L(")"))}function B(e,t){return q(e,t,!1)}function z(e,t){return q(e,t,!0)}function U(e){return"("!=e?k():E(j(")"),H,L(")"),D)}function q(e,t,n){if(x.state.fatArrowAt==x.stream.start){var r=n?Y:K;if("("==e)return E(R,j(")"),re(Re,")"),D,L("=>"),r,I);if("variable"==e)return k(R,be,L("=>"),r,I)}var i=n?V:W;return b.hasOwnProperty(e)?E(i):"function"==e?E(Ce,i):"class"==e||u&&"interface"==t?(x.marked="keyword",E(j("form"),Me,D)):"keyword c"==e||"async"==e?E(n?z:B):"("==e?E(j(")"),H,L(")"),D,i):"operator"==e||"spread"==e?E(n?z:B):"["==e?E(j("]"),We,D,i):"{"==e?ie(ee,"}",null,i):"quasi"==e?k($,i):"new"==e?E(function(e){return function(t){return"."==t?E(e?X:Q):"variable"==t&&u?E(me,e?V:W):k(e?z:B)}}(n)):"import"==e?E(B):E()}function H(e){return e.match(/[;\}\)\],]/)?k():k(B)}function W(e,t){return","==e?E(H):V(e,t,!1)}function V(e,t,n){var r=0==n?W:V,i=0==n?B:z;return"=>"==e?E(R,n?Y:K,I):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?E(r):u&&"<"==t&&x.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(j(">"),re(ce,">"),D,r):"?"==t?E(B,L(":"),i):E(i):"quasi"==e?k($,r):";"!=e?"("==e?ie(z,")","call",r):"."==e?E(Z,r):"["==e?E(j("]"),H,L("]"),D,r):u&&"as"==t?(x.marked="keyword",E(ce,r)):"regexp"==e?(x.state.lastType=x.marked="operator",x.stream.backUp(x.stream.pos-x.stream.start-1),E(i)):void 0:void 0}function $(e,t){return"quasi"!=e?k():"${"!=t.slice(t.length-2)?E($):E(B,G)}function G(e){if("}"==e)return x.marked="string-2",x.state.tokenize=v,E($)}function K(e){return y(x.stream,x.state),k("{"==e?N:B)}function Y(e){return y(x.stream,x.state),k("{"==e?N:z)}function Q(e,t){if("target"==t)return x.marked="keyword",E(W)}function X(e,t){if("target"==t)return x.marked="keyword",E(V)}function J(e){return":"==e?E(D,N):k(W,L(";"),D)}function Z(e){if("variable"==e)return x.marked="property",E()}function ee(e,t){return"async"==e?(x.marked="property",E(ee)):"variable"==e||"keyword"==x.style?(x.marked="property","get"==t||"set"==t?E(te):(u&&x.state.fatArrowAt==x.stream.start&&(n=x.stream.match(/^\s*:\s*/,!1))&&(x.state.fatArrowAt=x.stream.pos+n[0].length),E(ne))):"number"==e||"string"==e?(x.marked=s?"property":x.style+" property",E(ne)):"jsonld-keyword"==e?E(ne):u&&T(t)?(x.marked="keyword",E(ee)):"["==e?E(B,ae,L("]"),ne):"spread"==e?E(z,ne):"*"==t?(x.marked="keyword",E(ee)):":"==e?k(ne):void 0;var n}function te(e){return"variable"!=e?k(ne):(x.marked="property",E(Ce))}function ne(e){return":"==e?E(z):"("==e?k(Ce):void 0}function re(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=x.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E((function(n,r){return n==t||r==t?k():k(e)}),r)}return i==t||o==t?E():n&&n.indexOf(";")>-1?k(e):E(L(t))}return function(n,i){return n==t||i==t?E():k(e,r)}}function ie(e,t,n){for(var r=3;r"),ce):void 0}function de(e){if("=>"==e)return E(ce)}function fe(e,t){return"variable"==e||"keyword"==x.style?(x.marked="property",E(fe)):"?"==t||"number"==e||"string"==e?E(fe):":"==e?E(ce):"["==e?E(L("variable"),se,L("]"),fe):"("==e?k(Ae,fe):void 0}function pe(e,t){return"variable"==e&&x.stream.match(/^\s*[?:]/,!1)||"?"==t?E(pe):":"==e?E(ce):"spread"==e?E(pe):k(ce)}function he(e,t){return"<"==t?E(j(">"),re(ce,">"),D,he):"|"==t||"."==e||"&"==t?E(ce):"["==e?E(ce,L("]"),he):"extends"==t||"implements"==t?(x.marked="keyword",E(ce)):"?"==t?E(ce,L(":"),ce):void 0}function me(e,t){if("<"==t)return E(j(">"),re(ce,">"),D,he)}function ge(){return k(ce,ve)}function ve(e,t){if("="==t)return E(ce)}function ye(e,t){return"enum"==t?(x.marked="keyword",E(Ve)):k(be,ae,xe,ke)}function be(e,t){return u&&T(t)?(x.marked="keyword",E(be)):"variable"==e?(O(t),E()):"spread"==e?E(be):"["==e?ie(we,"]"):"{"==e?ie(_e,"}"):void 0}function _e(e,t){return"variable"!=e||x.stream.match(/^\s*:/,!1)?("variable"==e&&(x.marked="property"),"spread"==e?E(be):"}"==e?k():"["==e?E(B,L("]"),L(":"),_e):E(L(":"),be,xe)):(O(t),E(xe))}function we(){return k(be,xe)}function xe(e,t){if("="==t)return E(z)}function ke(e){if(","==e)return E(ye)}function Ee(e,t){if("keyword b"==e&&"else"==t)return E(j("form","else"),N,D)}function Se(e,t){return"await"==t?E(Se):"("==e?E(j(")"),Oe,D):void 0}function Oe(e){return"var"==e?E(ye,Te):"variable"==e?E(Te):k(Te)}function Te(e,t){return")"==e?E():";"==e?E(Te):"in"==t||"of"==t?(x.marked="keyword",E(B,Te)):k(B,Te)}function Ce(e,t){return"*"==t?(x.marked="keyword",E(Ce)):"variable"==e?(O(t),E(Ce)):"("==e?E(R,j(")"),re(Re,")"),D,le,N,I):u&&"<"==t?E(j(">"),re(ge,">"),D,Ce):void 0}function Ae(e,t){return"*"==t?(x.marked="keyword",E(Ae)):"variable"==e?(O(t),E(Ae)):"("==e?E(R,j(")"),re(Re,")"),D,le,I):u&&"<"==t?E(j(">"),re(ge,">"),D,Ae):void 0}function Pe(e,t){return"keyword"==e||"variable"==e?(x.marked="type",E(Pe)):"<"==t?E(j(">"),re(ge,">"),D):void 0}function Re(e,t){return"@"==t&&E(B,Re),"spread"==e?E(Re):u&&T(t)?(x.marked="keyword",E(Re)):u&&"this"==e?E(ae,xe):k(be,ae,xe)}function Me(e,t){return"variable"==e?Ie(e,t):je(e,t)}function Ie(e,t){if("variable"==e)return O(t),E(je)}function je(e,t){return"<"==t?E(j(">"),re(ge,">"),D,je):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(x.marked="keyword"),E(u?ce:B,je)):"{"==e?E(j("}"),De,D):void 0}function De(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&T(t))&&x.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(x.marked="keyword",E(De)):"variable"==e||"keyword"==x.style?(x.marked="property",E(Le,De)):"number"==e||"string"==e?E(Le,De):"["==e?E(B,ae,L("]"),Le,De):"*"==t?(x.marked="keyword",E(De)):u&&"("==e?k(Ae,De):";"==e||","==e?E(De):"}"==e?E():"@"==t?E(B,De):void 0}function Le(e,t){if("?"==t)return E(Le);if(":"==e)return E(ce,xe);if("="==t)return E(z);var n=x.state.lexical.prev;return k(n&&"interface"==n.info?Ae:Ce)}function Ne(e,t){return"*"==t?(x.marked="keyword",E(He,L(";"))):"default"==t?(x.marked="keyword",E(B,L(";"))):"{"==e?E(re(Fe,"}"),He,L(";")):k(N)}function Fe(e,t){return"as"==t?(x.marked="keyword",E(L("variable"))):"variable"==e?k(z,Fe):void 0}function Be(e){return"string"==e?E():"("==e?k(B):k(ze,Ue,He)}function ze(e,t){return"{"==e?ie(ze,"}"):("variable"==e&&O(t),"*"==t&&(x.marked="keyword"),E(qe))}function Ue(e){if(","==e)return E(ze,Ue)}function qe(e,t){if("as"==t)return x.marked="keyword",E(ze)}function He(e,t){if("from"==t)return x.marked="keyword",E(B)}function We(e){return"]"==e?E():k(re(z,"]"))}function Ve(){return k(j("form"),be,L("{"),j("}"),re($e,"}"),D,D)}function $e(){return k(be,xe)}function Ge(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return I.lex=!0,D.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new _((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new C(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),y(e,t)),t.tokenize!=g&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function(e,t,n,r,i){var o=e.cc;for(x.state=e,x.stream=i,x.marked=null,x.cc=o,x.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?B:N)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return x.marked?x.marked:"variable"==n&&w(e,r)?"variable-2":t}}(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==g)return e.Pass;if(t.tokenize!=m)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==D)l=l.prev;else if(c!=Ee)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==W||i==V)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,p=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+o:"stat"==d?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||o:0):"switch"!=l.info||p||0==n.doubleIndentSwitch?l.align?l.column+(p?0:1):l.indented+(p?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Ge,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=B&&t!=z||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(5))},function(e,t,n){!function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((!1===t?"":"^")+"(?:"+e+")",n)}function r(e,r){(e.next||e.push)&&t(r,e.next||e.push),this.regex=n(e.regex),this.token=function(e){if(!e)return null;if(e.apply)return e;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n2&&c.token&&"string"!=typeof c.token){r.pending=[];for(var p=2;p-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var l=0;l=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,t,n,i,o){for(var a,s=[t,n];s.length;)(n=s.pop())-(t=s.pop())<=i||(a=t+Math.ceil((n-t)/i/2)*i,r(e,a,t,n,o),s.push(t,a,a,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,n=[],r=this.toBBox;if(!h(e,t))return n;for(var i,o,a,s,l=[];t;){for(i=0,o=t.children.length;i=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(i,o,t)},_split:function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,n){var r,i,o,a,l,u,c,f,p,h,m,g,v,y;for(u=c=1/0,r=t;r<=n-t;r++)i=s(e,0,r,this.toBBox),o=s(e,r,n,this.toBBox),p=i,h=o,m=void 0,g=void 0,v=void 0,y=void 0,m=Math.max(p.minX,h.minX),g=Math.max(p.minY,h.minY),v=Math.min(p.maxX,h.maxX),y=Math.min(p.maxY,h.maxY),a=Math.max(0,v-m)*Math.max(0,y-g),l=d(i)+d(o),a=t;i--)o=e.children[i],l(c,e.leaf?a(o):o),d+=f(c);return d},_adjustParentBBoxes:function(e,t,n){for(var r=n;r>=0;r--)l(t[r],e)},_condense:function(e){for(var t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children).splice(t.indexOf(e[n]),1):this.clear():a(e[n],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},function(e,t,n){"use strict";var r=n(26),i=n(3),o=n(10),a=n(114),s=n(62),l=n(72),u=n(73),c=n(15),d=function(e){function t(t,n){e.call(this),n&&!Array.isArray(t[0])?this.setFlatCoordinates(n,t):this.setCoordinates(t,n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.appendPoint=function(e){this.flatCoordinates?Object(r.c)(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()},t.prototype.clone=function(){return new t(this.flatCoordinates.slice(),this.layout)},t.prototype.closestPointXY=function(e,t,n,r){if(r>1;o{const n=t(),r=(0,i.currentBackend)(n.config);return e(s()),r.currentUser().then(t=>{t?(t.useOpenAuthoring&&e(d()),e(l(t))):e(c())}).catch(t=>{e(u(t)),e(p())})}},t.loginUser=function(e){return(t,n)=>{const r=n(),a=(0,i.currentBackend)(r.config);return t(s()),a.authenticate(e).then(e=>{e.useOpenAuthoring&&t(d()),t(l(e))}).catch(e=>{console.error(e),t(o({message:{details:e.message,key:"ui.toast.onFailToAuth"},kind:"warning",dismissAfter:8e3})),t(u(e))})}},t.logoutUser=p,t.LOGOUT=t.USE_OPEN_AUTHORING=t.AUTH_REQUEST_DONE=t.AUTH_FAILURE=t.AUTH_SUCCESS=t.AUTH_REQUEST=void 0;var r=n(133),i=n(119);const{notifSend:o,notifClear:a}=r.actions;t.AUTH_REQUEST="AUTH_REQUEST";t.AUTH_SUCCESS="AUTH_SUCCESS";t.AUTH_FAILURE="AUTH_FAILURE";t.AUTH_REQUEST_DONE="AUTH_REQUEST_DONE";t.USE_OPEN_AUTHORING="USE_OPEN_AUTHORING";function s(){return{type:"AUTH_REQUEST"}}function l(e){return{type:"AUTH_SUCCESS",payload:e}}function u(e){return{type:"AUTH_FAILURE",error:"Failed to authenticate",payload:e}}function c(){return{type:"AUTH_REQUEST_DONE"}}function d(){return{type:"USE_OPEN_AUTHORING"}}function f(){return{type:"LOGOUT"}}function p(){return(e,t)=>{const n=t(),r=(0,i.currentBackend)(n.config);Promise.resolve(r.logout()).then(()=>{e({type:"LOGOUT"}),e(a())})}}t.LOGOUT="LOGOUT"},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(154),i=n(134);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},function(e,t,n){var r=n(245),i=n(738);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},function(e,t,n){var r=n(739),i=n(69),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},function(e,t,n){(function(e){var r=n(75),i=n(755),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l}).call(this,n(135)(e))},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++re.blob());if(e.size<=0)return"";return await new Promise(t=>{const n=new FileReader;n.onload=e=>{var n;const r=(null===(n=e.target)||void 0===n?void 0:n.result)||"";t(r.toString().split("base64,")[1])},n.readAsDataURL(e)})}}t.default=i},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(187);e.exports=new r({include:[n(473)],implicit:[n(820),n(821)],explicit:[n(822),n(823),n(824),n(825)]})},function(e,t,n){var r=n(496),i=n(911),o=n(912),a=n(497),s=n(918),l=n(349),u=n(919),c=n(501),d=n(502),f=n(110),p=Math.max;e.exports=function(e,t,n,h,m,g,v,y){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var _=h?h.length:0;if(_||(t&=-97,h=m=void 0),v=void 0===v?v:p(f(v),0),y=void 0===y?y:f(y),_-=m?m.length:0,64&t){var w=h,x=m;h=m=void 0}var k=b?void 0:l(e),E=[e,t,n,h,m,w,x,g,v,y];if(k&&u(E,k),e=E[0],t=E[1],n=E[2],h=E[3],m=E[4],!(y=E[9]=void 0===E[9]?b?0:e.length:p(E[9]-_,0))&&24&t&&(t&=-25),t&&1!=t)S=8==t||16==t?o(e,t,y):32!=t&&33!=t||m.length?a.apply(void 0,E):s(e,t,n,h);else var S=i(e,t,n);return d((k?r:c)(S,E),e,t)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n{const a=o(),s=a.entryDraft,d=s.get("fieldsErrors"),p=(0,c.selectUnpublishedSlugs)(a,e.get("name")),h=(0,c.selectPublishedSlugs)(a,e.get("name")).concat(p);if(!(0,r.default)(a.editorialWorkflow.toJS(),"pages.ids",!1)&&n(C(a.collections)),!d.isEmpty()){return d.some(e=>e.some(e=>e.type&&e.type===b.default.PRESENCE))&&n(x({message:{key:"ui.toast.missingRequiredField"},kind:"danger",dismissAfter:8e3})),Promise.reject()}const g=(0,u.currentBackend)(a.config),v=(0,i.default)(),y=s.get("entry"),w=(0,m.getMediaAssets)({entry:y}),k=(0,f.selectFields)(e,y.get("slug")),A=(0,l.serializeValues)(y.get("data"),k),P=y.set("data",A),R=s.set("entry",P);n(E(e,P,v));const M=t?g.persistUnpublishedEntry:g.persistEntry;try{const t=await M.call(g,{config:a.config,collection:e,entryDraft:R,assetProxies:w,usedSlugs:h});n(x({message:{key:"ui.toast.entrySaved"},kind:"success",dismissAfter:4e3})),n(S(e,v,t)),y.get("slug")!==t&&(n(T(e,t)),(0,_.navigateToEntry)(e.get("name"),t))}catch(e){return n(x({message:{key:"ui.toast.onFailToPersist",details:e},kind:"danger",dismissAfter:8e3})),Promise.reject(n(O(e,v)))}}},t.updateUnpublishedEntryStatus=function(e,t,n,r){return(o,s)=>{if(n===r)return;const l=s(),c=(0,u.currentBackend)(l.config),d=(0,i.default)();o(function(e,t,n,r,i){return{type:"UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",payload:{collection:e,slug:t,oldStatus:n,newStatus:r},optimist:{type:a.BEGIN,id:i}}}(e,t,n,r,d)),c.updateUnpublishedEntryStatus(e,t,r).then(()=>{o(x({message:{key:"ui.toast.entryUpdated"},kind:"success",dismissAfter:4e3})),o(function(e,t,n,r,i){return{type:"UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",payload:{collection:e,slug:t,oldStatus:n,newStatus:r},optimist:{type:a.COMMIT,id:i}}}(e,t,n,r,d))}).catch(n=>{o(x({message:{key:"ui.toast.onFailToUpdateStatus",details:n},kind:"danger",dismissAfter:8e3})),o(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",payload:{collection:e,slug:t},optimist:{type:a.REVERT,id:n}}}(e,t,d))})}},t.deleteUnpublishedEntry=function(e,t){return(n,r)=>{const o=r(),s=(0,u.currentBackend)(o.config),l=(0,i.default)();return n(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t},optimist:{type:a.BEGIN,id:n}}}(e,t,l)),s.deleteUnpublishedEntry(e,t).then(()=>{n(x({message:{key:"ui.toast.onDeleteUnpublishedChanges"},kind:"success",dismissAfter:4e3})),n(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_DELETE_SUCCESS",payload:{collection:e,slug:t},optimist:{type:a.COMMIT,id:n}}}(e,t,l))}).catch(r=>{n(x({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:r},kind:"danger",dismissAfter:8e3})),n(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t},optimist:{type:a.REVERT,id:n}}}(e,t,l))})}},t.publishUnpublishedEntry=function(e,t){return async(n,r)=>{const o=r(),s=o.collections,l=(0,u.currentBackend)(o.config),f=(0,i.default)(),p=(0,c.selectUnpublishedEntry)(o,e,t);n(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_PUBLISH_REQUEST",payload:{collection:e,slug:t},optimist:{type:a.BEGIN,id:n}}}(e,t,f));try{await l.publishUnpublishedEntry(p),n((0,y.loadMedia)()),n(x({message:{key:"ui.toast.entryPublished"},kind:"success",dismissAfter:4e3})),n(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",payload:{collection:e,slug:t},optimist:{type:a.COMMIT,id:n}}}(e,t,f));const r=s.get(e);if(!r.has("nested"))return n((0,m.loadEntry)(r,t));{n((0,m.loadEntries)(r));const e=(0,u.slugFromCustomPath)(r,p.get("path"));(0,m.loadEntry)(r,e),t!==e&&(0,d.selectEditingDraft)(o.entryDraft)&&(0,_.navigateToEntry)(r.get("name"),e)}}catch(r){n(x({message:{key:"ui.toast.onFailToPublishEntry",details:r},kind:"danger",dismissAfter:8e3})),n(function(e,t,n){return{type:"UNPUBLISHED_ENTRY_PUBLISH_FAILURE",payload:{collection:e,slug:t},optimist:{type:a.REVERT,id:n}}}(e,t,f))}}},t.unpublishPublishedEntry=function(e,t){return(n,r)=>{const o=r(),a=(0,u.currentBackend)(o.config),l=(0,i.default)(),d=(0,c.selectEntry)(o,e.get("name"),t),f=(0,s.Map)().set("entry",d);return n(E(e,d,l)),a.deleteEntry(o,e,t).then(()=>a.persistEntry({config:o.config,collection:e,entryDraft:f,assetProxies:[],usedSlugs:(0,s.List)(),status:p.status.get("PENDING_PUBLISH")})).then(()=>{n(S(e,l,t)),n((0,m.entryDeleted)(e,t)),n(T(e,t)),n(x({message:{key:"ui.toast.entryUnpublished"},kind:"success",dismissAfter:4e3}))}).catch(e=>{n(x({message:{key:"ui.toast.onFailToUnpublishEntry",details:e},kind:"danger",dismissAfter:8e3})),n(O(e,l))})}},t.UNPUBLISHED_ENTRY_DELETE_FAILURE=t.UNPUBLISHED_ENTRY_DELETE_SUCCESS=t.UNPUBLISHED_ENTRY_DELETE_REQUEST=t.UNPUBLISHED_ENTRY_PUBLISH_FAILURE=t.UNPUBLISHED_ENTRY_PUBLISH_SUCCESS=t.UNPUBLISHED_ENTRY_PUBLISH_REQUEST=t.UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE=t.UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS=t.UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST=t.UNPUBLISHED_ENTRY_PERSIST_FAILURE=t.UNPUBLISHED_ENTRY_PERSIST_SUCCESS=t.UNPUBLISHED_ENTRY_PERSIST_REQUEST=t.UNPUBLISHED_ENTRIES_FAILURE=t.UNPUBLISHED_ENTRIES_SUCCESS=t.UNPUBLISHED_ENTRIES_REQUEST=t.UNPUBLISHED_ENTRY_REDIRECT=t.UNPUBLISHED_ENTRY_SUCCESS=t.UNPUBLISHED_ENTRY_REQUEST=void 0;var r=w(n(82)),i=w(n(140)),o=n(133),a=n(425),s=n(4),l=n(490),u=n(119),c=n(100),d=n(104),f=n(67),p=n(103),h=n(37),m=n(123),g=n(219),v=n(165),y=n(141),b=w(n(359)),_=n(152);function w(e){return e&&e.__esModule?e:{default:e}}const{notifSend:x}=o.actions;t.UNPUBLISHED_ENTRY_REQUEST="UNPUBLISHED_ENTRY_REQUEST";t.UNPUBLISHED_ENTRY_SUCCESS="UNPUBLISHED_ENTRY_SUCCESS";t.UNPUBLISHED_ENTRY_REDIRECT="UNPUBLISHED_ENTRY_REDIRECT";t.UNPUBLISHED_ENTRIES_REQUEST="UNPUBLISHED_ENTRIES_REQUEST";t.UNPUBLISHED_ENTRIES_SUCCESS="UNPUBLISHED_ENTRIES_SUCCESS";t.UNPUBLISHED_ENTRIES_FAILURE="UNPUBLISHED_ENTRIES_FAILURE";t.UNPUBLISHED_ENTRY_PERSIST_REQUEST="UNPUBLISHED_ENTRY_PERSIST_REQUEST";t.UNPUBLISHED_ENTRY_PERSIST_SUCCESS="UNPUBLISHED_ENTRY_PERSIST_SUCCESS";t.UNPUBLISHED_ENTRY_PERSIST_FAILURE="UNPUBLISHED_ENTRY_PERSIST_FAILURE";t.UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST";t.UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS";t.UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE";t.UNPUBLISHED_ENTRY_PUBLISH_REQUEST="UNPUBLISHED_ENTRY_PUBLISH_REQUEST";t.UNPUBLISHED_ENTRY_PUBLISH_SUCCESS="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS";t.UNPUBLISHED_ENTRY_PUBLISH_FAILURE="UNPUBLISHED_ENTRY_PUBLISH_FAILURE";t.UNPUBLISHED_ENTRY_DELETE_REQUEST="UNPUBLISHED_ENTRY_DELETE_REQUEST";t.UNPUBLISHED_ENTRY_DELETE_SUCCESS="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function k(e,t){return{type:"UNPUBLISHED_ENTRIES_SUCCESS",payload:{entries:e,pages:t}}}function E(e,t,n){return{type:"UNPUBLISHED_ENTRY_PERSIST_REQUEST",payload:{collection:e.get("name"),entry:t},optimist:{type:a.BEGIN,id:n}}}function S(e,t,n){return{type:"UNPUBLISHED_ENTRY_PERSIST_SUCCESS",payload:{collection:e.get("name"),slug:n},optimist:{type:a.COMMIT,id:t}}}function O(e,t){return{type:"UNPUBLISHED_ENTRY_PERSIST_FAILURE",payload:{error:e},optimist:{type:a.REVERT,id:t},error:e}}function T(e,t){return async(n,i)=>{const o=i(),a=(0,u.currentBackend)(o.config);if(!(0,r.default)(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await a.unpublishedEntries(o.collections);n(k(e,t))}catch(e){}n(function(e,t){return{type:"UNPUBLISHED_ENTRY_REQUEST",payload:{collection:e.get("name"),slug:t}}}(e,t));try{const r=await a.unpublishedEntry(o,e,t),i=await Promise.all(r.mediaFiles.filter(e=>e.draft).map(({url:e,file:t,path:n})=>(0,g.createAssetProxy)({path:n,url:e,file:t})));n((0,v.addAssets)(i)),n(function(e,t){return{type:"UNPUBLISHED_ENTRY_SUCCESS",payload:{collection:e.get("name"),entry:t}}}(e,r)),n((0,m.createDraftFromEntry)(r))}catch(r){r.name===h.EDITORIAL_WORKFLOW_ERROR&&r.notUnderEditorialWorkflow?(n(function(e,t){return{type:"UNPUBLISHED_ENTRY_REDIRECT",payload:{collection:e.get("name"),slug:t}}}(e,t)),n((0,m.loadEntry)(e,t))):n(x({message:{key:"ui.toast.onFailToLoadEntries",details:r},kind:"danger",dismissAfter:8e3}))}}}function C(e){return(t,n)=>{const i=n(),o=(0,u.currentBackend)(i.config),a=(0,r.default)(i.editorialWorkflow.toJS(),"pages.ids",!1);i.config.get("publish_mode")!==p.EDITORIAL_WORKFLOW||a||(t({type:"UNPUBLISHED_ENTRIES_REQUEST"}),o.unpublishedEntries(e).then(e=>t(k(e.entries,e.pagination))).catch(e=>{t(x({message:{key:"ui.toast.onFailToLoadEntries",details:e},kind:"danger",dismissAfter:8e3})),t(function(e){return{type:"UNPUBLISHED_ENTRIES_FAILURE",error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)}))}}t.UNPUBLISHED_ENTRY_DELETE_FAILURE="UNPUBLISHED_ENTRY_DELETE_FAILURE"},function(e,t,n){"use strict";e.exports=function(e,t,n){for(var r in n=n||{},t)t.hasOwnProperty(r)&&(n[r]||(e[r]=t[r]))}},function(e,t){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l=t||n<0||g&&e-h>=c}function w(){var e=i();if(_(e))return x(e);f=setTimeout(w,function(e){var n=t-(e-p);return g?s(n,c-(e-h)):n}(e))}function x(e){return f=void 0,v&&l?y(e):(l=u=void 0,d)}function k(){var e=i(),n=_(e);if(l=arguments,u=this,p=e,n){if(void 0===f)return b(p);if(g)return clearTimeout(f),f=setTimeout(w,t),y(p)}return void 0===f&&(f=setTimeout(w,t)),d}return t=o(t)||0,r(n)&&(m=!!n.leading,c=(g="maxWait"in n)?a(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,l=p=u=f=void 0},k.flush=function(){return void 0===f?d:x(i())},k}},function(e,t,n){"use strict";e.exports=function(e,t){if(null==t)return"";if(e.frozenBaseUrl&&"undefined"!=typeof URL)return String(new URL(t,e.frozenBaseUrl));return t}},function(e,t,n){!function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?w(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?w(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=E),w("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0}function k(e){return function(t,n){for(var r,i=!1;null!=(r=t.next());){if(r==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==r}return(r==e||!i&&")"!=e)&&(n.tokenize=null),w("string","string")}}function E(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=k(")"),w(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function O(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:a),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function C(e,t,n){return R[n.context.type](e,t,n)}function A(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return C(e,t,n)}function P(e){var t=e.current().toLowerCase();o=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var R={top:function(e,t,n){if("{"==e)return O(n,t,"block");if("}"==e&&n.context.prev)return T(n);if(_&&/@component/i.test(e))return O(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return O(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return O(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return O(n,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return O(n,t,"interpolation");if(":"==e)return"pseudo";if(y&&"("==e)return O(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return f.hasOwnProperty(r)?(o="property","maybeprop"):p.hasOwnProperty(r)?(o="string-2","maybeprop"):y?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?R.top(e,t,n):(o="error","block")},maybeprop:function(e,t,n){return":"==e?O(n,t,"prop"):C(e,t,n)},prop:function(e,t,n){if(";"==e)return T(n);if("{"==e&&y)return O(n,t,"propBlock");if("}"==e||"{"==e)return A(e,t,n);if("("==e)return O(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)P(t);else if("interpolation"==e)return O(n,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?T(n):"word"==e?(o="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?A(e,t,n):")"==e?T(n):"("==e?O(n,t,"parens"):"interpolation"==e?O(n,t,"interpolation"):("word"==e&&P(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(o="variable-3",n.context.type):C(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(o="tag",n.context.type):R.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return O(n,t,"atBlock_parens");if("}"==e||";"==e)return A(e,t,n);if("{"==e)return T(n)&&O(n,t,y?"block":"top");if("interpolation"==e)return O(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":u.hasOwnProperty(r)?"attribute":c.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":f.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"string-2":v.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?A(e,t,n):"{"==e?T(n)&&O(n,t,y?"block":"top",!1):("word"==e&&(o="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?A(e,t,n,2):R.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?O(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):C(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,T(n)):"word"==e?(o="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(o="variable","keyframes"):"{"==e?O(n,t,"top"):C(e,t,n)},at:function(e,t,n){return";"==e?T(n):"{"==e||"}"==e?A(e,t,n):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?A(e,t,n):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||x)(e,t);return n&&"object"==typeof n&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(t.state=R[t.state](i,e,t)),o},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),f=["border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(f),h=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=t(y),_=n.concat(i).concat(a).concat(l).concat(c).concat(f).concat(g).concat(y);function w(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w,w(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w,w(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:v,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w,w(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:o,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:v,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w,w(e,t))}},name:"css",helperType:"gss"})}(n(5))},function(e,t,n){!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},u=i.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in i)l[c]=i[c];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){if(1==t){r.tokenize=d;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=d,t.state=v,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",x):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,0,n)):(a="error",y)}function b(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",w)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",_(e,0,n)):(a="error",w)}function _(e,t,n){return"endTag"!=e?(a="error",_):(m(n),v)}function w(e,t,n){return a="error",_(e,0,n)}function x(e,t,n){if("word"==e)return a="attribute",k;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new h(n,r,i==n.indented)),v}return a="error",x}function k(e,t,n){return"equals"==e?E:(l.allowMissing||(a="error"),x(e,0,n))}function E(e,t,n){return"string"==e?S:"word"==e&&l.allowUnquoted?(a="string",x):(a="error",x(e,0,n))}function S(e,t,n){return"string"==e?S:x(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:v,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=x)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(5))},function(e,t,n){!function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)=i?e:r(e,t,n)}},function(e,t,n){var r=n(774),i=n(324),o=n(775);e.exports=function(e){return i(e)?o(e):r(e)}},function(e,t,n){var r=n(322);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t,n){var r=n(101),i=n(69),o=n(257);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!o(e)}},function(e,t,n){var r=n(101),i=n(327),o=n(69),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(o=new Array(s-1),a=0;ae.path===t)},t.selectMediaDisplayURL=function(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,i.Map)())},t.default=void 0;var r,i=n(4),o=(r=n(140))&&r.__esModule?r:{default:r},a=n(141),s=n(104),l=n(100),u=n(89);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t(0,u.dirname)(e.path)===l).map(e=>d({key:e.id},e))}else c=n.get("files")||[];return c}var m=(e=(0,i.Map)(p),t)=>{switch(t.type){case a.MEDIA_LIBRARY_CREATE:return e.withMutations(e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())});case a.MEDIA_LIBRARY_OPEN:{const{controlID:n,forImage:r,privateUpload:o,config:a,field:s}=t.payload,l=a||(0,i.Map)();return e.get("privateUpload")!==o?(0,i.Map)({isVisible:!0,forImage:r,controlID:n,canInsert:!!n,privateUpload:o,config:l,controlMedia:(0,i.Map)(),field:s}):e.withMutations(e=>{e.set("isVisible",!0),e.set("forImage",r),e.set("controlID",n),e.set("canInsert",!!n),e.set("privateUpload",o),e.set("config",l),e.set("field",s)})}case a.MEDIA_LIBRARY_CLOSE:return e.set("isVisible",!1);case a.MEDIA_INSERT:{const{mediaPath:n}=t.payload,r=e.get("controlID");return e.withMutations(e=>{e.setIn(["controlMedia",r],n)})}case a.MEDIA_REMOVE_INSERTED:{const n=t.payload.controlID;return e.setIn(["controlMedia",n],"")}case a.MEDIA_LOAD_REQUEST:return e.withMutations(e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)});case a.MEDIA_LOAD_SUCCESS:{const{files:n=[],page:r,canPaginate:i,dynamicSearch:a,dynamicSearchQuery:s,privateUpload:l}=t.payload;if(e.get("privateUpload")!==l)return e;const u=n.map(e=>d(d({},e),{},{key:(0,o.default)()}));return e.withMutations(e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",r),e.set("hasNextPage",i&&n.length>0),e.set("dynamicSearch",a),e.set("dynamicSearchQuery",s),e.set("dynamicSearchActive",!!s),r&&r>1){const t=e.get("files").concat(u);e.set("files",t)}else e.set("files",u)})}case a.MEDIA_LOAD_FAILURE:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case a.MEDIA_PERSIST_REQUEST:return e.set("isPersisting",!0);case a.MEDIA_PERSIST_SUCCESS:{const{file:n,privateUpload:r}=t.payload;return e.get("privateUpload")!==r?e:e.withMutations(e=>{const t=[d(d({},n),{},{key:(0,o.default)()}),...e.get("files")];e.set("files",t),e.set("isPersisting",!1)})}case a.MEDIA_PERSIST_FAILURE:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case a.MEDIA_DELETE_REQUEST:return e.set("isDeleting",!0);case a.MEDIA_DELETE_SUCCESS:{const{id:n,key:r,privateUpload:i}=t.payload.file;return e.get("privateUpload")!==i?e:e.withMutations(e=>{const t=e.get("files").filter(e=>r?e.key!==r:e.id!==n);e.set("files",t),e.deleteIn(["displayURLs",n]),e.set("isDeleting",!1)})}case a.MEDIA_DELETE_FAILURE:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case a.MEDIA_DISPLAY_URL_REQUEST:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case a.MEDIA_DISPLAY_URL_SUCCESS:{const n=["displayURLs",t.payload.key];return e.setIn([...n,"isFetching"],!1).setIn([...n,"url"],t.payload.url)}case a.MEDIA_DISPLAY_URL_FAILURE:{const n=["displayURLs",t.payload.key];return e.setIn([...n,"isFetching"],!1).setIn([...n,"err"],t.payload.err||!0).deleteIn([...n,"url"])}default:return e}};t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.folderFormatter=t.summaryFormatter=t.previewUrlFormatter=t.slugFormatter=t.getProcessSegment=t.prepareSlug=t.commitMessageFormatter=void 0;var r=f(n(121)),i=f(n(163)),o=f(n(514)),a=f(n(124)),s=n(4),l=n(164),u=n(166),c=n(67),d=n(107);function f(e){return e&&e.__esModule?e:{default:e}}const{compileStringTemplate:p,parseDateFromEntry:h,SLUG_MISSING_REQUIRED_DATE:m,keyToPathArray:g,addFileTemplateFields:v}=u.stringTemplate,y=(0,s.Map)({create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"}),b=/\{\{([^}]+)\}\}/g;t.commitMessageFormatter=(e,t,{slug:n,path:r,collection:i,authorLogin:o,authorName:a},l)=>{const u=y.merge(t.getIn(["backend","commit_messages"],(0,s.Map)())),c=u.get(e).replace(b,(e,t)=>{switch(t){case"slug":return n||"";case"path":return r||"";case"collection":return i?i.get("label_singular")||i.get("label"):"";case"author-login":return o||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in commit message template.`),""}});if(!l)return c;return u.get("openAuthoring").replace(b,(e,t)=>{switch(t){case"message":return c;case"author-login":return o||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in open authoring message template.`),""}})};const _=e=>e.trim().toLocaleLowerCase().replace(/[']/g,"").replace(/[.]/g,"-");t.prepareSlug=_;const w=e=>(0,a.default)([e=>String(e),_,(0,o.default)(l.sanitizeSlug,e)]);t.getProcessSegment=w;t.slugFormatter=(e,t,n)=>{const r=e.get("slug")||"{{slug}}",i=t.getIn(g((0,c.selectIdentifier)(e)));if(!i)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const o=w(n),a=new Date,s=p(r,a,i,t,o);if(e.has("path")){const n=_(e.get("path"));return p(n,a,s,t,e=>e===s?e:o(e))}return s};t.previewUrlFormatter=(e,t,n,o,a)=>{if(!e)return;if(!t.get("preview_path"))return e;const s=(0,i.default)(e,"/"),l=t.get("preview_path");let u=a.get("data");u=v(a.get("path"),u);const f=t.get("preview_path_date_field")||(0,c.selectInferedField)(t,"date"),g=h(a,f),y=w(o);let b;try{b=p(l,g,n,u,y)}catch(e){if(e.name===m)return console.error(d.stripIndent` + Collection "${t.get("name")}" configuration error: + \`preview_path_date_field\` must be a field with a valid date. Ignoring \`preview_path\`. + `),s;throw e}return`${s}/${(0,r.default)(b," /")}`};t.summaryFormatter=(e,t,n)=>{let r=t.get("data");const i=h(t,(0,c.selectInferedField)(n,"date"))||null,o=r.getIn(g((0,c.selectIdentifier)(n)));r=v(t.get("path"),r),t.get("author")&&!(0,c.selectField)(n,c.COMMIT_AUTHOR)&&(r=r.set(c.COMMIT_AUTHOR,t.get("author"))),t.get("updatedOn")&&!(0,c.selectField)(n,c.COMMIT_DATE)&&(r=r.set(c.COMMIT_DATE,t.get("updatedOn")));return p(e,i,o,r)};t.folderFormatter=(e,t,n,r,i,o)=>{if(!t||!t.get("data"))return e;let a=t.get("data").set(i,r);a=v(t.get("path"),a);const s=h(t,(0,c.selectInferedField)(n,"date"))||null,l=a.getIn(g((0,c.selectIdentifier)(n))),u=w(o);return p(e,s,l,a,e=>e===r?r:u(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchingEntries=s,t.searchSuccess=l,t.searchFailure=u,t.querying=c,t.querySuccess=d,t.queryFailure=f,t.clearSearch=function(){return{type:"SEARCH_CLEAR"}},t.searchEntries=function(e,t=null,n=0){return(c,d)=>{const f=d(),{search:p}=f,h=(0,r.currentBackend)(f.config),m=t||f.collections.keySeq().toArray(),g=m.filter(e=>(0,o.selectIntegration)(f,e,"search")),v=(0,o.selectIntegration)(f,g[0],"search");if(!0===p.get("isFetching")&&p.get("term")===e&&null!==p.get("collections")&&(0,a.List)(m).equals(p.get("collections"))&&(p.get("page")===n||!v))return;c(s(e,m,n));return(v?(0,i.getIntegrationProvider)(f.integrations,h.getToken,v).search(g,e,n):h.search(f.collections.filter((e,t)=>-1!==m.indexOf(t)).valueSeq().toArray(),e)).then(t=>c(l(e,m,t.entries,t.pagination)),t=>c(u(e,t)))}},t.query=function(e,t,n,a,s,l){return async(u,p)=>{u(c(e,t,n,a));const h=p(),m=(0,r.currentBackend)(h.config),g=(0,o.selectIntegration)(h,t,"search"),v=h.collections.find(e=>e.get("name")===t),y=g?(0,i.getIntegrationProvider)(h.integrations,m.getToken,g).searchBy(n.map(e=>"data."+e),t,a):m.query(v,n,a,s,l);try{const r=await y;return u(d(e,t,n,a,r))}catch(r){return u(f(e,t,n,a,r))}}},t.SEARCH_CLEAR=t.QUERY_FAILURE=t.QUERY_SUCCESS=t.QUERY_REQUEST=t.SEARCH_ENTRIES_FAILURE=t.SEARCH_ENTRIES_SUCCESS=t.SEARCH_ENTRIES_REQUEST=void 0;var r=n(119),i=n(344),o=n(100),a=n(4);t.SEARCH_ENTRIES_REQUEST="SEARCH_ENTRIES_REQUEST";t.SEARCH_ENTRIES_SUCCESS="SEARCH_ENTRIES_SUCCESS";t.SEARCH_ENTRIES_FAILURE="SEARCH_ENTRIES_FAILURE";t.QUERY_REQUEST="INIT_QUERY";t.QUERY_SUCCESS="QUERY_OK";t.QUERY_FAILURE="QUERY_ERROR";function s(e,t,n){return{type:"SEARCH_ENTRIES_REQUEST",payload:{searchTerm:e,searchCollections:t,page:n}}}function l(e,t,n,r){return{type:"SEARCH_ENTRIES_SUCCESS",payload:{searchTerm:e,searchCollections:t,entries:n,page:r}}}function u(e,t){return{type:"SEARCH_ENTRIES_FAILURE",payload:{searchTerm:e,error:t}}}function c(e,t,n,r){return{type:"INIT_QUERY",payload:{namespace:e,collection:t,searchFields:n,searchTerm:r}}}function d(e,t,n,r,i){return{type:"QUERY_OK",payload:{namespace:e,collection:t,searchFields:n,searchTerm:r,response:i}}}function f(e,t,n,r,i){return{type:"QUERY_ERROR",payload:{namespace:e,collection:t,searchFields:n,searchTerm:r,error:i}}}t.SEARCH_CLEAR="SEARCH_CLEAR"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.selectIsLoadingAsset=void 0;var r=n(4),i=n(165);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;tObject.values(e.toJS()).some(e=>e.isLoading);var l=(e=(0,r.fromJS)({}),t)=>{switch(t.type){case i.ADD_ASSETS:{const n=t.payload;let r=e;return n.forEach(e=>{r=r.set(e.path,{asset:e,isLoading:!1,error:null})}),r}case i.ADD_ASSET:{const n=t.payload;return e.set(n.path,{asset:n,isLoading:!1,error:null})}case i.REMOVE_ASSET:{const n=t.payload;return e.delete(n)}case i.LOAD_ASSET_REQUEST:{const{path:n}=t.payload;return e.set(n,a(a({},e.get(n)),{},{isLoading:!0}))}case i.LOAD_ASSET_SUCCESS:{const{path:n}=t.payload;return e.set(n,a(a({},e.get(n)),{},{isLoading:!1,error:null}))}case i.LOAD_ASSET_FAILURE:{const{path:n,error:r}=t.payload;return e.set(n,a(a({},e.get(n)),{},{isLoading:!1,error:r}))}default:return e}};t.default=l},function(e,t,n){"use strict";var r=TypeError,i=Object.getOwnPropertyDescriptor;if(i)try{i({},"")}catch(e){i=null}var o=function(){throw new r},a=i?function(){try{return o}catch(e){try{return i(arguments,"callee").get}catch(e){return o}}}():o,s=n(989)(),l=Object.getPrototypeOf||function(e){return e.__proto__},u=void 0,c="undefined"==typeof Uint8Array?void 0:l(Uint8Array),d={"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":s?l([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":u&&s&&Symbol.asyncIterator?u[Symbol.asyncIterator]():void 0,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s?l(l([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%JSONParse%":"object"==typeof JSON?JSON.parse:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&s?l((new Map)[Symbol.iterator]()):void 0,"%MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"%PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"%Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"%Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"%Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&s?l((new Set)[Symbol.iterator]()):void 0,"%SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":s?l(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":s?Symbol:void 0,"%SymbolPrototype%":s?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":a,"%TypedArray%":c,"%TypedArrayPrototype%":c?c.prototype:void 0,"%TypeError%":r,"%TypeErrorPrototype%":r.prototype,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype},f=n(364).call(Function.call,String.prototype.replace),p=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,h=/\\(\\)?/g,m=function(e){var t=[];return f(e,p,(function(e,n,r,i){t[t.length]=r?f(i,h,"$1"):n||e})),t},g=function(e,t){if(!(e in d))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===d[e]&&!t)throw new r("intrinsic "+e+" exists, but is not available. Please file an issue!");return d[e]};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');for(var n=m(e),o=g("%"+(n.length>0?n[0]:"")+"%",t),a=1;a=n.length){var s=i(o,n[a]);if(!t&&!(n[a]in o))throw new r("base intrinsic for "+e+" exists, but the property is not available.");o=s?s.get||s.value:o[n[a]]}else o=o[n[a]];return o}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const t=(0,i.default)().use(a.default,{fences:!0,commonmark:!0}).use(T,{inlineTokenizers:["url"]}).use(b.remarkParseShortcodes,{plugins:(0,E.getEditorComponents)()}).use(x.default).parse(e);return(0,i.default)().use(y.default).runSync(t)};function T({inlineTokenizers:e}){e&&e.forEach(e=>{delete this.Parser.prototype.inlineTokenizers[e]})}t.markdownToRemark=O;const C=e=>{const t=e||(0,o.default)("root",[(0,o.default)("paragraph",[(0,o.default)("text","")])]),n=(0,i.default)().use(_.default).use(w.default).runSync(t),a=(0,i.default)().use(s.default,{commonmark:!0,fences:!0,listItemIndent:"1",bullet:"*",emphasis:"*",strong:"*",rule:"-"}).use((function(){this.Compiler.prototype.visitors.text=e=>e.value})).use((0,b.createRemarkShortcodeStringifier)({plugins:(0,E.getEditorComponents)()})).stringify(n).replace(/\r?/g,"");return(0,r.default)(a)};t.remarkToMarkdown=C;t.markdownToHtml=(e,{getAsset:t,resolveWidget:n}={})=>{const r=O(e),o=(0,i.default)().use(f.default,{plugins:(0,E.getEditorComponents)(),getAsset:t,resolveWidget:n}).use(l.default,{allowDangerousHTML:!0}).runSync(r);return(0,i.default)().use(u.default,{allowDangerousHtml:!0,allowDangerousCharacters:!0,closeSelfClosing:!0,entities:{useNamedReferences:!0}}).stringify(o)};t.htmlToSlate=e=>{const t=(0,i.default)().use(c.default,{fragment:!0}).parse(e),n=(0,i.default)().use(p.default).use(d.default,{minify:!1}).runSync(t);return(0,i.default)().use(h.default).use(m.default).use(g.default).use(v.default).runSync(n)};t.markdownToSlate=(e,{voidCodeBlock:t}={})=>{const n=O(e);return(0,i.default)().use(g.default).use(v.default,{voidCodeBlock:t}).runSync(n)};t.slateToMarkdown=(e,{voidCodeBlock:t}={})=>{const n=(0,k.default)(e,{voidCodeBlock:t});return C(n)}},function(e,t,n){"use strict";var r=n(379),i=n(1254),o=n(194),a=n(380),s=n(381),l=n(1255);e.exports=function(e,t){var n,o,a={};t||(t={});for(o in f)n=t[o],a[o]=null==n?f[o]:n;(a.position.indent||a.position.start)&&(a.indent=a.position.indent||[],a.position=a.position.start);return function(e,t){var n,o,a,f,b,_,w,x,k,E,S,O,T,C,A,P,R,M,I,j=t.additional,D=t.nonTerminated,L=t.text,N=t.reference,F=t.warning,B=t.textContext,z=t.referenceContext,U=t.warningContext,q=t.position,H=t.indent||[],W=e.length,V=0,$=-1,G=q.column||1,K=q.line||1,Y="",Q=[];"string"==typeof j&&(j=j.charCodeAt(0));P=J(),x=F?function(e,t){var n=J();n.column+=t,n.offset+=t,F.call(U,v[e],n,e)}:d,V--,W++;for(;++V=55296&&X<=57343||X>1114111?(x(7,M),_=c(65533)):_ in i?(x(6,M),_=i[_]):(E="",y(_)&&x(6,M),_>65535&&(E+=c((_-=65536)>>>10|55296),_=56320|1023&_),_=E+c(_))):C!==p&&x(4,M)),_?(Z(),P=J(),V=I-1,G+=I-T+1,Q.push(_),(R=J()).offset++,N&&N.call(z,_,{start:P,end:R},e.slice(T-1,I)),P=R):(f=e.slice(T-1,I),Y+=f,G+=f.length,V=I-1)}else 10===b&&(K++,$++,G=0),b==b?(Y+=c(b),G++):Z();var X;return Q.join("");function J(){return{line:K,column:G,offset:V+(q.offset||0)}}function Z(){Y&&(Q.push(Y),L&&L.call(B,Y,{start:P,end:J()}),Y="")}}(e,a)};var u={}.hasOwnProperty,c=String.fromCharCode,d=Function.prototype,f={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},p="named",h="hexadecimal",m={hexadecimal:16,decimal:10},g={};g[p]=s,g.decimal=o,g[h]=a;var v={};function y(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)}v[1]="Named character references must be terminated by a semicolon",v[2]="Numeric character references must be terminated by a semicolon",v[3]="Named character references cannot be empty",v[4]="Numeric character references cannot be empty",v[5]="Named character references must be known",v[6]="Numeric character references cannot be disallowed",v[7]="Numeric character references cannot be outside the permissible Unicode range"},function(e,t,n){"use strict";e.exports=s;var r=n(598),i=r.CONTINUE,o=r.SKIP,a=r.EXIT;function s(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null),r(e,t,(function(e,t){var r=t[t.length-1],i=r?r.children.indexOf(e):null;return n(e,i,r)}),i)}s.CONTINUE=i,s.SKIP=o,s.EXIT=a},function(e,t,n){"use strict";e.exports=function(e){var t=String(e),n=t.length;for(;"\n"===t.charAt(--n););return t.slice(0,n+1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r=String(e),i=0;if("string"!=typeof t||1!==t.length)throw new Error("Expected character");n=r.indexOf(t);for(;-1!==n;)i++,n=r.indexOf(t,n+1);return i}},function(e,t,n){"use strict";var r={};function i(e,t,n){var o,a,s,l,u,c="";for("string"!=typeof t&&(n=t,t=i.defaultChars),void 0===n&&(n=!0),u=function(e){var t,n,i=r[e];if(i)return i;for(i=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1=56320&&l<=57343){c+=encodeURIComponent(e[o]+e[o+1]),o++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[o]);return c}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i},function(e,t,n){"use strict";var r=0;function i(){return Math.pow(2,++r)}t.boolean=i(),t.booleanish=i(),t.overloadedBoolean=i(),t.number=i(),t.spaceSeparated=i(),t.commaSeparated=i(),t.commaOrSpaceSeparated=i()},function(e,t,n){"use strict";var r=n(617),i=n(619),o=n(622),a=n(623),s=n(626),l=n(1369);e.exports=r([o,i,a,s,l])},function(e,t,n){"use strict";var r=n(605),i=n(379),o=n(380),a=n(194),s=n(381),l=n(1375);e.exports=h,h.escape=function(e){return h(e,{escapeOnly:!0,useNamedReferences:!0})};var u={}.hasOwnProperty,c=function(){var e,t={};for(e in r)t[r[e]]=e;return t}(),d=v(['"',"'","<",">","&","`"]),f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;function h(e,t){var n=t||{},r=n.subset,o=r?v(r):d,a=n.escapeOnly,h=n.omitOptionalSemicolons;return e=e.replace(o,y),r||a?e:e.replace(f,(function(e,t,n){return m(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,n.charCodeAt(t+2),h)})).replace(p,y);function y(e,t,r){return function(e,t,n){var r,o,a,d,f=n.useShortestReferences,p=n.omitOptionalSemicolons;(f||n.useNamedReferences)&&u.call(c,e)&&(r=function(e,t,n,r){var o="&"+e;if(n&&u.call(i,e)&&-1===l.indexOf(e)&&(!r||t&&61!==t&&!s(t)))return o;return o+";"}(c[e],t,p,n.attribute));!f&&r||(o=e.charCodeAt(0),a=m(o,t,p),f&&(d=g(o,t,p)).length=s.DIGIT_0&&e<=s.DIGIT_9}function p(e){return e>=s.LATIN_CAPITAL_A&&e<=s.LATIN_CAPITAL_Z}function h(e){return e>=s.LATIN_SMALL_A&&e<=s.LATIN_SMALL_Z}function m(e){return h(e)||p(e)}function g(e){return m(e)||f(e)}function v(e){return e>=s.LATIN_CAPITAL_A&&e<=s.LATIN_CAPITAL_F}function y(e){return e>=s.LATIN_SMALL_A&&e<=s.LATIN_SMALL_F}function b(e){return e+32}function _(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function w(e){return String.fromCharCode(b(e))}function x(e,t){const n=o[++e];let r=++e,i=r+n-1;for(;r<=i;){const e=r+i>>>1,a=o[e];if(at))return o[e+n];i=e-1}}return-1}class k{constructor(){this.preprocessor=new r,this.tokenQueue=[],this.allowCDATA=!1,this.state=c,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume()}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t)}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:k.HIBERNATION_TOKEN}),!0}return!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}_reconsumeInState(e){this.state=e,this._unconsume()}_consumeSequenceIfMatch(e,t,n){let r=0,i=!0;const o=e.length;let a=0,l=t,u=void 0;for(;a0&&(l=this._consume(),r++),l===s.EOF){i=!1;break}if(u=e[a],l!==u&&(n||l!==b(u))){i=!1;break}}if(!i)for(;r--;)this._unconsume();return i}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==l.SCRIPT_STRING.length)return!1;for(let e=0;e0&&this._err(a.endTagWithAttributes),e.selfClosing&&this._err(a.endTagWithTrailingSolidus)),this.tokenQueue.push(e)}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken()}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}_emitCodePoint(e){let t=k.CHARACTER_TOKEN;d(e)?t=k.WHITESPACE_CHARACTER_TOKEN:e===s.NULL&&(t=k.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,_(e))}_emitSeveralCodePoints(e){for(let t=0;t-1;){const e=o[r],i=e<7;i&&1&e&&(t=2&e?[o[++r],o[++r]]:[o[++r]],n=0);const a=this._consume();if(this.tempBuff.push(a),n++,a===s.EOF)break;r=i?4&e?x(r,a):-1:a===e?++r:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return"ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_UNQUOTED_STATE"===this.returnState}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===s.EQUALS_SIGN||g(e)}return!1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e")):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitChars(i.REPLACEMENT_CHARACTER)):e===s.EOF?(this._err(a.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitCodePoint(e))}SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE(e){e===s.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE"):m(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE")):(this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE"))}SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE(e){m(e)?(this._createEndTagToken(),this._reconsumeInState("SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE")):(this._emitChars("")):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitChars(i.REPLACEMENT_CHARACTER)):e===s.EOF?(this._err(a.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e))}SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE(e){e===s.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",this._emitChars("/")):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE(e){d(e)||e===s.SOLIDUS||e===s.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?"SCRIPT_DATA_ESCAPED_STATE":"SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e)):p(e)?(this.tempBuff.push(b(e)),this._emitCodePoint(e)):h(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}BEFORE_ATTRIBUTE_NAME_STATE(e){d(e)||(e===s.SOLIDUS||e===s.GREATER_THAN_SIGN||e===s.EOF?this._reconsumeInState("AFTER_ATTRIBUTE_NAME_STATE"):e===s.EQUALS_SIGN?(this._err(a.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state="ATTRIBUTE_NAME_STATE"):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}ATTRIBUTE_NAME_STATE(e){d(e)||e===s.SOLIDUS||e===s.GREATER_THAN_SIGN||e===s.EOF?(this._leaveAttrName("AFTER_ATTRIBUTE_NAME_STATE"),this._unconsume()):e===s.EQUALS_SIGN?this._leaveAttrName("BEFORE_ATTRIBUTE_VALUE_STATE"):p(e)?this.currentAttr.name+=w(e):e===s.QUOTATION_MARK||e===s.APOSTROPHE||e===s.LESS_THAN_SIGN?(this._err(a.unexpectedCharacterInAttributeName),this.currentAttr.name+=_(e)):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.name+=i.REPLACEMENT_CHARACTER):this.currentAttr.name+=_(e)}AFTER_ATTRIBUTE_NAME_STATE(e){d(e)||(e===s.SOLIDUS?this.state="SELF_CLOSING_START_TAG_STATE":e===s.EQUALS_SIGN?this.state="BEFORE_ATTRIBUTE_VALUE_STATE":e===s.GREATER_THAN_SIGN?(this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}BEFORE_ATTRIBUTE_VALUE_STATE(e){d(e)||(e===s.QUOTATION_MARK?this.state="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE":e===s.APOSTROPHE?this.state="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE":e===s.GREATER_THAN_SIGN?(this._err(a.missingAttributeValue),this.state=c,this._emitCurrentToken()):this._reconsumeInState("ATTRIBUTE_VALUE_UNQUOTED_STATE"))}ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE(e){e===s.QUOTATION_MARK?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===s.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):this.currentAttr.value+=_(e)}ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE(e){e===s.APOSTROPHE?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===s.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):this.currentAttr.value+=_(e)}ATTRIBUTE_VALUE_UNQUOTED_STATE(e){d(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===s.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_UNQUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===s.GREATER_THAN_SIGN?(this._leaveAttrValue(c),this._emitCurrentToken()):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.value+=i.REPLACEMENT_CHARACTER):e===s.QUOTATION_MARK||e===s.APOSTROPHE||e===s.LESS_THAN_SIGN||e===s.EQUALS_SIGN||e===s.GRAVE_ACCENT?(this._err(a.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=_(e)):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):this.currentAttr.value+=_(e)}AFTER_ATTRIBUTE_VALUE_QUOTED_STATE(e){d(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===s.SOLIDUS?this._leaveAttrValue("SELF_CLOSING_START_TAG_STATE"):e===s.GREATER_THAN_SIGN?(this._leaveAttrValue(c),this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):(this._err(a.missingWhitespaceBetweenAttributes),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}SELF_CLOSING_START_TAG_STATE(e){e===s.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):(this._err(a.unexpectedSolidusInTag),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}BOGUS_COMMENT_STATE(e){e===s.GREATER_THAN_SIGN?(this.state=c,this._emitCurrentToken()):e===s.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):this.currentToken.data+=_(e)}MARKUP_DECLARATION_OPEN_STATE(e){this._consumeSequenceIfMatch(l.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state="COMMENT_START_STATE"):this._consumeSequenceIfMatch(l.DOCTYPE_STRING,e,!1)?this.state="DOCTYPE_STATE":this._consumeSequenceIfMatch(l.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state="CDATA_SECTION_STATE":(this._err(a.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state="BOGUS_COMMENT_STATE"):this._ensureHibernation()||(this._err(a.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState("BOGUS_COMMENT_STATE"))}COMMENT_START_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_START_DASH_STATE":e===s.GREATER_THAN_SIGN?(this._err(a.abruptClosingOfEmptyComment),this.state=c,this._emitCurrentToken()):this._reconsumeInState("COMMENT_STATE")}COMMENT_START_DASH_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===s.GREATER_THAN_SIGN?(this._err(a.abruptClosingOfEmptyComment),this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}COMMENT_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_END_DASH_STATE":e===s.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state="COMMENT_LESS_THAN_SIGN_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.data+=i.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=_(e)}COMMENT_LESS_THAN_SIGN_STATE(e){e===s.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state="COMMENT_LESS_THAN_SIGN_BANG_STATE"):e===s.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState("COMMENT_STATE")}COMMENT_LESS_THAN_SIGN_BANG_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE":this._reconsumeInState("COMMENT_STATE")}COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE":this._reconsumeInState("COMMENT_END_DASH_STATE")}COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE(e){e!==s.GREATER_THAN_SIGN&&e!==s.EOF&&this._err(a.nestedComment),this._reconsumeInState("COMMENT_END_STATE")}COMMENT_END_DASH_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}COMMENT_END_STATE(e){e===s.GREATER_THAN_SIGN?(this.state=c,this._emitCurrentToken()):e===s.EXCLAMATION_MARK?this.state="COMMENT_END_BANG_STATE":e===s.HYPHEN_MINUS?this.currentToken.data+="-":e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState("COMMENT_STATE"))}COMMENT_END_BANG_STATE(e){e===s.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state="COMMENT_END_DASH_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.incorrectlyClosedComment),this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState("COMMENT_STATE"))}DOCTYPE_STATE(e){d(e)?this.state="BEFORE_DOCTYPE_NAME_STATE":e===s.GREATER_THAN_SIGN?this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"):e===s.EOF?(this._err(a.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingWhitespaceBeforeDoctypeName),this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"))}BEFORE_DOCTYPE_NAME_STATE(e){d(e)||(p(e)?(this._createDoctypeToken(w(e)),this.state="DOCTYPE_NAME_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this._createDoctypeToken(i.REPLACEMENT_CHARACTER),this.state="DOCTYPE_NAME_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=c):e===s.EOF?(this._err(a.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(_(e)),this.state="DOCTYPE_NAME_STATE"))}DOCTYPE_NAME_STATE(e){d(e)?this.state="AFTER_DOCTYPE_NAME_STATE":e===s.GREATER_THAN_SIGN?(this.state=c,this._emitCurrentToken()):p(e)?this.currentToken.name+=w(e):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.name+=i.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=_(e)}AFTER_DOCTYPE_NAME_STATE(e){d(e)||(e===s.GREATER_THAN_SIGN?(this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(l.PUBLIC_STRING,e,!1)?this.state="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE":this._consumeSequenceIfMatch(l.SYSTEM_STRING,e,!1)?this.state="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE":this._ensureHibernation()||(this._err(a.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE(e){d(e)?this.state="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===s.QUOTATION_MARK?(this._err(a.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this._err(a.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE(e){d(e)||(e===s.QUOTATION_MARK?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE(e){e===s.QUOTATION_MARK?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=c):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=_(e)}DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE(e){e===s.APOSTROPHE?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.publicId+=i.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=c):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=_(e)}AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE(e){d(e)?this.state="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE":e===s.GREATER_THAN_SIGN?(this.state=c,this._emitCurrentToken()):e===s.QUOTATION_MARK?(this._err(a.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this._err(a.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE(e){d(e)||(e===s.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=c):e===s.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE(e){d(e)?this.state="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===s.QUOTATION_MARK?(this._err(a.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this._err(a.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE(e){d(e)||(e===s.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=c,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE(e){e===s.QUOTATION_MARK?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=c):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=_(e)}DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE(e){e===s.APOSTROPHE?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.systemId+=i.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=c):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=_(e)}AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE(e){d(e)||(e===s.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=c):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}BOGUS_DOCTYPE_STATE(e){e===s.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=c):e===s.NULL?this._err(a.unexpectedNullCharacter):e===s.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}CDATA_SECTION_STATE(e){e===s.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_BRACKET_STATE":e===s.EOF?(this._err(a.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}CDATA_SECTION_BRACKET_STATE(e){e===s.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_END_STATE":(this._emitChars("]"),this._reconsumeInState("CDATA_SECTION_STATE"))}CDATA_SECTION_END_STATE(e){e===s.GREATER_THAN_SIGN?this.state=c:e===s.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState("CDATA_SECTION_STATE"))}CHARACTER_REFERENCE_STATE(e){this.tempBuff=[s.AMPERSAND],e===s.NUMBER_SIGN?(this.tempBuff.push(e),this.state="NUMERIC_CHARACTER_REFERENCE_STATE"):g(e)?this._reconsumeInState("NAMED_CHARACTER_REFERENCE_STATE"):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}NAMED_CHARACTER_REFERENCE_STATE(e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[s.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===s.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(a.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state="AMBIGUOS_AMPERSAND_STATE"}AMBIGUOS_AMPERSAND_STATE(e){g(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=_(e):this._emitCodePoint(e):(e===s.SEMICOLON&&this._err(a.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}NUMERIC_CHARACTER_REFERENCE_STATE(e){this.charRefCode=0,e===s.LATIN_SMALL_X||e===s.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE"):this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_START_STATE")}HEXADEMICAL_CHARACTER_REFERENCE_START_STATE(e){!function(e){return f(e)||v(e)||y(e)}(e)?(this._err(a.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState("HEXADEMICAL_CHARACTER_REFERENCE_STATE")}DECIMAL_CHARACTER_REFERENCE_START_STATE(e){f(e)?this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_STATE"):(this._err(a.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}HEXADEMICAL_CHARACTER_REFERENCE_STATE(e){v(e)?this.charRefCode=16*this.charRefCode+e-55:y(e)?this.charRefCode=16*this.charRefCode+e-87:f(e)?this.charRefCode=16*this.charRefCode+e-48:e===s.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(a.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}DECIMAL_CHARACTER_REFERENCE_STATE(e){f(e)?this.charRefCode=10*this.charRefCode+e-48:e===s.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(a.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}NUMERIC_CHARACTER_REFERENCE_END_STATE(){if(this.charRefCode===s.NULL)this._err(a.nullCharacterReference),this.charRefCode=s.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(a.characterReferenceOutsideUnicodeRange),this.charRefCode=s.REPLACEMENT_CHARACTER;else if(i.isSurrogate(this.charRefCode))this._err(a.surrogateCharacterReference),this.charRefCode=s.REPLACEMENT_CHARACTER;else if(i.isUndefinedCodePoint(this.charRefCode))this._err(a.noncharacterCharacterReference);else if(i.isControlCodePoint(this.charRefCode)||this.charRefCode===s.CARRIAGE_RETURN){this._err(a.controlCharacterReference);const e=u[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}k.CHARACTER_TOKEN="CHARACTER_TOKEN",k.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",k.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",k.START_TAG_TOKEN="START_TAG_TOKEN",k.END_TAG_TOKEN="END_TAG_TOKEN",k.COMMENT_TOKEN="COMMENT_TOKEN",k.DOCTYPE_TOKEN="DOCTYPE_TOKEN",k.EOF_TOKEN="EOF_TOKEN",k.HIBERNATION_TOKEN="HIBERNATION_TOKEN",k.MODE={DATA:c,RCDATA:"RCDATA_STATE",RAWTEXT:"RAWTEXT_STATE",SCRIPT_DATA:"SCRIPT_DATA_STATE",PLAINTEXT:"PLAINTEXT_STATE"},k.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null},e.exports=k},function(e,t,n){"use strict";var r=n(83),i=n(106),o=n(1420);e.exports=function(e){var t,n,o,a,s,c=e.children||[],d=c.length,f=v(e),h=p(e,{}),m=-1;if("text"===e.type||"comment"===e.type)return u(e,{whiteSpace:h,breakBefore:!0,breakAfter:!0});t=[];for(;++ms&&(s=a):""!==a&&(s&&o.push(r("\n",s)),s=0,o.push(a));return o.join("")};var a=Math.min,s=Math.max;function l(e,t,n,r){return"element"===e.type?function(e,t,n,r){var a,s,u,c=p(e,r),d=e.children||[],f=d.length,h=-1,y=[];if(function(e){var t=e.properties||{};return i(e,["datalist","head","noembed","noframes","rp","script","style","template","title","noscript"])||t.hidden||i(e,"dialog")&&!t.open}(e))return y;i(e,"br")||g(e)&&o(n,e,g)?u="\n":i(e,"p")?(s=2,u=2):v(e)&&(s=1,u=1);for(;++h1&&void 0!==arguments[1]?arguments[1]:{},n=t.delimiter,i=void 0===n?"\n":n;return"document"===e.object||"block"===e.object&&r.Block.isBlockList(e.nodes)?e.nodes.map(a).join(i):e.text}var s={deserialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.defaultBlock,a=void 0===n?"line":n,s=t.defaultMarks,l=void 0===s?[]:s,u=t.delimiter,c=void 0===u?"\n":u,d=t.toJSON,f=void 0!==d&&d;i.Set.isSet(l)&&(l=l.toArray()),a=r.Node.createProperties(a),l=l.map(r.Mark.createProperties);var p={object:"value",document:{object:"document",data:{},nodes:e.split(c).map((function(e){return o({},a,{object:"block",data:{},nodes:[{object:"text",text:e,marks:l}]})}))}},h=f?p:r.Value.fromJSON(p);return h},serialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(e.document,t)}};t.default=s},function(e,t,n){"use strict";var r=n(6),i=function(e){function t(t){var n="Assertion failed. See https://openlayers.org/en/"+("latest"===r.a?r.a:"v"+r.a.split("-")[0])+"/doc/errors/#"+t+" for details.";e.call(this,n),this.code=t,this.name="AssertionError",this.message=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);t.a=i},function(e,t,n){"use strict";var r=n(9),i=n(94),o=n(14),a=function(e){function t(){e.call(this),this.revision_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.changed=function(){++this.revision_,this.dispatchEvent(o.a.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.on=function(e,t){if(Array.isArray(e)){for(var n=e.length,i=new Array(n),o=0;ox&&(d=(f+p)/2,Object(i.c)(e,t,n,o,d,g)&&(w=d,x=k)),f=p}return isNaN(w)&&(w=a[s]),l?(l.push(w,g,x),l):[w,g,x]}function a(e,t,n,r,i){for(var a=[],s=0,l=n.length;sthis.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(o.a.CLEAR)},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e,t){for(var n=this.oldest_;n;)e.call(t,n.value_,n.key_,this),n=n.newer},t.prototype.get=function(e){var t=this.entries_[e];return Object(r.a)(void 0!==t,15),t===this.newest_||(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t),t.value_},t.prototype.remove=function(e){var t=this.entries_[e];return Object(r.a)(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e,t=new Array(this.count_),n=0;for(e=this.newest_;e;e=e.older)t[n++]=e.key_;return t},t.prototype.getValues=function(){var e,t=new Array(this.count_),n=0;for(e=this.newest_;e;e=e.older)t[n++]=e.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t.prototype.set=function(e,t){Object(r.a)(!(e in this.entries_),16);var n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t}(i.a);t.a=a},function(e,t,n){"use strict";t.a={IMAGE:"image",VECTOR:"vector"}},function(e,t,n){"use strict";function r(e,t,n,r){for(var i=e[t],o=e[t+1],a=0,s=t+r;s=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(1232)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(70))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),i={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},o={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:r?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},a={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=1;s<20;s++)a["f"+s]=111+s;function l(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return u(e,t)})),i=function(e){return r.some((function(t){return c(t,e)}))};return null==n?i:i(n)}function u(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),a=o.length;for(var s in i)r[i[s]]=!1;var l=!0,u=!1,c=void 0;try{for(var p,h=o[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var m=p.value,g=m.endsWith("?");g&&(m=m.slice(0,-1));var v=f(m),y=i[v];1!==a&&y||(n?r.key=v:r.which=d(m)),y&&(r[y]=!g||null)}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}return r}function c(e,t){for(var n in e){var r=e[n],i=void 0;if(null!=r&&((null!=(i="key"===n?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&i!==r))return!1}return!0}function d(e){return e=f(e),a[e]||e.toUpperCase().charCodeAt(0)}function f(e){return e=e.toLowerCase(),e=o[e]||e}t.default=l,t.isHotkey=l,t.isCodeHotkey=function(e,t){return l(e,t)},t.isKeyHotkey=function(e,t){return l(e,{byKey:!0},t)},t.parseHotkey=u,t.compareHotkey=c,t.toKeyCode=d,t.toKeyName=f},,function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){var r=n(240),i=n(209),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(44),i=n(182),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(721),i=n(733),o=n(735),a=n(736),s=n(737);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(251),i=n(757),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(770),i=n(453)(r);e.exports=i},function(e,t,n){var r=n(323),i=n(772),o=n(773);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},function(e,t){e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o=200){var m=t?null:s(e);if(m)return l(m);f=!1,c=a,h=new r}else h=t?[]:p;e:for(;++u({yml:o.default,yaml:o.default,toml:a.default,json:s.default,frontmatter:l.FrontmatterInfer,"json-frontmatter":(0,l.frontmatterJSON)(t),"toml-frontmatter":(0,l.frontmatterTOML)(t),"yaml-frontmatter":(0,l.frontmatterYAML)(t)}[e])},function(e,t,n){e.exports=n(1680).YAML},function(module,exports,__webpack_require__){"use strict";(function(global){module.exports=makeParserClass(__webpack_require__(782)),module.exports.makeParserClass=makeParserClass;class TomlError extends Error{constructor(e){super(e),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,TomlError),this.fromTOML=!0,this.wrapped=null}}TomlError.wrap=e=>{const t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t},module.exports.TomlError=TomlError;const createDateTime=__webpack_require__(783),createDateTimeFloat=__webpack_require__(784),createDate=__webpack_require__(785),createTime=__webpack_require__(786),CTRL_I=9,CTRL_J=10,CTRL_M=13,CTRL_CHAR_BOUNDARY=31,CHAR_SP=32,CHAR_QUOT=34,CHAR_NUM=35,CHAR_APOS=39,CHAR_PLUS=43,CHAR_COMMA=44,CHAR_HYPHEN=45,CHAR_PERIOD=46,CHAR_0=48,CHAR_1=49,CHAR_7=55,CHAR_9=57,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_A=65,CHAR_E=69,CHAR_F=70,CHAR_T=84,CHAR_U=85,CHAR_Z=90,CHAR_LOWBAR=95,CHAR_a=97,CHAR_b=98,CHAR_e=101,CHAR_f=102,CHAR_i=105,CHAR_l=108,CHAR_n=110,CHAR_o=111,CHAR_r=114,CHAR_s=115,CHAR_t=116,CHAR_u=117,CHAR_x=120,CHAR_z=122,CHAR_LCUB=123,CHAR_RCUB=125,CHAR_LSQB=91,CHAR_BSOL=92,CHAR_RSQB=93,CHAR_DEL=127,SURROGATE_FIRST=55296,SURROGATE_LAST=57343,escapes={[CHAR_b]:"\b",[CHAR_t]:"\t",[CHAR_n]:"\n",[CHAR_f]:"\f",[CHAR_r]:"\r",[CHAR_QUOT]:'"',[CHAR_BSOL]:"\\"};function isDigit(e){return e>=CHAR_0&&e<=CHAR_9}function isHexit(e){return e>=CHAR_A&&e<=CHAR_F||e>=CHAR_a&&e<=CHAR_f||e>=CHAR_0&&e<=CHAR_9}function isBit(e){return e===CHAR_1||e===CHAR_0}function isOctit(e){return e>=CHAR_0&&e<=CHAR_7}function isAlphaNumQuoteHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_APOS||e===CHAR_QUOT||e===CHAR_LOWBAR||e===CHAR_HYPHEN}function isAlphaNumHyphen(e){return e>=CHAR_A&&e<=CHAR_Z||e>=CHAR_a&&e<=CHAR_z||e>=CHAR_0&&e<=CHAR_9||e===CHAR_LOWBAR||e===CHAR_HYPHEN}const _type=Symbol("type"),_declared=Symbol("declared"),hasOwnProperty=Object.prototype.hasOwnProperty,defineProperty=Object.defineProperty,descriptor={configurable:!0,enumerable:!0,writable:!0,value:void 0};function hasKey(e,t){return!!hasOwnProperty.call(e,t)||("__proto__"===t&&defineProperty(e,"__proto__",descriptor),!1)}const INLINE_TABLE=Symbol("inline-table");function InlineTable(){return Object.defineProperties({},{[_type]:{value:INLINE_TABLE}})}function isInlineTable(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_TABLE}const TABLE=Symbol("table");function Table(){return Object.defineProperties({},{[_type]:{value:TABLE},[_declared]:{value:!1,writable:!0}})}function isTable(e){return null!==e&&"object"==typeof e&&e[_type]===TABLE}const _contentType=Symbol("content-type"),INLINE_LIST=Symbol("inline-list");function InlineList(e){return Object.defineProperties([],{[_type]:{value:INLINE_LIST},[_contentType]:{value:e}})}function isInlineList(e){return null!==e&&"object"==typeof e&&e[_type]===INLINE_LIST}const LIST=Symbol("list");function List(){return Object.defineProperties([],{[_type]:{value:LIST}})}function isList(e){return null!==e&&"object"==typeof e&&e[_type]===LIST}let _custom;try{const utilInspect=eval("require('util').inspect");_custom=utilInspect.custom}catch(e){}const _inspect=_custom||"inspect";class BoxedBigInt{constructor(e){try{this.value=global.BigInt.asIntN(64,e)}catch(e){this.value=null}Object.defineProperty(this,_type,{value:INTEGER})}isNaN(){return null===this.value}toString(){return String(this.value)}[_inspect](){return`[BigInt: ${this.toString()}]}`}valueOf(){return this.value}}const INTEGER=Symbol("integer");function Integer(e){let t=Number(e);return Object.is(t,-0)&&(t=0),global.BigInt&&!Number.isSafeInteger(t)?new BoxedBigInt(e):Object.defineProperties(new Number(t),{isNaN:{value:function(){return isNaN(this)}},[_type]:{value:INTEGER},[_inspect]:{value:()=>`[Integer: ${e}]`}})}function isInteger(e){return null!==e&&"object"==typeof e&&e[_type]===INTEGER}const FLOAT=Symbol("float");function Float(e){return Object.defineProperties(new Number(e),{[_type]:{value:FLOAT},[_inspect]:{value:()=>`[Float: ${e}]`}})}function isFloat(e){return null!==e&&"object"==typeof e&&e[_type]===FLOAT}function tomlType(e){const t=typeof e;if("object"===t){if(null===e)return"null";if(e instanceof Date)return"datetime";if(_type in e)switch(e[_type]){case INLINE_TABLE:return"inline-table";case INLINE_LIST:return"inline-list";case TABLE:return"table";case LIST:return"list";case FLOAT:return"float";case INTEGER:return"integer"}}return t}function makeParserClass(e){return class extends e{constructor(){super(),this.ctx=this.obj=Table()}atEndOfWord(){return this.char===CHAR_NUM||this.char===CTRL_I||this.char===CHAR_SP||this.atEndOfLine()}atEndOfLine(){return this.char===e.END||this.char===CTRL_J||this.char===CTRL_M}parseStart(){if(this.char===e.END)return null;if(this.char===CHAR_LSQB)return this.call(this.parseTableOrList);if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(isAlphaNumQuoteHyphen(this.char))return this.callNow(this.parseAssignStatement);throw this.error(new TomlError(`Unknown character "${this.char}"`))}parseWhitespaceToEOL(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M)return null;if(this.char===CHAR_NUM)return this.goto(this.parseComment);if(this.char===e.END||this.char===CTRL_J)return this.return();throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"))}parseAssignStatement(){return this.callNow(this.parseAssign,this.recordAssignStatement)}recordAssignStatement(e){let t=this.ctx,n=e.key.pop();for(let n of e.key){if(hasKey(t,n)&&(!isTable(t[n])||t[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));t=t[n]=t[n]||Table()}if(hasKey(t,n))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(e.value)||isFloat(e.value)?t[n]=e.value.valueOf():t[n]=e.value,this.goto(this.parseWhitespaceToEOL)}parseAssign(){return this.callNow(this.parseKeyword,this.recordAssignKeyword)}recordAssignKeyword(e){return this.state.resultTable?this.state.resultTable.push(e):this.state.resultTable=[e],this.goto(this.parseAssignKeywordPreDot)}parseAssignKeywordPreDot(){return this.char===CHAR_PERIOD?this.next(this.parseAssignKeywordPostDot):this.char!==CHAR_SP&&this.char!==CTRL_I?this.goto(this.parseAssignEqual):void 0}parseAssignKeywordPostDot(){if(this.char!==CHAR_SP&&this.char!==CTRL_I)return this.callNow(this.parseKeyword,this.recordAssignKeyword)}parseAssignEqual(){if(this.char===CHAR_EQUALS)return this.next(this.parseAssignPreValue);throw this.error(new TomlError('Invalid character, expected "="'))}parseAssignPreValue(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseValue,this.recordAssignValue)}recordAssignValue(e){return this.returnNow({key:this.state.resultTable,value:e})}parseComment(){do{if(this.char===e.END||this.char===CTRL_J)return this.return()}while(this.nextChar())}parseTableOrList(){if(this.char!==CHAR_LSQB)return this.goto(this.parseTable);this.next(this.parseList)}parseTable(){return this.ctx=this.obj,this.goto(this.parseTableNext)}parseTableNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseTableMore)}parseTableMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)&&(!isTable(this.ctx[e])||this.ctx[e][_declared]))throw this.error(new TomlError("Can't redefine existing key"));return this.ctx=this.ctx[e]=this.ctx[e]||Table(),this.ctx[_declared]=!0,this.next(this.parseWhitespaceToEOL)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e))if(isTable(this.ctx[e]))this.ctx=this.ctx[e];else{if(!isList(this.ctx[e]))throw this.error(new TomlError("Can't redefine existing key"));this.ctx=this.ctx[e][this.ctx[e].length-1]}else this.ctx=this.ctx[e]=Table();return this.next(this.parseTableNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseList(){return this.ctx=this.obj,this.goto(this.parseListNext)}parseListNext(){return this.char===CHAR_SP||this.char===CTRL_I?null:this.callNow(this.parseKeyword,this.parseListMore)}parseListMore(e){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CHAR_RSQB){if(hasKey(this.ctx,e)||(this.ctx[e]=List()),isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(!isList(this.ctx[e]))throw this.error(new TomlError("Can't redefine an existing key"));{const t=Table();this.ctx[e].push(t),this.ctx=t}return this.next(this.parseListEnd)}if(this.char===CHAR_PERIOD){if(hasKey(this.ctx,e)){if(isInlineList(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline array"));if(isInlineTable(this.ctx[e]))throw this.error(new TomlError("Can't extend an inline table"));if(isList(this.ctx[e]))this.ctx=this.ctx[e][this.ctx[e].length-1];else{if(!isTable(this.ctx[e]))throw this.error(new TomlError("Can't redefine an existing key"));this.ctx=this.ctx[e]}}else this.ctx=this.ctx[e]=Table();return this.next(this.parseListNext)}throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseListEnd(e){if(this.char===CHAR_RSQB)return this.next(this.parseWhitespaceToEOL);throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"))}parseValue(){if(this.char===e.END)throw this.error(new TomlError("Key without value"));if(this.char===CHAR_QUOT)return this.next(this.parseDoubleString);if(this.char===CHAR_APOS)return this.next(this.parseSingleString);if(this.char===CHAR_HYPHEN||this.char===CHAR_PLUS)return this.goto(this.parseNumberSign);if(this.char===CHAR_i)return this.next(this.parseInf);if(this.char===CHAR_n)return this.next(this.parseNan);if(isDigit(this.char))return this.goto(this.parseNumberOrDateTime);if(this.char===CHAR_t||this.char===CHAR_f)return this.goto(this.parseBoolean);if(this.char===CHAR_LSQB)return this.call(this.parseInlineList,this.recordValue);if(this.char===CHAR_LCUB)return this.call(this.parseInlineTable,this.recordValue);throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"))}recordValue(e){return this.returnNow(e)}parseInf(){if(this.char===CHAR_n)return this.next(this.parseInf2);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseInf2(){if(this.char===CHAR_f)return"-"===this.state.buf?this.return(-1/0):this.return(1/0);throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'))}parseNan(){if(this.char===CHAR_a)return this.next(this.parseNan2);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseNan2(){if(this.char===CHAR_n)return this.return(NaN);throw this.error(new TomlError('Unexpected character, expected "nan"'))}parseKeyword(){return this.char===CHAR_QUOT?this.next(this.parseBasicString):this.char===CHAR_APOS?this.next(this.parseLiteralString):this.goto(this.parseBareKey)}parseBareKey(){do{if(this.char===e.END)throw this.error(new TomlError("Key ended without value"));if(!isAlphaNumHyphen(this.char)){if(0===this.state.buf.length)throw this.error(new TomlError("Empty bare keys are not allowed"));return this.returnNow()}this.consume()}while(this.nextChar())}parseSingleString(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiStringMaybe):this.goto(this.parseLiteralString)}parseLiteralString(){do{if(this.char===CHAR_APOS)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiStringMaybe(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiString):this.returnNow()}parseLiteralMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseLiteralMultiStringContent):this.goto(this.parseLiteralMultiStringContent)}parseLiteralMultiStringContent(){do{if(this.char===CHAR_APOS)return this.next(this.parseLiteralMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}parseLiteralMultiEnd(){return this.char===CHAR_APOS?this.next(this.parseLiteralMultiEnd2):(this.state.buf+="'",this.goto(this.parseLiteralMultiStringContent))}parseLiteralMultiEnd2(){return this.char===CHAR_APOS?this.return():(this.state.buf+="''",this.goto(this.parseLiteralMultiStringContent))}parseDoubleString(){return this.char===CHAR_QUOT?this.next(this.parseMultiStringMaybe):this.goto(this.parseBasicString)}parseBasicString(){do{if(this.char===CHAR_BSOL)return this.call(this.parseEscape,this.recordEscapeReplacement);if(this.char===CHAR_QUOT)return this.return();if(this.atEndOfLine())throw this.error(new TomlError("Unterminated string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}recordEscapeReplacement(e){return this.state.buf+=e,this.goto(this.parseBasicString)}parseMultiStringMaybe(){return this.char===CHAR_QUOT?this.next(this.parseMultiString):this.returnNow()}parseMultiString(){return this.char===CTRL_M?null:this.char===CTRL_J?this.next(this.parseMultiStringContent):this.goto(this.parseMultiStringContent)}parseMultiStringContent(){do{if(this.char===CHAR_BSOL)return this.call(this.parseMultiEscape,this.recordMultiEscapeReplacement);if(this.char===CHAR_QUOT)return this.next(this.parseMultiEnd);if(this.char===e.END)throw this.error(new TomlError("Unterminated multi-line string"));if(this.char===CHAR_DEL||this.char<=CTRL_CHAR_BOUNDARY&&this.char!==CTRL_I&&this.char!==CTRL_J&&this.char!==CTRL_M)throw this.errorControlCharInString();this.consume()}while(this.nextChar())}errorControlCharInString(){let e="\\u00";return this.char<16&&(e+="0"),e+=this.char.toString(16),this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${e} instead`))}recordMultiEscapeReplacement(e){return this.state.buf+=e,this.goto(this.parseMultiStringContent)}parseMultiEnd(){return this.char===CHAR_QUOT?this.next(this.parseMultiEnd2):(this.state.buf+='"',this.goto(this.parseMultiStringContent))}parseMultiEnd2(){return this.char===CHAR_QUOT?this.return():(this.state.buf+='""',this.goto(this.parseMultiStringContent))}parseMultiEscape(){return this.char===CTRL_M||this.char===CTRL_J?this.next(this.parseMultiTrim):this.char===CHAR_SP||this.char===CTRL_I?this.next(this.parsePreMultiTrim):this.goto(this.parseEscape)}parsePreMultiTrim(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===CTRL_M||this.char===CTRL_J)return this.next(this.parseMultiTrim);throw this.error(new TomlError("Can't escape whitespace"))}parseMultiTrim(){return this.char===CTRL_J||this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M?null:this.returnNow()}parseEscape(){if(this.char in escapes)return this.return(escapes[this.char]);if(this.char===CHAR_u)return this.call(this.parseSmallUnicode,this.parseUnicodeReturn);if(this.char===CHAR_U)return this.call(this.parseLargeUnicode,this.parseUnicodeReturn);throw this.error(new TomlError("Unknown escape character: "+this.char))}parseUnicodeReturn(e){try{const t=parseInt(e,16);if(t>=SURROGATE_FIRST&&t<=SURROGATE_LAST)throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));return this.returnNow(String.fromCodePoint(t))}catch(e){throw this.error(TomlError.wrap(e))}}parseSmallUnicode(){if(!isHexit(this.char))throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));if(this.consume(),this.state.buf.length>=4)return this.return()}parseLargeUnicode(){if(!isHexit(this.char))throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));if(this.consume(),this.state.buf.length>=8)return this.return()}parseNumberSign(){return this.consume(),this.next(this.parseMaybeSignedInfOrNan)}parseMaybeSignedInfOrNan(){return this.char===CHAR_i?this.next(this.parseInf):this.char===CHAR_n?this.next(this.parseNan):this.callNow(this.parseNoUnder,this.parseNumberIntegerStart)}parseNumberIntegerStart(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberIntegerExponentOrDecimal)):this.goto(this.parseNumberInteger)}parseNumberIntegerExponentOrDecimal(){return this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Integer(this.state.buf))}parseNumberInteger(){if(!isDigit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnder);if(this.char===CHAR_E||this.char===CHAR_e)return this.consume(),this.next(this.parseNumberExponentSign);if(this.char===CHAR_PERIOD)return this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat);{const e=Integer(this.state.buf);if(e.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(e)}}this.consume()}parseNoUnder(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD||this.char===CHAR_E||this.char===CHAR_e)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNoUnderHexOctBinLiteral(){if(this.char===CHAR_LOWBAR||this.char===CHAR_PERIOD)throw this.error(new TomlError("Unexpected character, expected digit"));if(this.atEndOfWord())throw this.error(new TomlError("Incomplete number"));return this.returnNow()}parseNumberFloat(){return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder,this.parseNumberFloat):isDigit(this.char)?void this.consume():this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.returnNow(Float(this.state.buf))}parseNumberExponentSign(){if(isDigit(this.char))return this.goto(this.parseNumberExponent);if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS)throw this.error(new TomlError("Unexpected character, expected -, + or digit"));this.consume(),this.call(this.parseNoUnder,this.parseNumberExponent)}parseNumberExponent(){if(!isDigit(this.char))return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder):this.returnNow(Float(this.state.buf));this.consume()}parseNumberOrDateTime(){return this.char===CHAR_0?(this.consume(),this.next(this.parseNumberBaseOrDateTime)):this.goto(this.parseNumberOrDateTimeOnly)}parseNumberOrDateTimeOnly(){return this.char===CHAR_LOWBAR?this.call(this.parseNoUnder,this.parseNumberInteger):isDigit(this.char)?(this.consume(),void(this.state.buf.length>4&&this.next(this.parseNumberInteger))):this.char===CHAR_E||this.char===CHAR_e?(this.consume(),this.next(this.parseNumberExponentSign)):this.char===CHAR_PERIOD?(this.consume(),this.call(this.parseNoUnder,this.parseNumberFloat)):this.char===CHAR_HYPHEN?this.goto(this.parseDateTime):this.char===CHAR_COLON?this.goto(this.parseOnlyTimeHour):this.returnNow(Integer(this.state.buf))}parseDateTimeOnly(){if(this.state.buf.length<4){if(isDigit(this.char))return this.consume();if(this.char===CHAR_COLON)return this.goto(this.parseOnlyTimeHour);throw this.error(new TomlError("Expected digit while parsing year part of a date"))}if(this.char===CHAR_HYPHEN)return this.goto(this.parseDateTime);throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"))}parseNumberBaseOrDateTime(){return this.char===CHAR_b?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerBin)):this.char===CHAR_o?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerOct)):this.char===CHAR_x?(this.consume(),this.call(this.parseNoUnderHexOctBinLiteral,this.parseIntegerHex)):this.char===CHAR_PERIOD?this.goto(this.parseNumberInteger):isDigit(this.char)?this.goto(this.parseDateTimeOnly):this.returnNow(Integer(this.state.buf))}parseIntegerHex(){if(!isHexit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const e=Integer(this.state.buf);if(e.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(e)}}this.consume()}parseIntegerOct(){if(!isOctit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const e=Integer(this.state.buf);if(e.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(e)}}this.consume()}parseIntegerBin(){if(!isBit(this.char)){if(this.char===CHAR_LOWBAR)return this.call(this.parseNoUnderHexOctBinLiteral);{const e=Integer(this.state.buf);if(e.isNaN())throw this.error(new TomlError("Invalid number"));return this.returnNow(e)}}this.consume()}parseDateTime(){if(this.state.buf.length<4)throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseDateMonth)}parseDateMonth(){if(this.char===CHAR_HYPHEN){if(this.state.buf.length<2)throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseDateDay)}if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseDateDay(){if(this.char===CHAR_T||this.char===CHAR_SP){if(this.state.buf.length<2)throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));return this.state.result+="-"+this.state.buf,this.state.buf="",this.next(this.parseStartTimeHour)}if(this.atEndOfWord())return this.returnNow(createDate(this.state.result+"-"+this.state.buf));if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseStartTimeHour(){return this.atEndOfWord()?this.returnNow(createDate(this.state.result)):this.goto(this.parseTimeHour)}parseTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result+="T"+this.state.buf,this.state.buf="",this.next(this.parseTimeMin)}if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));this.consume()}parseTimeMin(){if(!(this.state.buf.length<2&&isDigit(this.char))){if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeSec);throw this.error(new TomlError("Incomplete datetime"))}this.consume()}parseTimeSec(){if(!isDigit(this.char))throw this.error(new TomlError("Incomplete datetime"));if(this.consume(),2===this.state.buf.length)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseTimeZoneOrFraction)}parseOnlyTimeHour(){if(this.char===CHAR_COLON){if(this.state.buf.length<2)throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));return this.state.result=this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeMin)}throw this.error(new TomlError("Incomplete time"))}parseOnlyTimeMin(){if(!(this.state.buf.length<2&&isDigit(this.char))){if(2===this.state.buf.length&&this.char===CHAR_COLON)return this.state.result+=":"+this.state.buf,this.state.buf="",this.next(this.parseOnlyTimeSec);throw this.error(new TomlError("Incomplete time"))}this.consume()}parseOnlyTimeSec(){if(!isDigit(this.char))throw this.error(new TomlError("Incomplete time"));if(this.consume(),2===this.state.buf.length)return this.next(this.parseOnlyTimeFractionMaybe)}parseOnlyTimeFractionMaybe(){if(this.state.result+=":"+this.state.buf,this.char!==CHAR_PERIOD)return this.return(createTime(this.state.result));this.state.buf="",this.next(this.parseOnlyTimeFraction)}parseOnlyTimeFraction(){if(!isDigit(this.char)){if(this.atEndOfWord()){if(0===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));return this.returnNow(createTime(this.state.result+"."+this.state.buf))}throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume()}parseTimeZoneOrFraction(){if(this.char===CHAR_PERIOD)this.consume(),this.next(this.parseDateTimeFraction);else{if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS){if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume(),this.next(this.parseTimeZoneHour)}}parseDateTimeFraction(){if(isDigit(this.char))this.consume();else{if(1===this.state.buf.length)throw this.error(new TomlError("Expected digit in milliseconds"));if(this.char!==CHAR_HYPHEN&&this.char!==CHAR_PLUS){if(this.char===CHAR_Z)return this.consume(),this.return(createDateTime(this.state.result+this.state.buf));if(this.atEndOfWord())return this.returnNow(createDateTimeFloat(this.state.result+this.state.buf));throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"))}this.consume(),this.next(this.parseTimeZoneHour)}}parseTimeZoneHour(){if(!isDigit(this.char))throw this.error(new TomlError("Unexpected character in datetime, expected digit"));if(this.consume(),/\d\d$/.test(this.state.buf))return this.next(this.parseTimeZoneSep)}parseTimeZoneSep(){if(this.char!==CHAR_COLON)throw this.error(new TomlError("Unexpected character in datetime, expected colon"));this.consume(),this.next(this.parseTimeZoneMin)}parseTimeZoneMin(){if(!isDigit(this.char))throw this.error(new TomlError("Unexpected character in datetime, expected digit"));if(this.consume(),/\d\d$/.test(this.state.buf))return this.return(createDateTime(this.state.result+this.state.buf))}parseBoolean(){return this.char===CHAR_t?(this.consume(),this.next(this.parseTrue_r)):this.char===CHAR_f?(this.consume(),this.next(this.parseFalse_a)):void 0}parseTrue_r(){if(this.char===CHAR_r)return this.consume(),this.next(this.parseTrue_u);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_u(){if(this.char===CHAR_u)return this.consume(),this.next(this.parseTrue_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseTrue_e(){if(this.char===CHAR_e)return this.return(!0);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_a(){if(this.char===CHAR_a)return this.consume(),this.next(this.parseFalse_l);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_l(){if(this.char===CHAR_l)return this.consume(),this.next(this.parseFalse_s);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_s(){if(this.char===CHAR_s)return this.consume(),this.next(this.parseFalse_e);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseFalse_e(){if(this.char===CHAR_e)return this.return(!1);throw this.error(new TomlError("Invalid boolean, expected true or false"))}parseInlineList(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===e.END)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_NUM?this.call(this.parseComment):this.char===CHAR_RSQB?this.return(this.state.resultArr||InlineList()):this.callNow(this.parseValue,this.recordInlineListValue)}recordInlineListValue(e){if(this.state.resultArr){const t=this.state.resultArr[_contentType],n=tomlType(e);if(t!==n)throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${t} and ${n}`))}else this.state.resultArr=InlineList(tomlType(e));return isFloat(e)||isInteger(e)?this.state.resultArr.push(e.valueOf()):this.state.resultArr.push(e),this.goto(this.parseInlineListNext)}parseInlineListNext(){if(this.char===CHAR_SP||this.char===CTRL_I||this.char===CTRL_M||this.char===CTRL_J)return null;if(this.char===CHAR_NUM)return this.call(this.parseComment);if(this.char===CHAR_COMMA)return this.next(this.parseInlineList);if(this.char===CHAR_RSQB)return this.goto(this.parseInlineList);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}parseInlineTable(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));return this.char===CHAR_RCUB?this.return(this.state.resultTable||InlineTable()):(this.state.resultTable||(this.state.resultTable=InlineTable()),this.callNow(this.parseAssign,this.recordInlineTableValue))}recordInlineTableValue(e){let t=this.state.resultTable,n=e.key.pop();for(let n of e.key){if(hasKey(t,n)&&(!isTable(t[n])||t[n][_declared]))throw this.error(new TomlError("Can't redefine existing key"));t=t[n]=t[n]||Table()}if(hasKey(t,n))throw this.error(new TomlError("Can't redefine existing key"));return isInteger(e.value)||isFloat(e.value)?t[n]=e.value.valueOf():t[n]=e.value,this.goto(this.parseInlineTableNext)}parseInlineTableNext(){if(this.char===CHAR_SP||this.char===CTRL_I)return null;if(this.char===e.END||this.char===CHAR_NUM||this.char===CTRL_J||this.char===CTRL_M)throw this.error(new TomlError("Unterminated inline array"));if(this.char===CHAR_COMMA)return this.next(this.parseInlineTable);if(this.char===CHAR_RCUB)return this.goto(this.parseInlineTable);throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"))}}}}).call(this,__webpack_require__(43))},function(e,t,n){"use strict";e.exports=(e,t)=>{for(t=String(t);t.length "+r[t]+"\n",n+=o+" ";for(let t=0;t0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var u=l.length,c=g(l,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(466)).Stream=t,t.Readable=t,t.Writable=n(336),t.Duplex=n(159),t.Transform=n(470),t.PassThrough=n(796)},function(e,t,n){var r=n(157),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(t,r,i){var o=n(258);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 i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,l=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:o.nextTick;y.WritableState=v;var u=Object.create(n(218));u.inherits=n(158);var c={deprecate:n(794)},d=n(467),f=n(335).Buffer,p=i.Uint8Array||function(){};var h,m=n(468);function g(){}function v(e,t){s=s||n(159),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(u||0===u)?u:c,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 d=!1===e.decodeStrings;this.decodeStrings=!d,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,i=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,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),E(e,t))}(e,n,r,t,i);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?l(_,e,n,a,i):_(e,n,a,i)}}(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 y(e){if(s=s||n(159),!(h.call(y,this)||this instanceof s))return new y(e);this._writableState=new v(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)),d.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),E(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,d=n.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var n=x(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(y,d),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.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(y,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===y&&(e&&e._writableState instanceof v)}})):h=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,f.isBuffer(r)||r instanceof p);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=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!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),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){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,i);r!==a&&(n=!0,i="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(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.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,E(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(70),n(465).setImmediate,n(43))},function(e,t,n){"use strict";var r=n(187);e.exports=new r({explicit:[n(813),n(814),n(815)]})},function(e,t,n){"use strict";(function(e){const r=n(830),i=n(259);t.define=function(e,t,n){Reflect.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})},t.isBuffer=e=>"buffer"===i(e),t.isObject=e=>"object"===i(e),t.toBuffer=function(t){return"string"==typeof t?e.from(t):t},t.toString=function(e){if(t.isBuffer(e))return r(String(e));if("string"!=typeof e)throw new TypeError("expected input to be a string or buffer");return r(e)},t.arrayify=function(e){return e?Array.isArray(e)?e:[e]:[]},t.startsWith=function(e,t,n){return"number"!=typeof n&&(n=t.length),e.slice(0,n)===t}}).call(this,n(157).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.selectUseWorkflow=t.selectLocale=void 0;var r=n(4),i=n(160),o=n(103);const a=(0,r.Map)({isFetching:!0});t.selectLocale=e=>e.get("locale","en");t.selectUseWorkflow=e=>e.get("publish_mode")===o.EDITORIAL_WORKFLOW;var s=(e=a,t)=>{switch(t.type){case i.CONFIG_MERGE:return e.mergeDeep(t.payload);case i.CONFIG_REQUEST:return e.set("isFetching",!0);case i.CONFIG_SUCCESS:return t.payload.delete("isFetching");case i.CONFIG_FAILURE:return e.withMutations(e=>{e.delete("isFetching"),e.set("error",t.payload.toString())});default:return e}};t.default=s},function(e,t,n){"use strict";var r=n(837),i=n(341),o=n(188),a=n(477),s=n(839);function l(e,t,n){var r=this._refs[n];if("string"==typeof r){if(!this._refs[r])return l.call(this,e,t,r);r=this._refs[r]}if((r=r||this._schemas[n])instanceof a)return h(r.schema,this._opts.inlineRefs)?r.schema:r.validate||this._compile(r);var i,o,s,c=u.call(this,t,n);return c&&(i=c.schema,t=c.root,s=c.baseId),i instanceof a?o=i.validate||e.call(this,i.schema,t,void 0,s):void 0!==i&&(o=h(i,this._opts.inlineRefs)?i:e.call(this,i,t,void 0,s)),o}function u(e,t){var n=r.parse(t),i=g(n),o=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||i!==o){var s=y(i),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,n);if(l instanceof a)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof a))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:o};e=l}if(!e.schema)return;o=m(this._getId(e.schema))}return f.call(this,n,o,e.schema,e)}function c(e,t,n){var r=u.call(this,e,t);if(r){var i=r.schema,o=r.baseId;e=r.root;var a=this._getId(i);return a&&(o=b(o,a)),f.call(this,n,o,i,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),n={"":t},a={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,d,f,p){if(""!==t){var h=u._getId(e),m=n[c],g=a[c]+"/"+d;if(void 0!==p&&(g+="/"+("number"==typeof p?p:o.escapeFragment(p))),"string"==typeof h){h=m=y(m?r.resolve(m,h):h);var v=u._refs[h];if("string"==typeof v&&(v=u._refs[v]),v&&v.schema){if(!i(e,v.schema))throw new Error('id "'+h+'" resolves to more than one schema')}else if(h!=y(g))if("#"==h[0]){if(l[h]&&!i(e,l[h]))throw new Error('id "'+h+'" resolves to more than one schema');l[h]=e}else u._refs[h]=g}n[t]=m,a[t]=g}})),l},l.inlineRef=h,l.schema=u;var d=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,t,n,r){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var i=e.fragment.split("/"),a=1;a{switch(o){case"algolia":n=n.set("algolia",new r.default(e));break;case"assetStore":n=n.set("assetStore",new i.default(e,t))}}),n}const l=function(){let e=null;return(t,n,r)=>(e||(e=s(t,n)),e.get(r))}();t.getIntegrationProvider=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createEntry=function(e,t="",n="",r={}){return{collection:e,slug:t,path:n,partial:r.partial||!1,raw:r.raw||"",data:r.data||{},label:r.label||null,isModification:(0,i.default)(r.isModification)?r.isModification:null,mediaFiles:r.mediaFiles||[],author:r.author||"",updatedOn:r.updatedOn||"",status:r.status||"",meta:r.meta||{}}};var r,i=(r=n(900))&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.API_ERROR=void 0;t.API_ERROR="API_ERROR";class i extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Error)){constructor(e,t,n,i={}){super(e),r(this,"message",void 0),r(this,"status",void 0),r(this,"api",void 0),r(this,"meta",void 0),this.message=e,this.status=t,this.api=n,this.name="API_ERROR",this.meta=i}}t.default=i},function(e,t,n){var r=n(264),i=n(348);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(492),i=n(458),o=r?function(e){return r.get(e)}:i;e.exports=o},function(e,t,n){var r=n(264),i=n(348);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(4),i=s(n(495)),o=s(n(124)),a=s(n(353));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t{if(t&&t.signal||"undefined"==typeof window||!window.AbortController)return fetch(e,t);const n=new AbortController,r=setTimeout(()=>n.abort(),6e4);return fetch(e,u(u({},t),{},{signal:n.signal})).then(e=>(clearTimeout(r),e)).catch(e=>{if("AbortError"===e.name||"DOMException"===e.name)throw new Error("Request timed out after 60 seconds");throw e})},f=e=>{const[t,n]=e.split("?");return(0,r.Map)(u({url:t},n?{params:(i=n,(0,r.List)(i.split("&")).map(e=>(0,r.List)(e.split("=")).map(decodeURIComponent)).update(r.Map))}:{}));var i},p=e=>{return`${e.get("url")}${e.get("params")?"?"+(t=e.get("params"),t.entrySeq().map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&")):""}`;var t},h=e=>(0,a.default)(e)?f(e):e?(0,r.fromJS)(e):(0,r.Map)(),m=(g=e=>{const t=(e=>[p(e),e.remove("url").remove("params").toJS()])(e);return d(...t)},e=>g(h(e)));var g;const v=(0,o.default)([e=>(t,n)=>e(t,h(n)),i.default]),y=e=>v((t,n)=>n.setIn(e,t)),b=e=>v((t,n)=>n.updateIn(e,(e=(0,r.Map)())=>e.merge(t))),_=y(["method"]),w=y(["body"]),x=y(["cache"])("no-cache"),k=b(["params"]),E=b(["headers"]),S=new RegExp("^(?:[a-z]+:)?//","i"),O=v((e,t)=>t.update("url",t=>S.test(t)?t:e&&t&&"/"!==t[0]&&"/"!==e[e.length-1]?`${e}/${t}`:`${e}${t}`));var T={toURL:p,fromURL:f,fromFetchArguments:(e,t)=>f(e).merge((t?(0,r.fromJS)(t):(0,r.Map)()).remove("url").remove("params")),performRequest:m,withMethod:_,withBody:w,withHeaders:E,withParams:k,withRoot:O,withNoCache:x,fetchWithTimeout:d};t.default=T},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++nnew i.Cursor(e.getIn(["cursorsByType","collectionEntries",t]));var a=(e=(0,r.fromJS)({cursorsByType:{collectionEntries:{}}}),t)=>{switch(t.type){case o.ENTRIES_SUCCESS:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],i.Cursor.create(t.payload.cursor).store);case o.SORT_ENTRIES_SUCCESS:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={PRESENCE:"PRESENCE",PATTERN:"PATTERN",RANGE:"RANGE",CUSTOM:"CUSTOM"}},function(e,t,n){"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.SortDirection=void 0,t.SortDirection=r,function(e){e.Ascending="Ascending",e.Descending="Descending",e.None="None"}(r||(t.SortDirection=r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.selectCustomPath=void 0;var r=c(n(82)),i=n(4),o=c(n(140)),a=n(123),s=n(226),l=n(67),u=n(89);function c(e){return e&&e.__esModule?e:{default:e}}const d=(0,i.Map)({entry:(0,i.Map)(),fieldsMetaData:(0,i.Map)(),fieldsErrors:(0,i.Map)(),hasChanged:!1,key:""});t.selectCustomPath=(e,t)=>{if(!(0,l.selectHasMetaPath)(e))return;const n=t.getIn(["entry","meta"]),i=n&&n.get("path"),o=(0,r.default)(e.toJS(),["meta","path","index_file"]),a=(0,l.selectFolderEntryExtension)(e);return i&&(0,u.join)(e.get("folder"),i,`${o}.${a}`)};var f=(e=(0,i.Map)(),t)=>{switch(t.type){case a.DRAFT_CREATE_FROM_ENTRY:return e.withMutations(e=>{e.set("entry",(0,i.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,i.Map)()),e.set("fieldsErrors",(0,i.Map)()),e.set("hasChanged",!1),e.set("key",(0,o.default)())});case a.DRAFT_CREATE_EMPTY:return e.withMutations(e=>{e.set("entry",(0,i.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,i.Map)()),e.set("fieldsErrors",(0,i.Map)()),e.set("hasChanged",!1),e.set("key",(0,o.default)())});case a.DRAFT_CREATE_FROM_LOCAL_BACKUP:return e.withMutations(e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,i.Map)()),e.set("fieldsErrors",(0,i.Map)()),e.set("hasChanged",!0),e.set("key",(0,o.default)())});case a.DRAFT_CREATE_DUPLICATE_FROM_ENTRY:return e.withMutations(e=>{e.set("entry",(0,i.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,i.List)()),e.set("fieldsMetaData",(0,i.Map)()),e.set("fieldsErrors",(0,i.Map)()),e.set("hasChanged",!0)});case a.DRAFT_DISCARD:return d;case a.DRAFT_LOCAL_BACKUP_RETRIEVED:{const{entry:n}=t.payload,r=new i.Map({entry:(0,i.fromJS)(n)});return e.set("localBackup",r)}case a.DRAFT_CHANGE_FIELD:return e.withMutations(e=>{const{field:n,value:r,metadata:o,entries:a}=t.payload,s=n.get("name");n.get("meta")?e.setIn(["entry","meta",s],r):e.setIn(["entry","data",s],r),e.mergeDeepIn(["fieldsMetaData"],(0,i.fromJS)(o));const l=e.getIn(["entry","data"]),u=e.getIn(["entry","meta"]);e.set("hasChanged",!a.some(e=>l.equals(e.get("data")))||!a.some(e=>u.equals(e.get("meta"))))});case a.DRAFT_VALIDATION_ERRORS:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case a.DRAFT_CLEAR_ERRORS:return e.set("fieldsErrors",(0,i.Map)());case a.ENTRY_PERSIST_REQUEST:case s.UNPUBLISHED_ENTRY_PERSIST_REQUEST:return e.setIn(["entry","isPersisting"],!0);case a.ENTRY_PERSIST_FAILURE:case s.UNPUBLISHED_ENTRY_PERSIST_FAILURE:return e.deleteIn(["entry","isPersisting"]);case a.ENTRY_PERSIST_SUCCESS:case s.UNPUBLISHED_ENTRY_PERSIST_SUCCESS:return e.withMutations(e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)});case a.ENTRY_DELETE_SUCCESS:return e.withMutations(e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)});case a.ADD_DRAFT_ENTRY_MEDIA_FILE:return e.withMutations(e=>{const n=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],n.filterNot(e=>e.get("id")===t.payload.id).insert(0,(0,i.fromJS)(t.payload))),e.set("hasChanged",!0)});case a.REMOVE_DRAFT_ENTRY_MEDIA_FILE:return e.withMutations(e=>{const n=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],n.filterNot(e=>e.get("id")===t.payload.id)),e.set("hasChanged",!0)});default:return e}};t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_STYLE_GRID=t.VIEW_STYLE_LIST=void 0;t.VIEW_STYLE_LIST="VIEW_STYLE_LIST";t.VIEW_STYLE_GRID="VIEW_STYLE_GRID"},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";var r=n(987);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=((r=n(1))&&r.__esModule?r:{default:r}).default.createContext();t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}var o=n(1),a=n(1007).default,s=n(530),l=n(227);e.exports=function(e){var t,n;return n=t=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}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)}(n,t),n.prototype.render=function(){var t=this;return o.createElement(s.Consumer,null,(function(n){var r={};return l(r,t.props),l(r,{ambManager:n}),o.createElement(e,r,t.props.children)}))},n}(o.Component),t.displayName="withManagerContext("+a(e)+")",n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE="__NATIVE_FILE__",t.URL="__NATIVE_URL__",t.TEXT="__NATIVE_TEXT__"},function(e,t,n){"use strict";function r(e){return e&&e.$$typeof&&"Symbol(react.forward_ref)"===e.$$typeof.toString()}Object.defineProperty(t,"__esModule",{value:!0}),t.isRefForwardingComponent=r,t.isRefable=function(e){return(t=e)&&t.prototype&&"function"==typeof t.prototype.render||r(e);var t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(275),o=n(38);t.useDragDropManager=function(){var e=r.useContext(i.context).dragDropManager;return o(null!=e,"Expected drag drop context"),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=void 0;var r,i=n(1090);var o=((r=i)&&r.__esModule?r:{default:r}).default,a=o.canUseDOM?window.HTMLElement:{};t.canUseDOM=o.canUseDOM;t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.searchCollections=function(e,t){t?i.default.push(`/collections/${t}/search/${e}`):i.default.push("/search/"+e)},t.showCollection=function(e){i.default.push((0,o.getCollectionUrl)(e))},t.createNewEntry=function(e){i.default.push((0,o.getNewEntryUrl)(e))};var r,i=(r=n(152))&&r.__esModule?r:{default:r},o=n(164)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"GitHubBackend",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"API",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"AuthenticationPage",{enumerable:!0,get:function(){return o.default}}),t.NetlifyCmsBackendGithub=void 0;var r=a(n(1152)),i=a(n(373)),o=a(n(564));function a(e){return e&&e.__esModule?e:{default:e}}const s={GitHubBackend:r.default,API:i.default,AuthenticationPage:o.default};t.NetlifyCmsBackendGithub=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PullRequestState=t.MOCK_PULL_REQUEST=t.API_NAME=void 0;var r=h(n(138)),i=h(n(121)),o=h(n(565)),a=h(n(170)),s=h(n(162)),l=h(n(1155)),u=n(566),c=h(n(191)),d=n(107),f=n(37),p=n(89);function h(e){return e&&e.__esModule?e:{default:e}}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;te.labels.some(e=>(0,f.isCMSLabel)(e.name)),w=e=>e.reduce((e,t)=>("removed"===t.status?e.push({sha:null,path:t.filename}):"renamed"===t.status?(e.push({sha:null,path:t.previous_filename}),e.push({sha:t.sha,path:t.filename})):e.push({sha:t.sha,path:t.filename}),e),[]),x=e=>({path:e.filename,newFile:"added"===e.status,sha:e.sha,binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")});let k=!1;class E{constructor(e){v(this,"apiRoot",void 0),v(this,"token",void 0),v(this,"branch",void 0),v(this,"useOpenAuthoring",void 0),v(this,"repo",void 0),v(this,"originRepo",void 0),v(this,"repoOwner",void 0),v(this,"repoName",void 0),v(this,"originRepoOwner",void 0),v(this,"originRepoName",void 0),v(this,"repoURL",void 0),v(this,"originRepoURL",void 0),v(this,"mergeMethod",void 0),v(this,"initialWorkflowStatus",void 0),v(this,"_userPromise",void 0),v(this,"_metadataSemaphore",void 0),v(this,"commitAuthor",void 0),v(this,"filterOpenAuthoringBranches",async e=>{try{const t=await this.getBranchPullRequest(e),{state:n,merged_at:r}=t;return-1!==t.number&&n===b.Closed&&r?(await this.deleteBranch(e),{branch:e,filter:!1}):{branch:e,filter:!0}}catch(t){return{branch:e,filter:!1}}}),this.apiRoot=e.apiRoot||"https://api.github.com",this.token=e.token||"",this.branch=e.branch||"master",this.useOpenAuthoring=e.useOpenAuthoring,this.repo=e.repo||"",this.originRepo=e.originRepo||this.repo,this.repoURL="/repos/"+this.repo,this.originRepoURL="/repos/"+this.originRepo;const[t,n]=[this.repo.split("/"),this.originRepo.split("/")];this.repoOwner=t[0],this.repoName=t[1],this.originRepoOwner=n[0],this.originRepoName=n[1],this.mergeMethod=e.squashMerges?"squash":"merge",this.initialWorkflowStatus=e.initialWorkflowStatus}user(){return this._userPromise||(this._userPromise=this.getUser()),this._userPromise}getUser(){return this.request("/user")}async hasWriteAccess(){try{const e=await this.request(this.repoURL);return this.repoOwner=e.owner.login,e.permissions.push}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}reset(){}requestHeaders(e={}){const t=g({"Content-Type":"application/json; charset=utf-8"},e);return this.token?(t.Authorization="token "+this.token,Promise.resolve(t)):Promise.resolve(t)}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const n=[];if(t.params)for(const e in t.params)n.push(`${e}=${encodeURIComponent(t.params[e])}`);return n.length&&(e+="?"+n.join("&")),this.apiRoot+e}parseResponse(e){const t=e.headers.get("Content-Type");if(t&&t.match(/json/))return this.parseJsonResponse(e);return e.text().then(t=>e.ok?t:Promise.reject(t))}handleRequestError(e,t){throw new f.APIError(e.message,t,"GitHub")}buildRequest(e){return e}async request(e,t={},n=(e=>this.parseResponse(e))){t=g({cache:"no-cache"},t);const r=await this.requestHeaders(t.headers||{}),i=this.urlFor(e,t);let o=500;try{const e=f.unsentRequest.fromFetchArguments(i,g(g({},t),{},{headers:r})),a=await(0,f.requestWithBackoff)(this,e);o=a.status;return await n(a)}catch(e){return this.handleRequestError(e,o)}}nextUrlProcessor(){return e=>e}async requestAllPages(e,t={}){t=g({cache:"no-cache"},t);const n=await this.requestHeaders(t.headers||{}),r=this.urlFor(e,t),i=await(0,f.getAllResponses)(r,g(g({},t),{},{headers:n}),"next",this.nextUrlProcessor()),o=await Promise.all(i.map(e=>this.parseResponse(e)));return[].concat(...o)}generateContentKey(e,t){const n=(0,f.generateContentKey)(e,t);return this.useOpenAuthoring?`${this.repo}/${n}`:n}parseContentKey(e){return this.useOpenAuthoring?(0,f.parseContentKey)(e.substring(this.repo.length+1)):(0,f.parseContentKey)(e)}checkMetadataRef(){return this.request(this.repoURL+"/git/refs/meta/_netlify_cms").then(e=>e.object).catch(()=>this.uploadBlob({raw:"# Netlify CMS\n\nThis tree is used by the Netlify CMS to store metadata information for specific files and branches."}).then(e=>this.request(this.repoURL+"/git/trees",{method:"POST",body:JSON.stringify({tree:[{path:"README.md",mode:"100644",type:"blob",sha:e.sha}]})})).then(e=>this.commit("First Commit",e)).then(e=>this.createRef("meta","_netlify_cms",e.sha)).then(e=>e.object))}async storeMetadata(e,t){return this._metadataSemaphore||(this._metadataSemaphore=(0,c.default)(1)),new Promise((n,r)=>{var i;return null===(i=this._metadataSemaphore)||void 0===i?void 0:i.take(async()=>{try{var i;const r=await this.checkMetadataRef(),o={path:e+".json",raw:JSON.stringify(t)};await this.uploadBlob(o);const a=await this.updateTree(r.sha,[o]),{sha:s}=await this.commit(`Updating “${e}” metadata`,a);await this.patchRef("meta","_netlify_cms",s),await f.localForage.setItem("gh.meta."+e,{expires:Date.now()+3e5,data:t}),null===(i=this._metadataSemaphore)||void 0===i||i.leave(),n()}catch(e){r(e)}})})}deleteMetadata(e){return this._metadataSemaphore||(this._metadataSemaphore=(0,c.default)(1)),new Promise(t=>{var n;return null===(n=this._metadataSemaphore)||void 0===n?void 0:n.take(async()=>{try{var n;const r=await this.checkMetadataRef(),i={path:e+".json",sha:null},o=await this.updateTree(r.sha,[i]),{sha:a}=await this.commit(`Deleting “${e}” metadata`,o);await this.patchRef("meta","_netlify_cms",a),null===(n=this._metadataSemaphore)||void 0===n||n.leave(),t()}catch(e){var r;null===(r=this._metadataSemaphore)||void 0===r||r.leave(),t()}})})}async retrieveMetadataOld(e){console.log("%c Checking for MetaData files","line-height: 30px;text-align: center;font-weight: bold");const t={params:{ref:"refs/meta/_netlify_cms"},headers:{Accept:"application/vnd.github.v3.raw"}},n=t=>{throw"Not Found"===t.message&&console.log("%c %s does not have metadata","line-height: 30px;text-align: center;font-weight: bold",e),t};if(!this.useOpenAuthoring){return await this.request(`${this.repoURL}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(n)}const[r,i]=e.split("/");return this.request(`/repos/${r}/${i}/contents/${e}.json`,t).then(e=>JSON.parse(e)).catch(n)}async getPullRequests(e,t,n){return(await this.requestAllPages(this.originRepoURL+"/pulls",{params:g(g({},e?{head:await this.getHeadReference(e)}:{}),{},{base:this.branch,state:t,per_page:100})})).filter(e=>e.head.ref.startsWith(f.CMS_BRANCH_PREFIX+"/")&&n(e))}async getOpenAuthoringPullRequest(e,t){const n=await this.getBranch(e).catch(()=>{throw new f.EditorialWorkflowError("content is not under editorial workflow",!0)}),r=t.filter(e=>e.head.sha===n.commit.sha)[0];if(r){r.labels=r.labels.filter(e=>!(0,f.isCMSLabel)(e.name));const e=r.state===b.Closed?{name:(0,f.statusToLabel)(this.initialWorkflowStatus)}:{name:(0,f.statusToLabel)("pending_review")};return r.labels.push(e),r}try{return{head:{sha:n.commit.sha},number:-1,labels:[{name:(0,f.statusToLabel)(this.initialWorkflowStatus)}],state:b.Open}}catch(e){throw new f.EditorialWorkflowError("content is not under editorial workflow",!0)}}async getBranchPullRequest(e){if(this.useOpenAuthoring){const t=await this.getPullRequests(e,b.All,()=>!0);return this.getOpenAuthoringPullRequest(e,t)}{const t=await this.getPullRequests(e,b.Open,_);if(t.length<=0)throw new f.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}}async getPullRequestCommits(e){if(-1===e)return[];try{return await this.request(`${this.originRepoURL}/pulls/${e}/commits`)}catch(e){return console.log(e),[]}}async retrieveUnpublishedEntryData(e){const{collection:t,slug:n}=this.parseContentKey(e),r=(0,f.branchFromContentKey)(e),i=await this.getBranchPullRequest(r),{files:o}=await this.getDifferences(this.branch,i.head.sha),a=o.map(x),s=i.labels.find(e=>(0,f.isCMSLabel)(e.name)),l=(0,f.labelToStatus)(s.name),u=i.updated_at;return{collection:t,slug:n,status:l,diffs:a.map(e=>({path:e.path,newFile:e.newFile,id:e.sha})),updatedAt:u}}async readFile(e,t,{branch:n=this.branch,repoURL:r=this.repoURL,parseText:i=!0}={}){t||(t=await this.getFileSha(e,{repoURL:r,branch:n}));return await this.fetchBlobContent({sha:t,repoURL:r,parseText:i})}async readFileMetadata(e,t){return await(0,f.readFileMetadata)(t,async()=>{try{const t=await this.request(this.originRepoURL+"/commits",{params:{path:e,sha:this.branch}}),{commit:n}=t[0];return{author:n.author.name||n.author.email,updatedOn:n.author.date}}catch(e){return{author:"",updatedOn:""}}},f.localForage)}async fetchBlobContent({sha:e,repoURL:t,parseText:n}){const r=await this.request(`${t}/git/blobs/${e}`,{cache:"force-cache"});if(n){return u.Base64.decode(r.content)}{const e=u.Base64.atob(r.content),t=new Uint8Array(e.length);for(let n=0;n1?{recursive:1}:{}})).tree.filter(e=>"blob"===e.type&&e.path.split("/").length<=i).map(e=>({type:e.type,id:e.sha,name:(0,f.basename)(e.path),path:`${o}/${e.path}`,size:e.size}))}catch(e){if(e&&404===e.status)return console.log("This 404 was expected and handled appropriately."),[];throw e}}async migrateToVersion1(e,t){const n=e.head.ref.substring("cms/".length),r=`${t.collection}/${n}`,i="cms/"+r;await this.getBranch(i).catch(()=>{})||await this.createBranch(i,e.head.sha);const o=(await this.getPullRequests(i,b.All,()=>!0))[0]||await this.createPR(e.title,i),a=g(g({},t),{},{pr:{number:o.number,head:o.head.sha},branch:i,version:"1"});return await this.storeMetadata(r,a),await this.closePR(e.number),await this.deleteBranch(e.head.ref),await this.deleteMetadata(n),{metadata:a,pullRequest:o}}async migrateToPullRequestLabels(e,t){await this.setPullRequestStatus(e,t.status);const n=e.head.ref.substring("cms/".length);await this.deleteMetadata(n)}async migratePullRequest(e,t){const{number:n}=e;console.log(`Migrating Pull Request '${n}' (${t})`);const r=(0,f.contentKeyFromBranch)(e.head.ref);let i=await this.retrieveMetadataOld(r).catch(()=>{});if(!i)return void console.log(`Skipped migrating Pull Request '${n}' (${t})`);let o=n;if(!i.version){console.log(`Migrating Pull Request '${n}' to version 1`);try{({metadata:i,pullRequest:e}=await this.migrateToVersion1(e,i))}catch(e){return console.log(`Failed to migrate Pull Request '${n}' to version 1. See error below.`),void console.error(e)}o=e.number,console.log(`Done migrating Pull Request '${n}' to version 1. New pull request '${o}' created.`)}"1"===i.version&&(console.log(`Migrating Pull Request '${o}' to labels`),await this.migrateToPullRequestLabels(e,i),console.log(`Done migrating Pull Request '${o}' to labels`)),console.log(`Done migrating Pull Request '${n===o?o:`${n} => ${o}`}'`)}async getOpenAuthoringBranches(){return await this.requestAllPages(`${this.repoURL}/git/refs/heads/cms/${this.repo}`).catch(()=>[])}async listUnpublishedBranches(){let e;if(console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),this.useOpenAuthoring){e=(await this.getOpenAuthoringBranches()).map(e=>e.ref.substring("refs/heads/".length));const t=await Promise.all(e.map(e=>this.filterOpenAuthoringBranches(e)));e=t.filter(e=>e.filter).map(e=>e.branch)}else{const t=await this.getPullRequests(void 0,b.Open,e=>!e.head.repo.fork&&(e=>e.labels.every(e=>!(0,f.isCMSLabel)(e.name)))(e));let n=0;for(const e of t)k||(k=!0,alert(d.oneLine` + Netlify CMS is adding labels to ${t.length} of your Editorial Workflow + entries. The "Workflow" tab will be unavailable during this migration. You may use other + areas of the CMS during this time. Note that closing the CMS will pause the migration. + `)),n+=1,await this.migratePullRequest(e,`${n} of ${t.length}`);e=(await this.getPullRequests(void 0,b.Open,_)).map(e=>e.head.ref)}return e}async getStatuses(e,t){const n=this.generateContentKey(e,t),r=(0,f.branchFromContentKey)(n),i=(await this.getBranchPullRequest(r)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map(e=>({context:e.context,target_url:e.target_url,state:e.state===y.Success?f.PreviewState.Success:f.PreviewState.Other}))}async persistFiles(e,t,n){const r=e?t.concat(e):t,o=r.map(e=>this.uploadBlob(e));if(await Promise.all(o),n.useWorkflow){const o=t.map(({sha:e,path:t})=>({path:(0,i.default)(t,"/"),sha:e}));return this.editorialWorkflowGit(r,e,o,n)}return this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,r)).then(e=>this.commit(n.commitMessage,e)).then(e=>this.patchBranch(this.branch,e.sha))}async getFileSha(e,{repoURL:t=this.repoURL,branch:n=this.branch}={}){const r=e.split("/"),i=(0,s.default)(r),o=(0,l.default)(r).join("/"),a=`${t}/git/trees/${n}:${encodeURIComponent(o)}`,u=(await this.request(a)).tree.find(e=>e.path===i);if(u)return u.sha;throw new f.APIError("Not Found",404,"GitHub")}deleteFile(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const n=this.branch;return this.getFileSha(e,{branch:n}).then(r=>{const i={method:"DELETE",params:{sha:r,message:t,branch:n}};this.commitAuthor&&(i.params.author=g(g({},this.commitAuthor),{},{date:(new Date).toISOString()}));const o=`${this.repoURL}/contents/${e}`;return this.request(o,i)})}async createBranchAndPullRequest(e,t,n){return await this.createBranch(e,t),this.createPR(n,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async editorialWorkflowGit(e,t,n,r){const i=this.generateContentKey(r.collectionName,t.slug),o=(0,f.branchFromContentKey)(i);if(r.unpublished||!1){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=t.map(x),a=[];for(const e of i.filter(e=>e.binary))n.some(t=>t.path===e.path)||a.push({path:e.path,sha:null});const s=await this.rebaseBranch(o),l=a.concat(e),u=await this.updateTree(s.sha,l,o),c=await this.commit(r.commitMessage,u);return this.patchBranch(o,c.sha,{force:!0})}{const t=await this.getDefaultBranch(),n=await this.updateTree(t.commit.sha,e),i=await this.commit(r.commitMessage,n);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,r.commitMessage);await this.setPullRequestStatus(e,r.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const n=this.useOpenAuthoring?10:1;for(let r=1;r<=n;r++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(r===n)throw console.warn(`Reached maximum number of attempts '${n}' for getDifferences`),e;await new Promise(e=>setTimeout(e,500*r))}throw new f.APIError("Not Found",404,"GitHub")}async rebaseSingleCommit(e,t){const n=await this.getDifferences(t.parents[0].sha,t.sha),r=w(n.files);if(r.length>0){const n=await this.updateTree(e.sha,r),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,n.sha,[e.sha],o,a)}return t}async rebaseCommits(e,t){if(0===t.length||t[0].parents[0].sha===e.sha){return(0,s.default)(t)}return t.reduce((e,t)=>e.then(e=>{const n=e,r=t;return this.rebaseSingleCommit(n,r)}),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:n}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,n)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const n=[...e.labels.filter(e=>!(0,f.isCMSLabel)(e.name)).map(e=>e.name),(0,f.statusToLabel)(t)];await this.updatePullRequestLabels(e.number,n)}async updateUnpublishedEntryStatus(e,t,n){const r=this.generateContentKey(e,t),i=(0,f.branchFromContentKey)(r),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(-1!==o.number){const{state:e}=o;e===b.Open&&"draft"===n&&await this.closePR(o.number),e===b.Closed&&"pending_review"===n&&await this.openPR(o.number)}else if("pending_review"===n){var a,s;const e=(0,f.branchFromContentKey)(r),t=(null===(a=(await this.getDifferences(this.branch,await this.getHeadReference(e))).commits[0])||void 0===a||null===(s=a.commit)||void 0===s?void 0:s.message)||E.DEFAULT_COMMIT_MESSAGE;await this.createPR(t,e)}}else await this.setPullRequestStatus(o,n)}async deleteUnpublishedEntry(e,t){const n=this.generateContentKey(e,t),r=(0,f.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);-1!==i.number&&await this.closePR(i.number),await this.deleteBranch(r)}async publishUnpublishedEntry(e,t){const n=this.generateContentKey(e,t),r=(0,f.branchFromContentKey)(n),i=await this.getBranchPullRequest(r);await this.mergePR(i),await this.deleteBranch(r)}async createRef(e,t,n){return await this.request(this.repoURL+"/git/refs",{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:n})})}async patchRef(e,t,n,r={}){const i=r.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:n,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(f.CMS_BRANCH_PREFIX+"/"),`${f.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(n){const r=String(n.message||"");if("Reference update failed"===r)await(0,f.throwOnConflictingBranches)(e,e=>this.getBranch(e),"GitHub");else if("Reference already exists"===r&&e.startsWith(f.CMS_BRANCH_PREFIX+"/"))try{await this.backupBranch(e);return await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw n}}assertCmsBranch(e){return e.startsWith(f.CMS_BRANCH_PREFIX+"/")}patchBranch(e,t,n={}){const r=n.force||!1;if(r&&!this.assertCmsBranch(e))throw Error("Only CMS branches can be force updated, cannot force update "+e);return this.patchRef("heads",e,t,{force:r})}deleteBranch(e){return this.deleteRef("heads",e).catch(e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e)))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(this.originRepoURL+"/pulls",{method:"POST",body:JSON.stringify({title:e,body:f.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold");return await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:b.Open})})}async closePR(e){console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold");return await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:b.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:f.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof f.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=await this.getDifferences(e.base.sha,e.head.sha),n=w(t.files);let r="Automatically generated. Merged on Netlify CMS\n\nForce merge of:";return n.forEach(e=>{r+=`\n* "${e.path}"`}),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,n)).then(e=>this.commit(r,e)).then(e=>this.patchBranch(this.branch,e.sha))}toBase64(e){return Promise.resolve(u.Base64.encode(e))}async uploadBlob(e){const t=await(0,o.default)(e,"toBase64",(0,a.default)(this.toBase64,e.raw)),n=await this.request(this.repoURL+"/git/blobs",{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=n.sha,e}async updateTree(e,t,n=this.branch){const r=[],o=t.reduce((e,t)=>{const n={path:(0,i.default)(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?r.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(n),e},[]);for(const{from:e,to:t,sha:i}of r){const r=(0,p.dirname)(e),a=(0,p.dirname)(t),s=await this.listFiles(r,{branch:n,depth:100});for(const t of s)o.push({path:t.path,mode:"100644",type:"blob",sha:null}),o.push({path:t.path.replace(r,a),mode:"100644",type:"blob",sha:t.path===e?i:t.id})}return g(g({},await this.createTree(e,o)),{},{parentSha:e})}async createTree(e,t){return await this.request(this.repoURL+"/git/trees",{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const n=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,n)}async createCommit(e,t,n,r,i){return await this.request(this.repoURL+"/git/commits",{method:"POST",body:JSON.stringify({message:e,tree:t,parents:n,author:r,committer:i})})}async getUnpublishedEntrySha(e,t){const n=this.generateContentKey(e,t),r=(0,f.branchFromContentKey)(n);return(await this.getBranchPullRequest(r)).head.sha}}t.default=E,v(E,"DEFAULT_COMMIT_MESSAGE","Automatically generated by Netlify CMS")},function(e,t,n){var r=n(1162).parse;function i(e){return e.replace(/[\s,]+/g," ").trim()}var o={},a={};var s=!0;var l=!1;function u(e){var t=i(e);if(o[t])return o[t];var n=r(e,{experimentalFragmentVariables:l});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");return n=function e(t,n){var r=Object.prototype.toString.call(t);if("[object Array]"===r)return t.map((function(t){return e(t,n)}));if("[object Object]"!==r)throw new Error("Unexpected input.");n&&t.loc&&delete t.loc,t.loc&&(delete t.loc.startToken,delete t.loc.endToken);var i,o,a,s=Object.keys(t);for(i in s)s.hasOwnProperty(i)&&(o=t[s[i]],"[object Object]"!==(a=Object.prototype.toString.call(o))&&"[object Array]"!==a||(t[s[i]]=e(o,!0)));return t}(n=function(e){for(var t,n={},r=[],o=0;o=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?O(e):t}function C(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t-1}function j(e){return I(e)?window.pageYOffset:e.scrollTop}function D(e,t){I(e)?window.scrollTo(0,t):e.scrollTop=t}function L(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function N(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:A,i=j(e),o=t-i,a=10,s=0;function l(){var t=L(s+=a,i,o,n);D(e,t),s=p)return{placement:"bottom",maxHeight:t};if(k>=p&&!a)return o&&N(l,E,160),{placement:"bottom",maxHeight:t};if(!a&&k>=r||a&&w>=r)return o&&N(l,E,160),{placement:"bottom",maxHeight:a?w-y:k-y};if("auto"===i||a){var O=t,T=a?_:x;return T>=r&&(O=Math.min(T-y-s.controlHeight,t)),{placement:"top",maxHeight:O}}if("bottom"===i)return D(l,E),{placement:"bottom",maxHeight:t};break;case"top":if(_>=p)return{placement:"top",maxHeight:t};if(x>=p&&!a)return o&&N(l,S,160),{placement:"top",maxHeight:t};if(!a&&x>=r||a&&_>=r){var C=t;return(!a&&x>=r||a&&_>=r)&&(C=a?_-b:x-b),o&&N(l,S,160),{placement:"top",maxHeight:C}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}var z=function(e){return"auto"===e?"bottom":e},U=function(e){function t(){var e,n;g(this,t);for(var r=arguments.length,i=new Array(r),o=0;o-1}},re=function(e){return i.a.createElement("span",_({className:Object(a.a)({label:"a11yText",zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},e))},ie=function(e){function t(){return g(this,t),T(this,k(t).apply(this,arguments))}return x(t,e),y(t,[{key:"render",value:function(){var e=this.props,t=(e.in,e.out,e.onExited,e.appear,e.enter,e.exit,e.innerRef),n=(e.emotion,S(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return i.a.createElement("input",_({ref:t},n,{className:Object(a.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}]),t}(r.Component),oe=function(e){function t(){return g(this,t),T(this,k(t).apply(this,arguments))}return x(t,e),y(t,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(s.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),t}(r.Component),ae=["boxSizing","height","overflow","paddingRight","position"],se={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function le(e){e.preventDefault()}function ue(e){e.stopPropagation()}function ce(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function de(){return"ontouchstart"in window||navigator.maxTouchPoints}var fe=!("undefined"==typeof window||!window.document||!window.document.createElement),pe=0,he=function(e){function t(){var e,n;g(this,t);for(var r=arguments.length,i=new Array(r),o=0;o0,h=c-d-u,m=!1;h>t&&n.isBottom&&(o&&o(e),n.isBottom=!1),p&&n.isTop&&(s&&s(e),n.isTop=!1),p&&t>h?(i&&!n.isBottom&&i(e),f.scrollTop=c,m=!0,n.isBottom=!0):!p&&-t>u&&(a&&!n.isTop&&a(e),f.scrollTop=0,m=!0,n.isTop=!0),m&&n.cancelScroll(e)})),b(O(O(n)),"onWheel",(function(e){n.handleEventDelta(e,e.deltaY)})),b(O(O(n)),"onTouchStart",(function(e){n.touchStart=e.changedTouches[0].clientY})),b(O(O(n)),"onTouchMove",(function(e){var t=n.touchStart-e.changedTouches[0].clientY;n.handleEventDelta(e,t)})),b(O(O(n)),"getScrollTarget",(function(e){n.scrollTarget=e})),n}return x(t,e),y(t,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e&&(e.scrollHeight<=e.clientHeight||("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1)))}},{key:"stopListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.a.createElement(oe,{innerRef:this.getScrollTarget},this.props.children)}}]),t}(r.Component),ve=function(e){function t(){return g(this,t),T(this,k(t).apply(this,arguments))}return x(t,e),y(t,[{key:"render",value:function(){var e=this.props,t=e.isEnabled,n=S(e,["isEnabled"]);return t?i.a.createElement(ge,n):this.props.children}}]),t}(r.Component);b(ve,"defaultProps",{isEnabled:!0});var ye=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,i=t.label,o=t.isDisabled;switch(e){case"menu":return"Use Up and Down to choose options".concat(o?"":", press Enter to select the currently focused option",", press Escape to exit the menu, press Tab to select the option and exit the menu.");case"input":return"".concat(i||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},be=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"select-option":return"option ".concat(n,r?" is disabled. Select another option.":", selected.")}},_e=function(e){return!!e.isDisabled},we=function(e){function t(){return g(this,t),T(this,k(t).apply(this,arguments))}return x(t,e),y(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.cx,o=e.isMulti,s=e.getStyles,l=e.hasValue;return i.a.createElement("div",{className:r(Object(a.a)(s("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":l},n)},t)}}]),t}(r.Component),xe=function(e){var t=e.size,n=S(e,["size"]);return i.a.createElement("svg",_({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:Object(a.a)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},n))},ke=function(e){return i.a.createElement(xe,_({size:20},e),i.a.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Ee=function(e){return i.a.createElement(xe,_({size:20},e),i.a.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Se=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,i=n.colors;return{label:"indicatorContainer",color:t?i.neutral60:i.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?i.neutral80:i.neutral40}}},Oe=Se,Te=Se,Ce=!1,Ae=function(e){var t=e.color,n=e.delay,r=e.offset;return i.a.createElement("span",{className:Object(a.a)({animationDuration:"1s",animationDelay:"".concat(n,"ms"),animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:t,borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})},Pe=function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps,s=e.isFocused,l=e.isRtl,u=e.theme.colors,c=s?u.neutral80:u.neutral20;return Ce||(Object(a.b)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};"),Ce=!0),i.a.createElement("div",_({},o,{className:n(Object(a.a)(r("loadingIndicator",e)),{indicator:!0,"loading-indicator":!0},t)}),i.a.createElement(Ae,{color:c,delay:0,offset:l}),i.a.createElement(Ae,{color:c,delay:160,offset:!0}),i.a.createElement(Ae,{color:c,delay:320,offset:!l}))};Pe.defaultProps={size:4};var Re=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}},Me=function(e){var t=e.children,n=e.innerProps;return i.a.createElement("div",n,t)},Ie=Me,je=Me,De=function(e){function t(){return g(this,t),T(this,k(t).apply(this,arguments))}return x(t,e),y(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.innerProps;return i.a.createElement("div",n,t||i.a.createElement(ke,{size:14}))}}]),t}(r.Component),Le=function(e){function t(){return g(this,t),T(this,k(t).apply(this,arguments))}return x(t,e),y(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.components,o=e.cx,s=e.data,l=e.getStyles,u=e.innerProps,c=e.isDisabled,d=e.removeProps,f=e.selectProps,p=r.Container,h=r.Label,m=r.Remove,g=w({className:o(Object(a.a)(l("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":c},n)},u),v={className:o(Object(a.a)(l("multiValueLabel",this.props)),{"multi-value__label":!0},n)},y=w({className:o(Object(a.a)(l("multiValueRemove",this.props)),{"multi-value__remove":!0},n)},d);return i.a.createElement(p,{data:s,innerProps:g,selectProps:f},i.a.createElement(h,{data:s,innerProps:v,selectProps:f},t),i.a.createElement(m,{data:s,innerProps:y,selectProps:f}))}}]),t}(r.Component);b(Le,"defaultProps",{cropWithEllipsis:!0});var Ne={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.innerProps;return i.a.createElement("div",_({},s,{className:r(Object(a.a)(o("clearIndicator",e)),{indicator:!0,"clear-indicator":!0},n)}),t||i.a.createElement(ke,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.className,s=e.isDisabled,l=e.isFocused,u=e.innerRef,c=e.innerProps,d=e.menuIsOpen;return i.a.createElement("div",_({ref:u,className:n(Object(a.a)(r("control",e)),{control:!0,"control--is-disabled":s,"control--is-focused":l,"control--menu-is-open":d},o)},c),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.innerProps;return i.a.createElement("div",_({},s,{className:r(Object(a.a)(o("dropdownIndicator",e)),{indicator:!0,"dropdown-indicator":!0},n)}),t||i.a.createElement(Ee,null))},DownChevron:Ee,CrossIcon:ke,Group:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.Heading,l=e.headingProps,u=e.label,c=e.theme,d=e.selectProps;return i.a.createElement("div",{className:r(Object(a.a)(o("group",e)),{group:!0},n)},i.a.createElement(s,_({},l,{selectProps:d,theme:c,getStyles:o,cx:r}),u),i.a.createElement("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.theme,s=(e.selectProps,S(e,["className","cx","getStyles","theme","selectProps"]));return i.a.createElement("div",_({className:n(Object(a.a)(r("groupHeading",w({theme:o},s))),{"group-heading":!0},t)},s))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles;return i.a.createElement("div",{className:r(Object(a.a)(o("indicatorsContainer",e)),{indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps;return i.a.createElement("span",_({},o,{className:n(Object(a.a)(r("indicatorSeparator",e)),{"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerRef,s=e.isHidden,l=e.isDisabled,u=e.theme,c=(e.selectProps,S(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return i.a.createElement("div",{className:Object(a.a)(r("input",w({theme:u},c)))},i.a.createElement(p.a,_({className:n(null,{input:!0},t),inputRef:o,inputStyle:Re(s),disabled:l},c)))},LoadingIndicator:Pe,Menu:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.innerRef,l=e.innerProps,u=r(Object(a.a)(o("menu",e)),{menu:!0},n);return i.a.createElement("div",_({className:u},l,{ref:s}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.isMulti,l=e.innerRef;return i.a.createElement("div",{className:r(Object(a.a)(o("menuList",e)),{"menu-list":!0,"menu-list--is-multi":s},n),ref:l},t)},MenuPortal:G,LoadingMessage:$,NoOptionsMessage:V,MultiValue:Le,MultiValueContainer:Ie,MultiValueLabel:je,MultiValueRemove:De,Option:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.isDisabled,l=e.isFocused,u=e.isSelected,c=e.innerRef,d=e.innerProps;return i.a.createElement("div",_({ref:c,className:r(Object(a.a)(o("option",e)),{option:!0,"option--is-disabled":s,"option--is-focused":l,"option--is-selected":u},n)},d),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.innerProps;return i.a.createElement("div",_({className:r(Object(a.a)(o("placeholder",e)),{placeholder:!0},n)},s),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.innerProps,l=e.isDisabled,u=e.isRtl;return i.a.createElement("div",_({className:r(Object(a.a)(o("container",e)),{"--is-disabled":l,"--is-rtl":u},n)},s),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,s=e.isDisabled,l=e.innerProps;return i.a.createElement("div",_({className:r(Object(a.a)(o("singleValue",e)),{"single-value":!0,"single-value--is-disabled":s},n)},l),t)},ValueContainer:we},Fe=function(e){return w({},Ne,e.components)},Be={clearIndicator:Te,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,i=r.colors,o=r.borderRadius,a=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?i.neutral5:i.neutral0,borderColor:t?i.neutral10:n?i.primary:i.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(i.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?i.primary:i.neutral30}}},dropdownIndicator:Oe,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,i=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?i.neutral10:i.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,i=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:i.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,i=r.colors,o=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?i.neutral60:i.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:W,menu:function(e){var t,n=e.placement,r=e.theme,i=r.borderRadius,o=r.spacing,a=r.colors;return b(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),b(t,"backgroundColor",a.neutral0),b(t,"borderRadius",i),b(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),b(t,"marginBottom",o.menuGutter),b(t,"marginTop",o.menuGutter),b(t,"position","absolute"),b(t,"width","100%"),b(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,i=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:i?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,i=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&i.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}}},noOptionsMessage:H,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,i=e.theme,o=i.spacing,a=i.colors;return{label:"option",backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?a.primary:a.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,i=n.colors;return{label:"singleValue",color:t?i.neutral40:i.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=w({},e);return Object.keys(t).forEach((function(r){e[r]?n[r]=function(n,i){return t[r](e[r](n,i),i)}:n[r]=t[r]})),n}var Ue={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},qe={backspaceRemovesValue:!0,blurInputOnSelect:F(),captureMenuScroll:!F(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ne(),formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:_e,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},He=1,We=function(e){function t(e){var n;g(this,t),b(O(O(n=T(this,k(t).call(this,e)))),"state",{ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]}),b(O(O(n)),"blockOptionHover",!1),b(O(O(n)),"isComposing",!1),b(O(O(n)),"clearFocusValueOnUpdate",!1),b(O(O(n)),"commonProps",void 0),b(O(O(n)),"components",void 0),b(O(O(n)),"hasGroups",!1),b(O(O(n)),"initialTouchX",0),b(O(O(n)),"initialTouchY",0),b(O(O(n)),"inputIsHiddenAfterUpdate",void 0),b(O(O(n)),"instancePrefix",""),b(O(O(n)),"openAfterFocus",!1),b(O(O(n)),"scrollToFocusedOptionOnUpdate",!1),b(O(O(n)),"userIsDragging",void 0),b(O(O(n)),"controlRef",null),b(O(O(n)),"getControlRef",(function(e){n.controlRef=e})),b(O(O(n)),"focusedOptionRef",null),b(O(O(n)),"getFocusedOptionRef",(function(e){n.focusedOptionRef=e})),b(O(O(n)),"menuListRef",null),b(O(O(n)),"getMenuListRef",(function(e){n.menuListRef=e})),b(O(O(n)),"inputRef",null),b(O(O(n)),"getInputRef",(function(e){n.inputRef=e})),b(O(O(n)),"cacheComponents",(function(e){n.components=Fe({components:e})})),b(O(O(n)),"focus",n.focusInput),b(O(O(n)),"blur",n.blurInput),b(O(O(n)),"onChange",(function(e,t){var r=n.props;(0,r.onChange)(e,w({},t,{name:r.name}))})),b(O(O(n)),"setValue",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",r=arguments.length>2?arguments[2]:void 0,i=n.props,o=i.closeMenuOnSelect,a=i.isMulti;n.onInputChange("",{action:"set-value"}),o&&(n.inputIsHiddenAfterUpdate=!a,n.onMenuClose()),n.clearFocusValueOnUpdate=!0,n.onChange(e,{action:t,option:r})})),b(O(O(n)),"selectOption",(function(e){var t=n.props,r=t.blurInputOnSelect,i=t.isMulti,o=n.state.selectValue;if(i)if(n.isOptionSelected(e,o)){var a=n.getOptionValue(e);n.setValue(o.filter((function(e){return n.getOptionValue(e)!==a})),"deselect-option",e),n.announceAriaLiveSelection({event:"deselect-option",context:{value:n.getOptionLabel(e)}})}else n.isOptionDisabled(e,o)?n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e),isDisabled:!0}}):(n.setValue([].concat(C(o),[e]),"select-option",e),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}}));else n.isOptionDisabled(e,o)?n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e),isDisabled:!0}}):(n.setValue(e,"select-option"),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}}));r&&n.blurInput()})),b(O(O(n)),"removeValue",(function(e){var t=n.state.selectValue,r=n.getOptionValue(e);n.onChange(t.filter((function(e){return n.getOptionValue(e)!==r})),{action:"remove-value",removedValue:e}),n.announceAriaLiveSelection({event:"remove-value",context:{value:e?n.getOptionLabel(e):""}}),n.focusInput()})),b(O(O(n)),"clearValue",(function(){var e=n.props.isMulti;n.onChange(e?[]:null,{action:"clear"})})),b(O(O(n)),"popValue",(function(){var e=n.state.selectValue,t=e[e.length-1];n.announceAriaLiveSelection({event:"pop-value",context:{value:t?n.getOptionLabel(t):""}}),n.onChange(e.slice(0,e.length-1),{action:"pop-value",removedValue:t})})),b(O(O(n)),"getOptionLabel",(function(e){return n.props.getOptionLabel(e)})),b(O(O(n)),"getOptionValue",(function(e){return n.props.getOptionValue(e)})),b(O(O(n)),"getStyles",(function(e,t){var r=Be[e](t);r.boxSizing="border-box";var i=n.props.styles[e];return i?i(r,t):r})),b(O(O(n)),"getElementId",(function(e){return"".concat(n.instancePrefix,"-").concat(e)})),b(O(O(n)),"getActiveDescendentId",(function(){var e=n.props.menuIsOpen,t=n.state,r=t.menuOptions,i=t.focusedOption;if(i&&e){var o=r.focusable.indexOf(i),a=r.render[o];return a&&a.key}})),b(O(O(n)),"announceAriaLiveSelection",(function(e){var t=e.event,r=e.context;n.setState({ariaLiveSelection:be(t,r)})})),b(O(O(n)),"announceAriaLiveContext",(function(e){var t=e.event,r=e.context;n.setState({ariaLiveContext:ye(t,w({},r,{label:n.props["aria-label"]}))})})),b(O(O(n)),"onMenuMouseDown",(function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),n.focusInput())})),b(O(O(n)),"onMenuMouseMove",(function(e){n.blockOptionHover=!1})),b(O(O(n)),"onControlMouseDown",(function(e){var t=n.props.openMenuOnClick;n.state.isFocused?n.props.menuIsOpen?"INPUT"!==e.target.tagName&&n.onMenuClose():t&&n.openMenu("first"):(t&&(n.openAfterFocus=!0),n.focusInput()),"INPUT"!==e.target.tagName&&e.preventDefault()})),b(O(O(n)),"onDropdownIndicatorMouseDown",(function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||n.props.isDisabled)){var t=n.props,r=t.isMulti,i=t.menuIsOpen;n.focusInput(),i?(n.inputIsHiddenAfterUpdate=!r,n.onMenuClose()):n.openMenu("first"),e.preventDefault(),e.stopPropagation()}})),b(O(O(n)),"onClearIndicatorMouseDown",(function(e){e&&"mousedown"===e.type&&0!==e.button||(n.clearValue(),e.stopPropagation(),n.openAfterFocus=!1,setTimeout((function(){return n.focusInput()})))})),b(O(O(n)),"onScroll",(function(e){"boolean"==typeof n.props.closeMenuOnScroll?e.target instanceof HTMLElement&&I(e.target)&&n.props.onMenuClose():"function"==typeof n.props.closeMenuOnScroll&&n.props.closeMenuOnScroll(e)&&n.props.onMenuClose()})),b(O(O(n)),"onCompositionStart",(function(){n.isComposing=!0})),b(O(O(n)),"onCompositionEnd",(function(){n.isComposing=!1})),b(O(O(n)),"onTouchStart",(function(e){var t=e.touches.item(0);t&&(n.initialTouchX=t.clientX,n.initialTouchY=t.clientY,n.userIsDragging=!1)})),b(O(O(n)),"onTouchMove",(function(e){var t=e.touches.item(0);if(t){var r=Math.abs(t.clientX-n.initialTouchX),i=Math.abs(t.clientY-n.initialTouchY);n.userIsDragging=r>5||i>5}})),b(O(O(n)),"onTouchEnd",(function(e){n.userIsDragging||(n.controlRef&&!n.controlRef.contains(e.target)&&n.menuListRef&&!n.menuListRef.contains(e.target)&&n.blurInput(),n.initialTouchX=0,n.initialTouchY=0)})),b(O(O(n)),"onControlTouchEnd",(function(e){n.userIsDragging||n.onControlMouseDown(e)})),b(O(O(n)),"onClearIndicatorTouchEnd",(function(e){n.userIsDragging||n.onClearIndicatorMouseDown(e)})),b(O(O(n)),"onDropdownIndicatorTouchEnd",(function(e){n.userIsDragging||n.onDropdownIndicatorMouseDown(e)})),b(O(O(n)),"handleInputChange",(function(e){var t=e.currentTarget.value;n.inputIsHiddenAfterUpdate=!1,n.onInputChange(t,{action:"input-change"}),n.onMenuOpen()})),b(O(O(n)),"onInputFocus",(function(e){var t=n.props,r=t.isSearchable,i=t.isMulti;n.props.onFocus&&n.props.onFocus(e),n.inputIsHiddenAfterUpdate=!1,n.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:i}}),n.setState({isFocused:!0}),(n.openAfterFocus||n.props.openMenuOnFocus)&&n.openMenu("first"),n.openAfterFocus=!1})),b(O(O(n)),"onInputBlur",(function(e){n.menuListRef&&n.menuListRef.contains(document.activeElement)?n.inputRef.focus():(n.props.onBlur&&n.props.onBlur(e),n.onInputChange("",{action:"input-blur"}),n.onMenuClose(),n.setState({focusedValue:null,isFocused:!1}))})),b(O(O(n)),"onOptionHover",(function(e){n.blockOptionHover||n.state.focusedOption===e||n.setState({focusedOption:e})})),b(O(O(n)),"shouldHideSelectedOptions",(function(){var e=n.props,t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t})),b(O(O(n)),"onKeyDown",(function(e){var t=n.props,r=t.isMulti,i=t.backspaceRemovesValue,o=t.escapeClearsValue,a=t.inputValue,s=t.isClearable,l=t.isDisabled,u=t.menuIsOpen,c=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=n.state,h=p.focusedOption,m=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(n.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||a)return;n.focusValue("previous");break;case"ArrowRight":if(!r||a)return;n.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)n.removeValue(m);else{if(!i)return;r?n.popValue():s&&n.clearValue()}break;case"Tab":if(n.isComposing)return;if(e.shiftKey||!u||!d||!h||f&&n.isOptionSelected(h,g))return;n.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(u){if(!h)return;if(n.isComposing)return;n.selectOption(h);break}return;case"Escape":u?(n.inputIsHiddenAfterUpdate=!1,n.onInputChange("",{action:"menu-close"}),n.onMenuClose()):s&&o&&n.clearValue();break;case" ":if(a)return;if(!u){n.openMenu("first");break}if(!h)return;n.selectOption(h);break;case"ArrowUp":u?n.focusOption("up"):n.openMenu("last");break;case"ArrowDown":u?n.focusOption("down"):n.openMenu("first");break;case"PageUp":if(!u)return;n.focusOption("pageup");break;case"PageDown":if(!u)return;n.focusOption("pagedown");break;case"Home":if(!u)return;n.focusOption("first");break;case"End":if(!u)return;n.focusOption("last");break;default:return}e.preventDefault()}}));var r=e.value;n.cacheComponents=Object(o.a)(n.cacheComponents,X).bind(O(O(n))),n.cacheComponents(e.components),n.instancePrefix="react-select-"+(n.props.instanceId||++He);var i=M(r),a=n.buildMenuOptions(e,i);return n.state.menuOptions=a,n.state.selectValue=i,n}return x(t,e),y(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,i=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.inputValue!==i){var o=M(e.value),a=this.buildMenuOptions(e,o),s=this.getNextFocusedValue(o),l=this.getNextFocusedOption(a.focusable);this.setState({menuOptions:a,selectValue:o,focusedOption:l,focusedValue:s})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,i,o,a=this.props,s=a.isDisabled,l=a.menuIsOpen,u=this.state.isFocused;(u&&!s&&e.isDisabled||u&&l&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=n.offsetHeight/3,i.bottom+o>r.bottom?D(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):i.top-o-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:n.focusable[a]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,i=this.state,o=i.selectValue,a=i.focusedValue;if(n){this.setState({focusedOption:null});var s=o.indexOf(a);a||(s=-1,this.announceAriaLiveContext({event:"value"}));var l=o.length-1,u=-1;if(o.length){switch(e){case"previous":u=0===s?0:-1===s?l:s-1;break;case"next":s>-1&&s0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,r=n.focusedOption,i=n.menuOptions,o=i.focusable;if(o.length){var a=0,s=o.indexOf(r);r||(s=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?a=s>0?s-1:o.length-1:"down"===e?a=(s+1)%o.length:"pageup"===e?(a=s-t)<0&&(a=0):"pagedown"===e?(a=s+t)>o.length-1&&(a=o.length-1):"last"===e&&(a=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[a],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:_e(o[a])}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Ue):w({},Ue,this.props.theme):Ue}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,i=this.props,o=i.classNamePrefix,a=i.isMulti,s=i.isRtl,l=i.options,u=this.state.selectValue,c=this.hasValue();return{cx:R.bind(null,o),clearValue:e,getStyles:t,getValue:function(){return u},hasValue:c,isMulti:a,isRtl:s,options:l,selectOption:r,setValue:n,selectProps:i,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some((function(e){return n.getOptionValue(e)===r}))}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(e,t){var n=this,r=e.inputValue,i=void 0===r?"":r,o=e.options,a=function(e,r){var o=n.isOptionDisabled(e,t),a=n.isOptionSelected(e,t),s=n.getOptionLabel(e),l=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&a||!n.filterOption({label:s,value:l,data:e},i))){var u=o?void 0:function(){return n.onOptionHover(e)},c=o?void 0:function(){return n.selectOption(e)},d="".concat(n.getElementId("option"),"-").concat(r);return{innerProps:{id:d,onClick:c,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:e,isDisabled:o,isSelected:a,key:d,label:s,type:"option",value:l}}};return o.reduce((function(e,t,r){if(t.options){n.hasGroups||(n.hasGroups=!0);var i=t.options.map((function(t,n){var i=a(t,"".concat(r,"-").concat(n));return i&&e.focusable.push(t),i})).filter(Boolean);if(i.length){var o="".concat(n.getElementId("group"),"-").concat(r);e.render.push({type:"group",key:o,data:t,options:i})}}else{var s=a(t,"".concat(r));s&&(e.render.push(s),e.focusable.push(t))}return e}),{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,i=e.focusedOption,o=this.props,a=o.options,s=o.menuIsOpen,l=o.inputValue,u=o.screenReaderStatus,c=r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"",d=i&&s?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option ".concat(n(t)," focused").concat(t.isDisabled?" disabled":"",", ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedOption:i,getOptionLabel:this.getOptionLabel,options:a}):"",f=function(e){var t=e.inputValue,n=e.screenReaderMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}({inputValue:l,screenReaderMessage:u({count:this.countOptions()})});return"".concat(c," ").concat(d," ").concat(f," ").concat(t)}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,a=e.tabIndex,s=this.components.Input,l=this.state.inputIsHidden,u=r||this.getElementId("input");if(!n)return i.a.createElement(ie,{id:u,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:A,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:a,value:""});var c={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},d=this.commonProps,f=d.cx,p=d.theme,h=d.selectProps;return i.a.createElement(s,_({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:f,getStyles:this.getStyles,id:u,innerRef:this.getInputRef,isDisabled:t,isHidden:l,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:h,spellCheck:"false",tabIndex:a,theme:p,type:"text",value:o},c))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,a=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,u=this.commonProps,c=this.props,d=c.controlShouldRenderValue,f=c.isDisabled,p=c.isMulti,h=c.inputValue,m=c.placeholder,g=this.state,v=g.selectValue,y=g.focusedValue,b=g.isFocused;if(!this.hasValue()||!d)return h?null:i.a.createElement(l,_({},u,{key:"placeholder",isDisabled:f,isFocused:b}),m);if(p)return v.map((function(t){var s=t===y;return i.a.createElement(n,_({},u,{components:{Container:r,Label:o,Remove:a},isFocused:s,isDisabled:f,key:e.getOptionValue(t),removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var w=v[0];return i.a.createElement(s,_({},u,{data:w,isDisabled:f}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,_({},t,{innerProps:s,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,a=this.state.isFocused;if(!e||!o)return null;return i.a.createElement(e,_({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,a=this.state.isFocused;return i.a.createElement(n,_({},r,{isDisabled:o,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,_({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,o=t.Menu,a=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,u=t.NoOptionsMessage,c=t.Option,d=this.commonProps,f=this.state,p=f.focusedOption,h=f.menuOptions,m=this.props,g=m.captureMenuScroll,v=m.inputValue,y=m.isLoading,b=m.loadingMessage,w=m.minMenuHeight,x=m.maxMenuHeight,k=m.menuIsOpen,E=m.menuPlacement,O=m.menuPosition,T=m.menuPortalTarget,C=m.menuShouldBlockScroll,A=m.menuShouldScrollIntoView,P=m.noOptionsMessage,R=m.onMenuScrollToTop,M=m.onMenuScrollToBottom;if(!k)return null;var I,j=function(t){var n=p===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,i.a.createElement(c,_({},d,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())I=h.render.map((function(t){if("group"===t.type){t.type;var o=S(t,["type"]),a="".concat(t.key,"-heading");return i.a.createElement(n,_({},d,o,{Heading:r,headingProps:{id:a},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return j(e)})))}if("option"===t.type)return j(t)}));else if(y){var D=b({inputValue:v});if(null===D)return null;I=i.a.createElement(l,d,D)}else{var L=P({inputValue:v});if(null===L)return null;I=i.a.createElement(u,d,L)}var N={minMenuHeight:w,maxMenuHeight:x,menuPlacement:E,menuPosition:O,menuShouldScrollIntoView:A},F=i.a.createElement(U,_({},d,N),(function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return i.a.createElement(o,_({},d,N,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:y,placement:s}),i.a.createElement(ve,{isEnabled:g,onTopArrive:R,onBottomArrive:M},i.a.createElement(me,{isEnabled:C},i.a.createElement(a,_({},d,{innerRef:e.getMenuListRef,isLoading:y,maxHeight:l}),I))))}));return T||"fixed"===O?i.a.createElement(s,_({},d,{appendTo:T,controlElement:this.controlRef,menuPlacement:E,menuPosition:O}),F):F}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,a=t.name,s=this.state.selectValue;if(a&&!r){if(o){if(n){var l=s.map((function(t){return e.getOptionValue(t)})).join(n);return i.a.createElement("input",{name:a,type:"hidden",value:l})}var u=s.length>0?s.map((function(t,n){return i.a.createElement("input",{key:"i-".concat(n),name:a,type:"hidden",value:e.getOptionValue(t)})})):i.a.createElement("input",{name:a,type:"hidden"});return i.a.createElement("div",null,u)}var c=s[0]?this.getOptionValue(s[0]):"";return i.a.createElement("input",{name:a,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(re,{"aria-live":"assertive"},i.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,a=this.props,s=a.className,l=a.id,u=a.isDisabled,c=a.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return i.a.createElement(r,_({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:d}),this.renderLiveRegion(),i.a.createElement(t,_({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:d,menuIsOpen:c}),i.a.createElement(o,_({},f,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(n,_({},f,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),t}(r.Component);b(We,"defaultProps",qe);var Ve={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},$e=function(e){var t,n;return n=t=function(t){function n(){var e,t;g(this,n);for(var r=arguments.length,i=new Array(r),o=0;o1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=String(e).toLowerCase(),r=String(t.value).toLowerCase(),i=String(t.label).toLowerCase();return r===n||i===n},Je=w({allowCreateWhileLoading:!1,createOptionPosition:"last"},{formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n){return!(!e||t.some((function(t){return Xe(e,t)}))||n.some((function(t){return Xe(e,t)})))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}}),Ze=function(e){var t,n;return n=t=function(t){function n(e){var t;g(this,n),b(O(O(t=T(this,k(n).call(this,e)))),"select",void 0),b(O(O(t)),"onChange",(function(e,n){var r=t.props,i=r.getNewOptionData,o=r.inputValue,a=r.isMulti,s=r.onChange,l=r.onCreateOption,u=r.value;if("select-option"!==n.action)return s(e,n);var c=t.state.newOption,d=Array.isArray(e)?e:[e];if(d[d.length-1]!==c)s(e,n);else if(l)l(o);else{var f=i(o,o),p={action:"create-option"};s(a?[].concat(C(M(u)),[f]):f,p)}}));var r=e.options||[];return t.state={newOption:void 0,options:r},t}return x(n,t),y(n,[{key:"componentWillReceiveProps",value:function(e){var t=e.allowCreateWhileLoading,n=e.createOptionPosition,r=e.formatCreateLabel,i=e.getNewOptionData,o=e.inputValue,a=e.isLoading,s=e.isValidNewOption,l=e.value,u=e.options||[],c=this.state.newOption;c=s(o,M(l),u)?i(o,r(o)):void 0,this.setState({newOption:c,options:!t&&a||!c?u:"first"===n?[c].concat(C(u)):[].concat(C(u),[c])})}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){var t=this,n=_({},this.props),r=this.state.options;return i.a.createElement(e,_({},n,{ref:function(e){t.select=e},options:r,onChange:this.onChange}))}}]),n}(r.Component),b(t,"defaultProps",Je),n},et=$e(Ze(We)),tt=$e(Ze(We)),nt=Ke(tt),rt=function(e){return function(t){t.in,t.onExited,t.appear,t.enter,t.exit;var n=S(t,["in","onExited","appear","enter","exit"]);return i.a.createElement(e,n)}},it=function(e){var t=e.component,n=e.duration,r=void 0===n?1:n,o=e.in,a=(e.onExited,S(e,["component","duration","in","onExited"])),s={entering:{opacity:0},entered:{opacity:1,transition:"opacity ".concat(r,"ms")},exiting:{opacity:0},exited:{opacity:0}};return i.a.createElement(h.Transition,{mountOnEnter:!0,unmountOnExit:!0,in:o,timeout:r},(function(e){var n={style:w({},s[e])};return i.a.createElement(t,_({innerProps:n},a))}))},ot=function(e){function t(){var e,n;g(this,t);for(var r=arguments.length,i=new Array(r),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=Fe({components:e}),n=t.Input,r=t.MultiValue,i=t.Placeholder,o=t.SingleValue,a=t.ValueContainer,s=S(t,["Input","MultiValue","Placeholder","SingleValue","ValueContainer"]);return w({Input:rt(n),MultiValue:at(r),Placeholder:st(i),SingleValue:lt(o),ValueContainer:ut(a)},s)},dt=ct(),ft=(dt.Input,dt.MultiValue,dt.Placeholder,dt.SingleValue,dt.ValueContainer,Object(o.a)(ct,X)),pt=$e(We);t.default=pt},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.getEditorComponents=t.getEditorControl=void 0;var r=u(n(1)),i=u(n(2)),o=u(n(24)),a=u(n(1230)),s=u(n(1469)),l=n(11);function u(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}let d,f=()=>[];t.getEditorControl=()=>d;t.getEditorComponents=()=>f();class p extends r.default.Component{constructor(e){super(e),c(this,"handleMode",e=>{this.setState({mode:e,pendingFocus:!0}),localStorage.setItem("cms.md-mode",e)}),c(this,"processRef",e=>this.ref=e),c(this,"setFocusReceived",()=>{this.setState({pendingFocus:!1})}),d=e.editorControl,f=e.getEditorComponents,this.state={mode:localStorage.getItem("cms.md-mode")||"visual",pendingFocus:!1}}render(){const{onChange:e,onAddAsset:t,getAsset:n,value:r,classNameWrapper:i,field:o,getEditorComponents:u,resolveWidget:c,t:d}=this.props,{mode:f,pendingFocus:p}=this.state,h=(0,l.jsx)("div",{className:"cms-editor-visual",ref:this.processRef},(0,l.jsx)(s.default,{onChange:e,onAddAsset:t,onMode:this.handleMode,getAsset:n,className:i,value:r,field:o,getEditorComponents:u,resolveWidget:c,pendingFocus:p&&this.setFocusReceived,t:d})),m=(0,l.jsx)("div",{className:"cms-editor-raw",ref:this.processRef},(0,l.jsx)(a.default,{onChange:e,onAddAsset:t,onMode:this.handleMode,getAsset:n,className:i,value:r,field:o,pendingFocus:p&&this.setFocusReceived,t:d}));return"visual"===f?h:m}}t.default=p,c(p,"propTypes",{onChange:i.default.func.isRequired,onAddAsset:i.default.func.isRequired,getAsset:i.default.func.isRequired,classNameWrapper:i.default.string.isRequired,editorControl:i.default.elementType.isRequired,value:i.default.string,field:o.default.map.isRequired,getEditorComponents:i.default.func,t:i.default.func.isRequired}),c(p,"defaultProps",{value:""})},function(e){e.exports=JSON.parse('{"AElig":"Æ","AMP":"&","Aacute":"Á","Acirc":"Â","Agrave":"À","Aring":"Å","Atilde":"Ã","Auml":"Ä","COPY":"©","Ccedil":"Ç","ETH":"Ð","Eacute":"É","Ecirc":"Ê","Egrave":"È","Euml":"Ë","GT":">","Iacute":"Í","Icirc":"Î","Igrave":"Ì","Iuml":"Ï","LT":"<","Ntilde":"Ñ","Oacute":"Ó","Ocirc":"Ô","Ograve":"Ò","Oslash":"Ø","Otilde":"Õ","Ouml":"Ö","QUOT":"\\"","REG":"®","THORN":"Þ","Uacute":"Ú","Ucirc":"Û","Ugrave":"Ù","Uuml":"Ü","Yacute":"Ý","aacute":"á","acirc":"â","acute":"´","aelig":"æ","agrave":"à","amp":"&","aring":"å","atilde":"ã","auml":"ä","brvbar":"¦","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","curren":"¤","deg":"°","divide":"÷","eacute":"é","ecirc":"ê","egrave":"è","eth":"ð","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","iacute":"í","icirc":"î","iexcl":"¡","igrave":"ì","iquest":"¿","iuml":"ï","laquo":"«","lt":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","ntilde":"ñ","oacute":"ó","ocirc":"ô","ograve":"ò","ordf":"ª","ordm":"º","oslash":"ø","otilde":"õ","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","raquo":"»","reg":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","thorn":"þ","times":"×","uacute":"ú","ucirc":"û","ugrave":"ù","uml":"¨","uuml":"ü","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(e,t,n){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}},function(e,t,n){"use strict";var r=n(595),i=n(194);e.exports=function(e){return r(e)||i(e)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a=e.length,s=-1;for(;++s";return e};var i=/\s/},function(e,t,n){"use strict";e.exports=function(e){var t=-1===e.indexOf('"')?'"':"'";return t+e+t}},function(e,t,n){"use strict";var r=n(617),i=n(619),o=n(622),a=n(623),s=n(626),l=n(1368);e.exports=r([o,i,a,s,l])},function(e,t,n){"use strict";e.exports=function(e){return e.toLowerCase()}},function(e,t,n){"use strict";var r=n(390);function i(e){return function(t,n,i){var o=t&&t.children,a=n+e,s=o&&o[a];if(!i)for(;s&&r(s);)s=o[a+=e];return s}}t.before=i(-1),t.after=i(1)},function(e,t,n){"use strict";e.exports=function(e){var t;if(e&&"object"==typeof e&&"text"===e.type)t=e.value||"";else{if("string"!=typeof e)return!1;t=e}return""===t.replace(r,"")};var r=/[ \t\n\f\r]/g},function(e,t,n){"use strict";var r=n(388),i=n(620),o=n(621);e.exports=function(e,t){var n=r(t),d=t,f=o;if(n in e.normal)return e.property[e.normal[n]];n.length>4&&"data"===n.slice(0,4)&&a.test(t)&&("-"===t.charAt(4)?d=function(e){var t=e.slice(5).replace(s,c);return"data"+t.charAt(0).toUpperCase()+t.slice(1)}(t):t=function(e){var t=e.slice(4);if(s.test(t))return e;"-"!==(t=t.replace(l,u)).charAt(0)&&(t="-"+t);return"data"+t}(t),f=i);return new f(d,t)};var a=/^data[-\w.:]+$/i,s=/-[a-z]/g,l=/[A-Z]/g;function u(e){return"-"+e.toLowerCase()}function c(e){return e.charAt(1).toUpperCase()}},function(e,t,n){"use strict";const r=[65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];t.REPLACEMENT_CHARACTER="�",t.CODE_POINTS={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},t.CODE_POINT_SEQUENCES={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},t.isSurrogate=function(e){return e>=55296&&e<=57343},t.isSurrogatePair=function(e){return e>=56320&&e<=57343},t.getSurrogatePairCodePoint=function(e,t){return 1024*(e-55296)+9216+t},t.isControlCodePoint=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},t.isUndefinedCodePoint=function(e){return e>=64976&&e<=65007||r.indexOf(e)>-1}},function(e,t,n){"use strict";e.exports={controlCharacterInInputStream:"control-character-in-input-stream",noncharacterInInputStream:"noncharacter-in-input-stream",surrogateInInputStream:"surrogate-in-input-stream",nonVoidHtmlElementStartTagWithTrailingSolidus:"non-void-html-element-start-tag-with-trailing-solidus",endTagWithAttributes:"end-tag-with-attributes",endTagWithTrailingSolidus:"end-tag-with-trailing-solidus",unexpectedSolidusInTag:"unexpected-solidus-in-tag",unexpectedNullCharacter:"unexpected-null-character",unexpectedQuestionMarkInsteadOfTagName:"unexpected-question-mark-instead-of-tag-name",invalidFirstCharacterOfTagName:"invalid-first-character-of-tag-name",unexpectedEqualsSignBeforeAttributeName:"unexpected-equals-sign-before-attribute-name",missingEndTagName:"missing-end-tag-name",unexpectedCharacterInAttributeName:"unexpected-character-in-attribute-name",unknownNamedCharacterReference:"unknown-named-character-reference",missingSemicolonAfterCharacterReference:"missing-semicolon-after-character-reference",unexpectedCharacterAfterDoctypeSystemIdentifier:"unexpected-character-after-doctype-system-identifier",unexpectedCharacterInUnquotedAttributeValue:"unexpected-character-in-unquoted-attribute-value",eofBeforeTagName:"eof-before-tag-name",eofInTag:"eof-in-tag",missingAttributeValue:"missing-attribute-value",missingWhitespaceBetweenAttributes:"missing-whitespace-between-attributes",missingWhitespaceAfterDoctypePublicKeyword:"missing-whitespace-after-doctype-public-keyword",missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:"missing-whitespace-between-doctype-public-and-system-identifiers",missingWhitespaceAfterDoctypeSystemKeyword:"missing-whitespace-after-doctype-system-keyword",missingQuoteBeforeDoctypePublicIdentifier:"missing-quote-before-doctype-public-identifier",missingQuoteBeforeDoctypeSystemIdentifier:"missing-quote-before-doctype-system-identifier",missingDoctypePublicIdentifier:"missing-doctype-public-identifier",missingDoctypeSystemIdentifier:"missing-doctype-system-identifier",abruptDoctypePublicIdentifier:"abrupt-doctype-public-identifier",abruptDoctypeSystemIdentifier:"abrupt-doctype-system-identifier",cdataInHtmlContent:"cdata-in-html-content",incorrectlyOpenedComment:"incorrectly-opened-comment",eofInScriptHtmlCommentLikeText:"eof-in-script-html-comment-like-text",eofInDoctype:"eof-in-doctype",nestedComment:"nested-comment",abruptClosingOfEmptyComment:"abrupt-closing-of-empty-comment",eofInComment:"eof-in-comment",incorrectlyClosedComment:"incorrectly-closed-comment",eofInCdata:"eof-in-cdata",absenceOfDigitsInNumericCharacterReference:"absence-of-digits-in-numeric-character-reference",nullCharacterReference:"null-character-reference",surrogateCharacterReference:"surrogate-character-reference",characterReferenceOutsideUnicodeRange:"character-reference-outside-unicode-range",controlCharacterReference:"control-character-reference",noncharacterCharacterReference:"noncharacter-character-reference",missingWhitespaceBeforeDoctypeName:"missing-whitespace-before-doctype-name",missingDoctypeName:"missing-doctype-name",invalidCharacterSequenceAfterDoctypeName:"invalid-character-sequence-after-doctype-name",duplicateAttribute:"duplicate-attribute",nonConformingDoctype:"non-conforming-doctype",missingDoctype:"missing-doctype",misplacedDoctype:"misplaced-doctype",endTagWithoutMatchingOpenElement:"end-tag-without-matching-open-element",closingOfElementWithOpenChildElements:"closing-of-element-with-open-child-elements",disallowedContentInNoscriptInHead:"disallowed-content-in-noscript-in-head",openElementsLeftAfterEof:"open-elements-left-after-eof",abandonedHeadElementChild:"abandoned-head-element-child",misplacedStartTagForHeadElement:"misplaced-start-tag-for-head-element",nestedNoscriptInHead:"nested-noscript-in-head",eofInElementThatCanContainOnlyText:"eof-in-element-that-can-contain-only-text"}},function(e,t,n){"use strict";const r=n(125);e.exports=class extends r{constructor(e,t){super(e),this.posTracker=null,this.onParseError=t.onParseError}_setErrorLocation(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset}_reportError(e){const t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t)}_getOverriddenMethods(e){return{_err(t){e._reportError(t)}}}}},function(e,t,n){"use strict";e.exports=s;var r=n(1411),i=r.CONTINUE,o=r.SKIP,a=r.EXIT;function s(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null),r(e,t,(function(e,t){var r=t[t.length-1],i=r?r.children.indexOf(e):null;return n(e,i,r)}),i)}s.CONTINUE=i,s.SKIP=o,s.EXIT=a},function(e,t,n){"use strict";e.exports=function(e,t){return i(r(e,t))};var r=n(71),i=n(397)},function(e,t,n){"use strict";e.exports=o,o.needed=s;var r=n(592),i=n(1414);function o(e){return a(e,(function(e){var t=e[0];if(1===e.length&&"text"===t.type&&(" "===t.value||"\n"===t.value))return[];return{type:"paragraph",children:e}}))}function a(e,t,n){for(var r,o,a=n||c,u=[],d=function(e){var t,n=e.length,r=-1,i=[];for(;++rfunction(e){for(var t=1;t|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r!?|\/]/,A=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,P=l.isReservedIdentifier||!1;function R(e,t){var n,r=e.next();if(_[r]){var i=_[r](e,t);if(!1!==i)return i}if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){for(var r,i=!1,o=!1;null!=(r=e.next());){if(r==n&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!w)&&(t.tokenize=null),"string"}),t.tokenize(e,t);if(S.test(r))return u=r,null;if(O.test(r)){if(e.backUp(1),e.match(T))return"number";e.next()}if("/"==r){if(e.eat("*"))return t.tokenize=M,M(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(C.test(r)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(C););return"operator"}if(e.eatWhile(A),E)for(;e.match(E);)e.eatWhile(A);var o=e.current();return s(h,o)?(s(v,o)&&(u="newstatement"),s(y,o)&&(c=!0),"keyword"):s(m,o)?"type":s(g,o)||P&&P(o)?(s(v,o)&&(u="newstatement"),"builtin"):s(b,o)?"atom":"variable"}function M(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function I(e,t){l.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-d,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return I(e,t),null;u=c=null;var s=(t.tokenize||R)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==u||":"==u||","==u&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==u)n(t,e.column(),"}");else if("["==u)n(t,e.column(),"]");else if("("==u)n(t,e.column(),")");else if("}"==u){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else u==a.type?r(t):x&&(("}"==a.type||"top"==a.type)&&";"!=u||"statement"==a.type&&"newstatement"==u)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),_.token){var d=_.token(e,t,s);void 0!==d&&(s=d)}return"def"==s&&!1===l.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=c?"def":s||u,I(e,t),s},indent:function(t,n){if(t.tokenize!=R&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0),o=i==r.type;if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(_.indent){var a=_.indent(t,r,n,d);if("number"==typeof a)return a}var s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:f):!r.align||p&&")"==r.type?")"!=r.type||o?r.indented+(o?0:d)+(o||!s||/^(?:case|default)\b/.test(n)?0:d):r.indented+f:r.column+(o?0:1)},electricInput:k?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",u="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",c="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",d="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",f=a("int long char short double float unsigned signed void bool"),p=a("SEL instancetype id Class Protocol BOOL");function h(e){return s(f,e)||/.+_t$/.test(e)}function m(e){return h(e)||s(p,e)}var g="case do else for if switch while struct enum union";function v(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=v;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function y(e,t){return"type"==t.prevToken&&"type"}function b(e){return!(!e||e.length<2||"_"!=e[0]||"_"!=e[1]&&e[1]===e[1].toLowerCase())}function _(e){return e.eatWhile(/[\w\.']/),"number"}function w(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=E,E(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function x(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function k(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function E(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+n+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function S(t,n){"string"==typeof t&&(t=[t]);var r=[];function i(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}i(n.keywords),i(n.types),i(n.builtin),i(n.atoms),r.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var o=0;o!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=O,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=T(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),S("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){var n;return t.tokenize=(n=e.match('""'),function(e,t){for(var r,i=!1,o=!1;!e.eol();){if(!n&&!i&&e.match('"')){o=!0;break}if(n&&e.match('"""')){o=!0;break}r=e.next(),!i&&"$"==r&&e.match("{")&&e.skipTo("}"),i=!i&&"\\"==r&&!n}return!o&&n||(t.tokenize=null),"string"}),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=T(1),t.tokenize(e,t))},indent:function(e,t,n,r){var i=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n&&"}"!=e.context.type||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*r+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:r):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),S(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":v},modeProps:{fold:["brace","include"]}}),S("text/x-nesc",{name:"clike",keywords:a(l+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:h,blockKeywords:a(g),atoms:a("null true false"),hooks:{"#":v},modeProps:{fold:["brace","include"]}}),S("text/x-objectivec",{name:"clike",keywords:a(l+" "+c),types:m,builtin:a(d),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a("struct enum union @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:b,hooks:{"#":v,"*":y},modeProps:{fold:["brace","include"]}}),S("text/x-objectivec++",{name:"clike",keywords:a(l+" "+c+" "+u),types:m,builtin:a(d),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:a("struct enum union @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:b,hooks:{"#":v,"*":y,u:w,U:w,L:w,R:w,0:_,1:_,2:_,3:_,4:_,5:_,6:_,7:_,8:_,9:_,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&x(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),S("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:h,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":v},modeProps:{fold:["brace","include"]}});var C=null;S("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=function e(t){return function(n,r){for(var i,o=!1,a=!1;!n.eol();){if(!o&&n.match('"')&&("single"==t||n.match('""'))){a=!0;break}if(!o&&n.match("``")){C=e(t),a=!0;break}i=n.next(),o="single"==t&&!o&&"\\"==i}return a&&(r.tokenize=null),"string"}}(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!C||!e.match("`"))&&(t.tokenize=C,C=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}(n(5))},function(e,t,n){!function(e){"use strict";e.defineMode("ruby",(function(t){function n(e){for(var t={},n=0,r=e.length;n-1)r++;else if("]})".indexOf(t)>-1){if(--r<0)break}else if("/"==t&&0==r){i=!0;break}o="\\"==t}return e.backUp(e.pos-n),i}(e)?u(p(a,"string-2",!0),e,t):"operator";if("%"==a){var l="string",c=!0;e.eat("s")?l="atom":e.eat(/[WQ]/)?l="string":e.eat(/[r]/)?l="string-2":e.eat(/[wxq]/)&&(l="string",c=!1);var d=e.eat(/[^\w\s=]/);return d?(s.propertyIsEnumerable(d)&&(d=s[d]),u(p(d,l,c,!0),e,t)):"operator"}if("#"==a)return e.skipToEnd(),"comment";if("<"==a&&(n=e.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return u((i=n[2],o=n[1],function(e,t){return o&&e.eatSpace(),e.match(i)?t.tokenize.pop():e.skipToEnd(),"string"}),e,t);if("0"==a)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(a))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==a){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==a)return e.eat("'")?u(p("'","atom",!1),e,t):e.eat('"')?u(p('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==a&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==a)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(a))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=a||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(a))return r=a,null;if("-"==a&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(a)){var f=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=a||f||(r="."),"operator"}return null}return r="|",null}function d(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=d(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=d(e+1));return c(t,n)}}function f(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,c(t,n))}}function p(e,t,n,r){return function(i,o){var a,s=!1;for("read-quoted-paused"===o.context.type&&(o.context=o.context.prev,i.eat("}"));null!=(a=i.next());){if(a==e&&(r||!s)){o.tokenize.pop();break}if(n&&"#"==a&&!s){if(i.eat("{")){"}"==e&&(o.context={prev:o.context,type:"read-quoted-paused"}),o.tokenize.push(d());break}if(/[@\$]/.test(i.peek())){o.tokenize.push(f());break}}s=!s&&"\\"==a}return t}}function h(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}return{startState:function(){return{tokenize:[c],indented:0,context:{type:"top",indented:-t.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){r=null,e.sol()&&(t.indented=e.indentation());var n,s=t.tokenize[t.tokenize.length-1](e,t),l=r;if("ident"==s){var u=e.current();"keyword"==(s="."==t.lastTok?"property":i.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(u)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable")&&(l=u,o.propertyIsEnumerable(u)?n="indent":a.propertyIsEnumerable(u)?n="dedent":"if"!=u&&"unless"!=u||e.column()!=e.indentation()?"do"==u&&t.context.indented-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive;if(u=i.string,!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);if((d=a.close?r(u,a.close,i.pos,a.parseDelimiters):-1)==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";d>-1&&(i.string=u.slice(0,d));var s=a.mode.token(i,o.inner);return d>-1&&(i.string=u),d==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(s=s?s+" "+a.innerStyle:a.innerStyle),s}for(var l=1/0,u=i.string,c=0;c2&&void 0!==arguments[2]&&arguments[2];return{type:u,payload:{location:e,action:t,isFirstRendering:n}}},d="@@router/CALL_HISTORY_METHOD",f=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.type,a=i.payload;if(o===u){var s=a.location,l=a.action,c=a.isFirstRendering;return c?e:n(e,{location:t(R(s)),action:l})}return e}}};function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var D={fromJS:function(e){return e},getIn:function(e,t){if(!e)return e;var n=t.length;if(n){for(var r=e,i=0;i2&&void 0!==arguments[2]&&arguments[2];r.inTimeTravelling?r.inTimeTravelling=!1:a(e,t,n)};return r.unlisten=o.listen(s),e.noInitialPop||s(o.location,o.action,!0),r}var r,o,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(n,e),r=n,(o=[{key:"componentWillUnmount",value:function(){this.unlisten(),this.unsubscribe()}},{key:"render",value:function(){var e=this.props,t=e.history,n=e.children;return i.a.createElement(l.e,{history:t},n)}}])&&k(r.prototype,o),a&&k(r,a),n}(r.PureComponent);n.propTypes={store:a.a.shape({getState:a.a.func.isRequired,subscribe:a.a.func.isRequired}).isRequired,history:a.a.shape({action:a.a.string.isRequired,listen:a.a.func.isRequired,location:a.a.object.isRequired,push:a.a.func.isRequired}).isRequired,basename:a.a.string,children:a.a.oneOfType([a.a.func,a.a.node]),onLocationChanged:a.a.func.isRequired,noInitialPop:a.a.bool};var o=function(e){var t=e.context||s.ReactReduxContext;if(null==t)throw"Please upgrade to react-redux v6";return i.a.createElement(t.Consumer,null,(function(t){var r=t.store;return i.a.createElement(n,x({store:r},e))}))};return o.propTypes={context:a.a.object},Object(s.connect)(null,(function(e){return{onLocationChanged:function(t,n,r){return e(c(t,n,r))}}}))(o)}(D),B=M(D),z=_(D),U=z.getLocation,q=z.getAction,H=z.getHash,W=z.getSearch,V=z.createMatchSelector},function(e,t,n){"use strict";n.r(t),n.d(t,"Editor",(function(){return pn})),n.d(t,"cloneFragment",(function(){return Bt})),n.d(t,"findDOMNode",(function(){return hn})),n.d(t,"findDOMPoint",(function(){return mn})),n.d(t,"findDOMRange",(function(){return gn})),n.d(t,"findNode",(function(){return vn})),n.d(t,"findPath",(function(){return yn})),n.d(t,"findPoint",(function(){return bn})),n.d(t,"findRange",(function(){return wn})),n.d(t,"getEventRange",(function(){return xn})),n.d(t,"getEventTransfer",(function(){return $t})),n.d(t,"setEventTransfer",(function(){return Yt})),n.d(t,"ReactPlugin",(function(){return dn}));var r=n(1),i=n.n(r),o=n(2),a=n.n(o),s=n(23);function l(e,t){function n(n,r,i,o,a){var s=r[i];return null!=s||n?null==s&&n?new Error("The "+a+" `"+i+"` is marked as required in `"+o+"`, but it was not supplied."):t(s)?null:new Error("Invalid "+a+" `"+i+"` supplied to `"+o+"`, expected a Slate `"+e+"` but received: "+s):null}function r(){for(var e=arguments.length,t=Array(e),r=0;r",(function(e){return s.Block.isBlockList(e)})),change:l("Change",(function(e){return s.Change.isChange(e)})),data:l("Data",(function(e){return s.Data.isData(e)})),document:l("Document",(function(e){return s.Document.isDocument(e)})),inline:l("Inline",(function(e){return s.Inline.isInline(e)})),inlines:l("Inline",(function(e){return s.Inline.isInlineList(e)})),leaf:l("Leaf",(function(e){return s.Leaf.isLeaf(e)})),leaves:l("List",(function(e){return s.Leaf.isLeafList(e)})),mark:l("Mark",(function(e){return s.Mark.isMark(e)})),marks:l("Set",(function(e){return s.Mark.isMarkSet(e)})),node:l("Node",(function(e){return s.Node.isNode(e)})),nodes:l("List",(function(e){return s.Node.isNodeList(e)})),range:l("Range",(function(e){return s.Range.isRange(e)})),ranges:l("List",(function(e){return s.Range.isRangeList(e)})),selection:l("Selection",(function(e){return s.Selection.isSelection(e)})),value:l("Value",(function(e){return s.Value.isValue(e)})),text:l("Text",(function(e){return s.Text.isText(e)})),texts:l("List",(function(e){return s.Text.isTextList(e)}))},c=n(24),d=n.n(c),f=n(81),p=n.n(f),h=function(e,t){0},m=n(45),g=n.n(m),v=n(672),y=n.n(v),b="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},_="object"===("undefined"==typeof window?"undefined":b(window))&&"object"===("undefined"==typeof document?"undefined":b(document))&&9===document.nodeType,w=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},x=void 0;if(_){var k=!0,E=!1,S=void 0;try{for(var O,T=[["edge",/Edge\/([0-9\._]+)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["android",/Android\s([0-9\.]+)/],["safari",/Version\/([0-9\._]+).*Safari/]][Symbol.iterator]();!(k=(O=T.next()).done);k=!0){var C=O.value,A=w(C,2),P=A[0];if(A[1].test(window.navigator.userAgent)){x=P;break}}}catch(e){E=!0,S=e}finally{try{!k&&T.return&&T.return()}finally{if(E)throw S}}}var R=void 0;if(_){var M=!0,I=!1,j=void 0;try{for(var D,L=[["ios",/os ([\.\_\d]+) like mac os/i],["macos",/mac os x/i],["android",/android/i],["firefoxos",/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],["windows",/windows\s*(?:nt)?\s*([\.\_\d]+)/i]][Symbol.iterator]();!(M=(D=L.next()).done);M=!0){var N=D.value,F=w(N,2),B=F[0];if(F[1].test(window.navigator.userAgent)){R=B;break}}}catch(e){I=!0,j=e}finally{try{!M&&L.return&&L.return()}finally{if(I)throw j}}}var z=[];if(_){var U=!0,q=!1,H=void 0;try{for(var W,V=[["inputeventslevel1",function(e){return"inputType"in(e.InputEvent?new e.InputEvent("input"):{})}],["inputeventslevel2",function(e){var t=e.document.createElement("div");return t.contentEditable=!0,"onbeforeinput"in t}]][Symbol.iterator]();!(U=(W=V.next()).done);U=!0){var $=W.value,G=w($,2),K=G[0];(0,G[1])(window)&&z.push(K)}}catch(e){q=!0,H=e}finally{try{!U&&V.return&&V.return()}finally{if(q)throw H}}}var Y=[[/^9([.]0|)/,28],[/^8[.]1/,27],[/^8([.]0|)/,26],[/^7[.]1/,25],[/^7([.]0|)/,24],[/^6([.]0|)/,23],[/^5[.]1/,22],[/^5([.]0|)/,21],[/^4[.]4/,20]];var Q="firefox"===x,X="safari"===x,J="ie"===x,Z="edge"===x,ee="android"===R,te="ios"===R,ne="macos"===R,re=function(){if("android"!==R)return null;var e=window.navigator.userAgent.match(/Android\s([0-9\.]+)/);if(null==e)return null;var t=e[1],n=!0,r=!1,i=void 0;try{for(var o,a=Y[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=w(s,2),u=l[0],c=l[1];if(t.match(u))return c}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return null}(),ie=(z.includes("inputeventslevel1"),z.includes("inputeventslevel2")||ee&&(28===re||null===re)),oe=n(407),ae=n.n(oe),se=n(144),le=n.n(se),ue=n(4),ce=n(309),de={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z"},fe={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},pe={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:"ctrl+y"},he={},me=te||ne,ge=!me;[].concat(Object.keys(de)).concat(Object.keys(fe)).concat(Object.keys(pe)).forEach((function(e){var t="is"+e[0].toUpperCase()+e.slice(1);if(!he[t]){var n=de[e],r=fe[e],i=pe[e],o=n&&Object(ce.isKeyHotkey)(n),a=r&&Object(ce.isKeyHotkey)(r),s=i&&Object(ce.isKeyHotkey)(i);he[t]=function(e){return!(!o||!o(e))||(!!(me&&a&&a(e))||!!(ge&&s&&s(e)))}}}));var ve=he,ye=n(49),be=n.n(ye),_e=n(205),we=n(293),xe=n(33),ke=function(e,t){if(!e)throw new Error("Invariant failed: "+(t||""))},Ee=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=Te++,n=e.placeholder,r=e.when,o=e.style,a=void 0===o?{}:o;function s(e,n,i){if(!n.query(r,e))return i();var o=i(),a=e.texts(),s=Se(a,1)[0],l=e.texts({direction:"backward"}),u=Se(l,1)[0],c=Se(s,2),d=c[0],f=c[1],p=Se(u,2),h=p[0],m=p[1],g={type:"placeholder",data:{key:t},anchor:{key:d.key,offset:0,path:f},focus:{key:h.key,offset:h.text.length,path:m}};return[].concat(Oe(o),[g])}function l(e,r,o){var s=e.children,l=e.decoration;if("placeholder"===l.type&&l.data.get("key")===t){var u=Ee({pointerEvents:"none",display:"inline-block",width:"0",maxWidth:"100%",whiteSpace:"nowrap",opacity:"0.333",verticalAlign:"text-top"},a);return i.a.createElement("span",null,i.a.createElement("span",{contentEditable:!1,style:u},n),s)}return o()}return ke("string"==typeof n,"You must pass `SlateReactPlaceholder` an `options.placeholder` string."),ke("string"==typeof r||"function"==typeof r,"You must pass `SlateReactPlaceholder` an `options.when` query."),{decorateNode:s,renderDecoration:l}},Ae=function(e,t){return e===t};var Pe=function(e,t){var n;void 0===t&&(t=Ae);var r,i=[],o=!1,a=function(e,n){return t(e,i[n],n)};return function(){for(var t=arguments.length,s=new Array(t),l=0;l1?n-1:0),i=1;i1?n-1:0),i=1;ic+s&&(N=L+h+_-s),Du+l&&(F=D+p+v+a.height-l),r?t.scrollTo(N,F):(n.scrollTop=F,n.scrollLeft=N)}}function gt(e){if(J){var t=window.document.body.createTextRange();t.collapse(),t.select()}else e.removeAllRanges()}var vt=/Permission denied to access property "nodeType"/,yt=p()("slate:content");yt.update=p()("slate:update");var bt=function(e){function t(){var e,n,r;We(this,t);for(var o=arguments.length,a=Array(o),s=0;s0&&void 0!==arguments[0]?arguments[0]:{},t=_t.reduce((function(t,n){return n in e&&(t[n]=e[n]),t}),{});return t}function xt(){return{decorateNode:function(){return[]},renderAnnotation:function(e){var t=e.attributes,n=e.children;return i.a.createElement("span",t,n)},renderBlock:function(e){var t=e.attributes,n=e.children;return i.a.createElement("div",Ge({},t,{style:{position:"relative"}}),n)},renderDecoration:function(e){var t=e.attributes,n=e.children;return i.a.createElement("span",t,n)},renderDocument:function(e){return e.children},renderEditor:function(e){return e.children},renderInline:function(e){var t=e.attributes,n=e.children;return i.a.createElement("span",Ge({},t,{style:{position:"relative"}}),n)},renderMark:function(e){var t=e.attributes,n=e.children;return i.a.createElement("span",t,n)}}}function kt(){return{queries:{findDOMNode:function(e,t){t=s.PathUtils.create(t);var n=e.tmp.contentRef.current;return n?t.size?function e(t,n){if(!t)return null;if(!n.size)return t.ref?t.ref.current||null:t||null;var r=n.first(),i=n.rest();return e(t.tmp.nodeRefs[r],i)}(n.tmp.nodeRef.current,t):n.ref.current||null:null},findDOMPoint:function(e,t){var n=e.findDOMNode(t.path),r=0;if(!n)return null;var i=Array.from(n.querySelectorAll(He.STRING+", "+He.ZERO_WIDTH)),o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value,d=c.childNodes[0],f=d.textContent.length,p=f;c.hasAttribute(Le)&&(p=parseInt(c.getAttribute(Le),10));var h=r+p;if(t.offset<=h)return{node:d,offset:Math.min(f,Math.max(0,t.offset-r))};r=h}}catch(e){a=!0,s=e}finally{try{!o&&u.return&&u.return()}finally{if(a)throw s}}return null},findDOMRange:function(e,t){var n=t.anchor,r=t.focus,i=t.isBackward,o=t.isCollapsed,a=e.findDOMPoint(n),s=o?a:e.findDOMPoint(r);if(!a||!s)return null;var l=g()(a.node).document.createRange(),u=i?s:a,c=i?a:s;return l.setStart(u.node,u.offset),l.setEnd(c.node,c.offset),l},findEventRange:function(e,t){t.nativeEvent&&(t=t.nativeEvent);var n=t,r=n.clientX,i=n.clientY,o=n.target;if(null==r||null==i)return null;var a=e.value.document,s=e.findPath(t.target);if(!s)return null;var l=a.getNode(s);if(e.isVoid(l)){var u=o.getBoundingClientRect(),c="inline"===l.object?r-u.left=r.length?(a=!0,o=t-1,n="backward"):o<0?(s=!0,o=t+1,n="forward"):(i=r[o],"forward"===n&&o++,"backward"===n&&o--);return i||null}function St(e,t){if(e===t)return null;var n=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t,i=e,o=0;-1!==o&&-1!==(o=i.indexOf(Ct,o));)r>o&&r--,i=""+i.slice(0,o)+i.slice(o+1);var a=i.charAt(i.length-1);n&&"\n"===a&&(i=i.slice(0,-1));var s=i.length;return r>s&&(r=s),{text:i,offset:r}}function Mt(e){var t=new window.MutationObserver((function(e){var t;Tt("flush"),(t=l).push.apply(t,Xe(e)),d()})),n=null,r={rootEl:null,diff:null,range:null,domNode:null};function i(){Tt("clearAction"),r.diff=null,r.domNode=null}function o(){Tt("applyDiff");var t=r.diff;if(null!=t){Tt("applyDiff:run");var n=e.value.document,i=e.value.selection.moveAnchorTo(t.path,t.start).moveFocusTo(t.path,t.end);i=n.resolveRange(i),e.insertTextAtRange(i,t.insertText)}}function a(){Tt("splitBlock"),Pt(e,(function(){o(),r.range?e.select(r.range):Tt("splitBlock:NO-SELECTION"),e.splitBlock().focus().restoreDOM(),i()}))}var s=null,l=[],u=null,c=!1;function d(){s&&(window.cancelAnimationFrame(s),s=null),c=!0,u&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame((function(){l.length>0&&function(t){if(Tt("flushAction",t.length,t),r.range&&!r.range.isCollapsed)return void Pt(e,(function(){e.select(r.range).deleteBackward().focus().restoreDOM()}));if(t.length>1){if(t.find((function(t){if("childList"!==t.type)return!1;if(0===t.addedNodes.length)return!1;var n=t.addedNodes[0];if(n.nodeType===window.Node.TEXT_NODE&&"\n"===n.textContent)return!0;if(n.nodeType!==window.Node.ELEMENT_NODE)return!1;var r=n.dataset.key;return null!=r&&!!e.value.document.getClosestBlock(r)})))return void a()}var s=t[0];"characterData"===s.type?function(t){Tt("resolveDOMNode");var n=e.value.document,i=t.closest("[data-key]").dataset.key,o=n.getPath(i),a=n.getClosestBlock(i),s=n.getDescendant(i),l=s.text,u=a.nodes.last()===s,c=Rt(t.textContent,0,u).text;if(c===l)return void(r.diff=null);var d=function(e,t){var n=St(e,t);if(null==n)return null;var r=Ot(t,n),i=Ot(e,n);return{start:n.start,end:e.length-n.end,cursor:n.start+r.length,insertText:r,removeText:i}}(l,c);r.diff={path:o,start:d.start,end:d.end,insertText:d.insertText},Tt("resolveDOMNode:diff",r.diff)}(s.target.parentNode):"childList"===s.type&&(s.removedNodes.length>0?1===t.length?function(t){if(Tt("removeNode"),t.nodeType!==window.Node.ELEMENT_NODE)return;var n=e.value,r=n.document,i=n.selection,o=e.findNode(t),a=r.resolveRange(i.moveToRangeOfNode(o));Pt(e,(function(){e.select(a).delete().restoreDOM()}))}(s.removedNodes[0]):(Tt("mergeBlock"),n.requestAnimationFrame((function(){Pt(e,(function(){o(),e.select(r.range).deleteBackward().focus().restoreDOM(),i()}))}))):s.addedNodes.length>0&&a())}(l),u=null,l=[],c=!1}))}return{clearDiff:function(){Tt("clearDIff"),r.diff=null},connect:function(){Tt("connect",{rootEl:i});var i=e.findDOMNode([]);r.rootEl!==i&&(Tt("connect:run"),n=g()(i),t.observe(i,{childList:!0,characterData:!0,attributes:!0,subtree:!0,characterDataOldValue:!0}))},disconnect:function(){Tt("disconnect"),t.disconnect(),r.rootEl=null},onKeyDown:d,onCompositionStart:function(){Tt("onCompositionStart")},onCompositionEnd:function(){Tt("onCompositionEnd"),window.setTimeout((function(){r.diff&&(Tt("onCompositionEnd:applyDiff"),Pt(e,(function(){o();var t=n.getSelection().getRangeAt(0),r=Rt(t.startContainer.textContent,t.startOffset),i=e.findRange({anchorNode:t.startContainer,anchorOffset:0,focusNode:t.startContainer,focusOffset:0,isCollapsed:!0}).moveTo(r.offset);e.select(i).focus().restoreDOM()}))),i()}),20)},onSelect:function(t){Tt("onSelect:try"),t=t.nativeEvent?t.nativeEvent:t,window.cancelAnimationFrame(s),s=null,c||(s=window.requestAnimationFrame((function(){Tt("onSelect:save-selection");var n,a=g()(t.target).getSelection(),s=e.findRange(a),l=Rt(a.anchorNode.textContent,a.anchorOffset),u=Rt(a.focusNode.textContent,a.focusOffset);s.anchor.offset!==l.offset&&(s=s.set("anchor",s.anchor.set("offset",l.offset))),s.focus.offset!==u.offset&&(s=s.set("focus",s.focus.set("offset",u.offset))),Tt("onSelect:save-data",{domSelection:(n=a,{anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),range:s.toJS()}),a.isCollapsed&&r.node!==a.anchorNode&&null!=r.diff&&(Tt("onSelect:applyDiff",r.diff),o(),e.select(s),i()),r.range=s,r.node=a.anchorNode})))}}}function It(e){var t=new Mt(e.editor);return{onComponentDidMount:function(){t.connect()},onComponentDidUpdate:function(){t.connect()},onComponentWillUnmount:function(){t.disconnect()},onCompositionEnd:function(){t.onCompositionEnd()},onCompositionStart:function(){t.onCompositionStart()},onRender:function(){t.disconnect(),t.clearDiff()},onSelect:function(e){!function(e){var t=e.getSelection(),n=t.anchorNode;if(null!=n){var r=n.parentElement.dataset;if(!!r&&"n"===r.slateZeroWidth&&1===n.textContent.length&&0!==t.anchorOffset){var i=e.document.createRange();i.setStart(n,0),i.setEnd(n,0),t.removeAllRanges(),t.addRange(i)}}}(g()(e.target)),t.onSelect(e)}}}function jt(){var e={},t=!0,n=!1,r=void 0;try{for(var i,o=Re[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){e[i.value]=function(e,t,n){}}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}return e}var Dt={FRAGMENT:"application/x-slate-fragment",HTML:"text/html",NODE:"application/x-slate-node",RICH:"text/rtf",TEXT:"text/plain"},Lt=Dt.FRAGMENT,Nt=Dt.HTML,Ft=Dt.TEXT;function Bt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};Object(xe.a)(!s.Value.isValue(t),"As of Slate 0.42.0, the `cloneFragment` utility takes an `editor` instead of a `value`.");var r=g()(e.target),i=r.getSelection(),o=t.value,a=o.document,l=o.fragment,u=o.selection,c=u.start,d=u.end,f=a.getClosestVoid(c.path,t),p=a.getClosestVoid(d.path,t);if(!i.isCollapsed||f){var h=_e.default.serializeNode(l),m=i.getRangeAt(0),v=m.cloneContents(),y=v.childNodes[0];if(v.childNodes.forEach((function(e){e.textContent&&""!==e.textContent.trim()&&(y=e)})),p){var b=m.cloneRange(),_=a.getPath(p.key);if(_){var w=t.findDOMNode(_);b.setEndAfter(w),v=b.cloneContents()}}if(f&&(y=v.childNodes[0].childNodes[1].firstChild),[].slice.call(v.querySelectorAll(He.ZERO_WIDTH)).forEach((function(e){var t="n"===e.getAttribute(qe);e.textContent=t?"\n":""})),3===y.nodeType){var x=r.document.createElement("span");x.style.whiteSpace="pre",x.appendChild(y),v.appendChild(x),y=x}y.setAttribute(Ie,h);var k=s.Value.create({document:l}),E=we.default.serialize(k),S=r.document.createElement("div");if(S.appendChild(v),e.clipboardData&&e.clipboardData.setData&&!J)return e.preventDefault(),e.clipboardData.setData(Ft,E),e.clipboardData.setData(Lt,h),e.clipboardData.setData(Nt,S.innerHTML),void n();var O=e.target.closest(He.EDITOR);S.setAttribute("contenteditable",!0),S.style.position="absolute",S.style.left="-9999px",O.appendChild(S),i.selectAllChildren(S),r.requestAnimationFrame((function(){O.removeChild(S),gt(i),i.addRange(m),n()}))}}var zt=Dt.FRAGMENT,Ut=Dt.HTML,qt=Dt.NODE,Ht=Dt.RICH,Wt=Dt.TEXT,Vt=/ data-slate-fragment="([^\s"]+)"/;function $t(e){!J&&e.nativeEvent&&(e=e.nativeEvent);var t=e.dataTransfer||e.clipboardData,n=Gt(t,zt),r=Gt(t,qt),i=Gt(t,Ut),o=Gt(t,Ht),a=Gt(t,Wt),s=void 0;if(!n&&i&&~i.indexOf(" "+Ie+'="')){var l=Vt.exec(i),u=Qe(l,2),c=(u[0],u[1]);c&&(n=c)}if(a){var d=function(e){var t="SLATE-DATA-EMBED::";if(e.substring(0,t.length)!==t)return{TEXT:e};try{return JSON.parse(e.substring(t.length))}catch(e){throw new Error("Unable to parse custom Slate drag event data.")}}(a);d[zt]&&(n=d[zt]),d[qt]&&(r=d[qt]),d[Wt]&&(a=d[Wt])}n&&(n=_e.default.deserializeNode(n)),r&&(r=_e.default.deserializeNode(r));try{t.items&&t.items.length?s=Array.from(t.items).map((function(e){return"file"===e.kind?e.getAsFile():null})).filter((function(e){return e})):t.files&&t.files.length&&(s=Array.from(t.files))}catch(e){t.files&&t.files.length&&(s=Array.from(t.files))}var f={files:s,fragment:n,html:i,node:r,rich:o,text:a};return f.type=function(e){return e.fragment?"fragment":e.node?"node":e.rich&&e.html?"html":e.rich&&e.text?"text":e.files&&e.files.length?"files":e.html?"html":e.text?"text":"unknown"}(f),f}function Gt(e,t){return e.types&&e.types.length?-1!==Array.from(e.types).indexOf(t)&&e.getData(t)||null:t===Wt&&e.getData("Text")||null}var Kt=Dt.TEXT;function Yt(e,t,n){var r=Dt[t.toUpperCase()];if(!r)throw new Error('Cannot set unknown transfer type "'+r+'".');e.nativeEvent&&(e=e.nativeEvent);var i=e.dataTransfer||e.clipboardData;try{i.setData(r,n),i.setData("text",i.getData("text"))}catch(e){var o="SLATE-DATA-EMBED::",a=i.getData(Kt),s={};if(a.substring(0,o.length)===o)try{s=JSON.parse(a.substring(o.length))}catch(e){throw new Error("Failed to parse Slate data from `DataTransfer` object.")}else s[Kt]=a;s[r]=n;var l=""+o+JSON.stringify(s);i.setData(Kt,l)}}var Qt=p()("slate:after");function Xt(){var e=null,t=!1;return{onBeforeInput:function(e,t,n){var r=t.value;if(!!e.nativeEvent)return e.preventDefault(),t.insertText(e.data),n();var i=e.getTargetRanges(),o=Qe(i,1)[0];if(!o)return n();Qt("onBeforeInput",{event:e}),e.preventDefault();var a=r.document,s=r.selection,l=t.findRange(o);switch(e.inputType){case"deleteByDrag":case"deleteByCut":case"deleteContent":case"deleteContentBackward":case"deleteContentForward":t.deleteAtRange(l);break;case"deleteWordBackward":t.deleteWordBackwardAtRange(l);break;case"deleteWordForward":t.deleteWordForwardAtRange(l);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":t.deleteLineBackwardAtRange(l);break;case"deleteSoftLineForward":case"deleteHardLineForward":t.deleteLineForwardAtRange(l);break;case"insertLineBreak":case"insertParagraph":a.hasVoidParent(s.start.path,t)?t.moveToStartOfNextText():t.splitBlockAtRange(l);break;case"insertFromYank":case"insertReplacementText":case"insertText":var u=null==e.data?e.dataTransfer.getData("text/plain"):e.data;if(null==u)break;t.insertTextAtRange(l,u,s.marks),s.marks&&r.document!==t.value.document&&t.select({marks:null})}n()},onBlur:function(e,t,n){Qt("onBlur",{event:e}),t.blur(),n()},onClick:function(e,t,n){if(t.readOnly)return n();var r=t.value.document,i=t.findPath(e.target);if(!i)return n();Qt("onClick",{event:e});var o=r.getNode(i),a=r.getAncestors(i);o&&(t.isVoid(o)||a.some((function(e){return t.isVoid(e)})))&&t.focus().moveToEndOfNode(o),n()},onCopy:function(e,t,n){Qt("onCopy",{event:e}),Bt(e,t),n()},onCut:function(e,t,n){Qt("onCut",{event:e}),Bt(e,t,(function(){var e=t.value,n=e.document,r=e.selection,i=r.end,o=void 0;if(r.isCollapsed){var a=!0,s=!1,l=void 0;try{for(var u,c=n.ancestors(i.path)[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var d=u.value,f=Qe(d,2),p=f[0],h=f[1];if(t.isVoid(p)){o=h;break}}}catch(e){s=!0,l=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}}o?t.removeNodeByKey(o):t.delete()})),n()},onDragEnd:function(t,n,r){Qt("onDragEnd",{event:t}),e=null,r()},onDragStart:function(t,n,r){Qt("onDragStart",{event:t}),e=!0;var i=n.value,o=i.document,a=n.findPath(t.target),s=o.getNode(a),l=o.getAncestors(a),u=s&&(n.isVoid(s)||l.some((function(e){return n.isVoid(e)}))),c=i.blocks.some((function(e){return e===s}));u&&!c&&n.moveToRangeOfNode(s);var d=n.value.fragment;Yt(t,"fragment",_e.default.serializeNode(d)),r()},onDrop:function(t,n,r){var i=n.value,o=i.document,a=i.selection,s=g()(t.target),l=n.findEventRange(t);if(!l)return r();Qt("onDrop",{event:t});var u=$t(t),c=u.type,d=u.fragment,f=u.text;n.focus();var p=n.findDOMNode(l.focus.path);p&&p.dispatchEvent(new MouseEvent("mouseup",{view:s,bubbles:!0,cancelable:!0}));var h=a;if(n.select(l),e&&n.deleteAtRange(h),"text"===c||"html"===c){var m=l.anchor,v=o.hasVoidParent(m.path,n);if(v){for(var y=m.path,b=o.getNode(m.path);v;){var _=o.texts({path:y}),w=Qe(_,1)[0];if(!w)break;var x=Qe(w,2);b=x[0],y=x[1],v=o.hasVoidParent(y,n)}b&&n.moveToStartOfNode(b)}f&&f.split("\n").forEach((function(e,t){t>0&&n.splitBlock(),n.insertText(e)}))}"fragment"===c&&n.insertFragment(d),r()},onFocus:function(e,n,r){Qt("onFocus",{event:e}),!t||J||Z?n.focus():n.deselect().focus(),r()},onInput:function(e,t,n){Qt("onInput");var r=g()(e.target).getSelection(),i=t.findSelection(r);i?t.select(i):t.blur();var o=r.anchorNode;t.reconcileDOMNode(o),n()},onKeyDown:function(e,t,n){Qt("onKeyDown",{event:e});var r=t.value,i=r.document,o=r.selection,a=o.start,s=i.hasVoidParent(a.path,t);if(ve.isSplitBlock(e)&&!te)return s?t.moveToStartOfNextText():t.splitBlock();if(ve.isDeleteBackward(e)&&!te)return t.deleteCharBackward();if(ve.isDeleteForward(e)&&!te)return t.deleteCharForward();if(ve.isDeleteLineBackward(e))return t.deleteLineBackward();if(ve.isDeleteLineForward(e))return t.deleteLineForward();if(ve.isDeleteWordBackward(e))return t.deleteWordBackward();if(ve.isDeleteWordForward(e))return t.deleteWordForward();if(ve.isRedo(e))return t.redo();if(ve.isUndo(e))return t.undo();if(ve.isMoveLineBackward(e))return e.preventDefault(),t.moveToStartOfBlock();if(ve.isMoveLineForward(e))return e.preventDefault(),t.moveToEndOfBlock();if(ve.isExtendLineBackward(e))return e.preventDefault(),t.moveFocusToStartOfBlock();if(ve.isExtendLineForward(e))return e.preventDefault(),t.moveFocusToEndOfBlock();if(ve.isMoveBackward(e))return e.preventDefault(),o.isCollapsed?t.moveBackward():t.moveToStart();if(ve.isMoveForward(e))return e.preventDefault(),o.isCollapsed?t.moveForward():t.moveToEnd();if(ve.isMoveWordBackward(e))return e.preventDefault(),t.moveWordBackward();if(ve.isMoveWordForward(e))return e.preventDefault(),t.moveWordForward();if(ve.isExtendBackward(e)){var l=i.getNode(a.path),u=i.texts({path:a.path,direction:"backward"}),c=Qe(u,1)[0],d=!1;if(c){var f=Qe(c,2)[1];d=i.hasVoidParent(f,t)}if(s||d||""===l.text)return e.preventDefault(),t.moveFocusBackward()}if(ve.isExtendForward(e)){var p=i.getNode(a.path),h=i.texts({path:a.path}),m=Qe(h,1)[0],g=!1;if(m){var v=Qe(m,2)[1];g=i.hasVoidParent(v,t)}if(s||g||""===p.text)return e.preventDefault(),t.moveFocusForward()}n()},onMouseDown:function(e,n,r){Qt("onMouseDown",{event:e}),t=!0,r()},onMouseUp:function(e,n,r){Qt("onMouseUp",{event:e}),t=!1,r()},onPaste:function(e,t,n){Qt("onPaste",{event:e});var r=t.value,i=$t(e),o=i.type,a=i.fragment,s=i.text;if("fragment"===o&&t.insertFragment(a),"text"===o||"html"===o){if(!s)return n();var l=r.document,u=r.selection,c=r.startBlock;if(t.isVoid(c))return n();var d=c,f=l.getInsertMarksAtRange(u),p=we.default.deserialize(s,{defaultBlock:d,defaultMarks:f}).document;t.insertFragment(p)}n()},onSelect:function(e,n,r){Qt("onSelect",{event:e});var i=g()(e.target).getSelection(),o=n.findSelection(i);o?n.select(o):n.blur(),t=!1,r()}}}var Jt=p()("slate:before");function Zt(){var e=null,t=0,n=!1,r=!1,i=!1,o=!1;return{onBeforeInput:function(e,t,n){var r=!!e.nativeEvent;t.readOnly||(o=!0,r&&ie||(Jt("onBeforeInput",{event:e}),n()))},onBlur:function(t,n,i){if(!r&&!n.readOnly){var o=t.relatedTarget,a=t.target,s=g()(a);if(e!==s.document.activeElement){if(o){var l=n.findDOMNode([]);if(o===l)return;if(o.hasAttribute(Be))return;var u=n.findNode(o);if(l.contains(o)&&u&&!n.isVoid(u))return}Jt("onBlur",{event:t}),i()}}},onClick:function(e,t,n){Jt("onClick",{event:e}),o=!0,n()},onCompositionEnd:function(e,r,i){var a=t;o=!0,window.requestAnimationFrame((function(){t>a||(n=!1)})),Jt("onCompositionEnd",{event:e}),i()},onCompositionStart:function(e,r,i){n=!0,t++;var a=r.value.selection;o=!0,a.isCollapsed||r.delete(),Jt("onCompositionStart",{event:e}),i()},onCopy:function(e,t,n){var i=g()(e.target);r=!0,i.requestAnimationFrame((function(){return r=!1})),Jt("onCopy",{event:e}),n()},onCut:function(e,t,n){if(!t.readOnly){var i=g()(e.target);r=!0,i.requestAnimationFrame((function(){return r=!1})),Jt("onCut",{event:e}),n()}},onDragEnd:function(e,t,n){i=!1,Jt("onDragEnd",{event:e}),n()},onDragEnter:function(e,t,n){Jt("onDragEnter",{event:e}),n()},onDragExit:function(e,t,n){Jt("onDragExit",{event:e}),n()},onDragLeave:function(e,t,n){Jt("onDragLeave",{event:e}),n()},onDragOver:function(e,t,n){var r=t.findNode(e.target);r&&!t.isVoid(r)||e.preventDefault(),J&&e.preventDefault(),i||(i=!0,J||(e.nativeEvent.dataTransfer.dropEffect="move")),Jt("onDragOver",{event:e}),n()},onDragStart:function(e,t,n){i=!0,Jt("onDragStart",{event:e}),n()},onDrop:function(e,t,n){t.readOnly||(o=!0,e.preventDefault(),Jt("onDrop",{event:e}),n())},onFocus:function(t,n,i){if(!r&&!n.readOnly){var o=n.findDOMNode([]),a=g()(t.target);e=a.document.activeElement,Q&&t.target!==o?o.focus():(Jt("onFocus",{event:t}),i())}},onInput:function(e,t,r){n||t.value.selection.isBlurred||(o=!0,Jt("onInput",{event:e}),r())},onKeyDown:function(e,t,r){t.readOnly||(n?ve.isCompose(e)&&e.preventDefault():(!te&&(ve.isBold(e)||ve.isDeleteBackward(e)||ve.isDeleteForward(e)||ve.isDeleteLineBackward(e)||ve.isDeleteLineForward(e)||ve.isDeleteWordBackward(e)||ve.isDeleteWordForward(e)||ve.isItalic(e)||ve.isRedo(e)||ve.isSplitBlock(e)||ve.isTransposeCharacter(e)||ve.isUndo(e))&&e.preventDefault(),o=!0,Jt("onKeyDown",{event:e}),r()))},onPaste:function(e,t,n){t.readOnly||(o=!0,e.preventDefault(),Jt("onPaste",{event:e}),n())},onSelect:function(t,i,a){if(!r&&!n&&!i.readOnly){var s=g()(t.target);e=s.document.activeElement,o=!0,Jt("onSelect",{event:t}),a()}},queries:{userActionPerformed:function(){return o}},commands:{clearUserActionPerformed:function(){return o=!1,null}}}}function en(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.plugins,n=void 0===t?[]:t,r=Zt(),i=Xt(),o=ee?[It(e),jt()]:[];return[].concat(o,[r],Xe(n),[i])}function tn(e){var t=e.nativeEvent||e;switch(t.type){case"keydown":return t.type+" "+JSON.stringify(t.key);case"input":case"beforeinput":case"textInput":return t.type+":"+t.inputType+" "+JSON.stringify(t.data);default:return t.type}}var nn=p()("slate:events");function rn(){var e={},t=!0,n=!1,r=void 0;try{for(var i,o=Re[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){e[i.value]=function(e,t,n){var r=tn(e);nn(r),n()}}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}return e}var on=p()("slate:batch-events");function an(){var e=null,t=null,n=[];function r(){on("\n"+n.join("\n")),n.length=0}function i(i){0===n.length&&(e=new Date);var o=tn(i),a=new Date;n.push("- "+(a-e)+" - "+o),clearTimeout(t),t=setTimeout(r,2e3)}var o={},a=!0,s=!1,l=void 0;try{for(var u,c=Re[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){o[u.value]=function(e,t,n){i(e),n()}}}catch(e){s=!0,l=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw l}}return o}var sn=p()("slate:mutations"),ln=["type","oldValue","target","addedNodes","removedNodes","attributeName","attributeNamespace","nextSibling","previousSibling"];function un(e){if(e.nodeType===window.Node.TEXT_NODE)return e.textContent;if(e.nodeType===window.Node.ELEMENT_NODE){var t=e.outerHTML,n=e.innerHTML;return null==t?JSON.stringify(e.textContent):t.slice(0,t.indexOf(n))}return"Node(type="+e.nodeType}function cn(){var e=new window.MutationObserver((function(e){var t=Array.from(e).map((function(e){var t={};return ln.forEach((function(n){var r=e[n];if(null!=r)if(r instanceof window.NodeList){if(0===r.length)return;t[n]=Array.from(r).map(un).join(", ")}else r instanceof window.Node&&(r=un(r)),t[n]=r})),t}));sn.apply(void 0,[t.length+" Mutations"].concat(Xe(t)))})),t=null;function n(n,r,i){var o=r.findDOMNode([]);if(o===t)return i();sn("start"),e.observe(o,{childList:!0,characterData:!0,attributes:!0,subtree:!0,characterDataOldValue:!0}),t=o,i()}return{onComponentDidMount:n,onComponentDidUpdate:n,onComponentWillUnmount:function(n,r,i){sn("stop"),e.disconnect(),t=null,i()}}}function dn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.placeholder,n=void 0===t?"":t,r=p.a.enabled("slate:events")?rn():null,i=p.a.enabled("slate:batch-events")?an():null,o=p.a.enabled("slate:mutations")?cn():null,a=xt(),s={commands:{reconcileNode:function(e,t){var n=e.value,r=n.document,i=n.selection,o=r.getPath(t.key),a=e.findDOMNode(o),s=r.getClosestBlock(o),l=t.text,u=a.textContent,c=s.nodes.last()===t,d=u.charAt(u.length-1);if(c&&"\n"===d&&(u=u.slice(0,-1)),l!==u){var f=i.moveAnchorTo(o,0).moveFocusTo(o,l.length);f=r.resolveRange(f),e.insertTextAtRange(f,u,t.marks)}},reconcileDOMNode:function(e,t){var n=t.parentElement.closest("[data-key]"),r=e.findNode(n);e.reconcileNode(r)}}},l=kt(),u=wt(e),c=en(e),d={commands:{restoreDOM:function(e){var t=e.tmp.contentRef.current.tmp;t.contentKey=t.contentKey+1}}},f=ee?null:Ce({placeholder:n,when:function(e,t){return"document"===t.object&&""===t.text&&1===t.nodes.size&&1===Array.from(t.texts()).length}});return[r,i,o,u,c,d,f,a,s,l]}var fn=p()("slate:editor"),pn=function(e){function t(){var e,n,r;We(this,t);for(var o=arguments.length,a=Array(o),l=0;l component is re-resolving the `plugins`, `schema`, `commands`, `queries` or `placeholder` prop on each update, which leads to poor performance. This is often due to passing in a new references for these props with each render by declaring them inline in your render function. Do not do this! Declare them outside your render function, or memoize them instead."),r.tmp.resolves++;var t=e(Ge({},r.props,{editor:r,value:r.props.value||r.state.value})),n=function(e){r.tmp.mounted?r.handleChange(e):r.tmp.change=e};r.controller=new s.Editor({plugins:[t],onChange:n},{controller:r,construct:!1}),r.controller.run("onConstruct")})),Ye(r,n)}return Ke(t,e),Ve(t,[{key:"componentDidMount",value:function(){this.tmp.mounted=!0,this.tmp.updates++,this.props.autoFocus&&this.focus(),this.tmp.change&&(this.handleChange(this.tmp.change),this.tmp.change=null)}},{key:"componentDidUpdate",value:function(){this.tmp.updates++,this.tmp.change&&(this.handleChange(this.tmp.change),this.tmp.change=null)}},{key:"componentWillUnmount",value:function(){this.tmp.mounted=!1}},{key:"render",value:function(){var e=this;fn("render",this);var n=this.props,r=n.commands,o=n.placeholder,a=n.plugins,s=n.queries,l=n.schema;this.resolveController(a,l,r,s,o,dn);var u=this.props,c=u.options,d=u.readOnly,f=u.value,p=this.state.value,h=f||p,m=this.state.contentKey;this.controller.setReadOnly(d),this.controller.setValue(h,c);var g=this.props,v=g.autoCorrect,y=g.className,b=g.id,_=g.role,w=g.spellCheck,x=g.tabIndex,k=g.style,E=g.tagName,S=le()(this.props,Object.keys(t.propTypes)),O=i.a.createElement(bt,Ge({},S,{ref:this.tmp.contentRef,autoCorrect:v,className:y,contentKey:m,editor:this,id:b,onEvent:function(t,n){return e.run(t,n)},readOnly:d,role:_,spellCheck:w,style:k,tabIndex:x,tagName:E}));return this.controller.run("renderEditor",Ge({},this.props,{editor:this,children:O}))}},{key:"handleChange",value:function(e){var t=this.props.onChange;this.state.value&&this.setState({value:e.value}),t(e)}},{key:"applyOperation",value:function(){var e;return(e=this.controller).applyOperation.apply(e,arguments)}},{key:"command",value:function(){var e;return(e=this.controller).command.apply(e,arguments)}},{key:"hasCommand",value:function(){var e;return(e=this.controller).hasCommand.apply(e,arguments)}},{key:"hasQuery",value:function(){var e;return(e=this.controller).hasQuery.apply(e,arguments)}},{key:"normalize",value:function(){var e;return(e=this.controller).normalize.apply(e,arguments)}},{key:"query",value:function(){var e;return(e=this.controller).query.apply(e,arguments)}},{key:"registerCommand",value:function(){var e;return(e=this.controller).registerCommand.apply(e,arguments)}},{key:"registerQuery",value:function(){var e;return(e=this.controller).registerQuery.apply(e,arguments)}},{key:"run",value:function(){var e;return(e=this.controller).run.apply(e,arguments)}},{key:"withoutNormalizing",value:function(){var e;return(e=this.controller).withoutNormalizing.apply(e,arguments)}},{key:"call",value:function(){var e;return(e=this.controller).call.apply(e,arguments)}},{key:"change",value:function(){var e;return(e=this.controller).change.apply(e,arguments)}},{key:"onChange",value:function(){var e;return(e=this.controller).onChange.apply(e,arguments)}},{key:"applyOperations",value:function(){var e;return(e=this.controller).applyOperations.apply(e,arguments)}},{key:"setOperationFlag",value:function(){var e;return(e=this.controller).setOperationFlag.apply(e,arguments)}},{key:"getFlag",value:function(){var e;return(e=this.controller).getFlag.apply(e,arguments)}},{key:"unsetOperationFlag",value:function(){var e;return(e=this.controller).unsetOperationFlag.apply(e,arguments)}},{key:"withoutNormalization",value:function(){var e;return(e=this.controller).withoutNormalization.apply(e,arguments)}},{key:"operations",get:function(){return this.controller.operations}},{key:"readOnly",get:function(){return this.controller.readOnly}},{key:"value",get:function(){return this.controller.value}},{key:"editor",get:function(){return this.controller.editor}},{key:"schema",get:function(){Object(xe.a)(!1,"As of Slate 0.42, the `editor.schema` property no longer exists, and its functionality has been folded into the editor itself. Use the `editor` instead.")}},{key:"stack",get:function(){Object(xe.a)(!1,"As of Slate 0.42, the `editor.stack` property no longer exists, and its functionality has been folded into the editor itself. Use the `editor` instead.")}}]),t}(i.a.Component);function hn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;h(!1,"As of slate-react@0.22 the `findDOMNode(key)` helper is deprecated in favor of `editor.findDOMNode(path)`."),s.Node.isNode(e)&&(e=e.key);var n=t.document.querySelector("["+je+'="'+e+'"]');if(!n)throw new Error('Unable to find a DOM node for "'+e+'". This is often because of forgetting to add `props.attributes` to a custom component.');return n}function mn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;h(!1,"As of slate-react@0.22 the `findDOMPoint(point)` helper is deprecated in favor of `editor.findDOMPoint(point)`.");var n=hn(e.key,t),r=0,i=Array.from(n.querySelectorAll(He.STRING+", "+He.ZERO_WIDTH)),o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value,d=c.childNodes[0],f=d.textContent.length,p=f;c.hasAttribute(Le)&&(p=parseInt(c.getAttribute(Le),10));var m=r+p;if(e.offset<=m){var g=Math.min(f,Math.max(0,e.offset-r));return{node:d,offset:g}}r=m}}catch(e){a=!0,s=e}finally{try{!o&&u.return&&u.return()}finally{if(a)throw s}}return null}function gn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;h(!1,"As of slate-react@0.22 the `findDOMRange(range)` helper is deprecated in favor of `editor.findDOMRange(range)`.");var n=e.anchor,r=e.focus,i=e.isBackward,o=e.isCollapsed,a=mn(n,t),s=o?a:mn(r,t);if(!a||!s)return null;var l=t.document.createRange(),u=i?s:a,c=i?a:s;return l.setStart(u.node,u.offset),l.setEnd(c.node,c.offset),l}function vn(e,t){h(!1,"As of slate-react@0.22 the `findNode(element)` helper is deprecated in favor of `editor.findNode(element)`."),Object(xe.a)(!s.Value.isValue(t),"As of Slate 0.42.0, the `findNode` utility takes an `editor` instead of a `value`.");var n=e.closest(He.KEY);if(!n)return null;var r=n.getAttribute(je);return r&&t.value.document.getNode(r)||null}function yn(e,t){h(!1,"As of slate-react@0.22 the `findPath(element)` helper is deprecated in favor of `editor.findPath(element)`.");var n=vn(e,t);return n?t.value.document.getPath(n):null}function bn(e,t,n){h(!1,"As of slate-react@0.22 the `findPoint(node, offset)` helper is deprecated in favor of `editor.findPoint(node, offset)`."),Object(xe.a)(!s.Value.isValue(n),"As of Slate 0.42.0, the `findPoint` utility takes an `editor` instead of a `value`.");var r=function(e,t){if(1===e.nodeType&&e.childNodes.length){var n=t===e.childNodes.length,r=n?"backward":"forward";for(e=_n(e,n?t-1:t,r);1===e.nodeType&&e.childNodes.length;){var i=n?e.childNodes.length-1:0;e=_n(e,i,r)}t=n?e.textContent.length:0}return{node:e,offset:t}}(e,t),i=r.node,o=r.offset,a=g()(e),l=i.parentNode,u=l.closest(He.LEAF),c=void 0,d=void 0;if(u){var f=a.document.createRange(),p=u.closest(He.TEXT);f.setStart(p,0),f.setEnd(i,o),d=p;var m=f.cloneContents(),v=m.querySelectorAll("["+qe+"]");c=m.textContent.length-v.length}else{var y=l.closest(He.VOID);if(!y)return null;if(!(u=y.querySelector(He.LEAF)))return null;c=(d=u).textContent.length}c===d.textContent.length&&l.hasAttribute(qe)&&c--;var b=u.getAttribute(Fe);if(!b)return null;var _=Ze.parse(b).key,w=n.value;return w.document.hasDescendant(_)?w.document.createPoint({key:_,offset:c}):null}function _n(e,t,n){for(var r=e.childNodes,i=r[t],o=t,a=!1,s=!1;(8===i.nodeType||1===i.nodeType&&0===i.childNodes.length||1===i.nodeType&&"false"===i.getAttribute("contenteditable"))&&(!a||!s);)o>=r.length?(a=!0,o=t-1,n="backward"):o<0?(s=!0,o=t+1,n="forward"):(i=r[o],"forward"===n&&o++,"backward"===n&&o--);return i||null}function wn(e,t){h(!1,"As of slate-react@0.22 the `findRange(selection)` helper is deprecated in favor of `editor.findRange(selection)`."),Object(xe.a)(!s.Value.isValue(t),"As of Slate 0.42.0, the `findNode` utility takes an `editor` instead of a `value`.");var n=e.anchorNode||e.startContainer;if(!n)return null;var r=g()(n);(e instanceof r.Range||r.StaticRange&&e instanceof r.StaticRange)&&(e={anchorNode:e.startContainer,anchorOffset:e.startOffset,focusNode:e.endContainer,focusOffset:e.endOffset});var i=e,o=i.anchorNode,a=i.anchorOffset,l=i.focusNode,u=i.focusOffset,c=i.isCollapsed,d=t.value,f=bn(o,a,t),p=c?f:bn(l,u,t);return f&&p?d.document.createRange({anchor:f,focus:p}):null}function xn(e,t){h(!1,"As of slate-react@0.22 the `getEventRange(event, editor)` helper is deprecated in favor of `editor.findEventRange(event)`."),Object(xe.a)(!s.Value.isValue(t),"As of Slate 0.42.0, the `findNode` utility takes an `editor` instead of a `value`."),e.nativeEvent&&(e=e.nativeEvent);var n=e,r=n.clientX,i=n.clientY,o=n.target;if(null==r||null==i)return null;var a=t.value.document,l=yn(e.target,t);if(!l)return null;var u=a.getNode(l);if(t.isVoid(u)){var c=o.getBoundingClientRect(),d="inline"===u.object?r-c.left=n[0]||(e[1]<=n[1]&&e[3]>=n[1]||Object(f.t)(e,this.intersectsCoordinate,this))}return!1},t.prototype.setCenter=function(e){var t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(var i=1;i=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&t.type===o.a.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t),i=!1):this.freehand_&&t.type===o.a.POINTERDOWN?i=!1:n?(i=t.type===o.a.POINTERMOVE)&&this.freehand_?i=this.handlePointerMove_(t):(t.pointerEvent.pointerType==k.b||t.type===o.a.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t):t.type===o.a.DBLCLICK&&(i=!1),e.prototype.handleEvent.call(this,t)&&i},t.prototype.handleDownEvent=function(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e),!0):!!this.condition_(e)&&(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new a.a(o.a.POINTERMOVE,e.map,e.pointerEvent,!1,e.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=e.pixel,!0)},t.prototype.handleUpEvent=function(e){var t=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);var n=this.mode_===j;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||n?this.finishDrawing():this.atFinish_(e)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e):(this.startDrawing_(e),this.mode_===R&&this.finishDrawing()),t=!1):this.freehand_&&(this.finishCoordinate_=null,this.abortDrawing_()),!t&&this.stopClick_&&e.stopPropagation(),t},t.prototype.handlePointerMove_=function(e){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(e):this.createOrUpdateSketchPoint_(e),!0},t.prototype.atFinish_=function(e){var t=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_];if(this.mode_===M)n=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===I){var i=this.sketchCoords_;n=i[0].length>this.minPoints_,r=[i[0][0],i[0][i[0].length-2]]}if(n)for(var o=e.map,a=0,s=r.length;a=this.maxPoints_&&(this.freehand_?n.pop():t=!0),n.push(r.slice()),this.geometryFunction_(n,i)):this.mode_===I&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():t=!0),n.push(r.slice()),t&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,i)),this.updateSketchFeatures_(),t&&this.finishDrawing()},t.prototype.removeLastPoint=function(){if(this.sketchFeature_){var e,t=this.sketchFeature_.getGeometry();this.mode_===M?((e=this.sketchCoords_).splice(-2,1),this.geometryFunction_(e,t),e.length>=2&&(this.finishCoordinate_=e[e.length-2].slice())):this.mode_===I&&((e=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t)),0===e.length&&(this.finishCoordinate_=null),this.updateSketchFeatures_()}},t.prototype.finishDrawing=function(){var e=this.abortDrawing_();if(e){var t=this.sketchCoords_,n=e.getGeometry();this.mode_===M?(t.pop(),this.geometryFunction_(t,n)):this.mode_===I&&(t[0].pop(),this.geometryFunction_(t,n),t=n.getCoordinates()),this.type_===h.a.MULTI_POINT?e.setGeometry(new w.a([t])):this.type_===h.a.MULTI_LINE_STRING?e.setGeometry(new _.a([t])):this.type_===h.a.MULTI_POLYGON&&e.setGeometry(new x.a([t])),this.dispatchEvent(new N(L,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e)}},t.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var e=this.sketchFeature_;return e&&(this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0)),e},t.prototype.extend=function(e){var t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new N(D,this.sketchFeature_))},t.prototype.updateSketchFeatures_=function(){var e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);var t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)},t.prototype.updateState_=function(){var e=this.getMap(),t=this.getActive();e&&t||this.abortDrawing_(),this.overlay_.setMap(t?e:null)},t}(O.b);function B(e,t){return function(n,r){var i=n[0],o=n[1],a=Math.sqrt(Object(l.e)(i,o)),s=r||Object(S.b)(new y(i),e),u=t;if(!t){var c=o[0]-i[0],d=o[1]-i[1];u=Math.atan(d/c)-(c<0?Math.PI:0)}return Object(S.d)(s,i,a,u),s}}function z(){return function(e,t){var n=Object(f.b)(e),r=[[Object(f.v)(n),Object(f.w)(n),Object(f.D)(n),Object(f.C)(n),Object(f.v)(n)]],i=t;return i?i.setCoordinates(r):i=new S.a(r),i}}t.default=F},function(e,t,n){var r=n(230),i=n(76);e.exports=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:o,maxWait:t,trailing:a})}},function(e,t,n){"use strict";n.r(t);var r=n(85),i=n(108),o=n(301),a=n(22),s=n(239),l="renderOrder",u=function(e){function t(t){var n=t||{},i=Object(a.a)({},n);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,e.call(this,i),this.declutter_=void 0!==n.declutter&&n.declutter,this.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(n.style),this.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,this.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,this.renderMode_=n.renderMode||o.a.VECTOR,this.type=r.a.VECTOR}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDeclutter=function(){return this.declutter_},t.prototype.setDeclutter=function(e){this.declutter_=e},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(l)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.setRenderOrder=function(e){this.set(l,e)},t.prototype.setStyle=function(e){this.style_=void 0!==e?e:s.a,this.styleFunction_=null===e?void 0:Object(s.c)(this.style_),this.changed()},t.prototype.getRenderMode=function(){return this.renderMode_},t}(i.a);u.prototype.getSource,t.default=u},function(e,t,n){ +/** + * @license uploadcare-widget v3.10.2 + * + * Copyright (c) 2020 Uploadcare, Inc. + * + * This source code is licensed under the BSD 2-Clause License + * found in the LICENSE file in the root directory of this source tree. + */ +e.exports=function(e){"use strict";function t(e){return(t="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})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"i";return n=e.map(t.split("*"),we),new RegExp("^"+n.join(".+")+"$",r)},ke=function(e){var t;return"http:"!==(t=document.location.protocol)&&(t="https:"),e.replace(/^\/\//,t+"//").replace(/\/+$/,"")},Ee=function(e,t){if(e.length>t){var n=Math.ceil((t-3)/2),r=Math.floor((t-3)/2);return e.slice(0,n)+"..."+e.slice(-r)}return e},Se=function(e,t,n){var r,i;return e[0]>t[0]||e[1]>t[1]||n?(i=t[0]/e[0],r=t[1]/e[1],!t[0]||t[1]&&i>r?[Math.round(r*e[0]),t[1]]:[t[0],Math.round(i*e[1])]):e.slice()},Oe=function(t,n,r,i){var o,a,s,l,u,c,d;if(c=i.width,a=i.height,l=n.preferedSize,s="",(d=c===r[0]&&a===r[1])||(s+="-/crop/".concat(c,"x").concat(a,"/").concat(i.left,",").concat(i.top,"/")),o=n.downscale&&(c>l[0]||a>l[1]),u=n.upscale&&(c'):e('')).attr("accept",i).css({position:"absolute",top:0,opacity:0,margin:0,padding:0,width:"auto",height:"auto",cursor:t.css("cursor")}).on("change",(function(){return r(this),e(this).hide(),a()})),t.append(o)})(),t.css({position:"relative",overflow:"hidden"}).mousemove((function(t){var n,r,i,a=e(this).offset();return n=a.left,r=a.top,i=o.width(),o.css({left:t.pageX-n-i+10,top:t.pageY-r-10})}))},Ce=function(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return""===(i=n.inputAcceptTypes)&&(i=n.imagesOnly?"image/*":null),e(n.multiple?'':'').attr("accept",i).attr(o).css({position:"fixed",bottom:0,opacity:0}).on("change",(function(){return r(this),e(this).remove()})).appendTo(t).focus().click().hide()},Ae="B KB MB GB TB PB EB ZB YB".split(" "),Pe=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e=parseInt(e,10),isNaN(e))return o;for(t=2,r=0,i=1e3-5*Math.pow(10,2-Math.max(t,3));e>i&&r3&&void 0!==arguments[3]?arguments[3]:{};return e.ajax(e.extend({url:t,type:n,data:r},i,Re)).then((function(t){var n;return t.error?(n=t.error.content||t.error,e.Deferred().reject(n)):t}),(function(e,n,r){var i;return i="".concat(n," (").concat(r,")"),ne("JSONP unexpected error: ".concat(i," while loading ").concat(t)),i}))},Ie=function(e,t,n,r){var i,o,a,s,l,u;if(window.HTMLCanvasElement.prototype.toBlob)return e.toBlob(r,t,n);for(a=(a=e.toDataURL(t,n)).split(","),o=window.atob(a[1]),i=new Uint8Array(o.length),s=l=0,u=o.length;l1?n-1:0),i=1;i5e6?(ie("Shrinked size can not be larger than 5MP. "+"You have set ".concat(n[1],"x").concat(n[2]," (")+"".concat(Math.ceil(r/1e3/100)/10,"MP).")),!1):{quality:n[3]?n[3]/100:void 0,size:r})},D=function(e,t){var n,r,i,o;return this.previewProxy?(r=(i=!/\?/.test(this.previewProxy))||!/=$/.test(this.previewProxy),n=!i&&!/[&?=]$/.test(this.previewProxy),o=encodeURIComponent(e),r&&(o="url="+o),n&&(o="&"+o),i&&(o="?"+o),this.previewProxy+o):e},U=function(t){var n;return M(t,["tabs","preferredTypes","videoPreferredMimeTypes"]),Y(t,["cdnBase","socialBase","urlBase","scriptBase"]),N(t,["doNotStore","imagesOnly","multiple","clearable","pathValue","previewStep","systemDialog","debugUploads","multipleMaxStrict","cameraMirrorDefault"]),F(t,["multipleMax","multipleMin","multipartMinSize","multipartPartSize","multipartMinLastPartSize","multipartConcurrency","multipartMaxAttempts","parallelDirectUploads"]),G(t,K),I(t,j),z(t),!1===t.crop||e.isArray(t.crop)||(/^(disabled?|false|null)$/i.test(t.crop)?t.crop=!1:e.isPlainObject(t.crop)?t.crop=[t.crop]:t.crop=e.map((""+t.crop).split(","),q)),t.imageShrink&&!e.isPlainObject(t.imageShrink)&&(t.imageShrink=H(t.imageShrink)),(t.crop||t.multiple)&&(t.previewStep=!0),E||(t.systemDialog=!1),t.validators&&(t.validators=t.validators.slice()),t.previewProxy&&!t.previewUrlCallback&&(t.previewUrlCallback=D),-1!==(n=t.tabs.indexOf("skydrive"))&&(t.tabs[n]="onedrive"),t};var Fe,Be=function(){var e,t,n;for(e in t={},L)null!=(n=window["UPLOADCARE_".concat(pe(e))])&&(t[e]=n);return t},ze=ue((function(t,n){var r;return n||(L=e.extend(L,Be())),r=U(e.extend(L,t||{})),qe.fire(r),r})),Ue=function(t){var n;return n=e.extend({},ze()),e.isEmptyObject(t)||(n=U(e.extend(n,t))),n},qe=w()&&e.Callbacks("once memory"),He=function(){function e(){n(this,e),this.urls=[],this.styles=[]}return o(e,[{key:"addUrl",value:function(e){if(!/^https?:\/\//i.test(e))throw new Error("Embedded urls should be absolute. "+e);if(!(Ne.call(this.urls,e)>=0))return this.urls.push(e)}},{key:"addStyle",value:function(e){return this.styles.push(e)}}]),e}(),We=function(t,n){var r;return r=e.Deferred(),n&&(t.src=n),t.complete?r.resolve(t):(e(t).one("load",(function(){return r.resolve(t)})),e(t).one("error",(function(){return r.reject(t)}))),r.promise()},Ve=function t(n){return e.isArray(n)?e.when.apply(null,e.map(n,t)):n.src?We(n):We(new window.Image,n)},$e=function(t){var n=e.Deferred();return e("