\n \n \n \n
\n\nTo use Portal without any particular runtime, try the\n[standalone](https://djblue.github.io/portal/) version of Portal. It can be\ninstalled as a [chrome pwa](https://support.google.com/chrome/answer/9658361)\nwhich will provide a dock launcher for easy access.\n\n\n \n
\n\n## Paste Clipboard Data\n\nTo quickly paste some edn, json or transit into Portal, try the `ctrl | cmd + v`\npaste command. Upon pasting portal will prompt for the format type in order to\nparse the data.\n\n\n \n
\n\n## Drag + Drop Files\n\nIf the data you want to view in Portal is in a file, it can be easily dragged\nand dropped over the UI.\n\n\n \n
\n\n## Preloading Data\n\nTo open the UI with pre-loaded data, you can pass the `content-url` and\n`content-type` via query params. For example\n[this link](https://djblue.github.io/portal/?content-url=https://gist.githubusercontent.com/djblue/9a2cd250e061f62ce527b20648fd8256/raw/e7bd673df60b3c503306956b950bb9589ba480eb/data.clj&content-type=application/edn) pulls some edn data via a [GitHub Gist](https://gist.github.com/djblue/6ef5f3ddd0bc93e3ca34a7132be63d8f) with the `content-type=application/edn`, this can be very handy to share data.\n\nThe supported content-types:\n\n- `application/edn`\n- `application/json`\n- `application/transit+json`\n- `text/plain`\n\n## Share Command\n\nIf you want to automate the sharing of data from your runtime, you can create a\n[Portal command](../ui/commands.md) that automatically uploads and generates a\nsimilar link as above. One such command could look like:\n\n```clojure\n(ns portal.share\n (:require [clojure.pprint :as pp]\n [clojure.string :as str]\n [org.httpkit.client :as http]\n [portal.api :as p]\n [portal.runtime.json :as json]))\n\n(defn- pprint [value]\n (binding [*print-meta* true]\n (with-out-str (pp/pprint value))))\n\n(defn- create-gist [content]\n (-> @(http/post\n \"https://api.github.com/gists\"\n {:basic-auth [(System/getenv \"GIT_USERNAME\")\n (System/getenv \"GIT_PASSWORD\")]\n :headers {\"Accept\" \"application/vnd.github.v3+json\"}\n :body (json/write\n {:public false\n :description \"Portal Share\"\n :files {\"data.clj\" {:content content}}})})\n :body\n json/read\n (get-in [:files :data.clj :raw_url])))\n\n(defn- ->query-string [m]\n (str/join \"&\" (for [[k v] m] (str (name k) \"=\" v))))\n\n(defn- create-url [gist-raw-url]\n (str \"https://djblue.github.io/portal/?\"\n (->query-string {:content-url gist-raw-url\n :content-type \"application/edn\"})))\n\n(defn- shorten-url [url]\n (-> @(http/post\n \"https://url.api.stdlib.com/temporary@0.3.0/create/\"\n {:headers {\"Content-Type\" \"application/json\"}\n :body (json/write {:url url :ttl 86400})})\n :body\n json/read\n :link_url))\n\n(defn share\n \"Create a shareable portal link for the supplied value.\"\n [value]\n (-> value pprint create-gist create-url shorten-url))\n\n(p/register! #'share)\n```\n"}] ["Clerk" {:file "doc/guides/clerk.md", :markdown "# [Clerk](https://github.com/nextjournal/clerk)\n\nIf you would like to leverage Portal in the context of a clerk notebook, you can\nsetup a viewer such as the following:\n\n> **Warning**\n> Every viewer is a new iframe so having too many on the page will\n> cause performance issues.\n\n```clojure\n(ns portal.clerk\n (:require [nextjournal.clerk :as clerk]\n [portal.api :as p]))\n\n(def app-viewer\n {:name :portal/app\n :transform-fn\n (fn [value]\n (p/url\n (p/open {:launcher false\n :value (:nextjournal/value value)\n :theme :portal.colors/nord-light})))\n :render-fn '#(v/html [:iframe\n {:src %\n :style {:width \"100%\"\n :height \"50vh\"\n :border-left \"1px solid #d8dee9\"\n :border-right \"1px solid #d8dee9\"\n :border-bottom \"1px solid #d8dee9\"\n :border-radius 2}}])})\n\n(defn open\n \"Open portal with the value of `x` in current notebook.\"\n ([x] (open {} x))\n ([viewer-opts x]\n (clerk/with-viewer app-viewer viewer-opts x)))\n```\n"}] ["Custom Viewer" {:file "examples/portal-present/README.md", :markdown "# Custom Viewer\n\nPortal is implemented with [reagent][reagent] so implementing a custom viewer is\nas simple as writing a reagent component, this should be relatively easy\nassuming you are familiar with reagent.\n\nIn this guide I will walk you through creating a slide deck viewer in Portal.\n\n## Portal nREPL\n\nIf you would like to interactively develop your custom viewer, and are using\nnREPL, you can use the `portal.nrepl/wrap-repl` middleware. With that middleware\nenabled, you can launch a sub repl with the following:\n\n```clojure\n(require '[portal.api :as p])\n(def portal (p/open))\n;; Turns the current nREPL session into a portal repl session.\n(p/repl portal)\n```\n\nNow all subsequent eval invocations will run in the Portal UI ClojureScript\nruntime.\n\n> **Note**\n> To quit the Portal repl, eval `:cljs/quit`. This will automatically\n> occur if the portal session is no longer available.\n\n## Input Data Structure\n\nFor this particular viewer, we can enable any collection to act as a slide deck\nand allow each element in the sequence to decide how it wants to be rendered.\n\nFor example, the following should be considered a valid slide deck:\n\n```clojure\n[^{:portal.viewer/default :portal.viewer/hiccup}\n [:h1 \"hello\"]\n ^{:portal.viewer/default :portal.viewer/hiccup}\n [:h1 \"world\"]]\n```\n\nLet's express this as a `:predicate` for later use:\n\n```clojure\n(defn deck? [value] (and (coll? value) (not (map? value))))\n```\n\n## Creating a Reagent Component\n\nThe only assumption that Portal makes about viewer components is that they take\na value as their first argument, everything else is up to the component.\n\nFor example, the following is a valid Portal viewer:\n\n```clojure\n(defn viewer [value] [:pre {:style {:color :pink}} (pr-str value)])\n```\n\nHowever, that's not very interesting. For the deck viewer, let's render the\ncurrently selected element in the sequence as a slide:\n\n```clojure\n(ns portal-present.viewer\n (:require [portal.ui.api :as p]\n [portal.ui.inspector :as ins]\n [reagent.core :as r]))\n\n(defn view-presentation []\n (let [slide (r/atom 0)]\n (fn [slides]\n [:<>\n [ins/inspector (nth (seq slides) @slide :no-slide)]\n [:button {:on-click #(swap! slide dec)} \"prev\"]\n [:button {:on-click #(swap! slide inc)} \"next\"]])))\n```\n\n## Registering a viewer\n\nWhen you are satisfied with your component, you can register it with Portal via\n`portal.ui.api/register-viewer!` such as the following:\n\n```clojure\n(portal.ui.api/register-viewer!\n {:name ::slides\n :predicate deck?\n :component view-presentation})\n```\n\n> **Note**\n> Anytime a viewer is registered, it will cause the UI to re-render. This\n> is very handy for interactive development.\n\nAnd with just that, you now have a fully working custom viewer!\n\n## Code Loading\n\nThe next step, is getting the code loaded into the Portal UI runtime without\nusing `portal.api/repl`. This can be done via `portal.api/eval-str` which\nenables evaluating arbitrary ClojureScript code in the Portal UI runtime from\nthe host runtime.\n\nFor example, the following will alert `1` when invoked at the host repl.\n\n```clojure\n(require '[portal.api :as p])\n(p/eval-str \"(js/alert 1)\")\n```\n\nTo load the code for an extension, we can provide the string directly or load it\nfrom a file via slurp. For example:\n\n```clojure\n(require '[portal.api :as p])\n(p/eval-str (slurp (io/resource \"portal_present/viewer.cljs\")))\n```\n\n> **Note**\n> you can specify which Portal instance you want this code evaluated in\n> to prevent evaluating it in every available Portal UI runtime.\n\n## Usage\n\nNow that the viewer has been defined and loaded, you can select it like any viewer or enable it by default via metadata:\n\n```clojure\n(require '[portal.api :as p]\n '[portal.viewer :as-alias v])\n\n(def slides\n ^{::v/default :portal-present.viewer/slides}\n [^{::v/default ::v/hiccup} [:h1 \"hello\"]\n ^{::v/default ::v/hiccup} [:h1 \"world\"]])\n\n(add-tap p/submit)\n(tap> slides)\n```\n\n## Auto Loading\n\nAn issue with the current loading mechanism is that is won't persist across\nbrowser reloads or `portal.api/open` invocations. To address this issue, we can\nauto load the viewer via the `:on-load` hook. For example:\n\n```clojure\n(require '[portal.api :as p])\n\n(declare portal)\n\n(defn on-load []\n (p/eval-str portal (slurp (io/resource \"portal_present/viewer.cljs\"))))\n\n(def portal\n (p/open\n {:value slides\n :on-load on-load\n :window-title \"Portal Present\"}))\n```\n\n## Conclusion\n\nWith only the concepts above, you can now build a variety of custom viewers!\nFor a more complete example that builds on the above with improved styles and\nUX, look at [portal-present.viewer](./src/portal_present/viewer.cljs).\n\n[reagent]: https://reagent-project.github.io/\n"}]] ["Editors" ["Emacs" {:file "doc/editors/emacs.md", :markdown "# Emacs\n\n## CIDER\n\nIf you are an emacs + cider user and would like tighter integration with portal,\nthe following section may be of interest to you.\n\n```elisp\n;; Leverage an existing cider nrepl connection to evaluate portal.api functions\n;; and map them to convenient key bindings.\n\n;; def portal to the dev namespace to allow dereferencing via @dev/portal\n(defun portal.api/open ()\n (interactive)\n (cider-nrepl-sync-request:eval\n \"(do (ns dev) (def portal ((requiring-resolve 'portal.api/open))) (add-tap (requiring-resolve 'portal.api/submit)))\"))\n\n(defun portal.api/clear ()\n (interactive)\n (cider-nrepl-sync-request:eval \"(portal.api/clear)\"))\n\n(defun portal.api/close ()\n (interactive)\n (cider-nrepl-sync-request:eval \"(portal.api/close)\"))\n\n;; Example key mappings for doom emacs\n(map! :map clojure-mode-map\n ;; cmd + o\n :n \"s-o\" #'portal.api/open\n ;; ctrl + l\n :n \"C-l\" #'portal.api/clear)\n\n;; NOTE: You do need to have portal on the class path and the easiest way I know\n;; how is via a clj user or project alias.\n(setq cider-clojure-cli-aliases \":portal\")\n```\n\n## xwidget-webkit embed\n\n![Screen Shot 2022-10-15 at 2 45 29 PM](https://user-images.githubusercontent.com/1986211/196008954-f3aeac5f-0a5f-4c90-bd82-22f727beda57.png)\n\nIf you would like to run the Portal UI in emacs itself, you can do so with the\nfollowing code.\n\n> **Note**\n> You need a build of emacs with [Embedded-WebKit-Widgets][1]\n> Also, this method only works if you're using [emacs server](https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html) functionality as it relies on `emacsclient` command\n\n```clojure\n(portal.api/open {:launcher :emacs})\n```\n\n> **Warning**\n> I haven't tested this extensively so you might run into some weird\n> issues\n\n[1]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Embedded-WebKit-Widgets.html\n\n## Monroe & xwidget-webkit\n\nFor [Monroe](https://github.com/sanel/monroe) nREPL client users.\n\n### The code\n\nAdd the following to your Emacs config:\n\n```elisp\n; -*- lexical-binding: t; -*-\n;; The line above is really important, otherwise things will not work.\n\n;; A little helper to simplify communication between Emacs and the nREPL process\n(defun monroe-eval-code-and-callback-with-value (code-str on-value)\n (monroe-send-eval-string\n code-str\n (lambda (response)\n (condition-case err\n (monroe-dbind-response response\n (value status id)\n (when value (funcall on-value value))\n (when (member \"done\" status)\n (remhash id monroe-requests)))\n (error (message \"Eval error %s\" err))))))\n\n\n\n(defun monroe-launch-portal ()\n (interactive)\n (monroe-eval-code-and-callback-with-value\n \"(do\n (require 'portal.api)\n (let [url (portal.api/url (portal.api/open {:launcher false}))]\n (add-tap #'portal.api/submit)\n url)\"\n (lambda (value)\n ;; value is a raw string, so we need to remove \" from it\n (let ((url (string-replace \"\\\"\" \"\" value)))\n (message \"Opening portal %s\" url)\n (xwidget-webkit-browse-url url)))))\n\n```\n\n### Usage\n\nThen in the Monroe REPL or Clojure buffer with an active Monroe session run `M-x monroe-launch-portal`.\n\n> **Note**\n>\n> This is just a jump-off point, you might want to customize this function to your\n> liking, e.g. run the code in your `user` namespace, set a different theme and so on.\n> See CIDER section for how you can extend it further.\n"}] ["VS Code" {:file "doc/editors/vs-code.md", :markdown "# VS Code\n\n[![Screenshot](https://user-images.githubusercontent.com/1986211/140680881-497efd3b-da75-4220-9630-bf1af9d8bf37.png)](https://marketplace.visualstudio.com/items?itemName=djblue.portal)\n\nIf you are using vs-code, try out the [vs-code-extension][extension]. It allows\nlaunching portal in an embedded [webview][webview] within vs-code.\n\nFor a more in depth look at customizing vs-code for use with portal,\nparticularly with [calva][calva], take a look at\n[seancorfield/vscode-calva-setup][calva-setup].\n\nFor a more complete workflow guide, checkout [Calva, Joyride, and\nPortal][guide] by [@seancorfield][seancorfield].\n\n> **Note**\n> The version of portal being run in the webview is still decided by\n> the runtime in which `(portal.api/open {:launcher :vs-code})` is run.\n\n[calva]: https://calva.io/\n[calva-setup]: https://github.com/seancorfield/vscode-calva-setup\n[guide]: https://corfield.org/blog/2022/12/18/calva-joyride-portal/\n[seancorfield]: https://github.com/seancorfield\n[extension]: https://marketplace.visualstudio.com/items?itemName=djblue.portal\n[webview]: https://code.visualstudio.com/api/extension-guides/webview\n"} ["Clojure Notebooks" {:file "doc/editors/vs-code-notebook.md", :markdown "# Clojure Notebooks\n\nIf you are interested in using Portal as a renderer for [Calva's Clojure\nNotebooks][1], you've come to the right place.\n\nBefore getting started, make sure you have both the [Calva][2] and [Portal][3] VS Code extensions installed.\n\n## Usage\n\n\n\n
\n\nWith the above extensions installed, you should now be able to open any Clojure\nfile by right clicking the file in the file explorer and selecting `Open\nWith...` and selecting `Clojure Notebook`. The output cells have a three dot\nmenu where you can change the presentation to Portal!\n\n> **Note**\n> Calva gives Portal the evaluation results as an edn string therefore\n> this mode of Portal will not be the same as a process connected Portal\n> instance.\n\n[1]: https://calva.io/notebooks/\n[2]: https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva\n[3]: https://marketplace.visualstudio.com/items?itemName=djblue.portal\n\n## `portal.nrepl/wrap-notebook`\n\nIf you would like the same facilities provided by a process connected Portal\ninstance directly in your Calva notebooks, simply add the\n`portal.nrepl/wrap-notebook` middleware to your nrepl stack. This will enable:\n\n- [Datafy + Nav](../datafy.md)\n- First class object support\n- Runtime registered commands\n- Larger values which are harder for edn to serialize and parse\n- Better error rendering\n"}] ["Joyride" {:file "doc/editors/vs-code-joyride.md", :markdown "# Joyride\n\n![image](https://github.com/djblue/portal/assets/1986211/1fd37185-7304-4572-86c6-4207adc3f449)\n\nTo leverage the `portal.api` namespace from your Joyride script, ensure you have\nthe following VS Code extensions installed:\n\n- [Joyride](https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.joyride)\n- [Calva](https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva)\n- [Portal](https://marketplace.visualstudio.com/items?itemName=djblue.portal)\n\nThen after connection to a [Joyride REPL](https://calva.io/joyride/#how-to-connect),\nyou should be able to follow the [API guide](../../README.md#api).\n"}]] ["Intellij" {:file "doc/editors/intellij.md", :markdown "# Intellij\n\nThe Intellij plugin provides a way to embed the Portal UI directly into your IDE.\n\n[![Screenshot](https://user-images.githubusercontent.com/1986211/140680825-431459a8-02d5-40f8-b71c-42aa026cfe93.png)](https://plugins.jetbrains.com/plugin/18467-portal-inspector/)\n\nYou can download the IntelliJ plugin from the [Jet Brains\nMarketplace](https://plugins.jetbrains.com/plugin/18467-portal-inspector/).\n\"Portal\" button will appear on the right-hand bar. The window area will be blank\nuntil portal is launched from the REPL.\n\nAdd a dependency on Portal to your `deps.edn` or `project.clj`, start a Clojure\nREPL and inside that evaluate:\n\n```clojure\n(do\n (def user/portal ((requiring-resolve 'portal.api/open) {:launcher :intellij}))\n (add-tap (requiring-resolve 'portal.api/submit)))\n```\n\nYou can now `tap>` data and they will appear in the Portal tool window.\n\n## Features\n\nThe main benefits of using this plugin are:\n\n- Automatic font / theme discovery.\n- No window management.\n- Editor specific commands. See: goto-definition in the command palette.\n\n## Debugging / Troubleshooting\n\nIf after running `portal.api/open` at the REPL, the Portal UI does not open, it\nis most likely due to having a multi-module project. When the plugin is started,\nit writes a `.portal/intellij.edn` file, which the REPL process will try to\nfind. If the REPL process is started outside of the root project, it will not be\nable to use the Intellij plugin.\n\nA quick hack to get around this problem is to symlink the `.portal` directory to\nthe directory where the REPL process is started.\n\nSimilarly, if you get the following error message, simply remove the `.portal` directory, and try calling `(p/open {:launcher :intellij}` again.\n(This might be caused by the portal intellij extension not being initialized after upgrading, but you have an existing .portal/intellij.edn -- the clj runtime is trying to connect to a server that is no longer running.)\n\n```\nExecution error (ConnectException) at sun.nio.ch.Net/pollConnect (Net.java:-2).\nConnection refused\n```\n"}]] ["CLI Usage" {:file "doc/cli.md", :markdown "# CLI Usage\n\nAdd a portal alias in `~/.clojure/deps.edn`\n\n```clojure\n:portal/cli\n{:main-opts [\"-m\" \"portal.main\"]\n :extra-deps\n {djblue/portal {:mvn/version \"LATEST\"}\n ;; optional yaml support\n clj-commons/clj-yaml {:mvn/version \"0.7.0\"}}}\n```\n\nThen do the following depending on your data format:\n\n```bash\ncat data | clojure -M:portal/cli [edn|json|transit|yaml]\n# or with babashka for faster startup\ncat data | bb -cp `clojure -Spath -M:portal/cli` -m portal.main [edn|json|transit|yaml]\n```\n\nI keep the following bash aliases handy for easier CLI use:\n\n```bash\nalias portal='bb -cp `clojure -Spath -M:portal/cli` -m portal.main'\nalias edn='portal edn'\nalias json='portal json'\nalias transit='portal transit'\nalias yaml='portal yaml'\n```\n\nand often use the `Copy as cURL` feature in the chrome network tab to do\nthe following:\n\n```bash\ncurl ... | transit\n```\n\nThere is also the ability to invoke a standalone http server to listen and\ndisplay data from remote client\n\n```bash\nbb -cp `clojure -Spath -Sdeps '{:deps {djblue/portal {:mvn/version \"LATEST\"}}}'` \\\n -e '(require (quote [portal.api])) (portal.api/open {:port 53755}) @(promise)'\n```\n"}] ["Datafy / Nav" {:file "doc/datafy.md", :markdown "# [Datafy](https://clojuredocs.org/clojure.datafy/datafy) and [Nav](https://clojuredocs.org/clojure.datafy/nav)\n\nDatafy and Nav are extension points defined in clojure to support user defined\nlogic for transforming anything into clojure data and how to traverse it.\n\nFor a great overview of datafy and nav, I recommend reading [Clojure\n1.10's Datafy and Nav](https://corfield.org/blog/2018/12/03/datafy-nav/)\nby Sean Corfield.\n\nThe below will demonstrate the power of datafy and nav by allowing you to\ntraverse the hacker news api! It will produce data tagged with metadata on\nhow to get more data!\n\n```clojure\n(require '[examples.hacker-news :as hn])\n\n(tap> hn/stories)\n```\n\nAn interesting use case for nav is allowing users to nav into keywords to\nproduce documentation for that keyword. This really highlights the power\nbehind datafy and nav. It becomes very easy to tailor a browser into the\nperfect development environment!\n\nBelow is an example of extending the Datafiable protocol to java files:\n\n```clojure\n(require '[clojure.core.protocols :refer [Datafiable]])\n\n(extend-protocol Datafiable\n java.io.File\n (datafy [^java.io.File this]\n {:name (.getName this)\n :absolute-path (.getAbsolutePath this)\n :flags (cond-> #{}\n (.canRead this) (conj :read)\n (.canExecute this) (conj :execute)\n (.canWrite this) (conj :write)\n (.exists this) (conj :exists)\n (.isAbsolute this) (conj :absolute)\n (.isFile this) (conj :file)\n (.isDirectory this) (conj :directory)\n (.isHidden this) (conj :hidden))\n :size (.length this)\n :last-modified (.lastModified this)\n :uri (.toURI this)\n :files (seq (.listFiles this))\n :parent (.getParentFile this)}))\n```\n\nHere is an example of how to leverage [protocol extension via metadata](https://clojure.org/reference/protocols#_extend_via_metadata) to make it possible to navigate to a related entity, namely from a book to its author:\n\n```clojure\n;; in practice you'd use e.g. next.jdbc with a real DB, here we've a db map:\n(let [db {:book [#:book{:id 1, :title \"1984\" :author 10}]\n :person [#:person{:id 10 :fname \"George\" :lname \"Orwell\"}]}]\n (tap> (->> (get db :book)\n (map #(with-meta % {`clojure.core.protocols/nav\n (fn [_coll key value]\n (if (= key :book/author)\n (first (filter (comp #{value} :person/id) (:person db)))\n value))})))))\n```\n\nThis is what it looks like. Notice the book author's ID is selected - if we press Enter now, it will trigger the navigation and display the person map:\n\n![portal-nav-example](https://user-images.githubusercontent.com/624958/198690804-269131fe-2c77-4c37-96b2-fd4d6831d452.png)\n\n\n## Tips\n\nIf you would like to automatically datafy all tapped values, try the following:\n\n```clojure\n(require '[clojure.datafy :as d])\n(require '[portal.api :as p])\n\n(def submit (comp p/submit d/datafy))\n(add-tap #'submit)\n\n(tap> *ns*)\n```\n"}] ["Video Presentations" {:file "doc/videos.md", :markdown "## 2023-10-25 - Portal Internals (by Chris Badahdah)\n\n\n\n\n\n## 2023-04-06 - Clojure visual-tools meeting 17 - Various Updates\n\n\n\n\n\n## 2022-12-07 - Tapping into one of Clojure's superpowers with Portal by James Trunk\n\n\n\n\n\n## 2022-12-01 - Clojure visual-tools meeting 16 - Calva Notebooks & Portal\n\n\n\n\n\n## 2022-08-08 - JUXT Safari - Portal, Developing with Data with Chris Williams\n\n\n\n\n\n## 2022-04-13 - Meetup: Collaborative Learning - Portal\n\n\n\n\n\n## 2021-11-23 - Thinking with Portal (by Chris Badahdah)\n\n\n\n\n\n## 2020-10-15 - Apropos 14\n\n\n\n"}] ["Dev Guide" {:file "doc/dev/index.md", :markdown "# Development\n\nAfter [installing dependencies](./deps.md) and\n[setting up an editor](./editors.md), the following should be enough to get you\nstarted with Portal development. To kick off a dev server, do:\n\n```bash\nbb dev\nbb tasks # List all bb tasks\n```\n\nFor more info on dev tasks, see [tasks.md](./tasks.md).\n\n## [`user.clj`](../../dev/user.clj)\n\nA good place to start poking around is in the [user](../../dev/user.clj)\nnamespace. It has a bunch of useful example code for development. Take a peek to\nget going, but here are a few important bits.\n\n## `:mode` `:dev`\n\nBy default, anytime a Portal window is opened, it loads the production UI. If\nyou intend to edit the [UI](../../src/portal/ui) code, you will need to start\nPortal with the following option:\n\n```clojure\n(portal.api/open {:mode :dev})\n```\n"} ["System Deps" {:file "doc/dev/deps.md", :markdown "# System Dependencies\n\nTo get started with development on Portal, make sure you have the following\ndependencies installed on your system:\n\n- [java](https://openjdk.java.net/) - for clojure runtime\n - for osx, do `brew install openjdk`\n- [babashka](https://babashka.org/) - for build scripting\n - for osx, do: `brew install borkdude/brew/babashka`\n - to list all build tasks, do: `bb tasks`\n- [node, npm](https://nodejs.org/) - for javascript dependencies\n - for osx, do: `brew install node`\n"}] ["Editor Setup" {:file "doc/dev/editors.md", :markdown "# Editor Setup\n\nFor editor specific development tips, try the following:\n\n## vim + [vim-fireplace](https://github.com/tpope/vim-fireplace)\n\nTo start a dev server, do:\n\n```bash\nbb dev\n```\n\nvim-fireplace should automatically connect upon evaluation, but this will\nonly be for clj files, to get a cljs repl, do:\n\n```vim\n:CljEval (user/cljs)\n```\n\n## emacs + [cider](https://cider.mx/)\n\nThe best way to get started via emacs is to have cider start the repl, do:\n\n```bash\nM-x cider-jack-in-clj&cljs\n```\n\n[.dir-locals.el](../../.dir-locals.el) has all the configuration variables for\ncider.\n\n> **Note**\n> When using cider-jack-in, you will need to manually `npm install`\n> when the `package.json` or `package-lock.json` changes.\n"}] ["Dev Tasks" {:file "doc/dev/tasks.md", :markdown "# Dev Tasks\n\n## Formatting\n\nTo format source code, do:\n\n```bash\nbb fmt\n```\n\n## CI Checks\n\nTo run ci checks, do:\n\n```bash\nbb ci # run all ci check\n\nbb check # run just the static analysis\nbb test # run just the tests\n```\n\n## E2E Testing\n\nTo run the e2e tests in the jvm, node and web environments, do:\n\n```bash\nbb e2e\n```\n\n> **Note**\n> these aren't fully automated tests. They depend on a human for verification\n> and synchronization but it beats having to type everything out manually into\n> a repl.\n\n## Extensions\n\nTo build the [vs-code](./extension-vscode) and [intellij](./extension-intellij) extensions, do:\n\n```bash\nbb ext\n```\n\n### VS Code Dev\n\nTo launch a dev version of the vs-code extension, open a new directory with\n[extension-vscode](../../extension-vscode/) as the root. Then under the `Run and\nDebug` tab you should see a `Run Portal` action which will launch a new vs-code\ndev instance, I like to open the [root](../../) Portal directory in this\ninstance. You can also connect to shadow-cljs via the `:vs-code` or\n`:vs-code-notebook` builds to eval code at the repl. [Here][shadow-cljs] are the\neditor specific shadow-cljs guides.\n\n## Deployment\n\nTo deploy to a release to [clojars](https://clojars.org/djblue/portal), do:\n\n```bash\nbb tag\nbb deploy\n```\n\n[shadow-cljs]: https://shadow-cljs.github.io/docs/UsersGuide.html#_editor_integration"}]] ["Inspiration" {:file "doc/inspiration.md", :markdown "# Inspiration\n\n- [Reveal](https://github.com/vlaaad/reveal)\n - [Talk](https://www.youtube.com/watch?v=jq-7aiXPRKs)\n- [Clouseau](https://common-lisp.net/project/mcclim/static/manual/mcclim.html)\n - [Demo Video](https://youtu.be/-1LzFxTbU9E)\n- [clojure.inspector](https://clojuredocs.org/clojure.inspector/inspect)\n- [REBL](https://github.com/cognitect-labs/REBL-distro)\n- [punk](https://github.com/Lokeh/punk)\n- [shadow-cljs inspect](https://clojureverse.org/t/introducing-shadow-cljs-inspect/5012)\n"}] ["Limitations" {:file "doc/limitations.md", :markdown "# Limitations\n\nSince the Portal UI is implemented in ClojureScript, it also adopts some of its\nplatform limitations.\n\n## Dates\n\nDates captured from your host platform are interpreted as `js/Date` in the\nPortal UI. Therefore, as documents by this [ClojureScript issue][date-issue],\nthey are potentially interpreted against a different calendar.\n\n## Longs\n\nSince JavaScript doesn't support the full range of numbers provided by longs,\nintegers outside of a certain range must be boxed and shipped as string to the\nUI. This precludes them from participating in viewers that expect `js/Number`.\n\n## Doubles\n\nSince Portal serializes values as JSON, the treatment of doubles can become\ninexact. Any double value submitted to Portal with no decimal component can get\n\"downcast\" to a long when rendered or brought back into the REPL. This is\nfurther complicated since container values (maps, sets, vectors, lists) are\ncaptured and can be returned to the REPL exactly therefore avoiding this issue.\nIn any case, Portal should not be replied upon to preserve exact numeric types.\n\n## Lazy Values\n\nLazy values that contain exceptions will cause Portal's internals to break if\nallowed to flow into the tap-list. By trying to partially realize lazy values\nbefore accepting them, and rejecting any exceptional values, Portal can keep\nworking. However, this only applies to the default tap-list. Since Portal can be\nopened with any value, it is still possible to break that instance of Portal,\nbut it should be contained to that specific instance.\n\n[date-issue]: https://github.com/clojure/clojurescript-site/issues/367"}] ["portal.api" ["clear" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/clear]] [:<> ^{:key 0} [:portal.viewer/pr-str (clear)] ^{:key 1} [:portal.viewer/pr-str (clear portal)]] [:portal.viewer/markdown "Clear all values."]]}] ["close" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/close]] [:<> ^{:key 0} [:portal.viewer/pr-str (close)] ^{:key 1} [:portal.viewer/pr-str (close portal)]] [:portal.viewer/markdown "Close all current inspector windows.\n\n - portal: Portal session returned via `portal.api/open`.\n "]]}] ["docs" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/docs]] [:<> ^{:key 0} [:portal.viewer/pr-str (docs)] ^{:key 1} [:portal.viewer/pr-str (docs options)]] [:portal.viewer/markdown "Open portal docs.\n\n - options: see `portal.api/open` for options."]]}] ["eval-str" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/eval-str]] [:<> ^{:key 0} [:portal.viewer/pr-str (eval-str code)] ^{:key 1} [:portal.viewer/pr-str (eval-str portal code)] ^{:key 2} [:portal.viewer/pr-str (eval-str portal code opts)]] [:portal.viewer/markdown "Evaluate ClojureScript source given as a string in the UI runtime. The parameters:\n\n - portal: portal instance returned from `portal.api/open` or `:all`\n - code (string): the ClojureScript source\n - opts (map): evaluation options.\n - `:verbose` (boolean) optional, return a map containing more info that just the value.\n - Defaults to `false`.\n - `:await` (boolean) optional, await a promise result.\n - Defaults to `false`."]]}] ["inspect" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/inspect]] [:<> ^{:key 0} [:portal.viewer/pr-str (inspect value)] ^{:key 1} [:portal.viewer/pr-str (inspect value options)]] [:portal.viewer/markdown "Open a new portal window to inspect a particular value.\n\n - value: a value to inspect.\n - options: see `portal.api/open` for options."]]}] ["open" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/open]] [:<> ^{:key 0} [:portal.viewer/pr-str (open)] ^{:key 1} [:portal.viewer/pr-str (open portal-or-options)] ^{:key 2} [:portal.viewer/pr-str (open portal options)]] [:portal.viewer/markdown "Open a new inspector window. A previous instance can be passed as\n parameter to make sure it is open.\n\n - options (map): open options.\n - `:theme` (keyword) theme to use for Portal UI, see `portal.colors/themes` for themes.\n - Themes are applied per UI instance, not globally.\n - `:window-title` (string) browser window title.\n - Useful for distinguishing multiple UI instances.\n - `:app` (boolean) Run in `--app` mode via chrome.\n - Defaults to true when chrome is installed.\n - Will use PWA at https://djblue.github.io/portal/ when installed."]]}] ["register!" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/register!]] [:<> ^{:key 0} [:portal.viewer/pr-str (register! var)]] [:portal.viewer/markdown "Register a var with portal. For now, the var should be a 1 arity fn.\n\n Example:\n\n ```clojure\n (register! #'identity)\n ```\n\n The function name and doc string will show up in the command palette."]]}] ["repl" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/repl]] [:<> ^{:key 0} [:portal.viewer/pr-str (repl)] ^{:key 1} [:portal.viewer/pr-str (repl portal)]] [:portal.viewer/markdown "Start a repl for the given Portal session.\n\n - portal: Portal session returned via `portal.api/open`"]]}] ["selected" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/selected]] [:<> ^{:key 0} [:portal.viewer/pr-str (selected)] ^{:key 1} [:portal.viewer/pr-str (selected session)]] [:portal.viewer/markdown "Get a sequence of all currently selected values."]]}] ["sessions" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/sessions]] [:<> ^{:key 0} [:portal.viewer/pr-str (sessions)]] [:portal.viewer/markdown "Get all current portal sessions."]]}] ["set-defaults!" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/set-defaults!]] [:<> ^{:key 0} [:portal.viewer/pr-str (set-defaults! options)]] [:portal.viewer/markdown "Set default options for `open` and `start`.\n Parameters passed directly to either will override defaults."]]}] ["start" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/start]] [:<> ^{:key 0} [:portal.viewer/pr-str (start options)]] [:portal.viewer/markdown "Start the HTTP server with non-default options. Only use if you need\n control over the HTTP server.\n\n - options (map): start options.\n - `:host` (string) optional, server host to use for Portal server.\n - Ignored if server already started.\n - `:port` (number) optional, server port to use for Portal server.\n - Ignored if server already started."]]}] ["stop" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/stop]] [:<> ^{:key 0} [:portal.viewer/pr-str (stop)]] [:portal.viewer/markdown "Stop the HTTP server."]]}] ["submit" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/submit]] [:<> ^{:key 0} [:portal.viewer/pr-str (submit value)]] [:portal.viewer/markdown "Tap target function.\n\n Usage:\n\n ```clojure\n (add-tap #'portal.api/submit)\n (remove-tap #'portal.api/submit)\n ```"]]}] ["tap" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/tap]] [:<> ^{:key 0} [:portal.viewer/pr-str (tap)]] [:portal.viewer/markdown "Add portal as a `tap>` target."]]}] ["url" {:hiccup ^#:portal.viewer{:default :portal.viewer/hiccup} [:div {:style {:gap 9, :max-width 896, :padding 40, :display :flex, :flex-direction :column, :box-sizing :border-box}} [:h2 [:portal.viewer/inspector #'portal.api/url]] [:<> ^{:key 0} [:portal.viewer/pr-str (url portal)]] [:portal.viewer/markdown "Get url for portal session.\n\n - portal: Portal session returned via `portal.api/open`"]]}]]]} \ No newline at end of file diff --git a/icon.svg b/icon.svg new file mode 100644 index 00000000..afa607bc --- /dev/null +++ b/icon.svg @@ -0,0 +1,99 @@ + + diff --git a/index.html b/index.html new file mode 100644 index 00000000..1e4af006 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +x&&(m=L,L=x,x=m);return(void 0===y||y?L<=G:Lm.replace(/\\(.)/g,"$1")):sb(G));const u=G&&G.length,L=y&&y.get||O;y=m=>L(x?[m]: +ma(m));if(u)if(1===u){const m=y(G[0]);y=function(q){return""+m(q)}}else{const m=G.map(y);y=function(q){let S=""+m[0](q),X=0;for(;++X{x={};y={};u=0},m=(q,S)=>{++u>G&&(y=x,x={},u=1);return x[q]=S};L();return{clear:L,has:q=>$a(x,q)||$a(y,q),get:q=>$a(x,q)?x[q]:$a(y,q)?m(q,y[q]):void 0,set:(q,S)=>$a(x,q)?x[q]=S:m(q,S)}};c.merge=function(G,x,y,u){const L=x.length,m=y.length;if(!m)return x;if(!L)return y;u=u||new x.constructor(L+m);let q=0,S=0,X=0;for(;q {for(const u in y)"signals"===u?x.signals=ib(x.signals,y.signals):Pa(x,u,y[u],"legend"===u?{layout:1}:"style"===u?!0:null);return x},{})};c.one=M;c.pad=function(G,x,y,u){y=y||" ";G+="";x-=G.length;return 0>=x?G:"left"===u?Ha(y,x)+G:"center"===u?Ha(y,~~(x/2))+G+Ha(y,Math.ceil(x/2)):G+Ha(y,x)};c.panLinear=function(G,x){return ab(G,x,za,Ma)};c.panLog=function(G,x){var y= +Math.sign(G[0]);return ab(G,x,qa(y),pa(y))};c.panPow=function(G,x,y){return ab(G,x,ja(y),ja(1/y))};c.panSymlog=function(G,x,y){return ab(G,x,bb(y),na(y))};c.peek=yb;c.quarter=function(G){return 1+~~((new Date(G)).getMonth()/3)};c.repeat=Ha;c.span=function(G){return G&&yb(G)-G[0]||0};c.splitAccessPath=ma;c.stringValue=ua;c.toBoolean=function(G){return null==G||""===G?null:G&&"false"!==G&&"0"!==G?!!G:!1};c.toDate=function(G,x){x=x||H;return null==G||""===G?null:x(G)};c.toNumber=za;c.toSet=function(G){const x= +{},y=G.length;for(let u=0;u zb&&(zb=ea[0]);ea[1]<$a&&($a=ea[1]);ea[1]>ka&&(ka=ea[1])}function ub(ea){switch(ea.type){case "GeometryCollection":ea.geometries.forEach(ub);break;case "Point":ab(ea.coordinates);break;case "MultiPoint":ea.coordinates.forEach(ab)}}var sb=r(za.transform),Bb,hb=Infinity,$a=hb,zb=-hb,ka=-hb;za.arcs.forEach(function(ea){for(var Ha=-1,ua=ea.length,xa;++Ha zb&&(zb=xa[0]), +xa[1]<$a&&($a=xa[1]),xa[1]>ka&&(ka=xa[1])});for(Bb in za.objects)ub(za.objects[Bb]);return[hb,$a,zb,ka]}function V(za,ab){var ub=ab.id,sb=ab.bbox,Bb=null==ab.properties?{}:ab.properties;za=ma(za,ab);return null==ub&&null==sb?{type:"Feature",properties:Bb,geometry:za}:null==sb?{type:"Feature",id:ub,properties:Bb,geometry:za}:{type:"Feature",id:ub,bbox:sb,properties:Bb,geometry:za}}function ma(za,ab){function ub(ea){return zb(ea)}function sb(ea){for(var Ha=[],ua=0,xa=ea.length;ua da?~da:da],mb=0,M=Ma.length;mb da)for(da=Oa,Oa=da.length,Ma=Oa-M;Ma<--Oa;)M=da[Ma],da[Ma++]=da[Oa],da[Oa]=M}2>Ha.length&&Ha.push(Ha[0]);return Ha}function Bb(ea){for(ea=sb(ea);4>ea.length;)ea.push(ea[0]);return ea}function hb(ea){return ea.map(Bb)}function $a(ea){var Ha=ea.type;switch(Ha){case "GeometryCollection":return{type:Ha,geometries:ea.geometries.map($a)};case "Point":ea=zb(ea.coordinates);break;case "MultiPoint":ea= +ea.coordinates.map(ub);break;case "LineString":ea=sb(ea.arcs);break;case "MultiLineString":ea=ea.arcs.map(sb);break;case "Polygon":ea=hb(ea.arcs);break;case "MultiPolygon":ea=ea.arcs.map(hb);break;default:return null}return{type:Ha,coordinates:ea}}var zb=r(za.transform),ka=za.arcs;return $a(ab)}function Ia(za,ab){function ub(ea){var Ha=za.arcs[0>ea?~ea:ea],ua=Ha[0];if(za.transform){var xa=[0,0];Ha.forEach(function(da){xa[0]+=da[0];xa[1]+=da[1]})}else xa=Ha[Ha.length-1];return 0>ea?[xa,ua]:[ua,xa]} +function sb(ea,Ha){for(var ua in ea){var xa=ea[ua];delete Ha[xa.start];delete xa.start;delete xa.end;xa.forEach(function(da){Bb[0>da?~da:da]=1});zb.push(xa)}}var Bb={},hb={},$a={},zb=[],ka=-1;ab.forEach(function(ea,Ha){var ua=za.arcs[0>ea?~ea:ea];3>ua.length&&!ua[1][0]&&!ua[1][1]&&(ua=ab[++ka],ab[ka]=ea,ab[Ha]=ua)});ab.forEach(function(ea){var Ha=ub(ea),ua=Ha[0],xa=Ha[1];(Ha=$a[ua])?(delete $a[Ha.end],Ha.push(ea),Ha.end=xa,(ea=hb[xa])?(delete hb[ea.start],ua=ea===Ha?Ha:Ha.concat(ea),hb[ua.start=Ha.start]= +$a[ua.end=ea.end]=ua):hb[Ha.start]=$a[Ha.end]=Ha):(Ha=hb[xa])?(delete hb[Ha.start],Ha.unshift(ea),Ha.start=ua,(ea=$a[ua])?(delete $a[ea.end],ua=ea===Ha?Ha:ea.concat(Ha),hb[ua.start=ea.start]=$a[ua.end=Ha.end]=ua):hb[Ha.start]=$a[Ha.end]=Ha):(Ha=[ea],hb[Ha.start=ua]=$a[Ha.end=xa]=Ha)});sb($a,hb);sb(hb,$a);ab.forEach(function(ea){Bb[0>ea?~ea:ea]||zb.push([ea])});return zb}function ya(za,ab,ub){var sb;if(1 Ha?~Ha:Ha;(ka[ua]||(ka[ua]=[])).push({i:Ha,g:ea})}function Bb(Ha){Ha.forEach(sb)}function hb(Ha){Ha.forEach(Bb)}function $a(Ha){switch(ea=Ha,Ha.type){case "GeometryCollection":Ha.geometries.forEach($a);break;case "LineString":Bb(Ha.arcs);break;case "MultiLineString":case "Polygon":hb(Ha.arcs);break;case "MultiPolygon":Ha.arcs.forEach(hb)}}var zb=[],ka=[],ea;$a(ab);ka.forEach(null==ub?function(Ha){zb.push(Ha[0].i)}: +function(Ha){ub(Ha[0].g,Ha[Ha.length-1].g)&&zb.push(Ha[0].i)});return zb}function Pa(za,ab){function ub(ka){switch(ka.type){case "GeometryCollection":ka.geometries.forEach(ub);break;case "Polygon":sb(ka.arcs);break;case "MultiPolygon":ka.arcs.forEach(sb)}}function sb(ka){ka.forEach(function(ea){ea.forEach(function(Ha){(hb[Ha=0>Ha?~Ha:Ha]||(hb[Ha]=[])).push(ka)})});$a.push(ka)}function Bb(ka){ka=ma(za,{type:"Polygon",arcs:[ka]}).coordinates[0];for(var ea=-1,Ha=ka.length,ua,xa=ka[Ha-1],da=0;++ea xa?~xa:xa].forEach(function(da){da._||(da._=1,Ha.push(da))})})})}});$a.forEach(function(ka){delete ka._});return{type:"MultiPolygon",arcs:zb.map(function(ka){var ea=[];ka.forEach(function(da){da.forEach(function(Oa){Oa.forEach(function(Ma){2>hb[0>Ma? +~Ma:Ma].length&&ea.push(Ma)})})});ea=Ia(za,ea);if(1<(ka=ea.length))for(var Ha=1,ua=Bb(ea[0]),xa;Ha ua&&(ua=ea[0],ea[0]=ea[Ha],ea[Ha]=ua,ua=xa);return ea}).filter(function(ka){return 0 >>1;za[Bb] mb&&(mb=~mb);var M=Bb[mb];M?M.push(Ma):Bb[mb]=[Ma]})}function ub(Oa,Ma){Oa.forEach(function(mb){ab(mb,Ma)})}function sb(Oa,Ma){if("GeometryCollection"===Oa.type)Oa.geometries.forEach(function(mb){sb(mb,Ma)});else if(Oa.type in $a)$a[Oa.type](Oa.arcs,Ma)}var Bb={},hb=za.map(function(){return[]}),$a={LineString:ab,MultiLineString:ub,Polygon:ub,MultiPolygon:function(Oa,Ma){Oa.forEach(function(mb){ub(mb,Ma)})}};za.forEach(sb);for(var zb in Bb){za= +Bb[zb];for(var ka=za.length,ea=0;ea {e.hasOwnProperty(da,nb)?Wa[nb]=1:e.error(`Invalid time unit: ${nb}.`)});1<(Wa.week||Wa.day?1:0)+(Wa.quarter||Wa.month|| +Wa.date?1:0)+(Wa.dayofyear?1:0)&&e.error(`Incompatible time units: ${aa}`);Na.sort((nb,bc)=>da[nb]-da[bc]);return Na}function O(aa,Na,Wa,nb){function bc(ec){return aa(ec=0===arguments.length?new Date:new Date(+ec)),ec}bc.floor=ec=>(aa(ec=new Date(+ec)),ec);bc.ceil=ec=>(aa(ec=new Date(ec-1)),Na(ec,1),aa(ec),ec);bc.round=ec=>{const Kb=bc(ec),kc=bc.ceil(ec);return ec-Kb (Na(ec=new Date(+ec),null==Kb?1:Math.floor(Kb)),ec);bc.range=(ec,Kb,kc)=>{const Nb=[];ec=bc.ceil(ec); +kc=null==kc?1:Math.floor(kc);if(!(ec O(Kb=>{if(Kb>=Kb)for(;aa(Kb),!ec(Kb);)Kb.setTime(Kb-1)},(Kb,kc)=>{if(Kb>=Kb)if(0>kc)for(;0>=++kc;)for(;Na(Kb,-1),!ec(Kb););else for(;0<=--kc;)for(;Na(Kb,1),!ec(Kb););});Wa&&(bc.count=(ec,Kb)=>{Ma.setTime(+ec);mb.setTime(+Kb);aa(Ma);aa(mb);return Math.floor(Wa(Ma,mb))},bc.every=ec=>{ec=Math.floor(ec);return isFinite(ec)&&0 +0===nb(Kb)%ec:Kb=>0===bc.count(0,Kb)%ec):bc:null});return bc}function V(aa){return O(Na=>{Na.setDate(Na.getDate()-(Na.getDay()+7-aa)%7);Na.setHours(0,0,0,0)},(Na,Wa)=>{Na.setDate(Na.getDate()+7*Wa)},(Na,Wa)=>(Wa-Na-6E4*(Wa.getTimezoneOffset()-Na.getTimezoneOffset()))/6048E5)}function ma(aa){return O(Na=>{Na.setUTCDate(Na.getUTCDate()-(Na.getUTCDay()+7-aa)%7);Na.setUTCHours(0,0,0,0)},(Na,Wa)=>{Na.setUTCDate(Na.getUTCDate()+7*Wa)},(Na,Wa)=>(Wa-Na)/6048E5)}function Ia(aa,Na){return null==aa||null==Na? +NaN:aa Na?1:aa>=Na?0:NaN}function ya(aa,Na){return null==aa||null==Na?NaN:Na aa?1:Na>=aa?0:NaN}function db(aa){function Na(ec,Kb,kc=0,Nb=ec.length){if(kc >>1;0>nb(ec[uc],Kb)?kc=uc+1:Nb=uc}while(kc Ia(aa(ec),Kb),bc=(ec,Kb)=>aa(ec)-Kb):(Wa=aa===Ia||aa===ya?aa:Pa,bc=nb=aa);return{left:Na,center:function(ec,Kb,kc=0,Nb=ec.length){Nb=Na(ec,Kb,kc,Nb-1);return Nb>kc&&bc(ec[Nb-1], +Kb)>-bc(ec[Nb],Kb)?Nb-1:Nb},right:function(ec,Kb,kc=0,Nb=ec.length){if(kc >>1;0>=nb(ec[uc],Kb)?kc=uc+1:Nb=uc}while(kc =G?10:nb>=x?5:nb>=y?2:1;let ec;0>bc?(ec=Math.pow(10,-bc)/nb,bc=Math.round(aa*ec),nb=Math.round(Na*ec),bc/ec Na&&--nb,ec=-ec):(ec=Math.pow(10,bc)*nb,bc=Math.round(aa/ec),nb= +Math.round(Na/ec),bc*ec Na&&--nb);return nb Wa?ib(aa,Na,2*Wa):[bc,nb,ec]}function yb(aa,Na,Wa){return ib(+aa,+Na,+Wa)[2]}function za(aa,Na,Wa){Na=+Na;aa=+aa;Wa=+Wa;const nb=Na aa?1/-aa:aa)}function ab(aa){u.setFullYear(aa);u.setMonth(0);u.setDate(1);u.setHours(0,0,0,0);return u}function ub(aa){return bb.count(ab(aa.getFullYear())-1,aa)}function sb(aa){return va.count(ab(aa.getFullYear())-1,aa)}function Bb(aa,Na,Wa, +nb,bc,ec,Kb){return 0<=aa&&100>aa?(Na=new Date(-1,Na,Wa,nb,bc,ec,Kb),Na.setFullYear(aa),Na):new Date(aa,Na,Wa,nb,bc,ec,Kb)}function hb(aa){const Na=Date.UTC(aa.getUTCFullYear(),0,1);return na.count(Na-1,aa)}function $a(aa){const Na=Date.UTC(aa.getUTCFullYear(),0,1);return H.count(Na-1,aa)}function zb(aa){u.setTime(Date.UTC(aa,0,1));return u.getUTCDay()}function ka(aa,Na,Wa,nb,bc,ec,Kb){return 0<=aa&&100>aa?(aa=new Date(Date.UTC(-1,Na,Wa,nb,bc,ec,Kb)),aa.setUTCFullYear(Wa.y),aa):new Date(Date.UTC(aa, +Na,Wa,nb,bc,ec,Kb))}function ea(aa,Na,Wa,nb,bc){const ec=Na||1,Kb=e.peek(aa);Na=(Ob,Xb,sc)=>{sc=sc||Ob;return Ha(Wa[sc],nb[sc],Ob===Kb&&ec,Xb)};const kc=new Date;aa=e.toSet(aa);const Nb=aa.year?Na("year"):e.constant(2012),uc=aa.month?Na("month"):aa.quarter?Na("quarter"):e.zero,Zc=aa.week&&aa.day?Na("day",1,"weekday"):aa.week?Na("week",1):aa.day?Na("day",1):aa.date?Na("date",1):aa.dayofyear?Na("dayofyear",1):e.one,Qa=aa.hours?Na("hours"):e.zero,Jb=aa.minutes?Na("minutes"):e.zero,rb=aa.seconds?Na("seconds"): +e.zero,Sb=aa.milliseconds?Na("milliseconds"):e.zero;return function(Ob){kc.setTime(+Ob);Ob=Nb(kc);return bc(Ob,uc(kc),Zc(kc,Ob),Qa(kc),Jb(kc),rb(kc),Sb(kc))}}function Ha(aa,Na,Wa,nb){const bc=1>=Wa?aa:nb?(ec,Kb)=>nb+Wa*Math.floor((aa(ec,Kb)-nb)/Wa):(ec,Kb)=>Wa*Math.floor(aa(ec,Kb)/Wa);return Na?(ec,Kb)=>Na(bc(ec,Kb),Kb):bc}function ua(aa,Na,Wa){return Na+7*aa-(Wa+6)%7}const xa="year quarter month week date day dayofyear hours minutes seconds milliseconds".split(" "),da=xa.reduce((aa,Na,Wa)=>(aa[Na]= +1+Wa,aa),{}),Oa={year:"%Y ",quarter:"Q%q ",month:"%b ",date:"%d ",week:"W%U ",day:"%a ",dayofyear:"%j ",hours:"%H:00",minutes:"00:%M",seconds:":%S",milliseconds:".%L",["year-month"]:"%Y-%m ",["year-month-date"]:"%Y-%m-%d ",["hours-minutes"]:"%H:%M"},Ma=new Date,mb=new Date,M=O(()=>{},(aa,Na)=>{aa.setTime(+aa+Na)},(aa,Na)=>Na-aa);M.every=aa=>{aa=Math.floor(aa);return isFinite(aa)&&0 {Na.setTime(Math.floor(Na/aa)*aa)},(Na,Wa)=>{Na.setTime(+Na+Wa*aa)},(Na,Wa)=>(Wa-Na)/aa):M:null};M.range; +var F=O(aa=>{aa.setTime(aa-aa.getMilliseconds())},(aa,Na)=>{aa.setTime(+aa+1E3*Na)},(aa,Na)=>(Na-aa)/1E3,aa=>aa.getUTCSeconds());F.range;var p=O(aa=>{aa.setTime(aa-aa.getMilliseconds()-1E3*aa.getSeconds())},(aa,Na)=>{aa.setTime(+aa+6E4*Na)},(aa,Na)=>(Na-aa)/6E4,aa=>aa.getMinutes());p.range;var E=O(aa=>{aa.setUTCSeconds(0,0)},(aa,Na)=>{aa.setTime(+aa+6E4*Na)},(aa,Na)=>(Na-aa)/6E4,aa=>aa.getUTCMinutes());E.range;var pa=O(aa=>{aa.setTime(aa-aa.getMilliseconds()-1E3*aa.getSeconds()-6E4*aa.getMinutes())}, +(aa,Na)=>{aa.setTime(+aa+36E5*Na)},(aa,Na)=>(Na-aa)/36E5,aa=>aa.getHours());pa.range;var qa=O(aa=>{aa.setUTCMinutes(0,0,0)},(aa,Na)=>{aa.setTime(+aa+36E5*Na)},(aa,Na)=>(Na-aa)/36E5,aa=>aa.getUTCHours());qa.range;const bb=O(aa=>aa.setHours(0,0,0,0),(aa,Na)=>aa.setDate(aa.getDate()+Na),(aa,Na)=>(Na-aa-6E4*(Na.getTimezoneOffset()-aa.getTimezoneOffset()))/864E5,aa=>aa.getDate()-1);bb.range;const na=O(aa=>{aa.setUTCHours(0,0,0,0)},(aa,Na)=>{aa.setUTCDate(aa.getUTCDate()+Na)},(aa,Na)=>(Na-aa)/864E5,aa=> +aa.getUTCDate()-1);na.range;var ja=O(aa=>{aa.setUTCHours(0,0,0,0)},(aa,Na)=>{aa.setUTCDate(aa.getUTCDate()+Na)},(aa,Na)=>(Na-aa)/864E5,aa=>Math.floor(aa/864E5));ja.range;const va=V(0);ja=V(1);var fb=V(2),Za=V(3),ca=V(4),ta=V(5),J=V(6);va.range;ja.range;fb.range;Za.range;ca.range;ta.range;J.range;const H=ma(0);ja=ma(1);fb=ma(2);Za=ma(3);ca=ma(4);ta=ma(5);J=ma(6);H.range;ja.range;fb.range;Za.range;ca.range;ta.range;J.range;ja=O(aa=>{aa.setDate(1);aa.setHours(0,0,0,0)},(aa,Na)=>{aa.setMonth(aa.getMonth()+ +Na)},(aa,Na)=>Na.getMonth()-aa.getMonth()+12*(Na.getFullYear()-aa.getFullYear()),aa=>aa.getMonth());ja.range;fb=O(aa=>{aa.setUTCDate(1);aa.setUTCHours(0,0,0,0)},(aa,Na)=>{aa.setUTCMonth(aa.getUTCMonth()+Na)},(aa,Na)=>Na.getUTCMonth()-aa.getUTCMonth()+12*(Na.getUTCFullYear()-aa.getUTCFullYear()),aa=>aa.getUTCMonth());fb.range;Za=O(aa=>{aa.setMonth(0,1);aa.setHours(0,0,0,0)},(aa,Na)=>{aa.setFullYear(aa.getFullYear()+Na)},(aa,Na)=>Na.getFullYear()-aa.getFullYear(),aa=>aa.getFullYear());Za.every=aa=> +isFinite(aa=Math.floor(aa))&&0 {Na.setFullYear(Math.floor(Na.getFullYear()/aa)*aa);Na.setMonth(0,1);Na.setHours(0,0,0,0)},(Na,Wa)=>{Na.setFullYear(Na.getFullYear()+Wa*aa)}):null;Za.range;ca=O(aa=>{aa.setUTCMonth(0,1);aa.setUTCHours(0,0,0,0)},(aa,Na)=>{aa.setUTCFullYear(aa.getUTCFullYear()+Na)},(aa,Na)=>Na.getUTCFullYear()-aa.getUTCFullYear(),aa=>aa.getUTCFullYear());ca.every=aa=>isFinite(aa=Math.floor(aa))&&0 {Na.setUTCFullYear(Math.floor(Na.getUTCFullYear()/aa)*aa);Na.setUTCMonth(0, +1);Na.setUTCHours(0,0,0,0)},(Na,Wa)=>{Na.setUTCFullYear(Na.getUTCFullYear()+Wa*aa)}):null;ca.range;const G=Math.sqrt(50),x=Math.sqrt(10),y=Math.sqrt(2),u=new Date,L={year:aa=>aa.getFullYear(),quarter:aa=>Math.floor(aa.getMonth()/3),month:aa=>aa.getMonth(),date:aa=>aa.getDate(),hours:aa=>aa.getHours(),minutes:aa=>aa.getMinutes(),seconds:aa=>aa.getSeconds(),milliseconds:aa=>aa.getMilliseconds(),dayofyear:aa=>ub(aa),week:aa=>sb(aa),weekday:(aa,Na)=>ua(sb(aa),aa.getDay(),ab(Na).getDay()),day:(aa,Na)=> +ua(1,aa.getDay(),ab(Na).getDay())},m={quarter:aa=>3*aa,week:(aa,Na)=>ua(aa,0,ab(Na).getDay())},q={year:aa=>aa.getUTCFullYear(),quarter:aa=>Math.floor(aa.getUTCMonth()/3),month:aa=>aa.getUTCMonth(),date:aa=>aa.getUTCDate(),hours:aa=>aa.getUTCHours(),minutes:aa=>aa.getUTCMinutes(),seconds:aa=>aa.getUTCSeconds(),milliseconds:aa=>aa.getUTCMilliseconds(),dayofyear:aa=>hb(aa),week:aa=>$a(aa),day:(aa,Na)=>ua(1,aa.getUTCDay(),zb(Na)),weekday:(aa,Na)=>ua($a(aa),aa.getUTCDay(),zb(Na))},S={quarter:aa=>3*aa, +week:(aa,Na)=>ua(aa,0,zb(Na))},X={year:Za,quarter:ja.every(3),month:ja,week:va,date:bb,day:bb,dayofyear:bb,hours:pa,minutes:p,seconds:F,milliseconds:M},Ba={year:ca,quarter:fb.every(3),month:fb,week:H,date:na,day:na,dayofyear:na,hours:qa,minutes:E,seconds:F,milliseconds:M},Ja="year month date hours minutes seconds milliseconds".split(" ");F=Ja.slice(0,-1);p=F.slice(0,-1);E=p.slice(0,-1);pa=E.slice(0,-1);qa=["year","month"];const eb=["year"],wb=[[F,1,1E3],[F,5,5E3],[F,15,15E3],[F,30,3E4],[p,1,6E4], +[p,5,3E5],[p,15,9E5],[p,30,18E5],[E,1,36E5],[E,3,108E5],[E,6,216E5],[E,12,432E5],[pa,1,864E5],[["year","week"],1,6048E5],[qa,1,2592E6],[qa,3,7776E6],[eb,1,31536E6]];c.DATE="date";c.DAY="day";c.DAYOFYEAR="dayofyear";c.HOURS="hours";c.MILLISECONDS="milliseconds";c.MINUTES="minutes";c.MONTH="month";c.QUARTER="quarter";c.SECONDS="seconds";c.TIME_UNITS=xa;c.WEEK="week";c.YEAR="year";c.dayofyear=function(aa){return ub(new Date(aa))};c.timeBin=function(aa){var Na=aa.extent;aa=aa.maxbins||40;var Wa=Math.abs(e.span(Na))/ +aa;let nb=db(bc=>bc[2]).right(wb,Wa);nb===wb.length?(Wa=eb,Na=za(Na[0]/31536E6,Na[1]/31536E6,aa)):nb?(nb=wb[Wa/wb[nb-1][2] bc;--ec)if(Kb=aa.slice(bc,ec).join("-"),null!=Na[Kb]){nb+=Na[Kb];bc=ec;break}return nb.trim()};c.timeUnits=r;c.utcFloor=function(aa,Na){return ea(aa,Na||1,q,S,ka)};c.utcInterval=function(aa){return Ba[aa]};c.utcOffset=function(aa,Na,Wa){return(aa=Ba[aa])?aa.offset(Na,Wa):void 0};c.utcSequence=function(aa,Na,Wa,nb){return(aa=Ba[aa])?aa.range(Na,Wa,nb):void 0};c.utcdayofyear=function(aa){return hb(new Date(aa))}; +c.utcweek=function(aa){return $a(new Date(aa))};c.week=function(aa){return sb(new Date(aa))}})}; +shadow$provide[48]=function(Z,ia,Ea,C){(function(c,e){"object"===typeof C&&"undefined"!==typeof Ea?e(C,ia(47),ia(45)):"function"===typeof define&&define.amd?define(["exports","vega-time","vega-util"],e):(c="undefined"!==typeof globalThis?globalThis:c||self,e(c.vega={},c.vega,c.vega))})(this,function(c,e,r){function O(Da){const jb={};return hc=>jb[hc]||(jb[hc]=Da(hc))}function V(Da,jb,hc){var ed=(jb-Da)/Math.max(0,hc),z=Math.floor(Math.log10(ed));ed/=Math.pow(10,z);ed=ed>=rd?10:ed>=od?5:ed>=pe?2:1; +let Y;0>z?(Y=Math.pow(10,-z)/ed,z=Math.round(Da*Y),ed=Math.round(jb*Y),z/Y jb&&--ed,Y=-Y):(Y=Math.pow(10,z)*ed,z=Math.round(Da/Y),ed=Math.round(jb/Y),z*Y jb&&--ed);return ed hc?V(Da,jb,2*hc):[z,ed,Y]}function ma(Da,jb,hc){return V(+Da,+jb,+hc)[2]}function Ia(Da,jb){if(0>(jb=(Da=jb?Da.toExponential(jb-1):Da.toExponential()).indexOf("e")))return null;var hc=Da.slice(0,jb);return[1 ed&&(vb=Math.max(1,ed-Gb));Y.push(hc.substring(z-=vb,z+vb));if((Gb+=vb+1)>ed)break;vb=Da[Ka=(Ka+1)%Da.length]}return Y.reverse().join(jb)}}function Pa(Da){return function(jb){return jb.replace(/[0-9]/g,function(hc){return Da[+hc]})}}function ib(Da){if(!(jb=Ac.exec(Da)))throw Error("invalid format: "+Da);var jb;return new yb({fill:jb[1],align:jb[2],sign:jb[3],symbol:jb[4],zero:jb[5], +width:jb[6],comma:jb[7],precision:jb[8]&&jb[8].slice(1),trim:jb[9],type:jb[10]})}function yb(Da){this.fill=void 0===Da.fill?" ":Da.fill+"";this.align=void 0===Da.align?"\x3e":Da.align+"";this.sign=void 0===Da.sign?"-":Da.sign+"";this.symbol=void 0===Da.symbol?"":Da.symbol+"";this.zero=!!Da.zero;this.width=void 0===Da.width?void 0:+Da.width;this.comma=!!Da.comma;this.precision=void 0===Da.precision?void 0:+Da.precision;this.trim=!!Da.trim;this.type=void 0===Da.type?"":Da.type+""}function za(Da,jb){jb= +Ia(Da,jb);if(!jb)return Da+"";Da=jb[0];jb=jb[1];return 0>jb?"0."+Array(-jb).join("0")+Da:Da.length>jb+1?Da.slice(0,jb+1)+"."+Da.slice(jb+1):Da+Array(jb-Da.length+2).join("0")}function ab(Da){return Da}function ub(Da){function jb(rc){function jd(t){var W=Sd,R=he,Aa,Xa;if("c"===Id)R=B(t)+R,t="";else{t=+t;var Fb=0>t||0>1/t;t=isNaN(t)?Yc:B(Math.abs(t),re);if(Md){var Tb=t.length,jc=1,Yb=-1;a:for(;jc Xa||57 >1)+W+t+R+Fb.slice(Xa);break;default:t=Fb+W+t+R}return Ka(t)}rc=ib(rc);var Jc=rc.fill,Cc=rc.align,sd=rc.sign,ce=rc.symbol,te=rc.zero,$d=rc.width,Od=rc.comma,re=rc.precision,Md=rc.trim,Id=rc.type;"n"===Id?(Od=!0,Id="g"):ba[Id]||(void 0===re&&(re=12),Md=!0,Id="g");if(te||"0"===Jc&&"\x3d"===Cc)te=!0,Jc="0",Cc="\x3d";var Sd="$"===ce?ed:"#"===ce&&/[boxX]/.test(Id)?"0"+Id.toLowerCase():"",he="$"===ce?z:/[%p]/.test(Id)?vb:"",B=ba[Id], +T=/[defgprs%]/.test(Id);re=void 0===re?6:/[gprs]/.test(Id)?Math.max(1,Math.min(21,re)):Math.max(0,Math.min(20,re));jd.toString=function(){return rc+""};return jd}var hc=void 0===Da.grouping||void 0===Da.thousands?ab:db(Ta.call(Da.grouping,Number),Da.thousands+""),ed=void 0===Da.currency?"":Da.currency[0]+"",z=void 0===Da.currency?"":Da.currency[1]+"",Y=void 0===Da.decimal?".":Da.decimal+"",Ka=void 0===Da.numerals?ab:Pa(Ta.call(Da.numerals,String)),vb=void 0===Da.percent?"%":Da.percent+"",Gb=void 0=== +Da.minus?"−":Da.minus+"",Yc=void 0===Da.nan?"NaN":Da.nan+"";return{format:jb,formatPrefix:function(rc,jd){var Jc=jb((rc=ib(rc),rc.type="f",rc));rc=3*Math.max(-8,Math.min(8,Math.floor(ya(jd)/3)));var Cc=Math.pow(10,-rc),sd=lb[8+rc/3];return function(ce){return Jc(Cc*ce)+sd}}}}function sb(Da,jb){return hc=>{hc=Da(hc);const ed=hc.indexOf(jb);if(0>ed)return hc;a:{var z=hc.lastIndexOf("e");if(!(0 ed;){var Y=hc.charCodeAt(z);if(48<=Y&&57>=Y){z+=1;break a}}z=void 0}}for(Y=z ed;)if("0"!==hc[z]){++z;break}return hc.slice(0,z)+Y}}function Bb(Da){const jb=O(Da.format),hc=Da.formatPrefix;return{format:jb,formatPrefix:hc,formatFloat(ed){ed=ib(ed||",");if(null==ed.precision){ed.precision=12;switch(ed.type){case "%":ed.precision-=2;break;case "e":--ed.precision}return sb(jb(ed),jb(".1f")(1)[1])}return jb(ed)},formatSpan(ed,z,Y,Ka){Ka=ib(null==Ka?",f":Ka);var vb=+z;var Gb=+ed;var Yc=+Y;Gb=(Y=vb Gb?1/-Gb:Gb);z=Math.max(Math.abs(ed), +Math.abs(z));if(null==Ka.precision)switch(Ka.type){case "s":return isNaN(ed=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ya(z)/3)))-ya(Math.abs(Gb))))||(Ka.precision=ed),hc(Ka,z);case "":case "e":case "g":case "p":case "r":ed=isNaN;Gb=Math.abs(Gb);z=Math.abs(z)-Gb;z=Math.max(0,ya(z)-ya(Gb))+1;ed(ed=z)||(Ka.precision=ed-("e"===Ka.type));break;case "f":case "%":isNaN(ed=Math.max(0,-ya(Math.abs(Gb))))||(Ka.precision=ed-2*("%"===Ka.type))}return jb(Ka)}}}function hb(){return gc=Bb({format:Wb,formatPrefix:mc})} +function $a(Da){return Bb(ub(Da))}function zb(Da){return arguments.length?gc=$a(Da):gc}function ka(Da,jb,hc,ed){function z(Y){return Da(Y=0===arguments.length?new Date:new Date(+Y)),Y}z.floor=Y=>(Da(Y=new Date(+Y)),Y);z.ceil=Y=>(Da(Y=new Date(Y-1)),jb(Y,1),Da(Y),Y);z.round=Y=>{const Ka=z(Y),vb=z.ceil(Y);return Y-Ka (jb(Y=new Date(+Y),null==Ka?1:Math.floor(Ka)),Y);z.range=(Y,Ka,vb)=>{const Gb=[];Y=z.ceil(Y);vb=null==vb?1:Math.floor(vb);if(!(Y ka(Ka=>{if(Ka>=Ka)for(;Da(Ka),!Y(Ka);)Ka.setTime(Ka-1)},(Ka,vb)=>{if(Ka>=Ka)if(0>vb)for(;0>=++vb;)for(;jb(Ka,-1),!Y(Ka););else for(;0<=--vb;)for(;jb(Ka,1),!Y(Ka););});hc&&(z.count=(Y,Ka)=>{tc.setTime(+Y);Oc.setTime(+Ka);Da(tc);Da(Oc);return Math.floor(hc(tc,Oc))},z.every=Y=>{Y=Math.floor(Y);return isFinite(Y)&&0 0===ed(Ka)%Y:Ka=>0===z.count(0,Ka)%Y):z:null});return z}function ea(Da){return ka(jb=> +{jb.setDate(jb.getDate()-(jb.getDay()+7-Da)%7);jb.setHours(0,0,0,0)},(jb,hc)=>{jb.setDate(jb.getDate()+7*hc)},(jb,hc)=>(hc-jb-6E4*(hc.getTimezoneOffset()-jb.getTimezoneOffset()))/6048E5)}function Ha(Da){return ka(jb=>{jb.setUTCDate(jb.getUTCDate()-(jb.getUTCDay()+7-Da)%7);jb.setUTCHours(0,0,0,0)},(jb,hc)=>{jb.setUTCDate(jb.getUTCDate()+7*hc)},(jb,hc)=>(hc-jb)/6048E5)}function ua(Da){if(0<=Da.y&&100>Da.y){var jb=new Date(-1,Da.m,Da.d,Da.H,Da.M,Da.S,Da.L);jb.setFullYear(Da.y);return jb}return new Date(Da.y, +Da.m,Da.d,Da.H,Da.M,Da.S,Da.L)}function xa(Da){if(0<=Da.y&&100>Da.y){var jb=new Date(Date.UTC(-1,Da.m,Da.d,Da.H,Da.M,Da.S,Da.L));jb.setUTCFullYear(Da.y);return jb}return new Date(Date.UTC(Da.y,Da.m,Da.d,Da.H,Da.M,Da.S,Da.L))}function da(Da,jb,hc){return{y:Da,m:jb,d:hc,H:0,M:0,S:0,L:0}}function Oa(Da){function jb(T,t){return function(W){var R=[],Aa=-1,Xa=0,Fb=T.length,Tb,jc;for(W instanceof Date||(W=new Date(+W));++Aa R.V||53 =Fb)return-1;Tb=t.charCodeAt(Aa++);if(37===Tb){if(Tb=t.charAt(Aa++),Tb=B[Tb in qe?t.charAt(Aa++):Tb],!Tb||0>(R=Tb(T,W,R)))return-1}else if(Tb!=W.charCodeAt(R++))return-1}return R}var z=Da.dateTime,Y=Da.date,Ka=Da.time,vb=Da.periods,Gb=Da.days,Yc=Da.shortDays,rc=Da.months,jd=Da.shortMonths,Jc=M(vb),Cc=F(vb),sd=M(Gb),ce=F(Gb),te=M(Yc),$d=F(Yc),Od=M(rc),re=F(rc),Md=M(jd),Id=F(jd),Sd={a:function(T){return Yc[T.getDay()]}, +A:function(T){return Gb[T.getDay()]},b:function(T){return jd[T.getMonth()]},B:function(T){return rc[T.getMonth()]},c:null,d:q,e:q,f:eb,g:uc,G:Qa,H:S,I:X,j:Ba,L:Ja,m:wb,M:aa,p:function(T){return vb[+(12<=T.getHours())]},q:function(T){return 1+~~(T.getMonth()/3)},Q:Ub,s:Dc,S:Na,u:Wa,U:nb,V:ec,w:Kb,W:kc,x:null,X:null,y:Nb,Y:Zc,Z:Jb,"%":Qb},he={a:function(T){return Yc[T.getUTCDay()]},A:function(T){return Gb[T.getUTCDay()]},b:function(T){return jd[T.getUTCMonth()]},B:function(T){return rc[T.getUTCMonth()]}, +c:null,d:rb,e:rb,f:vc,g:cb,G:pb,H:Sb,I:Ob,j:Xb,L:sc,m:Hc,M:fd,p:function(T){return vb[+(12<=T.getUTCHours())]},q:function(T){return 1+~~(T.getUTCMonth()/3)},Q:Ub,s:Dc,S:Xc,u:Fa,U:La,V:la,w,W:ra,x:null,X:null,y:Ua,Y:Ya,Z:Rb,"%":Qb},B={a:function(T,t,W){return(t=te.exec(t.slice(W)))?(T.w=$d.get(t[0].toLowerCase()),W+t[0].length):-1},A:function(T,t,W){return(t=sd.exec(t.slice(W)))?(T.w=ce.get(t[0].toLowerCase()),W+t[0].length):-1},b:function(T,t,W){return(t=Md.exec(t.slice(W)))?(T.m=Id.get(t[0].toLowerCase()), +W+t[0].length):-1},B:function(T,t,W){return(t=Od.exec(t.slice(W)))?(T.m=re.get(t[0].toLowerCase()),W+t[0].length):-1},c:function(T,t,W){return ed(T,z,t,W)},d:ca,e:ca,f:y,g:ja,G:na,H:J,I:J,j:ta,L:x,m:Za,M:H,p:function(T,t,W){return(t=Jc.exec(t.slice(W)))?(T.p=Cc.get(t[0].toLowerCase()),W+t[0].length):-1},q:fb,Q:L,s:m,S:G,u:E,U:pa,V:qa,w:p,W:bb,x:function(T,t,W){return ed(T,Y,t,W)},X:function(T,t,W){return ed(T,Ka,t,W)},y:ja,Y:na,Z:va,"%":u};Sd.x=jb(Y,Sd);Sd.X=jb(Ka,Sd);Sd.c=jb(z,Sd);he.x=jb(Y,he); +he.X=jb(Ka,he);he.c=jb(z,he);return{format:function(T){var t=jb(T+="",Sd);t.toString=function(){return T};return t},parse:function(T){var t=hc(T+="",!1);t.toString=function(){return T};return t},utcFormat:function(T){var t=jb(T+="",he);t.toString=function(){return T};return t},utcParse:function(T){var t=hc(T+="",!0);t.toString=function(){return T};return t}}}function Ma(Da,jb,hc){var ed=0>Da?"-":"";Da=(ed?-Da:Da)+"";var z=Da.length;return ed+(z [jb.toLowerCase(),hc]))}function p(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+1)))?(Da.w=+jb[0],hc+jb[0].length):-1}function E(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+1)))?(Da.u=+jb[0],hc+jb[0].length):-1}function pa(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.U=+jb[0],hc+jb[0].length):-1}function qa(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.V=+jb[0], +hc+jb[0].length):-1}function bb(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.W=+jb[0],hc+jb[0].length):-1}function na(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+4)))?(Da.y=+jb[0],hc+jb[0].length):-1}function ja(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.y=+jb[0]+(68<+jb[0]?1900:2E3),hc+jb[0].length):-1}function va(Da,jb,hc){return(jb=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(jb.slice(hc,hc+6)))?(Da.Z=jb[1]?0:-(jb[2]+(jb[3]||"00")),hc+jb[0].length):-1}function fb(Da,jb,hc){return(jb=oe.exec(jb.slice(hc, +hc+1)))?(Da.q=3*jb[0]-3,hc+jb[0].length):-1}function Za(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.m=jb[0]-1,hc+jb[0].length):-1}function ca(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.d=+jb[0],hc+jb[0].length):-1}function ta(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+3)))?(Da.m=0,Da.d=+jb[0],hc+jb[0].length):-1}function J(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.H=+jb[0],hc+jb[0].length):-1}function H(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.M=+jb[0],hc+jb[0].length): +-1}function G(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+2)))?(Da.S=+jb[0],hc+jb[0].length):-1}function x(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+3)))?(Da.L=+jb[0],hc+jb[0].length):-1}function y(Da,jb,hc){return(jb=oe.exec(jb.slice(hc,hc+6)))?(Da.L=Math.floor(jb[0]/1E3),hc+jb[0].length):-1}function u(Da,jb,hc){return(Da=Se.exec(jb.slice(hc,hc+1)))?hc+Da[0].length:-1}function L(Da,jb,hc){return(jb=oe.exec(jb.slice(hc)))?(Da.Q=+jb[0],hc+jb[0].length):-1}function m(Da,jb,hc){return(jb=oe.exec(jb.slice(hc)))? +(Da.s=+jb[0],hc+jb[0].length):-1}function q(Da,jb){return Ma(Da.getDate(),jb,2)}function S(Da,jb){return Ma(Da.getHours(),jb,2)}function X(Da,jb){return Ma(Da.getHours()%12||12,jb,2)}function Ba(Da,jb){return Ma(1+Fc.count($e(Da),Da),jb,3)}function Ja(Da,jb){return Ma(Da.getMilliseconds(),jb,3)}function eb(Da,jb){return Ja(Da,jb)+"000"}function wb(Da,jb){return Ma(Da.getMonth()+1,jb,2)}function aa(Da,jb){return Ma(Da.getMinutes(),jb,2)}function Na(Da,jb){return Ma(Da.getSeconds(),jb,2)}function Wa(Da){Da= +Da.getDay();return 0===Da?7:Da}function nb(Da,jb){return Ma(ld.count($e(Da)-1,Da),jb,2)}function bc(Da){var jb=Da.getDay();return 4<=jb||0===jb?ee(Da):ee.ceil(Da)}function ec(Da,jb){Da=bc(Da);return Ma(ee.count($e(Da),Da)+(4===$e(Da).getDay()),jb,2)}function Kb(Da){return Da.getDay()}function kc(Da,jb){return Ma(pd.count($e(Da)-1,Da),jb,2)}function Nb(Da,jb){return Ma(Da.getFullYear()%100,jb,2)}function uc(Da,jb){Da=bc(Da);return Ma(Da.getFullYear()%100,jb,2)}function Zc(Da,jb){return Ma(Da.getFullYear()% +1E4,jb,4)}function Qa(Da,jb){var hc=Da.getDay();Da=4<=hc||0===hc?ee(Da):ee.ceil(Da);return Ma(Da.getFullYear()%1E4,jb,4)}function Jb(Da){Da=Da.getTimezoneOffset();return(0 (ed(Md) r.isString(ed)?jb(ed):Kc(jb,e.timeInterval,ed),utcFormat:ed=>r.isString(ed)?hc(ed):Kc(hc,e.utcInterval,ed),timeParse:O(Da.parse),utcParse:O(Da.utcParse)}}function vd(){return zc=Mc({format:Ab,parse:Vb,utcFormat:Mb,utcParse:ic})}function ud(Da){return Mc(Oa(Da))}function ad(Da){return arguments.length?zc=ud(Da):zc}function Dd(Da,jb){var hc= +arguments.length;hc&&2!==hc&&r.error("defaultLocale expects either zero or two arguments.");if(hc){hc=zb(Da);var ed=ad(jb);hc=r.extend({},hc,ed)}else hc=zb(),ed=ad(),hc=r.extend({},hc,ed);return hc}const rd=Math.sqrt(50),od=Math.sqrt(10),pe=Math.sqrt(2);var Ac=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;ib.prototype=yb.prototype;yb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,this.width| +0))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};var D,ba={"%":(Da,jb)=>(100*Da).toFixed(jb),b:Da=>Math.round(Da).toString(2),c:Da=>Da+"",d:function(Da){return 1E21<=Math.abs(Da=Math.round(Da))?Da.toLocaleString("en").replace(/,/g,""):Da.toString(10)},e:(Da,jb)=>Da.toExponential(jb),f:(Da,jb)=>Da.toFixed(jb),g:(Da,jb)=>Da.toPrecision(jb),o:Da=>Math.round(Da).toString(8),p:(Da,jb)=>za(100*Da,jb),r:za,s:function(Da,jb){var hc=Ia(Da, +jb);if(!hc)return Da+"";var ed=hc[0];hc=hc[1];hc=hc-(D=3*Math.max(-8,Math.min(8,Math.floor(hc/3))))+1;var z=ed.length;return hc===z?ed:hc>z?ed+Array(hc-z+1).join("0"):0 Math.round(Da).toString(16).toUpperCase(),x:Da=>Math.round(Da).toString(16)},Ta=Array.prototype.map,lb="y z a f p n µ m k M G T P E Z Y".split(" "),Ib,Wb,mc;(function(Da){Ib=ub(Da);Wb=Ib.format;mc=Ib.formatPrefix;return Ib})({thousands:",", +grouping:[3],currency:["$",""]});let gc;hb();const tc=new Date,Oc=new Date,Fc=ka(Da=>Da.setHours(0,0,0,0),(Da,jb)=>Da.setDate(Da.getDate()+jb),(Da,jb)=>(jb-Da-6E4*(jb.getTimezoneOffset()-Da.getTimezoneOffset()))/864E5,Da=>Da.getDate()-1);Fc.range;const cd=ka(Da=>{Da.setUTCHours(0,0,0,0)},(Da,jb)=>{Da.setUTCDate(Da.getUTCDate()+jb)},(Da,jb)=>(jb-Da)/864E5,Da=>Da.getUTCDate()-1);cd.range;const md=ka(Da=>{Da.setUTCHours(0,0,0,0)},(Da,jb)=>{Da.setUTCDate(Da.getUTCDate()+jb)},(Da,jb)=>(jb-Da)/864E5,Da=> +Math.floor(Da/864E5));md.range;const ld=ea(0),pd=ea(1),Rd=ea(2),Nd=ea(3),ee=ea(4),ye=ea(5),Ee=ea(6);ld.range;pd.range;Rd.range;Nd.range;ee.range;ye.range;Ee.range;const Ne=Ha(0),af=Ha(1),Ff=Ha(2),sf=Ha(3),lf=Ha(4),gf=Ha(5),wf=Ha(6);Ne.range;af.range;Ff.range;sf.range;lf.range;gf.range;wf.range;const $e=ka(Da=>{Da.setMonth(0,1);Da.setHours(0,0,0,0)},(Da,jb)=>{Da.setFullYear(Da.getFullYear()+jb)},(Da,jb)=>jb.getFullYear()-Da.getFullYear(),Da=>Da.getFullYear());$e.every=Da=>isFinite(Da=Math.floor(Da))&& +0 {jb.setFullYear(Math.floor(jb.getFullYear()/Da)*Da);jb.setMonth(0,1);jb.setHours(0,0,0,0)},(jb,hc)=>{jb.setFullYear(jb.getFullYear()+hc*Da)}):null;$e.range;const De=ka(Da=>{Da.setUTCMonth(0,1);Da.setUTCHours(0,0,0,0)},(Da,jb)=>{Da.setUTCFullYear(Da.getUTCFullYear()+jb)},(Da,jb)=>jb.getUTCFullYear()-Da.getUTCFullYear(),Da=>Da.getUTCFullYear());De.every=Da=>isFinite(Da=Math.floor(Da))&&0 {jb.setUTCFullYear(Math.floor(jb.getUTCFullYear()/Da)*Da);jb.setUTCMonth(0,1);jb.setUTCHours(0, +0,0,0)},(jb,hc)=>{jb.setUTCFullYear(jb.getUTCFullYear()+hc*Da)}):null;De.range;var qe={"-":"",_:" ",0:"0"},oe=/^\s*\d+/,Se=/^%/,Xe=/[\\^$*+?|[\]().{}]/g,qb,Ab,Vb,Mb,ic;(function(Da){qb=Oa(Da);Ab=qb.format;Vb=qb.parse;Mb=qb.utcFormat;ic=qb.utcParse;return qb})({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "), +shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")});let zc;vd();c.defaultLocale=Dd;c.locale=function(Da,jb){Da=Da?$a(Da):zb();jb=jb?ud(jb):ad();return r.extend({},Da,jb)};c.numberFormatDefaultLocale=zb;c.numberFormatLocale=$a;c.resetDefaultLocale=function(){hb();vd();return Dd()};c.resetNumberFormatDefaultLocale=hb;c.resetTimeFormatDefaultLocale=vd;c.timeFormatDefaultLocale=ad;c.timeFormatLocale=ud})}; +shadow$provide[49]=function(Z,ia,Ea,C){function c(V){var ma=V.length;if(0 >16&255,ya[db++]=Ia>>8&255,ya[db++]=Ia&255;2===ma&&(Ia=r[V.charCodeAt(ib)]<<2|r[V.charCodeAt(ib+1)]>>4,ya[db++]=Ia&255);1===ma&&(Ia=r[V.charCodeAt(ib)]<<10|r[V.charCodeAt(ib+1)]<<4|r[V.charCodeAt(ib+2)]>>2,ya[db++]=Ia>>8&255,ya[db++]=Ia&255);return ya};C.fromByteArray=function(V){for(var ma=V.length,Ia=ma%3,ya=[],db=0,Pa=ma-Ia;db Pa?Pa:db+16383,sb=[],Bb=db;Bb >18&63]+e[za>>12&63]+e[za>>6&63]+e[za&63]);za=sb.join("");yb.call(ib,za)}1===Ia?(V=V[ma-1],ya.push(e[V>>2]+e[V<<4&63]+"\x3d\x3d")):2===Ia&&(V=(V[ma-2]<<8)+V[ma-1],ya.push(e[V>>10]+e[V>>4&63]+e[V<<2&63]+"\x3d"));return ya.join("")};var e=[],r=[],O="undefined"!==typeof Uint8Array?Uint8Array:Array;for(Z=0;64>Z;++Z)e[Z]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[Z],r["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Z)]=Z;r[45]=62;r[95]= +63}; +shadow$provide[50]=function(Z,ia,Ea,C){C.read=function(c,e,r,O,V){var ma=8*V-O-1;var Ia=(1< >1,db=-7;V=r?V-1:0;var Pa=r?-1:1,ib=c[e+V];V+=Pa;r=ib&(1<<-db)-1;ib>>=-db;for(db+=ma;0 >=-db;for(db+=O;0 >1,ib=23===V?Math.pow(2, +-24)-Math.pow(2,-77):0;ma=O?0:ma-1;var yb=O?1:-1,za=0>e||0===e&&0>1/e?1:0;e=Math.abs(e);isNaN(e)||Infinity===e?(e=isNaN(e)?1:0,O=db):(O=Math.floor(Math.log(e)/Math.LN2),1>e*(Ia=Math.pow(2,-O))&&(O--,Ia*=2),e=1<=O+Pa?e+ib/Ia:e+ib*Math.pow(2,1-Pa),2<=e*Ia&&(O++,Ia/=2),O+Pa>=db?(e=0,O=db):1<=O+Pa?(e=(e*Ia-1)*Math.pow(2,V),O+=Pa):(e=e*Math.pow(2,Pa-1)*Math.pow(2,V),O=0));for(;8<=V;c[r+ma]=e&255,ma+=yb,e/=256,V-=8);O=O< Oa)throw new RangeError('The value "'+M+'" is invalid for option "size"');M=new Uint8Array(M);M.__proto__=e.prototype;return M}function e(M,F,p){if("number"===typeof M){if("string"===typeof F)throw new TypeError('The "string" argument must be of type string. Received type number');return V(M)}return r(M,F,p)}function r(M,F,p){if("string"===typeof M){var E=F;if("string"!==typeof E||""===E)E="utf8";if(!e.isEncoding(E))throw new TypeError("Unknown encoding: "+ +E);F=db(M,E)|0;p=c(F);M=p.write(M,E);M!==F&&(p=p.slice(0,M));return p}if(ArrayBuffer.isView(M))return ma(M);if(null==M)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(ua(M,ArrayBuffer)||M&&ua(M.buffer,ArrayBuffer)){if(0>F||M.byteLength M)throw new RangeError('The value "'+M+'" is invalid for option "size"');}function V(M){O(M);return c(0>M?0:ya(M)|0)}function ma(M){for(var F=0>M.length?0:ya(M.length)|0,p=c(F),E=0;E =Oa)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Oa.toString(16)+" bytes");return M|0}function db(M,F){if(e.isBuffer(M))return M.length;if(ArrayBuffer.isView(M)||ua(M,ArrayBuffer))return M.byteLength;if("string"!==typeof M)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);var p=M.length, +E=2 >>1;case "base64":return ea(M).length;default:if(pa)return E?-1:zb(M).length;F=(""+F).toLowerCase();pa=!0}}function Pa(M,F,p){var E=!1;if(void 0===F||0>F)F=0;if(F>this.length)return"";if(void 0===p||p>this.length)p=this.length;if(0>= +p)return"";p>>>=0;F>>>=0;if(p<=F)return"";for(M||(M="utf8");;)switch(M){case "hex":M=F;F=this.length;if(!M||0>M)M=0;if(!p||0>p||p>F)p=F;for(F="";M E?"0"+E.toString(16):E.toString(16),F+=E;return F;case "utf8":case "utf-8":return ab(this,F,p);case "ascii":M=F;F="";for(p=Math.min(this.length,p);M
p&&(p=-2147483648); +p=+p;p!==p&&(p=pa?0:M.length-1);0>p&&(p=M.length+p);if(p>=M.length){if(pa)return-1;p=M.length-1}else if(0>p)if(pa)p=0;else return-1;"string"===typeof F&&(F=e.from(F,E));if(e.isBuffer(F))return 0===F.length?-1:za(M,F,p,E,pa);if("number"===typeof F)return F&=255,"function"===typeof Uint8Array.prototype.indexOf?pa?Uint8Array.prototype.indexOf.call(M,F,p):Uint8Array.prototype.lastIndexOf.call(M,F,p):za(M,[F],p,E,pa);throw new TypeError("val must be string, number or Buffer");}function za(M,F,p,E,pa){function qa(va, +fb){return 1===bb?va[fb]:va.readUInt16BE(fb*bb)}var bb=1,na=M.length,ja=F.length;if(void 0!==E&&(E=String(E).toLowerCase(),"ucs2"===E||"ucs-2"===E||"utf16le"===E||"utf-16le"===E)){if(2>M.length||2>F.length)return-1;bb=2;na/=2;ja/=2;p/=2}if(pa)for(E=-1;p
na&&(p=na-ja);0<=p;p--){na=!0;for(E=0;E pa&&(qa=pa);break;case 2:var na=M[F+1];128===(na&192)&&(pa=(pa&31)<<6|na&63,127 pa||57343 pa&&(qa=pa))}null===qa?(qa=65533,bb=1):65535 >>10&1023|55296),qa=56320|qa&1023);E.push(qa);F+=bb}M=E.length;if(M<=Ma)E=String.fromCharCode.apply(String,E);else{p="";for(F=0;F M)throw new RangeError("offset is not uint");if(M+F>p)throw new RangeError("Trying to access beyond buffer length");}function sb(M,F,p,E,pa,qa){if(!e.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance'); +if(F>pa||F M.length)throw new RangeError("Index out of range");}function Bb(M,F,p,E,pa,qa){if(p+E>M.length)throw new RangeError("Index out of range");if(0>p)throw new RangeError("Index out of range");}function hb(M,F,p,E,pa){F=+F;p>>>=0;pa||Bb(M,F,p,4,3.4028234663852886E38,-3.4028234663852886E38);da.write(M,F,p,E,23,4);return p+4}function $a(M,F,p,E,pa){F=+F;p>>>=0;pa||Bb(M,F,p,8,1.7976931348623157E308,-1.7976931348623157E308);da.write(M, +F,p,E,52,8);return p+8}function zb(M,F){F=F||Infinity;for(var p,E=M.length,pa=null,qa=[],bb=0;bb p){if(!pa){if(56319 p){-1<(F-=3)&&qa.push(239,191,189);pa=p;continue}p=(pa-55296<<10|p-56320)+65536}else pa&&-1<(F-=3)&&qa.push(239,191,189);pa=null;if(128>p){if(0>--F)break;qa.push(p)}else if(2048>p){if(0>(F-=2))break;qa.push(p>>6|192, +p&63|128)}else if(65536>p){if(0>(F-=3))break;qa.push(p>>12|224,p>>6&63|128,p&63|128)}else if(1114112>p){if(0>(F-=4))break;qa.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw Error("Invalid code point");}return qa}function ka(M){for(var F=[],p=0;p
M.length)M="";else for(;0!==M.length%4;)M+="\x3d";return p.call(F,M)}function Ha(M,F,p,E){for(var pa= +0;pa =F.length||pa>=M.length);++pa)F[pa+p]=M[pa];return pa}function ua(M,F){return M instanceof F||null!=M&&null!=M.constructor&&null!=M.constructor.name&&M.constructor.name===F.name}var xa=ia(49),da=ia(50);C.Buffer=e;C.SlowBuffer=function(M){+M!=M&&(M=0);return e.alloc(+M)};C.INSPECT_MAX_BYTES=50;var Oa=2147483647;C.kMaxLength=Oa;e.TYPED_ARRAY_SUPPORT=function(){try{var M=new Uint8Array(1);M.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return 42===M.foo()}catch(F){return!1}}(); +e.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}});Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});"undefined"!==typeof Symbol&& +null!=Symbol.species&&e[Symbol.species]===e&&Object.defineProperty(e,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1});e.poolSize=8192;e.from=function(M,F,p){return r(M,F,p)};e.prototype.__proto__=Uint8Array.prototype;e.__proto__=Uint8Array;e.alloc=function(M,F,p){O(M);M=0>=M?c(M):void 0!==F?"string"===typeof p?c(M).fill(F,p):c(M).fill(F):c(M);return M};e.allocUnsafe=function(M){return V(M)};e.allocUnsafeSlow=function(M){return V(M)};e.isBuffer=function(M){return null!=M&&!0=== +M._isBuffer&&M!==e.prototype};e.compare=function(M,F){ua(M,Uint8Array)&&(M=e.from(M,M.offset,M.byteLength));ua(F,Uint8Array)&&(F=e.from(F,F.offset,F.byteLength));if(!e.isBuffer(M)||!e.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(M===F)return 0;for(var p=M.length,E=F.length,pa=0,qa=Math.min(p,E);pa M&&(F+=" ... ");return"\x3cBuffer "+F+"\x3e"};e.prototype.compare=function(M,F,p,E,pa){ua(M,Uint8Array)&&(M=e.from(M,M.offset,M.byteLength));if(!e.isBuffer(M))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof M);void 0===F&&(F=0);void 0===p&&(p=M?M.length:0);void 0===E&&(E=0);void 0===pa&&(pa=this.length);if(0>F||p>M.length||0>E||pa>this.length)throw new RangeError("out of range index");if(E>=pa&&F>=p)return 0;if(E>=pa)return-1; +if(F>=p)return 1;F>>>=0;p>>>=0;E>>>=0;pa>>>=0;if(this===M)return 0;var qa=pa-E,bb=p-F,na=Math.min(qa,bb);E=this.slice(E,pa);M=M.slice(F,p);for(F=0;F >>=0,isFinite(p)?(p>>>=0,void 0===E&&(E="utf8")):(E=p,p=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var pa=this.length-F;if(void 0===p||p>pa)p=pa;if(0 p||0>F)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");E||(E="utf8");for(pa=!1;;)switch(E){case "hex":a:{F=Number(F)||0;E=this.length-F;p?(p=Number(p),p>E&&(p=E)):p=E;E=M.length;p>E/2&& +(p=E/2);for(E=0;E (pa-=2));++bb){var na=E.charCodeAt(bb);M=na>>8;na%=256;qa.push(na);qa.push(M)}return Ha(qa, +this,F,p);default:if(pa)throw new TypeError("Unknown encoding: "+E);E=(""+E).toLowerCase();pa=!0}};e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ma=4096;e.prototype.slice=function(M,F){var p=this.length;M=~~M;F=void 0===F?p:~~F;0>M?(M+=p,0>M&&(M=0)):M>p&&(M=p);0>F?(F+=p,0>F&&(F=0)):F>p&&(F=p);F
>>=0;F>>>=0;p||ub(M,F,this.length);p=this[M]; +for(var E=1,pa=0;++pa >>=0;F>>>=0;p||ub(M,F,this.length);p=this[M+--F];for(var E=1;0 >>=0;F||ub(M,1,this.length);return this[M]};e.prototype.readUInt16LE=function(M,F){M>>>=0;F||ub(M,2,this.length);return this[M]|this[M+1]<<8};e.prototype.readUInt16BE=function(M,F){M>>>=0;F||ub(M,2,this.length);return this[M]<<8|this[M+1]};e.prototype.readUInt32LE= +function(M,F){M>>>=0;F||ub(M,4,this.length);return(this[M]|this[M+1]<<8|this[M+2]<<16)+16777216*this[M+3]};e.prototype.readUInt32BE=function(M,F){M>>>=0;F||ub(M,4,this.length);return 16777216*this[M]+(this[M+1]<<16|this[M+2]<<8|this[M+3])};e.prototype.readIntLE=function(M,F,p){M>>>=0;F>>>=0;p||ub(M,F,this.length);p=this[M];for(var E=1,pa=0;++pa =128*E&&(p-=Math.pow(2,8*F));return p};e.prototype.readIntBE=function(M,F,p){M>>>=0;F>>>=0;p||ub(M,F,this.length);p=F;for(var E= +1,pa=this[M+--p];0 =128*E&&(pa-=Math.pow(2,8*F));return pa};e.prototype.readInt8=function(M,F){M>>>=0;F||ub(M,1,this.length);return this[M]&128?-1*(255-this[M]+1):this[M]};e.prototype.readInt16LE=function(M,F){M>>>=0;F||ub(M,2,this.length);M=this[M]|this[M+1]<<8;return M&32768?M|4294901760:M};e.prototype.readInt16BE=function(M,F){M>>>=0;F||ub(M,2,this.length);M=this[M+1]|this[M]<<8;return M&32768?M|4294901760:M};e.prototype.readInt32LE=function(M,F){M>>>=0;F||ub(M, +4,this.length);return this[M]|this[M+1]<<8|this[M+2]<<16|this[M+3]<<24};e.prototype.readInt32BE=function(M,F){M>>>=0;F||ub(M,4,this.length);return this[M]<<24|this[M+1]<<16|this[M+2]<<8|this[M+3]};e.prototype.readFloatLE=function(M,F){M>>>=0;F||ub(M,4,this.length);return da.read(this,M,!0,23,4)};e.prototype.readFloatBE=function(M,F){M>>>=0;F||ub(M,4,this.length);return da.read(this,M,!1,23,4)};e.prototype.readDoubleLE=function(M,F){M>>>=0;F||ub(M,8,this.length);return da.read(this,M,!0,52,8)};e.prototype.readDoubleBE= +function(M,F){M>>>=0;F||ub(M,8,this.length);return da.read(this,M,!1,52,8)};e.prototype.writeUIntLE=function(M,F,p,E){M=+M;F>>>=0;p>>>=0;E||sb(this,M,F,p,Math.pow(2,8*p)-1,0);E=1;var pa=0;for(this[F]=M&255;++pa
>>=0;p>>>=0;E||sb(this,M,F,p,Math.pow(2,8*p)-1,0);E=p-1;var pa=1;for(this[F+E]=M&255;0<=--E&&(pa*=256);)this[F+E]=M/pa&255;return F+p};e.prototype.writeUInt8=function(M,F,p){M=+M;F>>>=0;p||sb(this, +M,F,1,255,0);this[F]=M&255;return F+1};e.prototype.writeUInt16LE=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,2,65535,0);this[F]=M&255;this[F+1]=M>>>8;return F+2};e.prototype.writeUInt16BE=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,2,65535,0);this[F]=M>>>8;this[F+1]=M&255;return F+2};e.prototype.writeUInt32LE=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,4,4294967295,0);this[F+3]=M>>>24;this[F+2]=M>>>16;this[F+1]=M>>>8;this[F]=M&255;return F+4};e.prototype.writeUInt32BE=function(M,F,p){M=+M;F>>>=0;p|| +sb(this,M,F,4,4294967295,0);this[F]=M>>>24;this[F+1]=M>>>16;this[F+2]=M>>>8;this[F+3]=M&255;return F+4};e.prototype.writeIntLE=function(M,F,p,E){M=+M;F>>>=0;E||(E=Math.pow(2,8*p-1),sb(this,M,F,p,E-1,-E));E=0;var pa=1,qa=0;for(this[F]=M&255;++E
M&&0===qa&&0!==this[F+E-1]&&(qa=1),this[F+E]=(M/pa>>0)-qa&255;return F+p};e.prototype.writeIntBE=function(M,F,p,E){M=+M;F>>>=0;E||(E=Math.pow(2,8*p-1),sb(this,M,F,p,E-1,-E));E=p-1;var pa=1,qa=0;for(this[F+E]=M&255;0<=--E&&(pa*=256);)0>M&&0=== +qa&&0!==this[F+E+1]&&(qa=1),this[F+E]=(M/pa>>0)-qa&255;return F+p};e.prototype.writeInt8=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,1,127,-128);0>M&&(M=255+M+1);this[F]=M&255;return F+1};e.prototype.writeInt16LE=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,2,32767,-32768);this[F]=M&255;this[F+1]=M>>>8;return F+2};e.prototype.writeInt16BE=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,2,32767,-32768);this[F]=M>>>8;this[F+1]=M&255;return F+2};e.prototype.writeInt32LE=function(M,F,p){M=+M;F>>>=0;p||sb(this, +M,F,4,2147483647,-2147483648);this[F]=M&255;this[F+1]=M>>>8;this[F+2]=M>>>16;this[F+3]=M>>>24;return F+4};e.prototype.writeInt32BE=function(M,F,p){M=+M;F>>>=0;p||sb(this,M,F,4,2147483647,-2147483648);0>M&&(M=4294967295+M+1);this[F]=M>>>24;this[F+1]=M>>>16;this[F+2]=M>>>8;this[F+3]=M&255;return F+4};e.prototype.writeFloatLE=function(M,F,p){return hb(this,M,F,!0,p)};e.prototype.writeFloatBE=function(M,F,p){return hb(this,M,F,!1,p)};e.prototype.writeDoubleLE=function(M,F,p){return $a(this,M,F,!0,p)}; +e.prototype.writeDoubleBE=function(M,F,p){return $a(this,M,F,!1,p)};e.prototype.copy=function(M,F,p,E){if(!e.isBuffer(M))throw new TypeError("argument should be a Buffer");p||(p=0);E||0===E||(E=this.length);F>=M.length&&(F=M.length);F||(F=0);0
F)throw new RangeError("targetStart out of bounds");if(0>p||p>=this.length)throw new RangeError("Index out of range");if(0>E)throw new RangeError("sourceEnd out of bounds");E>this.length&&(E= +this.length);M.length-F pa||"latin1"===E)M=pa}}else"number"===typeof M&&(M&=255);if(0>F||this.length >>=0;p=void 0===p?this.length:p>>>0;M||(M=0);if("number"===typeof M)for(E=F;E new Promise((va,fb)=>{na.readFile(ja,(Za,ca)=>{Za?fb(Za):va(ca)})}):db}async function db(){r.error("No file system access.")}function Pa(na){return na?async function(ja,va){const fb=r.extend({},this.options.http,va);va=va&&va.response;ja=await na(ja, +fb);return ja.ok?r.isFunction(ja[va])?ja[va]():ja.text():r.error(ja.status+""+ja.statusText)}:ib}async function ib(){r.error("No HTTP fetch method available.")}function yb(na,ja){if(!na||!na.length)return"unknown";const va=na.length,fb=M.length,Za=M.map((ca,ta)=>ta+1);for(let ca=0,ta=0,J,H;ca
0===ca?ta:ca,0)-1]}function za(na,ja){return ja.reduce((va, +fb)=>{va[fb]=yb(na,fb);return va},{})}function ab(na){return new Function("d","return {"+na.map(function(ja,va){return JSON.stringify(ja)+": d["+va+'] || ""'}).join(",")+"}")}function ub(na,ja){var va=ab(na);return function(fb,Za){return ja(va(fb),Za,na)}}function sb(na){var ja=Object.create(null),va=[];na.forEach(function(fb){for(var Za in fb)Za in ja||va.push(ja[Za]=Za)});return va}function Bb(na,ja){na+="";var va=na.length;return va =y?q=!0:10===(eb=J.charCodeAt(u++))?S=!0:13===eb&&(S=!0,10===J.charCodeAt(u)&&++u);return J.slice(Ja+1,Ba-1).replace(/""/g,'"')}for(;u =y,S=!1;10=== +J.charCodeAt(y-1)&&--y;for(13===J.charCodeAt(y-1)&&--y;(m=G())!==E;){for(var X=[];m!==p&&m!==E;)X.push(m),m=G();H&&null==(X=H(X,L++))||x.push(X)}return x}function va(J,H){return J.map(function(G){return H.map(function(x){return Za(G[x])}).join(na)})}function fb(J){return J.map(Za).join(na)}function Za(J){if(null==J)J="";else{if(J instanceof Date){var H=J.getUTCHours();var G=J.getUTCMinutes(),x=J.getUTCSeconds(),y=J.getUTCMilliseconds();if(isNaN(J))J="Invalid Date";else{var u=J.getUTCFullYear();J= +(0>u?"-"+Bb(-u,6):9999{var L=ja[u];if(L&&(L.startsWith("date:")||L.startsWith("utc:"))){u=L.split(/:(.+)?/, +2);L=u[1];if("'"===L[0]&&"'"===L[L.length-1]||'"'===L[0]&&'"'===L[L.length-1])L=L.slice(1,-1);return("utc"===u[0]?fb:va)(L)}if(!mb[L])throw Error("Illegal format pattern: "+u+":"+L);return mb[L]});var H=0;var G=na.length;for(ta=Za.length;H !Number.isNaN(+na)&&!(na instanceof Date),mb={boolean:r.toBoolean,integer:r.toNumber,number:r.toNumber,date:r.toDate,string:r.toString,unknown:r.identity},M=[na=>"true"===na||"false"===na||!0===na||!1===na,na=>Ma(na)&&Number.isInteger(+na),Ma,na=>!Number.isNaN(Date.parse(na))],F=["boolean","integer","number","date"];var p={},E={};zb.responseType="text";ka.responseType="json";const pa={interior:(na,ja)=>na!==ja,exterior:(na,ja)=>na===ja};ea.responseType="json";const qa={dsv:zb,csv:$a(","),tsv:$a("\t"), +json:ka,topojson:ea},bb=function(na,ja){return va=>({options:va||{},sanitize:Ia,load:ma,fileAccess:!!ja,file:ya(ja),http:Pa(na)})}("undefined"!==typeof fetch&&fetch,null);e.format=qa;e.formats=Ha;e.inferType=yb;e.inferTypes=za;e.loader=bb;e.read=function(na,ja,va,fb){ja=ja||{};const Za=Ha(ja.type||"json");Za||r.error("Unknown data format type: "+ja.type);na=Za(na,ja);ja.parse&&ua(na,ja.parse,va,fb);r.hasOwnProperty(na,"columns")&&delete na.columns;return na};e.responseType=function(na){return(na= +Ha(na))&&na.responseType||"text"};e.typeParsers=mb})}; +shadow$provide[53]=function(Z,ia,Ea,C){(function(c,e){"object"===typeof C&&"undefined"!==typeof Ea?e(C,ia(45),ia(52),ia(48)):"function"===typeof define&&define.amd?define(["exports","vega-util","vega-loader","vega-format"],e):(c="undefined"!==typeof globalThis?globalThis:c||self,e(c.vega={},c.vega,c.vega,c.vega))})(this,function(c,e,r,O){function V(ca){const ta=ca||e.identity,J=[],H={};J.add=G=>{const x=ta(G);H[x]||(H[x]=1,J.push(G));return J};J.remove=G=>{const x=ta(G);H[x]&&(H[x]=0,G=J.indexOf(G), +0<=G&&J.splice(G,1));return J};return J}async function ma(ca,ta){try{await ta(ca)}catch(J){ca.error(J)}}function Ia(ca){ca=ca===Object(ca)?ca:{data:ca};if(!ca[E]){var ta=pa++;ca[E]=ta}return ca}function ya(ca,ta){for(const J in ca)ta[J]=ca[J];return ta}function db(ca){return ca&&ca.constructor===Pa}function Pa(){const ca=[],ta=[],J=[],H=[],G=[];let x=null,y=!1;return{constructor:Pa,insert(u){u=e.array(u);const L=u.length;for(let m=0;m {eb(Na)&&(q[Na[E]]=-1)});X=0;for(Ba=ca.length;X q[wb[E]]&&u.rem.push(wb);X=0;for(Ba=J.length;X {eb(Na)&&0 0ta=H);J.requests=0;J.done=()=>{0===--J.requests&&(ca._pending=null,ta(ca))};return ca._pending=J}function Bb(ca,ta,J,H,G,x){const y=e.extend({},x,ja);let u;e.isFunction(J)||(J=e.constant(J));void 0===H?G=L=>ca.touch(J(L)):e.isFunction(H)?(u=new yb(null,H,G,!1),G=L=>{u.evaluate(L); +L=J(L);const m=u.value;db(m)?ca.pulse(L,m,x):ca.update(L,m,y)}):G=L=>ca.update(J(L),H,y);ta.apply(G)}function hb(ca,ta,J,H,G,x){void 0===H?ta.targets().add(J):(x=x||{},H=new yb(null,$a(J,H),G,!1),H.modified(x.force),H.rank=ta.rank,ta.targets().add(H),J&&(H.skip(!0),H.value=J.value,H.targets().add(J),ca.connect(J,[H])))}function $a(ca,ta){ta=e.isFunction(ta)?ta:e.constant(ta);return ca?function(J,H){J=ta(J,H);ca.skip()||(ca.skip(J!==this.value).value=J);return J}:ta}function zb(ca,ta,J){this.dataflow= +ca;this.stamp=null==ta?-1:ta;this.add=[];this.rem=[];this.mod=[];this.fields=null;this.encode=J||null}function ka(ca,ta){const J=[];e.visitArray(ca,ta,H=>J.push(H));return J}function ea(ca,ta){const J={};ca.visit(ta,H=>{J[H[E]]=1});return H=>J[H[E]]?null:H}function Ha(ca,ta){return ca?(J,H)=>ca(J,H)&&ta(J,H):ta}function ua(ca,ta,J,H){let G=0;this.dataflow=ca;this.stamp=ta;this.fields=null;this.encode=H||null;this.pulses=J;for(const x of J)if(x.stamp===ta){if(x.fields){ca=this.fields||(this.fields= +{});for(const y in x.fields)ca[y]=1}x.changed(this.ADD)&&(G|=this.ADD);x.changed(this.REM)&&(G|=this.REM);x.changed(this.MOD)&&(G|=this.MOD)}this.changes=G}function xa(ca){ca.error("Dataflow already running. Use runAsync() to chain invocations.");return ca}function da(ca,ta){if(ta&&ta.stamp===ca.stamp)return ta;ca=ca.fork();ta&&ta!==va&&(ca.source=ta.source);return ca}function Oa(ca){let ta=[];return{clear:()=>ta=[],size:()=>ta.length,peek:()=>ta[0],push:J=>{ta.push(J);return Ma(ta,0,ta.length-1, +ca)},pop:()=>{var J=ta.pop();let H;if(ta.length){H=ta[0];ta[0]=J;J=ta;var G=0;const x=G,y=J.length,u=J[G];let L=(G<<1)+1,m;for(;Lta;)if(x=J-1>>1,G=ca[x],0>H(y,G))ca[J]=G,J=x;else break;return ca[J]=y}function mb(){this.logger(e.logger());this.logLevel(e.Error);this._rank=this._clock=0;this._locale=O.defaultLocale();try{this._loader=r.loader()}catch(ca){}this._touched= +V(e.id);this._input={};this._pulse=null;this._heap=Oa((ca,ta)=>ca.qrank-ta.qrank);this._postrun=[]}function M(ca){return function(){return this._log[ca].apply(this,arguments)}}function F(ca,ta){yb.call(this,ca,null,ta)}function p(ca){ca=ca&&ca.toLowerCase();return e.hasOwnProperty(Za,ca)?Za[ca]:null}const E=Symbol("vega_id");let pa=1;ib.prototype={set(ca,ta,J,H){const G=this[ca],x=this["_:mod:_"];if(null!=ta&&0<=ta){if(G[ta]!==J||H)G[ta]=J,x[ta+":"+ca]=-1,x[ca]=-1}else if(G!==J||H)this[ca]=J,x[ca]= +e.isArray(J)?1+J.length:-1;return this},modified(ca,ta){const J=this["_:mod:_"];if(!arguments.length){for(var H in J)if(J[H])return!0;return!1}if(e.isArray(ca)){for(H=0;H {Ba instanceof yb?(Ba!==this&&(ta&&Ba.targets().add(this),x.push(Ba)),G.push({op:Ba,name:S,index:X})):H.set(S,X,Ba)};for(y in ca)if(u=ca[y],"pulse"===y)e.array(u).forEach(S=>{S instanceof yb?S!==this&&(S.targets().add(this),x.push(S)):e.error("Pulse parameters must be operator instances.")}),this.source=u;else if(e.isArray(u))for(H.set(y,-1,Array(L=u.length)),m=0;m +{const J=Date.now();return J-ta>ca?(ta=J,1):0})},debounce(ca){const ta=ub();this.targets().add(ub(null,null,e.debounce(ca,J=>{const H=J.dataflow;ta.receive(J);H&&H.run&&H.run()})));return ta},between(ca,ta){let J=!1;ca.targets().add(ub(null,null,()=>J=!0));ta.targets().add(ub(null,null,()=>J=!1));return this.filter(()=>J)},detach(){this._filter=e.truthy;this._targets=null}};const ja={skip:!0},va={};zb.prototype={StopPropagation:va,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32, +NO_FIELDS:64,fork(ca){return(new zb(this.dataflow)).init(this,ca)},clone(){const ca=this.fork(7);ca.add=ca.add.slice();ca.rem=ca.rem.slice();ca.mod=ca.mod.slice();ca.source&&(ca.source=ca.source.slice());return ca.materialize(23)},addAll(){let ca=this;ca.source&&ca.add!==ca.rem&&(ca.rem.length||ca.source.length!==ca.add.length)&&(ca=(new zb(this.dataflow)).init(this),ca.add=ca.source,ca.rem=[]);return ca},init(ca,ta){this.stamp=ca.stamp;this.encode=ca.encode;!ca.fields||ta&64||(this.fields=ca.fields); +ta&1?(this.addF=ca.addF,this.add=ca.add):(this.addF=null,this.add=[]);ta&2?(this.remF=ca.remF,this.rem=ca.rem):(this.remF=null,this.rem=[]);ta&4?(this.modF=ca.modF,this.mod=ca.mod):(this.modF=null,this.mod=[]);ta&32?this.source=this.srcF=null:(this.srcF=ca.srcF,this.source=ca.source,ca.cleans&&(this.cleans=ca.cleans));return this},runAfter(ca){this.dataflow.runAfter(ca)},changed(ca){ca=ca||7;return ca&1&&this.add.length||ca&2&&this.rem.length||ca&4&&this.mod.length},reflow(ca){if(ca)return this.fork(7).reflow(); +ca=this.add.length;const ta=this.source&&this.source.length;ta&&ta!==ca&&(this.mod=this.source,ca&&this.filter(4,ea(this,1)));return this},clean(ca){return arguments.length?(this.cleans=!!ca,this):this.cleans},modifies(ca){const ta=this.fields||(this.fields={});e.isArray(ca)?ca.forEach(J=>ta[J]=!0):ta[ca]=!0;return this},modified(ca,ta){const J=this.fields;return(ta||this.mod.length)&&J?arguments.length?e.isArray(ca)?ca.some(H=>J[H]):J[ca]:!!J:!1},filter(ca,ta){ca&1&&(this.addF=Ha(this.addF,ta)); +ca&2&&(this.remF=Ha(this.remF,ta));ca&4&&(this.modF=Ha(this.modF,ta));ca&16&&(this.srcF=Ha(this.srcF,ta));return this},materialize(ca){ca=ca||7;ca&1&&this.addF&&(this.add=ka(this.add,this.addF),this.addF=null);ca&2&&this.remF&&(this.rem=ka(this.rem,this.remF),this.remF=null);ca&4&&this.modF&&(this.mod=ka(this.mod,this.modF),this.modF=null);ca&16&&this.srcF&&(this.source=this.source.filter(this.srcF),this.srcF=null);return this},visit(ca,ta){if(ca&16)return e.visitArray(this.source,this.srcF,ta),this; +ca&1&&e.visitArray(this.add,this.addF,ta);ca&2&&e.visitArray(this.rem,this.remF,ta);ca&4&&e.visitArray(this.mod,this.modF,ta);const J=this.source;ca&8&&J&&(ca=this.add.length+this.mod.length,ca!==J.length&&(ca?e.visitArray(J,ea(this,5),ta):e.visitArray(J,this.srcF,ta)));return this}};e.inherits(ua,zb,{fork(ca){const ta=(new zb(this.dataflow)).init(this,ca&this.NO_FIELDS);void 0!==ca&&(ca&ta.ADD&&this.visit(ta.ADD,J=>ta.add.push(J)),ca&ta.REM&&this.visit(ta.REM,J=>ta.rem.push(J)),ca&ta.MOD&&this.visit(ta.MOD, +J=>ta.mod.push(J)));return ta},changed(ca){return this.changes&ca},modified(ca){const ta=this.fields;return ta&&this.changes&this.MOD?e.isArray(ca)?ca.some(J=>ta[J]):ta[ca]:0},filter(){e.error("MultiPulse does not support filtering.")},materialize(){e.error("MultiPulse does not support materialization.")},visit(ca,ta){const J=this.pulses,H=J.length;let G=0;if(ca&this.SOURCE)for(;G H._enqueue(m,!0));H._touched=V(e.id);let x=0;let y,u;try{for(;0 H._enqueue(m)),++x)}}catch(m){H._heap.clear(),u=m}H._input={};H._pulse=null;H.debug(`Pulse ${ta}: ${x} operators`); +u&&(H._postrun=[],H.error(u));if(H._postrun.length)for(ca=H._postrun.sort((m,q)=>q.priority-m.priority),H._postrun=[],L=0;L H.runAsync(null,()=>{m.forEach(q=>{try{q(H)}catch(S){H.error(S)}})}));return H},run:function(ca,ta,J){return this._pulse?xa(this):(this.evaluate(ca,ta,J),this)},runAsync:async function(ca,ta,J){for(;this._running;)await this._running;const H=()=>this._running=null;(this._running=this.evaluate(ca, +ta,J)).then(H,H);return this._running},runAfter:function(ca,ta,J){if(this._pulse||ta)this._postrun.push({priority:J||0,callback:ca});else try{ca(this)}catch(H){this.error(H)}},_enqueue:function(ca,ta){const J=ca.stamp G.pulse),ta):this._input[ca.id]||da(this._pulse,J&&J.pulse)}};e.inherits(F,yb,{run(ca){if(ca.stamp< +this.stamp)return ca.StopPropagation;let ta;this.skip()?this.skip(!1):ta=this.evaluate(ca);ta=ta||ca;ta.then?ta=ta.then(J=>this.pulse=J):ta!==ca.StopPropagation&&(this.pulse=ta);return ta},evaluate(ca){const ta=this.marshall(ca.stamp);ca=this.transform(ta,ca);ta.clear();return ca},transform(){}});const Za={};c.Dataflow=mb;c.EventStream=ab;c.MultiPulse=ua;c.Operator=yb;c.Parameters=ib;c.Pulse=zb;c.Transform=F;c.UniqueList=V;c.asyncCallback=ma;c.changeset=Pa;c.definition=function(ca){return(ca=p(ca))&& +ca.Definition||null};c.derive=function(ca){return ya(ca,Ia({}))};c.ingest=Ia;c.isChangeSet=db;c.isTuple=function(ca){return!(!ca||!ca[E])};c.rederive=ya;c.replace=function(ca,ta){ta[E]=ca[E];return ta};c.stableCompare=function(ca,ta){return ca?ta?(J,H)=>ca(J,H)||ta(J)[E]-ta(H)[E]:(J,H)=>ca(J,H)||J[E]-H[E]:null};c.transform=p;c.transforms=Za;c.tupleid=function(ca){return ca[E]}})}; +shadow$provide[54]=function(Z,ia,Ea,C){(function(c,e){"object"===typeof C&&"undefined"!==typeof Ea?e(C):"function"===typeof define&&define.amd?define(["exports"],e):(c="undefined"!==typeof globalThis?globalThis:c||self,e(c.vega={}))})(this,function(c){function*e(J,H){if(null==H)for(var G of J)null!=G&&""!==G&&(G=+G)>=G&&(yield G);else{G=-1;for(let x of J)x=H(x,++G,J),null!=x&&""!==x&&(x=+x)>=x&&(yield x)}}function r(J,H){return null==J||null==H?NaN:J H?1:J>=H?0:NaN}function O(J){return null=== +J?NaN:+J}function*V(J,H){if(void 0===H)for(var G of J)null!=G&&(G=+G)>=G&&(yield G);else{G=-1;for(let x of J)null!=(x=H(x,++G,J))&&(x=+x)>=x&&(yield x)}}function ma(J=r){if(J===r)return Ia;if("function"!==typeof J)throw new TypeError("compare is not a function");return(H,G)=>{const x=J(H,G);return x||0===x?x:(0===J(G,G))-(0===J(H,H))}}function Ia(J,H){return(null==J||!(J>=J))-(null==H||!(H>=H))||(J H?1:0)}function ya(J,H){let G;if(void 0===H)for(var x of J)null!=x&&(G =x)&& +(G=x);else{x=-1;for(let y of J)null!=(y=H(y,++x,J))&&(G =y)&&(G=y)}return G}function db(J,H){let G;if(void 0===H)for(var x of J)null!=x&&(G>x||void 0===G&&x>=x)&&(G=x);else{x=-1;for(let y of J)null!=(y=H(y,++x,J))&&(G>y||void 0===G&&y>=y)&&(G=y)}return G}function Pa(J,H,G=0,x=Infinity,y){H=Math.floor(H);G=Math.floor(Math.max(0,G));x=Math.floor(Math.min(J.length-1,x));if(!(G<=H&&H<=x))return J;for(y=void 0===y?Ia:ma(y);x>G;){if(600 L-u/2?-1:1);Pa(J,H,Math.max(G,Math.floor(H-L*q/u+m)),Math.min(x,Math.floor(H+(u-L)*q/u+m)),y)}u=J[H];L=G;q=x;ib(J,G,H);for(0 y(J[L],u);)++L;for(;0 =H||2>G)return db(J);if(1<=H)return ya(J);H*= +G-1;G=Math.floor(H);var x=ya(Pa(J,G).subarray(0,G+1));J=db(J.subarray(G+1));return x+(J-x)*(H-G)}}function za(J,H,G=O){if((x=J.length)&&!isNaN(H=+H)){if(0>=H||2>x)return+G(J[0],0,J);if(1<=H)return+G(J[x-1],x-1,J);var x;H*=x-1;x=Math.floor(H);var y=+G(J[x],x,J);J=+G(J[x+1],x+1,J);return y+(J-y)*(H-x)}}function ab(J,H,G){const x=Float64Array.from(e(J,G));x.sort(r);return H.map(y=>za(x,y))}function ub(J,H){return ab(J,[.25,.5,.75],H)}function sb(J,H){const G=J.length;{var x=0;let u,L=0,m=0;if(void 0=== +H)for(var y of J)null!=y&&(y=+y)>=y&&(u=y-L,L+=u/++x,m+=u*(y-L));else{y=-1;for(let q of J)null!=(q=H(q,++y,J))&&(q=+q)>=q&&(u=q-L,L+=u/++x,m+=u*(q-L))}x=1 >1);L y;)J[L--]=J[x]}x=y;y=u}return J}function hb(J, +H){J=J||0;H=null==H?1:H;let G,x;if(ca===ca)G=ca,ca=NaN;else{do{G=2*c.random()-1;x=2*c.random()-1;var y=G*G+x*x}while(0===y||1 H?(G*=(((((.0352624965998911*H+.700383064443688)*H+6.37396220353165)*H+33.912866078383)*H+112.079291497871)*H+221.213596169931)*H+220.206867912376, +G/=((((((.0883883476483184*H+1.75566716318264)*H+16.064177579207)*H+86.7807322029461)*H+296.564248779674)*H+637.333633378831)*H+793.826512519948)*H+440.413735824752):G=G/(H+1/(H+2/(H+3/(H+4/(H+.65)))))/2.506628274631);return 0 J||1 x?(x-=3.125,x=1.6536545626831027+(.24015818242558962+(-.006033670871430149+(-7.40702534166267E-4+(1.8673420803405714E-4+(-1.3882523362786469E-5+(-1.3654692000834679E-6+(4.2347877827932404E-7+ +(-2.9070369957882005E-8+(-4.112633980346984E-9+(1.0512122733215323E-9+(-5.415412054294628E-11+(-1.2975133253453532E-11+(2.6335093153082323E-12+(-8.151934197605472E-14+(-4.054566272975207E-14+(6.637638134358324E-15+(2.0972767875968562E-17+(-1.333171662854621E-16+(1.1157877678025181E-17+(1.28584807152564E-18+(-1.6850591381820166E-19+-3.64441206401782E-21*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x):16>x?(x=Math.sqrt(x)-3.25,x=3.0838856104922208+(1.0052589676941592+(.005370914553590064+ +(-.003751208507569241+(.002491442096107851+(-.0016882755560235047+(9.532893797373805E-4+(-3.550375203628475E-4+(2.4031110387097894E-5+(6.828485145957318E-5+(-4.7318229009055734E-5+(1.2475304481671779E-5+(2.9234449089955446E-6+(-4.013867526981546E-6+(1.5027403968909828E-6+(1.8239629214389228E-8+(-2.7517406297064545E-7+(9.075656193888539E-8+2.2137376921775787E-9*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x):Number.isFinite(x)?(x=Math.sqrt(x)-5,x=4.849906401408584+(1.0103004648645344+(-1.3871931833623122E-4+ +(-2.1503011930044477E-4+(7.599527703001776E-5+(-1.968177810553167E-5+(4.526062597223154E-6+(-9.9298272942317E-7+(2.2900482228026655E-7+(-6.771199775845234E-8+(2.914795345090108E-8+(-1.496002662714924E-8+(7.61570120807834E-9+(-3.789465440126737E-9+(1.5076572693500548E-9+(-2.555641816996525E-10+-2.7109920616438573E-11*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x)*x):x=Infinity;return(H||0)+(null==G?1:G)*Za*x*J}function ea(J,H){let G,x;const y={mean(u){return arguments.length?(G=u||0,y):G},stdev(u){return arguments.length? +(x=null==u?1:u,y):x},sample:()=>hb(G,x),pdf:u=>$a(u,G,x),cdf:u=>zb(u,G,x),icdf:u=>ka(u,G,x)};return y.mean(J).stdev(H)}function Ha(J,H){H=null==H?1:H;return Math.exp((J||0)+hb()*H)}function ua(J,H,G){if(0>=J)return 0;G=null==G?1:G;H=(Math.log(J)-(H||0))/G;return Math.exp(-.5*H*H)/(G*fb*J)}function xa(J,H,G){return zb(Math.log(J),H,G)}function da(J,H,G){return Math.exp(ka(J,H,G))}function Oa(J,H){null==H&&(H=null==J?1:J,J=0);return J+(H-J)*c.random()}function Ma(J,H,G){null==G&&(G=null==H?1:H,H=0); +return J>=H&&J<=G?1/(G-H):0}function mb(J,H,G){null==G&&(G=null==H?1:H,H=0);return J G?1:(J-H)/(G-H)}function M(J,H,G){null==G&&(G=null==H?1:H,H=0);return 0<=J&&1>=J?H+J*(G-H):NaN}function F(J,H,G){let x=0,y=0;for(const u of J)J=G(u),null==H(u)||null==J||isNaN(J)||(x+=(J-x)/++y);return{coef:[x],predict:()=>x,rSquared:0}}function p(J,H,G,x){x-=J*J;G=1E-24>Math.abs(x)?0:(G-J*H)/x;return[H-G*J,G]}function E(J,H,G,x){J=J.filter(Ba=>{let Ja=H(Ba);Ba=G(Ba);return null!=Ja&&(Ja=+Ja)>=Ja&&null!=Ba&& +(Ba=+Ba)>=Ba});x&&J.sort((Ba,Ja)=>H(Ba)-H(Ja));x=J.length;const y=new Float64Array(x),u=new Float64Array(x);let L=0,m=0,q=0,S,X;for(X of J)y[L]=J=+H(X),u[L]=S=+G(X),++L,m+=(J-m)/L,q+=(S-q)/L;for(L=0;L =J&&null!=u&&(u=+u)>=u&&x(J,u,++y)}function qa(J,H,G,x,y){let u=0,L=0;pa(J,H,G,(m,q)=>{m=q-y(m);q-=x;u+=m*m;L+=q*q});return 1-u/L}function bb(J,H,G){let x=0,y=0,u=0,L=0,m=0;pa(J,H,G,(X, +Ba)=>{++m;x+=(X-x)/m;y+=(Ba-y)/m;u+=(X*Ba-u)/m;L+=(X*X-L)/m});const q=p(x,y,u,L),S=X=>q[0]+q[1]*X;return{coef:q,predict:S,rSquared:qa(J,H,G,y,S)}}function na(J,H,G){const [x,y,u,L]=E(J,H,G);var m=x.length,q=0;let S=0;var X=0;let Ba=0,Ja=0,eb,wb,aa,Na;for(eb=0;eb {ec-=u;return Wa*ec*ec+nb*ec+bc+L};return{coef:[bc-nb* +u+Wa*u*u+L,nb-2*Wa*u,Wa],predict:q,rSquared:qa(J,H,G,L,q)}}function ja(J,H,G,x){const y=Array(J);let u,L,m;for(u=0;u Math.abs(J[x][L])&&(L=y);for(u=x;u =x;u--)J[u][y]-=J[u][x]*J[x][y]/J[x][x]}for(y= +H-1;0<=y;--y){m=0;for(u=y+1;u H;)Ja*=G;S=0;for(X=y.length;S =m&&Ba/q<=H&&(Ja=q)}q=Math.log(Ja);H=Math.pow(G,-(0<=q?0:~~(-q/x)+1)-1);if(J.nice||void 0===J.nice)q=Math.floor(u/Ja+H)*Ja,u=u Ja);const y=J.length,u=new Float64Array(y);let L=0,m=1,q=x(J[0]),S=q,X=q+H,Ba;for(;m=X){for(S=(q+S)/2;L =G&&L =x?1:(L-G+1)/y},icdf(L){return 0<=L&&1>=L?G-1+Math.floor(L*y):NaN}};return u.min(J).max(H)};c.randomKDE=function(J,H){const G=ea(); +let x=0;const y={data(u){return arguments.length?(x=(J=u)?u.length:0,y.bandwidth(H)):J},bandwidth(u){if(!arguments.length)return H;H=u;!H&&J&&(H=sb(J));return y},sample(){return J[~~(c.random()*x)]+H*G.sample()},pdf(u){let L=0,m=0;for(;m Ha(G,x),pdf:u=>ua(u,G,x),cdf:u=>xa(u,G,x),icdf:u=>da(u,G,x)};return y.mean(J).stdev(H)};c.randomMixture=function(J,H){let G=0,x;const y={weights(u){if(arguments.length){var L=H=u||[];const m=[];let q=0,S;for(S=0;S Oa(G,x),pdf:u=>Ma(u,G,x),cdf:u=>mb(u,G,x),icdf:u=>M(u,G,x)};null==H&&(H=null==J?1:J,J=0);return y.min(J).max(H)};c.regressionConstant=F;c.regressionExp=function(J,H,G){const [x,,y,u]=E(J,H,G);let L=0,m=0,q=0,S=0,X=0,Ba,Ja,eb;pa(J,H,G,(Wa,nb)=>{Ba=x[X++];Ja=Math.log(nb);eb=Ba*nb;L+=(nb*Ja-L)/X;m+=(eb-m)/X;q+=(eb*Ja-q)/X;S+=(Ba*eb-S)/X});const [wb,aa]=p(m/u,L/u,q/u,S/u),Na=Wa=>Math.exp(wb+aa*(Wa-y));return{coef:[Math.exp(wb-aa*y),aa],predict:Na,rSquared:qa(J,H,G,u,Na)}}; +c.regressionLinear=bb;c.regressionLoess=function(J,H,G,x){const [y,u,L,m]=E(J,H,G,!0);J=y.length;H=Math.max(2,~~(x*J));x=new Float64Array(J);G=new Float64Array(J);var q=(new Float64Array(J)).fill(1);for(var S=-1;2>=++S;){var X=[0,H-1];for(let nb=0;nb y[eb]-Ba?Ja:eb]-Ba||1);for(;Ja<=eb;++Ja){const uc=y[Ja],Zc=u[Ja];var Wa=Math.abs(Ba-uc)*Kb;const Qa=(Wa=1-Wa*Wa*Wa)*Wa*Wa*q[Ja];Wa=uc*Qa;wb+=Qa;aa+=Wa;Na+= +Zc*Qa;bc+=Zc*Wa;ec+=uc*Wa}const [kc,Nb]=p(aa/wb,Na/wb,bc/wb,ec/wb);x[nb]=kc+Nb*Ba;G[nb]=Math.abs(u[nb]-x[nb]);Ba=y;eb=nb+1;wb=Ba[eb];aa=X[0];Na=X[1]+1;if(!(Na>=Ba.length))for(;eb>aa&&Ba[Na]-wb<=wb-Ba[aa];)X[0]=++aa,X[1]=Na,++Na}if(2===S)break;X=yb(G,.5,void 0);if(1E-12>Math.abs(X))break;for(let nb=0,bc,ec;nb {++m;X=Math.log(X);x+=(X-x)/m;y+=(Ba-y)/m;u+=(X*Ba-u)/m;L+=(X*X-L)/m});const q=p(x,y,u,L),S=X=>q[0]+q[1]*Math.log(X);return{coef:q,predict:S,rSquared:qa(J,H,G,y,S)}};c.regressionPoly=function(J,H,G,x){if(0===x)return F(J,H,G);if(1===x)return bb(J,H,G);if(2===x)return na(J,H,G);const [y,u,L,m]=E(J,H,G);var q=y.length;const S=[],X=[],Ba=x+1;let Ja,eb,wb,aa;for(Ja=0;Ja {Wa-=L;let nb=m+Na[0]+Na[1]*Wa+Na[2]*Wa*Wa;for(Ja=3;Ja {Ba=Math.log(Ba);const eb=Math.log(Ja);++q;x+=(Ba-x)/q;y+=(eb-y)/q;u+=(Ba*eb-u)/q;L+=(Ba*Ba-L)/q;m+=(Ja-m)/q});const S=p(x,y,u,L),X=Ba=>S[0]*Math.pow(Ba, +S[1]);S[0]=Math.exp(S[0]);return{coef:S,predict:X,rSquared:qa(J,H,G,m,X)}};c.regressionQuad=na;c.sampleCurve=function(J,H,G,x){G=G||25;x=Math.max(G,x||200);var y=H[0],u=H[1],L=u-y,m=L/x;H=[[y,J(y)]];var q=[];if(G===x){for(var S=1;S u&&(u=Ba)}for(x= +1/(u-x);y;)u=(G[0]+y[0])/2,u=[u,J(u)],u[0]-G[0]>=m&&Math.abs(Math.atan2(x*(y[1]-G[1]),L*(y[0]-G[0]))-Math.atan2(x*(u[1]-G[1]),L*(u[0]-G[0])))>ta?q.push(u):(G=y,H.push(y),q.pop()),y=q[q.length-1];return H};c.sampleLogNormal=Ha;c.sampleNormal=hb;c.sampleUniform=Oa;c.setRandom=function(J){c.random=J}})}; +shadow$provide[55]=function(Z,ia,Ea,C){(function(c,e){"object"===typeof C&&"undefined"!==typeof Ea?e(C,ia(45),ia(53),ia(54),ia(47)):"function"===typeof define&&define.amd?define(["exports","vega-util","vega-dataflow","vega-statistics","vega-time"],e):(c="undefined"!==typeof globalThis?globalThis:c||self,e(c.vega={},c.vega,c.vega,c.vega,c.vega))})(this,function(c,e,r,O,V){function ma(D){return ba=>{const Ta=D.length;let lb=1,Ib=String(D[0](ba));for(;lb e.extend({name:D,aggregate_param:lb,out:Ta||D},Ub,ba)}function db(D,ba){return D.idx-ba.idx}function Pa(D){const ba={};D.forEach(lb=>ba[lb.name]=lb);const Ta=lb=>{lb.req&&lb.req.forEach(Ib=>{ba[Ib]||Ta(ba[Ib]=Dc[Ib]())})};D.forEach(Ta);return Object.values(ba).sort(db)}function ib(){this.missing=this.valid=0;this._ops.forEach(D=>null==D.aggregate_param?D.init(this):D.init(this,D.aggregate_param))}function yb(D, +ba){null==D||""===D?++this.missing:D===D&&(++this.valid,this._ops.forEach(Ta=>Ta.add(this,D,ba)))}function za(D,ba){null==D||""===D?--this.missing:D===D&&(--this.valid,this._ops.forEach(Ta=>Ta.rem(this,D,ba)))}function ab(D){this._out.forEach(ba=>D[ba.out]=ba.value(this));return D}function ub(D,ba){function Ta(Wb){this._ops=lb;this._out=Ib;this.cell=Wb;this.init()}ba=ba||e.identity;const lb=Pa(D),Ib=D.slice().sort(db);Ta.prototype.init=ib;Ta.prototype.add=yb;Ta.prototype.rem=za;Ta.prototype.set=ab; +Ta.prototype.get=ba;Ta.fields=D.map(Wb=>Wb.out);return Ta}function sb(D){this._key=D?e.field(D):r.tupleid;this.reset()}function Bb(D){r.Transform.call(this,null,D);this._adds=[];this._mods=[];this._mlen=this._alen=0;this._drop=!0;this._cross=!1;this._dims=[];this._dnames=[];this._measures=[];this._countOnly=!1;this._outputs=this._inputs=this._prev=this._counts=null}function hb(D){r.Transform.call(this,null,D)}function $a(D,ba,Ta){let lb=ba||[],Ib=Ta||[],Wb={},mc=0;return{add:gc=>Ib.push(gc),remove:gc=> +Wb[D(gc)]=++mc,size:()=>lb.length,data:(gc,tc)=>{mc&&(lb=lb.filter(Oc=>!Wb[D(Oc)]),Wb={},mc=0);tc&&gc&&lb.sort(gc);Ib.length&&(lb=gc?e.merge(gc,lb,Ib.sort(gc)):lb.concat(Ib),Ib=[]);return lb}}}function zb(D){r.Transform.call(this,[],D)}function ka(D){r.Operator.call(this,null,ea,D)}function ea(D){return this.value&&!D.modified()?this.value:e.compare(D.fields,D.orders)}function Ha(D){r.Transform.call(this,null,D)}function ua(D){r.Transform.call(this,null,D)}function xa(D,ba){var Ta=D["function"];e.hasOwnProperty(vd, +Ta)||e.error("Unknown distribution function: "+Ta);Ta=vd[Ta]();for(const lb in D)if("field"===lb)Ta.data((D.from||ba()).map(D[lb]));else if("distributions"===lb)Ta[lb](D[lb].map(Ib=>xa(Ib,ba)));else if("function"===typeof Ta[lb])Ta[lb](D[lb]);return Ta}function da(D){r.Transform.call(this,null,D)}function Oa(D){return()=>D.materialize(D.SOURCE).source}function Ma(D,ba){return D?D.map((Ta,lb)=>ba[lb]||e.accessorName(Ta)):null}function mb(D,ba,Ta){const lb=[],Ib=cd=>cd(tc);let Wb,mc,gc,tc,Oc,Fc;if(null== +ba)lb.push(D.map(Ta));else for(Wb={},mc=0,gc=D.length;mc ba(Ta,D),e.accessorFields(ba),e.accessorName(ba))}function E(D){r.Transform.call(this,[void 0,void 0],D)}function pa(D,ba){r.Operator.call(this, +D);this.parent=ba;this.count=0}function qa(D){r.Transform.call(this,{},D);this._keys=e.fastmap();const ba=this._targets=[];ba.active=0;ba.forEach=Ta=>{for(let lb=0,Ib=ba.active;lb e.field(ba)):e.field(D.name,D.as)}function ja(D){r.Transform.call(this,e.fastmap(),D)}function va(D){r.Transform.call(this,[],D)}function fb(D){r.Transform.call(this, +[],D)}function Za(D){r.Transform.call(this,null,D)}function ca(D){r.Transform.call(this,[],D)}function ta(D,ba){return null==D||null==ba?NaN:D ba?1:D>=ba?0:NaN}function J(D,ba){return null==D||null==ba?NaN:ba D?1:ba>=D?0:NaN}function H(D){function ba(Wb,mc,gc=0,tc=Wb.length){if(gc >>1;0>lb(Wb[Oc],mc)?gc=Oc+1:tc=Oc}while(gc ta(D(Wb),mc),Ib=(Wb,mc)=>D(Wb)-mc):(Ta=D===ta||D===J? +D:G,Ib=lb=D);return{left:ba,center:function(Wb,mc,gc=0,tc=Wb.length){tc=ba(Wb,mc,gc,tc-1);return tc>gc&&Ib(Wb[tc-1],mc)>-Ib(Wb[tc],mc)?tc-1:tc},right:function(Wb,mc,gc=0,tc=Wb.length){if(gc >>1;0>=lb(Wb[Oc],mc)?gc=Oc+1:tc=Oc}while(gc =Ta&&(yield Ta);else{Ta=-1;for(let lb of D)null!=(lb=ba(lb,++Ta,D))&&(lb=+lb)>=lb&&(yield lb)}}function y(D=ta){if(D=== +ta)return u;if("function"!==typeof D)throw new TypeError("compare is not a function");return(ba,Ta)=>{const lb=D(ba,Ta);return lb||0===lb?lb:(0===D(Ta,Ta))-(0===D(ba,ba))}}function u(D,ba){return(null==D||!(D>=D))-(null==ba||!(ba>=ba))||(D ba?1:0)}function L(D,ba){let Ta;if(void 0===ba)for(var lb of D)null!=lb&&(Ta =lb)&&(Ta=lb);else{lb=-1;for(let Ib of D)null!=(Ib=ba(Ib,++lb,D))&&(Ta
=Ib)&&(Ta=Ib)}return Ta}function m(D,ba){let Ta;if(void 0===ba)for(var lb of D)null!= +lb&&(Ta>lb||void 0===Ta&&lb>=lb)&&(Ta=lb);else{lb=-1;for(let Ib of D)null!=(Ib=ba(Ib,++lb,D))&&(Ta>Ib||void 0===Ta&&Ib>=Ib)&&(Ta=Ib)}return Ta}function q(D,ba,Ta=0,lb=Infinity,Ib){ba=Math.floor(ba);Ta=Math.floor(Math.max(0,Ta));lb=Math.floor(Math.min(D.length-1,lb));if(!(Ta<=ba&&ba<=lb))return D;for(Ib=void 0===Ib?u:y(Ib);lb>Ta;){if(600 mc-Wb/2?-1:1);q(D,ba,Math.max(Ta,Math.floor(ba-mc*tc/ +Wb+gc)),Math.min(lb,Math.floor(ba+(Wb-mc)*tc/Wb+gc)),Ib)}Wb=D[ba];mc=Ta;tc=lb;S(D,Ta,ba);for(0 Ib(D[mc],Wb);)++mc;for(;0 (Ib=arguments.length)?(ba=D,D=0,1):3>Ib?1:+Ta;for(var lb=-1,Ib=Math.max(0,Math.ceil((ba-D)/Ta))|0,Wb=Array(Ib);++lb Ta}return ad[ba]}}function eb(D){const ba=D.field;return Ta=>Ta?ba(Ta):NaN}function wb(D,ba,Ta,lb){var Ib=Rd=>Rd(cd),Wb=[];lb=lb?lb.slice():[];var mc={},gc={},tc,Oc;lb.forEach((Rd,Nd)=>mc[Rd]=Nd+1);var Fc=0;for(Oc=D.length;Fc lb&&(lb=Wb[1]);return[Ta,lb]} +function Zc(D){r.Operator.call(this,null,Qa,D)}function Qa(D){return this.value&&!D.modified()?this.value:D.values.reduce((ba,Ta)=>ba.concat(Ta),[])}function Jb(D){r.Transform.call(this,null,D)}function rb(D){Bb.call(this,D)}function Sb(D,ba){const Ta=D.field,lb=D.value,Ib=("count"===D.op?"__count__":D.op)||"sum",Wb=e.accessorFields(Ta).concat(e.accessorFields(lb)),mc=Xb(Ta,D.limit||0,ba);ba.changed()&&D.set("__pivot__",null,null,!0);return{key:D.key,groupby:D.groupby,ops:mc.map(()=>Ib),fields:mc.map(gc=> +Ob(gc,Ta,lb,Wb)),as:mc.map(gc=>gc+""),modified:D.modified.bind(D)}}function Ob(D,ba,Ta,lb){return e.accessor(Ib=>ba(Ib)===D?Ta(Ib):NaN,lb,D+"")}function Xb(D,ba,Ta){const lb={},Ib=[];Ta.visit(Ta.SOURCE,Wb=>{Wb=D(Wb);lb[Wb]||(lb[Wb]=1,Ib.push(Wb))});Ib.sort(e.ascending);return ba?Ib.slice(0,ba):Ib}function sc(D){qa.call(this,D)}function vc(D){r.Transform.call(this,null,D)}function Hc(D){r.Transform.call(this,null,D)}function fd(D){r.Transform.call(this,null,D)}function Xc(D){r.Transform.call(this, +null,D)}function Fa(D){r.Transform.call(this,[],D);this.count=0}function La(D){r.Transform.call(this,null,D)}function Hb(D){r.Transform.call(this,null,D);this.modified(!0)}function la(D){r.Transform.call(this,null,D)}function w(D){r.Transform.call(this,e.fastmap(),D)}function ra(D){r.Transform.call(this,null,D)}function Ua(D,ba,Ta,lb){const Ib=od[D](ba,Ta);return{init:Ib.init||e.zero,update:function(Wb,mc){mc[lb]=Ib.next(Wb)}}}function cb(D){function ba(pd){e.array(e.accessorFields(pd)).forEach(Rd=> +Oc[Rd]=1)}const Ta=e.array(D.ops),lb=e.array(D.fields),Ib=e.array(D.params),Wb=e.array(D.aggregate_params),mc=e.array(D.as),gc=this.outputs=[],tc=this.windows=[],Oc={},Fc={},cd=[],md=[];let ld=!0;ba(D.sort);Ta.forEach((pd,Rd)=>{const Nd=lb[Rd];var ee=Ib[Rd];const ye=Wb[Rd]||null,Ee=e.accessorName(Nd);Rd=mc[Rd]||pd+(Ee?"_"+Ee:"");ba(Nd);gc.push(Rd);e.hasOwnProperty(od,pd)?tc.push(Ua(pd,Nd,ee,Rd)):(null==Nd&&"count"!==pd&&e.error("Null aggregate field specified."),"count"===pd?cd.push(Rd):(ld=!1,ee= +Fc[Ee],ee||(ee=Fc[Ee]=[],ee.field=Nd,md.push(ee)),ee.push(Dc[pd](Rd,ye))))});if(cd.length||md.length)this.cell=Ya(md,cd,ld);this.inputs=Object.keys(Oc)}function Ya(D,ba,Ta){D=D.map(tc=>ub(tc,tc.field));const lb={num:0,agg:null,store:!1,count:ba};if(!Ta)for(var Ib=D.length,Wb=lb.agg=Array(Ib),mc=0;mc {},Ub={init:Qb,add:Qb,rem:Qb,idx:0},Dc={values:{init:D=>D.cell.store=!0,value:D=>D.cell.data.values(),idx:-1},count:{value:D=>D.cell.num},__count__:{value:D=>D.missing+D.valid},missing:{value:D=>D.missing},valid:{value:D=>D.valid},sum:{init:D=>D.sum=0,value:D=>D.valid?D.sum:void 0,add:(D,ba)=>D.sum+=+ba,rem:(D,ba)=>D.sum-=ba},product:{init:D=>D.product=1,value:D=>D.valid?D.product:void 0,add:(D,ba)=>D.product*=ba,rem:(D,ba)=>D.product/=ba},mean:{init:D=>D.mean=0,value:D=>D.valid?D.mean:void 0, +add:(D,ba)=>(D.mean_d=ba-D.mean,D.mean+=D.mean_d/D.valid),rem:(D,ba)=>(D.mean_d=ba-D.mean,D.mean-=D.valid?D.mean_d/D.valid:D.mean)},average:{value:D=>D.valid?D.mean:void 0,req:["mean"],idx:1},variance:{init:D=>D.dev=0,value:D=>1 D.dev+=D.mean_d*(ba-D.mean),rem:(D,ba)=>D.dev-=D.mean_d*(ba-D.mean),req:["mean"],idx:1},variancep:{value:D=>1 1 1 1 D.cell.data.distinct(D.get),req:["values"],idx:3},ci0:{value:D=>D.cell.data.ci0(D.get),req:["values"],idx:3},ci1:{value:D=>D.cell.data.ci1(D.get),req:["values"],idx:3},median:{value:D=>D.cell.data.q2(D.get),req:["values"],idx:3},q1:{value:D=>D.cell.data.q1(D.get),req:["values"],idx:3},q3:{value:D=> +D.cell.data.q3(D.get),req:["values"],idx:3},min:{init:D=>D.min=void 0,value:D=>D.min=Number.isNaN(D.min)?D.cell.data.min(D.get):D.min,add:(D,ba)=>{if(ba {ba<=D.min&&(D.min=NaN)},req:["values"],idx:4},max:{init:D=>D.max=void 0,value:D=>D.max=Number.isNaN(D.max)?D.cell.data.max(D.get):D.max,add:(D,ba)=>{if(ba>D.max||void 0===D.max)D.max=ba},rem:(D,ba)=>{ba>=D.max&&(D.max=NaN)},req:["values"],idx:4},argmin:{init:D=>D.argmin=void 0,value:D=>D.argmin||D.cell.data.argmin(D.get), +add:(D,ba,Ta)=>{ba {ba<=D.min&&(D.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:D=>D.argmax=void 0,value:D=>D.argmax||D.cell.data.argmax(D.get),add:(D,ba,Ta)=>{ba>D.max&&(D.argmax=Ta)},rem:(D,ba)=>{ba>=D.max&&(D.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(D,ba)=>{D.exp=0;D.exp_r=ba},value:D=>D.valid?D.exp*(1-D.exp_r)/(1-D.exp_r**D.valid):void 0,add:(D,ba)=>D.exp=D.exp_r*D.exp+ba,rem:(D,ba)=>D.exp=(D.exp-ba/D.exp_r**(D.valid-1))/D.exp_r}, +exponentialb:{value:D=>D.valid?D.exp*(1-D.exp_r):void 0,req:["exponential"],idx:1}},Kc=Object.keys(Dc).filter(D=>"__count__"!==D);[...Kc,"__count__"].forEach(D=>{Dc[D]=ya(D,Dc[D])});const Mc=sb.prototype;Mc.reset=function(){this._add=[];this._rem=[];this._q=this._get=this._ext=null};Mc.add=function(D){this._add.push(D)};Mc.rem=function(D){this._rem.push(D)};Mc.values=function(){this._get=null;if(0===this._rem.length)return this._add;const D=this._add;var ba=this._rem;const Ta=this._key,lb=D.length, +Ib=ba.length,Wb=Array(lb-Ib),mc={};let gc,tc;for(gc=0;gc Ta.add(Wb))):(Ta.value=Ta.value||Ta.init(D),ba.visit(ba.REM,Wb=>Ta.rem(Wb)),ba.visit(ba.ADD,Wb=>Ta.add(Wb)));lb.modifies(Ta._outputs); +Ta._drop=!1!==D.drop;D.cross&&1 this.clean());return Ta.changes(lb)},cross(){function D(gc){let tc,Oc,Fc,cd;for(tc in gc)for(Fc=gc[tc].tuple,Oc=0;Oc ({})),mc=Ib.length;D(Ta._prev); +D(lb);ba("",{},0)},init(D){function ba(ee){ee=e.array(e.accessorFields(ee));const ye=ee.length;let Ee=0,Ne;for(;Ee {const ye=e.accessorName(ee);ba(ee);lb.push(ye);return ye});this.cellkey=D.key?D.key:Ia(this._dims);this._countOnly=!0;this._counts=[];this._measures=[];const Wb=D.fields||[null],mc=D.ops||["count"],gc=D.aggregate_params||[null]; +D=D.as||[];const tc=Wb.length,Oc={};let Fc,cd,md,ld,pd,Rd,Nd;tc!==mc.length&&e.error("Unmatched number of fields and aggregate ops.");for(Nd=0;Nd ub(ee,ee.field));return Object.create(null)},cellkey:Ia(),cell(D,ba){let Ta=this.value[D];Ta?0===Ta.num&&this._drop&&Ta.stamp {const Fc=lb(Oc);Oc[gc]=Fc;Oc[tc]=null==Fc?null:Ib+Wb*(1+(Fc-Ib)/Wb)}:Oc=>Oc[gc]=lb(Oc));return ba.modifies(Ta?mc:gc)},_bins(D){if(this.value&&!D.modified())return this.value;const ba=D.field,Ta=O.bin(D),lb=Ta.step;let Ib=Ta.start,Wb=Ib+Math.ceil((Ta.stop-Ib)/lb)*lb;var mc; +null!=(mc=D.anchor)&&(mc-=Ib+lb*Math.floor((mc-Ib)/lb),Ib+=mc,Wb+=mc);mc=function(gc){gc=e.toNumber(ba(gc));return null==gc?null:gc Wb?Infinity:(gc=Math.max(Ib,Math.min(gc,Wb-lb)),Ib+lb*Math.floor(1E-14+(gc-Ib)/lb))};mc.start=Ib;mc.stop=Ta.stop;mc.step=lb;return this.value=e.accessor(mc,e.accessorFields(ba),D.name||"bin_"+e.accessorName(ba))}});zb.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};e.inherits(zb,r.Transform,{transform(D,ba){const Ta= +ba.fork(ba.ALL),lb=$a(r.tupleid,this.value,Ta.materialize(Ta.ADD).add),Ib=D.sort;D=ba.changed()||Ib&&(D.modified("sort")||ba.modified(Ib.fields));Ta.visit(Ta.REM,lb.remove);this.modified(D);this.value=Ta.source=lb.data(r.stableCompare(Ib),D);ba.source&&ba.source.root&&(this.value.root=ba.source.root);return Ta}});e.inherits(ka,r.Operator);Ha.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower", +"mixed"],"default":"mixed"},{name:"pattern",type:"string","default":'[\\w"]+'},{name:"stopwords",type:"string","default":""},{name:"as",type:"string",array:!0,length:2,"default":["text","count"]}]};e.inherits(Ha,r.Transform,{transform(D,ba){var Ta=Fc=>cd=>{cd=gc(cd);switch(D.case){case "upper":cd=cd.toUpperCase();break;case "lower":cd=cd.toLowerCase()}cd=cd.match(Wb)||[];for(var md,ld=0,pd=cd.length;ld Ib[Fc]=1+(Ib[Fc]||0));Ta=Ta(Fc=>--Ib[Fc]);lb?ba.visit(ba.SOURCE,Oc):(ba.visit(ba.ADD,Oc),ba.visit(ba.REM,Ta));return this._finish(ba,tc)},_parameterCheck(D,ba){let Ta=!1;if(D.modified("stopwords")||!this._stop)this._stop=new RegExp("^"+(D.stopwords||"")+"$","i"),Ta=!0;if(D.modified("pattern")||!this._match)this._match=new RegExp(D.pattern||"[\\w']+","g"),Ta=!0;if(D.modified("field")||ba.modified(D.field.fields))Ta=!0;Ta&&(this._counts={}); +return Ta},_finish(D,ba){const Ta=this._counts,lb=this._tuples||(this._tuples={}),Ib=ba[0],Wb=ba[1];D=D.fork(D.NO_SOURCE|D.NO_FIELDS);let mc,gc,tc;for(mc in Ta)gc=lb[mc],tc=Ta[mc]||0,!gc&&tc?(lb[mc]=gc=r.ingest({}),gc[Ib]=mc,gc[Wb]=tc,D.add.push(gc)):0===tc?(gc&&D.rem.push(gc),Ta[mc]=null,lb[mc]=null):gc[Wb]!==tc&&(gc[Wb]=tc,D.mod.push(gc));return D.modifies(ba)}});ua.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,"default":["a", +"b"]}]};e.inherits(ua,r.Transform,{transform(D,ba){const Ta=ba.fork(ba.NO_SOURCE),lb=D.as||["a","b"],Ib=lb[0],Wb=lb[1];var mc=!this.value||ba.changed(ba.ADD_REM)||D.modified("as")||D.modified("filter"),gc=this.value;if(mc){gc&&(Ta.rem=gc);ba=gc=ba.materialize(ba.SOURCE).source;D=D.filter||e.truthy;mc=[];gc={};for(var tc=ba.length,Oc=0,Fc,cd;Oc {const tc={};tc[mc[0]]=gc[0];tc[mc[1]]=gc[1];return r.ingest(tc)});this.value&&(Ta.rem=this.value);this.value=Ta.add=Ta.source=D}return Ta}});M.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean","default":!1}, +{name:"as",type:"string","default":"bin"}]};e.inherits(M,r.Transform,{transform(D,ba){if(this.value&&!D.modified()&&!ba.changed())return ba;var Ta=ba.materialize(ba.SOURCE).source;const lb=mb(ba.source,D.groupby,e.identity),Ib=D.smooth||!1,Wb=D.field;Ta=D.step||e.span(e.extent(Ta,Wb))/30;const mc=r.stableCompare((md,ld)=>Wb(md)-Wb(ld));D=D.as||"bin";const gc=lb.length;let tc=Infinity,Oc=-Infinity,Fc=0,cd;for(;Fc Oc&&(Oc=ld),md[++cd][D]=ld}this.value={start:tc,stop:Oc,step:Ta};return ba.reflow(!0).modifies(D)}});e.inherits(F,r.Operator);E.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};e.inherits(E,r.Transform,{transform(D,ba){var Ta=this.value;const lb=D.field;D=ba.changed()||ba.modified(lb.fields)||D.modified("field");let Ib=Ta[0],Wb=Ta[1];if(D||null==Ib)Ib=Infinity,Wb=-Infinity;ba.visit(D?ba.SOURCE:ba.ADD,mc=>{mc=e.toNumber(lb(mc));null!=mc&&(mc Wb&&(Wb=mc))});Number.isFinite(Ib)&&Number.isFinite(Wb)||((Ta=e.accessorName(lb))&&(Ta=` for field "${Ta}"`),ba.dataflow.warn(`Infinite extent${Ta}: [${Ib}, ${Wb}]`),Ib=Wb=void 0);this.value=[Ib,Wb]}});e.inherits(pa,r.Operator,{connect(D){this.detachSubflow=D.detachSubflow;this.targets().add(D);return D.source=this},add(D){this.count+=1;this.value.add.push(D)},rem(D){--this.count;this.value.rem.push(D)},mod(D){this.value.mod.push(D)},init(D){this.value.init(D,D.NO_SOURCE)},evaluate(){return this.value}}); +e.inherits(qa,r.Transform,{activate(D){this._targets[this._targets.active++]=D},subflow(D,ba,Ta,lb){const Ib=this.value;let Wb=e.hasOwnProperty(Ib,D)&&Ib[D],mc;Wb?Wb.value.stamp Ta&&0 this.subflow(tc,Ib,ba);this._group=D.group||{};this.initTargets();ba.visit(ba.REM,tc=>{const Oc=r.tupleid(tc),Fc=Wb.get(Oc);void 0!==Fc&&(Wb.delete(Oc),gc(Fc).rem(tc))}); +ba.visit(ba.ADD,tc=>{const Oc=lb(tc);Wb.set(r.tupleid(tc),Oc);gc(Oc).add(tc)});mc||ba.modified(lb.fields)?ba.visit(ba.MOD,tc=>{const Oc=r.tupleid(tc),Fc=Wb.get(Oc),cd=lb(tc);Fc===cd?gc(cd).mod(tc):(Wb.set(Oc,cd),gc(Fc).rem(tc),gc(cd).add(tc))}):ba.changed(ba.MOD)&&ba.visit(ba.MOD,tc=>{gc(Wb.get(r.tupleid(tc))).mod(tc)});mc&&ba.visit(ba.REFLOW,tc=>{const Oc=r.tupleid(tc),Fc=Wb.get(Oc),cd=lb(tc);Fc!==cd&&(Wb.set(Oc,cd),gc(Fc).rem(tc),gc(cd).add(tc))});ba.clean()?Ta.runAfter(()=>{this.clean();Wb.clean()}): +Wb.empty>Ta.cleanThreshold&&Ta.runAfter(Wb.clean);return ba}});e.inherits(bb,r.Operator);ja.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};e.inherits(ja,r.Transform,{transform(D,ba){function Ta(cd){const md=r.tupleid(cd),ld=Oc(cd,D),pd=Ib.get(md);ld&&pd?(Ib.delete(md),mc.push(cd)):ld||pd?Fc&&ld&&!pd&&tc.push(cd):(Ib.set(md,1),gc.push(cd))}const lb=ba.dataflow,Ib=this.value,Wb=ba.fork(),mc=Wb.add,gc=Wb.rem,tc=Wb.mod,Oc=D.expr;let Fc=!0;ba.visit(ba.REM, +cd=>{const md=r.tupleid(cd);Ib.has(md)?Ib.delete(md):gc.push(cd)});ba.visit(ba.ADD,cd=>{Oc(cd,D)?mc.push(cd):Ib.set(r.tupleid(cd),1)});ba.visit(ba.MOD,Ta);D.modified()&&(Fc=!1,ba.visit(ba.REFLOW,Ta));Ib.empty>lb.cleanThreshold&&lb.runAfter(Ib.clean);return Wb}});va.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};e.inherits(va,r.Transform,{transform(D,ba){const Ta=ba.fork(ba.NO_SOURCE), +lb=D.fields,Ib=Ma(lb,D.as||[]),Wb=D.index||null,mc=Ib.length;Ta.rem=this.value;ba.visit(ba.SOURCE,gc=>{const tc=lb.map(pd=>pd(gc)),Oc=tc.reduce((pd,Rd)=>Math.max(pd,Rd.length),0);let Fc=0,cd,md,ld;for(;Fc {for(let Oc=0,Fc;Oc mc[lb]=Ta(mc,D))}});e.inherits(ca,r.Transform,{transform(D,ba){ba=ba.fork(ba.ALL);const Ta=D.generator;let lb=this.value,Ib=D.size-lb.length, +Wb,mc;if(0 =Ta||2>ba)D=m(D);else if(1<=Ta)D=L(D);else{Ta*=ba-1;ba=Math.floor(Ta);var lb=L(q(D,ba).subarray(0,ba+1)); +D=m(D.subarray(ba+1));D=lb+(D-lb)*(Ta-ba)}else D=void 0;return D},mean:function(D,ba){let Ta=0,lb=0;if(void 0===ba)for(var Ib of D)null!=Ib&&(Ib=+Ib)>=Ib&&(++Ta,lb+=Ib);else{Ib=-1;for(let Wb of D)null!=(Wb=ba(Wb,++Ib,D))&&(Wb=+Wb)>=Wb&&(++Ta,lb+=Wb)}if(Ta)return lb/Ta},min:m,max:L},Dd=[];Ba.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method", +type:"enum","default":"value",values:["value","mean","median","max","min"]},{name:"value","default":0}]};e.inherits(Ba,r.Transform,{transform(D,ba){var Ta=ba.fork(ba.ALL),lb=Ja(D),Ib=eb(D),Wb=e.accessorName(D.field),mc=e.accessorName(D.key),gc=(D.groupby||[]).map(e.accessorName);D=wb(ba.source,D.groupby,D.key,D.keyvals);ba=[];var tc=this.value,Oc=D.domain.length,Fc,cd,md;var ld=0;for(cd=D.length;ld Ta.add(Wb))):(Ib=Ta.value=Ta.value||this.init(D),ba.visit(ba.REM,Wb=>Ta.rem(Wb)),ba.visit(ba.ADD,Wb=>Ta.add(Wb)));Ta.changes();ba.visit(ba.SOURCE,Wb=>{e.extend(Wb,Ib[Ta.cellkey(Wb)].tuple)});return ba.reflow(lb).modifies(this._outputs)},changes(){const D=this._adds,ba=this._mods;let Ta, +lb;Ta=0;for(lb=this._alen;Ta {const ld=O.randomKDE(md,Wb)[mc],pd=D.counts?md.length:1,Rd=Oc||e.extent(md);O.sampleCurve(ld,Rd,Fc,cd).forEach(Nd=>{const ee={};for(let ye=0;ye
{this._pending=e.array(lb.data);return Ib=>Ib.touch(this)})}:Ta.request(D.url,D.format).then(lb=>Kb(this,ba,e.array(lb.data)))}});kc.Definition= +{type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default","default":null}]};e.inherits(kc,r.Transform,{transform(D,ba){const Ta=D.fields,lb=D.index,Ib=D.values,Wb=null==D.default?null:D.default;var mc=D.modified();const gc=Ta.length;let tc=mc?ba.SOURCE:ba.ADD,Oc= +ba,Fc=D.as,cd;Ib?(cd=Ib.length,1 ba.modified(md.fields)),tc|=mc?ba.MOD:0);ba.visit(tc,D);return Oc.modifies(Fc)}});e.inherits(Nb,r.Operator);e.inherits(Zc,r.Operator);e.inherits(Jb,r.Transform,{transform(D,ba){this.modified(D.modified());this.value=D;return ba.fork(ba.NO_SOURCE|ba.NO_FIELDS)}});rb.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field", +required:!0},{name:"op",type:"enum",values:Kc,"default":"sum"},{name:"limit",type:"number","default":0},{name:"key",type:"field"}]};e.inherits(rb,Bb,{_transform:Bb.prototype.transform,transform(D,ba){return this._transform(Sb(D,ba),ba)}});e.inherits(sc,qa,{transform(D,ba){const Ta=D.subflow,lb=D.field,Ib=Wb=>this.subflow(r.tupleid(Wb),Ta,ba,Wb);(D.modified("field")||lb&&ba.modified(e.accessorFields(lb)))&&e.error("PreFacet does not support field modification.");this.initTargets();lb?(ba.visit(ba.MOD, +Wb=>{const mc=Ib(Wb);lb(Wb).forEach(gc=>mc.mod(gc))}),ba.visit(ba.ADD,Wb=>{const mc=Ib(Wb);lb(Wb).forEach(gc=>mc.add(r.ingest(gc)))}),ba.visit(ba.REM,Wb=>{const mc=Ib(Wb);lb(Wb).forEach(gc=>mc.rem(gc))})):(ba.visit(ba.MOD,Wb=>Ib(Wb).mod(Wb)),ba.visit(ba.ADD,Wb=>Ib(Wb).add(Wb)),ba.visit(ba.REM,Wb=>Ib(Wb).rem(Wb)));ba.clean()&&ba.runAfter(()=>this.clean());return ba}});vc.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string", +"null":!0,array:!0}]};e.inherits(vc,r.Transform,{transform(D,ba){const Ta=ba.fork(ba.NO_SOURCE),lb=D.fields,Ib=Ma(D.fields,D.as||[]),Wb=lb?(gc,tc)=>{for(let Oc=0,Fc=lb.length;Oc {gc=r.tupleid(gc);Ta.rem.push(mc[gc]);mc[gc]=null});ba.visit(ba.ADD,gc=>{const tc=Wb(gc,r.ingest({}));mc[r.tupleid(gc)]=tc;Ta.add.push(tc)});ba.visit(ba.MOD,gc=>{Ta.mod.push(Wb(gc,mc[r.tupleid(gc)]))}); +return Ta}});e.inherits(Hc,r.Transform,{transform(D,ba){this.value=D.value;return D.modified("value")?ba.fork(ba.NO_SOURCE|ba.NO_FIELDS):ba.StopPropagation}});fd.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number","default":.01},{name:"as",type:"string",array:!0,"default":["prob","value"]}]};e.inherits(fd,r.Transform,{transform(D,ba){const Ta= +ba.fork(ba.NO_SOURCE|ba.NO_FIELDS),lb=D.as||["prob","value"];if(this.value&&!D.modified()&&!ba.changed())return Ta.source=this.value,Ta;ba=ba.materialize(ba.SOURCE).source;ba=mb(ba,D.groupby,D.field);const Ib=(D.groupby||[]).map(e.accessorName),Wb=[],mc=D.step||.01,gc=D.probs||X(mc/2,1-1E-14,mc),tc=gc.length;ba.forEach(Oc=>{const Fc=O.quantiles(Oc,gc);for(let cd=0;cd {Ib=r.tupleid(Ib);Ta.rem.push(lb[Ib]);lb[Ib]=null}),ba.visit(ba.ADD,Ib=>{const Wb=r.derive(Ib);lb[r.tupleid(Ib)]=Wb;Ta.add.push(Wb)}),ba.visit(ba.MOD,Ib=>{const Wb=lb[r.tupleid(Ib)];for(const mc in Ib)Wb[mc]=Ib[mc],Ta.modifies(mc);Ta.mod.push(Wb)}));return Ta}}); +Fa.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number","default":1E3}]};e.inherits(Fa,r.Transform,{transform(D,ba){function Ta(Fc){let cd,md;gc.length =Oc&&(cd=gc[md],mc[r.tupleid(cd)]&&lb.rem.push(cd),gc[md]=Fc));++tc}const lb=ba.fork(ba.NO_SOURCE);var Ib=D.modified("size");const Wb=D.size,mc=this.value.reduce((Fc,cd)=>(Fc[r.tupleid(cd)]=1,Fc),{});let gc=this.value,tc=this.count,Oc=0;ba.rem.length&&(ba.visit(ba.REM,Fc=> +{const cd=r.tupleid(Fc);mc[cd]&&(mc[cd]=-1,lb.rem.push(Fc));--tc}),gc=gc.filter(Fc=>-1!==mc[r.tupleid(Fc)]));(ba.rem.length||Ib)&&gc.length {mc[r.tupleid(Fc)]||Ta(Fc)}),Oc=-1);if(Ib&&gc.length>Wb){D=gc.length-Wb;for(Ib=0;Ib {mc[r.tupleid(Fc)]&&lb.mod.push(Fc)});ba.add.length&&ba.visit(ba.ADD,Ta);if(ba.add.length||0>Oc)lb.add=gc.filter(Fc=>!mc[r.tupleid(Fc)]); +this.count=tc;this.value=lb.source=gc;return lb}});La.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number","default":1},{name:"as",type:"string","default":"data"}]};e.inherits(La,r.Transform,{transform(D,ba){if(!this.value||D.modified()){var Ta=ba.materialize().fork(ba.MOD),lb=D.as||"data";Ta.rem=this.value?ba.rem.concat(this.value):ba.rem;this.value=X(D.start,D.stop,D.step|| +1).map(Ib=>{const Wb={};Wb[lb]=Ib;return r.ingest(Wb)});Ta.add=ba.add.concat(this.value);return Ta}}});e.inherits(Hb,r.Transform,{transform(D,ba){this.value=ba.source;return ba.changed()?ba.fork(ba.NO_SOURCE|ba.NO_FIELDS):ba.StopPropagation}});const rd=["unit0","unit1"];la.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean","default":!0},{name:"units",type:"enum",values:V.TIME_UNITS,array:!0},{name:"step",type:"number", +"default":1},{name:"maxbins",type:"number","default":40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum","default":"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,"default":rd}]};e.inherits(la,r.Transform,{transform(D,ba){const Ta=D.field,lb=!1!==D.interval;var Ib="utc"===D.timezone;const Wb=this._floor(D,ba),mc=(Ib?V.utcInterval:V.timeInterval)(Wb.unit).offset;Ib=D.as||rd;const gc=Ib[0],tc=Ib[1],Oc=Wb.step;let Fc=Wb.start||Infinity,cd=Wb.stop||-Infinity, +md=ba.ADD;if(D.modified()||ba.changed(ba.REM)||ba.modified(e.accessorFields(Ta)))ba=ba.reflow(!0),md=ba.SOURCE,Fc=Infinity,cd=-Infinity;ba.visit(md,ld=>{var pd=Ta(ld);let Rd;null==pd?(ld[gc]=null,lb&&(ld[tc]=null)):(ld[gc]=pd=Rd=Wb(pd),lb&&(ld[tc]=Rd=mc(pd,Oc)),pd cd&&(cd=Rd))});Wb.start=Fc;Wb.stop=cd;return ba.modifies(lb?Ib:gc)},_floor(D,ba){var Ta="utc"===D.timezone;const {units:lb,step:Ib}=D.units?{units:D.units,step:D.step||1}:V.timeBin({extent:D.extent||e.extent(ba.materialize(ba.SOURCE).source, +D.field),maxbins:D.maxbins});D=V.timeUnits(lb);ba=this.value||{};Ta=(Ta?V.utcFloor:V.timeFloor)(D,Ib);Ta.unit=e.peek(D);Ta.units=D;Ta.step=Ib;Ta.start=ba.start;Ta.stop=ba.stop;return this.value=Ta}});e.inherits(w,r.Transform,{transform(D,ba){const Ta=ba.dataflow,lb=D.field,Ib=this.value,Wb=gc=>Ib.set(lb(gc),gc);let mc=!0;D.modified("field")||ba.modified(lb.fields)?(Ib.clear(),ba.visit(ba.SOURCE,Wb)):ba.changed()?(ba.visit(ba.REM,gc=>Ib.delete(lb(gc))),ba.visit(ba.ADD,Wb)):mc=!1;this.modified(mc); +Ib.empty>Ta.cleanThreshold&&Ta.runAfter(Ib.clean);return ba.fork()}});e.inherits(ra,r.Transform,{transform(D,ba){if(!this.value||D.modified("field")||D.modified("sort")||ba.changed()||D.sort&&ba.modified(D.sort.fields))this.value=(D.sort?ba.source.slice().sort(r.stableCompare(D.sort)):ba.source).map(D.field)}});const od={row_number:function(){return{next:D=>D.index+1}},rank:function(){let D;return{init:()=>D=1,next:ba=>{const Ta=ba.index,lb=ba.data;return Ta&&ba.compare(lb[Ta-1],lb[Ta])?D=Ta+1:D}}}, +dense_rank:function(){let D;return{init:()=>D=1,next:ba=>{const Ta=ba.index,lb=ba.data;return Ta&&ba.compare(lb[Ta-1],lb[Ta])?++D:D}}},percent_rank:function(){const D=od.rank(),ba=D.next;return{init:D.init,next:Ta=>(ba(Ta)-1)/(Ta.data.length-1)}},cume_dist:function(){let D;return{init:()=>D=0,next:ba=>{const Ta=ba.data,lb=ba.compare;ba=ba.index;if(D Math.ceil(ba*Ta(lb))}},lag:function(D,ba){ba=+ba||1;return{next:Ta=>{const lb=Ta.index-ba;return 0<=lb?D(Ta.data[lb]):null}}},lead:function(D,ba){ba=+ba||1;return{next:Ta=>{const lb=Ta.index+ba;Ta=Ta.data;return lb D(ba.data[ba.i0])}},last_value:function(D){return{next:ba=>D(ba.data[ba.i1-1])}},nth_value:function(D,ba){ba=+ba;0 {const lb=Ta.i0+(ba-1);return lb ba=null,next:Ta=>{Ta=D(Ta.data[Ta.index]);return null!=Ta?ba=Ta:ba}}},next_value:function(D){let ba,Ta;return{init:()=>(ba=null,Ta=-1),next:lb=>{var Ib=lb.data;if(lb.index<=Ta)Ib=ba;else{a:{lb=lb.index;for(let Wb=Ib.length;lb (Ta=lb)?(Ta=Ib.length,ba=null):ba=D(Ib[Ta])}return Ib}}}},pe=Object.keys(od),Ac=cb.prototype;Ac.init=function(){this.windows.forEach(D=> +D.init());this.cell&&this.cell.init()};Ac.update=function(D,ba){const Ta=this.cell,lb=this.windows,Ib=D.data,Wb=lb&&lb.length;let mc;if(Ta){for(mc=D.p0;mc this.group(Ib(gc));let mc=this.state;if(!mc||Ta)mc=this.state=new cb(D);Ta||ba.modified(mc.inputs)? +(this.value={},ba.visit(ba.SOURCE,gc=>Wb(gc).add(gc))):(ba.visit(ba.REM,gc=>Wb(gc).remove(gc)),ba.visit(ba.ADD,gc=>Wb(gc).add(gc)));for(let gc=0,tc=this._mlen;gc "undefined"!==typeof Image?Image:null})}; +shadow$provide[57]=function(Z,ia,Ea,C){(function(c,e){"object"===typeof C&&"undefined"!==typeof Ea?e(C,ia(45),ia(47)):"function"===typeof define&&define.amd?define(["exports","vega-util","vega-time"],e):(c="undefined"!==typeof globalThis?globalThis:c||self,e(c.vega={},c.vega,c.vega))})(this,function(c,e,r){function O(n,N,U){N=n-N+2*U;return n?0 =Ga&&U[dc]<=N&&(0>xb&&(xb=dc),Db=dc);if(!(0>xb))return Ga=n.invertExtent(U[xb]),N=n.invertExtent(U[Db]),[void 0===Ga[0]?Ga[1]:Ga[0],void 0===N[1]?N[0]:N[1]]}}function Ia(n,N){return null==n||null==N?NaN:n N?1:n>=N?0:NaN}function ya(n,N){return null==n||null==N?NaN:N n?1:N>=n?0:NaN}function db(n){function N(Db,Pb,dc=0,Bc=Db.length){if(dc >>1;0>Ga(Db[id],Pb)?dc=id+1:Bc=id}while(dc Ia(n(Db),Pb),xb=(Db,Pb)=>n(Db)-Pb):(U=n===Ia||n===ya?n:Pa,xb=Ga=n);return{left:N,center:function(Db,Pb,dc=0,Bc=Db.length){Bc=N(Db,Pb,dc,Bc-1);return Bc>dc&&xb(Db[Bc-1],Pb)>-xb(Db[Bc],Pb)?Bc-1:Bc},right:function(Db,Pb,dc=0,Bc=Db.length){if(dc >>1;0>=Ga(Db[id],Pb)?dc=id+1:Bc=id}while(dc =oh?10:Ga>=ph?5:Ga>=Ah?2:1;let Db;0>xb?(Db=Math.pow(10,-xb)/Ga,xb=Math.round(n*Db), +Ga=Math.round(N*Db),xb/Db N&&--Ga,Db=-Db):(Db=Math.pow(10,xb)*Ga,xb=Math.round(n/Db),Ga=Math.round(N/Db),xb*Db N&&--Ga);return Ga U?sb(n,N,2*U):[xb,Ga,Db]}function Bb(n,N,U){N=+N;n=+n;U=+U;if(!(0=xb))return[];n=Db-xb+1;N=Array(n);if(Ga)if(0>Pb)for(Ga=0;Ga Pb)for(Ga=0;Ga n?1/-n:n)}function zb(n,N,U=ib){if((Ga=n.length)&&!isNaN(N=+N)){if(0>=N||2>Ga)return+U(n[0],0,n);if(1<=N)return+U(n[Ga-1],Ga-1,n);var Ga;N*=Ga-1;Ga=Math.floor(N);var xb=+U(n[Ga],Ga,n);n=+U(n[Ga+1],Ga+1,n);return xb+(n-xb)*(N-Ga)}}function ka(n,N,U){n=+n;N=+N;U=2>(xb=arguments.length)?(N=n,n=0,1):3>xb?1:+U;for(var Ga= +-1,xb=Math.max(0,Math.ceil((N-n)/U))|0,Db=Array(xb);++Ga >8&15|N>>4&240,N>>4&15|N&240,(N&15)<<4|N&15,1):8===U?p(N>>24&255,N>>16&255,N>>8&255,(N&255)/255):4===U?p(N>>12&15|N>>8&240,N>>8&15|N>>4&240,N>>4&15|N&240,((N&15)<<4|N&15)/255):null):(N=qg.exec(n))?new qa(N[1], +N[2],N[3],1):(N=ah.exec(n))?new qa(255*N[1]/100,255*N[2]/100,255*N[3]/100,1):(N=hh.exec(n))?p(N[1],N[2],N[3],N[4]):(N=Qh.exec(n))?p(255*N[1]/100,255*N[2]/100,255*N[3]/100,N[4]):(N=tg.exec(n))?Za(N[1],N[2]/100,N[3]/100,1):(N=bh.exec(n))?Za(N[1],N[2]/100,N[3]/100,N[4]):rh.hasOwnProperty(n)?F(rh[n]):"transparent"===n?new qa(NaN,NaN,NaN,0):null}function F(n){return new qa(n>>16&255,n>>8&255,n&255,1)}function p(n,N,U,Ga){0>=Ga&&(n=N=U=NaN);return new qa(n,N,U,Ga)}function E(n){n instanceof Oa||(n=M(n)); +if(!n)return new qa;n=n.rgb();return new qa(n.r,n.g,n.b,n.opacity)}function pa(n,N,U,Ga){return 1===arguments.length?E(n):new qa(n,N,U,null==Ga?1:Ga)}function qa(n,N,U,Ga){this.r=+n;this.g=+N;this.b=+U;this.opacity=+Ga}function bb(){return`#${fb(this.r)}${fb(this.g)}${fb(this.b)}`}function na(){const n=ja(this.opacity);return`${1===n?"rgb(":"rgba("}${va(this.r)}, ${va(this.g)}, ${va(this.b)}${1===n?")":`, ${n})`}`}function ja(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function va(n){return Math.max(0, +Math.min(255,Math.round(n)||0))}function fb(n){n=va(n);return(16>n?"0":"")+n.toString(16)}function Za(n,N,U,Ga){0>=Ga?n=N=U=NaN:0>=U||1<=U?n=N=NaN:0>=N&&(n=NaN);return new J(n,N,U,Ga)}function ca(n){if(n instanceof J)return new J(n.h,n.s,n.l,n.opacity);n instanceof Oa||(n=M(n));if(!n)return new J;if(n instanceof J)return n;n=n.rgb();var N=n.r/255,U=n.g/255,Ga=n.b/255,xb=Math.min(N,U,Ga),Db=Math.max(N,U,Ga),Pb=NaN,dc=Db-xb,Bc=(Db+xb)/2;dc?(Pb=N===Db?(U-Ga)/dc+6*(U Bc?Db+xb:2-Db-xb,Pb*=60):dc=0 Bc?0:Pb;return new J(Pb,dc,Bc,n.opacity)}function ta(n,N,U,Ga){return 1===arguments.length?ca(n):new J(n,N,U,null==Ga?1:Ga)}function J(n,N,U,Ga){this.h=+n;this.s=+N;this.l=+U;this.opacity=+Ga}function H(n){n=(n||0)%360;return 0>n?n+360:n}function G(n){return Math.max(0,Math.min(1,n||0))}function x(n,N,U){return 255*(60>n?N+(U-N)*n/60:180>n?U:240>n?N+(U-N)*(240-n)/60:N)}function y(n){if(n instanceof L)return new L(n.l,n.a,n.b,n.opacity);if(n instanceof eb)return wb(n); +n instanceof qa||(n=E(n));var N=X(n.r),U=X(n.g),Ga=X(n.b),xb=m(.2225045*N+.7168786*U+.0606169*Ga);if(N===U&&U===Ga)var Db=N=xb;else Db=m((.4360747*N+.3850649*U+.1430804*Ga)/.96422),N=m((.0139322*N+.0971045*U+.7141733*Ga)/.82521);return new L(116*xb-16,500*(Db-xb),200*(xb-N),n.opacity)}function u(n,N,U,Ga){return 1===arguments.length?y(n):new L(n,N,U,null==Ga?1:Ga)}function L(n,N,U,Ga){this.l=+n;this.a=+N;this.b=+U;this.opacity=+Ga}function m(n){return n>Rh?Math.pow(n,1/3):n/Ch+bi}function q(n){return n> +Vf?n*n*n:Ch*(n-bi)}function S(n){return 255*(.0031308>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function X(n){return.04045>=(n/=255)?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Ba(n){if(n instanceof eb)return new eb(n.h,n.c,n.l,n.opacity);n instanceof L||(n=y(n));if(0===n.a&&0===n.b)return new eb(NaN,0 n.l?0:NaN,n.l,n.opacity);var N=Math.atan2(n.b,n.a)*Ii;return new eb(0>N?N+360:N,Math.sqrt(n.a*n.a+n.b*n.b),n.l,n.opacity)}function Ja(n,N,U,Ga){return 1===arguments.length?Ba(n):new eb(n, +N,U,null==Ga?1:Ga)}function eb(n,N,U,Ga){this.h=+n;this.c=+N;this.l=+U;this.opacity=+Ga}function wb(n){if(isNaN(n.h))return new L(n.l,0,0,n.opacity);var N=n.h*ih;return new L(n.l,Math.cos(N)*n.c,Math.sin(N)*n.c,n.opacity)}function aa(n,N,U,Ga){if(1===arguments.length){var xb=n;if(xb instanceof Na)xb=new Na(xb.h,xb.s,xb.l,xb.opacity);else{xb instanceof qa||(xb=E(xb));var Db=xb.g/255,Pb=xb.b/255,dc=(jh*Pb+xb.r/255*-1.7884503806-3.5172982438*Db)/(jh+-1.7884503806-3.5172982438);Pb-=dc;var Bc=(1.97294* +(Db-dc)- -.29227*Pb)/-.90649;Pb=(Db=Math.sqrt(Bc*Bc+Pb*Pb)/(1.97294*dc*(1-dc)))?Math.atan2(Bc,Pb)*Ii-120:NaN;xb=new Na(0>Pb?Pb+360:Pb,Db,dc,xb.opacity)}}else xb=new Na(n,N,U,null==Ga?1:Ga);return xb}function Na(n,N,U,Ga){this.h=+n;this.s=+N;this.l=+U;this.opacity=+Ga}function Wa(n,N,U,Ga,xb){var Db=n*n,Pb=Db*n;return((1-3*n+3*Db-Pb)*N+(4-6*Db+3*Pb)*U+(1+3*n+3*Db-3*Pb)*Ga+Pb*xb)/6}function nb(n){var N=n.length-1;return function(U){var Ga=0>=U?U=0:1<=U?(U=1,N-1):Math.floor(U*N),xb=n[Ga],Db=n[Ga+1]; +return Wa((U-Ga/N)*N,0 (U%=1)?++U:U)*N);return Wa((U-Ga/N)*N,n[(Ga+N-1)%N],n[Ga%N],n[(Ga+1)%N],n[(Ga+2)%N])}}function ec(n,N){return function(U){return n+U*N}}function Kb(n,N,U){return n=Math.pow(n,U),N=Math.pow(N,U)-n,U=1/U,function(Ga){return Math.pow(n+Ga*N,U)}}function kc(n,N){var U=N-n;return U?ec(n,180U?U-360*Math.round(U/360):U):Dh(isNaN(n)?N:n)}function Nb(n){return 1=== +(n=+n)?uc:function(N,U){return U-N?Kb(N,U,n):Dh(isNaN(N)?U:N)}}function uc(n,N){var U=N-n;return U?ec(n,U):Dh(isNaN(n)?N:n)}function Zc(n){return function(N){var U=N.length,Ga=Array(U),xb=Array(U),Db=Array(U),Pb;for(Pb=0;PbU&&(Db=N.slice(U,Db),dc[Pb]?dc[Pb]+= +Db:dc[++Pb]=Db),(Ga=Ga[0])===(xb=xb[0])?dc[Pb]?dc[Pb]+=xb:dc[++Pb]=xb:(dc[++Pb]=null,Bc.push({i:Pb,x:Ob(Ga,xb)})),U=Og.lastIndex;U dc.length?Bc[0]?vc(Bc[0].x):sc(N):(N=Bc.length,function(id){for(var kd=0,Ec;kd Ga?0:Ga);U N){var U=n;n=N;N=U}return function(Ga){return Math.max(n,Math.min(N,Ga))}}function Ub(n,N,U){var Ga=n[0];n=n[1];var xb=N[0];N=N[1];n (N=(n=N?n.toExponential(N-1):n.toExponential()).indexOf("e")))return null;var U=n.slice(0,N);return[1 Ga&&(dc=Math.max(1,Ga-Bc));Db.push(U.substring(xb-=dc,xb+dc));if((Bc+=dc+1)>Ga)break;dc=n[Pb=(Pb+1)%n.length]}return Db.reverse().join(N)}} +function Dd(n){return function(N){return N.replace(/[0-9]/g,function(U){return n[+U]})}}function rd(n){if(!(N=Ra.exec(n)))throw Error("invalid format: "+n);var N;return new od({fill:N[1],align:N[2],sign:N[3],symbol:N[4],zero:N[5],width:N[6],comma:N[7],precision:N[8]&&N[8].slice(1),trim:N[9],type:N[10]})}function od(n){this.fill=void 0===n.fill?" ":n.fill+"";this.align=void 0===n.align?"\x3e":n.align+"";this.sign=void 0===n.sign?"-":n.sign+"";this.symbol=void 0===n.symbol?"":n.symbol+"";this.zero= +!!n.zero;this.width=void 0===n.width?void 0:+n.width;this.comma=!!n.comma;this.precision=void 0===n.precision?void 0:+n.precision;this.trim=!!n.trim;this.type=void 0===n.type?"":n.type+""}function pe(n,N){N=vd(n,N);if(!N)return n+"";n=N[0];N=N[1];return 0>N?"0."+Array(-N).join("0")+n:n.length>N+1?n.slice(0,N+1)+"."+n.slice(N+1):n+Array(N-n.length+2).join("0")}function Ac(n){return n}function D(n){function N(kd){function Ec(Ed){var ie=Be,Hd=Af,se,xf;if("c"===Kf)Hd=ci(Ed)+Hd,Ed="";else{Ed=+Ed;var Bf= +0>Ed||0>1/Ed;Ed=isNaN(Ed)?id:ci(Math.abs(Ed),Wf);if(Jg){var lg=Ed.length,ch=1,Mh=-1;a:for(;ch xf||57 >1)+ie+Ed+Hd+Bf.slice(xf);break;default:Ed=Bf+ie+Ed+Hd}return Pb(Ed)}kd=rd(kd);var zd=kd.fill,Vd=kd.align,xe=kd.sign,Td=kd.symbol,Ue=kd.zero,Lf=kd.width,Gf=kd.comma,Wf=kd.precision,Jg=kd.trim, +Kf=kd.type;"n"===Kf?(Gf=!0,Kf="g"):Zb[Kf]||(void 0===Wf&&(Wf=12),Jg=!0,Kf="g");if(Ue||"0"===zd&&"\x3d"===Vd)Ue=!0,zd="0",Vd="\x3d";var Be="$"===Td?Ga:"#"===Td&&/[boxX]/.test(Kf)?"0"+Kf.toLowerCase():"",Af="$"===Td?xb:/[%p]/.test(Kf)?dc:"",ci=Zb[Kf],ae=/[defgprs%]/.test(Kf);Wf=void 0===Wf?6:/[gprs]/.test(Kf)?Math.max(1,Math.min(21,Wf)):Math.max(0,Math.min(20,Wf));Ec.toString=function(){return kd+""};return Ec}var U=void 0===n.grouping||void 0===n.thousands?Ac:ad(cc.call(n.grouping,Number),n.thousands+ +""),Ga=void 0===n.currency?"":n.currency[0]+"",xb=void 0===n.currency?"":n.currency[1]+"",Db=void 0===n.decimal?".":n.decimal+"",Pb=void 0===n.numerals?Ac:Dd(cc.call(n.numerals,String)),dc=void 0===n.percent?"%":n.percent+"",Bc=void 0===n.minus?"−":n.minus+"",id=void 0===n.nan?"NaN":n.nan+"";return{format:N,formatPrefix:function(kd,Ec){var zd=N((kd=rd(kd),kd.type="f",kd));kd=3*Math.max(-8,Math.min(8,Math.floor(ud(Ec)/3)));var Vd=Math.pow(10,-kd),xe=oc[8+kd/3];return function(Td){return zd(Vd*Td)+ +xe}}}}function ba(n,N,U,Ga){U=$a(n,N,U);Ga=rd(null==Ga?",f":Ga);switch(Ga.type){case "s":n=Math.max(Math.abs(n),Math.abs(N));if(N=null==Ga.precision){var xb=isNaN;U=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ud(n)/3)))-ud(Math.abs(U)));N=!xb(xb=U)}N&&(Ga.precision=xb);return Ca(Ga,n);case "":case "e":case "g":case "p":case "r":var Db;if(Db=null==Ga.precision)xb=isNaN,n=Math.max(Math.abs(n),Math.abs(N)),U=Math.abs(U),n=Math.abs(n)-U,U=Math.max(0,ud(n)-ud(U))+1,Db=!xb(xb=U);Db&&(Ga.precision=xb- +("e"===Ga.type));break;case "f":case "%":null!=Ga.precision||isNaN(xb=Math.max(0,-ud(Math.abs(U))))||(Ga.precision=xb-2*("%"===Ga.type))}return P(Ga)}function Ta(n){var N=n.domain;n.ticks=function(U){var Ga=N();return Bb(Ga[0],Ga[Ga.length-1],null==U?10:U)};n.tickFormat=function(U,Ga){var xb=N();return ba(xb[0],xb[xb.length-1],null==U?10:U,Ga)};n.nice=function(U){null==U&&(U=10);var Ga=N(),xb=0,Db=Ga.length-1,Pb=Ga[xb],dc=Ga[Db],Bc=10;if(dc id)Pb=Math.ceil(Pb*id)/id,dc=Math.floor(dc*id)/id;else break;var kd=id}return n};return n}function lb(){var n=Mc()(pb,pb);n.copy=function(){return Kc(n,lb())};ea.apply(n,arguments);return Ta(n)}function Ib(n){function N(Ga){return null==Ga||isNaN(Ga=+Ga)?U:Ga}var U;N.invert=N;N.domain=N.range=function(Ga){return arguments.length?(n=Array.from(Ga,Ya),N):n.slice()};N.unknown=function(Ga){return arguments.length? +(U=Ga,N):U};N.copy=function(){return Ib(n).unknown(U)};n=arguments.length?Array.from(n,Ya):[0,1];return Ta(N)}function Wb(n,N){n=n.slice();var U=0,Ga=n.length-1,xb=n[U],Db=n[Ga];if(Db n?0:n}function cd(n){return 10===n?Fc:n===Math.E? +Math.exp:N=>Math.pow(n,N)}function md(n){return n===Math.E?Math.log:10===n&&Math.log10||2===n&&Math.log2||(n=Math.log(n),N=>Math.log(N)/n)}function ld(n){return(N,U)=>-n(-N,U)}function pd(n){function N(){Db=md(xb);Pb=cd(xb);0>Ga()[0]?(Db=ld(Db),Pb=ld(Pb),n(tc,Oc)):n(mc,gc);return U}const U=n(mc,gc),Ga=U.domain;let xb=10,Db,Pb;U.base=function(dc){return arguments.length?(xb=+dc,N()):xb};U.domain=function(dc){return arguments.length?(Ga(dc),N()):Ga()};U.ticks=dc=>{var Bc=Ga();let id=Bc[0];Bc=Bc[Bc.length- +1];const kd=Bc Ec?dc/Pb(-Ec):dc*Pb(Ec),!(Vd Bc)break;Td.push(Vd)}}else for(;Ec<=zd;++Ec)for(dc=xb-1;1<=dc;--dc)if(Vd=0 Bc)break;Td.push(Vd)}2*Td.length {null==dc&&(dc=10);null==Bc&&(Bc=10===xb?"s":",");"function"!==typeof Bc&&(xb%1||null!=(Bc=rd(Bc)).precision||(Bc.trim=!0),Bc=P(Bc));if(Infinity===dc)return Bc;const id=Math.max(1,xb*dc/U.ticks().length);return kd=>{let Ec=kd/Pb(Math.round(Db(kd)));Ec*xb Ga(Wb(Ga(),{floor:dc=>Pb(Math.floor(Db(dc))),ceil:dc=>Pb(Math.ceil(Db(dc)))}));return U}function Rd(){const n=pd(Mc()).domain([1,10]);n.copy=()=>Kc(n,Rd()).base(n.base());ea.apply(n,arguments); +return n}function Nd(n){return function(N){return Math.sign(N)*Math.log1p(Math.abs(N/n))}}function ee(n){return function(N){return Math.sign(N)*Math.expm1(Math.abs(N))*n}}function ye(n){var N=1,U=n(Nd(N),ee(N));U.constant=function(Ga){return arguments.length?n(Nd(N=+Ga),ee(N)):N};return Ta(U)}function Ee(){var n=ye(Mc());n.copy=function(){return Kc(n,Ee()).constant(n.constant())};return ea.apply(n,arguments)}function Ne(n){return function(N){return 0>N?-Math.pow(-N,n):Math.pow(N,n)}}function af(n){return 0> +n?-Math.sqrt(-n):Math.sqrt(n)}function Ff(n){return 0>n?-n*n:n*n}function sf(n){var N=n(pb,pb),U=1;N.exponent=function(Ga){return arguments.length?(U=+Ga,1===U?n(pb,pb):.5===U?n(af,Ff):n(Ne(U),Ne(1/U))):U};return Ta(N)}function lf(){var n=sf(Mc());n.copy=function(){return Kc(n,lf()).exponent(n.exponent())};ea.apply(n,arguments);return n}function gf(){function n(){var Pb=0,dc=Math.max(1,Ga.length);for(xb=Array(dc-1);++Pb Pb?[NaN,NaN]:[0 Bc?[NaN,NaN]:1>Bc?[U,Db[0]]:Bc>=xb? +[Db[xb-1],Ga]:[Db[Bc-1],Db[Bc]]};n.unknown=function(Bc){return arguments.length?(dc=Bc,n):n};n.thresholds=function(){return Db.slice()};n.copy=function(){return wf().domain([U,Ga]).range(Pb).unknown(dc)};return ea.apply(Ta(n),arguments)}function $e(){function n(Db){return null!=Db&&Db<=Db?U[Cg(N,Db,0,xb)]:Ga}var N=[.5],U=[0,1],Ga,xb=1;n.domain=function(Db){return arguments.length?(N=Array.from(Db),xb=Math.min(N.length,U.length-1),n):N.slice()};n.range=function(Db){return arguments.length?(U=Array.from(Db), +xb=Math.min(N.length,U.length-1),n):U.slice()};n.invertExtent=function(Db){Db=U.indexOf(Db);return[N[Db-1],N[Db]]};n.unknown=function(Db){return arguments.length?(Ga=Db,n):Ga};n.copy=function(){return $e().domain(N).range(U).unknown(Ga)};return ea.apply(n,arguments)}function De(n,N,U,Ga){function xb(Db){return n(Db=0===arguments.length?new Date:new Date(+Db)),Db}xb.floor=Db=>(n(Db=new Date(+Db)),Db);xb.ceil=Db=>(n(Db=new Date(Db-1)),N(Db,1),n(Db),Db);xb.round=Db=>{const Pb=xb(Db),dc=xb.ceil(Db);return Db- +Pb (N(Db=new Date(+Db),null==Pb?1:Math.floor(Pb)),Db);xb.range=(Db,Pb,dc)=>{const Bc=[];Db=xb.ceil(Db);dc=null==dc?1:Math.floor(dc);if(!(Db De(Pb=>{if(Pb>=Pb)for(;n(Pb),!Db(Pb);)Pb.setTime(Pb-1)},(Pb,dc)=>{if(Pb>=Pb)if(0>dc)for(;0>=++dc;)for(;N(Pb,-1),!Db(Pb););else for(;0<=--dc;)for(;N(Pb,1),!Db(Pb););});U&&(xb.count=(Db,Pb)=>{Sa.setTime(+Db);Cb.setTime(+Pb); +n(Sa);n(Cb);return Math.floor(U(Sa,Cb))},xb.every=Db=>{Db=Math.floor(Db);return isFinite(Db)&&0 0===Ga(Pb)%Db:Pb=>0===xb.count(0,Pb)%Db):xb:null});return xb}function qe(n){return De(N=>{N.setDate(N.getDate()-(N.getDay()+7-n)%7);N.setHours(0,0,0,0)},(N,U)=>{N.setDate(N.getDate()+7*U)},(N,U)=>(U-N-6E4*(U.getTimezoneOffset()-N.getTimezoneOffset()))/6048E5)}function oe(n){return De(N=>{N.setUTCDate(N.getUTCDate()-(N.getUTCDay()+7-n)%7);N.setUTCHours(0,0,0,0)},(N,U)=>{N.setUTCDate(N.getUTCDate()+ +7*U)},(N,U)=>(U-N)/6048E5)}function Se(n,N,U,Ga,xb,Db){function Pb(Bc,id,kd){const Ec=Math.abs(id-Bc)/kd,zd=db(([,,Td])=>Td).right(dc,Ec);if(zd===dc.length)return n.every($a(Bc/31536E6,id/31536E6,kd));if(0===zd)return fc.every(Math.max($a(Bc,id,kd),1));const [Vd,xe]=dc[Ec/dc[zd-1][2] n.y){var N=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);N.setFullYear(n.y);return N}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function qb(n){if(0<=n.y&&100>n.y){var N=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));N.setUTCFullYear(n.y);return N}return new Date(Date.UTC(n.y, +n.m,n.d,n.H,n.M,n.S,n.L))}function Ab(n,N,U){return{y:n,m:N,d:U,H:0,M:0,S:0,L:0}}function Vb(n){function N(ae,Ed){return function(ie){var Hd=[],se=-1,xf=0,Bf=ae.length,lg,ch;for(ie instanceof Date||(ie=new Date(+ie));++se