diff --git a/plugins/additionals/.github/workflows/linters.yml b/plugins/additionals/.github/workflows/linters.yml new file mode 100644 index 0000000..265dab6 --- /dev/null +++ b/plugins/additionals/.github/workflows/linters.yml @@ -0,0 +1,47 @@ +name: Run Linters +on: + push: + pull_request: + schedule: + - cron: '30 5 * * *' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + bundler-cache: true + + - name: Set Gemfile + run: | + echo "">> Gemfile + echo "group :test do">> Gemfile + echo " gem 'pandoc-ruby', require: false" >> Gemfile + echo " gem 'rubocop', require: false" >> Gemfile + echo " gem 'rubocop-performance', require: false" >> Gemfile + echo " gem 'rubocop-rails', require: false" >> Gemfile + echo " gem 'slim_lint', require: false" >> Gemfile + echo "end">> Gemfile + + - name: Setup gems + run: | + bundle install --jobs 4 --retry 3 + + - name: Run RuboCop + run: | + bundle exec rubocop -S + + - name: Run Slim-Lint + run: | + bundle exec slim-lint app/views + if: always() + + - name: Run Brakeman + run: | + bundle exec brakeman -5 diff --git a/plugins/additionals/.github/workflows/tests.yml b/plugins/additionals/.github/workflows/tests.yml new file mode 100644 index 0000000..a24e8a5 --- /dev/null +++ b/plugins/additionals/.github/workflows/tests.yml @@ -0,0 +1,124 @@ +name: Tests +on: + push: + pull_request: + schedule: + - cron: '0 5 * * *' + +jobs: + test: + name: ${{ matrix.redmine }} ${{ matrix.db }} ruby-${{ matrix.ruby }} + runs-on: ubuntu-latest + + strategy: + matrix: + ruby: ['2.6', '2.4'] + redmine: ['4.1-stable', 'master'] + db: ['postgres', 'mysql'] + fail-fast: false + + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: 'BestPasswordEver' + ports: + # will assign a random free host port + - 3306/tcp + options: >- + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + + steps: + - name: Verify MySQL connection from host + run: | + mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -pBestPasswordEver -e "SHOW DATABASES" + if: matrix.db == 'mysql' + + - name: Checkout Redmine + uses: actions/checkout@v2 + with: + repository: redmine/redmine + ref: ${{ matrix.redmine }} + path: redmine + + - name: Checkout additionals + uses: actions/checkout@v2 + with: + repository: AlphaNodes/additionals + path: redmine/plugins/additionals + + - name: Update package archives + run: sudo apt-get update --yes --quiet + + - name: Install package dependencies + run: > + sudo apt-get install --yes --quiet + build-essential + cmake + libicu-dev + libpq-dev + libmysqlclient-dev + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Prepare Redmine source + working-directory: redmine + run: | + sed -i '/rubocop/d' Gemfile + rm -f .rubocop* + cp plugins/additionals/test/support/database-${{ matrix.db }}.yml config/database.yml + cp plugins/additionals/test/support/configuration.yml config/configuration.yml + + - name: Install Ruby dependencies + working-directory: redmine + run: | + bundle install --jobs=4 --retry=3 --without development + + - name: Run Redmine rake tasks + env: + RAILS_ENV: test + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + working-directory: redmine + run: | + bundle exec rake generate_secret_token + bundle exec rake db:create db:migrate redmine:plugins:migrate + bundle exec rake db:test:prepare + + - name: Run tests + env: + RAILS_ENV: test + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + working-directory: redmine + run: bundle exec rake redmine:plugins:test NAME=additionals RUBYOPT="-W0" + + - name: Run uninstall test + env: + RAILS_ENV: test + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + working-directory: redmine + run: bundle exec rake redmine:plugins:migrate NAME=additionals VERSION=0 + + - name: Run build gem file + working-directory: redmine/plugins/additionals + run: gem build additionals.gemspec diff --git a/plugins/additionals/.gitignore b/plugins/additionals/.gitignore index a889413..2469bbe 100755 --- a/plugins/additionals/.gitignore +++ b/plugins/additionals/.gitignore @@ -1,8 +1,11 @@ .DS_Store .buildpath +*.gem coverage/ tmp/ +Gemfile.lock .project +.vscode .settings/ docs/_build docs/_static diff --git a/plugins/additionals/.rubocop.yml b/plugins/additionals/.rubocop.yml index 51b9c7e..5282b1c 100755 --- a/plugins/additionals/.rubocop.yml +++ b/plugins/additionals/.rubocop.yml @@ -70,3 +70,12 @@ Style/HashTransformKeys: Style/HashTransformValues: Enabled: false + +Naming/VariableNumber: + Enabled: true + Exclude: + - 'test/**/*' + +Style/StringConcatenation: + Exclude: + - 'app/views/additionals/_select2_ajax_call.*' diff --git a/plugins/additionals/.slim-lint.yml b/plugins/additionals/.slim-lint.yml index 54689e6..6579ae1 100755 --- a/plugins/additionals/.slim-lint.yml +++ b/plugins/additionals/.slim-lint.yml @@ -4,15 +4,10 @@ linters: RuboCop: ignored_cops: - Layout/ArgumentAlignment - - Layout/ArrayAlignment - Layout/BlockEndNewline - Layout/EmptyLineAfterGuardClause - Layout/HashAlignment - - Layout/IndentationConsistency - Layout/IndentationWidth - - Layout/IndentFirstArgument - - Layout/IndentFirstArrayElement - - Layout/IndentFirstHashElement - Layout/MultilineArrayBraceLayout - Layout/MultilineAssignmentLayout - Layout/MultilineBlockLayout @@ -21,19 +16,11 @@ linters: - Layout/MultilineMethodCallIndentation - Layout/MultilineMethodDefinitionBraceLayout - Layout/MultilineOperationIndentation - - Layout/TrailingBlankLines + - Layout/SpaceBeforeBrackets - Layout/TrailingEmptyLines - - Layout/TrailingWhitespace - - Lint/BlockAlignment - - Lint/EndAlignment - Lint/Void - - Metrics/BlockLength - Metrics/BlockNesting - - Metrics/LineLength - - Naming/FileName - Rails/OutputSafety - - Style/ConditionalAssignment - - Style/FrozenStringLiteralComment - Style/IdenticalConditionalBranches - Style/IfUnlessModifier - Style/Next diff --git a/plugins/additionals/.travis.yml b/plugins/additionals/.travis.yml deleted file mode 100755 index f826712..0000000 --- a/plugins/additionals/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: ruby -os: linux -dist: xenial - -rvm: - - 2.6.6 - - 2.5.8 - - 2.4.10 - -services: - - mysql - - postgresql - -env: - - REDMINE_VER=4.1-stable DB=postgresql - - REDMINE_VER=master DB=postgresql - - REDMINE_VER=4.1-stable DB=mysql - - REDMINE_VER=master DB=mysql - -before_install: - - export PLUGIN_NAME=additionals - - export REDMINE_GIT_REPO=git://github.com/redmine/redmine.git - - export REDMINE_PATH=$HOME/redmine - - export BUNDLE_GEMFILE=$REDMINE_PATH/Gemfile - - export RAILS_ENV=test - - git clone $REDMINE_GIT_REPO $REDMINE_PATH - - cd $REDMINE_PATH - - if [[ "$REDMINE_VER" != "master" ]]; then git checkout -b $REDMINE_VER origin/$REDMINE_VER; fi - - sed -i '/rubocop/d' $REDMINE_PATH/Gemfile - - rm -f $REDMINE_PATH/.rubocop* - - cp $TRAVIS_BUILD_DIR/test/support/Gemfile.local $REDMINE_PATH - - ln -s $TRAVIS_BUILD_DIR $REDMINE_PATH/plugins/$PLUGIN_NAME - - cp $TRAVIS_BUILD_DIR/test/support/additional_environment.rb $REDMINE_PATH/config/ - - cp $TRAVIS_BUILD_DIR/test/support/database-$DB-travis.yml $REDMINE_PATH/config/database.yml - -before_script: - - bundle exec rake db:create db:migrate redmine:plugins:migrate - -script: - - if [[ "$REDMINE_VER" != "master" ]] && [[ "$DB" == "postgresql" ]]; then brakeman plugins/$PLUGIN_NAME; fi - - if [[ "$REDMINE_VER" != "master" ]] && [[ "$DB" == "postgresql" ]]; then rubocop plugins/$PLUGIN_NAME; fi - - bundle exec rake redmine:plugins:test NAME=$PLUGIN_NAME RUBYOPT="-W0" - - bundle exec rake redmine:plugins:migrate NAME=$PLUGIN_NAME VERSION=0 diff --git a/plugins/additionals/CHANGELOG.rst b/plugins/additionals/CHANGELOG.rst index 7e6afa6..ff3b968 100755 --- a/plugins/additionals/CHANGELOG.rst +++ b/plugins/additionals/CHANGELOG.rst @@ -1,6 +1,33 @@ Changelog ========= +3.0.2 ++++++ + +- d3plus to v2.0.0-alpha.30 support +- Mermaid 8.9.1 support +- Bug fix for select2 loading without named field +- FontAwesome 5.15.2 support +- D3 6.6.0 support +- Fix news limit for welcome dashboard block +- Frensh translation updated, thanks to Brice BEAUMESNIL! +- clipboard.js updated to v2.0.8 +- +3.0.1 ++++++ + +- Do not show "Assign to me" if assigned_to is disabled for tracker +- FontAwesome 5.15.1 support +- D3 6.3.1 support +- Mermaid 8.8.4 support +- add current_user as special login name for user macro (which shows current login user) +- add text parameter to user macro (which disable link to user) +- add asynchronous text block +- gemify plugin to use it with Gemfile.local or other plugins +- remove spam protection functionality +- Chart.js 2.9.4 support +- Allow overwrite mermaid theme and variables + 3.0.0 +++++ diff --git a/plugins/additionals/Gemfile b/plugins/additionals/Gemfile index 4288b35..96be6e8 100755 --- a/plugins/additionals/Gemfile +++ b/plugins/additionals/Gemfile @@ -1,13 +1,4 @@ source 'https://rubygems.org' -gem 'deface', '1.5.3' -gem 'gemoji', '~> 3.0.0' -gem 'invisible_captcha' -gem 'render_async' -gem 'rss' -gem 'slim-rails' - -group :development, :test do - gem 'brakeman', require: false - gem 'slim_lint', require: false -end +# Specify your gem's dependencies in additionals.gemspec +gemspec diff --git a/plugins/additionals/README.rst b/plugins/additionals/README.rst deleted file mode 100644 index d46ade8..0000000 --- a/plugins/additionals/README.rst +++ /dev/null @@ -1 +0,0 @@ -docs/index.rst \ No newline at end of file diff --git a/plugins/additionals/Rakefile b/plugins/additionals/Rakefile new file mode 100644 index 0000000..39a5d23 --- /dev/null +++ b/plugins/additionals/Rakefile @@ -0,0 +1,11 @@ +require 'bundler/gem_tasks' +require 'rake/testtask' + +Rake::TestTask.new do |t| + t.libs << 'test' + files = FileList['test/**/*test.rb'] + t.test_files = files + t.verbose = true +end + +task default: :test diff --git a/plugins/additionals/additionals.gemspec b/plugins/additionals/additionals.gemspec new file mode 100644 index 0000000..9c5d6ca --- /dev/null +++ b/plugins/additionals/additionals.gemspec @@ -0,0 +1,30 @@ +lib = File.expand_path '../lib', __FILE__ +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'additionals/version' + +Gem::Specification.new do |spec| + spec.name = 'additionals' + spec.version = Additionals::VERSION + spec.authors = ['AlphaNodes'] + spec.email = ['alex@alphanodes.com'] + + spec.summary = 'Redmine plugin for adding dashboard functionality, wiki macros and libraries for other Redmine plugins' + spec.description = 'Redmine plugin for adding dashboard functionality, wiki macros and libraries for other Redmine plugins' + spec.homepage = 'https://github.com/alphanodes/alphanodes' + spec.license = 'GPL-2.0' + + spec.files = Dir['**/*'] - Dir['test/**/*'] - Dir['Gemfile', 'Gemfile.lock', 'README.rst'] + spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 2.4' + + spec.add_runtime_dependency 'deface', '1.5.3' + spec.add_runtime_dependency 'gemoji', '~> 3.0.0' + spec.add_runtime_dependency 'render_async' + spec.add_runtime_dependency 'rss' + spec.add_runtime_dependency 'slim-rails' + + spec.add_development_dependency 'brakeman' + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'slim_lint' +end diff --git a/plugins/additionals/app/controllers/additionals_change_status_controller.rb b/plugins/additionals/app/controllers/additionals_change_status_controller.rb index ed1a481..f82c420 100755 --- a/plugins/additionals/app/controllers/additionals_change_status_controller.rb +++ b/plugins/additionals/app/controllers/additionals_change_status_controller.rb @@ -13,7 +13,7 @@ class AdditionalsChangeStatusController < ApplicationController return end - @issue.init_journal(User.current) + @issue.init_journal User.current @issue.status_id = new_status_id @issue.assigned_to = User.current if @issue.status_x_affected?(new_status_id) && issue_old_user != User.current diff --git a/plugins/additionals/app/controllers/dashboard_async_blocks_controller.rb b/plugins/additionals/app/controllers/dashboard_async_blocks_controller.rb index d5e7f6a..fb98457 100644 --- a/plugins/additionals/app/controllers/dashboard_async_blocks_controller.rb +++ b/plugins/additionals/app/controllers/dashboard_async_blocks_controller.rb @@ -6,7 +6,6 @@ class DashboardAsyncBlocksController < ApplicationController helper :additionals_routes helper :additionals_queries - helper :additionals_tag helper :queries helper :issues helper :activities @@ -14,6 +13,12 @@ class DashboardAsyncBlocksController < ApplicationController include DashboardsHelper + # support for redmine_contacts_helpdesk plugin + if Redmine::Plugin.installed? 'redmine_contacts_helpdesk' + include HelpdeskHelper + helper :helpdesk + end + rescue_from Query::StatementInvalid, with: :query_statement_invalid rescue_from StandardError, with: :dashboard_with_invalid_block diff --git a/plugins/additionals/app/controllers/dashboards_controller.rb b/plugins/additionals/app/controllers/dashboards_controller.rb index 4ab51b8..cef7616 100644 --- a/plugins/additionals/app/controllers/dashboards_controller.rb +++ b/plugins/additionals/app/controllers/dashboards_controller.rb @@ -17,7 +17,6 @@ class DashboardsController < ApplicationController helper :dashboards helper :additionals_issues helper :additionals_queries - helper :additionals_tag include AdditionalsRoutesHelper include AdditionalsQueriesHelper @@ -92,7 +91,7 @@ class DashboardsController < ApplicationController respond_to do |format| format.html - format.xml {} + format.api end end diff --git a/plugins/additionals/app/helpers/additionals_chartjs_helper.rb b/plugins/additionals/app/helpers/additionals_chartjs_helper.rb index 6eee28b..bb3f41b 100644 --- a/plugins/additionals/app/helpers/additionals_chartjs_helper.rb +++ b/plugins/additionals/app/helpers/additionals_chartjs_helper.rb @@ -6,7 +6,7 @@ module AdditionalsChartjsHelper end def select_options_for_chartjs_colorscheme(selected) - data = YAML.safe_load(ERB.new(IO.read(Rails.root.join('plugins/additionals/config/colorschemes.yml'))).result) || {} + data = YAML.safe_load(ERB.new(IO.read(File.join(Additionals.plugin_dir, 'config', 'colorschemes.yml'))).result) || {} grouped_options_for_select(data, selected) end end diff --git a/plugins/additionals/app/helpers/additionals_clipboardjs_helper.rb b/plugins/additionals/app/helpers/additionals_clipboardjs_helper.rb index 61fe55c..b49cc1d 100644 --- a/plugins/additionals/app/helpers/additionals_clipboardjs_helper.rb +++ b/plugins/additionals/app/helpers/additionals_clipboardjs_helper.rb @@ -3,20 +3,34 @@ module AdditionalsClipboardjsHelper render_clipboardjs_button(target, clipboard_text_from_button) + render_clipboardjs_javascript(target) end + def render_text_with_clipboardjs(text) + return if text.blank? + + tag.acronym text, + class: 'clipboard-text', + title: l(:label_copy_to_clipboard), + data: clipboardjs_data(text: text) + end + + def clipboardjs_data(clipboard_data) + data = { 'label-copied' => l(:label_copied_to_clipboard), + 'label-to-copy' => l(:label_copy_to_clipboard) } + + clipboard_data.each do |key, value| + data["clipboard-#{key}"] = value if value.present? + end + + data + end + private def render_clipboardjs_button(target, clipboard_text_from_button) - data = { 'clipboard-target' => "##{target}", - 'label-copied' => l(:label_copied_to_clipboard), - 'label-to-copy' => l(:label_copy_to_clipboard) } - - data['clipboard-text'] = clipboard_text_from_button if clipboard_text_from_button.present? - tag.button id: "zc_#{target}", - class: 'clipboard_button far fa-copy', + class: 'clipboard-button far fa-copy', type: 'button', title: l(:label_copy_to_clipboard), - data: data + data: clipboardjs_data(target: "##{target}", text: clipboard_text_from_button) end def render_clipboardjs_javascript(target) diff --git a/plugins/additionals/app/helpers/additionals_menu_helper.rb b/plugins/additionals/app/helpers/additionals_menu_helper.rb index fabdf9f..ceee70f 100755 --- a/plugins/additionals/app/helpers/additionals_menu_helper.rb +++ b/plugins/additionals/app/helpers/additionals_menu_helper.rb @@ -100,12 +100,9 @@ module AdditionalsMenuHelper def additionals_custom_top_menu_item(item, user_roles) show_entry = false item[:roles].each do |role| - if user_roles.empty? && role.to_i == Role::BUILTIN_ANONYMOUS - show_entry = true - break - elsif User.current.logged? && role.to_i == Role::BUILTIN_NON_MEMBER - # if user is logged in and non_member is active in item, - # always show it + if user_roles.empty? && role.to_i == Role::BUILTIN_ANONYMOUS || + # if user is logged in and non_member is active in item, always show it + User.current.logged? && role.to_i == Role::BUILTIN_NON_MEMBER show_entry = true break end diff --git a/plugins/additionals/app/helpers/additionals_queries_helper.rb b/plugins/additionals/app/helpers/additionals_queries_helper.rb index 3b0c4df..4c357af 100755 --- a/plugins/additionals/app/helpers/additionals_queries_helper.rb +++ b/plugins/additionals/app/helpers/additionals_queries_helper.rb @@ -4,8 +4,8 @@ module AdditionalsQueriesHelper end def additionals_retrieve_query(object_type, options = {}) - session_key = additionals_query_session_key(object_type) - query_class = Object.const_get("#{object_type.camelcase}Query") + session_key = additionals_query_session_key object_type + query_class = Object.const_get "#{object_type.camelcase}Query" if params[:query_id].present? additionals_load_query_id(query_class, session_key, params[:query_id], options, object_type) elsif api_request? || @@ -28,7 +28,7 @@ module AdditionalsQueriesHelper else # retrieve from session @query = query_class.find_by(id: session[session_key][:id]) if session[session_key][:id] - session_data = Rails.cache.read(additionals_query_cache_key(object_type)) + session_data = Rails.cache.read additionals_query_cache_key(object_type) @query ||= query_class.new(name: '_', filters: session_data.nil? ? nil : session_data[:filters], group_by: session_data.nil? ? nil : session_data[:group_by], @@ -79,11 +79,11 @@ module AdditionalsQueriesHelper def additionals_select2_search_users(options = {}) q = params[:q].to_s.strip exclude_id = params[:user_id].to_i - scope = User.active.where(type: 'User') + scope = User.active.where type: 'User' scope = scope.visible unless options[:all_visible] scope = scope.where.not(id: exclude_id) if exclude_id.positive? scope = scope.where(options[:where_filter], options[:where_params]) if options[:where_filter] - q.split(' ').map { |search_string| scope = scope.like(search_string) } if q.present? + q.split.map { |search_string| scope = scope.like(search_string) } if q.present? scope = scope.order(last_login_on: :desc) .limit(Additionals::SELECT2_INIT_ENTRIES) @users = scope.to_a.sort! { |x, y| x.name <=> y.name } @@ -140,13 +140,13 @@ module AdditionalsQueriesHelper def xlsx_write_header_row(workbook, worksheet, columns) columns_width = [] columns.each_with_index do |c, index| - value = if c.class.name == 'String' + value = if c.is_a? String c else c.caption.to_s end - worksheet.write(0, index, value, workbook.add_format(xlsx_cell_format(:header))) + worksheet.write 0, index, value, workbook.add_format(xlsx_cell_format(:header)) columns_width << xlsx_get_column_width(value) end columns_width @@ -224,13 +224,11 @@ module AdditionalsQueriesHelper def xlsx_hyperlink_cell?(token) # Match http, https or ftp URL - if %r{\A[fh]tt?ps?://}.match?(token) - true - # Match mailto: - elsif token.present? && token.start_with?('mailto:') - true - # Match internal or external sheet link - elsif /\A(?:in|ex)ternal:/.match?(token) + if %r{\A[fh]tt?ps?://}.match?(token) || + # Match mailto: + token.present? && token.start_with?('mailto:') || + # Match internal or external sheet link + /\A(?:in|ex)ternal:/.match?(token) true end end diff --git a/plugins/additionals/app/helpers/additionals_select2_helper.rb b/plugins/additionals/app/helpers/additionals_select2_helper.rb index 5ad1931..562c3e6 100644 --- a/plugins/additionals/app/helpers/additionals_select2_helper.rb +++ b/plugins/additionals/app/helpers/additionals_select2_helper.rb @@ -1,9 +1,10 @@ module AdditionalsSelect2Helper def additionals_select2_tag(name, option_tags = nil, options = {}) s = select_tag(name, option_tags, options) + id = options.delete(:id) || sanitize_to_id(name) s << hidden_field_tag("#{name}[]", '') if options[:multiple] && options.fetch(:include_hidden, true) - s + javascript_tag("select2Tag('#{sanitize_to_id name}', #{options.to_json});") + s + javascript_tag("select2Tag('#{id}', #{options.to_json});") end # Transforms select filters of +type+ fields into select2 diff --git a/plugins/additionals/app/helpers/additionals_settings_helper.rb b/plugins/additionals/app/helpers/additionals_settings_helper.rb index d3e01c4..07b1f26 100644 --- a/plugins/additionals/app/helpers/additionals_settings_helper.rb +++ b/plugins/additionals/app/helpers/additionals_settings_helper.rb @@ -4,7 +4,6 @@ module AdditionalsSettingsHelper { name: 'wiki', partial: 'additionals/settings/wiki', label: :label_wiki }, { name: 'macros', partial: 'additionals/settings/macros', label: :label_macro_plural }, { name: 'rules', partial: 'additionals/settings/issues', label: :label_issue_plural }, - { name: 'users', partial: 'additionals/settings/users', label: :label_user_plural }, { name: 'web', partial: 'additionals/settings/web_apis', label: :label_web_apis }] unless Redmine::Plugin.installed? 'redmine_hrm' @@ -46,6 +45,22 @@ module AdditionalsSettingsHelper text_field_tag("settings[#{name}]", value, options)] end + def additionals_settings_passwordfield(name, options = {}) + label_title = options.delete(:label).presence || l("label_#{name}") + value = options.delete(:value).presence || @settings[name] + + safe_join [label_tag("settings[#{name}]", label_title), + password_field_tag("settings[#{name}]", value, options)] + end + + def additionals_settings_urlfield(name, options = {}) + label_title = options.delete(:label).presence || l("label_#{name}") + value = options.delete(:value).presence || @settings[name] + + safe_join [label_tag("settings[#{name}]", label_title), + url_field_tag("settings[#{name}]", value, options)] + end + def additionals_settings_textarea(name, options = {}) label_title = options.delete(:label).presence || l("label_#{name}") value = options.delete(:value).presence || @settings[name] diff --git a/plugins/additionals/app/helpers/additionals_tag_helper.rb b/plugins/additionals/app/helpers/additionals_tag_helper.rb deleted file mode 100755 index 6c5c8d0..0000000 --- a/plugins/additionals/app/helpers/additionals_tag_helper.rb +++ /dev/null @@ -1,113 +0,0 @@ -require 'digest/md5' - -module AdditionalsTagHelper - def additionals_tag_cloud(tags, options = {}) - return if tags.blank? - - options[:show_count] = true - - # prevent ActsAsTaggableOn::TagsHelper from calling `all` - # otherwise we will need sort tags after `tag_cloud` - tags = tags.all if tags.respond_to?(:all) - - s = [] - tags.each do |tag| - s << additionals_tag_link(tag, options) - end - - sep = if options[:tags_without_color] - ', ' - else - ' ' - end - - tag.div safe_join(s, sep), class: 'tags' - end - - # plain list of tags - def render_additionals_tags(tags, sep = ' ') - s = if tags.blank? - [''] - else - tags.map(&:name) - end - s.join(sep) - end - - def additionals_tag_links(tag_list, options = {}) - return unless tag_list - - sep = if options[:tags_without_color] - ', ' - else - ' ' - end - - safe_join(tag_list.map do |tag| - additionals_tag_link tag, options - end, sep) - end - - def additionals_tag_link(tag_object, options = {}) - tag_name = [] - tag_name << tag_object.name - - unless options[:tags_without_color] - tag_bg_color = additionals_tag_color tag_object.name - tag_fg_color = additionals_tag_fg_color tag_bg_color - tag_style = "background-color: #{tag_bg_color}; color: #{tag_fg_color}" - end - - tag_name << tag.span("(#{tag_object.count})", class: 'tag-count') if options[:show_count] - - if options[:tags_without_color] - tag.span link_to(safe_join(tag_name), additionals_tag_url(tag_object.name, options)), - class: 'tag-label' - else - tag.span link_to(safe_join(tag_name), - additionals_tag_url(tag_object.name, options), - style: tag_style), - class: 'additionals-tag-label-color', - style: tag_style - end - end - - def additionals_tag_url(tag_name, options = {}) - action = options[:tag_action].presence || (controller_name == 'hrm_user_resources' ? 'show' : 'index') - - { controller: options[:tag_controller].presence || controller_name, - action: action, - set_filter: 1, - project_id: options[:project], - fields: [:tags], - values: { tags: [tag_name] }, - operators: { tags: '=' } } - end - - private - - def tag_cloud(tags, classes) - return [] if tags.empty? - - max_count = tags.max_by(&:count).count.to_f - - tags.each do |tag| - index = ((tag.count / max_count) * (classes.size - 1)) - yield tag, classes[index.nan? ? 0 : index.round] - end - end - - def additionals_tag_color(tag_name) - "##{Digest::MD5.hexdigest(tag_name)[0..5]}" - end - - def additionals_tag_fg_color(bg_color) - # calculate contrast text color according to YIQ method - # https://24ways.org/2010/calculating-color-contrast/ - # https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color - r = bg_color[1..2].hex - g = bg_color[3..4].hex - b = bg_color[5..6].hex - (r * 299 + g * 587 + b * 114) >= 128_000 ? 'black' : 'white' - end -end diff --git a/plugins/additionals/app/helpers/dashboards_helper.rb b/plugins/additionals/app/helpers/dashboards_helper.rb index 17a54a5..937e676 100644 --- a/plugins/additionals/app/helpers/dashboards_helper.rb +++ b/plugins/additionals/app/helpers/dashboards_helper.rb @@ -86,10 +86,10 @@ module DashboardsHelper tag.div class: 'active-dashboards' do out = [tag.h3(l(:label_active_dashboard)), tag.ul do - concat tag.ul "#{l :field_name}: #{dashboard.name}" - concat tag.ul safe_join([l(:field_author), link_to_user(dashboard.author)], ': ') - concat tag.ul "#{l :field_created_on}: #{format_time dashboard.created_at}" - concat tag.ul "#{l :field_updated_on}: #{format_time dashboard.updated_at}" + concat tag.li "#{l :field_name}: #{dashboard.name}" + concat tag.li safe_join([l(:field_author), link_to_user(dashboard.author)], ': ') + concat tag.li "#{l :field_created_on}: #{format_time dashboard.created_at}" + concat tag.li "#{l :field_updated_on}: #{format_time dashboard.updated_at}" end] if dashboard.description.present? @@ -105,7 +105,7 @@ module DashboardsHelper return '' unless dashboards.any? tag.h3(title, class: 'dashboards') + - tag.ul do + tag.ul(class: 'dashboards') do dashboards.each do |dashboard| selected = dashboard.id == if params[:dashboard_id].present? params[:dashboard_id].to_i @@ -115,19 +115,24 @@ module DashboardsHelper css = 'dashboard' css << ' selected' if selected + li_class = nil + link = [dashboard_link(dashboard, project, class: css)] if dashboard.system_default? link << if dashboard.project_id.nil? - font_awesome_icon('fas_cube', + li_class = 'global' + font_awesome_icon 'fas_cube', title: l(:field_system_default), - class: 'dashboard-system-default global') + class: "dashboard-system-default #{li_class}" else - font_awesome_icon('fas_cube', + li_class = 'project' + font_awesome_icon 'fas_cube', title: l(:field_project_system_default), - class: 'dashboard-system-default project') + class: "dashboard-system-default #{li_class}" end end - concat tag.li safe_join(link) + + concat tag.li safe_join(link), class: li_class end end end @@ -325,7 +330,7 @@ module DashboardsHelper max_entries = settings[:max_entries] || DashboardContent::DEFAULT_MAX_ENTRIES news = if dashboard.content_project.nil? - News.latest User.current + News.latest User.current, max_entries else dashboard.content_project .news @@ -378,7 +383,7 @@ module DashboardsHelper max_entries = max_entries.present? ? max_entries.to_i : 10 begin - URI.open(url) do |rss_feed| + URI.parse(url).open do |rss_feed| rss = RSS::Parser.parse(rss_feed) rss.items.each do |item| cnt += 1 diff --git a/plugins/additionals/app/jobs/additionals_remove_unused_tag_job.rb b/plugins/additionals/app/jobs/additionals_remove_unused_tag_job.rb deleted file mode 100644 index 7453c76..0000000 --- a/plugins/additionals/app/jobs/additionals_remove_unused_tag_job.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AdditionalsRemoveUnusedTagJob < AdditionalsJob - def perform - AdditionalsTag.remove_unused_tags - end -end diff --git a/plugins/additionals/app/models/additionals_chart.rb b/plugins/additionals/app/models/additionals_chart.rb index ed1fdc5..84a27ad 100644 --- a/plugins/additionals/app/models/additionals_chart.rb +++ b/plugins/additionals/app/models/additionals_chart.rb @@ -1,4 +1,5 @@ -class AdditionalsChart < ActiveRecord::Base +class AdditionalsChart + include ActiveRecord::Sanitization include Redmine::I18n CHART_DEFAULT_HEIGHT = 350 diff --git a/plugins/additionals/app/models/additionals_font_awesome.rb b/plugins/additionals/app/models/additionals_font_awesome.rb index ead1529..a1e1622 100755 --- a/plugins/additionals/app/models/additionals_font_awesome.rb +++ b/plugins/additionals/app/models/additionals_font_awesome.rb @@ -6,7 +6,7 @@ class AdditionalsFontAwesome class << self def load_icons(type) - data = YAML.safe_load(ERB.new(IO.read(Rails.root.join('plugins/additionals/config/fontawesome_icons.yml'))).result) || {} + data = YAML.safe_load(ERB.new(IO.read(File.join(Additionals.plugin_dir, 'config', 'fontawesome_icons.yml'))).result) || {} icons = {} data.each do |key, values| icons[key] = { unicode: values['unicode'], label: values['label'] } if values['styles'].include?(convert_type2style(type)) diff --git a/plugins/additionals/app/models/additionals_import.rb b/plugins/additionals/app/models/additionals_import.rb index 0b4c406..f8d31a8 100755 --- a/plugins/additionals/app/models/additionals_import.rb +++ b/plugins/additionals/app/models/additionals_import.rb @@ -31,7 +31,7 @@ class AdditionalsImport < Import next unless value h[v.custom_field.id.to_s] = - if value.is_a?(Array) + if value.is_a? Array value.map { |val| v.custom_field.value_from_keyword(val.strip, object) }.flatten!&.compact else v.custom_field.value_from_keyword(value, object) diff --git a/plugins/additionals/app/models/additionals_info.rb b/plugins/additionals/app/models/additionals_info.rb new file mode 100644 index 0000000..b4691b3 --- /dev/null +++ b/plugins/additionals/app/models/additionals_info.rb @@ -0,0 +1,73 @@ +class AdditionalsInfo + include Redmine::I18n + + class << self + def system_infos + { system_info: { label: l(:label_system_info), value: system_info }, + system_uptime: { label: l(:label_uptime), value: system_uptime } } + end + + def system_info + if windows_platform? + win_info = `wmic os get Caption,CSDVersion,BuildNumber /value` + return 'unknown' if win_info.blank? + + windows_version = '' + windows_build = '' + build_names = %w[BuildNumber CSDVersion] + win_info.split(/\n+/).each do |line| + line_info = line.split '=' + if line_info[0] == 'Caption' + windows_version = line_info[1] + elsif build_names.include?(line_info[0]) && line_info[1]&.present? + windows_build = line_info[1] + end + end + "#{windows_version} build #{windows_build}" + else + `uname -a` + end + end + + def system_uptime(format: :time_tag) + if windows_platform? + `net stats srv | find "Statist"` + elsif File.exist? '/proc/uptime' + secs = `cat /proc/uptime`.to_i + min = 0 + hours = 0 + days = 0 + if secs.positive? + min = (secs / 60).round + hours = (secs / 3_600).round + days = (secs / 86_400).round + end + if days >= 1 + "#{days} #{l(:days, count: days)}" + elsif hours >= 1 + "#{hours} #{l(:hours, count: hours)}" + else + "#{min} #{l(:minutes, count: min)}" + end + else + # this should be work on macOS + seconds = `sysctl -n kern.boottime | awk '{print $4}'`.tr ',', '' + so = DateTime.strptime seconds.strip, '%s' + if so.present? + if format == :datetime + so + else + ApplicationController.helpers.time_tag so + end + else + days = `uptime | awk '{print $3}'`.to_i.round + "#{days} #{l(:days, count: days)}" + end + end + end + + def windows_platform? + /cygwin|mswin|mingw|bccwin|wince|emx/.match? RUBY_PLATFORM + end + end +end diff --git a/plugins/additionals/app/models/additionals_query.rb b/plugins/additionals/app/models/additionals_query.rb index 6b389ff..e9d773e 100755 --- a/plugins/additionals/app/models/additionals_query.rb +++ b/plugins/additionals/app/models/additionals_query.rb @@ -22,6 +22,17 @@ module AdditionalsQuery sql.join(' AND ') end + def fix_sql_for_text_field(field, operator, value, table_name = nil, target_field = nil) + table_name = queried_table_name if table_name.blank? + target_field = field if target_field.blank? + + sql = [] + sql << "(#{sql_for_field(field, operator, value, table_name, target_field)})" + sql << "#{table_name}.#{target_field} != ''" if operator == '*' + + sql.join(' AND ') + end + def initialize_ids_filter(options = {}) if options[:label] add_available_filter 'ids', type: :integer, label: options[:label] @@ -44,30 +55,44 @@ module AdditionalsQuery end end + def sql_for_project_identifier_field(field, operator, values) + value = values.first + values = value.split(',').map(&:strip) if ['=', '!'].include?(operator) && value.include?(',') + sql_for_field field, operator, values, Project.table_name, 'identifier' + end + def sql_for_project_status_field(field, operator, value) sql_for_field field, operator, value, Project.table_name, 'status' end - def initialize_project_status_filter - return if project&.leaf? + def initialize_project_identifier_filter + return if project - add_available_filter('project.status', + add_available_filter 'project.identifier', + type: :string, + name: l(:label_attribute_of_project, name: l(:field_identifier)) + end + + def initialize_project_status_filter + return if project + + add_available_filter 'project.status', type: :list, name: l(:label_attribute_of_project, name: l(:field_status)), - values: -> { project_statuses_values }) + values: -> { project_statuses_values } end def initialize_project_filter(options = {}) if project.nil? || options[:always] - add_available_filter('project_id', order: options[:position], + add_available_filter 'project_id', order: options[:position], type: :list, - values: -> { project_values }) + values: -> { project_values } end return if project.nil? || project.leaf? || subproject_values.empty? - add_available_filter('subproject_id', order: options[:position], + add_available_filter 'subproject_id', order: options[:position], type: :list_subprojects, - values: -> { subproject_values }) + values: -> { subproject_values } end def initialize_created_filter(options = {}) @@ -83,16 +108,9 @@ module AdditionalsQuery end def initialize_tags_filter(options = {}) - values = if project - queried_class.available_tags(project: project.id) - else - queried_class.available_tags - end - return if values.blank? - add_available_filter 'tags', order: options[:position], - type: :list, - values: values.collect { |t| [t.name, t.name] } + type: :list_optional, + values: -> { tag_values(project) } end def initialize_approved_filter @@ -106,27 +124,35 @@ module AdditionalsQuery end def initialize_author_filter(options = {}) - return if author_values.empty? - - add_available_filter('author_id', order: options[:position], + add_available_filter 'author_id', order: options[:position], type: :list_optional, - values: options[:no_lambda].nil? ? author_values : -> { author_values }) + values: -> { author_values } end def initialize_assignee_filter(options = {}) - return if author_values.empty? - - add_available_filter('assigned_to_id', order: options[:position], + add_available_filter 'assigned_to_id', order: options[:position], type: :list_optional, - values: options[:no_lambda] ? assigned_to_all_values : -> { assigned_to_all_values }) + values: -> { assigned_to_all_values } end def initialize_watcher_filter(options = {}) - return if watcher_values.empty? || !User.current.logged? + return unless User.current.logged? - add_available_filter('watcher_id', order: options[:position], + add_available_filter 'watcher_id', order: options[:position], type: :list, - values: options[:no_lambda] ? watcher_values : -> { watcher_values }) + values: -> { watcher_values } + end + + def tag_values(project) + values = if project + queried_class.available_tags project: project.id + else + queried_class.available_tags + end + + return [] if values.blank? + + values.collect { |t| [t.name, t.name] } end # issue independend values. Use assigned_to_values from Redmine, if you want it only for issues @@ -154,7 +180,7 @@ module AdditionalsQuery end def sql_for_tags_field(field, _operator, value) - AdditionalsTag.sql_for_tags_field(queried_class, operator_for(field), value) + AdditionalTags.sql_for_tags_field queried_class, operator_for(field), value end def sql_for_is_private_field(_field, operator, value) diff --git a/plugins/additionals/app/models/additionals_tag.rb b/plugins/additionals/app/models/additionals_tag.rb deleted file mode 100755 index db9c893..0000000 --- a/plugins/additionals/app/models/additionals_tag.rb +++ /dev/null @@ -1,76 +0,0 @@ -class AdditionalsTag - TAG_TABLE_NAME = RedmineCrm::Tag.table_name if defined? RedmineCrm - TAGGING_TABLE_NAME = RedmineCrm::Tagging.table_name if defined? RedmineCrm - PROJECT_TABLE_NAME = Project.table_name - - class << self - def all_type_tags(klass, options = {}) - RedmineCrm::Tag.where({}) - .joins(tag_joins(klass, options)) - .distinct - .order("#{TAG_TABLE_NAME}.name") - end - - def get_available_tags(klass, options = {}) - scope = RedmineCrm::Tag.where({}) - scope = scope.where("#{PROJECT_TABLE_NAME}.id = ?", options[:project]) if options[:project] - if options[:permission] - scope = scope.where(tag_access(options[:permission])) - elsif options[:visible_condition] - scope = scope.where(klass.visible_condition(User.current)) - end - scope = scope.where("LOWER(#{TAG_TABLE_NAME}.name) LIKE ?", "%#{options[:name_like].downcase}%") if options[:name_like] - scope = scope.where("#{TAG_TABLE_NAME}.name=?", options[:name]) if options[:name] - scope = scope.where("#{TAGGING_TABLE_NAME}.taggable_id!=?", options[:exclude_id]) if options[:exclude_id] - scope = scope.where(options[:where_field] => options[:where_value]) if options[:where_field].present? && options[:where_value] - - scope.select("#{TAG_TABLE_NAME}.*, COUNT(DISTINCT #{TAGGING_TABLE_NAME}.taggable_id) AS count") - .joins(tag_joins(klass, options)) - .group("#{TAG_TABLE_NAME}.id, #{TAG_TABLE_NAME}.name").having('COUNT(*) > 0') - .order("#{TAG_TABLE_NAME}.name") - end - - def remove_unused_tags - RedmineCrm::Tag.where.not(id: RedmineCrm::Tagging.select(:tag_id).distinct) - .each(&:destroy) - end - - def sql_for_tags_field(klass, operator, value) - compare = operator.eql?('=') ? 'IN' : 'NOT IN' - ids_list = klass.tagged_with(value).collect(&:id).push(0).join(',') - "( #{klass.table_name}.id #{compare} (#{ids_list}) ) " - end - - private - - def tag_access(permission) - projects_allowed = if permission.nil? - Project.visible.ids - else - Project.where(Project.allowed_to_condition(User.current, permission)).ids - end - - if projects_allowed.present? - "#{PROJECT_TABLE_NAME}.id IN (#{projects_allowed.join ','})" unless projects_allowed.empty? - else - '1=0' - end - end - - def tag_joins(klass, options = {}) - table_name = klass.table_name - - joins = ["JOIN #{TAGGING_TABLE_NAME} ON #{TAGGING_TABLE_NAME}.tag_id = #{TAG_TABLE_NAME}.id"] - joins << "JOIN #{table_name} " \ - "ON #{table_name}.id = #{TAGGING_TABLE_NAME}.taggable_id AND #{TAGGING_TABLE_NAME}.taggable_type = '#{klass}'" - - if options[:project_join] - joins << options[:project_join] - elsif options[:project] || !options[:without_projects] - joins << "JOIN #{PROJECT_TABLE_NAME} ON #{table_name}.project_id = #{PROJECT_TABLE_NAME}.id" - end - - joins - end - end -end diff --git a/plugins/additionals/app/models/dashboard.rb b/plugins/additionals/app/models/dashboard.rb index ab4f9d7..41b5efe 100644 --- a/plugins/additionals/app/models/dashboard.rb +++ b/plugins/additionals/app/models/dashboard.rb @@ -4,6 +4,7 @@ class Dashboard < ActiveRecord::Base include Additionals::EntityMethods class SystemDefaultChangeException < StandardError; end + class ProjectSystemDefaultChangeException < StandardError; end belongs_to :project @@ -302,7 +303,10 @@ class Dashboard < ActiveRecord::Base config = { dashboard_id: id, block: block } - settings[:user_id] = User.current.id if !options.key?(:skip_user_id) || !options[:skip_user_id] + if !options.key?(:skip_user_id) || !options[:skip_user_id] + settings[:user_id] = User.current.id + settings[:user_is_admin] = User.current.admin? + end if settings.present? settings.each do |key, setting| @@ -321,11 +325,11 @@ class Dashboard < ActiveRecord::Base unique_params = settings.flatten unique_params += options[:unique_params].reject(&:blank?) if options[:unique_params].present? - Rails.logger.debug "debug async_params for #{block}: unique_params=#{unique_params.inspect}" + # Rails.logger.debug "debug async_params for #{block}: unique_params=#{unique_params.inspect}" config[:unique_key] = Digest::SHA256.hexdigest(unique_params.join('_')) end - Rails.logger.debug "debug async_params for #{block}: config=#{config.inspect}" + # Rails.logger.debug "debug async_params for #{block}: config=#{config.inspect}" config end @@ -358,7 +362,10 @@ class Dashboard < ActiveRecord::Base end def validate_system_default - return if new_record? || system_default_was == system_default || system_default? + return if new_record? || + system_default_was == system_default || + system_default? || + project_id.present? raise SystemDefaultChangeException end diff --git a/plugins/additionals/app/models/dashboard_content.rb b/plugins/additionals/app/models/dashboard_content.rb index a03c93c..43005d7 100644 --- a/plugins/additionals/app/models/dashboard_content.rb +++ b/plugins/additionals/app/models/dashboard_content.rb @@ -41,9 +41,13 @@ class DashboardContent with_project: true }, max_occurs: DashboardContent::MAX_MULTIPLE_OCCURS }, - 'text' => { label: l(:label_text), + 'text' => { label: l(:label_text_sync), max_occurs: MAX_MULTIPLE_OCCURS, partial: 'dashboards/blocks/text' }, + 'text_async' => { label: l(:label_text_async), + max_occurs: MAX_MULTIPLE_OCCURS, + async: { required_settings: %i[text], + partial: 'dashboards/blocks/text_async' } }, 'news' => { label: l(:label_news_latest), permission: :view_news }, 'documents' => { label: l(:label_document_plural), diff --git a/plugins/additionals/app/models/dashboard_role.rb b/plugins/additionals/app/models/dashboard_role.rb index 9ecfff7..f174f50 100644 --- a/plugins/additionals/app/models/dashboard_role.rb +++ b/plugins/additionals/app/models/dashboard_role.rb @@ -3,4 +3,7 @@ class DashboardRole < ActiveRecord::Base belongs_to :dashboard belongs_to :role + + validates :dashboard, :role, + presence: true end diff --git a/plugins/additionals/app/overrides/account/register.rb b/plugins/additionals/app/overrides/account/register.rb deleted file mode 100755 index 419a744..0000000 --- a/plugins/additionals/app/overrides/account/register.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new virtual_path: 'account/register', - name: 'add-invisble-captcha', - insert_top: 'div.box', - original: 'a9c303821376a8d83cba32654629d71cc3926a1d', - partial: 'account/invisible_captcha' diff --git a/plugins/additionals/app/overrides/contacts/form.rb b/plugins/additionals/app/overrides/contacts/form.rb index a1e8a9b..364e0bf 100644 --- a/plugins/additionals/app/overrides/contacts/form.rb +++ b/plugins/additionals/app/overrides/contacts/form.rb @@ -1,8 +1,15 @@ unless Redmine::Plugin.installed? 'redmine_servicedesk' - # redmine_contacts does not provide hook - Deface::Override.new virtual_path: 'contacts/_form', - name: 'contacts-form-hook', - insert_bottom: 'div#contact_data', - original: 'df6cae24cfd26e5299c45c427fbbd4e5f23c313e', - partial: 'hooks/view_contacts_form' + if defined?(CONTACTS_VERSION_TYPE) && CONTACTS_VERSION_TYPE == 'PRO version' + Deface::Override.new virtual_path: 'contacts/_form', + name: 'contacts-pro-form-hook', + insert_bottom: 'div#contact_data', + original: 'df6cae24cfd26e5299c45c427fbbd4e5f23c313e', + partial: 'hooks/view_contacts_form' + else + Deface::Override.new virtual_path: 'contacts/_form', + name: 'contacts-form-hook', + insert_bottom: 'div#contact_data', + original: '217049684a0bcd7e404dc6b5b2348aae47ac8a72', + partial: 'hooks/view_contacts_form' + end end diff --git a/plugins/additionals/app/overrides/wiki/edit.rb b/plugins/additionals/app/overrides/wiki/edit.rb new file mode 100644 index 0000000..ae9be74 --- /dev/null +++ b/plugins/additionals/app/overrides/wiki/edit.rb @@ -0,0 +1,5 @@ +Deface::Override.new virtual_path: 'wiki/edit', + name: 'wiki-edit-bottom', + insert_before: 'fieldset', + original: 'ededb6cfd5adfe8a9723d00ce0ee23575c7cc44c', + partial: 'hooks/view_wiki_form_bottom' diff --git a/plugins/additionals/app/overrides/wiki/show.rb b/plugins/additionals/app/overrides/wiki/show.rb new file mode 100644 index 0000000..bb13ae0 --- /dev/null +++ b/plugins/additionals/app/overrides/wiki/show.rb @@ -0,0 +1,5 @@ +Deface::Override.new virtual_path: 'wiki/show', + name: 'wiki-show-bottom', + insert_before: 'p.wiki-update-info', + original: 'd9f52aa98f1cb335314570d3f5403690f1b29145', + partial: 'hooks/view_wiki_show_bottom' diff --git a/plugins/additionals/app/views/account/_invisible_captcha.html.slim b/plugins/additionals/app/views/account/_invisible_captcha.html.slim deleted file mode 100755 index e22a941..0000000 --- a/plugins/additionals/app/views/account/_invisible_captcha.html.slim +++ /dev/null @@ -1,2 +0,0 @@ -- if Additionals.setting?(:invisible_captcha) - = f.invisible_captcha :url, autocomplete: 'off' diff --git a/plugins/additionals/app/views/additionals/_body_bottom.html.slim b/plugins/additionals/app/views/additionals/_body_bottom.html.slim index b045725..6c4fcd1 100755 --- a/plugins/additionals/app/views/additionals/_body_bottom.html.slim +++ b/plugins/additionals/app/views/additionals/_body_bottom.html.slim @@ -1,7 +1,7 @@ -- footer = Additionals.setting(:global_footer) +- footer = Additionals.setting :global_footer - if footer.present? .additionals-footer - = textilizable(footer) + = textilizable footer - if @additionals_help_items.present? javascript: @@ -9,7 +9,7 @@ $('a.help').parent().append(""); }); -- if Additionals.setting?(:open_external_urls) +- if Additionals.setting? :open_external_urls javascript: $(function() { $('a.external').attr({ 'target': '_blank', diff --git a/plugins/additionals/app/views/additionals/_body_top.slim b/plugins/additionals/app/views/additionals/_body_top.slim index 207c34a..f1e843e 100644 --- a/plugins/additionals/app/views/additionals/_body_top.slim +++ b/plugins/additionals/app/views/additionals/_body_top.slim @@ -1,2 +1,2 @@ -- if Additionals.setting?(:add_go_to_top) +- if Additionals.setting? :add_go_to_top a#gototop diff --git a/plugins/additionals/app/views/additionals/_chart_table_values.html.slim b/plugins/additionals/app/views/additionals/_chart_table_values.html.slim index 286d5d0..61193e8 100644 --- a/plugins/additionals/app/views/additionals/_chart_table_values.html.slim +++ b/plugins/additionals/app/views/additionals/_chart_table_values.html.slim @@ -7,8 +7,7 @@ table.list.issue-report.table-of-values tbody - options = { set_filter: 1 } - @chart[:filters].each do |line| - - if line[:filter] - - options.merge! line[:filter] + - options.merge! line[:filter] if line[:filter] tr class="#{cycle 'odd', 'even'}" td.name class="#{line[:id].to_s == '0' ? 'summary' : ''}" - if line[:filter].nil? diff --git a/plugins/additionals/app/views/additionals/_h2_with_query_search.html.slim b/plugins/additionals/app/views/additionals/_h2_with_query_search.html.slim index 3af60ee..d09b8ee 100755 --- a/plugins/additionals/app/views/additionals/_h2_with_query_search.html.slim +++ b/plugins/additionals/app/views/additionals/_h2_with_query_search.html.slim @@ -1,11 +1,13 @@ -= render(partial: 'additionals/live_search_ajax_call.js', layout: false, formats: [:js]) -- unless defined? classes - - classes = 'title' +- classes = 'title' unless defined? classes h2 class="#{classes}" = @query.new_record? ? l(title) : h(@query.name) span.additionals-live-search - = text_field_tag(:search, + = text_field_tag :search, q, autocomplete: 'off', class: 'live-search-field', - placeholder: l(:label_query_name_search)) + placeholder: defined?(placeholder) ? placeholder : l(:label_query_name_search) + + javascript: + observeLiveSearchField('search', + 'query-result-list') diff --git a/plugins/additionals/app/views/additionals/_html_head.html.slim b/plugins/additionals/app/views/additionals/_html_head.html.slim index 1680cb6..7d33104 100755 --- a/plugins/additionals/app/views/additionals/_html_head.html.slim +++ b/plugins/additionals/app/views/additionals/_html_head.html.slim @@ -2,5 +2,4 @@ = additionals_library_load :font_awesome = stylesheet_link_tag 'additionals', plugin: 'additionals' = javascript_include_tag 'additionals', plugin: 'additionals' -- unless Redmine::Plugin.installed? 'redmine_hrm' - - render_custom_top_menu_item +- render_custom_top_menu_item unless Redmine::Plugin.installed? 'redmine_hrm' diff --git a/plugins/additionals/app/views/additionals/_live_search_ajax_call.js.slim b/plugins/additionals/app/views/additionals/_live_search_ajax_call.js.slim deleted file mode 100755 index 295d6be..0000000 --- a/plugins/additionals/app/views/additionals/_live_search_ajax_call.js.slim +++ /dev/null @@ -1,18 +0,0 @@ -javascript: - $(function() { - // when the #search field changes - $('#search').live_observe_field(2, function() { - var form = $('#query_form'); // grab the form wrapping the search bar. - var url = form.attr('action'); - form.find('[name="c[]"] option').each(function(i, elem) { - $(elem).attr('selected', true) - }) - var formData = form.serialize(); - form.find('[name="c[]"] option').each(function(i, elem) { - $(elem).attr('selected', false) - }) - $.get(url, formData, function(data) { // perform an AJAX get, the trailing function is what happens on successful get. - $("#query-result-list").html(data); // replace the "results" div with the result of action taken - }); - }); - }); diff --git a/plugins/additionals/app/views/additionals/_select2_ajax_call.js.slim b/plugins/additionals/app/views/additionals/_select2_ajax_call.js.slim index 20d3e87..0a87881 100755 --- a/plugins/additionals/app/views/additionals/_select2_ajax_call.js.slim +++ b/plugins/additionals/app/views/additionals/_select2_ajax_call.js.slim @@ -21,7 +21,7 @@ javascript: placeholder: "#{options[:placeholder].presence}", allowClear: #{options[:allow_clear].present? && options[:allow_clear] ? 'true' : 'false'}, minimumInputLength: 0, - width: "#{options[:width].presence || '60%'}", + width: "#{options[:width].presence || '90%'}", templateResult: #{options[:template_result].presence || 'formatNameWithIcon'}, #{options[:template_selection].present? ? ('templateSelection: ' + options[:template_selection]) : nil} }) diff --git a/plugins/additionals/app/views/additionals/_settings_list_defaults.html.slim b/plugins/additionals/app/views/additionals/_settings_list_defaults.html.slim index b21b5c9..bbde541 100755 --- a/plugins/additionals/app/views/additionals/_settings_list_defaults.html.slim +++ b/plugins/additionals/app/views/additionals/_settings_list_defaults.html.slim @@ -16,8 +16,8 @@ fieldset.box - columns.each do |s| label.inline - value = @settings[setting_name_totals.to_sym].present? ? @settings[setting_name_totals.to_sym].include?(s.name.to_s) : false - = check_box_tag("settings[#{setting_name_totals}][]", + = check_box_tag "settings[#{setting_name_totals}][]", s.name, value, - id: nil) + id: nil = s.caption diff --git a/plugins/additionals/app/views/additionals/_tag_list.html.slim b/plugins/additionals/app/views/additionals/_tag_list.html.slim deleted file mode 100755 index ec9858c..0000000 --- a/plugins/additionals/app/views/additionals/_tag_list.html.slim +++ /dev/null @@ -1,30 +0,0 @@ -- if defined?(show_always) && show_always || entry.tag_list.present? - .tags.attribute - - unless defined? hide_label - span.label - = l(:field_tag_list) - ' : - - if defined?(editable) && editable - #tags-data - = additionals_tag_links(entry.tags, - project: @project, - tags_without_color: defined?(tags_without_color) ? tags_without_color : false) - ' - span.contextual - = link_to l(:label_edit_tags), - {}, - onclick: "$('#edit_tags_form').show(); $('#tags-data').hide(); return false;", - id: 'edit_tags_link' - - #edit_tags_form style="display: none;" - = form_tag(update_url, method: :put, multipart: true) do - = render partial: 'tags_form' - ' - = submit_tag l(:button_save), class: 'button-small' - ' - = link_to l(:button_cancel), {}, onclick: "$('#edit_tags_form').hide(); $('#tags-data').show(); return false;" - - - else - = additionals_tag_links(entry.tags, - project: @project, - tags_without_color: defined?(tags_without_color) ? tags_without_color : false) diff --git a/plugins/additionals/app/views/additionals/settings/_additionals.html.slim b/plugins/additionals/app/views/additionals/settings/_additionals.html.slim index ab3d683..e7a92de 100755 --- a/plugins/additionals/app/views/additionals/settings/_additionals.html.slim +++ b/plugins/additionals/app/views/additionals/settings/_additionals.html.slim @@ -1,7 +1,3 @@ ' Need Help? : -= link_to(l(:label_additionals_doc), - 'https://additionals.readthedocs.io/en/latest/', - class: 'external', - target: '_blank', - rel: 'noopener') += link_to_external l(:label_additionals_doc), 'https://additionals.readthedocs.io/en/latest/' = render_tabs additionals_settings_tabs diff --git a/plugins/additionals/app/views/additionals/settings/_users.html.slim b/plugins/additionals/app/views/additionals/settings/_users.html.slim deleted file mode 100755 index 60bf889..0000000 --- a/plugins/additionals/app/views/additionals/settings/_users.html.slim +++ /dev/null @@ -1,5 +0,0 @@ -p - = additionals_settings_checkbox :invisible_captcha, - disabled: (true unless Setting.self_registration?) - em.info - = t(:invisible_captcha_info_html) diff --git a/plugins/additionals/app/views/additionals_macros/show.html.slim b/plugins/additionals/app/views/additionals_macros/show.html.slim index 9bb2744..f99555e 100755 --- a/plugins/additionals/app/views/additionals_macros/show.html.slim +++ b/plugins/additionals/app/views/additionals_macros/show.html.slim @@ -1,6 +1,6 @@ h2 = l(:label_settings_macros) + " (#{@available_macros.count})" -.info = t(:label_top_macros_help_html) +.info = t :label_top_macros_help_html br .box - @available_macros.each do |macro, options| diff --git a/plugins/additionals/app/views/admin/_system_info.html.slim b/plugins/additionals/app/views/admin/_system_info.html.slim index 11022e9..a2178d5 100755 --- a/plugins/additionals/app/views/admin/_system_info.html.slim +++ b/plugins/additionals/app/views/admin/_system_info.html.slim @@ -1,13 +1,6 @@ table.list - tr - td.name - = l :label_system_info - | : - td.name - = system_info - tr - td.name - = l :label_uptime - | : - td.name - = system_uptime + - AdditionalsInfo.system_infos.each_value do |system_info| + tr + td.name + = "#{system_info[:label]}:" + td.name = system_info[:value] diff --git a/plugins/additionals/app/views/auto_completes/_additionals_tag_list.html.slim b/plugins/additionals/app/views/auto_completes/_additionals_tag_list.html.slim deleted file mode 100755 index 7007689..0000000 --- a/plugins/additionals/app/views/auto_completes/_additionals_tag_list.html.slim +++ /dev/null @@ -1 +0,0 @@ -== @tags.collect { |tag| { 'id' => tag.name, 'text' => tag.name } }.to_json diff --git a/plugins/additionals/app/views/dashboards/_form.html.slim b/plugins/additionals/app/views/dashboards/_form.html.slim index 2ac2c01..230b427 100644 --- a/plugins/additionals/app/views/dashboards/_form.html.slim +++ b/plugins/additionals/app/views/dashboards/_form.html.slim @@ -9,10 +9,7 @@ .splitcontent .splitcontentleft - - - if @dashboard.new_record? - = hidden_field_tag 'dashboard[dashboard_type]', @dashboard.dashboard_type - + = hidden_field_tag 'dashboard[dashboard_type]', @dashboard.dashboard_type if @dashboard.new_record? - if @project && @allowed_projects.present? && @allowed_projects.count > 1 p = f.select :project_id, diff --git a/plugins/additionals/app/views/dashboards/blocks/_activity.html.slim b/plugins/additionals/app/views/dashboards/blocks/_activity.html.slim index 4d0f70f..71d56ca 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_activity.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_activity.html.slim @@ -6,6 +6,6 @@ - events_by_day = activity_dashboard_data settings, dashboard - title = Additionals.true?(settings[:me_only]) ? l(:label_my_activity) : l(:label_activity) h3 = link_to title, activity_path(user_id: User.current, - from: events_by_day.keys.first) + from: events_by_day.keys.first) = render partial: 'activities/activities', locals: { events_by_day: events_by_day } diff --git a/plugins/additionals/app/views/dashboards/blocks/_activity_settings.html.slim b/plugins/additionals/app/views/dashboards/blocks/_activity_settings.html.slim index b22be45..67f32af 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_activity_settings.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_activity_settings.html.slim @@ -1,17 +1,17 @@ -- max_entries = settings[:max_entries].presence || DashboardContent::DEFAULT_MAX_ENTRIES div id="#{block}-settings" style="#{'display: none;' if hide}" = form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do = hidden_field_tag "settings[#{block}][me_only]", '0' .box p label - = l(:label_max_entries) + = l :label_max_entries ' : - = number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true - + = number_field_tag "settings[#{block}][max_entries]", + settings[:max_entries].presence || DashboardContent::DEFAULT_MAX_ENTRIES, + min: 1, max: 1000, required: true p label - = l(:label_only_my_activities) + = l :label_only_my_activities ' : = check_box_tag "settings[#{block}][me_only]", '1', Additionals.true?(settings[:me_only]) diff --git a/plugins/additionals/app/views/dashboards/blocks/_feed.html.slim b/plugins/additionals/app/views/dashboards/blocks/_feed.html.slim index 7494ecd..af2b485 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_feed.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_feed.html.slim @@ -11,10 +11,7 @@ - if feed[:items].count.positive? ul.reporting-list.feed - feed[:items].each do |item| - li - = link_to item[:title], - item[:link], - class: 'external', rel: 'noopener noreferrer', target: '_blank' + li = link_to_external item[:title], item[:link] - else p.nodata = l :label_no_data - elsif settings[:url].blank? diff --git a/plugins/additionals/app/views/dashboards/blocks/_news.html.slim b/plugins/additionals/app/views/dashboards/blocks/_news.html.slim index aa7238d..ce223a1 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_news.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_news.html.slim @@ -6,7 +6,7 @@ h3.icon.icon-news = l :label_news_latest .box p label - = l(:label_max_entries) + = l :label_max_entries ' : = number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true p diff --git a/plugins/additionals/app/views/dashboards/blocks/_project_subprojects.html.slim b/plugins/additionals/app/views/dashboards/blocks/_project_subprojects.html.slim index bb8025a..e169418 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_project_subprojects.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_project_subprojects.html.slim @@ -1,7 +1,7 @@ - if @subprojects.any? h3.icon.icon-projects - = l(:label_subproject_plural) + = l :label_subproject_plural ul.subprojects - @subprojects.each do |project| li - = link_to(project.name, project_path(project), class: project.css_classes).html_safe + = link_to project.name, project_path(project), class: project.css_classes diff --git a/plugins/additionals/app/views/dashboards/blocks/_query_list.html.slim b/plugins/additionals/app/views/dashboards/blocks/_query_list.html.slim index 3372c23..1f7dc6e 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_query_list.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_query_list.html.slim @@ -22,6 +22,7 @@ - if count.positive? / required by some helpers of other plugins - @query = query + = render partial: query_block[:list_partial], locals: { query_block[:entities_var] => query.send(query_block[:entries_method], limit: settings[:max_entries] || DashboardContent::DEFAULT_MAX_ENTRIES), diff --git a/plugins/additionals/app/views/dashboards/blocks/_text.html.slim b/plugins/additionals/app/views/dashboards/blocks/_text.html.slim index 22e4756..8469bb4 100644 --- a/plugins/additionals/app/views/dashboards/blocks/_text.html.slim +++ b/plugins/additionals/app/views/dashboards/blocks/_text.html.slim @@ -1,26 +1,12 @@ -ruby: - title = settings[:title] || l(:label_text) - text = settings[:text] - -- if title.present? - h3 = title +- if settings[:text].nil? + h3 + = l :label_text_sync +- elsif settings[:title].present? + h3 + = settings[:title] - if @can_edit - div id="#{block}-settings" style='display: none;' - = form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do - .box - p - label - = l :field_title - ' : - = text_field_tag "settings[#{block}][title]", title - p - = text_area_tag "settings[#{block}][text]", text, rows: addtionals_textarea_cols(text), class: 'wiki-edit' - = wikitoolbar_for "settings_#{block}_text" - p - = submit_tag l(:button_save) - ' - = link_to_function l(:button_cancel), "$('##{block}-settings').toggle();" + = render partial: 'dashboards/blocks/text_async_settings', locals: { block: block, settings: settings } .wiki - = textilizable text + = textilizable settings[:text] diff --git a/plugins/additionals/app/views/dashboards/blocks/_text_async.html.slim b/plugins/additionals/app/views/dashboards/blocks/_text_async.html.slim new file mode 100644 index 0000000..db9a050 --- /dev/null +++ b/plugins/additionals/app/views/dashboards/blocks/_text_async.html.slim @@ -0,0 +1,10 @@ +- cache render_async_cache_key(_dashboard_async_blocks_path(@project, + dashboard.async_params(block, async, settings))), + expires_in: async[:cache_expires_in] || DashboardContent::RENDER_ASYNC_CACHE_EXPIRES_IN, + skip_digest: true do + + - if settings[:title].present? + h3 = settings[:title] + + .wiki + = textilizable settings[:text] diff --git a/plugins/additionals/app/views/dashboards/blocks/_text_async_settings.html.slim b/plugins/additionals/app/views/dashboards/blocks/_text_async_settings.html.slim new file mode 100644 index 0000000..c0cfc5d --- /dev/null +++ b/plugins/additionals/app/views/dashboards/blocks/_text_async_settings.html.slim @@ -0,0 +1,15 @@ +div id="#{block}-settings" style='display: none;' + = form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do + .box + p + label + = l :field_title + ' : + = text_field_tag "settings[#{block}][title]", (settings[:title] || l(:label_text_sync)) + p + = text_area_tag "settings[#{block}][text]", settings[:text], rows: addtionals_textarea_cols(settings[:text]), class: 'wiki-edit' + = wikitoolbar_for "settings_#{block}_text" + p + = submit_tag l :button_save + ' + = link_to_function l(:button_cancel), "$('##{block}-settings').toggle();" diff --git a/plugins/additionals/app/views/dashboards/edit.html.slim b/plugins/additionals/app/views/dashboards/edit.html.slim index 5b6ecca..acfe00a 100644 --- a/plugins/additionals/app/views/dashboards/edit.html.slim +++ b/plugins/additionals/app/views/dashboards/edit.html.slim @@ -1,7 +1,6 @@ h2 = l(:button_dashboard_edit) = labelled_form_for :dashboard, @dashboard, - url: { action: 'update', id: @dashboard.id }, - html: { multipart: true, method: :put, id: 'dashboard-form' } do |f| + html: { multipart: true, id: 'dashboard-form' } do |f| = render partial: 'form', locals: { f: f } = submit_tag l(:button_save) diff --git a/plugins/additionals/app/views/hooks/_view_wiki_form_bottom.html.slim b/plugins/additionals/app/views/hooks/_view_wiki_form_bottom.html.slim new file mode 100644 index 0000000..2f94ebd --- /dev/null +++ b/plugins/additionals/app/views/hooks/_view_wiki_form_bottom.html.slim @@ -0,0 +1 @@ += call_hook :view_wiki_form_bottom, content: @content, page: @page diff --git a/plugins/additionals/app/views/hooks/_view_wiki_show_bottom.html.slim b/plugins/additionals/app/views/hooks/_view_wiki_show_bottom.html.slim new file mode 100644 index 0000000..bfefc0f --- /dev/null +++ b/plugins/additionals/app/views/hooks/_view_wiki_show_bottom.html.slim @@ -0,0 +1 @@ += call_hook :view_wiki_show_bottom, content: @content, page: @page diff --git a/plugins/additionals/app/views/issues/_additionals_action_menu.html.slim b/plugins/additionals/app/views/issues/_additionals_action_menu.html.slim index 7ec5a38..99c954d 100755 --- a/plugins/additionals/app/views/issues/_additionals_action_menu.html.slim +++ b/plugins/additionals/app/views/issues/_additionals_action_menu.html.slim @@ -1,5 +1,9 @@ -- if User.current.logged? && @issue.editable? && Additionals.setting?(:issue_assign_to_me) && \ - @issue.assigned_to_id != User.current.id && @project.assignable_users.detect { |u| u.id == User.current.id } +- if User.current.logged? && \ + Additionals.setting?(:issue_assign_to_me) && \ + @issue.editable? && \ + @issue.safe_attribute?('assigned_to_id') && \ + @issue.assigned_to_id != User.current.id && \ + @project.assignable_users.detect { |u| u.id == User.current.id } = link_to font_awesome_icon('far_user-circle', post_text: l(:button_assign_to_me)), issue_assign_to_me_path(@issue), method: :put, class: 'assign-to-me' diff --git a/plugins/additionals/app/views/issues/_additionals_sidebar_issues.html.slim b/plugins/additionals/app/views/issues/_additionals_sidebar_issues.html.slim index cbd8e00..a6cf08b 100644 --- a/plugins/additionals/app/views/issues/_additionals_sidebar_issues.html.slim +++ b/plugins/additionals/app/views/issues/_additionals_sidebar_issues.html.slim @@ -1,19 +1,19 @@ - if Additionals.setting?(:issue_change_status_in_sidebar) && \ - @issue && \ - User.current.allowed_to?(:edit_issues, @project) && \ - (!@issue.closed? || User.current.allowed_to?(:edit_closed_issues, @project)) - - statuses = @issue.sidbar_change_status_allowed_to(User.current) + @issue && \ + User.current.allowed_to?(:edit_issues, @project) && \ + (!@issue.closed? || User.current.allowed_to?(:edit_closed_issues, @project)) + - statuses = @issue.sidbar_change_status_allowed_to User.current - if statuses.present? - h3 = l(:label_issue_change_status) + h3 = l :label_issue_change_status ul.issue-status-change-sidebar - statuses.each do |s| - - if s != @issue.status + - unless s == @issue.status li - if s.is_closed? - = link_to(font_awesome_icon('fas_caret-square-left', post_text: s.name), + = link_to font_awesome_icon('fas_caret-square-left', post_text: s.name), issue_change_status_path(@issue, new_status_id: s.id), - method: :put, class: "status-switch status-#{s.id}") + method: :put, class: "status-switch status-#{s.id}" - else - = link_to(font_awesome_icon('far_caret-square-left', post_text: s.name), + = link_to font_awesome_icon('far_caret-square-left', post_text: s.name), issue_change_status_path(@issue, new_status_id: s.id), - method: :put, class: "status-switch status-#{s.id}") + method: :put, class: "status-switch status-#{s.id}" diff --git a/plugins/additionals/app/views/projects/show.html.slim b/plugins/additionals/app/views/projects/show.html.slim index 35005f6..2023f3c 100644 --- a/plugins/additionals/app/views/projects/show.html.slim +++ b/plugins/additionals/app/views/projects/show.html.slim @@ -6,8 +6,7 @@ edit_project_dashboard_path(@project, @dashboard), class: 'icon icon-edit' - - unless Redmine::Plugin.installed? 'redmine_reporting' - = bookmark_link @project + = bookmark_link @project unless Redmine::Plugin.installed? 'redmine_reporting' = call_hook :view_project_contextual_links, project: @project - if @dashboard&.editable? @@ -49,9 +48,7 @@ class: 'icon icon-del' = sidebar_action_toggle @dashboard_sidebar, @dashboard, @project - - unless @dashboard_sidebar - = render_dashboard_actionlist @dashboard, @project - + = render_dashboard_actionlist @dashboard, @project unless @dashboard_sidebar = call_hook :view_project_actions_dropdown, project: @project - if User.current.allowed_to?(:edit_project, @project) diff --git a/plugins/additionals/app/views/users/_additionals_contextual.html.slim b/plugins/additionals/app/views/users/_additionals_contextual.html.slim index ba37a40..68c5b27 100755 --- a/plugins/additionals/app/views/users/_additionals_contextual.html.slim +++ b/plugins/additionals/app/views/users/_additionals_contextual.html.slim @@ -1,4 +1,3 @@ - if Additionals.setting?(:new_issue_on_profile) && @memberships.present? - - project_url = memberships_new_issue_project_url(user, @memberships) - - if project_url.present? - = link_to(l(:label_issue_new), project_url, class: 'user-new-issue icon icon-add') + - project_url = memberships_new_issue_project_url user, @memberships + = link_to l(:label_issue_new), project_url, class: 'user-new-issue icon icon-add' if project_url.present? diff --git a/plugins/additionals/app/views/welcome/index.html.slim b/plugins/additionals/app/views/welcome/index.html.slim index f7cd53f..40de8ba 100644 --- a/plugins/additionals/app/views/welcome/index.html.slim +++ b/plugins/additionals/app/views/welcome/index.html.slim @@ -21,8 +21,7 @@ = delete_dashboard_link dashboard_path(@dashboard), class: 'icon icon-del' = sidebar_action_toggle @dashboard_sidebar, @dashboard - - unless @dashboard_sidebar - = render_dashboard_actionlist @dashboard + = render_dashboard_actionlist @dashboard unless @dashboard_sidebar = call_hook :view_welcome_show_actions_dropdown diff --git a/plugins/additionals/app/views/wiki/_user_macros.html.slim b/plugins/additionals/app/views/wiki/_user_macros.html.slim index 823d815..00ead10 100755 --- a/plugins/additionals/app/views/wiki/_user_macros.html.slim +++ b/plugins/additionals/app/views/wiki/_user_macros.html.slim @@ -7,6 +7,7 @@ = avatar(user, size: 50) .user.line[style="font-weight: bold;"] = link_to_user user + - if !user_roles.nil? && user_roles[user.id] .user.line = l :field_role @@ -16,6 +17,7 @@ = l :field_login ' : = link_to user.login, "/users/#{user.id}" + - unless user.pref.hide_mail .user.line = l :field_mail diff --git a/plugins/additionals/assets/javascripts/Chart.bundle.min.js b/plugins/additionals/assets/javascripts/Chart.bundle.min.js index 55d9eb0..7134d26 100644 --- a/plugins/additionals/assets/javascripts/Chart.bundle.min.js +++ b/plugins/additionals/assets/javascripts/Chart.bundle.min.js @@ -1,7 +1,7 @@ /*! - * Chart.js v2.9.3 + * Chart.js v2.9.4 * https://www.chartjs.org - * (c) 2019 Chart.js Contributors + * (c) 2020 Chart.js Contributors * Released under the MIT License */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Chart=e()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},i=e((function(t){var e={};for(var i in n)n.hasOwnProperty(i)&&(e[n[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=e[t];if(i)return i;var a,r,o,s=1/0;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));i.rgb,i.hsl,i.hsv,i.hwb,i.cmyk,i.xyz,i.lab,i.lch,i.hex,i.keyword,i.ansi16,i.ansi256,i.hcg,i.apple,i.gray;function a(t){var e=function(){for(var t={},e=Object.keys(i),n=e.length,a=0;a1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var l=s,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d={getRgba:h,getHsla:c,getRgb:function(t){var e=h(t);return e&&e.slice(0,3)},getHsl:function(t){var e=c(t);return e&&e.slice(0,3)},getHwb:f,getAlpha:function(t){var e=h(t);if(e)return e[3];if(e=c(t))return e[3];if(e=f(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+b(t[0])+b(t[1])+b(t[2])+(e>=0&&e<1?b(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:g,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return m(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:m,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return y[t.slice(0,3)]}};function h(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new _,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},_.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},_.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},_.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;a--)e.call(n,t[a],a);else for(a=0;a=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-D.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*D.easeInBounce(2*t):.5*D.easeOutBounce(2*t-1)+.5}},C={effects:D};S.easingEffects=D;var P=Math.PI,T=P/180,O=2*P,A=P/2,F=P/4,I=2*P/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r=n?(H.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},Q=H.options.resolve,tt=["push","pop","shift","splice","unshift"];function et(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(tt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var nt=function(t,e){this.initialize(t,e)};H.extend(nt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&et(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;na?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function ot(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+at,rt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=at,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+at,n.startAngle,!0),a=0;as;)a-=at;for(;a=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/at)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+at,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;tt.x&&(e=bt(e,"left","right")):t.basen?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function xt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&vt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}W._set("global",{elements:{rectangle:{backgroundColor:mt,borderColor:mt,borderSkipped:"bottom",borderWidth:0}}});var _t=$.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=vt(t),n=e.right-e.left,i=e.bottom-e.top,a=yt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return xt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return pt(n)?xt(n,t,null):xt(n,null,e)},inXRange:function(t){return xt(this._view,t,null)},inYRange:function(t){return xt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return pt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return pt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),wt={},kt=st,Mt=dt,St=gt,Dt=_t;wt.Arc=kt,wt.Line=Mt,wt.Point=St,wt.Rectangle=Dt;var Ct=H._deprecated,Pt=H.valueOrDefault;function Tt(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=H.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return H.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}W._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),W._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Ot=it.extend({dataElementType:wt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;it.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Ct("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Ct("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Ct("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Ct("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Ct("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e=0&&m.min>=0?m.min:m.max,x=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&r<0||m.max>=0&&r>0)&&(y+=r));return o=h.getPixelForValue(y),l=(s=h.getPixelForValue(y+x))-o,void 0!==p&&Math.abs(l)=0&&!c||x<0&&c?o-p:o+p),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=Rt?-Nt:b<-Rt?Nt:0)+p,x=Math.cos(b),_=Math.sin(b),w=Math.cos(y),k=Math.sin(y),M=b<=0&&y>=0||y>=Nt,S=b<=Wt&&y>=Wt||y>=Nt+Wt,D=b<=-Wt&&y>=-Wt||y>=Rt+Wt,C=b===-Rt||y>=Rt?-1:Math.min(x,x*m,w,w*m),P=D?-1:Math.min(_,_*m,k,k*m),T=M?1:Math.max(x,x*m,w,w*m),O=S?1:Math.max(_,_*m,k,k*m);u=(T-C)/2,d=(O-P)/2,h=-(T+C)/2,c=-(O+P)/2}for(i=0,a=g.length;i0&&!isNaN(t)?Nt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Ht(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ae(t,e,{intersect:!1})},point:function(t,e){return ee(t,Qt(e,t))},nearest:function(t,e,n){var i=Qt(e,t);n.axis=n.axis||"xy";var a=ie(n.axis);return ne(t,i,n.intersect,a)},x:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},oe=H.extend;function se(t,e){return H.where(t,(function(t){return t.pos===e}))}function le(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function ue(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function de(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-ue(o,t,"left","right"),a=e.outerHeight-ue(o,t,"top","bottom"),i!==t.w||a!==t.h)return t.w=i,t.h=a,n.horizontal?i!==t.w:a!==t.h}function he(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function ce(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&ge.default||ge,ve="$chartjs",be="chartjs-size-monitor",ye="chartjs-render-monitor",xe="chartjs-render-animation",_e=["animationstart","webkitAnimationStart"],we={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ke(t,e){var n=H.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var Me=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Se(t,e,n){t.addEventListener(e,n,Me)}function De(t,e,n){t.removeEventListener(e,n,Me)}function Ce(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Pe(t){var e=document.createElement("div");return e.className=t||"",e}function Te(t,e,n){var i,a,r,o,s=t[ve]||(t[ve]={}),l=s.resizer=function(t){var e=Pe(be),n=Pe(be+"-expand"),i=Pe(be+"-shrink");n.appendChild(Pe()),i.appendChild(Pe()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return Se(n,"scroll",a.bind(n,"expand")),Se(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Ce("resize",n)),i&&i.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?t.split("\n"):t}function Ve(t){var e=W.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Ne(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Ne(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Ne(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Ne(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Ne(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Ne(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Ne(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Ne(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Ne(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function He(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Be(t){return ze([],Ee(t))}var je=$.extend({initialize:function(){this._model=Ve(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=ze(o,Ee(i)),o=ze(o,Ee(a)),o=ze(o,Ee(r))},getBeforeBody:function(){return Be(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return H.each(t,(function(t){var r={before:[],lines:[],after:[]};ze(r.before,Ee(i.beforeLabel.call(n,t,e))),ze(r.lines,i.label.call(n,t,e)),ze(r.after,Ee(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return Be(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=ze(r,Ee(n)),r=ze(r,Ee(i)),r=ze(r,Ee(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Ve(c),m=h._active,p=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},y={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(m.length){g.opacity=1;var _=[],w=[];x=Ye[c.position].call(h,m,h._eventPosition);var k=[];for(e=0,n=m.length;ei.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,y,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.yl.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,y),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=y.width,g.height=y.height,g.caretX=x.x,g.caretY=x.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=We(e.rtl,e.x,e.width);for(t.x=He(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=H.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,H.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),H.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!H.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),Ue=Ye,Ge=je;Ge.positioners=Ue;var qe=H.valueOrDefault;function Ze(){return H.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?H.merge(e[t][a],[Re.getScaleDefaults(r),o]):H.merge(e[t][a],o)}else H._merger(t,e,n,i)}})}function $e(){return H.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=Ze(a,r):"scale"===t?e[t]=H.merge(a,[Re.getScaleDefaults(r.type),r]):H._merger(t,e,n,i)}})}function Xe(t){var e=t.options;H.each(t.scales,(function(e){me.removeBox(t,e)})),e=$e(W.global,W[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Ke(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(H.findIndex(t,a)>=0);return i}function Je(t){return"top"===t||"bottom"===t}function Qe(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}W._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var tn=function(t,e){return this.construct(t,e),this};H.extend(tn.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=$e(W.global,W[t.type],t.options||{}),t}(e);var i=Ie.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=H.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,tn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Le.notify(t,"beforeInit"),H.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Le.notify(t,"afterInit"),t},clear:function(){return H.canvas.clear(this),this},stop:function(){return J.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(H.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:H.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",H.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Le.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;H.each(e.xAxes,(function(t,n){t.id||(t.id=Ke(e.xAxes,"x-axis-",n))})),H.each(e.yAxes,(function(t,n){t.id||(t.id=Ke(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),H.each(i,(function(e){var i=e.options,r=i.id,o=qe(i.type,e.dtype);Je(i.position)!==Je(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Re.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),H.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Re.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t=0;--n)this.drawDataset(e[n],t);Le.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Le.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Le.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Le.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Le.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return re.modes.single(this,t)},getElementsAtEvent:function(t){return re.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return re.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=re.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return re.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=H.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=H.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(H.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},sn=H.isArray,ln=H.isNullOrUndef,un=H.valueOrDefault,dn=H.valueAtIndexOrDefault;function hn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function cn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,m,p,v=n.length,b=[],y=[],x=[];for(a=0;ae){for(n=0;n=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-fn(l.gridLines)-u.padding-gn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=H.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){H.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){H.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=fn(o)+gn(r)),u?s&&(e.height=fn(o)+gn(r)):e.height=t.maxHeight,a.display&&s){var d=pn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,m=h.highest,p=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=H.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y),w=_*g.width+x*(m.height-(b?m.offset:0))+(b?0:p);e.height=Math.min(t.maxHeight,e.height+w+v);var k,M,S=t.getPixelForTick(0)-t.left,D=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?x*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):x*f.width+_*f.offset):(k=c.width/2,M=f.width/2),t.paddingLeft=Math.max((k-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-D)*t.width/(t.width-D),0)+3}else{var C=a.mirror?0:g.width+v+p;e.width=Math.min(t.maxWidth,e.width+C),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){H.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ln(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;nn-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;es)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;iu)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e1?(h-d)/(u-1):null,bn(t,i,H.isNullOrUndef(a)?0:d-a,d),bn(t,i,h,H.isNullOrUndef(a)?t.length:h+a),vn(t)}return bn(t,i),vn(t)},_tickSize:function(){var t=this.options.ticks,e=H.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;xn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return _n(e)||_n(n)||(t=o.chart.data.datasets[n].data[e]),_n(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=H.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),kn={position:"bottom"};wn._defaults=kn;var Mn=H.noop,Sn=H.isNullOrUndef;var Dn=xn.extend({getRightValue:function(t){return"string"==typeof t?+t:xn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=H.sign(t.min),i=H.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Mn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:H.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,m=H.niceNum((g-f)/u/l)*l;if(m<1e-14&&Sn(d)&&Sn(h))return[f,g];(r=Math.ceil(g/m)-Math.floor(f/m))>u&&(m=H.niceNum(r*m/u/l)*l),s||Sn(c)?n=Math.pow(10,H._decimalPlaces(m)):(n=Math.pow(10,c),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,a=Math.ceil(g/m)*m,s&&(!Sn(d)&&H.almostWhole(d/m,m/1e3)&&(i=d),!Sn(h)&&H.almostWhole(h/m,m/1e3)&&(a=h)),r=(a-i)/m,r=H.almostEquals(r,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Sn(d)?i:d);for(var p=1;pe.length-1?null:this.getPixelForValue(e[t])}}),An=Cn;On._defaults=An;var Fn=H.valueOrDefault,In=H.math.log10;var Ln={position:"left",ticks:{callback:on.formatters.logarithmic}};function Rn(t,e){return H.isFinite(t)&&t>=0?t:e}var Nn=xn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t0){var e=H.min(t),n=H.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(In(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Rn(e.min),max:Rn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=Fn(t.min,Math.pow(10,Math.floor(In(e.min)))),o=Math.floor(In(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(In(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(In(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(In(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;xn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Fn(t.options.ticks.fontSize,W.global.defaultFontSize)/t._length),t._startValue=In(e),t._valueOffset=n,t._valueRange=(In(t.max)-In(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(In(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Wn=Ln;Nn._defaults=Wn;var Yn=H.valueOrDefault,zn=H.valueAtIndexOrDefault,En=H.options.resolve,Vn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:on.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Hn(t){var e=t.ticks;return e.display&&t.display?Yn(e.fontSize,W.global.defaultFontSize)+2*e.backdropPaddingY:0}function Bn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:ta?{start:e-n,end:e}:{start:e,end:e+n}}function jn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Un(t,e,n,i){var a,r,o=n.y+i/2;if(H.isArray(e))for(a=0,r=e.length;a270||t<90)&&(n.y-=e.h)}function qn(t){return H.isNumber(t)?t:0}var Zn=Dn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Hn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;H.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);H.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Hn(this.options))},convertTicksToLabels:function(){var t=this;Dn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=H.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=H.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=qn(a),r=qn(r),o=qn(o),s=qn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(H.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Yn(s.lineWidth,o.lineWidth),u=Yn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Hn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=H.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=zn(i.fontColor,s,W.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=H.toDegrees(h);e.textAlign=jn(c),Gn(c,t._pointLabelSizes[s],u),Un(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&H.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=zn(e.color,i-1),u=zn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=H.options._parseFont(n),s=Yn(n.fontColor,W.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",H.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:H.noop}),$n=Vn;Zn._defaults=$n;var Xn=H._deprecated,Kn=H.options.resolve,Jn=H.valueOrDefault,Qn=Number.MIN_SAFE_INTEGER||-9007199254740991,ti=Number.MAX_SAFE_INTEGER||9007199254740991,ei={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ni=Object.keys(ei);function ii(t,e){return t-e}function ai(t){return H.valueOrDefault(t.time.min,t.ticks.min)}function ri(t){return H.valueOrDefault(t.time.max,t.ticks.max)}function oi(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function si(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),H.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),H.isFinite(o)||(o=n.parse(o))),o)}function li(t,e){if(H.isNullOrUndef(e))return null;var n=t.options.time,i=si(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function ui(t,e,n,i){var a,r,o,s=ni.length;for(a=ni.indexOf(t);a=0&&(e[r].major=!0);return e}(t,r,o,n):r}var hi=xn.extend({initialize:function(){this.mergeTicksOptions(),xn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new rn._date(e.adapters.date);return Xn("time scale",n.format,"time.format","time.parser"),Xn("time scale",n.min,"time.min","ticks.min"),Xn("time scale",n.max,"time.max","ticks.max"),H.mergeIf(n.displayFormats,i.formats()),xn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),xn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=ti,f=Qn,g=[],m=[],p=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?ui(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ni.length-1;r>=ni.indexOf(n);r--)if(o=ni[r],ei[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ni[n?ni.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ni.indexOf(t)+1,n=ni.length;ee&&s=0&&t0?s:1}}),ci={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};hi._defaults=ci;var fi={category:wn,linear:On,logarithmic:Nn,radialLinear:Zn,time:hi},gi=e((function(e,n){e.exports=function(){var n,i;function a(){return n.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var n,i=[];for(n=0;n>>0,i=0;i0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}var E=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,V=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},B={};function j(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(B[t]=a),e&&(B[e[0]]=function(){return z(a.apply(this,arguments),e[1],e[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=G(e,t.localeData()),H[e]=H[e]||function(t){var e,n,i,a=t.match(E);for(e=0,n=a.length;e=0&&V.test(t);)t=t.replace(V,i),V.lastIndex=0,n-=1;return t}var q=/\d/,Z=/\d\d/,$=/\d{3}/,X=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,nt=/\d{1,4}/,it=/[+-]?\d{1,6}/,at=/\d+/,rt=/[+-]?\d+/,ot=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ut={};function dt(t,e,n){ut[t]=O(e)?e:function(t,i){return t&&n?n:e}}function ht(t,e){return h(ut,t)?ut[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,a){return e||n||i||a}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function gt(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),l(e)&&(i=function(t,n){n[e]=k(t)}),n=0;n68?1900:2e3)};var Pt,Tt=Ot("FullYear",!0);function Ot(t,e){return function(n){return null!=n?(Ft(this,t,n),a.updateOffset(this,e),this):At(this,t)}}function At(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Ft(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Ct(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),It(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function It(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=function(t,e){return(t%e+e)%e}(e,12);return t+=(e-n)/12,1===n?Ct(t)?29:28:31-n%7%2}Pt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(s=new Date(t+400,e,n,i,a,r,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,a,r,o),s}function jt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ut(t,e,n){var i=7+e-n;return-(7+jt(t,0,i).getUTCDay()-e)%7+i-1}function Gt(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Ut(t,i,a);return s<=0?o=Dt(r=t-1)+s:s>Dt(t)?(r=t+1,o=s-Dt(t)):(r=t,o=s),{year:r,dayOfYear:o}}function qt(t,e,n){var i,a,r=Ut(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Zt(a=t.year()-1,e,n):o>Zt(t.year(),e,n)?(i=o-Zt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Zt(t,e,n){var i=Ut(t,e,n),a=Ut(t+1,e,n);return(Dt(t)-i+a)/7}function $t(t,e){return t.slice(e,7).concat(t.slice(0,e))}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Y("week",5),Y("isoWeek",5),dt("w",J),dt("ww",J,Z),dt("W",J),dt("WW",J,Z),mt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=k(t)})),j("d",0,"do","day"),j("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),j("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),j("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),dt("d",J),dt("e",J),dt("E",J),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,n,i){e[i]=k(t)}));var Xt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Jt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null}var te=lt,ee=lt,ne=lt;function ie(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=f([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ct(s[e]),l[e]=ct(l[e]),u[e]=ct(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ae(){return this.hours()%12||12}function re(t,e){j(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function oe(t,e){return e._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,ae),j("k",["kk",2],0,(function(){return this.hours()||24})),j("hmm",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)})),j("hmmss",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)})),j("Hmm",0,0,(function(){return""+this.hours()+z(this.minutes(),2)})),j("Hmmss",0,0,(function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)})),re("a",!0),re("A",!1),L("hour","h"),Y("hour",13),dt("a",oe),dt("A",oe),dt("H",J),dt("h",J),dt("k",J),dt("HH",J,Z),dt("hh",J,Z),dt("kk",J,Z),dt("hmm",Q),dt("hmmss",tt),dt("Hmm",Q),dt("Hmmss",tt),gt(["H","HH"],xt),gt(["k","kk"],(function(t,e,n){var i=k(t);e[xt]=24===i?0:i})),gt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),gt(["h","hh"],(function(t,e,n){e[xt]=k(t),g(n).bigHour=!0})),gt("hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i)),g(n).bigHour=!0})),gt("hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a)),g(n).bigHour=!0})),gt("Hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i))})),gt("Hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a))}));var se,le=Ot("Hours",!0),ue={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Rt,monthsShort:Nt,week:{dow:0,doy:6},weekdays:Xt,weekdaysMin:Jt,weekdaysShort:Kt,meridiemParse:/[ap]\.?m?\.?/i},de={},he={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(n){var i=null;if(!de[n]&&e&&e.exports)try{i=se._abbr,t(),ge(i)}catch(t){}return de[n]}function ge(t,e){var n;return t&&((n=s(e)?pe(t):me(t,e))?se=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),se._abbr}function me(t,e){if(null!==e){var n,i=ue;if(e.abbr=t,null!=de[t])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=de[t]._config;else if(null!=e.parentLocale)if(null!=de[e.parentLocale])i=de[e.parentLocale]._config;else{if(null==(n=fe(e.parentLocale)))return he[e.parentLocale]||(he[e.parentLocale]=[]),he[e.parentLocale].push({name:t,config:e}),null;i=n._config}return de[t]=new F(A(i,e)),he[t]&&he[t].forEach((function(t){me(t.name,t.config)})),ge(t),de[t]}return delete de[t],null}function pe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return se;if(!r(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r0;){if(i=fe(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&M(a,n,!0)>=e-1)break;e--}r++}return se}(t)}function ve(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[bt]<0||n[bt]>11?bt:n[yt]<1||n[yt]>It(n[vt],n[bt])?yt:n[xt]<0||n[xt]>24||24===n[xt]&&(0!==n[_t]||0!==n[wt]||0!==n[kt])?xt:n[_t]<0||n[_t]>59?_t:n[wt]<0||n[wt]>59?wt:n[kt]<0||n[kt]>999?kt:-1,g(t)._overflowDayOfYear&&(eyt)&&(e=yt),g(t)._overflowWeeks&&-1===e&&(e=Mt),g(t)._overflowWeekday&&-1===e&&(e=St),g(t).overflow=e),t}function be(t,e,n){return null!=t?t:null!=e?e:n}function ye(t){var e,n,i,r,o,s=[];if(!t._d){for(i=function(t){var e=new Date(a.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[yt]&&null==t._a[bt]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=be(e.GG,t._a[vt],qt(Le(),1,4).year),i=be(e.W,1),((a=be(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=qt(Le(),r,o);n=be(e.gg,t._a[vt],u.year),i=be(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Zt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=Gt(n,i,a,r,o),t._a[vt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=be(t._a[vt],i[vt]),(t._dayOfYear>Dt(o)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=jt(o,0,t._dayOfYear),t._a[bt]=n.getUTCMonth(),t._a[yt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=i[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[xt]&&0===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[xt]=0),t._d=(t._useUTC?jt:Bt).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[xt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(g(t).weekdayMismatch=!0)}}var xe=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_e=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,we=/Z|[+-]\d\d(?::?\d\d)?/,ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Se=/^\/?Date\((\-?\d+)/i;function De(t){var e,n,i,a,r,o,s=t._i,l=xe.exec(s)||_e.exec(s);if(l){for(g(t).iso=!0,e=0,n=ke.length;e0&&g(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[r]?(n?g(t).empty=!1:g(t).unusedTokens.push(r),pt(r,n,t)):t._strict&&!n&&g(t).unusedTokens.push(r);g(t).charsLeftOver=l-u,s.length>0&&g(t).unusedInput.push(s),t._a[xt]<=12&&!0===g(t).bigHour&&t._a[xt]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[xt]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[xt],t._meridiem),ye(t),ve(t)}else Oe(t);else De(t)}function Fe(t){var e=t._i,n=t._f;return t._locale=t._locale||pe(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new x(ve(e)):(u(e)?t._d=e:r(n)?function(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;athis?this:t:p()}));function We(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Le();for(n=e[0],i=1;i=0?new Date(t+400,e,n)-hn:new Date(t,e,n).valueOf()}function gn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hn:Date.UTC(t,e,n)}function mn(t,e){j(0,[t,t.length],0,e)}function pn(t,e,n,i,a){var r;return null==t?qt(this,i,a).year:(e>(r=Zt(t,i,a))&&(e=r),vn.call(this,t,e,n,i,a))}function vn(t,e,n,i,a){var r=Gt(t,e,n,i,a),o=jt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}j(0,["gg",2],0,(function(){return this.weekYear()%100})),j(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),mn("gggg","weekYear"),mn("ggggg","weekYear"),mn("GGGG","isoWeekYear"),mn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),dt("G",rt),dt("g",rt),dt("GG",J,Z),dt("gg",J,Z),dt("GGGG",nt,X),dt("gggg",nt,X),dt("GGGGG",it,K),dt("ggggg",it,K),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,n,i){e[i]=a.parseTwoDigitYear(t)})),j("Q",0,"Qo","quarter"),L("quarter","Q"),Y("quarter",7),dt("Q",q),gt("Q",(function(t,e){e[bt]=3*(k(t)-1)})),j("D",["DD",2],"Do","date"),L("date","D"),Y("date",9),dt("D",J),dt("DD",J,Z),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),gt(["D","DD"],yt),gt("Do",(function(t,e){e[yt]=k(t.match(J)[0])}));var bn=Ot("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Y("dayOfYear",4),dt("DDD",et),dt("DDDD",$),gt(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=k(t)})),j("m",["mm",2],0,"minute"),L("minute","m"),Y("minute",14),dt("m",J),dt("mm",J,Z),gt(["m","mm"],_t);var yn=Ot("Minutes",!1);j("s",["ss",2],0,"second"),L("second","s"),Y("second",15),dt("s",J),dt("ss",J,Z),gt(["s","ss"],wt);var xn,_n=Ot("Seconds",!1);for(j("S",0,0,(function(){return~~(this.millisecond()/100)})),j(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),j(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),j(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),j(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),j(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),j(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),Y("millisecond",16),dt("S",et,q),dt("SS",et,Z),dt("SSS",et,$),xn="SSSS";xn.length<=9;xn+="S")dt(xn,at);function wn(t,e){e[kt]=k(1e3*("0."+t))}for(xn="S";xn.length<=9;xn+="S")gt(xn,wn);var kn=Ot("Milliseconds",!1);j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var Mn=x.prototype;function Sn(t){return t}Mn.add=en,Mn.calendar=function(t,e){var n=t||Le(),i=Ue(n,this).startOf("day"),r=a.calendarFormat(this,i)||"sameElse",o=e&&(O(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,Le(n)))},Mn.clone=function(){return new x(this)},Mn.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Ue(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=R(e)){case"year":r=an(this,i)/12;break;case"month":r=an(this,i);break;case"quarter":r=an(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:w(r)},Mn.endOf=function(t){var e;if(void 0===(t=R(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?gn:fn;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=dn-cn(e+(this._isUTC?0:this.utcOffset()*un),dn)-1;break;case"minute":e=this._d.valueOf(),e+=un-cn(e,un)-1;break;case"second":e=this._d.valueOf(),e+=ln-cn(e,ln)-1}return this._d.setTime(e),a.updateOffset(this,!0),this},Mn.format=function(t){t||(t=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},Mn.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.fromNow=function(t){return this.from(Le(),t)},Mn.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.toNow=function(t){return this.to(Le(),t)},Mn.get=function(t){return O(this[t=R(t)])?this[t]():this},Mn.invalidAt=function(){return g(this).overflow},Mn.isAfter=function(t,e){var n=_(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=R(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?U(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},Mn.toJSON=function(){return this.isValid()?this.toISOString():null},Mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mn.unix=function(){return Math.floor(this.valueOf()/1e3)},Mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mn.year=Tt,Mn.isLeapYear=function(){return Ct(this.year())},Mn.weekYear=function(t){return pn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Mn.isoWeekYear=function(t){return pn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Mn.quarter=Mn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Mn.month=zt,Mn.daysInMonth=function(){return It(this.year(),this.month())},Mn.week=Mn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Mn.isoWeek=Mn.isoWeeks=function(t){var e=qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Mn.weeksInYear=function(){var t=this.localeData()._week;return Zt(this.year(),t.dow,t.doy)},Mn.isoWeeksInYear=function(){return Zt(this.year(),1,4)},Mn.date=bn,Mn.day=Mn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},Mn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Mn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Mn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Mn.hour=Mn.hours=le,Mn.minute=Mn.minutes=yn,Mn.second=Mn.seconds=_n,Mn.millisecond=Mn.milliseconds=kn,Mn.utcOffset=function(t,e,n){var i,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=je(st,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(i=Ge(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?tn(this,Xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ge(this)},Mn.utc=function(t){return this.utcOffset(0,t)},Mn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ge(this),"m")),this},Mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=je(ot,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Mn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Le(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mn.isUtc=qe,Mn.isUTC=qe,Mn.zoneAbbr=function(){return this._isUTC?"UTC":""},Mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mn.dates=D("dates accessor is deprecated. Use date instead.",bn),Mn.months=D("months accessor is deprecated. Use month instead",zt),Mn.years=D("years accessor is deprecated. Use year instead",Tt),Mn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),Mn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),(t=Fe(t))._a){var e=t._isUTC?f(t._a):Le(t._a);this._isDSTShifted=this.isValid()&&M(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Dn=F.prototype;function Cn(t,e,n,i){var a=pe(),r=f().set(i,e);return a[n](r,t)}function Pn(t,e,n){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return Cn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=Cn(t,i,n,"month");return a}function Tn(t,e,n,i){"boolean"==typeof t?(l(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,l(e)&&(n=e,e=void 0),e=e||"");var a,r=pe(),o=t?r._week.dow:0;if(null!=n)return Cn(e,(n+o)%7,i,"day");var s=[];for(a=0;a<7;a++)s[a]=Cn(e,(a+o)%7,i,"day");return s}Dn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return O(i)?i.call(e,n):i},Dn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Dn.invalidDate=function(){return this._invalidDate},Dn.ordinal=function(t){return this._ordinal.replace("%d",t)},Dn.preparse=Sn,Dn.postformat=Sn,Dn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return O(a)?a(t,e,n,i):a.replace(/%d/i,t)},Dn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)},Dn.set=function(t){var e,n;for(n in t)O(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Dn.months=function(t,e){return t?r(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Lt).test(e)?"format":"standalone"][t.month()]:r(this._months)?this._months:this._months.standalone},Dn.monthsShort=function(t,e){return t?r(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Lt.test(e)?"format":"standalone"][t.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Dn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return Wt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},Dn.monthsRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Vt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Dn.monthsShortRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Et),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Dn.week=function(t){return qt(t,this._week.dow,this._week.doy).week},Dn.firstDayOfYear=function(){return this._week.doy},Dn.firstDayOfWeek=function(){return this._week.dow},Dn.weekdays=function(t,e){var n=r(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?$t(n,this._week.dow):t?n[t.day()]:n},Dn.weekdaysMin=function(t){return!0===t?$t(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Dn.weekdaysShort=function(t){return!0===t?$t(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Dn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Qt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},Dn.weekdaysRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Dn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Dn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ne),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Dn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Dn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ge("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",ge),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",pe);var On=Math.abs;function An(t,e,n,i){var a=Xe(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function Fn(t){return t<0?Math.floor(t):Math.ceil(t)}function In(t){return 4800*t/146097}function Ln(t){return 146097*t/4800}function Rn(t){return function(){return this.as(t)}}var Nn=Rn("ms"),Wn=Rn("s"),Yn=Rn("m"),zn=Rn("h"),En=Rn("d"),Vn=Rn("w"),Hn=Rn("M"),Bn=Rn("Q"),jn=Rn("y");function Un(t){return function(){return this.isValid()?this._data[t]:NaN}}var Gn=Un("milliseconds"),qn=Un("seconds"),Zn=Un("minutes"),$n=Un("hours"),Xn=Un("days"),Kn=Un("months"),Jn=Un("years"),Qn=Math.round,ti={ss:44,s:45,m:45,h:22,d:26,M:11};function ei(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}var ni=Math.abs;function ii(t){return(t>0)-(t<0)||+t}function ai(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=ni(this._milliseconds)/1e3,i=ni(this._days),a=ni(this._months);t=w(n/60),e=w(t/60),n%=60,t%=60;var r=w(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=ii(this._months)!==ii(h)?"-":"",g=ii(this._days)!==ii(h)?"-":"",m=ii(this._milliseconds)!==ii(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var ri=ze.prototype;return ri.isValid=function(){return this._isValid},ri.abs=function(){var t=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),t.milliseconds=On(t.milliseconds),t.seconds=On(t.seconds),t.minutes=On(t.minutes),t.hours=On(t.hours),t.months=On(t.months),t.years=On(t.years),this},ri.add=function(t,e){return An(this,t,e,1)},ri.subtract=function(t,e){return An(this,t,e,-1)},ri.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=R(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+In(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Ln(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},ri.asMilliseconds=Nn,ri.asSeconds=Wn,ri.asMinutes=Yn,ri.asHours=zn,ri.asDays=En,ri.asWeeks=Vn,ri.asMonths=Hn,ri.asQuarters=Bn,ri.asYears=jn,ri.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},ri._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*Fn(Ln(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=w(r/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,n=w(e/60),l.hours=n%24,o+=w(n/24),a=w(In(o)),s+=a,o-=Fn(Ln(a)),i=w(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},ri.clone=function(){return Xe(this)},ri.get=function(t){return t=R(t),this.isValid()?this[t+"s"]():NaN},ri.milliseconds=Gn,ri.seconds=qn,ri.minutes=Zn,ri.hours=$n,ri.days=Xn,ri.weeks=function(){return w(this.days()/7)},ri.months=Kn,ri.years=Jn,ri.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var i=Xe(t).abs(),a=Qn(i.as("s")),r=Qn(i.as("m")),o=Qn(i.as("h")),s=Qn(i.as("d")),l=Qn(i.as("M")),u=Qn(i.as("y")),d=a<=ti.ss&&["s",a]||a0,d[4]=n,ei.apply(null,d)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},ri.toISOString=ai,ri.toString=ai,ri.toJSON=ai,ri.locale=rn,ri.localeData=sn,ri.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ai),ri.lang=on,j("X",0,0,"unix"),j("x",0,0,"valueOf"),dt("x",rt),dt("X",/[+-]?\d+(\.\d{1,3})?/),gt("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))})),gt("x",(function(t,e,n){n._d=new Date(k(t))})),a.version="2.24.0",n=Le,a.fn=Mn,a.min=function(){return We("isBefore",[].slice.call(arguments,0))},a.max=function(){return We("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=f,a.unix=function(t){return Le(1e3*t)},a.months=function(t,e){return Pn(t,e,"months")},a.isDate=u,a.locale=ge,a.invalid=p,a.duration=Xe,a.isMoment=_,a.weekdays=function(t,e,n){return Tn(t,e,n,"weekdays")},a.parseZone=function(){return Le.apply(null,arguments).parseZone()},a.localeData=pe,a.isDuration=Ee,a.monthsShort=function(t,e){return Pn(t,e,"monthsShort")},a.weekdaysMin=function(t,e,n){return Tn(t,e,n,"weekdaysMin")},a.defineLocale=me,a.updateLocale=function(t,e){if(null!=e){var n,i,a=ue;null!=(i=fe(t))&&(a=i._config),e=A(a,e),(n=new F(e)).parentLocale=de[t],de[t]=n,ge(t)}else null!=de[t]&&(null!=de[t].parentLocale?de[t]=de[t].parentLocale:null!=de[t]&&delete de[t]);return de[t]},a.locales=function(){return C(de)},a.weekdaysShort=function(t,e,n){return Tn(t,e,n,"weekdaysShort")},a.normalizeUnits=R,a.relativeTimeRounding=function(t){return void 0===t?Qn:"function"==typeof t&&(Qn=t,!0)},a.relativeTimeThreshold=function(t,e){return void 0!==ti[t]&&(void 0===e?ti[t]:(ti[t]=e,"s"===t&&(ti.ss=e-1),!0))},a.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=Mn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()})),mi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};rn._date.override("function"==typeof gi?{_id:"moment",formats:function(){return mi},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=gi(t,e):t instanceof gi||(t=gi(t)),t.isValid()?t.valueOf():null},format:function(t,e){return gi(t).format(e)},add:function(t,e,n){return gi(t).add(e,n).valueOf()},diff:function(t,e,n){return gi(t).diff(gi(e),n)},startOf:function(t,e,n){return t=gi(t),"isoWeek"===e?t.isoWeekday(n).valueOf():t.startOf(e).valueOf()},endOf:function(t,e){return gi(t).endOf(e).valueOf()},_create:function(t){return gi(t)}}:{}),W._set("global",{plugins:{filler:{propagate:!0}}});var pi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function bi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a0;--r)H.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function ki(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,m=i.spanGaps,p=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||W.global.defaultColor,o&&s&&r.length&&(H.canvas.clipArea(u,t.chartArea),ki(u,r,o,a,s,i._loop),H.canvas.unclipArea(u)))}},Si=H.rtl.getRtlAdapter,Di=H.noop,Ci=H.valueOrDefault;function Pi(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}W._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],m=n.padding,p=0,v=0;H.each(t.legendItems,(function(t,e){var i=Pi(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(m+=p+n.padding,f.push(p),g.push(v),p=0,v=0),p=Math.max(p,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),m+=p,f.push(p),g.push(v),l.width+=m}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Di,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=W.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=Si(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Ci(n.fontColor,i.defaultFontColor),g=H.options._parseFont(n),m=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var p=Pi(n,m),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},y=t.isHorizontal();d=y?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},H.rtl.overrideTextDirection(t.ctx,e.textDirection);var x=m+n.padding;H.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=p+m/2+f,_=d.x,w=d.y;h.setWidth(t.minSize.width),y?i>0&&_+g+n.padding>t.left+t.minSize.width&&(w=d.y+=x,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&w+x>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,w=d.y=t.top+b(o,s[d.line]));var k=h.x(_);!function(t,e,i){if(!(isNaN(p)||p<=0)){c.save();var o=Ci(i.lineWidth,r.borderWidth);if(c.fillStyle=Ci(i.fillStyle,a),c.lineCap=Ci(i.lineCap,r.borderCapStyle),c.lineDashOffset=Ci(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Ci(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Ci(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Ci(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=p*Math.SQRT2/2,l=h.xPlus(t,p/2),u=e+m/2;H.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,p),e,p,m),0!==o&&c.strokeRect(h.leftForLtr(t,p),e,p,m);c.restore()}}(k,w,e),v[i].left=h.leftForLtr(k,v[i].width),v[i].top=w,function(t,e,n,i){var a=m/2,r=h.xPlus(t,p+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(k,w,e,f),y?d.x+=g+n.padding:d.y+=x})),H.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Oi(t,e){var n=new Ti({ctx:t.ctx,options:e,chart:t});me.configure(t,n,e),me.addBox(t,n),t.legend=n}var Ai={id:"legend",_element:Ti,beforeInit:function(t){var e=t.options.legend;e&&Oi(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(H.mergeIf(e,W.global.legend),n?(me.configure(t,n,e),n.options=e):Oi(t,e)):n&&(me.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Fi=H.noop;W._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ii=$.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Fi,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Fi,beforeSetDimensions:Fi,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Fi,beforeBuildLabels:Fi,buildLabels:Fi,afterBuildLabels:Fi,beforeFit:Fi,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(H.isArray(n.text)?n.text.length:1)*H.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Fi,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=H.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=H.valueOrDefault(n.fontColor,W.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(H.isArray(g))for(var m=0,p=0;p=0;i--){var a=t[i];if(e(a))return a}},H.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},H.almostEquals=function(t,e,n){return Math.abs(t-e)=t},H.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},H.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},H.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},H.toRadians=function(t){return t*(Math.PI/180)},H.toDegrees=function(t){return t*(180/Math.PI)},H._decimalPlaces=function(t){if(H.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},H.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},H.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},H.aliasPixel=function(t){return t%2==0?0:.5},H._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},H.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},H.EPSILON=Number.EPSILON||1e-14,H.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(a=e0?d[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},H.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},H.niceNum=function(t,e){var n=Math.floor(H.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},H.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},H.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(H.getStyle(r,"padding-left")),u=parseFloat(H.getStyle(r,"padding-top")),d=parseFloat(H.getStyle(r,"padding-right")),h=parseFloat(H.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},H.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},H.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},H._calculatePadding=function(t,e,n){return(e=H.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},H._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},H.getMaximumWidth=function(t){var e=H._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-H._calculatePadding(e,"padding-left",n)-H._calculatePadding(e,"padding-right",n),a=H.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},H.getMaximumHeight=function(t){var e=H._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-H._calculatePadding(e,"padding-top",n)-H._calculatePadding(e,"padding-bottom",n),a=H.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},H.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},H.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},H.fontString=function(t,e,n){return e+" "+t+"px "+n},H.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;on.length){for(o=0;oi&&(i=r),i},H.numberOfLabelLines=function(t){var e=1;return H.each(t,(function(t){H.isArray(t)&&t.length>e&&(e=t.length)})),e},H.color=k?function(t){return t instanceof CanvasGradient&&(t=W.global.defaultColor),k(t)}:function(t){return console.error("Color.js not found!"),t},H.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:H.color(t).saturate(.5).darken(.1).rgbString()}}(),en._adapters=rn,en.Animation=K,en.animationService=J,en.controllers=Jt,en.DatasetController=it,en.defaults=W,en.Element=$,en.elements=wt,en.Interaction=re,en.layouts=me,en.platform=Ie,en.plugins=Le,en.Scale=xn,en.scaleService=Re,en.Ticks=on,en.Tooltip=Ge,en.helpers.each(fi,(function(t,e){en.scaleService.registerScaleType(e,t,t._defaults)})),Ri)Ri.hasOwnProperty(zi)&&en.plugins.register(Ri[zi]);en.platform.initialize();var Ei=en;return"undefined"!=typeof window&&(window.Chart=en),en.Chart=en,en.Legend=Ri.legend._element,en.Title=Ri.title._element,en.pluginService=en.plugins,en.PluginBase=en.Element.extend({}),en.canvasHelpers=en.helpers.canvas,en.layoutService=en.layouts,en.LinearScaleBase=Dn,en.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){en[t]=function(e,n){return new en(e,en.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Ei})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Chart=e()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},i=e((function(t){var e={};for(var i in n)n.hasOwnProperty(i)&&(e[n[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=e[t];if(i)return i;var a,r,o,s=1/0;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));i.rgb,i.hsl,i.hsv,i.hwb,i.cmyk,i.xyz,i.lab,i.lch,i.hex,i.keyword,i.ansi16,i.ansi256,i.hcg,i.apple,i.gray;function a(t){var e=function(){for(var t={},e=Object.keys(i),n=e.length,a=0;a1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var l=s,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d={getRgba:h,getHsla:c,getRgb:function(t){var e=h(t);return e&&e.slice(0,3)},getHsl:function(t){var e=c(t);return e&&e.slice(0,3)},getHwb:f,getAlpha:function(t){var e=h(t);if(e)return e[3];if(e=c(t))return e[3];if(e=f(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+b(t[0])+b(t[1])+b(t[2])+(e>=0&&e<1?b(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:g,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return m(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:m,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return y[t.slice(0,3)]}};function h(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new _,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},_.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},_.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},_.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;a--)e.call(n,t[a],a);else for(a=0;a=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-C.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*C.easeInBounce(2*t):.5*C.easeOutBounce(2*t-1)+.5}},P={effects:C};D.easingEffects=C;var T=Math.PI,O=T/180,A=2*T,F=T/2,I=T/4,L=2*T/3,R={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r=n?(B.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},tt=B.options.resolve,et=["push","pop","shift","splice","unshift"];function nt(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(et.forEach((function(e){delete t[e]})),delete t._chartjs)}}var it=function(t,e){this.initialize(t,e)};B.extend(it.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&nt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;na?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function st(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+rt,ot(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=rt,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+rt,n.startAngle,!0),a=0;as;)a-=rt;for(;a=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/rt)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+rt,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;tt.x&&(e=yt(e,"left","right")):t.basen?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function _t(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&bt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}Y._set("global",{elements:{rectangle:{backgroundColor:pt,borderColor:pt,borderSkipped:"bottom",borderWidth:0}}});var wt=X.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=bt(t),n=e.right-e.left,i=e.bottom-e.top,a=xt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return _t(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return vt(n)?_t(n,t,null):_t(n,null,e)},inXRange:function(t){return _t(this._view,t,null)},inYRange:function(t){return _t(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return vt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return vt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),kt={},Mt=lt,St=ht,Dt=mt,Ct=wt;kt.Arc=Mt,kt.Line=St,kt.Point=Dt,kt.Rectangle=Ct;var Pt=B._deprecated,Tt=B.valueOrDefault;function Ot(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=B.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return B.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}Y._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),Y._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var At=at.extend({dataElementType:kt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;at.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Pt("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Pt("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Pt("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Pt("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Pt("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e=0&&m.min>=0?m.min:m.max,x=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&r<0||m.max>=0&&r>0)&&(y+=r));return o=h.getPixelForValue(y),l=(s=h.getPixelForValue(y+x))-o,void 0!==p&&Math.abs(l)=0&&!c||x<0&&c?o-p:o+p),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=Nt?-Wt:b<-Nt?Wt:0)+p,x=Math.cos(b),_=Math.sin(b),w=Math.cos(y),k=Math.sin(y),M=b<=0&&y>=0||y>=Wt,S=b<=Yt&&y>=Yt||y>=Wt+Yt,D=b<=-Yt&&y>=-Yt||y>=Nt+Yt,C=b===-Nt||y>=Nt?-1:Math.min(x,x*m,w,w*m),P=D?-1:Math.min(_,_*m,k,k*m),T=M?1:Math.max(x,x*m,w,w*m),O=S?1:Math.max(_,_*m,k,k*m);u=(T-C)/2,d=(O-P)/2,h=-(T+C)/2,c=-(O+P)/2}for(i=0,a=g.length;i0&&!isNaN(t)?Wt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=B.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Rt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Rt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Rt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Bt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return re(t,e,{intersect:!1})},point:function(t,e){return ne(t,te(e,t))},nearest:function(t,e,n){var i=te(e,t);n.axis=n.axis||"xy";var a=ae(n.axis);return ie(t,i,n.intersect,a)},x:function(t,e,n){var i=te(e,t),a=[],r=!1;return ee(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=te(e,t),a=[],r=!1;return ee(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},se=B.extend;function le(t,e){return B.where(t,(function(t){return t.pos===e}))}function ue(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function de(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function he(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-de(o,t,"left","right"),a=e.outerHeight-de(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function ce(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function fe(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&me.default||me,be="$chartjs",ye="chartjs-size-monitor",xe="chartjs-render-monitor",_e="chartjs-render-animation",we=["animationstart","webkitAnimationStart"],ke={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function Me(t,e){var n=B.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var Se=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function De(t,e,n){t.addEventListener(e,n,Se)}function Ce(t,e,n){t.removeEventListener(e,n,Se)}function Pe(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Te(t){var e=document.createElement("div");return e.className=t||"",e}function Oe(t,e,n){var i,a,r,o,s=t[be]||(t[be]={}),l=s.resizer=function(t){var e=Te(ye),n=Te(ye+"-expand"),i=Te(ye+"-shrink");n.appendChild(Te()),i.appendChild(Te()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return De(n,"scroll",a.bind(n,"expand")),De(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Pe("resize",n)),i&&i.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?t.split("\n"):t}function He(t){var e=Y.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:We(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:We(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:We(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:We(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:We(t.titleFontStyle,e.defaultFontStyle),titleFontSize:We(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:We(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:We(t.footerFontStyle,e.defaultFontStyle),footerFontSize:We(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Be(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function je(t){return Ee([],Ve(t))}var Ue=X.extend({initialize:function(){this._model=He(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Ee(o,Ve(i)),o=Ee(o,Ve(a)),o=Ee(o,Ve(r))},getBeforeBody:function(){return je(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return B.each(t,(function(t){var r={before:[],lines:[],after:[]};Ee(r.before,Ve(i.beforeLabel.call(n,t,e))),Ee(r.lines,i.label.call(n,t,e)),Ee(r.after,Ve(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return je(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Ee(r,Ve(n)),r=Ee(r,Ve(i)),r=Ee(r,Ve(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=He(c),m=h._active,p=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},y={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(m.length){g.opacity=1;var _=[],w=[];x=ze[c.position].call(h,m,h._eventPosition);var k=[];for(e=0,n=m.length;ei.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,y,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.yl.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,y),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=y.width,g.height=y.height,g.caretX=x.x,g.caretY=x.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Ye(e.rtl,e.x,e.width);for(t.x=Be(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=B.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,B.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),B.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!B.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),Ge=ze,qe=Ue;qe.positioners=Ge;var Ze=B.valueOrDefault;function $e(){return B.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?B.merge(e[t][a],[Ne.getScaleDefaults(r),o]):B.merge(e[t][a],o)}else B._merger(t,e,n,i)}})}function Xe(){return B.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=$e(a,r):"scale"===t?e[t]=B.merge(a,[Ne.getScaleDefaults(r.type),r]):B._merger(t,e,n,i)}})}function Ke(t){var e=t.options;B.each(t.scales,(function(e){pe.removeBox(t,e)})),e=Xe(Y.global,Y[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Je(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(B.findIndex(t,a)>=0);return i}function Qe(t){return"top"===t||"bottom"===t}function tn(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}Y._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var en=function(t,e){return this.construct(t,e),this};B.extend(en.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Xe(Y.global,Y[t.type],t.options||{}),t}(e);var i=Le.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=B.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,en.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Re.notify(t,"beforeInit"),B.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Re.notify(t,"afterInit"),t},clear:function(){return B.canvas.clear(this),this},stop:function(){return Q.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(B.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:B.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",B.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Re.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;B.each(e.xAxes,(function(t,n){t.id||(t.id=Je(e.xAxes,"x-axis-",n))})),B.each(e.yAxes,(function(t,n){t.id||(t.id=Je(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),B.each(i,(function(e){var i=e.options,r=i.id,o=Ze(i.type,e.dtype);Qe(i.position)!==Qe(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Ne.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),B.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Ne.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t=0;--n)this.drawDataset(e[n],t);Re.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Re.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Re.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Re.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Re.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return oe.modes.single(this,t)},getElementsAtEvent:function(t){return oe.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return oe.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=oe.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return oe.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=B.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=B.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(B.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},ln=B.isArray,un=B.isNullOrUndef,dn=B.valueOrDefault,hn=B.valueAtIndexOrDefault;function cn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function fn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,m,p,v=n.length,b=[],y=[],x=[],_=0,w=0;for(a=0;ae){for(n=0;n=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-gn(l.gridLines)-u.padding-mn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=B.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){B.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){B.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=gn(o)+mn(r)),u?s&&(e.height=gn(o)+mn(r)):e.height=t.maxHeight,a.display&&s){var d=vn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,m=h.highest,p=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=B.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y),w=_*g.width+x*(m.height-(b?m.offset:0))+(b?0:p);e.height=Math.min(t.maxHeight,e.height+w+v);var k,M,S=t.getPixelForTick(0)-t.left,D=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?x*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):x*f.width+_*f.offset):(k=c.width/2,M=f.width/2),t.paddingLeft=Math.max((k-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-D)*t.width/(t.width-D),0)+3}else{var C=a.mirror?0:g.width+v+p;e.width=Math.min(t.maxWidth,e.width+C),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){B.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(un(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;nn-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;es)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;iu)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e1?(h-d)/(u-1):null,yn(t,i,B.isNullOrUndef(a)?0:d-a,d),yn(t,i,h,B.isNullOrUndef(a)?t.length:h+a),bn(t)}return yn(t,i),bn(t)},_tickSize:function(){var t=this.options.ticks,e=B.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;_n.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return wn(e)||wn(n)||(t=o.chart.data.datasets[n].data[e]),wn(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=B.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),Mn={position:"bottom"};kn._defaults=Mn;var Sn=B.noop,Dn=B.isNullOrUndef;var Cn=_n.extend({getRightValue:function(t){return"string"==typeof t?+t:_n.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=B.sign(t.min),i=B.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Sn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:B.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,m=B.niceNum((g-f)/u/l)*l;if(m<1e-14&&Dn(d)&&Dn(h))return[f,g];(r=Math.ceil(g/m)-Math.floor(f/m))>u&&(m=B.niceNum(r*m/u/l)*l),s||Dn(c)?n=Math.pow(10,B._decimalPlaces(m)):(n=Math.pow(10,c),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,a=Math.ceil(g/m)*m,s&&(!Dn(d)&&B.almostWhole(d/m,m/1e3)&&(i=d),!Dn(h)&&B.almostWhole(h/m,m/1e3)&&(a=h)),r=(a-i)/m,r=B.almostEquals(r,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Dn(d)?i:d);for(var p=1;pe.length-1?null:this.getPixelForValue(e[t])}}),Fn=Pn;An._defaults=Fn;var In=B.valueOrDefault,Ln=B.math.log10;var Rn={position:"left",ticks:{callback:sn.formatters.logarithmic}};function Nn(t,e){return B.isFinite(t)&&t>=0?t:e}var Wn=_n.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t0){var e=B.min(t),n=B.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Ln(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Nn(e.min),max:Nn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=In(t.min,Math.pow(10,Math.floor(Ln(e.min)))),o=Math.floor(Ln(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Ln(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Ln(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Ln(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;_n.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=In(t.options.ticks.fontSize,Y.global.defaultFontSize)/t._length),t._startValue=Ln(e),t._valueOffset=n,t._valueRange=(Ln(t.max)-Ln(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Ln(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Yn=Rn;Wn._defaults=Yn;var zn=B.valueOrDefault,En=B.valueAtIndexOrDefault,Vn=B.options.resolve,Hn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:sn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Bn(t){var e=t.ticks;return e.display&&t.display?zn(e.fontSize,Y.global.defaultFontSize)+2*e.backdropPaddingY:0}function jn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:ta?{start:e-n,end:e}:{start:e,end:e+n}}function Un(t){return 0===t||180===t?"center":t<180?"left":"right"}function Gn(t,e,n,i){var a,r,o=n.y+i/2;if(B.isArray(e))for(a=0,r=e.length;a270||t<90)&&(n.y-=e.h)}function Zn(t){return B.isNumber(t)?t:0}var $n=Cn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Bn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;B.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);B.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Bn(this.options))},convertTicksToLabels:function(){var t=this;Cn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=B.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=B.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Zn(a),r=Zn(r),o=Zn(o),s=Zn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(B.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=zn(s.lineWidth,o.lineWidth),u=zn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Bn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=B.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=En(i.fontColor,s,Y.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=B.toDegrees(h);e.textAlign=Un(c),qn(c,t._pointLabelSizes[s],u),Gn(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&B.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=En(e.color,i-1),u=En(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=B.options._parseFont(n),s=zn(n.fontColor,Y.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",B.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:B.noop}),Xn=Hn;$n._defaults=Xn;var Kn=B._deprecated,Jn=B.options.resolve,Qn=B.valueOrDefault,ti=Number.MIN_SAFE_INTEGER||-9007199254740991,ei=Number.MAX_SAFE_INTEGER||9007199254740991,ni={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ii=Object.keys(ni);function ai(t,e){return t-e}function ri(t){return B.valueOrDefault(t.time.min,t.ticks.min)}function oi(t){return B.valueOrDefault(t.time.max,t.ticks.max)}function si(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function li(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),B.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),B.isFinite(o)||(o=n.parse(o))),o)}function ui(t,e){if(B.isNullOrUndef(e))return null;var n=t.options.time,i=li(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function di(t,e,n,i){var a,r,o,s=ii.length;for(a=ii.indexOf(t);a=0&&(e[r].major=!0);return e}(t,r,o,n):r}var ci=_n.extend({initialize:function(){this.mergeTicksOptions(),_n.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new on._date(e.adapters.date);return Kn("time scale",n.format,"time.format","time.parser"),Kn("time scale",n.min,"time.min","ticks.min"),Kn("time scale",n.max,"time.max","ticks.max"),B.mergeIf(n.displayFormats,i.formats()),_n.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),_n.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=ei,f=ti,g=[],m=[],p=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?di(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ii.length-1;r>=ii.indexOf(n);r--)if(o=ii[r],ni[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ii[n?ii.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ii.indexOf(t)+1,n=ii.length;ee&&s=0&&t0?s:1}}),fi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};ci._defaults=fi;var gi={category:kn,linear:An,logarithmic:Wn,radialLinear:$n,time:ci},mi=e((function(e,n){e.exports=function(){var n,i;function a(){return n.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var n,i=[];for(n=0;n>>0,i=0;i0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}var E=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,V=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},B={};function j(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(B[t]=a),e&&(B[e[0]]=function(){return z(a.apply(this,arguments),e[1],e[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=G(e,t.localeData()),H[e]=H[e]||function(t){var e,n,i,a=t.match(E);for(e=0,n=a.length;e=0&&V.test(t);)t=t.replace(V,i),V.lastIndex=0,n-=1;return t}var q=/\d/,Z=/\d\d/,$=/\d{3}/,X=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,nt=/\d{1,4}/,it=/[+-]?\d{1,6}/,at=/\d+/,rt=/[+-]?\d+/,ot=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ut={};function dt(t,e,n){ut[t]=O(e)?e:function(t,i){return t&&n?n:e}}function ht(t,e){return h(ut,t)?ut[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,a){return e||n||i||a}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function gt(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),l(e)&&(i=function(t,n){n[e]=k(t)}),n=0;n68?1900:2e3)};var Pt,Tt=Ot("FullYear",!0);function Ot(t,e){return function(n){return null!=n?(Ft(this,t,n),a.updateOffset(this,e),this):At(this,t)}}function At(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Ft(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Ct(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),It(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function It(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=function(t,e){return(t%e+e)%e}(e,12);return t+=(e-n)/12,1===n?Ct(t)?29:28:31-n%7%2}Pt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(s=new Date(t+400,e,n,i,a,r,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,a,r,o),s}function jt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ut(t,e,n){var i=7+e-n;return-(7+jt(t,0,i).getUTCDay()-e)%7+i-1}function Gt(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Ut(t,i,a);return s<=0?o=Dt(r=t-1)+s:s>Dt(t)?(r=t+1,o=s-Dt(t)):(r=t,o=s),{year:r,dayOfYear:o}}function qt(t,e,n){var i,a,r=Ut(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Zt(a=t.year()-1,e,n):o>Zt(t.year(),e,n)?(i=o-Zt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Zt(t,e,n){var i=Ut(t,e,n),a=Ut(t+1,e,n);return(Dt(t)-i+a)/7}function $t(t,e){return t.slice(e,7).concat(t.slice(0,e))}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Y("week",5),Y("isoWeek",5),dt("w",J),dt("ww",J,Z),dt("W",J),dt("WW",J,Z),mt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=k(t)})),j("d",0,"do","day"),j("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),j("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),j("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),dt("d",J),dt("e",J),dt("E",J),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,n,i){e[i]=k(t)}));var Xt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Jt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null}var te=lt,ee=lt,ne=lt;function ie(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=f([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ct(s[e]),l[e]=ct(l[e]),u[e]=ct(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ae(){return this.hours()%12||12}function re(t,e){j(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function oe(t,e){return e._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,ae),j("k",["kk",2],0,(function(){return this.hours()||24})),j("hmm",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)})),j("hmmss",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)})),j("Hmm",0,0,(function(){return""+this.hours()+z(this.minutes(),2)})),j("Hmmss",0,0,(function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)})),re("a",!0),re("A",!1),L("hour","h"),Y("hour",13),dt("a",oe),dt("A",oe),dt("H",J),dt("h",J),dt("k",J),dt("HH",J,Z),dt("hh",J,Z),dt("kk",J,Z),dt("hmm",Q),dt("hmmss",tt),dt("Hmm",Q),dt("Hmmss",tt),gt(["H","HH"],xt),gt(["k","kk"],(function(t,e,n){var i=k(t);e[xt]=24===i?0:i})),gt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),gt(["h","hh"],(function(t,e,n){e[xt]=k(t),g(n).bigHour=!0})),gt("hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i)),g(n).bigHour=!0})),gt("hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a)),g(n).bigHour=!0})),gt("Hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i))})),gt("Hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a))}));var se,le=Ot("Hours",!0),ue={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Rt,monthsShort:Nt,week:{dow:0,doy:6},weekdays:Xt,weekdaysMin:Jt,weekdaysShort:Kt,meridiemParse:/[ap]\.?m?\.?/i},de={},he={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(n){var i=null;if(!de[n]&&e&&e.exports)try{i=se._abbr,t(),ge(i)}catch(t){}return de[n]}function ge(t,e){var n;return t&&((n=s(e)?pe(t):me(t,e))?se=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),se._abbr}function me(t,e){if(null!==e){var n,i=ue;if(e.abbr=t,null!=de[t])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=de[t]._config;else if(null!=e.parentLocale)if(null!=de[e.parentLocale])i=de[e.parentLocale]._config;else{if(null==(n=fe(e.parentLocale)))return he[e.parentLocale]||(he[e.parentLocale]=[]),he[e.parentLocale].push({name:t,config:e}),null;i=n._config}return de[t]=new F(A(i,e)),he[t]&&he[t].forEach((function(t){me(t.name,t.config)})),ge(t),de[t]}return delete de[t],null}function pe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return se;if(!r(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r0;){if(i=fe(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&M(a,n,!0)>=e-1)break;e--}r++}return se}(t)}function ve(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[bt]<0||n[bt]>11?bt:n[yt]<1||n[yt]>It(n[vt],n[bt])?yt:n[xt]<0||n[xt]>24||24===n[xt]&&(0!==n[_t]||0!==n[wt]||0!==n[kt])?xt:n[_t]<0||n[_t]>59?_t:n[wt]<0||n[wt]>59?wt:n[kt]<0||n[kt]>999?kt:-1,g(t)._overflowDayOfYear&&(eyt)&&(e=yt),g(t)._overflowWeeks&&-1===e&&(e=Mt),g(t)._overflowWeekday&&-1===e&&(e=St),g(t).overflow=e),t}function be(t,e,n){return null!=t?t:null!=e?e:n}function ye(t){var e,n,i,r,o,s=[];if(!t._d){for(i=function(t){var e=new Date(a.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[yt]&&null==t._a[bt]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=be(e.GG,t._a[vt],qt(Le(),1,4).year),i=be(e.W,1),((a=be(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=qt(Le(),r,o);n=be(e.gg,t._a[vt],u.year),i=be(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Zt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=Gt(n,i,a,r,o),t._a[vt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=be(t._a[vt],i[vt]),(t._dayOfYear>Dt(o)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=jt(o,0,t._dayOfYear),t._a[bt]=n.getUTCMonth(),t._a[yt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=i[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[xt]&&0===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[xt]=0),t._d=(t._useUTC?jt:Bt).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[xt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(g(t).weekdayMismatch=!0)}}var xe=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_e=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,we=/Z|[+-]\d\d(?::?\d\d)?/,ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Se=/^\/?Date\((\-?\d+)/i;function De(t){var e,n,i,a,r,o,s=t._i,l=xe.exec(s)||_e.exec(s);if(l){for(g(t).iso=!0,e=0,n=ke.length;e0&&g(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[r]?(n?g(t).empty=!1:g(t).unusedTokens.push(r),pt(r,n,t)):t._strict&&!n&&g(t).unusedTokens.push(r);g(t).charsLeftOver=l-u,s.length>0&&g(t).unusedInput.push(s),t._a[xt]<=12&&!0===g(t).bigHour&&t._a[xt]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[xt]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[xt],t._meridiem),ye(t),ve(t)}else Oe(t);else De(t)}function Fe(t){var e=t._i,n=t._f;return t._locale=t._locale||pe(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new x(ve(e)):(u(e)?t._d=e:r(n)?function(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;athis?this:t:p()}));function We(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Le();for(n=e[0],i=1;i=0?new Date(t+400,e,n)-hn:new Date(t,e,n).valueOf()}function gn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hn:Date.UTC(t,e,n)}function mn(t,e){j(0,[t,t.length],0,e)}function pn(t,e,n,i,a){var r;return null==t?qt(this,i,a).year:(e>(r=Zt(t,i,a))&&(e=r),vn.call(this,t,e,n,i,a))}function vn(t,e,n,i,a){var r=Gt(t,e,n,i,a),o=jt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}j(0,["gg",2],0,(function(){return this.weekYear()%100})),j(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),mn("gggg","weekYear"),mn("ggggg","weekYear"),mn("GGGG","isoWeekYear"),mn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),dt("G",rt),dt("g",rt),dt("GG",J,Z),dt("gg",J,Z),dt("GGGG",nt,X),dt("gggg",nt,X),dt("GGGGG",it,K),dt("ggggg",it,K),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,n,i){e[i]=a.parseTwoDigitYear(t)})),j("Q",0,"Qo","quarter"),L("quarter","Q"),Y("quarter",7),dt("Q",q),gt("Q",(function(t,e){e[bt]=3*(k(t)-1)})),j("D",["DD",2],"Do","date"),L("date","D"),Y("date",9),dt("D",J),dt("DD",J,Z),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),gt(["D","DD"],yt),gt("Do",(function(t,e){e[yt]=k(t.match(J)[0])}));var bn=Ot("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Y("dayOfYear",4),dt("DDD",et),dt("DDDD",$),gt(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=k(t)})),j("m",["mm",2],0,"minute"),L("minute","m"),Y("minute",14),dt("m",J),dt("mm",J,Z),gt(["m","mm"],_t);var yn=Ot("Minutes",!1);j("s",["ss",2],0,"second"),L("second","s"),Y("second",15),dt("s",J),dt("ss",J,Z),gt(["s","ss"],wt);var xn,_n=Ot("Seconds",!1);for(j("S",0,0,(function(){return~~(this.millisecond()/100)})),j(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),j(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),j(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),j(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),j(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),j(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),Y("millisecond",16),dt("S",et,q),dt("SS",et,Z),dt("SSS",et,$),xn="SSSS";xn.length<=9;xn+="S")dt(xn,at);function wn(t,e){e[kt]=k(1e3*("0."+t))}for(xn="S";xn.length<=9;xn+="S")gt(xn,wn);var kn=Ot("Milliseconds",!1);j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var Mn=x.prototype;function Sn(t){return t}Mn.add=en,Mn.calendar=function(t,e){var n=t||Le(),i=Ue(n,this).startOf("day"),r=a.calendarFormat(this,i)||"sameElse",o=e&&(O(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,Le(n)))},Mn.clone=function(){return new x(this)},Mn.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Ue(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=R(e)){case"year":r=an(this,i)/12;break;case"month":r=an(this,i);break;case"quarter":r=an(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:w(r)},Mn.endOf=function(t){var e;if(void 0===(t=R(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?gn:fn;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=dn-cn(e+(this._isUTC?0:this.utcOffset()*un),dn)-1;break;case"minute":e=this._d.valueOf(),e+=un-cn(e,un)-1;break;case"second":e=this._d.valueOf(),e+=ln-cn(e,ln)-1}return this._d.setTime(e),a.updateOffset(this,!0),this},Mn.format=function(t){t||(t=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},Mn.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.fromNow=function(t){return this.from(Le(),t)},Mn.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.toNow=function(t){return this.to(Le(),t)},Mn.get=function(t){return O(this[t=R(t)])?this[t]():this},Mn.invalidAt=function(){return g(this).overflow},Mn.isAfter=function(t,e){var n=_(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=R(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?U(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},Mn.toJSON=function(){return this.isValid()?this.toISOString():null},Mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mn.unix=function(){return Math.floor(this.valueOf()/1e3)},Mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mn.year=Tt,Mn.isLeapYear=function(){return Ct(this.year())},Mn.weekYear=function(t){return pn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Mn.isoWeekYear=function(t){return pn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Mn.quarter=Mn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Mn.month=zt,Mn.daysInMonth=function(){return It(this.year(),this.month())},Mn.week=Mn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Mn.isoWeek=Mn.isoWeeks=function(t){var e=qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Mn.weeksInYear=function(){var t=this.localeData()._week;return Zt(this.year(),t.dow,t.doy)},Mn.isoWeeksInYear=function(){return Zt(this.year(),1,4)},Mn.date=bn,Mn.day=Mn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},Mn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Mn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Mn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Mn.hour=Mn.hours=le,Mn.minute=Mn.minutes=yn,Mn.second=Mn.seconds=_n,Mn.millisecond=Mn.milliseconds=kn,Mn.utcOffset=function(t,e,n){var i,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=je(st,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(i=Ge(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?tn(this,Xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ge(this)},Mn.utc=function(t){return this.utcOffset(0,t)},Mn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ge(this),"m")),this},Mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=je(ot,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Mn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Le(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mn.isUtc=qe,Mn.isUTC=qe,Mn.zoneAbbr=function(){return this._isUTC?"UTC":""},Mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mn.dates=D("dates accessor is deprecated. Use date instead.",bn),Mn.months=D("months accessor is deprecated. Use month instead",zt),Mn.years=D("years accessor is deprecated. Use year instead",Tt),Mn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),Mn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),(t=Fe(t))._a){var e=t._isUTC?f(t._a):Le(t._a);this._isDSTShifted=this.isValid()&&M(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Dn=F.prototype;function Cn(t,e,n,i){var a=pe(),r=f().set(i,e);return a[n](r,t)}function Pn(t,e,n){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return Cn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=Cn(t,i,n,"month");return a}function Tn(t,e,n,i){"boolean"==typeof t?(l(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,l(e)&&(n=e,e=void 0),e=e||"");var a,r=pe(),o=t?r._week.dow:0;if(null!=n)return Cn(e,(n+o)%7,i,"day");var s=[];for(a=0;a<7;a++)s[a]=Cn(e,(a+o)%7,i,"day");return s}Dn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return O(i)?i.call(e,n):i},Dn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Dn.invalidDate=function(){return this._invalidDate},Dn.ordinal=function(t){return this._ordinal.replace("%d",t)},Dn.preparse=Sn,Dn.postformat=Sn,Dn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return O(a)?a(t,e,n,i):a.replace(/%d/i,t)},Dn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)},Dn.set=function(t){var e,n;for(n in t)O(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Dn.months=function(t,e){return t?r(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Lt).test(e)?"format":"standalone"][t.month()]:r(this._months)?this._months:this._months.standalone},Dn.monthsShort=function(t,e){return t?r(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Lt.test(e)?"format":"standalone"][t.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Dn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return Wt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},Dn.monthsRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Vt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Dn.monthsShortRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Et),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Dn.week=function(t){return qt(t,this._week.dow,this._week.doy).week},Dn.firstDayOfYear=function(){return this._week.doy},Dn.firstDayOfWeek=function(){return this._week.dow},Dn.weekdays=function(t,e){var n=r(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?$t(n,this._week.dow):t?n[t.day()]:n},Dn.weekdaysMin=function(t){return!0===t?$t(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Dn.weekdaysShort=function(t){return!0===t?$t(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Dn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Qt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},Dn.weekdaysRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Dn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Dn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ne),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Dn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Dn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ge("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",ge),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",pe);var On=Math.abs;function An(t,e,n,i){var a=Xe(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function Fn(t){return t<0?Math.floor(t):Math.ceil(t)}function In(t){return 4800*t/146097}function Ln(t){return 146097*t/4800}function Rn(t){return function(){return this.as(t)}}var Nn=Rn("ms"),Wn=Rn("s"),Yn=Rn("m"),zn=Rn("h"),En=Rn("d"),Vn=Rn("w"),Hn=Rn("M"),Bn=Rn("Q"),jn=Rn("y");function Un(t){return function(){return this.isValid()?this._data[t]:NaN}}var Gn=Un("milliseconds"),qn=Un("seconds"),Zn=Un("minutes"),$n=Un("hours"),Xn=Un("days"),Kn=Un("months"),Jn=Un("years"),Qn=Math.round,ti={ss:44,s:45,m:45,h:22,d:26,M:11};function ei(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}var ni=Math.abs;function ii(t){return(t>0)-(t<0)||+t}function ai(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=ni(this._milliseconds)/1e3,i=ni(this._days),a=ni(this._months);t=w(n/60),e=w(t/60),n%=60,t%=60;var r=w(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=ii(this._months)!==ii(h)?"-":"",g=ii(this._days)!==ii(h)?"-":"",m=ii(this._milliseconds)!==ii(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var ri=ze.prototype;return ri.isValid=function(){return this._isValid},ri.abs=function(){var t=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),t.milliseconds=On(t.milliseconds),t.seconds=On(t.seconds),t.minutes=On(t.minutes),t.hours=On(t.hours),t.months=On(t.months),t.years=On(t.years),this},ri.add=function(t,e){return An(this,t,e,1)},ri.subtract=function(t,e){return An(this,t,e,-1)},ri.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=R(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+In(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Ln(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},ri.asMilliseconds=Nn,ri.asSeconds=Wn,ri.asMinutes=Yn,ri.asHours=zn,ri.asDays=En,ri.asWeeks=Vn,ri.asMonths=Hn,ri.asQuarters=Bn,ri.asYears=jn,ri.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},ri._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*Fn(Ln(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=w(r/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,n=w(e/60),l.hours=n%24,o+=w(n/24),a=w(In(o)),s+=a,o-=Fn(Ln(a)),i=w(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},ri.clone=function(){return Xe(this)},ri.get=function(t){return t=R(t),this.isValid()?this[t+"s"]():NaN},ri.milliseconds=Gn,ri.seconds=qn,ri.minutes=Zn,ri.hours=$n,ri.days=Xn,ri.weeks=function(){return w(this.days()/7)},ri.months=Kn,ri.years=Jn,ri.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var i=Xe(t).abs(),a=Qn(i.as("s")),r=Qn(i.as("m")),o=Qn(i.as("h")),s=Qn(i.as("d")),l=Qn(i.as("M")),u=Qn(i.as("y")),d=a<=ti.ss&&["s",a]||a0,d[4]=n,ei.apply(null,d)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},ri.toISOString=ai,ri.toString=ai,ri.toJSON=ai,ri.locale=rn,ri.localeData=sn,ri.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ai),ri.lang=on,j("X",0,0,"unix"),j("x",0,0,"valueOf"),dt("x",rt),dt("X",/[+-]?\d+(\.\d{1,3})?/),gt("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))})),gt("x",(function(t,e,n){n._d=new Date(k(t))})),a.version="2.24.0",n=Le,a.fn=Mn,a.min=function(){return We("isBefore",[].slice.call(arguments,0))},a.max=function(){return We("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=f,a.unix=function(t){return Le(1e3*t)},a.months=function(t,e){return Pn(t,e,"months")},a.isDate=u,a.locale=ge,a.invalid=p,a.duration=Xe,a.isMoment=_,a.weekdays=function(t,e,n){return Tn(t,e,n,"weekdays")},a.parseZone=function(){return Le.apply(null,arguments).parseZone()},a.localeData=pe,a.isDuration=Ee,a.monthsShort=function(t,e){return Pn(t,e,"monthsShort")},a.weekdaysMin=function(t,e,n){return Tn(t,e,n,"weekdaysMin")},a.defineLocale=me,a.updateLocale=function(t,e){if(null!=e){var n,i,a=ue;null!=(i=fe(t))&&(a=i._config),e=A(a,e),(n=new F(e)).parentLocale=de[t],de[t]=n,ge(t)}else null!=de[t]&&(null!=de[t].parentLocale?de[t]=de[t].parentLocale:null!=de[t]&&delete de[t]);return de[t]},a.locales=function(){return C(de)},a.weekdaysShort=function(t,e,n){return Tn(t,e,n,"weekdaysShort")},a.normalizeUnits=R,a.relativeTimeRounding=function(t){return void 0===t?Qn:"function"==typeof t&&(Qn=t,!0)},a.relativeTimeThreshold=function(t,e){return void 0!==ti[t]&&(void 0===e?ti[t]:(ti[t]=e,"s"===t&&(ti.ss=e-1),!0))},a.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=Mn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()})),pi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};on._date.override("function"==typeof mi?{_id:"moment",formats:function(){return pi},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=mi(t,e):t instanceof mi||(t=mi(t)),t.isValid()?t.valueOf():null},format:function(t,e){return mi(t).format(e)},add:function(t,e,n){return mi(t).add(e,n).valueOf()},diff:function(t,e,n){return mi(t).diff(mi(e),n)},startOf:function(t,e,n){return t=mi(t),"isoWeek"===e?t.isoWeekday(n).valueOf():t.startOf(e).valueOf()},endOf:function(t,e){return mi(t).endOf(e).valueOf()},_create:function(t){return mi(t)}}:{}),Y._set("global",{plugins:{filler:{propagate:!0}}});var vi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function yi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a0;--r)B.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function Mi(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,m=i.spanGaps,p=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||Y.global.defaultColor,o&&s&&r.length&&(B.canvas.clipArea(u,t.chartArea),Mi(u,r,o,a,s,i._loop),B.canvas.unclipArea(u)))}},Di=B.rtl.getRtlAdapter,Ci=B.noop,Pi=B.valueOrDefault;function Ti(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}Y._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],m=n.padding,p=0,v=0;B.each(t.legendItems,(function(t,e){var i=Ti(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(m+=p+n.padding,f.push(p),g.push(v),p=0,v=0),p=Math.max(p,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),m+=p,f.push(p),g.push(v),l.width+=m}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Ci,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=Y.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=Di(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Pi(n.fontColor,i.defaultFontColor),g=B.options._parseFont(n),m=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var p=Ti(n,m),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},y=t.isHorizontal();d=y?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},B.rtl.overrideTextDirection(t.ctx,e.textDirection);var x=m+n.padding;B.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=p+m/2+f,_=d.x,w=d.y;h.setWidth(t.minSize.width),y?i>0&&_+g+n.padding>t.left+t.minSize.width&&(w=d.y+=x,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&w+x>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,w=d.y=t.top+b(o,s[d.line]));var k=h.x(_);!function(t,e,i){if(!(isNaN(p)||p<=0)){c.save();var o=Pi(i.lineWidth,r.borderWidth);if(c.fillStyle=Pi(i.fillStyle,a),c.lineCap=Pi(i.lineCap,r.borderCapStyle),c.lineDashOffset=Pi(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Pi(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Pi(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Pi(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=p*Math.SQRT2/2,l=h.xPlus(t,p/2),u=e+m/2;B.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,p),e,p,m),0!==o&&c.strokeRect(h.leftForLtr(t,p),e,p,m);c.restore()}}(k,w,e),v[i].left=h.leftForLtr(k,v[i].width),v[i].top=w,function(t,e,n,i){var a=m/2,r=h.xPlus(t,p+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(k,w,e,f),y?d.x+=g+n.padding:d.y+=x})),B.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Ai(t,e){var n=new Oi({ctx:t.ctx,options:e,chart:t});pe.configure(t,n,e),pe.addBox(t,n),t.legend=n}var Fi={id:"legend",_element:Oi,beforeInit:function(t){var e=t.options.legend;e&&Ai(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(B.mergeIf(e,Y.global.legend),n?(pe.configure(t,n,e),n.options=e):Ai(t,e)):n&&(pe.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ii=B.noop;Y._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Li=X.extend({initialize:function(t){B.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ii,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Ii,beforeSetDimensions:Ii,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ii,beforeBuildLabels:Ii,buildLabels:Ii,afterBuildLabels:Ii,beforeFit:Ii,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(B.isArray(n.text)?n.text.length:1)*B.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Ii,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=B.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=B.valueOrDefault(n.fontColor,Y.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(B.isArray(g))for(var m=0,p=0;p=0;i--){var a=t[i];if(e(a))return a}},B.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},B.almostEquals=function(t,e,n){return Math.abs(t-e)=t},B.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},B.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},B.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},B.toRadians=function(t){return t*(Math.PI/180)},B.toDegrees=function(t){return t*(180/Math.PI)},B._decimalPlaces=function(t){if(B.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},B.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},B.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},B.aliasPixel=function(t){return t%2==0?0:.5},B._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},B.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},B.EPSILON=Number.EPSILON||1e-14,B.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(a=e0?d[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},B.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},B.niceNum=function(t,e){var n=Math.floor(B.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},B.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},B.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(B.getStyle(r,"padding-left")),u=parseFloat(B.getStyle(r,"padding-top")),d=parseFloat(B.getStyle(r,"padding-right")),h=parseFloat(B.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},B.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},B.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},B._calculatePadding=function(t,e,n){return(e=B.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},B._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},B.getMaximumWidth=function(t){var e=B._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-B._calculatePadding(e,"padding-left",n)-B._calculatePadding(e,"padding-right",n),a=B.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},B.getMaximumHeight=function(t){var e=B._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-B._calculatePadding(e,"padding-top",n)-B._calculatePadding(e,"padding-bottom",n),a=B.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},B.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},B.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},B.fontString=function(t,e,n){return e+" "+t+"px "+n},B.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;on.length){for(o=0;oi&&(i=r),i},B.numberOfLabelLines=function(t){var e=1;return B.each(t,(function(t){B.isArray(t)&&t.length>e&&(e=t.length)})),e},B.color=w?function(t){return t instanceof CanvasGradient&&(t=Y.global.defaultColor),w(t)}:function(t){return console.error("Color.js not found!"),t},B.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:B.color(t).saturate(.5).darken(.1).rgbString()}}(),nn._adapters=on,nn.Animation=J,nn.animationService=Q,nn.controllers=Qt,nn.DatasetController=at,nn.defaults=Y,nn.Element=X,nn.elements=kt,nn.Interaction=oe,nn.layouts=pe,nn.platform=Le,nn.plugins=Re,nn.Scale=_n,nn.scaleService=Ne,nn.Ticks=sn,nn.Tooltip=qe,nn.helpers.each(gi,(function(t,e){nn.scaleService.registerScaleType(e,t,t._defaults)})),Ni)Ni.hasOwnProperty(Ei)&&nn.plugins.register(Ni[Ei]);nn.platform.initialize();var Vi=nn;return"undefined"!=typeof window&&(window.Chart=nn),nn.Chart=nn,nn.Legend=Ni.legend._element,nn.Title=Ni.title._element,nn.pluginService=nn.plugins,nn.PluginBase=nn.Element.extend({}),nn.canvasHelpers=nn.helpers.canvas,nn.layoutService=nn.layouts,nn.LinearScaleBase=Cn,nn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){nn[t]=function(e,n){return new nn(e,nn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Vi})); diff --git a/plugins/additionals/assets/javascripts/additionals.js b/plugins/additionals/assets/javascripts/additionals.js index 4b463a6..3474a86 100644 --- a/plugins/additionals/assets/javascripts/additionals.js +++ b/plugins/additionals/assets/javascripts/additionals.js @@ -32,3 +32,61 @@ function formatFontawesomeText(icon) { return icon.text; } } + +/* exported observeLiveSearchField */ +function observeLiveSearchField(fieldId, targetId, target_url) { + $('#'+fieldId).each(function() { + var $this = $(this); + $this.addClass('autocomplete'); + $this.attr('data-search-was', $this.val()); + var check = function() { + var val = $this.val(); + if ($this.attr('data-search-was') != val){ + $this.attr('data-search-was', val); + + var form = $('#query_form'); // grab the form wrapping the search bar. + var formData; + var url; + + form.find('[name="c[]"] option').each(function(i, elem) { + $(elem).attr('selected', true); + }); + + if (typeof target_url === 'undefined') { + url = form.attr('action'); + formData = form.serialize(); + } else { + url = target_url; + formData = { q: val }; + } + + form.find('[name="c[]"] option').each(function(i, elem) { + $(elem).attr('selected', false); + }); + + $.ajax({ + url: url, + type: 'get', + data: formData, + success: function(data){ if(targetId) $('#'+targetId).html(data); }, + beforeSend: function(){ $this.addClass('ajax-loading'); }, + complete: function(){ $this.removeClass('ajax-loading'); } + }); + } + }; + + /* see https://stackoverflow.com/questions/1909441/how-to-delay-the-keyup-handler-until-the-user-stops-typing */ + var search_delay = function(callback) { + var timer = 0; + return function() { + var context = this, args = arguments; + clearTimeout(timer); + timer = setTimeout(function () { + callback.apply(context, args); + }, 400 || 0); + }; + }; + + $this.keyup(search_delay(check)); + }); +} diff --git a/plugins/additionals/assets/javascripts/additionals_observe_field.js b/plugins/additionals/assets/javascripts/additionals_observe_field.js deleted file mode 100755 index c33ba54..0000000 --- a/plugins/additionals/assets/javascripts/additionals_observe_field.js +++ /dev/null @@ -1,52 +0,0 @@ -// see https://github.com/splendeo/jquery.observe_field - -(function($) { - 'use strict'; - - $.fn.live_observe_field = function(frequency, callback) { - - frequency = frequency * 100; // translate to milliseconds - - return this.each(function() { - var $this = $(this); - var prev = $this.val(); - var prevChecked = $this.prop('checked'); - - var check = function() { - if (removed()) { - // if removed clear the interval and don't fire the callback - if (ti) - clearInterval(ti); - return; - } - - var val = $this.val(); - var checked = $this.prop('checked'); - if (prev != val || checked != prevChecked) { - prev = val; - prevChecked = checked; - $this.map(callback); // invokes the callback on $this - } - }; - - var removed = function() { - return $this.closest('html').length == 0; - }; - - var reset = function() { - if (ti) { - clearInterval(ti); - ti = setInterval(check, frequency); - } - }; - - check(); - var ti = setInterval(check, frequency); // invoke check periodically - - // reset counter after user interaction - $this.bind('keyup click mousemove', reset); // mousemove is for selects - }); - - }; - -})(jQuery); diff --git a/plugins/additionals/assets/javascripts/clipboard.min.js b/plugins/additionals/assets/javascripts/clipboard.min.js index b9ed143..95f55d7 100644 --- a/plugins/additionals/assets/javascripts/clipboard.min.js +++ b/plugins/additionals/assets/javascripts/clipboard.min.js @@ -1,7 +1,7 @@ /*! - * clipboard.js v2.0.6 + * clipboard.js v2.0.8 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return o={},r.m=n=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;on?1:t>=n?0:NaN}function e(t){let e=t,r=t;function i(t,n,e,i){for(null==e&&(e=0),null==i&&(i=t.length);e>>1;r(t[o],n)<0?e=o+1:i=o}return e}return 1===t.length&&(e=(n,e)=>t(n)-e,r=function(t){return(e,r)=>n(t(e),r)}(t)),{left:i,center:function(t,n,r,o){null==r&&(r=0),null==o&&(o=t.length);const a=i(t,n,r,o-1);return a>r&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,n,e,i){for(null==e&&(e=0),null==i&&(i=t.length);e>>1;r(t[o],n)>0?i=o:e=o+1}return e}}}function r(t){return null===t?NaN:+t}const i=e(n),o=i.right,a=i.left,u=e(r).center;function c(t,n){let e=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&++e;else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(i=+i)>=i&&++e}return e}function f(t){return 0|t.length}function s(t){return!(t>0)}function l(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function h(t,n){let e,r=0,i=0,o=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(e=n-i,i+=e/++r,o+=e*(n-i));else{let a=-1;for(let u of t)null!=(u=n(u,++a,t))&&(u=+u)>=u&&(e=u-i,i+=e/++r,o+=e*(u-i))}if(r>1)return o/(r-1)}function d(t,n){const e=h(t,n);return e?Math.sqrt(e):e}function p(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r=o&&(e=r=o):(e>o&&(e=o),r0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}function y(t){return t}function v(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function _(t,n,e,r){return function t(i,o){if(o>=r.length)return e(i);const a=new Map,u=r[o++];let c=-1;for(const t of i){const n=u(t,++c,i),e=a.get(n);e?e.push(t):a.set(n,[t])}for(const[n,e]of a)a.set(n,t(e,o));return n(a)}(t,0)}var b=Array.prototype.slice;function m(t){return function(){return t}}var x=Math.sqrt(50),w=Math.sqrt(10),M=Math.sqrt(2);function A(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=x?10:o>=w?5:o>=M?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=x?10:o>=w?5:o>=M?2:1)}function S(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=x?i*=10:o>=w?i*=5:o>=M&&(i*=2),nl;)h.pop(),--d;var p,g=new Array(d+1);for(i=0;i<=d;++i)(p=g[i]=[]).x0=i>0?h[i-1]:s,p.x1=i=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function C(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function P(t,e,r=0,i=t.length-1,o=n){for(;i>r;){if(i-r>600){const n=i-r+1,a=e-r+1,u=Math.log(n),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(n-c)/n)*(a-n/2<0?-1:1);P(t,e,Math.max(r,Math.floor(e-a*c/n+f)),Math.min(i,Math.floor(e+(n-a)*c/n+f)),o)}const n=t[e];let a=r,u=i;for(z(t,r,e),o(t[i],n)>0&&z(t,r,i);a0;)--u}0===o(t[r],n)?z(t,r,u):(++u,z(t,u,i)),u<=e&&(r=u+1),e<=u&&(i=u-1)}return t}function z(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function D(t,n,e){if(r=(t=Float64Array.from(function*(t,n){if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let e=-1;for(let r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(t,e))).length){if((n=+n)<=0||r<2)return C(t);if(n>=1)return N(t);var r,i=(r-1)*n,o=Math.floor(i),a=N(P(t,o).subarray(0,o+1));return a+(C(t.subarray(o+1))-a)*(i-o)}}function q(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e=o)&&(e=o,r=i);return r}function R(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}function F(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e>n||void 0===e&&n>=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e>o||void 0===e&&o>=o)&&(e=o,r=i);return r}function U(t,n){return[t,n]}function O(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r+t(n)}function Z(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(e){return+t(e)+n}}function K(){return!this.__axis}function Q(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,c=1===t||4===t?-1:1,f=4===t||2===t?"x":"y",s=1===t||3===t?V:$;function l(l){var h=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,d=null==i?n.tickFormat?n.tickFormat.apply(n,e):X:i,p=Math.max(o,0)+u,g=n.range(),y=+g[0]+.5,v=+g[g.length-1]+.5,_=(n.bandwidth?Z:W)(n.copy()),b=l.selection?l.selection():l,m=b.selectAll(".domain").data([null]),x=b.selectAll(".tick").data(h,n).order(),w=x.exit(),M=x.enter().append("g").attr("class","tick"),A=x.select("line"),T=x.select("text");m=m.merge(m.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(M),A=A.merge(M.append("line").attr("stroke","currentColor").attr(f+"2",c*o)),T=T.merge(M.append("text").attr("fill","currentColor").attr(f,c*p).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),l!==b&&(m=m.transition(l),x=x.transition(l),A=A.transition(l),T=T.transition(l),w=w.transition(l).attr("opacity",G).attr("transform",(function(t){return isFinite(t=_(t))?s(t):this.getAttribute("transform")})),M.attr("opacity",G).attr("transform",(function(t){var n=this.parentNode.__axis;return s(n&&isFinite(n=n(t))?n:_(t))}))),w.remove(),m.attr("d",4===t||2==t?a?"M"+c*a+","+y+"H0.5V"+v+"H"+c*a:"M0.5,"+y+"V"+v:a?"M"+y+","+c*a+"V0.5H"+v+"V"+c*a:"M"+y+",0.5H"+v),x.attr("opacity",1).attr("transform",(function(t){return s(_(t))})),A.attr(f+"2",c*o),T.attr(f,c*p).text(d),b.filter(K).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each((function(){this.__axis=_}))}return l.scale=function(t){return arguments.length?(n=t,l):n},l.ticks=function(){return e=H.call(arguments),l},l.tickArguments=function(t){return arguments.length?(e=null==t?[]:H.call(t),l):e.slice()},l.tickValues=function(t){return arguments.length?(r=null==t?null:H.call(t),l):r&&r.slice()},l.tickFormat=function(t){return arguments.length?(i=t,l):i},l.tickSize=function(t){return arguments.length?(o=a=+t,l):o},l.tickSizeInner=function(t){return arguments.length?(o=+t,l):o},l.tickSizeOuter=function(t){return arguments.length?(a=+t,l):a},l.tickPadding=function(t){return arguments.length?(u=+t,l):u},l}var J={value:()=>{}};function tt(){for(var t,n=0,e=arguments.length,r={};n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function rt(t,n){for(var e,r=0,i=t.length;r0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),at.hasOwnProperty(n)?{space:at[n],local:t}:t}function ct(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===ot&&n.documentElement.namespaceURI===ot?n.createElement(t):n.createElementNS(e,t)}}function ft(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function st(t){var n=ut(t);return(n.local?ft:ct)(n)}function lt(){}function ht(t){return null==t?lt:function(){return this.querySelector(t)}}function dt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function pt(){return[]}function gt(t){return null==t?pt:function(){return this.querySelectorAll(t)}}function yt(t){return function(){return this.matches(t)}}function vt(t){return function(n){return n.matches(t)}}var _t=Array.prototype.find;function bt(){return this.firstElementChild}var mt=Array.prototype.filter;function xt(){return this.children}function wt(t){return new Array(t.length)}function Mt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function At(t){return function(){return t}}function Tt(t,n,e,r,i,o){for(var a,u=0,c=n.length,f=o.length;un?1:t>=n?0:NaN}function Nt(t){return function(){this.removeAttribute(t)}}function Ct(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Pt(t,n){return function(){this.setAttribute(t,n)}}function zt(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Dt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function qt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Rt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ft(t){return function(){this.style.removeProperty(t)}}function Ut(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Ot(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function It(t,n){return t.style.getPropertyValue(n)||Rt(t).getComputedStyle(t,null).getPropertyValue(n)}function Bt(t){return function(){delete this[t]}}function Yt(t,n){return function(){this[t]=n}}function Lt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function jt(t){return t.trim().split(/^|\s+/)}function Ht(t){return t.classList||new Xt(t)}function Xt(t){this._node=t,this._names=jt(t.getAttribute("class")||"")}function Gt(t,n){for(var e=Ht(t),r=-1,i=n.length;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function ln(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var yn=[null];function vn(t,n){this._groups=t,this._parents=n}function _n(){return new vn([[document.documentElement]],yn)}function bn(t){return"string"==typeof t?new vn([[document.querySelector(t)]],[document.documentElement]):new vn([[t]],yn)}vn.prototype=_n.prototype={constructor:vn,select:function(t){"function"!=typeof t&&(t=ht(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=x&&(x=m+1);!(b=y[x])&&++x=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=kt);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?Ft:"function"==typeof n?Ot:Ut)(t,n,null==e?"":e)):It(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Bt:"function"==typeof n?Lt:Yt)(t,n)):this.node()[t]},classed:function(t,n){var e=jt(t+"");if(arguments.length<2){for(var r=Ht(this.node()),i=-1,o=e.length;++i()=>t;function Cn(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:f,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:s}})}function Pn(t){return!t.ctrlKey&&!t.button}function zn(){return this.parentNode}function Dn(t,n){return null==n?{x:t.x,y:t.y}:n}function qn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Rn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Fn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Un(){}Cn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var On=.7,In=1/On,Bn="\\s*([+-]?\\d+)\\s*",Yn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ln="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jn=/^#([0-9a-f]{3,8})$/,Hn=new RegExp("^rgb\\("+[Bn,Bn,Bn]+"\\)$"),Xn=new RegExp("^rgb\\("+[Ln,Ln,Ln]+"\\)$"),Gn=new RegExp("^rgba\\("+[Bn,Bn,Bn,Yn]+"\\)$"),Vn=new RegExp("^rgba\\("+[Ln,Ln,Ln,Yn]+"\\)$"),$n=new RegExp("^hsl\\("+[Yn,Ln,Ln]+"\\)$"),Wn=new RegExp("^hsla\\("+[Yn,Ln,Ln,Yn]+"\\)$"),Zn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Kn(){return this.rgb().formatHex()}function Qn(){return this.rgb().formatRgb()}function Jn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=jn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?te(n):3===e?new ie(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?ne(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?ne(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Hn.exec(t))?new ie(n[1],n[2],n[3],1):(n=Xn.exec(t))?new ie(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Gn.exec(t))?ne(n[1],n[2],n[3],n[4]):(n=Vn.exec(t))?ne(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=$n.exec(t))?ce(n[1],n[2]/100,n[3]/100,1):(n=Wn.exec(t))?ce(n[1],n[2]/100,n[3]/100,n[4]):Zn.hasOwnProperty(t)?te(Zn[t]):"transparent"===t?new ie(NaN,NaN,NaN,0):null}function te(t){return new ie(t>>16&255,t>>8&255,255&t,1)}function ne(t,n,e,r){return r<=0&&(t=n=e=NaN),new ie(t,n,e,r)}function ee(t){return t instanceof Un||(t=Jn(t)),t?new ie((t=t.rgb()).r,t.g,t.b,t.opacity):new ie}function re(t,n,e,r){return 1===arguments.length?ee(t):new ie(t,n,e,null==r?1:r)}function ie(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function oe(){return"#"+ue(this.r)+ue(this.g)+ue(this.b)}function ae(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function ue(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ce(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new le(t,n,e,r)}function fe(t){if(t instanceof le)return new le(t.h,t.s,t.l,t.opacity);if(t instanceof Un||(t=Jn(t)),!t)return new le;if(t instanceof le)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new le(a,u,c,t.opacity)}function se(t,n,e,r){return 1===arguments.length?fe(t):new le(t,n,e,null==r?1:r)}function le(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function he(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Rn(Un,Jn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Kn,formatHex:Kn,formatHsl:function(){return fe(this).formatHsl()},formatRgb:Qn,toString:Qn}),Rn(ie,re,Fn(Un,{brighter:function(t){return t=null==t?In:Math.pow(In,t),new ie(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?On:Math.pow(On,t),new ie(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oe,formatHex:oe,formatRgb:ae,toString:ae})),Rn(le,se,Fn(Un,{brighter:function(t){return t=null==t?In:Math.pow(In,t),new le(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?On:Math.pow(On,t),new le(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new ie(he(t>=240?t-240:t+120,i,r),he(t,i,r),he(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const de=Math.PI/180,pe=180/Math.PI,ge=.96422,ye=.82521,ve=4/29,_e=6/29,be=3*_e*_e;function me(t){if(t instanceof we)return new we(t.l,t.a,t.b,t.opacity);if(t instanceof Ne)return Ce(t);t instanceof ie||(t=ee(t));var n,e,r=Se(t.r),i=Se(t.g),o=Se(t.b),a=Me((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?n=e=a:(n=Me((.4360747*r+.3850649*i+.1430804*o)/ge),e=Me((.0139322*r+.0971045*i+.7141733*o)/ye)),new we(116*a-16,500*(n-a),200*(a-e),t.opacity)}function xe(t,n,e,r){return 1===arguments.length?me(t):new we(t,n,e,null==r?1:r)}function we(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Me(t){return t>.008856451679035631?Math.pow(t,1/3):t/be+ve}function Ae(t){return t>_e?t*t*t:be*(t-ve)}function Te(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Se(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ee(t){if(t instanceof Ne)return new Ne(t.h,t.c,t.l,t.opacity);if(t instanceof we||(t=me(t)),0===t.a&&0===t.b)return new Ne(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function Ge(t,n){return function(e){return t+e*n}}function Ve(t,n){var e=n-t;return e?Ge(t,e>180||e<-180?e-360*Math.round(e/360):e):Xe(isNaN(t)?n:t)}function $e(t){return 1==(t=+t)?We:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Xe(isNaN(n)?e:n)}}function We(t,n){var e=n-t;return e?Ge(t,e):Xe(isNaN(t)?n:t)}var Ze=function t(n){var e=$e(n);function r(t,n){var r=e((t=re(t)).r,(n=re(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=We(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Ke(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:ir(e,r)})),o=ur.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:ir(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:ir(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:ir(t,e)},{i:u-2,x:ir(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--zr}function Xr(){Fr=(Rr=Or.now())+Ur,zr=Dr=0;try{Hr()}finally{zr=0,function(){var t,n,e=Cr,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Cr=n);Pr=t,Vr(r)}(),Fr=0}}function Gr(){var t=Or.now(),n=t-Rr;n>1e3&&(Ur-=n,Rr=t)}function Vr(t){zr||(Dr&&(Dr=clearTimeout(Dr)),t-Fr>24?(t<1/0&&(Dr=setTimeout(Xr,t-Or.now()-Ur)),qr&&(qr=clearInterval(qr))):(qr||(Rr=Or.now(),qr=setInterval(Gr,1e3)),zr=1,Ir(Xr)))}function $r(t,n,e){var r=new Lr;return n=null==n?0:+n,r.restart(e=>{r.stop(),t(e+n)},n,e),r}Lr.prototype=jr.prototype={constructor:Lr,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Br():+e)+(null==n?0:+n),this._next||Pr===this||(Pr?Pr._next=this:Cr=this,Pr=this),this._call=t,this._time=e,Vr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vr())}};var Wr=tt("start","end","cancel","interrupt"),Zr=[];function Kr(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var f,s,l,h;if(1!==e.state)return c();for(f in i)if((h=i[f]).name===e.name){if(3===h.state)return $r(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+f0)throw new Error("too late; already scheduled");return e}function Jr(t,n){var e=ti(t,n);if(e.state>3)throw new Error("too late; already running");return e}function ti(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function ni(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function ei(t,n){var e,r;return function(){var i=Jr(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Qr:Jr;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}var wi=_n.prototype.constructor;function Mi(t){return function(){this.style.removeProperty(t)}}function Ai(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Ti(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&Ai(t,o,e)),r}return o._value=n,o}function Si(t){return function(n){this.textContent=t.call(this,n)}}function Ei(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&Si(r)),n}return r._value=t,r}var ki=0;function Ni(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Ci(t){return _n().transition(t)}function Pi(){return++ki}var zi=_n.prototype;Ni.prototype=Ci.prototype={constructor:Ni,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=ht(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>t;function oo(t,{sourceEvent:n,target:e,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function ao(t){t.stopImmediatePropagation()}function uo(t){t.preventDefault(),t.stopImmediatePropagation()}var co={name:"drag"},fo={name:"space"},so={name:"handle"},lo={name:"center"};const{abs:ho,max:po,min:go}=Math;function yo(t){return[+t[0],+t[1]]}function vo(t){return[yo(t[0]),yo(t[1])]}var _o={name:"x",handles:["w","e"].map(So),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},bo={name:"y",handles:["n","s"].map(So),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},mo={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(So),input:function(t){return null==t?null:vo(t)},output:function(t){return t}},xo={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},wo={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Mo={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ao={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},To={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function So(t){return{type:t}}function Eo(t){return!t.ctrlKey&&!t.button}function ko(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function No(){return navigator.maxTouchPoints||"ontouchstart"in this}function Co(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Po(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function zo(t){var n,e=ko,r=Eo,i=No,o=!0,a=tt("start","brush","end"),u=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([So("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",xo.overlay).merge(e).each((function(){var t=Co(this).extent;bn(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([So("selection")]).enter().append("rect").attr("class","selection").attr("cursor",xo.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return xo[t.type]})),n.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){var t=bn(this),n=Co(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function s(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new l(t,n,e):r}function l(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function h(e){if((!n||e.touches)&&r.apply(this,arguments)){var i,a,u,c,l,h,d,p,g,y,v,_=this,b=e.target.__data__.type,m="selection"===(o&&e.metaKey?b="overlay":b)?co:o&&e.altKey?lo:so,x=t===bo?null:Ao[b],w=t===_o?null:To[b],M=Co(_),A=M.extent,T=M.selection,S=A[0][0],E=A[0][1],k=A[1][0],N=A[1][1],C=0,P=0,z=x&&w&&o&&e.shiftKey,D=Array.from(e.touches||[e],t=>{const n=t.identifier;return(t=An(t,_)).point0=t.slice(),t.identifier=n,t});if("overlay"===b){T&&(g=!0);const n=[D[0],D[1]||D[0]];M.selection=T=[[i=t===bo?S:go(n[0][0],n[1][0]),u=t===_o?E:go(n[0][1],n[1][1])],[l=t===bo?k:po(n[0][0],n[1][0]),d=t===_o?N:po(n[0][1],n[1][1])]],D.length>1&&I()}else i=T[0][0],u=T[0][1],l=T[1][0],d=T[1][1];a=i,c=u,h=l,p=d;var q=bn(_).attr("pointer-events","none"),R=q.selectAll(".overlay").attr("cursor",xo[b]);ni(_);var F=s(_,arguments,!0).beforestart();if(e.touches)F.moved=O,F.ended=B;else{var U=bn(e.view).on("mousemove.brush",O,!0).on("mouseup.brush",B,!0);o&&U.on("keydown.brush",Y,!0).on("keyup.brush",L,!0),En(e.view)}f.call(_),F.start(e,m.name)}function O(t){for(const n of t.changedTouches||[t])for(const t of D)t.identifier===n.identifier&&(t.cur=An(n,_));if(z&&!y&&!v&&1===D.length){const t=D[0];ho(t.cur[0]-t[0])>ho(t.cur[1]-t[1])?v=!0:y=!0}for(const t of D)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,uo(t),I(t)}function I(t){const n=D[0],e=n.point0;var r;switch(C=n[0]-e[0],P=n[1]-e[1],m){case fo:case co:x&&(C=po(S-i,go(k-l,C)),a=i+C,h=l+C),w&&(P=po(E-u,go(N-d,P)),c=u+P,p=d+P);break;case so:D[1]?(x&&(a=po(S,go(k,D[0][0])),h=po(S,go(k,D[1][0])),x=1),w&&(c=po(E,go(N,D[0][1])),p=po(E,go(N,D[1][1])),w=1)):(x<0?(C=po(S-i,go(k-i,C)),a=i+C,h=l):x>0&&(C=po(S-l,go(k-l,C)),a=i,h=l+C),w<0?(P=po(E-u,go(N-u,P)),c=u+P,p=d):w>0&&(P=po(E-d,go(N-d,P)),c=u,p=d+P));break;case lo:x&&(a=po(S,go(k,i-C*x)),h=po(S,go(k,l+C*x))),w&&(c=po(E,go(N,u-P*w)),p=po(E,go(N,d+P*w)))}h0&&(i=a-C),w<0?d=p-P:w>0&&(u=c-P),m=fo,R.attr("cursor",xo.selection),I());break;default:return}uo(t)}function L(t){switch(t.keyCode){case 16:z&&(y=v=z=!1,I());break;case 18:m===lo&&(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=so,I());break;case 32:m===fo&&(t.altKey?(x&&(l=h-C*x,i=a+C*x),w&&(d=p-P*w,u=c+P*w),m=lo):(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=so),R.attr("cursor",xo[b]),I());break;default:return}uo(t)}}function d(t){s(this,arguments).moved(t)}function p(t){s(this,arguments).ended(t)}function g(){var n=this.__brush||{selection:null};return n.extent=vo(e.apply(this,arguments)),n.dim=t,n}return c.move=function(n,e){n.tween?n.on("start.brush",(function(t){s(this,arguments).beforestart().start(t)})).on("interrupt.brush end.brush",(function(t){s(this,arguments).end(t)})).tween("brush",(function(){var n=this,r=n.__brush,i=s(n,arguments),o=r.selection,a=t.input("function"==typeof e?e.apply(this,arguments):e,r.extent),u=fr(o,a);function c(t){r.selection=1===t&&null===a?null:u(t),f.call(n),i.brush()}return null!==o&&null!==a?c:c(1)})):n.each((function(){var n=this,r=arguments,i=n.__brush,o=t.input("function"==typeof e?e.apply(n,r):e,i.extent),a=s(n,r).beforestart();ni(n),i.selection=null===o?null:o,f.call(n),a.start().brush().end()}))},c.clear=function(t){c.move(t,null)},l.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,n){return this.starting?(this.starting=!1,this.emit("start",t,n)):this.emit("brush",t),this},brush:function(t,n){return this.emit("brush",t,n),this},end:function(t,n){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,n)),this},emit:function(n,e,r){var i=bn(this.that).datum();a.call(n,this.that,new oo(n,{sourceEvent:e,target:c,selection:t.output(this.state.selection),mode:r,dispatch:a}),i)}},c.extent=function(t){return arguments.length?(e="function"==typeof t?t:io(vo(t)),c):e},c.filter=function(t){return arguments.length?(r="function"==typeof t?t:io(!!t),c):r},c.touchable=function(t){return arguments.length?(i="function"==typeof t?t:io(!!t),c):i},c.handleSize=function(t){return arguments.length?(u=+t,c):u},c.keyModifiers=function(t){return arguments.length?(o=!!t,c):o},c.on=function(){var t=a.on.apply(a,arguments);return t===a?c:t},c}var Do=Math.abs,qo=Math.cos,Ro=Math.sin,Fo=Math.PI,Uo=Fo/2,Oo=2*Fo,Io=Math.max,Bo=1e-12;function Yo(t,n){return Array.from({length:n-t},(n,e)=>t+e)}function Lo(t){return function(n,e){return t(n.source.value+n.target.value,e.source.value+e.target.value)}}function jo(t,n){var e=0,r=null,i=null,o=null;function a(a){var u,c=a.length,f=new Array(c),s=Yo(0,c),l=new Array(c*c),h=new Array(c),d=0;a=Float64Array.from({length:c*c},n?(t,n)=>a[n%c][n/c|0]:(t,n)=>a[n/c|0][n%c]);for(let n=0;nr(f[t],f[n]));for(const e of s){const r=n;if(t){const t=Yo(1+~c,c).filter(t=>t<0?a[~t*c+e]:a[e*c+t]);i&&t.sort((t,n)=>i(t<0?-a[~t*c+e]:a[e*c+t],n<0?-a[~n*c+e]:a[e*c+n]));for(const r of t)if(r<0){(l[~r*c+e]||(l[~r*c+e]={source:null,target:null})).target={index:e,startAngle:n,endAngle:n+=a[~r*c+e]*d,value:a[~r*c+e]}}else{(l[e*c+r]||(l[e*c+r]={source:null,target:null})).source={index:e,startAngle:n,endAngle:n+=a[e*c+r]*d,value:a[e*c+r]}}h[e]={index:e,startAngle:r,endAngle:n,value:f[e]}}else{const t=Yo(0,c).filter(t=>a[e*c+t]||a[t*c+e]);i&&t.sort((t,n)=>i(a[e*c+t],a[e*c+n]));for(const r of t){let t;if(eGo)if(Math.abs(s*u-c*f)>Go&&i){var h=e-o,d=r-a,p=u*u+c*c,g=h*h+d*d,y=Math.sqrt(p),v=Math.sqrt(l),_=i*Math.tan((Ho-Math.acos((p+l-g)/(2*y*v)))/2),b=_/v,m=_/y;Math.abs(b-1)>Go&&(this._+="L"+(t+b*f)+","+(n+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+m*u)+","+(this._y1=n+m*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,f=n+u,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>Go||Math.abs(this._y1-f)>Go)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%Xo+Xo),l>Vo?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>Go&&(this._+="A"+e+","+e+",0,"+ +(l>=Ho)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Zo=Array.prototype.slice;function Ko(t){return function(){return t}}function Qo(t){return t.source}function Jo(t){return t.target}function ta(t){return t.radius}function na(t){return t.startAngle}function ea(t){return t.endAngle}function ra(){return 0}function ia(){return 10}function oa(t){var n=Qo,e=Jo,r=ta,i=ta,o=na,a=ea,u=ra,c=null;function f(){var f,s=n.apply(this,arguments),l=e.apply(this,arguments),h=u.apply(this,arguments)/2,d=Zo.call(arguments),p=+r.apply(this,(d[0]=s,d)),g=o.apply(this,d)-Uo,y=a.apply(this,d)-Uo,v=+i.apply(this,(d[0]=l,d)),_=o.apply(this,d)-Uo,b=a.apply(this,d)-Uo;if(c||(c=f=Wo()),h>Bo&&(Do(y-g)>2*h+Bo?y>g?(g+=h,y-=h):(g-=h,y+=h):g=y=(g+y)/2,Do(b-_)>2*h+Bo?b>_?(_+=h,b-=h):(_-=h,b+=h):_=b=(_+b)/2),c.moveTo(p*qo(g),p*Ro(g)),c.arc(0,0,p,g,y),g!==_||y!==b)if(t){var m=+t.apply(this,arguments),x=v-m,w=(_+b)/2;c.quadraticCurveTo(0,0,x*qo(_),x*Ro(_)),c.lineTo(v*qo(w),v*Ro(w)),c.lineTo(x*qo(b),x*Ro(b))}else c.quadraticCurveTo(0,0,v*qo(_),v*Ro(_)),c.arc(0,0,v,_,b);if(c.quadraticCurveTo(0,0,p*qo(g),p*Ro(g)),c.closePath(),f)return c=null,f+""||null}return t&&(f.headRadius=function(n){return arguments.length?(t="function"==typeof n?n:Ko(+n),f):t}),f.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:Ko(+t),f):r},f.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:Ko(+t),f):r},f.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:Ko(+t),f):i},f.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ko(+t),f):o},f.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ko(+t),f):a},f.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:Ko(+t),f):u},f.source=function(t){return arguments.length?(n=t,f):n},f.target=function(t){return arguments.length?(e=t,f):e},f.context=function(t){return arguments.length?(c=null==t?null:t,f):c},f}var aa=Array.prototype.slice;function ua(t,n){return t-n}var ca=t=>()=>t;function fa(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function la(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function ha(){}var da=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function pa(){var t=1,n=1,e=E,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(ua);else{var r=p(t),i=r[0],a=r[1];n=S(i,a,n),n=O(Math.floor(i/n)*n,Math.floor(a/n)*n,n)}return n.map((function(n){return o(t,n)}))}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,c,f,s,l,h=new Array,d=new Array;o=u=-1,f=e[0]>=r,da[f<<1].forEach(p);for(;++o=r,da[c|f<<1].forEach(p);da[f<<0].forEach(p);for(;++u=r,s=e[u*t]>=r,da[f<<1|s<<2].forEach(p);++o=r,l=s,s=e[u*t+o+1]>=r,da[c|f<<1|s<<2|l<<3].forEach(p);da[f|s<<3].forEach(p)}o=-1,s=e[u*t]>=r,da[s<<2].forEach(p);for(;++o=r,da[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],c=[t[1][0]+o,t[1][1]+u],f=a(r),s=a(c);(n=d[f])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[f])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=f]=n):h[f]=d[s]={start:f,end:s,ring:[r,c]}}da[s<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var n,e=0,r=o.length;e0&&a0&&u=0&&o>=0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?ca(aa.call(t)):ca(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:ha,i):r===u},i}function ga(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[u-o+a*r]),n.data[u-e+a*r]=c/Math.min(u+1,r-1+o-u,o))}function ya(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=c/Math.min(u+1,i-1+o-u,o))}function va(t){return t[0]}function _a(t){return t[1]}function ba(){return 1}const ma=Math.pow(2,-52),xa=new Uint32Array(512);class wa{static from(t,n=Ca,e=Pa){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const e=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*e),this._halfedges=new Int32Array(3*e),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:e,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,c=-1/0,f=-1/0;for(let n=0;nc&&(c=e),r>f&&(f=r),this._ids[n]=n}const s=(a+c)/2,l=(u+f)/2;let h,d,p,g=1/0;for(let n=0;n0&&(d=n,g=e)}let _=t[2*d],b=t[2*d+1],m=1/0;for(let n=0;nr&&(n[e++]=i,r=this._dists[i])}return this.hull=n.subarray(0,e),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Ta(y,v,_,b,x,w)){const t=d,n=_,e=b;d=p,_=x,b=w,p=t,x=n,w=e}const M=function(t,n,e,r,i,o){const a=e-t,u=r-n,c=i-t,f=o-n,s=a*a+u*u,l=c*c+f*f,h=.5/(a*f-u*c);return{x:t+(f*s-u*l)*h,y:n+(a*l-c*s)*h}}(y,v,_,b,x,w);this._cx=M.x,this._cy=M.y;for(let n=0;n0&&Math.abs(f-o)<=ma&&Math.abs(s-a)<=ma)continue;if(o=f,a=s,c===h||c===d||c===p)continue;let l=0;for(let t=0,n=this._hashKey(f,s);t0?3-e:1+e)/4}(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:e,coords:r}=this;let i=0,o=0;for(;;){const a=e[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=xa[--i];continue}const c=a-a%3,f=u+(t+1)%3,s=c+(a+2)%3,l=n[o],h=n[t],d=n[f],p=n[s];if(Sa(r[2*l],r[2*l+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=l;const r=e[s];if(-1===r){let n=this._hullStart;do{if(this._hullTri[n]===s){this._hullTri[n]=t;break}n=this._hullPrev[n]}while(n!==this._hullStart)}this._link(t,r),this._link(a,e[o]),this._link(o,s);const u=c+(a+1)%3;i=33306690738754716e-32*Math.abs(a+u)?a-u:0}function Ta(t,n,e,r,i,o){return(Aa(i,o,t,n,e,r)||Aa(t,n,e,r,i,o)||Aa(e,r,i,o,t,n))<0}function Sa(t,n,e,r,i,o,a,u){const c=t-a,f=n-u,s=e-a,l=r-u,h=i-a,d=o-u,p=s*s+l*l,g=h*h+d*d;return c*(l*g-p*d)-f*(s*g-p*h)+(c*c+f*f)*(s*d-l*h)<0}function Ea(t,n,e,r,i,o){const a=e-t,u=r-n,c=i-t,f=o-n,s=a*a+u*u,l=c*c+f*f,h=.5/(a*f-u*c),d=(f*s-u*l)*h,p=(a*l-c*s)*h;return d*d+p*p}function ka(t,n,e,r){if(r-e<=20)for(let i=e+1;i<=r;i++){const r=t[i],o=n[r];let a=i-1;for(;a>=e&&n[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=e+1,o=r;Na(t,e+r>>1,i),n[t[e]]>n[t[r]]&&Na(t,e,r),n[t[i]]>n[t[r]]&&Na(t,i,r),n[t[e]]>n[t[i]]&&Na(t,e,i);const a=t[i],u=n[a];for(;;){do{i++}while(n[t[i]]u);if(o=o-e?(ka(t,n,i,r),ka(t,n,e,o-1)):(ka(t,n,e,o-1),ka(t,n,i,r))}}function Na(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function Ca(t){return t[0]}function Pa(t){return t[1]}const za=1e-6;class Da{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,e){const r=(t=+t)+(e=+e),i=n=+n;if(e<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>za||Math.abs(this._y1-i)>za)&&(this._+="L"+r+","+i),e&&(this._+=`A${e},${e},0,1,1,${t-e},${n}A${e},${e},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,n,e,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+e}v${+r}h${-e}Z`}value(){return this._||null}}class qa{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class Ra{constructor(t,[n,e,r,i]=[0,0,960,500]){if(!((r=+r)>=(n=+n)&&(i=+i)>=(e=+e)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=n,this.ymax=i,this.ymin=e,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:e},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,e.length/3*2);for(let n,r,o=0,a=0,u=e.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(n>=this.ymax)return null;(i=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/e)this.xmax?2:0)|(nthis.ymax?8:0)}}const Fa=2*Math.PI,Ua=Math.pow;function Oa(t){return t[0]}function Ia(t){return t[1]}function Ba(t,n,e){return[t+Math.sin(t+n)*e,n+Math.cos(t-n)*e]}class Ya{static from(t,n=Oa,e=Ia,r){return new Ya("length"in t?function(t,n,e,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:n,coords:e}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},(t,n)=>n).sort((t,e)=>n[2*t]-n[2*e]||n[2*t+1]-n[2*e+1]);const t=this.collinear[0],e=this.collinear[this.collinear.length-1],r=[n[2*t],n[2*t+1],n[2*e],n[2*e+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,e=n.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(t){return new Ra(this,t)}*neighbors(t){const{inedges:n,hull:e,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const n=a.indexOf(t);return n>0&&(yield a[n-1]),void(n=0&&i!==e&&i!==r;)e=i;return i}_step(t,n,e){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:c}=this;if(-1===r[t]||!c.length)return(t+1)%(c.length>>1);let f=t,s=Ua(n-c[2*t],2)+Ua(e-c[2*t+1],2);const l=r[t];let h=l;do{let r=u[h];const l=Ua(n-c[2*r],2)+Ua(e-c[2*r+1],2);if(l9999?"+"+Ga(t,6):Ga(t,4)}(t.getUTCFullYear())+"-"+Ga(t.getUTCMonth()+1,2)+"-"+Ga(t.getUTCDate(),2)+(i?"T"+Ga(n,2)+":"+Ga(e,2)+":"+Ga(r,2)+"."+Ga(i,3)+"Z":r?"T"+Ga(n,2)+":"+Ga(e,2)+":"+Ga(r,2)+"Z":e||n?"T"+Ga(n,2)+":"+Ga(e,2)+"Z":"")}function $a(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,c=o<=0,f=!1;function s(){if(c)return ja;if(f)return f=!1,La;var n,r,i=a;if(34===t.charCodeAt(i)){for(;a++=o?c=!0:10===(r=t.charCodeAt(a++))?f=!0:13===r&&(f=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;agu(n,e).then(n=>(new DOMParser).parseFromString(n,t))}var xu=mu("application/xml"),wu=mu("text/html"),Mu=mu("image/svg+xml");function Au(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,c,f,s,l,h,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function Tu(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Su(t){return t[0]}function Eu(t){return t[1]}function ku(t,n,e){var r=new Nu(null==n?Su:n,null==e?Eu:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Nu(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Cu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Pu=ku.prototype=Nu.prototype;function zu(t){return function(){return t}}function Du(t){return 1e-6*(t()-.5)}function qu(t){return t.x+t.vx}function Ru(t){return t.y+t.vy}function Fu(t){return t.index}function Uu(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}Pu.copy=function(){var t,n,e=new Nu(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Cu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Cu(n));return e},Pu.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return Au(this.cover(n,e),n,e,t)},Pu.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=c.y0)>d||(a=c.x1)=v)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,g.data),b=n-+this._y.call(null,g.data),m=_*_+b*b;if(m=(u=(p+y)/2))?p=u:y=u,(s=a>=(c=(g+v)/2))?g=c:v=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Pu.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ju(t){return(t=Lu(Math.abs(t)))?t[1]:NaN}var Hu,Xu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gu(t){if(!(n=Xu.exec(t)))throw new Error("invalid format: "+t);var n;return new Vu({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 Vu(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function $u(t,n){var e=Lu(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Gu.prototype=Vu.prototype,Vu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Wu={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>$u(100*t,n),r:$u,s:function(t,n){var e=Lu(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Hu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Lu(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Zu(t){return t}var Ku,Qu=Array.prototype.map,Ju=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tc(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Zu:(n=Qu.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Zu:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Qu.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var n=(t=Gu(t)).fill,e=t.align,l=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,v=t.trim,_=t.type;"n"===_?(g=!0,_="g"):Wu[_]||(void 0===y&&(y=12),v=!0,_="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",m="$"===h?o:/[%p]/.test(_)?c:"",x=Wu[_],w=/[defgprs%]/.test(_);function M(t){var i,o,c,h=b,M=m;if("c"===_)M=x(t)+M,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),y),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),A&&0==+t&&"+"!==l&&(A=!1),h=(A?"("===l?l:f:"-"===l||"("===l?"":l)+h,M=("s"===_?Ju[8+Hu/3]:"")+M+(A&&"("===l?")":""),w)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=h.length+t.length+M.length,S=T>1)+h+t+M+S.slice(T);break;default:t=S+h+t+M}return u(t)}return y=void 0===y?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,n){var e=l(((t=Gu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3))),i=Math.pow(10,-r),o=Ju[8+r/3];return function(t){return e(i*t)+o}}}}function nc(n){return Ku=tc(n),t.format=Ku.format,t.formatPrefix=Ku.formatPrefix,Ku}function ec(t){return Math.max(0,-ju(Math.abs(t)))}function rc(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3)))-ju(Math.abs(t)))}function ic(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ju(n)-ju(t))+1}nc({thousands:",",grouping:[3],currency:["$",""]});var oc=1e-6,ac=1e-12,uc=Math.PI,cc=uc/2,fc=uc/4,sc=2*uc,lc=180/uc,hc=uc/180,dc=Math.abs,pc=Math.atan,gc=Math.atan2,yc=Math.cos,vc=Math.ceil,_c=Math.exp,bc=Math.hypot,mc=Math.log,xc=Math.pow,wc=Math.sin,Mc=Math.sign||function(t){return t>0?1:t<0?-1:0},Ac=Math.sqrt,Tc=Math.tan;function Sc(t){return t>1?0:t<-1?uc:Math.acos(t)}function Ec(t){return t>1?cc:t<-1?-cc:Math.asin(t)}function kc(t){return(t=wc(t/2))*t}function Nc(){}function Cc(t,n){t&&zc.hasOwnProperty(t.type)&&zc[t.type](t,n)}var Pc={Feature:function(t,n){Cc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=yc(n=(n*=hc)/2+fc),a=wc(n),u=Bc*a,c=Ic*o+u*yc(i),f=u*r*wc(i);Qc.add(gc(f,c)),Oc=t,Ic=o,Bc=a}function af(t){return[gc(t[1],t[0]),Ec(t[2])]}function uf(t){var n=t[0],e=t[1],r=yc(e);return[r*yc(n),r*wc(n),wc(e)]}function cf(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ff(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function sf(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function lf(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function hf(t){var n=Ac(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var df,pf,gf,yf,vf,_f,bf,mf,xf,wf,Mf,Af,Tf,Sf,Ef,kf,Nf={point:Cf,lineStart:zf,lineEnd:Df,polygonStart:function(){Nf.point=qf,Nf.lineStart=Rf,Nf.lineEnd=Ff,Wc=new g,tf.polygonStart()},polygonEnd:function(){tf.polygonEnd(),Nf.point=Cf,Nf.lineStart=zf,Nf.lineEnd=Df,Qc<0?(Yc=-(jc=180),Lc=-(Hc=90)):Wc>oc?Hc=90:Wc<-1e-6&&(Lc=-90),Kc[0]=Yc,Kc[1]=jc},sphere:function(){Yc=-(jc=180),Lc=-(Hc=90)}};function Cf(t,n){Zc.push(Kc=[Yc=t,jc=t]),nHc&&(Hc=n)}function Pf(t,n){var e=uf([t*hc,n*hc]);if($c){var r=ff($c,e),i=ff([r[1],-r[0],0],r);hf(i),i=af(i);var o,a=t-Xc,u=a>0?1:-1,c=i[0]*lc*u,f=dc(a)>180;f^(u*XcHc&&(Hc=o):f^(u*Xc<(c=(c+360)%360-180)&&cHc&&(Hc=n)),f?tUf(Yc,jc)&&(jc=t):Uf(t,jc)>Uf(Yc,jc)&&(Yc=t):jc>=Yc?(tjc&&(jc=t)):t>Xc?Uf(Yc,t)>Uf(Yc,jc)&&(jc=t):Uf(t,jc)>Uf(Yc,jc)&&(Yc=t)}else Zc.push(Kc=[Yc=t,jc=t]);nHc&&(Hc=n),$c=e,Xc=t}function zf(){Nf.point=Pf}function Df(){Kc[0]=Yc,Kc[1]=jc,Nf.point=Cf,$c=null}function qf(t,n){if($c){var e=t-Xc;Wc.add(dc(e)>180?e+(e>0?360:-360):e)}else Gc=t,Vc=n;tf.point(t,n),Pf(t,n)}function Rf(){tf.lineStart()}function Ff(){qf(Gc,Vc),tf.lineEnd(),dc(Wc)>oc&&(Yc=-(jc=180)),Kc[0]=Yc,Kc[1]=jc,$c=null}function Uf(t,n){return(n-=t)<0?n+360:n}function Of(t,n){return t[0]-n[0]}function If(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nuc?t+Math.round(-t/sc)*sc:t,n]}function ts(t,n,e){return(t%=sc)?n||e?Qf(es(t),rs(n,e)):es(t):n||e?rs(n,e):Jf}function ns(t){return function(n,e){return[(n+=t)>uc?n-sc:n<-uc?n+sc:n,e]}}function es(t){var n=ns(t);return n.invert=ns(-t),n}function rs(t,n){var e=yc(t),r=wc(t),i=yc(n),o=wc(n);function a(t,n){var a=yc(n),u=yc(t)*a,c=wc(t)*a,f=wc(n),s=f*e+u*r;return[gc(c*i-s*o,u*e-f*r),Ec(s*i+c*o)]}return a.invert=function(t,n){var a=yc(n),u=yc(t)*a,c=wc(t)*a,f=wc(n),s=f*i-c*o;return[gc(c*i+f*o,u*e+s*r),Ec(s*e-u*r)]},a}function is(t){function n(n){return(n=t(n[0]*hc,n[1]*hc))[0]*=lc,n[1]*=lc,n}return t=ts(t[0]*hc,t[1]*hc,t.length>2?t[2]*hc:0),n.invert=function(n){return(n=t.invert(n[0]*hc,n[1]*hc))[0]*=lc,n[1]*=lc,n},n}function os(t,n,e,r,i,o){if(e){var a=yc(n),u=wc(n),c=r*e;null==i?(i=n+r*sc,o=n-c/2):(i=as(a,i),o=as(a,o),(r>0?io)&&(i+=r*sc));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function cs(t,n){return dc(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function ls(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,E=S*T,k=E>uc,N=v*M;if(c.add(gc(N*S*wc(E),_*A+N*yc(E))),a+=k?T+S*sc:T,k^p>=e^x>=e){var C=ff(uf(d),uf(m));hf(C);var P=ff(o,C);hf(P);var z=(k^T>=0?-1:1)*Ec(P[2]);(r>z||r===z&&(C[0]||C[1]))&&(u+=k^T>=0?1:-1)}}return(a<-1e-6||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(gs))}return h}}function gs(t){return t.length>1}function ys(t,n){return((t=t.x)[0]<0?t[1]-cc-oc:cc-t[1])-((n=n.x)[0]<0?n[1]-cc-oc:cc-n[1])}Jf.invert=Jf;var vs=ps((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?uc:-uc,c=dc(o-e);dc(c-uc)0?cc:-cc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=uc&&(dc(e-i)oc?pc((wc(n)*(o=yc(r))*wc(e)-wc(r)*(i=yc(n))*wc(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*cc,r.point(-uc,i),r.point(0,i),r.point(uc,i),r.point(uc,0),r.point(uc,-i),r.point(0,-i),r.point(-uc,-i),r.point(-uc,0),r.point(-uc,i);else if(dc(t[0]-n[0])>oc){var o=t[0]0,i=dc(n)>oc;function o(t,e){return yc(t)*yc(e)>n}function a(t,e,r){var i=[1,0,0],o=ff(uf(t),uf(e)),a=cf(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var f=n*a/c,s=-n*u/c,l=ff(i,o),h=lf(i,f);sf(h,lf(o,s));var d=l,p=cf(h,d),g=cf(d,d),y=p*p-g*(cf(h,h)-1);if(!(y<0)){var v=Ac(y),_=lf(d,(-p-v)/g);if(sf(_,h),_=af(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x0^_[1]<(dc(_[0]-m)uc^(m<=_[0]&&_[0]<=x)){var S=lf(d,(-p+v)/g);return sf(S,h),[_,af(S)]}}}function u(n,e){var i=r?t:uc-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return ps(o,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],g=o(l,h),y=r?g?0:u(l,h):g?u(l+(l<0?uc:-uc),h):0;if(!n&&(f=c=g)&&t.lineStart(),g!==c&&(!(d=a(n,p))||cs(n,d)||cs(p,d))&&(p[2]=1),g!==c)s=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1],2),t.lineEnd()),n=d;else if(i&&n&&r^g){var v;y&e||!(v=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||n&&cs(n,p)||t.point(p[0],p[1]),n=p,c=g,e=y},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,o){os(o,t,e,i,n,r)}),r?[0,-t]:[-uc,t-uc])}var bs,ms,xs,ws,Ms=1e9,As=-Ms;function Ts(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,f){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||c(i,o)<0^u>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else f.point(o[0],o[1])}function a(r,i){return dc(r[0]-t)0?0:3:dc(r[0]-e)0?2:1:dc(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,f,s,l,h,d,p,g,y,v,_,b=a,m=us(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]);v=!0,y=!1,p=g=NaN},lineEnd:function(){c&&(M(l,h),d&&y&&m.rejoin(),c.push(m.result()));x.point=w,y&&b.lineEnd()},polygonStart:function(){b=m,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(c=R(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&ss(c,u,n,o,a),a.polygonEnd());b=a,c=f=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(f&&s.push([o,a]),v)l=o,h=a,d=u,v=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&y)b.point(o,a);else{var c=[p=Math.max(As,Math.min(Ms,p)),g=Math.max(As,Math.min(Ms,g))],m=[o=Math.max(As,Math.min(Ms,o)),a=Math.max(As,Math.min(Ms,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=n[0]-u,h=n[1]-c;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(n[0]=u+s*l,n[1]=c+s*h),!0}}}}}(c,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(y||(b.lineStart(),b.point(c[0],c[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,g=a,y=u}return x}}var Ss={sphere:Nc,point:Nc,lineStart:function(){Ss.point=ks,Ss.lineEnd=Es},lineEnd:Nc,polygonStart:Nc,polygonEnd:Nc};function Es(){Ss.point=Ss.lineEnd=Nc}function ks(t,n){ms=t*=hc,xs=wc(n*=hc),ws=yc(n),Ss.point=Ns}function Ns(t,n){t*=hc;var e=wc(n*=hc),r=yc(n),i=dc(t-ms),o=yc(i),a=r*wc(i),u=ws*e-xs*r*o,c=xs*e+ws*r*o;bs.add(gc(Ac(a*a+u*u),c)),ms=t,xs=e,ws=r}function Cs(t){return bs=new g,Rc(t,Ss),+bs}var Ps=[null,null],zs={type:"LineString",coordinates:Ps};function Ds(t,n){return Ps[0]=t,Ps[1]=n,Cs(zs)}var qs={Feature:function(t,n){return Fs(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=Ds(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))oc})).map(c)).concat(O(vc(o/d)*d,i,d).filter((function(t){return dc(t%g)>oc})).map(f))}return v.lines=function(){return _().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),v.precision(y)):[[r,u],[e,a]]},v.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),v.precision(y)):[[n,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(y=+h,c=Ls(o,i,90),f=js(n,t,y),s=Ls(u,a,90),l=js(r,e,y),v):y},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var Xs,Gs,Vs,$s,Ws=t=>t,Zs=new g,Ks=new g,Qs={point:Nc,lineStart:Nc,lineEnd:Nc,polygonStart:function(){Qs.lineStart=Js,Qs.lineEnd=el},polygonEnd:function(){Qs.lineStart=Qs.lineEnd=Qs.point=Nc,Zs.add(dc(Ks)),Ks=new g},result:function(){var t=Zs/2;return Zs=new g,t}};function Js(){Qs.point=tl}function tl(t,n){Qs.point=nl,Xs=Vs=t,Gs=$s=n}function nl(t,n){Ks.add($s*t-Vs*n),Vs=t,$s=n}function el(){nl(Xs,Gs)}var rl=1/0,il=rl,ol=-rl,al=ol,ul={point:function(t,n){tol&&(ol=t);nal&&(al=n)},lineStart:Nc,lineEnd:Nc,polygonStart:Nc,polygonEnd:Nc,result:function(){var t=[[rl,il],[ol,al]];return ol=al=-(il=rl=1/0),t}};var cl,fl,sl,ll,hl=0,dl=0,pl=0,gl=0,yl=0,vl=0,_l=0,bl=0,ml=0,xl={point:wl,lineStart:Ml,lineEnd:Sl,polygonStart:function(){xl.lineStart=El,xl.lineEnd=kl},polygonEnd:function(){xl.point=wl,xl.lineStart=Ml,xl.lineEnd=Sl},result:function(){var t=ml?[_l/ml,bl/ml]:vl?[gl/vl,yl/vl]:pl?[hl/pl,dl/pl]:[NaN,NaN];return hl=dl=pl=gl=yl=vl=_l=bl=ml=0,t}};function wl(t,n){hl+=t,dl+=n,++pl}function Ml(){xl.point=Al}function Al(t,n){xl.point=Tl,wl(sl=t,ll=n)}function Tl(t,n){var e=t-sl,r=n-ll,i=Ac(e*e+r*r);gl+=i*(sl+t)/2,yl+=i*(ll+n)/2,vl+=i,wl(sl=t,ll=n)}function Sl(){xl.point=wl}function El(){xl.point=Nl}function kl(){Cl(cl,fl)}function Nl(t,n){xl.point=Cl,wl(cl=sl=t,fl=ll=n)}function Cl(t,n){var e=t-sl,r=n-ll,i=Ac(e*e+r*r);gl+=i*(sl+t)/2,yl+=i*(ll+n)/2,vl+=i,_l+=(i=ll*t-sl*n)*(sl+t),bl+=i*(ll+n),ml+=3*i,wl(sl=t,ll=n)}function Pl(t){this._context=t}Pl.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,sc)}},result:Nc};var zl,Dl,ql,Rl,Fl,Ul=new g,Ol={point:Nc,lineStart:function(){Ol.point=Il},lineEnd:function(){zl&&Bl(Dl,ql),Ol.point=Nc},polygonStart:function(){zl=!0},polygonEnd:function(){zl=null},result:function(){var t=+Ul;return Ul=new g,t}};function Il(t,n){Ol.point=Bl,Dl=Rl=t,ql=Fl=n}function Bl(t,n){Rl-=t,Fl-=n,Ul.add(Ac(Rl*Rl+Fl*Fl)),Rl=t,Fl=n}function Yl(){this._string=[]}function Ll(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function jl(t){return function(n){var e=new Hl;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Hl(){}function Xl(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Rc(e,t.stream(ul)),n(ul.result()),null!=r&&t.clipExtent(r),t}function Gl(t,n,e){return Xl(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])}),e)}function Vl(t,n,e){return Gl(t,[[0,0],n],e)}function $l(t,n,e){return Xl(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])}),e)}function Wl(t,n,e){return Xl(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])}),e)}Yl.prototype={_radius:4.5,_circle:Ll(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=Ll(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Hl.prototype={constructor:Hl,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Zl=yc(30*hc);function Kl(t,n){return+n?function(t,n){function e(r,i,o,a,u,c,f,s,l,h,d,p,g,y){var v=f-r,_=s-i,b=v*v+_*_;if(b>4*n&&g--){var m=a+h,x=u+d,w=c+p,M=Ac(m*m+x*x+w*w),A=Ec(w/=M),T=dc(dc(w)-1)n||dc((v*N+_*C)/b-.5)>.3||a*h+u*d+c*p2?t[2]%360*hc:0,N()):[y*lc,v*lc,_*lc]},E.angle=function(t){return arguments.length?(b=t%360*hc,N()):b*lc},E.reflectX=function(t){return arguments.length?(m=t?-1:1,N()):m<0},E.reflectY=function(t){return arguments.length?(x=t?-1:1,N()):x<0},E.precision=function(t){return arguments.length?(a=Kl(u,S=t*t),C()):Ac(S)},E.fitExtent=function(t,n){return Gl(E,t,n)},E.fitSize=function(t,n){return Vl(E,t,n)},E.fitWidth=function(t,n){return $l(E,t,n)},E.fitHeight=function(t,n){return Wl(E,t,n)},function(){return n=t.apply(this,arguments),E.invert=n.invert&&k,N()}}function eh(t){var n=0,e=uc/3,r=nh(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*hc,e=t[1]*hc):[n*lc,e*lc]},i}function rh(t,n){var e=wc(t),r=(e+wc(n))/2;if(dc(r)0?n<-cc+oc&&(n=-cc+oc):n>cc-oc&&(n=cc-oc);var e=i/xc(hh(n),r);return[e*wc(r*t),i-e*yc(r*t)]}return o.invert=function(t,n){var e=i-n,o=Mc(r)*Ac(t*t+e*e),a=gc(t,dc(e))*Mc(e);return e*r<0&&(a-=uc*Mc(t)*Mc(e)),[a/r,2*pc(xc(i/o,1/r))-cc]},o}function ph(t,n){return[t,n]}function gh(t,n){var e=yc(t),r=t===n?wc(t):(e-yc(n))/(n-t),i=e/r+t;if(dc(r)=0;)n+=e[r].value;else n=1;t.value=n}function Ph(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=Dh)):void 0===n&&(n=zh);for(var e,r,i,o,a,u=new Fh(t),c=[u];e=c.pop();)if((i=n(e.data))&&(a=(i=Array.from(i)).length))for(e.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new Fh(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Rh)}function zh(t){return t.children}function Dh(t){return Array.isArray(t)?t[1]:null}function qh(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Rh(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Fh(t){this.data=t,this.depth=this.height=0,this.parent=null}function Uh(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(Array.from(t))).length,o=[];r0&&e*e>r*r+i*i}function Yh(t,n){for(var e=0;e(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Gh(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function Vh(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function $h(t){this._=t,this.next=null,this.previous=null}function Wh(t){if(!(i=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,e,r,i,o,a,u,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Xh(e,n,r=t[2]),n=new $h(n),e=new $h(e),r=new $h(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;uoc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Ah.invert=uh(Ec),Th.invert=uh((function(t){return 2*pc(t)})),Sh.invert=function(t,n){return[-n,2*pc(_c(t))-cc]},Fh.prototype=Ph.prototype={constructor:Fh,count:function(){return this.eachAfter(Ch)},each:function(t,n){let e=-1;for(const r of this)t.call(n,r,++e,this);return this},eachAfter:function(t,n){for(var e,r,i,o=this,a=[o],u=[],c=-1;o=a.pop();)if(u.push(o),e=o.children)for(r=0,i=e.length;r=0;--r)o.push(e[r]);return this},find:function(t,n){let e=-1;for(const r of this)if(t.call(n,r,++e,this))return r},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Ph(this).eachBefore(qh)},[Symbol.iterator]:function*(){var t,n,e,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,n=i.children)for(e=0,r=n.length;eh&&(h=u),y=s*s*g,(d=Math.max(h/y,y/l))>p){s-=u;break}p=d}v.push(a={value:s,dice:c1?n:1)},e}(vd);var md=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?n:1)},e}(vd);function xd(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function wd(t,n){return t[0]-n[0]||t[1]-n[1]}function Md(t){const n=t.length,e=[0,1];let r,i=2;for(r=2;r1&&xd(t[e[i-2]],t[e[i-1]],t[r])<=0;)--i;e[i++]=r}return e.slice(0,i)}var Ad=Math.random,Td=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(Ad),Sd=function t(n){function e(t,e){return arguments.length<2&&(e=t,t=0),t=Math.floor(t),e=Math.floor(e)-t,function(){return Math.floor(n()*e+t)}}return e.source=t,e}(Ad),Ed=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(Ad),kd=function t(n){var e=Ed.source(n);function r(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(Ad),Nd=function t(n){function e(t){return(t=+t)<=0?()=>0:function(){for(var e=0,r=t;r>1;--r)e+=n();return e+r*n()}}return e.source=t,e}(Ad),Cd=function t(n){var e=Nd.source(n);function r(t){if(0==(t=+t))return n;var r=e(t);return function(){return r()/t}}return r.source=t,r}(Ad),Pd=function t(n){function e(t){return function(){return-Math.log1p(-n())/t}}return e.source=t,e}(Ad),zd=function t(n){function e(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-n(),t)}}return e.source=t,e}(Ad),Dd=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+t)}}return e.source=t,e}(Ad),qd=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-n())/t)})}return e.source=t,e}(Ad),Rd=function t(n){var e=Ed.source(n)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-n())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(n(),1/t):()=>1;return function(){do{do{var t=e(),u=1+o*t}while(u<=0);u*=u*u;var c=1-n()}while(c>=1-.0331*t*t*t*t&&Math.log(c)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(Ad),Fd=function t(n){var e=Rd.source(n);function r(t,n){var r=e(t),i=e(n);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(Ad),Ud=function t(n){var e=qd.source(n),r=Fd.source(n);function i(t,n){return t=+t,(n=+n)>=1?()=>t:n<=0?()=>0:function(){for(var i=0,o=t,a=n;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),c=r(u,o-u+1)();c<=a?(i+=u,o-=u,a=(a-c)/(1-c)):(o=u-1,a/=c)}for(var f=a<.5,s=e(f?a:1-a),l=s(),h=0;l<=o;++h)l+=s();return i+(f?h:o-h)}}return i.source=t,i}(Ad),Od=function t(n){function e(t,e,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=n=>Math.pow(n,t)),e=null==e?0:+e,r=null==r?1:+r,function(){return e+r*i(-Math.log1p(-n()))}}return e.source=t,e}(Ad),Id=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){return t+e*Math.tan(Math.PI*n())}}return e.source=t,e}(Ad),Bd=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){var r=n();return t+e*Math.log(r/(1-r))}}return e.source=t,e}(Ad),Yd=function t(n){var e=Rd.source(n),r=Ud.source(n);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=e(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var c=-Math.log1p(-n()),f=0;c<=o;++f)c-=Math.log1p(-n());return i+f}}return i.source=t,i}(Ad);const Ld=1/4294967296;function jd(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function Hd(t,n){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof n?this.interpolator(n):this.range(n)}return this}const Xd=Symbol("implicit");function Gd(){var t=new Map,n=[],e=[],r=Xd;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==Xd)return r;t.set(o,a=n.push(i))}return e[(a-1)%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new Map;for(const r of e){const e=r+"";t.has(e)||t.set(e,n.push(r))}return i},i.range=function(t){return arguments.length?(e=Array.from(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Gd(n,e).unknown(r)},jd.apply(i,arguments),i}function Vd(){var t,n,e=Gd().unknown(void 0),r=e.domain,i=e.range,o=0,a=1,u=!1,c=0,f=0,s=.5;function l(){var e=r().length,l=an&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(a[0],a[t-1])),r=t>2?tp:Jd,i=o=null,l}function l(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,c)))(t(f(n)))}return l.invert=function(e){return f(n((o||(o=r(u,a.map(t),ir)))(e)))},l.domain=function(t){return arguments.length?(a=Array.from(t,Wd),s()):a.slice()},l.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},l.rangeRound=function(t){return u=Array.from(t),c=sr,s()},l.clamp=function(t){return arguments.length?(f=!!t||Kd,s()):f!==Kd},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function rp(){return ep()(Kd,Kd)}function ip(n,e,r,i){var o,a=S(n,e,r);switch((i=Gu(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=rc(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=ic(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=ec(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function op(t){var n=t.domain;return t.ticks=function(t){var e=n();return A(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return ip(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,c=o[a],f=o[u],s=10;for(f0;){if((i=T(c,f,e))===r)return o[a]=c,o[u]=f,n(o);if(i>0)c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i}r=i}return t},t}function ap(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;h<=d;++h)for(s=1,f=r(h);sc)break;g.push(l)}}else for(;h<=d;++h)for(s=a-1,f=r(h);s>=1;--s)if(!((l=f*s)c)break;g.push(l)}2*g.length0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return Ap.setTime(+n),Tp.setTime(+r),t(Ap),t(Tp),Math.floor(e(Ap,Tp))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Ep=Sp((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));Ep.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Sp((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):Ep:null};var kp=Ep.range,Np=1e3,Cp=6e4,Pp=36e5,zp=864e5,Dp=6048e5,qp=Sp((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+n*Np)}),(function(t,n){return(n-t)/Np}),(function(t){return t.getUTCSeconds()})),Rp=qp.range,Fp=Sp((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Np)}),(function(t,n){t.setTime(+t+n*Cp)}),(function(t,n){return(n-t)/Cp}),(function(t){return t.getMinutes()})),Up=Fp.range,Op=Sp((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Np-t.getMinutes()*Cp)}),(function(t,n){t.setTime(+t+n*Pp)}),(function(t,n){return(n-t)/Pp}),(function(t){return t.getHours()})),Ip=Op.range,Bp=Sp(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Cp)/zp,t=>t.getDate()-1),Yp=Bp.range;function Lp(t){return Sp((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Cp)/Dp}))}var jp=Lp(0),Hp=Lp(1),Xp=Lp(2),Gp=Lp(3),Vp=Lp(4),$p=Lp(5),Wp=Lp(6),Zp=jp.range,Kp=Hp.range,Qp=Xp.range,Jp=Gp.range,tg=Vp.range,ng=$p.range,eg=Wp.range,rg=Sp((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),ig=rg.range,og=Sp((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));og.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Sp((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var ag=og.range,ug=Sp((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*Cp)}),(function(t,n){return(n-t)/Cp}),(function(t){return t.getUTCMinutes()})),cg=ug.range,fg=Sp((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+n*Pp)}),(function(t,n){return(n-t)/Pp}),(function(t){return t.getUTCHours()})),sg=fg.range,lg=Sp((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/zp}),(function(t){return t.getUTCDate()-1})),hg=lg.range;function dg(t){return Sp((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/Dp}))}var pg=dg(0),gg=dg(1),yg=dg(2),vg=dg(3),_g=dg(4),bg=dg(5),mg=dg(6),xg=pg.range,wg=gg.range,Mg=yg.range,Ag=vg.range,Tg=_g.range,Sg=bg.range,Eg=mg.range,kg=Sp((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),Ng=kg.range,Cg=Sp((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Cg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Sp((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Pg=Cg.range;function zg(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Dg(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function qg(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function Rg(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,f=jg(i),s=Hg(i),l=jg(o),h=Hg(o),d=jg(a),p=Hg(a),g=jg(u),y=Hg(u),v=jg(c),_=Hg(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:ly,e:ly,f:yy,g:Ey,G:Ny,H:hy,I:dy,j:py,L:gy,m:vy,M:_y,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Qy,s:Jy,S:by,u:my,U:xy,V:My,w:Ay,W:Ty,x:null,X:null,y:Sy,Y:ky,Z:Cy,"%":Ky},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Py,e:Py,f:Fy,g:Vy,G:Wy,H:zy,I:Dy,j:qy,L:Ry,m:Uy,M:Oy,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Qy,s:Jy,S:Iy,u:By,U:Yy,V:jy,w:Hy,W:Xy,x:null,X:null,y:Gy,Y:$y,Z:Zy,"%":Ky},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=_.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return A(t,n,e,r)},d:ny,e:ny,f:uy,g:Kg,G:Zg,H:ry,I:ry,j:ey,L:ay,m:ty,M:iy,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s.get(r[0].toLowerCase()),e+r[0].length):-1},q:Jg,Q:fy,s:sy,S:oy,u:Gg,U:Vg,V:$g,w:Xg,W:Wg,x:function(t,n,r){return A(t,e,n,r)},X:function(t,n,e){return A(t,r,n,e)},y:Kg,Y:Zg,Z:Qg,"%":cy};function w(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Dg(qg(o.y,0,1))).getUTCDay(),r=i>4||0===i?gg.ceil(r):gg(r),r=lg.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=zg(qg(o.y,0,1))).getDay(),r=i>4||0===i?Hp.ceil(r):Hp(r),r=Bp.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Dg(qg(o.y,0,1)).getUTCDay():zg(qg(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Dg(o)):zg(o)}}function A(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in Ug?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}var Fg,Ug={"-":"",_:" ",0:"0"},Og=/^\s*\d+/,Ig=/^%/,Bg=/[\\^$*+?|[\]().{}]/g;function Yg(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function Xg(t,n,e){var r=Og.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Gg(t,n,e){var r=Og.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function Vg(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function $g(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Wg(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function Zg(t,n,e){var r=Og.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Kg(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Qg(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Jg(t,n,e){var r=Og.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function ty(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function ny(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function ey(t,n,e){var r=Og.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function ry(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function iy(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function oy(t,n,e){var r=Og.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function ay(t,n,e){var r=Og.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function uy(t,n,e){var r=Og.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function cy(t,n,e){var r=Ig.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function fy(t,n,e){var r=Og.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function sy(t,n,e){var r=Og.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function ly(t,n){return Yg(t.getDate(),n,2)}function hy(t,n){return Yg(t.getHours(),n,2)}function dy(t,n){return Yg(t.getHours()%12||12,n,2)}function py(t,n){return Yg(1+Bp.count(og(t),t),n,3)}function gy(t,n){return Yg(t.getMilliseconds(),n,3)}function yy(t,n){return gy(t,n)+"000"}function vy(t,n){return Yg(t.getMonth()+1,n,2)}function _y(t,n){return Yg(t.getMinutes(),n,2)}function by(t,n){return Yg(t.getSeconds(),n,2)}function my(t){var n=t.getDay();return 0===n?7:n}function xy(t,n){return Yg(jp.count(og(t)-1,t),n,2)}function wy(t){var n=t.getDay();return n>=4||0===n?Vp(t):Vp.ceil(t)}function My(t,n){return t=wy(t),Yg(Vp.count(og(t),t)+(4===og(t).getDay()),n,2)}function Ay(t){return t.getDay()}function Ty(t,n){return Yg(Hp.count(og(t)-1,t),n,2)}function Sy(t,n){return Yg(t.getFullYear()%100,n,2)}function Ey(t,n){return Yg((t=wy(t)).getFullYear()%100,n,2)}function ky(t,n){return Yg(t.getFullYear()%1e4,n,4)}function Ny(t,n){var e=t.getDay();return Yg((t=e>=4||0===e?Vp(t):Vp.ceil(t)).getFullYear()%1e4,n,4)}function Cy(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Yg(n/60|0,"0",2)+Yg(n%60,"0",2)}function Py(t,n){return Yg(t.getUTCDate(),n,2)}function zy(t,n){return Yg(t.getUTCHours(),n,2)}function Dy(t,n){return Yg(t.getUTCHours()%12||12,n,2)}function qy(t,n){return Yg(1+lg.count(Cg(t),t),n,3)}function Ry(t,n){return Yg(t.getUTCMilliseconds(),n,3)}function Fy(t,n){return Ry(t,n)+"000"}function Uy(t,n){return Yg(t.getUTCMonth()+1,n,2)}function Oy(t,n){return Yg(t.getUTCMinutes(),n,2)}function Iy(t,n){return Yg(t.getUTCSeconds(),n,2)}function By(t){var n=t.getUTCDay();return 0===n?7:n}function Yy(t,n){return Yg(pg.count(Cg(t)-1,t),n,2)}function Ly(t){var n=t.getUTCDay();return n>=4||0===n?_g(t):_g.ceil(t)}function jy(t,n){return t=Ly(t),Yg(_g.count(Cg(t),t)+(4===Cg(t).getUTCDay()),n,2)}function Hy(t){return t.getUTCDay()}function Xy(t,n){return Yg(gg.count(Cg(t)-1,t),n,2)}function Gy(t,n){return Yg(t.getUTCFullYear()%100,n,2)}function Vy(t,n){return Yg((t=Ly(t)).getUTCFullYear()%100,n,2)}function $y(t,n){return Yg(t.getUTCFullYear()%1e4,n,4)}function Wy(t,n){var e=t.getUTCDay();return Yg((t=e>=4||0===e?_g(t):_g.ceil(t)).getUTCFullYear()%1e4,n,4)}function Zy(){return"+0000"}function Ky(){return"%"}function Qy(t){return+t}function Jy(t){return Math.floor(+t/1e3)}function tv(n){return Fg=Rg(n),t.timeFormat=Fg.format,t.timeParse=Fg.parse,t.utcFormat=Fg.utcFormat,t.utcParse=Fg.utcParse,Fg}tv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var nv="%Y-%m-%dT%H:%M:%S.%LZ";var ev=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(nv);var rv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse(nv),iv=1e3,ov=6e4,av=36e5,uv=864e5,cv=2592e6,fv=31536e6;function sv(t){return new Date(t)}function lv(t){return t instanceof Date?+t:+new Date(+t)}function hv(t,n,r,i,o,a,u,c,f){var s=rp(),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),g=f("%I:%M"),y=f("%I %p"),v=f("%a %d"),_=f("%b %d"),b=f("%B"),m=f("%Y"),x=[[u,1,iv],[u,5,5e3],[u,15,15e3],[u,30,3e4],[a,1,ov],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,av],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,uv],[i,2,1728e5],[r,1,6048e5],[n,1,cv],[n,3,7776e6],[t,1,fv]];function w(e){return(u(e)Qe(t[t.length-1]),Cv=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(_v),Pv=Nv(Cv),zv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(_v),Dv=Nv(zv),qv=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(_v),Rv=Nv(qv),Fv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(_v),Uv=Nv(Fv),Ov=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(_v),Iv=Nv(Ov),Bv=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(_v),Yv=Nv(Bv),Lv=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(_v),jv=Nv(Lv),Hv=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(_v),Xv=Nv(Hv),Gv=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(_v),Vv=Nv(Gv),$v=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(_v),Wv=Nv($v),Zv=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(_v),Kv=Nv(Zv),Qv=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(_v),Jv=Nv(Qv),t_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(_v),n_=Nv(t_),e_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(_v),r_=Nv(e_),i_=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(_v),o_=Nv(i_),a_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(_v),u_=Nv(a_),c_=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(_v),f_=Nv(c_),s_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(_v),l_=Nv(s_),h_=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(_v),d_=Nv(h_),p_=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(_v),g_=Nv(p_),y_=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(_v),v_=Nv(y_),__=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(_v),b_=Nv(__),m_=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(_v),x_=Nv(m_),w_=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(_v),M_=Nv(w_),A_=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(_v),T_=Nv(A_),S_=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(_v),E_=Nv(S_),k_=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(_v),N_=Nv(k_);var C_=kr(Be(300,.5,0),Be(-240,.5,1)),P_=kr(Be(-100,.75,.35),Be(80,1.5,.8)),z_=kr(Be(260,.75,.35),Be(80,1.5,.8)),D_=Be();var q_=re(),R_=Math.PI/3,F_=2*Math.PI/3;function U_(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var O_=U_(_v("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),I_=U_(_v("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),B_=U_(_v("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Y_=U_(_v("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function L_(t){return function(){return t}}var j_=Math.abs,H_=Math.atan2,X_=Math.cos,G_=Math.max,V_=Math.min,$_=Math.sin,W_=Math.sqrt,Z_=1e-12,K_=Math.PI,Q_=K_/2,J_=2*K_;function tb(t){return t>1?0:t<-1?K_:Math.acos(t)}function nb(t){return t>=1?Q_:t<=-1?-Q_:Math.asin(t)}function eb(t){return t.innerRadius}function rb(t){return t.outerRadius}function ib(t){return t.startAngle}function ob(t){return t.endAngle}function ab(t){return t&&t.padAngle}function ub(t,n,e,r,i,o,a,u){var c=e-t,f=r-n,s=a-i,l=u-o,h=l*c-s*f;if(!(h*hC*C+P*P&&(A=S,T=E),{cx:A,cy:T,x01:-s,y01:-l,x11:A*(i/x-1),y11:T*(i/x-1)}}var fb=Array.prototype.slice;function sb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function lb(t){this._context=t}function hb(t){return new lb(t)}function db(t){return t[0]}function pb(t){return t[1]}function gb(t,n){var e=L_(!0),r=null,i=hb,o=null;function a(a){var u,c,f,s=(a=sb(a)).length,l=!1;for(null==r&&(o=i(f=Wo())),u=0;u<=s;++u)!(u=s;--l)u.point(y[l],v[l]);u.lineEnd(),u.areaEnd()}g&&(y[f]=+t(h,f,c),v[f]=+n(h,f,c),u.point(r?+r(h,f,c):y[f],e?+e(h,f,c):v[f]))}if(d)return u=null,d+""||null}function f(){return gb().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?db:L_(+t),n="function"==typeof n?n:L_(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?pb:L_(+e),c.x=function(n){return arguments.length?(t="function"==typeof n?n:L_(+n),r=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:L_(+n),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:L_(+t),c):r},c.y=function(t){return arguments.length?(n="function"==typeof t?t:L_(+t),e=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:L_(+t),c):n},c.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:L_(+t),c):e},c.lineX0=c.lineY0=function(){return f().x(t).y(n)},c.lineY1=function(){return f().x(t).y(e)},c.lineX1=function(){return f().x(r).y(n)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:L_(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function vb(t,n){return nt?1:n>=t?0:NaN}function _b(t){return t}lb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var bb=xb(hb);function mb(t){this._curve=t}function xb(t){function n(n){return new mb(t(n))}return n._curve=t,n}function wb(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(xb(t)):n()._curve},t}function Mb(){return wb(gb().curve(bb))}function Ab(){var t=yb().curve(bb),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return wb(e())},delete t.lineX0,t.lineEndAngle=function(){return wb(r())},delete t.lineX1,t.lineInnerRadius=function(){return wb(i())},delete t.lineY0,t.lineOuterRadius=function(){return wb(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(xb(t)):n()._curve},t}function Tb(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}function Sb(t){return t.source}function Eb(t){return t.target}function kb(t){var n=Sb,e=Eb,r=db,i=pb,o=null;function a(){var a,u=fb.call(arguments),c=n.apply(this,u),f=e.apply(this,u);if(o||(o=a=Wo()),t(o,+r.apply(this,(u[0]=c,u)),+i.apply(this,u),+r.apply(this,(u[0]=f,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:L_(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:L_(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function Nb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Cb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function Pb(t,n,e,r,i){var o=Tb(n,e),a=Tb(n,e=(e+i)/2),u=Tb(r,e),c=Tb(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}mb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var zb={draw:function(t,n){var e=Math.sqrt(n/K_);t.moveTo(e,0),t.arc(0,0,e,0,J_)}},Db={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},qb=Math.sqrt(1/3),Rb=2*qb,Fb={draw:function(t,n){var e=Math.sqrt(n/Rb),r=e*qb;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Ub=Math.sin(K_/10)/Math.sin(7*K_/10),Ob=Math.sin(J_/10)*Ub,Ib=-Math.cos(J_/10)*Ub,Bb={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Ob*e,i=Ib*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=J_*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*e,-u*e),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},Yb={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Lb=Math.sqrt(3),jb={draw:function(t,n){var e=-Math.sqrt(n/(3*Lb));t.moveTo(0,2*e),t.lineTo(-Lb*e,-e),t.lineTo(Lb*e,-e),t.closePath()}},Hb=-.5,Xb=Math.sqrt(3)/2,Gb=1/Math.sqrt(12),Vb=3*(Gb/2+1),$b={draw:function(t,n){var e=Math.sqrt(n/Vb),r=e/2,i=e*Gb,o=r,a=e*Gb+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(Hb*r-Xb*i,Xb*r+Hb*i),t.lineTo(Hb*o-Xb*a,Xb*o+Hb*a),t.lineTo(Hb*u-Xb*c,Xb*u+Hb*c),t.lineTo(Hb*r+Xb*i,Hb*i-Xb*r),t.lineTo(Hb*o+Xb*a,Hb*a-Xb*o),t.lineTo(Hb*u+Xb*c,Hb*c-Xb*u),t.closePath()}},Wb=[zb,Db,Fb,Yb,Bb,jb,$b];function Zb(){}function Kb(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Qb(t){this._context=t}function Jb(t){this._context=t}function tm(t){this._context=t}function nm(t,n){this._basis=new Qb(t),this._beta=n}Qb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Kb(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Kb(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Jb.prototype={areaStart:Zb,areaEnd:Zb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Kb(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},tm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Kb(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},nm.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var em=function t(n){function e(t){return 1===n?new Qb(t):new nm(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function rm(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function im(t,n){this._context=t,this._k=(1-n)/6}im.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rm(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:rm(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var om=function t(n){function e(t){return new im(t,n)}return e.tension=function(n){return t(+n)},e}(0);function am(t,n){this._context=t,this._k=(1-n)/6}am.prototype={areaStart:Zb,areaEnd:Zb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:rm(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var um=function t(n){function e(t){return new am(t,n)}return e.tension=function(n){return t(+n)},e}(0);function cm(t,n){this._context=t,this._k=(1-n)/6}cm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:rm(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var fm=function t(n){function e(t){return new cm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function sm(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Z_){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Z_){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function lm(t,n){this._context=t,this._alpha=n}lm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:sm(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var hm=function t(n){function e(t){return n?new lm(t,n):new im(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function dm(t,n){this._context=t,this._alpha=n}dm.prototype={areaStart:Zb,areaEnd:Zb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:sm(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var pm=function t(n){function e(t){return n?new dm(t,n):new am(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function gm(t,n){this._context=t,this._alpha=n}gm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:sm(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var ym=function t(n){function e(t){return n?new gm(t,n):new cm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function vm(t){this._context=t}function _m(t){return t<0?-1:1}function bm(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(_m(o)+_m(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function mm(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function xm(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function wm(t){this._context=t}function Mm(t){this._context=new Am(t)}function Am(t){this._context=t}function Tm(t){this._context=t}function Sm(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function Cm(t,n){return t[n]}function Pm(t){const n=[];return n.key=t,n}function zm(t){var n=t.map(Dm);return Nm(t).sort((function(t,e){return n[t]-n[e]}))}function Dm(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function qm(t){var n=t.map(Rm);return Nm(t).sort((function(t,e){return n[t]-n[e]}))}function Rm(t){for(var n,e=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Fm=t=>()=>t;function Um(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Om(t,n,e){this.k=t,this.x=n,this.y=e}Om.prototype={constructor:Om,scale:function(t){return 1===t?this:new Om(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Om(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Im=new Om(1,0,0);function Bm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Im;return t.__zoom}function Ym(t){t.stopImmediatePropagation()}function Lm(t){t.preventDefault(),t.stopImmediatePropagation()}function jm(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Hm(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Xm(){return this.__zoom||Im}function Gm(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Vm(){return navigator.maxTouchPoints||"ontouchstart"in this}function $m(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}Bm.prototype=Om.prototype,t.Adder=g,t.Delaunay=Ya,t.FormatSpecifier=Vu,t.Voronoi=Ra,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>1&&e.name===n)return new Ni([[t]],ro,n,+r);return null},t.arc=function(){var t=eb,n=rb,e=L_(0),r=null,i=ib,o=ob,a=ab,u=null;function c(){var c,f,s=+t.apply(this,arguments),l=+n.apply(this,arguments),h=i.apply(this,arguments)-Q_,d=o.apply(this,arguments)-Q_,p=j_(d-h),g=d>h;if(u||(u=c=Wo()),lZ_)if(p>J_-Z_)u.moveTo(l*X_(h),l*$_(h)),u.arc(0,0,l,h,d,!g),s>Z_&&(u.moveTo(s*X_(d),s*$_(d)),u.arc(0,0,s,d,h,g));else{var y,v,_=h,b=d,m=h,x=d,w=p,M=p,A=a.apply(this,arguments)/2,T=A>Z_&&(r?+r.apply(this,arguments):W_(s*s+l*l)),S=V_(j_(l-s)/2,+e.apply(this,arguments)),E=S,k=S;if(T>Z_){var N=nb(T/s*$_(A)),C=nb(T/l*$_(A));(w-=2*N)>Z_?(m+=N*=g?1:-1,x-=N):(w=0,m=x=(h+d)/2),(M-=2*C)>Z_?(_+=C*=g?1:-1,b-=C):(M=0,_=b=(h+d)/2)}var P=l*X_(_),z=l*$_(_),D=s*X_(x),q=s*$_(x);if(S>Z_){var R,F=l*X_(b),U=l*$_(b),O=s*X_(m),I=s*$_(m);if(pZ_?k>Z_?(y=cb(O,I,P,z,l,k,g),v=cb(F,U,D,q,l,k,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),kZ_&&w>Z_?E>Z_?(y=cb(D,q,F,U,s,-E,g),v=cb(P,z,O,I,s,-E,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),E>a,f=i+2*u>>a,s=ca(20);function l(r){var i=new Float32Array(c*f),l=new Float32Array(c*f);r.forEach((function(r,o,s){var l=+t(r,o,s)+u>>a,h=+n(r,o,s)+u>>a,d=+e(r,o,s);l>=0&&l=0&&h>a),ya({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a),ga({width:c,height:f,data:i},{width:c,height:f,data:l},o>>a),ya({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a),ga({width:c,height:f,data:i},{width:c,height:f,data:l},o>>a),ya({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a);var d=s(i);if(!Array.isArray(d)){var p=N(i);d=S(0,p,d),(d=O(0,Math.floor(p/d)*d,d)).shift()}return pa().thresholds(d).size([c,f])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function y(){return c=r+2*(u=3*o)>>a,f=i+2*u>>a,l}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:ca(+n),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:ca(+t),l):n},l.weight=function(t){return arguments.length?(e="function"==typeof t?t:ca(+t),l):e},l.size=function(t){if(!arguments.length)return[r,i];var n=+t[0],e=+t[1];if(!(n>=0&&e>=0))throw new Error("invalid size");return r=n,i=e,y()},l.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),y()},l.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?ca(aa.call(t)):ca(t),l):s},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},l},t.contours=pa,t.count=c,t.create=function(t){return bn(st(t).call(document.documentElement))},t.creator=st,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),e=(t=t.map(l)).map(f),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(s))return o;for(;;){o.push(i.map((n,e)=>t[e][n]));let a=r;for(;++i[a]===e[a];){if(0===a)return n?o.map(n):o;i[a--]=0}}},t.csv=vu,t.csvFormat=Qa,t.csvFormatBody=Ja,t.csvFormatRow=nu,t.csvFormatRows=tu,t.csvFormatValue=eu,t.csvParse=Za,t.csvParseRows=Ka,t.cubehelix=Be,t.cumsum=function(t,n){var e=0,r=0;return Float64Array.from(t,void 0===n?t=>e+=+t||0:i=>e+=+n(i,r++,t)||0)},t.curveBasis=function(t){return new Qb(t)},t.curveBasisClosed=function(t){return new Jb(t)},t.curveBasisOpen=function(t){return new tm(t)},t.curveBundle=em,t.curveCardinal=om,t.curveCardinalClosed=um,t.curveCardinalOpen=fm,t.curveCatmullRom=hm,t.curveCatmullRomClosed=pm,t.curveCatmullRomOpen=ym,t.curveLinear=hb,t.curveLinearClosed=function(t){return new vm(t)},t.curveMonotoneX=function(t){return new wm(t)},t.curveMonotoneY=function(t){return new Mm(t)},t.curveNatural=function(t){return new Tm(t)},t.curveStep=function(t){return new Em(t,.5)},t.curveStepAfter=function(t){return new Em(t,1)},t.curveStepBefore=function(t){return new Em(t,0)},t.descending=function(t,n){return nt?1:n>=t?0:NaN},t.deviation=d,t.dispatch=tt,t.drag=function(){var t,n,e,r,i=Pn,o=zn,a=Dn,u=qn,c={},f=tt("start","drag","end"),s=0,l=0;function h(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var c=b(this,o.call(this,a,u),a,u,"mouse");c&&(bn(a.view).on("mousemove.drag",p,!0).on("mouseup.drag",g,!0),En(a.view),Tn(a),e=!1,t=a.clientX,n=a.clientY,c("start",a))}}function p(r){if(Sn(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>l}c.mouse("drag",r)}function g(t){bn(t.view).on("mousemove.drag mouseup.drag",null),kn(t.view,e),Sn(t),c.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,u=o.call(this,t,n),c=a.length;for(e=0;e+t,t.easePoly=Ui,t.easePolyIn=Ri,t.easePolyInOut=Ui,t.easePolyOut=Fi,t.easeQuad=Di,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=Di,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=Bi,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*Ii)},t.easeSinInOut=Bi,t.easeSinOut=function(t){return Math.sin(t*Ii)},t.extent=p,t.forceCenter=function(t,n){var e,r=1;function i(){var i,o,a=e.length,u=0,c=0;for(i=0;if+p||os+p||ac.index){var g=f-u.x-u.vx,y=s-u.y-u.vy,v=g*g+y*y;vt.r&&(t.r=t[n].r)}function c(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r[u(t,n,r),t]));for(a=0,i=new Array(f);a=u)){(t.data!==n||t.next)&&(0===l&&(p+=(l=Du(e))*l),0===h&&(p+=(h=Du(e))*h),p(t=(1664525*t+1013904223)%Ou)/Ou}();function l(){h(),f.call("tick",n),e1?(null==e?u.delete(t):u.set(t,p(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},t.forceX=function(t){var n,e,r,i=zu(.1);function o(t){for(var i,o=0,a=n.length;o=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++eUf(r[0],r[1])&&(r[1]=i[1]),Uf(i[0],r[1])>Uf(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Uf(r[1],i[0]))>a&&(a=u,Yc=i[0],jc=r[1])}return Zc=Kc=null,Yc===1/0||Lc===1/0?[[NaN,NaN],[NaN,NaN]]:[[Yc,Lc],[jc,Hc]]},t.geoCentroid=function(t){df=pf=gf=yf=vf=_f=bf=mf=0,xf=new g,wf=new g,Mf=new g,Rc(t,Bf);var n=+xf,e=+wf,r=+Mf,i=bc(n,e,r);return i2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Sh,t.gray=function(t,n){return new we(t,0,0,null==n?1:n)},t.greatest=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)>0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r},t.greatestIndex=function(t,e=n){if(1===e.length)return q(t,e);let r,i=-1,o=-1;for(const n of t)++o,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=o);return i},t.group=function(t,...n){return _(t,y,y,n)},t.groups=function(t,...n){return _(t,Array.from,y,n)},t.hcl=ke,t.hierarchy=Ph,t.histogram=k,t.hsl=se,t.html=wu,t.image=function(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))},t.index=function(t,...n){return _(t,y,v,n)},t.indexes=function(t,...n){return _(t,Array.from,v,n)},t.interpolate=fr,t.interpolateArray=function(t,n){return(nr(n)?tr:er)(t,n)},t.interpolateBasis=je,t.interpolateBasisClosed=He,t.interpolateBlues=b_,t.interpolateBrBG=Pv,t.interpolateBuGn=Wv,t.interpolateBuPu=Kv,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=z_,t.interpolateCubehelix=Er,t.interpolateCubehelixDefault=C_,t.interpolateCubehelixLong=kr,t.interpolateDate=rr,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateGnBu=Jv,t.interpolateGreens=x_,t.interpolateGreys=M_,t.interpolateHcl=Ar,t.interpolateHclLong=Tr,t.interpolateHsl=xr,t.interpolateHslLong=wr,t.interpolateHue=function(t,n){var e=Ve(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateInferno=B_,t.interpolateLab=function(t,n){var e=We((t=xe(t)).l,(n=xe(n)).l),r=We(t.a,n.a),i=We(t.b,n.b),o=We(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateMagma=I_,t.interpolateNumber=ir,t.interpolateNumberArray=tr,t.interpolateObject=or,t.interpolateOrRd=n_,t.interpolateOranges=N_,t.interpolatePRGn=Dv,t.interpolatePiYG=Rv,t.interpolatePlasma=Y_,t.interpolatePuBu=o_,t.interpolatePuBuGn=r_,t.interpolatePuOr=Uv,t.interpolatePuRd=u_,t.interpolatePurples=T_,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return D_.h=360*t-100,D_.s=1.5-1.5*n,D_.l=.8-.9*n,D_+""},t.interpolateRdBu=Iv,t.interpolateRdGy=Yv,t.interpolateRdPu=f_,t.interpolateRdYlBu=jv,t.interpolateRdYlGn=Xv,t.interpolateReds=E_,t.interpolateRgb=Ze,t.interpolateRgbBasis=Qe,t.interpolateRgbBasisClosed=Je,t.interpolateRound=sr,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,q_.r=255*(n=Math.sin(t))*n,q_.g=255*(n=Math.sin(t+R_))*n,q_.b=255*(n=Math.sin(t+F_))*n,q_+""},t.interpolateSpectral=Vv,t.interpolateString=cr,t.interpolateTransformCss=yr,t.interpolateTransformSvg=vr,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=O_,t.interpolateWarm=P_,t.interpolateYlGn=d_,t.interpolateYlGnBu=l_,t.interpolateYlOrBr=g_,t.interpolateYlOrRd=v_,t.interpolateZoom=br,t.interrupt=ni,t.interval=function(t,n,e){var r=new Lr,i=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?Br():+e,r._restart((function o(a){a+=i,r._restart(o,i+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)},t.isoFormat=ev,t.isoParse=rv,t.json=function(t,n){return fetch(t,n).then(bu)},t.lab=xe,t.lch=function(t,n,e,r){return 1===arguments.length?Ee(t):new Ne(e,n,t,null==r?1:r)},t.least=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)<0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r},t.leastIndex=I,t.line=gb,t.lineRadial=Mb,t.linkHorizontal=function(){return kb(Nb)},t.linkRadial=function(){var t=kb(Pb);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return kb(Cb)},t.local=xn,t.matcher=yt,t.max=N,t.maxIndex=q,t.mean=function(t,n){let e=0,r=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++e,r+=n);else{let i=-1;for(let o of t)null!=(o=n(o,++i,t))&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e},t.median=function(t,n){return D(t,.5,n)},t.merge=R,t.min=C,t.minIndex=F,t.namespace=ut,t.namespaces=at,t.now=Br,t.pack=function(){var t=null,n=1,e=1,r=Qh;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(nd(t)).eachAfter(ed(r,.5)).eachBefore(rd(1)):i.eachBefore(nd(td)).eachAfter(ed(Qh,1)).eachAfter(ed(r,i.r/Math.min(n,e))).eachBefore(rd(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=Zh(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:Jh(+t),i):r},i},t.packEnclose=Uh,t.packSiblings=function(t){return Wh(t),t},t.pairs=function(t,n=U){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&od(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;at[n])},t.pie=function(){var t=_b,n=vb,e=null,r=L_(0),i=L_(J_),o=L_(0);function a(a){var u,c,f,s,l,h=(a=sb(a)).length,d=0,p=new Array(h),g=new Array(h),y=+r.apply(this,arguments),v=Math.min(J_,Math.max(-J_,i.apply(this,arguments)-y)),_=Math.min(Math.abs(v)/h,o.apply(this,arguments)),b=_*(v<0?-1:1);for(u=0;u0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,f=d?(v-h*b)/d:0;u0?l*f:0)+b,g[c]={data:a[c],index:u,value:l,startAngle:y,endAngle:s,padAngle:_};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:L_(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:L_(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:L_(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:L_(+t),a):o},a},t.piecewise=Nr,t.pointRadial=Tb,t.pointer=An,t.pointers=function(t,n){return t.target&&(t=Mn(t),void 0===n&&(n=t.currentTarget),t=t.touches||[t]),Array.from(t,t=>An(t,n))},t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eu!=f>u&&a<(c-e)*(u-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[o[n]][2]]);for(n=+u;n=1)return+e(t[i-1],i-1,t);var i,o=(i-1)*n,a=Math.floor(o),u=+e(t[a],a,t);return u+(+e(t[a+1],a+1,t)-u)*(o-a)}},t.quantize=function(t,n){for(var e=new Array(n),r=0;r(n=1664525*n+1013904223|0,Ld*(n>>>0))},t.randomLogNormal=kd,t.randomLogistic=Bd,t.randomNormal=Ed,t.randomPareto=zd,t.randomPoisson=Yd,t.randomUniform=Td,t.randomWeibull=Od,t.range=O,t.rgb=re,t.ribbon=function(){return oa()},t.ribbonArrow=function(){return oa(ia)},t.rollup=function(t,n,...e){return _(t,y,n,e)},t.rollups=function(t,n,...e){return _(t,Array.from,n,e)},t.scaleBand=Vd,t.scaleDiverging=function t(){var n=op(yv()(Kd));return n.copy=function(){return pv(n,t())},Hd.apply(n,arguments)},t.scaleDivergingLog=function t(){var n=dp(yv()).domain([.1,1,10]);return n.copy=function(){return pv(n,t()).base(n.base())},Hd.apply(n,arguments)},t.scaleDivergingPow=vv,t.scaleDivergingSqrt=function(){return vv.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var n=yp(yv());return n.copy=function(){return pv(n,t()).constant(n.constant())},Hd.apply(n,arguments)},t.scaleIdentity=function t(n){var e;function r(t){return isNaN(t=+t)?e:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,Wd),r):n.slice()},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,Wd):[0,1],op(r)},t.scaleImplicit=Xd,t.scaleLinear=function t(){var n=rp();return n.copy=function(){return np(n,t())},jd.apply(n,arguments),op(n)},t.scaleLog=function t(){var n=dp(ep()).domain([1,10]);return n.copy=function(){return np(n,t()).base(n.base())},jd.apply(n,arguments),n},t.scaleOrdinal=Gd,t.scalePoint=function(){return $d(Vd.apply(null,arguments).paddingInner(1))},t.scalePow=xp,t.scaleQuantile=function t(){var e,r=[],i=[],a=[];function u(){var t=0,n=Math.max(1,i.length);for(a=new Array(n-1);++t0?a[n-1]:r[0],n=i?[a[i-1],r]:[a[n-1],a[n]]},c.unknown=function(t){return arguments.length?(n=t,c):c},c.thresholds=function(){return a.slice()},c.copy=function(){return t().domain([e,r]).range(u).unknown(n)},jd.apply(op(c),arguments)},t.scaleRadial=function t(){var n,e=rp(),r=[0,1],i=!1;function o(t){var r=Mp(e(t));return isNaN(r)?n:i?Math.round(r):r}return o.invert=function(t){return e.invert(wp(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((r=Array.from(t,Wd)).map(wp)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t(e.domain(),r).round(i).clamp(e.clamp()).unknown(n)},jd.apply(o,arguments),op(o)},t.scaleSequential=function t(){var n=op(dv()(Kd));return n.copy=function(){return pv(n,t())},Hd.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=dp(dv()).domain([1,10]);return n.copy=function(){return pv(n,t()).base(n.base())},Hd.apply(n,arguments)},t.scaleSequentialPow=gv,t.scaleSequentialQuantile=function t(){var e=[],r=Kd;function i(t){if(!isNaN(t=+t))return r((o(e,t,1)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(n),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return e.map((t,n)=>r(n/(e.length-1)))},i.quantiles=function(t){return Array.from({length:t+1},(n,r)=>D(e,r/t))},i.copy=function(){return t(r).domain(e)},Hd.apply(i,arguments)},t.scaleSequentialSqrt=function(){return gv.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=yp(dv());return n.copy=function(){return pv(n,t()).constant(n.constant())},Hd.apply(n,arguments)},t.scaleSqrt=function(){return xp.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var n=yp(ep());return n.copy=function(){return np(n,t()).constant(n.constant())},jd.apply(n,arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function a(t){return t<=t?r[o(e,t,0,i)]:n}return a.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),a):e.slice()},a.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),a):r.slice()},a.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},a.unknown=function(t){return arguments.length?(n=t,a):n},a.copy=function(){return t().domain(e).range(r).unknown(n)},jd.apply(a,arguments)},t.scaleTime=function(){return jd.apply(hv(og,rg,jp,Bp,Op,Fp,qp,Ep,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return jd.apply(hv(Cg,kg,pg,lg,fg,ug,qp,Ep,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,n){const e=I(t,n);return e<0?void 0:e},t.schemeAccent=mv,t.schemeBlues=__,t.schemeBrBG=Cv,t.schemeBuGn=$v,t.schemeBuPu=Zv,t.schemeCategory10=bv,t.schemeDark2=xv,t.schemeGnBu=Qv,t.schemeGreens=m_,t.schemeGreys=w_,t.schemeOrRd=t_,t.schemeOranges=k_,t.schemePRGn=zv,t.schemePaired=wv,t.schemePastel1=Mv,t.schemePastel2=Av,t.schemePiYG=qv,t.schemePuBu=i_,t.schemePuBuGn=e_,t.schemePuOr=Fv,t.schemePuRd=a_,t.schemePurples=A_,t.schemeRdBu=Ov,t.schemeRdGy=Bv,t.schemeRdPu=c_,t.schemeRdYlBu=Lv,t.schemeRdYlGn=Hv,t.schemeReds=S_,t.schemeSet1=Tv,t.schemeSet2=Sv,t.schemeSet3=Ev,t.schemeSpectral=Gv,t.schemeTableau10=kv,t.schemeYlGn=h_,t.schemeYlGnBu=s_,t.schemeYlOrBr=p_,t.schemeYlOrRd=y_,t.select=bn,t.selectAll=function(t){return"string"==typeof t?new vn([document.querySelectorAll(t)],[document.documentElement]):new vn([null==t?[]:dt(t)],yn)},t.selection=_n,t.selector=ht,t.selectorAll=gt,t.shuffle=B,t.shuffler=Y,t.stack=function(){var t=L_([]),n=Nm,e=km,r=Cm;function i(i){var o,a,u=Array.from(t.apply(this,arguments),Pm),c=u.length,f=-1;for(const t of i)for(o=0,++f;o0)for(var e,r,i,o,a,u,c=0,f=t[n[0]].length;c0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=Kh(n),e):t},e.parentId=function(t){return arguments.length?(n=Kh(t),e):n},e},t.style=It,t.sum=function(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e},t.svg=Mu,t.symbol=function(t,n){var e=null;function r(){var r;if(e||(e=r=Wo()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return t="function"==typeof t?t:L_(t||zb),n="function"==typeof n?n:L_(void 0===n?64:+n),r.type=function(n){return arguments.length?(t="function"==typeof n?n:L_(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:L_(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbolCircle=zb,t.symbolCross=Db,t.symbolDiamond=Fb,t.symbolSquare=Yb,t.symbolStar=Bb,t.symbolTriangle=jb,t.symbolWye=$b,t.symbols=Wb,t.text=gu,t.thresholdFreedmanDiaconis=function(t,n,e){return Math.ceil((e-n)/(2*(D(t,.75)-D(t,.25))*Math.pow(c(t),-1/3)))},t.thresholdScott=function(t,n,e){return Math.ceil((e-n)/(3.5*d(t)*Math.pow(c(t),-1/3)))},t.thresholdSturges=E,t.tickFormat=ip,t.tickIncrement=T,t.tickStep=S,t.ticks=A,t.timeDay=Bp,t.timeDays=Yp,t.timeFormatDefaultLocale=tv,t.timeFormatLocale=Rg,t.timeFriday=$p,t.timeFridays=ng,t.timeHour=Op,t.timeHours=Ip,t.timeInterval=Sp,t.timeMillisecond=Ep,t.timeMilliseconds=kp,t.timeMinute=Fp,t.timeMinutes=Up,t.timeMonday=Hp,t.timeMondays=Kp,t.timeMonth=rg,t.timeMonths=ig,t.timeSaturday=Wp,t.timeSaturdays=eg,t.timeSecond=qp,t.timeSeconds=Rp,t.timeSunday=jp,t.timeSundays=Zp,t.timeThursday=Vp,t.timeThursdays=tg,t.timeTuesday=Xp,t.timeTuesdays=Qp,t.timeWednesday=Gp,t.timeWednesdays=Jp,t.timeWeek=jp,t.timeWeeks=Zp,t.timeYear=og,t.timeYears=ag,t.timeout=$r,t.timer=jr,t.timerFlush=Hr,t.transition=Ci,t.transpose=L,t.tree=function(){var t=sd,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,a=new gd(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new gd(r[i],i)),e.parent=n;return(a.parent=new gd(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),g=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=hd(u),o=ld(o),u&&o;)c=ld(c),(a=hd(a)).a=n,(i=u.z+l-o.z-f+t(u._,o._))>0&&(dd(pd(u,n,r),n,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!hd(a)&&(a.t=u,a.m+=l-s),o&&!ld(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=bd,n=!1,e=1,r=1,i=[0],o=Qh,a=Qh,u=Qh,c=Qh,f=Qh;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(id),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}var l=f[n],h=r/2+l,d=n+1,p=e-1;for(;d>>1;f[g]c-o){var _=r?(i*v+a*y)/r:a;t(n,d,y,i,o,_,c),t(d,e,v,_,o,a,c)}else{var b=r?(o*v+c*y)/r:c;t(n,d,y,i,o,a,b),t(d,e,v,i,b,a,c)}}(0,c,t.value,n,e,r,i)},t.treemapDice=od,t.treemapResquarify=md,t.treemapSlice=yd,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?yd:od)(t,n,e,r,i)},t.treemapSquarify=bd,t.tsv=_u,t.tsvFormat=au,t.tsvFormatBody=uu,t.tsvFormatRow=fu,t.tsvFormatRows=cu,t.tsvFormatValue=su,t.tsvParse=iu,t.tsvParseRows=ou,t.utcDay=lg,t.utcDays=hg,t.utcFriday=bg,t.utcFridays=Sg,t.utcHour=fg,t.utcHours=sg,t.utcMillisecond=Ep,t.utcMilliseconds=kp,t.utcMinute=ug,t.utcMinutes=cg,t.utcMonday=gg,t.utcMondays=wg,t.utcMonth=kg,t.utcMonths=Ng,t.utcSaturday=mg,t.utcSaturdays=Eg,t.utcSecond=qp,t.utcSeconds=Rp,t.utcSunday=pg,t.utcSundays=xg,t.utcThursday=_g,t.utcThursdays=Tg,t.utcTuesday=yg,t.utcTuesdays=Mg,t.utcWednesday=vg,t.utcWednesdays=Ag,t.utcWeek=pg,t.utcWeeks=xg,t.utcYear=Cg,t.utcYears=Pg,t.variance=h,t.version="6.1.1",t.window=Rt,t.xml=xu,t.zip=function(){return L(arguments)},t.zoom=function(){var t,n,e,r=jm,i=Hm,o=$m,a=Gm,u=Vm,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],s=250,l=br,h=tt("start","zoom","end"),d=500,p=0,g=10;function y(t){t.property("__zoom",Xm).on("wheel.zoom",M).on("mousedown.zoom",A).on("dblclick.zoom",T).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(c[0],Math.min(c[1],n)))===t.k?t:new Om(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Om(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,n,e,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),u=i.apply(t,o),c=null==e?b(u):"function"==typeof e?e.apply(t,o):e,f=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof n?n.apply(t,o):n,d=l(s.invert(c).concat(f/s.k),h.invert(c).concat(f/h.k));return function(t){if(1===t)t=h;else{var n=d(t),e=f/n[2];t=new Om(e,c[0]-n[0]*e,c[1]-n[1]*e)}a.zoom(null,t)}}))}function x(t,n,e){return!e&&t.__zooming||new w(t,n)}function w(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function M(t,...n){if(r.apply(this,arguments)){var e=x(this,n).event(t),i=this.__zoom,u=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),s=An(t);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=i.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[s,i.invert(s)],ni(this),e.start()}Lm(t),e.wheel=setTimeout(l,150),e.zoom("mouse",o(_(v(i,u),e.mouse[0],e.mouse[1]),e.extent,f))}function l(){e.wheel=null,e.end()}}function A(t,...n){if(!e&&r.apply(this,arguments)){var i=x(this,n,!0).event(t),a=bn(t.view).on("mousemove.zoom",h,!0).on("mouseup.zoom",d,!0),u=An(t,c),c=t.currentTarget,s=t.clientX,l=t.clientY;En(t.view),Ym(t),i.mouse=[u,this.__zoom.invert(u)],ni(this),i.start()}function h(t){if(Lm(t),!i.moved){var n=t.clientX-s,e=t.clientY-l;i.moved=n*n+e*e>p}i.event(t).zoom("mouse",o(_(i.that.__zoom,i.mouse[0]=An(t,c),i.mouse[1]),i.extent,f))}function d(t){a.on("mousemove.zoom mouseup.zoom",null),kn(t.view,i.moved),Lm(t),i.event(t).end()}}function T(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=An(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),c=e.k*(t.shiftKey?.5:2),l=o(_(v(e,c),a,u),i.apply(this,n),f);Lm(t),s>0?bn(this).transition().duration(s).call(m,l,a,t):bn(this).call(y.transform,l,a,t)}}function S(e,...i){if(r.apply(this,arguments)){var o,a,u,c,f=e.touches,s=f.length,l=x(this,i,e.changedTouches.length===s).event(e);for(Ym(e),a=0;an?1:t>=n?0:NaN}function e(t){let e=t,r=t;function i(t,n,e,i){for(null==e&&(e=0),null==i&&(i=t.length);e>>1;r(t[o],n)<0?e=o+1:i=o}return e}return 1===t.length&&(e=(n,e)=>t(n)-e,r=function(t){return(e,r)=>n(t(e),r)}(t)),{left:i,center:function(t,n,r,o){null==r&&(r=0),null==o&&(o=t.length);const a=i(t,n,r,o-1);return a>r&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,n,e,i){for(null==e&&(e=0),null==i&&(i=t.length);e>>1;r(t[o],n)>0?i=o:e=o+1}return e}}}function r(t){return null===t?NaN:+t}const i=e(n),o=i.right,a=i.left,u=e(r).center;function c(t,n){let e=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&++e;else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(i=+i)>=i&&++e}return e}function f(t){return 0|t.length}function s(t){return!(t>0)}function l(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function h(t,n){let e,r=0,i=0,o=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(e=n-i,i+=e/++r,o+=e*(n-i));else{let a=-1;for(let u of t)null!=(u=n(u,++a,t))&&(u=+u)>=u&&(e=u-i,i+=e/++r,o+=e*(u-i))}if(r>1)return o/(r-1)}function d(t,n){const e=h(t,n);return e?Math.sqrt(e):e}function p(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r=o&&(e=r=o):(e>o&&(e=o),r0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}class y extends Map{constructor(t,n=x){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[n,e]of t)this.set(n,e)}get(t){return super.get(_(this,t))}has(t){return super.has(_(this,t))}set(t,n){return super.set(b(this,t),n)}delete(t){return super.delete(m(this,t))}}class v extends Set{constructor(t,n=x){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(_(this,t))}add(t){return super.add(b(this,t))}delete(t){return super.delete(m(this,t))}}function _({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function b({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function m({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(e),t.delete(r)),e}function x(t){return null!==t&&"object"==typeof t?t.valueOf():t}function w(t){return t}function M(t,...n){return S(t,w,w,n)}function A(t,n,...e){return S(t,w,n,e)}function T(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function S(t,n,e,r){return function t(i,o){if(o>=r.length)return e(i);const a=new y,u=r[o++];let c=-1;for(const t of i){const n=u(t,++c,i),e=a.get(n);e?e.push(t):a.set(n,[t])}for(const[n,e]of a)a.set(n,t(e,o));return n(a)}(t,0)}function E(t,n){return Array.from(n,(n=>t[n]))}function k(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[r=n]=e;if(1===r.length||e.length>1){const i=Uint32Array.from(t,((t,n)=>n));return e.length>1?(e=e.map((n=>t.map(n))),i.sort(((t,r)=>{for(const i of e){const e=n(i[t],i[r]);if(e)return e}}))):(r=t.map(r),i.sort(((t,e)=>n(r[t],r[e])))),E(t,i)}return t.sort(r)}var N=Array.prototype.slice;function C(t){return function(){return t}}var P=Math.sqrt(50),z=Math.sqrt(10),D=Math.sqrt(2);function q(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=P?10:o>=z?5:o>=D?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=P?10:o>=z?5:o>=D?2:1)}function F(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=P?i*=10:o>=z?i*=5:o>=D&&(i*=2),n0?(t=Math.floor(t/i)*i,n=Math.ceil(n/i)*i):i<0&&(t=Math.ceil(t*i)/i,n=Math.floor(n*i)/i),r=i}}function U(t){return Math.ceil(Math.log(c(t))/Math.LN2)+1}function I(){var t=w,n=p,e=U;function r(r){Array.isArray(r)||(r=Array.from(r));var i,a,u=r.length,c=new Array(u);for(i=0;i=l)if(t>=l&&n===p){const t=R(s,l,e);isFinite(t)&&(t>0?l=(Math.floor(l/t)+1)*t:t<0&&(l=(Math.ceil(l*-t)+1)/-t))}else h.pop()}for(var d=h.length;h[0]<=s;)h.shift(),--d;for(;h[d-1]>l;)h.pop(),--d;var g,y=new Array(d+1);for(i=0;i<=d;++i)(g=y[i]=[]).x0=i>0?h[i-1]:s,g.x1=i=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function Y(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function L(t,e,r=0,i=t.length-1,o=n){for(;i>r;){if(i-r>600){const n=i-r+1,a=e-r+1,u=Math.log(n),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(n-c)/n)*(a-n/2<0?-1:1);L(t,e,Math.max(r,Math.floor(e-a*c/n+f)),Math.min(i,Math.floor(e+(n-a)*c/n+f)),o)}const n=t[e];let a=r,u=i;for(j(t,r,e),o(t[i],n)>0&&j(t,r,i);a0;)--u}0===o(t[r],n)?j(t,r,u):(++u,j(t,u,i)),u<=e&&(r=u+1),e<=u&&(i=u-1)}return t}function j(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function H(t,n,e){if(r=(t=Float64Array.from(function*(t,n){if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let e=-1;for(let r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(t,e))).length){if((n=+n)<=0||r<2)return Y(t);if(n>=1)return B(t);var r,i=(r-1)*n,o=Math.floor(i),a=B(L(t,o).subarray(0,o+1));return a+(Y(t.subarray(o+1))-a)*(i-o)}}function X(t,n,e=r){if(i=t.length){if((n=+n)<=0||i<2)return+e(t[0],0,t);if(n>=1)return+e(t[i-1],i-1,t);var i,o=(i-1)*n,a=Math.floor(o),u=+e(t[a],a,t);return u+(+e(t[a+1],a+1,t)-u)*(o-a)}}function G(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e=o)&&(e=o,r=i);return r}function V(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}function $(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e>n||void 0===e&&n>=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e>o||void 0===e&&o>=o)&&(e=o,r=i);return r}function W(t,n){return[t,n]}function Z(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r+t(n)}function st(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function lt(){return!this.__axis}function ht(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,f=1===t||4===t?-1:1,s=4===t||2===t?"x":"y",l=1===t||3===t?ut:ct;function h(h){var d=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,p=null==i?n.tickFormat?n.tickFormat.apply(n,e):ot:i,g=Math.max(o,0)+u,y=n.range(),v=+y[0]+c,_=+y[y.length-1]+c,b=(n.bandwidth?st:ft)(n.copy(),c),m=h.selection?h.selection():h,x=m.selectAll(".domain").data([null]),w=m.selectAll(".tick").data(d,n).order(),M=w.exit(),A=w.enter().append("g").attr("class","tick"),T=w.select("line"),S=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(A),T=T.merge(A.append("line").attr("stroke","currentColor").attr(s+"2",f*o)),S=S.merge(A.append("text").attr("fill","currentColor").attr(s,f*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),h!==m&&(x=x.transition(h),w=w.transition(h),T=T.transition(h),S=S.transition(h),M=M.transition(h).attr("opacity",at).attr("transform",(function(t){return isFinite(t=b(t))?l(t+c):this.getAttribute("transform")})),A.attr("opacity",at).attr("transform",(function(t){var n=this.parentNode.__axis;return l((n&&isFinite(n=n(t))?n:b(t))+c)}))),M.remove(),x.attr("d",4===t||2===t?a?"M"+f*a+","+v+"H"+c+"V"+_+"H"+f*a:"M"+c+","+v+"V"+_:a?"M"+v+","+f*a+"V"+c+"H"+_+"V"+f*a:"M"+v+","+c+"H"+_),w.attr("opacity",1).attr("transform",(function(t){return l(b(t)+c)})),T.attr(s+"2",f*o),S.attr(s,f*g).text(p),m.filter(lt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),m.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(n=t,h):n},h.ticks=function(){return e=it.call(arguments),h},h.tickArguments=function(t){return arguments.length?(e=null==t?[]:it.call(t),h):e.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:it.call(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(c=+t,h):c},h}var dt={value:()=>{}};function pt(){for(var t,n=0,e=arguments.length,r={};n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function vt(t,n){for(var e,r=0,i=t.length;r0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),mt.hasOwnProperty(n)?{space:mt[n],local:t}:t}function wt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===bt&&n.documentElement.namespaceURI===bt?n.createElement(t):n.createElementNS(e,t)}}function Mt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function At(t){var n=xt(t);return(n.local?Mt:wt)(n)}function Tt(){}function St(t){return null==t?Tt:function(){return this.querySelector(t)}}function Et(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function kt(){return[]}function Nt(t){return null==t?kt:function(){return this.querySelectorAll(t)}}function Ct(t){return function(){return this.matches(t)}}function Pt(t){return function(n){return n.matches(t)}}var zt=Array.prototype.find;function Dt(){return this.firstElementChild}var qt=Array.prototype.filter;function Rt(){return this.children}function Ft(t){return new Array(t.length)}function Ot(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function Ut(t){return function(){return t}}function It(t,n,e,r,i,o){for(var a,u=0,c=n.length,f=o.length;un?1:t>=n?0:NaN}function jt(t){return function(){this.removeAttribute(t)}}function Ht(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Xt(t,n){return function(){this.setAttribute(t,n)}}function Gt(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Vt(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function $t(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Wt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Zt(t){return function(){this.style.removeProperty(t)}}function Kt(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Qt(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Jt(t,n){return t.style.getPropertyValue(n)||Wt(t).getComputedStyle(t,null).getPropertyValue(n)}function tn(t){return function(){delete this[t]}}function nn(t,n){return function(){this[t]=n}}function en(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function rn(t){return t.trim().split(/^|\s+/)}function on(t){return t.classList||new an(t)}function an(t){this._node=t,this._names=rn(t.getAttribute("class")||"")}function un(t,n){for(var e=on(t),r=-1,i=n.length;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function Tn(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Cn=[null];function Pn(t,n){this._groups=t,this._parents=n}function zn(){return new Pn([[document.documentElement]],Cn)}function Dn(t){return"string"==typeof t?new Pn([[document.querySelector(t)]],[document.documentElement]):new Pn([[t]],Cn)}Pn.prototype=zn.prototype={constructor:Pn,select:function(t){"function"!=typeof t&&(t=St(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=x&&(x=m+1);!(b=y[x])&&++x=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Lt);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?Zt:"function"==typeof n?Qt:Kt)(t,n,null==e?"":e)):Jt(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?tn:"function"==typeof n?en:nn)(t,n)):this.node()[t]},classed:function(t,n){var e=rn(t+"");if(arguments.length<2){for(var r=on(this.node()),i=-1,o=e.length;++i()=>t;function Hn(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:f,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:s}})}function Xn(t){return!t.ctrlKey&&!t.button}function Gn(){return this.parentNode}function Vn(t,n){return null==n?{x:t.x,y:t.y}:n}function $n(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Zn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Kn(){}Hn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Qn=.7,Jn=1/Qn,te="\\s*([+-]?\\d+)\\s*",ne="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ee="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",re=/^#([0-9a-f]{3,8})$/,ie=new RegExp("^rgb\\("+[te,te,te]+"\\)$"),oe=new RegExp("^rgb\\("+[ee,ee,ee]+"\\)$"),ae=new RegExp("^rgba\\("+[te,te,te,ne]+"\\)$"),ue=new RegExp("^rgba\\("+[ee,ee,ee,ne]+"\\)$"),ce=new RegExp("^hsl\\("+[ne,ee,ee]+"\\)$"),fe=new RegExp("^hsla\\("+[ne,ee,ee,ne]+"\\)$"),se={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function le(){return this.rgb().formatHex()}function he(){return this.rgb().formatRgb()}function de(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=re.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?pe(n):3===e?new _e(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?ge(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?ge(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=ie.exec(t))?new _e(n[1],n[2],n[3],1):(n=oe.exec(t))?new _e(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ae.exec(t))?ge(n[1],n[2],n[3],n[4]):(n=ue.exec(t))?ge(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=ce.exec(t))?we(n[1],n[2]/100,n[3]/100,1):(n=fe.exec(t))?we(n[1],n[2]/100,n[3]/100,n[4]):se.hasOwnProperty(t)?pe(se[t]):"transparent"===t?new _e(NaN,NaN,NaN,0):null}function pe(t){return new _e(t>>16&255,t>>8&255,255&t,1)}function ge(t,n,e,r){return r<=0&&(t=n=e=NaN),new _e(t,n,e,r)}function ye(t){return t instanceof Kn||(t=de(t)),t?new _e((t=t.rgb()).r,t.g,t.b,t.opacity):new _e}function ve(t,n,e,r){return 1===arguments.length?ye(t):new _e(t,n,e,null==r?1:r)}function _e(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function be(){return"#"+xe(this.r)+xe(this.g)+xe(this.b)}function me(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function xe(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function we(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Te(t,n,e,r)}function Me(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof Kn||(t=de(t)),!t)return new Te;if(t instanceof Te)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new Te(a,u,c,t.opacity)}function Ae(t,n,e,r){return 1===arguments.length?Me(t):new Te(t,n,e,null==r?1:r)}function Te(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Se(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Wn(Kn,de,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:le,formatHex:le,formatHsl:function(){return Me(this).formatHsl()},formatRgb:he,toString:he}),Wn(_e,ve,Zn(Kn,{brighter:function(t){return t=null==t?Jn:Math.pow(Jn,t),new _e(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Qn:Math.pow(Qn,t),new _e(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:be,formatHex:be,formatRgb:me,toString:me})),Wn(Te,Ae,Zn(Kn,{brighter:function(t){return t=null==t?Jn:Math.pow(Jn,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Qn:Math.pow(Qn,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new _e(Se(t>=240?t-240:t+120,i,r),Se(t,i,r),Se(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const Ee=Math.PI/180,ke=180/Math.PI,Ne=.96422,Ce=.82521,Pe=4/29,ze=6/29,De=3*ze*ze;function qe(t){if(t instanceof Fe)return new Fe(t.l,t.a,t.b,t.opacity);if(t instanceof je)return He(t);t instanceof _e||(t=ye(t));var n,e,r=Be(t.r),i=Be(t.g),o=Be(t.b),a=Oe((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?n=e=a:(n=Oe((.4360747*r+.3850649*i+.1430804*o)/Ne),e=Oe((.0139322*r+.0971045*i+.7141733*o)/Ce)),new Fe(116*a-16,500*(n-a),200*(a-e),t.opacity)}function Re(t,n,e,r){return 1===arguments.length?qe(t):new Fe(t,n,e,null==r?1:r)}function Fe(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Oe(t){return t>.008856451679035631?Math.pow(t,1/3):t/De+Pe}function Ue(t){return t>ze?t*t*t:De*(t-Pe)}function Ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Be(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ye(t){if(t instanceof je)return new je(t.h,t.c,t.l,t.opacity);if(t instanceof Fe||(t=qe(t)),0===t.a&&0===t.b)return new je(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function ar(t,n){return function(e){return t+e*n}}function ur(t,n){var e=n-t;return e?ar(t,e>180||e<-180?e-360*Math.round(e/360):e):or(isNaN(t)?n:t)}function cr(t){return 1==(t=+t)?fr:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):or(isNaN(n)?e:n)}}function fr(t,n){var e=n-t;return e?ar(t,e):or(isNaN(t)?n:t)}var sr=function t(n){var e=cr(n);function r(t,n){var r=e((t=ve(t)).r,(n=ve(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=fr(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function lr(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:_r(e,r)})),o=xr.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:_r(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:_r(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:_r(t,e)},{i:u-2,x:_r(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Gr}function oi(){Zr=(Wr=Qr.now())+Kr,Gr=Vr=0;try{ii()}finally{Gr=0,function(){var t,n,e=Hr,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Hr=n);Xr=t,ui(r)}(),Zr=0}}function ai(){var t=Qr.now(),n=t-Wr;n>1e3&&(Kr-=n,Wr=t)}function ui(t){Gr||(Vr&&(Vr=clearTimeout(Vr)),t-Zr>24?(t<1/0&&(Vr=setTimeout(oi,t-Qr.now()-Kr)),$r&&($r=clearInterval($r))):($r||(Wr=Qr.now(),$r=setInterval(ai,1e3)),Gr=1,Jr(oi)))}function ci(t,n,e){var r=new ei;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}ei.prototype=ri.prototype={constructor:ei,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?ti():+e)+(null==n?0:+n),this._next||Xr===this||(Xr?Xr._next=this:Hr=this,Xr=this),this._call=t,this._time=e,ui()},stop:function(){this._call&&(this._call=null,this._time=1/0,ui())}};var fi=pt("start","end","cancel","interrupt"),si=[];function li(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var f,s,l,h;if(1!==e.state)return c();for(f in i)if((h=i[f]).name===e.name){if(3===h.state)return ci(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+f0)throw new Error("too late; already scheduled");return e}function di(t,n){var e=pi(t,n);if(e.state>3)throw new Error("too late; already running");return e}function pi(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function gi(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function yi(t,n){var e,r;return function(){var i=di(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?hi:di;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}var Fi=zn.prototype.constructor;function Oi(t){return function(){this.style.removeProperty(t)}}function Ui(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Ii(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&Ui(t,o,e)),r}return o._value=n,o}function Bi(t){return function(n){this.textContent=t.call(this,n)}}function Yi(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&Bi(r)),n}return r._value=t,r}var Li=0;function ji(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Hi(t){return zn().transition(t)}function Xi(){return++Li}var Gi=zn.prototype;ji.prototype=Hi.prototype={constructor:ji,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=St(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>t;function mo(t,{sourceEvent:n,target:e,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function xo(t){t.stopImmediatePropagation()}function wo(t){t.preventDefault(),t.stopImmediatePropagation()}var Mo={name:"drag"},Ao={name:"space"},To={name:"handle"},So={name:"center"};const{abs:Eo,max:ko,min:No}=Math;function Co(t){return[+t[0],+t[1]]}function Po(t){return[Co(t[0]),Co(t[1])]}var zo={name:"x",handles:["w","e"].map(Bo),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Do={name:"y",handles:["n","s"].map(Bo),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},qo={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Bo),input:function(t){return null==t?null:Po(t)},output:function(t){return t}},Ro={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Fo={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Oo={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Uo={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Io={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Bo(t){return{type:t}}function Yo(t){return!t.ctrlKey&&!t.button}function Lo(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function jo(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ho(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Xo(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Go(t){var n,e=Lo,r=Yo,i=jo,o=!0,a=pt("start","brush","end"),u=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([Bo("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ro.overlay).merge(e).each((function(){var t=Ho(this).extent;Dn(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([Bo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ro.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Ro[t.type]})),n.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){var t=Dn(this),n=Ho(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function s(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new l(t,n,e):r}function l(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function h(e){if((!n||e.touches)&&r.apply(this,arguments)){var i,a,u,c,l,h,d,p,g,y,v,_=this,b=e.target.__data__.type,m="selection"===(o&&e.metaKey?b="overlay":b)?Mo:o&&e.altKey?So:To,x=t===Do?null:Uo[b],w=t===zo?null:Io[b],M=Ho(_),A=M.extent,T=M.selection,S=A[0][0],E=A[0][1],k=A[1][0],N=A[1][1],C=0,P=0,z=x&&w&&o&&e.shiftKey,D=Array.from(e.touches||[e],(t=>{const n=t.identifier;return(t=Un(t,_)).point0=t.slice(),t.identifier=n,t}));if("overlay"===b){T&&(g=!0);const n=[D[0],D[1]||D[0]];M.selection=T=[[i=t===Do?S:No(n[0][0],n[1][0]),u=t===zo?E:No(n[0][1],n[1][1])],[l=t===Do?k:ko(n[0][0],n[1][0]),d=t===zo?N:ko(n[0][1],n[1][1])]],D.length>1&&I()}else i=T[0][0],u=T[0][1],l=T[1][0],d=T[1][1];a=i,c=u,h=l,p=d;var q=Dn(_).attr("pointer-events","none"),R=q.selectAll(".overlay").attr("cursor",Ro[b]);gi(_);var F=s(_,arguments,!0).beforestart();if(e.touches)F.moved=U,F.ended=B;else{var O=Dn(e.view).on("mousemove.brush",U,!0).on("mouseup.brush",B,!0);o&&O.on("keydown.brush",Y,!0).on("keyup.brush",L,!0),Yn(e.view)}f.call(_),F.start(e,m.name)}function U(t){for(const n of t.changedTouches||[t])for(const t of D)t.identifier===n.identifier&&(t.cur=Un(n,_));if(z&&!y&&!v&&1===D.length){const t=D[0];Eo(t.cur[0]-t[0])>Eo(t.cur[1]-t[1])?v=!0:y=!0}for(const t of D)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,wo(t),I(t)}function I(t){const n=D[0],e=n.point0;var r;switch(C=n[0]-e[0],P=n[1]-e[1],m){case Ao:case Mo:x&&(C=ko(S-i,No(k-l,C)),a=i+C,h=l+C),w&&(P=ko(E-u,No(N-d,P)),c=u+P,p=d+P);break;case To:D[1]?(x&&(a=ko(S,No(k,D[0][0])),h=ko(S,No(k,D[1][0])),x=1),w&&(c=ko(E,No(N,D[0][1])),p=ko(E,No(N,D[1][1])),w=1)):(x<0?(C=ko(S-i,No(k-i,C)),a=i+C,h=l):x>0&&(C=ko(S-l,No(k-l,C)),a=i,h=l+C),w<0?(P=ko(E-u,No(N-u,P)),c=u+P,p=d):w>0&&(P=ko(E-d,No(N-d,P)),c=u,p=d+P));break;case So:x&&(a=ko(S,No(k,i-C*x)),h=ko(S,No(k,l+C*x))),w&&(c=ko(E,No(N,u-P*w)),p=ko(E,No(N,d+P*w)))}h0&&(i=a-C),w<0?d=p-P:w>0&&(u=c-P),m=Ao,R.attr("cursor",Ro.selection),I());break;default:return}wo(t)}function L(t){switch(t.keyCode){case 16:z&&(y=v=z=!1,I());break;case 18:m===So&&(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=To,I());break;case 32:m===Ao&&(t.altKey?(x&&(l=h-C*x,i=a+C*x),w&&(d=p-P*w,u=c+P*w),m=So):(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=To),R.attr("cursor",Ro[b]),I());break;default:return}wo(t)}}function d(t){s(this,arguments).moved(t)}function p(t){s(this,arguments).ended(t)}function g(){var n=this.__brush||{selection:null};return n.extent=Po(e.apply(this,arguments)),n.dim=t,n}return c.move=function(n,e){n.tween?n.on("start.brush",(function(t){s(this,arguments).beforestart().start(t)})).on("interrupt.brush end.brush",(function(t){s(this,arguments).end(t)})).tween("brush",(function(){var n=this,r=n.__brush,i=s(n,arguments),o=r.selection,a=t.input("function"==typeof e?e.apply(this,arguments):e,r.extent),u=Mr(o,a);function c(t){r.selection=1===t&&null===a?null:u(t),f.call(n),i.brush()}return null!==o&&null!==a?c:c(1)})):n.each((function(){var n=this,r=arguments,i=n.__brush,o=t.input("function"==typeof e?e.apply(n,r):e,i.extent),a=s(n,r).beforestart();gi(n),i.selection=null===o?null:o,f.call(n),a.start().brush().end()}))},c.clear=function(t){c.move(t,null)},l.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,n){return this.starting?(this.starting=!1,this.emit("start",t,n)):this.emit("brush",t),this},brush:function(t,n){return this.emit("brush",t,n),this},end:function(t,n){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,n)),this},emit:function(n,e,r){var i=Dn(this.that).datum();a.call(n,this.that,new mo(n,{sourceEvent:e,target:c,selection:t.output(this.state.selection),mode:r,dispatch:a}),i)}},c.extent=function(t){return arguments.length?(e="function"==typeof t?t:bo(Po(t)),c):e},c.filter=function(t){return arguments.length?(r="function"==typeof t?t:bo(!!t),c):r},c.touchable=function(t){return arguments.length?(i="function"==typeof t?t:bo(!!t),c):i},c.handleSize=function(t){return arguments.length?(u=+t,c):u},c.keyModifiers=function(t){return arguments.length?(o=!!t,c):o},c.on=function(){var t=a.on.apply(a,arguments);return t===a?c:t},c}var Vo=Math.abs,$o=Math.cos,Wo=Math.sin,Zo=Math.PI,Ko=Zo/2,Qo=2*Zo,Jo=Math.max,ta=1e-12;function na(t,n){return Array.from({length:n-t},((n,e)=>t+e))}function ea(t){return function(n,e){return t(n.source.value+n.target.value,e.source.value+e.target.value)}}function ra(t,n){var e=0,r=null,i=null,o=null;function a(a){var u,c=a.length,f=new Array(c),s=na(0,c),l=new Array(c*c),h=new Array(c),d=0;a=Float64Array.from({length:c*c},n?(t,n)=>a[n%c][n/c|0]:(t,n)=>a[n/c|0][n%c]);for(let n=0;nr(f[t],f[n])));for(const e of s){const r=n;if(t){const t=na(1+~c,c).filter((t=>t<0?a[~t*c+e]:a[e*c+t]));i&&t.sort(((t,n)=>i(t<0?-a[~t*c+e]:a[e*c+t],n<0?-a[~n*c+e]:a[e*c+n])));for(const r of t)if(r<0){(l[~r*c+e]||(l[~r*c+e]={source:null,target:null})).target={index:e,startAngle:n,endAngle:n+=a[~r*c+e]*d,value:a[~r*c+e]}}else{(l[e*c+r]||(l[e*c+r]={source:null,target:null})).source={index:e,startAngle:n,endAngle:n+=a[e*c+r]*d,value:a[e*c+r]}}h[e]={index:e,startAngle:r,endAngle:n,value:f[e]}}else{const t=na(0,c).filter((t=>a[e*c+t]||a[t*c+e]));i&&t.sort(((t,n)=>i(a[e*c+t],a[e*c+n])));for(const r of t){let t;if(eaa)if(Math.abs(s*u-c*f)>aa&&i){var h=e-o,d=r-a,p=u*u+c*c,g=h*h+d*d,y=Math.sqrt(p),v=Math.sqrt(l),_=i*Math.tan((ia-Math.acos((p+l-g)/(2*y*v)))/2),b=_/v,m=_/y;Math.abs(b-1)>aa&&(this._+="L"+(t+b*f)+","+(n+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+m*u)+","+(this._y1=n+m*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,f=n+u,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>aa||Math.abs(this._y1-f)>aa)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%oa+oa),l>ua?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>aa&&(this._+="A"+e+","+e+",0,"+ +(l>=ia)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var sa=Array.prototype.slice;function la(t){return function(){return t}}function ha(t){return t.source}function da(t){return t.target}function pa(t){return t.radius}function ga(t){return t.startAngle}function ya(t){return t.endAngle}function va(){return 0}function _a(){return 10}function ba(t){var n=ha,e=da,r=pa,i=pa,o=ga,a=ya,u=va,c=null;function f(){var f,s=n.apply(this,arguments),l=e.apply(this,arguments),h=u.apply(this,arguments)/2,d=sa.call(arguments),p=+r.apply(this,(d[0]=s,d)),g=o.apply(this,d)-Ko,y=a.apply(this,d)-Ko,v=+i.apply(this,(d[0]=l,d)),_=o.apply(this,d)-Ko,b=a.apply(this,d)-Ko;if(c||(c=f=fa()),h>ta&&(Vo(y-g)>2*h+ta?y>g?(g+=h,y-=h):(g-=h,y+=h):g=y=(g+y)/2,Vo(b-_)>2*h+ta?b>_?(_+=h,b-=h):(_-=h,b+=h):_=b=(_+b)/2),c.moveTo(p*$o(g),p*Wo(g)),c.arc(0,0,p,g,y),g!==_||y!==b)if(t){var m=+t.apply(this,arguments),x=v-m,w=(_+b)/2;c.quadraticCurveTo(0,0,x*$o(_),x*Wo(_)),c.lineTo(v*$o(w),v*Wo(w)),c.lineTo(x*$o(b),x*Wo(b))}else c.quadraticCurveTo(0,0,v*$o(_),v*Wo(_)),c.arc(0,0,v,_,b);if(c.quadraticCurveTo(0,0,p*$o(g),p*Wo(g)),c.closePath(),f)return c=null,f+""||null}return t&&(f.headRadius=function(n){return arguments.length?(t="function"==typeof n?n:la(+n),f):t}),f.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:la(+t),f):r},f.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:la(+t),f):r},f.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:la(+t),f):i},f.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:la(+t),f):o},f.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:la(+t),f):a},f.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:la(+t),f):u},f.source=function(t){return arguments.length?(n=t,f):n},f.target=function(t){return arguments.length?(e=t,f):e},f.context=function(t){return arguments.length?(c=null==t?null:t,f):c},f}var ma=Array.prototype.slice;function xa(t,n){return t-n}var wa=t=>()=>t;function Ma(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function Ta(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function Sa(){}var Ea=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ka(){var t=1,n=1,e=U,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(xa);else{var r=p(t),i=r[0],a=r[1];n=F(i,a,n),n=Z(Math.floor(i/n)*n,Math.floor(a/n)*n,n)}return n.map((function(n){return o(t,n)}))}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,c,f,s,l,h=new Array,d=new Array;o=u=-1,f=e[0]>=r,Ea[f<<1].forEach(p);for(;++o=r,Ea[c|f<<1].forEach(p);Ea[f<<0].forEach(p);for(;++u=r,s=e[u*t]>=r,Ea[f<<1|s<<2].forEach(p);++o=r,l=s,s=e[u*t+o+1]>=r,Ea[c|f<<1|s<<2|l<<3].forEach(p);Ea[f|s<<3].forEach(p)}o=-1,s=e[u*t]>=r,Ea[s<<2].forEach(p);for(;++o=r,Ea[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],c=[t[1][0]+o,t[1][1]+u],f=a(r),s=a(c);(n=d[f])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[f])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=f]=n):h[f]=d[s]={start:f,end:s,ring:[r,c]}}Ea[s<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var n,e=0,r=o.length;e0&&a0&&u=0&&o>=0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?wa(ma.call(t)):wa(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:Sa,i):r===u},i}function Na(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[u-o+a*r]),n.data[u-e+a*r]=c/Math.min(u+1,r-1+o-u,o))}function Ca(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=c/Math.min(u+1,i-1+o-u,o))}function Pa(t){return t[0]}function za(t){return t[1]}function Da(){return 1}const qa=Math.pow(2,-52),Ra=new Uint32Array(512);class Fa{static from(t,n=Ha,e=Xa){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const e=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*e),this._halfedges=new Int32Array(3*e),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:e,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,c=-1/0,f=-1/0;for(let n=0;nc&&(c=e),r>f&&(f=r),this._ids[n]=n}const s=(a+c)/2,l=(u+f)/2;let h,d,p,g=1/0;for(let n=0;n0&&(d=n,g=e)}let _=t[2*d],b=t[2*d+1],m=1/0;for(let n=0;nr&&(n[e++]=i,r=this._dists[i])}return this.hull=n.subarray(0,e),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Ia(y,v,_,b,x,w)){const t=d,n=_,e=b;d=p,_=x,b=w,p=t,x=n,w=e}const M=function(t,n,e,r,i,o){const a=e-t,u=r-n,c=i-t,f=o-n,s=a*a+u*u,l=c*c+f*f,h=.5/(a*f-u*c);return{x:t+(f*s-u*l)*h,y:n+(a*l-c*s)*h}}(y,v,_,b,x,w);this._cx=M.x,this._cy=M.y;for(let n=0;n0&&Math.abs(f-o)<=qa&&Math.abs(s-a)<=qa)continue;if(o=f,a=s,c===h||c===d||c===p)continue;let l=0;for(let t=0,n=this._hashKey(f,s);t0?3-e:1+e)/4}(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:e,coords:r}=this;let i=0,o=0;for(;;){const a=e[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=Ra[--i];continue}const c=a-a%3,f=u+(t+1)%3,s=c+(a+2)%3,l=n[o],h=n[t],d=n[f],p=n[s];if(Ba(r[2*l],r[2*l+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=l;const r=e[s];if(-1===r){let n=this._hullStart;do{if(this._hullTri[n]===s){this._hullTri[n]=t;break}n=this._hullPrev[n]}while(n!==this._hullStart)}this._link(t,r),this._link(a,e[o]),this._link(o,s);const u=c+(a+1)%3;i=33306690738754716e-32*Math.abs(a+u)?a-u:0}function Ia(t,n,e,r,i,o){return(Ua(i,o,t,n,e,r)||Ua(t,n,e,r,i,o)||Ua(e,r,i,o,t,n))<0}function Ba(t,n,e,r,i,o,a,u){const c=t-a,f=n-u,s=e-a,l=r-u,h=i-a,d=o-u,p=s*s+l*l,g=h*h+d*d;return c*(l*g-p*d)-f*(s*g-p*h)+(c*c+f*f)*(s*d-l*h)<0}function Ya(t,n,e,r,i,o){const a=e-t,u=r-n,c=i-t,f=o-n,s=a*a+u*u,l=c*c+f*f,h=.5/(a*f-u*c),d=(f*s-u*l)*h,p=(a*l-c*s)*h;return d*d+p*p}function La(t,n,e,r){if(r-e<=20)for(let i=e+1;i<=r;i++){const r=t[i],o=n[r];let a=i-1;for(;a>=e&&n[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=e+1,o=r;ja(t,e+r>>1,i),n[t[e]]>n[t[r]]&&ja(t,e,r),n[t[i]]>n[t[r]]&&ja(t,i,r),n[t[e]]>n[t[i]]&&ja(t,e,i);const a=t[i],u=n[a];for(;;){do{i++}while(n[t[i]]u);if(o=o-e?(La(t,n,i,r),La(t,n,e,o-1)):(La(t,n,e,o-1),La(t,n,i,r))}}function ja(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function Ha(t){return t[0]}function Xa(t){return t[1]}const Ga=1e-6;class Va{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,e){const r=(t=+t)+(e=+e),i=n=+n;if(e<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Ga||Math.abs(this._y1-i)>Ga)&&(this._+="L"+r+","+i),e&&(this._+=`A${e},${e},0,1,1,${t-e},${n}A${e},${e},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,n,e,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+e}v${+r}h${-e}Z`}value(){return this._||null}}class $a{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class Wa{constructor(t,[n,e,r,i]=[0,0,960,500]){if(!((r=+r)>=(n=+n)&&(i=+i)>=(e=+e)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=n,this.ymax=i,this.ymin=e,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:e},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,e.length/3*2);for(let n,r,o=0,a=0,u=e.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(n>=this.ymax)return null;(i=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/e)this.xmax?2:0)|(nthis.ymax?8:0)}}const Za=2*Math.PI,Ka=Math.pow;function Qa(t){return t[0]}function Ja(t){return t[1]}function tu(t,n,e){return[t+Math.sin(t+n)*e,n+Math.cos(t-n)*e]}class nu{static from(t,n=Qa,e=Ja,r){return new nu("length"in t?function(t,n,e,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:n,coords:e}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},((t,n)=>n)).sort(((t,e)=>n[2*t]-n[2*e]||n[2*t+1]-n[2*e+1]));const t=this.collinear[0],e=this.collinear[this.collinear.length-1],r=[n[2*t],n[2*t+1],n[2*e],n[2*e+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,e=n.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(t){return new Wa(this,t)}*neighbors(t){const{inedges:n,hull:e,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const n=a.indexOf(t);return n>0&&(yield a[n-1]),void(n=0&&i!==e&&i!==r;)e=i;return i}_step(t,n,e){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:c}=this;if(-1===r[t]||!c.length)return(t+1)%(c.length>>1);let f=t,s=Ka(n-c[2*t],2)+Ka(e-c[2*t+1],2);const l=r[t];let h=l;do{let r=u[h];const l=Ka(n-c[2*r],2)+Ka(e-c[2*r+1],2);if(l9999?"+"+au(t,6):au(t,4)}(t.getUTCFullYear())+"-"+au(t.getUTCMonth()+1,2)+"-"+au(t.getUTCDate(),2)+(i?"T"+au(n,2)+":"+au(e,2)+":"+au(r,2)+"."+au(i,3)+"Z":r?"T"+au(n,2)+":"+au(e,2)+":"+au(r,2)+"Z":e||n?"T"+au(n,2)+":"+au(e,2)+"Z":"")}function cu(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,c=o<=0,f=!1;function s(){if(c)return ru;if(f)return f=!1,eu;var n,r,i=a;if(34===t.charCodeAt(i)){for(;a++=o?c=!0:10===(r=t.charCodeAt(a++))?f=!0:13===r&&(f=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;aNu(n,e).then((n=>(new DOMParser).parseFromString(n,t)))}var Ru=qu("application/xml"),Fu=qu("text/html"),Ou=qu("image/svg+xml");function Uu(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,c,f,s,l,h,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function Iu(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Bu(t){return t[0]}function Yu(t){return t[1]}function Lu(t,n,e){var r=new ju(null==n?Bu:n,null==e?Yu:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ju(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Hu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Xu=Lu.prototype=ju.prototype;function Gu(t){return function(){return t}}function Vu(t){return 1e-6*(t()-.5)}function $u(t){return t.x+t.vx}function Wu(t){return t.y+t.vy}function Zu(t){return t.index}function Ku(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}Xu.copy=function(){var t,n,e=new ju(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Hu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Hu(n));return e},Xu.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return Uu(this.cover(n,e),n,e,t)},Xu.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=c.y0)>d||(a=c.x1)=v)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,g.data),b=n-+this._y.call(null,g.data),m=_*_+b*b;if(m=(u=(p+y)/2))?p=u:y=u,(s=a>=(c=(g+v)/2))?g=c:v=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Xu.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function rc(t){return(t=ec(Math.abs(t)))?t[1]:NaN}var ic,oc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ac(t){if(!(n=oc.exec(t)))throw new Error("invalid format: "+t);var n;return new uc({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 uc(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function cc(t,n){var e=ec(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ac.prototype=uc.prototype,uc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var fc={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>cc(100*t,n),r:cc,s:function(t,n){var e=ec(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ic=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ec(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sc(t){return t}var lc,hc=Array.prototype.map,dc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pc(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?sc:(n=hc.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?sc:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(hc.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var n=(t=ac(t)).fill,e=t.align,l=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,v=t.trim,_=t.type;"n"===_?(g=!0,_="g"):fc[_]||(void 0===y&&(y=12),v=!0,_="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",m="$"===h?o:/[%p]/.test(_)?c:"",x=fc[_],w=/[defgprs%]/.test(_);function M(t){var i,o,c,h=b,M=m;if("c"===_)M=x(t)+M,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),y),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),A&&0==+t&&"+"!==l&&(A=!1),h=(A?"("===l?l:f:"-"===l||"("===l?"":l)+h,M=("s"===_?dc[8+ic/3]:"")+M+(A&&"("===l?")":""),w)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=h.length+t.length+M.length,S=T>1)+h+t+M+S.slice(T);break;default:t=S+h+t+M}return u(t)}return y=void 0===y?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,n){var e=l(((t=ac(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(rc(n)/3))),i=Math.pow(10,-r),o=dc[8+r/3];return function(t){return e(i*t)+o}}}}function gc(n){return lc=pc(n),t.format=lc.format,t.formatPrefix=lc.formatPrefix,lc}function yc(t){return Math.max(0,-rc(Math.abs(t)))}function vc(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(rc(n)/3)))-rc(Math.abs(t)))}function _c(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,rc(n)-rc(t))+1}t.format=void 0,t.formatPrefix=void 0,gc({thousands:",",grouping:[3],currency:["$",""]});var bc=1e-6,mc=1e-12,xc=Math.PI,wc=xc/2,Mc=xc/4,Ac=2*xc,Tc=180/xc,Sc=xc/180,Ec=Math.abs,kc=Math.atan,Nc=Math.atan2,Cc=Math.cos,Pc=Math.ceil,zc=Math.exp,Dc=Math.hypot,qc=Math.log,Rc=Math.pow,Fc=Math.sin,Oc=Math.sign||function(t){return t>0?1:t<0?-1:0},Uc=Math.sqrt,Ic=Math.tan;function Bc(t){return t>1?0:t<-1?xc:Math.acos(t)}function Yc(t){return t>1?wc:t<-1?-wc:Math.asin(t)}function Lc(t){return(t=Fc(t/2))*t}function jc(){}function Hc(t,n){t&&Gc.hasOwnProperty(t.type)&&Gc[t.type](t,n)}var Xc={Feature:function(t,n){Hc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Cc(n=(n*=Sc)/2+Mc),a=Fc(n),u=tf*a,c=Jc*o+u*Cc(i),f=u*r*Fc(i);df.add(Nc(f,c)),Qc=t,Jc=o,tf=a}function mf(t){return[Nc(t[1],t[0]),Yc(t[2])]}function xf(t){var n=t[0],e=t[1],r=Cc(e);return[r*Cc(n),r*Fc(n),Fc(e)]}function wf(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Mf(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Af(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Tf(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Sf(t){var n=Uc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var Ef,kf,Nf,Cf,Pf,zf,Df,qf,Rf,Ff,Of,Uf,If,Bf,Yf,Lf,jf={point:Hf,lineStart:Gf,lineEnd:Vf,polygonStart:function(){jf.point=$f,jf.lineStart=Wf,jf.lineEnd=Zf,sf=new g,gf.polygonStart()},polygonEnd:function(){gf.polygonEnd(),jf.point=Hf,jf.lineStart=Gf,jf.lineEnd=Vf,df<0?(nf=-(rf=180),ef=-(of=90)):sf>bc?of=90:sf<-1e-6&&(ef=-90),hf[0]=nf,hf[1]=rf},sphere:function(){nf=-(rf=180),ef=-(of=90)}};function Hf(t,n){lf.push(hf=[nf=t,rf=t]),nof&&(of=n)}function Xf(t,n){var e=xf([t*Sc,n*Sc]);if(ff){var r=Mf(ff,e),i=Mf([r[1],-r[0],0],r);Sf(i),i=mf(i);var o,a=t-af,u=a>0?1:-1,c=i[0]*Tc*u,f=Ec(a)>180;f^(u*afof&&(of=o):f^(u*af<(c=(c+360)%360-180)&&cof&&(of=n)),f?tKf(nf,rf)&&(rf=t):Kf(t,rf)>Kf(nf,rf)&&(nf=t):rf>=nf?(trf&&(rf=t)):t>af?Kf(nf,t)>Kf(nf,rf)&&(rf=t):Kf(t,rf)>Kf(nf,rf)&&(nf=t)}else lf.push(hf=[nf=t,rf=t]);nof&&(of=n),ff=e,af=t}function Gf(){jf.point=Xf}function Vf(){hf[0]=nf,hf[1]=rf,jf.point=Hf,ff=null}function $f(t,n){if(ff){var e=t-af;sf.add(Ec(e)>180?e+(e>0?360:-360):e)}else uf=t,cf=n;gf.point(t,n),Xf(t,n)}function Wf(){gf.lineStart()}function Zf(){$f(uf,cf),gf.lineEnd(),Ec(sf)>bc&&(nf=-(rf=180)),hf[0]=nf,hf[1]=rf,ff=null}function Kf(t,n){return(n-=t)<0?n+360:n}function Qf(t,n){return t[0]-n[0]}function Jf(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nxc?t+Math.round(-t/Ac)*Ac:t,n]}function ps(t,n,e){return(t%=Ac)?n||e?hs(ys(t),vs(n,e)):ys(t):n||e?vs(n,e):ds}function gs(t){return function(n,e){return[(n+=t)>xc?n-Ac:n<-xc?n+Ac:n,e]}}function ys(t){var n=gs(t);return n.invert=gs(-t),n}function vs(t,n){var e=Cc(t),r=Fc(t),i=Cc(n),o=Fc(n);function a(t,n){var a=Cc(n),u=Cc(t)*a,c=Fc(t)*a,f=Fc(n),s=f*e+u*r;return[Nc(c*i-s*o,u*e-f*r),Yc(s*i+c*o)]}return a.invert=function(t,n){var a=Cc(n),u=Cc(t)*a,c=Fc(t)*a,f=Fc(n),s=f*i-c*o;return[Nc(c*i+f*o,u*e+s*r),Yc(s*e-u*r)]},a}function _s(t){function n(n){return(n=t(n[0]*Sc,n[1]*Sc))[0]*=Tc,n[1]*=Tc,n}return t=ps(t[0]*Sc,t[1]*Sc,t.length>2?t[2]*Sc:0),n.invert=function(n){return(n=t.invert(n[0]*Sc,n[1]*Sc))[0]*=Tc,n[1]*=Tc,n},n}function bs(t,n,e,r,i,o){if(e){var a=Cc(n),u=Fc(n),c=r*e;null==i?(i=n+r*Ac,o=n-c/2):(i=ms(a,i),o=ms(a,o),(r>0?io)&&(i+=r*Ac));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function ws(t,n){return Ec(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function Ts(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,E=S*T,k=E>xc,N=v*M;if(c.add(Nc(N*S*Fc(E),_*A+N*Cc(E))),a+=k?T+S*Ac:T,k^p>=e^x>=e){var C=Mf(xf(d),xf(m));Sf(C);var P=Mf(o,C);Sf(P);var z=(k^T>=0?-1:1)*Yc(P[2]);(r>z||r===z&&(C[0]||C[1]))&&(u+=k^T>=0?1:-1)}}return(a<-1e-6||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Ns))}return h}}function Ns(t){return t.length>1}function Cs(t,n){return((t=t.x)[0]<0?t[1]-wc-bc:wc-t[1])-((n=n.x)[0]<0?n[1]-wc-bc:wc-n[1])}ds.invert=ds;var Ps=ks((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?xc:-xc,c=Ec(o-e);Ec(c-xc)0?wc:-wc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=xc&&(Ec(e-i)bc?kc((Fc(n)*(o=Cc(r))*Fc(e)-Fc(r)*(i=Cc(n))*Fc(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*wc,r.point(-xc,i),r.point(0,i),r.point(xc,i),r.point(xc,0),r.point(xc,-i),r.point(0,-i),r.point(-xc,-i),r.point(-xc,0),r.point(-xc,i);else if(Ec(t[0]-n[0])>bc){var o=t[0]0,i=Ec(n)>bc;function o(t,e){return Cc(t)*Cc(e)>n}function a(t,e,r){var i=[1,0,0],o=Mf(xf(t),xf(e)),a=wf(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var f=n*a/c,s=-n*u/c,l=Mf(i,o),h=Tf(i,f);Af(h,Tf(o,s));var d=l,p=wf(h,d),g=wf(d,d),y=p*p-g*(wf(h,h)-1);if(!(y<0)){var v=Uc(y),_=Tf(d,(-p-v)/g);if(Af(_,h),_=mf(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x0^_[1]<(Ec(_[0]-m)xc^(m<=_[0]&&_[0]<=x)){var S=Tf(d,(-p+v)/g);return Af(S,h),[_,mf(S)]}}}function u(n,e){var i=r?t:xc-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return ks(o,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],g=o(l,h),y=r?g?0:u(l,h):g?u(l+(l<0?xc:-xc),h):0;if(!n&&(f=c=g)&&t.lineStart(),g!==c&&(!(d=a(n,p))||ws(n,d)||ws(p,d))&&(p[2]=1),g!==c)s=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1],2),t.lineEnd()),n=d;else if(i&&n&&r^g){var v;y&e||!(v=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||n&&ws(n,p)||t.point(p[0],p[1]),n=p,c=g,e=y},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,o){bs(o,t,e,i,n,r)}),r?[0,-t]:[-xc,t-xc])}var Ds,qs,Rs,Fs,Os=1e9,Us=-Os;function Is(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,f){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||c(i,o)<0^u>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else f.point(o[0],o[1])}function a(r,i){return Ec(r[0]-t)0?0:3:Ec(r[0]-e)0?2:1:Ec(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,f,s,l,h,d,p,g,y,v,_,b=a,m=xs(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]);v=!0,y=!1,p=g=NaN},lineEnd:function(){c&&(M(l,h),d&&y&&m.rejoin(),c.push(m.result()));x.point=w,y&&b.lineEnd()},polygonStart:function(){b=m,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(c=V(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&As(c,u,n,o,a),a.polygonEnd());b=a,c=f=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(f&&s.push([o,a]),v)l=o,h=a,d=u,v=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&y)b.point(o,a);else{var c=[p=Math.max(Us,Math.min(Os,p)),g=Math.max(Us,Math.min(Os,g))],m=[o=Math.max(Us,Math.min(Os,o)),a=Math.max(Us,Math.min(Os,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=n[0]-u,h=n[1]-c;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(n[0]=u+s*l,n[1]=c+s*h),!0}}}}}(c,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(y||(b.lineStart(),b.point(c[0],c[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,g=a,y=u}return x}}var Bs={sphere:jc,point:jc,lineStart:function(){Bs.point=Ls,Bs.lineEnd=Ys},lineEnd:jc,polygonStart:jc,polygonEnd:jc};function Ys(){Bs.point=Bs.lineEnd=jc}function Ls(t,n){qs=t*=Sc,Rs=Fc(n*=Sc),Fs=Cc(n),Bs.point=js}function js(t,n){t*=Sc;var e=Fc(n*=Sc),r=Cc(n),i=Ec(t-qs),o=Cc(i),a=r*Fc(i),u=Fs*e-Rs*r*o,c=Rs*e+Fs*r*o;Ds.add(Nc(Uc(a*a+u*u),c)),qs=t,Rs=e,Fs=r}function Hs(t){return Ds=new g,Wc(t,Bs),+Ds}var Xs=[null,null],Gs={type:"LineString",coordinates:Xs};function Vs(t,n){return Xs[0]=t,Xs[1]=n,Hs(Gs)}var $s={Feature:function(t,n){return Zs(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=Vs(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))bc})).map(c)).concat(Z(Pc(o/d)*d,i,d).filter((function(t){return Ec(t%g)>bc})).map(f))}return v.lines=function(){return _().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),v.precision(y)):[[r,u],[e,a]]},v.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),v.precision(y)):[[n,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(y=+h,c=el(o,i,90),f=rl(n,t,y),s=el(u,a,90),l=rl(r,e,y),v):y},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var ol,al,ul,cl,fl=t=>t,sl=new g,ll=new g,hl={point:jc,lineStart:jc,lineEnd:jc,polygonStart:function(){hl.lineStart=dl,hl.lineEnd=yl},polygonEnd:function(){hl.lineStart=hl.lineEnd=hl.point=jc,sl.add(Ec(ll)),ll=new g},result:function(){var t=sl/2;return sl=new g,t}};function dl(){hl.point=pl}function pl(t,n){hl.point=gl,ol=ul=t,al=cl=n}function gl(t,n){ll.add(cl*t-ul*n),ul=t,cl=n}function yl(){gl(ol,al)}var vl=1/0,_l=vl,bl=-vl,ml=bl,xl={point:function(t,n){tbl&&(bl=t);n<_l&&(_l=n);n>ml&&(ml=n)},lineStart:jc,lineEnd:jc,polygonStart:jc,polygonEnd:jc,result:function(){var t=[[vl,_l],[bl,ml]];return bl=ml=-(_l=vl=1/0),t}};var wl,Ml,Al,Tl,Sl=0,El=0,kl=0,Nl=0,Cl=0,Pl=0,zl=0,Dl=0,ql=0,Rl={point:Fl,lineStart:Ol,lineEnd:Bl,polygonStart:function(){Rl.lineStart=Yl,Rl.lineEnd=Ll},polygonEnd:function(){Rl.point=Fl,Rl.lineStart=Ol,Rl.lineEnd=Bl},result:function(){var t=ql?[zl/ql,Dl/ql]:Pl?[Nl/Pl,Cl/Pl]:kl?[Sl/kl,El/kl]:[NaN,NaN];return Sl=El=kl=Nl=Cl=Pl=zl=Dl=ql=0,t}};function Fl(t,n){Sl+=t,El+=n,++kl}function Ol(){Rl.point=Ul}function Ul(t,n){Rl.point=Il,Fl(Al=t,Tl=n)}function Il(t,n){var e=t-Al,r=n-Tl,i=Uc(e*e+r*r);Nl+=i*(Al+t)/2,Cl+=i*(Tl+n)/2,Pl+=i,Fl(Al=t,Tl=n)}function Bl(){Rl.point=Fl}function Yl(){Rl.point=jl}function Ll(){Hl(wl,Ml)}function jl(t,n){Rl.point=Hl,Fl(wl=Al=t,Ml=Tl=n)}function Hl(t,n){var e=t-Al,r=n-Tl,i=Uc(e*e+r*r);Nl+=i*(Al+t)/2,Cl+=i*(Tl+n)/2,Pl+=i,zl+=(i=Tl*t-Al*n)*(Al+t),Dl+=i*(Tl+n),ql+=3*i,Fl(Al=t,Tl=n)}function Xl(t){this._context=t}Xl.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Ac)}},result:jc};var Gl,Vl,$l,Wl,Zl,Kl=new g,Ql={point:jc,lineStart:function(){Ql.point=Jl},lineEnd:function(){Gl&&th(Vl,$l),Ql.point=jc},polygonStart:function(){Gl=!0},polygonEnd:function(){Gl=null},result:function(){var t=+Kl;return Kl=new g,t}};function Jl(t,n){Ql.point=th,Vl=Wl=t,$l=Zl=n}function th(t,n){Wl-=t,Zl-=n,Kl.add(Uc(Wl*Wl+Zl*Zl)),Wl=t,Zl=n}function nh(){this._string=[]}function eh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function rh(t){return function(n){var e=new ih;for(var r in t)e[r]=t[r];return e.stream=n,e}}function ih(){}function oh(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Wc(e,t.stream(xl)),n(xl.result()),null!=r&&t.clipExtent(r),t}function ah(t,n,e){return oh(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])}),e)}function uh(t,n,e){return ah(t,[[0,0],n],e)}function ch(t,n,e){return oh(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])}),e)}function fh(t,n,e){return oh(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])}),e)}nh.prototype={_radius:4.5,_circle:eh(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=eh(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},ih.prototype={constructor:ih,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var sh=Cc(30*Sc);function lh(t,n){return+n?function(t,n){function e(r,i,o,a,u,c,f,s,l,h,d,p,g,y){var v=f-r,_=s-i,b=v*v+_*_;if(b>4*n&&g--){var m=a+h,x=u+d,w=c+p,M=Uc(m*m+x*x+w*w),A=Yc(w/=M),T=Ec(Ec(w)-1)n||Ec((v*N+_*C)/b-.5)>.3||a*h+u*d+c*p2?t[2]%360*Sc:0,N()):[y*Tc,v*Tc,_*Tc]},E.angle=function(t){return arguments.length?(b=t%360*Sc,N()):b*Tc},E.reflectX=function(t){return arguments.length?(m=t?-1:1,N()):m<0},E.reflectY=function(t){return arguments.length?(x=t?-1:1,N()):x<0},E.precision=function(t){return arguments.length?(a=lh(u,S=t*t),C()):Uc(S)},E.fitExtent=function(t,n){return ah(E,t,n)},E.fitSize=function(t,n){return uh(E,t,n)},E.fitWidth=function(t,n){return ch(E,t,n)},E.fitHeight=function(t,n){return fh(E,t,n)},function(){return n=t.apply(this,arguments),E.invert=n.invert&&k,N()}}function yh(t){var n=0,e=xc/3,r=gh(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Sc,e=t[1]*Sc):[n*Tc,e*Tc]},i}function vh(t,n){var e=Fc(t),r=(e+Fc(n))/2;if(Ec(r)0?n<-wc+bc&&(n=-wc+bc):n>wc-bc&&(n=wc-bc);var e=i/Rc(Sh(n),r);return[e*Fc(r*t),i-e*Cc(r*t)]}return o.invert=function(t,n){var e=i-n,o=Oc(r)*Uc(t*t+e*e),a=Nc(t,Ec(e))*Oc(e);return e*r<0&&(a-=xc*Oc(t)*Oc(e)),[a/r,2*kc(Rc(i/o,1/r))-wc]},o}function kh(t,n){return[t,n]}function Nh(t,n){var e=Cc(t),r=t===n?Fc(t):(e-Cc(n))/(n-t),i=e/r+t;if(Ec(r)=0;)n+=e[r].value;else n=1;t.value=n}function Xh(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=Vh)):void 0===n&&(n=Gh);for(var e,r,i,o,a,u=new Zh(t),c=[u];e=c.pop();)if((i=n(e.data))&&(a=(i=Array.from(i)).length))for(e.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new Zh(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Wh)}function Gh(t){return t.children}function Vh(t){return Array.isArray(t)?t[1]:null}function $h(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Wh(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Zh(t){this.data=t,this.depth=this.height=0,this.parent=null}function Kh(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(Array.from(t))).length,o=[];r0&&e*e>r*r+i*i}function nd(t,n){for(var e=0;e(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function ad(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function ud(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function cd(t){this._=t,this.next=null,this.previous=null}function fd(t){if(!(i=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,e,r,i,o,a,u,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;od(e,n,r=t[2]),n=new cd(n),e=new cd(e),r=new cd(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;ubc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Uh.invert=xh(Yc),Ih.invert=xh((function(t){return 2*kc(t)})),Bh.invert=function(t,n){return[-n,2*kc(zc(t))-wc]},Zh.prototype=Xh.prototype={constructor:Zh,count:function(){return this.eachAfter(Hh)},each:function(t,n){let e=-1;for(const r of this)t.call(n,r,++e,this);return this},eachAfter:function(t,n){for(var e,r,i,o=this,a=[o],u=[],c=-1;o=a.pop();)if(u.push(o),e=o.children)for(r=0,i=e.length;r=0;--r)o.push(e[r]);return this},find:function(t,n){let e=-1;for(const r of this)if(t.call(n,r,++e,this))return r},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Xh(this).eachBefore($h)},[Symbol.iterator]:function*(){var t,n,e,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,n=i.children)for(e=0,r=n.length;eh&&(h=u),y=s*s*g,(d=Math.max(h/y,y/l))>p){s-=u;break}p=d}v.push(a={value:s,dice:c1?n:1)},e}(Pd);var qd=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?n:1)},e}(Pd);function Rd(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function Fd(t,n){return t[0]-n[0]||t[1]-n[1]}function Od(t){const n=t.length,e=[0,1];let r,i=2;for(r=2;r1&&Rd(t[e[i-2]],t[e[i-1]],t[r])<=0;)--i;e[i++]=r}return e.slice(0,i)}var Ud=Math.random,Id=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(Ud),Bd=function t(n){function e(t,e){return arguments.length<2&&(e=t,t=0),t=Math.floor(t),e=Math.floor(e)-t,function(){return Math.floor(n()*e+t)}}return e.source=t,e}(Ud),Yd=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(Ud),Ld=function t(n){var e=Yd.source(n);function r(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(Ud),jd=function t(n){function e(t){return(t=+t)<=0?()=>0:function(){for(var e=0,r=t;r>1;--r)e+=n();return e+r*n()}}return e.source=t,e}(Ud),Hd=function t(n){var e=jd.source(n);function r(t){if(0==(t=+t))return n;var r=e(t);return function(){return r()/t}}return r.source=t,r}(Ud),Xd=function t(n){function e(t){return function(){return-Math.log1p(-n())/t}}return e.source=t,e}(Ud),Gd=function t(n){function e(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-n(),t)}}return e.source=t,e}(Ud),Vd=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+t)}}return e.source=t,e}(Ud),$d=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-n())/t)})}return e.source=t,e}(Ud),Wd=function t(n){var e=Yd.source(n)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-n())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(n(),1/t):()=>1;return function(){do{do{var t=e(),u=1+o*t}while(u<=0);u*=u*u;var c=1-n()}while(c>=1-.0331*t*t*t*t&&Math.log(c)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(Ud),Zd=function t(n){var e=Wd.source(n);function r(t,n){var r=e(t),i=e(n);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(Ud),Kd=function t(n){var e=$d.source(n),r=Zd.source(n);function i(t,n){return t=+t,(n=+n)>=1?()=>t:n<=0?()=>0:function(){for(var i=0,o=t,a=n;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),c=r(u,o-u+1)();c<=a?(i+=u,o-=u,a=(a-c)/(1-c)):(o=u-1,a/=c)}for(var f=a<.5,s=e(f?a:1-a),l=s(),h=0;l<=o;++h)l+=s();return i+(f?h:o-h)}}return i.source=t,i}(Ud),Qd=function t(n){function e(t,e,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=n=>Math.pow(n,t)),e=null==e?0:+e,r=null==r?1:+r,function(){return e+r*i(-Math.log1p(-n()))}}return e.source=t,e}(Ud),Jd=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){return t+e*Math.tan(Math.PI*n())}}return e.source=t,e}(Ud),tp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){var r=n();return t+e*Math.log(r/(1-r))}}return e.source=t,e}(Ud),np=function t(n){var e=Wd.source(n),r=Kd.source(n);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=e(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var c=-Math.log1p(-n()),f=0;c<=o;++f)c-=Math.log1p(-n());return i+f}}return i.source=t,i}(Ud);const ep=1/4294967296;function rp(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function ip(t,n){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof n?this.interpolator(n):this.range(n)}return this}const op=Symbol("implicit");function ap(){var t=new Map,n=[],e=[],r=op;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==op)return r;t.set(o,a=n.push(i))}return e[(a-1)%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new Map;for(const r of e){const e=r+"";t.has(e)||t.set(e,n.push(r))}return i},i.range=function(t){return arguments.length?(e=Array.from(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return ap(n,e).unknown(r)},rp.apply(i,arguments),i}function up(){var t,n,e=ap().unknown(void 0),r=e.domain,i=e.range,o=0,a=1,u=!1,c=0,f=0,s=.5;function l(){var e=r().length,l=an&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(a[0],a[t-1])),r=t>2?pp:dp,i=o=null,l}function l(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,c)))(t(f(n)))}return l.invert=function(e){return f(n((o||(o=r(u,a.map(t),_r)))(e)))},l.domain=function(t){return arguments.length?(a=Array.from(t,fp),s()):a.slice()},l.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},l.rangeRound=function(t){return u=Array.from(t),c=Ar,s()},l.clamp=function(t){return arguments.length?(f=!!t||lp,s()):f!==lp},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function vp(){return yp()(lp,lp)}function _p(n,e,r,i){var o,a=F(n,e,r);switch((i=ac(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=vc(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=_c(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=yc(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function bp(t){var n=t.domain;return t.ticks=function(t){var e=n();return q(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return _p(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,c=o[a],f=o[u],s=10;for(f0;){if((i=R(c,f,e))===r)return o[a]=c,o[u]=f,n(o);if(i>0)c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i}r=i}return t},t}function mp(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;h<=d;++h)for(s=1,f=r(h);sc)break;g.push(l)}}else for(;h<=d;++h)for(s=a-1,f=r(h);s>=1;--s)if(!((l=f*s)c)break;g.push(l)}2*g.length0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return Up.setTime(+n),Ip.setTime(+r),t(Up),t(Ip),Math.floor(e(Up,Ip))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Yp=Bp((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));Yp.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Bp((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):Yp:null};var Lp=Yp.range,jp=1e3,Hp=6e4,Xp=36e5,Gp=864e5,Vp=6048e5,$p=Bp((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+n*jp)}),(function(t,n){return(n-t)/jp}),(function(t){return t.getUTCSeconds()})),Wp=$p.range,Zp=Bp((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*jp)}),(function(t,n){t.setTime(+t+n*Hp)}),(function(t,n){return(n-t)/Hp}),(function(t){return t.getMinutes()})),Kp=Zp.range,Qp=Bp((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*jp-t.getMinutes()*Hp)}),(function(t,n){t.setTime(+t+n*Xp)}),(function(t,n){return(n-t)/Xp}),(function(t){return t.getHours()})),Jp=Qp.range,tg=Bp((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Hp)/Gp),(t=>t.getDate()-1)),ng=tg.range;function eg(t){return Bp((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Hp)/Vp}))}var rg=eg(0),ig=eg(1),og=eg(2),ag=eg(3),ug=eg(4),cg=eg(5),fg=eg(6),sg=rg.range,lg=ig.range,hg=og.range,dg=ag.range,pg=ug.range,gg=cg.range,yg=fg.range,vg=Bp((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),_g=vg.range,bg=Bp((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));bg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Bp((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var mg=bg.range,xg=Bp((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*Hp)}),(function(t,n){return(n-t)/Hp}),(function(t){return t.getUTCMinutes()})),wg=xg.range,Mg=Bp((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+n*Xp)}),(function(t,n){return(n-t)/Xp}),(function(t){return t.getUTCHours()})),Ag=Mg.range,Tg=Bp((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/Gp}),(function(t){return t.getUTCDate()-1})),Sg=Tg.range;function Eg(t){return Bp((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/Vp}))}var kg=Eg(0),Ng=Eg(1),Cg=Eg(2),Pg=Eg(3),zg=Eg(4),Dg=Eg(5),qg=Eg(6),Rg=kg.range,Fg=Ng.range,Og=Cg.range,Ug=Pg.range,Ig=zg.range,Bg=Dg.range,Yg=qg.range,Lg=Bp((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),jg=Lg.range,Hg=Bp((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Hg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Bp((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Xg=Hg.range;function Gg(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Vg(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $g(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function Wg(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,f=ry(i),s=iy(i),l=ry(o),h=iy(o),d=ry(a),p=iy(a),g=ry(u),y=iy(u),v=ry(c),_=iy(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Ty,e:Ty,f:Cy,g:Yy,G:jy,H:Sy,I:Ey,j:ky,L:Ny,m:Py,M:zy,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:hv,s:dv,S:Dy,u:qy,U:Ry,V:Oy,w:Uy,W:Iy,x:null,X:null,y:By,Y:Ly,Z:Hy,"%":lv},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Xy,e:Xy,f:Zy,g:uv,G:fv,H:Gy,I:Vy,j:$y,L:Wy,m:Ky,M:Qy,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:hv,s:dv,S:Jy,u:tv,U:nv,V:rv,w:iv,W:ov,x:null,X:null,y:av,Y:cv,Z:sv,"%":lv},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=_.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return A(t,n,e,r)},d:gy,e:gy,f:xy,g:ly,G:sy,H:vy,I:vy,j:yy,L:my,m:py,M:_y,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s.get(r[0].toLowerCase()),e+r[0].length):-1},q:dy,Q:My,s:Ay,S:by,u:ay,U:uy,V:cy,w:oy,W:fy,x:function(t,n,r){return A(t,e,n,r)},X:function(t,n,e){return A(t,r,n,e)},y:ly,Y:sy,Z:hy,"%":wy};function w(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Vg($g(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ng.ceil(r):Ng(r),r=Tg.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Gg($g(o.y,0,1))).getDay(),r=i>4||0===i?ig.ceil(r):ig(r),r=tg.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Vg($g(o.y,0,1)).getUTCDay():Gg($g(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Vg(o)):Gg(o)}}function A(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in Kg?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}var Zg,Kg={"-":"",_:" ",0:"0"},Qg=/^\s*\d+/,Jg=/^%/,ty=/[\\^$*+?|[\]().{}]/g;function ny(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),n])))}function oy(t,n,e){var r=Qg.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function ay(t,n,e){var r=Qg.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function uy(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function cy(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function fy(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function sy(t,n,e){var r=Qg.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function ly(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function hy(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function dy(t,n,e){var r=Qg.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function py(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function gy(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function yy(t,n,e){var r=Qg.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function vy(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function _y(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function by(t,n,e){var r=Qg.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function my(t,n,e){var r=Qg.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function xy(t,n,e){var r=Qg.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function wy(t,n,e){var r=Jg.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function My(t,n,e){var r=Qg.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Ay(t,n,e){var r=Qg.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Ty(t,n){return ny(t.getDate(),n,2)}function Sy(t,n){return ny(t.getHours(),n,2)}function Ey(t,n){return ny(t.getHours()%12||12,n,2)}function ky(t,n){return ny(1+tg.count(bg(t),t),n,3)}function Ny(t,n){return ny(t.getMilliseconds(),n,3)}function Cy(t,n){return Ny(t,n)+"000"}function Py(t,n){return ny(t.getMonth()+1,n,2)}function zy(t,n){return ny(t.getMinutes(),n,2)}function Dy(t,n){return ny(t.getSeconds(),n,2)}function qy(t){var n=t.getDay();return 0===n?7:n}function Ry(t,n){return ny(rg.count(bg(t)-1,t),n,2)}function Fy(t){var n=t.getDay();return n>=4||0===n?ug(t):ug.ceil(t)}function Oy(t,n){return t=Fy(t),ny(ug.count(bg(t),t)+(4===bg(t).getDay()),n,2)}function Uy(t){return t.getDay()}function Iy(t,n){return ny(ig.count(bg(t)-1,t),n,2)}function By(t,n){return ny(t.getFullYear()%100,n,2)}function Yy(t,n){return ny((t=Fy(t)).getFullYear()%100,n,2)}function Ly(t,n){return ny(t.getFullYear()%1e4,n,4)}function jy(t,n){var e=t.getDay();return ny((t=e>=4||0===e?ug(t):ug.ceil(t)).getFullYear()%1e4,n,4)}function Hy(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+ny(n/60|0,"0",2)+ny(n%60,"0",2)}function Xy(t,n){return ny(t.getUTCDate(),n,2)}function Gy(t,n){return ny(t.getUTCHours(),n,2)}function Vy(t,n){return ny(t.getUTCHours()%12||12,n,2)}function $y(t,n){return ny(1+Tg.count(Hg(t),t),n,3)}function Wy(t,n){return ny(t.getUTCMilliseconds(),n,3)}function Zy(t,n){return Wy(t,n)+"000"}function Ky(t,n){return ny(t.getUTCMonth()+1,n,2)}function Qy(t,n){return ny(t.getUTCMinutes(),n,2)}function Jy(t,n){return ny(t.getUTCSeconds(),n,2)}function tv(t){var n=t.getUTCDay();return 0===n?7:n}function nv(t,n){return ny(kg.count(Hg(t)-1,t),n,2)}function ev(t){var n=t.getUTCDay();return n>=4||0===n?zg(t):zg.ceil(t)}function rv(t,n){return t=ev(t),ny(zg.count(Hg(t),t)+(4===Hg(t).getUTCDay()),n,2)}function iv(t){return t.getUTCDay()}function ov(t,n){return ny(Ng.count(Hg(t)-1,t),n,2)}function av(t,n){return ny(t.getUTCFullYear()%100,n,2)}function uv(t,n){return ny((t=ev(t)).getUTCFullYear()%100,n,2)}function cv(t,n){return ny(t.getUTCFullYear()%1e4,n,4)}function fv(t,n){var e=t.getUTCDay();return ny((t=e>=4||0===e?zg(t):zg.ceil(t)).getUTCFullYear()%1e4,n,4)}function sv(){return"+0000"}function lv(){return"%"}function hv(t){return+t}function dv(t){return Math.floor(+t/1e3)}function pv(n){return Zg=Wg(n),t.timeFormat=Zg.format,t.timeParse=Zg.parse,t.utcFormat=Zg.utcFormat,t.utcParse=Zg.utcParse,Zg}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,pv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var gv="%Y-%m-%dT%H:%M:%S.%LZ";var yv=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(gv);var vv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse(gv),_v=1e3,bv=6e4,mv=36e5,xv=864e5,wv=2592e6,Mv=31536e6;function Av(t){return new Date(t)}function Tv(t){return t instanceof Date?+t:+new Date(+t)}function Sv(t,n,r,i,o,a,u,c,f){var s=vp(),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),g=f("%I:%M"),y=f("%I %p"),v=f("%a %d"),_=f("%b %d"),b=f("%B"),m=f("%Y"),x=[[u,1,_v],[u,5,5e3],[u,15,15e3],[u,30,3e4],[a,1,bv],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,mv],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,xv],[i,2,1728e5],[r,1,6048e5],[n,1,wv],[n,3,7776e6],[t,1,Mv]];function w(e){return(u(e)hr(t[t.length-1]),Hv=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(zv),Xv=jv(Hv),Gv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(zv),Vv=jv(Gv),$v=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(zv),Wv=jv($v),Zv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(zv),Kv=jv(Zv),Qv=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(zv),Jv=jv(Qv),t_=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(zv),n_=jv(t_),e_=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(zv),r_=jv(e_),i_=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(zv),o_=jv(i_),a_=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(zv),u_=jv(a_),c_=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(zv),f_=jv(c_),s_=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(zv),l_=jv(s_),h_=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(zv),d_=jv(h_),p_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(zv),g_=jv(p_),y_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(zv),v_=jv(y_),__=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(zv),b_=jv(__),m_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(zv),x_=jv(m_),w_=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(zv),M_=jv(w_),A_=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(zv),T_=jv(A_),S_=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(zv),E_=jv(S_),k_=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(zv),N_=jv(k_),C_=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(zv),P_=jv(C_),z_=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(zv),D_=jv(z_),q_=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(zv),R_=jv(q_),F_=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(zv),O_=jv(F_),U_=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(zv),I_=jv(U_),B_=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(zv),Y_=jv(B_),L_=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(zv),j_=jv(L_);var H_=Lr(tr(300,.5,0),tr(-240,.5,1)),X_=Lr(tr(-100,.75,.35),tr(80,1.5,.8)),G_=Lr(tr(260,.75,.35),tr(80,1.5,.8)),V_=tr();var $_=ve(),W_=Math.PI/3,Z_=2*Math.PI/3;function K_(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Q_=K_(zv("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),J_=K_(zv("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),tb=K_(zv("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),nb=K_(zv("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function eb(t){return function(){return t}}var rb=Math.abs,ib=Math.atan2,ob=Math.cos,ab=Math.max,ub=Math.min,cb=Math.sin,fb=Math.sqrt,sb=1e-12,lb=Math.PI,hb=lb/2,db=2*lb;function pb(t){return t>1?0:t<-1?lb:Math.acos(t)}function gb(t){return t>=1?hb:t<=-1?-hb:Math.asin(t)}function yb(t){return t.innerRadius}function vb(t){return t.outerRadius}function _b(t){return t.startAngle}function bb(t){return t.endAngle}function mb(t){return t&&t.padAngle}function xb(t,n,e,r,i,o,a,u){var c=e-t,f=r-n,s=a-i,l=u-o,h=l*c-s*f;if(!(h*hC*C+P*P&&(A=S,T=E),{cx:A,cy:T,x01:-s,y01:-l,x11:A*(i/x-1),y11:T*(i/x-1)}}var Mb=Array.prototype.slice;function Ab(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Tb(t){this._context=t}function Sb(t){return new Tb(t)}function Eb(t){return t[0]}function kb(t){return t[1]}function Nb(t,n){var e=eb(!0),r=null,i=Sb,o=null;function a(a){var u,c,f,s=(a=Ab(a)).length,l=!1;for(null==r&&(o=i(f=fa())),u=0;u<=s;++u)!(u=s;--l)u.point(y[l],v[l]);u.lineEnd(),u.areaEnd()}g&&(y[f]=+t(h,f,c),v[f]=+n(h,f,c),u.point(r?+r(h,f,c):y[f],e?+e(h,f,c):v[f]))}if(d)return u=null,d+""||null}function f(){return Nb().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Eb:eb(+t),n="function"==typeof n?n:eb(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?kb:eb(+e),c.x=function(n){return arguments.length?(t="function"==typeof n?n:eb(+n),r=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:eb(+n),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:eb(+t),c):r},c.y=function(t){return arguments.length?(n="function"==typeof t?t:eb(+t),e=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:eb(+t),c):n},c.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:eb(+t),c):e},c.lineX0=c.lineY0=function(){return f().x(t).y(n)},c.lineY1=function(){return f().x(t).y(e)},c.lineX1=function(){return f().x(r).y(n)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:eb(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function Pb(t,n){return nt?1:n>=t?0:NaN}function zb(t){return t}Tb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var Db=Rb(Sb);function qb(t){this._curve=t}function Rb(t){function n(n){return new qb(t(n))}return n._curve=t,n}function Fb(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(Rb(t)):n()._curve},t}function Ob(){return Fb(Nb().curve(Db))}function Ub(){var t=Cb().curve(Db),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Fb(e())},delete t.lineX0,t.lineEndAngle=function(){return Fb(r())},delete t.lineX1,t.lineInnerRadius=function(){return Fb(i())},delete t.lineY0,t.lineOuterRadius=function(){return Fb(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(Rb(t)):n()._curve},t}function Ib(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}function Bb(t){return t.source}function Yb(t){return t.target}function Lb(t){var n=Bb,e=Yb,r=Eb,i=kb,o=null;function a(){var a,u=Mb.call(arguments),c=n.apply(this,u),f=e.apply(this,u);if(o||(o=a=fa()),t(o,+r.apply(this,(u[0]=c,u)),+i.apply(this,u),+r.apply(this,(u[0]=f,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:eb(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:eb(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function jb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Hb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function Xb(t,n,e,r,i){var o=Ib(n,e),a=Ib(n,e=(e+i)/2),u=Ib(r,e),c=Ib(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}qb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Gb={draw:function(t,n){var e=Math.sqrt(n/lb);t.moveTo(e,0),t.arc(0,0,e,0,db)}},Vb={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},$b=Math.sqrt(1/3),Wb=2*$b,Zb={draw:function(t,n){var e=Math.sqrt(n/Wb),r=e*$b;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Kb=Math.sin(lb/10)/Math.sin(7*lb/10),Qb=Math.sin(db/10)*Kb,Jb=-Math.cos(db/10)*Kb,tm={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Qb*e,i=Jb*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=db*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*e,-u*e),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},nm={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},em=Math.sqrt(3),rm={draw:function(t,n){var e=-Math.sqrt(n/(3*em));t.moveTo(0,2*e),t.lineTo(-em*e,-e),t.lineTo(em*e,-e),t.closePath()}},im=-.5,om=Math.sqrt(3)/2,am=1/Math.sqrt(12),um=3*(am/2+1),cm={draw:function(t,n){var e=Math.sqrt(n/um),r=e/2,i=e*am,o=r,a=e*am+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(im*r-om*i,om*r+im*i),t.lineTo(im*o-om*a,om*o+im*a),t.lineTo(im*u-om*c,om*u+im*c),t.lineTo(im*r+om*i,im*i-om*r),t.lineTo(im*o+om*a,im*a-om*o),t.lineTo(im*u+om*c,im*c-om*u),t.closePath()}},fm=[Gb,Vb,Zb,nm,tm,rm,cm];function sm(){}function lm(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function hm(t){this._context=t}function dm(t){this._context=t}function pm(t){this._context=t}hm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},dm.prototype={areaStart:sm,areaEnd:sm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:lm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},pm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:lm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};class gm{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}function ym(t,n){this._basis=new hm(t),this._beta=n}ym.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var vm=function t(n){function e(t){return 1===n?new hm(t):new ym(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function _m(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function bm(t,n){this._context=t,this._k=(1-n)/6}bm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:_m(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:_m(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var mm=function t(n){function e(t){return new bm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function xm(t,n){this._context=t,this._k=(1-n)/6}xm.prototype={areaStart:sm,areaEnd:sm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:_m(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var wm=function t(n){function e(t){return new xm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Mm(t,n){this._context=t,this._k=(1-n)/6}Mm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:_m(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Am=function t(n){function e(t){return new Mm(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Tm(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>sb){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>sb){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Sm(t,n){this._context=t,this._alpha=n}Sm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Tm(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Em=function t(n){function e(t){return n?new Sm(t,n):new bm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function km(t,n){this._context=t,this._alpha=n}km.prototype={areaStart:sm,areaEnd:sm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tm(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Nm=function t(n){function e(t){return n?new km(t,n):new xm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Cm(t,n){this._context=t,this._alpha=n}Cm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tm(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Pm=function t(n){function e(t){return n?new Cm(t,n):new Mm(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function zm(t){this._context=t}function Dm(t){return t<0?-1:1}function qm(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Dm(o)+Dm(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Rm(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Fm(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function Om(t){this._context=t}function Um(t){this._context=new Im(t)}function Im(t){this._context=t}function Bm(t){this._context=t}function Ym(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function Xm(t,n){return t[n]}function Gm(t){const n=[];return n.key=t,n}function Vm(t){var n=t.map($m);return Hm(t).sort((function(t,e){return n[t]-n[e]}))}function $m(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function Wm(t){var n=t.map(Zm);return Hm(t).sort((function(t,e){return n[t]-n[e]}))}function Zm(t){for(var n,e=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Km=t=>()=>t;function Qm(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Jm(t,n,e){this.k=t,this.x=n,this.y=e}Jm.prototype={constructor:Jm,scale:function(t){return 1===t?this:new Jm(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Jm(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tx=new Jm(1,0,0);function nx(t){for(;!t.__zoom;)if(!(t=t.parentNode))return tx;return t.__zoom}function ex(t){t.stopImmediatePropagation()}function rx(t){t.preventDefault(),t.stopImmediatePropagation()}function ix(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function ox(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function ax(){return this.__zoom||tx}function ux(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function cx(){return navigator.maxTouchPoints||"ontouchstart"in this}function fx(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}nx.prototype=Jm.prototype,t.Adder=g,t.Delaunay=nu,t.FormatSpecifier=uc,t.InternMap=y,t.InternSet=v,t.Voronoi=Wa,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>1&&e.name===n)return new ji([[t]],_o,n,+r);return null},t.arc=function(){var t=yb,n=vb,e=eb(0),r=null,i=_b,o=bb,a=mb,u=null;function c(){var c,f,s=+t.apply(this,arguments),l=+n.apply(this,arguments),h=i.apply(this,arguments)-hb,d=o.apply(this,arguments)-hb,p=rb(d-h),g=d>h;if(u||(u=c=fa()),lsb)if(p>db-sb)u.moveTo(l*ob(h),l*cb(h)),u.arc(0,0,l,h,d,!g),s>sb&&(u.moveTo(s*ob(d),s*cb(d)),u.arc(0,0,s,d,h,g));else{var y,v,_=h,b=d,m=h,x=d,w=p,M=p,A=a.apply(this,arguments)/2,T=A>sb&&(r?+r.apply(this,arguments):fb(s*s+l*l)),S=ub(rb(l-s)/2,+e.apply(this,arguments)),E=S,k=S;if(T>sb){var N=gb(T/s*cb(A)),C=gb(T/l*cb(A));(w-=2*N)>sb?(m+=N*=g?1:-1,x-=N):(w=0,m=x=(h+d)/2),(M-=2*C)>sb?(_+=C*=g?1:-1,b-=C):(M=0,_=b=(h+d)/2)}var P=l*ob(_),z=l*cb(_),D=s*ob(x),q=s*cb(x);if(S>sb){var R,F=l*ob(b),O=l*cb(b),U=s*ob(m),I=s*cb(m);if(psb?k>sb?(y=wb(U,I,P,z,l,k,g),v=wb(F,O,D,q,l,k,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),ksb&&w>sb?E>sb?(y=wb(D,q,F,O,s,-E,g),v=wb(P,z,U,I,s,-E,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),E>a,f=i+2*u>>a,s=wa(20);function l(r){var i=new Float32Array(c*f),l=new Float32Array(c*f);r.forEach((function(r,o,s){var l=+t(r,o,s)+u>>a,h=+n(r,o,s)+u>>a,d=+e(r,o,s);l>=0&&l=0&&h>a),Ca({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a),Na({width:c,height:f,data:i},{width:c,height:f,data:l},o>>a),Ca({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a),Na({width:c,height:f,data:i},{width:c,height:f,data:l},o>>a),Ca({width:c,height:f,data:l},{width:c,height:f,data:i},o>>a);var d=s(i);if(!Array.isArray(d)){var p=B(i);d=F(0,p,d),(d=Z(0,Math.floor(p/d)*d,d)).shift()}return ka().thresholds(d).size([c,f])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function y(){return c=r+2*(u=3*o)>>a,f=i+2*u>>a,l}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:wa(+n),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:wa(+t),l):n},l.weight=function(t){return arguments.length?(e="function"==typeof t?t:wa(+t),l):e},l.size=function(t){if(!arguments.length)return[r,i];var n=+t[0],e=+t[1];if(!(n>=0&&e>=0))throw new Error("invalid size");return r=n,i=e,y()},l.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),y()},l.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?wa(ma.call(t)):wa(t),l):s},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},l},t.contours=ka,t.count=c,t.create=function(t){return Dn(At(t).call(document.documentElement))},t.creator=At,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),e=(t=t.map(l)).map(f),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(s))return o;for(;;){o.push(i.map(((n,e)=>t[e][n])));let a=r;for(;++i[a]===e[a];){if(0===a)return n?o.map(n):o;i[a--]=0}}},t.csv=Pu,t.csvFormat=hu,t.csvFormatBody=du,t.csvFormatRow=gu,t.csvFormatRows=pu,t.csvFormatValue=yu,t.csvParse=su,t.csvParseRows=lu,t.cubehelix=tr,t.cumsum=function(t,n){var e=0,r=0;return Float64Array.from(t,void 0===n?t=>e+=+t||0:i=>e+=+n(i,r++,t)||0)},t.curveBasis=function(t){return new hm(t)},t.curveBasisClosed=function(t){return new dm(t)},t.curveBasisOpen=function(t){return new pm(t)},t.curveBumpX=function(t){return new gm(t,!0)},t.curveBumpY=function(t){return new gm(t,!1)},t.curveBundle=vm,t.curveCardinal=mm,t.curveCardinalClosed=wm,t.curveCardinalOpen=Am,t.curveCatmullRom=Em,t.curveCatmullRomClosed=Nm,t.curveCatmullRomOpen=Pm,t.curveLinear=Sb,t.curveLinearClosed=function(t){return new zm(t)},t.curveMonotoneX=function(t){return new Om(t)},t.curveMonotoneY=function(t){return new Um(t)},t.curveNatural=function(t){return new Bm(t)},t.curveStep=function(t){return new Lm(t,.5)},t.curveStepAfter=function(t){return new Lm(t,1)},t.curveStepBefore=function(t){return new Lm(t,0)},t.descending=function(t,n){return nt?1:n>=t?0:NaN},t.deviation=d,t.difference=function(t,...n){t=new Set(t);for(const e of n)for(const n of e)t.delete(n);return t},t.disjoint=function(t,n){const e=n[Symbol.iterator](),r=new Set;for(const n of t){if(r.has(n))return!1;let t,i;for(;({value:t,done:i}=e.next())&&!i;){if(Object.is(n,t))return!1;r.add(t)}}return!0},t.dispatch=pt,t.drag=function(){var t,n,e,r,i=Xn,o=Gn,a=Vn,u=$n,c={},f=pt("start","drag","end"),s=0,l=0;function h(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var c=b(this,o.call(this,a,u),a,u,"mouse");c&&(Dn(a.view).on("mousemove.drag",p,!0).on("mouseup.drag",g,!0),Yn(a.view),In(a),e=!1,t=a.clientX,n=a.clientY,c("start",a))}}function p(r){if(Bn(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>l}c.mouse("drag",r)}function g(t){Dn(t.view).on("mousemove.drag mouseup.drag",null),Ln(t.view,e),Bn(t),c.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,u=o.call(this,t,n),c=a.length;for(e=0;e+t,t.easePoly=Ki,t.easePolyIn=Wi,t.easePolyInOut=Ki,t.easePolyOut=Zi,t.easeQuad=Vi,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=Vi,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=to,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*Ji)},t.easeSinInOut=to,t.easeSinOut=function(t){return Math.sin(t*Ji)},t.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(!n(r,++e,t))return!1;return!0},t.extent=p,t.fcumsum=function(t,n){const e=new g;let r=-1;return Float64Array.from(t,void 0===n?t=>e.add(+t||0):i=>e.add(+n(i,++r,t)||0))},t.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const e=[];let r=-1;for(const i of t)n(i,++r,t)&&e.push(i);return e},t.forceCenter=function(t,n){var e,r=1;function i(){var i,o,a=e.length,u=0,c=0;for(i=0;if+p||os+p||ac.index){var g=f-u.x-u.vx,y=s-u.y-u.vy,v=g*g+y*y;vt.r&&(t.r=t[n].r)}function c(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r[u(t,n,r),t])));for(a=0,i=new Array(f);a=u)){(t.data!==n||t.next)&&(0===l&&(p+=(l=Vu(e))*l),0===h&&(p+=(h=Vu(e))*h),p(t=(1664525*t+1013904223)%Qu)/Qu}();function l(){h(),f.call("tick",n),e1?(null==e?u.delete(t):u.set(t,p(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},t.forceX=function(t){var n,e,r,i=Gu(.1);function o(t){for(var i,o=0,a=n.length;o=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++eKf(r[0],r[1])&&(r[1]=i[1]),Kf(i[0],r[1])>Kf(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Kf(r[1],i[0]))>a&&(a=u,nf=i[0],rf=r[1])}return lf=hf=null,nf===1/0||ef===1/0?[[NaN,NaN],[NaN,NaN]]:[[nf,ef],[rf,of]]},t.geoCentroid=function(t){Ef=kf=Nf=Cf=Pf=zf=Df=qf=0,Rf=new g,Ff=new g,Of=new g,Wc(t,ts);var n=+Rf,e=+Ff,r=+Of,i=Dc(n,e,r);return i2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Bh,t.gray=function(t,n){return new Fe(t,0,0,null==n?1:n)},t.greatest=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)>0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r},t.greatestIndex=function(t,e=n){if(1===e.length)return G(t,e);let r,i=-1,o=-1;for(const n of t)++o,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=o);return i},t.group=M,t.groupSort=function(t,e,r){return(1===e.length?k(A(t,e,r),(([t,e],[r,i])=>n(e,i)||n(t,r))):k(M(t,r),(([t,r],[i,o])=>e(r,o)||n(t,i)))).map((([t])=>t))},t.groups=function(t,...n){return S(t,Array.from,w,n)},t.hcl=Le,t.hierarchy=Xh,t.histogram=I,t.hsl=Ae,t.html=Fu,t.image=function(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))},t.index=function(t,...n){return S(t,w,T,n)},t.indexes=function(t,...n){return S(t,Array.from,T,n)},t.interpolate=Mr,t.interpolateArray=function(t,n){return(gr(n)?pr:yr)(t,n)},t.interpolateBasis=rr,t.interpolateBasisClosed=ir,t.interpolateBlues=D_,t.interpolateBrBG=Xv,t.interpolateBuGn=f_,t.interpolateBuPu=l_,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=G_,t.interpolateCubehelix=Yr,t.interpolateCubehelixDefault=H_,t.interpolateCubehelixLong=Lr,t.interpolateDate=vr,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateGnBu=d_,t.interpolateGreens=R_,t.interpolateGreys=O_,t.interpolateHcl=Ur,t.interpolateHclLong=Ir,t.interpolateHsl=Rr,t.interpolateHslLong=Fr,t.interpolateHue=function(t,n){var e=ur(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateInferno=tb,t.interpolateLab=function(t,n){var e=fr((t=Re(t)).l,(n=Re(n)).l),r=fr(t.a,n.a),i=fr(t.b,n.b),o=fr(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateMagma=J_,t.interpolateNumber=_r,t.interpolateNumberArray=pr,t.interpolateObject=br,t.interpolateOrRd=g_,t.interpolateOranges=j_,t.interpolatePRGn=Vv,t.interpolatePiYG=Wv,t.interpolatePlasma=nb,t.interpolatePuBu=b_,t.interpolatePuBuGn=v_,t.interpolatePuOr=Kv,t.interpolatePuRd=x_,t.interpolatePurples=I_,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return V_.h=360*t-100,V_.s=1.5-1.5*n,V_.l=.8-.9*n,V_+""},t.interpolateRdBu=Jv,t.interpolateRdGy=n_,t.interpolateRdPu=M_,t.interpolateRdYlBu=r_,t.interpolateRdYlGn=o_,t.interpolateReds=Y_,t.interpolateRgb=sr,t.interpolateRgbBasis=hr,t.interpolateRgbBasisClosed=dr,t.interpolateRound=Ar,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,$_.r=255*(n=Math.sin(t))*n,$_.g=255*(n=Math.sin(t+W_))*n,$_.b=255*(n=Math.sin(t+Z_))*n,$_+""},t.interpolateSpectral=u_,t.interpolateString=wr,t.interpolateTransformCss=Cr,t.interpolateTransformSvg=Pr,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=Q_,t.interpolateWarm=X_,t.interpolateYlGn=E_,t.interpolateYlGnBu=T_,t.interpolateYlOrBr=N_,t.interpolateYlOrRd=P_,t.interpolateZoom=Dr,t.interrupt=gi,t.intersection=function(t,...n){t=new Set(t),n=n.map(et);t:for(const e of t)for(const r of n)if(!r.has(e)){t.delete(e);continue t}return t},t.interval=function(t,n,e){var r=new ei,i=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?ti():+e,r._restart((function o(a){a+=i,r._restart(o,i+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)},t.isoFormat=yv,t.isoParse=vv,t.json=function(t,n){return fetch(t,n).then(Du)},t.lab=Re,t.lch=function(t,n,e,r){return 1===arguments.length?Ye(t):new je(e,n,t,null==r?1:r)},t.least=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)<0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r},t.leastIndex=K,t.line=Nb,t.lineRadial=Ob,t.linkHorizontal=function(){return Lb(jb)},t.linkRadial=function(){var t=Lb(Xb);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return Lb(Hb)},t.local=Rn,t.map=function(t,n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof n)throw new TypeError("mapper is not a function");return Array.from(t,((e,r)=>n(e,r,t)))},t.matcher=Ct,t.max=B,t.maxIndex=G,t.mean=function(t,n){let e=0,r=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++e,r+=n);else{let i=-1;for(let o of t)null!=(o=n(o,++i,t))&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e},t.median=function(t,n){return H(t,.5,n)},t.merge=V,t.min=Y,t.minIndex=$,t.namespace=xt,t.namespaces=mt,t.nice=O,t.now=ti,t.pack=function(){var t=null,n=1,e=1,r=hd;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(gd(t)).eachAfter(yd(r,.5)).eachBefore(vd(1)):i.eachBefore(gd(pd)).eachAfter(yd(hd,1)).eachAfter(yd(r,i.r/Math.min(n,e))).eachBefore(vd(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=sd(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:dd(+t),i):r},i},t.packEnclose=Kh,t.packSiblings=function(t){return fd(t),t},t.pairs=function(t,n=W){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&bd(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,f=d?(v-h*b)/d:0;u0?l*f:0)+b,g[c]={data:a[c],index:u,value:l,startAngle:y,endAngle:s,padAngle:_};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:eb(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:eb(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:eb(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:eb(+t),a):o},a},t.piecewise=jr,t.pointRadial=Ib,t.pointer=Un,t.pointers=function(t,n){return t.target&&(t=On(t),void 0===n&&(n=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Un(t,n)))},t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eu!=f>u&&a<(c-e)*(u-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[o[n]][2]]);for(n=+u;n(n=1664525*n+1013904223|0,ep*(n>>>0))},t.randomLogNormal=Ld,t.randomLogistic=tp,t.randomNormal=Yd,t.randomPareto=Gd,t.randomPoisson=np,t.randomUniform=Id,t.randomWeibull=Qd,t.range=Z,t.reduce=function(t,n,e){if("function"!=typeof n)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:e}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)e=n(e,o,++a,t);return e},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=ve,t.ribbon=function(){return ba()},t.ribbonArrow=function(){return ba(_a)},t.rollup=A,t.rollups=function(t,n,...e){return S(t,Array.from,n,e)},t.scaleBand=up,t.scaleDiverging=function t(){var n=bp(Cv()(lp));return n.copy=function(){return kv(n,t())},ip.apply(n,arguments)},t.scaleDivergingLog=function t(){var n=Ep(Cv()).domain([.1,1,10]);return n.copy=function(){return kv(n,t()).base(n.base())},ip.apply(n,arguments)},t.scaleDivergingPow=Pv,t.scaleDivergingSqrt=function(){return Pv.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var n=Cp(Cv());return n.copy=function(){return kv(n,t()).constant(n.constant())},ip.apply(n,arguments)},t.scaleIdentity=function t(n){var e;function r(t){return isNaN(t=+t)?e:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,fp),r):n.slice()},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,fp):[0,1],bp(r)},t.scaleImplicit=op,t.scaleLinear=function t(){var n=vp();return n.copy=function(){return gp(n,t())},rp.apply(n,arguments),bp(n)},t.scaleLog=function t(){var n=Ep(yp()).domain([1,10]);return n.copy=function(){return gp(n,t()).base(n.base())},rp.apply(n,arguments),n},t.scaleOrdinal=ap,t.scalePoint=function(){return cp(up.apply(null,arguments).paddingInner(1))},t.scalePow=Rp,t.scaleQuantile=function t(){var e,r=[],i=[],a=[];function u(){var t=0,n=Math.max(1,i.length);for(a=new Array(n-1);++t0?a[n-1]:r[0],n=i?[a[i-1],r]:[a[n-1],a[n]]},c.unknown=function(t){return arguments.length?(n=t,c):c},c.thresholds=function(){return a.slice()},c.copy=function(){return t().domain([e,r]).range(u).unknown(n)},rp.apply(bp(c),arguments)},t.scaleRadial=function t(){var n,e=vp(),r=[0,1],i=!1;function o(t){var r=Op(e(t));return isNaN(r)?n:i?Math.round(r):r}return o.invert=function(t){return e.invert(Fp(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((r=Array.from(t,fp)).map(Fp)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t(e.domain(),r).round(i).clamp(e.clamp()).unknown(n)},rp.apply(o,arguments),bp(o)},t.scaleSequential=function t(){var n=bp(Ev()(lp));return n.copy=function(){return kv(n,t())},ip.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=Ep(Ev()).domain([1,10]);return n.copy=function(){return kv(n,t()).base(n.base())},ip.apply(n,arguments)},t.scaleSequentialPow=Nv,t.scaleSequentialQuantile=function t(){var e=[],r=lp;function i(t){if(!isNaN(t=+t))return r((o(e,t,1)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(n),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return e.map(((t,n)=>r(n/(e.length-1))))},i.quantiles=function(t){return Array.from({length:t+1},((n,r)=>H(e,r/t)))},i.copy=function(){return t(r).domain(e)},ip.apply(i,arguments)},t.scaleSequentialSqrt=function(){return Nv.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=Cp(Ev());return n.copy=function(){return kv(n,t()).constant(n.constant())},ip.apply(n,arguments)},t.scaleSqrt=function(){return Rp.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var n=Cp(yp());return n.copy=function(){return gp(n,t()).constant(n.constant())},rp.apply(n,arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function a(t){return t<=t?r[o(e,t,0,i)]:n}return a.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),a):e.slice()},a.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),a):r.slice()},a.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},a.unknown=function(t){return arguments.length?(n=t,a):n},a.copy=function(){return t().domain(e).range(r).unknown(n)},rp.apply(a,arguments)},t.scaleTime=function(){return rp.apply(Sv(bg,vg,rg,tg,Qp,Zp,$p,Yp,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return rp.apply(Sv(Hg,Lg,kg,Tg,Mg,xg,$p,Yp,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,n){const e=K(t,n);return e<0?void 0:e},t.schemeAccent=qv,t.schemeBlues=z_,t.schemeBrBG=Hv,t.schemeBuGn=c_,t.schemeBuPu=s_,t.schemeCategory10=Dv,t.schemeDark2=Rv,t.schemeGnBu=h_,t.schemeGreens=q_,t.schemeGreys=F_,t.schemeOrRd=p_,t.schemeOranges=L_,t.schemePRGn=Gv,t.schemePaired=Fv,t.schemePastel1=Ov,t.schemePastel2=Uv,t.schemePiYG=$v,t.schemePuBu=__,t.schemePuBuGn=y_,t.schemePuOr=Zv,t.schemePuRd=m_,t.schemePurples=U_,t.schemeRdBu=Qv,t.schemeRdGy=t_,t.schemeRdPu=w_,t.schemeRdYlBu=e_,t.schemeRdYlGn=i_,t.schemeReds=B_,t.schemeSet1=Iv,t.schemeSet2=Bv,t.schemeSet3=Yv,t.schemeSpectral=a_,t.schemeTableau10=Lv,t.schemeYlGn=S_,t.schemeYlGnBu=A_,t.schemeYlOrBr=k_,t.schemeYlOrRd=C_,t.select=Dn,t.selectAll=function(t){return"string"==typeof t?new Pn([document.querySelectorAll(t)],[document.documentElement]):new Pn([null==t?[]:Et(t)],Cn)},t.selection=zn,t.selector=St,t.selectorAll=Nt,t.shuffle=Q,t.shuffler=J,t.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(n(r,++e,t))return!0;return!1},t.sort=k,t.stack=function(){var t=eb([]),n=Hm,e=jm,r=Xm;function i(i){var o,a,u=Array.from(t.apply(this,arguments),Gm),c=u.length,f=-1;for(const t of i)for(o=0,++f;o0)for(var e,r,i,o,a,u,c=0,f=t[n[0]].length;c0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;a0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=ld(n),e):t},e.parentId=function(t){return arguments.length?(n=ld(t),e):n},e},t.style=Jt,t.subset=function(t,n){return rt(n,t)},t.sum=function(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e},t.superset=rt,t.svg=Ou,t.symbol=function(t,n){var e=null;function r(){var r;if(e||(e=r=fa()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return t="function"==typeof t?t:eb(t||Gb),n="function"==typeof n?n:eb(void 0===n?64:+n),r.type=function(n){return arguments.length?(t="function"==typeof n?n:eb(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:eb(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbolCircle=Gb,t.symbolCross=Vb,t.symbolDiamond=Zb,t.symbolSquare=nm,t.symbolStar=tm,t.symbolTriangle=rm,t.symbolWye=cm,t.symbols=fm,t.text=Nu,t.thresholdFreedmanDiaconis=function(t,n,e){return Math.ceil((e-n)/(2*(H(t,.75)-H(t,.25))*Math.pow(c(t),-1/3)))},t.thresholdScott=function(t,n,e){return Math.ceil((e-n)/(3.5*d(t)*Math.pow(c(t),-1/3)))},t.thresholdSturges=U,t.tickFormat=_p,t.tickIncrement=R,t.tickStep=F,t.ticks=q,t.timeDay=tg,t.timeDays=ng,t.timeFormatDefaultLocale=pv,t.timeFormatLocale=Wg,t.timeFriday=cg,t.timeFridays=gg,t.timeHour=Qp,t.timeHours=Jp,t.timeInterval=Bp,t.timeMillisecond=Yp,t.timeMilliseconds=Lp,t.timeMinute=Zp,t.timeMinutes=Kp,t.timeMonday=ig,t.timeMondays=lg,t.timeMonth=vg,t.timeMonths=_g,t.timeSaturday=fg,t.timeSaturdays=yg,t.timeSecond=$p,t.timeSeconds=Wp,t.timeSunday=rg,t.timeSundays=sg,t.timeThursday=ug,t.timeThursdays=pg,t.timeTuesday=og,t.timeTuesdays=hg,t.timeWednesday=ag,t.timeWednesdays=dg,t.timeWeek=rg,t.timeWeeks=sg,t.timeYear=bg,t.timeYears=mg,t.timeout=ci,t.timer=ri,t.timerFlush=ii,t.transition=Hi,t.transpose=tt,t.tree=function(){var t=Ad,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,a=new Nd(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new Nd(r[i],i)),e.parent=n;return(a.parent=new Nd(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),g=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=Sd(u),o=Td(o),u&&o;)c=Td(c),(a=Sd(a)).a=n,(i=u.z+l-o.z-f+t(u._,o._))>0&&(Ed(kd(u,n,r),n,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!Sd(a)&&(a.t=u,a.m+=l-s),o&&!Td(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=Dd,n=!1,e=1,r=1,i=[0],o=hd,a=hd,u=hd,c=hd,f=hd;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(_d),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}var l=f[n],h=r/2+l,d=n+1,p=e-1;for(;d>>1;f[g]c-o){var _=r?(i*v+a*y)/r:a;t(n,d,y,i,o,_,c),t(d,e,v,_,o,a,c)}else{var b=r?(o*v+c*y)/r:c;t(n,d,y,i,o,a,b),t(d,e,v,i,b,a,c)}}(0,c,t.value,n,e,r,i)},t.treemapDice=bd,t.treemapResquarify=qd,t.treemapSlice=Cd,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?Cd:bd)(t,n,e,r,i)},t.treemapSquarify=Dd,t.tsv=zu,t.tsvFormat=mu,t.tsvFormatBody=xu,t.tsvFormatRow=Mu,t.tsvFormatRows=wu,t.tsvFormatValue=Au,t.tsvParse=_u,t.tsvParseRows=bu,t.union=function(...t){const n=new Set;for(const e of t)for(const t of e)n.add(t);return n},t.utcDay=Tg,t.utcDays=Sg,t.utcFriday=Dg,t.utcFridays=Bg,t.utcHour=Mg,t.utcHours=Ag,t.utcMillisecond=Yp,t.utcMilliseconds=Lp,t.utcMinute=xg,t.utcMinutes=wg,t.utcMonday=Ng,t.utcMondays=Fg,t.utcMonth=Lg,t.utcMonths=jg,t.utcSaturday=qg,t.utcSaturdays=Yg,t.utcSecond=$p,t.utcSeconds=Wp,t.utcSunday=kg,t.utcSundays=Rg,t.utcThursday=zg,t.utcThursdays=Ig,t.utcTuesday=Cg,t.utcTuesdays=Og,t.utcWednesday=Pg,t.utcWednesdays=Ug,t.utcWeek=kg,t.utcWeeks=Rg,t.utcYear=Hg,t.utcYears=Xg,t.variance=h,t.version="6.6.0",t.window=Wt,t.xml=Ru,t.zip=function(){return tt(arguments)},t.zoom=function(){var t,n,e,r=ix,i=ox,o=fx,a=ux,u=cx,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Dr,h=pt("start","zoom","end"),d=500,p=0,g=10;function y(t){t.property("__zoom",ax).on("wheel.zoom",M).on("mousedown.zoom",A).on("dblclick.zoom",T).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(c[0],Math.min(c[1],n)))===t.k?t:new Jm(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Jm(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,n,e,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),u=i.apply(t,o),c=null==e?b(u):"function"==typeof e?e.apply(t,o):e,f=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof n?n.apply(t,o):n,d=l(s.invert(c).concat(f/s.k),h.invert(c).concat(f/h.k));return function(t){if(1===t)t=h;else{var n=d(t),e=f/n[2];t=new Jm(e,c[0]-n[0]*e,c[1]-n[1]*e)}a.zoom(null,t)}}))}function x(t,n,e){return!e&&t.__zooming||new w(t,n)}function w(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function M(t,...n){if(r.apply(this,arguments)){var e=x(this,n).event(t),i=this.__zoom,u=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),s=Un(t);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=i.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[s,i.invert(s)],gi(this),e.start()}rx(t),e.wheel=setTimeout(l,150),e.zoom("mouse",o(_(v(i,u),e.mouse[0],e.mouse[1]),e.extent,f))}function l(){e.wheel=null,e.end()}}function A(t,...n){if(!e&&r.apply(this,arguments)){var i=x(this,n,!0).event(t),a=Dn(t.view).on("mousemove.zoom",h,!0).on("mouseup.zoom",d,!0),u=Un(t,c),c=t.currentTarget,s=t.clientX,l=t.clientY;Yn(t.view),ex(t),i.mouse=[u,this.__zoom.invert(u)],gi(this),i.start()}function h(t){if(rx(t),!i.moved){var n=t.clientX-s,e=t.clientY-l;i.moved=n*n+e*e>p}i.event(t).zoom("mouse",o(_(i.that.__zoom,i.mouse[0]=Un(t,c),i.mouse[1]),i.extent,f))}function d(t){a.on("mousemove.zoom mouseup.zoom",null),Ln(t.view,i.moved),rx(t),i.event(t).end()}}function T(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=Un(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),c=e.k*(t.shiftKey?.5:2),l=o(_(v(e,c),a,u),i.apply(this,n),f);rx(t),s>0?Dn(this).transition().duration(s).call(m,l,a,t):Dn(this).call(y.transform,l,a,t)}}function S(e,...i){if(r.apply(this,arguments)){var o,a,u,c,f=e.touches,s=f.length,l=x(this,i,e.changedTouches.length===s).event(e);for(ex(e),a=0;a 0 ? floor : ceil)(argument); - }; - - var min = Math.min; - - // `ToLength` abstract operation - // https://tc39.github.io/ecma262/#sec-tolength - var toLength = function (argument) { - return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 - }; - - var max = Math.max; - var min$1 = Math.min; - - // Helper for a popular repeating case of the spec: - // Let integer be ? ToInteger(index). - // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). - var toAbsoluteIndex = function (index, length) { - var integer = toInteger(index); - return integer < 0 ? max(integer + length, 0) : min$1(integer, length); - }; - - // `Array.prototype.{ indexOf, includes }` methods implementation - var createMethod = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) { - if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; - }; - - var arrayIncludes = { - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - includes: createMethod(true), - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - indexOf: createMethod(false) - }; - - var indexOf = arrayIncludes.indexOf; - - - var objectKeysInternal = function (object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~indexOf(result, key) || result.push(key); - } - return result; - }; - - // IE8- don't enum bug keys - var enumBugKeys = [ - 'constructor', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'toLocaleString', - 'toString', - 'valueOf' - ]; - - var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); - - // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames - var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return objectKeysInternal(O, hiddenKeys$1); - }; - - var objectGetOwnPropertyNames = { - f: f$3 - }; - - var f$4 = Object.getOwnPropertySymbols; - - var objectGetOwnPropertySymbols = { - f: f$4 - }; - - // all object keys, includes non-enumerable and symbols - var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { - var keys = objectGetOwnPropertyNames.f(anObject(it)); - var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; - }; - - var copyConstructorProperties = function (target, source) { - var keys = ownKeys(source); - var defineProperty = objectDefineProperty.f; - var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); - } - }; - - var replacement = /#|\.prototype\./; - - var isForced = function (feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL ? true - : value == NATIVE ? false - : typeof detection == 'function' ? fails(detection) - : !!detection; - }; - - var normalize = isForced.normalize = function (string) { - return String(string).replace(replacement, '.').toLowerCase(); - }; - - var data = isForced.data = {}; - var NATIVE = isForced.NATIVE = 'N'; - var POLYFILL = isForced.POLYFILL = 'P'; - - var isForced_1 = isForced; - - var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; - - - - - - - /* - options.target - name of the target object - options.global - target is the global object - options.stat - export as static methods of target - options.proto - export as prototype methods of target - options.real - real prototype method for the `pure` version - options.forced - export even if the native feature is available - options.bind - bind methods to the target, required for the `pure` version - options.wrap - wrap constructors to preventing global pollution, required for the `pure` version - options.unsafe - use the simple assignment of property instead of delete + defineProperty - options.sham - add a flag to not completely full polyfills - options.enumerable - export as enumerable property - options.noTargetGet - prevent calling a getter on target - */ - var _export = function (options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global_1; - } else if (STATIC) { - target = global_1[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global_1[TARGET] || {}).prototype; - } - if (target) for (key in source) { - sourceProperty = source[key]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor$1(target, key); - targetProperty = descriptor && descriptor.value; - } else targetProperty = target[key]; - FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); - // contained in target - if (!FORCED && targetProperty !== undefined) { - if (typeof sourceProperty === typeof targetProperty) continue; - copyConstructorProperties(sourceProperty, targetProperty); - } - // add a flag to not completely full polyfills - if (options.sham || (targetProperty && targetProperty.sham)) { - createNonEnumerableProperty(sourceProperty, 'sham', true); - } - // extend global - redefine(target, key, sourceProperty, options); - } - }; - - var aFunction$1 = function (it) { - if (typeof it != 'function') { - throw TypeError(String(it) + ' is not a function'); - } return it; - }; - - // optional / simple context binding - var functionBindContext = function (fn, that, length) { - aFunction$1(fn); - if (that === undefined) return fn; - switch (length) { - case 0: return function () { - return fn.call(that); - }; - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; - }; - - // `ToObject` abstract operation - // https://tc39.github.io/ecma262/#sec-toobject - var toObject = function (argument) { - return Object(requireObjectCoercible(argument)); - }; - - // `IsArray` abstract operation - // https://tc39.github.io/ecma262/#sec-isarray - var isArray = Array.isArray || function isArray(arg) { - return classofRaw(arg) == 'Array'; - }; - - var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { - // Chrome 38 Symbol has incorrect toString conversion - // eslint-disable-next-line no-undef - return !String(Symbol()); - }); - - var useSymbolAsUid = nativeSymbol - // eslint-disable-next-line no-undef - && !Symbol.sham - // eslint-disable-next-line no-undef - && typeof Symbol.iterator == 'symbol'; - - var WellKnownSymbolsStore = shared('wks'); - var Symbol$1 = global_1.Symbol; - var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid; - - var wellKnownSymbol = function (name) { - if (!has(WellKnownSymbolsStore, name)) { - if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name]; - else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); - } return WellKnownSymbolsStore[name]; - }; - - var SPECIES = wellKnownSymbol('species'); - - // `ArraySpeciesCreate` abstract operation - // https://tc39.github.io/ecma262/#sec-arrayspeciescreate - var arraySpeciesCreate = function (originalArray, length) { - var C; - if (isArray(originalArray)) { - C = originalArray.constructor; - // cross-realm fallback - if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; - else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); - }; - - var push = [].push; - - // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation - var createMethod$1 = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_FILTER = TYPE == 2; - var IS_SOME = TYPE == 3; - var IS_EVERY = TYPE == 4; - var IS_FIND_INDEX = TYPE == 6; - var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - return function ($this, callbackfn, that, specificCreate) { - var O = toObject($this); - var self = indexedObject(O); - var boundFunction = functionBindContext(callbackfn, that, 3); - var length = toLength(self.length); - var index = 0; - var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; - var value, result; - for (;length > index; index++) if (NO_HOLES || index in self) { - value = self[index]; - result = boundFunction(value, index, O); - if (TYPE) { - if (IS_MAP) target[index] = result; // map - else if (result) switch (TYPE) { - case 3: return true; // some - case 5: return value; // find - case 6: return index; // findIndex - case 2: push.call(target, value); // filter - } else if (IS_EVERY) return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; - }; - }; - - var arrayIteration = { - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - forEach: createMethod$1(0), - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - map: createMethod$1(1), - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - filter: createMethod$1(2), - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - some: createMethod$1(3), - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - every: createMethod$1(4), - // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find - find: createMethod$1(5), - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - findIndex: createMethod$1(6) - }; - - // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys - var objectKeys = Object.keys || function keys(O) { - return objectKeysInternal(O, enumBugKeys); - }; - - // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties - var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var index = 0; - var key; - while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]); - return O; - }; - - var html = getBuiltIn('document', 'documentElement'); - - var GT = '>'; - var LT = '<'; - var PROTOTYPE = 'prototype'; - var SCRIPT = 'script'; - var IE_PROTO = sharedKey('IE_PROTO'); - - var EmptyConstructor = function () { /* empty */ }; - - var scriptTag = function (content) { - return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; - }; - - // Create object with fake `null` prototype: use ActiveX Object with cleared prototype - var NullProtoObjectViaActiveX = function (activeXDocument) { - activeXDocument.write(scriptTag('')); - activeXDocument.close(); - var temp = activeXDocument.parentWindow.Object; - activeXDocument = null; // avoid memory leak - return temp; - }; - - // Create object with fake `null` prototype: use iframe Object with cleared prototype - var NullProtoObjectViaIFrame = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = documentCreateElement('iframe'); - var JS = 'java' + SCRIPT + ':'; - var iframeDocument; - iframe.style.display = 'none'; - html.appendChild(iframe); - // https://github.com/zloirock/core-js/issues/475 - iframe.src = String(JS); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(scriptTag('document.F=Object')); - iframeDocument.close(); - return iframeDocument.F; - }; - - // Check for document.domain and active x support - // No need to use active x approach when document.domain is not set - // see https://github.com/es-shims/es5-shim/issues/150 - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 - // avoid IE GC bug - var activeXDocument; - var NullProtoObject = function () { - try { - /* global ActiveXObject */ - activeXDocument = document.domain && new ActiveXObject('htmlfile'); - } catch (error) { /* ignore */ } - NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); - var length = enumBugKeys.length; - while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return NullProtoObject(); - }; - - hiddenKeys[IE_PROTO] = true; - - // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create - var objectCreate = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - EmptyConstructor[PROTOTYPE] = anObject(O); - result = new EmptyConstructor(); - EmptyConstructor[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = NullProtoObject(); - return Properties === undefined ? result : objectDefineProperties(result, Properties); - }; - - var UNSCOPABLES = wellKnownSymbol('unscopables'); - var ArrayPrototype = Array.prototype; - - // Array.prototype[@@unscopables] - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - if (ArrayPrototype[UNSCOPABLES] == undefined) { - objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, { - configurable: true, - value: objectCreate(null) - }); - } - - // add a key to Array.prototype[@@unscopables] - var addToUnscopables = function (key) { - ArrayPrototype[UNSCOPABLES][key] = true; - }; - - var defineProperty = Object.defineProperty; - var cache = {}; - - var thrower = function (it) { throw it; }; - - var arrayMethodUsesToLength = function (METHOD_NAME, options) { - if (has(cache, METHOD_NAME)) return cache[METHOD_NAME]; - if (!options) options = {}; - var method = [][METHOD_NAME]; - var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false; - var argument0 = has(options, 0) ? options[0] : thrower; - var argument1 = has(options, 1) ? options[1] : undefined; - - return cache[METHOD_NAME] = !!method && !fails(function () { - if (ACCESSORS && !descriptors) return true; - var O = { length: -1 }; - - if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower }); - else O[1] = 1; - - method.call(O, argument0, argument1); - }); - }; - - var $find = arrayIteration.find; - - - - var FIND = 'find'; - var SKIPS_HOLES = true; - - var USES_TO_LENGTH = arrayMethodUsesToLength(FIND); - - // Shouldn't skip holes - if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); - - // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find - _export({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables(FIND); - - var $includes = arrayIncludes.includes; - - - - var USES_TO_LENGTH$1 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); - - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - _export({ target: 'Array', proto: true, forced: !USES_TO_LENGTH$1 }, { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('includes'); - - var nativeAssign = Object.assign; - var defineProperty$1 = Object.defineProperty; - - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - var objectAssign = !nativeAssign || fails(function () { - // should have correct order of operations (Edge bug) - if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$1({}, 'a', { - enumerable: true, - get: function () { - defineProperty$1(this, 'b', { - value: 3, - enumerable: false - }); - } - }), { b: 2 })).b !== 1) return true; - // should work with symbols and should have deterministic property order (V8 bug) - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var symbol = Symbol(); - var alphabet = 'abcdefghijklmnopqrst'; - A[symbol] = 7; - alphabet.split('').forEach(function (chr) { B[chr] = chr; }); - return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; - }) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var argumentsLength = arguments.length; - var index = 1; - var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; - var propertyIsEnumerable = objectPropertyIsEnumerable.f; - while (argumentsLength > index) { - var S = indexedObject(arguments[index++]); - var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) { - key = keys[j++]; - if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key]; - } - } return T; - } : nativeAssign; - - // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign - _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, { - assign: objectAssign - }); - - var MATCH = wellKnownSymbol('match'); - - // `IsRegExp` abstract operation - // https://tc39.github.io/ecma262/#sec-isregexp - var isRegexp = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp'); - }; - - var notARegexp = function (it) { - if (isRegexp(it)) { - throw TypeError("The method doesn't accept regular expressions"); - } return it; - }; - - var MATCH$1 = wellKnownSymbol('match'); - - var correctIsRegexpLogic = function (METHOD_NAME) { - var regexp = /./; - try { - '/./'[METHOD_NAME](regexp); - } catch (e) { - try { - regexp[MATCH$1] = false; - return '/./'[METHOD_NAME](regexp); - } catch (f) { /* empty */ } - } return false; - }; - - // `String.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-string.prototype.includes - _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, { - includes: function includes(searchString /* , position = 0 */) { - return !!~String(requireObjectCoercible(this)) - .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined); - } - }); - - var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; - - - - - - - var nativeStartsWith = ''.startsWith; - var min$2 = Math.min; - - var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('startsWith'); - // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { - var descriptor = getOwnPropertyDescriptor$2(String.prototype, 'startsWith'); - return descriptor && !descriptor.writable; - }(); - - // `String.prototype.startsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.startswith - _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = String(requireObjectCoercible(this)); - notARegexp(searchString); - var index = toLength(min$2(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return nativeStartsWith - ? nativeStartsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } - }); - - if (typeof window !== "undefined") { - (function () { - try { - if (typeof SVGElement === 'undefined' || Boolean(SVGElement.prototype.innerHTML)) { - return; - } - } catch (e) { - return; - } - - function serializeNode (node) { - switch (node.nodeType) { - case 1: - return serializeElementNode(node); - case 3: - return serializeTextNode(node); - case 8: - return serializeCommentNode(node); - } - } - - function serializeTextNode (node) { - return node.textContent.replace(/&/g, '&').replace(//g, '>'); - } - - function serializeCommentNode (node) { - return '' - } - - function serializeElementNode (node) { - var output = ''; - - output += '<' + node.tagName; - - if (node.hasAttributes()) { - [].forEach.call(node.attributes, function(attrNode) { - output += ' ' + attrNode.name + '="' + attrNode.value + '"'; - }); - } - - output += '>'; - - if (node.hasChildNodes()) { - [].forEach.call(node.childNodes, function(childNode) { - output += serializeNode(childNode); - }); - } - - output += ''; - - return output; - } - - Object.defineProperty(SVGElement.prototype, 'innerHTML', { - get: function () { - var output = ''; - - [].forEach.call(this.childNodes, function(childNode) { - output += serializeNode(childNode); - }); - - return output; - }, - set: function (markup) { - while (this.firstChild) { - this.removeChild(this.firstChild); - } - - try { - var dXML = new DOMParser(); - dXML.async = false; - - var sXML = '' + markup + ''; - var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement; - - [].forEach.call(svgDocElement.childNodes, function(childNode) { - this.appendChild(this.ownerDocument.importNode(childNode, true)); - }.bind(this)); - } catch (e) { - throw new Error('Error parsing markup string'); - } - } - }); - - Object.defineProperty(SVGElement.prototype, 'innerSVG', { - get: function () { - return this.innerHTML; - }, - set: function (markup) { - this.innerHTML = markup; - } - }); - - })(); - } - -}))); - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define('d3plus-hierarchy', ['exports'], factory) : - (global = global || self, factory(global.d3plus = {})); -}(this, (function (exports) { - function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); - } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; - } - - function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); - } - - function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized(self); - } - - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn(this, result); - }; - } - - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - - return object; - } - - function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); - } - - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); - } - - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); - } - - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; - } - - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - - var F = function () {}; - - return { - s: F, - n: function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }, - e: function (e) { - throw e; - }, - f: F - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - var normalCompletion = true, - didErr = false, - err; - return { - s: function () { - it = o[Symbol.iterator](); - }, - n: function () { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function (e) { - didErr = true; - err = e; - }, - f: function () { - try { - if (!normalCompletion && it.return != null) it.return(); - } finally { - if (didErr) throw err; - } - } - }; - } - - function ascending (a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } - - function bisector (compare) { - if (compare.length === 1) compare = ascendingComparator(compare); - return { - left: function left(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) < 0) lo = mid + 1;else hi = mid; - } - - return lo; - }, - right: function right(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - - while (lo < hi) { - var mid = lo + hi >>> 1; - if (compare(a[mid], x) > 0) hi = mid;else lo = mid + 1; - } - - return lo; - } - }; - } - - function ascendingComparator(f) { - return function (d, x) { - return ascending(f(d), x); - }; - } - - var ascendingBisect = bisector(ascending); - var bisectRight = ascendingBisect.right; - - function number (x) { - return x === null ? NaN : +x; - } - - function variance (values, valueof) { - var n = values.length, - m = 0, - i = -1, - mean = 0, - value, - delta, - sum = 0; - - if (valueof == null) { - while (++i < n) { - if (!isNaN(value = number(values[i]))) { - delta = value - mean; - mean += delta / ++m; - sum += delta * (value - mean); - } - } - } else { - while (++i < n) { - if (!isNaN(value = number(valueof(values[i], i, values)))) { - delta = value - mean; - mean += delta / ++m; - sum += delta * (value - mean); - } - } - } - - if (m > 1) return sum / (m - 1); - } - - function deviation (array, f) { - var v = variance(array, f); - return v ? Math.sqrt(v) : v; - } - - function extent (values, valueof) { - var n = values.length, - i = -1, - value, - min, - max; - - if (valueof == null) { - while (++i < n) { - // Find the first comparable value. - if ((value = values[i]) != null && value >= value) { - min = max = value; - - while (++i < n) { - // Compare the remaining values. - if ((value = values[i]) != null) { - if (min > value) min = value; - if (max < value) max = value; - } - } - } - } - } else { - while (++i < n) { - // Find the first comparable value. - if ((value = valueof(values[i], i, values)) != null && value >= value) { - min = max = value; - - while (++i < n) { - // Compare the remaining values. - if ((value = valueof(values[i], i, values)) != null) { - if (min > value) min = value; - if (max < value) max = value; - } - } - } - } - } - - return [min, max]; - } - - function range (start, stop, step) { - start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; - var i = -1, - n = Math.max(0, Math.ceil((stop - start) / step)) | 0, - range = new Array(n); - - while (++i < n) { - range[i] = start + i * step; - } - - return range; - } - - var e10 = Math.sqrt(50), - e5 = Math.sqrt(10), - e2 = Math.sqrt(2); - function d3Ticks (start, stop, count) { - var reverse, - i = -1, - n, - ticks, - step; - stop = +stop, start = +start, count = +count; - if (start === stop && count > 0) return [start]; - if (reverse = stop < start) n = start, start = stop, stop = n; - if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return []; - - if (step > 0) { - start = Math.ceil(start / step); - stop = Math.floor(stop / step); - ticks = new Array(n = Math.ceil(stop - start + 1)); - - while (++i < n) { - ticks[i] = (start + i) * step; - } - } else { - start = Math.floor(start * step); - stop = Math.ceil(stop * step); - ticks = new Array(n = Math.ceil(start - stop + 1)); - - while (++i < n) { - ticks[i] = (start - i) / step; - } - } - - if (reverse) ticks.reverse(); - return ticks; - } - function tickIncrement(start, stop, count) { - var step = (stop - start) / Math.max(0, count), - power = Math.floor(Math.log(step) / Math.LN10), - error = step / Math.pow(10, power); - return power >= 0 ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); - } - function tickStep(start, stop, count) { - var step0 = Math.abs(stop - start) / Math.max(0, count), - step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), - error = step0 / step1; - if (error >= e10) step1 *= 10;else if (error >= e5) step1 *= 5;else if (error >= e2) step1 *= 2; - return stop < start ? -step1 : step1; - } - - function quantile (values, p, valueof) { - if (valueof == null) valueof = number; - if (!(n = values.length)) return; - if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values); - if (p >= 1) return +valueof(values[n - 1], n - 1, values); - var n, - i = (n - 1) * p, - i0 = Math.floor(i), - value0 = +valueof(values[i0], i0, values), - value1 = +valueof(values[i0 + 1], i0 + 1, values); - return value0 + (value1 - value0) * (i - i0); - } - - function max (values, valueof) { - var n = values.length, - i = -1, - value, - max; - - if (valueof == null) { - while (++i < n) { - // Find the first comparable value. - if ((value = values[i]) != null && value >= value) { - max = value; - - while (++i < n) { - // Compare the remaining values. - if ((value = values[i]) != null && value > max) { - max = value; - } - } - } - } - } else { - while (++i < n) { - // Find the first comparable value. - if ((value = valueof(values[i], i, values)) != null && value >= value) { - max = value; - - while (++i < n) { - // Compare the remaining values. - if ((value = valueof(values[i], i, values)) != null && value > max) { - max = value; - } - } - } - } - } - - return max; - } - - function arrayMerge (arrays) { - var n = arrays.length, - m, - i = -1, - j = 0, - merged, - array; - - while (++i < n) { - j += arrays[i].length; - } - - merged = new Array(j); - - while (--n >= 0) { - array = arrays[n]; - m = array.length; - - while (--m >= 0) { - merged[--j] = array[m]; - } - } - - return merged; - } - - function min (values, valueof) { - var n = values.length, - i = -1, - value, - min; - - if (valueof == null) { - while (++i < n) { - // Find the first comparable value. - if ((value = values[i]) != null && value >= value) { - min = value; - - while (++i < n) { - // Compare the remaining values. - if ((value = values[i]) != null && min > value) { - min = value; - } - } - } - } - } else { - while (++i < n) { - // Find the first comparable value. - if ((value = valueof(values[i], i, values)) != null && value >= value) { - min = value; - - while (++i < n) { - // Compare the remaining values. - if ((value = valueof(values[i], i, values)) != null && min > value) { - min = value; - } - } - } - } - } - - return min; - } - - function sum (values, valueof) { - var n = values.length, - i = -1, - value, - sum = 0; - - if (valueof == null) { - while (++i < n) { - if (value = +values[i]) sum += value; // Note: zero and null are equivalent. - } - } else { - while (++i < n) { - if (value = +valueof(values[i], i, values)) sum += value; - } - } - - return sum; - } - - var pi = Math.PI, - tau = 2 * pi, - epsilon = 1e-6, - tauEpsilon = tau - epsilon; - - function Path() { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; // end of current subpath - - this._ = ""; - } - - function path() { - return new Path(); - } - - Path.prototype = path.prototype = { - constructor: Path, - moveTo: function moveTo(x, y) { - this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y); - }, - closePath: function closePath() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._ += "Z"; - } - }, - lineTo: function lineTo(x, y) { - this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y); - }, - quadraticCurveTo: function quadraticCurveTo(x1, y1, x, y) { - this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y); - }, - bezierCurveTo: function bezierCurveTo(x1, y1, x2, y2, x, y) { - this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y); - }, - arcTo: function arcTo(x1, y1, x2, y2, r) { - x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; - var x0 = this._x1, - y0 = this._y1, - x21 = x2 - x1, - y21 = y2 - y1, - x01 = x0 - x1, - y01 = y0 - y1, - l01_2 = x01 * x01 + y01 * y01; // Is the radius negative? Error. - - if (r < 0) throw new Error("negative radius: " + r); // Is this path empty? Move to (x1,y1). - - if (this._x1 === null) { - this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); - } // Or, is (x1,y1) coincident with (x0,y0)? Do nothing. - else if (!(l01_2 > epsilon)) ; // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear? - // Equivalently, is (x1,y1) coincident with (x2,y2)? - // Or, is the radius zero? Line to (x1,y1). - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { - this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); - } // Otherwise, draw an arc! - else { - var x20 = x2 - x0, - y20 = y2 - y0, - l21_2 = x21 * x21 + y21 * y21, - l20_2 = x20 * x20 + y20 * y20, - l21 = Math.sqrt(l21_2), - l01 = Math.sqrt(l01_2), - l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), - t01 = l / l01, - t21 = l / l21; // If the start tangent is not coincident with (x0,y0), line to. - - if (Math.abs(t01 - 1) > epsilon) { - this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); - } - - this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); - } - }, - arc: function arc(x, y, r, a0, a1, ccw) { - x = +x, y = +y, r = +r; - var dx = r * Math.cos(a0), - dy = r * Math.sin(a0), - x0 = x + dx, - y0 = y + dy, - cw = 1 ^ ccw, - da = ccw ? a0 - a1 : a1 - a0; // Is the radius negative? Error. - - if (r < 0) throw new Error("negative radius: " + r); // Is this path empty? Move to (x0,y0). - - if (this._x1 === null) { - this._ += "M" + x0 + "," + y0; - } // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0). - else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { - this._ += "L" + x0 + "," + y0; - } // Is this arc empty? We’re done. - - - if (!r) return; // Does the angle go the wrong way? Flip the direction. - - if (da < 0) da = da % tau + tau; // Is this a complete circle? Draw two arcs to complete the circle. - - if (da > tauEpsilon) { - this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); - } // Is this arc non-empty? Draw an arc! - else if (da > epsilon) { - this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)); - } - }, - rect: function rect(x, y, w, h) { - this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z"; - }, - toString: function toString() { - return this._; - } - }; - - function constant (x) { - return function constant() { - return x; - }; - } - - var abs = Math.abs; - var atan2 = Math.atan2; - var cos = Math.cos; - var max$1 = Math.max; - var min$1 = Math.min; - var sin = Math.sin; - var sqrt = Math.sqrt; - var epsilon$1 = 1e-12; - var pi$1 = Math.PI; - var halfPi = pi$1 / 2; - var tau$1 = 2 * pi$1; - function acos(x) { - return x > 1 ? 0 : x < -1 ? pi$1 : Math.acos(x); - } - function asin(x) { - return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x); - } - - function arcInnerRadius(d) { - return d.innerRadius; - } - - function arcOuterRadius(d) { - return d.outerRadius; - } - - function arcStartAngle(d) { - return d.startAngle; - } - - function arcEndAngle(d) { - return d.endAngle; - } - - function arcPadAngle(d) { - return d && d.padAngle; // Note: optional! - } - - function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { - var x10 = x1 - x0, - y10 = y1 - y0, - x32 = x3 - x2, - y32 = y3 - y2, - t = y32 * x10 - x32 * y10; - if (t * t < epsilon$1) return; - t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; - return [x0 + t * x10, y0 + t * y10]; - } // Compute perpendicular offset line of length rc. - // http://mathworld.wolfram.com/Circle-LineIntersection.html - - - function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { - var x01 = x0 - x1, - y01 = y0 - y1, - lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), - ox = lo * y01, - oy = -lo * x01, - x11 = x0 + ox, - y11 = y0 + oy, - x10 = x1 + ox, - y10 = y1 + oy, - x00 = (x11 + x10) / 2, - y00 = (y11 + y10) / 2, - dx = x10 - x11, - dy = y10 - y11, - d2 = dx * dx + dy * dy, - r = r1 - rc, - D = x11 * y10 - x10 * y11, - d = (dy < 0 ? -1 : 1) * sqrt(max$1(0, r * r * d2 - D * D)), - cx0 = (D * dy - dx * d) / d2, - cy0 = (-D * dx - dy * d) / d2, - cx1 = (D * dy + dx * d) / d2, - cy1 = (-D * dx + dy * d) / d2, - dx0 = cx0 - x00, - dy0 = cy0 - y00, - dx1 = cx1 - x00, - dy1 = cy1 - y00; // Pick the closer of the two intersection points. - // TODO Is there a faster way to determine which intersection to use? - - if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; - return { - cx: cx0, - cy: cy0, - x01: -ox, - y01: -oy, - x11: cx0 * (r1 / r - 1), - y11: cy0 * (r1 / r - 1) - }; - } - - function arc () { - var innerRadius = arcInnerRadius, - outerRadius = arcOuterRadius, - cornerRadius = constant(0), - padRadius = null, - startAngle = arcStartAngle, - endAngle = arcEndAngle, - padAngle = arcPadAngle, - context = null; - - function arc() { - var buffer, - r, - r0 = +innerRadius.apply(this, arguments), - r1 = +outerRadius.apply(this, arguments), - a0 = startAngle.apply(this, arguments) - halfPi, - a1 = endAngle.apply(this, arguments) - halfPi, - da = abs(a1 - a0), - cw = a1 > a0; - if (!context) context = buffer = path(); // Ensure that the outer radius is always larger than the inner radius. - - if (r1 < r0) r = r1, r1 = r0, r0 = r; // Is it a point? - - if (!(r1 > epsilon$1)) context.moveTo(0, 0); // Or is it a circle or annulus? - else if (da > tau$1 - epsilon$1) { - context.moveTo(r1 * cos(a0), r1 * sin(a0)); - context.arc(0, 0, r1, a0, a1, !cw); - - if (r0 > epsilon$1) { - context.moveTo(r0 * cos(a1), r0 * sin(a1)); - context.arc(0, 0, r0, a1, a0, cw); - } - } // Or is it a circular or annular sector? - else { - var a01 = a0, - a11 = a1, - a00 = a0, - a10 = a1, - da0 = da, - da1 = da, - ap = padAngle.apply(this, arguments) / 2, - rp = ap > epsilon$1 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), - rc = min$1(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), - rc0 = rc, - rc1 = rc, - t0, - t1; // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0. - - if (rp > epsilon$1) { - var p0 = asin(rp / r0 * sin(ap)), - p1 = asin(rp / r1 * sin(ap)); - if ((da0 -= p0 * 2) > epsilon$1) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;else da0 = 0, a00 = a10 = (a0 + a1) / 2; - if ((da1 -= p1 * 2) > epsilon$1) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;else da1 = 0, a01 = a11 = (a0 + a1) / 2; - } - - var x01 = r1 * cos(a01), - y01 = r1 * sin(a01), - x10 = r0 * cos(a10), - y10 = r0 * sin(a10); // Apply rounded corners? - - if (rc > epsilon$1) { - var x11 = r1 * cos(a11), - y11 = r1 * sin(a11), - x00 = r0 * cos(a00), - y00 = r0 * sin(a00), - oc; // Restrict the corner radius according to the sector angle. - - if (da < pi$1 && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { - var ax = x01 - oc[0], - ay = y01 - oc[1], - bx = x11 - oc[0], - by = y11 - oc[1], - kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), - lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); - rc0 = min$1(rc, (r0 - lc) / (kc - 1)); - rc1 = min$1(rc, (r1 - lc) / (kc + 1)); - } - } // Is the sector collapsed to a line? - - - if (!(da1 > epsilon$1)) context.moveTo(x01, y01); // Does the sector’s outer ring have rounded corners? - else if (rc1 > epsilon$1) { - t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); - t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); - context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01); // Have the corners merged? - - if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); // Otherwise, draw the two corners and the ring. - else { - context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw); - context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw); - context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw); - } - } // Or is the outer ring just a circular arc? - else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); // Is there no inner ring, and it’s a circular sector? - // Or perhaps it’s an annular sector collapsed due to padding? - - if (!(r0 > epsilon$1) || !(da0 > epsilon$1)) context.lineTo(x10, y10); // Does the sector’s inner ring (or point) have rounded corners? - else if (rc0 > epsilon$1) { - t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); - t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); - context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01); // Have the corners merged? - - if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); // Otherwise, draw the two corners and the ring. - else { - context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw); - context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw); - context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw); - } - } // Or is the inner ring just a circular arc? - else context.arc(0, 0, r0, a10, a00, cw); - } - context.closePath(); - if (buffer) return context = null, buffer + "" || null; - } - - arc.centroid = function () { - var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, - a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi$1 / 2; - return [cos(a) * r, sin(a) * r]; - }; - - arc.innerRadius = function (_) { - return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius; - }; - - arc.outerRadius = function (_) { - return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius; - }; - - arc.cornerRadius = function (_) { - return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius; - }; - - arc.padRadius = function (_) { - return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius; - }; - - arc.startAngle = function (_) { - return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle; - }; - - arc.endAngle = function (_) { - return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle; - }; - - arc.padAngle = function (_) { - return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle; - }; - - arc.context = function (_) { - return arguments.length ? (context = _ == null ? null : _, arc) : context; - }; - - return arc; - } - - function Linear(context) { - this._context = context; - } - - Linear.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._point = 0; - }, - lineEnd: function lineEnd() { - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); - break; - - case 1: - this._point = 2; - // proceed - - default: - this._context.lineTo(x, y); - - break; - } - } - }; - function curveLinear (context) { - return new Linear(context); - } - - function x(p) { - return p[0]; - } - function y(p) { - return p[1]; - } - - function line () { - var x$1 = x, - y$1 = y, - defined = constant(true), - context = null, - curve = curveLinear, - output = null; - - function line(data) { - var i, - n = data.length, - d, - defined0 = false, - buffer; - if (context == null) output = curve(buffer = path()); - - for (i = 0; i <= n; ++i) { - if (!(i < n && defined(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) output.lineStart();else output.lineEnd(); - } - - if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data)); - } - - if (buffer) return output = null, buffer + "" || null; - } - - line.x = function (_) { - return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1; - }; - - line.y = function (_) { - return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1; - }; - - line.defined = function (_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined; - }; - - line.curve = function (_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; - }; - - line.context = function (_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; - }; - - return line; - } - - function area () { - var x0 = x, - x1 = null, - y0 = constant(0), - y1 = y, - defined = constant(true), - context = null, - curve = curveLinear, - output = null; - - function area(data) { - var i, - j, - k, - n = data.length, - d, - defined0 = false, - buffer, - x0z = new Array(n), - y0z = new Array(n); - if (context == null) output = curve(buffer = path()); - - for (i = 0; i <= n; ++i) { - if (!(i < n && defined(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) { - j = i; - output.areaStart(); - output.lineStart(); - } else { - output.lineEnd(); - output.lineStart(); - - for (k = i - 1; k >= j; --k) { - output.point(x0z[k], y0z[k]); - } - - output.lineEnd(); - output.areaEnd(); - } - } - - if (defined0) { - x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); - output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); - } - } - - if (buffer) return output = null, buffer + "" || null; - } - - function arealine() { - return line().defined(defined).curve(curve).context(context); - } - - area.x = function (_) { - return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0; - }; - - area.x0 = function (_) { - return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0; - }; - - area.x1 = function (_) { - return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1; - }; - - area.y = function (_) { - return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0; - }; - - area.y0 = function (_) { - return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0; - }; - - area.y1 = function (_) { - return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : y1; - }; - - area.lineX0 = area.lineY0 = function () { - return arealine().x(x0).y(y0); - }; - - area.lineY1 = function () { - return arealine().x(x0).y(y1); - }; - - area.lineX1 = function () { - return arealine().x(x1).y(y0); - }; - - area.defined = function (_) { - return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), area) : defined; - }; - - area.curve = function (_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; - }; - - area.context = function (_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; - }; - - return area; - } - - function descending (a, b) { - return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; - } - - function identity (d) { - return d; - } - - function pie () { - var value = identity, - sortValues = descending, - sort = null, - startAngle = constant(0), - endAngle = constant(tau$1), - padAngle = constant(0); - - function pie(data) { - var i, - n = data.length, - j, - k, - sum = 0, - index = new Array(n), - arcs = new Array(n), - a0 = +startAngle.apply(this, arguments), - da = Math.min(tau$1, Math.max(-tau$1, endAngle.apply(this, arguments) - a0)), - a1, - p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), - pa = p * (da < 0 ? -1 : 1), - v; - - for (i = 0; i < n; ++i) { - if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) { - sum += v; - } - } // Optionally sort the arcs by previously-computed values or by data. - - - if (sortValues != null) index.sort(function (i, j) { - return sortValues(arcs[i], arcs[j]); - });else if (sort != null) index.sort(function (i, j) { - return sort(data[i], data[j]); - }); // Compute the arcs! They are stored in the original data's order. - - for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) { - j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = { - data: data[j], - index: i, - value: v, - startAngle: a0, - endAngle: a1, - padAngle: p - }; - } - - return arcs; - } - - pie.value = function (_) { - return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value; - }; - - pie.sortValues = function (_) { - return arguments.length ? (sortValues = _, sort = null, pie) : sortValues; - }; - - pie.sort = function (_) { - return arguments.length ? (sort = _, sortValues = null, pie) : sort; - }; - - pie.startAngle = function (_) { - return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle; - }; - - pie.endAngle = function (_) { - return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle; - }; - - pie.padAngle = function (_) { - return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle; - }; - - return pie; - } - - var curveRadialLinear = curveRadial(curveLinear); - - function Radial(curve) { - this._curve = curve; - } - - Radial.prototype = { - areaStart: function areaStart() { - this._curve.areaStart(); - }, - areaEnd: function areaEnd() { - this._curve.areaEnd(); - }, - lineStart: function lineStart() { - this._curve.lineStart(); - }, - lineEnd: function lineEnd() { - this._curve.lineEnd(); - }, - point: function point(a, r) { - this._curve.point(r * Math.sin(a), r * -Math.cos(a)); - } - }; - function curveRadial(curve) { - function radial(context) { - return new Radial(curve(context)); - } - - radial._curve = curve; - return radial; - } - - function lineRadial(l) { - var c = l.curve; - l.angle = l.x, delete l.x; - l.radius = l.y, delete l.y; - - l.curve = function (_) { - return arguments.length ? c(curveRadial(_)) : c()._curve; - }; - - return l; - } - function lineRadial$1 () { - return lineRadial(line().curve(curveRadialLinear)); - } - - function areaRadial () { - var a = area().curve(curveRadialLinear), - c = a.curve, - x0 = a.lineX0, - x1 = a.lineX1, - y0 = a.lineY0, - y1 = a.lineY1; - a.angle = a.x, delete a.x; - a.startAngle = a.x0, delete a.x0; - a.endAngle = a.x1, delete a.x1; - a.radius = a.y, delete a.y; - a.innerRadius = a.y0, delete a.y0; - a.outerRadius = a.y1, delete a.y1; - a.lineStartAngle = function () { - return lineRadial(x0()); - }, delete a.lineX0; - a.lineEndAngle = function () { - return lineRadial(x1()); - }, delete a.lineX1; - a.lineInnerRadius = function () { - return lineRadial(y0()); - }, delete a.lineY0; - a.lineOuterRadius = function () { - return lineRadial(y1()); - }, delete a.lineY1; - - a.curve = function (_) { - return arguments.length ? c(curveRadial(_)) : c()._curve; - }; - - return a; - } - - function pointRadial (x, y) { - return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)]; - } - - var slice = Array.prototype.slice; - - function linkSource(d) { - return d.source; - } - - function linkTarget(d) { - return d.target; - } - - function link(curve) { - var source = linkSource, - target = linkTarget, - x$1 = x, - y$1 = y, - context = null; - - function link() { - var buffer, - argv = slice.call(arguments), - s = source.apply(this, argv), - t = target.apply(this, argv); - if (!context) context = buffer = path(); - curve(context, +x$1.apply(this, (argv[0] = s, argv)), +y$1.apply(this, argv), +x$1.apply(this, (argv[0] = t, argv)), +y$1.apply(this, argv)); - if (buffer) return context = null, buffer + "" || null; - } - - link.source = function (_) { - return arguments.length ? (source = _, link) : source; - }; - - link.target = function (_) { - return arguments.length ? (target = _, link) : target; - }; - - link.x = function (_) { - return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), link) : x$1; - }; - - link.y = function (_) { - return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), link) : y$1; - }; - - link.context = function (_) { - return arguments.length ? (context = _ == null ? null : _, link) : context; - }; - - return link; - } - - function curveHorizontal(context, x0, y0, x1, y1) { - context.moveTo(x0, y0); - context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1); - } - - function curveVertical(context, x0, y0, x1, y1) { - context.moveTo(x0, y0); - context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1); - } - - function curveRadial$1(context, x0, y0, x1, y1) { - var p0 = pointRadial(x0, y0), - p1 = pointRadial(x0, y0 = (y0 + y1) / 2), - p2 = pointRadial(x1, y0), - p3 = pointRadial(x1, y1); - context.moveTo(p0[0], p0[1]); - context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]); - } - - function linkHorizontal() { - return link(curveHorizontal); - } - function linkVertical() { - return link(curveVertical); - } - function linkRadial() { - var l = link(curveRadial$1); - l.angle = l.x, delete l.x; - l.radius = l.y, delete l.y; - return l; - } - - var circle = { - draw: function draw(context, size) { - var r = Math.sqrt(size / pi$1); - context.moveTo(r, 0); - context.arc(0, 0, r, 0, tau$1); - } - }; - - var cross = { - draw: function draw(context, size) { - var r = Math.sqrt(size / 5) / 2; - context.moveTo(-3 * r, -r); - context.lineTo(-r, -r); - context.lineTo(-r, -3 * r); - context.lineTo(r, -3 * r); - context.lineTo(r, -r); - context.lineTo(3 * r, -r); - context.lineTo(3 * r, r); - context.lineTo(r, r); - context.lineTo(r, 3 * r); - context.lineTo(-r, 3 * r); - context.lineTo(-r, r); - context.lineTo(-3 * r, r); - context.closePath(); - } - }; - - var tan30 = Math.sqrt(1 / 3), - tan30_2 = tan30 * 2; - var diamond = { - draw: function draw(context, size) { - var y = Math.sqrt(size / tan30_2), - x = y * tan30; - context.moveTo(0, -y); - context.lineTo(x, 0); - context.lineTo(0, y); - context.lineTo(-x, 0); - context.closePath(); - } - }; - - var ka = 0.89081309152928522810, - kr = Math.sin(pi$1 / 10) / Math.sin(7 * pi$1 / 10), - kx = Math.sin(tau$1 / 10) * kr, - ky = -Math.cos(tau$1 / 10) * kr; - var star = { - draw: function draw(context, size) { - var r = Math.sqrt(size * ka), - x = kx * r, - y = ky * r; - context.moveTo(0, -r); - context.lineTo(x, y); - - for (var i = 1; i < 5; ++i) { - var a = tau$1 * i / 5, - c = Math.cos(a), - s = Math.sin(a); - context.lineTo(s * r, -c * r); - context.lineTo(c * x - s * y, s * x + c * y); - } - - context.closePath(); - } - }; - - var square = { - draw: function draw(context, size) { - var w = Math.sqrt(size), - x = -w / 2; - context.rect(x, x, w, w); - } - }; - - var sqrt3 = Math.sqrt(3); - var triangle = { - draw: function draw(context, size) { - var y = -Math.sqrt(size / (sqrt3 * 3)); - context.moveTo(0, y * 2); - context.lineTo(-sqrt3 * y, -y); - context.lineTo(sqrt3 * y, -y); - context.closePath(); - } - }; - - var c = -0.5, - s = Math.sqrt(3) / 2, - k = 1 / Math.sqrt(12), - a = (k / 2 + 1) * 3; - var wye = { - draw: function draw(context, size) { - var r = Math.sqrt(size / a), - x0 = r / 2, - y0 = r * k, - x1 = x0, - y1 = r * k + r, - x2 = -x1, - y2 = y1; - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - context.lineTo(c * x0 - s * y0, s * x0 + c * y0); - context.lineTo(c * x1 - s * y1, s * x1 + c * y1); - context.lineTo(c * x2 - s * y2, s * x2 + c * y2); - context.lineTo(c * x0 + s * y0, c * y0 - s * x0); - context.lineTo(c * x1 + s * y1, c * y1 - s * x1); - context.lineTo(c * x2 + s * y2, c * y2 - s * x2); - context.closePath(); - } - }; - - var symbols = [circle, cross, diamond, square, star, triangle, wye]; - function symbol () { - var type = constant(circle), - size = constant(64), - context = null; - - function symbol() { - var buffer; - if (!context) context = buffer = path(); - type.apply(this, arguments).draw(context, +size.apply(this, arguments)); - if (buffer) return context = null, buffer + "" || null; - } - - symbol.type = function (_) { - return arguments.length ? (type = typeof _ === "function" ? _ : constant(_), symbol) : type; - }; - - symbol.size = function (_) { - return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size; - }; - - symbol.context = function (_) { - return arguments.length ? (context = _ == null ? null : _, symbol) : context; - }; - - return symbol; - } - - function noop () {} - - function _point(that, x, y) { - that._context.bezierCurveTo((2 * that._x0 + that._x1) / 3, (2 * that._y0 + that._y1) / 3, (that._x0 + 2 * that._x1) / 3, (that._y0 + 2 * that._y1) / 3, (that._x0 + 4 * that._x1 + x) / 6, (that._y0 + 4 * that._y1 + y) / 6); - } - function Basis(context) { - this._context = context; - } - Basis.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 3: - _point(this, this._x1, this._y1); - - // proceed - - case 2: - this._context.lineTo(this._x1, this._y1); - - break; - } - - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); - break; - - case 1: - this._point = 2; - break; - - case 2: - this._point = 3; - - this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); - - // proceed - - default: - _point(this, x, y); - - break; - } - - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; - } - }; - function basis (context) { - return new Basis(context); - } - - function BasisClosed(context) { - this._context = context; - } - - BasisClosed.prototype = { - areaStart: noop, - areaEnd: noop, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 1: - { - this._context.moveTo(this._x2, this._y2); - - this._context.closePath(); - - break; - } - - case 2: - { - this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); - - this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); - - this._context.closePath(); - - break; - } - - case 3: - { - this.point(this._x2, this._y2); - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - break; - } - } - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - this._x2 = x, this._y2 = y; - break; - - case 1: - this._point = 2; - this._x3 = x, this._y3 = y; - break; - - case 2: - this._point = 3; - this._x4 = x, this._y4 = y; - - this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); - - break; - - default: - _point(this, x, y); - - break; - } - - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; - } - }; - function basisClosed (context) { - return new BasisClosed(context); - } - - function BasisOpen(context) { - this._context = context; - } - - BasisOpen.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - break; - - case 1: - this._point = 2; - break; - - case 2: - this._point = 3; - var x0 = (this._x0 + 4 * this._x1 + x) / 6, - y0 = (this._y0 + 4 * this._y1 + y) / 6; - this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); - break; - - case 3: - this._point = 4; - // proceed - - default: - _point(this, x, y); - - break; - } - - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; - } - }; - function basisOpen (context) { - return new BasisOpen(context); - } - - function Bundle(context, beta) { - this._basis = new Basis(context); - this._beta = beta; - } - - Bundle.prototype = { - lineStart: function lineStart() { - this._x = []; - this._y = []; - - this._basis.lineStart(); - }, - lineEnd: function lineEnd() { - var x = this._x, - y = this._y, - j = x.length - 1; - - if (j > 0) { - var x0 = x[0], - y0 = y[0], - dx = x[j] - x0, - dy = y[j] - y0, - i = -1, - t; - - while (++i <= j) { - t = i / j; - - this._basis.point(this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)); - } - } - - this._x = this._y = null; - - this._basis.lineEnd(); - }, - point: function point(x, y) { - this._x.push(+x); - - this._y.push(+y); - } - }; - var bundle = (function custom(beta) { - function bundle(context) { - return beta === 1 ? new Basis(context) : new Bundle(context, beta); - } - - bundle.beta = function (beta) { - return custom(+beta); - }; - - return bundle; - })(0.85); - - function _point$1(that, x, y) { - that._context.bezierCurveTo(that._x1 + that._k * (that._x2 - that._x0), that._y1 + that._k * (that._y2 - that._y0), that._x2 + that._k * (that._x1 - x), that._y2 + that._k * (that._y1 - y), that._x2, that._y2); - } - function Cardinal(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; - } - Cardinal.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - - break; - - case 3: - _point$1(this, this._x1, this._y1); - - break; - } - - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); - break; - - case 1: - this._point = 2; - this._x1 = x, this._y1 = y; - break; - - case 2: - this._point = 3; - // proceed - - default: - _point$1(this, x, y); - - break; - } - - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; - } - }; - var cardinal = (function custom(tension) { - function cardinal(context) { - return new Cardinal(context, tension); - } - - cardinal.tension = function (tension) { - return custom(+tension); - }; - - return cardinal; - })(0); - - function CardinalClosed(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; - } - CardinalClosed.prototype = { - areaStart: noop, - areaEnd: noop, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 1: - { - this._context.moveTo(this._x3, this._y3); - - this._context.closePath(); - - break; - } - - case 2: - { - this._context.lineTo(this._x3, this._y3); - - this._context.closePath(); - - break; - } - - case 3: - { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; - } - } - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x, this._y3 = y; - break; - - case 1: - this._point = 2; - - this._context.moveTo(this._x4 = x, this._y4 = y); - - break; - - case 2: - this._point = 3; - this._x5 = x, this._y5 = y; - break; - - default: - _point$1(this, x, y); - - break; - } - - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; - } - }; - var cardinalClosed = (function custom(tension) { - function cardinal(context) { - return new CardinalClosed(context, tension); - } - - cardinal.tension = function (tension) { - return custom(+tension); - }; - - return cardinal; - })(0); - - function CardinalOpen(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; - } - CardinalOpen.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - break; - - case 1: - this._point = 2; - break; - - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - - case 3: - this._point = 4; - // proceed - - default: - _point$1(this, x, y); - - break; - } - - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; - } - }; - var cardinalOpen = (function custom(tension) { - function cardinal(context) { - return new CardinalOpen(context, tension); - } - - cardinal.tension = function (tension) { - return custom(+tension); - }; - - return cardinal; - })(0); - - function _point$2(that, x, y) { - var x1 = that._x1, - y1 = that._y1, - x2 = that._x2, - y2 = that._y2; - - if (that._l01_a > epsilon$1) { - var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, - n = 3 * that._l01_a * (that._l01_a + that._l12_a); - x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; - y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; - } - - if (that._l23_a > epsilon$1) { - var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, - m = 3 * that._l23_a * (that._l23_a + that._l12_a); - x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m; - y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m; - } - - that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2); - } - - function CatmullRom(context, alpha) { - this._context = context; - this._alpha = alpha; - } - - CatmullRom.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - - break; - - case 3: - this.point(this._x2, this._y2); - break; - } - - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - if (this._point) { - var x23 = this._x2 - x, - y23 = this._y2 - y; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); - break; - - case 1: - this._point = 2; - break; - - case 2: - this._point = 3; - // proceed - - default: - _point$2(this, x, y); - - break; - } - - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; - } - }; - var catmullRom = (function custom(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); - } - - catmullRom.alpha = function (alpha) { - return custom(+alpha); - }; - - return catmullRom; - })(0.5); - - function CatmullRomClosed(context, alpha) { - this._context = context; - this._alpha = alpha; - } - - CatmullRomClosed.prototype = { - areaStart: noop, - areaEnd: noop, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 1: - { - this._context.moveTo(this._x3, this._y3); - - this._context.closePath(); - - break; - } - - case 2: - { - this._context.lineTo(this._x3, this._y3); - - this._context.closePath(); - - break; - } - - case 3: - { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; - } - } - }, - point: function point(x, y) { - x = +x, y = +y; - - if (this._point) { - var x23 = this._x2 - x, - y23 = this._y2 - y; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x, this._y3 = y; - break; - - case 1: - this._point = 2; - - this._context.moveTo(this._x4 = x, this._y4 = y); - - break; - - case 2: - this._point = 3; - this._x5 = x, this._y5 = y; - break; - - default: - _point$2(this, x, y); - - break; - } - - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; - } - }; - var catmullRomClosed = (function custom(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); - } - - catmullRom.alpha = function (alpha) { - return custom(+alpha); - }; - - return catmullRom; - })(0.5); - - function CatmullRomOpen(context, alpha) { - this._context = context; - this._alpha = alpha; - } - - CatmullRomOpen.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function lineEnd() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - if (this._point) { - var x23 = this._x2 - x, - y23 = this._y2 - y; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - - switch (this._point) { - case 0: - this._point = 1; - break; - - case 1: - this._point = 2; - break; - - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - - case 3: - this._point = 4; - // proceed - - default: - _point$2(this, x, y); - - break; - } - - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; - } - }; - var catmullRomOpen = (function custom(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); - } - - catmullRom.alpha = function (alpha) { - return custom(+alpha); - }; - - return catmullRom; - })(0.5); - - function LinearClosed(context) { - this._context = context; - } - - LinearClosed.prototype = { - areaStart: noop, - areaEnd: noop, - lineStart: function lineStart() { - this._point = 0; - }, - lineEnd: function lineEnd() { - if (this._point) this._context.closePath(); - }, - point: function point(x, y) { - x = +x, y = +y; - if (this._point) this._context.lineTo(x, y);else this._point = 1, this._context.moveTo(x, y); - } - }; - function linearClosed (context) { - return new LinearClosed(context); - } - - function sign(x) { - return x < 0 ? -1 : 1; - } // Calculate the slopes of the tangents (Hermite-type interpolation) based on - // the following paper: Steffen, M. 1990. A Simple Method for Monotonic - // Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO. - // NOV(II), P. 443, 1990. - - - function slope3(that, x2, y2) { - var h0 = that._x1 - that._x0, - h1 = x2 - that._x1, - s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), - s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), - p = (s0 * h1 + s1 * h0) / (h0 + h1); - return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; - } // Calculate a one-sided slope. - - - function slope2(that, t) { - var h = that._x1 - that._x0; - return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; - } // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations - // "you can express cubic Hermite interpolation in terms of cubic Bézier curves - // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1". - - - function _point$3(that, t0, t1) { - var x0 = that._x0, - y0 = that._y0, - x1 = that._x1, - y1 = that._y1, - dx = (x1 - x0) / 3; - - that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1); - } - - function MonotoneX(context) { - this._context = context; - } - - MonotoneX.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - switch (this._point) { - case 2: - this._context.lineTo(this._x1, this._y1); - - break; - - case 3: - _point$3(this, this._t0, slope2(this, this._t0)); - - break; - } - - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function point(x, y) { - var t1 = NaN; - x = +x, y = +y; - if (x === this._x1 && y === this._y1) return; // Ignore coincident points. - - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); - break; - - case 1: - this._point = 2; - break; - - case 2: - this._point = 3; - - _point$3(this, slope2(this, t1 = slope3(this, x, y)), t1); - - break; - - default: - _point$3(this, this._t0, t1 = slope3(this, x, y)); - - break; - } - - this._x0 = this._x1, this._x1 = x; - this._y0 = this._y1, this._y1 = y; - this._t0 = t1; - } - }; - - function MonotoneY(context) { - this._context = new ReflectContext(context); - } - - (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function (x, y) { - MonotoneX.prototype.point.call(this, y, x); - }; - - function ReflectContext(context) { - this._context = context; - } - - ReflectContext.prototype = { - moveTo: function moveTo(x, y) { - this._context.moveTo(y, x); - }, - closePath: function closePath() { - this._context.closePath(); - }, - lineTo: function lineTo(x, y) { - this._context.lineTo(y, x); - }, - bezierCurveTo: function bezierCurveTo(x1, y1, x2, y2, x, y) { - this._context.bezierCurveTo(y1, x1, y2, x2, y, x); - } - }; - function monotoneX(context) { - return new MonotoneX(context); - } - function monotoneY(context) { - return new MonotoneY(context); - } - - function Natural(context) { - this._context = context; - } - - Natural.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x = []; - this._y = []; - }, - lineEnd: function lineEnd() { - var x = this._x, - y = this._y, - n = x.length; - - if (n) { - this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]); - - if (n === 2) { - this._context.lineTo(x[1], y[1]); - } else { - var px = controlPoints(x), - py = controlPoints(y); - - for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { - this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]); - } - } - } - - if (this._line || this._line !== 0 && n === 1) this._context.closePath(); - this._line = 1 - this._line; - this._x = this._y = null; - }, - point: function point(x, y) { - this._x.push(+x); - - this._y.push(+y); - } - }; // See https://www.particleincell.com/2012/bezier-splines/ for derivation. - - function controlPoints(x) { - var i, - n = x.length - 1, - m, - a = new Array(n), - b = new Array(n), - r = new Array(n); - a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1]; - - for (i = 1; i < n - 1; ++i) { - a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1]; - } - - a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n]; - - for (i = 1; i < n; ++i) { - m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1]; - } - - a[n - 1] = r[n - 1] / b[n - 1]; - - for (i = n - 2; i >= 0; --i) { - a[i] = (r[i] - a[i + 1]) / b[i]; - } - - b[n - 1] = (x[n] + a[n - 1]) / 2; - - for (i = 0; i < n - 1; ++i) { - b[i] = 2 * x[i + 1] - a[i + 1]; - } - - return [a, b]; - } - - function natural (context) { - return new Natural(context); - } - - function Step(context, t) { - this._context = context; - this._t = t; - } - - Step.prototype = { - areaStart: function areaStart() { - this._line = 0; - }, - areaEnd: function areaEnd() { - this._line = NaN; - }, - lineStart: function lineStart() { - this._x = this._y = NaN; - this._point = 0; - }, - lineEnd: function lineEnd() { - if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; - }, - point: function point(x, y) { - x = +x, y = +y; - - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); - break; - - case 1: - this._point = 2; - // proceed - - default: - { - if (this._t <= 0) { - this._context.lineTo(this._x, y); - - this._context.lineTo(x, y); - } else { - var x1 = this._x * (1 - this._t) + x * this._t; - - this._context.lineTo(x1, this._y); - - this._context.lineTo(x1, y); - } - - break; - } - } - - this._x = x, this._y = y; - } - }; - function step (context) { - return new Step(context, 0.5); - } - function stepBefore(context) { - return new Step(context, 0); - } - function stepAfter(context) { - return new Step(context, 1); - } - - function none (series, order) { - if (!((n = series.length) > 1)) return; - - for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) { - s0 = s1, s1 = series[order[i]]; - - for (j = 0; j < m; ++j) { - s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1]; - } - } - } - - function none$1 (series) { - var n = series.length, - o = new Array(n); - - while (--n >= 0) { - o[n] = n; - } - - return o; - } - - function stackValue(d, key) { - return d[key]; - } - - function stack () { - var keys = constant([]), - order = none$1, - offset = none, - value = stackValue; - - function stack(data) { - var kz = keys.apply(this, arguments), - i, - m = data.length, - n = kz.length, - sz = new Array(n), - oz; - - for (i = 0; i < n; ++i) { - for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) { - si[j] = sij = [0, +value(data[j], ki, j, data)]; - sij.data = data[j]; - } - - si.key = ki; - } - - for (i = 0, oz = order(sz); i < n; ++i) { - sz[oz[i]].index = i; - } - - offset(sz, oz); - return sz; - } - - stack.keys = function (_) { - return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys; - }; - - stack.value = function (_) { - return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value; - }; - - stack.order = function (_) { - return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order; - }; - - stack.offset = function (_) { - return arguments.length ? (offset = _ == null ? none : _, stack) : offset; - }; - - return stack; - } - - function expand (series, order) { - if (!((n = series.length) > 0)) return; - - for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) { - for (y = i = 0; i < n; ++i) { - y += series[i][j][1] || 0; - } - - if (y) for (i = 0; i < n; ++i) { - series[i][j][1] /= y; - } - } - - none(series, order); - } - - function diverging (series, order) { - if (!((n = series.length) > 0)) return; - - for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) { - for (yp = yn = 0, i = 0; i < n; ++i) { - if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) { - d[0] = yp, d[1] = yp += dy; - } else if (dy < 0) { - d[1] = yn, d[0] = yn += dy; - } else { - d[0] = yp; - } - } - } - } - - function silhouette (series, order) { - if (!((n = series.length) > 0)) return; - - for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) { - for (var i = 0, y = 0; i < n; ++i) { - y += series[i][j][1] || 0; - } - - s0[j][1] += s0[j][0] = -y / 2; - } - - none(series, order); - } - - function wiggle (series, order) { - if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return; - - for (var y = 0, j = 1, s0, m, n; j < m; ++j) { - for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) { - var si = series[order[i]], - sij0 = si[j][1] || 0, - sij1 = si[j - 1][1] || 0, - s3 = (sij0 - sij1) / 2; - - for (var k = 0; k < i; ++k) { - var sk = series[order[k]], - skj0 = sk[j][1] || 0, - skj1 = sk[j - 1][1] || 0; - s3 += skj0 - skj1; - } - - s1 += sij0, s2 += s3 * sij0; - } - - s0[j - 1][1] += s0[j - 1][0] = y; - if (s1) y -= s2 / s1; - } - - s0[j - 1][1] += s0[j - 1][0] = y; - none(series, order); - } - - function appearance (series) { - var peaks = series.map(peak); - return none$1(series).sort(function (a, b) { - return peaks[a] - peaks[b]; - }); - } - - function peak(series) { - var i = -1, - j = 0, - n = series.length, - vi, - vj = -Infinity; - - while (++i < n) { - if ((vi = +series[i][1]) > vj) vj = vi, j = i; - } - - return j; - } - - function ascending$1 (series) { - var sums = series.map(sum$1); - return none$1(series).sort(function (a, b) { - return sums[a] - sums[b]; - }); - } - function sum$1(series) { - var s = 0, - i = -1, - n = series.length, - v; - - while (++i < n) { - if (v = +series[i][1]) s += v; - } - - return s; - } - - function descending$1 (series) { - return ascending$1(series).reverse(); - } - - function insideOut (series) { - var n = series.length, - i, - j, - sums = series.map(sum$1), - order = appearance(series), - top = 0, - bottom = 0, - tops = [], - bottoms = []; - - for (i = 0; i < n; ++i) { - j = order[i]; - - if (top < bottom) { - top += sums[j]; - tops.push(j); - } else { - bottom += sums[j]; - bottoms.push(j); - } - } - - return bottoms.reverse().concat(tops); - } - - function reverse (series) { - return none$1(series).reverse(); - } - - - - var paths = /*#__PURE__*/Object.freeze({ - __proto__: null, - arc: arc, - area: area, - line: line, - pie: pie, - areaRadial: areaRadial, - radialArea: areaRadial, - lineRadial: lineRadial$1, - radialLine: lineRadial$1, - pointRadial: pointRadial, - linkHorizontal: linkHorizontal, - linkVertical: linkVertical, - linkRadial: linkRadial, - symbol: symbol, - symbols: symbols, - symbolCircle: circle, - symbolCross: cross, - symbolDiamond: diamond, - symbolSquare: square, - symbolStar: star, - symbolTriangle: triangle, - symbolWye: wye, - curveBasisClosed: basisClosed, - curveBasisOpen: basisOpen, - curveBasis: basis, - curveBundle: bundle, - curveCardinalClosed: cardinalClosed, - curveCardinalOpen: cardinalOpen, - curveCardinal: cardinal, - curveCatmullRomClosed: catmullRomClosed, - curveCatmullRomOpen: catmullRomOpen, - curveCatmullRom: catmullRom, - curveLinearClosed: linearClosed, - curveLinear: curveLinear, - curveMonotoneX: monotoneX, - curveMonotoneY: monotoneY, - curveNatural: natural, - curveStep: step, - curveStepAfter: stepAfter, - curveStepBefore: stepBefore, - stack: stack, - stackOffsetExpand: expand, - stackOffsetDiverging: diverging, - stackOffsetNone: none, - stackOffsetSilhouette: silhouette, - stackOffsetWiggle: wiggle, - stackOrderAppearance: appearance, - stackOrderAscending: ascending$1, - stackOrderDescending: descending$1, - stackOrderInsideOut: insideOut, - stackOrderNone: none$1, - stackOrderReverse: reverse - }); - - /** - @function accessor - @desc Wraps an object key in a simple accessor function. - @param {String} key The key to be returned from each Object passed to the function. - @param {*} [def] A default value to be returned if the key is not present. - @example this - accessor("id"); - @example returns this - function(d) { - return d["id"]; - } - */ - function accessor (key, def) { - if (def === void 0) return function (d) { - return d[key]; - }; - return function (d) { - return d[key] === void 0 ? def : d[key]; - }; - } - - function _typeof$1(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$1 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$1 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$1(obj); - } - /** - @function isObject - @desc Detects if a variable is a javascript Object. - @param {*} item - */ - - - function isObject (item) { - return item && _typeof$1(item) === "object" && (typeof window === "undefined" || item !== window && item !== window.document && !(item instanceof Element)) && !Array.isArray(item) ? true : false; - } - - /** - @function validObject - @desc Determines if the object passed is the document or window. - @param {Object} obj - @private - */ - - function validObject(obj) { - if (typeof window === "undefined") return true;else return obj !== window && obj !== document; - } - /** - @function assign - @desc A deeply recursive version of `Object.assign`. - @param {...Object} objects - @example this - assign({id: "foo", deep: {group: "A"}}, {id: "bar", deep: {value: 20}})); - @example returns this - {id: "bar", deep: {group: "A", value: 20}} - */ - - - function assign() { - var _arguments = arguments; - var target = arguments.length <= 0 ? undefined : arguments[0]; - - var _loop = function _loop(i) { - var source = i < 0 || _arguments.length <= i ? undefined : _arguments[i]; - Object.keys(source).forEach(function (prop) { - var value = source[prop]; - - if (isObject(value) && validObject(value)) { - if (target.hasOwnProperty(prop) && isObject(target[prop])) target[prop] = assign({}, target[prop], value);else target[prop] = assign({}, value); - } else if (Array.isArray(value)) target[prop] = value.slice();else target[prop] = value; - }); - }; - - for (var i = 1; i < arguments.length; i++) { - _loop(i); - } - - return target; - } - - /** - @function attrize - @desc Applies each key/value in an object as an attr. - @param {D3selection} elem The D3 element to apply the styles to. - @param {Object} attrs An object of key/value attr pairs. - */ - function attrize (e) { - var a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - for (var k in a) { - if ({}.hasOwnProperty.call(a, k)) e.attr(k, a[k]); - } - } - - var aa = { - language: "Afar", - location: null, - id: 4096, - tag: "aa", - version: "Release 10" - }; - var af = { - language: "Afrikaans", - location: null, - id: 54, - tag: "af", - version: "Release 7" - }; - var agq = { - language: "Aghem", - location: null, - id: 4096, - tag: "agq", - version: "Release 10" - }; - var ak = { - language: "Akan", - location: null, - id: 4096, - tag: "ak", - version: "Release 10" - }; - var sq = { - language: "Albanian", - location: null, - id: 28, - tag: "sq", - version: "Release 7" - }; - var gsw = { - language: "Alsatian", - location: null, - id: 132, - tag: "gsw", - version: "Release 7" - }; - var am = { - language: "Amharic", - location: null, - id: 94, - tag: "am", - version: "Release 7" - }; - var ar = { - language: "Arabic", - location: null, - id: 1, - tag: "ar", - version: "Release 7" - }; - var hy = { - language: "Armenian", - location: null, - id: 43, - tag: "hy", - version: "Release 7" - }; - var as = { - language: "Assamese", - location: null, - id: 77, - tag: "as", - version: "Release 7" - }; - var ast = { - language: "Asturian", - location: null, - id: 4096, - tag: "ast", - version: "Release 10" - }; - var asa = { - language: "Asu", - location: null, - id: 4096, - tag: "asa", - version: "Release 10" - }; - var az = { - language: "Azerbaijani (Latin)", - location: null, - id: 44, - tag: "az", - version: "Release 7" - }; - var ksf = { - language: "Bafia", - location: null, - id: 4096, - tag: "ksf", - version: "Release 10" - }; - var bm = { - language: "Bamanankan", - location: null, - id: 4096, - tag: "bm", - version: "Release 10" - }; - var bn = { - language: "Bangla", - location: null, - id: 69, - tag: "bn", - version: "Release 7" - }; - var bas = { - language: "Basaa", - location: null, - id: 4096, - tag: "bas", - version: "Release 10" - }; - var ba = { - language: "Bashkir", - location: null, - id: 109, - tag: "ba", - version: "Release 7" - }; - var eu = { - language: "Basque", - location: null, - id: 45, - tag: "eu", - version: "Release 7" - }; - var be = { - language: "Belarusian", - location: null, - id: 35, - tag: "be", - version: "Release 7" - }; - var bem = { - language: "Bemba", - location: null, - id: 4096, - tag: "bem", - version: "Release 10" - }; - var bez = { - language: "Bena", - location: null, - id: 4096, - tag: "bez", - version: "Release 10" - }; - var byn = { - language: "Blin", - location: null, - id: 4096, - tag: "byn", - version: "Release 10" - }; - var brx = { - language: "Bodo", - location: null, - id: 4096, - tag: "brx", - version: "Release 10" - }; - var bs = { - language: "Bosnian (Latin)", - location: null, - id: 30746, - tag: "bs", - version: "Release 7" - }; - var br = { - language: "Breton", - location: null, - id: 126, - tag: "br", - version: "Release 7" - }; - var bg = { - language: "Bulgarian", - location: null, - id: 2, - tag: "bg", - version: "Release 7" - }; - var my = { - language: "Burmese", - location: null, - id: 85, - tag: "my", - version: "Release 8.1" - }; - var ca = { - language: "Catalan", - location: null, - id: 3, - tag: "ca", - version: "Release 7" - }; - var ceb = { - language: "Cebuano", - location: null, - id: 4096, - tag: "ceb", - version: "Release 10.5" - }; - var ku = { - language: "Central Kurdish", - location: null, - id: 146, - tag: "ku", - version: "Release 8" - }; - var ccp = { - language: "Chakma", - location: null, - id: 4096, - tag: "ccp", - version: "Release 10.5" - }; - var chr = { - language: "Cherokee", - location: null, - id: 92, - tag: "chr", - version: "Release 8" - }; - var cgg = { - language: "Chiga", - location: null, - id: 4096, - tag: "cgg", - version: "Release 10" - }; - var zh = { - language: "Chinese (Simplified)", - location: null, - id: 30724, - tag: "zh", - version: "Windows 7" - }; - var swc = { - language: "Congo Swahili", - location: null, - id: 4096, - tag: "swc", - version: "Release 10" - }; - var kw = { - language: "Cornish", - location: null, - id: 4096, - tag: "kw", - version: "Release 10" - }; - var co = { - language: "Corsican", - location: null, - id: 131, - tag: "co", - version: "Release 7" - }; - var cs = { - language: "Czech", - location: null, - id: 5, - tag: "cs", - version: "Release 7" - }; - var da = { - language: "Danish", - location: null, - id: 6, - tag: "da", - version: "Release 7" - }; - var prs = { - language: "Dari", - location: null, - id: 140, - tag: "prs", - version: "Release 7" - }; - var dv = { - language: "Divehi", - location: null, - id: 101, - tag: "dv", - version: "Release 7" - }; - var dua = { - language: "Duala", - location: null, - id: 4096, - tag: "dua", - version: "Release 10" - }; - var nl = { - language: "Dutch", - location: null, - id: 19, - tag: "nl", - version: "Release 7" - }; - var dz = { - language: "Dzongkha", - location: null, - id: 4096, - tag: "dz", - version: "Release 10" - }; - var ebu = { - language: "Embu", - location: null, - id: 4096, - tag: "ebu", - version: "Release 10" - }; - var en = { - language: "English", - location: null, - id: 9, - tag: "en", - version: "Release 7" - }; - var eo = { - language: "Esperanto", - location: null, - id: 4096, - tag: "eo", - version: "Release 10" - }; - var et = { - language: "Estonian", - location: null, - id: 37, - tag: "et", - version: "Release 7" - }; - var ee = { - language: "Ewe", - location: null, - id: 4096, - tag: "ee", - version: "Release 10" - }; - var ewo = { - language: "Ewondo", - location: null, - id: 4096, - tag: "ewo", - version: "Release 10" - }; - var fo = { - language: "Faroese", - location: null, - id: 56, - tag: "fo", - version: "Release 7" - }; - var fil = { - language: "Filipino", - location: null, - id: 100, - tag: "fil", - version: "Release 7" - }; - var fi = { - language: "Finnish", - location: null, - id: 11, - tag: "fi", - version: "Release 7" - }; - var fr = { - language: "French", - location: null, - id: 12, - tag: "fr", - version: "Release 7" - }; - var fy = { - language: "Frisian", - location: null, - id: 98, - tag: "fy", - version: "Release 7" - }; - var fur = { - language: "Friulian", - location: null, - id: 4096, - tag: "fur", - version: "Release 10" - }; - var ff = { - language: "Fulah", - location: null, - id: 103, - tag: "ff", - version: "Release 8" - }; - var gl = { - language: "Galician", - location: null, - id: 86, - tag: "gl", - version: "Release 7" - }; - var lg = { - language: "Ganda", - location: null, - id: 4096, - tag: "lg", - version: "Release 10" - }; - var ka$1 = { - language: "Georgian", - location: null, - id: 55, - tag: "ka", - version: "Release 7" - }; - var de = { - language: "German", - location: null, - id: 7, - tag: "de", - version: "Release 7" - }; - var el = { - language: "Greek", - location: null, - id: 8, - tag: "el", - version: "Release 7" - }; - var kl = { - language: "Greenlandic", - location: null, - id: 111, - tag: "kl", - version: "Release 7" - }; - var gn = { - language: "Guarani", - location: null, - id: 116, - tag: "gn", - version: "Release 8.1" - }; - var gu = { - language: "Gujarati", - location: null, - id: 71, - tag: "gu", - version: "Release 7" - }; - var guz = { - language: "Gusii", - location: null, - id: 4096, - tag: "guz", - version: "Release 10" - }; - var ha = { - language: "Hausa (Latin)", - location: null, - id: 104, - tag: "ha", - version: "Release 7" - }; - var haw = { - language: "Hawaiian", - location: null, - id: 117, - tag: "haw", - version: "Release 8" - }; - var he = { - language: "Hebrew", - location: null, - id: 13, - tag: "he", - version: "Release 7" - }; - var hi = { - language: "Hindi", - location: null, - id: 57, - tag: "hi", - version: "Release 7" - }; - var hu = { - language: "Hungarian", - location: null, - id: 14, - tag: "hu", - version: "Release 7" - }; - var is = { - language: "Icelandic", - location: null, - id: 15, - tag: "is", - version: "Release 7" - }; - var ig = { - language: "Igbo", - location: null, - id: 112, - tag: "ig", - version: "Release 7" - }; - var id = { - language: "Indonesian", - location: null, - id: 33, - tag: "id", - version: "Release 7" - }; - var ia = { - language: "Interlingua", - location: null, - id: 4096, - tag: "ia", - version: "Release 10" - }; - var iu = { - language: "Inuktitut (Latin)", - location: null, - id: 93, - tag: "iu", - version: "Release 7" - }; - var ga = { - language: "Irish", - location: null, - id: 60, - tag: "ga", - version: "Windows 7" - }; - var it = { - language: "Italian", - location: null, - id: 16, - tag: "it", - version: "Release 7" - }; - var ja = { - language: "Japanese", - location: null, - id: 17, - tag: "ja", - version: "Release 7" - }; - var jv = { - language: "Javanese", - location: null, - id: 4096, - tag: "jv", - version: "Release 8.1" - }; - var dyo = { - language: "Jola-Fonyi", - location: null, - id: 4096, - tag: "dyo", - version: "Release 10" - }; - var kea = { - language: "Kabuverdianu", - location: null, - id: 4096, - tag: "kea", - version: "Release 10" - }; - var kab = { - language: "Kabyle", - location: null, - id: 4096, - tag: "kab", - version: "Release 10" - }; - var kkj = { - language: "Kako", - location: null, - id: 4096, - tag: "kkj", - version: "Release 10" - }; - var kln = { - language: "Kalenjin", - location: null, - id: 4096, - tag: "kln", - version: "Release 10" - }; - var kam = { - language: "Kamba", - location: null, - id: 4096, - tag: "kam", - version: "Release 10" - }; - var kn = { - language: "Kannada", - location: null, - id: 75, - tag: "kn", - version: "Release 7" - }; - var ks = { - language: "Kashmiri", - location: null, - id: 96, - tag: "ks", - version: "Release 10" - }; - var kk = { - language: "Kazakh", - location: null, - id: 63, - tag: "kk", - version: "Release 7" - }; - var km = { - language: "Khmer", - location: null, - id: 83, - tag: "km", - version: "Release 7" - }; - var quc = { - language: "K'iche", - location: null, - id: 134, - tag: "quc", - version: "Release 10" - }; - var ki = { - language: "Kikuyu", - location: null, - id: 4096, - tag: "ki", - version: "Release 10" - }; - var rw = { - language: "Kinyarwanda", - location: null, - id: 135, - tag: "rw", - version: "Release 7" - }; - var sw = { - language: "Kiswahili", - location: null, - id: 65, - tag: "sw", - version: "Release 7" - }; - var kok = { - language: "Konkani", - location: null, - id: 87, - tag: "kok", - version: "Release 7" - }; - var ko = { - language: "Korean", - location: null, - id: 18, - tag: "ko", - version: "Release 7" - }; - var khq = { - language: "Koyra Chiini", - location: null, - id: 4096, - tag: "khq", - version: "Release 10" - }; - var ses = { - language: "Koyraboro Senni", - location: null, - id: 4096, - tag: "ses", - version: "Release 10" - }; - var nmg = { - language: "Kwasio", - location: null, - id: 4096, - tag: "nmg", - version: "Release 10" - }; - var ky$1 = { - language: "Kyrgyz", - location: null, - id: 64, - tag: "ky", - version: "Release 7" - }; - var lkt = { - language: "Lakota", - location: null, - id: 4096, - tag: "lkt", - version: "Release 10" - }; - var lag = { - language: "Langi", - location: null, - id: 4096, - tag: "lag", - version: "Release 10" - }; - var lo = { - language: "Lao", - location: null, - id: 84, - tag: "lo", - version: "Release 7" - }; - var lv = { - language: "Latvian", - location: null, - id: 38, - tag: "lv", - version: "Release 7" - }; - var ln = { - language: "Lingala", - location: null, - id: 4096, - tag: "ln", - version: "Release 10" - }; - var lt = { - language: "Lithuanian", - location: null, - id: 39, - tag: "lt", - version: "Release 7" - }; - var nds = { - language: "Low German", - location: null, - id: 4096, - tag: "nds", - version: "Release 10.2" - }; - var dsb = { - language: "Lower Sorbian", - location: null, - id: 31790, - tag: "dsb", - version: "Windows 7" - }; - var lu = { - language: "Luba-Katanga", - location: null, - id: 4096, - tag: "lu", - version: "Release 10" - }; - var luo = { - language: "Luo", - location: null, - id: 4096, - tag: "luo", - version: "Release 10" - }; - var lb = { - language: "Luxembourgish", - location: null, - id: 110, - tag: "lb", - version: "Release 7" - }; - var luy = { - language: "Luyia", - location: null, - id: 4096, - tag: "luy", - version: "Release 10" - }; - var mk = { - language: "Macedonian", - location: null, - id: 47, - tag: "mk", - version: "Release 7" - }; - var jmc = { - language: "Machame", - location: null, - id: 4096, - tag: "jmc", - version: "Release 10" - }; - var mgh = { - language: "Makhuwa-Meetto", - location: null, - id: 4096, - tag: "mgh", - version: "Release 10" - }; - var kde = { - language: "Makonde", - location: null, - id: 4096, - tag: "kde", - version: "Release 10" - }; - var mg = { - language: "Malagasy", - location: null, - id: 4096, - tag: "mg", - version: "Release 8.1" - }; - var ms = { - language: "Malay", - location: null, - id: 62, - tag: "ms", - version: "Release 7" - }; - var ml = { - language: "Malayalam", - location: null, - id: 76, - tag: "ml", - version: "Release 7" - }; - var mt = { - language: "Maltese", - location: null, - id: 58, - tag: "mt", - version: "Release 7" - }; - var gv = { - language: "Manx", - location: null, - id: 4096, - tag: "gv", - version: "Release 10" - }; - var mi = { - language: "Maori", - location: null, - id: 129, - tag: "mi", - version: "Release 7" - }; - var arn = { - language: "Mapudungun", - location: null, - id: 122, - tag: "arn", - version: "Release 7" - }; - var mr = { - language: "Marathi", - location: null, - id: 78, - tag: "mr", - version: "Release 7" - }; - var mas = { - language: "Masai", - location: null, - id: 4096, - tag: "mas", - version: "Release 10" - }; - var mer = { - language: "Meru", - location: null, - id: 4096, - tag: "mer", - version: "Release 10" - }; - var mgo = { - language: "Meta'", - location: null, - id: 4096, - tag: "mgo", - version: "Release 10" - }; - var moh = { - language: "Mohawk", - location: null, - id: 124, - tag: "moh", - version: "Release 7" - }; - var mn = { - language: "Mongolian (Cyrillic)", - location: null, - id: 80, - tag: "mn", - version: "Release 7" - }; - var mfe = { - language: "Morisyen", - location: null, - id: 4096, - tag: "mfe", - version: "Release 10" - }; - var mua = { - language: "Mundang", - location: null, - id: 4096, - tag: "mua", - version: "Release 10" - }; - var nqo = { - language: "N'ko", - location: null, - id: 4096, - tag: "nqo", - version: "Release 8.1" - }; - var naq = { - language: "Nama", - location: null, - id: 4096, - tag: "naq", - version: "Release 10" - }; - var ne = { - language: "Nepali", - location: null, - id: 97, - tag: "ne", - version: "Release 7" - }; - var nnh = { - language: "Ngiemboon", - location: null, - id: 4096, - tag: "nnh", - version: "Release 10" - }; - var jgo = { - language: "Ngomba", - location: null, - id: 4096, - tag: "jgo", - version: "Release 10" - }; - var nd = { - language: "North Ndebele", - location: null, - id: 4096, - tag: "nd", - version: "Release 10" - }; - var no = { - language: "Norwegian (Bokmal)", - location: null, - id: 20, - tag: "no", - version: "Release 7" - }; - var nb = { - language: "Norwegian (Bokmal)", - location: null, - id: 31764, - tag: "nb", - version: "Release 7" - }; - var nn = { - language: "Norwegian (Nynorsk)", - location: null, - id: 30740, - tag: "nn", - version: "Release 7" - }; - var nus = { - language: "Nuer", - location: null, - id: 4096, - tag: "nus", - version: "Release 10" - }; - var nyn = { - language: "Nyankole", - location: null, - id: 4096, - tag: "nyn", - version: "Release 10" - }; - var oc = { - language: "Occitan", - location: null, - id: 130, - tag: "oc", - version: "Release 7" - }; - var or = { - language: "Odia", - location: null, - id: 72, - tag: "or", - version: "Release 7" - }; - var om = { - language: "Oromo", - location: null, - id: 114, - tag: "om", - version: "Release 8.1" - }; - var os = { - language: "Ossetian", - location: null, - id: 4096, - tag: "os", - version: "Release 10" - }; - var ps = { - language: "Pashto", - location: null, - id: 99, - tag: "ps", - version: "Release 7" - }; - var fa = { - language: "Persian", - location: null, - id: 41, - tag: "fa", - version: "Release 7" - }; - var pl = { - language: "Polish", - location: null, - id: 21, - tag: "pl", - version: "Release 7" - }; - var pt = { - language: "Portuguese", - location: null, - id: 22, - tag: "pt", - version: "Release 7" - }; - var pa = { - language: "Punjabi", - location: null, - id: 70, - tag: "pa", - version: "Release 7" - }; - var quz = { - language: "Quechua", - location: null, - id: 107, - tag: "quz", - version: "Release 7" - }; - var ksh = { - language: "Ripuarian", - location: null, - id: 4096, - tag: "ksh", - version: "Release 10" - }; - var ro = { - language: "Romanian", - location: null, - id: 24, - tag: "ro", - version: "Release 7" - }; - var rm = { - language: "Romansh", - location: null, - id: 23, - tag: "rm", - version: "Release 7" - }; - var rof = { - language: "Rombo", - location: null, - id: 4096, - tag: "rof", - version: "Release 10" - }; - var rn = { - language: "Rundi", - location: null, - id: 4096, - tag: "rn", - version: "Release 10" - }; - var ru = { - language: "Russian", - location: null, - id: 25, - tag: "ru", - version: "Release 7" - }; - var rwk = { - language: "Rwa", - location: null, - id: 4096, - tag: "rwk", - version: "Release 10" - }; - var ssy = { - language: "Saho", - location: null, - id: 4096, - tag: "ssy", - version: "Release 10" - }; - var sah = { - language: "Sakha", - location: null, - id: 133, - tag: "sah", - version: "Release 7" - }; - var saq = { - language: "Samburu", - location: null, - id: 4096, - tag: "saq", - version: "Release 10" - }; - var smn = { - language: "Sami (Inari)", - location: null, - id: 28731, - tag: "smn", - version: "Windows 7" - }; - var smj = { - language: "Sami (Lule)", - location: null, - id: 31803, - tag: "smj", - version: "Windows 7" - }; - var se = { - language: "Sami (Northern)", - location: null, - id: 59, - tag: "se", - version: "Release 7" - }; - var sms = { - language: "Sami (Skolt)", - location: null, - id: 29755, - tag: "sms", - version: "Windows 7" - }; - var sma = { - language: "Sami (Southern)", - location: null, - id: 30779, - tag: "sma", - version: "Windows 7" - }; - var sg = { - language: "Sango", - location: null, - id: 4096, - tag: "sg", - version: "Release 10" - }; - var sbp = { - language: "Sangu", - location: null, - id: 4096, - tag: "sbp", - version: "Release 10" - }; - var sa = { - language: "Sanskrit", - location: null, - id: 79, - tag: "sa", - version: "Release 7" - }; - var gd = { - language: "Scottish Gaelic", - location: null, - id: 145, - tag: "gd", - version: "Windows 7" - }; - var seh = { - language: "Sena", - location: null, - id: 4096, - tag: "seh", - version: "Release 10" - }; - var sr = { - language: "Serbian (Latin)", - location: null, - id: 31770, - tag: "sr", - version: "Release 7" - }; - var nso = { - language: "Sesotho sa Leboa", - location: null, - id: 108, - tag: "nso", - version: "Release 7" - }; - var tn = { - language: "Setswana", - location: null, - id: 50, - tag: "tn", - version: "Release 7" - }; - var ksb = { - language: "Shambala", - location: null, - id: 4096, - tag: "ksb", - version: "Release 10" - }; - var sn = { - language: "Shona", - location: null, - id: 4096, - tag: "sn", - version: "Release 8.1" - }; - var sd = { - language: "Sindhi", - location: null, - id: 89, - tag: "sd", - version: "Release 8" - }; - var si = { - language: "Sinhala", - location: null, - id: 91, - tag: "si", - version: "Release 7" - }; - var sk = { - language: "Slovak", - location: null, - id: 27, - tag: "sk", - version: "Release 7" - }; - var sl = { - language: "Slovenian", - location: null, - id: 36, - tag: "sl", - version: "Release 7" - }; - var xog = { - language: "Soga", - location: null, - id: 4096, - tag: "xog", - version: "Release 10" - }; - var so = { - language: "Somali", - location: null, - id: 119, - tag: "so", - version: "Release 8.1" - }; - var st = { - language: "Sotho", - location: null, - id: 48, - tag: "st", - version: "Release 8.1" - }; - var nr = { - language: "South Ndebele", - location: null, - id: 4096, - tag: "nr", - version: "Release 10" - }; - var es = { - language: "Spanish", - location: null, - id: 10, - tag: "es", - version: "Release 7" - }; - var zgh = { - language: "Standard Moroccan Tamazight", - location: null, - id: 4096, - tag: "zgh", - version: "Release 8.1" - }; - var ss = { - language: "Swati", - location: null, - id: 4096, - tag: "ss", - version: "Release 10" - }; - var sv = { - language: "Swedish", - location: null, - id: 29, - tag: "sv", - version: "Release 7" - }; - var syr = { - language: "Syriac", - location: null, - id: 90, - tag: "syr", - version: "Release 7" - }; - var shi = { - language: "Tachelhit", - location: null, - id: 4096, - tag: "shi", - version: "Release 10" - }; - var dav = { - language: "Taita", - location: null, - id: 4096, - tag: "dav", - version: "Release 10" - }; - var tg = { - language: "Tajik (Cyrillic)", - location: null, - id: 40, - tag: "tg", - version: "Release 7" - }; - var tzm = { - language: "Tamazight (Latin)", - location: null, - id: 95, - tag: "tzm", - version: "Release 7" - }; - var ta = { - language: "Tamil", - location: null, - id: 73, - tag: "ta", - version: "Release 7" - }; - var twq = { - language: "Tasawaq", - location: null, - id: 4096, - tag: "twq", - version: "Release 10" - }; - var tt = { - language: "Tatar", - location: null, - id: 68, - tag: "tt", - version: "Release 7" - }; - var te = { - language: "Telugu", - location: null, - id: 74, - tag: "te", - version: "Release 7" - }; - var teo = { - language: "Teso", - location: null, - id: 4096, - tag: "teo", - version: "Release 10" - }; - var th = { - language: "Thai", - location: null, - id: 30, - tag: "th", - version: "Release 7" - }; - var bo = { - language: "Tibetan", - location: null, - id: 81, - tag: "bo", - version: "Release 7" - }; - var tig = { - language: "Tigre", - location: null, - id: 4096, - tag: "tig", - version: "Release 10" - }; - var ti = { - language: "Tigrinya", - location: null, - id: 115, - tag: "ti", - version: "Release 8" - }; - var to = { - language: "Tongan", - location: null, - id: 4096, - tag: "to", - version: "Release 10" - }; - var ts = { - language: "Tsonga", - location: null, - id: 49, - tag: "ts", - version: "Release 8.1" - }; - var tr = { - language: "Turkish", - location: null, - id: 31, - tag: "tr", - version: "Release 7" - }; - var tk = { - language: "Turkmen", - location: null, - id: 66, - tag: "tk", - version: "Release 7" - }; - var uk = { - language: "Ukrainian", - location: null, - id: 34, - tag: "uk", - version: "Release 7" - }; - var hsb = { - language: "Upper Sorbian", - location: null, - id: 46, - tag: "hsb", - version: "Release 7" - }; - var ur = { - language: "Urdu", - location: null, - id: 32, - tag: "ur", - version: "Release 7" - }; - var ug = { - language: "Uyghur", - location: null, - id: 128, - tag: "ug", - version: "Release 7" - }; - var uz = { - language: "Uzbek (Latin)", - location: null, - id: 67, - tag: "uz", - version: "Release 7" - }; - var vai = { - language: "Vai", - location: null, - id: 4096, - tag: "vai", - version: "Release 10" - }; - var ve = { - language: "Venda", - location: null, - id: 51, - tag: "ve", - version: "Release 10" - }; - var vi = { - language: "Vietnamese", - location: null, - id: 42, - tag: "vi", - version: "Release 7" - }; - var vo = { - language: "Volapük", - location: null, - id: 4096, - tag: "vo", - version: "Release 10" - }; - var vun = { - language: "Vunjo", - location: null, - id: 4096, - tag: "vun", - version: "Release 10" - }; - var wae = { - language: "Walser", - location: null, - id: 4096, - tag: "wae", - version: "Release 10" - }; - var cy = { - language: "Welsh", - location: null, - id: 82, - tag: "cy", - version: "Release 7" - }; - var wal = { - language: "Wolaytta", - location: null, - id: 4096, - tag: "wal", - version: "Release 10" - }; - var wo = { - language: "Wolof", - location: null, - id: 136, - tag: "wo", - version: "Release 7" - }; - var xh = { - language: "Xhosa", - location: null, - id: 52, - tag: "xh", - version: "Release 7" - }; - var yav = { - language: "Yangben", - location: null, - id: 4096, - tag: "yav", - version: "Release 10" - }; - var ii = { - language: "Yi", - location: null, - id: 120, - tag: "ii", - version: "Release 7" - }; - var yo = { - language: "Yoruba", - location: null, - id: 106, - tag: "yo", - version: "Release 7" - }; - var dje = { - language: "Zarma", - location: null, - id: 4096, - tag: "dje", - version: "Release 10" - }; - var zu = { - language: "Zulu", - location: null, - id: 53, - tag: "zu", - version: "Release 7" - }; - var lcid = { - aa: aa, - "aa-dj": { - language: "Afar", - location: "Djibouti", - id: 4096, - tag: "aa-DJ", - version: "Release 10" - }, - "aa-er": { - language: "Afar", - location: "Eritrea", - id: 4096, - tag: "aa-ER", - version: "Release 10" - }, - "aa-et": { - language: "Afar", - location: "Ethiopia", - id: 4096, - tag: "aa-ET", - version: "Release 10" - }, - af: af, - "af-na": { - language: "Afrikaans", - location: "Namibia", - id: 4096, - tag: "af-NA", - version: "Release 10" - }, - "af-za": { - language: "Afrikaans", - location: "South Africa", - id: 1078, - tag: "af-ZA", - version: "Release B" - }, - agq: agq, - "agq-cm": { - language: "Aghem", - location: "Cameroon", - id: 4096, - tag: "agq-CM", - version: "Release 10" - }, - ak: ak, - "ak-gh": { - language: "Akan", - location: "Ghana", - id: 4096, - tag: "ak-GH", - version: "Release 10" - }, - sq: sq, - "sq-al": { - language: "Albanian", - location: "Albania", - id: 1052, - tag: "sq-AL", - version: "Release B" - }, - "sq-mk": { - language: "Albanian", - location: "North Macedonia", - id: 4096, - tag: "sq-MK", - version: "Release 10" - }, - gsw: gsw, - "gsw-fr": { - language: "Alsatian", - location: "France", - id: 1156, - tag: "gsw-FR", - version: "Release V" - }, - "gsw-li": { - language: "Alsatian", - location: "Liechtenstein", - id: 4096, - tag: "gsw-LI", - version: "Release 10" - }, - "gsw-ch": { - language: "Alsatian", - location: "Switzerland", - id: 4096, - tag: "gsw-CH", - version: "Release 10" - }, - am: am, - "am-et": { - language: "Amharic", - location: "Ethiopia", - id: 1118, - tag: "am-ET", - version: "Release V" - }, - ar: ar, - "ar-dz": { - language: "Arabic", - location: "Algeria", - id: 5121, - tag: "ar-DZ", - version: "Release B" - }, - "ar-bh": { - language: "Arabic", - location: "Bahrain", - id: 15361, - tag: "ar-BH", - version: "Release B" - }, - "ar-td": { - language: "Arabic", - location: "Chad", - id: 4096, - tag: "ar-TD", - version: "Release 10" - }, - "ar-km": { - language: "Arabic", - location: "Comoros", - id: 4096, - tag: "ar-KM", - version: "Release 10" - }, - "ar-dj": { - language: "Arabic", - location: "Djibouti", - id: 4096, - tag: "ar-DJ", - version: "Release 10" - }, - "ar-eg": { - language: "Arabic", - location: "Egypt", - id: 3073, - tag: "ar-EG", - version: "Release B" - }, - "ar-er": { - language: "Arabic", - location: "Eritrea", - id: 4096, - tag: "ar-ER", - version: "Release 10" - }, - "ar-iq": { - language: "Arabic", - location: "Iraq", - id: 2049, - tag: "ar-IQ", - version: "Release B" - }, - "ar-il": { - language: "Arabic", - location: "Israel", - id: 4096, - tag: "ar-IL", - version: "Release 10" - }, - "ar-jo": { - language: "Arabic", - location: "Jordan", - id: 11265, - tag: "ar-JO", - version: "Release B" - }, - "ar-kw": { - language: "Arabic", - location: "Kuwait", - id: 13313, - tag: "ar-KW", - version: "Release B" - }, - "ar-lb": { - language: "Arabic", - location: "Lebanon", - id: 12289, - tag: "ar-LB", - version: "Release B" - }, - "ar-ly": { - language: "Arabic", - location: "Libya", - id: 4097, - tag: "ar-LY", - version: "Release B" - }, - "ar-mr": { - language: "Arabic", - location: "Mauritania", - id: 4096, - tag: "ar-MR", - version: "Release 10" - }, - "ar-ma": { - language: "Arabic", - location: "Morocco", - id: 6145, - tag: "ar-MA", - version: "Release B" - }, - "ar-om": { - language: "Arabic", - location: "Oman", - id: 8193, - tag: "ar-OM", - version: "Release B" - }, - "ar-ps": { - language: "Arabic", - location: "Palestinian Authority", - id: 4096, - tag: "ar-PS", - version: "Release 10" - }, - "ar-qa": { - language: "Arabic", - location: "Qatar", - id: 16385, - tag: "ar-QA", - version: "Release B" - }, - "ar-sa": { - language: "Arabic", - location: "Saudi Arabia", - id: 1025, - tag: "ar-SA", - version: "Release B" - }, - "ar-so": { - language: "Arabic", - location: "Somalia", - id: 4096, - tag: "ar-SO", - version: "Release 10" - }, - "ar-ss": { - language: "Arabic", - location: "South Sudan", - id: 4096, - tag: "ar-SS", - version: "Release 10" - }, - "ar-sd": { - language: "Arabic", - location: "Sudan", - id: 4096, - tag: "ar-SD", - version: "Release 10" - }, - "ar-sy": { - language: "Arabic", - location: "Syria", - id: 10241, - tag: "ar-SY", - version: "Release B" - }, - "ar-tn": { - language: "Arabic", - location: "Tunisia", - id: 7169, - tag: "ar-TN", - version: "Release B" - }, - "ar-ae": { - language: "Arabic", - location: "U.A.E.", - id: 14337, - tag: "ar-AE", - version: "Release B" - }, - "ar-001": { - language: "Arabic", - location: "World", - id: 4096, - tag: "ar-001", - version: "Release 10" - }, - "ar-ye": { - language: "Arabic", - location: "Yemen", - id: 9217, - tag: "ar-YE", - version: "Release B" - }, - hy: hy, - "hy-am": { - language: "Armenian", - location: "Armenia", - id: 1067, - tag: "hy-AM", - version: "Release C" - }, - as: as, - "as-in": { - language: "Assamese", - location: "India", - id: 1101, - tag: "as-IN", - version: "Release V" - }, - ast: ast, - "ast-es": { - language: "Asturian", - location: "Spain", - id: 4096, - tag: "ast-ES", - version: "Release 10" - }, - asa: asa, - "asa-tz": { - language: "Asu", - location: "Tanzania", - id: 4096, - tag: "asa-TZ", - version: "Release 10" - }, - "az-cyrl": { - language: "Azerbaijani (Cyrillic)", - location: null, - id: 29740, - tag: "az-Cyrl", - version: "Windows 7" - }, - "az-cyrl-az": { - language: "Azerbaijani (Cyrillic)", - location: "Azerbaijan", - id: 2092, - tag: "az-Cyrl-AZ", - version: "Release C" - }, - az: az, - "az-latn": { - language: "Azerbaijani (Latin)", - location: null, - id: 30764, - tag: "az-Latn", - version: "Windows 7" - }, - "az-latn-az": { - language: "Azerbaijani (Latin)", - location: "Azerbaijan", - id: 1068, - tag: "az-Latn-AZ", - version: "Release C" - }, - ksf: ksf, - "ksf-cm": { - language: "Bafia", - location: "Cameroon", - id: 4096, - tag: "ksf-CM", - version: "Release 10" - }, - bm: bm, - "bm-latn-ml": { - language: "Bamanankan (Latin)", - location: "Mali", - id: 4096, - tag: "bm-Latn-ML", - version: "Release 10" - }, - bn: bn, - "bn-bd": { - language: "Bangla", - location: "Bangladesh", - id: 2117, - tag: "bn-BD", - version: "Release V" - }, - "bn-in": { - language: "Bangla", - location: "India", - id: 1093, - tag: "bn-IN", - version: "Release E1" - }, - bas: bas, - "bas-cm": { - language: "Basaa", - location: "Cameroon", - id: 4096, - tag: "bas-CM", - version: "Release 10" - }, - ba: ba, - "ba-ru": { - language: "Bashkir", - location: "Russia", - id: 1133, - tag: "ba-RU", - version: "Release V" - }, - eu: eu, - "eu-es": { - language: "Basque", - location: "Spain", - id: 1069, - tag: "eu-ES", - version: "Release B" - }, - be: be, - "be-by": { - language: "Belarusian", - location: "Belarus", - id: 1059, - tag: "be-BY", - version: "Release B" - }, - bem: bem, - "bem-zm": { - language: "Bemba", - location: "Zambia", - id: 4096, - tag: "bem-ZM", - version: "Release 10" - }, - bez: bez, - "bez-tz": { - language: "Bena", - location: "Tanzania", - id: 4096, - tag: "bez-TZ", - version: "Release 10" - }, - byn: byn, - "byn-er": { - language: "Blin", - location: "Eritrea", - id: 4096, - tag: "byn-ER", - version: "Release 10" - }, - brx: brx, - "brx-in": { - language: "Bodo", - location: "India", - id: 4096, - tag: "brx-IN", - version: "Release 10" - }, - "bs-cyrl": { - language: "Bosnian (Cyrillic)", - location: null, - id: 25626, - tag: "bs-Cyrl", - version: "Windows 7" - }, - "bs-cyrl-ba": { - language: "Bosnian (Cyrillic)", - location: "Bosnia and Herzegovina", - id: 8218, - tag: "bs-Cyrl-BA", - version: "Release E1" - }, - "bs-latn": { - language: "Bosnian (Latin)", - location: null, - id: 26650, - tag: "bs-Latn", - version: "Windows 7" - }, - bs: bs, - "bs-latn-ba": { - language: "Bosnian (Latin)", - location: "Bosnia and Herzegovina", - id: 5146, - tag: "bs-Latn-BA", - version: "Release E1" - }, - br: br, - "br-fr": { - language: "Breton", - location: "France", - id: 1150, - tag: "br-FR", - version: "Release V" - }, - bg: bg, - "bg-bg": { - language: "Bulgarian", - location: "Bulgaria", - id: 1026, - tag: "bg-BG", - version: "Release B" - }, - my: my, - "my-mm": { - language: "Burmese", - location: "Myanmar", - id: 1109, - tag: "my-MM", - version: "Release 8.1" - }, - ca: ca, - "ca-ad": { - language: "Catalan", - location: "Andorra", - id: 4096, - tag: "ca-AD", - version: "Release 10" - }, - "ca-fr": { - language: "Catalan", - location: "France", - id: 4096, - tag: "ca-FR", - version: "Release 10" - }, - "ca-it": { - language: "Catalan", - location: "Italy", - id: 4096, - tag: "ca-IT", - version: "Release 10" - }, - "ca-es": { - language: "Catalan", - location: "Spain", - id: 1027, - tag: "ca-ES", - version: "Release B" - }, - ceb: ceb, - "ceb-latn": { - language: "Cebuan (Latin)", - location: null, - id: 4096, - tag: "ceb-Latn", - version: "Release 10.5" - }, - "ceb-latn-ph": { - language: "Cebuan (Latin)", - location: "Philippines", - id: 4096, - tag: "ceb-Latn-PH", - version: "Release 10.5" - }, - "tzm-latn-": { - language: "Central Atlas Tamazight (Latin)", - location: "Morocco", - id: 4096, - tag: "tzm-Latn-", - version: "Release 10" - }, - ku: ku, - "ku-arab": { - language: "Central Kurdish", - location: null, - id: 31890, - tag: "ku-Arab", - version: "Release 8" - }, - "ku-arab-iq": { - language: "Central Kurdish", - location: "Iraq", - id: 1170, - tag: "ku-Arab-IQ", - version: "Release 8" - }, - ccp: ccp, - "ccp-cakm": { - language: "Chakma", - location: "Chakma", - id: 4096, - tag: "ccp-Cakm", - version: "Release 10.5" - }, - "ccp-cakm-": { - language: "Chakma", - location: "India", - id: 4096, - tag: "ccp-Cakm-", - version: "Release 10.5" - }, - "cd-ru": { - language: "Chechen", - location: "Russia", - id: 4096, - tag: "cd-RU", - version: "Release 10.1" - }, - chr: chr, - "chr-cher": { - language: "Cherokee", - location: null, - id: 31836, - tag: "chr-Cher", - version: "Release 8" - }, - "chr-cher-us": { - language: "Cherokee", - location: "United States", - id: 1116, - tag: "chr-Cher-US", - version: "Release 8" - }, - cgg: cgg, - "cgg-ug": { - language: "Chiga", - location: "Uganda", - id: 4096, - tag: "cgg-UG", - version: "Release 10" - }, - "zh-hans": { - language: "Chinese (Simplified)", - location: null, - id: 4, - tag: "zh-Hans", - version: "Release A" - }, - zh: zh, - "zh-cn": { - language: "Chinese (Simplified)", - location: "People's Republic of China", - id: 2052, - tag: "zh-CN", - version: "Release A" - }, - "zh-sg": { - language: "Chinese (Simplified)", - location: "Singapore", - id: 4100, - tag: "zh-SG", - version: "Release A" - }, - "zh-hant": { - language: "Chinese (Traditional)", - location: null, - id: 31748, - tag: "zh-Hant", - version: "Release A" - }, - "zh-hk": { - language: "Chinese (Traditional)", - location: "Hong Kong S.A.R.", - id: 3076, - tag: "zh-HK", - version: "Release A" - }, - "zh-mo": { - language: "Chinese (Traditional)", - location: "Macao S.A.R.", - id: 5124, - tag: "zh-MO", - version: "Release D" - }, - "zh-tw": { - language: "Chinese (Traditional)", - location: "Taiwan", - id: 1028, - tag: "zh-TW", - version: "Release A" - }, - "cu-ru": { - language: "Church Slavic", - location: "Russia", - id: 4096, - tag: "cu-RU", - version: "Release 10.1" - }, - swc: swc, - "swc-cd": { - language: "Congo Swahili", - location: "Congo DRC", - id: 4096, - tag: "swc-CD", - version: "Release 10" - }, - kw: kw, - "kw-gb": { - language: "Cornish", - location: "United Kingdom", - id: 4096, - tag: "kw-GB", - version: "Release 10" - }, - co: co, - "co-fr": { - language: "Corsican", - location: "France", - id: 1155, - tag: "co-FR", - version: "Release V" - }, - "hr,": { - language: "Croatian", - location: null, - id: 26, - tag: "hr,", - version: "Release 7" - }, - "hr-hr": { - language: "Croatian", - location: "Croatia", - id: 1050, - tag: "hr-HR", - version: "Release A" - }, - "hr-ba": { - language: "Croatian (Latin)", - location: "Bosnia and Herzegovina", - id: 4122, - tag: "hr-BA", - version: "Release E1" - }, - cs: cs, - "cs-cz": { - language: "Czech", - location: "Czech Republic", - id: 1029, - tag: "cs-CZ", - version: "Release A" - }, - da: da, - "da-dk": { - language: "Danish", - location: "Denmark", - id: 1030, - tag: "da-DK", - version: "Release A" - }, - "da-gl": { - language: "Danish", - location: "Greenland", - id: 4096, - tag: "da-GL", - version: "Release 10" - }, - prs: prs, - "prs-af": { - language: "Dari", - location: "Afghanistan", - id: 1164, - tag: "prs-AF", - version: "Release V" - }, - dv: dv, - "dv-mv": { - language: "Divehi", - location: "Maldives", - id: 1125, - tag: "dv-MV", - version: "Release D" - }, - dua: dua, - "dua-cm": { - language: "Duala", - location: "Cameroon", - id: 4096, - tag: "dua-CM", - version: "Release 10" - }, - nl: nl, - "nl-aw": { - language: "Dutch", - location: "Aruba", - id: 4096, - tag: "nl-AW", - version: "Release 10" - }, - "nl-be": { - language: "Dutch", - location: "Belgium", - id: 2067, - tag: "nl-BE", - version: "Release A" - }, - "nl-bq": { - language: "Dutch", - location: "Bonaire, Sint Eustatius and Saba", - id: 4096, - tag: "nl-BQ", - version: "Release 10" - }, - "nl-cw": { - language: "Dutch", - location: "Curaçao", - id: 4096, - tag: "nl-CW", - version: "Release 10" - }, - "nl-nl": { - language: "Dutch", - location: "Netherlands", - id: 1043, - tag: "nl-NL", - version: "Release A" - }, - "nl-sx": { - language: "Dutch", - location: "Sint Maarten", - id: 4096, - tag: "nl-SX", - version: "Release 10" - }, - "nl-sr": { - language: "Dutch", - location: "Suriname", - id: 4096, - tag: "nl-SR", - version: "Release 10" - }, - dz: dz, - "dz-bt": { - language: "Dzongkha", - location: "Bhutan", - id: 3153, - tag: "dz-BT", - version: "Release 10" - }, - ebu: ebu, - "ebu-ke": { - language: "Embu", - location: "Kenya", - id: 4096, - tag: "ebu-KE", - version: "Release 10" - }, - en: en, - "en-as": { - language: "English", - location: "American Samoa", - id: 4096, - tag: "en-AS", - version: "Release 10" - }, - "en-ai": { - language: "English", - location: "Anguilla", - id: 4096, - tag: "en-AI", - version: "Release 10" - }, - "en-ag": { - language: "English", - location: "Antigua and Barbuda", - id: 4096, - tag: "en-AG", - version: "Release 10" - }, - "en-au": { - language: "English", - location: "Australia", - id: 3081, - tag: "en-AU", - version: "Release A" - }, - "en-at": { - language: "English", - location: "Austria", - id: 4096, - tag: "en-AT", - version: "Release 10.1" - }, - "en-bs": { - language: "English", - location: "Bahamas", - id: 4096, - tag: "en-BS", - version: "Release 10" - }, - "en-bb": { - language: "English", - location: "Barbados", - id: 4096, - tag: "en-BB", - version: "Release 10" - }, - "en-be": { - language: "English", - location: "Belgium", - id: 4096, - tag: "en-BE", - version: "Release 10" - }, - "en-bz": { - language: "English", - location: "Belize", - id: 10249, - tag: "en-BZ", - version: "Release B" - }, - "en-bm": { - language: "English", - location: "Bermuda", - id: 4096, - tag: "en-BM", - version: "Release 10" - }, - "en-bw": { - language: "English", - location: "Botswana", - id: 4096, - tag: "en-BW", - version: "Release 10" - }, - "en-io": { - language: "English", - location: "British Indian Ocean Territory", - id: 4096, - tag: "en-IO", - version: "Release 10" - }, - "en-vg": { - language: "English", - location: "British Virgin Islands", - id: 4096, - tag: "en-VG", - version: "Release 10" - }, - "en-bi": { - language: "English", - location: "Burundi", - id: 4096, - tag: "en-BI", - version: "Release 10.1" - }, - "en-cm": { - language: "English", - location: "Cameroon", - id: 4096, - tag: "en-CM", - version: "Release 10" - }, - "en-ca": { - language: "English", - location: "Canada", - id: 4105, - tag: "en-CA", - version: "Release A" - }, - "en-029": { - language: "English", - location: "Caribbean", - id: 9225, - tag: "en-029", - version: "Release B" - }, - "en-ky": { - language: "English", - location: "Cayman Islands", - id: 4096, - tag: "en-KY", - version: "Release 10" - }, - "en-cx": { - language: "English", - location: "Christmas Island", - id: 4096, - tag: "en-CX", - version: "Release 10" - }, - "en-cc": { - language: "English", - location: "Cocos [Keeling] Islands", - id: 4096, - tag: "en-CC", - version: "Release 10" - }, - "en-ck": { - language: "English", - location: "Cook Islands", - id: 4096, - tag: "en-CK", - version: "Release 10" - }, - "en-cy": { - language: "English", - location: "Cyprus", - id: 4096, - tag: "en-CY", - version: "Release 10.1" - }, - "en-dk": { - language: "English", - location: "Denmark", - id: 4096, - tag: "en-DK", - version: "Release 10.1" - }, - "en-dm": { - language: "English", - location: "Dominica", - id: 4096, - tag: "en-DM", - version: "Release 10" - }, - "en-er": { - language: "English", - location: "Eritrea", - id: 4096, - tag: "en-ER", - version: "Release 10" - }, - "en-150": { - language: "English", - location: "Europe", - id: 4096, - tag: "en-150", - version: "Release 10" - }, - "en-fk": { - language: "English", - location: "Falkland Islands", - id: 4096, - tag: "en-FK", - version: "Release 10" - }, - "en-fi": { - language: "English", - location: "Finland", - id: 4096, - tag: "en-FI", - version: "Release 10.1" - }, - "en-fj": { - language: "English", - location: "Fiji", - id: 4096, - tag: "en-FJ", - version: "Release 10" - }, - "en-gm": { - language: "English", - location: "Gambia", - id: 4096, - tag: "en-GM", - version: "Release 10" - }, - "en-de": { - language: "English", - location: "Germany", - id: 4096, - tag: "en-DE", - version: "Release 10.1" - }, - "en-gh": { - language: "English", - location: "Ghana", - id: 4096, - tag: "en-GH", - version: "Release 10" - }, - "en-gi": { - language: "English", - location: "Gibraltar", - id: 4096, - tag: "en-GI", - version: "Release 10" - }, - "en-gd": { - language: "English", - location: "Grenada", - id: 4096, - tag: "en-GD", - version: "Release 10" - }, - "en-gu": { - language: "English", - location: "Guam", - id: 4096, - tag: "en-GU", - version: "Release 10" - }, - "en-gg": { - language: "English", - location: "Guernsey", - id: 4096, - tag: "en-GG", - version: "Release 10" - }, - "en-gy": { - language: "English", - location: "Guyana", - id: 4096, - tag: "en-GY", - version: "Release 10" - }, - "en-hk": { - language: "English", - location: "Hong Kong", - id: 15369, - tag: "en-HK", - version: "Release 8.1" - }, - "en-in": { - language: "English", - location: "India", - id: 16393, - tag: "en-IN", - version: "Release V" - }, - "en-ie": { - language: "English", - location: "Ireland", - id: 6153, - tag: "en-IE", - version: "Release A" - }, - "en-im": { - language: "English", - location: "Isle of Man", - id: 4096, - tag: "en-IM", - version: "Release 10" - }, - "en-il": { - language: "English", - location: "Israel", - id: 4096, - tag: "en-IL", - version: "Release 10.1" - }, - "en-jm": { - language: "English", - location: "Jamaica", - id: 8201, - tag: "en-JM", - version: "Release B" - }, - "en-je": { - language: "English", - location: "Jersey", - id: 4096, - tag: "en-JE", - version: "Release 10" - }, - "en-ke": { - language: "English", - location: "Kenya", - id: 4096, - tag: "en-KE", - version: "Release 10" - }, - "en-ki": { - language: "English", - location: "Kiribati", - id: 4096, - tag: "en-KI", - version: "Release 10" - }, - "en-ls": { - language: "English", - location: "Lesotho", - id: 4096, - tag: "en-LS", - version: "Release 10" - }, - "en-lr": { - language: "English", - location: "Liberia", - id: 4096, - tag: "en-LR", - version: "Release 10" - }, - "en-mo": { - language: "English", - location: "Macao SAR", - id: 4096, - tag: "en-MO", - version: "Release 10" - }, - "en-mg": { - language: "English", - location: "Madagascar", - id: 4096, - tag: "en-MG", - version: "Release 10" - }, - "en-mw": { - language: "English", - location: "Malawi", - id: 4096, - tag: "en-MW", - version: "Release 10" - }, - "en-my": { - language: "English", - location: "Malaysia", - id: 17417, - tag: "en-MY", - version: "Release V" - }, - "en-mt": { - language: "English", - location: "Malta", - id: 4096, - tag: "en-MT", - version: "Release 10" - }, - "en-mh": { - language: "English", - location: "Marshall Islands", - id: 4096, - tag: "en-MH", - version: "Release 10" - }, - "en-mu": { - language: "English", - location: "Mauritius", - id: 4096, - tag: "en-MU", - version: "Release 10" - }, - "en-fm": { - language: "English", - location: "Micronesia", - id: 4096, - tag: "en-FM", - version: "Release 10" - }, - "en-ms": { - language: "English", - location: "Montserrat", - id: 4096, - tag: "en-MS", - version: "Release 10" - }, - "en-na": { - language: "English", - location: "Namibia", - id: 4096, - tag: "en-NA", - version: "Release 10" - }, - "en-nr": { - language: "English", - location: "Nauru", - id: 4096, - tag: "en-NR", - version: "Release 10" - }, - "en-nl": { - language: "English", - location: "Netherlands", - id: 4096, - tag: "en-NL", - version: "Release 10.1" - }, - "en-nz": { - language: "English", - location: "New Zealand", - id: 5129, - tag: "en-NZ", - version: "Release A" - }, - "en-ng": { - language: "English", - location: "Nigeria", - id: 4096, - tag: "en-NG", - version: "Release 10" - }, - "en-nu": { - language: "English", - location: "Niue", - id: 4096, - tag: "en-NU", - version: "Release 10" - }, - "en-nf": { - language: "English", - location: "Norfolk Island", - id: 4096, - tag: "en-NF", - version: "Release 10" - }, - "en-mp": { - language: "English", - location: "Northern Mariana Islands", - id: 4096, - tag: "en-MP", - version: "Release 10" - }, - "en-pk": { - language: "English", - location: "Pakistan", - id: 4096, - tag: "en-PK", - version: "Release 10" - }, - "en-pw": { - language: "English", - location: "Palau", - id: 4096, - tag: "en-PW", - version: "Release 10" - }, - "en-pg": { - language: "English", - location: "Papua New Guinea", - id: 4096, - tag: "en-PG", - version: "Release 10" - }, - "en-pn": { - language: "English", - location: "Pitcairn Islands", - id: 4096, - tag: "en-PN", - version: "Release 10" - }, - "en-pr": { - language: "English", - location: "Puerto Rico", - id: 4096, - tag: "en-PR", - version: "Release 10" - }, - "en-ph": { - language: "English", - location: "Republic of the Philippines", - id: 13321, - tag: "en-PH", - version: "Release C" - }, - "en-rw": { - language: "English", - location: "Rwanda", - id: 4096, - tag: "en-RW", - version: "Release 10" - }, - "en-kn": { - language: "English", - location: "Saint Kitts and Nevis", - id: 4096, - tag: "en-KN", - version: "Release 10" - }, - "en-lc": { - language: "English", - location: "Saint Lucia", - id: 4096, - tag: "en-LC", - version: "Release 10" - }, - "en-vc": { - language: "English", - location: "Saint Vincent and the Grenadines", - id: 4096, - tag: "en-VC", - version: "Release 10" - }, - "en-ws": { - language: "English", - location: "Samoa", - id: 4096, - tag: "en-WS", - version: "Release 10" - }, - "en-sc": { - language: "English", - location: "Seychelles", - id: 4096, - tag: "en-SC", - version: "Release 10" - }, - "en-sl": { - language: "English", - location: "Sierra Leone", - id: 4096, - tag: "en-SL", - version: "Release 10" - }, - "en-sg": { - language: "English", - location: "Singapore", - id: 18441, - tag: "en-SG", - version: "Release V" - }, - "en-sx": { - language: "English", - location: "Sint Maarten", - id: 4096, - tag: "en-SX", - version: "Release 10" - }, - "en-si": { - language: "English", - location: "Slovenia", - id: 4096, - tag: "en-SI", - version: "Release 10.1" - }, - "en-sb": { - language: "English", - location: "Solomon Islands", - id: 4096, - tag: "en-SB", - version: "Release 10" - }, - "en-za": { - language: "English", - location: "South Africa", - id: 7177, - tag: "en-ZA", - version: "Release B" - }, - "en-ss": { - language: "English", - location: "South Sudan", - id: 4096, - tag: "en-SS", - version: "Release 10" - }, - "en-sh": { - language: "English", - location: "St Helena, Ascension, Tristan da Cunha", - id: 4096, - tag: "en-SH", - version: "Release 10" - }, - "en-sd": { - language: "English", - location: "Sudan", - id: 4096, - tag: "en-SD", - version: "Release 10" - }, - "en-sz": { - language: "English", - location: "Swaziland", - id: 4096, - tag: "en-SZ", - version: "Release 10" - }, - "en-se": { - language: "English", - location: "Sweden", - id: 4096, - tag: "en-SE", - version: "Release 10.1" - }, - "en-ch": { - language: "English", - location: "Switzerland", - id: 4096, - tag: "en-CH", - version: "Release 10.1" - }, - "en-tz": { - language: "English", - location: "Tanzania", - id: 4096, - tag: "en-TZ", - version: "Release 10" - }, - "en-tk": { - language: "English", - location: "Tokelau", - id: 4096, - tag: "en-TK", - version: "Release 10" - }, - "en-to": { - language: "English", - location: "Tonga", - id: 4096, - tag: "en-TO", - version: "Release 10" - }, - "en-tt": { - language: "English", - location: "Trinidad and Tobago", - id: 11273, - tag: "en-TT", - version: "Release B" - }, - "en-tc": { - language: "English", - location: "Turks and Caicos Islands", - id: 4096, - tag: "en-TC", - version: "Release 10" - }, - "en-tv": { - language: "English", - location: "Tuvalu", - id: 4096, - tag: "en-TV", - version: "Release 10" - }, - "en-ug": { - language: "English", - location: "Uganda", - id: 4096, - tag: "en-UG", - version: "Release 10" - }, - "en-ae": { - language: "English", - location: "United Arab Emirates", - id: 19465, - tag: "en-AE", - version: "Release 10.5" - }, - "en-gb": { - language: "English", - location: "United Kingdom", - id: 2057, - tag: "en-GB", - version: "Release A" - }, - "en-us": { - language: "English", - location: "United States", - id: 1033, - tag: "en-US", - version: "Release A" - }, - "en-um": { - language: "English", - location: "US Minor Outlying Islands", - id: 4096, - tag: "en-UM", - version: "Release 10" - }, - "en-vi": { - language: "English", - location: "US Virgin Islands", - id: 4096, - tag: "en-VI", - version: "Release 10" - }, - "en-vu": { - language: "English", - location: "Vanuatu", - id: 4096, - tag: "en-VU", - version: "Release 10" - }, - "en-001": { - language: "English", - location: "World", - id: 4096, - tag: "en-001", - version: "Release 10" - }, - "en-zm": { - language: "English", - location: "Zambia", - id: 4096, - tag: "en-ZM", - version: "Release 10" - }, - "en-zw": { - language: "English", - location: "Zimbabwe", - id: 12297, - tag: "en-ZW", - version: "Release C" - }, - eo: eo, - "eo-001": { - language: "Esperanto", - location: "World", - id: 4096, - tag: "eo-001", - version: "Release 10" - }, - et: et, - "et-ee": { - language: "Estonian", - location: "Estonia", - id: 1061, - tag: "et-EE", - version: "Release B" - }, - ee: ee, - "ee-gh": { - language: "Ewe", - location: "Ghana", - id: 4096, - tag: "ee-GH", - version: "Release 10" - }, - "ee-tg": { - language: "Ewe", - location: "Togo", - id: 4096, - tag: "ee-TG", - version: "Release 10" - }, - ewo: ewo, - "ewo-cm": { - language: "Ewondo", - location: "Cameroon", - id: 4096, - tag: "ewo-CM", - version: "Release 10" - }, - fo: fo, - "fo-dk": { - language: "Faroese", - location: "Denmark", - id: 4096, - tag: "fo-DK", - version: "Release 10.1" - }, - "fo-fo": { - language: "Faroese", - location: "Faroe Islands", - id: 1080, - tag: "fo-FO", - version: "Release B" - }, - fil: fil, - "fil-ph": { - language: "Filipino", - location: "Philippines", - id: 1124, - tag: "fil-PH", - version: "Release E2" - }, - fi: fi, - "fi-fi": { - language: "Finnish", - location: "Finland", - id: 1035, - tag: "fi-FI", - version: "Release A" - }, - fr: fr, - "fr-dz": { - language: "French", - location: "Algeria", - id: 4096, - tag: "fr-DZ", - version: "Release 10" - }, - "fr-be": { - language: "French", - location: "Belgium", - id: 2060, - tag: "fr-BE", - version: "Release A" - }, - "fr-bj": { - language: "French", - location: "Benin", - id: 4096, - tag: "fr-BJ", - version: "Release 10" - }, - "fr-bf": { - language: "French", - location: "Burkina Faso", - id: 4096, - tag: "fr-BF", - version: "Release 10" - }, - "fr-bi": { - language: "French", - location: "Burundi", - id: 4096, - tag: "fr-BI", - version: "Release 10" - }, - "fr-cm": { - language: "French", - location: "Cameroon", - id: 11276, - tag: "fr-CM", - version: "Release 8.1" - }, - "fr-ca": { - language: "French", - location: "Canada", - id: 3084, - tag: "fr-CA", - version: "Release A" - }, - "fr-cf": { - language: "French", - location: "Central African Republic", - id: 4096, - tag: "fr-CF", - version: "Release10" - }, - "fr-td": { - language: "French", - location: "Chad", - id: 4096, - tag: "fr-TD", - version: "Release 10" - }, - "fr-km": { - language: "French", - location: "Comoros", - id: 4096, - tag: "fr-KM", - version: "Release 10" - }, - "fr-cg": { - language: "French", - location: "Congo", - id: 4096, - tag: "fr-CG", - version: "Release 10" - }, - "fr-cd": { - language: "French", - location: "Congo, DRC", - id: 9228, - tag: "fr-CD", - version: "Release 8.1" - }, - "fr-ci": { - language: "French", - location: "Côte d'Ivoire", - id: 12300, - tag: "fr-CI", - version: "Release 8.1" - }, - "fr-dj": { - language: "French", - location: "Djibouti", - id: 4096, - tag: "fr-DJ", - version: "Release 10" - }, - "fr-gq": { - language: "French", - location: "Equatorial Guinea", - id: 4096, - tag: "fr-GQ", - version: "Release 10" - }, - "fr-fr": { - language: "French", - location: "France", - id: 1036, - tag: "fr-FR", - version: "Release A" - }, - "fr-gf": { - language: "French", - location: "French Guiana", - id: 4096, - tag: "fr-GF", - version: "Release 10" - }, - "fr-pf": { - language: "French", - location: "French Polynesia", - id: 4096, - tag: "fr-PF", - version: "Release 10" - }, - "fr-ga": { - language: "French", - location: "Gabon", - id: 4096, - tag: "fr-GA", - version: "Release 10" - }, - "fr-gp": { - language: "French", - location: "Guadeloupe", - id: 4096, - tag: "fr-GP", - version: "Release 10" - }, - "fr-gn": { - language: "French", - location: "Guinea", - id: 4096, - tag: "fr-GN", - version: "Release 10" - }, - "fr-ht": { - language: "French", - location: "Haiti", - id: 15372, - tag: "fr-HT", - version: "Release 8.1" - }, - "fr-lu": { - language: "French", - location: "Luxembourg", - id: 5132, - tag: "fr-LU", - version: "Release A" - }, - "fr-mg": { - language: "French", - location: "Madagascar", - id: 4096, - tag: "fr-MG", - version: "Release 10" - }, - "fr-ml": { - language: "French", - location: "Mali", - id: 13324, - tag: "fr-ML", - version: "Release 8.1" - }, - "fr-mq": { - language: "French", - location: "Martinique", - id: 4096, - tag: "fr-MQ", - version: "Release 10" - }, - "fr-mr": { - language: "French", - location: "Mauritania", - id: 4096, - tag: "fr-MR", - version: "Release 10" - }, - "fr-mu": { - language: "French", - location: "Mauritius", - id: 4096, - tag: "fr-MU", - version: "Release 10" - }, - "fr-yt": { - language: "French", - location: "Mayotte", - id: 4096, - tag: "fr-YT", - version: "Release 10" - }, - "fr-ma": { - language: "French", - location: "Morocco", - id: 14348, - tag: "fr-MA", - version: "Release 8.1" - }, - "fr-nc": { - language: "French", - location: "New Caledonia", - id: 4096, - tag: "fr-NC", - version: "Release 10" - }, - "fr-ne": { - language: "French", - location: "Niger", - id: 4096, - tag: "fr-NE", - version: "Release 10" - }, - "fr-mc": { - language: "French", - location: "Principality of Monaco", - id: 6156, - tag: "fr-MC", - version: "Release A" - }, - "fr-re": { - language: "French", - location: "Reunion", - id: 8204, - tag: "fr-RE", - version: "Release 8.1" - }, - "fr-rw": { - language: "French", - location: "Rwanda", - id: 4096, - tag: "fr-RW", - version: "Release 10" - }, - "fr-bl": { - language: "French", - location: "Saint Barthélemy", - id: 4096, - tag: "fr-BL", - version: "Release 10" - }, - "fr-mf": { - language: "French", - location: "Saint Martin", - id: 4096, - tag: "fr-MF", - version: "Release 10" - }, - "fr-pm": { - language: "French", - location: "Saint Pierre and Miquelon", - id: 4096, - tag: "fr-PM", - version: "Release 10" - }, - "fr-sn": { - language: "French", - location: "Senegal", - id: 10252, - tag: "fr-SN", - version: "Release 8.1" - }, - "fr-sc": { - language: "French", - location: "Seychelles", - id: 4096, - tag: "fr-SC", - version: "Release 10" - }, - "fr-ch": { - language: "French", - location: "Switzerland", - id: 4108, - tag: "fr-CH", - version: "Release A" - }, - "fr-sy": { - language: "French", - location: "Syria", - id: 4096, - tag: "fr-SY", - version: "Release 10" - }, - "fr-tg": { - language: "French", - location: "Togo", - id: 4096, - tag: "fr-TG", - version: "Release 10" - }, - "fr-tn": { - language: "French", - location: "Tunisia", - id: 4096, - tag: "fr-TN", - version: "Release 10" - }, - "fr-vu": { - language: "French", - location: "Vanuatu", - id: 4096, - tag: "fr-VU", - version: "Release 10" - }, - "fr-wf": { - language: "French", - location: "Wallis and Futuna", - id: 4096, - tag: "fr-WF", - version: "Release 10" - }, - fy: fy, - "fy-nl": { - language: "Frisian", - location: "Netherlands", - id: 1122, - tag: "fy-NL", - version: "Release E2" - }, - fur: fur, - "fur-it": { - language: "Friulian", - location: "Italy", - id: 4096, - tag: "fur-IT", - version: "Release 10" - }, - ff: ff, - "ff-latn": { - language: "Fulah (Latin)", - location: null, - id: 31847, - tag: "ff-Latn", - version: "Release 8" - }, - "ff-latn-bf": { - language: "Fulah (Latin)", - location: "Burkina Faso", - id: 4096, - tag: "ff-Latn-BF", - version: "Release 10.4" - }, - "ff-cm": { - language: "Fulah", - location: "Cameroon", - id: 4096, - tag: "ff-CM", - version: "Release 10" - }, - "ff-latn-cm": { - language: "Fulah (Latin)", - location: "Cameroon", - id: 4096, - tag: "ff-Latn-CM", - version: "Release 10.4" - }, - "ff-latn-gm": { - language: "Fulah (Latin)", - location: "Gambia", - id: 4096, - tag: "ff-Latn-GM", - version: "Release 10.4" - }, - "ff-latn-gh": { - language: "Fulah (Latin)", - location: "Ghana", - id: 4096, - tag: "ff-Latn-GH", - version: "Release 10.4" - }, - "ff-gn": { - language: "Fulah", - location: "Guinea", - id: 4096, - tag: "ff-GN", - version: "Release 10" - }, - "ff-latn-gn": { - language: "Fulah (Latin)", - location: "Guinea", - id: 4096, - tag: "ff-Latn-GN", - version: "Release 10.4" - }, - "ff-latn-gw": { - language: "Fulah (Latin)", - location: "Guinea-Bissau", - id: 4096, - tag: "ff-Latn-GW", - version: "Release 10.4" - }, - "ff-latn-lr": { - language: "Fulah (Latin)", - location: "Liberia", - id: 4096, - tag: "ff-Latn-LR", - version: "Release 10.4" - }, - "ff-mr": { - language: "Fulah", - location: "Mauritania", - id: 4096, - tag: "ff-MR", - version: "Release 10" - }, - "ff-latn-mr": { - language: "Fulah (Latin)", - location: "Mauritania", - id: 4096, - tag: "ff-Latn-MR", - version: "Release 10.4" - }, - "ff-latn-ne": { - language: "Fulah (Latin)", - location: "Niger", - id: 4096, - tag: "ff-Latn-NE", - version: "Release 10.4" - }, - "ff-ng": { - language: "Fulah", - location: "Nigeria", - id: 4096, - tag: "ff-NG", - version: "Release 10" - }, - "ff-latn-ng": { - language: "Fulah (Latin)", - location: "Nigeria", - id: 4096, - tag: "ff-Latn-NG", - version: "Release 10.4" - }, - "ff-latn-sn": { - language: "Fulah", - location: "Senegal", - id: 2151, - tag: "ff-Latn-SN", - version: "Release 8" - }, - "ff-latn-sl": { - language: "Fulah (Latin)", - location: "Sierra Leone", - id: 4096, - tag: "ff-Latn-SL", - version: "Release 10.4" - }, - gl: gl, - "gl-es": { - language: "Galician", - location: "Spain", - id: 1110, - tag: "gl-ES", - version: "Release D" - }, - lg: lg, - "lg-ug": { - language: "Ganda", - location: "Uganda", - id: 4096, - tag: "lg-UG", - version: "Release 10" - }, - ka: ka$1, - "ka-ge": { - language: "Georgian", - location: "Georgia", - id: 1079, - tag: "ka-GE", - version: "Release C" - }, - de: de, - "de-at": { - language: "German", - location: "Austria", - id: 3079, - tag: "de-AT", - version: "Release A" - }, - "de-be": { - language: "German", - location: "Belgium", - id: 4096, - tag: "de-BE", - version: "Release 10" - }, - "de-de": { - language: "German", - location: "Germany", - id: 1031, - tag: "de-DE", - version: "Release A" - }, - "de-it": { - language: "German", - location: "Italy", - id: 4096, - tag: "de-IT", - version: "Release 10.2" - }, - "de-li": { - language: "German", - location: "Liechtenstein", - id: 5127, - tag: "de-LI", - version: "Release B" - }, - "de-lu": { - language: "German", - location: "Luxembourg", - id: 4103, - tag: "de-LU", - version: "Release B" - }, - "de-ch": { - language: "German", - location: "Switzerland", - id: 2055, - tag: "de-CH", - version: "Release A" - }, - el: el, - "el-cy": { - language: "Greek", - location: "Cyprus", - id: 4096, - tag: "el-CY", - version: "Release 10" - }, - "el-gr": { - language: "Greek", - location: "Greece", - id: 1032, - tag: "el-GR", - version: "Release A" - }, - kl: kl, - "kl-gl": { - language: "Greenlandic", - location: "Greenland", - id: 1135, - tag: "kl-GL", - version: "Release V" - }, - gn: gn, - "gn-py": { - language: "Guarani", - location: "Paraguay", - id: 1140, - tag: "gn-PY", - version: "Release 8.1" - }, - gu: gu, - "gu-in": { - language: "Gujarati", - location: "India", - id: 1095, - tag: "gu-IN", - version: "Release D" - }, - guz: guz, - "guz-ke": { - language: "Gusii", - location: "Kenya", - id: 4096, - tag: "guz-KE", - version: "Release 10" - }, - ha: ha, - "ha-latn": { - language: "Hausa (Latin)", - location: null, - id: 31848, - tag: "ha-Latn", - version: "Windows 7" - }, - "ha-latn-gh": { - language: "Hausa (Latin)", - location: "Ghana", - id: 4096, - tag: "ha-Latn-GH", - version: "Release 10" - }, - "ha-latn-ne": { - language: "Hausa (Latin)", - location: "Niger", - id: 4096, - tag: "ha-Latn-NE", - version: "Release 10" - }, - "ha-latn-ng": { - language: "Hausa (Latin)", - location: "Nigeria", - id: 1128, - tag: "ha-Latn-NG", - version: "Release V" - }, - haw: haw, - "haw-us": { - language: "Hawaiian", - location: "United States", - id: 1141, - tag: "haw-US", - version: "Release 8" - }, - he: he, - "he-il": { - language: "Hebrew", - location: "Israel", - id: 1037, - tag: "he-IL", - version: "Release B" - }, - hi: hi, - "hi-in": { - language: "Hindi", - location: "India", - id: 1081, - tag: "hi-IN", - version: "Release C" - }, - hu: hu, - "hu-hu": { - language: "Hungarian", - location: "Hungary", - id: 1038, - tag: "hu-HU", - version: "Release A" - }, - is: is, - "is-is": { - language: "Icelandic", - location: "Iceland", - id: 1039, - tag: "is-IS", - version: "Release A" - }, - ig: ig, - "ig-ng": { - language: "Igbo", - location: "Nigeria", - id: 1136, - tag: "ig-NG", - version: "Release V" - }, - id: id, - "id-id": { - language: "Indonesian", - location: "Indonesia", - id: 1057, - tag: "id-ID", - version: "Release B" - }, - ia: ia, - "ia-fr": { - language: "Interlingua", - location: "France", - id: 4096, - tag: "ia-FR", - version: "Release 10" - }, - "ia-001": { - language: "Interlingua", - location: "World", - id: 4096, - tag: "ia-001", - version: "Release 10" - }, - iu: iu, - "iu-latn": { - language: "Inuktitut (Latin)", - location: null, - id: 31837, - tag: "iu-Latn", - version: "Windows 7" - }, - "iu-latn-ca": { - language: "Inuktitut (Latin)", - location: "Canada", - id: 2141, - tag: "iu-Latn-CA", - version: "Release E2" - }, - "iu-cans": { - language: "Inuktitut (Syllabics)", - location: null, - id: 30813, - tag: "iu-Cans", - version: "Windows 7" - }, - "iu-cans-ca": { - language: "Inuktitut (Syllabics)", - location: "Canada", - id: 1117, - tag: "iu-Cans-CA", - version: "Release V" - }, - ga: ga, - "ga-ie": { - language: "Irish", - location: "Ireland", - id: 2108, - tag: "ga-IE", - version: "Release E2" - }, - it: it, - "it-it": { - language: "Italian", - location: "Italy", - id: 1040, - tag: "it-IT", - version: "Release A" - }, - "it-sm": { - language: "Italian", - location: "San Marino", - id: 4096, - tag: "it-SM", - version: "Release 10" - }, - "it-ch": { - language: "Italian", - location: "Switzerland", - id: 2064, - tag: "it-CH", - version: "Release A" - }, - "it-va": { - language: "Italian", - location: "Vatican City", - id: 4096, - tag: "it-VA", - version: "Release 10.3" - }, - ja: ja, - "ja-jp": { - language: "Japanese", - location: "Japan", - id: 1041, - tag: "ja-JP", - version: "Release A" - }, - jv: jv, - "jv-latn": { - language: "Javanese", - location: "Latin", - id: 4096, - tag: "jv-Latn", - version: "Release 8.1" - }, - "jv-latn-id": { - language: "Javanese", - location: "Latin, Indonesia", - id: 4096, - tag: "jv-Latn-ID", - version: "Release 8.1" - }, - dyo: dyo, - "dyo-sn": { - language: "Jola-Fonyi", - location: "Senegal", - id: 4096, - tag: "dyo-SN", - version: "Release 10" - }, - kea: kea, - "kea-cv": { - language: "Kabuverdianu", - location: "Cabo Verde", - id: 4096, - tag: "kea-CV", - version: "Release 10" - }, - kab: kab, - "kab-dz": { - language: "Kabyle", - location: "Algeria", - id: 4096, - tag: "kab-DZ", - version: "Release 10" - }, - kkj: kkj, - "kkj-cm": { - language: "Kako", - location: "Cameroon", - id: 4096, - tag: "kkj-CM", - version: "Release 10" - }, - kln: kln, - "kln-ke": { - language: "Kalenjin", - location: "Kenya", - id: 4096, - tag: "kln-KE", - version: "Release 10" - }, - kam: kam, - "kam-ke": { - language: "Kamba", - location: "Kenya", - id: 4096, - tag: "kam-KE", - version: "Release 10" - }, - kn: kn, - "kn-in": { - language: "Kannada", - location: "India", - id: 1099, - tag: "kn-IN", - version: "Release D" - }, - ks: ks, - "ks-arab": { - language: "Kashmiri", - location: "Perso-Arabic", - id: 1120, - tag: "ks-Arab", - version: "Release 10" - }, - "ks-arab-in": { - language: "Kashmiri", - location: "Perso-Arabic", - id: 4096, - tag: "ks-Arab-IN", - version: "Release 10" - }, - kk: kk, - "kk-kz": { - language: "Kazakh", - location: "Kazakhstan", - id: 1087, - tag: "kk-KZ", - version: "Release C" - }, - km: km, - "km-kh": { - language: "Khmer", - location: "Cambodia", - id: 1107, - tag: "km-KH", - version: "Release V" - }, - quc: quc, - "quc-latn-gt": { - language: "K'iche", - location: "Guatemala", - id: 1158, - tag: "quc-Latn-GT", - version: "Release 10" - }, - ki: ki, - "ki-ke": { - language: "Kikuyu", - location: "Kenya", - id: 4096, - tag: "ki-KE", - version: "Release 10" - }, - rw: rw, - "rw-rw": { - language: "Kinyarwanda", - location: "Rwanda", - id: 1159, - tag: "rw-RW", - version: "Release V" - }, - sw: sw, - "sw-ke": { - language: "Kiswahili", - location: "Kenya", - id: 1089, - tag: "sw-KE", - version: "Release C" - }, - "sw-tz": { - language: "Kiswahili", - location: "Tanzania", - id: 4096, - tag: "sw-TZ", - version: "Release 10" - }, - "sw-ug": { - language: "Kiswahili", - location: "Uganda", - id: 4096, - tag: "sw-UG", - version: "Release 10" - }, - kok: kok, - "kok-in": { - language: "Konkani", - location: "India", - id: 1111, - tag: "kok-IN", - version: "Release C" - }, - ko: ko, - "ko-kr": { - language: "Korean", - location: "Korea", - id: 1042, - tag: "ko-KR", - version: "Release A" - }, - "ko-kp": { - language: "Korean", - location: "North Korea", - id: 4096, - tag: "ko-KP", - version: "Release 10.1" - }, - khq: khq, - "khq-ml": { - language: "Koyra Chiini", - location: "Mali", - id: 4096, - tag: "khq-ML", - version: "Release 10" - }, - ses: ses, - "ses-ml": { - language: "Koyraboro Senni", - location: "Mali", - id: 4096, - tag: "ses-ML", - version: "Release 10" - }, - nmg: nmg, - "nmg-cm": { - language: "Kwasio", - location: "Cameroon", - id: 4096, - tag: "nmg-CM", - version: "Release 10" - }, - ky: ky$1, - "ky-kg": { - language: "Kyrgyz", - location: "Kyrgyzstan", - id: 1088, - tag: "ky-KG", - version: "Release D" - }, - "ku-arab-ir": { - language: "Kurdish", - location: "Perso-Arabic, Iran", - id: 4096, - tag: "ku-Arab-IR", - version: "Release 10.1" - }, - lkt: lkt, - "lkt-us": { - language: "Lakota", - location: "United States", - id: 4096, - tag: "lkt-US", - version: "Release 10" - }, - lag: lag, - "lag-tz": { - language: "Langi", - location: "Tanzania", - id: 4096, - tag: "lag-TZ", - version: "Release 10" - }, - lo: lo, - "lo-la": { - language: "Lao", - location: "Lao P.D.R.", - id: 1108, - tag: "lo-LA", - version: "Release V" - }, - lv: lv, - "lv-lv": { - language: "Latvian", - location: "Latvia", - id: 1062, - tag: "lv-LV", - version: "Release B" - }, - ln: ln, - "ln-ao": { - language: "Lingala", - location: "Angola", - id: 4096, - tag: "ln-AO", - version: "Release 10" - }, - "ln-cf": { - language: "Lingala", - location: "Central African Republic", - id: 4096, - tag: "ln-CF", - version: "Release 10" - }, - "ln-cg": { - language: "Lingala", - location: "Congo", - id: 4096, - tag: "ln-CG", - version: "Release 10" - }, - "ln-cd": { - language: "Lingala", - location: "Congo DRC", - id: 4096, - tag: "ln-CD", - version: "Release 10" - }, - lt: lt, - "lt-lt": { - language: "Lithuanian", - location: "Lithuania", - id: 1063, - tag: "lt-LT", - version: "Release B" - }, - nds: nds, - "nds-de": { - language: "Low German", - location: "Germany", - id: 4096, - tag: "nds-DE", - version: "Release 10.2" - }, - "nds-nl": { - language: "Low German", - location: "Netherlands", - id: 4096, - tag: "nds-NL", - version: "Release 10.2" - }, - dsb: dsb, - "dsb-de": { - language: "Lower Sorbian", - location: "Germany", - id: 2094, - tag: "dsb-DE", - version: "Release V" - }, - lu: lu, - "lu-cd": { - language: "Luba-Katanga", - location: "Congo DRC", - id: 4096, - tag: "lu-CD", - version: "Release 10" - }, - luo: luo, - "luo-ke": { - language: "Luo", - location: "Kenya", - id: 4096, - tag: "luo-KE", - version: "Release 10" - }, - lb: lb, - "lb-lu": { - language: "Luxembourgish", - location: "Luxembourg", - id: 1134, - tag: "lb-LU", - version: "Release E2" - }, - luy: luy, - "luy-ke": { - language: "Luyia", - location: "Kenya", - id: 4096, - tag: "luy-KE", - version: "Release 10" - }, - mk: mk, - "mk-mk": { - language: "Macedonian", - location: "North Macedonia", - id: 1071, - tag: "mk-MK", - version: "Release C" - }, - jmc: jmc, - "jmc-tz": { - language: "Machame", - location: "Tanzania", - id: 4096, - tag: "jmc-TZ", - version: "Release 10" - }, - mgh: mgh, - "mgh-mz": { - language: "Makhuwa-Meetto", - location: "Mozambique", - id: 4096, - tag: "mgh-MZ", - version: "Release 10" - }, - kde: kde, - "kde-tz": { - language: "Makonde", - location: "Tanzania", - id: 4096, - tag: "kde-TZ", - version: "Release 10" - }, - mg: mg, - "mg-mg": { - language: "Malagasy", - location: "Madagascar", - id: 4096, - tag: "mg-MG", - version: "Release 8.1" - }, - ms: ms, - "ms-bn": { - language: "Malay", - location: "Brunei Darussalam", - id: 2110, - tag: "ms-BN", - version: "Release C" - }, - "ms-my": { - language: "Malay", - location: "Malaysia", - id: 1086, - tag: "ms-MY", - version: "Release C" - }, - ml: ml, - "ml-in": { - language: "Malayalam", - location: "India", - id: 1100, - tag: "ml-IN", - version: "Release E1" - }, - mt: mt, - "mt-mt": { - language: "Maltese", - location: "Malta", - id: 1082, - tag: "mt-MT", - version: "Release E1" - }, - gv: gv, - "gv-im": { - language: "Manx", - location: "Isle of Man", - id: 4096, - tag: "gv-IM", - version: "Release 10" - }, - mi: mi, - "mi-nz": { - language: "Maori", - location: "New Zealand", - id: 1153, - tag: "mi-NZ", - version: "Release E1" - }, - arn: arn, - "arn-cl": { - language: "Mapudungun", - location: "Chile", - id: 1146, - tag: "arn-CL", - version: "Release E2" - }, - mr: mr, - "mr-in": { - language: "Marathi", - location: "India", - id: 1102, - tag: "mr-IN", - version: "Release C" - }, - mas: mas, - "mas-ke": { - language: "Masai", - location: "Kenya", - id: 4096, - tag: "mas-KE", - version: "Release 10" - }, - "mas-tz": { - language: "Masai", - location: "Tanzania", - id: 4096, - tag: "mas-TZ", - version: "Release 10" - }, - "mzn-ir": { - language: "Mazanderani", - location: "Iran", - id: 4096, - tag: "mzn-IR", - version: "Release 10.1" - }, - mer: mer, - "mer-ke": { - language: "Meru", - location: "Kenya", - id: 4096, - tag: "mer-KE", - version: "Release 10" - }, - mgo: mgo, - "mgo-cm": { - language: "Meta'", - location: "Cameroon", - id: 4096, - tag: "mgo-CM", - version: "Release 10" - }, - moh: moh, - "moh-ca": { - language: "Mohawk", - location: "Canada", - id: 1148, - tag: "moh-CA", - version: "Release E2" - }, - mn: mn, - "mn-cyrl": { - language: "Mongolian (Cyrillic)", - location: null, - id: 30800, - tag: "mn-Cyrl", - version: "Windows 7" - }, - "mn-mn": { - language: "Mongolian (Cyrillic)", - location: "Mongolia", - id: 1104, - tag: "mn-MN", - version: "Release D" - }, - "mn-mong": { - language: "Mongolian (Traditional Mongolian)", - location: null, - id: 31824, - tag: "mn-Mong", - version: "Windows 7" - }, - "mn-mong-cn": { - language: "Mongolian (Traditional Mongolian)", - location: "People's Republic of China", - id: 2128, - tag: "mn-Mong-CN", - version: "Windows V" - }, - "mn-mong-mn": { - language: "Mongolian (Traditional Mongolian)", - location: "Mongolia", - id: 3152, - tag: "mn-Mong-MN", - version: "Windows 7" - }, - mfe: mfe, - "mfe-mu": { - language: "Morisyen", - location: "Mauritius", - id: 4096, - tag: "mfe-MU", - version: "Release 10" - }, - mua: mua, - "mua-cm": { - language: "Mundang", - location: "Cameroon", - id: 4096, - tag: "mua-CM", - version: "Release 10" - }, - nqo: nqo, - "nqo-gn": { - language: "N'ko", - location: "Guinea", - id: 4096, - tag: "nqo-GN", - version: "Release 8.1" - }, - naq: naq, - "naq-na": { - language: "Nama", - location: "Namibia", - id: 4096, - tag: "naq-NA", - version: "Release 10" - }, - ne: ne, - "ne-in": { - language: "Nepali", - location: "India", - id: 2145, - tag: "ne-IN", - version: "Release 8.1" - }, - "ne-np": { - language: "Nepali", - location: "Nepal", - id: 1121, - tag: "ne-NP", - version: "Release E2" - }, - nnh: nnh, - "nnh-cm": { - language: "Ngiemboon", - location: "Cameroon", - id: 4096, - tag: "nnh-CM", - version: "Release 10" - }, - jgo: jgo, - "jgo-cm": { - language: "Ngomba", - location: "Cameroon", - id: 4096, - tag: "jgo-CM", - version: "Release 10" - }, - "lrc-iq": { - language: "Northern Luri", - location: "Iraq", - id: 4096, - tag: "lrc-IQ", - version: "Release 10.1" - }, - "lrc-ir": { - language: "Northern Luri", - location: "Iran", - id: 4096, - tag: "lrc-IR", - version: "Release 10.1" - }, - nd: nd, - "nd-zw": { - language: "North Ndebele", - location: "Zimbabwe", - id: 4096, - tag: "nd-ZW", - version: "Release 10" - }, - no: no, - nb: nb, - "nb-no": { - language: "Norwegian (Bokmal)", - location: "Norway", - id: 1044, - tag: "nb-NO", - version: "Release A" - }, - nn: nn, - "nn-no": { - language: "Norwegian (Nynorsk)", - location: "Norway", - id: 2068, - tag: "nn-NO", - version: "Release A" - }, - "nb-sj": { - language: "Norwegian Bokmål", - location: "Svalbard and Jan Mayen", - id: 4096, - tag: "nb-SJ", - version: "Release 10" - }, - nus: nus, - "nus-sd": { - language: "Nuer", - location: "Sudan", - id: 4096, - tag: "nus-SD", - version: "Release 10" - }, - "nus-ss": { - language: "Nuer", - location: "South Sudan", - id: 4096, - tag: "nus-SS", - version: "Release 10.1" - }, - nyn: nyn, - "nyn-ug": { - language: "Nyankole", - location: "Uganda", - id: 4096, - tag: "nyn-UG", - version: "Release 10" - }, - oc: oc, - "oc-fr": { - language: "Occitan", - location: "France", - id: 1154, - tag: "oc-FR", - version: "Release V" - }, - or: or, - "or-in": { - language: "Odia", - location: "India", - id: 1096, - tag: "or-IN", - version: "Release V" - }, - om: om, - "om-et": { - language: "Oromo", - location: "Ethiopia", - id: 1138, - tag: "om-ET", - version: "Release 8.1" - }, - "om-ke": { - language: "Oromo", - location: "Kenya", - id: 4096, - tag: "om-KE", - version: "Release 10" - }, - os: os, - "os-ge": { - language: "Ossetian", - location: "Cyrillic, Georgia", - id: 4096, - tag: "os-GE", - version: "Release 10" - }, - "os-ru": { - language: "Ossetian", - location: "Cyrillic, Russia", - id: 4096, - tag: "os-RU", - version: "Release 10" - }, - ps: ps, - "ps-af": { - language: "Pashto", - location: "Afghanistan", - id: 1123, - tag: "ps-AF", - version: "Release E2" - }, - "ps-pk": { - language: "Pashto", - location: "Pakistan", - id: 4096, - tag: "ps-PK", - version: "Release 10.5" - }, - fa: fa, - "fa-af": { - language: "Persian", - location: "Afghanistan", - id: 4096, - tag: "fa-AF", - version: "Release 10" - }, - "fa-ir": { - language: "Persian", - location: "Iran", - id: 1065, - tag: "fa-IR", - version: "Release B" - }, - pl: pl, - "pl-pl": { - language: "Polish", - location: "Poland", - id: 1045, - tag: "pl-PL", - version: "Release A" - }, - pt: pt, - "pt-ao": { - language: "Portuguese", - location: "Angola", - id: 4096, - tag: "pt-AO", - version: "Release 8.1" - }, - "pt-br": { - language: "Portuguese", - location: "Brazil", - id: 1046, - tag: "pt-BR", - version: "Release A" - }, - "pt-cv": { - language: "Portuguese", - location: "Cabo Verde", - id: 4096, - tag: "pt-CV", - version: "Release 10" - }, - "pt-gq": { - language: "Portuguese", - location: "Equatorial Guinea", - id: 4096, - tag: "pt-GQ", - version: "Release 10.2" - }, - "pt-gw": { - language: "Portuguese", - location: "Guinea-Bissau", - id: 4096, - tag: "pt-GW", - version: "Release 10" - }, - "pt-lu": { - language: "Portuguese", - location: "Luxembourg", - id: 4096, - tag: "pt-LU", - version: "Release 10.2" - }, - "pt-mo": { - language: "Portuguese", - location: "Macao SAR", - id: 4096, - tag: "pt-MO", - version: "Release 10" - }, - "pt-mz": { - language: "Portuguese", - location: "Mozambique", - id: 4096, - tag: "pt-MZ", - version: "Release 10" - }, - "pt-pt": { - language: "Portuguese", - location: "Portugal", - id: 2070, - tag: "pt-PT", - version: "Release A" - }, - "pt-st": { - language: "Portuguese", - location: "São Tomé and Príncipe", - id: 4096, - tag: "pt-ST", - version: "Release 10" - }, - "pt-ch": { - language: "Portuguese", - location: "Switzerland", - id: 4096, - tag: "pt-CH", - version: "Release 10.2" - }, - "pt-tl": { - language: "Portuguese", - location: "Timor-Leste", - id: 4096, - tag: "pt-TL", - version: "Release 10" - }, - "prg-001": { - language: "Prussian", - location: null, - id: 4096, - tag: "prg-001", - version: "Release 10.1" - }, - "qps-ploca": { - language: "Pseudo Language", - location: "Pseudo locale for east Asian/complex script localization testing", - id: 1534, - tag: "qps-ploca", - version: "Release 7" - }, - "qps-ploc": { - language: "Pseudo Language", - location: "Pseudo locale used for localization testing", - id: 1281, - tag: "qps-ploc", - version: "Release 7" - }, - "qps-plocm": { - language: "Pseudo Language", - location: "Pseudo locale used for localization testing of mirrored locales", - id: 2559, - tag: "qps-plocm", - version: "Release 7" - }, - pa: pa, - "pa-arab": { - language: "Punjabi", - location: null, - id: 31814, - tag: "pa-Arab", - version: "Release 8" - }, - "pa-in": { - language: "Punjabi", - location: "India", - id: 1094, - tag: "pa-IN", - version: "Release D" - }, - "pa-arab-pk": { - language: "Punjabi", - location: "Islamic Republic of Pakistan", - id: 2118, - tag: "pa-Arab-PK", - version: "Release 8" - }, - quz: quz, - "quz-bo": { - language: "Quechua", - location: "Bolivia", - id: 1131, - tag: "quz-BO", - version: "Release E1" - }, - "quz-ec": { - language: "Quechua", - location: "Ecuador", - id: 2155, - tag: "quz-EC", - version: "Release E1" - }, - "quz-pe": { - language: "Quechua", - location: "Peru", - id: 3179, - tag: "quz-PE", - version: "Release E1" - }, - ksh: ksh, - "ksh-de": { - language: "Ripuarian", - location: "Germany", - id: 4096, - tag: "ksh-DE", - version: "Release 10" - }, - ro: ro, - "ro-md": { - language: "Romanian", - location: "Moldova", - id: 2072, - tag: "ro-MD", - version: "Release 8.1" - }, - "ro-ro": { - language: "Romanian", - location: "Romania", - id: 1048, - tag: "ro-RO", - version: "Release A" - }, - rm: rm, - "rm-ch": { - language: "Romansh", - location: "Switzerland", - id: 1047, - tag: "rm-CH", - version: "Release E2" - }, - rof: rof, - "rof-tz": { - language: "Rombo", - location: "Tanzania", - id: 4096, - tag: "rof-TZ", - version: "Release 10" - }, - rn: rn, - "rn-bi": { - language: "Rundi", - location: "Burundi", - id: 4096, - tag: "rn-BI", - version: "Release 10" - }, - ru: ru, - "ru-by": { - language: "Russian", - location: "Belarus", - id: 4096, - tag: "ru-BY", - version: "Release 10" - }, - "ru-kz": { - language: "Russian", - location: "Kazakhstan", - id: 4096, - tag: "ru-KZ", - version: "Release 10" - }, - "ru-kg": { - language: "Russian", - location: "Kyrgyzstan", - id: 4096, - tag: "ru-KG", - version: "Release 10" - }, - "ru-md": { - language: "Russian", - location: "Moldova", - id: 2073, - tag: "ru-MD", - version: "Release 10" - }, - "ru-ru": { - language: "Russian", - location: "Russia", - id: 1049, - tag: "ru-RU", - version: "Release A" - }, - "ru-ua": { - language: "Russian", - location: "Ukraine", - id: 4096, - tag: "ru-UA", - version: "Release 10" - }, - rwk: rwk, - "rwk-tz": { - language: "Rwa", - location: "Tanzania", - id: 4096, - tag: "rwk-TZ", - version: "Release 10" - }, - ssy: ssy, - "ssy-er": { - language: "Saho", - location: "Eritrea", - id: 4096, - tag: "ssy-ER", - version: "Release 10" - }, - sah: sah, - "sah-ru": { - language: "Sakha", - location: "Russia", - id: 1157, - tag: "sah-RU", - version: "Release V" - }, - saq: saq, - "saq-ke": { - language: "Samburu", - location: "Kenya", - id: 4096, - tag: "saq-KE", - version: "Release 10" - }, - smn: smn, - "smn-fi": { - language: "Sami (Inari)", - location: "Finland", - id: 9275, - tag: "smn-FI", - version: "Release E1" - }, - smj: smj, - "smj-no": { - language: "Sami (Lule)", - location: "Norway", - id: 4155, - tag: "smj-NO", - version: "Release E1" - }, - "smj-se": { - language: "Sami (Lule)", - location: "Sweden", - id: 5179, - tag: "smj-SE", - version: "Release E1" - }, - se: se, - "se-fi": { - language: "Sami (Northern)", - location: "Finland", - id: 3131, - tag: "se-FI", - version: "Release E1" - }, - "se-no": { - language: "Sami (Northern)", - location: "Norway", - id: 1083, - tag: "se-NO", - version: "Release E1" - }, - "se-se": { - language: "Sami (Northern)", - location: "Sweden", - id: 2107, - tag: "se-SE", - version: "Release E1" - }, - sms: sms, - "sms-fi": { - language: "Sami (Skolt)", - location: "Finland", - id: 8251, - tag: "sms-FI", - version: "Release E1" - }, - sma: sma, - "sma-no": { - language: "Sami (Southern)", - location: "Norway", - id: 6203, - tag: "sma-NO", - version: "Release E1" - }, - "sma-se": { - language: "Sami (Southern)", - location: "Sweden", - id: 7227, - tag: "sma-SE", - version: "Release E1" - }, - sg: sg, - "sg-cf": { - language: "Sango", - location: "Central African Republic", - id: 4096, - tag: "sg-CF", - version: "Release 10" - }, - sbp: sbp, - "sbp-tz": { - language: "Sangu", - location: "Tanzania", - id: 4096, - tag: "sbp-TZ", - version: "Release 10" - }, - sa: sa, - "sa-in": { - language: "Sanskrit", - location: "India", - id: 1103, - tag: "sa-IN", - version: "Release C" - }, - gd: gd, - "gd-gb": { - language: "Scottish Gaelic", - location: "United Kingdom", - id: 1169, - tag: "gd-GB", - version: "Release 7" - }, - seh: seh, - "seh-mz": { - language: "Sena", - location: "Mozambique", - id: 4096, - tag: "seh-MZ", - version: "Release 10" - }, - "sr-cyrl": { - language: "Serbian (Cyrillic)", - location: null, - id: 27674, - tag: "sr-Cyrl", - version: "Windows 7" - }, - "sr-cyrl-ba": { - language: "Serbian (Cyrillic)", - location: "Bosnia and Herzegovina", - id: 7194, - tag: "sr-Cyrl-BA", - version: "Release E1" - }, - "sr-cyrl-me": { - language: "Serbian (Cyrillic)", - location: "Montenegro", - id: 12314, - tag: "sr-Cyrl-ME", - version: "Release 7" - }, - "sr-cyrl-rs": { - language: "Serbian (Cyrillic)", - location: "Serbia", - id: 10266, - tag: "sr-Cyrl-RS", - version: "Release 7" - }, - "sr-cyrl-cs": { - language: "Serbian (Cyrillic)", - location: "Serbia and Montenegro (Former)", - id: 3098, - tag: "sr-Cyrl-CS", - version: "Release B" - }, - "sr-latn": { - language: "Serbian (Latin)", - location: null, - id: 28698, - tag: "sr-Latn", - version: "Windows 7" - }, - sr: sr, - "sr-latn-ba": { - language: "Serbian (Latin)", - location: "Bosnia and Herzegovina", - id: 6170, - tag: "sr-Latn-BA", - version: "Release E1" - }, - "sr-latn-me": { - language: "Serbian (Latin)", - location: "Montenegro", - id: 11290, - tag: "sr-Latn-ME", - version: "Release 7" - }, - "sr-latn-rs": { - language: "Serbian (Latin)", - location: "Serbia", - id: 9242, - tag: "sr-Latn-RS", - version: "Release 7" - }, - "sr-latn-cs": { - language: "Serbian (Latin)", - location: "Serbia and Montenegro (Former)", - id: 2074, - tag: "sr-Latn-CS", - version: "Release B" - }, - nso: nso, - "nso-za": { - language: "Sesotho sa Leboa", - location: "South Africa", - id: 1132, - tag: "nso-ZA", - version: "Release E1" - }, - tn: tn, - "tn-bw": { - language: "Setswana", - location: "Botswana", - id: 2098, - tag: "tn-BW", - version: "Release 8" - }, - "tn-za": { - language: "Setswana", - location: "South Africa", - id: 1074, - tag: "tn-ZA", - version: "Release E1" - }, - ksb: ksb, - "ksb-tz": { - language: "Shambala", - location: "Tanzania", - id: 4096, - tag: "ksb-TZ", - version: "Release 10" - }, - sn: sn, - "sn-latn": { - language: "Shona", - location: "Latin", - id: 4096, - tag: "sn-Latn", - version: "Release 8.1" - }, - "sn-latn-zw": { - language: "Shona", - location: "Zimbabwe", - id: 4096, - tag: "sn-Latn-ZW", - version: "Release 8.1" - }, - sd: sd, - "sd-arab": { - language: "Sindhi", - location: null, - id: 31833, - tag: "sd-Arab", - version: "Release 8" - }, - "sd-arab-pk": { - language: "Sindhi", - location: "Islamic Republic of Pakistan", - id: 2137, - tag: "sd-Arab-PK", - version: "Release 8" - }, - si: si, - "si-lk": { - language: "Sinhala", - location: "Sri Lanka", - id: 1115, - tag: "si-LK", - version: "Release V" - }, - sk: sk, - "sk-sk": { - language: "Slovak", - location: "Slovakia", - id: 1051, - tag: "sk-SK", - version: "Release A" - }, - sl: sl, - "sl-si": { - language: "Slovenian", - location: "Slovenia", - id: 1060, - tag: "sl-SI", - version: "Release A" - }, - xog: xog, - "xog-ug": { - language: "Soga", - location: "Uganda", - id: 4096, - tag: "xog-UG", - version: "Release 10" - }, - so: so, - "so-dj": { - language: "Somali", - location: "Djibouti", - id: 4096, - tag: "so-DJ", - version: "Release 10" - }, - "so-et": { - language: "Somali", - location: "Ethiopia", - id: 4096, - tag: "so-ET", - version: "Release 10" - }, - "so-ke": { - language: "Somali", - location: "Kenya", - id: 4096, - tag: "so-KE", - version: "Release 10" - }, - "so-so": { - language: "Somali", - location: "Somalia", - id: 1143, - tag: "so-SO", - version: "Release 8.1" - }, - st: st, - "st-za": { - language: "Sotho", - location: "South Africa", - id: 1072, - tag: "st-ZA", - version: "Release 8.1" - }, - nr: nr, - "nr-za": { - language: "South Ndebele", - location: "South Africa", - id: 4096, - tag: "nr-ZA", - version: "Release 10" - }, - "st-ls": { - language: "Southern Sotho", - location: "Lesotho", - id: 4096, - tag: "st-LS", - version: "Release 10" - }, - es: es, - "es-ar": { - language: "Spanish", - location: "Argentina", - id: 11274, - tag: "es-AR", - version: "Release B" - }, - "es-bz": { - language: "Spanish", - location: "Belize", - id: 4096, - tag: "es-BZ", - version: "Release 10.3" - }, - "es-ve": { - language: "Spanish", - location: "Bolivarian Republic of Venezuela", - id: 8202, - tag: "es-VE", - version: "Release B" - }, - "es-bo": { - language: "Spanish", - location: "Bolivia", - id: 16394, - tag: "es-BO", - version: "Release B" - }, - "es-br": { - language: "Spanish", - location: "Brazil", - id: 4096, - tag: "es-BR", - version: "Release 10.2" - }, - "es-cl": { - language: "Spanish", - location: "Chile", - id: 13322, - tag: "es-CL", - version: "Release B" - }, - "es-co": { - language: "Spanish", - location: "Colombia", - id: 9226, - tag: "es-CO", - version: "Release B" - }, - "es-cr": { - language: "Spanish", - location: "Costa Rica", - id: 5130, - tag: "es-CR", - version: "Release B" - }, - "es-cu": { - language: "Spanish", - location: "Cuba", - id: 23562, - tag: "es-CU", - version: "Release 10" - }, - "es-do": { - language: "Spanish", - location: "Dominican Republic", - id: 7178, - tag: "es-DO", - version: "Release B" - }, - "es-ec": { - language: "Spanish", - location: "Ecuador", - id: 12298, - tag: "es-EC", - version: "Release B" - }, - "es-sv": { - language: "Spanish", - location: "El Salvador", - id: 17418, - tag: "es-SV", - version: "Release B" - }, - "es-gq": { - language: "Spanish", - location: "Equatorial Guinea", - id: 4096, - tag: "es-GQ", - version: "Release 10" - }, - "es-gt": { - language: "Spanish", - location: "Guatemala", - id: 4106, - tag: "es-GT", - version: "Release B" - }, - "es-hn": { - language: "Spanish", - location: "Honduras", - id: 18442, - tag: "es-HN", - version: "Release B" - }, - "es-419": { - language: "Spanish", - location: "Latin America", - id: 22538, - tag: "es-419", - version: "Release 8.1" - }, - "es-mx": { - language: "Spanish", - location: "Mexico", - id: 2058, - tag: "es-MX", - version: "Release A" - }, - "es-ni": { - language: "Spanish", - location: "Nicaragua", - id: 19466, - tag: "es-NI", - version: "Release B" - }, - "es-pa": { - language: "Spanish", - location: "Panama", - id: 6154, - tag: "es-PA", - version: "Release B" - }, - "es-py": { - language: "Spanish", - location: "Paraguay", - id: 15370, - tag: "es-PY", - version: "Release B" - }, - "es-pe": { - language: "Spanish", - location: "Peru", - id: 10250, - tag: "es-PE", - version: "Release B" - }, - "es-ph": { - language: "Spanish", - location: "Philippines", - id: 4096, - tag: "es-PH", - version: "Release 10" - }, - "es-pr": { - language: "Spanish", - location: "Puerto Rico", - id: 20490, - tag: "es-PR", - version: "Release B" - }, - "es-es_tradnl": { - language: "Spanish", - location: "Spain", - id: 1034, - tag: "es-ES_tradnl", - version: "Release A" - }, - "es-es": { - language: "Spanish", - location: "Spain", - id: 3082, - tag: "es-ES", - version: "Release A" - }, - "es-us": { - language: "Spanish", - location: "UnitedStates", - id: 21514, - tag: "es-US", - version: "Release V" - }, - "es-uy": { - language: "Spanish", - location: "Uruguay", - id: 14346, - tag: "es-UY", - version: "Release B" - }, - zgh: zgh, - "zgh-tfng-ma": { - language: "Standard Moroccan Tamazight", - location: "Morocco", - id: 4096, - tag: "zgh-Tfng-MA", - version: "Release 8.1" - }, - "zgh-tfng": { - language: "Standard Moroccan Tamazight", - location: "Tifinagh", - id: 4096, - tag: "zgh-Tfng", - version: "Release 8.1" - }, - ss: ss, - "ss-za": { - language: "Swati", - location: "South Africa", - id: 4096, - tag: "ss-ZA", - version: "Release 10" - }, - "ss-sz": { - language: "Swati", - location: "Swaziland", - id: 4096, - tag: "ss-SZ", - version: "Release 10" - }, - sv: sv, - "sv-ax": { - language: "Swedish", - location: "Åland Islands", - id: 4096, - tag: "sv-AX", - version: "Release 10" - }, - "sv-fi": { - language: "Swedish", - location: "Finland", - id: 2077, - tag: "sv-FI", - version: "Release B" - }, - "sv-se": { - language: "Swedish", - location: "Sweden", - id: 1053, - tag: "sv-SE", - version: "Release A" - }, - syr: syr, - "syr-sy": { - language: "Syriac", - location: "Syria", - id: 1114, - tag: "syr-SY", - version: "Release D" - }, - shi: shi, - "shi-tfng": { - language: "Tachelhit", - location: "Tifinagh", - id: 4096, - tag: "shi-Tfng", - version: "Release 10" - }, - "shi-tfng-ma": { - language: "Tachelhit", - location: "Tifinagh, Morocco", - id: 4096, - tag: "shi-Tfng-MA", - version: "Release 10" - }, - "shi-latn": { - language: "Tachelhit (Latin)", - location: null, - id: 4096, - tag: "shi-Latn", - version: "Release 10" - }, - "shi-latn-ma": { - language: "Tachelhit (Latin)", - location: "Morocco", - id: 4096, - tag: "shi-Latn-MA", - version: "Release 10" - }, - dav: dav, - "dav-ke": { - language: "Taita", - location: "Kenya", - id: 4096, - tag: "dav-KE", - version: "Release 10" - }, - tg: tg, - "tg-cyrl": { - language: "Tajik (Cyrillic)", - location: null, - id: 31784, - tag: "tg-Cyrl", - version: "Windows 7" - }, - "tg-cyrl-tj": { - language: "Tajik (Cyrillic)", - location: "Tajikistan", - id: 1064, - tag: "tg-Cyrl-TJ", - version: "Release V" - }, - tzm: tzm, - "tzm-latn": { - language: "Tamazight (Latin)", - location: null, - id: 31839, - tag: "tzm-Latn", - version: "Windows 7" - }, - "tzm-latn-dz": { - language: "Tamazight (Latin)", - location: "Algeria", - id: 2143, - tag: "tzm-Latn-DZ", - version: "Release V" - }, - ta: ta, - "ta-in": { - language: "Tamil", - location: "India", - id: 1097, - tag: "ta-IN", - version: "Release C" - }, - "ta-my": { - language: "Tamil", - location: "Malaysia", - id: 4096, - tag: "ta-MY", - version: "Release 10" - }, - "ta-sg": { - language: "Tamil", - location: "Singapore", - id: 4096, - tag: "ta-SG", - version: "Release 10" - }, - "ta-lk": { - language: "Tamil", - location: "Sri Lanka", - id: 2121, - tag: "ta-LK", - version: "Release 8" - }, - twq: twq, - "twq-ne": { - language: "Tasawaq", - location: "Niger", - id: 4096, - tag: "twq-NE", - version: "Release 10" - }, - tt: tt, - "tt-ru": { - language: "Tatar", - location: "Russia", - id: 1092, - tag: "tt-RU", - version: "Release D" - }, - te: te, - "te-in": { - language: "Telugu", - location: "India", - id: 1098, - tag: "te-IN", - version: "Release D" - }, - teo: teo, - "teo-ke": { - language: "Teso", - location: "Kenya", - id: 4096, - tag: "teo-KE", - version: "Release 10" - }, - "teo-ug": { - language: "Teso", - location: "Uganda", - id: 4096, - tag: "teo-UG", - version: "Release 10" - }, - th: th, - "th-th": { - language: "Thai", - location: "Thailand", - id: 1054, - tag: "th-TH", - version: "Release B" - }, - bo: bo, - "bo-in": { - language: "Tibetan", - location: "India", - id: 4096, - tag: "bo-IN", - version: "Release 10" - }, - "bo-cn": { - language: "Tibetan", - location: "People's Republic of China", - id: 1105, - tag: "bo-CN", - version: "Release V" - }, - tig: tig, - "tig-er": { - language: "Tigre", - location: "Eritrea", - id: 4096, - tag: "tig-ER", - version: "Release 10" - }, - ti: ti, - "ti-er": { - language: "Tigrinya", - location: "Eritrea", - id: 2163, - tag: "ti-ER", - version: "Release 8" - }, - "ti-et": { - language: "Tigrinya", - location: "Ethiopia", - id: 1139, - tag: "ti-ET", - version: "Release 8" - }, - to: to, - "to-to": { - language: "Tongan", - location: "Tonga", - id: 4096, - tag: "to-TO", - version: "Release 10" - }, - ts: ts, - "ts-za": { - language: "Tsonga", - location: "South Africa", - id: 1073, - tag: "ts-ZA", - version: "Release 8.1" - }, - tr: tr, - "tr-cy": { - language: "Turkish", - location: "Cyprus", - id: 4096, - tag: "tr-CY", - version: "Release 10" - }, - "tr-tr": { - language: "Turkish", - location: "Turkey", - id: 1055, - tag: "tr-TR", - version: "Release A" - }, - tk: tk, - "tk-tm": { - language: "Turkmen", - location: "Turkmenistan", - id: 1090, - tag: "tk-TM", - version: "Release V" - }, - uk: uk, - "uk-ua": { - language: "Ukrainian", - location: "Ukraine", - id: 1058, - tag: "uk-UA", - version: "Release B" - }, - hsb: hsb, - "hsb-de": { - language: "Upper Sorbian", - location: "Germany", - id: 1070, - tag: "hsb-DE", - version: "Release V" - }, - ur: ur, - "ur-in": { - language: "Urdu", - location: "India", - id: 2080, - tag: "ur-IN", - version: "Release 8.1" - }, - "ur-pk": { - language: "Urdu", - location: "Islamic Republic of Pakistan", - id: 1056, - tag: "ur-PK", - version: "Release C" - }, - ug: ug, - "ug-cn": { - language: "Uyghur", - location: "People's Republic of China", - id: 1152, - tag: "ug-CN", - version: "Release V" - }, - "uz-arab": { - language: "Uzbek", - location: "Perso-Arabic", - id: 4096, - tag: "uz-Arab", - version: "Release 10" - }, - "uz-arab-af": { - language: "Uzbek", - location: "Perso-Arabic, Afghanistan", - id: 4096, - tag: "uz-Arab-AF", - version: "Release 10" - }, - "uz-cyrl": { - language: "Uzbek (Cyrillic)", - location: null, - id: 30787, - tag: "uz-Cyrl", - version: "Windows 7" - }, - "uz-cyrl-uz": { - language: "Uzbek (Cyrillic)", - location: "Uzbekistan", - id: 2115, - tag: "uz-Cyrl-UZ", - version: "Release C" - }, - uz: uz, - "uz-latn": { - language: "Uzbek (Latin)", - location: null, - id: 31811, - tag: "uz-Latn", - version: "Windows7" - }, - "uz-latn-uz": { - language: "Uzbek (Latin)", - location: "Uzbekistan", - id: 1091, - tag: "uz-Latn-UZ", - version: "Release C" - }, - vai: vai, - "vai-vaii": { - language: "Vai", - location: null, - id: 4096, - tag: "vai-Vaii", - version: "Release 10" - }, - "vai-vaii-lr": { - language: "Vai", - location: "Liberia", - id: 4096, - tag: "vai-Vaii-LR", - version: "Release 10" - }, - "vai-latn-lr": { - language: "Vai (Latin)", - location: "Liberia", - id: 4096, - tag: "vai-Latn-LR", - version: "Release 10" - }, - "vai-latn": { - language: "Vai (Latin)", - location: null, - id: 4096, - tag: "vai-Latn", - version: "Release 10" - }, - "ca-es-": { - language: "Valencian", - location: "Spain", - id: 2051, - tag: "ca-ES-", - version: "Release 8" - }, - ve: ve, - "ve-za": { - language: "Venda", - location: "South Africa", - id: 1075, - tag: "ve-ZA", - version: "Release 10" - }, - vi: vi, - "vi-vn": { - language: "Vietnamese", - location: "Vietnam", - id: 1066, - tag: "vi-VN", - version: "Release B" - }, - vo: vo, - "vo-001": { - language: "Volapük", - location: "World", - id: 4096, - tag: "vo-001", - version: "Release 10" - }, - vun: vun, - "vun-tz": { - language: "Vunjo", - location: "Tanzania", - id: 4096, - tag: "vun-TZ", - version: "Release 10" - }, - wae: wae, - "wae-ch": { - language: "Walser", - location: "Switzerland", - id: 4096, - tag: "wae-CH", - version: "Release 10" - }, - cy: cy, - "cy-gb": { - language: "Welsh", - location: "United Kingdom", - id: 1106, - tag: "cy-GB", - version: "ReleaseE1" - }, - wal: wal, - "wal-et": { - language: "Wolaytta", - location: "Ethiopia", - id: 4096, - tag: "wal-ET", - version: "Release 10" - }, - wo: wo, - "wo-sn": { - language: "Wolof", - location: "Senegal", - id: 1160, - tag: "wo-SN", - version: "Release V" - }, - xh: xh, - "xh-za": { - language: "Xhosa", - location: "South Africa", - id: 1076, - tag: "xh-ZA", - version: "Release E1" - }, - yav: yav, - "yav-cm": { - language: "Yangben", - location: "Cameroon", - id: 4096, - tag: "yav-CM", - version: "Release 10" - }, - ii: ii, - "ii-cn": { - language: "Yi", - location: "People's Republic of China", - id: 1144, - tag: "ii-CN", - version: "Release V" - }, - yo: yo, - "yo-bj": { - language: "Yoruba", - location: "Benin", - id: 4096, - tag: "yo-BJ", - version: "Release 10" - }, - "yo-ng": { - language: "Yoruba", - location: "Nigeria", - id: 1130, - tag: "yo-NG", - version: "Release V" - }, - dje: dje, - "dje-ne": { - language: "Zarma", - location: "Niger", - id: 4096, - tag: "dje-NE", - version: "Release 10" - }, - zu: zu, - "zu-za": { - language: "Zulu", - location: "South Africa", - id: 1077, - tag: "zu-ZA", - version: "Release E1" - } - }; - - var Abkhazian = { - name: "Abkhazian", - names: [ - "Abkhazian" - ], - "iso639-2": "abk", - "iso639-1": "ab" - }; - var Achinese = { - name: "Achinese", - names: [ - "Achinese" - ], - "iso639-2": "ace", - "iso639-1": null - }; - var Acoli = { - name: "Acoli", - names: [ - "Acoli" - ], - "iso639-2": "ach", - "iso639-1": null - }; - var Adangme = { - name: "Adangme", - names: [ - "Adangme" - ], - "iso639-2": "ada", - "iso639-1": null - }; - var Adygei = { - name: "Adygei", - names: [ - "Adyghe", - "Adygei" - ], - "iso639-2": "ady", - "iso639-1": null - }; - var Adyghe = { - name: "Adyghe", - names: [ - "Adyghe", - "Adygei" - ], - "iso639-2": "ady", - "iso639-1": null - }; - var Afar = { - name: "Afar", - names: [ - "Afar" - ], - "iso639-2": "aar", - "iso639-1": "aa" - }; - var Afrihili = { - name: "Afrihili", - names: [ - "Afrihili" - ], - "iso639-2": "afh", - "iso639-1": null - }; - var Afrikaans = { - name: "Afrikaans", - names: [ - "Afrikaans" - ], - "iso639-2": "afr", - "iso639-1": "af" - }; - var Ainu = { - name: "Ainu", - names: [ - "Ainu" - ], - "iso639-2": "ain", - "iso639-1": null - }; - var Akan = { - name: "Akan", - names: [ - "Akan" - ], - "iso639-2": "aka", - "iso639-1": "ak" - }; - var Akkadian = { - name: "Akkadian", - names: [ - "Akkadian" - ], - "iso639-2": "akk", - "iso639-1": null - }; - var Albanian = { - name: "Albanian", - names: [ - "Albanian" - ], - "iso639-2": "alb/sqi", - "iso639-1": "sq" - }; - var Alemannic = { - name: "Alemannic", - names: [ - "Swiss German", - "Alemannic", - "Alsatian" - ], - "iso639-2": "gsw", - "iso639-1": null - }; - var Aleut = { - name: "Aleut", - names: [ - "Aleut" - ], - "iso639-2": "ale", - "iso639-1": null - }; - var Alsatian = { - name: "Alsatian", - names: [ - "Swiss German", - "Alemannic", - "Alsatian" - ], - "iso639-2": "gsw", - "iso639-1": null - }; - var Amharic = { - name: "Amharic", - names: [ - "Amharic" - ], - "iso639-2": "amh", - "iso639-1": "am" - }; - var Angika = { - name: "Angika", - names: [ - "Angika" - ], - "iso639-2": "anp", - "iso639-1": null - }; - var Arabic = { - name: "Arabic", - names: [ - "Arabic" - ], - "iso639-2": "ara", - "iso639-1": "ar" - }; - var Aragonese = { - name: "Aragonese", - names: [ - "Aragonese" - ], - "iso639-2": "arg", - "iso639-1": "an" - }; - var Arapaho = { - name: "Arapaho", - names: [ - "Arapaho" - ], - "iso639-2": "arp", - "iso639-1": null - }; - var Arawak = { - name: "Arawak", - names: [ - "Arawak" - ], - "iso639-2": "arw", - "iso639-1": null - }; - var Armenian = { - name: "Armenian", - names: [ - "Armenian" - ], - "iso639-2": "arm/hye", - "iso639-1": "hy" - }; - var Aromanian = { - name: "Aromanian", - names: [ - "Aromanian", - "Arumanian", - "Macedo-Romanian" - ], - "iso639-2": "rup", - "iso639-1": null - }; - var Arumanian = { - name: "Arumanian", - names: [ - "Aromanian", - "Arumanian", - "Macedo-Romanian" - ], - "iso639-2": "rup", - "iso639-1": null - }; - var Assamese = { - name: "Assamese", - names: [ - "Assamese" - ], - "iso639-2": "asm", - "iso639-1": "as" - }; - var Asturian = { - name: "Asturian", - names: [ - "Asturian", - "Bable", - "Leonese", - "Asturleonese" - ], - "iso639-2": "ast", - "iso639-1": null - }; - var Asturleonese = { - name: "Asturleonese", - names: [ - "Asturian", - "Bable", - "Leonese", - "Asturleonese" - ], - "iso639-2": "ast", - "iso639-1": null - }; - var Avaric = { - name: "Avaric", - names: [ - "Avaric" - ], - "iso639-2": "ava", - "iso639-1": "av" - }; - var Avestan = { - name: "Avestan", - names: [ - "Avestan" - ], - "iso639-2": "ave", - "iso639-1": "ae" - }; - var Awadhi = { - name: "Awadhi", - names: [ - "Awadhi" - ], - "iso639-2": "awa", - "iso639-1": null - }; - var Aymara = { - name: "Aymara", - names: [ - "Aymara" - ], - "iso639-2": "aym", - "iso639-1": "ay" - }; - var Azerbaijani = { - name: "Azerbaijani", - names: [ - "Azerbaijani" - ], - "iso639-2": "aze", - "iso639-1": "az" - }; - var Bable = { - name: "Bable", - names: [ - "Asturian", - "Bable", - "Leonese", - "Asturleonese" - ], - "iso639-2": "ast", - "iso639-1": null - }; - var Balinese = { - name: "Balinese", - names: [ - "Balinese" - ], - "iso639-2": "ban", - "iso639-1": null - }; - var Baluchi = { - name: "Baluchi", - names: [ - "Baluchi" - ], - "iso639-2": "bal", - "iso639-1": null - }; - var Bambara = { - name: "Bambara", - names: [ - "Bambara" - ], - "iso639-2": "bam", - "iso639-1": "bm" - }; - var Basa = { - name: "Basa", - names: [ - "Basa" - ], - "iso639-2": "bas", - "iso639-1": null - }; - var Bashkir = { - name: "Bashkir", - names: [ - "Bashkir" - ], - "iso639-2": "bak", - "iso639-1": "ba" - }; - var Basque = { - name: "Basque", - names: [ - "Basque" - ], - "iso639-2": "baq/eus", - "iso639-1": "eu" - }; - var Bedawiyet = { - name: "Bedawiyet", - names: [ - "Beja", - "Bedawiyet" - ], - "iso639-2": "bej", - "iso639-1": null - }; - var Beja = { - name: "Beja", - names: [ - "Beja", - "Bedawiyet" - ], - "iso639-2": "bej", - "iso639-1": null - }; - var Belarusian = { - name: "Belarusian", - names: [ - "Belarusian" - ], - "iso639-2": "bel", - "iso639-1": "be" - }; - var Bemba = { - name: "Bemba", - names: [ - "Bemba" - ], - "iso639-2": "bem", - "iso639-1": null - }; - var Bengali = { - name: "Bengali", - names: [ - "Bengali" - ], - "iso639-2": "ben", - "iso639-1": "bn" - }; - var Bhojpuri = { - name: "Bhojpuri", - names: [ - "Bhojpuri" - ], - "iso639-2": "bho", - "iso639-1": null - }; - var Bikol = { - name: "Bikol", - names: [ - "Bikol" - ], - "iso639-2": "bik", - "iso639-1": null - }; - var Bilin = { - name: "Bilin", - names: [ - "Blin", - "Bilin" - ], - "iso639-2": "byn", - "iso639-1": null - }; - var Bini = { - name: "Bini", - names: [ - "Bini", - "Edo" - ], - "iso639-2": "bin", - "iso639-1": null - }; - var Bislama = { - name: "Bislama", - names: [ - "Bislama" - ], - "iso639-2": "bis", - "iso639-1": "bi" - }; - var Blin = { - name: "Blin", - names: [ - "Blin", - "Bilin" - ], - "iso639-2": "byn", - "iso639-1": null - }; - var Bliss = { - name: "Bliss", - names: [ - "Blissymbols", - "Blissymbolics", - "Bliss" - ], - "iso639-2": "zbl", - "iso639-1": null - }; - var Blissymbolics = { - name: "Blissymbolics", - names: [ - "Blissymbols", - "Blissymbolics", - "Bliss" - ], - "iso639-2": "zbl", - "iso639-1": null - }; - var Blissymbols = { - name: "Blissymbols", - names: [ - "Blissymbols", - "Blissymbolics", - "Bliss" - ], - "iso639-2": "zbl", - "iso639-1": null - }; - var Bosnian = { - name: "Bosnian", - names: [ - "Bosnian" - ], - "iso639-2": "bos", - "iso639-1": "bs" - }; - var Braj = { - name: "Braj", - names: [ - "Braj" - ], - "iso639-2": "bra", - "iso639-1": null - }; - var Breton = { - name: "Breton", - names: [ - "Breton" - ], - "iso639-2": "bre", - "iso639-1": "br" - }; - var Buginese = { - name: "Buginese", - names: [ - "Buginese" - ], - "iso639-2": "bug", - "iso639-1": null - }; - var Bulgarian = { - name: "Bulgarian", - names: [ - "Bulgarian" - ], - "iso639-2": "bul", - "iso639-1": "bg" - }; - var Buriat = { - name: "Buriat", - names: [ - "Buriat" - ], - "iso639-2": "bua", - "iso639-1": null - }; - var Burmese = { - name: "Burmese", - names: [ - "Burmese" - ], - "iso639-2": "bur/mya", - "iso639-1": "my" - }; - var Caddo = { - name: "Caddo", - names: [ - "Caddo" - ], - "iso639-2": "cad", - "iso639-1": null - }; - var Castilian = { - name: "Castilian", - names: [ - "Spanish", - "Castilian" - ], - "iso639-2": "spa", - "iso639-1": "es" - }; - var Catalan = { - name: "Catalan", - names: [ - "Catalan", - "Valencian" - ], - "iso639-2": "cat", - "iso639-1": "ca" - }; - var Cebuano = { - name: "Cebuano", - names: [ - "Cebuano" - ], - "iso639-2": "ceb", - "iso639-1": null - }; - var Chagatai = { - name: "Chagatai", - names: [ - "Chagatai" - ], - "iso639-2": "chg", - "iso639-1": null - }; - var Chamorro = { - name: "Chamorro", - names: [ - "Chamorro" - ], - "iso639-2": "cha", - "iso639-1": "ch" - }; - var Chechen = { - name: "Chechen", - names: [ - "Chechen" - ], - "iso639-2": "che", - "iso639-1": "ce" - }; - var Cherokee = { - name: "Cherokee", - names: [ - "Cherokee" - ], - "iso639-2": "chr", - "iso639-1": null - }; - var Chewa = { - name: "Chewa", - names: [ - "Chichewa", - "Chewa", - "Nyanja" - ], - "iso639-2": "nya", - "iso639-1": "ny" - }; - var Cheyenne = { - name: "Cheyenne", - names: [ - "Cheyenne" - ], - "iso639-2": "chy", - "iso639-1": null - }; - var Chibcha = { - name: "Chibcha", - names: [ - "Chibcha" - ], - "iso639-2": "chb", - "iso639-1": null - }; - var Chichewa = { - name: "Chichewa", - names: [ - "Chichewa", - "Chewa", - "Nyanja" - ], - "iso639-2": "nya", - "iso639-1": "ny" - }; - var Chinese = { - name: "Chinese", - names: [ - "Chinese" - ], - "iso639-2": "chi/zho", - "iso639-1": "zh" - }; - var Chipewyan = { - name: "Chipewyan", - names: [ - "Chipewyan", - "Dene Suline" - ], - "iso639-2": "chp", - "iso639-1": null - }; - var Choctaw = { - name: "Choctaw", - names: [ - "Choctaw" - ], - "iso639-2": "cho", - "iso639-1": null - }; - var Chuang = { - name: "Chuang", - names: [ - "Zhuang", - "Chuang" - ], - "iso639-2": "zha", - "iso639-1": "za" - }; - var Chuukese = { - name: "Chuukese", - names: [ - "Chuukese" - ], - "iso639-2": "chk", - "iso639-1": null - }; - var Chuvash = { - name: "Chuvash", - names: [ - "Chuvash" - ], - "iso639-2": "chv", - "iso639-1": "cv" - }; - var Coptic = { - name: "Coptic", - names: [ - "Coptic" - ], - "iso639-2": "cop", - "iso639-1": null - }; - var Cornish = { - name: "Cornish", - names: [ - "Cornish" - ], - "iso639-2": "cor", - "iso639-1": "kw" - }; - var Corsican = { - name: "Corsican", - names: [ - "Corsican" - ], - "iso639-2": "cos", - "iso639-1": "co" - }; - var Cree = { - name: "Cree", - names: [ - "Cree" - ], - "iso639-2": "cre", - "iso639-1": "cr" - }; - var Creek = { - name: "Creek", - names: [ - "Creek" - ], - "iso639-2": "mus", - "iso639-1": null - }; - var Croatian = { - name: "Croatian", - names: [ - "Croatian" - ], - "iso639-2": "hrv", - "iso639-1": "hr" - }; - var Czech = { - name: "Czech", - names: [ - "Czech" - ], - "iso639-2": "cze/ces", - "iso639-1": "cs" - }; - var Dakota = { - name: "Dakota", - names: [ - "Dakota" - ], - "iso639-2": "dak", - "iso639-1": null - }; - var Danish = { - name: "Danish", - names: [ - "Danish" - ], - "iso639-2": "dan", - "iso639-1": "da" - }; - var Dargwa = { - name: "Dargwa", - names: [ - "Dargwa" - ], - "iso639-2": "dar", - "iso639-1": null - }; - var Delaware = { - name: "Delaware", - names: [ - "Delaware" - ], - "iso639-2": "del", - "iso639-1": null - }; - var Dhivehi = { - name: "Dhivehi", - names: [ - "Divehi", - "Dhivehi", - "Maldivian" - ], - "iso639-2": "div", - "iso639-1": "dv" - }; - var Dimili = { - name: "Dimili", - names: [ - "Zaza", - "Dimili", - "Dimli", - "Kirdki", - "Kirmanjki", - "Zazaki" - ], - "iso639-2": "zza", - "iso639-1": null - }; - var Dimli = { - name: "Dimli", - names: [ - "Zaza", - "Dimili", - "Dimli", - "Kirdki", - "Kirmanjki", - "Zazaki" - ], - "iso639-2": "zza", - "iso639-1": null - }; - var Dinka = { - name: "Dinka", - names: [ - "Dinka" - ], - "iso639-2": "din", - "iso639-1": null - }; - var Divehi = { - name: "Divehi", - names: [ - "Divehi", - "Dhivehi", - "Maldivian" - ], - "iso639-2": "div", - "iso639-1": "dv" - }; - var Dogri = { - name: "Dogri", - names: [ - "Dogri" - ], - "iso639-2": "doi", - "iso639-1": null - }; - var Dogrib = { - name: "Dogrib", - names: [ - "Dogrib" - ], - "iso639-2": "dgr", - "iso639-1": null - }; - var Duala = { - name: "Duala", - names: [ - "Duala" - ], - "iso639-2": "dua", - "iso639-1": null - }; - var Dutch = { - name: "Dutch", - names: [ - "Dutch", - "Flemish" - ], - "iso639-2": "dut/nld", - "iso639-1": "nl" - }; - var Dyula = { - name: "Dyula", - names: [ - "Dyula" - ], - "iso639-2": "dyu", - "iso639-1": null - }; - var Dzongkha = { - name: "Dzongkha", - names: [ - "Dzongkha" - ], - "iso639-2": "dzo", - "iso639-1": "dz" - }; - var Edo = { - name: "Edo", - names: [ - "Bini", - "Edo" - ], - "iso639-2": "bin", - "iso639-1": null - }; - var Efik = { - name: "Efik", - names: [ - "Efik" - ], - "iso639-2": "efi", - "iso639-1": null - }; - var Ekajuk = { - name: "Ekajuk", - names: [ - "Ekajuk" - ], - "iso639-2": "eka", - "iso639-1": null - }; - var Elamite = { - name: "Elamite", - names: [ - "Elamite" - ], - "iso639-2": "elx", - "iso639-1": null - }; - var English = { - name: "English", - names: [ - "English" - ], - "iso639-2": "eng", - "iso639-1": "en" - }; - var Erzya = { - name: "Erzya", - names: [ - "Erzya" - ], - "iso639-2": "myv", - "iso639-1": null - }; - var Esperanto = { - name: "Esperanto", - names: [ - "Esperanto" - ], - "iso639-2": "epo", - "iso639-1": "eo" - }; - var Estonian = { - name: "Estonian", - names: [ - "Estonian" - ], - "iso639-2": "est", - "iso639-1": "et" - }; - var Ewe = { - name: "Ewe", - names: [ - "Ewe" - ], - "iso639-2": "ewe", - "iso639-1": "ee" - }; - var Ewondo = { - name: "Ewondo", - names: [ - "Ewondo" - ], - "iso639-2": "ewo", - "iso639-1": null - }; - var Fang = { - name: "Fang", - names: [ - "Fang" - ], - "iso639-2": "fan", - "iso639-1": null - }; - var Fanti = { - name: "Fanti", - names: [ - "Fanti" - ], - "iso639-2": "fat", - "iso639-1": null - }; - var Faroese = { - name: "Faroese", - names: [ - "Faroese" - ], - "iso639-2": "fao", - "iso639-1": "fo" - }; - var Fijian = { - name: "Fijian", - names: [ - "Fijian" - ], - "iso639-2": "fij", - "iso639-1": "fj" - }; - var Filipino = { - name: "Filipino", - names: [ - "Filipino", - "Pilipino" - ], - "iso639-2": "fil", - "iso639-1": null - }; - var Finnish = { - name: "Finnish", - names: [ - "Finnish" - ], - "iso639-2": "fin", - "iso639-1": "fi" - }; - var Flemish = { - name: "Flemish", - names: [ - "Dutch", - "Flemish" - ], - "iso639-2": "dut/nld", - "iso639-1": "nl" - }; - var Fon = { - name: "Fon", - names: [ - "Fon" - ], - "iso639-2": "fon", - "iso639-1": null - }; - var French = { - name: "French", - names: [ - "French" - ], - "iso639-2": "fre/fra", - "iso639-1": "fr" - }; - var Friulian = { - name: "Friulian", - names: [ - "Friulian" - ], - "iso639-2": "fur", - "iso639-1": null - }; - var Fulah = { - name: "Fulah", - names: [ - "Fulah" - ], - "iso639-2": "ful", - "iso639-1": "ff" - }; - var Ga = { - name: "Ga", - names: [ - "Ga" - ], - "iso639-2": "gaa", - "iso639-1": null - }; - var Gaelic = { - name: "Gaelic", - names: [ - "Gaelic", - "Scottish Gaelic" - ], - "iso639-2": "gla", - "iso639-1": "gd" - }; - var Galician = { - name: "Galician", - names: [ - "Galician" - ], - "iso639-2": "glg", - "iso639-1": "gl" - }; - var Ganda = { - name: "Ganda", - names: [ - "Ganda" - ], - "iso639-2": "lug", - "iso639-1": "lg" - }; - var Gayo = { - name: "Gayo", - names: [ - "Gayo" - ], - "iso639-2": "gay", - "iso639-1": null - }; - var Gbaya = { - name: "Gbaya", - names: [ - "Gbaya" - ], - "iso639-2": "gba", - "iso639-1": null - }; - var Geez = { - name: "Geez", - names: [ - "Geez" - ], - "iso639-2": "gez", - "iso639-1": null - }; - var Georgian = { - name: "Georgian", - names: [ - "Georgian" - ], - "iso639-2": "geo/kat", - "iso639-1": "ka" - }; - var German = { - name: "German", - names: [ - "German" - ], - "iso639-2": "ger/deu", - "iso639-1": "de" - }; - var Gikuyu = { - name: "Gikuyu", - names: [ - "Kikuyu", - "Gikuyu" - ], - "iso639-2": "kik", - "iso639-1": "ki" - }; - var Gilbertese = { - name: "Gilbertese", - names: [ - "Gilbertese" - ], - "iso639-2": "gil", - "iso639-1": null - }; - var Gondi = { - name: "Gondi", - names: [ - "Gondi" - ], - "iso639-2": "gon", - "iso639-1": null - }; - var Gorontalo = { - name: "Gorontalo", - names: [ - "Gorontalo" - ], - "iso639-2": "gor", - "iso639-1": null - }; - var Gothic = { - name: "Gothic", - names: [ - "Gothic" - ], - "iso639-2": "got", - "iso639-1": null - }; - var Grebo = { - name: "Grebo", - names: [ - "Grebo" - ], - "iso639-2": "grb", - "iso639-1": null - }; - var Greenlandic = { - name: "Greenlandic", - names: [ - "Kalaallisut", - "Greenlandic" - ], - "iso639-2": "kal", - "iso639-1": "kl" - }; - var Guarani = { - name: "Guarani", - names: [ - "Guarani" - ], - "iso639-2": "grn", - "iso639-1": "gn" - }; - var Gujarati = { - name: "Gujarati", - names: [ - "Gujarati" - ], - "iso639-2": "guj", - "iso639-1": "gu" - }; - var Haida = { - name: "Haida", - names: [ - "Haida" - ], - "iso639-2": "hai", - "iso639-1": null - }; - var Haitian = { - name: "Haitian", - names: [ - "Haitian", - "Haitian Creole" - ], - "iso639-2": "hat", - "iso639-1": "ht" - }; - var Hausa = { - name: "Hausa", - names: [ - "Hausa" - ], - "iso639-2": "hau", - "iso639-1": "ha" - }; - var Hawaiian = { - name: "Hawaiian", - names: [ - "Hawaiian" - ], - "iso639-2": "haw", - "iso639-1": null - }; - var Hebrew = { - name: "Hebrew", - names: [ - "Hebrew" - ], - "iso639-2": "heb", - "iso639-1": "he" - }; - var Herero = { - name: "Herero", - names: [ - "Herero" - ], - "iso639-2": "her", - "iso639-1": "hz" - }; - var Hiligaynon = { - name: "Hiligaynon", - names: [ - "Hiligaynon" - ], - "iso639-2": "hil", - "iso639-1": null - }; - var Hindi = { - name: "Hindi", - names: [ - "Hindi" - ], - "iso639-2": "hin", - "iso639-1": "hi" - }; - var Hittite = { - name: "Hittite", - names: [ - "Hittite" - ], - "iso639-2": "hit", - "iso639-1": null - }; - var Hmong = { - name: "Hmong", - names: [ - "Hmong", - "Mong" - ], - "iso639-2": "hmn", - "iso639-1": null - }; - var Hungarian = { - name: "Hungarian", - names: [ - "Hungarian" - ], - "iso639-2": "hun", - "iso639-1": "hu" - }; - var Hupa = { - name: "Hupa", - names: [ - "Hupa" - ], - "iso639-2": "hup", - "iso639-1": null - }; - var Iban = { - name: "Iban", - names: [ - "Iban" - ], - "iso639-2": "iba", - "iso639-1": null - }; - var Icelandic = { - name: "Icelandic", - names: [ - "Icelandic" - ], - "iso639-2": "ice/isl", - "iso639-1": "is" - }; - var Ido = { - name: "Ido", - names: [ - "Ido" - ], - "iso639-2": "ido", - "iso639-1": "io" - }; - var Igbo = { - name: "Igbo", - names: [ - "Igbo" - ], - "iso639-2": "ibo", - "iso639-1": "ig" - }; - var Iloko = { - name: "Iloko", - names: [ - "Iloko" - ], - "iso639-2": "ilo", - "iso639-1": null - }; - var Indonesian = { - name: "Indonesian", - names: [ - "Indonesian" - ], - "iso639-2": "ind", - "iso639-1": "id" - }; - var Ingush = { - name: "Ingush", - names: [ - "Ingush" - ], - "iso639-2": "inh", - "iso639-1": null - }; - var Interlingue = { - name: "Interlingue", - names: [ - "Interlingue", - "Occidental" - ], - "iso639-2": "ile", - "iso639-1": "ie" - }; - var Inuktitut = { - name: "Inuktitut", - names: [ - "Inuktitut" - ], - "iso639-2": "iku", - "iso639-1": "iu" - }; - var Inupiaq = { - name: "Inupiaq", - names: [ - "Inupiaq" - ], - "iso639-2": "ipk", - "iso639-1": "ik" - }; - var Irish = { - name: "Irish", - names: [ - "Irish" - ], - "iso639-2": "gle", - "iso639-1": "ga" - }; - var Italian = { - name: "Italian", - names: [ - "Italian" - ], - "iso639-2": "ita", - "iso639-1": "it" - }; - var Japanese = { - name: "Japanese", - names: [ - "Japanese" - ], - "iso639-2": "jpn", - "iso639-1": "ja" - }; - var Javanese = { - name: "Javanese", - names: [ - "Javanese" - ], - "iso639-2": "jav", - "iso639-1": "jv" - }; - var Jingpho = { - name: "Jingpho", - names: [ - "Kachin", - "Jingpho" - ], - "iso639-2": "kac", - "iso639-1": null - }; - var Kabardian = { - name: "Kabardian", - names: [ - "Kabardian" - ], - "iso639-2": "kbd", - "iso639-1": null - }; - var Kabyle = { - name: "Kabyle", - names: [ - "Kabyle" - ], - "iso639-2": "kab", - "iso639-1": null - }; - var Kachin = { - name: "Kachin", - names: [ - "Kachin", - "Jingpho" - ], - "iso639-2": "kac", - "iso639-1": null - }; - var Kalaallisut = { - name: "Kalaallisut", - names: [ - "Kalaallisut", - "Greenlandic" - ], - "iso639-2": "kal", - "iso639-1": "kl" - }; - var Kalmyk = { - name: "Kalmyk", - names: [ - "Kalmyk", - "Oirat" - ], - "iso639-2": "xal", - "iso639-1": null - }; - var Kamba = { - name: "Kamba", - names: [ - "Kamba" - ], - "iso639-2": "kam", - "iso639-1": null - }; - var Kannada = { - name: "Kannada", - names: [ - "Kannada" - ], - "iso639-2": "kan", - "iso639-1": "kn" - }; - var Kanuri = { - name: "Kanuri", - names: [ - "Kanuri" - ], - "iso639-2": "kau", - "iso639-1": "kr" - }; - var Kapampangan = { - name: "Kapampangan", - names: [ - "Pampanga", - "Kapampangan" - ], - "iso639-2": "pam", - "iso639-1": null - }; - var Karelian = { - name: "Karelian", - names: [ - "Karelian" - ], - "iso639-2": "krl", - "iso639-1": null - }; - var Kashmiri = { - name: "Kashmiri", - names: [ - "Kashmiri" - ], - "iso639-2": "kas", - "iso639-1": "ks" - }; - var Kashubian = { - name: "Kashubian", - names: [ - "Kashubian" - ], - "iso639-2": "csb", - "iso639-1": null - }; - var Kawi = { - name: "Kawi", - names: [ - "Kawi" - ], - "iso639-2": "kaw", - "iso639-1": null - }; - var Kazakh = { - name: "Kazakh", - names: [ - "Kazakh" - ], - "iso639-2": "kaz", - "iso639-1": "kk" - }; - var Khasi = { - name: "Khasi", - names: [ - "Khasi" - ], - "iso639-2": "kha", - "iso639-1": null - }; - var Khotanese = { - name: "Khotanese", - names: [ - "Khotanese", - "Sakan" - ], - "iso639-2": "kho", - "iso639-1": null - }; - var Kikuyu = { - name: "Kikuyu", - names: [ - "Kikuyu", - "Gikuyu" - ], - "iso639-2": "kik", - "iso639-1": "ki" - }; - var Kimbundu = { - name: "Kimbundu", - names: [ - "Kimbundu" - ], - "iso639-2": "kmb", - "iso639-1": null - }; - var Kinyarwanda = { - name: "Kinyarwanda", - names: [ - "Kinyarwanda" - ], - "iso639-2": "kin", - "iso639-1": "rw" - }; - var Kirdki = { - name: "Kirdki", - names: [ - "Zaza", - "Dimili", - "Dimli", - "Kirdki", - "Kirmanjki", - "Zazaki" - ], - "iso639-2": "zza", - "iso639-1": null - }; - var Kirghiz = { - name: "Kirghiz", - names: [ - "Kirghiz", - "Kyrgyz" - ], - "iso639-2": "kir", - "iso639-1": "ky" - }; - var Kirmanjki = { - name: "Kirmanjki", - names: [ - "Zaza", - "Dimili", - "Dimli", - "Kirdki", - "Kirmanjki", - "Zazaki" - ], - "iso639-2": "zza", - "iso639-1": null - }; - var Klingon = { - name: "Klingon", - names: [ - "Klingon", - "tlhIngan-Hol" - ], - "iso639-2": "tlh", - "iso639-1": null - }; - var Komi = { - name: "Komi", - names: [ - "Komi" - ], - "iso639-2": "kom", - "iso639-1": "kv" - }; - var Kongo = { - name: "Kongo", - names: [ - "Kongo" - ], - "iso639-2": "kon", - "iso639-1": "kg" - }; - var Konkani = { - name: "Konkani", - names: [ - "Konkani" - ], - "iso639-2": "kok", - "iso639-1": null - }; - var Korean = { - name: "Korean", - names: [ - "Korean" - ], - "iso639-2": "kor", - "iso639-1": "ko" - }; - var Kosraean = { - name: "Kosraean", - names: [ - "Kosraean" - ], - "iso639-2": "kos", - "iso639-1": null - }; - var Kpelle = { - name: "Kpelle", - names: [ - "Kpelle" - ], - "iso639-2": "kpe", - "iso639-1": null - }; - var Kuanyama = { - name: "Kuanyama", - names: [ - "Kuanyama", - "Kwanyama" - ], - "iso639-2": "kua", - "iso639-1": "kj" - }; - var Kumyk = { - name: "Kumyk", - names: [ - "Kumyk" - ], - "iso639-2": "kum", - "iso639-1": null - }; - var Kurdish = { - name: "Kurdish", - names: [ - "Kurdish" - ], - "iso639-2": "kur", - "iso639-1": "ku" - }; - var Kurukh = { - name: "Kurukh", - names: [ - "Kurukh" - ], - "iso639-2": "kru", - "iso639-1": null - }; - var Kutenai = { - name: "Kutenai", - names: [ - "Kutenai" - ], - "iso639-2": "kut", - "iso639-1": null - }; - var Kwanyama = { - name: "Kwanyama", - names: [ - "Kuanyama", - "Kwanyama" - ], - "iso639-2": "kua", - "iso639-1": "kj" - }; - var Kyrgyz = { - name: "Kyrgyz", - names: [ - "Kirghiz", - "Kyrgyz" - ], - "iso639-2": "kir", - "iso639-1": "ky" - }; - var Ladino = { - name: "Ladino", - names: [ - "Ladino" - ], - "iso639-2": "lad", - "iso639-1": null - }; - var Lahnda = { - name: "Lahnda", - names: [ - "Lahnda" - ], - "iso639-2": "lah", - "iso639-1": null - }; - var Lamba = { - name: "Lamba", - names: [ - "Lamba" - ], - "iso639-2": "lam", - "iso639-1": null - }; - var Lao = { - name: "Lao", - names: [ - "Lao" - ], - "iso639-2": "lao", - "iso639-1": "lo" - }; - var Latin = { - name: "Latin", - names: [ - "Latin" - ], - "iso639-2": "lat", - "iso639-1": "la" - }; - var Latvian = { - name: "Latvian", - names: [ - "Latvian" - ], - "iso639-2": "lav", - "iso639-1": "lv" - }; - var Leonese = { - name: "Leonese", - names: [ - "Asturian", - "Bable", - "Leonese", - "Asturleonese" - ], - "iso639-2": "ast", - "iso639-1": null - }; - var Letzeburgesch = { - name: "Letzeburgesch", - names: [ - "Luxembourgish", - "Letzeburgesch" - ], - "iso639-2": "ltz", - "iso639-1": "lb" - }; - var Lezghian = { - name: "Lezghian", - names: [ - "Lezghian" - ], - "iso639-2": "lez", - "iso639-1": null - }; - var Limburgan = { - name: "Limburgan", - names: [ - "Limburgan", - "Limburger", - "Limburgish" - ], - "iso639-2": "lim", - "iso639-1": "li" - }; - var Limburger = { - name: "Limburger", - names: [ - "Limburgan", - "Limburger", - "Limburgish" - ], - "iso639-2": "lim", - "iso639-1": "li" - }; - var Limburgish = { - name: "Limburgish", - names: [ - "Limburgan", - "Limburger", - "Limburgish" - ], - "iso639-2": "lim", - "iso639-1": "li" - }; - var Lingala = { - name: "Lingala", - names: [ - "Lingala" - ], - "iso639-2": "lin", - "iso639-1": "ln" - }; - var Lithuanian = { - name: "Lithuanian", - names: [ - "Lithuanian" - ], - "iso639-2": "lit", - "iso639-1": "lt" - }; - var Lojban = { - name: "Lojban", - names: [ - "Lojban" - ], - "iso639-2": "jbo", - "iso639-1": null - }; - var Lozi = { - name: "Lozi", - names: [ - "Lozi" - ], - "iso639-2": "loz", - "iso639-1": null - }; - var Luiseno = { - name: "Luiseno", - names: [ - "Luiseno" - ], - "iso639-2": "lui", - "iso639-1": null - }; - var Lunda = { - name: "Lunda", - names: [ - "Lunda" - ], - "iso639-2": "lun", - "iso639-1": null - }; - var Lushai = { - name: "Lushai", - names: [ - "Lushai" - ], - "iso639-2": "lus", - "iso639-1": null - }; - var Luxembourgish = { - name: "Luxembourgish", - names: [ - "Luxembourgish", - "Letzeburgesch" - ], - "iso639-2": "ltz", - "iso639-1": "lb" - }; - var Macedonian = { - name: "Macedonian", - names: [ - "Macedonian" - ], - "iso639-2": "mac/mkd", - "iso639-1": "mk" - }; - var Madurese = { - name: "Madurese", - names: [ - "Madurese" - ], - "iso639-2": "mad", - "iso639-1": null - }; - var Magahi = { - name: "Magahi", - names: [ - "Magahi" - ], - "iso639-2": "mag", - "iso639-1": null - }; - var Maithili = { - name: "Maithili", - names: [ - "Maithili" - ], - "iso639-2": "mai", - "iso639-1": null - }; - var Makasar = { - name: "Makasar", - names: [ - "Makasar" - ], - "iso639-2": "mak", - "iso639-1": null - }; - var Malagasy = { - name: "Malagasy", - names: [ - "Malagasy" - ], - "iso639-2": "mlg", - "iso639-1": "mg" - }; - var Malay = { - name: "Malay", - names: [ - "Malay" - ], - "iso639-2": "may/msa", - "iso639-1": "ms" - }; - var Malayalam = { - name: "Malayalam", - names: [ - "Malayalam" - ], - "iso639-2": "mal", - "iso639-1": "ml" - }; - var Maldivian = { - name: "Maldivian", - names: [ - "Divehi", - "Dhivehi", - "Maldivian" - ], - "iso639-2": "div", - "iso639-1": "dv" - }; - var Maltese = { - name: "Maltese", - names: [ - "Maltese" - ], - "iso639-2": "mlt", - "iso639-1": "mt" - }; - var Manchu = { - name: "Manchu", - names: [ - "Manchu" - ], - "iso639-2": "mnc", - "iso639-1": null - }; - var Mandar = { - name: "Mandar", - names: [ - "Mandar" - ], - "iso639-2": "mdr", - "iso639-1": null - }; - var Mandingo = { - name: "Mandingo", - names: [ - "Mandingo" - ], - "iso639-2": "man", - "iso639-1": null - }; - var Manipuri = { - name: "Manipuri", - names: [ - "Manipuri" - ], - "iso639-2": "mni", - "iso639-1": null - }; - var Manx = { - name: "Manx", - names: [ - "Manx" - ], - "iso639-2": "glv", - "iso639-1": "gv" - }; - var Maori = { - name: "Maori", - names: [ - "Maori" - ], - "iso639-2": "mao/mri", - "iso639-1": "mi" - }; - var Mapuche = { - name: "Mapuche", - names: [ - "Mapudungun", - "Mapuche" - ], - "iso639-2": "arn", - "iso639-1": null - }; - var Mapudungun = { - name: "Mapudungun", - names: [ - "Mapudungun", - "Mapuche" - ], - "iso639-2": "arn", - "iso639-1": null - }; - var Marathi = { - name: "Marathi", - names: [ - "Marathi" - ], - "iso639-2": "mar", - "iso639-1": "mr" - }; - var Mari = { - name: "Mari", - names: [ - "Mari" - ], - "iso639-2": "chm", - "iso639-1": null - }; - var Marshallese = { - name: "Marshallese", - names: [ - "Marshallese" - ], - "iso639-2": "mah", - "iso639-1": "mh" - }; - var Marwari = { - name: "Marwari", - names: [ - "Marwari" - ], - "iso639-2": "mwr", - "iso639-1": null - }; - var Masai = { - name: "Masai", - names: [ - "Masai" - ], - "iso639-2": "mas", - "iso639-1": null - }; - var Mende = { - name: "Mende", - names: [ - "Mende" - ], - "iso639-2": "men", - "iso639-1": null - }; - var Micmac = { - name: "Micmac", - names: [ - "Mi'kmaq", - "Micmac" - ], - "iso639-2": "mic", - "iso639-1": null - }; - var Minangkabau = { - name: "Minangkabau", - names: [ - "Minangkabau" - ], - "iso639-2": "min", - "iso639-1": null - }; - var Mirandese = { - name: "Mirandese", - names: [ - "Mirandese" - ], - "iso639-2": "mwl", - "iso639-1": null - }; - var Mohawk = { - name: "Mohawk", - names: [ - "Mohawk" - ], - "iso639-2": "moh", - "iso639-1": null - }; - var Moksha = { - name: "Moksha", - names: [ - "Moksha" - ], - "iso639-2": "mdf", - "iso639-1": null - }; - var Moldavian = { - name: "Moldavian", - names: [ - "Romanian", - "Moldavian", - "Moldovan" - ], - "iso639-2": "rum/ron", - "iso639-1": "ro" - }; - var Moldovan = { - name: "Moldovan", - names: [ - "Romanian", - "Moldavian", - "Moldovan" - ], - "iso639-2": "rum/ron", - "iso639-1": "ro" - }; - var Mong = { - name: "Mong", - names: [ - "Hmong", - "Mong" - ], - "iso639-2": "hmn", - "iso639-1": null - }; - var Mongo = { - name: "Mongo", - names: [ - "Mongo" - ], - "iso639-2": "lol", - "iso639-1": null - }; - var Mongolian = { - name: "Mongolian", - names: [ - "Mongolian" - ], - "iso639-2": "mon", - "iso639-1": "mn" - }; - var Montenegrin = { - name: "Montenegrin", - names: [ - "Montenegrin" - ], - "iso639-2": "cnr", - "iso639-1": null - }; - var Mossi = { - name: "Mossi", - names: [ - "Mossi" - ], - "iso639-2": "mos", - "iso639-1": null - }; - var Nauru = { - name: "Nauru", - names: [ - "Nauru" - ], - "iso639-2": "nau", - "iso639-1": "na" - }; - var Navaho = { - name: "Navaho", - names: [ - "Navajo", - "Navaho" - ], - "iso639-2": "nav", - "iso639-1": "nv" - }; - var Navajo = { - name: "Navajo", - names: [ - "Navajo", - "Navaho" - ], - "iso639-2": "nav", - "iso639-1": "nv" - }; - var Ndonga = { - name: "Ndonga", - names: [ - "Ndonga" - ], - "iso639-2": "ndo", - "iso639-1": "ng" - }; - var Neapolitan = { - name: "Neapolitan", - names: [ - "Neapolitan" - ], - "iso639-2": "nap", - "iso639-1": null - }; - var Nepali = { - name: "Nepali", - names: [ - "Nepali" - ], - "iso639-2": "nep", - "iso639-1": "ne" - }; - var Newari = { - name: "Newari", - names: [ - "Nepal Bhasa", - "Newari" - ], - "iso639-2": "new", - "iso639-1": null - }; - var Nias = { - name: "Nias", - names: [ - "Nias" - ], - "iso639-2": "nia", - "iso639-1": null - }; - var Niuean = { - name: "Niuean", - names: [ - "Niuean" - ], - "iso639-2": "niu", - "iso639-1": null - }; - var Nogai = { - name: "Nogai", - names: [ - "Nogai" - ], - "iso639-2": "nog", - "iso639-1": null - }; - var Norwegian = { - name: "Norwegian", - names: [ - "Norwegian" - ], - "iso639-2": "nor", - "iso639-1": "no" - }; - var Nuosu = { - name: "Nuosu", - names: [ - "Sichuan Yi", - "Nuosu" - ], - "iso639-2": "iii", - "iso639-1": "ii" - }; - var Nyamwezi = { - name: "Nyamwezi", - names: [ - "Nyamwezi" - ], - "iso639-2": "nym", - "iso639-1": null - }; - var Nyanja = { - name: "Nyanja", - names: [ - "Chichewa", - "Chewa", - "Nyanja" - ], - "iso639-2": "nya", - "iso639-1": "ny" - }; - var Nyankole = { - name: "Nyankole", - names: [ - "Nyankole" - ], - "iso639-2": "nyn", - "iso639-1": null - }; - var Nyoro = { - name: "Nyoro", - names: [ - "Nyoro" - ], - "iso639-2": "nyo", - "iso639-1": null - }; - var Nzima = { - name: "Nzima", - names: [ - "Nzima" - ], - "iso639-2": "nzi", - "iso639-1": null - }; - var Occidental = { - name: "Occidental", - names: [ - "Interlingue", - "Occidental" - ], - "iso639-2": "ile", - "iso639-1": "ie" - }; - var Oirat = { - name: "Oirat", - names: [ - "Kalmyk", - "Oirat" - ], - "iso639-2": "xal", - "iso639-1": null - }; - var Ojibwa = { - name: "Ojibwa", - names: [ - "Ojibwa" - ], - "iso639-2": "oji", - "iso639-1": "oj" - }; - var Oriya = { - name: "Oriya", - names: [ - "Oriya" - ], - "iso639-2": "ori", - "iso639-1": "or" - }; - var Oromo = { - name: "Oromo", - names: [ - "Oromo" - ], - "iso639-2": "orm", - "iso639-1": "om" - }; - var Osage = { - name: "Osage", - names: [ - "Osage" - ], - "iso639-2": "osa", - "iso639-1": null - }; - var Ossetian = { - name: "Ossetian", - names: [ - "Ossetian", - "Ossetic" - ], - "iso639-2": "oss", - "iso639-1": "os" - }; - var Ossetic = { - name: "Ossetic", - names: [ - "Ossetian", - "Ossetic" - ], - "iso639-2": "oss", - "iso639-1": "os" - }; - var Pahlavi = { - name: "Pahlavi", - names: [ - "Pahlavi" - ], - "iso639-2": "pal", - "iso639-1": null - }; - var Palauan = { - name: "Palauan", - names: [ - "Palauan" - ], - "iso639-2": "pau", - "iso639-1": null - }; - var Pali = { - name: "Pali", - names: [ - "Pali" - ], - "iso639-2": "pli", - "iso639-1": "pi" - }; - var Pampanga = { - name: "Pampanga", - names: [ - "Pampanga", - "Kapampangan" - ], - "iso639-2": "pam", - "iso639-1": null - }; - var Pangasinan = { - name: "Pangasinan", - names: [ - "Pangasinan" - ], - "iso639-2": "pag", - "iso639-1": null - }; - var Panjabi = { - name: "Panjabi", - names: [ - "Panjabi", - "Punjabi" - ], - "iso639-2": "pan", - "iso639-1": "pa" - }; - var Papiamento = { - name: "Papiamento", - names: [ - "Papiamento" - ], - "iso639-2": "pap", - "iso639-1": null - }; - var Pashto = { - name: "Pashto", - names: [ - "Pushto", - "Pashto" - ], - "iso639-2": "pus", - "iso639-1": "ps" - }; - var Pedi = { - name: "Pedi", - names: [ - "Pedi", - "Sepedi", - "Northern Sotho" - ], - "iso639-2": "nso", - "iso639-1": null - }; - var Persian = { - name: "Persian", - names: [ - "Persian" - ], - "iso639-2": "per/fas", - "iso639-1": "fa" - }; - var Phoenician = { - name: "Phoenician", - names: [ - "Phoenician" - ], - "iso639-2": "phn", - "iso639-1": null - }; - var Pilipino = { - name: "Pilipino", - names: [ - "Filipino", - "Pilipino" - ], - "iso639-2": "fil", - "iso639-1": null - }; - var Pohnpeian = { - name: "Pohnpeian", - names: [ - "Pohnpeian" - ], - "iso639-2": "pon", - "iso639-1": null - }; - var Polish = { - name: "Polish", - names: [ - "Polish" - ], - "iso639-2": "pol", - "iso639-1": "pl" - }; - var Portuguese = { - name: "Portuguese", - names: [ - "Portuguese" - ], - "iso639-2": "por", - "iso639-1": "pt" - }; - var Punjabi = { - name: "Punjabi", - names: [ - "Panjabi", - "Punjabi" - ], - "iso639-2": "pan", - "iso639-1": "pa" - }; - var Pushto = { - name: "Pushto", - names: [ - "Pushto", - "Pashto" - ], - "iso639-2": "pus", - "iso639-1": "ps" - }; - var Quechua = { - name: "Quechua", - names: [ - "Quechua" - ], - "iso639-2": "que", - "iso639-1": "qu" - }; - var Rajasthani = { - name: "Rajasthani", - names: [ - "Rajasthani" - ], - "iso639-2": "raj", - "iso639-1": null - }; - var Rapanui = { - name: "Rapanui", - names: [ - "Rapanui" - ], - "iso639-2": "rap", - "iso639-1": null - }; - var Rarotongan = { - name: "Rarotongan", - names: [ - "Rarotongan", - "Cook Islands Maori" - ], - "iso639-2": "rar", - "iso639-1": null - }; - var Romanian = { - name: "Romanian", - names: [ - "Romanian", - "Moldavian", - "Moldovan" - ], - "iso639-2": "rum/ron", - "iso639-1": "ro" - }; - var Romansh = { - name: "Romansh", - names: [ - "Romansh" - ], - "iso639-2": "roh", - "iso639-1": "rm" - }; - var Romany = { - name: "Romany", - names: [ - "Romany" - ], - "iso639-2": "rom", - "iso639-1": null - }; - var Rundi = { - name: "Rundi", - names: [ - "Rundi" - ], - "iso639-2": "run", - "iso639-1": "rn" - }; - var Russian = { - name: "Russian", - names: [ - "Russian" - ], - "iso639-2": "rus", - "iso639-1": "ru" - }; - var Sakan = { - name: "Sakan", - names: [ - "Khotanese", - "Sakan" - ], - "iso639-2": "kho", - "iso639-1": null - }; - var Samoan = { - name: "Samoan", - names: [ - "Samoan" - ], - "iso639-2": "smo", - "iso639-1": "sm" - }; - var Sandawe = { - name: "Sandawe", - names: [ - "Sandawe" - ], - "iso639-2": "sad", - "iso639-1": null - }; - var Sango = { - name: "Sango", - names: [ - "Sango" - ], - "iso639-2": "sag", - "iso639-1": "sg" - }; - var Sanskrit = { - name: "Sanskrit", - names: [ - "Sanskrit" - ], - "iso639-2": "san", - "iso639-1": "sa" - }; - var Santali = { - name: "Santali", - names: [ - "Santali" - ], - "iso639-2": "sat", - "iso639-1": null - }; - var Sardinian = { - name: "Sardinian", - names: [ - "Sardinian" - ], - "iso639-2": "srd", - "iso639-1": "sc" - }; - var Sasak = { - name: "Sasak", - names: [ - "Sasak" - ], - "iso639-2": "sas", - "iso639-1": null - }; - var Scots = { - name: "Scots", - names: [ - "Scots" - ], - "iso639-2": "sco", - "iso639-1": null - }; - var Selkup = { - name: "Selkup", - names: [ - "Selkup" - ], - "iso639-2": "sel", - "iso639-1": null - }; - var Sepedi = { - name: "Sepedi", - names: [ - "Pedi", - "Sepedi", - "Northern Sotho" - ], - "iso639-2": "nso", - "iso639-1": null - }; - var Serbian = { - name: "Serbian", - names: [ - "Serbian" - ], - "iso639-2": "srp", - "iso639-1": "sr" - }; - var Serer = { - name: "Serer", - names: [ - "Serer" - ], - "iso639-2": "srr", - "iso639-1": null - }; - var Shan = { - name: "Shan", - names: [ - "Shan" - ], - "iso639-2": "shn", - "iso639-1": null - }; - var Shona = { - name: "Shona", - names: [ - "Shona" - ], - "iso639-2": "sna", - "iso639-1": "sn" - }; - var Sicilian = { - name: "Sicilian", - names: [ - "Sicilian" - ], - "iso639-2": "scn", - "iso639-1": null - }; - var Sidamo = { - name: "Sidamo", - names: [ - "Sidamo" - ], - "iso639-2": "sid", - "iso639-1": null - }; - var Siksika = { - name: "Siksika", - names: [ - "Siksika" - ], - "iso639-2": "bla", - "iso639-1": null - }; - var Sindhi = { - name: "Sindhi", - names: [ - "Sindhi" - ], - "iso639-2": "snd", - "iso639-1": "sd" - }; - var Sinhala = { - name: "Sinhala", - names: [ - "Sinhala", - "Sinhalese" - ], - "iso639-2": "sin", - "iso639-1": "si" - }; - var Sinhalese = { - name: "Sinhalese", - names: [ - "Sinhala", - "Sinhalese" - ], - "iso639-2": "sin", - "iso639-1": "si" - }; - var Slovak = { - name: "Slovak", - names: [ - "Slovak" - ], - "iso639-2": "slo/slk", - "iso639-1": "sk" - }; - var Slovenian = { - name: "Slovenian", - names: [ - "Slovenian" - ], - "iso639-2": "slv", - "iso639-1": "sl" - }; - var Sogdian = { - name: "Sogdian", - names: [ - "Sogdian" - ], - "iso639-2": "sog", - "iso639-1": null - }; - var Somali = { - name: "Somali", - names: [ - "Somali" - ], - "iso639-2": "som", - "iso639-1": "so" - }; - var Soninke = { - name: "Soninke", - names: [ - "Soninke" - ], - "iso639-2": "snk", - "iso639-1": null - }; - var Spanish = { - name: "Spanish", - names: [ - "Spanish", - "Castilian" - ], - "iso639-2": "spa", - "iso639-1": "es" - }; - var Sukuma = { - name: "Sukuma", - names: [ - "Sukuma" - ], - "iso639-2": "suk", - "iso639-1": null - }; - var Sumerian = { - name: "Sumerian", - names: [ - "Sumerian" - ], - "iso639-2": "sux", - "iso639-1": null - }; - var Sundanese = { - name: "Sundanese", - names: [ - "Sundanese" - ], - "iso639-2": "sun", - "iso639-1": "su" - }; - var Susu = { - name: "Susu", - names: [ - "Susu" - ], - "iso639-2": "sus", - "iso639-1": null - }; - var Swahili = { - name: "Swahili", - names: [ - "Swahili" - ], - "iso639-2": "swa", - "iso639-1": "sw" - }; - var Swati = { - name: "Swati", - names: [ - "Swati" - ], - "iso639-2": "ssw", - "iso639-1": "ss" - }; - var Swedish = { - name: "Swedish", - names: [ - "Swedish" - ], - "iso639-2": "swe", - "iso639-1": "sv" - }; - var Syriac = { - name: "Syriac", - names: [ - "Syriac" - ], - "iso639-2": "syr", - "iso639-1": null - }; - var Tagalog = { - name: "Tagalog", - names: [ - "Tagalog" - ], - "iso639-2": "tgl", - "iso639-1": "tl" - }; - var Tahitian = { - name: "Tahitian", - names: [ - "Tahitian" - ], - "iso639-2": "tah", - "iso639-1": "ty" - }; - var Tajik = { - name: "Tajik", - names: [ - "Tajik" - ], - "iso639-2": "tgk", - "iso639-1": "tg" - }; - var Tamashek = { - name: "Tamashek", - names: [ - "Tamashek" - ], - "iso639-2": "tmh", - "iso639-1": null - }; - var Tamil = { - name: "Tamil", - names: [ - "Tamil" - ], - "iso639-2": "tam", - "iso639-1": "ta" - }; - var Tatar = { - name: "Tatar", - names: [ - "Tatar" - ], - "iso639-2": "tat", - "iso639-1": "tt" - }; - var Telugu = { - name: "Telugu", - names: [ - "Telugu" - ], - "iso639-2": "tel", - "iso639-1": "te" - }; - var Tereno = { - name: "Tereno", - names: [ - "Tereno" - ], - "iso639-2": "ter", - "iso639-1": null - }; - var Tetum = { - name: "Tetum", - names: [ - "Tetum" - ], - "iso639-2": "tet", - "iso639-1": null - }; - var Thai = { - name: "Thai", - names: [ - "Thai" - ], - "iso639-2": "tha", - "iso639-1": "th" - }; - var Tibetan = { - name: "Tibetan", - names: [ - "Tibetan" - ], - "iso639-2": "tib/bod", - "iso639-1": "bo" - }; - var Tigre = { - name: "Tigre", - names: [ - "Tigre" - ], - "iso639-2": "tig", - "iso639-1": null - }; - var Tigrinya = { - name: "Tigrinya", - names: [ - "Tigrinya" - ], - "iso639-2": "tir", - "iso639-1": "ti" - }; - var Timne = { - name: "Timne", - names: [ - "Timne" - ], - "iso639-2": "tem", - "iso639-1": null - }; - var Tiv = { - name: "Tiv", - names: [ - "Tiv" - ], - "iso639-2": "tiv", - "iso639-1": null - }; - var Tlingit = { - name: "Tlingit", - names: [ - "Tlingit" - ], - "iso639-2": "tli", - "iso639-1": null - }; - var Tokelau = { - name: "Tokelau", - names: [ - "Tokelau" - ], - "iso639-2": "tkl", - "iso639-1": null - }; - var Tsimshian = { - name: "Tsimshian", - names: [ - "Tsimshian" - ], - "iso639-2": "tsi", - "iso639-1": null - }; - var Tsonga = { - name: "Tsonga", - names: [ - "Tsonga" - ], - "iso639-2": "tso", - "iso639-1": "ts" - }; - var Tswana = { - name: "Tswana", - names: [ - "Tswana" - ], - "iso639-2": "tsn", - "iso639-1": "tn" - }; - var Tumbuka = { - name: "Tumbuka", - names: [ - "Tumbuka" - ], - "iso639-2": "tum", - "iso639-1": null - }; - var Turkish = { - name: "Turkish", - names: [ - "Turkish" - ], - "iso639-2": "tur", - "iso639-1": "tr" - }; - var Turkmen = { - name: "Turkmen", - names: [ - "Turkmen" - ], - "iso639-2": "tuk", - "iso639-1": "tk" - }; - var Tuvalu = { - name: "Tuvalu", - names: [ - "Tuvalu" - ], - "iso639-2": "tvl", - "iso639-1": null - }; - var Tuvinian = { - name: "Tuvinian", - names: [ - "Tuvinian" - ], - "iso639-2": "tyv", - "iso639-1": null - }; - var Twi = { - name: "Twi", - names: [ - "Twi" - ], - "iso639-2": "twi", - "iso639-1": "tw" - }; - var Udmurt = { - name: "Udmurt", - names: [ - "Udmurt" - ], - "iso639-2": "udm", - "iso639-1": null - }; - var Ugaritic = { - name: "Ugaritic", - names: [ - "Ugaritic" - ], - "iso639-2": "uga", - "iso639-1": null - }; - var Uighur = { - name: "Uighur", - names: [ - "Uighur", - "Uyghur" - ], - "iso639-2": "uig", - "iso639-1": "ug" - }; - var Ukrainian = { - name: "Ukrainian", - names: [ - "Ukrainian" - ], - "iso639-2": "ukr", - "iso639-1": "uk" - }; - var Umbundu = { - name: "Umbundu", - names: [ - "Umbundu" - ], - "iso639-2": "umb", - "iso639-1": null - }; - var Undetermined = { - name: "Undetermined", - names: [ - "Undetermined" - ], - "iso639-2": "und", - "iso639-1": null - }; - var Urdu = { - name: "Urdu", - names: [ - "Urdu" - ], - "iso639-2": "urd", - "iso639-1": "ur" - }; - var Uyghur = { - name: "Uyghur", - names: [ - "Uighur", - "Uyghur" - ], - "iso639-2": "uig", - "iso639-1": "ug" - }; - var Uzbek = { - name: "Uzbek", - names: [ - "Uzbek" - ], - "iso639-2": "uzb", - "iso639-1": "uz" - }; - var Vai = { - name: "Vai", - names: [ - "Vai" - ], - "iso639-2": "vai", - "iso639-1": null - }; - var Valencian = { - name: "Valencian", - names: [ - "Catalan", - "Valencian" - ], - "iso639-2": "cat", - "iso639-1": "ca" - }; - var Venda = { - name: "Venda", - names: [ - "Venda" - ], - "iso639-2": "ven", - "iso639-1": "ve" - }; - var Vietnamese = { - name: "Vietnamese", - names: [ - "Vietnamese" - ], - "iso639-2": "vie", - "iso639-1": "vi" - }; - var Votic = { - name: "Votic", - names: [ - "Votic" - ], - "iso639-2": "vot", - "iso639-1": null - }; - var Walloon = { - name: "Walloon", - names: [ - "Walloon" - ], - "iso639-2": "wln", - "iso639-1": "wa" - }; - var Waray = { - name: "Waray", - names: [ - "Waray" - ], - "iso639-2": "war", - "iso639-1": null - }; - var Washo = { - name: "Washo", - names: [ - "Washo" - ], - "iso639-2": "was", - "iso639-1": null - }; - var Welsh = { - name: "Welsh", - names: [ - "Welsh" - ], - "iso639-2": "wel/cym", - "iso639-1": "cy" - }; - var Wolaitta = { - name: "Wolaitta", - names: [ - "Wolaitta", - "Wolaytta" - ], - "iso639-2": "wal", - "iso639-1": null - }; - var Wolaytta = { - name: "Wolaytta", - names: [ - "Wolaitta", - "Wolaytta" - ], - "iso639-2": "wal", - "iso639-1": null - }; - var Wolof = { - name: "Wolof", - names: [ - "Wolof" - ], - "iso639-2": "wol", - "iso639-1": "wo" - }; - var Xhosa = { - name: "Xhosa", - names: [ - "Xhosa" - ], - "iso639-2": "xho", - "iso639-1": "xh" - }; - var Yakut = { - name: "Yakut", - names: [ - "Yakut" - ], - "iso639-2": "sah", - "iso639-1": null - }; - var Yao = { - name: "Yao", - names: [ - "Yao" - ], - "iso639-2": "yao", - "iso639-1": null - }; - var Yapese = { - name: "Yapese", - names: [ - "Yapese" - ], - "iso639-2": "yap", - "iso639-1": null - }; - var Yiddish = { - name: "Yiddish", - names: [ - "Yiddish" - ], - "iso639-2": "yid", - "iso639-1": "yi" - }; - var Yoruba = { - name: "Yoruba", - names: [ - "Yoruba" - ], - "iso639-2": "yor", - "iso639-1": "yo" - }; - var Zapotec = { - name: "Zapotec", - names: [ - "Zapotec" - ], - "iso639-2": "zap", - "iso639-1": null - }; - var Zaza = { - name: "Zaza", - names: [ - "Zaza", - "Dimili", - "Dimli", - "Kirdki", - "Kirmanjki", - "Zazaki" - ], - "iso639-2": "zza", - "iso639-1": null - }; - var Zazaki = { - name: "Zazaki", - names: [ - "Zaza", - "Dimili", - "Dimli", - "Kirdki", - "Kirmanjki", - "Zazaki" - ], - "iso639-2": "zza", - "iso639-1": null - }; - var Zenaga = { - name: "Zenaga", - names: [ - "Zenaga" - ], - "iso639-2": "zen", - "iso639-1": null - }; - var Zhuang = { - name: "Zhuang", - names: [ - "Zhuang", - "Chuang" - ], - "iso639-2": "zha", - "iso639-1": "za" - }; - var Zulu = { - name: "Zulu", - names: [ - "Zulu" - ], - "iso639-2": "zul", - "iso639-1": "zu" - }; - var Zuni = { - name: "Zuni", - names: [ - "Zuni" - ], - "iso639-2": "zun", - "iso639-1": null - }; - var iso = { - Abkhazian: Abkhazian, - Achinese: Achinese, - Acoli: Acoli, - Adangme: Adangme, - Adygei: Adygei, - Adyghe: Adyghe, - Afar: Afar, - Afrihili: Afrihili, - Afrikaans: Afrikaans, - "Afro-Asiatic languages": { - name: "Afro-Asiatic languages", - names: [ - "Afro-Asiatic languages" - ], - "iso639-2": "afa", - "iso639-1": null - }, - Ainu: Ainu, - Akan: Akan, - Akkadian: Akkadian, - Albanian: Albanian, - Alemannic: Alemannic, - Aleut: Aleut, - "Algonquian languages": { - name: "Algonquian languages", - names: [ - "Algonquian languages" - ], - "iso639-2": "alg", - "iso639-1": null - }, - Alsatian: Alsatian, - "Altaic languages": { - name: "Altaic languages", - names: [ - "Altaic languages" - ], - "iso639-2": "tut", - "iso639-1": null - }, - Amharic: Amharic, - Angika: Angika, - "Apache languages": { - name: "Apache languages", - names: [ - "Apache languages" - ], - "iso639-2": "apa", - "iso639-1": null - }, - Arabic: Arabic, - Aragonese: Aragonese, - Arapaho: Arapaho, - Arawak: Arawak, - Armenian: Armenian, - Aromanian: Aromanian, - "Artificial languages": { - name: "Artificial languages", - names: [ - "Artificial languages" - ], - "iso639-2": "art", - "iso639-1": null - }, - Arumanian: Arumanian, - Assamese: Assamese, - Asturian: Asturian, - Asturleonese: Asturleonese, - "Athapascan languages": { - name: "Athapascan languages", - names: [ - "Athapascan languages" - ], - "iso639-2": "ath", - "iso639-1": null - }, - "Australian languages": { - name: "Australian languages", - names: [ - "Australian languages" - ], - "iso639-2": "aus", - "iso639-1": null - }, - "Austronesian languages": { - name: "Austronesian languages", - names: [ - "Austronesian languages" - ], - "iso639-2": "map", - "iso639-1": null - }, - Avaric: Avaric, - Avestan: Avestan, - Awadhi: Awadhi, - Aymara: Aymara, - Azerbaijani: Azerbaijani, - Bable: Bable, - Balinese: Balinese, - "Baltic languages": { - name: "Baltic languages", - names: [ - "Baltic languages" - ], - "iso639-2": "bat", - "iso639-1": null - }, - Baluchi: Baluchi, - Bambara: Bambara, - "Bamileke languages": { - name: "Bamileke languages", - names: [ - "Bamileke languages" - ], - "iso639-2": "bai", - "iso639-1": null - }, - "Banda languages": { - name: "Banda languages", - names: [ - "Banda languages" - ], - "iso639-2": "bad", - "iso639-1": null - }, - "Bantu languages": { - name: "Bantu languages", - names: [ - "Bantu languages" - ], - "iso639-2": "bnt", - "iso639-1": null - }, - Basa: Basa, - Bashkir: Bashkir, - Basque: Basque, - "Batak languages": { - name: "Batak languages", - names: [ - "Batak languages" - ], - "iso639-2": "btk", - "iso639-1": null - }, - Bedawiyet: Bedawiyet, - Beja: Beja, - Belarusian: Belarusian, - Bemba: Bemba, - Bengali: Bengali, - "Berber languages": { - name: "Berber languages", - names: [ - "Berber languages" - ], - "iso639-2": "ber", - "iso639-1": null - }, - Bhojpuri: Bhojpuri, - "Bihari languages": { - name: "Bihari languages", - names: [ - "Bihari languages" - ], - "iso639-2": "bih", - "iso639-1": "bh" - }, - Bikol: Bikol, - Bilin: Bilin, - Bini: Bini, - Bislama: Bislama, - Blin: Blin, - Bliss: Bliss, - Blissymbolics: Blissymbolics, - Blissymbols: Blissymbols, - "Bokmål, Norwegian": { - name: "Bokmål, Norwegian", - names: [ - "Bokmål, Norwegian", - "Norwegian Bokmål" - ], - "iso639-2": "nob", - "iso639-1": "nb" - }, - Bosnian: Bosnian, - Braj: Braj, - Breton: Breton, - Buginese: Buginese, - Bulgarian: Bulgarian, - Buriat: Buriat, - Burmese: Burmese, - Caddo: Caddo, - Castilian: Castilian, - Catalan: Catalan, - "Caucasian languages": { - name: "Caucasian languages", - names: [ - "Caucasian languages" - ], - "iso639-2": "cau", - "iso639-1": null - }, - Cebuano: Cebuano, - "Celtic languages": { - name: "Celtic languages", - names: [ - "Celtic languages" - ], - "iso639-2": "cel", - "iso639-1": null - }, - "Central American Indian languages": { - name: "Central American Indian languages", - names: [ - "Central American Indian languages" - ], - "iso639-2": "cai", - "iso639-1": null - }, - "Central Khmer": { - name: "Central Khmer", - names: [ - "Central Khmer" - ], - "iso639-2": "khm", - "iso639-1": "km" - }, - Chagatai: Chagatai, - "Chamic languages": { - name: "Chamic languages", - names: [ - "Chamic languages" - ], - "iso639-2": "cmc", - "iso639-1": null - }, - Chamorro: Chamorro, - Chechen: Chechen, - Cherokee: Cherokee, - Chewa: Chewa, - Cheyenne: Cheyenne, - Chibcha: Chibcha, - Chichewa: Chichewa, - Chinese: Chinese, - "Chinook jargon": { - name: "Chinook jargon", - names: [ - "Chinook jargon" - ], - "iso639-2": "chn", - "iso639-1": null - }, - Chipewyan: Chipewyan, - Choctaw: Choctaw, - Chuang: Chuang, - "Church Slavic": { - name: "Church Slavic", - names: [ - "Church Slavic", - "Old Slavonic", - "Church Slavonic", - "Old Bulgarian", - "Old Church Slavonic" - ], - "iso639-2": "chu", - "iso639-1": "cu" - }, - "Church Slavonic": { - name: "Church Slavonic", - names: [ - "Church Slavic", - "Old Slavonic", - "Church Slavonic", - "Old Bulgarian", - "Old Church Slavonic" - ], - "iso639-2": "chu", - "iso639-1": "cu" - }, - Chuukese: Chuukese, - Chuvash: Chuvash, - "Classical Nepal Bhasa": { - name: "Classical Nepal Bhasa", - names: [ - "Classical Newari", - "Old Newari", - "Classical Nepal Bhasa" - ], - "iso639-2": "nwc", - "iso639-1": null - }, - "Classical Newari": { - name: "Classical Newari", - names: [ - "Classical Newari", - "Old Newari", - "Classical Nepal Bhasa" - ], - "iso639-2": "nwc", - "iso639-1": null - }, - "Classical Syriac": { - name: "Classical Syriac", - names: [ - "Classical Syriac" - ], - "iso639-2": "syc", - "iso639-1": null - }, - "Cook Islands Maori": { - name: "Cook Islands Maori", - names: [ - "Rarotongan", - "Cook Islands Maori" - ], - "iso639-2": "rar", - "iso639-1": null - }, - Coptic: Coptic, - Cornish: Cornish, - Corsican: Corsican, - Cree: Cree, - Creek: Creek, - "Creoles and pidgins": { - name: "Creoles and pidgins", - names: [ - "Creoles and pidgins" - ], - "iso639-2": "crp", - "iso639-1": null - }, - "Creoles and pidgins, English based": { - name: "Creoles and pidgins, English based", - names: [ - "Creoles and pidgins, English based" - ], - "iso639-2": "cpe", - "iso639-1": null - }, - "Creoles and pidgins, French-based": { - name: "Creoles and pidgins, French-based", - names: [ - "Creoles and pidgins, French-based" - ], - "iso639-2": "cpf", - "iso639-1": null - }, - "Creoles and pidgins, Portuguese-based": { - name: "Creoles and pidgins, Portuguese-based", - names: [ - "Creoles and pidgins, Portuguese-based" - ], - "iso639-2": "cpp", - "iso639-1": null - }, - "Crimean Tatar": { - name: "Crimean Tatar", - names: [ - "Crimean Tatar", - "Crimean Turkish" - ], - "iso639-2": "crh", - "iso639-1": null - }, - "Crimean Turkish": { - name: "Crimean Turkish", - names: [ - "Crimean Tatar", - "Crimean Turkish" - ], - "iso639-2": "crh", - "iso639-1": null - }, - Croatian: Croatian, - "Cushitic languages": { - name: "Cushitic languages", - names: [ - "Cushitic languages" - ], - "iso639-2": "cus", - "iso639-1": null - }, - Czech: Czech, - Dakota: Dakota, - Danish: Danish, - Dargwa: Dargwa, - Delaware: Delaware, - "Dene Suline": { - name: "Dene Suline", - names: [ - "Chipewyan", - "Dene Suline" - ], - "iso639-2": "chp", - "iso639-1": null - }, - Dhivehi: Dhivehi, - Dimili: Dimili, - Dimli: Dimli, - Dinka: Dinka, - Divehi: Divehi, - Dogri: Dogri, - Dogrib: Dogrib, - "Dravidian languages": { - name: "Dravidian languages", - names: [ - "Dravidian languages" - ], - "iso639-2": "dra", - "iso639-1": null - }, - Duala: Duala, - Dutch: Dutch, - "Dutch, Middle (ca.1050-1350)": { - name: "Dutch, Middle (ca.1050-1350)", - names: [ - "Dutch, Middle (ca.1050-1350)" - ], - "iso639-2": "dum", - "iso639-1": null - }, - Dyula: Dyula, - Dzongkha: Dzongkha, - "Eastern Frisian": { - name: "Eastern Frisian", - names: [ - "Eastern Frisian" - ], - "iso639-2": "frs", - "iso639-1": null - }, - Edo: Edo, - Efik: Efik, - "Egyptian (Ancient)": { - name: "Egyptian (Ancient)", - names: [ - "Egyptian (Ancient)" - ], - "iso639-2": "egy", - "iso639-1": null - }, - Ekajuk: Ekajuk, - Elamite: Elamite, - English: English, - "English, Middle (1100-1500)": { - name: "English, Middle (1100-1500)", - names: [ - "English, Middle (1100-1500)" - ], - "iso639-2": "enm", - "iso639-1": null - }, - "English, Old (ca.450-1100)": { - name: "English, Old (ca.450-1100)", - names: [ - "English, Old (ca.450-1100)" - ], - "iso639-2": "ang", - "iso639-1": null - }, - Erzya: Erzya, - Esperanto: Esperanto, - Estonian: Estonian, - Ewe: Ewe, - Ewondo: Ewondo, - Fang: Fang, - Fanti: Fanti, - Faroese: Faroese, - Fijian: Fijian, - Filipino: Filipino, - Finnish: Finnish, - "Finno-Ugrian languages": { - name: "Finno-Ugrian languages", - names: [ - "Finno-Ugrian languages" - ], - "iso639-2": "fiu", - "iso639-1": null - }, - Flemish: Flemish, - Fon: Fon, - French: French, - "French, Middle (ca.1400-1600)": { - name: "French, Middle (ca.1400-1600)", - names: [ - "French, Middle (ca.1400-1600)" - ], - "iso639-2": "frm", - "iso639-1": null - }, - "French, Old (842-ca.1400)": { - name: "French, Old (842-ca.1400)", - names: [ - "French, Old (842-ca.1400)" - ], - "iso639-2": "fro", - "iso639-1": null - }, - Friulian: Friulian, - Fulah: Fulah, - Ga: Ga, - Gaelic: Gaelic, - "Galibi Carib": { - name: "Galibi Carib", - names: [ - "Galibi Carib" - ], - "iso639-2": "car", - "iso639-1": null - }, - Galician: Galician, - Ganda: Ganda, - Gayo: Gayo, - Gbaya: Gbaya, - Geez: Geez, - Georgian: Georgian, - German: German, - "German, Low": { - name: "German, Low", - names: [ - "Low German", - "Low Saxon", - "German, Low", - "Saxon, Low" - ], - "iso639-2": "nds", - "iso639-1": null - }, - "German, Middle High (ca.1050-1500)": { - name: "German, Middle High (ca.1050-1500)", - names: [ - "German, Middle High (ca.1050-1500)" - ], - "iso639-2": "gmh", - "iso639-1": null - }, - "German, Old High (ca.750-1050)": { - name: "German, Old High (ca.750-1050)", - names: [ - "German, Old High (ca.750-1050)" - ], - "iso639-2": "goh", - "iso639-1": null - }, - "Germanic languages": { - name: "Germanic languages", - names: [ - "Germanic languages" - ], - "iso639-2": "gem", - "iso639-1": null - }, - Gikuyu: Gikuyu, - Gilbertese: Gilbertese, - Gondi: Gondi, - Gorontalo: Gorontalo, - Gothic: Gothic, - Grebo: Grebo, - "Greek, Ancient (to 1453)": { - name: "Greek, Ancient (to 1453)", - names: [ - "Greek, Ancient (to 1453)" - ], - "iso639-2": "grc", - "iso639-1": null - }, - "Greek, Modern (1453-)": { - name: "Greek, Modern (1453-)", - names: [ - "Greek, Modern (1453-)" - ], - "iso639-2": "gre/ell", - "iso639-1": "el" - }, - Greenlandic: Greenlandic, - Guarani: Guarani, - Gujarati: Gujarati, - "Gwich'in": { - name: "Gwich'in", - names: [ - "Gwich'in" - ], - "iso639-2": "gwi", - "iso639-1": null - }, - Haida: Haida, - Haitian: Haitian, - "Haitian Creole": { - name: "Haitian Creole", - names: [ - "Haitian", - "Haitian Creole" - ], - "iso639-2": "hat", - "iso639-1": "ht" - }, - Hausa: Hausa, - Hawaiian: Hawaiian, - Hebrew: Hebrew, - Herero: Herero, - Hiligaynon: Hiligaynon, - "Himachali languages": { - name: "Himachali languages", - names: [ - "Himachali languages", - "Western Pahari languages" - ], - "iso639-2": "him", - "iso639-1": null - }, - Hindi: Hindi, - "Hiri Motu": { - name: "Hiri Motu", - names: [ - "Hiri Motu" - ], - "iso639-2": "hmo", - "iso639-1": "ho" - }, - Hittite: Hittite, - Hmong: Hmong, - Hungarian: Hungarian, - Hupa: Hupa, - Iban: Iban, - Icelandic: Icelandic, - Ido: Ido, - Igbo: Igbo, - "Ijo languages": { - name: "Ijo languages", - names: [ - "Ijo languages" - ], - "iso639-2": "ijo", - "iso639-1": null - }, - Iloko: Iloko, - "Imperial Aramaic (700-300 BCE)": { - name: "Imperial Aramaic (700-300 BCE)", - names: [ - "Official Aramaic (700-300 BCE)", - "Imperial Aramaic (700-300 BCE)" - ], - "iso639-2": "arc", - "iso639-1": null - }, - "Inari Sami": { - name: "Inari Sami", - names: [ - "Inari Sami" - ], - "iso639-2": "smn", - "iso639-1": null - }, - "Indic languages": { - name: "Indic languages", - names: [ - "Indic languages" - ], - "iso639-2": "inc", - "iso639-1": null - }, - "Indo-European languages": { - name: "Indo-European languages", - names: [ - "Indo-European languages" - ], - "iso639-2": "ine", - "iso639-1": null - }, - Indonesian: Indonesian, - Ingush: Ingush, - "Interlingua (International Auxiliary Language Association)": { - name: "Interlingua (International Auxiliary Language Association)", - names: [ - "Interlingua (International Auxiliary Language Association)" - ], - "iso639-2": "ina", - "iso639-1": "ia" - }, - Interlingue: Interlingue, - Inuktitut: Inuktitut, - Inupiaq: Inupiaq, - "Iranian languages": { - name: "Iranian languages", - names: [ - "Iranian languages" - ], - "iso639-2": "ira", - "iso639-1": null - }, - Irish: Irish, - "Irish, Middle (900-1200)": { - name: "Irish, Middle (900-1200)", - names: [ - "Irish, Middle (900-1200)" - ], - "iso639-2": "mga", - "iso639-1": null - }, - "Irish, Old (to 900)": { - name: "Irish, Old (to 900)", - names: [ - "Irish, Old (to 900)" - ], - "iso639-2": "sga", - "iso639-1": null - }, - "Iroquoian languages": { - name: "Iroquoian languages", - names: [ - "Iroquoian languages" - ], - "iso639-2": "iro", - "iso639-1": null - }, - Italian: Italian, - Japanese: Japanese, - Javanese: Javanese, - Jingpho: Jingpho, - "Judeo-Arabic": { - name: "Judeo-Arabic", - names: [ - "Judeo-Arabic" - ], - "iso639-2": "jrb", - "iso639-1": null - }, - "Judeo-Persian": { - name: "Judeo-Persian", - names: [ - "Judeo-Persian" - ], - "iso639-2": "jpr", - "iso639-1": null - }, - Kabardian: Kabardian, - Kabyle: Kabyle, - Kachin: Kachin, - Kalaallisut: Kalaallisut, - Kalmyk: Kalmyk, - Kamba: Kamba, - Kannada: Kannada, - Kanuri: Kanuri, - Kapampangan: Kapampangan, - "Kara-Kalpak": { - name: "Kara-Kalpak", - names: [ - "Kara-Kalpak" - ], - "iso639-2": "kaa", - "iso639-1": null - }, - "Karachay-Balkar": { - name: "Karachay-Balkar", - names: [ - "Karachay-Balkar" - ], - "iso639-2": "krc", - "iso639-1": null - }, - Karelian: Karelian, - "Karen languages": { - name: "Karen languages", - names: [ - "Karen languages" - ], - "iso639-2": "kar", - "iso639-1": null - }, - Kashmiri: Kashmiri, - Kashubian: Kashubian, - Kawi: Kawi, - Kazakh: Kazakh, - Khasi: Khasi, - "Khoisan languages": { - name: "Khoisan languages", - names: [ - "Khoisan languages" - ], - "iso639-2": "khi", - "iso639-1": null - }, - Khotanese: Khotanese, - Kikuyu: Kikuyu, - Kimbundu: Kimbundu, - Kinyarwanda: Kinyarwanda, - Kirdki: Kirdki, - Kirghiz: Kirghiz, - Kirmanjki: Kirmanjki, - Klingon: Klingon, - Komi: Komi, - Kongo: Kongo, - Konkani: Konkani, - Korean: Korean, - Kosraean: Kosraean, - Kpelle: Kpelle, - "Kru languages": { - name: "Kru languages", - names: [ - "Kru languages" - ], - "iso639-2": "kro", - "iso639-1": null - }, - Kuanyama: Kuanyama, - Kumyk: Kumyk, - Kurdish: Kurdish, - Kurukh: Kurukh, - Kutenai: Kutenai, - Kwanyama: Kwanyama, - Kyrgyz: Kyrgyz, - Ladino: Ladino, - Lahnda: Lahnda, - Lamba: Lamba, - "Land Dayak languages": { - name: "Land Dayak languages", - names: [ - "Land Dayak languages" - ], - "iso639-2": "day", - "iso639-1": null - }, - Lao: Lao, - Latin: Latin, - Latvian: Latvian, - Leonese: Leonese, - Letzeburgesch: Letzeburgesch, - Lezghian: Lezghian, - Limburgan: Limburgan, - Limburger: Limburger, - Limburgish: Limburgish, - Lingala: Lingala, - Lithuanian: Lithuanian, - Lojban: Lojban, - "Low German": { - name: "Low German", - names: [ - "Low German", - "Low Saxon", - "German, Low", - "Saxon, Low" - ], - "iso639-2": "nds", - "iso639-1": null - }, - "Low Saxon": { - name: "Low Saxon", - names: [ - "Low German", - "Low Saxon", - "German, Low", - "Saxon, Low" - ], - "iso639-2": "nds", - "iso639-1": null - }, - "Lower Sorbian": { - name: "Lower Sorbian", - names: [ - "Lower Sorbian" - ], - "iso639-2": "dsb", - "iso639-1": null - }, - Lozi: Lozi, - "Luba-Katanga": { - name: "Luba-Katanga", - names: [ - "Luba-Katanga" - ], - "iso639-2": "lub", - "iso639-1": "lu" - }, - "Luba-Lulua": { - name: "Luba-Lulua", - names: [ - "Luba-Lulua" - ], - "iso639-2": "lua", - "iso639-1": null - }, - Luiseno: Luiseno, - "Lule Sami": { - name: "Lule Sami", - names: [ - "Lule Sami" - ], - "iso639-2": "smj", - "iso639-1": null - }, - Lunda: Lunda, - "Luo (Kenya and Tanzania)": { - name: "Luo (Kenya and Tanzania)", - names: [ - "Luo (Kenya and Tanzania)" - ], - "iso639-2": "luo", - "iso639-1": null - }, - Lushai: Lushai, - Luxembourgish: Luxembourgish, - "Macedo-Romanian": { - name: "Macedo-Romanian", - names: [ - "Aromanian", - "Arumanian", - "Macedo-Romanian" - ], - "iso639-2": "rup", - "iso639-1": null - }, - Macedonian: Macedonian, - Madurese: Madurese, - Magahi: Magahi, - Maithili: Maithili, - Makasar: Makasar, - Malagasy: Malagasy, - Malay: Malay, - Malayalam: Malayalam, - Maldivian: Maldivian, - Maltese: Maltese, - Manchu: Manchu, - Mandar: Mandar, - Mandingo: Mandingo, - Manipuri: Manipuri, - "Manobo languages": { - name: "Manobo languages", - names: [ - "Manobo languages" - ], - "iso639-2": "mno", - "iso639-1": null - }, - Manx: Manx, - Maori: Maori, - Mapuche: Mapuche, - Mapudungun: Mapudungun, - Marathi: Marathi, - Mari: Mari, - Marshallese: Marshallese, - Marwari: Marwari, - Masai: Masai, - "Mayan languages": { - name: "Mayan languages", - names: [ - "Mayan languages" - ], - "iso639-2": "myn", - "iso639-1": null - }, - Mende: Mende, - "Mi'kmaq": { - name: "Mi'kmaq", - names: [ - "Mi'kmaq", - "Micmac" - ], - "iso639-2": "mic", - "iso639-1": null - }, - Micmac: Micmac, - Minangkabau: Minangkabau, - Mirandese: Mirandese, - Mohawk: Mohawk, - Moksha: Moksha, - Moldavian: Moldavian, - Moldovan: Moldovan, - "Mon-Khmer languages": { - name: "Mon-Khmer languages", - names: [ - "Mon-Khmer languages" - ], - "iso639-2": "mkh", - "iso639-1": null - }, - Mong: Mong, - Mongo: Mongo, - Mongolian: Mongolian, - Montenegrin: Montenegrin, - Mossi: Mossi, - "Multiple languages": { - name: "Multiple languages", - names: [ - "Multiple languages" - ], - "iso639-2": "mul", - "iso639-1": null - }, - "Munda languages": { - name: "Munda languages", - names: [ - "Munda languages" - ], - "iso639-2": "mun", - "iso639-1": null - }, - "N'Ko": { - name: "N'Ko", - names: [ - "N'Ko" - ], - "iso639-2": "nqo", - "iso639-1": null - }, - "Nahuatl languages": { - name: "Nahuatl languages", - names: [ - "Nahuatl languages" - ], - "iso639-2": "nah", - "iso639-1": null - }, - Nauru: Nauru, - Navaho: Navaho, - Navajo: Navajo, - "Ndebele, North": { - name: "Ndebele, North", - names: [ - "Ndebele, North", - "North Ndebele" - ], - "iso639-2": "nde", - "iso639-1": "nd" - }, - "Ndebele, South": { - name: "Ndebele, South", - names: [ - "Ndebele, South", - "South Ndebele" - ], - "iso639-2": "nbl", - "iso639-1": "nr" - }, - Ndonga: Ndonga, - Neapolitan: Neapolitan, - "Nepal Bhasa": { - name: "Nepal Bhasa", - names: [ - "Nepal Bhasa", - "Newari" - ], - "iso639-2": "new", - "iso639-1": null - }, - Nepali: Nepali, - Newari: Newari, - Nias: Nias, - "Niger-Kordofanian languages": { - name: "Niger-Kordofanian languages", - names: [ - "Niger-Kordofanian languages" - ], - "iso639-2": "nic", - "iso639-1": null - }, - "Nilo-Saharan languages": { - name: "Nilo-Saharan languages", - names: [ - "Nilo-Saharan languages" - ], - "iso639-2": "ssa", - "iso639-1": null - }, - Niuean: Niuean, - "No linguistic content": { - name: "No linguistic content", - names: [ - "No linguistic content", - "Not applicable" - ], - "iso639-2": "zxx", - "iso639-1": null - }, - Nogai: Nogai, - "Norse, Old": { - name: "Norse, Old", - names: [ - "Norse, Old" - ], - "iso639-2": "non", - "iso639-1": null - }, - "North American Indian languages": { - name: "North American Indian languages", - names: [ - "North American Indian languages" - ], - "iso639-2": "nai", - "iso639-1": null - }, - "North Ndebele": { - name: "North Ndebele", - names: [ - "Ndebele, North", - "North Ndebele" - ], - "iso639-2": "nde", - "iso639-1": "nd" - }, - "Northern Frisian": { - name: "Northern Frisian", - names: [ - "Northern Frisian" - ], - "iso639-2": "frr", - "iso639-1": null - }, - "Northern Sami": { - name: "Northern Sami", - names: [ - "Northern Sami" - ], - "iso639-2": "sme", - "iso639-1": "se" - }, - "Northern Sotho": { - name: "Northern Sotho", - names: [ - "Pedi", - "Sepedi", - "Northern Sotho" - ], - "iso639-2": "nso", - "iso639-1": null - }, - Norwegian: Norwegian, - "Norwegian Bokmål": { - name: "Norwegian Bokmål", - names: [ - "Bokmål, Norwegian", - "Norwegian Bokmål" - ], - "iso639-2": "nob", - "iso639-1": "nb" - }, - "Norwegian Nynorsk": { - name: "Norwegian Nynorsk", - names: [ - "Norwegian Nynorsk", - "Nynorsk, Norwegian" - ], - "iso639-2": "nno", - "iso639-1": "nn" - }, - "Not applicable": { - name: "Not applicable", - names: [ - "No linguistic content", - "Not applicable" - ], - "iso639-2": "zxx", - "iso639-1": null - }, - "Nubian languages": { - name: "Nubian languages", - names: [ - "Nubian languages" - ], - "iso639-2": "nub", - "iso639-1": null - }, - Nuosu: Nuosu, - Nyamwezi: Nyamwezi, - Nyanja: Nyanja, - Nyankole: Nyankole, - "Nynorsk, Norwegian": { - name: "Nynorsk, Norwegian", - names: [ - "Norwegian Nynorsk", - "Nynorsk, Norwegian" - ], - "iso639-2": "nno", - "iso639-1": "nn" - }, - Nyoro: Nyoro, - Nzima: Nzima, - Occidental: Occidental, - "Occitan (post 1500)": { - name: "Occitan (post 1500)", - names: [ - "Occitan (post 1500)" - ], - "iso639-2": "oci", - "iso639-1": "oc" - }, - "Occitan, Old (to 1500)": { - name: "Occitan, Old (to 1500)", - names: [ - "Provençal, Old (to 1500)", - "Occitan, Old (to 1500)" - ], - "iso639-2": "pro", - "iso639-1": null - }, - "Official Aramaic (700-300 BCE)": { - name: "Official Aramaic (700-300 BCE)", - names: [ - "Official Aramaic (700-300 BCE)", - "Imperial Aramaic (700-300 BCE)" - ], - "iso639-2": "arc", - "iso639-1": null - }, - Oirat: Oirat, - Ojibwa: Ojibwa, - "Old Bulgarian": { - name: "Old Bulgarian", - names: [ - "Church Slavic", - "Old Slavonic", - "Church Slavonic", - "Old Bulgarian", - "Old Church Slavonic" - ], - "iso639-2": "chu", - "iso639-1": "cu" - }, - "Old Church Slavonic": { - name: "Old Church Slavonic", - names: [ - "Church Slavic", - "Old Slavonic", - "Church Slavonic", - "Old Bulgarian", - "Old Church Slavonic" - ], - "iso639-2": "chu", - "iso639-1": "cu" - }, - "Old Newari": { - name: "Old Newari", - names: [ - "Classical Newari", - "Old Newari", - "Classical Nepal Bhasa" - ], - "iso639-2": "nwc", - "iso639-1": null - }, - "Old Slavonic": { - name: "Old Slavonic", - names: [ - "Church Slavic", - "Old Slavonic", - "Church Slavonic", - "Old Bulgarian", - "Old Church Slavonic" - ], - "iso639-2": "chu", - "iso639-1": "cu" - }, - Oriya: Oriya, - Oromo: Oromo, - Osage: Osage, - Ossetian: Ossetian, - Ossetic: Ossetic, - "Otomian languages": { - name: "Otomian languages", - names: [ - "Otomian languages" - ], - "iso639-2": "oto", - "iso639-1": null - }, - Pahlavi: Pahlavi, - Palauan: Palauan, - Pali: Pali, - Pampanga: Pampanga, - Pangasinan: Pangasinan, - Panjabi: Panjabi, - Papiamento: Papiamento, - "Papuan languages": { - name: "Papuan languages", - names: [ - "Papuan languages" - ], - "iso639-2": "paa", - "iso639-1": null - }, - Pashto: Pashto, - Pedi: Pedi, - Persian: Persian, - "Persian, Old (ca.600-400 B.C.)": { - name: "Persian, Old (ca.600-400 B.C.)", - names: [ - "Persian, Old (ca.600-400 B.C.)" - ], - "iso639-2": "peo", - "iso639-1": null - }, - "Philippine languages": { - name: "Philippine languages", - names: [ - "Philippine languages" - ], - "iso639-2": "phi", - "iso639-1": null - }, - Phoenician: Phoenician, - Pilipino: Pilipino, - Pohnpeian: Pohnpeian, - Polish: Polish, - Portuguese: Portuguese, - "Prakrit languages": { - name: "Prakrit languages", - names: [ - "Prakrit languages" - ], - "iso639-2": "pra", - "iso639-1": null - }, - "Provençal, Old (to 1500)": { - name: "Provençal, Old (to 1500)", - names: [ - "Provençal, Old (to 1500)", - "Occitan, Old (to 1500)" - ], - "iso639-2": "pro", - "iso639-1": null - }, - Punjabi: Punjabi, - Pushto: Pushto, - Quechua: Quechua, - Rajasthani: Rajasthani, - Rapanui: Rapanui, - Rarotongan: Rarotongan, - "Reserved for local use": { - name: "Reserved for local use", - names: [ - "Reserved for local use" - ], - "iso639-2": "qaa-qtz", - "iso639-1": null - }, - "Romance languages": { - name: "Romance languages", - names: [ - "Romance languages" - ], - "iso639-2": "roa", - "iso639-1": null - }, - Romanian: Romanian, - Romansh: Romansh, - Romany: Romany, - Rundi: Rundi, - Russian: Russian, - Sakan: Sakan, - "Salishan languages": { - name: "Salishan languages", - names: [ - "Salishan languages" - ], - "iso639-2": "sal", - "iso639-1": null - }, - "Samaritan Aramaic": { - name: "Samaritan Aramaic", - names: [ - "Samaritan Aramaic" - ], - "iso639-2": "sam", - "iso639-1": null - }, - "Sami languages": { - name: "Sami languages", - names: [ - "Sami languages" - ], - "iso639-2": "smi", - "iso639-1": null - }, - Samoan: Samoan, - Sandawe: Sandawe, - Sango: Sango, - Sanskrit: Sanskrit, - Santali: Santali, - Sardinian: Sardinian, - Sasak: Sasak, - "Saxon, Low": { - name: "Saxon, Low", - names: [ - "Low German", - "Low Saxon", - "German, Low", - "Saxon, Low" - ], - "iso639-2": "nds", - "iso639-1": null - }, - Scots: Scots, - "Scottish Gaelic": { - name: "Scottish Gaelic", - names: [ - "Gaelic", - "Scottish Gaelic" - ], - "iso639-2": "gla", - "iso639-1": "gd" - }, - Selkup: Selkup, - "Semitic languages": { - name: "Semitic languages", - names: [ - "Semitic languages" - ], - "iso639-2": "sem", - "iso639-1": null - }, - Sepedi: Sepedi, - Serbian: Serbian, - Serer: Serer, - Shan: Shan, - Shona: Shona, - "Sichuan Yi": { - name: "Sichuan Yi", - names: [ - "Sichuan Yi", - "Nuosu" - ], - "iso639-2": "iii", - "iso639-1": "ii" - }, - Sicilian: Sicilian, - Sidamo: Sidamo, - "Sign Languages": { - name: "Sign Languages", - names: [ - "Sign Languages" - ], - "iso639-2": "sgn", - "iso639-1": null - }, - Siksika: Siksika, - Sindhi: Sindhi, - Sinhala: Sinhala, - Sinhalese: Sinhalese, - "Sino-Tibetan languages": { - name: "Sino-Tibetan languages", - names: [ - "Sino-Tibetan languages" - ], - "iso639-2": "sit", - "iso639-1": null - }, - "Siouan languages": { - name: "Siouan languages", - names: [ - "Siouan languages" - ], - "iso639-2": "sio", - "iso639-1": null - }, - "Skolt Sami": { - name: "Skolt Sami", - names: [ - "Skolt Sami" - ], - "iso639-2": "sms", - "iso639-1": null - }, - "Slave (Athapascan)": { - name: "Slave (Athapascan)", - names: [ - "Slave (Athapascan)" - ], - "iso639-2": "den", - "iso639-1": null - }, - "Slavic languages": { - name: "Slavic languages", - names: [ - "Slavic languages" - ], - "iso639-2": "sla", - "iso639-1": null - }, - Slovak: Slovak, - Slovenian: Slovenian, - Sogdian: Sogdian, - Somali: Somali, - "Songhai languages": { - name: "Songhai languages", - names: [ - "Songhai languages" - ], - "iso639-2": "son", - "iso639-1": null - }, - Soninke: Soninke, - "Sorbian languages": { - name: "Sorbian languages", - names: [ - "Sorbian languages" - ], - "iso639-2": "wen", - "iso639-1": null - }, - "Sotho, Northern": { - name: "Sotho, Northern", - names: [ - "Pedi", - "Sepedi", - "Northern Sotho" - ], - "iso639-2": "nso", - "iso639-1": null - }, - "Sotho, Southern": { - name: "Sotho, Southern", - names: [ - "Sotho, Southern" - ], - "iso639-2": "sot", - "iso639-1": "st" - }, - "South American Indian languages": { - name: "South American Indian languages", - names: [ - "South American Indian languages" - ], - "iso639-2": "sai", - "iso639-1": null - }, - "South Ndebele": { - name: "South Ndebele", - names: [ - "Ndebele, South", - "South Ndebele" - ], - "iso639-2": "nbl", - "iso639-1": "nr" - }, - "Southern Altai": { - name: "Southern Altai", - names: [ - "Southern Altai" - ], - "iso639-2": "alt", - "iso639-1": null - }, - "Southern Sami": { - name: "Southern Sami", - names: [ - "Southern Sami" - ], - "iso639-2": "sma", - "iso639-1": null - }, - Spanish: Spanish, - "Sranan Tongo": { - name: "Sranan Tongo", - names: [ - "Sranan Tongo" - ], - "iso639-2": "srn", - "iso639-1": null - }, - "Standard Moroccan Tamazight": { - name: "Standard Moroccan Tamazight", - names: [ - "Standard Moroccan Tamazight" - ], - "iso639-2": "zgh", - "iso639-1": null - }, - Sukuma: Sukuma, - Sumerian: Sumerian, - Sundanese: Sundanese, - Susu: Susu, - Swahili: Swahili, - Swati: Swati, - Swedish: Swedish, - "Swiss German": { - name: "Swiss German", - names: [ - "Swiss German", - "Alemannic", - "Alsatian" - ], - "iso639-2": "gsw", - "iso639-1": null - }, - Syriac: Syriac, - Tagalog: Tagalog, - Tahitian: Tahitian, - "Tai languages": { - name: "Tai languages", - names: [ - "Tai languages" - ], - "iso639-2": "tai", - "iso639-1": null - }, - Tajik: Tajik, - Tamashek: Tamashek, - Tamil: Tamil, - Tatar: Tatar, - Telugu: Telugu, - Tereno: Tereno, - Tetum: Tetum, - Thai: Thai, - Tibetan: Tibetan, - Tigre: Tigre, - Tigrinya: Tigrinya, - Timne: Timne, - Tiv: Tiv, - "tlhIngan-Hol": { - name: "tlhIngan-Hol", - names: [ - "Klingon", - "tlhIngan-Hol" - ], - "iso639-2": "tlh", - "iso639-1": null - }, - Tlingit: Tlingit, - "Tok Pisin": { - name: "Tok Pisin", - names: [ - "Tok Pisin" - ], - "iso639-2": "tpi", - "iso639-1": null - }, - Tokelau: Tokelau, - "Tonga (Nyasa)": { - name: "Tonga (Nyasa)", - names: [ - "Tonga (Nyasa)" - ], - "iso639-2": "tog", - "iso639-1": null - }, - "Tonga (Tonga Islands)": { - name: "Tonga (Tonga Islands)", - names: [ - "Tonga (Tonga Islands)" - ], - "iso639-2": "ton", - "iso639-1": "to" - }, - Tsimshian: Tsimshian, - Tsonga: Tsonga, - Tswana: Tswana, - Tumbuka: Tumbuka, - "Tupi languages": { - name: "Tupi languages", - names: [ - "Tupi languages" - ], - "iso639-2": "tup", - "iso639-1": null - }, - Turkish: Turkish, - "Turkish, Ottoman (1500-1928)": { - name: "Turkish, Ottoman (1500-1928)", - names: [ - "Turkish, Ottoman (1500-1928)" - ], - "iso639-2": "ota", - "iso639-1": null - }, - Turkmen: Turkmen, - Tuvalu: Tuvalu, - Tuvinian: Tuvinian, - Twi: Twi, - Udmurt: Udmurt, - Ugaritic: Ugaritic, - Uighur: Uighur, - Ukrainian: Ukrainian, - Umbundu: Umbundu, - "Uncoded languages": { - name: "Uncoded languages", - names: [ - "Uncoded languages" - ], - "iso639-2": "mis", - "iso639-1": null - }, - Undetermined: Undetermined, - "Upper Sorbian": { - name: "Upper Sorbian", - names: [ - "Upper Sorbian" - ], - "iso639-2": "hsb", - "iso639-1": null - }, - Urdu: Urdu, - Uyghur: Uyghur, - Uzbek: Uzbek, - Vai: Vai, - Valencian: Valencian, - Venda: Venda, - Vietnamese: Vietnamese, - "Volapük": { - name: "Volapük", - names: [ - "Volapük" - ], - "iso639-2": "vol", - "iso639-1": "vo" - }, - Votic: Votic, - "Wakashan languages": { - name: "Wakashan languages", - names: [ - "Wakashan languages" - ], - "iso639-2": "wak", - "iso639-1": null - }, - Walloon: Walloon, - Waray: Waray, - Washo: Washo, - Welsh: Welsh, - "Western Frisian": { - name: "Western Frisian", - names: [ - "Western Frisian" - ], - "iso639-2": "fry", - "iso639-1": "fy" - }, - "Western Pahari languages": { - name: "Western Pahari languages", - names: [ - "Himachali languages", - "Western Pahari languages" - ], - "iso639-2": "him", - "iso639-1": null - }, - Wolaitta: Wolaitta, - Wolaytta: Wolaytta, - Wolof: Wolof, - Xhosa: Xhosa, - Yakut: Yakut, - Yao: Yao, - Yapese: Yapese, - Yiddish: Yiddish, - Yoruba: Yoruba, - "Yupik languages": { - name: "Yupik languages", - names: [ - "Yupik languages" - ], - "iso639-2": "ypk", - "iso639-1": null - }, - "Zande languages": { - name: "Zande languages", - names: [ - "Zande languages" - ], - "iso639-2": "znd", - "iso639-1": null - }, - Zapotec: Zapotec, - Zaza: Zaza, - Zazaki: Zazaki, - Zenaga: Zenaga, - Zhuang: Zhuang, - Zulu: Zulu, - Zuni: Zuni - }; - - function _defineProperty$1(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - var locales = []; - var isoKeys = Object.keys(iso); - Object.keys(lcid).map(function (id) { - var locale = lcid[id]; - var isoLanguage = isoKeys.find(function (name) { - return name.toLowerCase() === locale.language.toLowerCase(); - }); - - if (locale.location && isoLanguage) { - var _locales$push; - - locales.push((_locales$push = {}, _defineProperty$1(_locales$push, "name", locale.language), _defineProperty$1(_locales$push, "location", locale.location), _defineProperty$1(_locales$push, "tag", locale.tag), _defineProperty$1(_locales$push, "lcid", locale.id), _defineProperty$1(_locales$push, "iso639-2", iso[isoLanguage]["iso639-2"]), _defineProperty$1(_locales$push, "iso639-1", iso[isoLanguage]["iso639-1"]), _locales$push)); - } - }); - var defaultLocales = { - ar: "ar-SA", - ca: "ca-ES", - da: "da-DK", - en: "en-US", - ko: "ko-KR", - pa: "pa-IN", - pt: "pt-BR", - sv: "sv-SE" - }; - /** - * Converts a 2-digit language into a full language-LOCATION locale. - * @param {String} locale - */ - - function findLocale (locale) { - if (typeof locale !== "string" || locale.length === 5) return locale; - if (defaultLocales[locale]) return defaultLocales[locale]; - var list = locales.filter(function (d) { - return d["iso639-1"] === locale; - }); - if (!list.length) return locale;else if (list.length === 1) return list[0].tag;else if (list.find(function (d) { - return d.tag === "".concat(locale, "-").concat(locale.toUpperCase()); - })) return "".concat(locale, "-").concat(locale.toUpperCase());else return list[0].tag; - } - - /** - @function s - @desc Returns 4 random characters, used for constructing unique identifiers. - @private - */ - function s$1() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - /** - @function uuid - @summary Returns a unique identifier. - */ - - - function uuid () { - return "".concat(s$1()).concat(s$1(), "-").concat(s$1(), "-").concat(s$1(), "-").concat(s$1(), "-").concat(s$1()).concat(s$1()).concat(s$1()); - } - - /** - @constant RESET - @desc String constant used to reset an individual config property. - */ - var RESET = "D3PLUS-COMMON-RESET"; - - var esES = { - "and": "y", - "Back": "Atrás", - "Click to Expand": "Clic para Ampliar", - "Click to Hide": "Clic para Ocultar", - "Click to Highlight": "Clic para Resaltar", - "Click to Reset": "Clic para Restablecer", - "Download": "Descargar", - "Loading Visualization": "Cargando Visualización", - "No Data Available": "Datos No Disponibles", - "Powered by D3plus": "Funciona con D3plus", - "Share": "Porcentaje", - "Shift+Click to Hide": "Mayús+Clic para Ocultar", - "Total": "Total", - "Values": "Valores" - }; - - var dictionaries = { - "es-ES": esES - }; - - function _classCallCheck$1(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$1(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$1(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$1(Constructor, staticProps); - return Constructor; - } - /** - @desc Recursive function that resets nested Object configs. - @param {Object} obj - @param {Object} defaults - @private - */ - - function nestedReset(obj, defaults) { - if (isObject(obj)) { - for (var nestedKey in obj) { - if ({}.hasOwnProperty.call(obj, nestedKey) && !nestedKey.startsWith("_")) { - var defaultValue = defaults && isObject(defaults) ? defaults[nestedKey] : undefined; - - if (obj[nestedKey] === RESET) { - if (defaultValue) obj[nestedKey] = defaultValue;else delete obj[nestedKey]; - } else if (isObject(obj[nestedKey])) { - nestedReset(obj[nestedKey], defaultValue); - } - } - } - } - } - /** - * @desc finds all prototype methods of a class and it's parent classes - * @param {*} obj - * @private - */ - - - function getAllMethods(obj) { - var props = []; - - do { - props = props.concat(Object.getOwnPropertyNames(obj)); - obj = Object.getPrototypeOf(obj); - } while (obj && obj !== Object.prototype); - - return props.filter(function (e) { - return e.indexOf("_") !== 0 && !["config", "constructor", "parent", "render"].includes(e); - }); - } - /** - @class BaseClass - @summary An abstract class that contains some global methods and functionality. - */ - - - var BaseClass = /*#__PURE__*/function () { - /** - @memberof BaseClass - @desc Invoked when creating a new class instance, and sets any default parameters. - @private - */ - function BaseClass() { - var _this = this; - - _classCallCheck$1(this, BaseClass); - - this._locale = "en-US"; - this._on = {}; - this._parent = {}; - - this._translate = function (d) { - var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this._locale; - var dictionary = dictionaries[locale]; - return dictionary && dictionary[d] ? dictionary[d] : d; - }; - - this._uuid = uuid(); - } - /** - @memberof BaseClass - @desc If *value* is specified, sets the methods that correspond to the key/value pairs and returns this class. If *value* is not specified, returns the current configuration. - @param {Object} [*value*] - @chainable - */ - - - _createClass$1(BaseClass, [{ - key: "config", - value: function config(_) { - var _this2 = this; - - if (!this._configDefault) { - var config = {}; - getAllMethods(this.__proto__).forEach(function (k) { - var v = _this2[k](); - - if (v !== _this2) config[k] = isObject(v) ? assign({}, v) : v; - }); - this._configDefault = config; - } - - if (arguments.length) { - for (var k in _) { - if ({}.hasOwnProperty.call(_, k) && k in this) { - var v = _[k]; - - if (v === RESET) { - if (k === "on") this._on = this._configDefault[k];else this[k](this._configDefault[k]); - } else { - nestedReset(v, this._configDefault[k]); - this[k](v); - } - } - } - - return this; - } else { - var _config = {}; - getAllMethods(this.__proto__).forEach(function (k) { - _config[k] = _this2[k](); - }); - return _config; - } - } - /** - @memberof BaseClass - @desc Sets the locale used for all text and number formatting. This method supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). The locale can be defined as a complex Object (like in d3plus-format), a locale code (like "en-US"), or a 2-digit language code (like "en"). If a 2-digit code is provided, the "findLocale" function is used to identify the most approximate locale from d3plus-format. - @param {Object|String} [*value* = "en-US"] - @chainable - @example - { - separator: "", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "B", "t", "q", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: ",", - decimal: "." - }, - currency: ["$", ""] - } - */ - - }, { - key: "locale", - value: function locale(_) { - return arguments.length ? (this._locale = findLocale(_), this) : this._locale; - } - /** - @memberof BaseClass - @desc Adds or removes a *listener* to each object for the specified event *typenames*. If a *listener* is not specified, returns the currently assigned listener for the specified event *typename*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior. - @param {String} [*typenames*] - @param {Function} [*listener*] - @chainable - @example By default, listeners apply globally to all objects, however, passing a namespace with the class name gives control over specific elements: - new Plot - .on("click.Shape", function(d) { - console.log("data for shape clicked:", d); - }) - .on("click.Legend", function(d) { - console.log("data for legend clicked:", d); - }) - */ - - }, { - key: "on", - value: function on(_, f) { - return arguments.length === 2 ? (this._on[_] = f, this) : arguments.length ? typeof _ === "string" ? this._on[_] : (this._on = Object.assign({}, this._on, _), this) : this._on; - } - /** - @memberof Viz - @desc If *value* is specified, sets the parent config used by the wrapper and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "parent", - value: function parent(_) { - return arguments.length ? (this._parent = _, this) : this._parent; - } - /** - @memberof BaseClass - @desc Defines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function. - @param {Function} [*value*] - @chainable - @example For example, if we wanted to only change the string "Back" and allow all other string to return in English: - .translate(function(d) { - return d === "Back" ? "Get outta here" : d; - }) - */ - - }, { - key: "translate", - value: function translate(_) { - return arguments.length ? (this._translate = _, this) : this._translate; - } - /** - @memberof Viz - @desc If *value* is specified, sets the config method for each shape and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "shapeConfig", - value: function shapeConfig(_) { - return arguments.length ? (this._shapeConfig = assign(this._shapeConfig, _), this) : this._shapeConfig; - } - }]); - - return BaseClass; - }(); - - /** - @function closest - @desc Finds the closest numeric value in an array. - @param {Number} n The number value to use when searching the array. - @param {Array} arr The array of values to test against. - */ - function closest (n) { - var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - if (!arr || !(arr instanceof Array) || !arr.length) return undefined; - return arr.reduce(function (prev, curr) { - return Math.abs(curr - n) < Math.abs(prev - n) ? curr : prev; - }); - } - - function _typeof$2(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$2 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$2 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$2(obj); - } - /** - @function configPrep - @desc Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context. - @param {Object} [config = this._shapeConfig] The configuration object to parse. - @param {String} [type = "shape"] The event classifier to user for "on" events. For example, the default event type of "shape" will apply all events in the "on" config object with that key, like "click.shape" and "mouseleave.shape", in addition to any gloval events like "click" and "mouseleave". - @param {String} [nest] An optional nested key to bubble up to the parent config level. - */ - - - function configPrep() { - var _this = this; - - var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._shapeConfig; - var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "shape"; - var nest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var newConfig = { - duration: this._duration, - on: {} - }; - - var wrapFunction = function wrapFunction(func) { - return function (d, i, s) { - var parent; - - while (d.__d3plus__) { - if (parent) d.__d3plusParent__ = parent; - parent = d; - i = d.i; - d = d.data || d.feature; - } - - return func.bind(_this)(d, i, s || parent); - }; - }; - - var parseEvents = function parseEvents(newObj, on) { - for (var event in on) { - if ({}.hasOwnProperty.call(on, event) && !event.includes(".") || event.includes(".".concat(type))) { - newObj.on[event] = wrapFunction(on[event]); - } - } - }; - - var arrayEval = function arrayEval(arr) { - return arr.map(function (d) { - if (d instanceof Array) return arrayEval(d);else if (_typeof$2(d) === "object") return keyEval({}, d);else if (typeof d === "function") return wrapFunction(d);else return d; - }); - }; - - var keyEval = function keyEval(newObj, obj) { - for (var key in obj) { - if ({}.hasOwnProperty.call(obj, key)) { - if (key === "on") parseEvents(newObj, obj[key]);else if (typeof obj[key] === "function") { - newObj[key] = wrapFunction(obj[key]); - } else if (obj[key] instanceof Array) { - newObj[key] = arrayEval(obj[key]); - } else if (_typeof$2(obj[key]) === "object") { - newObj[key] = { - on: {} - }; - keyEval(newObj[key], obj[key]); - } else newObj[key] = obj[key]; - } - } - }; - - keyEval(newConfig, config); - if (this._on) parseEvents(newConfig, this._on); - - if (nest && config[nest]) { - keyEval(newConfig, config[nest]); - if (config[nest].on) parseEvents(newConfig, config[nest].on); - } - - return newConfig; - } - - /** - @function constant - @desc Wraps non-function variables in a simple return function. - @param {Array|Number|Object|String} value The value to be returned from the function. - @example this - constant(42); - @example returns this - function() { - return 42; - } - */ - function constant$1 (value) { - return function constant() { - return value; - }; - } - - var xhtml = "http://www.w3.org/1999/xhtml"; - var namespaces = { - svg: "http://www.w3.org/2000/svg", - xhtml: xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" - }; - - function namespace (name) { - var prefix = name += "", - i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces.hasOwnProperty(prefix) ? { - space: namespaces[prefix], - local: name - } : name; - } - - function creatorInherit(name) { - return function () { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml && document.documentElement.namespaceURI === xhtml ? document.createElement(name) : document.createElementNS(uri, name); - }; - } - - function creatorFixed(fullname) { - return function () { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; - } - - function creator (name) { - var fullname = namespace(name); - return (fullname.local ? creatorFixed : creatorInherit)(fullname); - } - - function none$2() {} - - function selector (selector) { - return selector == null ? none$2 : function () { - return this.querySelector(selector); - }; - } - - function selection_select (select) { - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection(subgroups, this._parents); - } - - function empty() { - return []; - } - - function selectorAll (selector) { - return selector == null ? empty : function () { - return this.querySelectorAll(selector); - }; - } - - function selection_selectAll (select) { - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection(subgroups, parents); - } - - function matcher (selector) { - return function () { - return this.matches(selector); - }; - } - - function selection_filter (match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection(subgroups, this._parents); - } - - function sparse (update) { - return new Array(update.length); - } - - function selection_enter () { - return new Selection(this._enter || this._groups.map(sparse), this._parents); - } - function EnterNode(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; - } - EnterNode.prototype = { - constructor: EnterNode, - appendChild: function appendChild(child) { - return this._parent.insertBefore(child, this._next); - }, - insertBefore: function insertBefore(child, next) { - return this._parent.insertBefore(child, next); - }, - querySelector: function querySelector(selector) { - return this._parent.querySelector(selector); - }, - querySelectorAll: function querySelectorAll(selector) { - return this._parent.querySelectorAll(selector); - } - }; - - function constant$2 (x) { - return function () { - return x; - }; - } - - var keyPrefix = "$"; // Protect against keys like “__proto__”. - - function bindIndex(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - - for (; i < dataLength; ++i) { - if (node = group[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } // Put any non-null nodes that don’t fit into exit. - - - for (; i < groupLength; ++i) { - if (node = group[i]) { - exit[i] = node; - } - } - } - - function bindKey(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = {}, - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - - for (i = 0; i < groupLength; ++i) { - if (node = group[i]) { - keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group); - - if (keyValue in nodeByKeyValue) { - exit[i] = node; - } else { - nodeByKeyValue[keyValue] = node; - } - } - } // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - - - for (i = 0; i < dataLength; ++i) { - keyValue = keyPrefix + key.call(parent, data[i], i, data); - - if (node = nodeByKeyValue[keyValue]) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue[keyValue] = null; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } // Add any remaining nodes that were not bound to data to exit. - - - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && nodeByKeyValue[keyValues[i]] === node) { - exit[i] = node; - } - } - } - - function selection_data (value, key) { - if (!value) { - data = new Array(this.size()), j = -1; - this.each(function (d) { - data[++j] = d; - }); - return data; - } - - var bind = key ? bindKey : bindIndex, - parents = this._parents, - groups = this._groups; - if (typeof value !== "function") value = constant$2(value); - - for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = value.call(parent, parent && parent.__data__, j, parents), - dataLength = data.length, - enterGroup = enter[j] = new Array(dataLength), - updateGroup = update[j] = new Array(dataLength), - exitGroup = exit[j] = new Array(groupLength); - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - - while (!(next = updateGroup[i1]) && ++i1 < dataLength) { - } - - previous._next = next || null; - } - } - } - - update = new Selection(update, parents); - update._enter = enter; - update._exit = exit; - return update; - } - - function selection_exit () { - return new Selection(this._exit || this._groups.map(sparse), this._parents); - } - - function selection_join (onenter, onupdate, onexit) { - var enter = this.enter(), - update = this, - exit = this.exit(); - enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""); - if (onupdate != null) update = onupdate(update); - if (onexit == null) exit.remove();else onexit(exit); - return enter && update ? enter.merge(update).order() : update; - } - - function selection_merge (selection) { - for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection(merges, this._parents); - } - - function selection_order () { - for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { - for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { - if (node = group[i]) { - if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; - } - - function selection_sort (compare) { - if (!compare) compare = ascending$2; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group[i]) { - sortgroup[i] = node; - } - } - - sortgroup.sort(compareNode); - } - - return new Selection(sortgroups, this._parents).order(); - } - - function ascending$2(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; - } - - function selection_call () { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; - } - - function selection_nodes () { - var nodes = new Array(this.size()), - i = -1; - this.each(function () { - nodes[++i] = this; - }); - return nodes; - } - - function selection_node () { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; - } - - function selection_size () { - var size = 0; - this.each(function () { - ++size; - }); - return size; - } - - function selection_empty () { - return !this.node(); - } - - function selection_each (callback) { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) callback.call(node, node.__data__, i, group); - } - } - - return this; - } - - function attrRemove(name) { - return function () { - this.removeAttribute(name); - }; - } - - function attrRemoveNS(fullname) { - return function () { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - - function attrConstant(name, value) { - return function () { - this.setAttribute(name, value); - }; - } - - function attrConstantNS(fullname, value) { - return function () { - this.setAttributeNS(fullname.space, fullname.local, value); - }; - } - - function attrFunction(name, value) { - return function () { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name);else this.setAttribute(name, v); - }; - } - - function attrFunctionNS(fullname, value) { - return function () { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local);else this.setAttributeNS(fullname.space, fullname.local, v); - }; - } - - function selection_attr (name, value) { - var fullname = namespace(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname); - } - - return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value)); - } - - function defaultView (node) { - return node.ownerDocument && node.ownerDocument.defaultView || // node is a Node - node.document && node // node is a Window - || node.defaultView; // node is a Document - } - - function styleRemove(name) { - return function () { - this.style.removeProperty(name); - }; - } - - function styleConstant(name, value, priority) { - return function () { - this.style.setProperty(name, value, priority); - }; - } - - function styleFunction(name, value, priority) { - return function () { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name);else this.style.setProperty(name, v, priority); - }; - } - - function selection_style (name, value, priority) { - return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name); - } - function styleValue(node, name) { - return node.style.getPropertyValue(name) || defaultView(node).getComputedStyle(node, null).getPropertyValue(name); - } - - function propertyRemove(name) { - return function () { - delete this[name]; - }; - } - - function propertyConstant(name, value) { - return function () { - this[name] = value; - }; - } - - function propertyFunction(name, value) { - return function () { - var v = value.apply(this, arguments); - if (v == null) delete this[name];else this[name] = v; - }; - } - - function selection_property (name, value) { - return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name]; - } - - function classArray(string) { - return string.trim().split(/^|\s+/); - } - - function classList(node) { - return node.classList || new ClassList(node); - } - - function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute("class") || ""); - } - - ClassList.prototype = { - add: function add(name) { - var i = this._names.indexOf(name); - - if (i < 0) { - this._names.push(name); - - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function remove(name) { - var i = this._names.indexOf(name); - - if (i >= 0) { - this._names.splice(i, 1); - - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function contains(name) { - return this._names.indexOf(name) >= 0; - } - }; - - function classedAdd(node, names) { - var list = classList(node), - i = -1, - n = names.length; - - while (++i < n) { - list.add(names[i]); - } - } - - function classedRemove(node, names) { - var list = classList(node), - i = -1, - n = names.length; - - while (++i < n) { - list.remove(names[i]); - } - } - - function classedTrue(names) { - return function () { - classedAdd(this, names); - }; - } - - function classedFalse(names) { - return function () { - classedRemove(this, names); - }; - } - - function classedFunction(names, value) { - return function () { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; - } - - function selection_classed (name, value) { - var names = classArray(name + ""); - - if (arguments.length < 2) { - var list = classList(this.node()), - i = -1, - n = names.length; - - while (++i < n) { - if (!list.contains(names[i])) return false; - } - - return true; - } - - return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value)); - } - - function textRemove() { - this.textContent = ""; - } - - function textConstant(value) { - return function () { - this.textContent = value; - }; - } - - function textFunction(value) { - return function () { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; - } - - function selection_text (value) { - return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent; - } - - function htmlRemove() { - this.innerHTML = ""; - } - - function htmlConstant(value) { - return function () { - this.innerHTML = value; - }; - } - - function htmlFunction(value) { - return function () { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; - } - - function selection_html (value) { - return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML; - } - - function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); - } - - function selection_raise () { - return this.each(raise); - } - - function lower() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); - } - - function selection_lower () { - return this.each(lower); - } - - function selection_append (name) { - var create = typeof name === "function" ? name : creator(name); - return this.select(function () { - return this.appendChild(create.apply(this, arguments)); - }); - } - - function constantNull() { - return null; - } - - function selection_insert (name, before) { - var create = typeof name === "function" ? name : creator(name), - select = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function () { - return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); - }); - } - - function remove() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); - } - - function selection_remove () { - return this.each(remove); - } - - function selection_cloneShallow() { - var clone = this.cloneNode(false), - parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; - } - - function selection_cloneDeep() { - var clone = this.cloneNode(true), - parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; - } - - function selection_clone (deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); - } - - function selection_datum (value) { - return arguments.length ? this.property("__data__", value) : this.node().__data__; - } - - var filterEvents = {}; - var event$1 = null; - - if (typeof document !== "undefined") { - var element = document.documentElement; - - if (!("onmouseenter" in element)) { - filterEvents = { - mouseenter: "mouseover", - mouseleave: "mouseout" - }; - } - } - - function filterContextListener(listener, index, group) { - listener = contextListener(listener, index, group); - return function (event) { - var related = event.relatedTarget; - - if (!related || related !== this && !(related.compareDocumentPosition(this) & 8)) { - listener.call(this, event); - } - }; - } - - function contextListener(listener, index, group) { - return function (event1) { - var event0 = event$1; // Events can be reentrant (e.g., focus). - - event$1 = event1; - - try { - listener.call(this, this.__data__, index, group); - } finally { - event$1 = event0; - } - }; - } - - function parseTypenames(typenames) { - return typenames.trim().split(/^|\s+/).map(function (t) { - var name = "", - i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return { - type: t, - name: name - }; - }); - } - - function onRemove(typename) { - return function () { - var on = this.__on; - if (!on) return; - - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - } else { - on[++i] = o; - } - } - - if (++i) on.length = i;else delete this.__on; - }; - } - - function onAdd(typename, value, capture) { - var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener; - return function (d, i, group) { - var on = this.__on, - o, - listener = wrap(value, i, group); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.capture); - this.addEventListener(o.type, o.listener = listener, o.capture = capture); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, capture); - o = { - type: typename.type, - name: typename.name, - value: value, - listener: listener, - capture: capture - }; - if (!on) this.__on = [o];else on.push(o); - }; - } - - function selection_on (typename, value, capture) { - var typenames = parseTypenames(typename + ""), - i, - n = typenames.length, - t; - - if (arguments.length < 2) { - var on = this.node().__on; - - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd : onRemove; - if (capture == null) capture = false; - - for (i = 0; i < n; ++i) { - this.each(on(typenames[i], value, capture)); - } - - return this; - } - function customEvent(event1, listener, that, args) { - var event0 = event$1; - event1.sourceEvent = event$1; - event$1 = event1; - - try { - return listener.apply(that, args); - } finally { - event$1 = event0; - } - } - - function dispatchEvent(node, type, params) { - var window = defaultView(node), - event = window.CustomEvent; - - if (typeof event === "function") { - event = new event(type, params); - } else { - event = window.document.createEvent("Event"); - if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); - } - - function dispatchConstant(type, params) { - return function () { - return dispatchEvent(this, type, params); - }; - } - - function dispatchFunction(type, params) { - return function () { - return dispatchEvent(this, type, params.apply(this, arguments)); - }; - } - - function selection_dispatch (type, params) { - return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params)); - } - - var root = [null]; - function Selection(groups, parents) { - this._groups = groups; - this._parents = parents; - } - - function selection() { - return new Selection([[document.documentElement]], root); - } - - Selection.prototype = selection.prototype = { - constructor: Selection, - select: selection_select, - selectAll: selection_selectAll, - filter: selection_filter, - data: selection_data, - enter: selection_enter, - exit: selection_exit, - join: selection_join, - merge: selection_merge, - order: selection_order, - sort: selection_sort, - call: selection_call, - nodes: selection_nodes, - node: selection_node, - size: selection_size, - empty: selection_empty, - each: selection_each, - attr: selection_attr, - style: selection_style, - property: selection_property, - classed: selection_classed, - text: selection_text, - html: selection_html, - raise: selection_raise, - lower: selection_lower, - append: selection_append, - insert: selection_insert, - remove: selection_remove, - clone: selection_clone, - datum: selection_datum, - on: selection_on, - dispatch: selection_dispatch - }; - - function _select (selector) { - return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root); - } - - function sourceEvent () { - var current = event$1, - source; - - while (source = current.sourceEvent) { - current = source; - } - - return current; - } - - function point (node, event) { - var svg = node.ownerSVGElement || node; - - if (svg.createSVGPoint) { - var point = svg.createSVGPoint(); - point.x = event.clientX, point.y = event.clientY; - point = point.matrixTransform(node.getScreenCTM().inverse()); - return [point.x, point.y]; - } - - var rect = node.getBoundingClientRect(); - return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop]; - } - - function mouse (node) { - var event = sourceEvent(); - if (event.changedTouches) event = event.changedTouches[0]; - return point(node, event); - } - - function selectAll (selector) { - return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([selector == null ? [] : selector], root); - } - - function touch (node, touches, identifier) { - if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches; - - for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) { - if ((touch = touches[i]).identifier === identifier) { - return point(node, touch); - } - } - - return null; - } - - var noop$1 = { - value: function value() {} - }; - - function dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; - } - - return new Dispatch(_); - } - - function Dispatch(_) { - this._ = _; - } - - function parseTypenames$1(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function (t) { - var name = "", - i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return { - type: t, - name: name - }; - }); - } - - Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function on(typename, callback) { - var _ = this._, - T = parseTypenames$1(typename + "", _), - t, - i = -1, - n = T.length; // If no callback was specified, return the callback of the given type and name. - - if (arguments.length < 2) { - while (++i < n) { - if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; - } - - return; - } // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - - - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);else if (callback == null) for (t in _) { - _[t] = set(_[t], typename.name, null); - } - } - - return this; - }, - copy: function copy() { - var copy = {}, - _ = this._; - - for (var t in _) { - copy[t] = _[t].slice(); - } - - return new Dispatch(copy); - }, - call: function call(type, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) { - args[i] = arguments[i + 2]; - } - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - - for (t = this._[type], i = 0, n = t.length; i < n; ++i) { - t[i].value.apply(that, args); - } - }, - apply: function apply(type, that, args) { - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) { - t[i].value.apply(that, args); - } - } - }; - - function get(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; - } - } - } - - function set(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - type[i] = noop$1, type = type.slice(0, i).concat(type.slice(i + 1)); - break; - } - } - - if (callback != null) type.push({ - name: name, - value: callback - }); - return type; - } - - var frame = 0, - // is an animation frame pending? - timeout = 0, - // is a timeout pending? - interval = 0, - // are any timers active? - pokeDelay = 1000, - // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === "object" && performance.now ? performance : Date, - setFrame = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) { - setTimeout(f, 17); - }; - function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); - } - - function clearNow() { - clockNow = 0; - } - - function Timer() { - this._call = this._time = this._next = null; - } - Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function restart(callback, delay, time) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this;else taskHead = this; - taskTail = this; - } - - this._call = callback; - this._time = time; - sleep(); - }, - stop: function stop() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - } - }; - function timer(callback, delay, time) { - var t = new Timer(); - t.restart(callback, delay, time); - return t; - } - function timerFlush() { - now(); // Get the current time, if not already set. - - ++frame; // Pretend we’ve set an alarm, if we haven’t already. - - var t = taskHead, - e; - - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(null, e); - t = t._next; - } - - --frame; - } - - function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame = timeout = 0; - - try { - timerFlush(); - } finally { - frame = 0; - nap(); - clockNow = 0; - } - } - - function poke() { - var now = clock.now(), - delay = now - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now; - } - - function nap() { - var t0, - t1 = taskHead, - t2, - time = Infinity; - - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - t0 = t1, t1 = t1._next; - } else { - t2 = t1._next, t1._next = null; - t1 = t0 ? t0._next = t2 : taskHead = t2; - } - } - - taskTail = t0; - sleep(time); - } - - function sleep(time) { - if (frame) return; // Soonest alarm already set, or will be. - - if (timeout) timeout = clearTimeout(timeout); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - - if (delay > 24) { - if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); - if (interval) interval = clearInterval(interval); - } else { - if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); - frame = 1, setFrame(wake); - } - } - - function timeout$1 (callback, delay, time) { - var t = new Timer(); - delay = delay == null ? 0 : +delay; - t.restart(function (elapsed) { - t.stop(); - callback(elapsed + delay); - }, delay, time); - return t; - } - - var emptyOn = dispatch("start", "end", "cancel", "interrupt"); - var emptyTween = []; - var CREATED = 0; - var SCHEDULED = 1; - var STARTING = 2; - var STARTED = 3; - var RUNNING = 4; - var ENDING = 5; - var ENDED = 6; - function schedule (node, name, id, index, group, timing) { - var schedules = node.__transition; - if (!schedules) node.__transition = {};else if (id in schedules) return; - create(node, id, { - name: name, - index: index, - // For context during callback. - group: group, - // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); - } - function init(node, id) { - var schedule = get$1(node, id); - if (schedule.state > CREATED) throw new Error("too late; already scheduled"); - return schedule; - } - function set$1(node, id) { - var schedule = get$1(node, id); - if (schedule.state > STARTED) throw new Error("too late; already running"); - return schedule; - } - function get$1(node, id) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); - return schedule; - } - - function create(node, id, self) { - var schedules = node.__transition, - tween; // Initialize the self timer when the transition is created. - // Note the actual delay is not known until the first callback! - - schedules[id] = self; - self.timer = timer(schedule, 0, self.time); - - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start, self.delay, self.time); // If the elapsed delay is less than our first sleep, start immediately. - - if (self.delay <= elapsed) start(elapsed - self.delay); - } - - function start(elapsed) { - var i, j, n, o; // If the state is not SCHEDULED, then we previously errored on start. - - if (self.state !== SCHEDULED) return stop(); - - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; // While this element already has a starting transition during this frame, - // defer starting an interrupting transition until that transition has a - // chance to tick (and possibly end); see d3/d3-transition#54! - - if (o.state === STARTED) return timeout$1(start); // Interrupt the active transition, if any. - - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node, node.__data__, o.index, o.group); - delete schedules[i]; - } // Cancel any pre-empted transitions. - else if (+i < id) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } // Defer the first tick to end of the current frame; see d3/d3#1576. - // Note the transition may be canceled after start and before the first tick! - // Note this must be scheduled before the start event; see d3/d3-transition#16! - // Assuming this is successful, subsequent callbacks go straight to tick. - - - timeout$1(function () { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); // Dispatch the start event. - // Note this must be done before the tween are initialized. - - self.state = STARTING; - self.on.call("start", node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; // interrupted - - self.state = STARTED; // Initialize the tween, deleting null tween. - - tween = new Array(n = self.tween.length); - - for (i = 0, j = -1; i < n; ++i) { - if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { - tween[++j] = o; - } - } - - tween.length = j + 1; - } - - function tick(elapsed) { - var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), - i = -1, - n = tween.length; - - while (++i < n) { - tween[i].call(node, t); - } // Dispatch the end event. - - - if (self.state === ENDING) { - self.on.call("end", node, node.__data__, self.index, self.group); - stop(); - } - } - - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id]; - - for (var i in schedules) { - return; - } // eslint-disable-line no-unused-vars - - - delete node.__transition; - } - } - - function interrupt (node, name) { - var schedules = node.__transition, - schedule, - active, - empty = true, - i; - if (!schedules) return; - name = name == null ? null : name + ""; - - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { - empty = false; - continue; - } - - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); - delete schedules[i]; - } - - if (empty) delete node.__transition; - } - - function selection_interrupt (name) { - return this.each(function () { - interrupt(this, name); - }); - } - - function define (constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - - for (var key in definition) { - prototype[key] = definition[key]; - } - - return prototype; - } - - function Color() {} - var _darker = 0.7; - - var _brighter = 1 / _darker; - var reI = "\\s*([+-]?\\d+)\\s*", - reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex3 = /^#([0-9a-f]{3})$/, - reHex6 = /^#([0-9a-f]{6})$/, - reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), - reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), - reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), - reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), - reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), - reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); - var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 - }; - define(Color, color, { - displayable: function displayable() { - return this.rgb().displayable(); - }, - hex: function hex() { - return this.rgb().hex(); - }, - toString: function toString() { - return this.rgb() + ""; - } - }); - function color(format) { - var m; - format = (format + "").trim().toLowerCase(); - return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb(m >> 8 & 0xf | m >> 4 & 0x0f0, m >> 4 & 0xf | m & 0xf0, (m & 0xf) << 4 | m & 0xf, 1) // #f00 - ) : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000 - : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; - } - - function rgbn(n) { - return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); - } - - function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); - } - - function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb(); - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); - } - function rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); - } - function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; - } - define(Rgb, rgb, extend(Color, { - brighter: function brighter(k) { - k = k == null ? _brighter : Math.pow(_brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker : Math.pow(_darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function rgb() { - return this; - }, - displayable: function displayable() { - return 0 <= this.r && this.r <= 255 && 0 <= this.g && this.g <= 255 && 0 <= this.b && this.b <= 255 && 0 <= this.opacity && this.opacity <= 1; - }, - hex: function hex() { - return "#" + _hex(this.r) + _hex(this.g) + _hex(this.b); - }, - toString: function toString() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")"); - } - })); - - function _hex(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); - } - - function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); - } - - function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl(); - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - - return new Hsl(h, s, l, o.opacity); - } - function hsl(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); - } - - function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define(Hsl, hsl, extend(Color, { - brighter: function brighter(k) { - k = k == null ? _brighter : Math.pow(_brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker : Math.pow(_darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function rgb() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity); - }, - displayable: function displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; - } - })); - /* From FvD 13.37, CSS Color Module Level 3 */ - - function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; - } - - var deg2rad = Math.PI / 180; - var rad2deg = 180 / Math.PI; - - var K = 18, - Xn = 0.96422, - Yn = 1, - Zn = 0.82521, - t0 = 4 / 29, - t1 = 6 / 29, - t2 = 3 * t1 * t1, - t3 = t1 * t1 * t1; - - function labConvert(o) { - if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); - - if (o instanceof Hcl) { - if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * deg2rad; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); - } - - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = rgb2lrgb(o.r), - g = rgb2lrgb(o.g), - b = rgb2lrgb(o.b), - y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), - x, - z; - if (r === g && g === b) x = z = y;else { - x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); - } - return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); - } - function lab(l, a, b, opacity) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); - } - function Lab(l, a, b, opacity) { - this.l = +l; - this.a = +a; - this.b = +b; - this.opacity = +opacity; - } - define(Lab, lab, extend(Color, { - brighter: function brighter(k) { - return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - darker: function darker(k) { - return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - rgb: function rgb() { - var y = (this.l + 16) / 116, - x = isNaN(this.a) ? y : y + this.a / 500, - z = isNaN(this.b) ? y : y - this.b / 200; - x = Xn * lab2xyz(x); - y = Yn * lab2xyz(y); - z = Zn * lab2xyz(z); - return new Rgb(lrgb2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), lrgb2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z), this.opacity); - } - })); - - function xyz2lab(t) { - return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; - } - - function lab2xyz(t) { - return t > t1 ? t * t * t : t2 * (t - t0); - } - - function lrgb2rgb(x) { - return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); - } - - function rgb2lrgb(x) { - return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); - } - - function hclConvert(o) { - if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) o = labConvert(o); - if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * rad2deg; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); - } - function hcl(h, c, l, opacity) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); - } - function Hcl(h, c, l, opacity) { - this.h = +h; - this.c = +c; - this.l = +l; - this.opacity = +opacity; - } - define(Hcl, hcl, extend(Color, { - brighter: function brighter(k) { - return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); - }, - darker: function darker(k) { - return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); - }, - rgb: function rgb() { - return labConvert(this).rgb(); - } - })); - - var A = -0.14861, - B = +1.78277, - C = -0.29227, - D = -0.90649, - E = +1.97294, - ED = E * D, - EB = E * B, - BC_DA = B * C - D * A; - - function cubehelixConvert(o) { - if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), - bl = b - l, - k = (E * (g - l) - C * bl) / D, - s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), - // NaN if l=0 or l=1 - h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; - return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); - } - - function cubehelix(h, s, l, opacity) { - return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); - } - function Cubehelix(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - define(Cubehelix, cubehelix, extend(Color, { - brighter: function brighter(k) { - k = k == null ? _brighter : Math.pow(_brighter, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker : Math.pow(_darker, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function rgb() { - var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, - l = +this.l, - a = isNaN(this.s) ? 0 : this.s * l * (1 - l), - cosh = Math.cos(h), - sinh = Math.sin(h); - return new Rgb(255 * (l + a * (A * cosh + B * sinh)), 255 * (l + a * (C * cosh + D * sinh)), 255 * (l + a * (E * cosh)), this.opacity); - } - })); - - function constant$3 (x) { - return function () { - return x; - }; - } - - function linear(a, d) { - return function (t) { - return a + t * d; - }; - } - - function exponential(a, b, y) { - return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function (t) { - return Math.pow(a + t * b, y); - }; - } - function gamma(y) { - return (y = +y) === 1 ? nogamma : function (a, b) { - return b - a ? exponential(a, b, y) : constant$3(isNaN(a) ? b : a); - }; - } - function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : constant$3(isNaN(a) ? b : a); - } - - var interpolateRgb = (function rgbGamma(y) { - var color = gamma(y); - - function rgb$1(start, end) { - var r = color((start = rgb(start)).r, (end = rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function (t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - - rgb$1.gamma = rgbGamma; - return rgb$1; - })(1); - - function array (a, b) { - var nb = b ? b.length : 0, - na = a ? Math.min(nb, a.length) : 0, - x = new Array(na), - c = new Array(nb), - i; - - for (i = 0; i < na; ++i) { - x[i] = interpolate(a[i], b[i]); - } - - for (; i < nb; ++i) { - c[i] = b[i]; - } - - return function (t) { - for (i = 0; i < na; ++i) { - c[i] = x[i](t); - } - - return c; - }; - } - - function date (a, b) { - var d = new Date(); - return a = +a, b -= a, function (t) { - return d.setTime(a + b * t), d; - }; - } - - function interpolateNumber (a, b) { - return a = +a, b -= a, function (t) { - return a + b * t; - }; - } - - function object (a, b) { - var i = {}, - c = {}, - k; - if (a === null || _typeof(a) !== "object") a = {}; - if (b === null || _typeof(b) !== "object") b = {}; - - for (k in b) { - if (k in a) { - i[k] = interpolate(a[k], b[k]); - } else { - c[k] = b[k]; - } - } - - return function (t) { - for (k in i) { - c[k] = i[k](t); - } - - return c; - }; - } - - var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, "g"); - - function zero(b) { - return function () { - return b; - }; - } - - function one(b) { - return function (t) { - return b(t) + ""; - }; - } - - function interpolateString (a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, - // scan index for next number in b - am, - // current match in a - bm, - // current match in b - bs, - // string preceding current number in b, if any - i = -1, - // index in s - s = [], - // string constants and placeholders - q = []; // number interpolators - // Coerce inputs to strings. - - a = a + "", b = b + ""; // Interpolate pairs of numbers in a & b. - - while ((am = reA.exec(a)) && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { - // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - - if ((am = am[0]) === (bm = bm[0])) { - // numbers in a & b match - if (s[i]) s[i] += bm; // coalesce with previous string - else s[++i] = bm; - } else { - // interpolate non-matching numbers - s[++i] = null; - q.push({ - i: i, - x: interpolateNumber(am, bm) - }); - } - - bi = reB.lastIndex; - } // Add remains of b. - - - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - - - return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function (t) { - for (var i = 0, o; i < b; ++i) { - s[(o = q[i]).i] = o.x(t); - } - - return s.join(""); - }); - } - - function interpolate (a, b) { - var t = _typeof(b), - c; - - return b == null || t === "boolean" ? constant$3(b) : (t === "number" ? interpolateNumber : t === "string" ? (c = color(b)) ? (b = c, interpolateRgb) : interpolateString : b instanceof color ? interpolateRgb : b instanceof Date ? date : Array.isArray(b) ? array : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a, b); - } - - function interpolateRound (a, b) { - return a = +a, b -= a, function (t) { - return Math.round(a + b * t); - }; - } - - var degrees = 180 / Math.PI; - var identity$1 = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 - }; - function decompose (a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; - if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY - }; - } - - var cssNode, cssRoot, cssView, svgNode; - function parseCss(value) { - if (value === "none") return identity$1; - if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; - cssNode.style.transform = value; - value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); - cssRoot.removeChild(cssNode); - value = value.slice(7, -1).split(","); - return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); - } - function parseSvg(value) { - if (value == null) return identity$1; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity$1; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); - } - - function interpolateTransform(parse, pxComma, pxParen, degParen) { - function pop(s) { - return s.length ? s.pop() + " " : ""; - } - - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push("translate(", null, pxComma, null, pxParen); - q.push({ - i: i - 4, - x: interpolateNumber(xa, xb) - }, { - i: i - 2, - x: interpolateNumber(ya, yb) - }); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } - } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360;else if (b - a > 180) a += 360; // shortest path - - q.push({ - i: s.push(pop(s) + "rotate(", null, degParen) - 2, - x: interpolateNumber(a, b) - }); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); - } - } - - function skewX(a, b, s, q) { - if (a !== b) { - q.push({ - i: s.push(pop(s) + "skewX(", null, degParen) - 2, - x: interpolateNumber(a, b) - }); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } - } - - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({ - i: i - 4, - x: interpolateNumber(xa, xb) - }, { - i: i - 2, - x: interpolateNumber(ya, yb) - }); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } - } - - return function (a, b) { - var s = [], - // string constants and placeholders - q = []; // number interpolators - - a = parse(a), b = parse(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - - return function (t) { - var i = -1, - n = q.length, - o; - - while (++i < n) { - s[(o = q[i]).i] = o.x(t); - } - - return s.join(""); - }; - }; - } - - var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); - var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - - var rho = Math.SQRT2, - rho2 = 2, - rho4 = 4, - epsilon2 = 1e-12; - - function cosh(x) { - return ((x = Math.exp(x)) + 1 / x) / 2; - } - - function sinh(x) { - return ((x = Math.exp(x)) - 1 / x) / 2; - } - - function tanh(x) { - return ((x = Math.exp(2 * x)) - 1) / (x + 1); - } // p0 = [ux0, uy0, w0] - // p1 = [ux1, uy1, w1] - - - function interpolateZoom (p0, p1) { - var ux0 = p0[0], - uy0 = p0[1], - w0 = p0[2], - ux1 = p1[0], - uy1 = p1[1], - w1 = p1[2], - dx = ux1 - ux0, - dy = uy1 - uy0, - d2 = dx * dx + dy * dy, - i, - S; // Special case for u0 ≅ u1. - - if (d2 < epsilon2) { - S = Math.log(w1 / w0) / rho; - - i = function i(t) { - return [ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S)]; - }; - } // General case. - else { - var d1 = Math.sqrt(d2), - b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), - b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), - r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), - r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); - S = (r1 - r0) / rho; - - i = function i(t) { - var s = t * S, - coshr0 = cosh(r0), - u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); - return [ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s + r0)]; - }; - } - - i.duration = S * 1000; - return i; - } - - function tweenRemove(id, name) { - var tween0, tween1; - return function () { - var schedule = set$1(this, id), - tween = schedule.tween; // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - - if (tween !== tween0) { - tween1 = tween0 = tween; - - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - - schedule.tween = tween1; - }; - } - - function tweenFunction(id, name, value) { - var tween0, tween1; - if (typeof value !== "function") throw new Error(); - return function () { - var schedule = set$1(this, id), - tween = schedule.tween; // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - - for (var t = { - name: name, - value: value - }, i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - - if (i === n) tween1.push(t); - } - - schedule.tween = tween1; - }; - } - - function transition_tween (name, value) { - var id = this._id; - name += ""; - - if (arguments.length < 2) { - var tween = get$1(this.node(), id).tween; - - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - - return null; - } - - return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); - } - function tweenValue(transition, name, value) { - var id = transition._id; - transition.each(function () { - var schedule = set$1(this, id); - (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); - }); - return function (node) { - return get$1(node, id).value[name]; - }; - } - - function interpolate$1 (a, b) { - var c; - return (typeof b === "number" ? interpolateNumber : b instanceof color ? interpolateRgb : (c = color(b)) ? (b = c, interpolateRgb) : interpolateString)(a, b); - } - - function attrRemove$1(name) { - return function () { - this.removeAttribute(name); - }; - } - - function attrRemoveNS$1(fullname) { - return function () { - this.removeAttributeNS(fullname.space, fullname.local); - }; - } - - function attrConstant$1(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function () { - var string0 = this.getAttribute(name); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); - }; - } - - function attrConstantNS$1(fullname, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function () { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); - }; - } - - function attrFunction$1(name, interpolate, value) { - var string00, string10, interpolate0; - return function () { - var string0, - value1 = value(this), - string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; - } - - function attrFunctionNS$1(fullname, interpolate, value) { - var string00, string10, interpolate0; - return function () { - var string0, - value1 = value(this), - string1; - if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; - } - - function transition_attr (name, value) { - var fullname = namespace(name), - i = fullname === "transform" ? interpolateTransformSvg : interpolate$1; - return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS$1 : attrFunction$1)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS$1 : attrRemove$1)(fullname) : (fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, i, value)); - } - - function attrInterpolate(name, i) { - return function (t) { - this.setAttribute(name, i.call(this, t)); - }; - } - - function attrInterpolateNS(fullname, i) { - return function (t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; - } - - function attrTweenNS(fullname, value) { - var t0, i0; - - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); - return t0; - } - - tween._value = value; - return tween; - } - - function attrTween(name, value) { - var t0, i0; - - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); - return t0; - } - - tween._value = value; - return tween; - } - - function transition_attrTween (name, value) { - var key = "attr." + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error(); - var fullname = namespace(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); - } - - function delayFunction(id, value) { - return function () { - init(this, id).delay = +value.apply(this, arguments); - }; - } - - function delayConstant(id, value) { - return value = +value, function () { - init(this, id).delay = value; - }; - } - - function transition_delay (value) { - var id = this._id; - return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id, value)) : get$1(this.node(), id).delay; - } - - function durationFunction(id, value) { - return function () { - set$1(this, id).duration = +value.apply(this, arguments); - }; - } - - function durationConstant(id, value) { - return value = +value, function () { - set$1(this, id).duration = value; - }; - } - - function transition_duration (value) { - var id = this._id; - return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id, value)) : get$1(this.node(), id).duration; - } - - function easeConstant(id, value) { - if (typeof value !== "function") throw new Error(); - return function () { - set$1(this, id).ease = value; - }; - } - - function transition_ease (value) { - var id = this._id; - return arguments.length ? this.each(easeConstant(id, value)) : get$1(this.node(), id).ease; - } - - function transition_filter (match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Transition(subgroups, this._parents, this._name, this._id); - } - - function transition_merge (transition) { - if (transition._id !== this._id) throw new Error(); - - for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Transition(merges, this._parents, this._name, this._id); - } - - function start(name) { - return (name + "").trim().split(/^|\s+/).every(function (t) { - var i = t.indexOf("."); - if (i >= 0) t = t.slice(0, i); - return !t || t === "start"; - }); - } - - function onFunction(id, name, listener) { - var on0, - on1, - sit = start(name) ? init : set$1; - return function () { - var schedule = sit(this, id), - on = schedule.on; // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - schedule.on = on1; - }; - } - - function transition_on (name, listener) { - var id = this._id; - return arguments.length < 2 ? get$1(this.node(), id).on.on(name) : this.each(onFunction(id, name, listener)); - } - - function removeFunction(id) { - return function () { - var parent = this.parentNode; - - for (var i in this.__transition) { - if (+i !== id) return; - } - - if (parent) parent.removeChild(this); - }; - } - - function transition_remove () { - return this.on("end.remove", removeFunction(this._id)); - } - - function transition_select (select) { - var name = this._name, - id = this._id; - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule(subgroup[i], name, id, i, subgroup, get$1(node, id)); - } - } - } - - return new Transition(subgroups, this._parents, name, id); - } - - function transition_selectAll (select) { - var name = this._name, - id = this._id; - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - for (var children = select.call(node, node.__data__, i, group), child, inherit = get$1(node, id), k = 0, l = children.length; k < l; ++k) { - if (child = children[k]) { - schedule(child, name, id, k, children, inherit); - } - } - - subgroups.push(children); - parents.push(node); - } - } - } - - return new Transition(subgroups, parents, name, id); - } - - var Selection$1 = selection.prototype.constructor; - function transition_selection () { - return new Selection$1(this._groups, this._parents); - } - - function styleNull(name, interpolate) { - var string00, string10, interpolate0; - return function () { - var string0 = styleValue(this, name), - string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1); - }; - } - - function styleRemove$1(name) { - return function () { - this.style.removeProperty(name); - }; - } - - function styleConstant$1(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function () { - var string0 = styleValue(this, name); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); - }; - } - - function styleFunction$1(name, interpolate, value) { - var string00, string10, interpolate0; - return function () { - var string0 = styleValue(this, name), - value1 = value(this), - string1 = value1 + ""; - if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; - } - - function styleMaybeRemove(id, name) { - var on0, - on1, - listener0, - key = "style." + name, - event = "end." + key, - remove; - return function () { - var schedule = set$1(this, id), - on = schedule.on, - listener = schedule.value[key] == null ? remove || (remove = styleRemove$1(name)) : undefined; // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - - if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); - schedule.on = on1; - }; - } - - function transition_style (name, value, priority) { - var i = (name += "") === "transform" ? interpolateTransformCss : interpolate$1; - return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove$1(name)) : typeof value === "function" ? this.styleTween(name, styleFunction$1(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant$1(name, i, value), priority).on("end.style." + name, null); - } - - function styleInterpolate(name, i, priority) { - return function (t) { - this.style.setProperty(name, i.call(this, t), priority); - }; - } - - function styleTween(name, value, priority) { - var t, i0; - - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - - tween._value = value; - return tween; - } - - function transition_styleTween (name, value, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error(); - return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); - } - - function textConstant$1(value) { - return function () { - this.textContent = value; - }; - } - - function textFunction$1(value) { - return function () { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; - } - - function transition_text (value) { - return this.tween("text", typeof value === "function" ? textFunction$1(tweenValue(this, "text", value)) : textConstant$1(value == null ? "" : value + "")); - } - - function textInterpolate(i) { - return function (t) { - this.textContent = i.call(this, t); - }; - } - - function textTween(value) { - var t0, i0; - - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && textInterpolate(i); - return t0; - } - - tween._value = value; - return tween; - } - - function transition_textTween (value) { - var key = "text"; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error(); - return this.tween(key, textTween(value)); - } - - function transition_transition () { - var name = this._name, - id0 = this._id, - id1 = newId(); - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - var inherit = get$1(node, id0); - schedule(node, name, id1, i, group, { - time: inherit.time + inherit.delay + inherit.duration, - delay: 0, - duration: inherit.duration, - ease: inherit.ease - }); - } - } - } - - return new Transition(groups, this._parents, name, id1); - } - - function transition_end () { - var on0, - on1, - that = this, - id = that._id, - size = that.size(); - return new Promise(function (resolve, reject) { - var cancel = { - value: reject - }, - end = { - value: function value() { - if (--size === 0) resolve(); - } - }; - that.each(function () { - var schedule = set$1(this, id), - on = schedule.on; // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - - if (on !== on0) { - on1 = (on0 = on).copy(); - - on1._.cancel.push(cancel); - - on1._.interrupt.push(cancel); - - on1._.end.push(end); - } - - schedule.on = on1; - }); - }); - } - - var id$1 = 0; - function Transition(groups, parents, name, id) { - this._groups = groups; - this._parents = parents; - this._name = name; - this._id = id; - } - function transition(name) { - return selection().transition(name); - } - function newId() { - return ++id$1; - } - var selection_prototype = selection.prototype; - Transition.prototype = transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition_transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: transition_tween, - delay: transition_delay, - duration: transition_duration, - ease: transition_ease, - end: transition_end - }; - - function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; - } - - var defaultTiming = { - time: null, - // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut - }; - - function inherit(node, id) { - var timing; - - while (!(timing = node.__transition) || !(timing = timing[id])) { - if (!(node = node.parentNode)) { - return defaultTiming.time = now(), defaultTiming; - } - } - - return timing; - } - - function selection_transition (name) { - var id, timing; - - if (name instanceof Transition) { - id = name._id, name = name._name; - } else { - id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; - } - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - schedule(node, name, id, i, group, timing || inherit(node, id)); - } - } - } - - return new Transition(groups, this._parents, name, id); - } - - selection.prototype.interrupt = selection_interrupt; - selection.prototype.transition = selection_transition; - - /** - @function elem - @desc Manages the enter/update/exit pattern for a single DOM element. - @param {String} selector A D3 selector, which must include the tagname and a class and/or ID. - @param {Object} params Additional parameters. - @param {Boolean} [params.condition = true] Whether or not the element should be rendered (or removed). - @param {Object} [params.enter = {}] A collection of key/value pairs that map to attributes to be given on enter. - @param {Object} [params.exit = {}] A collection of key/value pairs that map to attributes to be given on exit. - @param {D3Selection} [params.parent = d3.select("body")] The parent element for this new element to be appended to. - @param {D3Transition} [params.transition = d3.transition().duration(0)] The transition to use when animated the different life cycle stages. - @param {Object} [params.update = {}] A collection of key/value pairs that map to attributes to be given on update. - */ - - function elem (selector, p) { - // overrides default params - p = Object.assign({}, { - condition: true, - enter: {}, - exit: {}, - parent: _select("body"), - transition: transition().duration(0), - update: {} - }, p); - var className = /\.([^#]+)/g.exec(selector), - id = /#([^\.]+)/g.exec(selector), - tag = /^([^.^#]+)/g.exec(selector)[1]; - var elem = p.parent.selectAll(selector.includes(":") ? selector.split(":")[1] : selector).data(p.condition ? [null] : []); - var enter = elem.enter().append(tag).call(attrize, p.enter); - if (id) enter.attr("id", id[1]); - if (className) enter.attr("class", className[1]); - elem.exit().transition(p.transition).call(attrize, p.exit).remove(); - var update = enter.merge(elem); - update.transition(p.transition).call(attrize, p.update); - return update; - } - - var prefix = "$"; - - function Map() {} - - Map.prototype = map.prototype = { - constructor: Map, - has: function has(key) { - return prefix + key in this; - }, - get: function get(key) { - return this[prefix + key]; - }, - set: function set(key, value) { - this[prefix + key] = value; - return this; - }, - remove: function remove(key) { - var property = prefix + key; - return property in this && delete this[property]; - }, - clear: function clear() { - for (var property in this) { - if (property[0] === prefix) delete this[property]; - } - }, - keys: function keys() { - var keys = []; - - for (var property in this) { - if (property[0] === prefix) keys.push(property.slice(1)); - } - - return keys; - }, - values: function values() { - var values = []; - - for (var property in this) { - if (property[0] === prefix) values.push(this[property]); - } - - return values; - }, - entries: function entries() { - var entries = []; - - for (var property in this) { - if (property[0] === prefix) entries.push({ - key: property.slice(1), - value: this[property] - }); - } - - return entries; - }, - size: function size() { - var size = 0; - - for (var property in this) { - if (property[0] === prefix) ++size; - } - - return size; - }, - empty: function empty() { - for (var property in this) { - if (property[0] === prefix) return false; - } - - return true; - }, - each: function each(f) { - for (var property in this) { - if (property[0] === prefix) f(this[property], property.slice(1), this); - } - } - }; - - function map(object, f) { - var map = new Map(); // Copy constructor. - - if (object instanceof Map) object.each(function (value, key) { - map.set(key, value); - }); // Index array by numeric index or specified key function. - else if (Array.isArray(object)) { - var i = -1, - n = object.length, - o; - if (f == null) while (++i < n) { - map.set(i, object[i]); - } else while (++i < n) { - map.set(f(o = object[i], i, object), o); - } - } // Convert object to map. - else if (object) for (var key in object) { - map.set(key, object[key]); - } - return map; - } - - function nest () { - var keys = [], - _sortKeys = [], - _sortValues, - _rollup, - nest; - - function apply(array, depth, createResult, setResult) { - if (depth >= keys.length) { - if (_sortValues != null) array.sort(_sortValues); - return _rollup != null ? _rollup(array) : array; - } - - var i = -1, - n = array.length, - key = keys[depth++], - keyValue, - value, - valuesByKey = map(), - values, - result = createResult(); - - while (++i < n) { - if (values = valuesByKey.get(keyValue = key(value = array[i]) + "")) { - values.push(value); - } else { - valuesByKey.set(keyValue, [value]); - } - } - - valuesByKey.each(function (values, key) { - setResult(result, key, apply(values, depth, createResult, setResult)); - }); - return result; - } - - function _entries(map, depth) { - if (++depth > keys.length) return map; - var array, - sortKey = _sortKeys[depth - 1]; - if (_rollup != null && depth >= keys.length) array = map.entries();else array = [], map.each(function (v, k) { - array.push({ - key: k, - values: _entries(v, depth) - }); - }); - return sortKey != null ? array.sort(function (a, b) { - return sortKey(a.key, b.key); - }) : array; - } - - return nest = { - object: function object(array) { - return apply(array, 0, createObject, setObject); - }, - map: function map(array) { - return apply(array, 0, createMap, setMap); - }, - entries: function entries(array) { - return _entries(apply(array, 0, createMap, setMap), 0); - }, - key: function key(d) { - keys.push(d); - return nest; - }, - sortKeys: function sortKeys(order) { - _sortKeys[keys.length - 1] = order; - return nest; - }, - sortValues: function sortValues(order) { - _sortValues = order; - return nest; - }, - rollup: function rollup(f) { - _rollup = f; - return nest; - } - }; - } - - function createObject() { - return {}; - } - - function setObject(object, key, value) { - object[key] = value; - } - - function createMap() { - return map(); - } - - function setMap(map, key, value) { - map.set(key, value); - } - - function Set$1() {} - - var proto = map.prototype; - Set$1.prototype = set$2.prototype = { - constructor: Set$1, - has: proto.has, - add: function add(value) { - value += ""; - this[prefix + value] = value; - return this; - }, - remove: proto.remove, - clear: proto.clear, - values: proto.keys, - size: proto.size, - empty: proto.empty, - each: proto.each - }; - - function set$2(object, f) { - var set = new Set$1(); // Copy constructor. - - if (object instanceof Set$1) object.each(function (value) { - set.add(value); - }); // Otherwise, assume it’s an array. - else if (object) { - var i = -1, - n = object.length; - if (f == null) while (++i < n) { - set.add(object[i]); - } else while (++i < n) { - set.add(f(object[i], i, object)); - } - } - return set; - } - - function keys (map) { - var keys = []; - - for (var key in map) { - keys.push(key); - } - - return keys; - } - - /** - @function unique - @desc ES5 implementation to reduce an Array of values to unique instances. - @param {Array} objects The Array of objects to be filtered. - @example this - unique(["apple", "banana", "apple"]); - @example returns this - ["apple", "banana"] - */ - function unique (arr) { - return arr.filter(function (k, i, a) { - return a.indexOf(k) === i; - }); - } - - /** - @function merge - @desc Combines an Array of Objects together and returns a new Object. - @param {Array} objects The Array of objects to be merged together. - @param {Object} aggs An object containing specific aggregation methods (functions) for each key type. By default, numbers are summed and strings are returned as an array of unique values. - @example this - merge([ - {id: "foo", group: "A", value: 10, links: [1, 2]}, - {id: "bar", group: "A", value: 20, links: [1, 3]} - ]); - @example returns this - {id: ["bar", "foo"], group: "A", value: 30, links: [1, 2, 3]} - */ - - function objectMerge(objects) { - var aggs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var availableKeys = unique(arrayMerge(objects.map(function (o) { - return keys(o); - }))), - newObject = {}; - availableKeys.forEach(function (k) { - var value; - if (aggs[k]) value = aggs[k](objects, function (o) { - return o[k]; - });else { - var values = objects.map(function (o) { - return o[k]; - }); - var types = values.map(function (v) { - return v || v === false ? v.constructor : v; - }).filter(function (v) { - return v !== void 0; - }); - if (!types.length) value = undefined;else if (types.indexOf(Array) >= 0) { - value = arrayMerge(values.map(function (v) { - return v instanceof Array ? v : [v]; - })); - value = unique(value); - if (value.length === 1) value = value[0]; - } else if (types.indexOf(String) >= 0) { - value = unique(values); - if (value.length === 1) value = value[0]; - } else if (types.indexOf(Number) >= 0) value = sum(values);else if (types.indexOf(Object) >= 0) { - value = unique(values.filter(function (v) { - return v; - })); - if (value.length === 1) value = value[0];else value = objectMerge(value); - } else { - value = unique(values.filter(function (v) { - return v !== void 0; - })); - if (value.length === 1) value = value[0]; - } - } - newObject[k] = value; - }); - return newObject; - } - - /** - @function parseSides - @desc Converts a string of directional CSS shorthand values into an object with the values expanded. - @param {String|Number} sides The CSS shorthand string to expand. - */ - function parseSides (sides) { - var values; - if (typeof sides === "number") values = [sides];else values = sides.split(/\s+/); - if (values.length === 1) values = [values[0], values[0], values[0], values[0]];else if (values.length === 2) values = values.concat(values);else if (values.length === 3) values.push(values[1]); - return ["top", "right", "bottom", "left"].reduce(function (acc, direction, i) { - var value = parseFloat(values[i]); - acc[direction] = value || 0; - return acc; - }, {}); - } - - /** - @function prefix - @desc Returns the appropriate CSS vendor prefix, given the current browser. - */ - function prefix$1 () { - if ("-webkit-transform" in document.body.style) return "-webkit-";else if ("-moz-transform" in document.body.style) return "-moz-";else if ("-ms-transform" in document.body.style) return "-ms-";else if ("-o-transform" in document.body.style) return "-o-";else return ""; - } - - /** - @function stylize - @desc Applies each key/value in an object as a style. - @param {D3selection} elem The D3 element to apply the styles to. - @param {Object} styles An object of key/value style pairs. - */ - function stylize (e) { - var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - for (var k in s) { - if ({}.hasOwnProperty.call(s, k)) e.style(k, s[k]); - } - } - - function _classCallCheck$2(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$2(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$2(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$2(Constructor, staticProps); - return Constructor; - } - /** - @class Image - @desc Creates SVG images based on an array of data. - @example a sample row of data - var data = {"url": "file.png", "width": "100", "height": "50"}; - @example passed to the generator - new Image().data([data]).render(); - @example creates the following - - @example this is shorthand for the following - image().data([data])(); - @example which also allows a post-draw callback function - image().data([data])(function() { alert("draw complete!"); }) - */ - - var Image$1 = /*#__PURE__*/function () { - /** - @memberof Image - @desc Invoked when creating a new class instance, and sets any default parameters. - @private - */ - function Image() { - _classCallCheck$2(this, Image); - - this._duration = 600; - this._height = accessor("height"); - this._id = accessor("id"); - this._opacity = constant$1(1); - this._pointerEvents = constant$1("auto"); - this._select; - this._url = accessor("url"); - this._width = accessor("width"); - this._x = accessor("x", 0); - this._y = accessor("y", 0); - } - /** - @memberof Image - @desc Renders the current Image to the page. If a *callback* is specified, it will be called once the images are done drawing. - @param {Function} [*callback*] - @chainable - */ - - - _createClass$2(Image, [{ - key: "render", - value: function render(callback) { - var _this = this; - - if (this._select === void 0) this.select(_select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).style("display", "block").node()); - - var images = this._select.selectAll(".d3plus-Image").data(this._data, this._id); - - var enter = images.enter().append("image").attr("class", "d3plus-Image").attr("opacity", 0).attr("width", 0).attr("height", 0).attr("x", function (d, i) { - return _this._x(d, i) + _this._width(d, i) / 2; - }).attr("y", function (d, i) { - return _this._y(d, i) + _this._height(d, i) / 2; - }); - var t = transition().duration(this._duration), - that = this, - update = enter.merge(images); - update.attr("xlink:href", this._url).style("pointer-events", this._pointerEvents).transition(t).attr("opacity", this._opacity).attr("width", function (d, i) { - return _this._width(d, i); - }).attr("height", function (d, i) { - return _this._height(d, i); - }).attr("x", function (d, i) { - return _this._x(d, i); - }).attr("y", function (d, i) { - return _this._y(d, i); - }).each(function (d, i) { - var image = _select(this), - link = that._url(d, i); - - var fullAddress = link.indexOf("http://") === 0 || link.indexOf("https://") === 0; - - if (!fullAddress || link.indexOf(window.location.hostname) === 0) { - var img = new Image(); - img.src = link; - img.crossOrigin = "Anonymous"; - - img.onload = function () { - var canvas = document.createElement("canvas"); - canvas.width = this.width; - canvas.height = this.height; - var context = canvas.getContext("2d"); - context.drawImage(this, 0, 0); - image.attr("xlink:href", canvas.toDataURL("image/png")); - }; - } - }); - images.exit().transition(t).attr("width", function (d, i) { - return _this._width(d, i); - }).attr("height", function (d, i) { - return _this._height(d, i); - }).attr("x", function (d, i) { - return _this._x(d, i); - }).attr("y", function (d, i) { - return _this._y(d, i); - }).attr("opacity", 0).remove(); - if (callback) setTimeout(callback, this._duration + 100); - return this; - } - /** - @memberof Image - @desc If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. An tag will be drawn for each object in the array. - @param {Array} [*data* = []] - @chainable - */ - - }, { - key: "data", - value: function data(_) { - return arguments.length ? (this._data = _, this) : this._data; - } - /** - @memberof Image - @desc If *ms* is specified, sets the animation duration to the specified number and returns the current class instance. If *ms* is not specified, returns the current animation duration. - @param {Number} [*ms* = 600] - @chainable - */ - - }, { - key: "duration", - value: function duration(_) { - return arguments.length ? (this._duration = _, this) : this._duration; - } - /** - @memberof Image - @desc If *value* is specified, sets the height accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.height; - } - */ - - }, { - key: "height", - value: function height(_) { - return arguments.length ? (this._height = typeof _ === "function" ? _ : constant$1(_), this) : this._height; - } - /** - @memberof Image - @desc If *value* is specified, sets the id accessor to the specified function and returns the current class instance. - @param {Function} [*value*] - @chainable - @example - function(d) { - return d.id; - } - */ - - }, { - key: "id", - value: function id(_) { - return arguments.length ? (this._id = _, this) : this._id; - } - /** - @memberof Image - @desc Sets the opacity of the image. - @param {Number} [*value* = 1] - @chainable - */ - - }, { - key: "opacity", - value: function opacity(_) { - return arguments.length ? (this._opacity = typeof _ === "function" ? _ : constant$1(_), this) : this._opacity; - } - /** - @memberof Image - @desc If *value* is specified, sets the pointer-events accessor to the specified function or string and returns the current class instance. - @param {Function|String} [*value* = "auto"] - @chainable - */ - - }, { - key: "pointerEvents", - value: function pointerEvents(_) { - return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : constant$1(_), this) : this._pointerEvents; - } - /** - @memberof Image - @desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element. - @param {String|HTMLElement} [*selector* = d3.select("body").append("svg")] - @chainable - */ - - }, { - key: "select", - value: function select(_) { - return arguments.length ? (this._select = _select(_), this) : this._select; - } - /** - @memberof Image - @desc If *value* is specified, sets the URL accessor to the specified function and returns the current class instance. - @param {Function} [*value*] - @chainable - @example - function(d) { - return d.url; - } - */ - - }, { - key: "url", - value: function url(_) { - return arguments.length ? (this._url = _, this) : this._url; - } - /** - @memberof Image - @desc If *value* is specified, sets the width accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.width; - } - */ - - }, { - key: "width", - value: function width(_) { - return arguments.length ? (this._width = typeof _ === "function" ? _ : constant$1(_), this) : this._width; - } - /** - @memberof Image - @desc If *value* is specified, sets the x accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.x || 0; - } - */ - - }, { - key: "x", - value: function x(_) { - return arguments.length ? (this._x = typeof _ === "function" ? _ : constant$1(_), this) : this._x; - } - /** - @memberof Image - @desc If *value* is specified, sets the y accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.y || 0; - } - */ - - }, { - key: "y", - value: function y(_) { - return arguments.length ? (this._y = typeof _ === "function" ? _ : constant$1(_), this) : this._y; - } - }]); - - return Image; - }(); - - function define$1 (constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - function extend$1(parent, definition) { - var prototype = Object.create(parent.prototype); - - for (var key in definition) { - prototype[key] = definition[key]; - } - - return prototype; - } - - function Color$1() {} - var _darker$1 = 0.7; - - var _brighter$1 = 1 / _darker$1; - var reI$1 = "\\s*([+-]?\\d+)\\s*", - reN$1 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP$1 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger$1 = new RegExp("^rgb\\(" + [reI$1, reI$1, reI$1] + "\\)$"), - reRgbPercent$1 = new RegExp("^rgb\\(" + [reP$1, reP$1, reP$1] + "\\)$"), - reRgbaInteger$1 = new RegExp("^rgba\\(" + [reI$1, reI$1, reI$1, reN$1] + "\\)$"), - reRgbaPercent$1 = new RegExp("^rgba\\(" + [reP$1, reP$1, reP$1, reN$1] + "\\)$"), - reHslPercent$1 = new RegExp("^hsl\\(" + [reN$1, reP$1, reP$1] + "\\)$"), - reHslaPercent$1 = new RegExp("^hsla\\(" + [reN$1, reP$1, reP$1, reN$1] + "\\)$"); - var named$1 = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 - }; - define$1(Color$1, color$1, { - copy: function copy(channels) { - return Object.assign(new this.constructor(), this, channels); - }, - displayable: function displayable() { - return this.rgb().displayable(); - }, - hex: color_formatHex, - // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb - }); - - function color_formatHex() { - return this.rgb().formatHex(); - } - - function color_formatHsl() { - return hslConvert$1(this).formatHsl(); - } - - function color_formatRgb() { - return this.rgb().formatRgb(); - } - - function color$1(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn$1(m) // #ff0000 - : l === 3 ? new Rgb$1(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, (m & 0xf) << 4 | m & 0xf, 1) // #f00 - : l === 8 ? rgba$1(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba$1(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, ((m & 0xf) << 4 | m & 0xf) / 0xff) // #f000 - : null // invalid hex - ) : (m = reRgbInteger$1.exec(format)) ? new Rgb$1(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent$1.exec(format)) ? new Rgb$1(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger$1.exec(format)) ? rgba$1(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent$1.exec(format)) ? rgba$1(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent$1.exec(format)) ? hsla$1(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent$1.exec(format)) ? hsla$1(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named$1.hasOwnProperty(format) ? rgbn$1(named$1[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb$1(NaN, NaN, NaN, 0) : null; - } - - function rgbn$1(n) { - return new Rgb$1(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); - } - - function rgba$1(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb$1(r, g, b, a); - } - - function rgbConvert$1(o) { - if (!(o instanceof Color$1)) o = color$1(o); - if (!o) return new Rgb$1(); - o = o.rgb(); - return new Rgb$1(o.r, o.g, o.b, o.opacity); - } - function rgb$1(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert$1(r) : new Rgb$1(r, g, b, opacity == null ? 1 : opacity); - } - function Rgb$1(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; - } - define$1(Rgb$1, rgb$1, extend$1(Color$1, { - brighter: function brighter(k) { - k = k == null ? _brighter$1 : Math.pow(_brighter$1, k); - return new Rgb$1(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker$1 : Math.pow(_darker$1, k); - return new Rgb$1(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function rgb() { - return this; - }, - displayable: function displayable() { - return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1; - }, - hex: rgb_formatHex, - // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb - })); - - function rgb_formatHex() { - return "#" + hex(this.r) + hex(this.g) + hex(this.b); - } - - function rgb_formatRgb() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")"); - } - - function hex(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); - } - - function hsla$1(h, s, l, a) { - if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN; - return new Hsl$1(h, s, l, a); - } - - function hslConvert$1(o) { - if (o instanceof Hsl$1) return new Hsl$1(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color$1)) o = color$1(o); - if (!o) return new Hsl$1(); - if (o instanceof Hsl$1) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - - return new Hsl$1(h, s, l, o.opacity); - } - function hsl$1(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert$1(h) : new Hsl$1(h, s, l, opacity == null ? 1 : opacity); - } - - function Hsl$1(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define$1(Hsl$1, hsl$1, extend$1(Color$1, { - brighter: function brighter(k) { - k = k == null ? _brighter$1 : Math.pow(_brighter$1, k); - return new Hsl$1(this.h, this.s, this.l * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker$1 : Math.pow(_darker$1, k); - return new Hsl$1(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function rgb() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb$1(hsl2rgb$1(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb$1(h, m1, m2), hsl2rgb$1(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity); - }, - displayable: function displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; - }, - formatHsl: function formatHsl() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")"); - } - })); - /* From FvD 13.37, CSS Color Module Level 3 */ - - function hsl2rgb$1(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; - } - - function define$2 (constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - function extend$2(parent, definition) { - var prototype = Object.create(parent.prototype); - - for (var key in definition) { - prototype[key] = definition[key]; - } - - return prototype; - } - - function Color$2() {} - var _darker$2 = 0.7; - - var _brighter$2 = 1 / _darker$2; - var reI$2 = "\\s*([+-]?\\d+)\\s*", - reN$2 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP$2 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex$1 = /^#([0-9a-f]{3,8})$/, - reRgbInteger$2 = new RegExp("^rgb\\(" + [reI$2, reI$2, reI$2] + "\\)$"), - reRgbPercent$2 = new RegExp("^rgb\\(" + [reP$2, reP$2, reP$2] + "\\)$"), - reRgbaInteger$2 = new RegExp("^rgba\\(" + [reI$2, reI$2, reI$2, reN$2] + "\\)$"), - reRgbaPercent$2 = new RegExp("^rgba\\(" + [reP$2, reP$2, reP$2, reN$2] + "\\)$"), - reHslPercent$2 = new RegExp("^hsl\\(" + [reN$2, reP$2, reP$2] + "\\)$"), - reHslaPercent$2 = new RegExp("^hsla\\(" + [reN$2, reP$2, reP$2, reN$2] + "\\)$"); - var named$2 = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 - }; - define$2(Color$2, color$2, { - copy: function copy(channels) { - return Object.assign(new this.constructor(), this, channels); - }, - displayable: function displayable() { - return this.rgb().displayable(); - }, - hex: color_formatHex$1, - // Deprecated! Use color.formatHex. - formatHex: color_formatHex$1, - formatHsl: color_formatHsl$1, - formatRgb: color_formatRgb$1, - toString: color_formatRgb$1 - }); - - function color_formatHex$1() { - return this.rgb().formatHex(); - } - - function color_formatHsl$1() { - return hslConvert$2(this).formatHsl(); - } - - function color_formatRgb$1() { - return this.rgb().formatRgb(); - } - - function color$2(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex$1.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn$2(m) // #ff0000 - : l === 3 ? new Rgb$2(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, (m & 0xf) << 4 | m & 0xf, 1) // #f00 - : l === 8 ? rgba$2(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba$2(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, ((m & 0xf) << 4 | m & 0xf) / 0xff) // #f000 - : null // invalid hex - ) : (m = reRgbInteger$2.exec(format)) ? new Rgb$2(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent$2.exec(format)) ? new Rgb$2(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger$2.exec(format)) ? rgba$2(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent$2.exec(format)) ? rgba$2(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent$2.exec(format)) ? hsla$2(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent$2.exec(format)) ? hsla$2(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named$2.hasOwnProperty(format) ? rgbn$2(named$2[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb$2(NaN, NaN, NaN, 0) : null; - } - - function rgbn$2(n) { - return new Rgb$2(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); - } - - function rgba$2(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb$2(r, g, b, a); - } - - function rgbConvert$2(o) { - if (!(o instanceof Color$2)) o = color$2(o); - if (!o) return new Rgb$2(); - o = o.rgb(); - return new Rgb$2(o.r, o.g, o.b, o.opacity); - } - function rgb$2(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert$2(r) : new Rgb$2(r, g, b, opacity == null ? 1 : opacity); - } - function Rgb$2(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; - } - define$2(Rgb$2, rgb$2, extend$2(Color$2, { - brighter: function brighter(k) { - k = k == null ? _brighter$2 : Math.pow(_brighter$2, k); - return new Rgb$2(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker$2 : Math.pow(_darker$2, k); - return new Rgb$2(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function rgb() { - return this; - }, - displayable: function displayable() { - return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1; - }, - hex: rgb_formatHex$1, - // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex$1, - formatRgb: rgb_formatRgb$1, - toString: rgb_formatRgb$1 - })); - - function rgb_formatHex$1() { - return "#" + hex$1(this.r) + hex$1(this.g) + hex$1(this.b); - } - - function rgb_formatRgb$1() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")"); - } - - function hex$1(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); - } - - function hsla$2(h, s, l, a) { - if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN; - return new Hsl$2(h, s, l, a); - } - - function hslConvert$2(o) { - if (o instanceof Hsl$2) return new Hsl$2(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color$2)) o = color$2(o); - if (!o) return new Hsl$2(); - if (o instanceof Hsl$2) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - - return new Hsl$2(h, s, l, o.opacity); - } - function hsl$2(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert$2(h) : new Hsl$2(h, s, l, opacity == null ? 1 : opacity); - } - - function Hsl$2(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define$2(Hsl$2, hsl$2, extend$2(Color$2, { - brighter: function brighter(k) { - k = k == null ? _brighter$2 : Math.pow(_brighter$2, k); - return new Hsl$2(this.h, this.s, this.l * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker$2 : Math.pow(_darker$2, k); - return new Hsl$2(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function rgb() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb$2(hsl2rgb$2(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb$2(h, m1, m2), hsl2rgb$2(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity); - }, - displayable: function displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; - }, - formatHsl: function formatHsl() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")"); - } - })); - /* From FvD 13.37, CSS Color Module Level 3 */ - - function hsl2rgb$2(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; - } - - function initRange(domain, range) { - switch (arguments.length) { - case 0: - break; - - case 1: - this.range(domain); - break; - - default: - this.range(range).domain(domain); - break; - } - - return this; - } - function initInterpolator(domain, interpolator) { - switch (arguments.length) { - case 0: - break; - - case 1: - this.interpolator(domain); - break; - - default: - this.interpolator(interpolator).domain(domain); - break; - } - - return this; - } - - var array$1 = Array.prototype; - var map$1 = array$1.map; - var slice$1 = array$1.slice; - - var implicit = { - name: "implicit" - }; - function ordinal() { - var index = map(), - domain = [], - range = [], - unknown = implicit; - - function scale(d) { - var key = d + "", - i = index.get(key); - - if (!i) { - if (unknown !== implicit) return unknown; - index.set(key, i = domain.push(d)); - } - - return range[(i - 1) % range.length]; - } - - scale.domain = function (_) { - if (!arguments.length) return domain.slice(); - domain = [], index = map(); - var i = -1, - n = _.length, - d, - key; - - while (++i < n) { - if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d)); - } - - return scale; - }; - - scale.range = function (_) { - return arguments.length ? (range = slice$1.call(_), scale) : range.slice(); - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - scale.copy = function () { - return ordinal(domain, range).unknown(unknown); - }; - - initRange.apply(scale, arguments); - return scale; - } - - function band() { - var scale = ordinal().unknown(undefined), - domain = scale.domain, - ordinalRange = scale.range, - range$1 = [0, 1], - step, - bandwidth, - round = false, - paddingInner = 0, - paddingOuter = 0, - align = 0.5; - delete scale.unknown; - - function rescale() { - var n = domain().length, - reverse = range$1[1] < range$1[0], - start = range$1[reverse - 0], - stop = range$1[1 - reverse]; - step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); - if (round) step = Math.floor(step); - start += (stop - start - step * (n - paddingInner)) * align; - bandwidth = step * (1 - paddingInner); - if (round) start = Math.round(start), bandwidth = Math.round(bandwidth); - var values = range(n).map(function (i) { - return start + step * i; - }); - return ordinalRange(reverse ? values.reverse() : values); - } - - scale.domain = function (_) { - return arguments.length ? (domain(_), rescale()) : domain(); - }; - - scale.range = function (_) { - return arguments.length ? (range$1 = [+_[0], +_[1]], rescale()) : range$1.slice(); - }; - - scale.rangeRound = function (_) { - return range$1 = [+_[0], +_[1]], round = true, rescale(); - }; - - scale.bandwidth = function () { - return bandwidth; - }; - - scale.step = function () { - return step; - }; - - scale.round = function (_) { - return arguments.length ? (round = !!_, rescale()) : round; - }; - - scale.padding = function (_) { - return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner; - }; - - scale.paddingInner = function (_) { - return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner; - }; - - scale.paddingOuter = function (_) { - return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter; - }; - - scale.align = function (_) { - return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align; - }; - - scale.copy = function () { - return band(domain(), range$1).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align); - }; - - return initRange.apply(rescale(), arguments); - } - - function pointish(scale) { - var copy = scale.copy; - scale.padding = scale.paddingOuter; - delete scale.paddingInner; - delete scale.paddingOuter; - - scale.copy = function () { - return pointish(copy()); - }; - - return scale; - } - - function point$1() { - return pointish(band.apply(null, arguments).paddingInner(1)); - } - - function constant$4 (x) { - return function () { - return x; - }; - } - - function number$1 (x) { - return +x; - } - - var unit = [0, 1]; - function identity$2(x) { - return x; - } - - function normalize(a, b) { - return (b -= a = +a) ? function (x) { - return (x - a) / b; - } : constant$4(isNaN(b) ? NaN : 0.5); - } - - function clamper(domain) { - var a = domain[0], - b = domain[domain.length - 1], - t; - if (a > b) t = a, a = b, b = t; - return function (x) { - return Math.max(a, Math.min(b, x)); - }; - } // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. - // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b]. - - - function bimap(domain, range, interpolate) { - var d0 = domain[0], - d1 = domain[1], - r0 = range[0], - r1 = range[1]; - if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);else d0 = normalize(d0, d1), r0 = interpolate(r0, r1); - return function (x) { - return r0(d0(x)); - }; - } - - function polymap(domain, range, interpolate) { - var j = Math.min(domain.length, range.length) - 1, - d = new Array(j), - r = new Array(j), - i = -1; // Reverse descending domains. - - if (domain[j] < domain[0]) { - domain = domain.slice().reverse(); - range = range.slice().reverse(); - } - - while (++i < j) { - d[i] = normalize(domain[i], domain[i + 1]); - r[i] = interpolate(range[i], range[i + 1]); - } - - return function (x) { - var i = bisectRight(domain, x, 1, j) - 1; - return r[i](d[i](x)); - }; - } - - function copy(source, target) { - return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); - } - function transformer() { - var domain = unit, - range = unit, - interpolate$1 = interpolate, - transform, - untransform, - unknown, - clamp = identity$2, - piecewise, - output, - input; - - function rescale() { - piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap; - output = input = null; - return scale; - } - - function scale(x) { - return isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x))); - } - - scale.invert = function (y) { - return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y))); - }; - - scale.domain = function (_) { - return arguments.length ? (domain = map$1.call(_, number$1), clamp === identity$2 || (clamp = clamper(domain)), rescale()) : domain.slice(); - }; - - scale.range = function (_) { - return arguments.length ? (range = slice$1.call(_), rescale()) : range.slice(); - }; - - scale.rangeRound = function (_) { - return range = slice$1.call(_), interpolate$1 = interpolateRound, rescale(); - }; - - scale.clamp = function (_) { - return arguments.length ? (clamp = _ ? clamper(domain) : identity$2, scale) : clamp !== identity$2; - }; - - scale.interpolate = function (_) { - return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1; - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - return function (t, u) { - transform = t, untransform = u; - return rescale(); - }; - } - function continuous(transform, untransform) { - return transformer()(transform, untransform); - } - - // Computes the decimal coefficient and exponent of the specified number x with - // significant digits p, where x is positive and p is in [1, 21] or undefined. - // For example, formatDecimal(1.23) returns ["123", 0]. - function formatDecimal (x, p) { - if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity - - var i, - coefficient = x.slice(0, i); // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - - return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)]; - } - - function exponent (x) { - return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN; - } - - function formatGroup (grouping, thousands) { - return function (value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; - - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - - return t.reverse().join(thousands); - }; - } - - function formatNumerals (numerals) { - return function (value) { - return value.replace(/[0-9]/g, function (i) { - return numerals[+i]; - }); - }; - } - - // [[fill]align][sign][symbol][0][width][,][.precision][~][type] - var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - function formatSpecifier(specifier) { - return new FormatSpecifier(specifier); - } - formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof - - function FormatSpecifier(specifier) { - if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - this.fill = match[1] || " "; - this.align = match[2] || ">"; - this.sign = match[3] || "-"; - this.symbol = match[4] || ""; - this.zero = !!match[5]; - this.width = match[6] && +match[6]; - this.comma = !!match[7]; - this.precision = match[8] && +match[8].slice(1); - this.trim = !!match[9]; - this.type = match[10] || ""; - } - - FormatSpecifier.prototype.toString = function () { - return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width == null ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision == null ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; - }; - - // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. - function formatTrim (s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case ".": - i0 = i1 = i; - break; - - case "0": - if (i0 === 0) i0 = i; - i1 = i; - break; - - default: - if (i0 > 0) { - if (!+s[i]) break out; - i0 = 0; - } - - break; - } - } - - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; - } - - var prefixExponent; - function formatPrefixAuto (x, p) { - var d = formatDecimal(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1], - i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, - n = coefficient.length; - return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y! - } - - function formatRounded (x, p) { - var d = formatDecimal(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0"); - } - - var formatTypes = { - "%": function _(x, p) { - return (x * 100).toFixed(p); - }, - "b": function b(x) { - return Math.round(x).toString(2); - }, - "c": function c(x) { - return x + ""; - }, - "d": function d(x) { - return Math.round(x).toString(10); - }, - "e": function e(x, p) { - return x.toExponential(p); - }, - "f": function f(x, p) { - return x.toFixed(p); - }, - "g": function g(x, p) { - return x.toPrecision(p); - }, - "o": function o(x) { - return Math.round(x).toString(8); - }, - "p": function p(x, _p) { - return formatRounded(x * 100, _p); - }, - "r": formatRounded, - "s": formatPrefixAuto, - "X": function X(x) { - return Math.round(x).toString(16).toUpperCase(); - }, - "x": function x(_x) { - return Math.round(_x).toString(16); - } - }; - - function identity$3 (x) { - return x; - } - - var prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; - function formatLocale (locale) { - var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity$3, - currency = locale.currency, - decimal = locale.decimal, - numerals = locale.numerals ? formatNumerals(locale.numerals) : identity$3, - percent = locale.percent || "%"; - - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; // The "n" type is an alias for ",g". - - if (type === "n") comma = true, type = "g"; // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes[type]) precision == null && (precision = 12), trim = true, type = "g"; // If zero fill is specified, padding goes after sign and before digits. - - if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "="; // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - - var prefix = symbol === "$" ? currency[0] : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", - suffix = symbol === "$" ? currency[1] : /[%p]/.test(type) ? percent : ""; // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - - var formatType = formatTypes[type], - maybeSuffix = /[defgprs%]/.test(type); // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - - precision = precision == null ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); - - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, - n, - c; - - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; // Perform the initial formatting. - - var valueNegative = value < 0; - value = formatType(Math.abs(value), precision); // Trim insignificant zeros. - - if (trim) value = formatTrim(value); // If a negative value rounds to zero during formatting, treat as positive. - - if (valueNegative && +value === 0) valueNegative = false; // Compute the prefix and suffix. - - valuePrefix = (valueNegative ? sign === "(" ? sign : "-" : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; - valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - - if (maybeSuffix) { - i = -1, n = value.length; - - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } // If the fill character is not "0", grouping is applied before padding. - - - if (comma && !zero) value = group(value, Infinity); // Compute the padding. - - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = length < width ? new Array(width - length + 1).join(fill) : ""; // If the fill character is "0", grouping is applied after padding. - - if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; // Reconstruct the final output based on the desired alignment. - - switch (align) { - case "<": - value = valuePrefix + value + valueSuffix + padding; - break; - - case "=": - value = valuePrefix + padding + value + valueSuffix; - break; - - case "^": - value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); - break; - - default: - value = padding + valuePrefix + value + valueSuffix; - break; - } - - return numerals(value); - } - - format.toString = function () { - return specifier + ""; - }; - - return format; - } - - function formatPrefix(specifier, value) { - var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), - e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes[8 + e / 3]; - return function (value) { - return f(k * value) + prefix; - }; - } - - return { - format: newFormat, - formatPrefix: formatPrefix - }; - } - - var locale; - var format; - var formatPrefix; - defaultLocale({ - decimal: ".", - thousands: ",", - grouping: [3], - currency: ["$", ""] - }); - function defaultLocale(definition) { - locale = formatLocale(definition); - format = locale.format; - formatPrefix = locale.formatPrefix; - return locale; - } - - function precisionFixed (step) { - return Math.max(0, -exponent(Math.abs(step))); - } - - function precisionPrefix (step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); - } - - function precisionRound (step, max) { - step = Math.abs(step), max = Math.abs(max) - step; - return Math.max(0, exponent(max) - exponent(step)) + 1; - } - - function tickFormat (start, stop, count, specifier) { - var step = tickStep(start, stop, count), - precision; - specifier = formatSpecifier(specifier == null ? ",f" : specifier); - - switch (specifier.type) { - case "s": - { - var value = Math.max(Math.abs(start), Math.abs(stop)); - if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision; - return formatPrefix(specifier, value); - } - - case "": - case "e": - case "g": - case "p": - case "r": - { - if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); - break; - } - - case "f": - case "%": - { - if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2; - break; - } - } - - return format(specifier); - } - - function linearish(scale) { - var domain = scale.domain; - - scale.ticks = function (count) { - var d = domain(); - return d3Ticks(d[0], d[d.length - 1], count == null ? 10 : count); - }; - - scale.tickFormat = function (count, specifier) { - var d = domain(); - return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier); - }; - - scale.nice = function (count) { - if (count == null) count = 10; - var d = domain(), - i0 = 0, - i1 = d.length - 1, - start = d[i0], - stop = d[i1], - step; - - if (stop < start) { - step = start, start = stop, stop = step; - step = i0, i0 = i1, i1 = step; - } - - step = tickIncrement(start, stop, count); - - if (step > 0) { - start = Math.floor(start / step) * step; - stop = Math.ceil(stop / step) * step; - step = tickIncrement(start, stop, count); - } else if (step < 0) { - start = Math.ceil(start * step) / step; - stop = Math.floor(stop * step) / step; - step = tickIncrement(start, stop, count); - } - - if (step > 0) { - d[i0] = Math.floor(start / step) * step; - d[i1] = Math.ceil(stop / step) * step; - domain(d); - } else if (step < 0) { - d[i0] = Math.ceil(start * step) / step; - d[i1] = Math.floor(stop * step) / step; - domain(d); - } - - return scale; - }; - - return scale; - } - function linear$1() { - var scale = continuous(identity$2, identity$2); - - scale.copy = function () { - return copy(scale, linear$1()); - }; - - initRange.apply(scale, arguments); - return linearish(scale); - } - - function identity$4(domain) { - var unknown; - - function scale(x) { - return isNaN(x = +x) ? unknown : x; - } - - scale.invert = scale; - - scale.domain = scale.range = function (_) { - return arguments.length ? (domain = map$1.call(_, number$1), scale) : domain.slice(); - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - scale.copy = function () { - return identity$4(domain).unknown(unknown); - }; - - domain = arguments.length ? map$1.call(domain, number$1) : [0, 1]; - return linearish(scale); - } - - function nice (domain, interval) { - domain = domain.slice(); - var i0 = 0, - i1 = domain.length - 1, - x0 = domain[i0], - x1 = domain[i1], - t; - - if (x1 < x0) { - t = i0, i0 = i1, i1 = t; - t = x0, x0 = x1, x1 = t; - } - - domain[i0] = interval.floor(x0); - domain[i1] = interval.ceil(x1); - return domain; - } - - function transformLog(x) { - return Math.log(x); - } - - function transformExp(x) { - return Math.exp(x); - } - - function transformLogn(x) { - return -Math.log(-x); - } - - function transformExpn(x) { - return -Math.exp(-x); - } - - function pow10(x) { - return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x; - } - - function powp(base) { - return base === 10 ? pow10 : base === Math.E ? Math.exp : function (x) { - return Math.pow(base, x); - }; - } - - function logp(base) { - return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), function (x) { - return Math.log(x) / base; - }); - } - - function reflect(f) { - return function (x) { - return -f(-x); - }; - } - - function loggish(transform) { - var scale = transform(transformLog, transformExp), - domain = scale.domain, - base = 10, - logs, - pows; - - function rescale() { - logs = logp(base), pows = powp(base); - - if (domain()[0] < 0) { - logs = reflect(logs), pows = reflect(pows); - transform(transformLogn, transformExpn); - } else { - transform(transformLog, transformExp); - } - - return scale; - } - - scale.base = function (_) { - return arguments.length ? (base = +_, rescale()) : base; - }; - - scale.domain = function (_) { - return arguments.length ? (domain(_), rescale()) : domain(); - }; - - scale.ticks = function (count) { - var d = domain(), - u = d[0], - v = d[d.length - 1], - r; - if (r = v < u) i = u, u = v, v = i; - var i = logs(u), - j = logs(v), - p, - k, - t, - n = count == null ? 10 : +count, - z = []; - - if (!(base % 1) && j - i < n) { - i = Math.round(i) - 1, j = Math.round(j) + 1; - if (u > 0) for (; i < j; ++i) { - for (k = 1, p = pows(i); k < base; ++k) { - t = p * k; - if (t < u) continue; - if (t > v) break; - z.push(t); - } - } else for (; i < j; ++i) { - for (k = base - 1, p = pows(i); k >= 1; --k) { - t = p * k; - if (t < u) continue; - if (t > v) break; - z.push(t); - } - } - } else { - z = d3Ticks(i, j, Math.min(j - i, n)).map(pows); - } - - return r ? z.reverse() : z; - }; - - scale.tickFormat = function (count, specifier) { - if (specifier == null) specifier = base === 10 ? ".0e" : ","; - if (typeof specifier !== "function") specifier = format(specifier); - if (count === Infinity) return specifier; - if (count == null) count = 10; - var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate? - - return function (d) { - var i = d / pows(Math.round(logs(d))); - if (i * base < base - 0.5) i *= base; - return i <= k ? specifier(d) : ""; - }; - }; - - scale.nice = function () { - return domain(nice(domain(), { - floor: function floor(x) { - return pows(Math.floor(logs(x))); - }, - ceil: function ceil(x) { - return pows(Math.ceil(logs(x))); - } - })); - }; - - return scale; - } - function log() { - var scale = loggish(transformer()).domain([1, 10]); - - scale.copy = function () { - return copy(scale, log()).base(scale.base()); - }; - - initRange.apply(scale, arguments); - return scale; - } - - function transformSymlog(c) { - return function (x) { - return Math.sign(x) * Math.log1p(Math.abs(x / c)); - }; - } - - function transformSymexp(c) { - return function (x) { - return Math.sign(x) * Math.expm1(Math.abs(x)) * c; - }; - } - - function symlogish(transform) { - var c = 1, - scale = transform(transformSymlog(c), transformSymexp(c)); - - scale.constant = function (_) { - return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c; - }; - - return linearish(scale); - } - function symlog() { - var scale = symlogish(transformer()); - - scale.copy = function () { - return copy(scale, symlog()).constant(scale.constant()); - }; - - return initRange.apply(scale, arguments); - } - - function transformPow(exponent) { - return function (x) { - return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent); - }; - } - - function transformSqrt(x) { - return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x); - } - - function transformSquare(x) { - return x < 0 ? -x * x : x * x; - } - - function powish(transform) { - var scale = transform(identity$2, identity$2), - exponent = 1; - - function rescale() { - return exponent === 1 ? transform(identity$2, identity$2) : exponent === 0.5 ? transform(transformSqrt, transformSquare) : transform(transformPow(exponent), transformPow(1 / exponent)); - } - - scale.exponent = function (_) { - return arguments.length ? (exponent = +_, rescale()) : exponent; - }; - - return linearish(scale); - } - function pow() { - var scale = powish(transformer()); - - scale.copy = function () { - return copy(scale, pow()).exponent(scale.exponent()); - }; - - initRange.apply(scale, arguments); - return scale; - } - function sqrt$1() { - return pow.apply(null, arguments).exponent(0.5); - } - - function quantile$1() { - var domain = [], - range = [], - thresholds = [], - unknown; - - function rescale() { - var i = 0, - n = Math.max(1, range.length); - thresholds = new Array(n - 1); - - while (++i < n) { - thresholds[i - 1] = quantile(domain, i / n); - } - - return scale; - } - - function scale(x) { - return isNaN(x = +x) ? unknown : range[bisectRight(thresholds, x)]; - } - - scale.invertExtent = function (y) { - var i = range.indexOf(y); - return i < 0 ? [NaN, NaN] : [i > 0 ? thresholds[i - 1] : domain[0], i < thresholds.length ? thresholds[i] : domain[domain.length - 1]]; - }; - - scale.domain = function (_) { - if (!arguments.length) return domain.slice(); - domain = []; - - for (var i = 0, n = _.length, d; i < n; ++i) { - if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); - } - - domain.sort(ascending); - return rescale(); - }; - - scale.range = function (_) { - return arguments.length ? (range = slice$1.call(_), rescale()) : range.slice(); - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - scale.quantiles = function () { - return thresholds.slice(); - }; - - scale.copy = function () { - return quantile$1().domain(domain).range(range).unknown(unknown); - }; - - return initRange.apply(scale, arguments); - } - - function quantize() { - var x0 = 0, - x1 = 1, - n = 1, - domain = [0.5], - range = [0, 1], - unknown; - - function scale(x) { - return x <= x ? range[bisectRight(domain, x, 0, n)] : unknown; - } - - function rescale() { - var i = -1; - domain = new Array(n); - - while (++i < n) { - domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1); - } - - return scale; - } - - scale.domain = function (_) { - return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1]; - }; - - scale.range = function (_) { - return arguments.length ? (n = (range = slice$1.call(_)).length - 1, rescale()) : range.slice(); - }; - - scale.invertExtent = function (y) { - var i = range.indexOf(y); - return i < 0 ? [NaN, NaN] : i < 1 ? [x0, domain[0]] : i >= n ? [domain[n - 1], x1] : [domain[i - 1], domain[i]]; - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : scale; - }; - - scale.thresholds = function () { - return domain.slice(); - }; - - scale.copy = function () { - return quantize().domain([x0, x1]).range(range).unknown(unknown); - }; - - return initRange.apply(linearish(scale), arguments); - } - - function threshold() { - var domain = [0.5], - range = [0, 1], - unknown, - n = 1; - - function scale(x) { - return x <= x ? range[bisectRight(domain, x, 0, n)] : unknown; - } - - scale.domain = function (_) { - return arguments.length ? (domain = slice$1.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice(); - }; - - scale.range = function (_) { - return arguments.length ? (range = slice$1.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice(); - }; - - scale.invertExtent = function (y) { - var i = range.indexOf(y); - return [domain[i - 1], domain[i]]; - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - scale.copy = function () { - return threshold().domain(domain).range(range).unknown(unknown); - }; - - return initRange.apply(scale, arguments); - } - - var t0$1 = new Date(), - t1$1 = new Date(); - function newInterval(floori, offseti, count, field) { - function interval(date) { - return floori(date = new Date(+date)), date; - } - - interval.floor = interval; - - interval.ceil = function (date) { - return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date; - }; - - interval.round = function (date) { - var d0 = interval(date), - d1 = interval.ceil(date); - return date - d0 < d1 - date ? d0 : d1; - }; - - interval.offset = function (date, step) { - return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date; - }; - - interval.range = function (start, stop, step) { - var range = [], - previous; - start = interval.ceil(start); - step = step == null ? 1 : Math.floor(step); - if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date - - do { - range.push(previous = new Date(+start)), offseti(start, step), floori(start); - } while (previous < start && start < stop); - - return range; - }; - - interval.filter = function (test) { - return newInterval(function (date) { - if (date >= date) while (floori(date), !test(date)) { - date.setTime(date - 1); - } - }, function (date, step) { - if (date >= date) { - if (step < 0) while (++step <= 0) { - while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty - - } else while (--step >= 0) { - while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty - - } - } - }); - }; - - if (count) { - interval.count = function (start, end) { - t0$1.setTime(+start), t1$1.setTime(+end); - floori(t0$1), floori(t1$1); - return Math.floor(count(t0$1, t1$1)); - }; - - interval.every = function (step) { - step = Math.floor(step); - return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? function (d) { - return field(d) % step === 0; - } : function (d) { - return interval.count(0, d) % step === 0; - }); - }; - } - - return interval; - } - - var millisecond = newInterval(function () {// noop - }, function (date, step) { - date.setTime(+date + step); - }, function (start, end) { - return end - start; - }); // An optimized implementation for this simple case. - - millisecond.every = function (k) { - k = Math.floor(k); - if (!isFinite(k) || !(k > 0)) return null; - if (!(k > 1)) return millisecond; - return newInterval(function (date) { - date.setTime(Math.floor(date / k) * k); - }, function (date, step) { - date.setTime(+date + step * k); - }, function (start, end) { - return (end - start) / k; - }); - }; - - var durationSecond = 1e3; - var durationMinute = 6e4; - var durationHour = 36e5; - var durationDay = 864e5; - var durationWeek = 6048e5; - - var second = newInterval(function (date) { - date.setTime(date - date.getMilliseconds()); - }, function (date, step) { - date.setTime(+date + step * durationSecond); - }, function (start, end) { - return (end - start) / durationSecond; - }, function (date) { - return date.getUTCSeconds(); - }); - - var minute = newInterval(function (date) { - date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond); - }, function (date, step) { - date.setTime(+date + step * durationMinute); - }, function (start, end) { - return (end - start) / durationMinute; - }, function (date) { - return date.getMinutes(); - }); - - var hour = newInterval(function (date) { - date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute); - }, function (date, step) { - date.setTime(+date + step * durationHour); - }, function (start, end) { - return (end - start) / durationHour; - }, function (date) { - return date.getHours(); - }); - - var day = newInterval(function (date) { - date.setHours(0, 0, 0, 0); - }, function (date, step) { - date.setDate(date.getDate() + step); - }, function (start, end) { - return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay; - }, function (date) { - return date.getDate() - 1; - }); - - function weekday(i) { - return newInterval(function (date) { - date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7); - date.setHours(0, 0, 0, 0); - }, function (date, step) { - date.setDate(date.getDate() + step * 7); - }, function (start, end) { - return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek; - }); - } - - var sunday = weekday(0); - var monday = weekday(1); - var tuesday = weekday(2); - var wednesday = weekday(3); - var thursday = weekday(4); - var friday = weekday(5); - var saturday = weekday(6); - - var month = newInterval(function (date) { - date.setDate(1); - date.setHours(0, 0, 0, 0); - }, function (date, step) { - date.setMonth(date.getMonth() + step); - }, function (start, end) { - return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; - }, function (date) { - return date.getMonth(); - }); - - var year = newInterval(function (date) { - date.setMonth(0, 1); - date.setHours(0, 0, 0, 0); - }, function (date, step) { - date.setFullYear(date.getFullYear() + step); - }, function (start, end) { - return end.getFullYear() - start.getFullYear(); - }, function (date) { - return date.getFullYear(); - }); // An optimized implementation for this simple case. - - year.every = function (k) { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function (date) { - date.setFullYear(Math.floor(date.getFullYear() / k) * k); - date.setMonth(0, 1); - date.setHours(0, 0, 0, 0); - }, function (date, step) { - date.setFullYear(date.getFullYear() + step * k); - }); - }; - - var utcMinute = newInterval(function (date) { - date.setUTCSeconds(0, 0); - }, function (date, step) { - date.setTime(+date + step * durationMinute); - }, function (start, end) { - return (end - start) / durationMinute; - }, function (date) { - return date.getUTCMinutes(); - }); - - var utcHour = newInterval(function (date) { - date.setUTCMinutes(0, 0, 0); - }, function (date, step) { - date.setTime(+date + step * durationHour); - }, function (start, end) { - return (end - start) / durationHour; - }, function (date) { - return date.getUTCHours(); - }); - - var utcDay = newInterval(function (date) { - date.setUTCHours(0, 0, 0, 0); - }, function (date, step) { - date.setUTCDate(date.getUTCDate() + step); - }, function (start, end) { - return (end - start) / durationDay; - }, function (date) { - return date.getUTCDate() - 1; - }); - - function utcWeekday(i) { - return newInterval(function (date) { - date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7); - date.setUTCHours(0, 0, 0, 0); - }, function (date, step) { - date.setUTCDate(date.getUTCDate() + step * 7); - }, function (start, end) { - return (end - start) / durationWeek; - }); - } - - var utcSunday = utcWeekday(0); - var utcMonday = utcWeekday(1); - var utcTuesday = utcWeekday(2); - var utcWednesday = utcWeekday(3); - var utcThursday = utcWeekday(4); - var utcFriday = utcWeekday(5); - var utcSaturday = utcWeekday(6); - - var utcMonth = newInterval(function (date) { - date.setUTCDate(1); - date.setUTCHours(0, 0, 0, 0); - }, function (date, step) { - date.setUTCMonth(date.getUTCMonth() + step); - }, function (start, end) { - return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; - }, function (date) { - return date.getUTCMonth(); - }); - - var utcYear = newInterval(function (date) { - date.setUTCMonth(0, 1); - date.setUTCHours(0, 0, 0, 0); - }, function (date, step) { - date.setUTCFullYear(date.getUTCFullYear() + step); - }, function (start, end) { - return end.getUTCFullYear() - start.getUTCFullYear(); - }, function (date) { - return date.getUTCFullYear(); - }); // An optimized implementation for this simple case. - - utcYear.every = function (k) { - return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function (date) { - date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k); - date.setUTCMonth(0, 1); - date.setUTCHours(0, 0, 0, 0); - }, function (date, step) { - date.setUTCFullYear(date.getUTCFullYear() + step * k); - }); - }; - - function localDate(d) { - if (0 <= d.y && d.y < 100) { - var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); - date.setFullYear(d.y); - return date; - } - - return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); - } - - function utcDate(d) { - if (0 <= d.y && d.y < 100) { - var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); - date.setUTCFullYear(d.y); - return date; - } - - return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); - } - - function newYear(y) { - return { - y: y, - m: 0, - d: 1, - H: 0, - M: 0, - S: 0, - L: 0 - }; - } - - function formatLocale$1(locale) { - var locale_dateTime = locale.dateTime, - locale_date = locale.date, - locale_time = locale.time, - locale_periods = locale.periods, - locale_weekdays = locale.days, - locale_shortWeekdays = locale.shortDays, - locale_months = locale.months, - locale_shortMonths = locale.shortMonths; - var periodRe = formatRe(locale_periods), - periodLookup = formatLookup(locale_periods), - weekdayRe = formatRe(locale_weekdays), - weekdayLookup = formatLookup(locale_weekdays), - shortWeekdayRe = formatRe(locale_shortWeekdays), - shortWeekdayLookup = formatLookup(locale_shortWeekdays), - monthRe = formatRe(locale_months), - monthLookup = formatLookup(locale_months), - shortMonthRe = formatRe(locale_shortMonths), - shortMonthLookup = formatLookup(locale_shortMonths); - var formats = { - "a": formatShortWeekday, - "A": formatWeekday, - "b": formatShortMonth, - "B": formatMonth, - "c": null, - "d": formatDayOfMonth, - "e": formatDayOfMonth, - "f": formatMicroseconds, - "H": formatHour24, - "I": formatHour12, - "j": formatDayOfYear, - "L": formatMilliseconds, - "m": formatMonthNumber, - "M": formatMinutes, - "p": formatPeriod, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatSeconds, - "u": formatWeekdayNumberMonday, - "U": formatWeekNumberSunday, - "V": formatWeekNumberISO, - "w": formatWeekdayNumberSunday, - "W": formatWeekNumberMonday, - "x": null, - "X": null, - "y": formatYear, - "Y": formatFullYear, - "Z": formatZone, - "%": formatLiteralPercent - }; - var utcFormats = { - "a": formatUTCShortWeekday, - "A": formatUTCWeekday, - "b": formatUTCShortMonth, - "B": formatUTCMonth, - "c": null, - "d": formatUTCDayOfMonth, - "e": formatUTCDayOfMonth, - "f": formatUTCMicroseconds, - "H": formatUTCHour24, - "I": formatUTCHour12, - "j": formatUTCDayOfYear, - "L": formatUTCMilliseconds, - "m": formatUTCMonthNumber, - "M": formatUTCMinutes, - "p": formatUTCPeriod, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatUTCSeconds, - "u": formatUTCWeekdayNumberMonday, - "U": formatUTCWeekNumberSunday, - "V": formatUTCWeekNumberISO, - "w": formatUTCWeekdayNumberSunday, - "W": formatUTCWeekNumberMonday, - "x": null, - "X": null, - "y": formatUTCYear, - "Y": formatUTCFullYear, - "Z": formatUTCZone, - "%": formatLiteralPercent - }; - var parses = { - "a": parseShortWeekday, - "A": parseWeekday, - "b": parseShortMonth, - "B": parseMonth, - "c": parseLocaleDateTime, - "d": parseDayOfMonth, - "e": parseDayOfMonth, - "f": parseMicroseconds, - "H": parseHour24, - "I": parseHour24, - "j": parseDayOfYear, - "L": parseMilliseconds, - "m": parseMonthNumber, - "M": parseMinutes, - "p": parsePeriod, - "Q": parseUnixTimestamp, - "s": parseUnixTimestampSeconds, - "S": parseSeconds, - "u": parseWeekdayNumberMonday, - "U": parseWeekNumberSunday, - "V": parseWeekNumberISO, - "w": parseWeekdayNumberSunday, - "W": parseWeekNumberMonday, - "x": parseLocaleDate, - "X": parseLocaleTime, - "y": parseYear, - "Y": parseFullYear, - "Z": parseZone, - "%": parseLiteralPercent - }; // These recursive directive definitions must be deferred. - - formats.x = newFormat(locale_date, formats); - formats.X = newFormat(locale_time, formats); - formats.c = newFormat(locale_dateTime, formats); - utcFormats.x = newFormat(locale_date, utcFormats); - utcFormats.X = newFormat(locale_time, utcFormats); - utcFormats.c = newFormat(locale_dateTime, utcFormats); - - function newFormat(specifier, formats) { - return function (date) { - var string = [], - i = -1, - j = 0, - n = specifier.length, - c, - pad, - format; - if (!(date instanceof Date)) date = new Date(+date); - - while (++i < n) { - if (specifier.charCodeAt(i) === 37) { - string.push(specifier.slice(j, i)); - if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);else pad = c === "e" ? " " : "0"; - if (format = formats[c]) c = format(date, pad); - string.push(c); - j = i + 1; - } - } - - string.push(specifier.slice(j, i)); - return string.join(""); - }; - } - - function newParse(specifier, newDate) { - return function (string) { - var d = newYear(1900), - i = parseSpecifier(d, specifier, string += "", 0), - week, - day$1; - if (i != string.length) return null; // If a UNIX timestamp is specified, return it. - - if ("Q" in d) return new Date(d.Q); // The am-pm flag is 0 for AM, and 1 for PM. - - if ("p" in d) d.H = d.H % 12 + d.p * 12; // Convert day-of-week and week-of-year to day-of-year. - - if ("V" in d) { - if (d.V < 1 || d.V > 53) return null; - if (!("w" in d)) d.w = 1; - - if ("Z" in d) { - week = utcDate(newYear(d.y)), day$1 = week.getUTCDay(); - week = day$1 > 4 || day$1 === 0 ? utcMonday.ceil(week) : utcMonday(week); - week = utcDay.offset(week, (d.V - 1) * 7); - d.y = week.getUTCFullYear(); - d.m = week.getUTCMonth(); - d.d = week.getUTCDate() + (d.w + 6) % 7; - } else { - week = newDate(newYear(d.y)), day$1 = week.getDay(); - week = day$1 > 4 || day$1 === 0 ? monday.ceil(week) : monday(week); - week = day.offset(week, (d.V - 1) * 7); - d.y = week.getFullYear(); - d.m = week.getMonth(); - d.d = week.getDate() + (d.w + 6) % 7; - } - } else if ("W" in d || "U" in d) { - if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; - day$1 = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay(); - d.m = 0; - d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day$1 + 5) % 7 : d.w + d.U * 7 - (day$1 + 6) % 7; - } // If a time zone is specified, all fields are interpreted as UTC and then - // offset according to the specified time zone. - - - if ("Z" in d) { - d.H += d.Z / 100 | 0; - d.M += d.Z % 100; - return utcDate(d); - } // Otherwise, all fields are in local time. - - - return newDate(d); - }; - } - - function parseSpecifier(d, specifier, string, j) { - var i = 0, - n = specifier.length, - m = string.length, - c, - parse; - - while (i < n) { - if (j >= m) return -1; - c = specifier.charCodeAt(i++); - - if (c === 37) { - c = specifier.charAt(i++); - parse = parses[c in pads ? specifier.charAt(i++) : c]; - if (!parse || (j = parse(d, string, j)) < 0) return -1; - } else if (c != string.charCodeAt(j++)) { - return -1; - } - } - - return j; - } - - function parsePeriod(d, string, i) { - var n = periodRe.exec(string.slice(i)); - return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } - - function parseShortWeekday(d, string, i) { - var n = shortWeekdayRe.exec(string.slice(i)); - return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } - - function parseWeekday(d, string, i) { - var n = weekdayRe.exec(string.slice(i)); - return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } - - function parseShortMonth(d, string, i) { - var n = shortMonthRe.exec(string.slice(i)); - return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } - - function parseMonth(d, string, i) { - var n = monthRe.exec(string.slice(i)); - return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1; - } - - function parseLocaleDateTime(d, string, i) { - return parseSpecifier(d, locale_dateTime, string, i); - } - - function parseLocaleDate(d, string, i) { - return parseSpecifier(d, locale_date, string, i); - } - - function parseLocaleTime(d, string, i) { - return parseSpecifier(d, locale_time, string, i); - } - - function formatShortWeekday(d) { - return locale_shortWeekdays[d.getDay()]; - } - - function formatWeekday(d) { - return locale_weekdays[d.getDay()]; - } - - function formatShortMonth(d) { - return locale_shortMonths[d.getMonth()]; - } - - function formatMonth(d) { - return locale_months[d.getMonth()]; - } - - function formatPeriod(d) { - return locale_periods[+(d.getHours() >= 12)]; - } - - function formatUTCShortWeekday(d) { - return locale_shortWeekdays[d.getUTCDay()]; - } - - function formatUTCWeekday(d) { - return locale_weekdays[d.getUTCDay()]; - } - - function formatUTCShortMonth(d) { - return locale_shortMonths[d.getUTCMonth()]; - } - - function formatUTCMonth(d) { - return locale_months[d.getUTCMonth()]; - } - - function formatUTCPeriod(d) { - return locale_periods[+(d.getUTCHours() >= 12)]; - } - - return { - format: function format(specifier) { - var f = newFormat(specifier += "", formats); - - f.toString = function () { - return specifier; - }; - - return f; - }, - parse: function parse(specifier) { - var p = newParse(specifier += "", localDate); - - p.toString = function () { - return specifier; - }; - - return p; - }, - utcFormat: function utcFormat(specifier) { - var f = newFormat(specifier += "", utcFormats); - - f.toString = function () { - return specifier; - }; - - return f; - }, - utcParse: function utcParse(specifier) { - var p = newParse(specifier, utcDate); - - p.toString = function () { - return specifier; - }; - - return p; - } - }; - } - var pads = { - "-": "", - "_": " ", - "0": "0" - }, - numberRe = /^\s*\d+/, - // note: ignores next directive - percentRe = /^%/, - requoteRe = /[\\^$*+?|[\]().{}]/g; - - function pad(value, fill, width) { - var sign = value < 0 ? "-" : "", - string = (sign ? -value : value) + "", - length = string.length; - return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); - } - - function requote(s) { - return s.replace(requoteRe, "\\$&"); - } - - function formatRe(names) { - return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); - } - - function formatLookup(names) { - var map = {}, - i = -1, - n = names.length; - - while (++i < n) { - map[names[i].toLowerCase()] = i; - } - - return map; - } - - function parseWeekdayNumberSunday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 1)); - return n ? (d.w = +n[0], i + n[0].length) : -1; - } - - function parseWeekdayNumberMonday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 1)); - return n ? (d.u = +n[0], i + n[0].length) : -1; - } - - function parseWeekNumberSunday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.U = +n[0], i + n[0].length) : -1; - } - - function parseWeekNumberISO(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.V = +n[0], i + n[0].length) : -1; - } - - function parseWeekNumberMonday(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.W = +n[0], i + n[0].length) : -1; - } - - function parseFullYear(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 4)); - return n ? (d.y = +n[0], i + n[0].length) : -1; - } - - function parseYear(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1; - } - - function parseZone(d, string, i) { - var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6)); - return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; - } - - function parseMonthNumber(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.m = n[0] - 1, i + n[0].length) : -1; - } - - function parseDayOfMonth(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.d = +n[0], i + n[0].length) : -1; - } - - function parseDayOfYear(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 3)); - return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; - } - - function parseHour24(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.H = +n[0], i + n[0].length) : -1; - } - - function parseMinutes(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.M = +n[0], i + n[0].length) : -1; - } - - function parseSeconds(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 2)); - return n ? (d.S = +n[0], i + n[0].length) : -1; - } - - function parseMilliseconds(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 3)); - return n ? (d.L = +n[0], i + n[0].length) : -1; - } - - function parseMicroseconds(d, string, i) { - var n = numberRe.exec(string.slice(i, i + 6)); - return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1; - } - - function parseLiteralPercent(d, string, i) { - var n = percentRe.exec(string.slice(i, i + 1)); - return n ? i + n[0].length : -1; - } - - function parseUnixTimestamp(d, string, i) { - var n = numberRe.exec(string.slice(i)); - return n ? (d.Q = +n[0], i + n[0].length) : -1; - } - - function parseUnixTimestampSeconds(d, string, i) { - var n = numberRe.exec(string.slice(i)); - return n ? (d.Q = +n[0] * 1000, i + n[0].length) : -1; - } - - function formatDayOfMonth(d, p) { - return pad(d.getDate(), p, 2); - } - - function formatHour24(d, p) { - return pad(d.getHours(), p, 2); - } - - function formatHour12(d, p) { - return pad(d.getHours() % 12 || 12, p, 2); - } - - function formatDayOfYear(d, p) { - return pad(1 + day.count(year(d), d), p, 3); - } - - function formatMilliseconds(d, p) { - return pad(d.getMilliseconds(), p, 3); - } - - function formatMicroseconds(d, p) { - return formatMilliseconds(d, p) + "000"; - } - - function formatMonthNumber(d, p) { - return pad(d.getMonth() + 1, p, 2); - } - - function formatMinutes(d, p) { - return pad(d.getMinutes(), p, 2); - } - - function formatSeconds(d, p) { - return pad(d.getSeconds(), p, 2); - } - - function formatWeekdayNumberMonday(d) { - var day = d.getDay(); - return day === 0 ? 7 : day; - } - - function formatWeekNumberSunday(d, p) { - return pad(sunday.count(year(d), d), p, 2); - } - - function formatWeekNumberISO(d, p) { - var day = d.getDay(); - d = day >= 4 || day === 0 ? thursday(d) : thursday.ceil(d); - return pad(thursday.count(year(d), d) + (year(d).getDay() === 4), p, 2); - } - - function formatWeekdayNumberSunday(d) { - return d.getDay(); - } - - function formatWeekNumberMonday(d, p) { - return pad(monday.count(year(d), d), p, 2); - } - - function formatYear(d, p) { - return pad(d.getFullYear() % 100, p, 2); - } - - function formatFullYear(d, p) { - return pad(d.getFullYear() % 10000, p, 4); - } - - function formatZone(d) { - var z = d.getTimezoneOffset(); - return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2); - } - - function formatUTCDayOfMonth(d, p) { - return pad(d.getUTCDate(), p, 2); - } - - function formatUTCHour24(d, p) { - return pad(d.getUTCHours(), p, 2); - } - - function formatUTCHour12(d, p) { - return pad(d.getUTCHours() % 12 || 12, p, 2); - } - - function formatUTCDayOfYear(d, p) { - return pad(1 + utcDay.count(utcYear(d), d), p, 3); - } - - function formatUTCMilliseconds(d, p) { - return pad(d.getUTCMilliseconds(), p, 3); - } - - function formatUTCMicroseconds(d, p) { - return formatUTCMilliseconds(d, p) + "000"; - } - - function formatUTCMonthNumber(d, p) { - return pad(d.getUTCMonth() + 1, p, 2); - } - - function formatUTCMinutes(d, p) { - return pad(d.getUTCMinutes(), p, 2); - } - - function formatUTCSeconds(d, p) { - return pad(d.getUTCSeconds(), p, 2); - } - - function formatUTCWeekdayNumberMonday(d) { - var dow = d.getUTCDay(); - return dow === 0 ? 7 : dow; - } - - function formatUTCWeekNumberSunday(d, p) { - return pad(utcSunday.count(utcYear(d), d), p, 2); - } - - function formatUTCWeekNumberISO(d, p) { - var day = d.getUTCDay(); - d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); - return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2); - } - - function formatUTCWeekdayNumberSunday(d) { - return d.getUTCDay(); - } - - function formatUTCWeekNumberMonday(d, p) { - return pad(utcMonday.count(utcYear(d), d), p, 2); - } - - function formatUTCYear(d, p) { - return pad(d.getUTCFullYear() % 100, p, 2); - } - - function formatUTCFullYear(d, p) { - return pad(d.getUTCFullYear() % 10000, p, 4); - } - - function formatUTCZone() { - return "+0000"; - } - - function formatLiteralPercent() { - return "%"; - } - - function formatUnixTimestamp(d) { - return +d; - } - - function formatUnixTimestampSeconds(d) { - return Math.floor(+d / 1000); - } - - var locale$1; - var timeFormat; - var timeParse; - var utcFormat; - var utcParse; - defaultLocale$1({ - dateTime: "%x, %X", - date: "%-m/%-d/%Y", - time: "%-I:%M:%S %p", - periods: ["AM", "PM"], - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] - }); - function defaultLocale$1(definition) { - locale$1 = formatLocale$1(definition); - timeFormat = locale$1.format; - timeParse = locale$1.parse; - utcFormat = locale$1.utcFormat; - utcParse = locale$1.utcParse; - return locale$1; - } - - var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ"; - - function formatIsoNative(date) { - return date.toISOString(); - } - - var formatIso = Date.prototype.toISOString ? formatIsoNative : utcFormat(isoSpecifier); - - function parseIsoNative(string) { - var date = new Date(string); - return isNaN(date) ? null : date; - } - - var parseIso = +new Date("2000-01-01T00:00:00.000Z") ? parseIsoNative : utcParse(isoSpecifier); - - var durationSecond$1 = 1000, - durationMinute$1 = durationSecond$1 * 60, - durationHour$1 = durationMinute$1 * 60, - durationDay$1 = durationHour$1 * 24, - durationWeek$1 = durationDay$1 * 7, - durationMonth = durationDay$1 * 30, - durationYear = durationDay$1 * 365; - - function date$1(t) { - return new Date(t); - } - - function number$2(t) { - return t instanceof Date ? +t : +new Date(+t); - } - - function calendar(year, month, week, day, hour, minute, second, millisecond, format) { - var scale = continuous(identity$2, identity$2), - invert = scale.invert, - domain = scale.domain; - var formatMillisecond = format(".%L"), - formatSecond = format(":%S"), - formatMinute = format("%I:%M"), - formatHour = format("%I %p"), - formatDay = format("%a %d"), - formatWeek = format("%b %d"), - formatMonth = format("%B"), - formatYear = format("%Y"); - var tickIntervals = [[second, 1, durationSecond$1], [second, 5, 5 * durationSecond$1], [second, 15, 15 * durationSecond$1], [second, 30, 30 * durationSecond$1], [minute, 1, durationMinute$1], [minute, 5, 5 * durationMinute$1], [minute, 15, 15 * durationMinute$1], [minute, 30, 30 * durationMinute$1], [hour, 1, durationHour$1], [hour, 3, 3 * durationHour$1], [hour, 6, 6 * durationHour$1], [hour, 12, 12 * durationHour$1], [day, 1, durationDay$1], [day, 2, 2 * durationDay$1], [week, 1, durationWeek$1], [month, 1, durationMonth], [month, 3, 3 * durationMonth], [year, 1, durationYear]]; - - function tickFormat(date) { - return (second(date) < date ? formatMillisecond : minute(date) < date ? formatSecond : hour(date) < date ? formatMinute : day(date) < date ? formatHour : month(date) < date ? week(date) < date ? formatDay : formatWeek : year(date) < date ? formatMonth : formatYear)(date); - } - - function tickInterval(interval, start, stop, step) { - if (interval == null) interval = 10; // If a desired tick count is specified, pick a reasonable tick interval - // based on the extent of the domain and a rough estimate of tick size. - // Otherwise, assume interval is already a time interval and use it. - - if (typeof interval === "number") { - var target = Math.abs(stop - start) / interval, - i = bisector(function (i) { - return i[2]; - }).right(tickIntervals, target); - - if (i === tickIntervals.length) { - step = tickStep(start / durationYear, stop / durationYear, interval); - interval = year; - } else if (i) { - i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i]; - step = i[1]; - interval = i[0]; - } else { - step = Math.max(tickStep(start, stop, interval), 1); - interval = millisecond; - } - } - - return step == null ? interval : interval.every(step); - } - - scale.invert = function (y) { - return new Date(invert(y)); - }; - - scale.domain = function (_) { - return arguments.length ? domain(map$1.call(_, number$2)) : domain().map(date$1); - }; - - scale.ticks = function (interval, step) { - var d = domain(), - t0 = d[0], - t1 = d[d.length - 1], - r = t1 < t0, - t; - if (r) t = t0, t0 = t1, t1 = t; - t = tickInterval(interval, t0, t1, step); - t = t ? t.range(t0, t1 + 1) : []; // inclusive stop - - return r ? t.reverse() : t; - }; - - scale.tickFormat = function (count, specifier) { - return specifier == null ? tickFormat : format(specifier); - }; - - scale.nice = function (interval, step) { - var d = domain(); - return (interval = tickInterval(interval, d[0], d[d.length - 1], step)) ? domain(nice(d, interval)) : scale; - }; - - scale.copy = function () { - return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format)); - }; - - return scale; - } - function scaleTime () { - return initRange.apply(calendar(year, month, sunday, day, hour, minute, second, millisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments); - } - - function utcTime () { - return initRange.apply(calendar(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, millisecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments); - } - - function transformer$1() { - var x0 = 0, - x1 = 1, - t0, - t1, - k10, - transform, - interpolator = identity$2, - clamp = false, - unknown; - - function scale(x) { - return isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x)); - } - - scale.domain = function (_) { - return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1]; - }; - - scale.clamp = function (_) { - return arguments.length ? (clamp = !!_, scale) : clamp; - }; - - scale.interpolator = function (_) { - return arguments.length ? (interpolator = _, scale) : interpolator; - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - return function (t) { - transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0); - return scale; - }; - } - - function copy$1(source, target) { - return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown()); - } - function sequential() { - var scale = linearish(transformer$1()(identity$2)); - - scale.copy = function () { - return copy$1(scale, sequential()); - }; - - return initInterpolator.apply(scale, arguments); - } - function sequentialLog() { - var scale = loggish(transformer$1()).domain([1, 10]); - - scale.copy = function () { - return copy$1(scale, sequentialLog()).base(scale.base()); - }; - - return initInterpolator.apply(scale, arguments); - } - function sequentialSymlog() { - var scale = symlogish(transformer$1()); - - scale.copy = function () { - return copy$1(scale, sequentialSymlog()).constant(scale.constant()); - }; - - return initInterpolator.apply(scale, arguments); - } - function sequentialPow() { - var scale = powish(transformer$1()); - - scale.copy = function () { - return copy$1(scale, sequentialPow()).exponent(scale.exponent()); - }; - - return initInterpolator.apply(scale, arguments); - } - function sequentialSqrt() { - return sequentialPow.apply(null, arguments).exponent(0.5); - } - - function sequentialQuantile() { - var domain = [], - interpolator = identity$2; - - function scale(x) { - if (!isNaN(x = +x)) return interpolator((bisectRight(domain, x) - 1) / (domain.length - 1)); - } - - scale.domain = function (_) { - if (!arguments.length) return domain.slice(); - domain = []; - - for (var i = 0, n = _.length, d; i < n; ++i) { - if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); - } - - domain.sort(ascending); - return scale; - }; - - scale.interpolator = function (_) { - return arguments.length ? (interpolator = _, scale) : interpolator; - }; - - scale.copy = function () { - return sequentialQuantile(interpolator).domain(domain); - }; - - return initInterpolator.apply(scale, arguments); - } - - function transformer$2() { - var x0 = 0, - x1 = 0.5, - x2 = 1, - t0, - t1, - t2, - k10, - k21, - interpolator = identity$2, - transform, - clamp = false, - unknown; - - function scale(x) { - return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (x < t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x)); - } - - scale.domain = function (_) { - return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), t2 = transform(x2 = +_[2]), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2]; - }; - - scale.clamp = function (_) { - return arguments.length ? (clamp = !!_, scale) : clamp; - }; - - scale.interpolator = function (_) { - return arguments.length ? (interpolator = _, scale) : interpolator; - }; - - scale.unknown = function (_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - return function (t) { - transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1); - return scale; - }; - } - - function diverging$1() { - var scale = linearish(transformer$2()(identity$2)); - - scale.copy = function () { - return copy$1(scale, diverging$1()); - }; - - return initInterpolator.apply(scale, arguments); - } - function divergingLog() { - var scale = loggish(transformer$2()).domain([0.1, 1, 10]); - - scale.copy = function () { - return copy$1(scale, divergingLog()).base(scale.base()); - }; - - return initInterpolator.apply(scale, arguments); - } - function divergingSymlog() { - var scale = symlogish(transformer$2()); - - scale.copy = function () { - return copy$1(scale, divergingSymlog()).constant(scale.constant()); - }; - - return initInterpolator.apply(scale, arguments); - } - function divergingPow() { - var scale = powish(transformer$2()); - - scale.copy = function () { - return copy$1(scale, divergingPow()).exponent(scale.exponent()); - }; - - return initInterpolator.apply(scale, arguments); - } - function divergingSqrt() { - return divergingPow.apply(null, arguments).exponent(0.5); - } - - - - var scales = /*#__PURE__*/Object.freeze({ - __proto__: null, - scaleBand: band, - scalePoint: point$1, - scaleIdentity: identity$4, - scaleLinear: linear$1, - scaleLog: log, - scaleSymlog: symlog, - scaleOrdinal: ordinal, - scaleImplicit: implicit, - scalePow: pow, - scaleSqrt: sqrt$1, - scaleQuantile: quantile$1, - scaleQuantize: quantize, - scaleThreshold: threshold, - scaleTime: scaleTime, - scaleUtc: utcTime, - scaleSequential: sequential, - scaleSequentialLog: sequentialLog, - scaleSequentialPow: sequentialPow, - scaleSequentialSqrt: sequentialSqrt, - scaleSequentialSymlog: sequentialSymlog, - scaleSequentialQuantile: sequentialQuantile, - scaleDiverging: diverging$1, - scaleDivergingLog: divergingLog, - scaleDivergingPow: divergingPow, - scaleDivergingSqrt: divergingSqrt, - scaleDivergingSymlog: divergingSymlog, - tickFormat: tickFormat - }); - - /** - @namespace {Object} colorDefaults - @desc A set of default color values used when assigning colors based on data. - * - * | Name | Default | Description | - * |---|---|---| - * | dark | #444444 | Used in the [contrast](#contrast) function when the color given is very light. | - * | light | #f7f7f7 | Used in the [contrast](#contrast) function when the color given is very dark. | - * | missing | #cccccc | Used in the [assign](#assign) function when the value passed is `null` or `undefined`. | - * | off | #b22200 | Used in the [assign](#assign) function when the value passed is `false`. | - * | on | #224f20 | Used in the [assign](#assign) function when the value passed is `true`. | - * | scale | #b22200, #eace3f, #282f6b, #b35c1e, #224f20, #5f487c, #759143, #419391, #993c88, #e89c89, #ffee8d, #afd5e8, #f7ba77, #a5c697, #c5b5e5, #d1d392, #bbefd0, #e099cf | An ordinal scale used in the [assign](#assign) function for non-valid color strings and numbers. | - */ - - var defaults = { - dark: "#444444", - light: "#f7f7f7", - missing: "#cccccc", - off: "#b22200", - on: "#224f20", - scale: ordinal().range(["#b22200", "#282f6b", "#eace3f", "#b35c1e", "#224f20", "#5f487c", "#759143", "#419391", "#993c88", "#e89c89", "#ffee8d", "#afd5e8", "#f7ba77", "#a5c697", "#c5b5e5", "#d1d392", "#bbefd0", "#e099cf"]) - }; - /** - Returns a color based on a key, whether it is present in a user supplied object or in the default object. - @returns {String} - @private - */ - - function getColor(k) { - var u = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return k in u ? u[k] : k in defaults ? defaults[k] : defaults.missing; - } - - /** - @function colorAssign - @desc Assigns a color to a value using a predefined set of defaults. - @param {String} c A valid CSS color string. - @param {Object} [u = defaults] An object containing overrides of the default colors. - @returns {String} - */ - - function colorAssign (c) { - var u = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // If the value is null or undefined, set to grey. - - if ([null, void 0].indexOf(c) >= 0) return getColor("missing", u); // Else if the value is true, set to green. - else if (c === true) return getColor("on", u); // Else if the value is false, set to red. - else if (c === false) return getColor("off", u); - var p = color$2(c); // If the value is not a valid color string, use the color scale. - - if (!p) return getColor("scale", u)(c); - return c.toString(); - } - - /** - @function colorContrast - @desc A set of default color values used when assigning colors based on data. - @param {String} c A valid CSS color string. - @param {Object} [u = defaults] An object containing overrides of the default colors. - @returns {String} - */ - - function colorContrast (c) { - var u = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - c = rgb$2(c); - var yiq = (c.r * 299 + c.g * 587 + c.b * 114) / 1000; - return yiq >= 128 ? getColor("dark", u) : getColor("light", u); - } - - /** - @function colorLighter - @desc Similar to d3.color.brighter, except that this also reduces saturation so that colors don't appear neon. - @param {String} c A valid CSS color string. - @param {String} [i = 0.5] A value from 0 to 1 dictating the strength of the function. - @returns {String} - */ - - function colorLighter (c) { - var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5; - c = hsl$2(c); - i *= 1 - c.l; - c.l += i; - c.s -= i; - return c.toString(); - } - - /** - * Strips HTML and "un-escapes" escape characters. - * @param {String} input - */ - function htmlDecode(input) { - if (input.replace(/\s+/g, "") === "") return input; - var doc = new DOMParser().parseFromString(input.replace(/<[^>]+>/g, ""), "text/html"); - return doc.documentElement ? doc.documentElement.textContent : input; - } - /** - @function textWidth - @desc Given a text string, returns the predicted pixel width of the string when placed into DOM. - @param {String|Array} text Can be either a single string or an array of strings to analyze. - @param {Object} [style] An object of CSS font styles to apply. Accepts any of the valid [CSS font property](http://www.w3schools.com/cssref/pr_font_font.asp) values. - */ - - - function textWidth (text, style) { - style = Object.assign({ - "font-size": 10, - "font-family": "sans-serif", - "font-style": "normal", - "font-weight": 400, - "font-variant": "normal" - }, style); - var context = document.createElement("canvas").getContext("2d"); - var font = []; - font.push(style["font-style"]); - font.push(style["font-variant"]); - font.push(style["font-weight"]); - font.push(typeof style["font-size"] === "string" ? style["font-size"] : "".concat(style["font-size"], "px")); - font.push(style["font-family"]); - context.font = font.join(" "); - if (text instanceof Array) return text.map(function (t) { - return context.measureText(htmlDecode(t)).width; - }); - return context.measureText(htmlDecode(text)).width; - } - - /** - @function trim - @desc Cross-browser implementation of [trim](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim). - @param {String} str - */ - function trim(str) { - return str.toString().replace(/^\s+|\s+$/g, ""); - } - /** - @function trimRight - @desc Cross-browser implementation of [trimRight](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/TrimRight). - @param {String} str - */ - - - function trimRight(str) { - return str.toString().replace(/\s+$/, ""); - } - - var alpha = "abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890", - checked = {}, - height = 32; - var dejavu, macos, monospace, proportional; - /** - @function fontExists - @desc Given either a single font-family or a list of fonts, returns the name of the first font that can be rendered, or `false` if none are installed on the user's machine. - @param {String|Array} font Can be either a valid CSS font-family string (single or comma-separated names) or an Array of string names. - */ - - var fontExists = function fontExists(font) { - if (!dejavu) { - dejavu = textWidth(alpha, { - "font-family": "DejaVuSans", - "font-size": height - }); - macos = textWidth(alpha, { - "font-family": "-apple-system", - "font-size": height - }); - monospace = textWidth(alpha, { - "font-family": "monospace", - "font-size": height - }); - proportional = textWidth(alpha, { - "font-family": "sans-serif", - "font-size": height - }); - } - - if (!(font instanceof Array)) font = font.split(","); - font = font.map(function (f) { - return trim(f); - }); - - for (var i = 0; i < font.length; i++) { - var fam = font[i]; - if (checked[fam] || ["-apple-system", "monospace", "sans-serif", "DejaVuSans"].includes(fam)) return fam;else if (checked[fam] === false) continue; - var width = textWidth(alpha, { - "font-family": fam, - "font-size": height - }); - checked[fam] = width !== monospace; - if (checked[fam]) checked[fam] = width !== proportional; - if (macos && checked[fam]) checked[fam] = width !== macos; - if (dejavu && checked[fam]) checked[fam] = width !== dejavu; - if (checked[fam]) return fam; - } - - return false; - }; - - /** - @function rtl - @desc Returns `true` if the HTML or body element has either the "dir" HTML attribute or the "direction" CSS property set to "rtl". - */ - - var detectRTL = (function () { - return _select("html").attr("dir") === "rtl" || _select("body").attr("dir") === "rtl" || _select("html").style("direction") === "rtl" || _select("body").style("direction") === "rtl"; - }); - - /** - @function stringify - @desc Coerces value into a String. - @param {String} value - */ - function stringify (value) { - if (value === void 0) value = "undefined";else if (!(typeof value === "string" || value instanceof String)) value = JSON.stringify(value); - return value; - } - - // great unicode list: http://asecuritysite.com/coding/asc2 - var diacritics = [[/[\300-\305]/g, "A"], [/[\340-\345]/g, "a"], [/[\306]/g, "AE"], [/[\346]/g, "ae"], [/[\337]/g, "B"], [/[\307]/g, "C"], [/[\347]/g, "c"], [/[\320\336\376]/g, "D"], [/[\360]/g, "d"], [/[\310-\313]/g, "E"], [/[\350-\353]/g, "e"], [/[\314-\317]/g, "I"], [/[\354-\357]/g, "i"], [/[\321]/g, "N"], [/[\361]/g, "n"], [/[\u014c\322-\326\330]/g, "O"], [/[\u014d\362-\366\370]/g, "o"], [/[\u016a\331-\334]/g, "U"], [/[\u016b\371-\374]/g, "u"], [/[\327]/g, "x"], [/[\335]/g, "Y"], [/[\375\377]/g, "y"]]; - /** - @function strip - @desc Removes all non ASCII characters from a string. - @param {String} value - */ - - function strip (value) { - return "".concat(value).replace(/[^A-Za-z0-9\-_]/g, function (_char) { - if (_char === " ") return "-"; - var ret = false; - - for (var d = 0; d < diacritics.length; d++) { - if (new RegExp(diacritics[d][0]).test(_char)) { - ret = diacritics[d][1]; - break; - } - } - - return ret || ""; - }); - } - - // scraped from http://www.fileformat.info/info/unicode/category/Mc/list.htm - // and http://www.fileformat.info/info/unicode/category/Mn/list.htm - // JSON.stringify([].slice.call(document.getElementsByClassName("table-list")[0].getElementsByTagName("tr")).filter(function(d){ return d.getElementsByTagName("a").length && d.getElementsByTagName("a")[0].innerHTML.length === 6; }).map(function(d){ return d.getElementsByTagName("a")[0].innerHTML.replace("U", "u").replace("+", ""); }).sort()); - // The following unicode characters combine to form new characters and should never be split from surrounding characters. - var a$1 = ["u0903", "u093B", "u093E", "u093F", "u0940", "u0949", "u094A", "u094B", "u094C", "u094E", "u094F", "u0982", "u0983", "u09BE", "u09BF", "u09C0", "u09C7", "u09C8", "u09CB", "u09CC", "u09D7", "u0A03", "u0A3E", "u0A3F", "u0A40", "u0A83", "u0ABE", "u0ABF", "u0AC0", "u0AC9", "u0ACB", "u0ACC", "u0B02", "u0B03", "u0B3E", "u0B40", "u0B47", "u0B48", "u0B4B", "u0B4C", "u0B57", "u0BBE", "u0BBF", "u0BC1", "u0BC2", "u0BC6", "u0BC7", "u0BC8", "u0BCA", "u0BCB", "u0BCC", "u0BD7", "u0C01", "u0C02", "u0C03", "u0C41", "u0C42", "u0C43", "u0C44", "u0C82", "u0C83", "u0CBE", "u0CC0", "u0CC1", "u0CC2", "u0CC3", "u0CC4", "u0CC7", "u0CC8", "u0CCA", "u0CCB", "u0CD5", "u0CD6", "u0D02", "u0D03", "u0D3E", "u0D3F", "u0D40", "u0D46", "u0D47", "u0D48", "u0D4A", "u0D4B", "u0D4C", "u0D57", "u0D82", "u0D83", "u0DCF", "u0DD0", "u0DD1", "u0DD8", "u0DD9", "u0DDA", "u0DDB", "u0DDC", "u0DDD", "u0DDE", "u0DDF", "u0DF2", "u0DF3", "u0F3E", "u0F3F", "u0F7F", "u102B", "u102C", "u1031", "u1038", "u103B", "u103C", "u1056", "u1057", "u1062", "u1063", "u1064", "u1067", "u1068", "u1069", "u106A", "u106B", "u106C", "u106D", "u1083", "u1084", "u1087", "u1088", "u1089", "u108A", "u108B", "u108C", "u108F", "u109A", "u109B", "u109C", "u17B6", "u17BE", "u17BF", "u17C0", "u17C1", "u17C2", "u17C3", "u17C4", "u17C5", "u17C7", "u17C8", "u1923", "u1924", "u1925", "u1926", "u1929", "u192A", "u192B", "u1930", "u1931", "u1933", "u1934", "u1935", "u1936", "u1937", "u1938", "u1A19", "u1A1A", "u1A55", "u1A57", "u1A61", "u1A63", "u1A64", "u1A6D", "u1A6E", "u1A6F", "u1A70", "u1A71", "u1A72", "u1B04", "u1B35", "u1B3B", "u1B3D", "u1B3E", "u1B3F", "u1B40", "u1B41", "u1B43", "u1B44", "u1B82", "u1BA1", "u1BA6", "u1BA7", "u1BAA", "u1BE7", "u1BEA", "u1BEB", "u1BEC", "u1BEE", "u1BF2", "u1BF3", "u1C24", "u1C25", "u1C26", "u1C27", "u1C28", "u1C29", "u1C2A", "u1C2B", "u1C34", "u1C35", "u1CE1", "u1CF2", "u1CF3", "u302E", "u302F", "uA823", "uA824", "uA827", "uA880", "uA881", "uA8B4", "uA8B5", "uA8B6", "uA8B7", "uA8B8", "uA8B9", "uA8BA", "uA8BB", "uA8BC", "uA8BD", "uA8BE", "uA8BF", "uA8C0", "uA8C1", "uA8C2", "uA8C3", "uA952", "uA953", "uA983", "uA9B4", "uA9B5", "uA9BA", "uA9BB", "uA9BD", "uA9BE", "uA9BF", "uA9C0", "uAA2F", "uAA30", "uAA33", "uAA34", "uAA4D", "uAA7B", "uAA7D", "uAAEB", "uAAEE", "uAAEF", "uAAF5", "uABE3", "uABE4", "uABE6", "uABE7", "uABE9", "uABEA", "uABEC"]; - var b = ["u0300", "u0301", "u0302", "u0303", "u0304", "u0305", "u0306", "u0307", "u0308", "u0309", "u030A", "u030B", "u030C", "u030D", "u030E", "u030F", "u0310", "u0311", "u0312", "u0313", "u0314", "u0315", "u0316", "u0317", "u0318", "u0319", "u031A", "u031B", "u031C", "u031D", "u031E", "u031F", "u0320", "u0321", "u0322", "u0323", "u0324", "u0325", "u0326", "u0327", "u0328", "u0329", "u032A", "u032B", "u032C", "u032D", "u032E", "u032F", "u0330", "u0331", "u0332", "u0333", "u0334", "u0335", "u0336", "u0337", "u0338", "u0339", "u033A", "u033B", "u033C", "u033D", "u033E", "u033F", "u0340", "u0341", "u0342", "u0343", "u0344", "u0345", "u0346", "u0347", "u0348", "u0349", "u034A", "u034B", "u034C", "u034D", "u034E", "u034F", "u0350", "u0351", "u0352", "u0353", "u0354", "u0355", "u0356", "u0357", "u0358", "u0359", "u035A", "u035B", "u035C", "u035D", "u035E", "u035F", "u0360", "u0361", "u0362", "u0363", "u0364", "u0365", "u0366", "u0367", "u0368", "u0369", "u036A", "u036B", "u036C", "u036D", "u036E", "u036F", "u0483", "u0484", "u0485", "u0486", "u0487", "u0591", "u0592", "u0593", "u0594", "u0595", "u0596", "u0597", "u0598", "u0599", "u059A", "u059B", "u059C", "u059D", "u059E", "u059F", "u05A0", "u05A1", "u05A2", "u05A3", "u05A4", "u05A5", "u05A6", "u05A7", "u05A8", "u05A9", "u05AA", "u05AB", "u05AC", "u05AD", "u05AE", "u05AF", "u05B0", "u05B1", "u05B2", "u05B3", "u05B4", "u05B5", "u05B6", "u05B7", "u05B8", "u05B9", "u05BA", "u05BB", "u05BC", "u05BD", "u05BF", "u05C1", "u05C2", "u05C4", "u05C5", "u05C7", "u0610", "u0611", "u0612", "u0613", "u0614", "u0615", "u0616", "u0617", "u0618", "u0619", "u061A", "u064B", "u064C", "u064D", "u064E", "u064F", "u0650", "u0651", "u0652", "u0653", "u0654", "u0655", "u0656", "u0657", "u0658", "u0659", "u065A", "u065B", "u065C", "u065D", "u065E", "u065F", "u0670", "u06D6", "u06D7", "u06D8", "u06D9", "u06DA", "u06DB", "u06DC", "u06DF", "u06E0", "u06E1", "u06E2", "u06E3", "u06E4", "u06E7", "u06E8", "u06EA", "u06EB", "u06EC", "u06ED", "u0711", "u0730", "u0731", "u0732", "u0733", "u0734", "u0735", "u0736", "u0737", "u0738", "u0739", "u073A", "u073B", "u073C", "u073D", "u073E", "u073F", "u0740", "u0741", "u0742", "u0743", "u0744", "u0745", "u0746", "u0747", "u0748", "u0749", "u074A", "u07A6", "u07A7", "u07A8", "u07A9", "u07AA", "u07AB", "u07AC", "u07AD", "u07AE", "u07AF", "u07B0", "u07EB", "u07EC", "u07ED", "u07EE", "u07EF", "u07F0", "u07F1", "u07F2", "u07F3", "u0816", "u0817", "u0818", "u0819", "u081B", "u081C", "u081D", "u081E", "u081F", "u0820", "u0821", "u0822", "u0823", "u0825", "u0826", "u0827", "u0829", "u082A", "u082B", "u082C", "u082D", "u0859", "u085A", "u085B", "u08E3", "u08E4", "u08E5", "u08E6", "u08E7", "u08E8", "u08E9", "u08EA", "u08EB", "u08EC", "u08ED", "u08EE", "u08EF", "u08F0", "u08F1", "u08F2", "u08F3", "u08F4", "u08F5", "u08F6", "u08F7", "u08F8", "u08F9", "u08FA", "u08FB", "u08FC", "u08FD", "u08FE", "u08FF", "u0900", "u0901", "u0902", "u093A", "u093C", "u0941", "u0942", "u0943", "u0944", "u0945", "u0946", "u0947", "u0948", "u094D", "u0951", "u0952", "u0953", "u0954", "u0955", "u0956", "u0957", "u0962", "u0963", "u0981", "u09BC", "u09C1", "u09C2", "u09C3", "u09C4", "u09CD", "u09E2", "u09E3", "u0A01", "u0A02", "u0A3C", "u0A41", "u0A42", "u0A47", "u0A48", "u0A4B", "u0A4C", "u0A4D", "u0A51", "u0A70", "u0A71", "u0A75", "u0A81", "u0A82", "u0ABC", "u0AC1", "u0AC2", "u0AC3", "u0AC4", "u0AC5", "u0AC7", "u0AC8", "u0ACD", "u0AE2", "u0AE3", "u0B01", "u0B3C", "u0B3F", "u0B41", "u0B42", "u0B43", "u0B44", "u0B4D", "u0B56", "u0B62", "u0B63", "u0B82", "u0BC0", "u0BCD", "u0C00", "u0C3E", "u0C3F", "u0C40", "u0C46", "u0C47", "u0C48", "u0C4A", "u0C4B", "u0C4C", "u0C4D", "u0C55", "u0C56", "u0C62", "u0C63", "u0C81", "u0CBC", "u0CBF", "u0CC6", "u0CCC", "u0CCD", "u0CE2", "u0CE3", "u0D01", "u0D41", "u0D42", "u0D43", "u0D44", "u0D4D", "u0D62", "u0D63", "u0DCA", "u0DD2", "u0DD3", "u0DD4", "u0DD6", "u0E31", "u0E34", "u0E35", "u0E36", "u0E37", "u0E38", "u0E39", "u0E3A", "u0E47", "u0E48", "u0E49", "u0E4A", "u0E4B", "u0E4C", "u0E4D", "u0E4E", "u0EB1", "u0EB4", "u0EB5", "u0EB6", "u0EB7", "u0EB8", "u0EB9", "u0EBB", "u0EBC", "u0EC8", "u0EC9", "u0ECA", "u0ECB", "u0ECC", "u0ECD", "u0F18", "u0F19", "u0F35", "u0F37", "u0F39", "u0F71", "u0F72", "u0F73", "u0F74", "u0F75", "u0F76", "u0F77", "u0F78", "u0F79", "u0F7A", "u0F7B", "u0F7C", "u0F7D", "u0F7E", "u0F80", "u0F81", "u0F82", "u0F83", "u0F84", "u0F86", "u0F87", "u0F8D", "u0F8E", "u0F8F", "u0F90", "u0F91", "u0F92", "u0F93", "u0F94", "u0F95", "u0F96", "u0F97", "u0F99", "u0F9A", "u0F9B", "u0F9C", "u0F9D", "u0F9E", "u0F9F", "u0FA0", "u0FA1", "u0FA2", "u0FA3", "u0FA4", "u0FA5", "u0FA6", "u0FA7", "u0FA8", "u0FA9", "u0FAA", "u0FAB", "u0FAC", "u0FAD", "u0FAE", "u0FAF", "u0FB0", "u0FB1", "u0FB2", "u0FB3", "u0FB4", "u0FB5", "u0FB6", "u0FB7", "u0FB8", "u0FB9", "u0FBA", "u0FBB", "u0FBC", "u0FC6", "u102D", "u102E", "u102F", "u1030", "u1032", "u1033", "u1034", "u1035", "u1036", "u1037", "u1039", "u103A", "u103D", "u103E", "u1058", "u1059", "u105E", "u105F", "u1060", "u1071", "u1072", "u1073", "u1074", "u1082", "u1085", "u1086", "u108D", "u109D", "u135D", "u135E", "u135F", "u1712", "u1713", "u1714", "u1732", "u1733", "u1734", "u1752", "u1753", "u1772", "u1773", "u17B4", "u17B5", "u17B7", "u17B8", "u17B9", "u17BA", "u17BB", "u17BC", "u17BD", "u17C6", "u17C9", "u17CA", "u17CB", "u17CC", "u17CD", "u17CE", "u17CF", "u17D0", "u17D1", "u17D2", "u17D3", "u17DD", "u180B", "u180C", "u180D", "u18A9", "u1920", "u1921", "u1922", "u1927", "u1928", "u1932", "u1939", "u193A", "u193B", "u1A17", "u1A18", "u1A1B", "u1A56", "u1A58", "u1A59", "u1A5A", "u1A5B", "u1A5C", "u1A5D", "u1A5E", "u1A60", "u1A62", "u1A65", "u1A66", "u1A67", "u1A68", "u1A69", "u1A6A", "u1A6B", "u1A6C", "u1A73", "u1A74", "u1A75", "u1A76", "u1A77", "u1A78", "u1A79", "u1A7A", "u1A7B", "u1A7C", "u1A7F", "u1AB0", "u1AB1", "u1AB2", "u1AB3", "u1AB4", "u1AB5", "u1AB6", "u1AB7", "u1AB8", "u1AB9", "u1ABA", "u1ABB", "u1ABC", "u1ABD", "u1B00", "u1B01", "u1B02", "u1B03", "u1B34", "u1B36", "u1B37", "u1B38", "u1B39", "u1B3A", "u1B3C", "u1B42", "u1B6B", "u1B6C", "u1B6D", "u1B6E", "u1B6F", "u1B70", "u1B71", "u1B72", "u1B73", "u1B80", "u1B81", "u1BA2", "u1BA3", "u1BA4", "u1BA5", "u1BA8", "u1BA9", "u1BAB", "u1BAC", "u1BAD", "u1BE6", "u1BE8", "u1BE9", "u1BED", "u1BEF", "u1BF0", "u1BF1", "u1C2C", "u1C2D", "u1C2E", "u1C2F", "u1C30", "u1C31", "u1C32", "u1C33", "u1C36", "u1C37", "u1CD0", "u1CD1", "u1CD2", "u1CD4", "u1CD5", "u1CD6", "u1CD7", "u1CD8", "u1CD9", "u1CDA", "u1CDB", "u1CDC", "u1CDD", "u1CDE", "u1CDF", "u1CE0", "u1CE2", "u1CE3", "u1CE4", "u1CE5", "u1CE6", "u1CE7", "u1CE8", "u1CED", "u1CF4", "u1CF8", "u1CF9", "u1DC0", "u1DC1", "u1DC2", "u1DC3", "u1DC4", "u1DC5", "u1DC6", "u1DC7", "u1DC8", "u1DC9", "u1DCA", "u1DCB", "u1DCC", "u1DCD", "u1DCE", "u1DCF", "u1DD0", "u1DD1", "u1DD2", "u1DD3", "u1DD4", "u1DD5", "u1DD6", "u1DD7", "u1DD8", "u1DD9", "u1DDA", "u1DDB", "u1DDC", "u1DDD", "u1DDE", "u1DDF", "u1DE0", "u1DE1", "u1DE2", "u1DE3", "u1DE4", "u1DE5", "u1DE6", "u1DE7", "u1DE8", "u1DE9", "u1DEA", "u1DEB", "u1DEC", "u1DED", "u1DEE", "u1DEF", "u1DF0", "u1DF1", "u1DF2", "u1DF3", "u1DF4", "u1DF5", "u1DFC", "u1DFD", "u1DFE", "u1DFF", "u20D0", "u20D1", "u20D2", "u20D3", "u20D4", "u20D5", "u20D6", "u20D7", "u20D8", "u20D9", "u20DA", "u20DB", "u20DC", "u20E1", "u20E5", "u20E6", "u20E7", "u20E8", "u20E9", "u20EA", "u20EB", "u20EC", "u20ED", "u20EE", "u20EF", "u20F0", "u2CEF", "u2CF0", "u2CF1", "u2D7F", "u2DE0", "u2DE1", "u2DE2", "u2DE3", "u2DE4", "u2DE5", "u2DE6", "u2DE7", "u2DE8", "u2DE9", "u2DEA", "u2DEB", "u2DEC", "u2DED", "u2DEE", "u2DEF", "u2DF0", "u2DF1", "u2DF2", "u2DF3", "u2DF4", "u2DF5", "u2DF6", "u2DF7", "u2DF8", "u2DF9", "u2DFA", "u2DFB", "u2DFC", "u2DFD", "u2DFE", "u2DFF", "u302A", "u302B", "u302C", "u302D", "u3099", "u309A", "uA66F", "uA674", "uA675", "uA676", "uA677", "uA678", "uA679", "uA67A", "uA67B", "uA67C", "uA67D", "uA69E", "uA69F", "uA6F0", "uA6F1", "uA802", "uA806", "uA80B", "uA825", "uA826", "uA8C4", "uA8E0", "uA8E1", "uA8E2", "uA8E3", "uA8E4", "uA8E5", "uA8E6", "uA8E7", "uA8E8", "uA8E9", "uA8EA", "uA8EB", "uA8EC", "uA8ED", "uA8EE", "uA8EF", "uA8F0", "uA8F1", "uA926", "uA927", "uA928", "uA929", "uA92A", "uA92B", "uA92C", "uA92D", "uA947", "uA948", "uA949", "uA94A", "uA94B", "uA94C", "uA94D", "uA94E", "uA94F", "uA950", "uA951", "uA980", "uA981", "uA982", "uA9B3", "uA9B6", "uA9B7", "uA9B8", "uA9B9", "uA9BC", "uA9E5", "uAA29", "uAA2A", "uAA2B", "uAA2C", "uAA2D", "uAA2E", "uAA31", "uAA32", "uAA35", "uAA36", "uAA43", "uAA4C", "uAA7C", "uAAB0", "uAAB2", "uAAB3", "uAAB4", "uAAB7", "uAAB8", "uAABE", "uAABF", "uAAC1", "uAAEC", "uAAED", "uAAF6", "uABE5", "uABE8", "uABED", "uFB1E", "uFE00", "uFE01", "uFE02", "uFE03", "uFE04", "uFE05", "uFE06", "uFE07", "uFE08", "uFE09", "uFE0A", "uFE0B", "uFE0C", "uFE0D", "uFE0E", "uFE0F", "uFE20", "uFE21", "uFE22", "uFE23", "uFE24", "uFE25", "uFE26", "uFE27", "uFE28", "uFE29", "uFE2A", "uFE2B", "uFE2C", "uFE2D", "uFE2E", "uFE2F"]; - var combiningMarks = a$1.concat(b); - - var splitChars = ["-", ";", ":", "&", "|", "u0E2F", // thai character pairannoi - "u0EAF", // lao ellipsis - "u0EC6", // lao ko la (word repetition) - "u0ECC", // lao cancellation mark - "u104A", // myanmar sign little section - "u104B", // myanmar sign section - "u104C", // myanmar symbol locative - "u104D", // myanmar symbol completed - "u104E", // myanmar symbol aforementioned - "u104F", // myanmar symbol genitive - "u2013", // en dash - "u2014", // em dash - "u2027", // simplified chinese hyphenation point - "u3000", // simplified chinese ideographic space - "u3001", // simplified chinese ideographic comma - "u3002", // simplified chinese ideographic full stop - "uFF0C", // full-width comma - "uFF5E" // wave dash - ]; - var prefixChars = ["'", "<", "(", "{", "[", "u00AB", // left-pointing double angle quotation mark - "u300A", // left double angle bracket - "u3008" // left angle bracket - ]; - var suffixChars = ["'", ">", ")", "}", "]", ".", "!", "?", "/", "u00BB", // right-pointing double angle quotation mark - "u300B", // right double angle bracket - "u3009" // right angle bracket - ].concat(splitChars); - var burmeseRange = "\u1000-\u102A\u103F-\u1049\u1050-\u1055"; - var japaneseRange = "\u3040-\u309F\u30A0-\u30FF\uFF00-\uFF0B\uFF0D-\uFF5D\uFF5F-\uFF9F\u3400-\u4DBF"; - var chineseRange = "\u3400-\u9FBF"; - var laoRange = "\u0E81-\u0EAE\u0EB0-\u0EC4\u0EC8-\u0ECB\u0ECD-\u0EDD"; - var noSpaceRange = burmeseRange + chineseRange + japaneseRange + laoRange; - var splitWords = new RegExp("(\\".concat(splitChars.join("|\\"), ")*[^\\s|\\").concat(splitChars.join("|\\"), "]*(\\").concat(splitChars.join("|\\"), ")*"), "g"); - var noSpaceLanguage = new RegExp("[".concat(noSpaceRange, "]")); - var splitAllChars = new RegExp("(\\".concat(prefixChars.join("|\\"), ")*[").concat(noSpaceRange, "](\\").concat(suffixChars.join("|\\"), "|\\").concat(combiningMarks.join("|\\"), ")*|[a-z0-9]+"), "gi"); - /** - @function textSplit - @desc Splits a given sentence into an array of words. - @param {String} sentence - */ - - function textSplit (sentence) { - if (!noSpaceLanguage.test(sentence)) return stringify(sentence).match(splitWords).filter(function (w) { - return w.length; - }); - return arrayMerge(stringify(sentence).match(splitWords).map(function (d) { - if (noSpaceLanguage.test(d)) return d.match(splitAllChars); - return [d]; - })); - } - - /** - @function textWrap - @desc Based on the defined styles and dimensions, breaks a string into an array of strings for each line of text. - */ - - function textWrap () { - var fontFamily = "sans-serif", - fontSize = 10, - fontWeight = 400, - height = 200, - lineHeight, - maxLines = null, - overflow = false, - split = textSplit, - width = 200; - /** - The inner return object and wraps the text and returns the line data array. - @private - */ - - function textWrap(sentence) { - sentence = stringify(sentence); - if (lineHeight === void 0) lineHeight = Math.ceil(fontSize * 1.4); - var words = split(sentence); - var style = { - "font-family": fontFamily, - "font-size": fontSize, - "font-weight": fontWeight, - "line-height": lineHeight - }; - var line = 1, - textProg = "", - truncated = false, - widthProg = 0; - var lineData = [], - sizes = textWidth(words, style), - space = textWidth(" ", style); - - for (var i = 0; i < words.length; i++) { - var word = words[i]; - var wordWidth = sizes[words.indexOf(word)]; - word += sentence.slice(textProg.length + word.length).match("^( |\n)*", "g")[0]; - - if (textProg.slice(-1) === "\n" || widthProg + wordWidth > width) { - if (!i && !overflow) { - truncated = true; - break; - } - - if (lineData.length >= line) lineData[line - 1] = trimRight(lineData[line - 1]); - line++; - - if (lineHeight * line > height || wordWidth > width && !overflow || maxLines && line > maxLines) { - truncated = true; - break; - } - - widthProg = 0; - lineData.push(word); - } else if (!i) lineData[0] = word;else lineData[line - 1] += word; - - textProg += word; - widthProg += wordWidth; - widthProg += word.match(/[\s]*$/g)[0].length * space; - } - - return { - lines: lineData, - sentence: sentence, - truncated: truncated, - widths: textWidth(lineData, style), - words: words - }; - } - /** - @memberof textWrap - @desc If *value* is specified, sets the font family accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current font family. - @param {Function|String} [*value* = "sans-serif"] - */ - - - textWrap.fontFamily = function (_) { - return arguments.length ? (fontFamily = _, textWrap) : fontFamily; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets the font size accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current font size. - @param {Function|Number} [*value* = 10] - */ - - - textWrap.fontSize = function (_) { - return arguments.length ? (fontSize = _, textWrap) : fontSize; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets the font weight accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current font weight. - @param {Function|Number|String} [*value* = 400] - */ - - - textWrap.fontWeight = function (_) { - return arguments.length ? (fontWeight = _, textWrap) : fontWeight; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets height limit to the specified value and returns this generator. If *value* is not specified, returns the current value. - @param {Number} [*value* = 200] - */ - - - textWrap.height = function (_) { - return arguments.length ? (height = _, textWrap) : height; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets the line height accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current line height accessor, which is 1.1 times the [font size](#textWrap.fontSize) by default. - @param {Function|Number} [*value*] - */ - - - textWrap.lineHeight = function (_) { - return arguments.length ? (lineHeight = _, textWrap) : lineHeight; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets the maximum number of lines allowed when wrapping. - @param {Function|Number} [*value*] - */ - - - textWrap.maxLines = function (_) { - return arguments.length ? (maxLines = _, textWrap) : maxLines; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets the overflow to the specified boolean and returns this generator. If *value* is not specified, returns the current overflow value. - @param {Boolean} [*value* = false] - */ - - - textWrap.overflow = function (_) { - return arguments.length ? (overflow = _, textWrap) : overflow; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets the word split function to the specified function and returns this generator. If *value* is not specified, returns the current word split function. - @param {Function} [*value*] A function that, when passed a string, is expected to return that string split into an array of words to textWrap. The default split function splits strings on the following characters: `-`, `/`, `;`, `:`, `&` - */ - - - textWrap.split = function (_) { - return arguments.length ? (split = _, textWrap) : split; - }; - /** - @memberof textWrap - @desc If *value* is specified, sets width limit to the specified value and returns this generator. If *value* is not specified, returns the current value. - @param {Number} [*value* = 200] - */ - - - textWrap.width = function (_) { - return arguments.length ? (width = _, textWrap) : width; - }; - - return textWrap; - } - - function _typeof$3(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$3 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$3 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$3(obj); - } - - function _classCallCheck$3(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$3(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$3(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$3(Constructor, staticProps); - return Constructor; - } - - function _inherits$1(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$1(subClass, superClass); - } - - function _setPrototypeOf$1(o, p) { - _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$1(o, p); - } - - function _createSuper$1(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$1(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$1(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$1(this, result); - }; - } - - function _possibleConstructorReturn$1(self, call) { - if (call && (_typeof$3(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$1(self); - } - - function _assertThisInitialized$1(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$1() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$1(o) { - _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$1(o); - } - var defaultHtmlLookup = { - i: "font-style: italic;", - em: "font-style: italic;", - b: "font-weight: bold;", - strong: "font-weight: bold;" - }; - /** - @class TextBox - @extends external:BaseClass - @desc Creates a wrapped text box for each point in an array of data. See [this example](https://d3plus.org/examples/d3plus-text/getting-started/) for help getting started using the TextBox class. - */ - - var TextBox = /*#__PURE__*/function (_BaseClass) { - _inherits$1(TextBox, _BaseClass); - - var _super = _createSuper$1(TextBox); - /** - @memberof TextBox - @desc Invoked when creating a new class instance, and sets any default parameters. - @private - */ - - - function TextBox() { - var _this; - - _classCallCheck$3(this, TextBox); - - _this = _super.call(this); - _this._ariaHidden = constant$1("false"); - _this._delay = 0; - _this._duration = 0; - - _this._ellipsis = function (text, line) { - return line ? "".concat(text.replace(/\.|,$/g, ""), "...") : ""; - }; - - _this._fontColor = constant$1("black"); - _this._fontFamily = constant$1(["Roboto", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]); - _this._fontMax = constant$1(50); - _this._fontMin = constant$1(8); - _this._fontOpacity = constant$1(1); - _this._fontResize = constant$1(false); - _this._fontSize = constant$1(10); - _this._fontStroke = constant$1("transparent"); - _this._fontStrokeWidth = constant$1(0); - _this._fontWeight = constant$1(400); - _this._height = accessor("height", 200); - _this._html = defaultHtmlLookup; - - _this._id = function (d, i) { - return d.id || "".concat(i); - }; - - _this._lineHeight = function (d, i) { - return _this._fontSize(d, i) * 1.2; - }; - - _this._maxLines = constant$1(null); - _this._on = {}; - _this._overflow = constant$1(false); - _this._padding = constant$1(0); - _this._pointerEvents = constant$1("auto"); - _this._rotate = constant$1(0); - - _this._rotateAnchor = function (d) { - return [d.w / 2, d.h / 2]; - }; - - _this._split = textSplit; - _this._text = accessor("text"); - _this._textAnchor = constant$1("start"); - _this._verticalAlign = constant$1("top"); - _this._width = accessor("width", 200); - _this._x = accessor("x", 0); - _this._y = accessor("y", 0); - return _this; - } - /** - @memberof TextBox - @desc Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing. - @param {Function} [*callback* = undefined] - */ - - - _createClass$3(TextBox, [{ - key: "render", - value: function render(callback) { - var _this2 = this; - - if (this._select === void 0) this.select(_select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).node()); - var that = this; - - var boxes = this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function (arr, d, i) { - var t = _this2._text(d, i); - - if (t === void 0) return arr; - t = trim(t); - - var resize = _this2._fontResize(d, i); - - var lHRatio = _this2._lineHeight(d, i) / _this2._fontSize(d, i); - - var fS = resize ? _this2._fontMax(d, i) : _this2._fontSize(d, i), - lH = resize ? fS * lHRatio : _this2._lineHeight(d, i), - line = 1, - lineData = [], - sizes, - wrapResults; - var style = { - "font-family": fontExists(_this2._fontFamily(d, i)), - "font-size": fS, - "font-weight": _this2._fontWeight(d, i), - "line-height": lH - }; - var padding = parseSides(_this2._padding(d, i)); - var h = _this2._height(d, i) - (padding.top + padding.bottom), - w = _this2._width(d, i) - (padding.left + padding.right); - var wrapper = textWrap().fontFamily(style["font-family"]).fontSize(fS).fontWeight(style["font-weight"]).lineHeight(lH).maxLines(_this2._maxLines(d, i)).height(h).overflow(_this2._overflow(d, i)).width(w).split(_this2._split); - - var fMax = _this2._fontMax(d, i), - fMin = _this2._fontMin(d, i), - vA = _this2._verticalAlign(d, i), - words = _this2._split(t, i); - /** - Figures out the lineData to be used for wrapping. - @private - */ - - - function checkSize() { - var truncate = function truncate() { - if (line < 1) lineData = [that._ellipsis("", line)];else lineData[line - 1] = that._ellipsis(lineData[line - 1], line); - }; // Constraint the font size - - - fS = max([fS, fMin]); - fS = min([fS, fMax]); - - if (resize) { - lH = fS * lHRatio; - wrapper.fontSize(fS).lineHeight(lH); - style["font-size"] = fS; - style["line-height"] = lH; - } - - wrapResults = wrapper(t); - lineData = wrapResults.lines.filter(function (l) { - return l !== ""; - }); - line = lineData.length; - - if (wrapResults.truncated) { - if (resize) { - fS--; - - if (fS < fMin) { - fS = fMin; - truncate(); - return; - } else checkSize(); - } else truncate(); - } - } - - if (w > fMin && (h > lH || resize && h > fMin * lHRatio)) { - if (resize) { - sizes = textWidth(words, style); - var areaMod = 1.165 + w / h * 0.1, - boxArea = w * h, - maxWidth = max(sizes), - textArea = sum(sizes, function (d) { - return d * lH; - }) * areaMod; - - if (maxWidth > w || textArea > boxArea) { - var areaRatio = Math.sqrt(boxArea / textArea), - widthRatio = w / maxWidth; - var sizeRatio = min([areaRatio, widthRatio]); - fS = Math.floor(fS * sizeRatio); - } - - var heightMax = Math.floor(h * 0.8); - if (fS > heightMax) fS = heightMax; - } - - checkSize(); - } - - if (lineData.length) { - var tH = line * lH; - - var r = _this2._rotate(d, i); - - var yP = r === 0 ? vA === "top" ? 0 : vA === "middle" ? h / 2 - tH / 2 : h - tH : 0; - yP -= lH * 0.1; - arr.push({ - aH: _this2._ariaHidden(d, i), - data: d, - i: i, - lines: lineData, - fC: _this2._fontColor(d, i), - fStroke: _this2._fontStroke(d, i), - fSW: _this2._fontStrokeWidth(d, i), - fF: style["font-family"], - fO: _this2._fontOpacity(d, i), - fW: style["font-weight"], - id: _this2._id(d, i), - tA: _this2._textAnchor(d, i), - vA: _this2._verticalAlign(d, i), - widths: wrapResults.widths, - fS: fS, - lH: lH, - w: w, - h: h, - r: r, - x: _this2._x(d, i) + padding.left, - y: _this2._y(d, i) + yP + padding.top - }); - } - - return arr; - }, []), function (d) { - return _this2._id(d.data, d.i); - }); - - var t = transition().duration(this._duration); - - if (this._duration === 0) { - boxes.exit().remove(); - } else { - boxes.exit().transition().delay(this._duration).remove(); - boxes.exit().selectAll("text").transition(t).attr("opacity", 0).style("opacity", 0); - } - /** - * Applies translate and rotate to a text element. - * @param {D3Selection} text - * @private - */ - - - function rotate(text) { - text.attr("transform", function (d, i) { - var rotateAnchor = that._rotateAnchor(d, i); - - return "translate(".concat(d.x, ", ").concat(d.y, ") rotate(").concat(d.r, ", ").concat(rotateAnchor[0], ", ").concat(rotateAnchor[1], ")"); - }); - } - - var update = boxes.enter().append("g").attr("class", "d3plus-textBox").attr("id", function (d) { - return "d3plus-textBox-".concat(strip(d.id)); - }).call(rotate).merge(boxes); - var rtl = detectRTL(); - update.style("pointer-events", function (d) { - return _this2._pointerEvents(d.data, d.i); - }).each(function (d) { - /** - Sets the inner text content of each element. - @private - */ - function textContent(text) { - text[that._html ? "html" : "text"](function (t) { - return trimRight(t).replace(/&([^\;&]*)/g, function (str, a) { - return a === "amp" ? str : "&".concat(a); - }) // replaces all non-HTML ampersands with escaped entity - .replace(/<([^A-z^/]+)/g, function (str, a) { - return "<".concat(a); - }).replace(/<$/g, "<") // replaces all non-HTML left angle brackets with escaped entity - .replace(/(<[^>^\/]+>)([^<^>]+)$/g, function (str, a, b) { - return "".concat(a).concat(b).concat(a.replace("<", "]+)(<\/[^>]+>)/g, function (str, a, b) { - return "".concat(b.replace("]*>([^<^>]+)<\/[^>]+>/g, function (str, a, b) { - var tag = that._html[a] ? "") : ""; - return "".concat(tag.length ? tag : "").concat(b).concat(tag.length ? "" : ""); - }); - }); - } - /** - Styles to apply to each element. - @private - */ - - - function textStyle(text) { - text.attr("aria-hidden", d.aH).attr("dir", rtl ? "rtl" : "ltr").attr("fill", d.fC).attr("stroke", d.fStroke).attr("stroke-width", d.fSW).attr("text-anchor", d.tA).attr("font-family", d.fF).style("font-family", d.fF).attr("font-size", "".concat(d.fS, "px")).style("font-size", "".concat(d.fS, "px")).attr("font-weight", d.fW).style("font-weight", d.fW).attr("x", "".concat(d.tA === "middle" ? d.w / 2 : rtl ? d.tA === "start" ? d.w : 0 : d.tA === "end" ? d.w : 2 * Math.sin(Math.PI * d.r / 180), "px")).attr("y", function (t, i) { - return d.r === 0 || d.vA === "top" ? "".concat((i + 1) * d.lH - (d.lH - d.fS), "px") : d.vA === "middle" ? "".concat((d.h + d.fS) / 2 - (d.lH - d.fS) + (i - d.lines.length / 2 + 0.5) * d.lH, "px") : "".concat(d.h - 2 * (d.lH - d.fS) - (d.lines.length - (i + 1)) * d.lH + 2 * Math.cos(Math.PI * d.r / 180), "px"); - }); - } - - var texts = _select(this).selectAll("text").data(d.lines); - - if (that._duration === 0) { - texts.call(textContent).call(textStyle); - texts.exit().remove(); - texts.enter().append("text").attr("dominant-baseline", "alphabetic").style("baseline-shift", "0%").attr("unicode-bidi", "bidi-override").call(textContent).call(textStyle).attr("opacity", d.fO).style("opacity", d.fO); - } else { - texts.call(textContent).transition(t).call(textStyle); - texts.exit().transition(t).attr("opacity", 0).remove(); - texts.enter().append("text").attr("dominant-baseline", "alphabetic").style("baseline-shift", "0%").attr("opacity", 0).style("opacity", 0).call(textContent).call(textStyle).merge(texts).transition(t).delay(that._delay).call(textStyle).attr("opacity", d.fO).style("opacity", d.fO); - } - }).transition(t).call(rotate); - var events = Object.keys(this._on), - on = events.reduce(function (obj, e) { - obj[e] = function (d, i) { - return _this2._on[e](d.data, i); - }; - - return obj; - }, {}); - - for (var e = 0; e < events.length; e++) { - update.on(events[e], on[events[e]]); - } - - if (callback) setTimeout(callback, this._duration + 100); - return this; - } - /** - @memberof TextBox - @desc If *value* is specified, sets the aria-hidden attribute to the specified function or string and returns the current class instance. - @param {Function|String} *value* - @chainable - */ - - }, { - key: "ariaHidden", - value: function ariaHidden(_) { - return _ !== undefined ? (this._ariaHidden = typeof _ === "function" ? _ : constant$1(_), this) : this._ariaHidden; - } - /** - @memberof TextBox - @desc Sets the data array to the specified array. A text box will be drawn for each object in the array. - @param {Array} [*data* = []] - @chainable - */ - - }, { - key: "data", - value: function data(_) { - return arguments.length ? (this._data = _, this) : this._data; - } - /** - @memberof TextBox - @desc Sets the animation delay to the specified number in milliseconds. - @param {Number} [*value* = 0] - @chainable - */ - - }, { - key: "delay", - value: function delay(_) { - return arguments.length ? (this._delay = _, this) : this._delay; - } - /** - @memberof TextBox - @desc Sets the animation duration to the specified number in milliseconds. - @param {Number} [*value* = 0] - @chainable - */ - - }, { - key: "duration", - value: function duration(_) { - return arguments.length ? (this._duration = _, this) : this._duration; - } - /** - @memberof TextBox - @desc Sets the function that handles what to do when a line is truncated. It should return the new value for the line, and is passed 2 arguments: the String of text for the line in question, and the number of the line. By default, an ellipsis is added to the end of any line except if it is the first word that cannot fit (in that case, an empty string is returned). - @param {Function|String} [*value*] - @chainable - @example default accessor - function(text, line) { - return line ? text.replace(/\.|,$/g, "") + "..." : ""; - } - */ - - }, { - key: "ellipsis", - value: function ellipsis(_) { - return arguments.length ? (this._ellipsis = typeof _ === "function" ? _ : constant$1(_), this) : this._ellipsis; - } - /** - @memberof TextBox - @desc Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default. - @param {Function|String} [*value* = "black"] - @chainable - */ - - }, { - key: "fontColor", - value: function fontColor(_) { - return arguments.length ? (this._fontColor = typeof _ === "function" ? _ : constant$1(_), this) : this._fontColor; - } - /** - @memberof TextBox - @desc Defines the font-family to be used. The value passed can be either a *String* name of a font, a comma-separated list of font-family fallbacks, an *Array* of fallbacks, or a *Function* that returns either a *String* or an *Array*. If supplying multiple fallback fonts, the [fontExists](#fontExists) function will be used to determine the first available font on the client's machine. - @param {Array|Function|String} [*value* = ["Roboto", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]] - @chainable - */ - - }, { - key: "fontFamily", - value: function fontFamily(_) { - return arguments.length ? (this._fontFamily = typeof _ === "function" ? _ : constant$1(_), this) : this._fontFamily; - } - /** - @memberof TextBox - @desc Sets the maximum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize). - @param {Function|Number} [*value* = 50] - @chainable - */ - - }, { - key: "fontMax", - value: function fontMax(_) { - return arguments.length ? (this._fontMax = typeof _ === "function" ? _ : constant$1(_), this) : this._fontMax; - } - /** - @memberof TextBox - @desc Sets the minimum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize). - @param {Function|Number} [*value* = 8] - @chainable - */ - - }, { - key: "fontMin", - value: function fontMin(_) { - return arguments.length ? (this._fontMin = typeof _ === "function" ? _ : constant$1(_), this) : this._fontMin; - } - /** - @memberof TextBox - @desc Sets the font opacity to the specified accessor function or static number between 0 and 1. - @param {Function|Number} [*value* = 1] - @chainable - */ - - }, { - key: "fontOpacity", - value: function fontOpacity(_) { - return arguments.length ? (this._fontOpacity = typeof _ === "function" ? _ : constant$1(_), this) : this._fontOpacity; - } - /** - @memberof TextBox - @desc Toggles font resizing, which can either be defined as a static boolean for all data points, or an accessor function that returns a boolean. See [this example](http://d3plus.org/examples/d3plus-text/resizing-text/) for a side-by-side comparison. - @param {Function|Boolean} [*value* = false] - @chainable - */ - - }, { - key: "fontResize", - value: function fontResize(_) { - return arguments.length ? (this._fontResize = typeof _ === "function" ? _ : constant$1(_), this) : this._fontResize; - } - /** - @memberof TextBox - @desc Sets the font size to the specified accessor function or static number (which corresponds to pixel units), which is inferred from the [DOM selection](#textBox.select) by default. - @param {Function|Number} [*value* = 10] - @chainable - */ - - }, { - key: "fontSize", - value: function fontSize(_) { - return arguments.length ? (this._fontSize = typeof _ === "function" ? _ : constant$1(_), this) : this._fontSize; - } - /** - @memberof TextBox - @desc Sets the font stroke color for the rendered text. - @param {Function|String} [*value* = "transparent"] - @chainable - */ - - }, { - key: "fontStroke", - value: function fontStroke(_) { - return arguments.length ? (this._fontStroke = typeof _ === "function" ? _ : constant$1(_), this) : this._fontStroke; - } - /** - @memberof TextBox - @desc Sets the font stroke width for the rendered text. - @param {Function|Number} [*value* = 0] - @chainable - */ - - }, { - key: "fontStrokeWidth", - value: function fontStrokeWidth(_) { - return arguments.length ? (this._fontStrokeWidth = typeof _ === "function" ? _ : constant$1(_), this) : this._fontStrokeWidth; - } - /** - @memberof TextBox - @desc Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default. - @param {Function|Number|String} [*value* = 400] - @chainable - */ - - }, { - key: "fontWeight", - value: function fontWeight(_) { - return arguments.length ? (this._fontWeight = typeof _ === "function" ? _ : constant$1(_), this) : this._fontWeight; - } - /** - @memberof TextBox - @desc Sets the height for each box to the specified accessor function or static number. - @param {Function|Number} [*value*] - @chainable - @example default accessor - function(d) { - return d.height || 200; - } - */ - - }, { - key: "height", - value: function height(_) { - return arguments.length ? (this._height = typeof _ === "function" ? _ : constant$1(_), this) : this._height; - } - /** - @memberof TextBox - @desc Configures the ability to render simple HTML tags. Defaults to supporting ``, ``, ``, and ``, set to false to disable or provide a mapping of tags to svg styles - @param {Object|Boolean} [*value* = { - i: 'font-style: italic;', - em: 'font-style: italic;', - b: 'font-weight: bold;', - strong: 'font-weight: bold;' - }] - @chainable - */ - - }, { - key: "html", - value: function html(_) { - return arguments.length ? (this._html = typeof _ === "boolean" ? _ ? defaultHtmlLookup : false : _, this) : this._html; - } - /** - @memberof TextBox - @desc Defines the unique id for each box to the specified accessor function or static number. - @param {Function|Number} [*value*] - @chainable - @example default accessor - function(d, i) { - return d.id || i + ""; - } - */ - - }, { - key: "id", - value: function id(_) { - return arguments.length ? (this._id = typeof _ === "function" ? _ : constant$1(_), this) : this._id; - } - /** - @memberof TextBox - @desc Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "lineHeight", - value: function lineHeight(_) { - return arguments.length ? (this._lineHeight = typeof _ === "function" ? _ : constant$1(_), this) : this._lineHeight; - } - /** - @memberof TextBox - @desc Restricts the maximum number of lines to wrap onto, which is null (unlimited) by default. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "maxLines", - value: function maxLines(_) { - return arguments.length ? (this._maxLines = typeof _ === "function" ? _ : constant$1(_), this) : this._maxLines; - } - /** - @memberof TextBox - @desc Sets the text overflow to the specified accessor function or static boolean. - @param {Function|Boolean} [*value* = false] - @chainable - */ - - }, { - key: "overflow", - value: function overflow(_) { - return arguments.length ? (this._overflow = typeof _ === "function" ? _ : constant$1(_), this) : this._overflow; - } - /** - @memberof TextBox - @desc Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default. - @param {Function|Number|String} [*value*] - @chainable - */ - - }, { - key: "padding", - value: function padding(_) { - return arguments.length ? (this._padding = typeof _ === "function" ? _ : constant$1(_), this) : this._padding; - } - /** - @memberof TextBox - @desc Sets the pointer-events to the specified accessor function or static string. - @param {Function|String} [*value* = "auto"] - @chainable - */ - - }, { - key: "pointerEvents", - value: function pointerEvents(_) { - return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : constant$1(_), this) : this._pointerEvents; - } - /** - @memberof TextBox - @desc Sets the rotate percentage for each box to the specified accessor function or static string. - @param {Function|Number} [*value* = 0] - @chainable - */ - - }, { - key: "rotate", - value: function rotate(_) { - return arguments.length ? (this._rotate = typeof _ === "function" ? _ : constant$1(_), this) : this._rotate; - } - /** - @memberof TextBox - @desc Sets the anchor point around which to rotate the text box. - @param {Function|Number[]} - @chainable - */ - - }, { - key: "rotateAnchor", - value: function rotateAnchor(_) { - return arguments.length ? (this._rotateAnchor = typeof _ === "function" ? _ : constant$1(_), this) : this._rotateAnchor; - } - /** - @memberof TextBox - @desc Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use. - @param {String|HTMLElement} [*selector*] - @chainable - */ - - }, { - key: "select", - value: function select(_) { - return arguments.length ? (this._select = _select(_), this) : this._select; - } - /** - @memberof TextBox - @desc Sets the word split behavior to the specified function, which when passed a string is expected to return that string split into an array of words. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "split", - value: function split(_) { - return arguments.length ? (this._split = _, this) : this._split; - } - /** - @memberof TextBox - @desc Sets the text for each box to the specified accessor function or static string. - @param {Function|String} [*value*] - @chainable - @example default accessor - function(d) { - return d.text; - } - */ - - }, { - key: "text", - value: function text(_) { - return arguments.length ? (this._text = typeof _ === "function" ? _ : constant$1(_), this) : this._text; - } - /** - @memberof TextBox - @desc Sets the horizontal text anchor to the specified accessor function or static string, whose values are analagous to the SVG [text-anchor](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor) property. - @param {Function|String} [*value* = "start"] - @chainable - */ - - }, { - key: "textAnchor", - value: function textAnchor(_) { - return arguments.length ? (this._textAnchor = typeof _ === "function" ? _ : constant$1(_), this) : this._textAnchor; - } - /** - @memberof TextBox - @desc Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`. - @param {Function|String} [*value* = "top"] - @chainable - */ - - }, { - key: "verticalAlign", - value: function verticalAlign(_) { - return arguments.length ? (this._verticalAlign = typeof _ === "function" ? _ : constant$1(_), this) : this._verticalAlign; - } - /** - @memberof TextBox - @desc Sets the width for each box to the specified accessor function or static number. - @param {Function|Number} [*value*] - @chainable - @example default accessor - function(d) { - return d.width || 200; - } - */ - - }, { - key: "width", - value: function width(_) { - return arguments.length ? (this._width = typeof _ === "function" ? _ : constant$1(_), this) : this._width; - } - /** - @memberof TextBox - @desc Sets the x position for each box to the specified accessor function or static number. The number given should correspond to the left side of the textBox. - @param {Function|Number} [*value*] - @chainable - @example default accessor - function(d) { - return d.x || 0; - } - */ - - }, { - key: "x", - value: function x(_) { - return arguments.length ? (this._x = typeof _ === "function" ? _ : constant$1(_), this) : this._x; - } - /** - @memberof TextBox - @desc Sets the y position for each box to the specified accessor function or static number. The number given should correspond to the top side of the textBox. - @param {Function|Number} [*value*] - @chainable - @example default accessor - function(d) { - return d.y || 0; - } - */ - - }, { - key: "y", - value: function y(_) { - return arguments.length ? (this._y = typeof _ === "function" ? _ : constant$1(_), this) : this._y; - } - }]); - - return TextBox; - }(BaseClass); - - /** - @function pointDistanceSquared - @desc Returns the squared euclidean distance between two points. - @param {Array} p1 The first point, which should always be an `[x, y]` formatted Array. - @param {Array} p2 The second point, which should always be an `[x, y]` formatted Array. - @returns {Number} - */ - var pointDistanceSquared = (function (p1, p2) { - var dx = p2[0] - p1[0], - dy = p2[1] - p1[1]; - return dx * dx + dy * dy; - }); - - /** - @function pointDistance - @desc Calculates the pixel distance between two points. - @param {Array} p1 The first point, which should always be an `[x, y]` formatted Array. - @param {Array} p2 The second point, which should always be an `[x, y]` formatted Array. - @returns {Number} - */ - - var pointDistance = (function (p1, p2) { - return Math.sqrt(pointDistanceSquared(p1, p2)); - }); - - function _typeof$4(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$4 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$4 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$4(obj); - } - - function _classCallCheck$4(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$4(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$4(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$4(Constructor, staticProps); - return Constructor; - } - - function _inherits$2(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$2(subClass, superClass); - } - - function _setPrototypeOf$2(o, p) { - _setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$2(o, p); - } - - function _createSuper$2(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$2(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$2(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$2(this, result); - }; - } - - function _possibleConstructorReturn$2(self, call) { - if (call && (_typeof$4(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$2(self); - } - - function _assertThisInitialized$2(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$2() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$2(o) { - _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$2(o); - } - /** - @class Shape - @extends external:BaseClass - @desc An abstracted class for generating shapes. - */ - - var Shape = /*#__PURE__*/function (_BaseClass) { - _inherits$2(Shape, _BaseClass); - - var _super = _createSuper$2(Shape); - /** - @memberof Shape - @desc Invoked when creating a new class instance, and sets any default parameters. - @private - */ - - - function Shape() { - var _this; - - var tagName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "g"; - - _classCallCheck$4(this, Shape); - - _this = _super.call(this); - _this._activeOpacity = 0.25; - _this._activeStyle = { - "stroke": function stroke(d, i) { - var c = _this._fill(d, i); - - if (["transparent", "none"].includes(c)) c = _this._stroke(d, i); - return color$1(c).darker(1); - }, - "stroke-width": function strokeWidth(d, i) { - var s = _this._strokeWidth(d, i) || 1; - return s * 3; - } - }; - _this._ariaLabel = constant$1(""); - _this._backgroundImage = constant$1(false); - _this._backgroundImageClass = new Image$1(); - _this._data = []; - _this._duration = 600; - _this._fill = constant$1("black"); - _this._fillOpacity = constant$1(1); - _this._hoverOpacity = 0.5; - _this._hoverStyle = { - "stroke": function stroke(d, i) { - var c = _this._fill(d, i); - - if (["transparent", "none"].includes(c)) c = _this._stroke(d, i); - return color$1(c).darker(0.5); - }, - "stroke-width": function strokeWidth(d, i) { - var s = _this._strokeWidth(d, i) || 1; - return s * 2; - } - }; - - _this._id = function (d, i) { - return d.id !== void 0 ? d.id : i; - }; - - _this._label = constant$1(false); - _this._labelClass = new TextBox(); - _this._labelConfig = { - fontColor: function fontColor(d, i) { - return colorContrast(_this._fill(d, i)); - }, - fontSize: 12, - padding: 5 - }; - _this._name = "Shape"; - _this._opacity = constant$1(1); - _this._pointerEvents = constant$1("visiblePainted"); - _this._role = constant$1("presentation"); - _this._rotate = constant$1(0); - _this._rx = constant$1(0); - _this._ry = constant$1(0); - _this._scale = constant$1(1); - _this._shapeRendering = constant$1("geometricPrecision"); - - _this._stroke = function (d, i) { - return color$1(_this._fill(d, i)).darker(1); - }; - - _this._strokeDasharray = constant$1("0"); - _this._strokeLinecap = constant$1("butt"); - _this._strokeOpacity = constant$1(1); - _this._strokeWidth = constant$1(0); - _this._tagName = tagName; - _this._textAnchor = constant$1("start"); - _this._vectorEffect = constant$1("non-scaling-stroke"); - _this._verticalAlign = constant$1("top"); - _this._x = accessor("x", 0); - _this._y = accessor("y", 0); - return _this; - } - /** - @memberof Shape - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - - _createClass$4(Shape, [{ - key: "_aes", - value: function _aes() { - return {}; - } - /** - @memberof Shape - @desc Adds event listeners to each shape group or hit area. - @param {D3Selection} *update* The update cycle of the data binding. - @private - */ - - }, { - key: "_applyEvents", - value: function _applyEvents(handler) { - var _this2 = this; - - var events = Object.keys(this._on); - - var _loop = function _loop(e) { - handler.on(events[e], function (d, i) { - if (!_this2._on[events[e]]) return; - if (d.i !== void 0) i = d.i; - - if (d.nested && d.values) { - var calcPoint = function calcPoint(d, i) { - if (_this2._discrete === "x") return [_this2._x(d, i), cursor[1]];else if (_this2._discrete === "y") return [cursor[0], _this2._y(d, i)];else return [_this2._x(d, i), _this2._y(d, i)]; - }; - - var cursor = mouse(_this2._select.node()), - values = d.values.map(function (d) { - return pointDistance(cursor, calcPoint(d, i)); - }); - i = values.indexOf(min(values)); - d = d.values[i]; - } - - _this2._on[events[e]].bind(_this2)(d, i); - }); - }; - - for (var e = 0; e < events.length; e++) { - _loop(e); - } - } - /** - @memberof Shape - @desc Provides the updated styling to the given shape elements. - @param {HTMLElement} *elem* - @param {Object} *style* - @private - */ - - }, { - key: "_updateStyle", - value: function _updateStyle(elem, style) { - var that = this; - if (elem.size() && elem.node().tagName === "g") elem = elem.selectAll("*"); - /** - @desc Determines whether a shape is a nested collection of data points, and uses the appropriate data and index for the given function context. - @param {Object} *d* data point - @param {Number} *i* index - @private - */ - - function styleLogic(d, i) { - return typeof this !== "function" ? this : d.nested && d.key && d.values ? this(d.values[0], that._data.indexOf(d.values[0])) : this(d, i); - } - - var styleObject = {}; - - for (var key in style) { - if ({}.hasOwnProperty.call(style, key)) { - styleObject[key] = styleLogic.bind(style[key]); - } - } - - elem.transition().duration(0).call(attrize, styleObject); - } - /** - @memberof Shape - @desc Provides the default styling to the shape elements. - @param {HTMLElement} *elem* - @private - */ - - }, { - key: "_applyStyle", - value: function _applyStyle(elem) { - var that = this; - if (elem.size() && elem.node().tagName === "g") elem = elem.selectAll("*"); - /** - @desc Determines whether a shape is a nested collection of data points, and uses the appropriate data and index for the given function context. - @param {Object} *d* data point - @param {Number} *i* index - @private - */ - - function styleLogic(d, i) { - return typeof this !== "function" ? this : d.nested && d.key && d.values ? this(d.values[0], that._data.indexOf(d.values[0])) : this(d, i); - } - - elem.attr("fill", styleLogic.bind(this._fill)).attr("fill-opacity", styleLogic.bind(this._fillOpacity)).attr("rx", styleLogic.bind(this._rx)).attr("ry", styleLogic.bind(this._ry)).attr("stroke", styleLogic.bind(this._stroke)).attr("stroke-dasharray", styleLogic.bind(this._strokeDasharray)).attr("stroke-linecap", styleLogic.bind(this._strokeLinecap)).attr("stroke-opacity", styleLogic.bind(this._strokeOpacity)).attr("stroke-width", styleLogic.bind(this._strokeWidth)).attr("vector-effect", styleLogic.bind(this._vectorEffect)); - } - /** - @memberof Shape - @desc Calculates the transform for the group elements. - @param {HTMLElement} *elem* - @private - */ - - }, { - key: "_applyTransform", - value: function _applyTransform(elem) { - var _this3 = this; - - elem.attr("transform", function (d, i) { - return "\n translate(".concat(d.__d3plusShape__ ? d.translate ? d.translate : "".concat(_this3._x(d.data, d.i), ",").concat(_this3._y(d.data, d.i)) : "".concat(_this3._x(d, i), ",").concat(_this3._y(d, i)), ")\n scale(").concat(d.__d3plusShape__ ? d.scale || _this3._scale(d.data, d.i) : _this3._scale(d, i), ")\n rotate(").concat(d.__d3plusShape__ ? d.rotate ? d.rotate : _this3._rotate(d.data || d, d.i) : _this3._rotate(d.data || d, d.i), ")"); - }); - } - /** - @memberof Shape - @desc Checks for nested data and uses the appropriate variables for accessor functions. - @param {HTMLElement} *elem* - @private - */ - - }, { - key: "_nestWrapper", - value: function _nestWrapper(method) { - return function (d, i) { - return method(d.__d3plusShape__ ? d.data : d, d.__d3plusShape__ ? d.i : i); - }; - } - /** - @memberof Shape - @desc Modifies existing shapes to show active status. - @private - */ - - }, { - key: "_renderActive", - value: function _renderActive() { - var that = this; - - this._group.selectAll(".d3plus-Shape, .d3plus-Image, .d3plus-textBox").each(function (d, i) { - if (!d) d = {}; - if (!d.parentNode) d.parentNode = this.parentNode; - var parent = d.parentNode; - if (_select(this).classed("d3plus-textBox")) d = d.data; - - if (d.__d3plusShape__ || d.__d3plus__) { - while (d && (d.__d3plusShape__ || d.__d3plus__)) { - i = d.i; - d = d.data; - } - } else i = that._data.indexOf(d); - - var group = !that._active || typeof that._active !== "function" || !that._active(d, i) ? parent : that._activeGroup.node(); - - if (group !== this.parentNode) { - group.appendChild(this); - - if (this.className.baseVal.includes("d3plus-Shape")) { - if (parent === group) _select(this).call(that._applyStyle.bind(that));else _select(this).call(that._updateStyle.bind(that, _select(this), that._activeStyle)); - } - } - }); // this._renderImage(); - // this._renderLabels(); - - - this._group.selectAll("g.d3plus-".concat(this._name, "-shape, g.d3plus-").concat(this._name, "-image, g.d3plus-").concat(this._name, "-text")).attr("opacity", this._hover ? this._hoverOpacity : this._active ? this._activeOpacity : 1); - } - /** - @memberof Shape - @desc Modifies existing shapes to show hover status. - @private - */ - - }, { - key: "_renderHover", - value: function _renderHover() { - var that = this; - - this._group.selectAll("g.d3plus-".concat(this._name, "-shape, g.d3plus-").concat(this._name, "-image, g.d3plus-").concat(this._name, "-text, g.d3plus-").concat(this._name, "-hover")).selectAll(".d3plus-Shape, .d3plus-Image, .d3plus-textBox").each(function (d, i) { - if (!d) d = {}; - if (!d.parentNode) d.parentNode = this.parentNode; - var parent = d.parentNode; - if (_select(this).classed("d3plus-textBox")) d = d.data; - - if (d.__d3plusShape__ || d.__d3plus__) { - while (d && (d.__d3plusShape__ || d.__d3plus__)) { - i = d.i; - d = d.data; - } - } else i = that._data.indexOf(d); - - var group = !that._hover || typeof that._hover !== "function" || !that._hover(d, i) ? parent : that._hoverGroup.node(); - if (group !== this.parentNode) group.appendChild(this); - - if (this.className.baseVal.includes("d3plus-Shape")) { - if (parent === group) _select(this).call(that._applyStyle.bind(that));else _select(this).call(that._updateStyle.bind(that, _select(this), that._hoverStyle)); - } - }); // this._renderImage(); - // this._renderLabels(); - - - this._group.selectAll("g.d3plus-".concat(this._name, "-shape, g.d3plus-").concat(this._name, "-image, g.d3plus-").concat(this._name, "-text")).attr("opacity", this._hover ? this._hoverOpacity : this._active ? this._activeOpacity : 1); - } - /** - @memberof Shape - @desc Adds background image to each shape group. - @private - */ - - }, { - key: "_renderImage", - value: function _renderImage() { - var _this4 = this; - - var imageData = []; - - this._update.merge(this._enter).data().forEach(function (datum, i) { - var aes = _this4._aes(datum, i); - - if (aes.r || aes.width && aes.height) { - var d = datum; - - if (datum.nested && datum.key && datum.values) { - d = datum.values[0]; - i = _this4._data.indexOf(d); - } - - var height = aes.r ? aes.r * 2 : aes.height, - url = _this4._backgroundImage(d, i), - width = aes.r ? aes.r * 2 : aes.width; - - if (url) { - var x = d.__d3plusShape__ ? d.translate ? d.translate[0] : _this4._x(d.data, d.i) : _this4._x(d, i), - y = d.__d3plusShape__ ? d.translate ? d.translate[1] : _this4._y(d.data, d.i) : _this4._y(d, i); - if (aes.x) x += aes.x; - if (aes.y) y += aes.y; - - if (d.__d3plusShape__) { - d = d.data; - i = d.i; - } - - imageData.push({ - __d3plus__: true, - data: d, - height: height, - i: i, - id: _this4._id(d, i), - url: url, - width: width, - x: x + -width / 2, - y: y + -height / 2 - }); - } - } - }); - - this._backgroundImageClass.data(imageData).duration(this._duration).opacity(this._nestWrapper(this._opacity)).pointerEvents("none").select(elem("g.d3plus-".concat(this._name, "-image"), { - parent: this._group, - update: { - opacity: this._active ? this._activeOpacity : 1 - } - }).node()).render(); - } - /** - @memberof Shape - @desc Adds labels to each shape group. - @private - */ - - }, { - key: "_renderLabels", - value: function _renderLabels() { - var _this5 = this; - - var labelData = []; - - this._update.merge(this._enter).data().forEach(function (datum, i) { - var d = datum; - - if (datum.nested && datum.key && datum.values) { - d = datum.values[0]; - i = _this5._data.indexOf(d); - } - - var labels = _this5._label(d, i); - - if (_this5._labelBounds && labels !== false && labels !== undefined && labels !== null) { - var bounds = _this5._labelBounds(d, i, _this5._aes(datum, i)); - - if (bounds) { - if (labels.constructor !== Array) labels = [labels]; - var x = d.__d3plusShape__ ? d.translate ? d.translate[0] : _this5._x(d.data, d.i) : _this5._x(d, i), - y = d.__d3plusShape__ ? d.translate ? d.translate[1] : _this5._y(d.data, d.i) : _this5._y(d, i); - - if (d.__d3plusShape__) { - d = d.data; - i = d.i; - } - - for (var l = 0; l < labels.length; l++) { - var b = bounds.constructor === Array ? bounds[l] : Object.assign({}, bounds); - - var rotate = _this5._rotate(d, i); - - var r = d.labelConfig && d.labelConfig.rotate ? d.labelConfig.rotate : bounds.angle !== undefined ? bounds.angle : 0; - r += rotate; - var rotateAnchor = rotate !== 0 ? [b.x * -1 || 0, b.y * -1 || 0] : [b.width / 2, b.height / 2]; - labelData.push({ - __d3plus__: true, - data: d, - height: b.height, - l: l, - id: "".concat(_this5._id(d, i), "_").concat(l), - r: r, - rotateAnchor: rotateAnchor, - text: labels[l], - width: b.width, - x: x + b.x, - y: y + b.y - }); - } - } - } - }); - - this._labelClass.data(labelData).duration(this._duration).fontOpacity(this._nestWrapper(this._opacity)).pointerEvents("none").rotate(function (d) { - return d.__d3plus__ ? d.r : d.data.r; - }).rotateAnchor(function (d) { - return d.__d3plus__ ? d.rotateAnchor : d.data.rotateAnchor; - }).select(elem("g.d3plus-".concat(this._name, "-text"), { - parent: this._group, - update: { - opacity: this._active ? this._activeOpacity : 1 - } - }).node()).config(configPrep.bind(this)(this._labelConfig)).render(); - } - /** - @memberof Shape - @desc Renders the current Shape to the page. If a *callback* is specified, it will be called once the shapes are done drawing. - @param {Function} [*callback*] - @chainable - */ - - }, { - key: "render", - value: function render(callback) { - var _this6 = this; - - if (this._select === void 0) { - this.select(_select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).style("display", "block").node()); - } - - this._transition = transition().duration(this._duration); - var data = this._data, - key = this._id; - - if (this._dataFilter) { - data = this._dataFilter(data); - if (data.key) key = data.key; - } - - if (this._sort) { - data = data.sort(function (a, b) { - while (a.__d3plusShape__ || a.__d3plus__) { - a = a.data; - } - - while (b.__d3plusShape__ || b.__d3plus__) { - b = b.data; - } - - return _this6._sort(a, b); - }); - } - - selectAll("g.d3plus-".concat(this._name, "-hover > *, g.d3plus-").concat(this._name, "-active > *")).each(function (d) { - if (d && d.parentNode) d.parentNode.appendChild(this);else this.parentNode.removeChild(this); - }); // Makes the update state of the group selection accessible. - - this._group = elem("g.d3plus-".concat(this._name, "-group"), { - parent: this._select - }); - var update = this._update = elem("g.d3plus-".concat(this._name, "-shape"), { - parent: this._group, - update: { - opacity: this._active ? this._activeOpacity : 1 - } - }).selectAll(".d3plus-".concat(this._name)).data(data, key); // Orders and transforms the updating Shapes. - - update.order(); - - if (this._duration) { - update.transition(this._transition).call(this._applyTransform.bind(this)); - } else { - update.call(this._applyTransform.bind(this)); - } // Makes the enter state of the group selection accessible. - - - var enter = this._enter = update.enter().append(this._tagName).attr("class", function (d, i) { - return "d3plus-Shape d3plus-".concat(_this6._name, " d3plus-id-").concat(strip(_this6._nestWrapper(_this6._id)(d, i))); - }).call(this._applyTransform.bind(this)).attr("aria-label", this._ariaLabel).attr("role", this._role).attr("opacity", this._nestWrapper(this._opacity)); - var enterUpdate = enter.merge(update); - var enterUpdateRender = enterUpdate.attr("shape-rendering", this._nestWrapper(this._shapeRendering)); - - if (this._duration) { - enterUpdateRender = enterUpdateRender.attr("pointer-events", "none").transition(this._transition).transition().delay(100).attr("pointer-events", this._pointerEvents); - } - - enterUpdateRender.attr("opacity", this._nestWrapper(this._opacity)); // Makes the exit state of the group selection accessible. - - var exit = this._exit = update.exit(); - if (this._duration) exit.transition().delay(this._duration).remove();else exit.remove(); - - this._renderImage(); - - this._renderLabels(); - - this._hoverGroup = elem("g.d3plus-".concat(this._name, "-hover"), { - parent: this._group - }); - this._activeGroup = elem("g.d3plus-".concat(this._name, "-active"), { - parent: this._group - }); - - var hitAreas = this._group.selectAll(".d3plus-HitArea").data(this._hitArea && Object.keys(this._on).length ? data : [], key); - - hitAreas.order().call(this._applyTransform.bind(this)); - var isLine = this._name === "Line"; - isLine && this._path.curve(paths["curve".concat(this._curve.charAt(0).toUpperCase()).concat(this._curve.slice(1))]).defined(this._defined).x(this._x).y(this._y); - var hitEnter = hitAreas.enter().append(isLine ? "path" : "rect").attr("class", function (d, i) { - return "d3plus-HitArea d3plus-id-".concat(strip(_this6._nestWrapper(_this6._id)(d, i))); - }).attr("fill", "black").attr("stroke", "black").attr("pointer-events", "painted").attr("opacity", 0).call(this._applyTransform.bind(this)); - var that = this; - var hitUpdates = hitAreas.merge(hitEnter).each(function (d) { - var i = that._data.indexOf(d); - - var h = that._hitArea(d, i, that._aes(d, i)); - - return h && !(that._name === "Line" && parseFloat(that._strokeWidth(d, i)) > 10) ? _select(this).call(attrize, h) : _select(this).remove(); - }); - hitAreas.exit().remove(); - - this._applyEvents(this._hitArea ? hitUpdates : enterUpdate); - - setTimeout(function () { - if (_this6._active) _this6._renderActive();else if (_this6._hover) _this6._renderHover(); - if (callback) callback(); - }, this._duration + 100); - return this; - } - /** - @memberof Shape - @desc If *value* is specified, sets the highlight accessor to the specified function and returns the current class instance. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "active", - value: function active(_) { - if (!arguments.length || _ === undefined) return this._active; - this._active = _; - - if (this._group) { - // this._renderImage(); - // this._renderLabels(); - this._renderActive(); - } - - return this; - } - /** - @memberof Shape - @desc When shapes are active, this is the opacity of any shape that is not active. - @param {Number} *value* = 0.25 - @chainable - */ - - }, { - key: "activeOpacity", - value: function activeOpacity(_) { - return arguments.length ? (this._activeOpacity = _, this) : this._activeOpacity; - } - /** - @memberof Shape - @desc The style to apply to active shapes. - @param {Object} *value* - @chainable - */ - - }, { - key: "activeStyle", - value: function activeStyle(_) { - return arguments.length ? (this._activeStyle = assign({}, this._activeStyle, _), this) : this._activeStyle; - } - /** - @memberof Shape - @desc If *value* is specified, sets the aria-label attribute to the specified function or string and returns the current class instance. - @param {Function|String} *value* - @chainable - */ - - }, { - key: "ariaLabel", - value: function ariaLabel(_) { - return _ !== undefined ? (this._ariaLabel = typeof _ === "function" ? _ : constant$1(_), this) : this._ariaLabel; - } - /** - @memberof Shape - @desc If *value* is specified, sets the background-image accessor to the specified function or string and returns the current class instance. - @param {Function|String} [*value* = false] - @chainable - */ - - }, { - key: "backgroundImage", - value: function backgroundImage(_) { - return arguments.length ? (this._backgroundImage = typeof _ === "function" ? _ : constant$1(_), this) : this._backgroundImage; - } - /** - @memberof Shape - @desc If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. A shape will be drawn for each object in the array. - @param {Array} [*data* = []] - @chainable - */ - - }, { - key: "data", - value: function data(_) { - return arguments.length ? (this._data = _, this) : this._data; - } - /** - @memberof Shape - @desc Determines if either the X or Y position is discrete along a Line, which helps in determining the nearest data point on a line for a hit area event. - @param {String} *value* - @chainable - */ - - }, { - key: "discrete", - value: function discrete(_) { - return arguments.length ? (this._discrete = _, this) : this._discrete; - } - /** - @memberof Shape - @desc If *ms* is specified, sets the animation duration to the specified number and returns the current class instance. If *ms* is not specified, returns the current animation duration. - @param {Number} [*ms* = 600] - @chainable - */ - - }, { - key: "duration", - value: function duration(_) { - return arguments.length ? (this._duration = _, this) : this._duration; - } - /** - @memberof Shape - @desc If *value* is specified, sets the fill accessor to the specified function or string and returns the current class instance. - @param {Function|String} [*value* = "black"] - @chainable - */ - - }, { - key: "fill", - value: function fill(_) { - return arguments.length ? (this._fill = typeof _ === "function" ? _ : constant$1(_), this) : this._fill; - } - /** - @memberof Shape - @desc Defines the "fill-opacity" attribute for the shapes. - @param {Function|Number} [*value* = 1] - @chainable - */ - - }, { - key: "fillOpacity", - value: function fillOpacity(_) { - return arguments.length ? (this._fillOpacity = typeof _ === "function" ? _ : constant$1(_), this) : this._fillOpacity; - } - /** - @memberof Shape - @desc If *value* is specified, sets the highlight accessor to the specified function and returns the current class instance. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "hover", - value: function hover(_) { - if (!arguments.length || _ === void 0) return this._hover; - this._hover = _; - - if (this._group) { - // this._renderImage(); - // this._renderLabels(); - this._renderHover(); - } - - return this; - } - /** - @memberof Shape - @desc The style to apply to hovered shapes. - @param {Object} *value* - @chainable - */ - - }, { - key: "hoverStyle", - value: function hoverStyle(_) { - return arguments.length ? (this._hoverStyle = assign({}, this._hoverStyle, _), this) : this._hoverStyle; - } - /** - @memberof Shape - @desc If *value* is specified, sets the hover opacity to the specified function and returns the current class instance. - @param {Number} [*value* = 0.5] - @chainable - */ - - }, { - key: "hoverOpacity", - value: function hoverOpacity(_) { - return arguments.length ? (this._hoverOpacity = _, this) : this._hoverOpacity; - } - /** - @memberof Shape - @desc If *bounds* is specified, sets the mouse hit area to the specified function and returns the current class instance. If *bounds* is not specified, returns the current mouse hit area accessor. - @param {Function} [*bounds*] The given function is passed the data point, index, and internally defined properties of the shape and should return an object containing the following values: `width`, `height`, `x`, `y`. - @chainable - @example - function(d, i, shape) { - return { - "width": shape.width, - "height": shape.height, - "x": -shape.width / 2, - "y": -shape.height / 2 - }; - } - */ - - }, { - key: "hitArea", - value: function hitArea(_) { - return arguments.length ? (this._hitArea = typeof _ === "function" ? _ : constant$1(_), this) : this._hitArea; - } - /** - @memberof Shape - @desc If *value* is specified, sets the id accessor to the specified function and returns the current class instance. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "id", - value: function id(_) { - return arguments.length ? (this._id = _, this) : this._id; - } - /** - @memberof Shape - @desc If *value* is specified, sets the label accessor to the specified function or string and returns the current class instance. - @param {Function|String|Array} [*value*] - @chainable - */ - - }, { - key: "label", - value: function label(_) { - return arguments.length ? (this._label = typeof _ === "function" ? _ : constant$1(_), this) : this._label; - } - /** - @memberof Shape - @desc If *bounds* is specified, sets the label bounds to the specified function and returns the current class instance. If *bounds* is not specified, returns the current inner bounds accessor. - @param {Function} [*bounds*] The given function is passed the data point, index, and internally defined properties of the shape and should return an object containing the following values: `width`, `height`, `x`, `y`. If an array is returned from the function, each value will be used in conjunction with each label. - @chainable - @example - function(d, i, shape) { - return { - "width": shape.width, - "height": shape.height, - "x": -shape.width / 2, - "y": -shape.height / 2 - }; - } - */ - - }, { - key: "labelBounds", - value: function labelBounds(_) { - return arguments.length ? (this._labelBounds = typeof _ === "function" ? _ : constant$1(_), this) : this._labelBounds; - } - /** - @memberof Shape - @desc A pass-through to the config method of the TextBox class used to create a shape's labels. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "labelConfig", - value: function labelConfig(_) { - return arguments.length ? (this._labelConfig = assign(this._labelConfig, _), this) : this._labelConfig; - } - /** - @memberof Shape - @desc If *value* is specified, sets the opacity accessor to the specified function or number and returns the current class instance. - @param {Number} [*value* = 1] - @chainable - */ - - }, { - key: "opacity", - value: function opacity(_) { - return arguments.length ? (this._opacity = typeof _ === "function" ? _ : constant$1(_), this) : this._opacity; - } - /** - @memberof Shape - @desc If *value* is specified, sets the pointerEvents accessor to the specified function or string and returns the current class instance. - @param {String} [*value*] - @chainable - */ - - }, { - key: "pointerEvents", - value: function pointerEvents(_) { - return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : constant$1(_), this) : this._pointerEvents; - } - /** - @memberof Shape - @desc If *value* is specified, sets the role attribute to the specified function or string and returns the current class instance. - @param {Function|String} *value* - @chainable - */ - - }, { - key: "role", - value: function role(_) { - return _ !== undefined ? (this._role = typeof _ === "function" ? _ : constant$1(_), this) : this._role; - } - /** - @memberof Shape - @desc If *value* is specified, sets the rotate accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value* = 0] - @chainable - */ - - }, { - key: "rotate", - value: function rotate(_) { - return arguments.length ? (this._rotate = typeof _ === "function" ? _ : constant$1(_), this) : this._rotate; - } - /** - @memberof Shape - @desc Defines the "rx" attribute for the shapes. - @param {Function|Number} [*value* = 0] - @chainable - */ - - }, { - key: "rx", - value: function rx(_) { - return arguments.length ? (this._rx = typeof _ === "function" ? _ : constant$1(_), this) : this._rx; - } - /** - @memberof Shape - @desc Defines the "rx" attribute for the shapes. - @param {Function|Number} [*value* = 0] - @chainable - */ - - }, { - key: "ry", - value: function ry(_) { - return arguments.length ? (this._ry = typeof _ === "function" ? _ : constant$1(_), this) : this._ry; - } - /** - @memberof Shape - @desc If *value* is specified, sets the scale accessor to the specified function or string and returns the current class instance. - @param {Function|Number} [*value* = 1] - @chainable - */ - - }, { - key: "scale", - value: function scale(_) { - return arguments.length ? (this._scale = typeof _ === "function" ? _ : constant$1(_), this) : this._scale; - } - /** - @memberof Shape - @desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element. - @param {String|HTMLElement} [*selector* = d3.select("body").append("svg")] - @chainable - */ - - }, { - key: "select", - value: function select(_) { - return arguments.length ? (this._select = _select(_), this) : this._select; - } - /** - @memberof Shape - @desc If *value* is specified, sets the shape-rendering accessor to the specified function or string and returns the current class instance. - @param {Function|String} [*value* = "geometricPrecision"] - @chainable - @example - function(d) { - return d.x; - } - */ - - }, { - key: "shapeRendering", - value: function shapeRendering(_) { - return arguments.length ? (this._shapeRendering = typeof _ === "function" ? _ : constant$1(_), this) : this._shapeRendering; - } - /** - @memberof Shape - @desc If *value* is specified, sets the sort comparator to the specified function and returns the current class instance. - @param {false|Function} [*value* = []] - @chainable - */ - - }, { - key: "sort", - value: function sort(_) { - return arguments.length ? (this._sort = _, this) : this._sort; - } - /** - @memberof Shape - @desc If *value* is specified, sets the stroke accessor to the specified function or string and returns the current class instance. - @param {Function|String} [*value* = "black"] - @chainable - */ - - }, { - key: "stroke", - value: function stroke(_) { - return arguments.length ? (this._stroke = typeof _ === "function" ? _ : constant$1(_), this) : this._stroke; - } - /** - @memberof Shape - @desc Defines the "stroke-dasharray" attribute for the shapes. - @param {Function|String} [*value* = "1"] - @chainable - */ - - }, { - key: "strokeDasharray", - value: function strokeDasharray(_) { - return arguments.length ? (this._strokeDasharray = typeof _ === "function" ? _ : constant$1(_), this) : this._strokeDasharray; - } - /** - @memberof Shape - @desc Defines the "stroke-linecap" attribute for the shapes. Accepted values are `"butt"`, `"round"`, and `"square"`. - @param {Function|String} [*value* = "butt"] - @chainable - */ - - }, { - key: "strokeLinecap", - value: function strokeLinecap(_) { - return arguments.length ? (this._strokeLinecap = typeof _ === "function" ? _ : constant$1(_), this) : this._strokeLinecap; - } - /** - @memberof Shape - @desc Defines the "stroke-opacity" attribute for the shapes. - @param {Function|Number} [*value* = 1] - @chainable - */ - - }, { - key: "strokeOpacity", - value: function strokeOpacity(_) { - return arguments.length ? (this._strokeOpacity = typeof _ === "function" ? _ : constant$1(_), this) : this._strokeOpacity; - } - /** - @memberof Shape - @desc If *value* is specified, sets the stroke-width accessor to the specified function or string and returns the current class instance. - @param {Function|Number} [*value* = 0] - @chainable - */ - - }, { - key: "strokeWidth", - value: function strokeWidth(_) { - return arguments.length ? (this._strokeWidth = typeof _ === "function" ? _ : constant$1(_), this) : this._strokeWidth; - } - /** - @memberof Shape - @desc If *value* is specified, sets the text-anchor accessor to the specified function or string and returns the current class instance. - @param {Function|String|Array} [*value* = "start"] - @chainable - */ - - }, { - key: "textAnchor", - value: function textAnchor(_) { - return arguments.length ? (this._textAnchor = typeof _ === "function" ? _ : constant$1(_), this) : this._textAnchor; - } - /** - @memberof Shape - @desc If *value* is specified, sets the vector-effect accessor to the specified function or string and returns the current class instance. - @param {Function|String} [*value* = "non-scaling-stroke"] - @chainable - */ - - }, { - key: "vectorEffect", - value: function vectorEffect(_) { - return arguments.length ? (this._vectorEffect = typeof _ === "function" ? _ : constant$1(_), this) : this._vectorEffect; - } - /** - @memberof Shape - @desc If *value* is specified, sets the vertical alignment accessor to the specified function or string and returns the current class instance. - @param {Function|String|Array} [*value* = "start"] - @chainable - */ - - }, { - key: "verticalAlign", - value: function verticalAlign(_) { - return arguments.length ? (this._verticalAlign = typeof _ === "function" ? _ : constant$1(_), this) : this._verticalAlign; - } - /** - @memberof Shape - @desc If *value* is specified, sets the x accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.x; - } - */ - - }, { - key: "x", - value: function x(_) { - return arguments.length ? (this._x = typeof _ === "function" ? _ : constant$1(_), this) : this._x; - } - /** - @memberof Shape - @desc If *value* is specified, sets the y accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.y; - } - */ - - }, { - key: "y", - value: function y(_) { - return arguments.length ? (this._y = typeof _ === "function" ? _ : constant$1(_), this) : this._y; - } - }]); - - return Shape; - }(BaseClass); - - /** - * de Casteljau's algorithm for drawing and splitting bezier curves. - * Inspired by https://pomax.github.io/bezierinfo/ - * - * @param {Number[][]} points Array of [x,y] points: [start, control1, control2, ..., end] - * The original segment to split. - * @param {Number} t Where to split the curve (value between [0, 1]) - * @return {Object} An object { left, right } where left is the segment from 0..t and - * right is the segment from t..1. - */ - function decasteljau(points, t) { - var left = []; - var right = []; - - function decasteljauRecurse(points, t) { - if (points.length === 1) { - left.push(points[0]); - right.push(points[0]); - } else { - var newPoints = Array(points.length - 1); - - for (var i = 0; i < newPoints.length; i++) { - if (i === 0) { - left.push(points[0]); - } - - if (i === newPoints.length - 1) { - right.push(points[i + 1]); - } - - newPoints[i] = [(1 - t) * points[i][0] + t * points[i + 1][0], (1 - t) * points[i][1] + t * points[i + 1][1]]; - } - - decasteljauRecurse(newPoints, t); - } - } - - if (points.length) { - decasteljauRecurse(points, t); - } - - return { - left: left, - right: right.reverse() - }; - } - /** - * Convert segments represented as points back into a command object - * - * @param {Number[][]} points Array of [x,y] points: [start, control1, control2, ..., end] - * Represents a segment - * @return {Object} A command object representing the segment. - */ - - - function pointsToCommand(points) { - var command = {}; - - if (points.length === 4) { - command.x2 = points[2][0]; - command.y2 = points[2][1]; - } - - if (points.length >= 3) { - command.x1 = points[1][0]; - command.y1 = points[1][1]; - } - - command.x = points[points.length - 1][0]; - command.y = points[points.length - 1][1]; - - if (points.length === 4) { - // start, control1, control2, end - command.type = 'C'; - } else if (points.length === 3) { - // start, control, end - command.type = 'Q'; - } else { - // start, end - command.type = 'L'; - } - - return command; - } - /** - * Runs de Casteljau's algorithm enough times to produce the desired number of segments. - * - * @param {Number[][]} points Array of [x,y] points for de Casteljau (the initial segment to split) - * @param {Number} segmentCount Number of segments to split the original into - * @return {Number[][][]} Array of segments - */ - - - function splitCurveAsPoints(points, segmentCount) { - segmentCount = segmentCount || 2; - var segments = []; - var remainingCurve = points; - var tIncrement = 1 / segmentCount; // x-----x-----x-----x - // t= 0.33 0.66 1 - // x-----o-----------x - // r= 0.33 - // x-----o-----x - // r= 0.5 (0.33 / (1 - 0.33)) === tIncrement / (1 - (tIncrement * (i - 1)) - // x-----x-----x-----x----x - // t= 0.25 0.5 0.75 1 - // x-----o----------------x - // r= 0.25 - // x-----o----------x - // r= 0.33 (0.25 / (1 - 0.25)) - // x-----o----x - // r= 0.5 (0.25 / (1 - 0.5)) - - for (var i = 0; i < segmentCount - 1; i++) { - var tRelative = tIncrement / (1 - tIncrement * i); - var split = decasteljau(remainingCurve, tRelative); - segments.push(split.left); - remainingCurve = split.right; - } // last segment is just to the end from the last point - - - segments.push(remainingCurve); - return segments; - } - /** - * Convert command objects to arrays of points, run de Casteljau's algorithm on it - * to split into to the desired number of segments. - * - * @param {Object} commandStart The start command object - * @param {Object} commandEnd The end command object - * @param {Number} segmentCount The number of segments to create - * @return {Object[]} An array of commands representing the segments in sequence - */ - - - function splitCurve(commandStart, commandEnd, segmentCount) { - var points = [[commandStart.x, commandStart.y]]; - - if (commandEnd.x1 != null) { - points.push([commandEnd.x1, commandEnd.y1]); - } - - if (commandEnd.x2 != null) { - points.push([commandEnd.x2, commandEnd.y2]); - } - - points.push([commandEnd.x, commandEnd.y]); - return splitCurveAsPoints(points, segmentCount).map(pointsToCommand); - } - - var commandTokenRegex = /[MLCSTQAHVmlcstqahv]|-?[\d.e+-]+/g; - /** - * List of params for each command type in a path `d` attribute - */ - - var typeMap = { - M: ['x', 'y'], - L: ['x', 'y'], - H: ['x'], - V: ['y'], - C: ['x1', 'y1', 'x2', 'y2', 'x', 'y'], - S: ['x2', 'y2', 'x', 'y'], - Q: ['x1', 'y1', 'x', 'y'], - T: ['x', 'y'], - A: ['rx', 'ry', 'xAxisRotation', 'largeArcFlag', 'sweepFlag', 'x', 'y'] - }; // Add lower case entries too matching uppercase (e.g. 'm' == 'M') - - Object.keys(typeMap).forEach(function (key) { - typeMap[key.toLowerCase()] = typeMap[key]; - }); - - function arrayOfLength(length, value) { - var array = Array(length); - - for (var i = 0; i < length; i++) { - array[i] = value; - } - - return array; - } - /** - * Converts a command object to a string to be used in a `d` attribute - * @param {Object} command A command object - * @return {String} The string for the `d` attribute - */ - - - function commandToString(command) { - return "".concat(command.type).concat(typeMap[command.type].map(function (p) { - return command[p]; - }).join(',')); - } - /** - * Converts command A to have the same type as command B. - * - * e.g., L0,5 -> C0,5,0,5,0,5 - * - * Uses these rules: - * x1 <- x - * x2 <- x - * y1 <- y - * y2 <- y - * rx <- 0 - * ry <- 0 - * xAxisRotation <- read from B - * largeArcFlag <- read from B - * sweepflag <- read from B - * - * @param {Object} aCommand Command object from path `d` attribute - * @param {Object} bCommand Command object from path `d` attribute to match against - * @return {Object} aCommand converted to type of bCommand - */ - - - function convertToSameType(aCommand, bCommand) { - var conversionMap = { - x1: 'x', - y1: 'y', - x2: 'x', - y2: 'y' - }; - var readFromBKeys = ['xAxisRotation', 'largeArcFlag', 'sweepFlag']; // convert (but ignore M types) - - if (aCommand.type !== bCommand.type && bCommand.type.toUpperCase() !== 'M') { - var aConverted = {}; - Object.keys(bCommand).forEach(function (bKey) { - var bValue = bCommand[bKey]; // first read from the A command - - var aValue = aCommand[bKey]; // if it is one of these values, read from B no matter what - - if (aValue === undefined) { - if (readFromBKeys.includes(bKey)) { - aValue = bValue; - } else { - // if it wasn't in the A command, see if an equivalent was - if (aValue === undefined && conversionMap[bKey]) { - aValue = aCommand[conversionMap[bKey]]; - } // if it doesn't have a converted value, use 0 - - - if (aValue === undefined) { - aValue = 0; - } - } - } - - aConverted[bKey] = aValue; - }); // update the type to match B - - aConverted.type = bCommand.type; - aCommand = aConverted; - } - - return aCommand; - } - /** - * Interpolate between command objects commandStart and commandEnd segmentCount times. - * If the types are L, Q, or C then the curves are split as per de Casteljau's algorithm. - * Otherwise we just copy commandStart segmentCount - 1 times, finally ending with commandEnd. - * - * @param {Object} commandStart Command object at the beginning of the segment - * @param {Object} commandEnd Command object at the end of the segment - * @param {Number} segmentCount The number of segments to split this into. If only 1 - * Then [commandEnd] is returned. - * @return {Object[]} Array of ~segmentCount command objects between commandStart and - * commandEnd. (Can be segmentCount+1 objects if commandStart is type M). - */ - - - function splitSegment(commandStart, commandEnd, segmentCount) { - var segments = []; // line, quadratic bezier, or cubic bezier - - if (commandEnd.type === 'L' || commandEnd.type === 'Q' || commandEnd.type === 'C') { - segments = segments.concat(splitCurve(commandStart, commandEnd, segmentCount)); // general case - just copy the same point - } else { - var copyCommand = Object.assign({}, commandStart); // convert M to L - - if (copyCommand.type === 'M') { - copyCommand.type = 'L'; - } - - segments = segments.concat(arrayOfLength(segmentCount - 1).map(function () { - return copyCommand; - })); - segments.push(commandEnd); - } - - return segments; - } - /** - * Extends an array of commandsToExtend to the length of the referenceCommands by - * splitting segments until the number of commands match. Ensures all the actual - * points of commandsToExtend are in the extended array. - * - * @param {Object[]} commandsToExtend The command object array to extend - * @param {Object[]} referenceCommands The command object array to match in length - * @param {Function} excludeSegment a function that takes a start command object and - * end command object and returns true if the segment should be excluded from splitting. - * @return {Object[]} The extended commandsToExtend array - */ - - - function extend$3(commandsToExtend, referenceCommands, excludeSegment) { - // compute insertion points: - // number of segments in the path to extend - var numSegmentsToExtend = commandsToExtend.length - 1; // number of segments in the reference path. - - var numReferenceSegments = referenceCommands.length - 1; // this value is always between [0, 1]. - - var segmentRatio = numSegmentsToExtend / numReferenceSegments; // create a map, mapping segments in referenceCommands to how many points - // should be added in that segment (should always be >= 1 since we need each - // point itself). - // 0 = segment 0-1, 1 = segment 1-2, n-1 = last vertex - - var countPointsPerSegment = arrayOfLength(numReferenceSegments).reduce(function (accum, d, i) { - var insertIndex = Math.floor(segmentRatio * i); // handle excluding segments - - if (excludeSegment && insertIndex < commandsToExtend.length - 1 && excludeSegment(commandsToExtend[insertIndex], commandsToExtend[insertIndex + 1])) { - // set the insertIndex to the segment that this point should be added to: - // round the insertIndex essentially so we split half and half on - // neighbouring segments. hence the segmentRatio * i < 0.5 - var addToPriorSegment = segmentRatio * i % 1 < 0.5; // only skip segment if we already have 1 point in it (can't entirely remove a segment) - - if (accum[insertIndex]) { - // TODO - Note this is a naive algorithm that should work for most d3-area use cases - // but if two adjacent segments are supposed to be skipped, this will not perform as - // expected. Could be updated to search for nearest segment to place the point in, but - // will only do that if necessary. - // add to the prior segment - if (addToPriorSegment) { - if (insertIndex > 0) { - insertIndex -= 1; // not possible to add to previous so adding to next - } else if (insertIndex < commandsToExtend.length - 1) { - insertIndex += 1; - } // add to next segment - - } else if (insertIndex < commandsToExtend.length - 1) { - insertIndex += 1; // not possible to add to next so adding to previous - } else if (insertIndex > 0) { - insertIndex -= 1; - } - } - } - - accum[insertIndex] = (accum[insertIndex] || 0) + 1; - return accum; - }, []); // extend each segment to have the correct number of points for a smooth interpolation - - var extended = countPointsPerSegment.reduce(function (extended, segmentCount, i) { - // if last command, just add `segmentCount` number of times - if (i === commandsToExtend.length - 1) { - var lastCommandCopies = arrayOfLength(segmentCount, Object.assign({}, commandsToExtend[commandsToExtend.length - 1])); // convert M to L - - if (lastCommandCopies[0].type === 'M') { - lastCommandCopies.forEach(function (d) { - d.type = 'L'; - }); - } - - return extended.concat(lastCommandCopies); - } // otherwise, split the segment segmentCount times. - - - return extended.concat(splitSegment(commandsToExtend[i], commandsToExtend[i + 1], segmentCount)); - }, []); // add in the very first point since splitSegment only adds in the ones after it - - extended.unshift(commandsToExtend[0]); - return extended; - } - /** - * Takes a path `d` string and converts it into an array of command - * objects. Drops the `Z` character. - * - * @param {String|null} d A path `d` string - */ - - - function makeCommands(d) { - // split into valid tokens - var tokens = (d || '').match(commandTokenRegex) || []; - var commands = []; - var commandArgs; - var command; // iterate over each token, checking if we are at a new command - // by presence in the typeMap - - for (var i = 0; i < tokens.length; ++i) { - commandArgs = typeMap[tokens[i]]; // new command found: - - if (commandArgs) { - command = { - type: tokens[i] - }; // add each of the expected args for this command: - - for (var a = 0; a < commandArgs.length; ++a) { - command[commandArgs[a]] = +tokens[i + a + 1]; - } // need to increment our token index appropriately since - // we consumed token args - - - i += commandArgs.length; - commands.push(command); - } - } - - return commands; - } - /** - * Interpolate from A to B by extending A and B during interpolation to have - * the same number of points. This allows for a smooth transition when they - * have a different number of points. - * - * Ignores the `Z` character in paths unless both A and B end with it. - * - * @param {String} a The `d` attribute for a path - * @param {String} b The `d` attribute for a path - * @param {Function} excludeSegment a function that takes a start command object and - * end command object and returns true if the segment should be excluded from splitting. - * @returns {Function} Interpolation function that maps t ([0, 1]) to a path `d` string. - */ - - - function interpolatePath(a, b, excludeSegment) { - var aCommands = makeCommands(a); - var bCommands = makeCommands(b); - - if (!aCommands.length && !bCommands.length) { - return function nullInterpolator() { - return ''; - }; - } // if A is empty, treat it as if it used to contain just the first point - // of B. This makes it so the line extends out of from that first point. - - - if (!aCommands.length) { - aCommands.push(bCommands[0]); // otherwise if B is empty, treat it as if it contains the first point - // of A. This makes it so the line retracts into the first point. - } else if (!bCommands.length) { - bCommands.push(aCommands[0]); - } // extend to match equal size - - - var numPointsToExtend = Math.abs(bCommands.length - aCommands.length); - - if (numPointsToExtend !== 0) { - // B has more points than A, so add points to A before interpolating - if (bCommands.length > aCommands.length) { - aCommands = extend$3(aCommands, bCommands, excludeSegment); // else if A has more points than B, add more points to B - } else if (bCommands.length < aCommands.length) { - bCommands = extend$3(bCommands, aCommands, excludeSegment); - } - } // commands have same length now. - // convert commands in A to the same type as those in B - - - aCommands = aCommands.map(function (aCommand, i) { - return convertToSameType(aCommand, bCommands[i]); - }); // create mutable interpolated command objects - - var interpolatedCommands = aCommands.map(function (aCommand) { - return _objectSpread2({}, aCommand); - }); - var addZ = (a == null || a[a.length - 1] === 'Z') && (b == null || b[b.length - 1] === 'Z'); - return function pathInterpolator(t) { - // at 1 return the final value without the extensions used during interpolation - if (t === 1) { - return b == null ? '' : b; - } // interpolate the commands using the mutable interpolated command objs - // we can skip at t=0 since we copied aCommands to begin - - - if (t > 0) { - for (var i = 0; i < interpolatedCommands.length; ++i) { - var aCommand = aCommands[i]; - var bCommand = bCommands[i]; - var interpolatedCommand = interpolatedCommands[i]; - - var _iterator = _createForOfIteratorHelper(typeMap[interpolatedCommand.type]), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var arg = _step.value; - interpolatedCommand[arg] = (1 - t) * aCommand[arg] + t * bCommand[arg]; // do not use floats for flags (#27), round to integer - - if (arg === 'largeArcFlag' || arg === 'sweepFlag') { - interpolatedCommand[arg] = Math.round(interpolatedCommand[arg]); - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - } // convert to a string (fastest concat: https://jsperf.com/join-concat/150) - - - var interpolatedString = ''; - - var _iterator2 = _createForOfIteratorHelper(interpolatedCommands), - _step2; - - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var _interpolatedCommand = _step2.value; - interpolatedString += commandToString(_interpolatedCommand); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - - if (addZ) { - interpolatedString += 'Z'; - } - - return interpolatedString; - }; - } - - function polygonArea (polygon) { - var i = -1, - n = polygon.length, - a, - b = polygon[n - 1], - area = 0; - - while (++i < n) { - a = b; - b = polygon[i]; - area += a[1] * b[0] - a[0] * b[1]; - } - - return area / 2; - } - - function polygonCentroid (polygon) { - var i = -1, - n = polygon.length, - x = 0, - y = 0, - a, - b = polygon[n - 1], - c, - k = 0; - - while (++i < n) { - a = b; - b = polygon[i]; - k += c = a[0] * b[1] - b[0] * a[1]; - x += (a[0] + b[0]) * c; - y += (a[1] + b[1]) * c; - } - - return k *= 3, [x / k, y / k]; - } - - function polygonContains (polygon, point) { - var n = polygon.length, - p = polygon[n - 1], - x = point[0], - y = point[1], - x0 = p[0], - y0 = p[1], - x1, - y1, - inside = false; - - for (var i = 0; i < n; ++i) { - p = polygon[i], x1 = p[0], y1 = p[1]; - if (y1 > y !== y0 > y && x < (x0 - x1) * (y - y1) / (y0 - y1) + x1) inside = !inside; - x0 = x1, y0 = y1; - } - - return inside; - } - - /** - @function lineIntersection - @desc Finds the intersection point (if there is one) of the lines p1q1 and p2q2. - @param {Array} p1 The first point of the first line segment, which should always be an `[x, y]` formatted Array. - @param {Array} q1 The second point of the first line segment, which should always be an `[x, y]` formatted Array. - @param {Array} p2 The first point of the second line segment, which should always be an `[x, y]` formatted Array. - @param {Array} q2 The second point of the second line segment, which should always be an `[x, y]` formatted Array. - @returns {Boolean} - */ - function lineIntersection (p1, q1, p2, q2) { - // allow for some margins due to numerical errors - var eps = 1e-9; // find the intersection point between the two infinite lines - - var dx1 = p1[0] - q1[0], - dx2 = p2[0] - q2[0], - dy1 = p1[1] - q1[1], - dy2 = p2[1] - q2[1]; - var denom = dx1 * dy2 - dy1 * dx2; - if (Math.abs(denom) < eps) return null; - var cross1 = p1[0] * q1[1] - p1[1] * q1[0], - cross2 = p2[0] * q2[1] - p2[1] * q2[0]; - var px = (cross1 * dx2 - cross2 * dx1) / denom, - py = (cross1 * dy2 - cross2 * dy1) / denom; - return [px, py]; - } - - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest(); - } - - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _unsupportedIterableToArray$1(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); - } - - function _arrayLikeToArray$1(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } - - function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - /** - @function segmentBoxContains - @desc Checks whether a point is inside the bounding box of a line segment. - @param {Array} s1 The first point of the line segment to be used for the bounding box, which should always be an `[x, y]` formatted Array. - @param {Array} s2 The second point of the line segment to be used for the bounding box, which should always be an `[x, y]` formatted Array. - @param {Array} p The point to be checked, which should always be an `[x, y]` formatted Array. - @returns {Boolean} - */ - - - function segmentBoxContains (s1, s2, p) { - var eps = 1e-9, - _p = _slicedToArray(p, 2), - px = _p[0], - py = _p[1]; - - return !(px < Math.min(s1[0], s2[0]) - eps || px > Math.max(s1[0], s2[0]) + eps || py < Math.min(s1[1], s2[1]) - eps || py > Math.max(s1[1], s2[1]) + eps); - } - - /** - @function segmentsIntersect - @desc Checks whether the line segments p1q1 && p2q2 intersect. - @param {Array} p1 The first point of the first line segment, which should always be an `[x, y]` formatted Array. - @param {Array} q1 The second point of the first line segment, which should always be an `[x, y]` formatted Array. - @param {Array} p2 The first point of the second line segment, which should always be an `[x, y]` formatted Array. - @param {Array} q2 The second point of the second line segment, which should always be an `[x, y]` formatted Array. - @returns {Boolean} - */ - - function segmentsIntersect (p1, q1, p2, q2) { - var p = lineIntersection(p1, q1, p2, q2); - if (!p) return false; - return segmentBoxContains(p1, q1, p) && segmentBoxContains(p2, q2, p); - } - - /** - @function polygonInside - @desc Checks if one polygon is inside another polygon. - @param {Array} polyA An Array of `[x, y]` points to be used as the inner polygon, checking if it is inside polyA. - @param {Array} polyB An Array of `[x, y]` points to be used as the containing polygon. - @returns {Boolean} - */ - - function polygonInside (polyA, polyB) { - var iA = -1; - var nA = polyA.length; - var nB = polyB.length; - var bA = polyA[nA - 1]; - - while (++iA < nA) { - var aA = bA; - bA = polyA[iA]; - var iB = -1; - var bB = polyB[nB - 1]; - - while (++iB < nB) { - var aB = bB; - bB = polyB[iB]; - if (segmentsIntersect(aA, bA, aB, bB)) return false; - } - } - - return polygonContains(polyB, polyA[0]); - } - - function _slicedToArray$1(arr, i) { - return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$1(); - } - - function _nonIterableRest$1() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _unsupportedIterableToArray$2(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); - } - - function _arrayLikeToArray$2(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } - - function _iterableToArrayLimit$1(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - function _arrayWithHoles$1(arr) { - if (Array.isArray(arr)) return arr; - } - /** - @function polygonRayCast - @desc Gives the two closest intersection points between a ray cast from a point inside a polygon. The two points should lie on opposite sides of the origin. - @param {Array} poly The polygon to test against, which should be an `[x, y]` formatted Array. - @param {Array} origin The origin point of the ray to be cast, which should be an `[x, y]` formatted Array. - @param {Number} [alpha = 0] The angle in radians of the ray. - @returns {Array} An array containing two values, the closest point on the left and the closest point on the right. If either point cannot be found, that value will be `null`. - */ - - function polygonRayCast (poly, origin) { - var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var eps = 1e-9; - origin = [origin[0] + eps * Math.cos(alpha), origin[1] + eps * Math.sin(alpha)]; - - var _origin = origin, - _origin2 = _slicedToArray$1(_origin, 2), - x0 = _origin2[0], - y0 = _origin2[1]; - - var shiftedOrigin = [x0 + Math.cos(alpha), y0 + Math.sin(alpha)]; - var idx = 0; - if (Math.abs(shiftedOrigin[0] - x0) < eps) idx = 1; - var i = -1; - var n = poly.length; - var b = poly[n - 1]; - var minSqDistLeft = Number.MAX_VALUE; - var minSqDistRight = Number.MAX_VALUE; - var closestPointLeft = null; - var closestPointRight = null; - - while (++i < n) { - var a = b; - b = poly[i]; - var p = lineIntersection(origin, shiftedOrigin, a, b); - - if (p && segmentBoxContains(a, b, p)) { - var sqDist = pointDistanceSquared(origin, p); - - if (p[idx] < origin[idx]) { - if (sqDist < minSqDistLeft) { - minSqDistLeft = sqDist; - closestPointLeft = p; - } - } else if (p[idx] > origin[idx]) { - if (sqDist < minSqDistRight) { - minSqDistRight = sqDist; - closestPointRight = p; - } - } - } - } - - return [closestPointLeft, closestPointRight]; - } - - /** - @function pointRotate - @desc Rotates a point around a given origin. - @param {Array} p The point to be rotated, which should always be an `[x, y]` formatted Array. - @param {Number} alpha The angle in radians to rotate. - @param {Array} [origin = [0, 0]] The origin point of the rotation, which should always be an `[x, y]` formatted Array. - @returns {Boolean} - */ - function pointRotate (p, alpha) { - var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0]; - var cosAlpha = Math.cos(alpha), - sinAlpha = Math.sin(alpha), - xshifted = p[0] - origin[0], - yshifted = p[1] - origin[1]; - return [cosAlpha * xshifted - sinAlpha * yshifted + origin[0], sinAlpha * xshifted + cosAlpha * yshifted + origin[1]]; - } - - /** - @function polygonRotate - @desc Rotates a point around a given origin. - @param {Array} poly The polygon to be rotated, which should be an Array of `[x, y]` values. - @param {Number} alpha The angle in radians to rotate. - @param {Array} [origin = [0, 0]] The origin point of the rotation, which should be an `[x, y]` formatted Array. - @returns {Boolean} - */ - - var polygonRotate = (function (poly, alpha) { - var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0]; - return poly.map(function (p) { - return pointRotate(p, alpha, origin); - }); - }); - - /** - @desc square distance from a point to a segment - @param {Array} point - @param {Array} segmentAnchor1 - @param {Array} segmentAnchor2 - @private - */ - - function getSqSegDist(p, p1, p2) { - var x = p1[0], - y = p1[1]; - var dx = p2[0] - x, - dy = p2[1] - y; - - if (dx !== 0 || dy !== 0) { - var t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy); - - if (t > 1) { - x = p2[0]; - y = p2[1]; - } else if (t > 0) { - x += dx * t; - y += dy * t; - } - } - - dx = p[0] - x; - dy = p[1] - y; - return dx * dx + dy * dy; - } - /** - @desc basic distance-based simplification - @param {Array} polygon - @param {Number} sqTolerance - @private - */ - - - function simplifyRadialDist(poly, sqTolerance) { - var point, - prevPoint = poly[0]; - var newPoints = [prevPoint]; - - for (var i = 1, len = poly.length; i < len; i++) { - point = poly[i]; - - if (pointDistanceSquared(point, prevPoint) > sqTolerance) { - newPoints.push(point); - prevPoint = point; - } - } - - if (prevPoint !== point) newPoints.push(point); - return newPoints; - } - /** - @param {Array} polygon - @param {Number} first - @param {Number} last - @param {Number} sqTolerance - @param {Array} simplified - @private - */ - - - function simplifyDPStep(poly, first, last, sqTolerance, simplified) { - var index, - maxSqDist = sqTolerance; - - for (var i = first + 1; i < last; i++) { - var sqDist = getSqSegDist(poly[i], poly[first], poly[last]); - - if (sqDist > maxSqDist) { - index = i; - maxSqDist = sqDist; - } - } - - if (maxSqDist > sqTolerance) { - if (index - first > 1) simplifyDPStep(poly, first, index, sqTolerance, simplified); - simplified.push(poly[index]); - if (last - index > 1) simplifyDPStep(poly, index, last, sqTolerance, simplified); - } - } - /** - @desc simplification using Ramer-Douglas-Peucker algorithm - @param {Array} polygon - @param {Number} sqTolerance - @private - */ - - - function simplifyDouglasPeucker(poly, sqTolerance) { - var last = poly.length - 1; - var simplified = [poly[0]]; - simplifyDPStep(poly, 0, last, sqTolerance, simplified); - simplified.push(poly[last]); - return simplified; - } - /** - @function largestRect - @desc Simplifies the points of a polygon using both the Ramer-Douglas-Peucker algorithm and basic distance-based simplification. Adapted to an ES6 module from the excellent [Simplify.js](http://mourner.github.io/simplify-js/). - @author Vladimir Agafonkin - @param {Array} poly An Array of points that represent a polygon. - @param {Number} [tolerance = 1] Affects the amount of simplification (in the same metric as the point coordinates). - @param {Boolean} [highestQuality = false] Excludes distance-based preprocessing step which leads to highest quality simplification but runs ~10-20 times slower. - - */ - - - var simplify = (function (poly) { - var tolerance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - var highestQuality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (poly.length <= 2) return poly; - var sqTolerance = tolerance * tolerance; - poly = highestQuality ? poly : simplifyRadialDist(poly, sqTolerance); - poly = simplifyDouglasPeucker(poly, sqTolerance); - return poly; - }); - - function _slicedToArray$2(arr, i) { - return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$2(); - } - - function _nonIterableRest$2() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _unsupportedIterableToArray$3(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); - } - - function _arrayLikeToArray$3(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } - - function _iterableToArrayLimit$2(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - function _arrayWithHoles$2(arr) { - if (Array.isArray(arr)) return arr; - } - - var aspectRatioStep = 0.5; // step size for the aspect ratio - - var angleStep = 5; // step size for angles (in degrees); has linear impact on running time - - var polyCache = {}; - /** - @typedef {Object} LargestRect - @desc The returned Object of the largestRect function. - @property {Number} width The width of the rectangle - @property {Number} height The height of the rectangle - @property {Number} cx The x coordinate of the rectangle's center - @property {Number} cy The y coordinate of the rectangle's center - @property {Number} angle The rotation angle of the rectangle in degrees. The anchor of rotation is the center point. - @property {Number} area The area of the largest rectangle. - @property {Array} points An array of x/y coordinates for each point in the rectangle, useful for rendering paths. - */ - - /** - @function largestRect - @author Daniel Smilkov [dsmilkov@gmail.com] - @desc An angle of zero means that the longer side of the polygon (the width) will be aligned with the x axis. An angle of 90 and/or -90 means that the longer side of the polygon (the width) will be aligned with the y axis. The value can be a number between -90 and 90 specifying the angle of rotation of the polygon, a string which is parsed to a number, or an array of numbers specifying the possible rotations of the polygon. - @param {Array} poly An Array of points that represent a polygon. - @param {Object} [options] An Object that allows for overriding various parameters of the algorithm. - @param {Number|String|Array} [options.angle = d3.range(-90, 95, 5)] The allowed rotations of the final rectangle. - @param {Number|String|Array} [options.aspectRatio] The ratio between the width and height of the rectangle. The value can be a number, a string which is parsed to a number, or an array of numbers specifying the possible aspect ratios of the final rectangle. - @param {Number} [options.maxAspectRatio = 15] The maximum aspect ratio (width/height) allowed for the rectangle. This property should only be used if the aspectRatio is not provided. - @param {Number} [options.minAspectRatio = 1] The minimum aspect ratio (width/height) allowed for the rectangle. This property should only be used if the aspectRatio is not provided. - @param {Number} [options.nTries = 20] The number of randomly drawn points inside the polygon which the algorithm explores as possible center points of the maximal rectangle. - @param {Number} [options.minHeight = 0] The minimum height of the rectangle. - @param {Number} [options.minWidth = 0] The minimum width of the rectangle. - @param {Number} [options.tolerance = 0.02] The simplification tolerance factor, between 0 and 1. A larger tolerance corresponds to more extensive simplification. - @param {Array} [options.origin] The center point of the rectangle. If specified, the rectangle will be fixed at that point, otherwise the algorithm optimizes across all possible points. The given value can be either a two dimensional array specifying the x and y coordinate of the origin or an array of two dimensional points specifying multiple possible center points of the rectangle. - @param {Boolean} [options.cache] Whether or not to cache the result, which would be used in subsequent calculations to preserve consistency and speed up calculation time. - @return {LargestRect} - */ - - function largestRect (poly) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (poly.length < 3) { - if (options.verbose) console.error("polygon has to have at least 3 points", poly); - return null; - } // For visualization debugging purposes - - - var events = []; // User's input normalization - - options = Object.assign({ - angle: range(-90, 90 + angleStep, angleStep), - cache: true, - maxAspectRatio: 15, - minAspectRatio: 1, - minHeight: 0, - minWidth: 0, - nTries: 20, - tolerance: 0.02, - verbose: false - }, options); - var angles = options.angle instanceof Array ? options.angle : typeof options.angle === "number" ? [options.angle] : typeof options.angle === "string" && !isNaN(options.angle) ? [Number(options.angle)] : []; - var aspectRatios = options.aspectRatio instanceof Array ? options.aspectRatio : typeof options.aspectRatio === "number" ? [options.aspectRatio] : typeof options.aspectRatio === "string" && !isNaN(options.aspectRatio) ? [Number(options.aspectRatio)] : []; - var origins = options.origin && options.origin instanceof Array ? options.origin[0] instanceof Array ? options.origin : [options.origin] : []; - var cacheString; - - if (options.cache) { - cacheString = arrayMerge(poly).join(","); - cacheString += "-".concat(options.minAspectRatio); - cacheString += "-".concat(options.maxAspectRatio); - cacheString += "-".concat(options.minHeight); - cacheString += "-".concat(options.minWidth); - cacheString += "-".concat(angles.join(",")); - cacheString += "-".concat(origins.join(",")); - if (polyCache[cacheString]) return polyCache[cacheString]; - } - - var area = Math.abs(polygonArea(poly)); // take absolute value of the signed area - - if (area === 0) { - if (options.verbose) console.error("polygon has 0 area", poly); - return null; - } // get the width of the bounding box of the original polygon to determine tolerance - - - var _extent = extent(poly, function (d) { - return d[0]; - }), - _extent2 = _slicedToArray$2(_extent, 2), - minx = _extent2[0], - maxx = _extent2[1]; - - var _extent3 = extent(poly, function (d) { - return d[1]; - }), - _extent4 = _slicedToArray$2(_extent3, 2), - miny = _extent4[0], - maxy = _extent4[1]; // simplify polygon - - - var tolerance = Math.min(maxx - minx, maxy - miny) * options.tolerance; - if (tolerance > 0) poly = simplify(poly, tolerance); - if (options.events) events.push({ - type: "simplify", - poly: poly - }); // get the width of the bounding box of the simplified polygon - - var _extent5 = extent(poly, function (d) { - return d[0]; - }); - - var _extent6 = _slicedToArray$2(_extent5, 2); - - minx = _extent6[0]; - maxx = _extent6[1]; - - var _extent7 = extent(poly, function (d) { - return d[1]; - }); - - var _extent8 = _slicedToArray$2(_extent7, 2); - - miny = _extent8[0]; - maxy = _extent8[1]; - var boxWidth = maxx - minx, - boxHeight = maxy - miny; // discretize the binary search for optimal width to a resolution of this times the polygon width - - var widthStep = Math.min(boxWidth, boxHeight) / 50; // populate possible center points with random points inside the polygon - - if (!origins.length) { - // get the centroid of the polygon - var centroid = polygonCentroid(poly); - - if (!isFinite(centroid[0])) { - if (options.verbose) console.error("cannot find centroid", poly); - return null; - } - - if (polygonContains(poly, centroid)) origins.push(centroid); - var nTries = options.nTries; // get few more points inside the polygon - - while (nTries) { - var rndX = Math.random() * boxWidth + minx; - var rndY = Math.random() * boxHeight + miny; - var rndPoint = [rndX, rndY]; - - if (polygonContains(poly, rndPoint)) { - origins.push(rndPoint); - } - - nTries--; - } - } - - if (options.events) events.push({ - type: "origins", - points: origins - }); - var maxArea = 0; - var maxRect = null; - - for (var ai = 0; ai < angles.length; ai++) { - var angle = angles[ai]; - var angleRad = -angle * Math.PI / 180; - if (options.events) events.push({ - type: "angle", - angle: angle - }); - - for (var i = 0; i < origins.length; i++) { - var origOrigin = origins[i]; // generate improved origins - - var _polygonRayCast = polygonRayCast(poly, origOrigin, angleRad), - _polygonRayCast2 = _slicedToArray$2(_polygonRayCast, 2), - p1W = _polygonRayCast2[0], - p2W = _polygonRayCast2[1]; - - var _polygonRayCast3 = polygonRayCast(poly, origOrigin, angleRad + Math.PI / 2), - _polygonRayCast4 = _slicedToArray$2(_polygonRayCast3, 2), - p1H = _polygonRayCast4[0], - p2H = _polygonRayCast4[1]; - - var modifOrigins = []; - if (p1W && p2W) modifOrigins.push([(p1W[0] + p2W[0]) / 2, (p1W[1] + p2W[1]) / 2]); // average along with width axis - - if (p1H && p2H) modifOrigins.push([(p1H[0] + p2H[0]) / 2, (p1H[1] + p2H[1]) / 2]); // average along with height axis - - if (options.events) events.push({ - type: "modifOrigin", - idx: i, - p1W: p1W, - p2W: p2W, - p1H: p1H, - p2H: p2H, - modifOrigins: modifOrigins - }); - - for (var _i2 = 0; _i2 < modifOrigins.length; _i2++) { - var origin = modifOrigins[_i2]; - if (options.events) events.push({ - type: "origin", - cx: origin[0], - cy: origin[1] - }); - - var _polygonRayCast5 = polygonRayCast(poly, origin, angleRad), - _polygonRayCast6 = _slicedToArray$2(_polygonRayCast5, 2), - _p1W = _polygonRayCast6[0], - _p2W = _polygonRayCast6[1]; - - if (_p1W === null || _p2W === null) continue; - var minSqDistW = Math.min(pointDistanceSquared(origin, _p1W), pointDistanceSquared(origin, _p2W)); - var maxWidth = 2 * Math.sqrt(minSqDistW); - - var _polygonRayCast7 = polygonRayCast(poly, origin, angleRad + Math.PI / 2), - _polygonRayCast8 = _slicedToArray$2(_polygonRayCast7, 2), - _p1H = _polygonRayCast8[0], - _p2H = _polygonRayCast8[1]; - - if (_p1H === null || _p2H === null) continue; - var minSqDistH = Math.min(pointDistanceSquared(origin, _p1H), pointDistanceSquared(origin, _p2H)); - var maxHeight = 2 * Math.sqrt(minSqDistH); - if (maxWidth * maxHeight < maxArea) continue; - var aRatios = aspectRatios; - - if (!aRatios.length) { - var minAspectRatio = Math.max(options.minAspectRatio, options.minWidth / maxHeight, maxArea / (maxHeight * maxHeight)); - var maxAspectRatio = Math.min(options.maxAspectRatio, maxWidth / options.minHeight, maxWidth * maxWidth / maxArea); - aRatios = range(minAspectRatio, maxAspectRatio + aspectRatioStep, aspectRatioStep); - } - - for (var a = 0; a < aRatios.length; a++) { - var aRatio = aRatios[a]; // do a binary search to find the max width that works - - var left = Math.max(options.minWidth, Math.sqrt(maxArea * aRatio)); - var right = Math.min(maxWidth, maxHeight * aRatio); - if (right * maxHeight < maxArea) continue; - if (options.events && right - left >= widthStep) events.push({ - type: "aRatio", - aRatio: aRatio - }); - - while (right - left >= widthStep) { - var width = (left + right) / 2; - var height = width / aRatio; - - var _origin = _slicedToArray$2(origin, 2), - cx = _origin[0], - cy = _origin[1]; - - var rectPoly = [[cx - width / 2, cy - height / 2], [cx + width / 2, cy - height / 2], [cx + width / 2, cy + height / 2], [cx - width / 2, cy + height / 2]]; - rectPoly = polygonRotate(rectPoly, angleRad, origin); - var insidePoly = polygonInside(rectPoly, poly); - - if (insidePoly) { - // we know that the area is already greater than the maxArea found so far - maxArea = width * height; - rectPoly.push(rectPoly[0]); - maxRect = { - area: maxArea, - cx: cx, - cy: cy, - width: width, - height: height, - angle: -angle, - points: rectPoly - }; - left = width; // increase the width in the binary search - } else { - right = width; // decrease the width in the binary search - } - - if (options.events) events.push({ - type: "rectangle", - areaFraction: width * height / area, - cx: cx, - cy: cy, - width: width, - height: height, - angle: angle, - insidePoly: insidePoly - }); - } - } - } - } - } - - if (options.cache) { - polyCache[cacheString] = maxRect; - } - - return options.events ? Object.assign(maxRect || {}, { - events: events - }) : maxRect; - } - - function _typeof$5(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$5 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$5 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$5(obj); - } - - function _classCallCheck$5(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$5(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$5(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$5(Constructor, staticProps); - return Constructor; - } - - function _get$1(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get$1 = Reflect.get; - } else { - _get$1 = function _get(target, property, receiver) { - var base = _superPropBase$1(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get$1(target, property, receiver || target); - } - - function _superPropBase$1(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$3(object); - if (object === null) break; - } - - return object; - } - - function _inherits$3(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$3(subClass, superClass); - } - - function _setPrototypeOf$3(o, p) { - _setPrototypeOf$3 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$3(o, p); - } - - function _createSuper$3(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$3(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$3(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$3(this, result); - }; - } - - function _possibleConstructorReturn$3(self, call) { - if (call && (_typeof$5(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$3(self); - } - - function _assertThisInitialized$3(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$3() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$3(o) { - _getPrototypeOf$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$3(o); - } - /** - @class Area - @extends Shape - @desc Creates SVG areas based on an array of data. - */ - - var Area = /*#__PURE__*/function (_Shape) { - _inherits$3(Area, _Shape); - - var _super = _createSuper$3(Area); - /** - @memberof Area - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape. - @private - */ - - - function Area() { - var _this; - - _classCallCheck$5(this, Area); - - _this = _super.call(this); - _this._curve = "linear"; - - _this._defined = function () { - return true; - }; - - _this._labelBounds = function (d, i, aes) { - var r = largestRect(aes.points); - if (!r) return null; - return { - angle: r.angle, - width: r.width, - height: r.height, - x: r.cx - r.width / 2 - _this._x(d, i), - y: r.cy - r.height / 2 - _this._y(d, i) - }; - }; - - _this._labelConfig = Object.assign(_this._labelConfig, { - textAnchor: "middle", - verticalAlign: "middle" - }); - _this._name = "Area"; - _this._x = accessor("x"); - _this._x0 = accessor("x"); - _this._x1 = null; - _this._y = constant$1(0); - _this._y0 = constant$1(0); - _this._y1 = accessor("y"); - return _this; - } - /** - @memberof Area - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - - _createClass$5(Area, [{ - key: "_aes", - value: function _aes(d) { - var _this2 = this; - - var values = d.values.slice().sort(function (a, b) { - return _this2._y1 ? _this2._x(a) - _this2._x(b) : _this2._y(a) - _this2._y(b); - }); - var points1 = values.map(function (v, z) { - return [_this2._x0(v, z), _this2._y0(v, z)]; - }); - var points2 = values.reverse().map(function (v, z) { - return _this2._y1 ? [_this2._x(v, z), _this2._y1(v, z)] : [_this2._x1(v, z), _this2._y(v, z)]; - }); - var points = points1.concat(points2); - if (points1[0][1] > points2[0][1]) points = points.reverse(); - points.push(points[0]); - return { - points: points - }; - } - /** - @memberof Area - @desc Filters/manipulates the data array before binding each point to an SVG group. - @param {Array} [*data* = the data array to be filtered] - @private - */ - - }, { - key: "_dataFilter", - value: function _dataFilter(data) { - var _this3 = this; - - var areas = nest().key(this._id).entries(data).map(function (d) { - d.data = objectMerge(d.values); - d.i = data.indexOf(d.values[0]); - var x = extent(d.values.map(_this3._x).concat(d.values.map(_this3._x0)).concat(_this3._x1 ? d.values.map(_this3._x1) : [])); - d.xR = x; - d.width = x[1] - x[0]; - d.x = x[0] + d.width / 2; - var y = extent(d.values.map(_this3._y).concat(d.values.map(_this3._y0)).concat(_this3._y1 ? d.values.map(_this3._y1) : [])); - d.yR = y; - d.height = y[1] - y[0]; - d.y = y[0] + d.height / 2; - d.nested = true; - d.translate = [d.x, d.y]; - d.__d3plusShape__ = true; - return d; - }); - - areas.key = function (d) { - return d.key; - }; - - return areas; - } - /** - @memberof Area - @desc Draws the area polygons. - @param {Function} [*callback*] - @chainable - */ - - }, { - key: "render", - value: function render(callback) { - var _this4 = this; - - _get$1(_getPrototypeOf$3(Area.prototype), "render", this).call(this, callback); - - var path = this._path = area().defined(this._defined).curve(paths["curve".concat(this._curve.charAt(0).toUpperCase()).concat(this._curve.slice(1))]).x(this._x).x0(this._x0).x1(this._x1).y(this._y).y0(this._y0).y1(this._y1); - var exitPath = area().defined(function (d) { - return d; - }).curve(paths["curve".concat(this._curve.charAt(0).toUpperCase()).concat(this._curve.slice(1))]).x(this._x).y(this._y).x0(function (d, i) { - return _this4._x1 ? _this4._x0(d, i) + (_this4._x1(d, i) - _this4._x0(d, i)) / 2 : _this4._x0(d, i); - }).x1(function (d, i) { - return _this4._x1 ? _this4._x0(d, i) + (_this4._x1(d, i) - _this4._x0(d, i)) / 2 : _this4._x0(d, i); - }).y0(function (d, i) { - return _this4._y1 ? _this4._y0(d, i) + (_this4._y1(d, i) - _this4._y0(d, i)) / 2 : _this4._y0(d, i); - }).y1(function (d, i) { - return _this4._y1 ? _this4._y0(d, i) + (_this4._y1(d, i) - _this4._y0(d, i)) / 2 : _this4._y0(d, i); - }); - - this._enter.append("path").attr("transform", function (d) { - return "translate(".concat(-d.xR[0] - d.width / 2, ", ").concat(-d.yR[0] - d.height / 2, ")"); - }).attr("d", function (d) { - return exitPath(d.values); - }).call(this._applyStyle.bind(this)).transition(this._transition).attrTween("d", function (d) { - return interpolatePath(_select(this).attr("d"), path(d.values)); - }); - - this._update.select("path").transition(this._transition).attr("transform", function (d) { - return "translate(".concat(-d.xR[0] - d.width / 2, ", ").concat(-d.yR[0] - d.height / 2, ")"); - }).attrTween("d", function (d) { - return interpolatePath(_select(this).attr("d"), path(d.values)); - }).call(this._applyStyle.bind(this)); - - this._exit.select("path").transition(this._transition).attrTween("d", function (d) { - return interpolatePath(_select(this).attr("d"), exitPath(d.values)); - }); - - return this; - } - /** - @memberof Area - @desc If *value* is specified, sets the area curve to the specified string and returns the current class instance. If *value* is not specified, returns the current area curve. - @param {String} [*value* = "linear"] - @chainable - */ - - }, { - key: "curve", - value: function curve(_) { - return arguments.length ? (this._curve = _, this) : this._curve; - } - /** - @memberof Area - @desc If *value* is specified, sets the defined accessor to the specified function and returns the current class instance. If *value* is not specified, returns the current defined accessor. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "defined", - value: function defined(_) { - return arguments.length ? (this._defined = _, this) : this._defined; - } - /** - @memberof Area - @desc If *value* is specified, sets the x accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current x accessor. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "x", - value: function x(_) { - if (!arguments.length) return this._x; - this._x = typeof _ === "function" ? _ : constant$1(_); - this._x0 = this._x; - return this; - } - /** - @memberof Area - @desc If *value* is specified, sets the x0 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current x0 accessor. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "x0", - value: function x0(_) { - if (!arguments.length) return this._x0; - this._x0 = typeof _ === "function" ? _ : constant$1(_); - this._x = this._x0; - return this; - } - /** - @memberof Area - @desc If *value* is specified, sets the x1 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current x1 accessor. - @param {Function|Number|null} [*value*] - @chainable - */ - - }, { - key: "x1", - value: function x1(_) { - return arguments.length ? (this._x1 = typeof _ === "function" || _ === null ? _ : constant$1(_), this) : this._x1; - } - /** - @memberof Area - @desc If *value* is specified, sets the y accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current y accessor. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "y", - value: function y(_) { - if (!arguments.length) return this._y; - this._y = typeof _ === "function" ? _ : constant$1(_); - this._y0 = this._y; - return this; - } - /** - @memberof Area - @desc If *value* is specified, sets the y0 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current y0 accessor. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "y0", - value: function y0(_) { - if (!arguments.length) return this._y0; - this._y0 = typeof _ === "function" ? _ : constant$1(_); - this._y = this._y0; - return this; - } - /** - @memberof Area - @desc If *value* is specified, sets the y1 accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current y1 accessor. - @param {Function|Number|null} [*value*] - @chainable - */ - - }, { - key: "y1", - value: function y1(_) { - return arguments.length ? (this._y1 = typeof _ === "function" || _ === null ? _ : constant$1(_), this) : this._y1; - } - }]); - - return Area; - }(Shape); - - function _typeof$6(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$6 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$6 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$6(obj); - } - - function _classCallCheck$6(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$6(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$6(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$6(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$6(Constructor, staticProps); - return Constructor; - } - - function _get$2(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get$2 = Reflect.get; - } else { - _get$2 = function _get(target, property, receiver) { - var base = _superPropBase$2(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get$2(target, property, receiver || target); - } - - function _superPropBase$2(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$4(object); - if (object === null) break; - } - - return object; - } - - function _inherits$4(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$4(subClass, superClass); - } - - function _setPrototypeOf$4(o, p) { - _setPrototypeOf$4 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$4(o, p); - } - - function _createSuper$4(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$4(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$4(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$4(this, result); - }; - } - - function _possibleConstructorReturn$4(self, call) { - if (call && (_typeof$6(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$4(self); - } - - function _assertThisInitialized$4(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$4() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$4(o) { - _getPrototypeOf$4 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$4(o); - } - /** - @class Bar - @extends Shape - @desc Creates SVG areas based on an array of data. - */ - - var Bar = /*#__PURE__*/function (_Shape) { - _inherits$4(Bar, _Shape); - - var _super = _createSuper$4(Bar); - /** - @memberof Bar - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape. - @private - */ - - - function Bar() { - var _this; - - _classCallCheck$6(this, Bar); - - _this = _super.call(this, "rect"); - _this._name = "Bar"; - _this._height = constant$1(10); - - _this._labelBounds = function (d, i, s) { - return { - width: s.width, - height: s.height, - x: _this._x1 !== null ? _this._getX(d, i) : -s.width / 2, - y: _this._x1 === null ? _this._getY(d, i) : -s.height / 2 - }; - }; - - _this._width = constant$1(10); - _this._x = accessor("x"); - _this._x0 = accessor("x"); - _this._x1 = null; - _this._y = constant$1(0); - _this._y0 = constant$1(0); - _this._y1 = accessor("y"); - return _this; - } - /** - @memberof Bar - @desc Draws the bars. - @param {Function} [*callback*] - @chainable - */ - - - _createClass$6(Bar, [{ - key: "render", - value: function render(callback) { - var _this2 = this; - - _get$2(_getPrototypeOf$4(Bar.prototype), "render", this).call(this, callback); - - var enter = this._enter.attr("width", function (d, i) { - return _this2._x1 === null ? _this2._getWidth(d, i) : 0; - }).attr("height", function (d, i) { - return _this2._x1 !== null ? _this2._getHeight(d, i) : 0; - }).attr("x", function (d, i) { - return _this2._x1 === null ? -_this2._getWidth(d, i) / 2 : 0; - }).attr("y", function (d, i) { - return _this2._x1 !== null ? -_this2._getHeight(d, i) / 2 : 0; - }).call(this._applyStyle.bind(this)); - - var update = this._update; - - if (this._duration) { - enter = enter.transition(this._transition); - update = update.transition(this._transition); - - this._exit.transition(this._transition).attr("width", function (d, i) { - return _this2._x1 === null ? _this2._getWidth(d, i) : 0; - }).attr("height", function (d, i) { - return _this2._x1 !== null ? _this2._getHeight(d, i) : 0; - }).attr("x", function (d, i) { - return _this2._x1 === null ? -_this2._getWidth(d, i) / 2 : 0; - }).attr("y", function (d, i) { - return _this2._x1 !== null ? -_this2._getHeight(d, i) / 2 : 0; - }); - } - - enter.call(this._applyPosition.bind(this)); - update.call(this._applyStyle.bind(this)).call(this._applyPosition.bind(this)); - return this; - } - /** - @memberof Bar - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - }, { - key: "_aes", - value: function _aes(d, i) { - return { - height: this._getHeight(d, i), - width: this._getWidth(d, i) - }; - } - /** - @memberof Bar - @desc Provides the default positioning to the elements. - @param {D3Selection} *elem* - @private - */ - - }, { - key: "_applyPosition", - value: function _applyPosition(elem) { - var _this3 = this; - - elem.attr("width", function (d, i) { - return _this3._getWidth(d, i); - }).attr("height", function (d, i) { - return _this3._getHeight(d, i); - }).attr("x", function (d, i) { - return _this3._x1 !== null ? _this3._getX(d, i) : -_this3._getWidth(d, i) / 2; - }).attr("y", function (d, i) { - return _this3._x1 === null ? _this3._getY(d, i) : -_this3._getHeight(d, i) / 2; - }); - } - /** - @memberof Bar - @desc Calculates the height of the by assessing the x and y properties. - @param {Object} *d* - @param {Number} *i* - @private - */ - - }, { - key: "_getHeight", - value: function _getHeight(d, i) { - if (this._x1 !== null) return this._height(d, i); - return Math.abs(this._y1(d, i) - this._y(d, i)); - } - /** - @memberof Bar - @desc Calculates the width of the by assessing the x and y properties. - @param {Object} *d* - @param {Number} *i* - @private - */ - - }, { - key: "_getWidth", - value: function _getWidth(d, i) { - if (this._x1 === null) return this._width(d, i); - return Math.abs(this._x1(d, i) - this._x(d, i)); - } - /** - @memberof Bar - @desc Calculates the x of the by assessing the x and width properties. - @param {Object} *d* - @param {Number} *i* - @private - */ - - }, { - key: "_getX", - value: function _getX(d, i) { - var w = this._x1 === null ? this._x(d, i) : this._x1(d, i) - this._x(d, i); - if (w < 0) return w;else return 0; - } - /** - @memberof Bar - @desc Calculates the y of the by assessing the y and height properties. - @param {Object} *d* - @param {Number} *i* - @private - */ - - }, { - key: "_getY", - value: function _getY(d, i) { - var h = this._x1 !== null ? this._y(d, i) : this._y1(d, i) - this._y(d, i); - if (h < 0) return h;else return 0; - } - /** - @memberof Bar - @desc If *value* is specified, sets the height accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.height; - } - */ - - }, { - key: "height", - value: function height(_) { - return arguments.length ? (this._height = typeof _ === "function" ? _ : constant$1(_), this) : this._height; - } - /** - @memberof Bar - @desc If *value* is specified, sets the width accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.width; - } - */ - - }, { - key: "width", - value: function width(_) { - return arguments.length ? (this._width = typeof _ === "function" ? _ : constant$1(_), this) : this._width; - } - /** - @memberof Bar - @desc If *value* is specified, sets the x0 accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "x0", - value: function x0(_) { - if (!arguments.length) return this._x0; - this._x0 = typeof _ === "function" ? _ : constant$1(_); - this._x = this._x0; - return this; - } - /** - @memberof Bar - @desc If *value* is specified, sets the x1 accessor to the specified function or number and returns the current class instance. - @param {Function|Number|null} [*value*] - @chainable - */ - - }, { - key: "x1", - value: function x1(_) { - return arguments.length ? (this._x1 = typeof _ === "function" || _ === null ? _ : constant$1(_), this) : this._x1; - } - /** - @memberof Bar - @desc If *value* is specified, sets the y0 accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "y0", - value: function y0(_) { - if (!arguments.length) return this._y0; - this._y0 = typeof _ === "function" ? _ : constant$1(_); - this._y = this._y0; - return this; - } - /** - @memberof Bar - @desc If *value* is specified, sets the y1 accessor to the specified function or number and returns the current class instance. - @param {Function|Number|null} [*value*] - @chainable - */ - - }, { - key: "y1", - value: function y1(_) { - return arguments.length ? (this._y1 = typeof _ === "function" || _ === null ? _ : constant$1(_), this) : this._y1; - } - }]); - - return Bar; - }(Shape); - - function _typeof$7(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$7 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$7 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$7(obj); - } - - function _classCallCheck$7(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$7(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$7(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$7(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$7(Constructor, staticProps); - return Constructor; - } - - function _get$3(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get$3 = Reflect.get; - } else { - _get$3 = function _get(target, property, receiver) { - var base = _superPropBase$3(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get$3(target, property, receiver || target); - } - - function _superPropBase$3(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$5(object); - if (object === null) break; - } - - return object; - } - - function _inherits$5(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$5(subClass, superClass); - } - - function _setPrototypeOf$5(o, p) { - _setPrototypeOf$5 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$5(o, p); - } - - function _createSuper$5(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$5(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$5(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$5(this, result); - }; - } - - function _possibleConstructorReturn$5(self, call) { - if (call && (_typeof$7(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$5(self); - } - - function _assertThisInitialized$5(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$5() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$5(o) { - _getPrototypeOf$5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$5(o); - } - /** - @class Circle - @extends Shape - @desc Creates SVG circles based on an array of data. - */ - - var Circle = /*#__PURE__*/function (_Shape) { - _inherits$5(Circle, _Shape); - - var _super = _createSuper$5(Circle); - /** - @memberof Circle - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape. - @private - */ - - - function Circle() { - var _this; - - _classCallCheck$7(this, Circle); - - _this = _super.call(this, "circle"); - - _this._labelBounds = function (d, i, s) { - return { - width: s.r * 1.5, - height: s.r * 1.5, - x: -s.r * 0.75, - y: -s.r * 0.75 - }; - }; - - _this._labelConfig = assign(_this._labelConfig, { - textAnchor: "middle", - verticalAlign: "middle" - }); - _this._name = "Circle"; - _this._r = accessor("r"); - return _this; - } - /** - @memberof Circle - @desc Provides the default positioning to the elements. - @private - */ - - - _createClass$7(Circle, [{ - key: "_applyPosition", - value: function _applyPosition(elem) { - var _this2 = this; - - elem.attr("r", function (d, i) { - return _this2._r(d, i); - }).attr("x", function (d, i) { - return -_this2._r(d, i) / 2; - }).attr("y", function (d, i) { - return -_this2._r(d, i) / 2; - }); - } - /** - @memberof Circle - @desc Draws the circles. - @param {Function} [*callback*] - @chainable - */ - - }, { - key: "render", - value: function render(callback) { - _get$3(_getPrototypeOf$5(Circle.prototype), "render", this).call(this, callback); - - var enter = this._enter.call(this._applyStyle.bind(this)); - - var update = this._update; - - if (this._duration) { - enter.attr("r", 0).attr("x", 0).attr("y", 0).transition(this._transition).call(this._applyPosition.bind(this)); - update = update.transition(this._transition); - - this._exit.transition(this._transition).attr("r", 0).attr("x", 0).attr("y", 0); - } else { - enter.call(this._applyPosition.bind(this)); - } - - update.call(this._applyStyle.bind(this)).call(this._applyPosition.bind(this)); - return this; - } - /** - @memberof Circle - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - }, { - key: "_aes", - value: function _aes(d, i) { - return { - r: this._r(d, i) - }; - } - /** - @memberof Circle - @desc If *value* is specified, sets the radius accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.r; - } - */ - - }, { - key: "r", - value: function r(_) { - return arguments.length ? (this._r = typeof _ === "function" ? _ : constant$1(_), this) : this._r; - } - }]); - - return Circle; - }(Shape); - - function _typeof$8(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$8 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$8 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$8(obj); - } - - function _classCallCheck$8(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$8(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$8(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$8(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$8(Constructor, staticProps); - return Constructor; - } - - function _get$4(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get$4 = Reflect.get; - } else { - _get$4 = function _get(target, property, receiver) { - var base = _superPropBase$4(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get$4(target, property, receiver || target); - } - - function _superPropBase$4(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$6(object); - if (object === null) break; - } - - return object; - } - - function _inherits$6(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$6(subClass, superClass); - } - - function _setPrototypeOf$6(o, p) { - _setPrototypeOf$6 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$6(o, p); - } - - function _createSuper$6(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$6(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$6(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$6(this, result); - }; - } - - function _possibleConstructorReturn$6(self, call) { - if (call && (_typeof$8(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$6(self); - } - - function _assertThisInitialized$6(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$6() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$6(o) { - _getPrototypeOf$6 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$6(o); - } - /** - @class Rect - @extends Shape - @desc Creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-shape/getting-started/) for help getting started using the rectangle generator. - */ - - var Rect = /*#__PURE__*/function (_Shape) { - _inherits$6(Rect, _Shape); - - var _super = _createSuper$6(Rect); - /** - @memberof Rect - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape. - @private - */ - - - function Rect() { - var _this; - - _classCallCheck$8(this, Rect); - - _this = _super.call(this, "rect"); - _this._height = accessor("height"); - - _this._labelBounds = function (d, i, s) { - return { - width: s.width, - height: s.height, - x: -s.width / 2, - y: -s.height / 2 - }; - }; - - _this._name = "Rect"; - _this._width = accessor("width"); - return _this; - } - /** - @memberof Rect - @desc Draws the rectangles. - @param {Function} [*callback*] - @chainable - */ - - - _createClass$8(Rect, [{ - key: "render", - value: function render(callback) { - _get$4(_getPrototypeOf$6(Rect.prototype), "render", this).call(this, callback); - - var enter = this._enter.attr("width", 0).attr("height", 0).attr("x", 0).attr("y", 0).call(this._applyStyle.bind(this)); - - var update = this._update; - - if (this._duration) { - enter = enter.transition(this._transition); - update = update.transition(this._transition); - - this._exit.transition(this._transition).attr("width", 0).attr("height", 0).attr("x", 0).attr("y", 0); - } - - enter.call(this._applyPosition.bind(this)); - update.call(this._applyStyle.bind(this)).call(this._applyPosition.bind(this)); - return this; - } - /** - @memberof Rect - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - }, { - key: "_aes", - value: function _aes(d, i) { - return { - width: this._width(d, i), - height: this._height(d, i) - }; - } - /** - @memberof Rect - @desc Provides the default positioning to the elements. - @param {D3Selection} *elem* - @private - */ - - }, { - key: "_applyPosition", - value: function _applyPosition(elem) { - var _this2 = this; - - elem.attr("width", function (d, i) { - return _this2._width(d, i); - }).attr("height", function (d, i) { - return _this2._height(d, i); - }).attr("x", function (d, i) { - return -_this2._width(d, i) / 2; - }).attr("y", function (d, i) { - return -_this2._height(d, i) / 2; - }); - } - /** - @memberof Rect - @desc If *value* is specified, sets the height accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.height; - } - */ - - }, { - key: "height", - value: function height(_) { - return arguments.length ? (this._height = typeof _ === "function" ? _ : constant$1(_), this) : this._height; - } - /** - @memberof Rect - @desc If *value* is specified, sets the width accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.width; - } - */ - - }, { - key: "width", - value: function width(_) { - return arguments.length ? (this._width = typeof _ === "function" ? _ : constant$1(_), this) : this._width; - } - }]); - - return Rect; - }(Shape); - - function _typeof$9(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$9 = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$9 = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$9(obj); - } - - function _classCallCheck$9(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$9(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$9(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$9(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$9(Constructor, staticProps); - return Constructor; - } - - function _get$5(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get$5 = Reflect.get; - } else { - _get$5 = function _get(target, property, receiver) { - var base = _superPropBase$5(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get$5(target, property, receiver || target); - } - - function _superPropBase$5(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$7(object); - if (object === null) break; - } - - return object; - } - - function _inherits$7(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$7(subClass, superClass); - } - - function _setPrototypeOf$7(o, p) { - _setPrototypeOf$7 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$7(o, p); - } - - function _createSuper$7(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$7(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$7(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$7(this, result); - }; - } - - function _possibleConstructorReturn$7(self, call) { - if (call && (_typeof$9(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$7(self); - } - - function _assertThisInitialized$7(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$7() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$7(o) { - _getPrototypeOf$7 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$7(o); - } - /** - @class Line - @extends Shape - @desc Creates SVG lines based on an array of data. - */ - - var Line = /*#__PURE__*/function (_Shape) { - _inherits$7(Line, _Shape); - - var _super = _createSuper$7(Line); - /** - @memberof Line - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape. - @private - */ - - - function Line() { - var _this; - - _classCallCheck$9(this, Line); - - _this = _super.call(this); - _this._curve = "linear"; - - _this._defined = function (d) { - return d; - }; - - _this._fill = constant$1("none"); - _this._hitArea = constant$1({ - "d": function d(_d) { - return _this._path(_d.values); - }, - "fill": "none", - "stroke-width": 10, - "transform": null - }); - _this._name = "Line"; - _this._path = line(); - _this._stroke = constant$1("black"); - _this._strokeWidth = constant$1(1); - return _this; - } - /** - @memberof Line - @desc Filters/manipulates the data array before binding each point to an SVG group. - @param {Array} [*data* = the data array to be filtered] - @private - */ - - - _createClass$9(Line, [{ - key: "_dataFilter", - value: function _dataFilter(data) { - var _this2 = this; - - var lines = nest().key(this._id).entries(data).map(function (d) { - d.data = objectMerge(d.values); - d.i = data.indexOf(d.values[0]); - var x = extent(d.values, _this2._x); - d.xR = x; - d.width = x[1] - x[0]; - d.x = x[0] + d.width / 2; - var y = extent(d.values, _this2._y); - d.yR = y; - d.height = y[1] - y[0]; - d.y = y[0] + d.height / 2; - d.nested = true; - d.translate = [d.x, d.y]; - d.__d3plusShape__ = true; - return d; - }); - - lines.key = function (d) { - return d.key; - }; - - return lines; - } - /** - @memberof Line - @desc Draws the lines. - @param {Function} [*callback*] - @chainable - */ - - }, { - key: "render", - value: function render(callback) { - var _this3 = this; - - _get$5(_getPrototypeOf$7(Line.prototype), "render", this).call(this, callback); - - var that = this; - /** - @desc Calculates the stroke-dasharray used for animations - @param {Object} *d* data point - @private - */ - - function calculateStrokeDashArray(d) { - d.initialLength = this.getTotalLength(); - - var strokeArray = that._strokeDasharray(d.values[0], that._data.indexOf(d.values[0])).split(" ").map(Number); - - if (strokeArray.length === 1 && strokeArray[0] === 0) strokeArray = [d.initialLength];else if (strokeArray.length === 1) strokeArray.push(strokeArray[0]);else if (strokeArray.length % 2) strokeArray = strokeArray.concat(strokeArray); - var newStrokeArray = []; - var strokeLength = 0; - - while (strokeLength < d.initialLength) { - for (var i = 0; i < strokeArray.length; i++) { - var num = strokeArray[i]; - strokeLength += num; - newStrokeArray.push(num); - if (strokeLength >= d.initialLength) break; - } - } - - if (newStrokeArray.length > 1 && newStrokeArray.length % 2) newStrokeArray.pop(); - newStrokeArray[newStrokeArray.length - 1] += d.initialLength - sum(newStrokeArray); - if (newStrokeArray.length % 2 === 0) newStrokeArray.push(0); - d.initialStrokeArray = newStrokeArray.join(" "); - } - - this._path.curve(paths["curve".concat(this._curve.charAt(0).toUpperCase()).concat(this._curve.slice(1))]).defined(this._defined).x(this._x).y(this._y); - - var enter = this._enter.append("path").attr("transform", function (d) { - return "translate(".concat(-d.xR[0] - d.width / 2, ", ").concat(-d.yR[0] - d.height / 2, ")"); - }).attr("d", function (d) { - return _this3._path(d.values); - }).call(this._applyStyle.bind(this)); - - var update = this._update.select("path").attr("stroke-dasharray", function (d) { - return that._strokeDasharray(d.values[0], that._data.indexOf(d.values[0])); - }); - - if (this._duration) { - enter.each(calculateStrokeDashArray).attr("stroke-dasharray", function (d) { - return "".concat(d.initialStrokeArray, " ").concat(d.initialLength); - }).attr("stroke-dashoffset", function (d) { - return d.initialLength; - }).transition(this._transition).attr("stroke-dashoffset", 0); - update = update.transition(this._transition).attrTween("d", function (d) { - return interpolatePath(_select(this).attr("d"), that._path(d.values)); - }); - - this._exit.selectAll("path").each(calculateStrokeDashArray).attr("stroke-dasharray", function (d) { - return "".concat(d.initialStrokeArray, " ").concat(d.initialLength); - }).transition(this._transition).attr("stroke-dashoffset", function (d) { - return -d.initialLength; - }); - } else { - update = update.attr("d", function (d) { - return that._path(d.values); - }); - } - - update.attr("transform", function (d) { - return "translate(".concat(-d.xR[0] - d.width / 2, ", ").concat(-d.yR[0] - d.height / 2, ")"); - }).call(this._applyStyle.bind(this)); - return this; - } - /** - @memberof Line - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - }, { - key: "_aes", - value: function _aes(d, i) { - var _this4 = this; - - return { - points: d.values.map(function (p) { - return [_this4._x(p, i), _this4._y(p, i)]; - }) - }; - } - /** - @memberof Line - @desc If *value* is specified, sets the line curve to the specified string and returns the current class instance. If *value* is not specified, returns the current line curve. - @param {String} [*value* = "linear"] - @chainable - */ - - }, { - key: "curve", - value: function curve(_) { - return arguments.length ? (this._curve = _, this) : this._curve; - } - /** - @memberof Line - @desc If *value* is specified, sets the defined accessor to the specified function and returns the current class instance. If *value* is not specified, returns the current defined accessor. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "defined", - value: function defined(_) { - return arguments.length ? (this._defined = _, this) : this._defined; - } - }]); - - return Line; - }(Shape); - - function _typeof$a(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$a = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$a = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$a(obj); - } - - function _classCallCheck$a(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$a(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$a(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$a(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$a(Constructor, staticProps); - return Constructor; - } - - function _inherits$8(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$8(subClass, superClass); - } - - function _setPrototypeOf$8(o, p) { - _setPrototypeOf$8 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$8(o, p); - } - - function _createSuper$8(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$8(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$8(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$8(this, result); - }; - } - - function _possibleConstructorReturn$8(self, call) { - if (call && (_typeof$a(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$8(self); - } - - function _assertThisInitialized$8(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$8() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$8(o) { - _getPrototypeOf$8 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$8(o); - } - var shapes = { - Circle: Circle, - Rect: Rect - }; - /** - @class Whisker - @extends BaseClass - @desc Creates SVG whisker based on an array of data. - */ - - var Whisker = /*#__PURE__*/function (_BaseClass) { - _inherits$8(Whisker, _BaseClass); - - var _super = _createSuper$8(Whisker); - /** - @memberof Whisker - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from BaseClass. - @private - */ - - - function Whisker() { - var _this; - - _classCallCheck$a(this, Whisker); - - _this = _super.call(this); - _this._endpoint = accessor("endpoint", "Rect"); - _this._endpointConfig = { - Circle: { - r: accessor("r", 5) - } - }; - _this._length = accessor("length", 25); - _this._lineConfig = {}; - _this._orient = accessor("orient", "top"); - _this._x = accessor("x", 0); - _this._y = accessor("y", 0); - return _this; - } - /** - @memberof Whisker - @desc Draws the whisker. - @param {Function} [*callback*] - @chainable - */ - - - _createClass$a(Whisker, [{ - key: "render", - value: function render(callback) { - var _this2 = this; - - if (this._select === void 0) { - this.select(_select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).style("display", "block").node()); - } - - var lineData = []; - - this._data.forEach(function (d, i) { - var orient = _this2._orient(d, i); - - var x = _this2._x(d, i); - - var y = _this2._y(d, i); - - var endpointX = x; - if (orient === "left") endpointX -= _this2._length(d, i);else if (orient === "right") endpointX += _this2._length(d, i); - var endpointY = y; - if (orient === "top") endpointY -= _this2._length(d, i);else if (orient === "bottom") endpointY += _this2._length(d, i); - lineData.push({ - __d3plus__: true, - data: d, - i: i, - id: i, - x: x, - y: y - }); - lineData.push({ - __d3plus__: true, - data: d, - i: i, - id: i, - x: endpointX, - y: endpointY - }); - }); // Draw whisker line. - - - this._line = new Line().data(lineData).select(elem("g.d3plus-Whisker", { - parent: this._select - }).node()).config(configPrep.bind(this)(this._lineConfig, "shape")).render(callback); - - var whiskerData = this._data.map(function (d, i) { - var dataObj = {}; - dataObj.__d3plus__ = true; - dataObj.data = d; - dataObj.i = i; - dataObj.endpoint = _this2._endpoint(d, i); - dataObj.length = _this2._length(d, i); - dataObj.orient = _this2._orient(d, i); - - var endpointX = _this2._x(d, i); - - if (dataObj.orient === "left") endpointX -= dataObj.length;else if (dataObj.orient === "right") endpointX += dataObj.length; - - var endpointY = _this2._y(d, i); - - if (dataObj.orient === "top") endpointY -= dataObj.length;else if (dataObj.orient === "bottom") endpointY += dataObj.length; - dataObj.x = endpointX; - dataObj.y = endpointY; - return dataObj; - }); // Draw whisker endpoint. - - - this._whiskerEndpoint = []; - nest().key(function (d) { - return d.endpoint; - }).entries(whiskerData).forEach(function (shapeData) { - var shapeName = shapeData.key; - - _this2._whiskerEndpoint.push(new shapes[shapeName]().data(shapeData.values).select(elem("g.d3plus-Whisker-Endpoint-".concat(shapeName), { - parent: _this2._select - }).node()).config({ - height: function height(d) { - return d.orient === "top" || d.orient === "bottom" ? 5 : 20; - }, - width: function width(d) { - return d.orient === "top" || d.orient === "bottom" ? 20 : 5; - } - }).config(configPrep.bind(_this2)(_this2._endpointConfig, "shape", shapeName)).render()); - }); - return this; - } - /** - @memberof Whisker - @desc Sets the highlight accessor to the Shape class's active function. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "active", - value: function active(_) { - if (this._line) this._line.active(_); - if (this._whiskerEndpoint) this._whiskerEndpoint.forEach(function (endPoint) { - return endPoint.active(_); - }); - } - /** - @memberof Whisker - @desc If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. - @param {Array} [*data* = []] - @chainable - */ - - }, { - key: "data", - value: function data(_) { - return arguments.length ? (this._data = _, this) : this._data; - } - /** - @memberof Whisker - @desc If *value* is specified, sets the endpoint accessor to the specified function or string and returns the current class instance. - @param {Function|String} - @chainable - */ - - }, { - key: "endpoint", - value: function endpoint(_) { - return arguments.length ? (this._endpoint = typeof _ === "function" ? _ : constant$1(_), this) : this._endpoint; - } - /** - @memberof Whisker - @desc If *value* is specified, sets the config method for each endpoint and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "endpointConfig", - value: function endpointConfig(_) { - return arguments.length ? (this._endpointConfig = assign(this._endpointConfig, _), this) : this._endpointConfig; - } - /** - @memberof Whisker - @desc Sets the highlight accessor to the Shape class's hover function. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "hover", - value: function hover(_) { - if (this._line) this._line.hover(_); - if (this._whiskerEndpoint) this._whiskerEndpoint.forEach(function (endPoint) { - return endPoint.hover(_); - }); - } - /** - @memberof Whisker - @desc If *value* is specified, sets the length accessor for whisker and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - */ - - }, { - key: "length", - value: function length(_) { - return arguments.length ? (this._length = typeof _ === "function" ? _ : constant$1(_), this) : this._length; - } - /** - @memberof Whisker - @desc If *value* is specified, sets the config method for line shape and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "lineConfig", - value: function lineConfig(_) { - return arguments.length ? (this._lineConfig = assign(this._lineConfig, _), this) : this._lineConfig; - } - /** - @memberof Whisker - @desc If *value* is specified, sets the orientation to the specified value. If *value* is not specified, returns the current orientation. - @param {Function|String} [*value* = "top"] Accepts "top", "right", "bottom" or "left" - @chainable - */ - - }, { - key: "orient", - value: function orient(_) { - return arguments.length ? (this._orient = typeof _ === "function" ? _ : constant$1(_), this) : this._orient; - } - /** - @memberof Whisker - @desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element. - @param {String|HTMLElement} [*selector* = d3.select("body").append("svg")] - @chainable - */ - - }, { - key: "select", - value: function select(_) { - return arguments.length ? (this._select = _select(_), this) : this._select; - } - /** - @memberof Whisker - @desc If *value* is specified, sets the x axis to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.x; - } - */ - - }, { - key: "x", - value: function x(_) { - return arguments.length ? (this._x = typeof _ === "function" ? _ : constant$1(_), this) : this._x; - } - /** - @memberof Whisker - @desc If *value* is specified, sets the y axis to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.y; - } - */ - - }, { - key: "y", - value: function y(_) { - return arguments.length ? (this._y = typeof _ === "function" ? _ : constant$1(_), this) : this._y; - } - }]); - - return Whisker; - }(BaseClass); - - function _typeof$b(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$b = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$b = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$b(obj); - } - - function _classCallCheck$b(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$b(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$b(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$b(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$b(Constructor, staticProps); - return Constructor; - } - - function _inherits$9(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$9(subClass, superClass); - } - - function _setPrototypeOf$9(o, p) { - _setPrototypeOf$9 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$9(o, p); - } - - function _createSuper$9(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$9(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$9(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$9(this, result); - }; - } - - function _possibleConstructorReturn$9(self, call) { - if (call && (_typeof$b(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$9(self); - } - - function _assertThisInitialized$9(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$9() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$9(o) { - _getPrototypeOf$9 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$9(o); - } - var shapes$1 = { - Circle: Circle, - Rect: Rect - }; - /** - @class Box - @extends BaseClass - @desc Creates SVG box based on an array of data. - */ - - var Box = /*#__PURE__*/function (_BaseClass) { - _inherits$9(Box, _BaseClass); - - var _super = _createSuper$9(Box); - /** - @memberof Box - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from BaseClass. - @private - */ - - - function Box() { - var _this; - - _classCallCheck$b(this, Box); - - _this = _super.call(this); - _this._medianConfig = { - fill: constant$1("black") - }; - _this._orient = accessor("orient", "vertical"); - _this._outlier = accessor("outlier", "Circle"); - _this._outlierConfig = { - Circle: { - r: accessor("r", 5) - }, - Rect: { - height: function height(d, i) { - return _this._orient(d, i) === "vertical" ? 5 : 20; - }, - width: function width(d, i) { - return _this._orient(d, i) === "vertical" ? 20 : 5; - } - } - }; - _this._rectConfig = { - fill: constant$1("white"), - stroke: constant$1("black"), - strokeWidth: constant$1(1) - }; - _this._rectWidth = constant$1(50); - _this._whiskerConfig = {}; - _this._whiskerMode = ["tukey", "tukey"]; - _this._x = accessor("x", 250); - _this._y = accessor("y", 250); - return _this; - } - /** - @memberof Box - @desc Draws the Box. - @param {Function} [*callback*] - @chainable - */ - - - _createClass$b(Box, [{ - key: "render", - value: function render() { - var _this2 = this; - - if (this._select === void 0) { - this.select(_select("body").append("svg").style("width", "".concat(window.innerWidth, "px")).style("height", "".concat(window.innerHeight, "px")).style("display", "block").node()); - } - - var outlierData = []; - var filteredData = nest().key(function (d, i) { - return _this2._orient(d, i) === "vertical" ? _this2._x(d, i) : _this2._y(d, i); - }).entries(this._data).map(function (d) { - d.data = objectMerge(d.values); - d.i = _this2._data.indexOf(d.values[0]); - d.orient = _this2._orient(d.data, d.i); - var values = d.values.map(d.orient === "vertical" ? _this2._y : _this2._x); - values.sort(function (a, b) { - return a - b; - }); - d.first = quantile(values, 0.25); - d.median = quantile(values, 0.50); - d.third = quantile(values, 0.75); - var mode = _this2._whiskerMode; - - if (mode[0] === "tukey") { - d.lowerLimit = d.first - (d.third - d.first) * 1.5; - if (d.lowerLimit < min(values)) d.lowerLimit = min(values); - } else if (mode[0] === "extent") d.lowerLimit = min(values);else if (typeof mode[0] === "number") d.lowerLimit = quantile(values, mode[0]); - - if (mode[1] === "tukey") { - d.upperLimit = d.third + (d.third - d.first) * 1.5; - if (d.upperLimit > max(values)) d.upperLimit = max(values); - } else if (mode[1] === "extent") d.upperLimit = max(values);else if (typeof mode[1] === "number") d.upperLimit = quantile(values, mode[1]); - - var rectLength = d.third - d.first; // Compute values for vertical orientation. - - if (d.orient === "vertical") { - d.height = rectLength; - d.width = _this2._rectWidth(d.data, d.i); - d.x = _this2._x(d.data, d.i); - d.y = d.first + rectLength / 2; - } else if (d.orient === "horizontal") { - // Compute values for horizontal orientation. - d.height = _this2._rectWidth(d.data, d.i); - d.width = rectLength; - d.x = d.first + rectLength / 2; - d.y = _this2._y(d.data, d.i); - } // Compute data for outliers. - - - d.values.forEach(function (eachValue, index) { - var value = d.orient === "vertical" ? _this2._y(eachValue, index) : _this2._x(eachValue, index); - - if (value < d.lowerLimit || value > d.upperLimit) { - var dataObj = {}; - dataObj.__d3plus__ = true; - dataObj.data = eachValue; - dataObj.i = index; - dataObj.outlier = _this2._outlier(eachValue, index); - - if (d.orient === "vertical") { - dataObj.x = d.x; - dataObj.y = value; - outlierData.push(dataObj); - } else if (d.orient === "horizontal") { - dataObj.y = d.y; - dataObj.x = value; - outlierData.push(dataObj); - } - } - }); - d.__d3plus__ = true; - return d; - }); // Draw box. - - this._box = new Rect().data(filteredData).x(function (d) { - return d.x; - }).y(function (d) { - return d.y; - }).select(elem("g.d3plus-Box", { - parent: this._select - }).node()).config(configPrep.bind(this)(this._rectConfig, "shape")).render(); // Draw median. - - this._median = new Rect().data(filteredData).x(function (d) { - return d.orient === "vertical" ? d.x : d.median; - }).y(function (d) { - return d.orient === "vertical" ? d.median : d.y; - }).height(function (d) { - return d.orient === "vertical" ? 1 : d.height; - }).width(function (d) { - return d.orient === "vertical" ? d.width : 1; - }).select(elem("g.d3plus-Box-Median", { - parent: this._select - }).node()).config(configPrep.bind(this)(this._medianConfig, "shape")).render(); // Draw 2 lines using Whisker class. - // Construct coordinates for whisker startpoints and push it to the whiskerData. - - var whiskerData = []; - filteredData.forEach(function (d, i) { - var x = d.x; - var y = d.y; - var topLength = d.first - d.lowerLimit; - var bottomLength = d.upperLimit - d.third; - - if (d.orient === "vertical") { - var topY = y - d.height / 2; - var bottomY = y + d.height / 2; - whiskerData.push({ - __d3plus__: true, - data: d, - i: i, - x: x, - y: topY, - length: topLength, - orient: "top" - }, { - __d3plus__: true, - data: d, - i: i, - x: x, - y: bottomY, - length: bottomLength, - orient: "bottom" - }); - } else if (d.orient === "horizontal") { - var topX = x + d.width / 2; - var bottomX = x - d.width / 2; - whiskerData.push({ - __d3plus__: true, - data: d, - i: i, - x: topX, - y: y, - length: bottomLength, - orient: "right" - }, { - __d3plus__: true, - data: d, - i: i, - x: bottomX, - y: y, - length: topLength, - orient: "left" - }); - } - }); // Draw whiskers. - - this._whisker = new Whisker().data(whiskerData).select(elem("g.d3plus-Box-Whisker", { - parent: this._select - }).node()).config(configPrep.bind(this)(this._whiskerConfig, "shape")).render(); // Draw outliers. - - this._whiskerEndpoint = []; - nest().key(function (d) { - return d.outlier; - }).entries(outlierData).forEach(function (shapeData) { - var shapeName = shapeData.key; - - _this2._whiskerEndpoint.push(new shapes$1[shapeName]().data(shapeData.values).select(elem("g.d3plus-Box-Outlier-".concat(shapeName), { - parent: _this2._select - }).node()).config(configPrep.bind(_this2)(_this2._outlierConfig, "shape", shapeName)).render()); - }); - return this; - } - /** - @memberof Box - @desc Sets the highlight accessor to the Shape class's active function. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "active", - value: function active(_) { - if (this._box) this._box.active(_); - if (this._median) this._median.active(_); - if (this._whisker) this._whisker.active(_); - if (this._whiskerEndpoint) this._whiskerEndpoint.forEach(function (endPoint) { - return endPoint.active(_); - }); - } - /** - @memberof Box - @desc If *data* is specified, sets the data array to the specified array and returns the current class instance. If *data* is not specified, returns the current data array. - @param {Array} [*data* = []] - @chainable - */ - - }, { - key: "data", - value: function data(_) { - return arguments.length ? (this._data = _, this) : this._data; - } - /** - @memberof Box - @desc Sets the highlight accessor to the Shape class's hover function. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "hover", - value: function hover(_) { - if (this._box) this._box.hover(_); - if (this._median) this._median.hover(_); - if (this._whisker) this._whisker.hover(_); - if (this._whiskerEndpoint) this._whiskerEndpoint.forEach(function (endPoint) { - return endPoint.hover(_); - }); - } - /** - @memberof Box - @desc If *value* is specified, sets the config method for median and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "medianConfig", - value: function medianConfig(_) { - return arguments.length ? (this._medianConfig = assign(this._medianConfig, _), this) : this._medianConfig; - } - /** - @memberof Box - @desc If *value* is specified, sets the orientation to the specified value. If *value* is not specified, returns the current orientation. - @param {Function|String} [*value* = "vertical"] Accepts "vertical" or "horizontal" - @chainable - */ - - }, { - key: "orient", - value: function orient(_) { - return arguments.length ? (this._orient = typeof _ === "function" ? _ : constant$1(_), this) : this._orient; - } - /** - @memberof Box - @desc If *value* is specified, sets the outlier accessor to the specified function or string and returns the current class instance. - @param {Function|String} - @chainable - */ - - }, { - key: "outlier", - value: function outlier(_) { - return arguments.length ? (this._outlier = typeof _ === "function" ? _ : constant$1(_), this) : this._outlier; - } - /** - @memberof Box - @desc If *value* is specified, sets the config method for each outlier point and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "outlierConfig", - value: function outlierConfig(_) { - return arguments.length ? (this._outlierConfig = assign(this._outlierConfig, _), this) : this._outlierConfig; - } - /** - @memberof Box - @desc If *value* is specified, sets the config method for rect shape and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "rectConfig", - value: function rectConfig(_) { - return arguments.length ? (this._rectConfig = assign(this._rectConfig, _), this) : this._rectConfig; - } - /** - @memberof Box - @desc If *value* is specified, sets the width accessor to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.width; - } - */ - - }, { - key: "rectWidth", - value: function rectWidth(_) { - return arguments.length ? (this._rectWidth = typeof _ === "function" ? _ : constant$1(_), this) : this._rectWidth; - } - /** - @memberof Box - @desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element. - @param {String|HTMLElement} [*selector* = d3.select("body").append("svg")] - @chainable - */ - - }, { - key: "select", - value: function select(_) { - return arguments.length ? (this._select = _select(_), this) : this._select; - } - /** - @memberof Box - @desc If *value* is specified, sets the config method for whisker and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "whiskerConfig", - value: function whiskerConfig(_) { - return arguments.length ? (this._whiskerConfig = assign(this._whiskerConfig, _), this) : this._whiskerConfig; - } - /** - @memberof Box - @desc Determines the value used for each whisker. Can be passed a single value to apply for both whiskers, or an Array of 2 values for the lower and upper whiskers (in that order). Accepted values are `"tukey"`, `"extent"`, or a Number representing a quantile. - @param {String|Number|String[]|Number[]} [*value* = "tukey"] - @chainable - */ - - }, { - key: "whiskerMode", - value: function whiskerMode(_) { - return arguments.length ? (this._whiskerMode = _ instanceof Array ? _ : [_, _], this) : this._whiskerMode; - } - /** - @memberof Box - @desc If *value* is specified, sets the x axis to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.x; - } - */ - - }, { - key: "x", - value: function x(_) { - return arguments.length ? (this._x = typeof _ === "function" ? _ : accessor(_), this) : this._x; - } - /** - @memberof Box - @desc If *value* is specified, sets the y axis to the specified function or number and returns the current class instance. - @param {Function|Number} [*value*] - @chainable - @example - function(d) { - return d.y; - } - */ - - }, { - key: "y", - value: function y(_) { - return arguments.length ? (this._y = typeof _ === "function" ? _ : accessor(_), this) : this._y; - } - }]); - - return Box; - }(BaseClass); - - var pi$2 = Math.PI; - /** - @function shapeEdgePoint - @desc Calculates the x/y position of a point at the edge of a shape, from the center of the shape, given a specified pixel distance and radian angle. - @param {Number} angle The angle, in radians, of the offset point. - @param {Number} distance The pixel distance away from the origin. - @returns {String} [shape = "circle"] The type of shape, which can be either "circle" or "square". - */ - - var shapeEdgePoint = (function (angle, distance) { - var shape = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "circle"; - if (angle < 0) angle = pi$2 * 2 + angle; - - if (shape === "square") { - var diagonal = 45 * (pi$2 / 180); - var x = 0, - y = 0; - - if (angle < pi$2 / 2) { - var tan = Math.tan(angle); - x += angle < diagonal ? distance : distance / tan; - y += angle < diagonal ? tan * distance : distance; - } else if (angle <= pi$2) { - var _tan = Math.tan(pi$2 - angle); - - x -= angle < pi$2 - diagonal ? distance / _tan : distance; - y += angle < pi$2 - diagonal ? distance : _tan * distance; - } else if (angle < diagonal + pi$2) { - x -= distance; - y -= Math.tan(angle - pi$2) * distance; - } else if (angle < 3 * pi$2 / 2) { - x -= distance / Math.tan(angle - pi$2); - y -= distance; - } else if (angle < 2 * pi$2 - diagonal) { - x += distance / Math.tan(2 * pi$2 - angle); - y -= distance; - } else { - x += distance; - y -= Math.tan(2 * pi$2 - angle) * distance; - } - - return [x, y]; - } else if (shape === "circle") { - return [distance * Math.cos(angle), distance * Math.sin(angle)]; - } else return null; - }); - - var pi$3 = Math.PI; - /** - @function path2polygon - @desc Transforms a path string into an Array of points. - @param {String} path An SVG string path, commonly the "d" property of a element. - @param {Number} [segmentLength = 20] The lenght of line segments when converting curves line segments. Higher values lower computation time, but will result in curves that are more rigid. - @returns {Array} - */ - - var path2polygon = (function (path) { - var segmentLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20; - var poly = [], - regex = /([MLA])([^MLAZ]+)/ig; - var match = regex.exec(path); - - while (match !== null) { - if (["M", "L"].includes(match[1])) poly.push(match[2].split(",").map(Number));else if (match[1] === "A") { - var points = match[2].split(",").map(Number); - var last = points.slice(points.length - 2, points.length), - prev = poly[poly.length - 1], - radius = points[0], - width = pointDistance(prev, last); - var angle = Math.acos((radius * radius + radius * radius - width * width) / (2 * radius * radius)); - if (points[2]) angle = pi$3 * 2 - angle; - var step = angle / (angle / (pi$3 * 2) * (radius * pi$3 * 2) / segmentLength); - var start = Math.atan2(-prev[1], -prev[0]) - pi$3; - var i = step; - - while (i < angle) { - poly.push(shapeEdgePoint(points[4] ? start + i : start - i, radius)); - i += step; - } - - poly.push(last); - } - match = regex.exec(path); - } - - return poly; - }); - - function _typeof$c(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$c = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$c = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$c(obj); - } - - function _classCallCheck$c(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$c(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$c(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$c(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$c(Constructor, staticProps); - return Constructor; - } - - function _get$6(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get$6 = Reflect.get; - } else { - _get$6 = function _get(target, property, receiver) { - var base = _superPropBase$6(target, property); - - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get$6(target, property, receiver || target); - } - - function _superPropBase$6(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf$a(object); - if (object === null) break; - } - - return object; - } - - function _inherits$a(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$a(subClass, superClass); - } - - function _setPrototypeOf$a(o, p) { - _setPrototypeOf$a = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$a(o, p); - } - - function _createSuper$a(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$a(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$a(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$a(this, result); - }; - } - - function _possibleConstructorReturn$a(self, call) { - if (call && (_typeof$c(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$a(self); - } - - function _assertThisInitialized$a(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$a() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$a(o) { - _getPrototypeOf$a = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$a(o); - } - /** - @class Path - @extends Shape - @desc Creates SVG Paths based on an array of data. - */ - - var Path$1 = /*#__PURE__*/function (_Shape) { - _inherits$a(Path, _Shape); - - var _super = _createSuper$a(Path); - /** - @memberof Path - @desc Invoked when creating a new class instance, and overrides any default parameters inherited from Shape. - @private - */ - - - function Path() { - var _this; - - _classCallCheck$c(this, Path); - - _this = _super.call(this, "path"); - _this._d = accessor("path"); - - _this._labelBounds = function (d, i, aes) { - var r = largestRect(aes.points, { - angle: _this._labelConfig.rotate ? _this._labelConfig.rotate(d, i) : 0 - }); - return r ? { - angle: r.angle, - width: r.width, - height: r.height, - x: r.cx - r.width / 2, - y: r.cy - r.height / 2 - } : false; - }; - - _this._name = "Path"; - _this._labelConfig = Object.assign(_this._labelConfig, { - textAnchor: "middle", - verticalAlign: "middle" - }); - return _this; - } - /** - @memberof Path - @desc Given a specific data point and index, returns the aesthetic properties of the shape. - @param {Object} *data point* - @param {Number} *index* - @private - */ - - - _createClass$c(Path, [{ - key: "_aes", - value: function _aes(d, i) { - return { - points: path2polygon(this._d(d, i)) - }; - } - /** - @memberof Path - @desc Draws the paths. - @param {Function} [*callback*] - @chainable - */ - - }, { - key: "render", - value: function render(callback) { - _get$6(_getPrototypeOf$a(Path.prototype), "render", this).call(this, callback); - - var enter = this._enter.attr("d", this._d).call(this._applyStyle.bind(this)); - - var update = this._update; - - if (this._duration) { - enter.attr("opacity", 0).transition(this._transition).attr("opacity", 1); - update = update.transition(this._transition); - - this._exit.transition(this._transition).attr("opacity", 0); - } - - update.call(this._applyStyle.bind(this)).attr("d", this._d); - return this; - } - /** - @memberof Path - @desc If *value* is specified, sets the "d" attribute accessor to the specified function or number and returns the current class instance. - @param {Function|String} [*value*] - @chainable - @example - function(d) { - return d.path; - } - */ - - }, { - key: "d", - value: function d(_) { - return arguments.length ? (this._d = typeof _ === "function" ? _ : constant$1(_), this) : this._d; - } - }]); - - return Path; - }(Shape); - - - - var shapes$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - Image: Image$1, - Shape: Shape, - Area: Area, - Bar: Bar, - Box: Box, - Circle: Circle, - Line: Line, - Path: Path$1, - Rect: Rect, - Whisker: Whisker, - largestRect: largestRect, - lineIntersection: lineIntersection, - path2polygon: path2polygon, - pointDistance: pointDistance, - pointDistanceSquared: pointDistanceSquared, - pointRotate: pointRotate, - polygonInside: polygonInside, - polygonRayCast: polygonRayCast, - polygonRotate: polygonRotate, - segmentBoxContains: segmentBoxContains, - segmentsIntersect: segmentsIntersect, - shapeEdgePoint: shapeEdgePoint, - simplify: simplify - }); - - /** - @function dataConcat - @desc Reduce and concat all the elements included in arrayOfArrays if they are arrays. If it is a JSON object try to concat the array under given key data. If the key doesn't exists in object item, a warning message is lauched to the console. You need to implement DataFormat callback to concat the arrays manually. - @param {Array} arrayOfArray Array of elements - @param {String} [data = "data"] The key used for the flat data array if exists inside of the JSON object. - */ - var concat = (function (arrayOfArrays) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "data"; - return arrayOfArrays.reduce(function (acc, item) { - var dataArray = []; - - if (Array.isArray(item)) { - dataArray = item; - } else { - if (item[data]) { - dataArray = item[data]; - } else { - console.warn("d3plus-viz: Please implement a \"dataFormat\" callback to concat the arrays manually (consider using the d3plus.dataConcat method in your callback). Currently unable to concatenate (using key: \"".concat(data, "\") the following response:"), item); - } - } - - return acc.concat(dataArray); - }, []); - }); - - /** - @function dataFold - @desc Given a JSON object where the data values and headers have been split into separate key lookups, this function will combine the data values with the headers and returns one large array of objects. - @param {Object} json A JSON data Object with `data` and `headers` keys. - @param {String} [data = "data"] The key used for the flat data array inside of the JSON object. - @param {String} [headers = "headers"] The key used for the flat headers array inside of the JSON object. - */ - var fold = (function (json) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "data"; - var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "headers"; - return json[data].map(function (data) { - return json[headers].reduce(function (obj, header, i) { - return obj[header] = data[i], obj; - }, {}); - }); - }); - - function request (url, callback) { - var request, - event = dispatch("beforesend", "progress", "load", "error"), - _mimeType, - headers = map(), - xhr = new XMLHttpRequest(), - _user = null, - _password = null, - _response, - _responseType, - _timeout = 0; // If IE does not support CORS, use XDomainRequest. - - - if (typeof XDomainRequest !== "undefined" && !("withCredentials" in xhr) && /^(http(s)?:)?\/\//.test(url)) xhr = new XDomainRequest(); - "onload" in xhr ? xhr.onload = xhr.onerror = xhr.ontimeout = respond : xhr.onreadystatechange = function (o) { - xhr.readyState > 3 && respond(o); - }; - - function respond(o) { - var status = xhr.status, - result; - - if (!status && hasResponse(xhr) || status >= 200 && status < 300 || status === 304) { - if (_response) { - try { - result = _response.call(request, xhr); - } catch (e) { - event.call("error", request, e); - return; - } - } else { - result = xhr; - } - - event.call("load", request, result); - } else { - event.call("error", request, o); - } - } - - xhr.onprogress = function (e) { - event.call("progress", request, e); - }; - - request = { - header: function header(name, value) { - name = (name + "").toLowerCase(); - if (arguments.length < 2) return headers.get(name); - if (value == null) headers.remove(name);else headers.set(name, value + ""); - return request; - }, - // If mimeType is non-null and no Accept header is set, a default is used. - mimeType: function mimeType(value) { - if (!arguments.length) return _mimeType; - _mimeType = value == null ? null : value + ""; - return request; - }, - // Specifies what type the response value should take; - // for instance, arraybuffer, blob, document, or text. - responseType: function responseType(value) { - if (!arguments.length) return _responseType; - _responseType = value; - return request; - }, - timeout: function timeout(value) { - if (!arguments.length) return _timeout; - _timeout = +value; - return request; - }, - user: function user(value) { - return arguments.length < 1 ? _user : (_user = value == null ? null : value + "", request); - }, - password: function password(value) { - return arguments.length < 1 ? _password : (_password = value == null ? null : value + "", request); - }, - // Specify how to convert the response content to a specific type; - // changes the callback value on "load" events. - response: function response(value) { - _response = value; - return request; - }, - // Alias for send("GET", …). - get: function get(data, callback) { - return request.send("GET", data, callback); - }, - // Alias for send("POST", …). - post: function post(data, callback) { - return request.send("POST", data, callback); - }, - // If callback is non-null, it will be used for error and load events. - send: function send(method, data, callback) { - xhr.open(method, url, true, _user, _password); - if (_mimeType != null && !headers.has("accept")) headers.set("accept", _mimeType + ",*/*"); - if (xhr.setRequestHeader) headers.each(function (value, name) { - xhr.setRequestHeader(name, value); - }); - if (_mimeType != null && xhr.overrideMimeType) xhr.overrideMimeType(_mimeType); - if (_responseType != null) xhr.responseType = _responseType; - if (_timeout > 0) xhr.timeout = _timeout; - if (callback == null && typeof data === "function") callback = data, data = null; - if (callback != null && callback.length === 1) callback = fixCallback(callback); - if (callback != null) request.on("error", callback).on("load", function (xhr) { - callback(null, xhr); - }); - event.call("beforesend", request, xhr); - xhr.send(data == null ? null : data); - return request; - }, - abort: function abort() { - xhr.abort(); - return request; - }, - on: function on() { - var value = event.on.apply(event, arguments); - return value === event ? request : value; - } - }; - - if (callback != null) { - if (typeof callback !== "function") throw new Error("invalid callback: " + callback); - return request.get(callback); - } - - return request; - } - - function fixCallback(callback) { - return function (error, xhr) { - callback(error == null ? xhr : null); - }; - } - - function hasResponse(xhr) { - var type = xhr.responseType; - return type && type !== "text" ? xhr.response // null on error - : xhr.responseText; // "" on error - } - - function type (defaultMimeType, response) { - return function (url, callback) { - var r = request(url).mimeType(defaultMimeType).response(response); - - if (callback != null) { - if (typeof callback !== "function") throw new Error("invalid callback: " + callback); - return r.get(callback); - } - - return r; - }; - } - - var json = type("application/json", function (xhr) { - return JSON.parse(xhr.responseText); - }); - - var text = type("text/plain", function (xhr) { - return xhr.responseText; - }); - - var EOL = {}, - EOF = {}, - QUOTE = 34, - NEWLINE = 10, - RETURN = 13; - - function objectConverter(columns) { - return new Function("d", "return {" + columns.map(function (name, i) { - return JSON.stringify(name) + ": d[" + i + "] || \"\""; - }).join(",") + "}"); - } - - function customConverter(columns, f) { - var object = objectConverter(columns); - return function (row, i) { - return f(object(row), i, columns); - }; - } // Compute unique columns in order of discovery. - - - function inferColumns(rows) { - var columnSet = Object.create(null), - columns = []; - rows.forEach(function (row) { - for (var column in row) { - if (!(column in columnSet)) { - columns.push(columnSet[column] = column); - } - } - }); - return columns; - } - - function pad$1(value, width) { - var s = value + "", - length = s.length; - return length < width ? new Array(width - length + 1).join(0) + s : s; - } - - function formatYear$1(year) { - return year < 0 ? "-" + pad$1(-year, 6) : year > 9999 ? "+" + pad$1(year, 6) : pad$1(year, 4); - } - - function formatDate(date) { - var hours = date.getUTCHours(), - minutes = date.getUTCMinutes(), - seconds = date.getUTCSeconds(), - milliseconds = date.getUTCMilliseconds(); - return isNaN(date) ? "Invalid Date" : formatYear$1(date.getUTCFullYear()) + "-" + pad$1(date.getUTCMonth() + 1, 2) + "-" + pad$1(date.getUTCDate(), 2) + (milliseconds ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + ":" + pad$1(seconds, 2) + "." + pad$1(milliseconds, 3) + "Z" : seconds ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + ":" + pad$1(seconds, 2) + "Z" : minutes || hours ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + "Z" : ""); - } - - function dsv (delimiter) { - var reFormat = new RegExp("[\"" + delimiter + "\n\r]"), - DELIMITER = delimiter.charCodeAt(0); - - function parse(text, f) { - var convert, - columns, - rows = parseRows(text, function (row, i) { - if (convert) return convert(row, i - 1); - columns = row, convert = f ? customConverter(row, f) : objectConverter(row); - }); - rows.columns = columns || []; - return rows; - } - - function parseRows(text, f) { - var rows = [], - // output rows - N = text.length, - I = 0, - // current character index - n = 0, - // current line number - t, - // current token - eof = N <= 0, - // current token followed by EOF? - eol = false; // current token followed by EOL? - // Strip the trailing newline. - - if (text.charCodeAt(N - 1) === NEWLINE) --N; - if (text.charCodeAt(N - 1) === RETURN) --N; - - function token() { - if (eof) return EOF; - if (eol) return eol = false, EOL; // Unescape quotes. - - var i, - j = I, - c; - - if (text.charCodeAt(j) === QUOTE) { - while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE) { - } - - if ((i = I) >= N) eof = true;else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;else if (c === RETURN) { - eol = true; - if (text.charCodeAt(I) === NEWLINE) ++I; - } - return text.slice(j + 1, i - 1).replace(/""/g, "\""); - } // Find next delimiter or newline. - - - while (I < N) { - if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;else if (c === RETURN) { - eol = true; - if (text.charCodeAt(I) === NEWLINE) ++I; - } else if (c !== DELIMITER) continue; - return text.slice(j, i); - } // Return last token before EOF. - - - return eof = true, text.slice(j, N); - } - - while ((t = token()) !== EOF) { - var row = []; - - while (t !== EOL && t !== EOF) { - row.push(t), t = token(); - } - - if (f && (row = f(row, n++)) == null) continue; - rows.push(row); - } - - return rows; - } - - function preformatBody(rows, columns) { - return rows.map(function (row) { - return columns.map(function (column) { - return formatValue(row[column]); - }).join(delimiter); - }); - } - - function format(rows, columns) { - if (columns == null) columns = inferColumns(rows); - return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n"); - } - - function formatBody(rows, columns) { - if (columns == null) columns = inferColumns(rows); - return preformatBody(rows, columns).join("\n"); - } - - function formatRows(rows) { - return rows.map(formatRow).join("\n"); - } - - function formatRow(row) { - return row.map(formatValue).join(delimiter); - } - - function formatValue(value) { - return value == null ? "" : value instanceof Date ? formatDate(value) : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" : value; - } - - return { - parse: parse, - parseRows: parseRows, - format: format, - formatBody: formatBody, - formatRows: formatRows, - formatRow: formatRow, - formatValue: formatValue - }; - } - - var csv = dsv(","); - var csvParse = csv.parse; - - var tsv = dsv("\t"); - var tsvParse = tsv.parse; - - function dsv$1 (defaultMimeType, parse) { - return function (url, row, callback) { - if (arguments.length < 3) callback = row, row = null; - var r = request(url).mimeType(defaultMimeType); - - r.row = function (_) { - return arguments.length ? r.response(responseOf(parse, row = _)) : row; - }; - - r.row(row); - return callback ? r.get(callback) : r; - }; - } - - function responseOf(parse, row) { - return function (request) { - return parse(request.responseText, row); - }; - } - - var csv$1 = dsv$1("text/csv", csvParse); - - var tsv$1 = dsv$1("text/tab-separated-values", tsvParse); - - function _typeof$d(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$d = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$d = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$d(obj); - } - /** - @function dataLoad - @desc Loads data from a filepath or URL, converts it to a valid JSON object, and returns it to a callback function. - @param {Array|String} path The path to the file or url to be loaded. Also support array of paths strings. If an Array of objects is passed, the xhr request logic is skipped. - @param {Function} [formatter] An optional formatter function that is run on the loaded data. - @param {String} [key] The key in the `this` context to save the resulting data to. - @param {Function} [callback] A function that is called when the final data is loaded. It is passed 2 variables, any error present and the data loaded. - */ - - function load (path, formatter, key, callback) { - var _this = this; - - var parser; - - var getParser = function getParser(path) { - var ext = path.slice(path.length - 4); - - switch (ext) { - case ".csv": - return csv$1; - - case ".tsv": - return tsv$1; - - case ".txt": - return text; - - default: - return json; - } - }; - - var validateData = function validateData(err, parser, data) { - if (parser !== json && !err && data && data instanceof Array) { - data.forEach(function (d) { - for (var k in d) { - if (!isNaN(d[k])) d[k] = parseFloat(d[k]);else if (d[k].toLowerCase() === "false") d[k] = false;else if (d[k].toLowerCase() === "true") d[k] = true;else if (d[k].toLowerCase() === "null") d[k] = null;else if (d[k].toLowerCase() === "undefined") d[k] = undefined; - } - }); - } - - return data; - }; - - var loadedLength = function loadedLength(loadedArray) { - return loadedArray.reduce(function (prev, current) { - return current ? prev + 1 : prev; - }, 0); - }; - - var getPathIndex = function getPathIndex(url, array) { - return array.indexOf(url); - }; // If path param is a not an Array then convert path to a 1 element Array to re-use logic - - - if (!(path instanceof Array)) path = [path]; - - var isData = function isData(dataItem) { - return typeof dataItem === "string" || _typeof$d(dataItem) === "object" && dataItem.url && dataItem.headers; - }; - - var needToLoad = path.find(isData); - var loaded = new Array(path.length); - var toLoad = []; // If there is a string I'm assuming is a Array to merge, urls or data - - if (needToLoad) { - path.forEach(function (dataItem, ix) { - if (isData(dataItem)) toLoad.push(dataItem);else loaded[ix] = dataItem; - }); - } // Data array itself - else { - loaded[0] = path; - } // Load all urls an combine them with data arrays - - - var alreadyLoaded = loadedLength(loaded); - toLoad.forEach(function (dataItem) { - var headers = {}, - url = dataItem; - - if (_typeof$d(dataItem) === "object") { - url = dataItem.url; - headers = dataItem.headers; - } - - parser = getParser(url); - var request = parser(url); - - for (var _key in headers) { - if ({}.hasOwnProperty.call(headers, _key)) { - request.header(_key, headers[_key]); - } - } - - request.get(function (err, data) { - data = err ? [] : data; - if (data && !(data instanceof Array) && data.data && data.headers) data = fold(data); - data = validateData(err, parser, data); - loaded[getPathIndex(url, path)] = data; - - if (loadedLength(loaded) - alreadyLoaded === toLoad.length) { - // All urls loaded - // Format data - data = loadedLength(loaded) === 1 ? loaded[0] : loaded; - if (_this._cache) _this._lrucache.set("".concat(key, "_").concat(url), data); - - if (formatter) { - data = formatter(loadedLength(loaded) === 1 ? loaded[0] : loaded); - } else if (key === "data") { - data = concat(loaded, "data"); - } - - if (key && "_".concat(key) in _this) _this["_".concat(key)] = data; - if (callback) callback(err, data); - } - }); - }); // If there is no data to Load response is immediately - - if (toLoad.length === 0) { - loaded = loaded.map(function (data) { - if (data && !(data instanceof Array) && data.data && data.headers) data = fold(data); - return data; - }); // Format data - - var data = loadedLength(loaded) === 1 ? loaded[0] : loaded; - - if (formatter) { - data = formatter(loadedLength(loaded) === 1 ? loaded[0] : loaded); - } else if (key === "data") { - data = concat(loaded, "data"); - } - - if (key && "_".concat(key) in this) this["_".concat(key)] = data; - if (callback) callback(null, data); - } - } - - function noevent () { - event$1.preventDefault(); - event$1.stopImmediatePropagation(); - } - - function dragDisable (view) { - var root = view.document.documentElement, - selection = _select(view).on("dragstart.drag", noevent, true); - - if ("onselectstart" in root) { - selection.on("selectstart.drag", noevent, true); - } else { - root.__noselect = root.style.MozUserSelect; - root.style.MozUserSelect = "none"; - } - } - function yesdrag(view, noclick) { - var root = view.document.documentElement, - selection = _select(view).on("dragstart.drag", null); - - if (noclick) { - selection.on("click.drag", noevent, true); - setTimeout(function () { - selection.on("click.drag", null); - }, 0); - } - - if ("onselectstart" in root) { - selection.on("selectstart.drag", null); - } else { - root.style.MozUserSelect = root.__noselect; - delete root.__noselect; - } - } - - function constant$5 (x) { - return function () { - return x; - }; - } - - function BrushEvent (target, type, selection) { - this.target = target; - this.type = type; - this.selection = selection; - } - - function nopropagation() { - event$1.stopImmediatePropagation(); - } - function noevent$1 () { - event$1.preventDefault(); - event$1.stopImmediatePropagation(); - } - - var MODE_DRAG = { - name: "drag" - }, - MODE_SPACE = { - name: "space" - }, - MODE_HANDLE = { - name: "handle" - }, - MODE_CENTER = { - name: "center" - }; - - function number1(e) { - return [+e[0], +e[1]]; - } - - function number2(e) { - return [number1(e[0]), number1(e[1])]; - } - - function toucher(identifier) { - return function (target) { - return touch(target, event$1.touches, identifier); - }; - } - - var X = { - name: "x", - handles: ["w", "e"].map(type$1), - input: function input(x, e) { - return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; - }, - output: function output(xy) { - return xy && [xy[0][0], xy[1][0]]; - } - }; - var Y = { - name: "y", - handles: ["n", "s"].map(type$1), - input: function input(y, e) { - return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; - }, - output: function output(xy) { - return xy && [xy[0][1], xy[1][1]]; - } - }; - var XY = { - name: "xy", - handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type$1), - input: function input(xy) { - return xy == null ? null : number2(xy); - }, - output: function output(xy) { - return xy; - } - }; - var cursors = { - overlay: "crosshair", - selection: "move", - n: "ns-resize", - e: "ew-resize", - s: "ns-resize", - w: "ew-resize", - nw: "nwse-resize", - ne: "nesw-resize", - se: "nwse-resize", - sw: "nesw-resize" - }; - var flipX = { - e: "w", - w: "e", - nw: "ne", - ne: "nw", - se: "sw", - sw: "se" - }; - var flipY = { - n: "s", - s: "n", - nw: "sw", - ne: "se", - se: "ne", - sw: "nw" - }; - var signsX = { - overlay: +1, - selection: +1, - n: null, - e: +1, - s: null, - w: -1, - nw: -1, - ne: +1, - se: +1, - sw: -1 - }; - var signsY = { - overlay: +1, - selection: +1, - n: -1, - e: null, - s: +1, - w: null, - nw: -1, - ne: -1, - se: +1, - sw: +1 - }; - - function type$1(t) { - return { - type: t - }; - } // Ignore right-click, since that should open the context menu. - - - function defaultFilter() { - return !event$1.ctrlKey && !event$1.button; - } - - function defaultExtent() { - var svg = this.ownerSVGElement || this; - - if (svg.hasAttribute("viewBox")) { - svg = svg.viewBox.baseVal; - return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]]; - } - - return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]]; - } - - function defaultTouchable() { - return navigator.maxTouchPoints || "ontouchstart" in this; - } // Like d3.local, but with the name “__brush” rather than auto-generated. - - - function local(node) { - while (!node.__brush) { - if (!(node = node.parentNode)) return; - } - - return node.__brush; - } - - function empty$1(extent) { - return extent[0][0] === extent[1][0] || extent[0][1] === extent[1][1]; - } - function brushX() { - return brush$1(X); - } - function brush () { - return brush$1(XY); - } - - function brush$1(dim) { - var extent = defaultExtent, - filter = defaultFilter, - touchable = defaultTouchable, - keys = true, - listeners = dispatch("start", "brush", "end"), - handleSize = 6, - touchending; - - function brush(group) { - var overlay = group.property("__brush", initialize).selectAll(".overlay").data([type$1("overlay")]); - overlay.enter().append("rect").attr("class", "overlay").attr("pointer-events", "all").attr("cursor", cursors.overlay).merge(overlay).each(function () { - var extent = local(this).extent; - _select(this).attr("x", extent[0][0]).attr("y", extent[0][1]).attr("width", extent[1][0] - extent[0][0]).attr("height", extent[1][1] - extent[0][1]); - }); - group.selectAll(".selection").data([type$1("selection")]).enter().append("rect").attr("class", "selection").attr("cursor", cursors.selection).attr("fill", "#777").attr("fill-opacity", 0.3).attr("stroke", "#fff").attr("shape-rendering", "crispEdges"); - var handle = group.selectAll(".handle").data(dim.handles, function (d) { - return d.type; - }); - handle.exit().remove(); - handle.enter().append("rect").attr("class", function (d) { - return "handle handle--" + d.type; - }).attr("cursor", function (d) { - return cursors[d.type]; - }); - group.each(redraw).attr("fill", "none").attr("pointer-events", "all").on("mousedown.brush", started).filter(touchable).on("touchstart.brush", started).on("touchmove.brush", touchmoved).on("touchend.brush touchcancel.brush", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); - } - - brush.move = function (group, selection) { - if (group.selection) { - group.on("start.brush", function () { - emitter(this, arguments).beforestart().start(); - }).on("interrupt.brush end.brush", function () { - emitter(this, arguments).end(); - }).tween("brush", function () { - var that = this, - state = that.__brush, - emit = emitter(that, arguments), - selection0 = state.selection, - selection1 = dim.input(typeof selection === "function" ? selection.apply(this, arguments) : selection, state.extent), - i = interpolate(selection0, selection1); - - function tween(t) { - state.selection = t === 1 && selection1 === null ? null : i(t); - redraw.call(that); - emit.brush(); - } - - return selection0 !== null && selection1 !== null ? tween : tween(1); - }); - } else { - group.each(function () { - var that = this, - args = arguments, - state = that.__brush, - selection1 = dim.input(typeof selection === "function" ? selection.apply(that, args) : selection, state.extent), - emit = emitter(that, args).beforestart(); - interrupt(that); - state.selection = selection1 === null ? null : selection1; - redraw.call(that); - emit.start().brush().end(); - }); - } - }; - - brush.clear = function (group) { - brush.move(group, null); - }; - - function redraw() { - var group = _select(this), - selection = local(this).selection; - - if (selection) { - group.selectAll(".selection").style("display", null).attr("x", selection[0][0]).attr("y", selection[0][1]).attr("width", selection[1][0] - selection[0][0]).attr("height", selection[1][1] - selection[0][1]); - group.selectAll(".handle").style("display", null).attr("x", function (d) { - return d.type[d.type.length - 1] === "e" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; - }).attr("y", function (d) { - return d.type[0] === "s" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; - }).attr("width", function (d) { - return d.type === "n" || d.type === "s" ? selection[1][0] - selection[0][0] + handleSize : handleSize; - }).attr("height", function (d) { - return d.type === "e" || d.type === "w" ? selection[1][1] - selection[0][1] + handleSize : handleSize; - }); - } else { - group.selectAll(".selection,.handle").style("display", "none").attr("x", null).attr("y", null).attr("width", null).attr("height", null); - } - } - - function emitter(that, args, clean) { - return !clean && that.__brush.emitter || new Emitter(that, args); - } - - function Emitter(that, args) { - this.that = that; - this.args = args; - this.state = that.__brush; - this.active = 0; - } - - Emitter.prototype = { - beforestart: function beforestart() { - if (++this.active === 1) this.state.emitter = this, this.starting = true; - return this; - }, - start: function start() { - if (this.starting) this.starting = false, this.emit("start");else this.emit("brush"); - return this; - }, - brush: function brush() { - this.emit("brush"); - return this; - }, - end: function end() { - if (--this.active === 0) delete this.state.emitter, this.emit("end"); - return this; - }, - emit: function emit(type) { - customEvent(new BrushEvent(brush, type, dim.output(this.state.selection)), listeners.apply, listeners, [type, this.that, this.args]); - } - }; - - function started() { - if (touchending && !event$1.touches) return; - if (!filter.apply(this, arguments)) return; - var that = this, - type = event$1.target.__data__.type, - mode = (keys && event$1.metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : keys && event$1.altKey ? MODE_CENTER : MODE_HANDLE, - signX = dim === Y ? null : signsX[type], - signY = dim === X ? null : signsY[type], - state = local(that), - extent = state.extent, - selection = state.selection, - W = extent[0][0], - w0, - w1, - N = extent[0][1], - n0, - n1, - E = extent[1][0], - e0, - e1, - S = extent[1][1], - s0, - s1, - dx = 0, - dy = 0, - moving, - shifting = signX && signY && keys && event$1.shiftKey, - lockX, - lockY, - pointer = event$1.touches ? toucher(event$1.changedTouches[0].identifier) : mouse, - point0 = pointer(that), - point = point0, - emit = emitter(that, arguments, true).beforestart(); - - if (type === "overlay") { - if (selection) moving = true; - state.selection = selection = [[w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]], [e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0]]; - } else { - w0 = selection[0][0]; - n0 = selection[0][1]; - e0 = selection[1][0]; - s0 = selection[1][1]; - } - - w1 = w0; - n1 = n0; - e1 = e0; - s1 = s0; - var group = _select(that).attr("pointer-events", "none"); - var overlay = group.selectAll(".overlay").attr("cursor", cursors[type]); - - if (event$1.touches) { - emit.moved = moved; - emit.ended = ended; - } else { - var view = _select(event$1.view).on("mousemove.brush", moved, true).on("mouseup.brush", ended, true); - if (keys) view.on("keydown.brush", keydowned, true).on("keyup.brush", keyupped, true); - dragDisable(event$1.view); - } - - nopropagation(); - interrupt(that); - redraw.call(that); - emit.start(); - - function moved() { - var point1 = pointer(that); - - if (shifting && !lockX && !lockY) { - if (Math.abs(point1[0] - point[0]) > Math.abs(point1[1] - point[1])) lockY = true;else lockX = true; - } - - point = point1; - moving = true; - noevent$1(); - move(); - } - - function move() { - var t; - dx = point[0] - point0[0]; - dy = point[1] - point0[1]; - - switch (mode) { - case MODE_SPACE: - case MODE_DRAG: - { - if (signX) dx = Math.max(W - w0, Math.min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx; - if (signY) dy = Math.max(N - n0, Math.min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy; - break; - } - - case MODE_HANDLE: - { - if (signX < 0) dx = Math.max(W - w0, Math.min(E - w0, dx)), w1 = w0 + dx, e1 = e0;else if (signX > 0) dx = Math.max(W - e0, Math.min(E - e0, dx)), w1 = w0, e1 = e0 + dx; - if (signY < 0) dy = Math.max(N - n0, Math.min(S - n0, dy)), n1 = n0 + dy, s1 = s0;else if (signY > 0) dy = Math.max(N - s0, Math.min(S - s0, dy)), n1 = n0, s1 = s0 + dy; - break; - } - - case MODE_CENTER: - { - if (signX) w1 = Math.max(W, Math.min(E, w0 - dx * signX)), e1 = Math.max(W, Math.min(E, e0 + dx * signX)); - if (signY) n1 = Math.max(N, Math.min(S, n0 - dy * signY)), s1 = Math.max(N, Math.min(S, s0 + dy * signY)); - break; - } - } - - if (e1 < w1) { - signX *= -1; - t = w0, w0 = e0, e0 = t; - t = w1, w1 = e1, e1 = t; - if (type in flipX) overlay.attr("cursor", cursors[type = flipX[type]]); - } - - if (s1 < n1) { - signY *= -1; - t = n0, n0 = s0, s0 = t; - t = n1, n1 = s1, s1 = t; - if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]); - } - - if (state.selection) selection = state.selection; // May be set by brush.move! - - if (lockX) w1 = selection[0][0], e1 = selection[1][0]; - if (lockY) n1 = selection[0][1], s1 = selection[1][1]; - - if (selection[0][0] !== w1 || selection[0][1] !== n1 || selection[1][0] !== e1 || selection[1][1] !== s1) { - state.selection = [[w1, n1], [e1, s1]]; - redraw.call(that); - emit.brush(); - } - } - - function ended() { - nopropagation(); - - if (event$1.touches) { - if (event$1.touches.length) return; - if (touchending) clearTimeout(touchending); - touchending = setTimeout(function () { - touchending = null; - }, 500); // Ghost clicks are delayed! - } else { - yesdrag(event$1.view, moving); - view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null); - } - - group.attr("pointer-events", "all"); - overlay.attr("cursor", cursors.overlay); - if (state.selection) selection = state.selection; // May be set by brush.move (on start)! - - if (empty$1(selection)) state.selection = null, redraw.call(that); - emit.end(); - } - - function keydowned() { - switch (event$1.keyCode) { - case 16: - { - // SHIFT - shifting = signX && signY; - break; - } - - case 18: - { - // ALT - if (mode === MODE_HANDLE) { - if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX; - if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY; - mode = MODE_CENTER; - move(); - } - - break; - } - - case 32: - { - // SPACE; takes priority over ALT - if (mode === MODE_HANDLE || mode === MODE_CENTER) { - if (signX < 0) e0 = e1 - dx;else if (signX > 0) w0 = w1 - dx; - if (signY < 0) s0 = s1 - dy;else if (signY > 0) n0 = n1 - dy; - mode = MODE_SPACE; - overlay.attr("cursor", cursors.selection); - move(); - } - - break; - } - - default: - return; - } - - noevent$1(); - } - - function keyupped() { - switch (event$1.keyCode) { - case 16: - { - // SHIFT - if (shifting) { - lockX = lockY = shifting = false; - move(); - } - - break; - } - - case 18: - { - // ALT - if (mode === MODE_CENTER) { - if (signX < 0) e0 = e1;else if (signX > 0) w0 = w1; - if (signY < 0) s0 = s1;else if (signY > 0) n0 = n1; - mode = MODE_HANDLE; - move(); - } - - break; - } - - case 32: - { - // SPACE - if (mode === MODE_SPACE) { - if (event$1.altKey) { - if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX; - if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY; - mode = MODE_CENTER; - } else { - if (signX < 0) e0 = e1;else if (signX > 0) w0 = w1; - if (signY < 0) s0 = s1;else if (signY > 0) n0 = n1; - mode = MODE_HANDLE; - } - - overlay.attr("cursor", cursors[type]); - move(); - } - - break; - } - - default: - return; - } - - noevent$1(); - } - } - - function touchmoved() { - emitter(this, arguments).moved(); - } - - function touchended() { - emitter(this, arguments).ended(); - } - - function initialize() { - var state = this.__brush || { - selection: null - }; - state.extent = number2(extent.apply(this, arguments)); - state.dim = dim; - return state; - } - - brush.extent = function (_) { - return arguments.length ? (extent = typeof _ === "function" ? _ : constant$5(number2(_)), brush) : extent; - }; - - brush.filter = function (_) { - return arguments.length ? (filter = typeof _ === "function" ? _ : constant$5(!!_), brush) : filter; - }; - - brush.touchable = function (_) { - return arguments.length ? (touchable = typeof _ === "function" ? _ : constant$5(!!_), brush) : touchable; - }; - - brush.handleSize = function (_) { - return arguments.length ? (handleSize = +_, brush) : handleSize; - }; - - brush.keyModifiers = function (_) { - return arguments.length ? (keys = !!_, brush) : keys; - }; - - brush.on = function () { - var value = listeners.on.apply(listeners, arguments); - return value === listeners ? brush : value; - }; - - return brush; - } - - function define$3 (constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; - } - function extend$4(parent, definition) { - var prototype = Object.create(parent.prototype); - - for (var key in definition) { - prototype[key] = definition[key]; - } - - return prototype; - } - - function Color$3() {} - var _darker$3 = 0.7; - - var _brighter$3 = 1 / _darker$3; - var reI$3 = "\\s*([+-]?\\d+)\\s*", - reN$3 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP$3 = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex$2 = /^#([0-9a-f]{3,8})$/, - reRgbInteger$3 = new RegExp("^rgb\\(" + [reI$3, reI$3, reI$3] + "\\)$"), - reRgbPercent$3 = new RegExp("^rgb\\(" + [reP$3, reP$3, reP$3] + "\\)$"), - reRgbaInteger$3 = new RegExp("^rgba\\(" + [reI$3, reI$3, reI$3, reN$3] + "\\)$"), - reRgbaPercent$3 = new RegExp("^rgba\\(" + [reP$3, reP$3, reP$3, reN$3] + "\\)$"), - reHslPercent$3 = new RegExp("^hsl\\(" + [reN$3, reP$3, reP$3] + "\\)$"), - reHslaPercent$3 = new RegExp("^hsla\\(" + [reN$3, reP$3, reP$3, reN$3] + "\\)$"); - var named$3 = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 - }; - define$3(Color$3, color$3, { - copy: function copy(channels) { - return Object.assign(new this.constructor(), this, channels); - }, - displayable: function displayable() { - return this.rgb().displayable(); - }, - hex: color_formatHex$2, - // Deprecated! Use color.formatHex. - formatHex: color_formatHex$2, - formatHsl: color_formatHsl$2, - formatRgb: color_formatRgb$2, - toString: color_formatRgb$2 - }); - - function color_formatHex$2() { - return this.rgb().formatHex(); - } - - function color_formatHsl$2() { - return hslConvert$3(this).formatHsl(); - } - - function color_formatRgb$2() { - return this.rgb().formatRgb(); - } - - function color$3(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex$2.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn$3(m) // #ff0000 - : l === 3 ? new Rgb$3(m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, (m & 0xf) << 4 | m & 0xf, 1) // #f00 - : l === 8 ? rgba$3(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba$3(m >> 12 & 0xf | m >> 8 & 0xf0, m >> 8 & 0xf | m >> 4 & 0xf0, m >> 4 & 0xf | m & 0xf0, ((m & 0xf) << 4 | m & 0xf) / 0xff) // #f000 - : null // invalid hex - ) : (m = reRgbInteger$3.exec(format)) ? new Rgb$3(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent$3.exec(format)) ? new Rgb$3(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger$3.exec(format)) ? rgba$3(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent$3.exec(format)) ? rgba$3(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent$3.exec(format)) ? hsla$3(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent$3.exec(format)) ? hsla$3(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named$3.hasOwnProperty(format) ? rgbn$3(named$3[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb$3(NaN, NaN, NaN, 0) : null; - } - - function rgbn$3(n) { - return new Rgb$3(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); - } - - function rgba$3(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb$3(r, g, b, a); - } - - function rgbConvert$3(o) { - if (!(o instanceof Color$3)) o = color$3(o); - if (!o) return new Rgb$3(); - o = o.rgb(); - return new Rgb$3(o.r, o.g, o.b, o.opacity); - } - function rgb$3(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert$3(r) : new Rgb$3(r, g, b, opacity == null ? 1 : opacity); - } - function Rgb$3(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; - } - define$3(Rgb$3, rgb$3, extend$4(Color$3, { - brighter: function brighter(k) { - k = k == null ? _brighter$3 : Math.pow(_brighter$3, k); - return new Rgb$3(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker$3 : Math.pow(_darker$3, k); - return new Rgb$3(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function rgb() { - return this; - }, - displayable: function displayable() { - return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1; - }, - hex: rgb_formatHex$2, - // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex$2, - formatRgb: rgb_formatRgb$2, - toString: rgb_formatRgb$2 - })); - - function rgb_formatHex$2() { - return "#" + hex$2(this.r) + hex$2(this.g) + hex$2(this.b); - } - - function rgb_formatRgb$2() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")"); - } - - function hex$2(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); - } - - function hsla$3(h, s, l, a) { - if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN; - return new Hsl$3(h, s, l, a); - } - - function hslConvert$3(o) { - if (o instanceof Hsl$3) return new Hsl$3(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color$3)) o = color$3(o); - if (!o) return new Hsl$3(); - if (o instanceof Hsl$3) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - - return new Hsl$3(h, s, l, o.opacity); - } - function hsl$3(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert$3(h) : new Hsl$3(h, s, l, opacity == null ? 1 : opacity); - } - - function Hsl$3(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define$3(Hsl$3, hsl$3, extend$4(Color$3, { - brighter: function brighter(k) { - k = k == null ? _brighter$3 : Math.pow(_brighter$3, k); - return new Hsl$3(this.h, this.s, this.l * k, this.opacity); - }, - darker: function darker(k) { - k = k == null ? _darker$3 : Math.pow(_darker$3, k); - return new Hsl$3(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function rgb() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb$3(hsl2rgb$3(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb$3(h, m1, m2), hsl2rgb$3(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity); - }, - displayable: function displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; - }, - formatHsl: function formatHsl() { - var a = this.opacity; - a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")"); - } - })); - /* From FvD 13.37, CSS Color Module Level 3 */ - - function hsl2rgb$3(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; - } - - var slice$2 = [].slice; - - var noabort = {}; - - function Queue(size) { - this._size = size; - this._call = this._error = null; - this._tasks = []; - this._data = []; - this._waiting = this._active = this._ended = this._start = 0; // inside a synchronous task callback? - } - - Queue.prototype = queue.prototype = { - constructor: Queue, - defer: function defer(callback) { - if (typeof callback !== "function") throw new Error("invalid callback"); - if (this._call) throw new Error("defer after await"); - if (this._error != null) return this; - var t = slice$2.call(arguments, 1); - t.push(callback); - ++this._waiting, this._tasks.push(t); - poke$1(this); - return this; - }, - abort: function abort() { - if (this._error == null) _abort(this, new Error("abort")); - return this; - }, - "await": function _await(callback) { - if (typeof callback !== "function") throw new Error("invalid callback"); - if (this._call) throw new Error("multiple await"); - - this._call = function (error, results) { - callback.apply(null, [error].concat(results)); - }; - - maybeNotify(this); - return this; - }, - awaitAll: function awaitAll(callback) { - if (typeof callback !== "function") throw new Error("invalid callback"); - if (this._call) throw new Error("multiple await"); - this._call = callback; - maybeNotify(this); - return this; - } - }; - - function poke$1(q) { - if (!q._start) { - try { - start$1(q); - } // let the current task complete - catch (e) { - if (q._tasks[q._ended + q._active - 1]) _abort(q, e); // task errored synchronously - else if (!q._data) throw e; // await callback errored synchronously - } - } - } - - function start$1(q) { - while (q._start = q._waiting && q._active < q._size) { - var i = q._ended + q._active, - t = q._tasks[i], - j = t.length - 1, - c = t[j]; - t[j] = end(q, i); - --q._waiting, ++q._active; - t = c.apply(null, t); - if (!q._tasks[i]) continue; // task finished synchronously - - q._tasks[i] = t || noabort; - } - } - - function end(q, i) { - return function (e, r) { - if (!q._tasks[i]) return; // ignore multiple callbacks - - --q._active, ++q._ended; - q._tasks[i] = null; - if (q._error != null) return; // ignore secondary errors - - if (e != null) { - _abort(q, e); - } else { - q._data[i] = r; - if (q._waiting) poke$1(q);else maybeNotify(q); - } - }; - } - - function _abort(q, e) { - var i = q._tasks.length, - t; - q._error = e; // ignore active callbacks - - q._data = undefined; // allow gc - - q._waiting = NaN; // prevent starting - - while (--i >= 0) { - if (t = q._tasks[i]) { - q._tasks[i] = null; - - if (t.abort) { - try { - t.abort(); - } catch (e) { - /* ignore */ - } - } - } - } - - q._active = NaN; // allow notification - - maybeNotify(q); - } - - function maybeNotify(q) { - if (!q._active && q._call) { - var d = q._data; - q._data = undefined; // allow gc - - q._call(q._error, d); - } - } - - function queue(concurrency) { - if (concurrency == null) concurrency = Infinity;else if (!((concurrency = +concurrency) >= 1)) throw new Error("invalid concurrency"); - return new Queue(concurrency); - } - - function constant$6 (x) { - return function () { - return x; - }; - } - - function ZoomEvent(target, type, transform) { - this.target = target; - this.type = type; - this.transform = transform; - } - - function Transform(k, x, y) { - this.k = k; - this.x = x; - this.y = y; - } - Transform.prototype = { - constructor: Transform, - scale: function scale(k) { - return k === 1 ? this : new Transform(this.k * k, this.x, this.y); - }, - translate: function translate(x, y) { - return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y); - }, - apply: function apply(point) { - return [point[0] * this.k + this.x, point[1] * this.k + this.y]; - }, - applyX: function applyX(x) { - return x * this.k + this.x; - }, - applyY: function applyY(y) { - return y * this.k + this.y; - }, - invert: function invert(location) { - return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; - }, - invertX: function invertX(x) { - return (x - this.x) / this.k; - }, - invertY: function invertY(y) { - return (y - this.y) / this.k; - }, - rescaleX: function rescaleX(x) { - return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x)); - }, - rescaleY: function rescaleY(y) { - return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y)); - }, - toString: function toString() { - return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; - } - }; - var identity$5 = new Transform(1, 0, 0); - transform.prototype = Transform.prototype; - function transform(node) { - while (!node.__zoom) { - if (!(node = node.parentNode)) return identity$5; - } - - return node.__zoom; - } - - function nopropagation$1() { - event$1.stopImmediatePropagation(); - } - function noevent$2 () { - event$1.preventDefault(); - event$1.stopImmediatePropagation(); - } - - function defaultFilter$1() { - return !event$1.ctrlKey && !event$1.button; - } - - function defaultExtent$1() { - var e = this; - - if (e instanceof SVGElement) { - e = e.ownerSVGElement || e; - - if (e.hasAttribute("viewBox")) { - e = e.viewBox.baseVal; - return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; - } - - return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; - } - - return [[0, 0], [e.clientWidth, e.clientHeight]]; - } - - function defaultTransform() { - return this.__zoom || identity$5; - } - - function defaultWheelDelta() { - return -event$1.deltaY * (event$1.deltaMode === 1 ? 0.05 : event$1.deltaMode ? 1 : 0.002); - } - - function defaultTouchable$1() { - return navigator.maxTouchPoints || "ontouchstart" in this; - } - - function defaultConstrain(transform, extent, translateExtent) { - var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], - dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], - dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], - dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; - return transform.translate(dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)); - } - - function zoom () { - var filter = defaultFilter$1, - extent = defaultExtent$1, - constrain = defaultConstrain, - wheelDelta = defaultWheelDelta, - touchable = defaultTouchable$1, - scaleExtent = [0, Infinity], - translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], - duration = 250, - interpolate = interpolateZoom, - listeners = dispatch("start", "zoom", "end"), - touchstarting, - touchending, - touchDelay = 500, - wheelDelay = 150, - clickDistance2 = 0; - - function zoom(selection) { - selection.property("__zoom", defaultTransform).on("wheel.zoom", wheeled).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); - } - - zoom.transform = function (collection, transform, point) { - var selection = collection.selection ? collection.selection() : collection; - selection.property("__zoom", defaultTransform); - - if (collection !== selection) { - schedule(collection, transform, point); - } else { - selection.interrupt().each(function () { - gesture(this, arguments).start().zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform).end(); - }); - } - }; - - zoom.scaleBy = function (selection, k, p) { - zoom.scaleTo(selection, function () { - var k0 = this.__zoom.k, - k1 = typeof k === "function" ? k.apply(this, arguments) : k; - return k0 * k1; - }, p); - }; - - zoom.scaleTo = function (selection, k, p) { - zoom.transform(selection, function () { - var e = extent.apply(this, arguments), - t0 = this.__zoom, - p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, - p1 = t0.invert(p0), - k1 = typeof k === "function" ? k.apply(this, arguments) : k; - return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); - }, p); - }; - - zoom.translateBy = function (selection, x, y) { - zoom.transform(selection, function () { - return constrain(this.__zoom.translate(typeof x === "function" ? x.apply(this, arguments) : x, typeof y === "function" ? y.apply(this, arguments) : y), extent.apply(this, arguments), translateExtent); - }); - }; - - zoom.translateTo = function (selection, x, y, p) { - zoom.transform(selection, function () { - var e = extent.apply(this, arguments), - t = this.__zoom, - p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; - return constrain(identity$5.translate(p0[0], p0[1]).scale(t.k).translate(typeof x === "function" ? -x.apply(this, arguments) : -x, typeof y === "function" ? -y.apply(this, arguments) : -y), e, translateExtent); - }, p); - }; - - function scale(transform, k) { - k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)); - return k === transform.k ? transform : new Transform(k, transform.x, transform.y); - } - - function translate(transform, p0, p1) { - var x = p0[0] - p1[0] * transform.k, - y = p0[1] - p1[1] * transform.k; - return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y); - } - - function centroid(extent) { - return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; - } - - function schedule(transition, transform, point) { - transition.on("start.zoom", function () { - gesture(this, arguments).start(); - }).on("interrupt.zoom end.zoom", function () { - gesture(this, arguments).end(); - }).tween("zoom", function () { - var that = this, - args = arguments, - g = gesture(that, args), - e = extent.apply(that, args), - p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, - w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), - a = that.__zoom, - b = typeof transform === "function" ? transform.apply(that, args) : transform, - i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k)); - return function (t) { - if (t === 1) t = b; // Avoid rounding error on end. - else { - var l = i(t), - k = w / l[2]; - t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); - } - g.zoom(null, t); - }; - }); - } - - function gesture(that, args, clean) { - return !clean && that.__zooming || new Gesture(that, args); - } - - function Gesture(that, args) { - this.that = that; - this.args = args; - this.active = 0; - this.extent = extent.apply(that, args); - this.taps = 0; - } - - Gesture.prototype = { - start: function start() { - if (++this.active === 1) { - this.that.__zooming = this; - this.emit("start"); - } - - return this; - }, - zoom: function zoom(key, transform) { - if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]); - if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]); - if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]); - this.that.__zoom = transform; - this.emit("zoom"); - return this; - }, - end: function end() { - if (--this.active === 0) { - delete this.that.__zooming; - this.emit("end"); - } - - return this; - }, - emit: function emit(type) { - customEvent(new ZoomEvent(zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]); - } - }; - - function wheeled() { - if (!filter.apply(this, arguments)) return; - var g = gesture(this, arguments), - t = this.__zoom, - k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), - p = mouse(this); // If the mouse is in the same location as before, reuse it. - // If there were recent wheel events, reset the wheel idle timeout. - - if (g.wheel) { - if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) { - g.mouse[1] = t.invert(g.mouse[0] = p); - } - - clearTimeout(g.wheel); - } // If this wheel event won’t trigger a transform change, ignore it. - else if (t.k === k) return; // Otherwise, capture the mouse point and location at the start. - else { - g.mouse = [p, t.invert(p)]; - interrupt(this); - g.start(); - } - - noevent$2(); - g.wheel = setTimeout(wheelidled, wheelDelay); - g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent)); - - function wheelidled() { - g.wheel = null; - g.end(); - } - } - - function mousedowned() { - if (touchending || !filter.apply(this, arguments)) return; - var g = gesture(this, arguments, true), - v = _select(event$1.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), - p = mouse(this), - x0 = event$1.clientX, - y0 = event$1.clientY; - dragDisable(event$1.view); - nopropagation$1(); - g.mouse = [p, this.__zoom.invert(p)]; - interrupt(this); - g.start(); - - function mousemoved() { - noevent$2(); - - if (!g.moved) { - var dx = event$1.clientX - x0, - dy = event$1.clientY - y0; - g.moved = dx * dx + dy * dy > clickDistance2; - } - - g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent, translateExtent)); - } - - function mouseupped() { - v.on("mousemove.zoom mouseup.zoom", null); - yesdrag(event$1.view, g.moved); - noevent$2(); - g.end(); - } - } - - function dblclicked() { - if (!filter.apply(this, arguments)) return; - var t0 = this.__zoom, - p0 = mouse(this), - p1 = t0.invert(p0), - k1 = t0.k * (event$1.shiftKey ? 0.5 : 2), - t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments), translateExtent); - noevent$2(); - if (duration > 0) _select(this).transition().duration(duration).call(schedule, t1, p0);else _select(this).call(zoom.transform, t1); - } - - function touchstarted() { - if (!filter.apply(this, arguments)) return; - var touches = event$1.touches, - n = touches.length, - g = gesture(this, arguments, event$1.changedTouches.length === n), - started, - i, - t, - p; - nopropagation$1(); - - for (i = 0; i < n; ++i) { - t = touches[i], p = touch(this, touches, t.identifier); - p = [p, this.__zoom.invert(p), t.identifier]; - if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; - } - - if (touchstarting) touchstarting = clearTimeout(touchstarting); - - if (started) { - if (g.taps < 2) touchstarting = setTimeout(function () { - touchstarting = null; - }, touchDelay); - interrupt(this); - g.start(); - } - } - - function touchmoved() { - if (!this.__zooming) return; - var g = gesture(this, arguments), - touches = event$1.changedTouches, - n = touches.length, - i, - t, - p, - l; - noevent$2(); - if (touchstarting) touchstarting = clearTimeout(touchstarting); - g.taps = 0; - - for (i = 0; i < n; ++i) { - t = touches[i], p = touch(this, touches, t.identifier); - if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p; - } - - t = g.that.__zoom; - - if (g.touch1) { - var p0 = g.touch0[0], - l0 = g.touch0[1], - p1 = g.touch1[0], - l1 = g.touch1[1], - dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, - dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl; - t = scale(t, Math.sqrt(dp / dl)); - p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2]; - l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2]; - } else if (g.touch0) p = g.touch0[0], l = g.touch0[1];else return; - - g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent)); - } - - function touchended() { - if (!this.__zooming) return; - var g = gesture(this, arguments), - touches = event$1.changedTouches, - n = touches.length, - i, - t; - nopropagation$1(); - if (touchending) clearTimeout(touchending); - touchending = setTimeout(function () { - touchending = null; - }, touchDelay); - - for (i = 0; i < n; ++i) { - t = touches[i]; - if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1; - } - - if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; - if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);else { - g.end(); // If this was a dbltap, reroute to the (optional) dblclick.zoom handler. - - if (g.taps === 2) { - var p = _select(this).on("dblclick.zoom"); - if (p) p.apply(this, arguments); - } - } - } - - zoom.wheelDelta = function (_) { - return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant$6(+_), zoom) : wheelDelta; - }; - - zoom.filter = function (_) { - return arguments.length ? (filter = typeof _ === "function" ? _ : constant$6(!!_), zoom) : filter; - }; - - zoom.touchable = function (_) { - return arguments.length ? (touchable = typeof _ === "function" ? _ : constant$6(!!_), zoom) : touchable; - }; - - zoom.extent = function (_) { - return arguments.length ? (extent = typeof _ === "function" ? _ : constant$6([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent; - }; - - zoom.scaleExtent = function (_) { - return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]]; - }; - - zoom.translateExtent = function (_) { - return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]]; - }; - - zoom.constrain = function (_) { - return arguments.length ? (constrain = _, zoom) : constrain; - }; - - zoom.duration = function (_) { - return arguments.length ? (duration = +_, zoom) : duration; - }; - - zoom.interpolate = function (_) { - return arguments.length ? (interpolate = _, zoom) : interpolate; - }; - - zoom.on = function () { - var value = listeners.on.apply(listeners, arguments); - return value === listeners ? zoom : value; - }; - - zoom.clickDistance = function (_) { - return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2); - }; - - return zoom; - } - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var lrucache = createCommonjsModule(function (module) { - - (function (root, factory) { - - { - module.exports = factory(); - } - })((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' ? window : commonjsGlobal, function () { - - var undef = void 0; - - function LRUCache(capacity) { - if (!(this instanceof LRUCache)) return new LRUCache(capacity); - this._LRUCacheState = new CacheState(capacity); - } - - var proto = LRUCache.prototype; - - proto.get = function (key) { - var state = this._LRUCacheState; - var lruEntry = state.hash[key]; - if (!lruEntry) return; - refresh(state.linkedList, lruEntry); - return state.data[key]; - }; - - proto.set = function (key, value) { - var state = this._LRUCacheState; - var lruEntry = state.hash[key]; - if (value === undef) return this; - - if (!lruEntry) { - state.hash[key] = new LRUEntry(key); - state.linkedList.length += 1; - lruEntry = state.hash[key]; - } - - refresh(state.linkedList, lruEntry); - state.data[key] = value; - if (state.linkedList.length > state.capacity) this.remove(state.linkedList.end.key); - return this; - }; - - proto.update = function (key, parseFn) { - if (this.has(key)) this.set(key, parseFn(this.get(key))); - return this; - }; - - proto.remove = function (key) { - var state = this._LRUCacheState; - var lruEntry = state.hash[key]; - if (!lruEntry) return this; - if (lruEntry === state.linkedList.head) state.linkedList.head = lruEntry.p; - if (lruEntry === state.linkedList.end) state.linkedList.end = lruEntry.n; - link(lruEntry.n, lruEntry.p); - delete state.hash[key]; - delete state.data[key]; - state.linkedList.length -= 1; - return this; - }; - - proto.removeAll = function () { - this._LRUCacheState = new CacheState(this._LRUCacheState.capacity); - return this; - }; - - proto.info = function () { - var state = this._LRUCacheState; - return { - capacity: state.capacity, - length: state.linkedList.length - }; - }; - - proto.keys = function () { - var keys = []; - var lruEntry = this._LRUCacheState.linkedList.head; - - while (lruEntry) { - keys.push(lruEntry.key); - lruEntry = lruEntry.p; - } - - return keys; - }; - - proto.has = function (key) { - return !!this._LRUCacheState.hash[key]; - }; - - proto.staleKey = function () { - return this._LRUCacheState.linkedList.end && this._LRUCacheState.linkedList.end.key; - }; - - proto.popStale = function () { - var staleKey = this.staleKey(); - if (!staleKey) return null; - var stale = [staleKey, this._LRUCacheState.data[staleKey]]; - this.remove(staleKey); - return stale; - }; - - function CacheState(capacity) { - this.capacity = capacity > 0 ? +capacity : Number.MAX_SAFE_INTEGER || Number.MAX_VALUE; - this.data = Object.create ? Object.create(null) : {}; - this.hash = Object.create ? Object.create(null) : {}; - this.linkedList = new LinkedList(); - } - - function LinkedList() { - this.length = 0; - this.head = null; - this.end = null; - } - - function LRUEntry(key) { - this.key = key; - this.p = null; - this.n = null; - } // 更新链表,把get或put方法操作的key提到链表head,即表示最新 - - - function refresh(linkedList, entry) { - if (entry === linkedList.head) return; - - if (!linkedList.end) { - linkedList.end = entry; - } else if (linkedList.end === entry) { - linkedList.end = entry.n; - } - - link(entry.n, entry.p); - link(entry, linkedList.head); - linkedList.head = entry; - linkedList.head.n = null; - } // 对两个链表对象建立链接,形成一条链 - - - function link(nextEntry, prevEntry) { - if (nextEntry === prevEntry) return; - if (nextEntry) nextEntry.p = prevEntry; - if (prevEntry) prevEntry.n = nextEntry; - } - - return LRUCache; - }); - }); - - // Computes the decimal coefficient and exponent of the specified number x with - // significant digits p, where x is positive and p is in [1, 21] or undefined. - // For example, formatDecimal(1.23) returns ["123", 0]. - function formatDecimal$1 (x, p) { - if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity - - var i, - coefficient = x.slice(0, i); // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - - return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)]; - } - - function exponent$1 (x) { - return x = formatDecimal$1(Math.abs(x)), x ? x[1] : NaN; - } - - function formatGroup$1 (grouping, thousands) { - return function (value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; - - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - - return t.reverse().join(thousands); - }; - } - - function formatNumerals$1 (numerals) { - return function (value) { - return value.replace(/[0-9]/g, function (i) { - return numerals[+i]; - }); - }; - } - - // [[fill]align][sign][symbol][0][width][,][.precision][~][type] - var re$1 = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - function formatSpecifier$1(specifier) { - if (!(match = re$1.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier$1({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); - } - formatSpecifier$1.prototype = FormatSpecifier$1.prototype; // instanceof - - function FormatSpecifier$1(specifier) { - this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; - this.align = specifier.align === undefined ? ">" : specifier.align + ""; - this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === undefined ? undefined : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === undefined ? undefined : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === undefined ? "" : specifier.type + ""; - } - - FormatSpecifier$1.prototype.toString = function () { - return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; - }; - - // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. - function formatTrim$1 (s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case ".": - i0 = i1 = i; - break; - - case "0": - if (i0 === 0) i0 = i; - i1 = i; - break; - - default: - if (!+s[i]) break out; - if (i0 > 0) i0 = 0; - break; - } - } - - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; - } - - var prefixExponent$1; - function formatPrefixAuto$1 (x, p) { - var d = formatDecimal$1(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1], - i = exponent - (prefixExponent$1 = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, - n = coefficient.length; - return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimal$1(x, Math.max(0, p + i - 1))[0]; // less than 1y! - } - - function formatRounded$1 (x, p) { - var d = formatDecimal$1(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0"); - } - - var formatTypes$1 = { - "%": function _(x, p) { - return (x * 100).toFixed(p); - }, - "b": function b(x) { - return Math.round(x).toString(2); - }, - "c": function c(x) { - return x + ""; - }, - "d": function d(x) { - return Math.round(x).toString(10); - }, - "e": function e(x, p) { - return x.toExponential(p); - }, - "f": function f(x, p) { - return x.toFixed(p); - }, - "g": function g(x, p) { - return x.toPrecision(p); - }, - "o": function o(x) { - return Math.round(x).toString(8); - }, - "p": function p(x, _p) { - return formatRounded$1(x * 100, _p); - }, - "r": formatRounded$1, - "s": formatPrefixAuto$1, - "X": function X(x) { - return Math.round(x).toString(16).toUpperCase(); - }, - "x": function x(_x) { - return Math.round(_x).toString(16); - } - }; - - function identity$6 (x) { - return x; - } - - var map$2 = Array.prototype.map, - prefixes$1 = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; - function formatLocale$2 (locale) { - var group = locale.grouping === undefined || locale.thousands === undefined ? identity$6 : formatGroup$1(map$2.call(locale.grouping, Number), locale.thousands + ""), - currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", - currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", - decimal = locale.decimal === undefined ? "." : locale.decimal + "", - numerals = locale.numerals === undefined ? identity$6 : formatNumerals$1(map$2.call(locale.numerals, String)), - percent = locale.percent === undefined ? "%" : locale.percent + "", - minus = locale.minus === undefined ? "-" : locale.minus + "", - nan = locale.nan === undefined ? "NaN" : locale.nan + ""; - - function newFormat(specifier) { - specifier = formatSpecifier$1(specifier); - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; // The "n" type is an alias for ",g". - - if (type === "n") comma = true, type = "g"; // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes$1[type]) precision === undefined && (precision = 12), trim = true, type = "g"; // If zero fill is specified, padding goes after sign and before digits. - - if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "="; // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", - suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - - var formatType = formatTypes$1[type], - maybeSuffix = /[defgprs%]/.test(type); // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - - precision = precision === undefined ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); - - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, - n, - c; - - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; // Determine the sign. -0 is not less than 0, but 1 / -0 is! - - var valueNegative = value < 0 || 1 / value < 0; // Perform the initial formatting. - - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); // Trim insignificant zeros. - - if (trim) value = formatTrim$1(value); // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. - - if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; // Compute the prefix and suffix. - - valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; - valueSuffix = (type === "s" ? prefixes$1[8 + prefixExponent$1 / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - - if (maybeSuffix) { - i = -1, n = value.length; - - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } // If the fill character is not "0", grouping is applied before padding. - - - if (comma && !zero) value = group(value, Infinity); // Compute the padding. - - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = length < width ? new Array(width - length + 1).join(fill) : ""; // If the fill character is "0", grouping is applied after padding. - - if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; // Reconstruct the final output based on the desired alignment. - - switch (align) { - case "<": - value = valuePrefix + value + valueSuffix + padding; - break; - - case "=": - value = valuePrefix + padding + value + valueSuffix; - break; - - case "^": - value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); - break; - - default: - value = padding + valuePrefix + value + valueSuffix; - break; - } - - return numerals(value); - } - - format.toString = function () { - return specifier + ""; - }; - - return format; - } - - function formatPrefix(specifier, value) { - var f = newFormat((specifier = formatSpecifier$1(specifier), specifier.type = "f", specifier)), - e = Math.max(-8, Math.min(8, Math.floor(exponent$1(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes$1[8 + e / 3]; - return function (value) { - return f(k * value) + prefix; - }; - } - - return { - format: newFormat, - formatPrefix: formatPrefix - }; - } - - /** - @namespace {Object} formatLocale - @desc A set of default locale formatters used when assigning suffixes and currency in numbers. - * - * | Name | Default | Description | - * |---|---|---| - * | separator | "" | Separation between the number with the suffix. | - * | suffixes | [] | List of suffixes used to format numbers. | - * | grouping | [3] | The array of group sizes, | - * | delimiters | {thousands: ",", decimal: "."} | Decimal and group separators. | - * | currency | ["$", ""] | The currency prefix and suffix. | - */ - var formatLocale$3 = { - "en-GB": { - separator: "", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "B", "T", "q", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: ",", - decimal: "." - }, - currency: ["£", ""] - }, - "en-US": { - separator: "", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "B", "T", "q", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: ",", - decimal: "." - }, - currency: ["$", ""] - }, - "es-CL": { - separator: "", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "MM", "B", "T", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: ".", - decimal: "," - }, - currency: ["$", ""] - }, - "es-MX": { - separator: "", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "MM", "B", "T", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: ",", - decimal: "." - }, - currency: ["$", ""] - }, - "es-ES": { - separator: "", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "mm", "b", "t", "q", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: ".", - decimal: "," - }, - currency: ["€", ""] - }, - "et-EE": { - separator: " ", - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "tuhat", "miljonit", "miljardit", "triljonit", "q", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: " ", - decimal: "," - }, - currency: ["", "eurot"] - }, - "fr-FR": { - suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "m", "b", "t", "q", "Q", "Z", "Y"], - grouping: [3], - delimiters: { - thousands: " ", - decimal: "," - }, - currency: ["€", ""] - } - }; - - function _typeof$e(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$e = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$e = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$e(obj); - } - - var round = function round(x, n) { - return parseFloat(Math.round(x * Math.pow(10, n)) / Math.pow(10, n)).toFixed(n); - }; - /** - * @private - */ - - - function formatSuffix(value, precision, suffixes) { - var i = 0; - - if (value) { - if (value < 0) value *= -1; - i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); - i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3)); - } - - var d = suffixes[8 + i / 3]; - return { - number: round(d.scale(value), precision), - symbol: d.symbol - }; - } - /** - * @private - */ - - - function parseSuffixes(d, i) { - var k = Math.pow(10, Math.abs(8 - i) * 3); - return { - scale: i > 8 ? function (d) { - return d / k; - } : function (d) { - return d * k; - }, - symbol: d - }; - } - /** - @function formatAbbreviate - @desc Formats a number to an appropriate number of decimal places and rounding, adding suffixes if applicable (ie. `1200000` to `"1.2M"`). - @param {Number|String} n The number to be formatted. - @param {Object|String} locale The locale config to be used. If *value* is an object, the function will format the numbers according the object. The object must include `suffixes`, `delimiter` and `currency` properties. - @returns {String} - */ - - - function formatAbbreviate (n) { - var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "en-US"; - var precision = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - if (isFinite(n)) n *= 1;else return "N/A"; - var negative = n < 0; - var length = n.toString().split(".")[0].replace("-", "").length, - localeConfig = _typeof$e(locale) === "object" ? locale : formatLocale$3[locale] || formatLocale$3["en-US"], - suffixes = localeConfig.suffixes.map(parseSuffixes); - var decimal = localeConfig.delimiters.decimal || ".", - separator = localeConfig.separator || "", - thousands = localeConfig.delimiters.thousands || ","; - var d3plusFormatLocale = formatLocale$2({ - currency: localeConfig.currency || ["$", ""], - decimal: decimal, - grouping: localeConfig.grouping || [3], - thousands: thousands - }); - var val; - if (precision) val = d3plusFormatLocale.format(precision)(n);else if (n === 0) val = "0";else if (length >= 3) { - var f = formatSuffix(d3plusFormatLocale.format(".3r")(n), 2, suffixes); - var num = parseFloat(f.number).toString().replace(".", decimal); - var _char = f.symbol; - val = "".concat(num).concat(separator).concat(_char); - } else if (length === 3) val = d3plusFormatLocale.format(",f")(n);else if (n < 1 && n > -1) val = d3plusFormatLocale.format(".2g")(n);else val = d3plusFormatLocale.format(".3g")(n); - return "".concat(negative && val.charAt(0) !== "-" ? "-" : "").concat(val).replace(/(\.[0]*[1-9]*)[0]*$/g, "$1") // removes any trailing zeros - .replace(/\.[0]*$/g, ""); // removes any trailing decimal point - } - - /** - @function date - @summary Parses numbers and strings to valid Javascript Date objects. - @description Returns a javascript Date object for a given a Number (representing either a 4-digit year or milliseconds since epoch) or a String that is in [valid dateString format](http://dygraphs.com/date-formats.html). Besides the 4-digit year parsing, this function is useful when needing to parse negative (BC) years, which the vanilla Date object cannot parse. - @param {Number|String} *date* - */ - function date$2 (d) { - // returns if already Date object - if (d.constructor === Date) return d; // detects if milliseconds - else if (d.constructor === Number && "".concat(d).length > 5 && d % 1 === 0) return new Date(d); - var s = "".concat(d); - var dayFormat = new RegExp(/^\d{1,2}[./-]\d{1,2}[./-](-*\d{1,4})$/g).exec(s), - strFormat = new RegExp(/^[A-z]{1,3} [A-z]{1,3} \d{1,2} (-*\d{1,4}) \d{1,2}:\d{1,2}:\d{1,2} [A-z]{1,3}-*\d{1,4} \([A-z]{1,3}\)/g).exec(s); // tests for XX/XX/XXXX format - - if (dayFormat) { - var year = dayFormat[1]; - if (year.indexOf("-") === 0) s = s.replace(year, year.substr(1)); - var date = new Date(s); - date.setFullYear(year); - return date; - } // tests for full Date object string format - else if (strFormat) { - var _year = strFormat[1]; - if (_year.indexOf("-") === 0) s = s.replace(_year, _year.substr(1)); - - var _date = new Date(s); - - _date.setFullYear(_year); - - return _date; - } // detects if only passing a year value - else if (!s.includes("/") && !s.includes(" ") && (!s.includes("-") || !s.indexOf("-"))) { - var _date2 = new Date("".concat(s, "/01/01")); - - _date2.setFullYear(d); - - return _date2; - } // parses string to Date object - else return new Date(s); - } - - var locale$2 = { - "de-DE": { - dateTime: "%A, der %e. %B %Y, %X", - date: "%d.%m.%Y", - time: "%H:%M:%S", - periods: ["AM", "PM"], - days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], - shortDays: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], - months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], - shortMonths: ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"] - }, - "en-GB": { - dateTime: "%a %e %b %X %Y", - date: "%d/%m/%Y", - time: "%H:%M:%S", - periods: ["AM", "PM"], - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] - }, - "en-US": { - dateTime: "%x, %X", - date: "%-m/%-d/%Y", - time: "%-I:%M:%S %p", - periods: ["AM", "PM"], - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] - }, - "es-ES": { - dateTime: "%A, %e de %B de %Y, %X", - date: "%d/%m/%Y", - time: "%H:%M:%S", - periods: ["AM", "PM"], - days: ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], - shortDays: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"], - months: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], - shortMonths: ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"] - }, - "es-MX": { - dateTime: "%x, %X", - date: "%d/%m/%Y", - time: "%-I:%M:%S %p", - periods: ["AM", "PM"], - days: ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], - shortDays: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"], - months: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"], - shortMonths: ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"] - }, - "fr-FR": { - dateTime: "%A, le %e %B %Y, %X", - date: "%d/%m/%Y", - time: "%H:%M:%S", - periods: ["AM", "PM"], - days: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"], - shortDays: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."], - months: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"], - shortMonths: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."] - }, - "it-IT": { - dateTime: "%A %e %B %Y, %X", - date: "%d/%m/%Y", - time: "%H:%M:%S", - periods: ["AM", "PM"], - days: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"], - shortDays: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], - months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], - shortMonths: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"] - }, - "pt-BR": { - dateTime: "%A, %e de %B de %Y. %X", - date: "%d/%m/%Y", - time: "%H:%M:%S", - periods: ["AM", "PM"], - days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], - shortDays: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"], - months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], - shortMonths: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"] - } - }; - - function _defineProperty$2(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - - function _toConsumableArray$1(arr) { - return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread$1(); - } - - function _nonIterableSpread$1() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - function _unsupportedIterableToArray$4(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); - } - - function _iterableToArray$1(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); - } - - function _arrayWithoutHoles$1(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray$4(arr); - } - - function _arrayLikeToArray$4(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } - - function _typeof$f(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$f = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$f = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$f(obj); - } - - function _classCallCheck$d(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$d(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$d(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$d(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$d(Constructor, staticProps); - return Constructor; - } - - function _inherits$b(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$b(subClass, superClass); - } - - function _setPrototypeOf$b(o, p) { - _setPrototypeOf$b = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$b(o, p); - } - - function _createSuper$b(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$b(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$b(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$b(this, result); - }; - } - - function _possibleConstructorReturn$b(self, call) { - if (call && (_typeof$f(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$b(self); - } - - function _assertThisInitialized$b(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$b() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$b(o) { - _getPrototypeOf$b = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$b(o); - } - /** - @class Axis - @extends external:BaseClass - @desc Creates an SVG scale based on an array of data. - */ - - var Axis = /*#__PURE__*/function (_BaseClass) { - _inherits$b(Axis, _BaseClass); - - var _super = _createSuper$b(Axis); - /** - @memberof Axis - @desc Invoked when creating a new class instance, and sets any default parameters. - @private - */ - - - function Axis() { - var _this; - - _classCallCheck$d(this, Axis); - - _this = _super.call(this); - _this._align = "middle"; - _this._barConfig = { - "stroke": "#000", - "stroke-width": 1 - }; - _this._domain = [0, 10]; - _this._duration = 600; - _this._gridConfig = { - "stroke": "#ccc", - "stroke-width": 1 - }; - _this._gridLog = false; - _this._height = 400; - _this._labelOffset = true; - - _this.orient("bottom"); - - _this._outerBounds = { - width: 0, - height: 0, - x: 0, - y: 0 - }; - _this._padding = 5; - _this._paddingInner = 0.1; - _this._paddingOuter = 0.1; - _this._rotateLabels = false; - _this._scale = "linear"; - _this._scalePadding = 0.5; - _this._shape = "Line"; - _this._shapeConfig = { - fill: "#000", - height: function height(d) { - return d.tick ? 8 : 0; - }, - label: function label(d) { - return d.text; - }, - labelBounds: function labelBounds(d) { - return d.labelBounds; - }, - labelConfig: { - fontColor: "#000", - fontFamily: new TextBox().fontFamily(), - fontResize: false, - fontSize: constant$1(10), - padding: 0, - textAnchor: function textAnchor() { - var rtl = detectRTL(); - return _this._orient === "left" ? rtl ? "start" : "end" : _this._orient === "right" ? rtl ? "end" : "start" : _this._rotateLabels ? _this._orient === "bottom" ? "end" : "start" : "middle"; - }, - verticalAlign: function verticalAlign() { - return _this._orient === "bottom" ? "top" : _this._orient === "top" ? "bottom" : "middle"; - } - }, - r: function r(d) { - return d.tick ? 4 : 0; - }, - stroke: "#000", - strokeWidth: 1, - width: function width(d) { - return d.tick ? 8 : 0; - } - }; - _this._tickSize = 5; - _this._tickSpecifier = undefined; - _this._tickSuffix = "normal"; - _this._tickUnit = 0; - _this._timeLocale = undefined; - _this._titleClass = new TextBox(); - _this._titleConfig = { - fontSize: 12, - textAnchor: "middle" - }; - _this._width = 400; - return _this; - } - /** - @memberof Axis - @desc Sets positioning for the axis bar. - @param {D3Selection} *bar* - @private - */ - - - _createClass$d(Axis, [{ - key: "_barPosition", - value: function _barPosition(bar) { - var _this$_position = this._position, - height = _this$_position.height, - x = _this$_position.x, - y = _this$_position.y, - opposite = _this$_position.opposite, - domain = this._getDomain(), - offset = this._margin[opposite], - position = ["top", "left"].includes(this._orient) ? this._outerBounds[y] + this._outerBounds[height] - offset : this._outerBounds[y] + offset; - - var x1mod = this._scale === "band" ? this._d3Scale.step() - this._d3Scale.bandwidth() : this._scale === "point" ? this._d3Scale.step() * this._d3Scale.padding() * -1 : 0; - var x2mod = this._scale === "band" ? this._d3Scale.step() : this._scale === "point" ? this._d3Scale.step() * this._d3Scale.padding() * -1 : 0; - bar.call(attrize, this._barConfig).attr("".concat(x, "1"), this._getPosition(domain[0]) - x1mod).attr("".concat(x, "2"), this._getPosition(domain[domain.length - 1]) + x2mod).attr("".concat(y, "1"), position).attr("".concat(y, "2"), position); - } - /** - @memberof Axis - @desc Returns the scale's domain, taking into account negative and positive log scales. - @private - */ - - }, { - key: "_getDomain", - value: function _getDomain() { - var ticks = []; - if (this._d3ScaleNegative) ticks = this._d3ScaleNegative.domain(); - if (this._d3Scale) ticks = ticks.concat(this._d3Scale.domain()); - var domain = ["band", "ordinal", "point"].includes(this._scale) ? ticks : extent(ticks); - return ticks[0] > ticks[1] ? domain.reverse() : domain; - } - /** - @memberof Axis - @desc Returns a value's scale position, taking into account negative and positive log scales. - @param {Number|String} *d* - @private - */ - - }, { - key: "_getPosition", - value: function _getPosition(d) { - return d < 0 && this._d3ScaleNegative ? this._d3ScaleNegative(d) : this._d3Scale(d); - } - /** - @memberof Axis - @desc Returns the scale's range, taking into account negative and positive log scales. - @private - */ - - }, { - key: "_getRange", - value: function _getRange() { - var ticks = []; - if (this._d3ScaleNegative) ticks = this._d3ScaleNegative.range(); - if (this._d3Scale) ticks = ticks.concat(this._d3Scale.range()); - return ticks[0] > ticks[1] ? extent(ticks).reverse() : extent(ticks); - } - /** - @memberof Axis - @desc Returns the scale's ticks, taking into account negative and positive log scales. - @private - */ - - }, { - key: "_getTicks", - value: function _getTicks() { - var tickScale = sqrt$1().domain([10, 400]).range([10, 50]); - var ticks = []; - - if (this._d3ScaleNegative) { - var negativeRange = this._d3ScaleNegative.range(); - - var size = negativeRange[1] - negativeRange[0]; - ticks = this._d3ScaleNegative.ticks(Math.floor(size / tickScale(size))); - } - - if (this._d3Scale) { - var positiveRange = this._d3Scale.range(); - - var _size = positiveRange[1] - positiveRange[0]; - - ticks = ticks.concat(this._d3Scale.ticks(Math.floor(_size / tickScale(_size)))); - } - - return ticks; - } - /** - @memberof Axis - @desc Sets positioning for the grid lines. - @param {D3Selection} *lines* - @private - */ - - }, { - key: "_gridPosition", - value: function _gridPosition(lines) { - var last = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var _this$_position2 = this._position, - height = _this$_position2.height, - x = _this$_position2.x, - y = _this$_position2.y, - opposite = _this$_position2.opposite, - offset = this._margin[opposite], - position = ["top", "left"].includes(this._orient) ? this._outerBounds[y] + this._outerBounds[height] - offset : this._outerBounds[y] + offset, - scale = last ? this._lastScale || this._getPosition.bind(this) : this._getPosition.bind(this), - size = ["top", "left"].includes(this._orient) ? offset : -offset, - xDiff = this._scale === "band" ? this._d3Scale.bandwidth() / 2 : 0, - xPos = function xPos(d) { - return scale(d.id) + xDiff; - }; - - lines.call(attrize, this._gridConfig).attr("".concat(x, "1"), xPos).attr("".concat(x, "2"), xPos).attr("".concat(y, "1"), position).attr("".concat(y, "2"), last ? position : position + size); - } - /** - @memberof Axis - @desc Renders the current Axis to the page. If a *callback* is specified, it will be called once the legend is done drawing. - @param {Function} [*callback* = undefined] - @chainable - */ - - }, { - key: "render", - value: function render(callback) { - var _this2 = this, - _this$_outerBounds; - /** - * Creates an SVG element to contain the axis if none - * has been specified using the "select" method. - */ - - - if (this._select === void 0) { - this.select(_select("body").append("svg").attr("width", "".concat(this._width, "px")).attr("height", "".concat(this._height, "px")).node()); - } - - var timeLocale = this._timeLocale || locale$2[this._locale] || locale$2["en-US"]; - defaultLocale$1(timeLocale).format(); - var formatDay = timeFormat("%a %d"), - formatHour = timeFormat("%I %p"), - formatMillisecond = timeFormat(".%L"), - formatMinute = timeFormat("%I:%M"), - formatMonth = timeFormat("%b"), - formatSecond = timeFormat(":%S"), - formatWeek = timeFormat("%b %d"), - formatYear = timeFormat("%Y"); - /** - * Declares some commonly used variables. - */ - - var _this$_position3 = this._position, - width = _this$_position3.width, - height = _this$_position3.height, - x = _this$_position3.x, - y = _this$_position3.y, - horizontal = _this$_position3.horizontal, - opposite = _this$_position3.opposite, - clipId = "d3plus-Axis-clip-".concat(this._uuid), - flip = ["top", "left"].includes(this._orient), - p = this._padding, - parent = this._select, - rangeOuter = [p, this["_".concat(width)] - p], - t = transition().duration(this._duration); - var tickValue = this._shape === "Circle" ? this._shapeConfig.r : this._shape === "Rect" ? this._shapeConfig[width] : this._shapeConfig.strokeWidth; - var tickGet = typeof tickValue !== "function" ? function () { - return tickValue; - } : tickValue; - /** - * Zeros out the margins for re-calculation. - */ - - var margin = this._margin = { - top: 0, - right: 0, - bottom: 0, - left: 0 - }; - var labels, range$1, ticks; - /** - * Constructs the tick formatter function. - */ - - var tickFormat = this._tickFormat ? this._tickFormat : function (d) { - if (_this2._scale === "time") { - return (second(d) < d ? formatMillisecond : minute(d) < d ? formatSecond : hour(d) < d ? formatMinute : day(d) < d ? formatHour : month(d) < d ? sunday(d) < d ? formatDay : formatWeek : year(d) < d ? formatMonth : formatYear)(d); - } else if (["band", "ordinal", "point"].includes(_this2._scale)) { - return d; - } - - if (isNaN(d)) { - return d; - } else if (_this2._scale === "linear" && _this2._tickSuffix === "smallest") { - var _locale = _typeof$f(_this2._locale) === "object" ? _this2._locale : formatLocale$3[_this2._locale]; - - var separator = _locale.separator, - suffixes = _locale.suffixes; - var suff = d >= 1000 ? suffixes[_this2._tickUnit + 8] : ""; - var tick = d / Math.pow(10, 3 * _this2._tickUnit); - var number = formatAbbreviate(tick, _locale, ",.".concat(tick.toString().length, "r")); - return "".concat(number).concat(separator).concat(suff); - } else { - return formatAbbreviate(d, _this2._locale); - } - }; - /** - * (Re)calculates the internal d3 scale - * @param {} newRange - */ - - function setScale() { - var _this3 = this; - - var newRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._range; - /** - * Calculates the internal "range" array to use, including - * fallbacks if not specified with the "range" method. - */ - - range$1 = newRange ? newRange.slice() : [undefined, undefined]; - var minRange = rangeOuter[0], - maxRange = rangeOuter[1]; - - if (this._range) { - if (this._range[0] !== undefined) minRange = this._range[0]; - if (this._range[this._range.length - 1] !== undefined) maxRange = this._range[this._range.length - 1]; - } - - if (range$1[0] === undefined || range$1[0] < minRange) range$1[0] = minRange; - if (range$1[1] === undefined || range$1[1] > maxRange) range$1[1] = maxRange; - var sizeInner = maxRange - minRange; - - if (this._scale === "ordinal" && this._domain.length > range$1.length) { - if (newRange === this._range) { - var buckets = this._domain.length + 1; - range$1 = range(buckets).map(function (d) { - return range$1[0] + sizeInner * (d / (buckets - 1)); - }).slice(1, buckets); - range$1 = range$1.map(function (d) { - return d - range$1[0] / 2; - }); - } else { - var _buckets = this._domain.length; - var size = range$1[1] - range$1[0]; - range$1 = range(_buckets).map(function (d) { - return range$1[0] + size * (d / (_buckets - 1)); - }); - } - } else if (newRange === this._range) { - var tickScale = sqrt$1().domain([10, 400]).range([10, 50]); - var domain = this._scale === "time" ? this._domain.map(date$2) : this._domain; - var scaleTicks = d3Ticks(domain[0], domain[1], Math.floor(sizeInner / tickScale(sizeInner))); - ticks = (this._ticks ? this._scale === "time" ? this._ticks.map(date$2) : this._ticks : scaleTicks).slice(); - labels = (this._labels ? this._scale === "time" ? this._labels.map(date$2) : this._labels : scaleTicks).slice(); - var _buckets2 = labels.length; - - if (_buckets2) { - var pad = Math.ceil(sizeInner / _buckets2 / 2); - range$1 = [range$1[0] + pad, range$1[1] - pad]; - } - } - /** - * Sets up the initial d3 scale, using this._domain and the - * previously defined range variable. - */ - - - var scale = "scale".concat(this._scale.charAt(0).toUpperCase()).concat(this._scale.slice(1)); - this._d3Scale = scales[scale]().domain(this._scale === "time" ? this._domain.map(date$2) : this._domain).range(range$1); - if (this._d3Scale.padding) this._d3Scale.padding(this._scalePadding); - if (this._d3Scale.paddingInner) this._d3Scale.paddingInner(this._paddingInner); - if (this._d3Scale.paddingOuter) this._d3Scale.paddingOuter(this._paddingOuter); - /** - * Constructs a separate "negative only" scale for logarithmic - * domains, as they cannot pass zero. - */ - - this._d3ScaleNegative = null; - - if (this._scale === "log") { - var _domain = this._d3Scale.domain(); - - if (_domain[0] === 0) { - _domain[0] = Math.abs(_domain[_domain.length - 1]) <= 1 ? 1e-6 : 1; - if (_domain[_domain.length - 1] < 0) _domain[0] *= -1; - } else if (_domain[_domain.length - 1] === 0) { - _domain[_domain.length - 1] = Math.abs(_domain[0]) <= 1 ? 1e-6 : 1; - if (_domain[0] < 0) _domain[_domain.length - 1] *= -1; - } - - var _range = this._d3Scale.range(); - - if (_domain[0] < 0 && _domain[_domain.length - 1] < 0) { - this._d3ScaleNegative = this._d3Scale.copy().domain(_domain).range(_range); - this._d3Scale = null; - } else if (_domain[0] > 0 && _domain[_domain.length - 1] > 0) { - this._d3Scale.domain(_domain).range(_range); - } else { - var percentScale = log().domain([1, _domain[_domain[1] > 0 ? 1 : 0]]).range([0, 1]); - var leftPercentage = percentScale(Math.abs(_domain[_domain[1] < 0 ? 1 : 0])); - var zero = leftPercentage / (leftPercentage + 1) * (_range[1] - _range[0]); - if (_domain[0] > 0) zero = _range[1] - _range[0] - zero; - this._d3ScaleNegative = this._d3Scale.copy(); - (_domain[0] < 0 ? this._d3Scale : this._d3ScaleNegative).domain([Math.sign(_domain[1]), _domain[1]]).range([_range[0] + zero, _range[1]]); - (_domain[0] < 0 ? this._d3ScaleNegative : this._d3Scale).domain([_domain[0], Math.sign(_domain[0])]).range([_range[0], _range[0] + zero]); - } - } - /** - * Determines the of values array to use - * for the "ticks" and the "labels" - */ - - - ticks = (this._ticks ? this._scale === "time" ? this._ticks.map(date$2) : this._ticks : (this._d3Scale ? this._d3Scale.ticks : this._d3ScaleNegative.ticks) ? this._getTicks() : this._domain).slice(); - labels = (this._labels ? this._scale === "time" ? this._labels.map(date$2) : this._labels : (this._d3Scale ? this._d3Scale.ticks : this._d3ScaleNegative.ticks) ? this._getTicks() : ticks).slice(); - - if (this._scale === "log") { - var tens = labels.filter(function (t) { - return Math.abs(t).toString().charAt(0) === "1" && (_this3._d3Scale ? t !== -1 : t !== 1); - }); - - if (tens.length > 2) { - labels = tens; - ticks = tens; - } else if (labels.length >= 10) { - labels = labels.filter(function (t) { - return t % 5 === 0 || tickFormat(t).substr(-1) === "1"; - }); - } - } - - if (this._scale === "time") { - ticks = ticks.map(Number); - labels = labels.map(Number); - } - - ticks = ticks.sort(function (a, b) { - return _this3._getPosition(a) - _this3._getPosition(b); - }); - labels = labels.sort(function (a, b) { - return _this3._getPosition(a) - _this3._getPosition(b); - }); - /** - * Get the smallest suffix. - */ - - if (this._scale === "linear" && this._tickSuffix === "smallest") { - var suffixes = labels.filter(function (d) { - return d >= 1000; - }); - - if (suffixes.length > 0) { - var _min = Math.min.apply(Math, _toConsumableArray$1(suffixes)); - - var i = 1; - - while (i && i < 7) { - var n = Math.pow(10, 3 * i); - - if (_min / n >= 1) { - this._tickUnit = i; - i += 1; - } else { - break; - } - } - } - } - /** - * Removes ticks when they overlap other ticks. - */ - - - var pixels = []; - this._availableTicks = ticks; - ticks.forEach(function (d, i) { - var s = tickGet({ - id: d, - tick: true - }, i); - if (_this3._shape === "Circle") s *= 2; - - var t = _this3._getPosition(d); - - if (!pixels.length || Math.abs(closest(t, pixels) - t) > s * 2) pixels.push(t);else pixels.push(false); - }); - ticks = ticks.filter(function (d, i) { - return pixels[i] !== false; - }); - this._visibleTicks = ticks; - } - - setScale.bind(this)(); - /** - * Calculates the space available for a given label. - * @param {Object} datum - */ - - function calculateSpace(datum) { - var diff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - var i = datum.i, - position = datum.position; - - if (this._scale === "band") { - return this._d3Scale.bandwidth(); - } else { - var prevPosition = i - diff < 0 ? textData.length === 1 || !this._range ? rangeOuter[0] : (position - textData[i + diff].position) / 2 - position : position - (position - textData[i - diff].position) / 2; - var prevSpace = Math.abs(position - prevPosition); - var nextPosition = i + diff > textData.length - 1 ? textData.length === 1 || !this._range ? rangeOuter[1] : (position - textData[i - diff].position) / 2 - position : position - (position - textData[i + diff].position) / 2; - var nextSpace = Math.abs(position - nextPosition); - return min([prevSpace, nextSpace]) * 2; - } - } - /** - * Pre-calculates the size of the title, if defined, in order - * to adjust the internal margins. - */ - - - if (this._title) { - var _this$_titleConfig = this._titleConfig, - fontFamily = _this$_titleConfig.fontFamily, - fontSize = _this$_titleConfig.fontSize, - lineHeight = _this$_titleConfig.lineHeight; - var titleWrap = textWrap().fontFamily(typeof fontFamily === "function" ? fontFamily() : fontFamily).fontSize(typeof fontSize === "function" ? fontSize() : fontSize).lineHeight(typeof lineHeight === "function" ? lineHeight() : lineHeight).width(range$1[range$1.length - 1] - range$1[0] - p * 2).height(this["_".concat(height)] - this._tickSize - p * 2); - var lines = titleWrap(this._title).lines.length; - margin[this._orient] = lines * titleWrap.lineHeight() + p; - } - - var hBuff = this._shape === "Circle" ? typeof this._shapeConfig.r === "function" ? this._shapeConfig.r({ - tick: true - }) : this._shapeConfig.r : this._shape === "Rect" ? typeof this._shapeConfig[height] === "function" ? this._shapeConfig[height]({ - tick: true - }) : this._shapeConfig[height] : this._tickSize, - wBuff = tickGet({ - tick: true - }); - if (typeof hBuff === "function") hBuff = max(ticks.map(hBuff)); - if (this._shape === "Rect") hBuff /= 2; - if (typeof wBuff === "function") wBuff = max(ticks.map(wBuff)); - if (this._shape !== "Circle") wBuff /= 2; - /** - * Calculates the space each label would take up, given - * the provided this._space size. - */ - - var textData = labels.map(function (d, i) { - var fF = _this2._shapeConfig.labelConfig.fontFamily(d, i), - fS = _this2._shapeConfig.labelConfig.fontSize(d, i), - position = _this2._getPosition(d); - - var lineHeight = _this2._shapeConfig.lineHeight ? _this2._shapeConfig.lineHeight(d, i) : fS * 1.4; - return { - d: d, - i: i, - fF: fF, - fS: fS, - lineHeight: lineHeight, - position: position - }; - }); - /** - * Calculates the text wrapping and size of a given textData object. - * @param {Object} datum - */ - - function calculateLabelSize(datum) { - var d = datum.d, - i = datum.i, - fF = datum.fF, - fS = datum.fS, - rotate = datum.rotate, - space = datum.space; - var h = rotate ? "width" : "height", - w = rotate ? "height" : "width"; - var wSize = min([this._maxSize, this._width]); - var hSize = min([this._maxSize, this._height]); - var wrap = textWrap().fontFamily(fF).fontSize(fS).lineHeight(this._shapeConfig.lineHeight ? this._shapeConfig.lineHeight(d, i) : undefined)[w](horizontal ? space : wSize - hBuff - p - this._margin.left - this._margin.right)[h](horizontal ? hSize - hBuff - p - this._margin.top - this._margin.bottom : space); - var res = wrap(tickFormat(d)); - res.lines = res.lines.filter(function (d) { - return d !== ""; - }); - res.width = res.lines.length ? Math.ceil(max(res.widths)) + fS / 4 : 0; - if (res.width % 2) res.width++; - res.height = res.lines.length ? Math.ceil(res.lines.length * wrap.lineHeight()) + fS / 4 : 0; - if (res.height % 2) res.height++; - return res; - } - - textData = textData.map(function (datum) { - datum.rotate = _this2._labelRotation; - datum.space = calculateSpace.bind(_this2)(datum); - var res = calculateLabelSize.bind(_this2)(datum); - return Object.assign(res, datum); - }); - this._rotateLabels = horizontal && this._labelRotation === undefined ? textData.some(function (d) { - return d.truncated; - }) : this._labelRotation; - - if (this._rotateLabels) { - textData = textData.map(function (datum) { - datum.rotate = true; - var res = calculateLabelSize.bind(_this2)(datum); - return Object.assign(datum, res); - }); - } - /** - * "spillover" will contain the pixel spillover of the first and last label, - * and then adjust the scale range accordingly. - */ - - - var spillover = [0, 0]; - - for (var index = 0; index < 2; index++) { - var datum = textData[index ? textData.length - 1 : 0]; - if (!datum) break; - var _height = datum.height, - position = datum.position, - rotate = datum.rotate, - _width = datum.width; - var compPosition = index ? rangeOuter[1] : rangeOuter[0]; - var halfSpace = (rotate || !horizontal ? _height : _width) / 2; - var spill = index ? position + halfSpace - compPosition : position - halfSpace - compPosition; - spillover[index] = spill; - } - - var first = range$1[0]; - var last = range$1[range$1.length - 1]; - var newRange = [first - spillover[0], last - spillover[1]]; - - if (this._range) { - if (this._range[0] !== undefined) newRange[0] = this._range[0]; - if (this._range[this._range.length - 1] !== undefined) newRange[1] = this._range[this._range.length - 1]; - } - - if (newRange[0] !== first || newRange[1] !== last) { - setScale.bind(this)(newRange); - textData = labels.map(function (d, i) { - var fF = _this2._shapeConfig.labelConfig.fontFamily(d, i), - fS = _this2._shapeConfig.labelConfig.fontSize(d, i), - position = _this2._getPosition(d); - - var lineHeight = _this2._shapeConfig.lineHeight ? _this2._shapeConfig.lineHeight(d, i) : fS * 1.4; - return { - d: d, - i: i, - fF: fF, - fS: fS, - lineHeight: lineHeight, - position: position - }; - }); - textData = textData.map(function (datum) { - datum.rotate = _this2._rotateLabels; - datum.space = calculateSpace.bind(_this2)(datum); - var res = calculateLabelSize.bind(_this2)(datum); - return Object.assign(res, datum); - }); - } - - var labelHeight = max(textData, function (t) { - return t.height; - }) || 0; - this._rotateLabels = horizontal && this._labelRotation === undefined ? textData.some(function (datum) { - var i = datum.i, - height = datum.height, - position = datum.position, - truncated = datum.truncated; - var prev = textData[i - 1]; - return truncated || i && prev.position + prev.height / 2 > position - height / 2; - }) : this._labelRotation; - - if (this._rotateLabels) { - var offset = 0; - textData = textData.map(function (datum) { - datum.space = calculateSpace.bind(_this2)(datum, 2); - var res = calculateLabelSize.bind(_this2)(datum); - datum = Object.assign(datum, res); - var prev = textData[datum.i - 1]; - - if (!prev) { - offset = 1; - } else if (prev.position + prev.height / 2 > datum.position) { - if (offset) { - datum.offset = prev.width; - offset = 0; - } else offset = 1; - } - - return datum; - }); - } - - var globalOffset = this._labelOffset ? max(textData, function (d) { - return d.offset || 0; - }) : 0; - textData.forEach(function (datum) { - return datum.offset = datum.offset ? globalOffset : 0; - }); - var tBuff = this._shape === "Line" ? 0 : hBuff; - var bounds = this._outerBounds = (_this$_outerBounds = {}, _defineProperty$2(_this$_outerBounds, height, (max(textData, function (t) { - return Math.ceil(t[t.rotate || !horizontal ? "width" : "height"] + t.offset); - }) || 0) + (textData.length ? p : 0)), _defineProperty$2(_this$_outerBounds, width, rangeOuter[rangeOuter.length - 1] - rangeOuter[0]), _defineProperty$2(_this$_outerBounds, x, rangeOuter[0]), _this$_outerBounds); - bounds[height] = max([this._minSize, bounds[height]]); - margin[this._orient] += hBuff; - margin[opposite] = this._gridSize !== undefined ? max([this._gridSize, tBuff]) : this["_".concat(height)] - margin[this._orient] - bounds[height] - p; - bounds[height] += margin[opposite] + margin[this._orient]; - bounds[y] = this._align === "start" ? this._padding : this._align === "end" ? this["_".concat(height)] - bounds[height] - this._padding : this["_".concat(height)] / 2 - bounds[height] / 2; - var group = elem("g#d3plus-Axis-".concat(this._uuid), { - parent: parent - }); - this._group = group; - var grid = elem("g.grid", { - parent: group - }).selectAll("line").data((this._gridSize !== 0 ? this._grid || this._scale === "log" && !this._gridLog ? labels : ticks : []).map(function (d) { - return { - id: d - }; - }), function (d) { - return d.id; - }); - grid.exit().transition(t).attr("opacity", 0).call(this._gridPosition.bind(this)).remove(); - grid.enter().append("line").attr("opacity", 0).attr("clip-path", "url(#".concat(clipId, ")")).call(this._gridPosition.bind(this), true).merge(grid).transition(t).attr("opacity", 1).call(this._gridPosition.bind(this)); - var labelOnly = labels.filter(function (d, i) { - return textData[i].lines.length && !ticks.includes(d); - }); - var rotated = textData.some(function (d) { - return d.rotate; - }); - var tickData = ticks.concat(labelOnly).map(function (d) { - var _tickConfig; - - var data = textData.find(function (td) { - return td.d === d; - }); - - var xPos = _this2._getPosition(d); - - var space = data ? data.space : 0; - var lines = data ? data.lines.length : 1; - var lineHeight = data ? data.lineHeight : 1; - var labelOffset = data && _this2._labelOffset ? data.offset : 0; - var labelWidth = horizontal ? space : bounds.width - margin[_this2._position.opposite] - hBuff - margin[_this2._orient] + p; - var offset = margin[opposite], - size = (hBuff + labelOffset) * (flip ? -1 : 1), - yPos = flip ? bounds[y] + bounds[height] - offset : bounds[y] + offset; - var tickConfig = (_tickConfig = { - id: d, - labelBounds: rotated && data ? { - x: -data.width / 2 + data.fS / 4, - y: _this2._orient === "bottom" ? size + p + (data.width - lineHeight * lines) / 2 : size - p * 2 - (data.width + lineHeight * lines) / 2, - width: data.width, - height: data.height - } : { - x: horizontal ? -space / 2 : _this2._orient === "left" ? -labelWidth - p + size : size + p, - y: horizontal ? _this2._orient === "bottom" ? size + p : size - p - labelHeight : -space / 2, - width: horizontal ? space : labelWidth, - height: horizontal ? labelHeight : space - }, - rotate: data ? data.rotate : false, - size: labels.includes(d) ? size : 0, - text: labels.includes(d) ? tickFormat(d) : false, - tick: ticks.includes(d) - }, _defineProperty$2(_tickConfig, x, xPos + (_this2._scale === "band" ? _this2._d3Scale.bandwidth() / 2 : 0)), _defineProperty$2(_tickConfig, y, yPos), _tickConfig); - return tickConfig; - }); - - if (this._shape === "Line") { - tickData = tickData.concat(tickData.map(function (d) { - var dupe = Object.assign({}, d); - dupe[y] += d.size; - return dupe; - })); - } - - new shapes$2[this._shape]().data(tickData).duration(this._duration).labelConfig({ - ellipsis: function ellipsis(d) { - return d && d.length ? "".concat(d, "...") : ""; - }, - rotate: function rotate(d) { - return d.rotate ? -90 : 0; - } - }).select(elem("g.ticks", { - parent: group - }).node()).config(this._shapeConfig).render(); - var bar = group.selectAll("line.bar").data([null]); - bar.enter().append("line").attr("class", "bar").attr("opacity", 0).call(this._barPosition.bind(this)).merge(bar).transition(t).attr("opacity", 1).call(this._barPosition.bind(this)); - - this._titleClass.data(this._title ? [{ - text: this._title - }] : []).duration(this._duration).height(margin[this._orient]).rotate(this._orient === "left" ? -90 : this._orient === "right" ? 90 : 0).select(elem("g.d3plus-Axis-title", { - parent: group - }).node()).text(function (d) { - return d.text; - }).verticalAlign("middle").width(range$1[range$1.length - 1] - range$1[0]).x(horizontal ? range$1[0] : this._orient === "left" ? bounds.x + margin.left / 2 - (range$1[range$1.length - 1] - range$1[0]) / 2 : bounds.x + bounds.width - margin.right / 2 - (range$1[range$1.length - 1] - range$1[0]) / 2).y(horizontal ? this._orient === "bottom" ? bounds.y + bounds.height - margin.bottom : bounds.y : range$1[0] + (range$1[range$1.length - 1] - range$1[0]) / 2 - margin[this._orient] / 2).config(this._titleConfig).render(); - - this._lastScale = this._getPosition.bind(this); - if (callback) setTimeout(callback, this._duration + 100); - return this; - } - /** - @memberof Axis - @desc If *value* is specified, sets the horizontal alignment to the specified value and returns the current class instance. - @param {String} [*value* = "center"] Supports `"left"` and `"center"` and `"right"`. - @chainable - */ - - }, { - key: "align", - value: function align(_) { - return arguments.length ? (this._align = _, this) : this._align; - } - /** - @memberof Axis - @desc If *value* is specified, sets the axis line style and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "barConfig", - value: function barConfig(_) { - return arguments.length ? (this._barConfig = Object.assign(this._barConfig, _), this) : this._barConfig; - } - /** - @memberof Axis - @desc If *value* is specified, sets the scale domain of the axis and returns the current class instance. - @param {Array} [*value* = [0, 10]] - @chainable - */ - - }, { - key: "domain", - value: function domain(_) { - return arguments.length ? (this._domain = _, this) : this._domain; - } - /** - @memberof Axis - @desc If *value* is specified, sets the transition duration of the axis and returns the current class instance. - @param {Number} [*value* = 600] - @chainable - */ - - }, { - key: "duration", - value: function duration(_) { - return arguments.length ? (this._duration = _, this) : this._duration; - } - /** - @memberof Axis - @desc If *value* is specified, sets the grid values of the axis and returns the current class instance. - @param {Array} [*value*] - @chainable - */ - - }, { - key: "grid", - value: function grid(_) { - return arguments.length ? (this._grid = _, this) : this._grid; - } - /** - @memberof Axis - @desc If *value* is specified, sets the grid config of the axis and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "gridConfig", - value: function gridConfig(_) { - return arguments.length ? (this._gridConfig = Object.assign(this._gridConfig, _), this) : this._gridConfig; - } - /** - @memberof Axis - @desc If *value* is specified, sets the grid behavior of the axis when scale is logarithmic and returns the current class instance. - @param {Boolean} [*value* = false] - @chainable - */ - - }, { - key: "gridLog", - value: function gridLog(_) { - return arguments.length ? (this._gridLog = _, this) : this._gridLog; - } - /** - @memberof Axis - @desc If *value* is specified, sets the grid size of the axis and returns the current class instance. - @param {Number} [*value* = undefined] - @chainable - */ - - }, { - key: "gridSize", - value: function gridSize(_) { - return arguments.length ? (this._gridSize = _, this) : this._gridSize; - } - /** - @memberof Axis - @desc If *value* is specified, sets the overall height of the axis and returns the current class instance. - @param {Number} [*value* = 100] - @chainable - */ - - }, { - key: "height", - value: function height(_) { - return arguments.length ? (this._height = _, this) : this._height; - } - /** - @memberof Axis - @desc If *value* is specified, sets the visible tick labels of the axis and returns the current class instance. - @param {Array} [*value*] - @chainable - */ - - }, { - key: "labels", - value: function labels(_) { - return arguments.length ? (this._labels = _, this) : this._labels; - } - /** - @memberof Axis - @desc If *value* is specified, sets whether offsets will be used to position some labels further away from the axis in order to allow space for the text. - @param {Boolean} [*value* = true] - @chainable - */ - - }, { - key: "labelOffset", - value: function labelOffset(_) { - return arguments.length ? (this._labelOffset = _, this) : this._labelOffset; - } - /** - @memberof Axis - @desc If *value* is specified, sets whether whether horizontal axis labels are rotated -90 degrees. - @param {Boolean} - @chainable - */ - - }, { - key: "labelRotation", - value: function labelRotation(_) { - return arguments.length ? (this._labelRotation = _, this) : this._labelRotation; - } - /** - @memberof Axis - @desc If *value* is specified, sets the maximum size allowed for the space that contains the axis tick labels and title. - @param {Number} - @chainable - */ - - }, { - key: "maxSize", - value: function maxSize(_) { - return arguments.length ? (this._maxSize = _, this) : this._maxSize; - } - /** - @memberof Axis - @desc If *value* is specified, sets the minimum size alloted for the space that contains the axis tick labels and title. - @param {Number} - @chainable - */ - - }, { - key: "minSize", - value: function minSize(_) { - return arguments.length ? (this._minSize = _, this) : this._minSize; - } - /** - @memberof Axis - @desc If *orient* is specified, sets the orientation of the shape and returns the current class instance. If *orient* is not specified, returns the current orientation. - @param {String} [*orient* = "bottom"] Supports `"top"`, `"right"`, `"bottom"`, and `"left"` orientations. - @chainable - */ - - }, { - key: "orient", - value: function orient(_) { - if (arguments.length) { - var horizontal = ["top", "bottom"].includes(_), - opps = { - top: "bottom", - right: "left", - bottom: "top", - left: "right" - }; - this._position = { - horizontal: horizontal, - width: horizontal ? "width" : "height", - height: horizontal ? "height" : "width", - x: horizontal ? "x" : "y", - y: horizontal ? "y" : "x", - opposite: opps[_] - }; - return this._orient = _, this; - } - - return this._orient; - } - /** - @memberof Axis - @desc If called after the elements have been drawn to DOM, will returns the outer bounds of the axis content. - @example - {"width": 180, "height": 24, "x": 10, "y": 20} - */ - - }, { - key: "outerBounds", - value: function outerBounds() { - return this._outerBounds; - } - /** - @memberof Axis - @desc If *value* is specified, sets the padding between each tick label to the specified number and returns the current class instance. - @param {Number} [*value* = 10] - @chainable - */ - - }, { - key: "padding", - value: function padding(_) { - return arguments.length ? (this._padding = _, this) : this._padding; - } - /** - @memberof Axis - @desc If *value* is specified, sets the inner padding of band scale to the specified number and returns the current class instance. - @param {Number} [*value* = 0.1] - @chainable - */ - - }, { - key: "paddingInner", - value: function paddingInner(_) { - return arguments.length ? (this._paddingInner = _, this) : this._paddingInner; - } - /** - @memberof Axis - @desc If *value* is specified, sets the outer padding of band scales to the specified number and returns the current class instance. - @param {Number} [*value* = 0.1] - @chainable - */ - - }, { - key: "paddingOuter", - value: function paddingOuter(_) { - return arguments.length ? (this._paddingOuter = _, this) : this._paddingOuter; - } - /** - @memberof Axis - @desc If *value* is specified, sets the scale range (in pixels) of the axis and returns the current class instance. The given array must have 2 values, but one may be `undefined` to allow the default behavior for that value. - @param {Array} [*value*] - @chainable - */ - - }, { - key: "range", - value: function range(_) { - return arguments.length ? (this._range = _, this) : this._range; - } - /** - @memberof Axis - @desc If *value* is specified, sets the scale of the axis and returns the current class instance. - @param {String} [*value* = "linear"] - @chainable - */ - - }, { - key: "scale", - value: function scale(_) { - return arguments.length ? (this._scale = _, this) : this._scale; - } - /** - @memberof Axis - @desc Sets the "padding" property of the scale, often used in point scales. - @param {Number} [*value* = 0.5] - @chainable - */ - - }, { - key: "scalePadding", - value: function scalePadding(_) { - return arguments.length ? (this._scalePadding = _, this) : this._scalePadding; - } - /** - @memberof Axis - @desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element. - @param {String|HTMLElement} [*selector* = d3.select("body").append("svg")] - @chainable - */ - - }, { - key: "select", - value: function select(_) { - return arguments.length ? (this._select = _select(_), this) : this._select; - } - /** - @memberof Axis - @desc If *value* is specified, sets the tick shape constructor and returns the current class instance. - @param {String} [*value* = "Line"] - @chainable - */ - - }, { - key: "shape", - value: function shape(_) { - return arguments.length ? (this._shape = _, this) : this._shape; - } - /** - @memberof Axis - @desc If *value* is specified, sets the tick style of the axis and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "shapeConfig", - value: function shapeConfig(_) { - return arguments.length ? (this._shapeConfig = assign(this._shapeConfig, _), this) : this._shapeConfig; - } - /** - @memberof Axis - @desc If *value* is specified, sets the tick formatter and returns the current class instance. - @param {Function} [*value*] - @chainable - */ - - }, { - key: "tickFormat", - value: function tickFormat(_) { - return arguments.length ? (this._tickFormat = _, this) : this._tickFormat; - } - /** - @memberof Axis - @desc If *value* is specified, sets the tick values of the axis and returns the current class instance. - @param {Array} [*value*] - @chainable - */ - - }, { - key: "ticks", - value: function ticks(_) { - return arguments.length ? (this._ticks = _, this) : this._ticks; - } - /** - @memberof Axis - @desc If *value* is specified, sets the tick size of the axis and returns the current class instance. - @param {Number} [*value* = 5] - @chainable - */ - - }, { - key: "tickSize", - value: function tickSize(_) { - return arguments.length ? (this._tickSize = _, this) : this._tickSize; - } - /** - @memberof Axis - @desc Sets the tick specifier for the [tickFormat](https://github.com/d3/d3-scale#continuous_tickFormat) function. If this method is called without any arguments, the default tick specifier is returned. - @param {String} [*value* = undefined] - @chainable - */ - - }, { - key: "tickSpecifier", - value: function tickSpecifier(_) { - return arguments.length ? (this._tickSpecifier = _, this) : this._tickSpecifier; - } - /** - @memberof Axis - @desc Sets the behavior of the abbreviations when you are using linear scale. This method accepts two options: "normal" (uses formatAbbreviate to determinate the abbreviation) and "smallest" (uses suffix from the smallest tick as reference in every tick). - @param {String} [*value* = "normal"] - @chainable - */ - - }, { - key: "tickSuffix", - value: function tickSuffix(_) { - return arguments.length ? (this._tickSuffix = _, this) : this._tickSuffix; - } - /** - @memberof Axis - @desc Defines a custom locale object to be used in time scale. This object must include the following properties: dateTime, date, time, periods, days, shortDays, months, shortMonths. For more information, you can revise [d3p.d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale). - @param {Object} [*value* = undefined] - @chainable - */ - - }, { - key: "timeLocale", - value: function timeLocale(_) { - return arguments.length ? (this._timeLocale = _, this) : this._timeLocale; - } - /** - @memberof Axis - @desc If *value* is specified, sets the title of the axis and returns the current class instance. - @param {String} [*value*] - @chainable - */ - - }, { - key: "title", - value: function title(_) { - return arguments.length ? (this._title = _, this) : this._title; - } - /** - @memberof Axis - @desc If *value* is specified, sets the title configuration of the axis and returns the current class instance. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "titleConfig", - value: function titleConfig(_) { - return arguments.length ? (this._titleConfig = Object.assign(this._titleConfig, _), this) : this._titleConfig; - } - /** - @memberof Axis - @desc If *value* is specified, sets the overall width of the axis and returns the current class instance. - @param {Number} [*value* = 400] - @chainable - */ - - }, { - key: "width", - value: function width(_) { - return arguments.length ? (this._width = _, this) : this._width; - } - }]); - - return Axis; - }(BaseClass); - - function _typeof$g(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof$g = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof$g = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof$g(obj); - } - - function _classCallCheck$e(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _defineProperties$e(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass$e(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties$e(Constructor.prototype, protoProps); - if (staticProps) _defineProperties$e(Constructor, staticProps); - return Constructor; - } - - function _inherits$c(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf$c(subClass, superClass); - } - - function _setPrototypeOf$c(o, p) { - _setPrototypeOf$c = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf$c(o, p); - } - - function _createSuper$c(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); - - return function _createSuperInternal() { - var Super = _getPrototypeOf$c(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf$c(this).constructor; - - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return _possibleConstructorReturn$c(this, result); - }; - } - - function _possibleConstructorReturn$c(self, call) { - if (call && (_typeof$g(call) === "object" || typeof call === "function")) { - return call; - } - - return _assertThisInitialized$c(self); - } - - function _assertThisInitialized$c(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; - } - - function _isNativeReflectConstruct$c() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } - } - - function _getPrototypeOf$c(o) { - _getPrototypeOf$c = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf$c(o); - } - /** - @class Button - @extends external:BaseClass - @desc Creates a set of HTML radio input elements. - */ - - var Button = /*#__PURE__*/function (_BaseClass) { - _inherits$c(Button, _BaseClass); - - var _super = _createSuper$c(Button); - /** - @memberof Button - @desc Invoked when creating a new class instance, and sets any default parameters. - @private - */ - - - function Button() { - var _this; - - _classCallCheck$e(this, Button); - - _this = _super.call(this); - _this._buttonStyle = { - "font-family": "'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif", - "font-size": "14px", - "margin": "0 5px" - }; - _this._data = []; - _this._text = accessor("text"); - _this._value = accessor("value"); - return _this; - } - /** - @memberof Button - @desc Renders the element to the page. - @chainable - */ - - - _createClass$e(Button, [{ - key: "render", - value: function render() { - var _this2 = this; - - if (this._container === void 0) this.container(_select("body").append("div").node()); - - var container = this._container.selectAll("div#d3plus-Form-".concat(this._uuid)).data([0]); - - var svg = this._container.node().tagName.toLowerCase() === "foreignobject"; - container = container.enter().append(svg ? "xhtml:div" : "div").attr("id", "d3plus-Form-".concat(this._uuid)).attr("class", "d3plus-Form d3plus-Form-Button").merge(container); - var button = container.selectAll("button").data(this._data, function (d, i) { - return _this2._value(d, i); - }); - button.exit().remove(); - button = button.enter().append("button").attr("class", "d3plus-Button").attr("type", "button").merge(button).call(stylize, this._buttonStyle).html(function (d, i) { - return _this2._text(d, i); - }); - - for (var event in this._on) { - if ({}.hasOwnProperty.call(this._on, event)) button.on(event, this._on[event]); - } - - return this; - } - /** - @memberof Button - @desc Sets the css styles for the elements. - @param {Object} [*value*] - @chainable - */ - - }, { - key: "buttonStyle", - value: function buttonStyle(_) { - return arguments.length ? (this._buttonStyle = _, this) : this._buttonStyle; - } - /** - @memberof Button - @desc If *selector* is specified, sets the SVG container element to the specified d3 selector or DOM element and returns the current class instance. If *selector* is not specified, returns the current SVG container element, which is `undefined` by default. - @param {String|HTMLElement} [*selector*] - @chainable - */ - - }, { - key: "container", - value: function container(_) { - return arguments.length ? (this._container = _select(_), this) : this._container; - } - /** - @memberof Radio - @desc Defines the array of values to be created as