diff --git a/Gemfile b/Gemfile index 18744bb..7d426f0 100644 --- a/Gemfile +++ b/Gemfile @@ -64,3 +64,7 @@ end gem "tailwindcss-rails", "~> 3.0" gem "rbui", github: "rbui-labs/rbui", branch: "main" + +gem "phlex-rails", "~> 1.1" + +gem "tailwind_merge", "~> 0.13.1" diff --git a/Gemfile.lock b/Gemfile.lock index 20c0601..69ef702 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -226,6 +226,10 @@ GEM ast (~> 2.4.1) racc phlex (1.11.0) + phlex-rails (1.1.1) + phlex (~> 1.9) + railties (>= 6.1, < 8) + zeitwerk (~> 2.6) propshaft (1.1.0) actionpack (>= 7.0.0) activesupport (>= 7.0.0) @@ -398,6 +402,7 @@ DEPENDENCIES importmap-rails jbuilder kamal + phlex-rails (~> 1.1) propshaft puma (>= 5.0) rails! @@ -409,6 +414,7 @@ DEPENDENCIES solid_queue sqlite3 (>= 2.1) stimulus-rails + tailwind_merge (~> 0.13.1) tailwindcss-rails (~> 3.0) thruster turbo-rails diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 8666d2f..26fa13a 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -2,12 +2,75 @@ @tailwind components; @tailwind utilities; -/* +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 240 10% 3.9%; + --card: 0 0% 100%; + --card-foreground: 240 10% 3.9%; + --popover: 0 0% 100%; + --popover-foreground: 240 10% 3.9%; + --primary: 240 5.9% 10%; + --primary-foreground: 0 0% 98%; + --secondary: 240 4.8% 95.9%; + --secondary-foreground: 240 5.9% 10%; + --muted: 240 4.8% 95.9%; + --muted-foreground: 240 3.8% 46.1%; + --accent: 240 4.8% 95.9%; + --accent-foreground: 240 5.9% 10%; + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 0 0% 98%; + --border: 240 5.9% 90%; + --input: 240 5.9% 90%; + --ring: 240 5.9% 10%; + --radius: 0.5rem; + + /* rbui especific */ + --warning: 38 92% 50%; + --warning-foreground: 0 0% 100%; + --success: 87 100% 37%; + --success-foreground: 0 0% 100%; + } + + .dark { + --background: 240 10% 3.9%; + --foreground: 0 0% 98%; + --card: 240 10% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 240 10% 3.9%; + --popover-foreground: 0 0% 98%; + --primary: 0 0% 98%; + --primary-foreground: 240 5.9% 10%; + --secondary: 240 3.7% 15.9%; + --secondary-foreground: 0 0% 98%; + --muted: 240 3.7% 15.9%; + --muted-foreground: 240 5% 64.9%; + --accent: 240 3.7% 15.9%; + --accent-foreground: 0 0% 98%; + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + --border: 240 3.7% 15.9%; + --input: 240 3.7% 15.9%; + --ring: 240 4.9% 83.9%; -@layer components { - .btn-primary { - @apply py-2 px-4 bg-blue-200; + /* rbui especific */ + --warning: 38 92% 50%; + --warning-foreground: 0 0% 100%; + --success: 84 81% 44%; + --success-foreground: 0 0% 100%; } } -*/ +@layer base { + * { + @apply border-border; + } + body { + @apply bg-background text-foreground; + font-feature-settings: "rlig" 1, "calt" 1; + + /* docs specific */ + /* https://css-tricks.com/snippets/css/system-font-stack/ */ + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + } +} diff --git a/app/components/rbui/index.js b/app/components/rbui/index.js new file mode 100644 index 0000000..b8a95fe --- /dev/null +++ b/app/components/rbui/index.js @@ -0,0 +1,10 @@ +import { application } from "controllers/application"; + +// Import all controller files +// import ComboboxController from "./combobox/combobox_controller"; + +// Register all controllers +// application.register("rbui--combobox", ComboboxController); + +import RBUI from "rbui-js"; +RBUI.initialize(application); diff --git a/app/javascript/application.js b/app/javascript/application.js index 0d7b494..777afb0 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,3 +1,5 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" + +import "rbui"; diff --git a/app/views/application_view.rb b/app/views/application_view.rb new file mode 100644 index 0000000..2fda4d3 --- /dev/null +++ b/app/views/application_view.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class ApplicationView < ApplicationComponent + include RBUI + # The ApplicationView is an abstract class for all your views. + + # By default, it inherits from `ApplicationComponent`, but you + # can change that to `Phlex::HTML` if you want to keep views and + # components independent. +end diff --git a/app/views/components/application_component.rb b/app/views/components/application_component.rb new file mode 100644 index 0000000..c07d0d8 --- /dev/null +++ b/app/views/components/application_component.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class ApplicationComponent < Phlex::HTML + include Phlex::Rails::Helpers::Routes + + if Rails.env.development? + def before_template + comment { "Before #{self.class.name}" } + super + end + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6525458..88828bb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -29,3 +29,6 @@ + \ No newline at end of file diff --git a/app/views/layouts/application_layout.rb b/app/views/layouts/application_layout.rb new file mode 100644 index 0000000..7d055c1 --- /dev/null +++ b/app/views/layouts/application_layout.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class ApplicationLayout < ApplicationView + include Phlex::Rails::Layout + + def template(&block) + doctype + + html do + head do + title { "You're awesome" } + meta name: "viewport", content: "width=device-width,initial-scale=1" + csp_meta_tag + csrf_meta_tags + stylesheet_link_tag "application", data_turbo_track: "reload" + javascript_importmap_tags + end + + body do + main(&block) + end + end + end +end diff --git a/config/application.rb b/config/application.rb index 5a15c0e..ee0071e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -8,6 +8,9 @@ module DemoImportmaps class Application < Rails::Application + config.autoload_paths << "#{root}/app/views" + config.autoload_paths << "#{root}/app/views/layouts" + config.autoload_paths << "#{root}/app/views/components" # Initialize configuration defaults for originally generated Rails version. config.load_defaults 8.0 diff --git a/config/importmap.rb b/config/importmap.rb index 909dfc5..e082876 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -2,6 +2,40 @@ pin "application" pin "@hotwired/turbo-rails", to: "turbo.min.js" -pin "@hotwired/stimulus", to: "stimulus.min.js" +pin "@hotwired/stimulus", to: "@hotwired--stimulus.js" # @3.2.2 pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" pin_all_from "app/javascript/controllers", under: "controllers" +pin "tailwindcss/plugin", to: "tailwindcss--plugin.js" # @3.4.13 +pin "tailwindcss-animate", to: "tailwindcss-animate.js", preload: true +pin_all_from "app/components/rbui", under: "rbui" +pin "rbui-js" # @1.0.0 +pin "@babel/runtime/helpers/esm/assertThisInitialized", to: "@babel--runtime--helpers--esm--assertThisInitialized.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/classCallCheck", to: "@babel--runtime--helpers--esm--classCallCheck.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/createClass", to: "@babel--runtime--helpers--esm--createClass.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/createForOfIteratorHelper", to: "@babel--runtime--helpers--esm--createForOfIteratorHelper.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/createSuper", to: "@babel--runtime--helpers--esm--createSuper.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/defineProperty", to: "@babel--runtime--helpers--esm--defineProperty.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/inherits", to: "@babel--runtime--helpers--esm--inherits.js" # @7.25.6 +pin "@babel/runtime/helpers/esm/typeof", to: "@babel--runtime--helpers--esm--typeof.js" # @7.25.6 +pin "@floating-ui/core", to: "@floating-ui--core.js" # @1.6.8 +pin "@floating-ui/dom", to: "@floating-ui--dom.js" # @1.6.11 +pin "@floating-ui/utils", to: "@floating-ui--utils.js" # @0.2.8 +pin "@floating-ui/utils/dom", to: "@floating-ui--utils--dom.js" # @0.2.8 +pin "@kurkle/color", to: "@kurkle--color.js" # @0.3.2 +pin "@motionone/animation", to: "@motionone--animation.js" # @10.18.0 +pin "@motionone/dom", to: "@motionone--dom.js" # @10.18.0 +pin "@motionone/easing", to: "@motionone--easing.js" # @10.18.0 +pin "@motionone/generators", to: "@motionone--generators.js" # @10.18.0 +pin "@motionone/types", to: "@motionone--types.js" # @10.17.1 +pin "@motionone/utils", to: "@motionone--utils.js" # @10.18.0 +pin "@popperjs/core", to: "@popperjs--core.js" # @2.11.8 +pin "chart.js/auto", to: "chart.js--auto.js" # @4.4.4 +pin "date-fns", to: "https://ga.jspm.io/npm:date-fns@3.3.1/index.mjs" +pin "fuse.js" # @7.0.0 +pin "hey-listen" # @1.0.8 +pin "motion" # @10.18.0 +pin "mustache" # @4.2.0 +pin "tippy.js" # @6.3.7 +pin "tslib" # @2.7.0 +pin "@popperjs/core/+esm", to: "@popperjs--core--+esm.js" # @2.11.8 +pin "@popperjs/core", to: "stupid-popper-lib-2024.js" \ No newline at end of file diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 4873244..b7dd947 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -5,3 +5,4 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path +Rails.application.config.assets.paths << Rails.root.join("app/components") diff --git a/config/initializers/rbui.rb b/config/initializers/rbui.rb new file mode 100644 index 0000000..02a0978 --- /dev/null +++ b/config/initializers/rbui.rb @@ -0,0 +1,10 @@ +#RBUI.setup do |config| + + # Setting a namespace allows you to access RBUI components through this namespace. + # For example, with namespace set to "UI", you can use: + # UI::Button.new instead of RBUI::Button.new + # UI::Card.new instead of RBUI::Card.new + # This can help avoid naming conflicts and allows for cleaner, more concise code. + # If you prefer to use RBUI components directly, you can leave this unset. + # config.namespace = "UI" +#end diff --git a/config/tailwind.config.js b/config/tailwind.config.js index d6ad82c..3eac91a 100644 --- a/config/tailwind.config.js +++ b/config/tailwind.config.js @@ -1,22 +1,88 @@ +// For importing tailwind styles from rbui gem +const execSync = require('child_process').execSync; + +// Import rbui gem path +const outputRBUI = execSync('bundle show rbui', { encoding: 'utf-8' }); +const rbui_path = outputRBUI.trim() + '/**/*.rb'; + const defaultTheme = require('tailwindcss/defaultTheme') module.exports = { + darkMode: ["class"], content: [ - './public/*.html', + './app/views/**/*.{erb,haml,html,slim,rb}', + './app/components/rbui/**/*.rb', './app/helpers/**/*.rb', + './app/assets/stylesheets/**/*.css', './app/javascript/**/*.js', - './app/views/**/*.{erb,haml,html,slim}' + rbui_path ], theme: { + container: { + center: true, + padding: "2rem", + screens: { + "2xl": "1400px", + }, + }, extend: { + colors: { + border: "hsl(var(--border))", + input: "hsl(var(--input))", + ring: "hsl(var(--ring))", + background: "hsl(var(--background))", + foreground: "hsl(var(--foreground))", + primary: { + DEFAULT: "hsl(var(--primary))", + foreground: "hsl(var(--primary-foreground))", + }, + secondary: { + DEFAULT: "hsl(var(--secondary))", + foreground: "hsl(var(--secondary-foreground))", + }, + destructive: { + DEFAULT: "hsl(var(--destructive))", + foreground: "hsl(var(--destructive-foreground))", + }, + muted: { + DEFAULT: "hsl(var(--muted))", + foreground: "hsl(var(--muted-foreground))", + }, + accent: { + DEFAULT: "hsl(var(--accent))", + foreground: "hsl(var(--accent-foreground))", + }, + popover: { + DEFAULT: "hsl(var(--popover))", + foreground: "hsl(var(--popover-foreground))", + }, + card: { + DEFAULT: "hsl(var(--card))", + foreground: "hsl(var(--card-foreground))", + }, + /* rbui especific */ + warning: { + DEFAULT: "hsl(var(--warning))", + foreground: "hsl(var(--warning-foreground))", + }, + success: { + DEFAULT: "hsl(var(--success))", + foreground: "hsl(var(--success-foreground))", + }, + }, + borderRadius: { + lg: `var(--radius)`, + md: `calc(var(--radius) - 2px)`, + sm: "calc(var(--radius) - 4px)", + }, fontFamily: { - sans: ['Inter var', ...defaultTheme.fontFamily.sans], + sans: ["var(--font-sans)", ...defaultTheme.fontFamily.sans], }, }, }, plugins: [ - require('@tailwindcss/forms'), - require('@tailwindcss/typography'), - require('@tailwindcss/container-queries'), - ] + + require("../vendor/javascript/tailwindcss-animate"), + + ], } diff --git a/vendor/javascript/@babel--runtime--helpers--esm--assertThisInitialized.js b/vendor/javascript/@babel--runtime--helpers--esm--assertThisInitialized.js new file mode 100644 index 0000000..97dea6a --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--assertThisInitialized.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/assertThisInitialized@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/assertThisInitialized.js + +function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}export{_assertThisInitialized as default}; + diff --git a/vendor/javascript/@babel--runtime--helpers--esm--classCallCheck.js b/vendor/javascript/@babel--runtime--helpers--esm--classCallCheck.js new file mode 100644 index 0000000..246fcc1 --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--classCallCheck.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/classCallCheck@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/classCallCheck.js + +function _classCallCheck(a,l){if(!(a instanceof l))throw new TypeError("Cannot call a class as a function")}export{_classCallCheck as default}; + diff --git a/vendor/javascript/@babel--runtime--helpers--esm--createClass.js b/vendor/javascript/@babel--runtime--helpers--esm--createClass.js new file mode 100644 index 0000000..e9482fe --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--createClass.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/createClass@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/createClass.js + +import e from"./toPropertyKey.js";import"./typeof.js";import"./toPrimitive.js";function _defineProperties(r,t){for(var o=0;o=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(r){throw r},f:u}}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 l,y=!0,c=!1;return{s:function s(){a=a.call(t)},n:function n(){var r=a.next();return y=r.done,r},e:function e(r){c=!0,l=r},f:function f(){try{y||null==a.return||a.return()}finally{if(c)throw l}}}}export{_createForOfIteratorHelper as default}; + diff --git a/vendor/javascript/@babel--runtime--helpers--esm--createSuper.js b/vendor/javascript/@babel--runtime--helpers--esm--createSuper.js new file mode 100644 index 0000000..4177614 --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--createSuper.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/createSuper@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/createSuper.js + +import t from"./getPrototypeOf.js";import r from"./isNativeReflectConstruct.js";import e from"./possibleConstructorReturn.js";import"./typeof.js";import"./assertThisInitialized.js";function _createSuper(o){var s=r();return function(){var r,i=t(o);if(s){var p=t(this).constructor;r=Reflect.construct(i,arguments,p)}else r=i.apply(this,arguments);return e(this,r)}}export{_createSuper as default}; + diff --git a/vendor/javascript/@babel--runtime--helpers--esm--defineProperty.js b/vendor/javascript/@babel--runtime--helpers--esm--defineProperty.js new file mode 100644 index 0000000..2484e82 --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--defineProperty.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/defineProperty@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/defineProperty.js + +import e from"./toPropertyKey.js";import"./typeof.js";import"./toPrimitive.js";function _defineProperty(r,t,o){return(t=e(t))in r?Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[t]=o,r}export{_defineProperty as default}; + diff --git a/vendor/javascript/@babel--runtime--helpers--esm--inherits.js b/vendor/javascript/@babel--runtime--helpers--esm--inherits.js new file mode 100644 index 0000000..a023d66 --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--inherits.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/inherits@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/inherits.js + +import e from"./setPrototypeOf.js";function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&e(t,r)}export{_inherits as default}; + diff --git a/vendor/javascript/@babel--runtime--helpers--esm--typeof.js b/vendor/javascript/@babel--runtime--helpers--esm--typeof.js new file mode 100644 index 0000000..1922228 --- /dev/null +++ b/vendor/javascript/@babel--runtime--helpers--esm--typeof.js @@ -0,0 +1,4 @@ +// @babel/runtime/helpers/esm/typeof@7.25.6 downloaded from https://ga.jspm.io/npm:@babel/runtime@7.25.6/helpers/esm/typeof.js + +function _typeof(o){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}export{_typeof as default}; + diff --git a/vendor/javascript/@floating-ui--core.js b/vendor/javascript/@floating-ui--core.js new file mode 100644 index 0000000..6ed23cf --- /dev/null +++ b/vendor/javascript/@floating-ui--core.js @@ -0,0 +1,4 @@ +// @floating-ui/core@1.6.8 downloaded from https://ga.jspm.io/npm:@floating-ui/core@1.6.8/dist/floating-ui.core.mjs + +import{getSideAxis as t,getAlignmentAxis as e,getAxisLength as n,getSide as o,getAlignment as s,evaluate as i,getPaddingObject as c,rectToClientRect as r,min as l,clamp as a,getOppositeAlignmentPlacement as f,placements as m,getAlignmentSides as d,getOppositePlacement as u,getExpandedPlacements as g,getOppositeAxisPlacements as p,sides as h,max as y,getOppositeAxis as w}from"@floating-ui/utils";export{rectToClientRect}from"@floating-ui/utils";function computeCoordsFromPlacement(i,c,r){let{reference:l,floating:a}=i;const f=t(c);const m=e(c);const d=n(m);const u=o(c);const g=f==="y";const p=l.x+l.width/2-a.width/2;const h=l.y+l.height/2-a.height/2;const y=l[d]/2-a[d]/2;let w;switch(u){case"top":w={x:p,y:l.y-a.height};break;case"bottom":w={x:p,y:l.y+l.height};break;case"right":w={x:l.x+l.width,y:h};break;case"left":w={x:l.x-a.width,y:h};break;default:w={x:l.x,y:l.y}}switch(s(c)){case"start":w[m]-=y*(r&&g?-1:1);break;case"end":w[m]+=y*(r&&g?-1:1);break}return w}const computePosition=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:c}=n;const r=i.filter(Boolean);const l=await(c.isRTL==null?void 0:c.isRTL(e));let a=await c.getElementRects({reference:t,floating:e,strategy:s});let{x:f,y:m}=computeCoordsFromPlacement(a,o,l);let d=o;let u={};let g=0;for(let n=0;n({name:"arrow",options:t,async fn(o){const{x:r,y:f,placement:m,rects:d,platform:u,elements:g,middlewareData:p}=o;const{element:h,padding:y=0}=i(t,o)||{};if(h==null)return{};const w=c(y);const x={x:r,y:f};const v=e(m);const b=n(v);const A=await u.getDimensions(h);const R=v==="y";const O=R?"top":"left";const P=R?"bottom":"right";const C=R?"clientHeight":"clientWidth";const D=d.reference[b]+d.reference[v]-x[v]-d.floating[b];const T=x[v]-d.reference[v];const L=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h));let B=L?L[C]:0;B&&await(u.isElement==null?void 0:u.isElement(L))||(B=g.floating[C]||d.floating[b]);const E=D/2-T/2;const k=B/2-A[b]/2-1;const S=l(w[O],k);const F=l(w[P],k);const H=S;const V=B-A[b]-F;const W=B/2-A[b]/2+E;const j=a(H,W,V);const z=!p.arrow&&s(m)!=null&&W!==j&&d.reference[b]/2-(Ws(e)===t)),...n.filter((e=>s(e)!==t))]:n.filter((t=>o(t)===t));return i.filter((n=>!t||(s(n)===t||!!e&&f(n)!==n)))}const autoPlacement=function(t){t===void 0&&(t={});return{name:"autoPlacement",options:t,async fn(e){var n,c,r;const{rects:l,middlewareData:a,placement:f,platform:u,elements:g}=e;const{crossAxis:p=false,alignment:h,allowedPlacements:y=m,autoAlignment:w=true,...x}=i(t,e);const v=h!==void 0||y===m?getPlacementList(h||null,w,y):y;const b=await detectOverflow(e,x);const A=((n=a.autoPlacement)==null?void 0:n.index)||0;const R=v[A];if(R==null)return{};const O=d(R,l,await(u.isRTL==null?void 0:u.isRTL(g.floating)));if(f!==R)return{reset:{placement:v[0]}};const P=[b[o(R)],b[O[0]],b[O[1]]];const C=[...((c=a.autoPlacement)==null?void 0:c.overflows)||[],{placement:R,overflows:P}];const D=v[A+1];if(D)return{data:{index:A+1,overflows:C},reset:{placement:D}};const T=C.map((t=>{const e=s(t.placement);return[t.placement,e&&p?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1]));const L=T.filter((t=>t[2].slice(0,s(t[0])?2:3).every((t=>t<=0))));const B=((r=L[0])==null?void 0:r[0])||T[0][0];return B!==f?{data:{index:A+1,overflows:C},reset:{placement:B}}:{}}}};const flip=function(e){e===void 0&&(e={});return{name:"flip",options:e,async fn(n){var s,c;const{placement:r,middlewareData:l,rects:a,initialPlacement:f,platform:m,elements:h}=n;const{mainAxis:y=true,crossAxis:w=true,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:A=true,...R}=i(e,n);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const O=o(r);const P=t(f);const C=o(f)===f;const D=await(m.isRTL==null?void 0:m.isRTL(h.floating));const T=x||(C||!A?[u(f)]:g(f));const L=b!=="none";!x&&L&&T.push(...p(f,A,b,D));const B=[f,...T];const E=await detectOverflow(n,R);const k=[];let S=((c=l.flip)==null?void 0:c.overflows)||[];y&&k.push(E[O]);if(w){const t=d(r,a,D);k.push(E[t[0]],E[t[1]])}S=[...S,{placement:r,overflows:k}];if(!k.every((t=>t<=0))){var F,H;const e=(((F=l.flip)==null?void 0:F.index)||0)+1;const n=B[e];if(n)return{data:{index:e,overflows:S},reset:{placement:n}};let o=(H=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])==null?void 0:H.placement;if(!o)switch(v){case"bestFit":{var V;const e=(V=S.filter((e=>{if(L){const n=t(e.placement);return n===P||n==="y"}return true})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])==null?void 0:V[0];e&&(o=e);break}case"initialPlacement":o=f;break}if(r!==o)return{reset:{placement:o}}}return{}}}};function getSideOffsets(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function isAnySideFullyClipped(t){return h.some((e=>t[e]>=0))}const hide=function(t){t===void 0&&(t={});return{name:"hide",options:t,async fn(e){const{rects:n}=e;const{strategy:o="referenceHidden",...s}=i(t,e);switch(o){case"referenceHidden":{const t=await detectOverflow(e,{...s,elementContext:"reference"});const o=getSideOffsets(t,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:isAnySideFullyClipped(o)}}}case"escaped":{const t=await detectOverflow(e,{...s,altBoundary:true});const o=getSideOffsets(t,n.floating);return{data:{escapedOffsets:o,escaped:isAnySideFullyClipped(o)}}}default:return{}}}}};function getBoundingRect(t){const e=l(...t.map((t=>t.left)));const n=l(...t.map((t=>t.top)));const o=y(...t.map((t=>t.right)));const s=y(...t.map((t=>t.bottom)));return{x:e,y:n,width:o-e,height:s-n}}function getRectsByLine(t){const e=t.slice().sort(((t,e)=>t.y-e.y));const n=[];let o=null;for(let t=0;to.height/2?n.push([s]):n[n.length-1].push(s);o=s}return n.map((t=>r(getBoundingRect(t))))}const inline=function(e){e===void 0&&(e={});return{name:"inline",options:e,async fn(n){const{placement:s,elements:a,rects:f,platform:m,strategy:d}=n;const{padding:u=2,x:g,y:p}=i(e,n);const h=Array.from(await(m.getClientRects==null?void 0:m.getClientRects(a.reference))||[]);const w=getRectsByLine(h);const x=r(getBoundingRect(h));const v=c(u);function getBoundingClientRect(){if(w.length===2&&w[0].left>w[1].right&&g!=null&&p!=null)return w.find((t=>g>t.left-v.left&&gt.top-v.top&&p=2){if(t(s)==="y"){const t=w[0];const e=w[w.length-1];const n=o(s)==="top";const i=t.top;const c=e.bottom;const r=n?t.left:e.left;const l=n?t.right:e.right;const a=l-r;const f=c-i;return{top:i,bottom:c,left:r,right:l,width:a,height:f,x:r,y:i}}const e=o(s)==="left";const n=y(...w.map((t=>t.right)));const i=l(...w.map((t=>t.left)));const c=w.filter((t=>e?t.left===i:t.right===n));const r=c[0].top;const a=c[c.length-1].bottom;const f=i;const m=n;const d=m-f;const u=a-r;return{top:r,bottom:a,left:f,right:m,width:d,height:u,x:f,y:r}}return x}const b=await m.getElementRects({reference:{getBoundingClientRect:getBoundingClientRect},floating:a.floating,strategy:d});return f.reference.x!==b.reference.x||f.reference.y!==b.reference.y||f.reference.width!==b.reference.width||f.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}};async function convertValueToCoords(e,n){const{placement:c,platform:r,elements:l}=e;const a=await(r.isRTL==null?void 0:r.isRTL(l.floating));const f=o(c);const m=s(c);const d=t(c)==="y";const u=["left","top"].includes(f)?-1:1;const g=a&&d?-1:1;const p=i(n,e);let{mainAxis:h,crossAxis:y,alignmentAxis:w}=typeof p==="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};m&&typeof w==="number"&&(y=m==="end"?w*-1:w);return d?{x:y*g,y:h*u}:{x:h*u,y:y*g}}const offset=function(t){t===void 0&&(t=0);return{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:c,middlewareData:r}=e;const l=await convertValueToCoords(e,t);return c===((n=r.offset)==null?void 0:n.placement)&&(o=r.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:c}}}}};const shift=function(e){e===void 0&&(e={});return{name:"shift",options:e,async fn(n){const{x:s,y:c,placement:r}=n;const{mainAxis:l=true,crossAxis:f=false,limiter:m={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...d}=i(e,n);const u={x:s,y:c};const g=await detectOverflow(n,d);const p=t(o(r));const h=w(p);let y=u[h];let x=u[p];if(l){const t=h==="y"?"top":"left";const e=h==="y"?"bottom":"right";const n=y+g[t];const o=y-g[e];y=a(n,y,o)}if(f){const t=p==="y"?"top":"left";const e=p==="y"?"bottom":"right";const n=x+g[t];const o=x-g[e];x=a(n,x,o)}const v=m.fn({...n,[h]:y,[p]:x});return{...v,data:{x:v.x-s,y:v.y-c,enabled:{[h]:l,[p]:f}}}}}};const limitShift=function(e){e===void 0&&(e={});return{options:e,fn(n){const{x:s,y:c,placement:r,rects:l,middlewareData:a}=n;const{offset:f=0,mainAxis:m=true,crossAxis:d=true}=i(e,n);const u={x:s,y:c};const g=t(r);const p=w(g);let h=u[p];let y=u[g];const x=i(f,n);const v=typeof x==="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(m){const t=p==="y"?"height":"width";const e=l.reference[p]-l.floating[t]+v.mainAxis;const n=l.reference[p]+l.reference[t]-v.mainAxis;hn&&(h=n)}if(d){var b,A;const t=p==="y"?"width":"height";const e=["top","left"].includes(o(r));const n=l.reference[g]-l.floating[t]+(e&&((b=a.offset)==null?void 0:b[g])||0)+(e?0:v.crossAxis);const s=l.reference[g]+l.reference[t]+(e?0:((A=a.offset)==null?void 0:A[g])||0)-(e?v.crossAxis:0);ys&&(y=s)}return{[p]:h,[g]:y}}}};const size=function(e){e===void 0&&(e={});return{name:"size",options:e,async fn(n){var c,r;const{placement:a,rects:f,platform:m,elements:d}=n;const{apply:u=(()=>{}),...g}=i(e,n);const p=await detectOverflow(n,g);const h=o(a);const w=s(a);const x=t(a)==="y";const{width:v,height:b}=f.floating;let A;let R;if(h==="top"||h==="bottom"){A=h;R=w===(await(m.isRTL==null?void 0:m.isRTL(d.floating))?"start":"end")?"left":"right"}else{R=h;A=w==="end"?"top":"bottom"}const O=b-p.top-p.bottom;const P=v-p.left-p.right;const C=l(b-p[A],O);const D=l(v-p[R],P);const T=!n.middlewareData.shift;let L=C;let B=D;(c=n.middlewareData.shift)!=null&&c.enabled.x&&(B=P);(r=n.middlewareData.shift)!=null&&r.enabled.y&&(L=O);if(T&&!w){const t=y(p.left,0);const e=y(p.right,0);const n=y(p.top,0);const o=y(p.bottom,0);x?B=v-2*(t!==0||e!==0?t+e:y(p.left,p.right)):L=b-2*(n!==0||o!==0?n+o:y(p.top,p.bottom))}await u({...n,availableWidth:B,availableHeight:L});const E=await m.getDimensions(d.floating);return v!==E.width||b!==E.height?{reset:{rects:true}}:{}}}};export{arrow,autoPlacement,computePosition,detectOverflow,flip,hide,inline,limitShift,offset,shift,size}; + diff --git a/vendor/javascript/@floating-ui--dom.js b/vendor/javascript/@floating-ui--dom.js new file mode 100644 index 0000000..7493765 --- /dev/null +++ b/vendor/javascript/@floating-ui--dom.js @@ -0,0 +1,12 @@ +// @floating-ui/dom@1.6.11 downloaded from https://ga.jspm.io/npm:@floating-ui/dom@1.6.11/dist/floating-ui.dom.mjs + +import{rectToClientRect as t,detectOverflow as e,offset as n,autoPlacement as o,shift as i,flip as s,size as c,hide as r,arrow as l,inline as f,limitShift as a,computePosition as u}from"@floating-ui/core";import{round as g,createCoords as h,max as d,min as p,floor as m}from"@floating-ui/utils";import{getComputedStyle as w,isHTMLElement as R,isElement as x,getWindow as v,isWebKit as y,getFrameElement as C,getDocumentElement as b,isTopLayer as O,getNodeName as T,isOverflowElement as L,getNodeScroll as P,getParentNode as B,isLastTraversableNode as S,getOverflowAncestors as A,isContainingBlock as F,isTableElement as E,getContainingBlock as V}from"@floating-ui/utils/dom";export{getOverflowAncestors}from"@floating-ui/utils/dom";function getCssDimensions(t){const e=w(t);let n=parseFloat(e.width)||0;let o=parseFloat(e.height)||0;const i=R(t);const s=i?t.offsetWidth:n;const c=i?t.offsetHeight:o;const r=g(n)!==s||g(o)!==c;if(r){n=s;o=c}return{width:n,height:o,$:r}}function unwrapElement(t){return x(t)?t:t.contextElement}function getScale(t){const e=unwrapElement(t);if(!R(e))return h(1);const n=e.getBoundingClientRect();const{width:o,height:i,$:s}=getCssDimensions(e);let c=(s?g(n.width):n.width)/o;let r=(s?g(n.height):n.height)/i;c&&Number.isFinite(c)||(c=1);r&&Number.isFinite(r)||(r=1);return{x:c,y:r}}const W=h(0);function getVisualOffsets(t){const e=v(t);return y()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:W}function shouldAddVisualOffsets(t,e,n){e===void 0&&(e=false);return!(!n||e&&n!==v(t))&&e}function getBoundingClientRect(e,n,o,i){n===void 0&&(n=false);o===void 0&&(o=false);const s=e.getBoundingClientRect();const c=unwrapElement(e);let r=h(1);n&&(i?x(i)&&(r=getScale(i)):r=getScale(e));const l=shouldAddVisualOffsets(c,o,i)?getVisualOffsets(c):h(0);let f=(s.left+l.x)/r.x;let a=(s.top+l.y)/r.y;let u=s.width/r.x;let g=s.height/r.y;if(c){const t=v(c);const e=i&&x(i)?v(i):i;let n=t;let o=C(n);while(o&&i&&e!==n){const t=getScale(o);const e=o.getBoundingClientRect();const i=w(o);const s=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x;const c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x;a*=t.y;u*=t.x;g*=t.y;f+=s;a+=c;n=v(o);o=C(n)}}return t({width:u,height:g,x:f,y:a})}function convertOffsetParentRelativeRectToViewportRelativeRect(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed";const c=b(o);const r=!!e&&O(e.floating);if(o===c||r&&s)return n;let l={scrollLeft:0,scrollTop:0};let f=h(1);const a=h(0);const u=R(o);if(u||!u&&!s){(T(o)!=="body"||L(c))&&(l=P(o));if(R(o)){const t=getBoundingClientRect(o);f=getScale(o);a.x=t.x+o.clientLeft;a.y=t.y+o.clientTop}}return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+a.x,y:n.y*f.y-l.scrollTop*f.y+a.y}}function getClientRects(t){return Array.from(t.getClientRects())}function getWindowScrollBarX(t,e){const n=P(t).scrollLeft;return e?e.left+n:getBoundingClientRect(b(t)).left+n}function getDocumentRect(t){const e=b(t);const n=P(t);const o=t.ownerDocument.body;const i=d(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth);const s=d(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+getWindowScrollBarX(t);const r=-n.scrollTop;w(o).direction==="rtl"&&(c+=d(e.clientWidth,o.clientWidth)-i);return{width:i,height:s,x:c,y:r}}function getViewportRect(t,e){const n=v(t);const o=b(t);const i=n.visualViewport;let s=o.clientWidth;let c=o.clientHeight;let r=0;let l=0;if(i){s=i.width;c=i.height;const t=y();if(!t||t&&e==="fixed"){r=i.offsetLeft;l=i.offsetTop}}return{width:s,height:c,x:r,y:l}}function getInnerBoundingClientRect(t,e){const n=getBoundingClientRect(t,true,e==="fixed");const o=n.top+t.clientTop;const i=n.left+t.clientLeft;const s=R(t)?getScale(t):h(1);const c=t.clientWidth*s.x;const r=t.clientHeight*s.y;const l=i*s.x;const f=o*s.y;return{width:c,height:r,x:l,y:f}}function getClientRectFromClippingAncestor(e,n,o){let i;if(n==="viewport")i=getViewportRect(e,o);else if(n==="document")i=getDocumentRect(b(e));else if(x(n))i=getInnerBoundingClientRect(n,o);else{const t=getVisualOffsets(e);i={...n,x:n.x-t.x,y:n.y-t.y}}return t(i)}function hasFixedPositionAncestor(t,e){const n=B(t);return!(n===e||!x(n)||S(n))&&(w(n).position==="fixed"||hasFixedPositionAncestor(n,e))}function getClippingElementAncestors(t,e){const n=e.get(t);if(n)return n;let o=A(t,[],false).filter((t=>x(t)&&T(t)!=="body"));let i=null;const s=w(t).position==="fixed";let c=s?B(t):t;while(x(c)&&!S(c)){const e=w(c);const n=F(c);n||e.position!=="fixed"||(i=null);const r=s?!n&&!i:!n&&e.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||L(c)&&!n&&hasFixedPositionAncestor(t,c);r?o=o.filter((t=>t!==c)):i=e;c=B(c)}e.set(t,o);return o}function getClippingRect(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=n==="clippingAncestors"?O(e)?[]:getClippingElementAncestors(e,this._c):[].concat(n);const c=[...s,o];const r=c[0];const l=c.reduce(((t,n)=>{const o=getClientRectFromClippingAncestor(e,n,i);t.top=d(o.top,t.top);t.right=p(o.right,t.right);t.bottom=p(o.bottom,t.bottom);t.left=d(o.left,t.left);return t}),getClientRectFromClippingAncestor(e,r,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function getDimensions(t){const{width:e,height:n}=getCssDimensions(t);return{width:e,height:n}}function getRectRelativeToOffsetParent(t,e,n){const o=R(e);const i=b(e);const s=n==="fixed";const c=getBoundingClientRect(t,true,s,e);let r={scrollLeft:0,scrollTop:0};const l=h(0);if(o||!o&&!s){(T(e)!=="body"||L(i))&&(r=P(e));if(o){const t=getBoundingClientRect(e,true,s,e);l.x=t.x+e.clientLeft;l.y=t.y+e.clientTop}else i&&(l.x=getWindowScrollBarX(i))}let f=0;let a=0;if(i&&!o&&!s){const t=i.getBoundingClientRect();a=t.top+r.scrollTop;f=t.left+r.scrollLeft-getWindowScrollBarX(i,t)}const u=c.left+r.scrollLeft-l.x-f;const g=c.top+r.scrollTop-l.y-a;return{x:u,y:g,width:c.width,height:c.height}}function isStaticPositioned(t){return w(t).position==="static"}function getTrueOffsetParent(t,e){if(!R(t)||w(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;b(t)===n&&(n=n.ownerDocument.body);return n}function getOffsetParent(t,e){const n=v(t);if(O(t))return n;if(!R(t)){let e=B(t);while(e&&!S(e)){if(x(e)&&!isStaticPositioned(e))return e;e=B(e)}return n}let o=getTrueOffsetParent(t,e);while(o&&E(o)&&isStaticPositioned(o))o=getTrueOffsetParent(o,e);return o&&S(o)&&isStaticPositioned(o)&&!F(o)?n:o||V(t)||n}const getElementRects=async function(t){const e=this.getOffsetParent||getOffsetParent;const n=this.getDimensions;const o=await n(t.floating);return{reference:getRectRelativeToOffsetParent(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function isRTL(t){return w(t).direction==="rtl"}const D={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:b,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:x,isRTL:isRTL};function observeMove(t,e){let n=null;let o;const i=b(t);function cleanup(){var t;clearTimeout(o);(t=n)==null||t.disconnect();n=null}function refresh(s,c){s===void 0&&(s=false);c===void 0&&(c=1);cleanup();const{left:r,top:l,width:f,height:a}=t.getBoundingClientRect();s||e();if(!f||!a)return;const u=m(l);const g=m(i.clientWidth-(r+f));const h=m(i.clientHeight-(l+a));const w=m(r);const R=-u+"px "+-g+"px "+-h+"px "+-w+"px";const x={rootMargin:R,threshold:d(0,p(1,c))||1};let v=true;function handleObserve(t){const e=t[0].intersectionRatio;if(e!==c){if(!v)return refresh();e?refresh(false,e):o=setTimeout((()=>{refresh(false,1e-7)}),1e3)}v=false}try{n=new IntersectionObserver(handleObserve,{...x,root:i.ownerDocument})}catch(t){n=new IntersectionObserver(handleObserve,x)}n.observe(t)}refresh(true);return cleanup} +/** + * Automatically updates the position of the floating element when necessary. + * Should only be called when the floating element is mounted on the DOM or + * visible on the screen. + * @returns cleanup function that should be invoked when the floating element is + * removed from the DOM or hidden from the screen. + * @see https://floating-ui.com/docs/autoUpdate + */function autoUpdate(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=true,ancestorResize:s=true,elementResize:c=typeof ResizeObserver==="function",layoutShift:r=typeof IntersectionObserver==="function",animationFrame:l=false}=o;const f=unwrapElement(t);const a=i||s?[...f?A(f):[],...A(e)]:[];a.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:true});s&&t.addEventListener("resize",n)}));const u=f&&r?observeMove(f,n):null;let g=-1;let h=null;if(c){h=new ResizeObserver((t=>{let[o]=t;if(o&&o.target===f&&h){h.unobserve(e);cancelAnimationFrame(g);g=requestAnimationFrame((()=>{var t;(t=h)==null||t.observe(e)}))}n()}));f&&!l&&h.observe(f);h.observe(e)}let d;let p=l?getBoundingClientRect(t):null;l&&frameLoop();function frameLoop(){const e=getBoundingClientRect(t);!p||e.x===p.x&&e.y===p.y&&e.width===p.width&&e.height===p.height||n();p=e;d=requestAnimationFrame(frameLoop)}n();return()=>{var t;a.forEach((t=>{i&&t.removeEventListener("scroll",n);s&&t.removeEventListener("resize",n)}));u==null||u();(t=h)==null||t.disconnect();h=null;l&&cancelAnimationFrame(d)}}const H=e;const z=n;const I=o;const M=i;const X=s;const q=c;const N=r;const U=l;const $=f;const _=a;const computePosition=(t,e,n)=>{const o=new Map;const i={platform:D,...n};const s={...i.platform,_c:o};return u(t,e,{...i,platform:s})};export{U as arrow,I as autoPlacement,autoUpdate,computePosition,H as detectOverflow,X as flip,N as hide,$ as inline,_ as limitShift,z as offset,D as platform,M as shift,q as size}; + diff --git a/vendor/javascript/@floating-ui--utils--dom.js b/vendor/javascript/@floating-ui--utils--dom.js new file mode 100644 index 0000000..6396373 --- /dev/null +++ b/vendor/javascript/@floating-ui--utils--dom.js @@ -0,0 +1,4 @@ +// @floating-ui/utils/dom@0.2.8 downloaded from https://ga.jspm.io/npm:@floating-ui/utils@0.2.8/dist/floating-ui.utils.dom.mjs + +function hasWindow(){return typeof window!=="undefined"}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return(t=(isNode(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function isNode(e){return!!hasWindow()&&(e instanceof Node||e instanceof getWindow(e).Node)}function isElement(e){return!!hasWindow()&&(e instanceof Element||e instanceof getWindow(e).Element)}function isHTMLElement(e){return!!hasWindow()&&(e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement)}function isShadowRoot(e){return!(!hasWindow()||typeof ShadowRoot==="undefined")&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=getComputedStyle(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function isTableElement(e){return["table","td","th"].includes(getNodeName(e))}function isTopLayer(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return false}}))}function isContainingBlock(e){const t=isWebKit();const n=isElement(e)?getComputedStyle(e):e;return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function getContainingBlock(e){let t=getParentNode(e);while(isHTMLElement(t)&&!isLastTraversableNode(t)){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return!(typeof CSS==="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(e){return["html","body","#document"].includes(getNodeName(e))}function getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if(getNodeName(e)==="html")return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var o;t===void 0&&(t=[]);n===void 0&&(n=true);const r=getNearestOverflowAncestor(e);const i=r===((o=e.ownerDocument)==null?void 0:o.body);const l=getWindow(r);if(i){const e=getFrameElement(l);return t.concat(l,l.visualViewport||[],isOverflowElement(r)?r:[],e&&n?getOverflowAncestors(e):[])}return t.concat(r,getOverflowAncestors(r,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}export{getComputedStyle,getContainingBlock,getDocumentElement,getFrameElement,getNearestOverflowAncestor,getNodeName,getNodeScroll,getOverflowAncestors,getParentNode,getWindow,isContainingBlock,isElement,isHTMLElement,isLastTraversableNode,isNode,isOverflowElement,isShadowRoot,isTableElement,isTopLayer,isWebKit}; + diff --git a/vendor/javascript/@floating-ui--utils.js b/vendor/javascript/@floating-ui--utils.js new file mode 100644 index 0000000..e4fc9b9 --- /dev/null +++ b/vendor/javascript/@floating-ui--utils.js @@ -0,0 +1,4 @@ +// @floating-ui/utils@0.2.8 downloaded from https://ga.jspm.io/npm:@floating-ui/utils@0.2.8/dist/floating-ui.utils.mjs + +const t=["top","right","bottom","left"];const e=["start","end"];const n=t.reduce(((t,n)=>t.concat(n,n+"-"+e[0],n+"-"+e[1])),[]);const i=Math.min;const o=Math.max;const g=Math.round;const c=Math.floor;const createCoords=t=>({x:t,y:t});const s={left:"right",right:"left",bottom:"top",top:"bottom"};const r={start:"end",end:"start"};function clamp(t,e,n){return o(t,i(e,n))}function evaluate(t,e){return typeof t==="function"?t(e):t}function getSide(t){return t.split("-")[0]}function getAlignment(t){return t.split("-")[1]}function getOppositeAxis(t){return t==="x"?"y":"x"}function getAxisLength(t){return t==="y"?"height":"width"}function getSideAxis(t){return["top","bottom"].includes(getSide(t))?"y":"x"}function getAlignmentAxis(t){return getOppositeAxis(getSideAxis(t))}function getAlignmentSides(t,e,n){n===void 0&&(n=false);const i=getAlignment(t);const o=getAlignmentAxis(t);const g=getAxisLength(o);let c=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";e.reference[g]>e.floating[g]&&(c=getOppositePlacement(c));return[c,getOppositePlacement(c)]}function getExpandedPlacements(t){const e=getOppositePlacement(t);return[getOppositeAlignmentPlacement(t),e,getOppositeAlignmentPlacement(e)]}function getOppositeAlignmentPlacement(t){return t.replace(/start|end/g,(t=>r[t]))}function getSideList(t,e,n){const i=["left","right"];const o=["right","left"];const g=["top","bottom"];const c=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?g:c;default:return[]}}function getOppositeAxisPlacements(t,e,n,i){const o=getAlignment(t);let g=getSideList(getSide(t),n==="start",i);if(o){g=g.map((t=>t+"-"+o));e&&(g=g.concat(g.map(getOppositeAlignmentPlacement)))}return g}function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,(t=>s[t]))}function expandPaddingObject(t){return{top:0,right:0,bottom:0,left:0,...t}}function getPaddingObject(t){return typeof t!=="number"?expandPaddingObject(t):{top:t,right:t,bottom:t,left:t}}function rectToClientRect(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}export{e as alignments,clamp,createCoords,evaluate,expandPaddingObject,c as floor,getAlignment,getAlignmentAxis,getAlignmentSides,getAxisLength,getExpandedPlacements,getOppositeAlignmentPlacement,getOppositeAxis,getOppositeAxisPlacements,getOppositePlacement,getPaddingObject,getSide,getSideAxis,o as max,i as min,n as placements,rectToClientRect,g as round,t as sides}; + diff --git a/vendor/javascript/@hotwired--stimulus.js b/vendor/javascript/@hotwired--stimulus.js new file mode 100644 index 0000000..07dd4a6 --- /dev/null +++ b/vendor/javascript/@hotwired--stimulus.js @@ -0,0 +1,4 @@ +// @hotwired/stimulus@3.2.2 downloaded from https://ga.jspm.io/npm:@hotwired/stimulus@3.2.2/dist/stimulus.js + +class EventListener{constructor(e,t,r){this.eventTarget=e;this.eventName=t;this.eventOptions=r;this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=extendEvent(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const r=e.index,s=t.index;return rs?1:0}))}}function extendEvent(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:false,stopImmediatePropagation(){this.immediatePropagationStopped=true;t.call(this)}})}}class Dispatcher{constructor(e){this.application=e;this.eventListenerMaps=new Map;this.started=false}start(){if(!this.started){this.started=true;this.eventListeners.forEach((e=>e.connect()))}}stop(){if(this.started){this.started=false;this.eventListeners.forEach((e=>e.disconnect()))}}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=false){this.fetchEventListenerForBinding(e).bindingDisconnected(e);t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);if(!t.hasBindings()){t.disconnect();this.removeMappedEventListenerFor(e)}}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:r,eventOptions:s}=e;const n=this.fetchEventListenerMapForEventTarget(t);const i=this.cacheKey(r,s);n.delete(i);0==n.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:r,eventOptions:s}=e;return this.fetchEventListener(t,r,s)}fetchEventListener(e,t,r){const s=this.fetchEventListenerMapForEventTarget(e);const n=this.cacheKey(t,r);let i=s.get(n);if(!i){i=this.createEventListener(e,t,r);s.set(n,i)}return i}createEventListener(e,t,r){const s=new EventListener(e,t,r);this.started&&s.connect();return s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);if(!t){t=new Map;this.eventListenerMaps.set(e,t)}return t}cacheKey(e,t){const r=[e];Object.keys(t).sort().forEach((e=>{r.push(`${t[e]?"":"!"}${e}`)}));return r.join(":")}}const e={stop({event:e,value:t}){t&&e.stopPropagation();return true},prevent({event:e,value:t}){t&&e.preventDefault();return true},self({event:e,value:t,element:r}){return!t||r===e.target}};const t=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function parseActionDescriptorString(e){const r=e.trim();const s=r.match(t)||[];let n=s[2];let i=s[3];if(i&&!["keydown","keyup","keypress"].includes(n)){n+=`.${i}`;i=""}return{eventTarget:parseEventTarget(s[4]),eventName:n,eventOptions:s[7]?parseEventOptions(s[7]):{},identifier:s[5],methodName:s[6],keyFilter:s[1]||i}}function parseEventTarget(e){return"window"==e?window:"document"==e?document:void 0}function parseEventOptions(e){return e.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})}function stringifyEventTarget(e){return e==window?"window":e==document?"document":void 0}function camelize(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function namespaceCamelize(e){return camelize(e.replace(/--/g,"-").replace(/__/g,"_"))}function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function dasherize(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function tokenize(e){return e.match(/[^\s]+/g)||[]}function isSomething(e){return null!==e&&void 0!==e}function hasProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const r=["meta","ctrl","alt","shift"];class Action{constructor(e,t,r,s){this.element=e;this.index=t;this.eventTarget=r.eventTarget||e;this.eventName=r.eventName||getDefaultEventNameForElement(e)||error("missing event name");this.eventOptions=r.eventOptions||{};this.identifier=r.identifier||error("missing identifier");this.methodName=r.methodName||error("missing method name");this.keyFilter=r.keyFilter||"";this.schema=s}static forToken(e,t){return new this(e.element,e.index,parseActionDescriptorString(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"";const t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return false;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return true;const s=t.filter((e=>!r.includes(e)))[0];if(!s)return false;hasProperty(this.keyMappings,s)||error(`contains unknown key filter: ${this.keyFilter}`);return this.keyMappings[s].toLowerCase()!==e.key.toLowerCase()}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return false;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={};const t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:r,value:s}of Array.from(this.element.attributes)){const n=r.match(t);const i=n&&n[1];i&&(e[camelize(i)]=typecast(s))}return e}get eventTargetName(){return stringifyEventTarget(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[s,n,i,o]=r.map((e=>t.includes(e)));return e.metaKey!==s||e.ctrlKey!==n||e.altKey!==i||e.shiftKey!==o}}const s={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function getDefaultEventNameForElement(e){const t=e.tagName.toLowerCase();if(t in s)return s[t](e)}function error(e){throw new Error(e)}function typecast(e){try{return JSON.parse(e)}catch(t){return e}}class Binding{constructor(e,t){this.context=e;this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action;const{actionDescriptorFilters:r}=this.context.application;const{controller:s}=this.context;let n=true;for(const[i,o]of Object.entries(this.eventOptions))if(i in r){const c=r[i];n=n&&c({name:i,value:o,event:e,element:t,controller:s})}return n}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e);this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(t){const{identifier:r,controller:s,element:n,index:i}=this;const o={identifier:r,controller:s,element:n,index:i,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class ElementObserver{constructor(e,t){this.mutationObserverInit={attributes:true,childList:true,subtree:true};this.element=e;this.started=false;this.delegate=t;this.elements=new Set;this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){if(!this.started){this.started=true;this.mutationObserver.observe(this.element,this.mutationObserverInit);this.refresh()}}pause(e){if(this.started){this.mutationObserver.disconnect();this.started=false}e();if(!this.started){this.mutationObserver.observe(this.element,this.mutationObserverInit);this.started=true}}stop(){if(this.started){this.mutationObserver.takeRecords();this.mutationObserver.disconnect();this.started=false}}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){if("attributes"==e.type)this.processAttributeChange(e.target,e.attributeName);else if("childList"==e.type){this.processRemovedNodes(e.removedNodes);this.processAddedNodes(e.addedNodes)}}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){if(!this.elements.has(e)&&this.elementIsActive(e)){this.elements.add(e);this.delegate.elementMatched&&this.delegate.elementMatched(e)}}removeElement(e){if(this.elements.has(e)){this.elements.delete(e);this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e)}}}class AttributeObserver{constructor(e,t,r){this.attributeName=t;this.delegate=r;this.elementObserver=new ElementObserver(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[];const r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function add(e,t,r){fetch(e,t).add(r)}function del(e,t,r){fetch(e,t).delete(r);prune(e,t)}function fetch(e,t){let r=e.get(t);if(!r){r=new Set;e.set(t,r)}return r}function prune(e,t){const r=e.get(t);null!=r&&0==r.size&&e.delete(t)}class Multimap{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){const e=Array.from(this.valuesByKey.values());return e.reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){const e=Array.from(this.valuesByKey.values());return e.reduce(((e,t)=>e+t.size),0)}add(e,t){add(this.valuesByKey,e,t)}delete(e,t){del(this.valuesByKey,e,t)}has(e,t){const r=this.valuesByKey.get(e);return null!=r&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){const t=Array.from(this.valuesByKey.values());return t.some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,r])=>r.has(e))).map((([e,t])=>e))}}class IndexedMultimap extends Multimap{constructor(){super();this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t);add(this.keysByValue,t,e)}delete(e,t){super.delete(e,t);del(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class SelectorObserver{constructor(e,t,r,s){this._selector=t;this.details=s;this.elementObserver=new ElementObserver(e,this);this.delegate=r;this.matchesByElement=new Multimap}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e;this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}return false}matchElementsInTree(e){const{selector:t}=this;if(t){const r=this.matchElement(e)?[e]:[];const s=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return r.concat(s)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){const{selector:r}=this;if(r){const t=this.matchElement(e);const s=this.matchesByElement.has(r,e);t&&!s?this.selectorMatched(e,r):!t&&s&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details);this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details);this.matchesByElement.delete(t,e)}}class StringMapObserver{constructor(e,t){this.element=e;this.delegate=t;this.started=false;this.stringMap=new Map;this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){if(!this.started){this.started=true;this.mutationObserver.observe(this.element,{attributes:true,attributeOldValue:true});this.refresh()}}stop(){if(this.started){this.mutationObserver.takeRecords();this.mutationObserver.disconnect();this.started=false}}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const r=this.delegate.getStringMapKeyForAttribute(e);if(null!=r){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);const s=this.element.getAttribute(e);this.stringMap.get(e)!=s&&this.stringMapValueChanged(s,r,t);if(null==s){const t=this.stringMap.get(e);this.stringMap.delete(e);t&&this.stringMapKeyRemoved(r,e,t)}else this.stringMap.set(e,s)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class TokenListObserver{constructor(e,t,r){this.attributeObserver=new AttributeObserver(e,t,this);this.delegate=r;this.tokensByElement=new Multimap}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t);this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e);this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e);this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e);const r=this.readTokensForElement(e);const s=zip(t,r).findIndex((([e,t])=>!tokensAreEqual(e,t)));return-1==s?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){const t=this.attributeName;const r=e.getAttribute(t)||"";return parseTokenString(r,e,t)}}function parseTokenString(e,t,r){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,s)=>({element:t,attributeName:r,content:e,index:s})))}function zip(e,t){const r=Math.max(e.length,t.length);return Array.from({length:r},((r,s)=>[e[s],t[s]]))}function tokensAreEqual(e,t){return e&&t&&e.index==t.index&&e.content==t.content}class ValueListObserver{constructor(e,t,r){this.tokenListObserver=new TokenListObserver(e,t,this);this.delegate=r;this.parseResultsByToken=new WeakMap;this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e;const{value:r}=this.fetchParseResultForToken(e);if(r){this.fetchValuesByTokenForElement(t).set(e,r);this.delegate.elementMatchedValue(t,r)}}tokenUnmatched(e){const{element:t}=e;const{value:r}=this.fetchParseResultForToken(e);if(r){this.fetchValuesByTokenForElement(t).delete(e);this.delegate.elementUnmatchedValue(t,r)}}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);if(!t){t=this.parseToken(e);this.parseResultsByToken.set(e,t)}return t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);if(!t){t=new Map;this.valuesByTokenByElement.set(e,t)}return t}parseToken(e){try{const t=this.delegate.parseValueForToken(e);return{value:t}}catch(e){return{error:e}}}}class BindingObserver{constructor(e,t){this.context=e;this.delegate=t;this.bindingsByAction=new Map}start(){if(!this.valueListObserver){this.valueListObserver=new ValueListObserver(this.element,this.actionAttribute,this);this.valueListObserver.start()}}stop(){if(this.valueListObserver){this.valueListObserver.stop();delete this.valueListObserver;this.disconnectAllActions()}}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new Binding(this.context,e);this.bindingsByAction.set(e,t);this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);if(t){this.bindingsByAction.delete(e);this.delegate.bindingDisconnected(t)}}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,true)));this.bindingsByAction.clear()}parseValueForToken(e){const t=Action.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class ValueObserver{constructor(e,t){this.context=e;this.receiver=t;this.stringMapObserver=new StringMapObserver(this.element,this);this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start();this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){const s=this.valueDescriptorNameMap[t];if(null!==e){null===r&&(r=s.writer(s.defaultValue));this.invokeChangedCallback(t,e,r)}}stringMapKeyRemoved(e,t,r){const s=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,s.writer(this.receiver[e]),r):this.invokeChangedCallback(e,s.writer(s.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:r,writer:s}of this.valueDescriptors)void 0==r||this.controller.data.has(e)||this.invokeChangedCallback(t,s(r),void 0)}invokeChangedCallback(e,t,r){const s=`${e}Changed`;const n=this.receiver[s];if("function"==typeof n){const s=this.valueDescriptorNameMap[e];try{const e=s.reader(t);let i=r;r&&(i=s.reader(r));n.call(this.receiver,e,i)}catch(e){e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${s.name}" - ${e.message}`);throw e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};Object.keys(this.valueDescriptorMap).forEach((t=>{const r=this.valueDescriptorMap[t];e[r.name]=r}));return e}hasValue(e){const t=this.valueDescriptorNameMap[e];const r=`has${capitalize(t.name)}`;return this.receiver[r]}}class TargetObserver{constructor(e,t){this.context=e;this.delegate=t;this.targetsByName=new Multimap}start(){if(!this.tokenListObserver){this.tokenListObserver=new TokenListObserver(this.element,this.attributeName,this);this.tokenListObserver.start()}}stop(){if(this.tokenListObserver){this.disconnectAllTargets();this.tokenListObserver.stop();delete this.tokenListObserver}}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;if(!this.targetsByName.has(t,e)){this.targetsByName.add(t,e);null===(r=this.tokenListObserver)||void 0===r?void 0:r.pause((()=>this.delegate.targetConnected(e,t)))}}disconnectTarget(e,t){var r;if(this.targetsByName.has(t,e)){this.targetsByName.delete(t,e);null===(r=this.tokenListObserver)||void 0===r?void 0:r.pause((()=>this.delegate.targetDisconnected(e,t)))}}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function readInheritableStaticArrayValues(e,t){const r=getAncestorsForConstructor(e);return Array.from(r.reduce(((e,r)=>{getOwnStaticArrayValues(r,t).forEach((t=>e.add(t)));return e}),new Set))}function readInheritableStaticObjectPairs(e,t){const r=getAncestorsForConstructor(e);return r.reduce(((e,r)=>{e.push(...getOwnStaticObjectPairs(r,t));return e}),[])}function getAncestorsForConstructor(e){const t=[];while(e){t.push(e);e=Object.getPrototypeOf(e)}return t.reverse()}function getOwnStaticArrayValues(e,t){const r=e[t];return Array.isArray(r)?r:[]}function getOwnStaticObjectPairs(e,t){const r=e[t];return r?Object.keys(r).map((e=>[e,r[e]])):[]}class OutletObserver{constructor(e,t){this.started=false;this.context=e;this.delegate=t;this.outletsByName=new Multimap;this.outletElementsByName=new Multimap;this.selectorObserverMap=new Map;this.attributeObserverMap=new Map}start(){if(!this.started){this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e);this.setupAttributeObserverForOutlet(e)}));this.started=true;this.dependentContexts.forEach((e=>e.refresh()))}}refresh(){this.selectorObserverMap.forEach((e=>e.refresh()));this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){if(this.started){this.started=false;this.disconnectAllOutlets();this.stopSelectorObservers();this.stopAttributeObservers()}}stopSelectorObservers(){if(this.selectorObserverMap.size>0){this.selectorObserverMap.forEach((e=>e.stop()));this.selectorObserverMap.clear()}}stopAttributeObservers(){if(this.attributeObserverMap.size>0){this.attributeObserverMap.forEach((e=>e.stop()));this.attributeObserverMap.clear()}}selectorMatched(e,t,{outletName:r}){const s=this.getOutlet(e,r);s&&this.connectOutlet(s,e,r)}selectorUnmatched(e,t,{outletName:r}){const s=this.getOutletFromMap(e,r);s&&this.disconnectOutlet(s,e,r)}selectorMatchElement(e,{outletName:t}){const r=this.selector(t);const s=this.hasOutlet(e,t);const n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!r&&(s&&n&&e.matches(r))}elementMatchedAttribute(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var s;if(!this.outletElementsByName.has(r,t)){this.outletsByName.add(r,e);this.outletElementsByName.add(r,t);null===(s=this.selectorObserverMap.get(r))||void 0===s?void 0:s.pause((()=>this.delegate.outletConnected(e,t,r)))}}disconnectOutlet(e,t,r){var s;if(this.outletElementsByName.has(r,t)){this.outletsByName.delete(r,e);this.outletElementsByName.delete(r,t);null===(s=this.selectorObserverMap.get(r))||void 0===s?void 0:s.pause((()=>this.delegate.outletDisconnected(e,t,r)))}}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e);const r=new SelectorObserver(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r);r.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e);const r=new AttributeObserver(this.scope.element,t,this);this.attributeObserverMap.set(e,r);r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new Multimap;this.router.modules.forEach((t=>{const r=t.definition.controllerConstructor;const s=readInheritableStaticArrayValues(r,"outlets");s.forEach((r=>e.add(r,t.identifier)))}));return e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class Context{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:r,controller:s,element:n}=this;t=Object.assign({identifier:r,controller:s,element:n},t);this.application.logDebugActivity(this.identifier,e,t)};this.module=e;this.scope=t;this.controller=new e.controllerConstructor(this);this.bindingObserver=new BindingObserver(this,this.dispatcher);this.valueObserver=new ValueObserver(this,this.controller);this.targetObserver=new TargetObserver(this,this);this.outletObserver=new OutletObserver(this,this);try{this.controller.initialize();this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start();this.valueObserver.start();this.targetObserver.start();this.outletObserver.start();try{this.controller.connect();this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect();this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop();this.targetObserver.stop();this.valueObserver.stop();this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){const{identifier:s,controller:n,element:i}=this;r=Object.assign({identifier:s,controller:n,element:i},r);this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${namespaceCamelize(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${namespaceCamelize(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const r=this.controller;"function"==typeof r[e]&&r[e](...t)}}function bless(e){return shadow(e,getBlessedProperties(e))}function shadow(e,t){const r=i(e);const s=getShadowProperties(e.prototype,t);Object.defineProperties(r.prototype,s);return r}function getBlessedProperties(e){const t=readInheritableStaticArrayValues(e,"blessings");return t.reduce(((t,r)=>{const s=r(e);for(const e in s){const r=t[e]||{};t[e]=Object.assign(r,s[e])}return t}),{})}function getShadowProperties(e,t){return n(t).reduce(((r,s)=>{const n=getShadowedDescriptor(e,t,s);n&&Object.assign(r,{[s]:n});return r}),{})}function getShadowedDescriptor(e,t,r){const s=Object.getOwnPropertyDescriptor(e,r);const n=s&&"value"in s;if(!n){const e=Object.getOwnPropertyDescriptor(t,r).value;if(s){e.get=s.get||e.get;e.set=s.set||e.set}return e}}const n=(()=>"function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames)();const i=(()=>{function extendWithReflect(e){function extended(){return Reflect.construct(e,arguments,new.target)}extended.prototype=Object.create(e.prototype,{constructor:{value:extended}});Reflect.setPrototypeOf(extended,e);return extended}function testReflectExtension(){const a=function(){this.a.call(this)};const e=extendWithReflect(a);e.prototype.a=function(){};return new e}try{testReflectExtension();return extendWithReflect}catch(e){return e=>class extended extends e{}}})();function blessDefinition(e){return{identifier:e.identifier,controllerConstructor:bless(e.controllerConstructor)}}class Module{constructor(e,t){this.application=e;this.definition=blessDefinition(t);this.contextsByScope=new WeakMap;this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t);t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);if(t){this.connectedContexts.delete(t);t.disconnect()}}fetchContextForScope(e){let t=this.contextsByScope.get(e);if(!t){t=new Context(this,e);this.contextsByScope.set(e,t)}return t}}class ClassMap{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return tokenize(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class DataMap{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const r=this.getAttributeNameForKey(e);this.element.setAttribute(r,t);return this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);this.element.removeAttribute(t);return true}return false}getAttributeNameForKey(e){return`data-${this.identifier}-${dasherize(e)}`}}class Guide{constructor(e){this.warnedKeysByObject=new WeakMap;this.logger=e}warn(e,t,r){let s=this.warnedKeysByObject.get(e);if(!s){s=new Set;this.warnedKeysByObject.set(e,s)}if(!s.has(t)){s.add(t);this.logger.warn(r,e)}}}function attributeValueContainsToken(e,t){return`[${e}~="${t}"]`}class TargetSet{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){const t=this.schema.targetAttributeForScope(this.identifier);return attributeValueContainsToken(t,e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return attributeValueContainsToken(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:r}=this;const s=this.schema.targetAttribute;const n=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${s}="${r}.${t}" with ${n}="${t}". The ${s} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class OutletSet{constructor(e,t){this.scope=e;this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){const r=this.scope.queryElements(e);return r.filter((r=>this.matchesElement(r,e,t)))[0]}findAllElements(e,t){const r=this.scope.queryElements(e);return r.filter((r=>this.matchesElement(r,e,t)))}matchesElement(e,t,r){const s=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&s.split(" ").includes(r)}}class Scope{constructor(e,t,r,s){this.targets=new TargetSet(this);this.classes=new ClassMap(this);this.data=new DataMap(this);this.containsElement=e=>e.closest(this.controllerSelector)===this.element;this.schema=e;this.element=t;this.identifier=r;this.guide=new Guide(s);this.outlets=new OutletSet(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return attributeValueContainsToken(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Scope(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class ScopeObserver{constructor(e,t,r){this.element=e;this.schema=t;this.delegate=r;this.valueListObserver=new ValueListObserver(this.element,this.controllerAttribute,this);this.scopesByIdentifierByElement=new WeakMap;this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){const r=this.fetchScopesByIdentifierForElement(e);let s=r.get(t);if(!s){s=this.delegate.createScopeForElementAndIdentifier(e,t);r.set(t,s)}return s}elementMatchedValue(e,t){const r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r);1==r&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const r=this.scopeReferenceCounts.get(t);if(r){this.scopeReferenceCounts.set(t,r-1);1==r&&this.delegate.scopeDisconnected(t)}}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);if(!t){t=new Map;this.scopesByIdentifierByElement.set(e,t)}return t}}class Router{constructor(e){this.application=e;this.scopeObserver=new ScopeObserver(this.element,this.schema,this);this.scopesByIdentifier=new Multimap;this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new Module(this.application,e);this.connectModule(t);const r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new Scope(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);const t=this.scopesByIdentifier.getValuesForKey(e.identifier);t.forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);const t=this.scopesByIdentifier.getValuesForKey(e.identifier);t.forEach((t=>e.disconnectContextForScope(t)))}}const o={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},objectFromEntries("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),objectFromEntries("0123456789".split("").map((e=>[e,e]))))};function objectFromEntries(e){return e.reduce(((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r})),{})}class Application{constructor(t=document.documentElement,r=o){this.logger=console;this.debug=false;this.logDebugActivity=(e,t,r={})=>{this.debug&&this.logFormattedMessage(e,t,r)};this.element=t;this.schema=r;this.dispatcher=new Dispatcher(this);this.router=new Router(this);this.actionDescriptorFilters=Object.assign({},e)}static start(e,t){const r=new this(e,t);r.start();return r}async start(){await domReady();this.logDebugActivity("application","starting");this.dispatcher.start();this.router.start();this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping");this.dispatcher.stop();this.router.stop();this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){const r=Array.isArray(e)?e:[e,...t];r.forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){const r=Array.isArray(e)?e:[e,...t];r.forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var s;this.logger.error("%s\n\n%o\n\n%o",t,e,r);null===(s=window.onerror)||void 0===s?void 0:s.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r);this.logger.groupCollapsed(`${e} #${t}`);this.logger.log("details:",Object.assign({},r));this.logger.groupEnd()}}function domReady(){return new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()}))}function ClassPropertiesBlessing(e){const t=readInheritableStaticArrayValues(e,"classes");return t.reduce(((e,t)=>Object.assign(e,propertiesForClassDefinition(t))),{})}function propertiesForClassDefinition(e){return{[`${e}Class`]:{get(){const{classes:t}=this;if(t.has(e))return t.get(e);{const r=t.getAttributeName(e);throw new Error(`Missing attribute "${r}"`)}}},[`${e}Classes`]:{get(){return this.classes.getAll(e)}},[`has${capitalize(e)}Class`]:{get(){return this.classes.has(e)}}}}function OutletPropertiesBlessing(e){const t=readInheritableStaticArrayValues(e,"outlets");return t.reduce(((e,t)=>Object.assign(e,propertiesForOutletDefinition(t))),{})}function getOutletController(e,t,r){return e.application.getControllerForElementAndIdentifier(t,r)}function getControllerAndEnsureConnectedScope(e,t,r){let s=getOutletController(e,t,r);if(s)return s;e.application.router.proposeToConnectScopeForElementAndIdentifier(t,r);s=getOutletController(e,t,r);return s||void 0}function propertiesForOutletDefinition(e){const t=namespaceCamelize(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e);const r=this.outlets.getSelectorForOutletName(e);if(t){const r=getControllerAndEnsureConnectedScope(this,t,e);if(r)return r;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const r=getControllerAndEnsureConnectedScope(this,t,e);if(r)return r;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e);const r=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${capitalize(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}function TargetPropertiesBlessing(e){const t=readInheritableStaticArrayValues(e,"targets");return t.reduce(((e,t)=>Object.assign(e,propertiesForTargetDefinition(t))),{})}function propertiesForTargetDefinition(e){return{[`${e}Target`]:{get(){const t=this.targets.find(e);if(t)return t;throw new Error(`Missing target element "${e}" for "${this.identifier}" controller`)}},[`${e}Targets`]:{get(){return this.targets.findAll(e)}},[`has${capitalize(e)}Target`]:{get(){return this.targets.has(e)}}}}function ValuePropertiesBlessing(e){const t=readInheritableStaticObjectPairs(e,"values");const r={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const r=parseValueDefinitionPair(t,this.identifier);const s=this.data.getAttributeNameForKey(r.key);return Object.assign(e,{[s]:r})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,propertiesForValueDefinitionPair(t))),r)}function propertiesForValueDefinitionPair(e,t){const r=parseValueDefinitionPair(e,t);const{key:s,name:n,reader:i,writer:o}=r;return{[n]:{get(){const e=this.data.get(s);return null!==e?i(e):r.defaultValue},set(e){void 0===e?this.data.delete(s):this.data.set(s,o(e))}},[`has${capitalize(n)}`]:{get(){return this.data.has(s)||r.hasCustomDefaultValue}}}}function parseValueDefinitionPair([e,t],r){return valueDescriptorForTokenAndTypeDefinition({controller:r,token:e,typeDefinition:t})}function parseValueTypeConstant(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function parseValueTypeDefault(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}function parseValueTypeObject(e){const{controller:t,token:r,typeObject:s}=e;const n=isSomething(s.type);const i=isSomething(s.default);const o=n&&i;const c=n&&!i;const l=!n&&i;const h=parseValueTypeConstant(s.type);const u=parseValueTypeDefault(e.typeObject.default);if(c)return h;if(l)return u;if(h!==u){const e=t?`${t}.${r}`:r;throw new Error(`The specified default value for the Stimulus Value "${e}" must match the defined type "${h}". The provided default value of "${s.default}" is of type "${u}".`)}return o?h:void 0}function parseValueTypeDefinition(e){const{controller:t,token:r,typeDefinition:s}=e;const n={controller:t,token:r,typeObject:s};const i=parseValueTypeObject(n);const o=parseValueTypeDefault(s);const c=parseValueTypeConstant(s);const l=i||o||c;if(l)return l;const h=t?`${t}.${s}`:r;throw new Error(`Unknown value type "${h}" for "${r}" value`)}function defaultValueForDefinition(e){const t=parseValueTypeConstant(e);if(t)return c[t];const r=hasProperty(e,"default");const s=hasProperty(e,"type");const n=e;if(r)return n.default;if(s){const{type:e}=n;const t=parseValueTypeConstant(e);if(t)return c[t]}return e}function valueDescriptorForTokenAndTypeDefinition(e){const{token:t,typeDefinition:r}=e;const s=`${dasherize(t)}-value`;const n=parseValueTypeDefinition(e);return{type:n,key:s,name:camelize(s),get defaultValue(){return defaultValueForDefinition(r)},get hasCustomDefaultValue(){return void 0!==parseValueTypeDefault(r)},reader:l[n],writer:h[n]||h.default}}const c={get array(){return[]},boolean:false,number:0,get object(){return{}},string:""};const l={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${parseValueTypeDefault(t)}"`);return t},boolean(e){return!("0"==e||"false"==String(e).toLowerCase())},number(e){return Number(e.replace(/_/g,""))},object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${parseValueTypeDefault(t)}"`);return t},string(e){return e}};const h={default:writeString,array:writeJSON,object:writeJSON};function writeJSON(e){return JSON.stringify(e)}function writeString(e){return`${e}`}class Controller{constructor(e){this.context=e}static get shouldLoad(){return true}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:s=this.identifier,bubbles:n=true,cancelable:i=true}={}){const o=s?`${s}:${e}`:e;const c=new CustomEvent(o,{detail:r,bubbles:n,cancelable:i});t.dispatchEvent(c);return c}}Controller.blessings=[ClassPropertiesBlessing,TargetPropertiesBlessing,ValuePropertiesBlessing,OutletPropertiesBlessing];Controller.targets=[];Controller.outlets=[];Controller.values={};export{Application,AttributeObserver,Context,Controller,ElementObserver,IndexedMultimap,Multimap,SelectorObserver,StringMapObserver,TokenListObserver,ValueListObserver,add,o as defaultSchema,del,fetch,prune}; + diff --git a/vendor/javascript/@kurkle--color.js b/vendor/javascript/@kurkle--color.js new file mode 100644 index 0000000..fd2b108 --- /dev/null +++ b/vendor/javascript/@kurkle--color.js @@ -0,0 +1,4 @@ +// @kurkle/color@0.3.2 downloaded from https://ga.jspm.io/npm:@kurkle/color@0.3.2/dist/color.esm.js + +function round(n){return n+.5|0}const lim=(n,e,t)=>Math.max(Math.min(n,t),e);function p2b(n){return lim(round(2.55*n),0,255)}function b2p(n){return lim(round(n/2.55),0,100)}function n2b(n){return lim(round(255*n),0,255)}function b2n(n){return lim(round(n/2.55)/100,0,1)}function n2p(n){return lim(round(100*n),0,100)}const n={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};const e=[..."0123456789ABCDEF"];const h1=n=>e[15&n];const h2=n=>e[(240&n)>>4]+e[15&n];const eq=n=>(240&n)>>4===(15&n);const isShort=n=>eq(n.r)&&eq(n.g)&&eq(n.b)&&eq(n.a);function hexParse(e){var t=e.length;var r;"#"===e[0]&&(4===t||5===t?r={r:255&17*n[e[1]],g:255&17*n[e[2]],b:255&17*n[e[3]],a:5===t?17*n[e[4]]:255}:7!==t&&9!==t||(r={r:n[e[1]]<<4|n[e[2]],g:n[e[3]]<<4|n[e[4]],b:n[e[5]]<<4|n[e[6]],a:9===t?n[e[7]]<<4|n[e[8]]:255}));return r}const alpha=(n,e)=>n<255?e(n):"";function hexString(n){var e=isShort(n)?h1:h2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+alpha(n.a,e):void 0}const t=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(n,e,t){const r=e*Math.min(t,1-t);const f=(e,a=(e+n/30)%12)=>t-r*Math.max(Math.min(a-3,9-a,1),-1);return[f(0),f(8),f(4)]}function hsv2rgbn(n,e,t){const f=(r,a=(r+n/60)%6)=>t-t*e*Math.max(Math.min(a,4-a,1),0);return[f(5),f(3),f(1)]}function hwb2rgbn(n,e,t){const r=hsl2rgbn(n,1,.5);let a;if(e+t>1){a=1/(e+t);e*=a;t*=a}for(a=0;a<3;a++){r[a]*=1-e-t;r[a]+=e}return r}function hueValue(n,e,t,r,a){return n===a?(e-t)/r+(e.5?g/(2-s-b):g/(s+b);o=hueValue(t,r,a,g,s);o=60*o+.5}return[0|o,i||0,c]}function calln(n,e,t,r){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,r)).map(n2b)}function hsl2rgb(n,e,t){return calln(hsl2rgbn,n,e,t)}function hwb2rgb(n,e,t){return calln(hwb2rgbn,n,e,t)}function hsv2rgb(n,e,t){return calln(hsv2rgbn,n,e,t)}function hue(n){return(n%360+360)%360}function hueParse(n){const e=t.exec(n);let r=255;let a;if(!e)return;e[5]!==a&&(r=e[6]?p2b(+e[5]):n2b(+e[5]));const s=hue(+e[2]);const b=+e[3]/100;const c=+e[4]/100;a="hwb"===e[1]?hwb2rgb(s,b,c):"hsv"===e[1]?hsv2rgb(s,b,c):hsl2rgb(s,b,c);return{r:a[0],g:a[1],b:a[2],a:r}}function rotate(n,e){var t=rgb2hsl(n);t[0]=hue(t[0]+e);t=hsl2rgb(t);n.r=t[0];n.g=t[1];n.b=t[2]}function hslString(n){if(!n)return;const e=rgb2hsl(n);const t=e[0];const r=n2p(e[1]);const a=n2p(e[2]);return n.a<255?`hsla(${t}, ${r}%, ${a}%, ${b2n(n.a)})`:`hsl(${t}, ${r}%, ${a}%)`}const r={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"};const a={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function unpack(){const n={};const e=Object.keys(a);const t=Object.keys(r);let s,b,c,o,i;for(s=0;s>16&255,c>>8&255,255&c]}return n}let s;function nameParse(n){if(!s){s=unpack();s.transparent=[0,0,0,0]}const e=s[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const b=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(n){const e=b.exec(n);let t=255;let r,a,s;if(e){if(e[7]!==r){const n=+e[7];t=e[8]?p2b(n):lim(255*n,0,255)}r=+e[1];a=+e[3];s=+e[5];r=255&(e[2]?p2b(r):lim(r,0,255));a=255&(e[4]?p2b(a):lim(a,0,255));s=255&(e[6]?p2b(s):lim(s,0,255));return{r:r,g:a,b:s,a:t}}}function rgbString(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${b2n(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const to=n=>n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055;const from=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function interpolate(n,e,t){const r=from(b2n(n.r));const a=from(b2n(n.g));const s=from(b2n(n.b));return{r:n2b(to(r+t*(from(b2n(e.r))-r))),g:n2b(to(a+t*(from(b2n(e.g))-a))),b:n2b(to(s+t*(from(b2n(e.b))-s))),a:n.a+t*(e.a-n.a)}}function modHSL(n,e,t){if(n){let r=rgb2hsl(n);r[e]=Math.max(0,Math.min(r[e]+r[e]*t,0===e?360:1));r=hsl2rgb(r);n.r=r[0];n.g=r[1];n.b=r[2]}}function clone(n,e){return n?Object.assign(e||{},n):n}function fromObject(n){var e={r:0,g:0,b:0,a:255};if(Array.isArray(n)){if(n.length>=3){e={r:n[0],g:n[1],b:n[2],a:255};n.length>3&&(e.a=n2b(n[3]))}}else{e=clone(n,{r:0,g:0,b:0,a:1});e.a=n2b(e.a)}return e}function functionParse(n){return"r"===n.charAt(0)?rgbParse(n):hueParse(n)}class Color{constructor(n){if(n instanceof Color)return n;const e=typeof n;let t;"object"===e?t=fromObject(n):"string"===e&&(t=hexParse(n)||nameParse(n)||functionParse(n));this._rgb=t;this._valid=!!t}get valid(){return this._valid}get rgb(){var n=clone(this._rgb);n&&(n.a=b2n(n.a));return n}set rgb(n){this._rgb=fromObject(n)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(n,e){if(n){const t=this.rgb;const r=n.rgb;let a;const s=e===a?.5:e;const b=2*s-1;const c=t.a-r.a;const o=((b*c===-1?b:(b+c)/(1+b*c))+1)/2;a=1-o;t.r=255&o*t.r+a*r.r+.5;t.g=255&o*t.g+a*r.g+.5;t.b=255&o*t.b+a*r.b+.5;t.a=s*t.a+(1-s)*r.a;this.rgb=t}return this}interpolate(n,e){n&&(this._rgb=interpolate(this._rgb,n._rgb,e));return this}clone(){return new Color(this.rgb)}alpha(n){this._rgb.a=n2b(n);return this}clearer(n){const e=this._rgb;e.a*=1-n;return this}greyscale(){const n=this._rgb;const e=round(.3*n.r+.59*n.g+.11*n.b);n.r=n.g=n.b=e;return this}opaquer(n){const e=this._rgb;e.a*=1+n;return this}negate(){const n=this._rgb;n.r=255-n.r;n.g=255-n.g;n.b=255-n.b;return this}lighten(n){modHSL(this._rgb,2,n);return this}darken(n){modHSL(this._rgb,2,-n);return this}saturate(n){modHSL(this._rgb,1,n);return this}desaturate(n){modHSL(this._rgb,1,-n);return this}rotate(n){rotate(this._rgb,n);return this}}function index_esm(n){return new Color(n)}export{Color,b2n,b2p,index_esm as default,hexParse,hexString,hsl2rgb,hslString,hsv2rgb,hueParse,hwb2rgb,lim,n2b,n2p,nameParse,p2b,rgb2hsl,rgbParse,rgbString,rotate,round}; + diff --git a/vendor/javascript/@motionone--animation.js b/vendor/javascript/@motionone--animation.js new file mode 100644 index 0000000..4bd15e9 --- /dev/null +++ b/vendor/javascript/@motionone--animation.js @@ -0,0 +1,4 @@ +// @motionone/animation@10.18.0 downloaded from https://ga.jspm.io/npm:@motionone/animation@10.18.0/dist/index.es.js + +import{isFunction as t,isCubicBezier as i,noopReturn as e,defaults as s,isEasingGenerator as a,isEasingList as n,interpolate as r}from"@motionone/utils";import{cubicBezier as o,steps as h}from"@motionone/easing";const l={ease:o(.25,.1,.25,1),"ease-in":o(.42,0,1,1),"ease-in-out":o(.42,0,.58,1),"ease-out":o(0,0,.58,1)};const u=/\((.*?)\)/;function getEasingFunction(s){if(t(s))return s;if(i(s))return o(...s);const a=l[s];if(a)return a;if(s.startsWith("steps")){const t=u.exec(s);if(t){const i=t[1].split(",");return h(parseFloat(i[0]),i[1].trim())}}return e}class Animation{constructor(t,i=[0,1],{easing:o,duration:h=s.duration,delay:l=s.delay,endDelay:u=s.endDelay,repeat:m=s.repeat,offset:c,direction:p="normal",autoplay:d=true}={}){this.startTime=null;this.rate=1;this.t=0;this.cancelTimestamp=null;this.easing=e;this.duration=0;this.totalDuration=0;this.repeat=0;this.playState="idle";this.finished=new Promise(((t,i)=>{this.resolve=t;this.reject=i}));o=o||s.easing;if(a(o)){const t=o.createAnimation(i);o=t.easing;i=t.keyframes||i;h=t.duration||h}this.repeat=m;this.easing=n(o)?e:getEasingFunction(o);this.updateDuration(h);const f=r(i,c,n(o)?o.map(getEasingFunction):e);this.tick=i=>{var e;l;let s=0;s=this.pauseTime!==void 0?this.pauseTime:(i-this.startTime)*this.rate;this.t=s;s/=1e3;s=Math.max(s-l,0);this.playState==="finished"&&this.pauseTime===void 0&&(s=this.totalDuration);const a=s/this.duration;let n=Math.floor(a);let r=a%1;!r&&a>=1&&(r=1);r===1&&n--;const o=n%2;(p==="reverse"||p==="alternate"&&o||p==="alternate-reverse"&&!o)&&(r=1-r);const h=s>=this.totalDuration?1:Math.min(r,1);const m=f(this.easing(h));t(m);const c=this.pauseTime===void 0&&(this.playState==="finished"||s>=this.totalDuration+u);if(c){this.playState="finished";(e=this.resolve)===null||e===void 0?void 0:e.call(this,m)}else this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))};d&&this.play()}play(){const t=performance.now();this.playState="running";this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t);this.cancelTimestamp=this.startTime;this.pauseTime=void 0;this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused";this.pauseTime=this.t}finish(){this.playState="finished";this.tick(0)}stop(){var t;this.playState="idle";this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId);(t=this.reject)===null||t===void 0?void 0:t.call(this,false)}cancel(){this.stop();this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t;this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}export{Animation,getEasingFunction}; + diff --git a/vendor/javascript/@motionone--dom.js b/vendor/javascript/@motionone--dom.js new file mode 100644 index 0000000..3f3b420 --- /dev/null +++ b/vendor/javascript/@motionone--dom.js @@ -0,0 +1,4 @@ +// @motionone/dom@10.18.0 downloaded from https://ga.jspm.io/npm:@motionone/dom@10.18.0/dist/index.es.js + +import{getEasingFunction as e,Animation as t}from"@motionone/animation";import{invariant as n}from"hey-listen";import{MotionValue as o}from"@motionone/types";import{noopReturn as i,addUniqueItem as s,progress as r,isFunction as a,defaults as c,isCubicBezier as l,isString as f,isEasingGenerator as u,isEasingList as d,isNumber as g,time as m,noop as h,removeItem as p,mix as v,getEasingForSegment as y,defaultOffset as w,fillOffset as E,velocityPerSecond as b,interpolate as A}from"@motionone/utils";import{__rest as S}from"tslib";import{pregenerateKeyframes as O,calcGeneratorVelocity as x,spring as z,glide as V}from"@motionone/generators";const W=new WeakMap;function getAnimationData(e){W.has(e)||W.set(e,{transforms:[],values:new Map});return W.get(e)}function getMotionValue(e,t){e.has(t)||e.set(t,new o);return e.get(t)}const L=["","X","Y","Z"];const T=["translate","scale","rotate","skew"];const M={x:"translateX",y:"translateY",z:"translateZ"};const D={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"};const B={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:D,scale:{syntax:"",initialValue:1,toDefaultUnit:i},skew:D};const k=new Map;const asTransformCssVar=e=>`--motion-${e}`;const N=["x","y","z"];T.forEach((e=>{L.forEach((t=>{N.push(e+t);k.set(asTransformCssVar(e+t),B[e])}))}));const compareTransformOrder=(e,t)=>N.indexOf(e)-N.indexOf(t);const $=new Set(N);const isTransform=e=>$.has(e);const addTransformToElement=(e,t)=>{M[t]&&(t=M[t]);const{transforms:n}=getAnimationData(e);s(n,t);e.style.transform=buildTransformTemplate(n)};const buildTransformTemplate=e=>e.sort(compareTransformOrder).reduce(transformListToString,"").trim();const transformListToString=(e,t)=>`${e} ${t}(var(${asTransformCssVar(t)}))`;const isCssVar=e=>e.startsWith("--");const C=new Set;function registerCssVariable(e){if(!C.has(e)){C.add(e);try{const{syntax:t,initialValue:n}=k.has(e)?k.get(e):{};CSS.registerProperty({name:e,inherits:false,syntax:t,initialValue:n})}catch(e){}}}const testAnimation=(e,t)=>document.createElement("div").animate(e,t);const j={cssRegisterProperty:()=>typeof CSS!=="undefined"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{testAnimation({opacity:[1]})}catch(e){return false}return true},finished:()=>Boolean(testAnimation({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{testAnimation({opacity:0},{easing:"linear(0, 1)"})}catch(e){return false}return true}};const P={};const R={};for(const e in j)R[e]=()=>{P[e]===void 0&&(P[e]=j[e]());return P[e]};const H=.015;const generateLinearEasingPoints=(e,t)=>{let n="";const o=Math.round(t/H);for(let t=0;ta(e)?R.linearEasing()?`linear(${generateLinearEasingPoints(e,t)})`:c.easing:l(e)?cubicBezierAsString(e):e;const cubicBezierAsString=([e,t,n,o])=>`cubic-bezier(${e}, ${t}, ${n}, ${o})`;function hydrateKeyframes(e,t){for(let n=0;nArray.isArray(e)?e:[e];function getStyleName(e){M[e]&&(e=M[e]);return isTransform(e)?asTransformCssVar(e):e}const I={get:(e,t)=>{t=getStyleName(t);let n=isCssVar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!==0){const e=k.get(t);e&&(n=e.initialValue)}return n},set:(e,t,n)=>{t=getStyleName(t);isCssVar(t)?e.style.setProperty(t,n):e.style[t]=n}};function stopAnimation(e,t=true){if(e&&e.playState!=="finished")try{if(e.stop)e.stop();else{t&&e.commitStyles();e.cancel()}}catch(e){}}function getUnitConverter(e,t){var n;let o=(t===null||t===void 0?void 0:t.toDefaultUnit)||i;const s=e[e.length-1];if(f(s)){const e=((n=s.match(/(-?[\d.]+)([a-z%]*)/))===null||n===void 0?void 0:n[2])||"";e&&(o=t=>t+e)}return o}function getDevToolsRecord(){return window.__MOTION_DEV_TOOLS_RECORD}function animateStyle(e,t,n,o={},i){const s=getDevToolsRecord();const r=o.record!==false&&s;let l;let{duration:f=c.duration,delay:p=c.delay,endDelay:v=c.endDelay,repeat:y=c.repeat,easing:w=c.easing,persist:E=false,direction:b,offset:A,allowWebkitAcceleration:S=false,autoplay:O=true}=o;const x=getAnimationData(e);const z=isTransform(t);let V=R.waapi();z&&addTransformToElement(e,t);const W=getStyleName(t);const L=getMotionValue(x.values,W);const T=k.get(W);stopAnimation(L.animation,!(u(w)&&L.generator)&&o.record!==false);return()=>{const readInitialValue=()=>{var t,n;return(n=(t=I.get(e,W))!==null&&t!==void 0?t:T===null||T===void 0?void 0:T.initialValue)!==null&&n!==void 0?n:0};let c=hydrateKeyframes(keyframesList(n),readInitialValue);const x=getUnitConverter(c,T);if(u(w)){const e=w.createAnimation(c,t!=="opacity",readInitialValue,W,L);w=e.easing;c=e.keyframes||c;f=e.duration||f}isCssVar(W)&&(R.cssRegisterProperty()?registerCssVariable(W):V=false);z&&!R.linearEasing()&&(a(w)||d(w)&&w.some(a))&&(V=false);if(V){T&&(c=c.map((e=>g(e)?T.toDefaultUnit(e):e)));c.length!==1||R.partialKeyframes()&&!r||c.unshift(readInitialValue());const t={delay:m.ms(p),duration:m.ms(f),endDelay:m.ms(v),easing:d(w)?void 0:convertEasing(w,f),direction:b,iterations:y+1,fill:"both"};l=e.animate({[W]:c,offset:A,easing:d(w)?w.map((e=>convertEasing(e,f))):void 0},t);l.finished||(l.finished=new Promise(((e,t)=>{l.onfinish=e;l.oncancel=t})));const n=c[c.length-1];l.finished.then((()=>{if(!E){I.set(e,W,n);l.cancel()}})).catch(h);S||(l.playbackRate=1.000001)}else if(i&&z){c=c.map((e=>typeof e==="string"?parseFloat(e):e));c.length===1&&c.unshift(parseFloat(readInitialValue()));l=new i((t=>{I.set(e,W,x?x(t):t)}),c,Object.assign(Object.assign({},o),{duration:f,easing:w}))}else{const t=c[c.length-1];I.set(e,W,T&&g(t)?T.toDefaultUnit(t):t)}r&&s(e,t,c,{duration:f,delay:p,easing:w,repeat:y,offset:A},"motion-one");L.setAnimation(l);l&&!O&&l.pause();return l}}const getOptions=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function resolveElements(e,t){var n;if(typeof e==="string")if(t){(n=t[e])!==null&&n!==void 0?n:t[e]=document.querySelectorAll(e);e=t[e]}else e=document.querySelectorAll(e);else e instanceof Element&&(e=[e]);return Array.from(e||[])}const createAnimation=e=>e();const withControls=(e,t,n=c.duration)=>new Proxy({animations:e.map(createAnimation).filter(Boolean),duration:n,options:t},U);const getActiveAnimation=e=>e.animations[0];const U={get:(e,t)=>{const n=getActiveAnimation(e);switch(t){case"duration":return e.duration;case"currentTime":return m.s((n===null||n===void 0?void 0:n[t])||0);case"playbackRate":case"playState":return n===null||n===void 0?void 0:n[t];case"finished":e.finished||(e.finished=Promise.all(e.animations.map(selectFinished)).catch(h));return e.finished;case"stop":return()=>{e.animations.forEach((e=>stopAnimation(e)))};case"forEachNative":return t=>{e.animations.forEach((n=>t(n,e)))};default:return typeof(n===null||n===void 0?void 0:n[t])==="undefined"?void 0:()=>e.animations.forEach((e=>e[t]()))}},set:(e,t,n)=>{switch(t){case"currentTime":n=m.ms(n);case"playbackRate":for(let o=0;oe.finished;function stagger(t=.1,{start:n=0,from:o=0,easing:i}={}){return(s,r)=>{const a=g(o)?o:getFromIndex(o,r);const c=Math.abs(a-s);let l=t*c;if(i){const n=r*t;const o=e(i);l=o(l/n)*n}return n+l}}function getFromIndex(e,t){if(e==="first")return 0;{const n=t-1;return e==="last"?n:n/2}}function resolveOption(e,t,n){return a(e)?e(t,n):e}function createAnimate(e){return function animate(t,o,i={}){t=resolveElements(t);const s=t.length;n(Boolean(s),"No valid element provided.");n(Boolean(o),"No keyframes defined.");const r=[];for(let n=0;nt&&i.atanimateStyle(...e,t))).filter(Boolean);return withControls(s,n,(o=i[0])===null||o===void 0?void 0:o[3].duration)}function createAnimationsFromTimeline(e,t={}){var{defaultOptions:o={}}=t,i=S(t,["defaultOptions"]);const s=[];const a=new Map;const l={};const d=new Map;let g=0;let m=0;let h=0;for(let t=0;t1,"spring must be provided 2 keyframes within timeline()");const e=d.createAnimation(a,t!=="opacity",(()=>0),t);d=e.easing;a=e.keyframes||a;f=e.duration||f}const g=resolveOption(p.delay,e,b)||0;const y=m+g;const A=y+f;let{offset:S=w(a.length)}=l;S.length===1&&S[0]===0&&(S[1]=1);const O=S.length-a.length;O>0&&E(S,O);a.length===1&&a.unshift(null);addKeyframes(s,a,d,S,y,A);v=Math.max(g+f,v);h=Math.max(A,h)}}g=m;m+=v}a.forEach(((e,t)=>{for(const n in e){const a=e[n];a.sort(compareByTime);const l=[];const f=[];const u=[];for(let e=0;e{const o=new Map;const getGenerator=(t=0,i=100,s=0,r=false)=>{const a=`${t}-${i}-${s}-${r}`;o.has(a)||o.set(a,e(Object.assign({from:t,to:i,velocity:s},n)));return o.get(a)};const getKeyframes=(e,n)=>{t.has(e)||t.set(e,O(e,n));return t.get(e)};return{createAnimation:(e,t=true,n,o,s)=>{let r;let a;let c;let l=0;let f=i;const u=e.length;if(t){f=getUnitConverter(e,o?k.get(getStyleName(o)):void 0);const t=e[u-1];c=getAsNumber(t);if(u>1&&e[0]!==null)a=getAsNumber(e[0]);else{const e=s===null||s===void 0?void 0:s.generator;if(e){const{animation:t,generatorStartTime:n}=s;const o=(t===null||t===void 0?void 0:t.startTime)||n||0;const i=(t===null||t===void 0?void 0:t.currentTime)||performance.now()-o;const r=e(i).current;a=r;l=x((t=>e(t).current),i,r)}else n&&(a=getAsNumber(n()))}}if(canGenerate(a)&&canGenerate(c)){const e=getGenerator(a,c,l,o===null||o===void 0?void 0:o.includes("scale"));r=Object.assign(Object.assign({},getKeyframes(e,f)),{easing:"linear"});if(s){s.generator=e;s.generatorStartTime=performance.now()}}if(!r){const e=getKeyframes(getGenerator(0,100));r={easing:"ease",duration:e.overshootDuration}}return r}}}}const G=createGeneratorEasing(z);const q=createGeneratorEasing(V);const K={any:0,all:1};function inView$1(e,t,{root:n,margin:o,amount:i="any"}={}){if(typeof IntersectionObserver==="undefined")return()=>{};const s=resolveElements(e);const r=new WeakMap;const onIntersectionChange=e=>{e.forEach((e=>{const n=r.get(e.target);if(e.isIntersecting!==Boolean(n))if(e.isIntersecting){const n=t(e);a(n)?r.set(e.target,n):c.unobserve(e.target)}else if(n){n(e);r.delete(e.target)}}))};const c=new IntersectionObserver(onIntersectionChange,{root:n,rootMargin:o,threshold:typeof i==="number"?i:K[i]});s.forEach((e=>c.observe(e)));return()=>c.disconnect()}const _=new WeakMap;let Z;function getElementSize(e,t){if(t){const{inlineSize:e,blockSize:n}=t[0];return{width:e,height:n}}return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}function notifyTarget({target:e,contentRect:t,borderBoxSize:n}){var o;(o=_.get(e))===null||o===void 0?void 0:o.forEach((o=>{o({target:e,contentSize:t,get size(){return getElementSize(e,n)}})}))}function notifyAll(e){e.forEach(notifyTarget)}function createResizeObserver(){typeof ResizeObserver!=="undefined"&&(Z=new ResizeObserver(notifyAll))}function resizeElement(e,t){Z||createResizeObserver();const n=resolveElements(e);n.forEach((e=>{let n=_.get(e);if(!n){n=new Set;_.set(e,n)}n.add(t);Z===null||Z===void 0?void 0:Z.observe(e)}));return()=>{n.forEach((e=>{const n=_.get(e);n===null||n===void 0?void 0:n.delete(t);(n===null||n===void 0?void 0:n.size)||(Z===null||Z===void 0?void 0:Z.unobserve(e))}))}}const X=new Set;let Y;function createWindowResizeHandler(){Y=()=>{const e={width:window.innerWidth,height:window.innerHeight};const t={target:window,size:e,contentSize:e};X.forEach((e=>e(t)))};window.addEventListener("resize",Y)}function resizeWindow(e){X.add(e);Y||createWindowResizeHandler();return()=>{X.delete(e);!X.size&&Y&&(Y=void 0)}}function resize(e,t){return a(e)?resizeWindow(e):resizeElement(e,t)}const J=50;const createAxisInfo=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0});const createScrollInfo=()=>({time:0,x:createAxisInfo(),y:createAxisInfo()});const Q={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function updateAxisInfo(e,t,n,o){const i=n[t];const{length:s,position:a}=Q[t];const c=i.current;const l=n.time;i.current=e[`scroll${a}`];i.scrollLength=e[`scroll${s}`]-e[`client${s}`];i.offset.length=0;i.offset[0]=0;i.offset[1]=i.scrollLength;i.progress=r(0,i.scrollLength,i.current);const f=o-l;i.velocity=f>J?0:b(i.current-c,f)}function updateScrollInfo(e,t,n){updateAxisInfo(e,"x",t,n);updateAxisInfo(e,"y",t,n);t.time=n}function calcInset(e,t){let n={x:0,y:0};let o=e;while(o&&o!==t)if(o instanceof HTMLElement){n.x+=o.offsetLeft;n.y+=o.offsetTop;o=o.offsetParent}else if(o instanceof SVGGraphicsElement&&"getBBox"in o){const{top:e,left:t}=o.getBBox();n.x+=t;n.y+=e;while(o&&o.tagName!=="svg")o=o.parentNode}return n}const ee={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]};const te={start:0,center:.5,end:1};function resolveEdge(e,t,n=0){let o=0;te[e]!==void 0&&(e=te[e]);if(f(e)){const t=parseFloat(e);e.endsWith("px")?o=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?o=t/100*document.documentElement.clientWidth:e.endsWith("vh")?o=t/100*document.documentElement.clientHeight:e=t}g(e)&&(o=t*e);return n+o}const ne=[0,0];function resolveOffset(e,t,n,o){let i=Array.isArray(e)?e:ne;let s=0;let r=0;if(g(e))i=[e,e];else if(f(e)){e=e.trim();i=e.includes(" ")?e.split(" "):[e,te[e]?e:"0"]}s=resolveEdge(i[0],n,o);r=resolveEdge(i[1],t);return s-r}const oe={x:0,y:0};function resolveOffsets(e,t,n){let{offset:o=ee.All}=n;const{target:i=e,axis:s="y"}=n;const r=s==="y"?"height":"width";const a=i!==e?calcInset(i,e):oe;const c=i===e?{width:e.scrollWidth,height:e.scrollHeight}:{width:i.clientWidth,height:i.clientHeight};const l={width:e.clientWidth,height:e.clientHeight};t[s].offset.length=0;let f=!t[s].interpolate;const u=o.length;for(let e=0;emeasure(e,o.target,n),update:t=>{updateScrollInfo(e,n,t);(o.offset||o.target)&&resolveOffsets(e,n,o)},notify:a(t)?()=>t(n):scrubAnimation(t,n[i])}}function scrubAnimation(e,t){e.pause();e.forEachNative(((e,{easing:t})=>{var n,o;if(e.updateDuration){t||(e.easing=i);e.updateDuration(1)}else{const i={duration:1e3};t||(i.easing="linear");(o=(n=e.effect)===null||n===void 0?void 0:n.updateTiming)===null||o===void 0?void 0:o.call(n,i)}}));return()=>{e.currentTime=t.progress}}const ie=new WeakMap;const se=new WeakMap;const re=new WeakMap;const getEventTarget=e=>e===document.documentElement?window:e;function scroll(e,t={}){var{container:n=document.documentElement}=t,o=S(t,["container"]);let i=re.get(n);if(!i){i=new Set;re.set(n,i)}const s=createScrollInfo();const r=createOnScrollHandler(n,e,s,o);i.add(r);if(!ie.has(n)){const listener=()=>{const e=performance.now();for(const e of i)e.measure();for(const t of i)t.update(e);for(const e of i)e.notify()};ie.set(n,listener);const e=getEventTarget(n);window.addEventListener("resize",listener,{passive:true});n!==document.documentElement&&se.set(n,resize(n,listener));e.addEventListener("scroll",listener,{passive:true})}const a=ie.get(n);const c=requestAnimationFrame(a);return()=>{var t;typeof e!=="function"&&e.stop();cancelAnimationFrame(c);const o=re.get(n);if(!o)return;o.delete(r);if(o.size)return;const i=ie.get(n);ie.delete(n);if(i){getEventTarget(n).removeEventListener("scroll",i);(t=se.get(n))===null||t===void 0?void 0:t();window.removeEventListener("resize",i)}}}function hasChanged(e,t){return typeof e!==typeof t||(Array.isArray(e)&&Array.isArray(t)?!shallowCompare(e,t):e!==t)}function shallowCompare(e,t){const n=t.length;if(n!==e.length)return false;for(let o=0;oe.getDepth()-t.getDepth();const fireAnimateUpdates=e=>e.animateUpdates();const fireNext=e=>e.next();const motionEvent=(e,t)=>new CustomEvent(e,{detail:{target:t}});function dispatchPointerEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:n}}))}function dispatchViewEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:n}}))}const ce={isActive:e=>Boolean(e.inView),subscribe:(e,{enable:t,disable:n},{inViewOptions:o={}})=>{const{once:i}=o,s=S(o,["once"]);return inView$1(e,(o=>{t();dispatchViewEvent(e,"viewenter",o);if(!i)return t=>{n();dispatchViewEvent(e,"viewleave",t)}}),s)}};const mouseEvent=(e,t,n)=>o=>{if(!o.pointerType||o.pointerType==="mouse"){n();dispatchPointerEvent(e,t,o)}};const le={isActive:e=>Boolean(e.hover),subscribe:(e,{enable:t,disable:n})=>{const o=mouseEvent(e,"hoverstart",t);const i=mouseEvent(e,"hoverend",n);e.addEventListener("pointerenter",o);e.addEventListener("pointerleave",i);return()=>{e.removeEventListener("pointerenter",o);e.removeEventListener("pointerleave",i)}}};const fe={isActive:e=>Boolean(e.press),subscribe:(e,{enable:t,disable:n})=>{const onPointerUp=t=>{n();dispatchPointerEvent(e,"pressend",t);window.removeEventListener("pointerup",onPointerUp)};const onPointerDown=n=>{t();dispatchPointerEvent(e,"pressstart",n);window.addEventListener("pointerup",onPointerUp)};e.addEventListener("pointerdown",onPointerDown);return()=>{e.removeEventListener("pointerdown",onPointerDown);window.removeEventListener("pointerup",onPointerUp)}}};const ue={inView:ce,hover:le,press:fe};const de=["initial","animate",...Object.keys(ue),"exit"];const ge=new WeakMap;function createMotionState(e={},o){let i;let s=o?o.getDepth()+1:0;const r={initial:true,animate:true};const a={};const c={};for(const t of de)c[t]=typeof e[t]==="string"?e[t]:o===null||o===void 0?void 0:o.getContext()[t];const l=e.initial===false?"animate":"initial";let f=resolveVariant(e[l]||c[l],e.variants)||{},u=S(f,["transition"]);const d=Object.assign({},u);function*animateUpdates(){var n,o;const s=u;u={};const a={};for(const t of de){if(!r[t])continue;const i=resolveVariant(e[t]);if(i)for(const t in i)if(t!=="transition"){u[t]=i[t];a[t]=getOptions((o=(n=i.transition)!==null&&n!==void 0?n:e.transition)!==null&&o!==void 0?o:{},t)}}const c=new Set([...Object.keys(u),...Object.keys(s)]);const l=[];c.forEach((e=>{var n;u[e]===void 0&&(u[e]=d[e]);if(hasChanged(s[e],u[e])){(n=d[e])!==null&&n!==void 0?n:d[e]=I.get(i,e);l.push(animateStyle(i,e,u[e],a[e],t))}}));yield;const f=l.map((e=>e())).filter(Boolean);if(!f.length)return;const g=u;i.dispatchEvent(motionEvent("motionstart",g));Promise.all(f.map((e=>e.finished))).then((()=>{i.dispatchEvent(motionEvent("motioncomplete",g))})).catch(h)}const setGesture=(e,t)=>()=>{r[e]=t;scheduleAnimation(g)};const updateGestureSubscriptions=()=>{for(const t in ue){const n=ue[t].isActive(e);const o=a[t];if(n&&!o)a[t]=ue[t].subscribe(i,{enable:setGesture(t,true),disable:setGesture(t,false)},e);else if(!n&&o){o();delete a[t]}}};const g={update:t=>{if(i){e=t;updateGestureSubscriptions();scheduleAnimation(g)}},setActive:(e,t)=>{if(i){r[e]=t;scheduleAnimation(g)}},animateUpdates:animateUpdates,getDepth:()=>s,getTarget:()=>u,getOptions:()=>e,getContext:()=>c,mount:e=>{n(Boolean(e),"Animation state must be mounted with valid Element");i=e;ge.set(i,g);updateGestureSubscriptions();return()=>{ge.delete(i);unscheduleAnimation(g);for(const e in a)a[e]()}},isMounted:()=>Boolean(i)};return g}function createStyles(e){const t={};const n=[];for(let o in e){const i=e[o];if(isTransform(o)){M[o]&&(o=M[o]);n.push(o);o=asTransformCssVar(o)}let s=Array.isArray(i)?i[0]:i;const r=k.get(o);r&&(s=g(i)?r.toDefaultUnit(i):i);t[o]=s}n.length&&(t.transform=buildTransformTemplate(n));return t}const camelLetterToPipeLetter=e=>`-${e.toLowerCase()}`;const camelToPipeCase=e=>e.replace(/[A-Z]/g,camelLetterToPipeLetter);function createStyleString(e={}){const t=createStyles(e);let n="";for(const e in t){n+=e.startsWith("--")?e:camelToPipeCase(e);n+=`: ${t[e]}; `}return n}export{ee as ScrollOffset,F as animate,animateStyle,createAnimate,createMotionState,createStyleString,createStyles,getAnimationData,getStyleName,q as glide,inView$1 as inView,ge as mountedStates,resize,scroll,G as spring,stagger,I as style,timeline,withControls}; + diff --git a/vendor/javascript/@motionone--easing.js b/vendor/javascript/@motionone--easing.js new file mode 100644 index 0000000..600ba72 --- /dev/null +++ b/vendor/javascript/@motionone--easing.js @@ -0,0 +1,4 @@ +// @motionone/easing@10.18.0 downloaded from https://ga.jspm.io/npm:@motionone/easing@10.18.0/dist/index.es.js + +import{noopReturn as t,clamp as n}from"@motionone/utils";const calcBezier=(t,n,e)=>(((1-3*e+3*n)*t+(3*e-6*n))*t+3*n)*t;const e=1e-7;const i=12;function binarySubdivide(t,n,o,r,c){let u;let a;let s=0;do{a=n+(o-n)/2;u=calcBezier(a,r,c)-t;u>0?o=a:n=a}while(Math.abs(u)>e&&++sbinarySubdivide(t,0,1,n,i);return t=>t===0||t===1?t:calcBezier(getTForX(t),e,o)}const steps=(t,e="end")=>i=>{i=e==="end"?Math.min(i,.999):Math.max(i,.001);const o=i*t;const r=e==="end"?Math.floor(o):Math.ceil(o);return n(0,1,r/t)};export{cubicBezier,steps}; + diff --git a/vendor/javascript/@motionone--generators.js b/vendor/javascript/@motionone--generators.js new file mode 100644 index 0000000..b83db92 --- /dev/null +++ b/vendor/javascript/@motionone--generators.js @@ -0,0 +1,4 @@ +// @motionone/generators@10.18.0 downloaded from https://ga.jspm.io/npm:@motionone/generators@10.18.0/dist/index.es.js + +import{velocityPerSecond as e,time as t,noopReturn as s}from"@motionone/utils";const n=5;function calcGeneratorVelocity(t,s,r){const a=Math.max(s-n,0);return e(r-t(a),s-a)}const r={stiffness:100,damping:10,mass:1};const calcDampingRatio=(e=r.stiffness,t=r.damping,s=r.mass)=>t/(2*Math.sqrt(e*s));function hasReachedTarget(e,t,s){return e=t||e>t&&s<=t}const spring=({stiffness:e=r.stiffness,damping:s=r.damping,mass:n=r.mass,from:a=0,to:o=1,velocity:c=0,restSpeed:i,restDistance:h}={})=>{c=c?t.s(c):0;const u={done:false,hasReachedTarget:false,current:a,target:o};const d=o-a;const f=Math.sqrt(e/n)/1e3;const l=calcDampingRatio(e,s,n);const g=Math.abs(d)<5;i||(i=g?.01:2);h||(h=g?.005:.5);let m;if(l<1){const e=f*Math.sqrt(1-l*l);m=t=>o-Math.exp(-l*f*t)*((l*f*d-c)/e*Math.sin(e*t)+d*Math.cos(e*t))}else m=e=>o-Math.exp(-f*e)*(d+(f*d-c)*e);return e=>{u.current=m(e);const t=e===0?c:calcGeneratorVelocity(m,e,u.current);const s=Math.abs(t)<=i;const n=Math.abs(o-u.current)<=h;u.done=s&&n;u.hasReachedTarget=hasReachedTarget(a,o,u.current);return u}};const glide=({from:e=0,velocity:s=0,power:n=.8,decay:r=.325,bounceDamping:a,bounceStiffness:o,changeTarget:c,min:i,max:h,restDistance:u=.5,restSpeed:d})=>{r=t.ms(r);const f={hasReachedTarget:false,done:false,current:e,target:e};const isOutOfBounds=e=>i!==void 0&&eh;const nearestBoundary=e=>i===void 0?h:h===void 0||Math.abs(i-e)-l*Math.exp(-e/r);const calcLatest=e=>m+calcDelta(e);const applyFriction=e=>{const t=calcDelta(e);const s=calcLatest(e);f.done=Math.abs(t)<=u;f.current=f.done?m:s};let p;let M;const checkCatchBoundary=e=>{if(isOutOfBounds(f.current)){p=e;M=spring({from:f.current,to:nearestBoundary(f.current),velocity:calcGeneratorVelocity(calcLatest,e,f.current),damping:a,stiffness:o,restDistance:u,restSpeed:d})}};checkCatchBoundary(0);return e=>{let t=false;if(!M&&p===void 0){t=true;applyFriction(e);checkCatchBoundary(e)}if(p!==void 0&&e>p){f.hasReachedTarget=true;return M(e-p)}f.hasReachedTarget=false;!t&&applyFriction(e);return f}};const a=10;const o=1e4;function pregenerateKeyframes(e,t=s){let n;let r=a;let c=e(0);const i=[t(c.current)];while(!c.done&&rthis.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}export{MotionValue}; + diff --git a/vendor/javascript/@motionone--utils.js b/vendor/javascript/@motionone--utils.js new file mode 100644 index 0000000..c01ea1a --- /dev/null +++ b/vendor/javascript/@motionone--utils.js @@ -0,0 +1,10 @@ +// @motionone/utils@10.18.0 downloaded from https://ga.jspm.io/npm:@motionone/utils@10.18.0/dist/index.es.js + +function addUniqueItem(t,e){t.indexOf(e)===-1&&t.push(e)}function removeItem(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const clamp=(t,e,n)=>Math.min(Math.max(n,t),e);const t={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"};const isNumber=t=>typeof t==="number";const isEasingList=t=>Array.isArray(t)&&!isNumber(t[0]);const wrap=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};function getEasingForSegment(t,e){return isEasingList(t)?t[wrap(0,t.length,e)]:t}const mix=(t,e,n)=>-n*t+n*e+t;const noop=()=>{};const noopReturn=t=>t;const progress=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function fillOffset(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const s=progress(0,e,o);t.push(mix(n,1,s))}}function defaultOffset(t){const e=[0];fillOffset(e,t-1);return e}function interpolate(t,e=defaultOffset(t.length),n=noopReturn){const o=t.length;const s=o-e.length;s>0&&fillOffset(e,s);return s=>{let f=0;for(;fArray.isArray(t)&&isNumber(t[0]);const isEasingGenerator=t=>typeof t==="object"&&Boolean(t.createAnimation);const isFunction=t=>typeof t==="function";const isString=t=>typeof t==="string";const e={ms:t=>t*1e3,s:t=>t/1e3}; +/* + Convert velocity into velocity per second + + @param [number]: Unit per frame + @param [number]: Frame duration in ms +*/function velocityPerSecond(t,e){return e?t*(1e3/e):0}export{addUniqueItem,clamp,defaultOffset,t as defaults,fillOffset,getEasingForSegment,interpolate,isCubicBezier,isEasingGenerator,isEasingList,isFunction,isNumber,isString,mix,noop,noopReturn,progress,removeItem,e as time,velocityPerSecond,wrap}; + diff --git a/vendor/javascript/@popperjs--core.js b/vendor/javascript/@popperjs--core.js new file mode 100644 index 0000000..4dc259b --- /dev/null +++ b/vendor/javascript/@popperjs--core.js @@ -0,0 +1,3 @@ +// @popperjs/core@2.11.8 downloaded from https://ga.jspm.io/npm:@popperjs/core@2.11.8/lib/index.js + +export{afterMain,afterRead,afterWrite,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,end,left,main,modifierPhases,placements,popper,read,reference,right,start,top,variationPlacements,viewport,write}from"./enums.js";import"./modifiers/index.js";export{c as createPopperBase,p as popperGenerator}from"../_/a0ba12d2.js";export{createPopper}from"./popper.js";export{createPopper as createPopperLite}from"./popper-lite.js";export{default as detectOverflow}from"./utils/detectOverflow.js";export{default as applyStyles}from"./modifiers/applyStyles.js";export{default as arrow}from"./modifiers/arrow.js";export{default as computeStyles}from"./modifiers/computeStyles.js";export{default as eventListeners}from"./modifiers/eventListeners.js";export{default as flip}from"./modifiers/flip.js";export{default as hide}from"./modifiers/hide.js";export{default as offset}from"./modifiers/offset.js";export{default as popperOffsets}from"./modifiers/popperOffsets.js";export{default as preventOverflow}from"./modifiers/preventOverflow.js";import"./dom-utils/getCompositeRect.js";import"../_/7a91f8b9.js";import"./dom-utils/instanceOf.js";import"./dom-utils/getWindow.js";import"../_/7742d4ca.js";import"../_/b8df2d1e.js";import"./dom-utils/getNodeScroll.js";import"./dom-utils/getWindowScroll.js";import"./dom-utils/getHTMLElementScroll.js";import"./dom-utils/getNodeName.js";import"./dom-utils/getWindowScrollBarX.js";import"./dom-utils/getDocumentElement.js";import"./dom-utils/isScrollParent.js";import"./dom-utils/getComputedStyle.js";import"./dom-utils/getLayoutRect.js";import"./dom-utils/listScrollParents.js";import"./dom-utils/getScrollParent.js";import"./dom-utils/getParentNode.js";import"./dom-utils/getOffsetParent.js";import"../_/084d303b.js";import"./dom-utils/getViewportRect.js";import"./dom-utils/getDocumentRect.js";import"../_/a9ca29ce.js";import"../_/bb24ce41.js";import"../_/2d19854a.js";import"../_/c7d11060.js";import"./utils/getMainAxisFromPlacement.js";import"../_/1ba79728.js";import"../_/6a201025.js";import"./utils/getOppositePlacement.js";import"./utils/getOppositeVariationPlacement.js";import"./utils/computeAutoPlacement.js"; diff --git a/vendor/javascript/chart.js--auto.js b/vendor/javascript/chart.js--auto.js new file mode 100644 index 0000000..a7255eb --- /dev/null +++ b/vendor/javascript/chart.js--auto.js @@ -0,0 +1,3 @@ +var e="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:global;var D={};!function(e,O){D=O()}(0,(function(){function t(){}const D=function(){let e=0;return function(){return e++}}();function i(e){return null==e}function s(e){if(Array.isArray&&Array.isArray(e))return!0;const D=Object.prototype.toString.call(e);return"[object"===D.slice(0,7)&&"Array]"===D.slice(-6)}function n(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}const o=e=>("number"==typeof e||e instanceof Number)&&isFinite(+e);function a(e,D){return o(e)?e:D}function r(e,D){return void 0===e?D:e}const l=(e,D)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100:e/D,h=(e,D)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*D:+e;function c(e,D,O){if(e&&"function"==typeof e.call)return e.apply(O,D)}function d(e,D,O,C){let A,T,E;if(s(e))if(T=e.length,C)for(A=T-1;A>=0;A--)D.call(O,e[A],A);else for(A=0;Ae,x:e=>e.x,y:e=>e.y};function y(e,D){const C=O[D]||(O[D]=function(e){const D=v(e);return e=>{for(const O of D){if(""===O)break;e=e&&e[O]}return e}}(D));return C(e)}function v(e){const D=e.split("."),O=[];let C="";for(const e of D)C+=e,C.endsWith("\\")?C=C.slice(0,-1)+".":(O.push(C),C="");return O}function w(e){return e.charAt(0).toUpperCase()+e.slice(1)}const M=e=>void 0!==e,k=e=>"function"==typeof e,S=(e,D)=>{if(e.size!==D.size)return!1;for(const O of e)if(!D.has(O))return!1;return!0};function P(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}const C=Math.PI,A=2*C,T=A+C,E=Number.POSITIVE_INFINITY,L=C/180,R=C/2,I=C/4,z=2*C/3,nt=Math.log10,lt=Math.sign;function F(e){const D=Math.round(e);e=N(e,D,e/1e3)?D:e;const O=Math.pow(10,Math.floor(nt(e))),C=e/O;return(C<=1?1:C<=2?2:C<=5?5:10)*O}function V(e){const D=[],O=Math.sqrt(e);let C;for(C=1;Ce-D)).pop(),D}function B(e){return!isNaN(parseFloat(e))&&isFinite(e)}function N(e,D,O){return Math.abs(e-D)=e}function j(e,D,O){let C,A,T;for(C=0,A=e.length;CR&&I=Math.min(D,O)-C&&e<=Math.max(D,O)+C}function tt(e,D,O){O=O||(O=>e[O]1;)C=T+A>>1,O(C)?T=C:A=C;return{lo:T,hi:A}}const et=(e,D,O,C)=>tt(e,O,C?C=>e[C][D]<=O:C=>e[C][D]tt(e,O,(C=>e[C][D]>=O));function st(e,D,O){let C=0,A=e.length;for(;CC&&e[A-1]>O;)A--;return C>0||A{const C="_onData"+w(O),A=D[O];Object.defineProperty(D,O,{configurable:!0,enumerable:!1,value(...O){const T=A.apply(this||e,O);return D._chartjs.listeners.forEach((e=>{"function"==typeof e[C]&&e[C](...O)})),T}})})))}function at(e,D){const O=e._chartjs;if(!O)return;const C=O.listeners,A=C.indexOf(D);-1!==A&&C.splice(A,1),C.length>0||(mt.forEach((D=>{delete e[D]})),delete e._chartjs)}function rt(e){const D=new Set;let O,C;for(O=0,C=e.length;OArray.prototype.slice.call(e));let A=!1,T=[];return function(...O){T=C(O),A||(A=!0,Mt.call(window,(()=>{A=!1,e.apply(D,T)})))}}function ct(D,O){let C;return function(...A){return O?(clearTimeout(C),C=setTimeout(D,O,A)):D.apply(this||e,A),O}}const dt=e=>"start"===e?"left":"end"===e?"right":"center",ut=(e,D,O)=>"start"===e?D:"end"===e?O:(D+O)/2,ft=(e,D,O,C)=>e===(C?"left":"right")?O:"center"===e?(D+O)/2:D;function gt(e,D,O){const C=D.length;let A=0,T=C;if(e._sorted){const{iScale:E,_parsed:L}=e,R=E.axis,{min:I,max:z,minDefined:nt,maxDefined:lt}=E.getUserBounds();nt&&(A=Z(Math.min(et(L,E.axis,I).lo,O?C:et(D,R,E.getPixelForValue(I)).lo),0,C-1)),T=lt?Z(Math.max(et(L,E.axis,z,!0).hi+1,O?0:et(D,R,E.getPixelForValue(z),!0).hi+1),A,C)-A:C-A}return{start:A,count:T}}function pt(e){const{xScale:D,yScale:O,_scaleRanges:C}=e,A={xmin:D.min,xmax:D.max,ymin:O.min,ymax:O.max};if(!C)return e._scaleRanges=A,!0;const T=C.xmin!==D.min||C.xmax!==D.max||C.ymin!==O.min||C.ymax!==O.max;return Object.assign(C,A),T}var kt=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,D,O,C){const A=D.listeners[C],T=D.duration;A.forEach((C=>C({chart:e,initial:D.initial,numSteps:T,currentStep:Math.min(O-D.start,T)})))}_refresh(){this._request||(this._running=!0,this._request=Mt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(e=Date.now()){let D=0;this._charts.forEach(((O,C)=>{if(!O.running||!O.items.length)return;const A=O.items;let T,E=A.length-1,L=!1;for(;E>=0;--E)T=A[E],T._active?(T._total>O.duration&&(O.duration=T._total),T.tick(e),L=!0):(A[E]=A[A.length-1],A.pop());L&&(C.draw(),this._notify(C,O,e,"progress")),A.length||(O.running=!1,this._notify(C,O,e,"complete"),O.initial=!1),D+=A.length})),this._lastDate=e,0===D&&(this._running=!1)}_getAnims(e){const D=this._charts;let O=D.get(e);return O||(O={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},D.set(e,O)),O}listen(e,D,O){this._getAnims(e).listeners[D].push(O)}add(e,D){D&&D.length&&this._getAnims(e).items.push(...D)}has(e){return this._getAnims(e).items.length>0}start(e){const D=this._charts.get(e);D&&(D.running=!0,D.start=Date.now(),D.duration=D.items.reduce(((e,D)=>Math.max(e,D._duration)),0),this._refresh())}running(e){if(!this._running)return!1;const D=this._charts.get(e);return!!(D&&D.running&&D.items.length)}stop(e){const D=this._charts.get(e);if(!D||!D.items.length)return;const O=D.items;let C=O.length-1;for(;C>=0;--C)O[C].cancel();D.items=[],this._notify(e,D,Date.now(),"complete")}remove(e){return this._charts.delete(e)}};function bt(e){return e+.5|0}const xt=(e,D,O)=>Math.max(Math.min(e,O),D);function _t(e){return xt(bt(2.55*e),0,255)}function yt(e){return xt(bt(255*e),0,255)}function vt(e){return xt(bt(e/2.55)/100,0,1)}function wt(e){return xt(bt(100*e),0,100)}const Ct={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Bt=[..."0123456789ABCDEF"],St=e=>Bt[15&e],Pt=e=>Bt[(240&e)>>4]+Bt[15&e],Dt=e=>(240&e)>>4==(15&e);function Ot(e){var D=(e=>Dt(e.r)&&Dt(e.g)&&Dt(e.b)&&Dt(e.a))(e)?St:Pt;return e?"#"+D(e.r)+D(e.g)+D(e.b)+((e,D)=>e<255?D(e):"")(e.a,D):void 0}const Vt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function At(e,D,O){const C=D*Math.min(O,1-O),n=(D,A=(D+e/30)%12)=>O-C*Math.max(Math.min(A-3,9-A,1),-1);return[n(0),n(8),n(4)]}function Tt(e,D,O){const s=(C,A=(C+e/60)%6)=>O-O*D*Math.max(Math.min(A,4-A,1),0);return[s(5),s(3),s(1)]}function Lt(e,D,O){const C=At(e,1,.5);let A;for(D+O>1&&(A=1/(D+O),D*=A,O*=A),A=0;A<3;A++)C[A]*=1-D-O,C[A]+=D;return C}function Et(e){const D=e.r/255,O=e.g/255,C=e.b/255,A=Math.max(D,O,C),T=Math.min(D,O,C),E=(A+T)/2;let L,R,I;return A!==T&&(I=A-T,R=E>.5?I/(2-A-T):I/(A+T),L=function(e,D,O,C,A){return e===A?(D-O)/C+(D>16&255,T>>8&255,255&T]}return e}(),te.transparent=[0,0,0,0]);const D=te[e.toLowerCase()];return D&&{r:D[0],g:D[1],b:D[2],a:4===D.length?D[3]:255}}const ee=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Ht=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,$t=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Yt(e,D,O){if(e){let C=Et(e);C[D]=Math.max(0,Math.min(C[D]+C[D]*O,0===D?360:1)),C=It(C),e.r=C[0],e.g=C[1],e.b=C[2]}}function Ut(e,D){return e?Object.assign(D||{},e):e}function Xt(e){var D={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(D={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(D.a=yt(e[3]))):(D=Ut(e,{r:0,g:0,b:0,a:1})).a=yt(D.a),D}function qt(e){return"r"===e.charAt(0)?function(e){const D=ee.exec(e);let O,C,A,T=255;if(D){if(D[7]!==O){const e=+D[7];T=D[8]?_t(e):xt(255*e,0,255)}return O=+D[1],C=+D[3],A=+D[5],O=255&(D[2]?_t(O):xt(O,0,255)),C=255&(D[4]?_t(C):xt(C,0,255)),A=255&(D[6]?_t(A):xt(A,0,255)),{r:O,g:C,b:A,a:T}}}(e):Ft(e)}class Kt{constructor(e){if(e instanceof Kt)return e;const D=typeof e;let O;var C,A,T;"object"===D?O=Xt(e):"string"===D&&(T=(C=e).length,"#"===C[0]&&(4===T||5===T?A={r:255&17*Ct[C[1]],g:255&17*Ct[C[2]],b:255&17*Ct[C[3]],a:5===T?17*Ct[C[4]]:255}:7!==T&&9!==T||(A={r:Ct[C[1]]<<4|Ct[C[2]],g:Ct[C[3]]<<4|Ct[C[4]],b:Ct[C[5]]<<4|Ct[C[6]],a:9===T?Ct[C[7]]<<4|Ct[C[8]]:255})),O=A||Wt(e)||qt(e)),this._rgb=O,this._valid=!!O}get valid(){return this._valid}get rgb(){var e=Ut(this._rgb);return e&&(e.a=vt(e.a)),e}set rgb(e){this._rgb=Xt(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${vt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid?Ot(this._rgb):void 0}hslString(){return this._valid?function(e){if(!e)return;const D=Et(e),O=D[0],C=wt(D[1]),A=wt(D[2]);return e.a<255?`hsla(${O}, ${C}%, ${A}%, ${vt(e.a)})`:`hsl(${O}, ${C}%, ${A}%)`}(this._rgb):void 0}mix(e,D){if(e){const O=this.rgb,C=e.rgb;let A;const T=D===A?.5:D,E=2*T-1,L=O.a-C.a,R=((E*L==-1?E:(E+L)/(1+E*L))+1)/2;A=1-R,O.r=255&R*O.r+A*C.r+.5,O.g=255&R*O.g+A*C.g+.5,O.b=255&R*O.b+A*C.b+.5,O.a=T*O.a+(1-T)*C.a,this.rgb=O}return this}interpolate(e,D){return e&&(this._rgb=function(e,D,O){const C=$t(vt(e.r)),A=$t(vt(e.g)),T=$t(vt(e.b));return{r:yt(Ht(C+O*($t(vt(D.r))-C))),g:yt(Ht(A+O*($t(vt(D.g))-A))),b:yt(Ht(T+O*($t(vt(D.b))-T))),a:e.a+O*(D.a-e.a)}}(this._rgb,e._rgb,D)),this}clone(){return new Kt(this.rgb)}alpha(e){return this._rgb.a=yt(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,D=bt(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=D,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Yt(this._rgb,2,e),this}darken(e){return Yt(this._rgb,2,-e),this}saturate(e){return Yt(this._rgb,1,e),this}desaturate(e){return Yt(this._rgb,1,-e),this}rotate(e){return function(e,D){var O=Et(e);O[0]=zt(O[0]+D),O=It(O),e.r=O[0],e.g=O[1],e.b=O[2]}(this._rgb,e),this}}function Gt(e){return new Kt(e)}function Zt(e){if(e&&"object"==typeof e){const D=e.toString();return"[object CanvasPattern]"===D||"[object CanvasGradient]"===D}return!1}function Jt(e){return Zt(e)?e:Gt(e)}function Qt(e){return Zt(e)?e:Gt(e).saturate(.5).darken(.1).hexString()}const ne=Object.create(null),ce=Object.create(null);function ie(e,D){if(!D)return e;const O=D.split(".");for(let D=0,C=O.length;De.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,D)=>Qt(D.backgroundColor),this.hoverBorderColor=(e,D)=>Qt(D.borderColor),this.hoverColor=(e,D)=>Qt(D.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,D){return se(this,e,D)}get(e){return ie(this,e)}describe(e,D){return se(ce,e,D)}override(e,D){return se(ne,e,D)}route(e,D,O,C){const A=ie(this,e),T=ie(this,O),E="_"+D;Object.defineProperties(A,{[E]:{value:A[D],writable:!0},[D]:{enumerable:!0,get(){const e=this[E],D=T[C];return n(e)?Object.assign({},D,e):r(e,D)},set(e){this[E]=e}}})}}({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function oe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ae(e){let D=e.parentNode;return D&&"[object ShadowRoot]"===D.toString()&&(D=D.host),D}function re(e,D,O){let C;return"string"==typeof e?(C=parseInt(e,10),-1!==e.indexOf("%")&&(C=C/100*D.parentNode[O])):C=e,C}const le=e=>window.getComputedStyle(e,null);function he(e,D){return le(e).getPropertyValue(D)}const Xe=["top","right","bottom","left"];function de(e,D,O){const C={};O=O?"-"+O:"";for(let A=0;A<4;A++){const T=Xe[A];C[T]=parseFloat(e[D+"-"+T+O])||0}return C.width=C.left+C.right,C.height=C.top+C.bottom,C}function ue(e,D){if("native"in e)return e;const{canvas:O,currentDevicePixelRatio:C}=D,A=le(O),T="border-box"===A.boxSizing,E=de(A,"padding"),L=de(A,"border","width"),{x:R,y:I,box:z}=function(e,D){const O=e.touches,C=O&&O.length?O[0]:e,{offsetX:A,offsetY:T}=C;let E,L,R=!1;if(((e,D,O)=>(e>0||D>0)&&(!O||!O.shadowRoot))(A,T,e.target))E=A,L=T;else{const e=D.getBoundingClientRect();E=C.clientX-e.left,L=C.clientY-e.top,R=!0}return{x:E,y:L,box:R}}(e,O),nt=E.left+(z&&L.left),lt=E.top+(z&&L.top);let{width:mt,height:Mt}=D;return T&&(mt-=E.width+L.width,Mt-=E.height+L.height),{x:Math.round((R-nt)/mt*O.width/C),y:Math.round((I-lt)/Mt*O.height/C)}}const fe=e=>Math.round(10*e)/10;function ge(e,D,O,C){const A=le(e),T=de(A,"margin"),L=re(A.maxWidth,e,"clientWidth")||E,R=re(A.maxHeight,e,"clientHeight")||E,I=function(e,D,O){let C,A;if(void 0===D||void 0===O){const T=ae(e);if(T){const e=T.getBoundingClientRect(),E=le(T),L=de(E,"border","width"),R=de(E,"padding");D=e.width-R.width-L.width,O=e.height-R.height-L.height,C=re(E.maxWidth,T,"clientWidth"),A=re(E.maxHeight,T,"clientHeight")}else D=e.clientWidth,O=e.clientHeight}return{width:D,height:O,maxWidth:C||E,maxHeight:A||E}}(e,D,O);let{width:z,height:nt}=I;if("content-box"===A.boxSizing){const e=de(A,"border","width"),D=de(A,"padding");z-=D.width+e.width,nt-=D.height+e.height}return z=Math.max(0,z-T.width),nt=Math.max(0,C?Math.floor(z/C):nt-T.height),z=fe(Math.min(z,L,I.maxWidth)),nt=fe(Math.min(nt,R,I.maxHeight)),z&&!nt&&(nt=fe(z/2)),{width:z,height:nt}}function pe(e,D,O){const C=D||1,A=Math.floor(e.height*C),T=Math.floor(e.width*C);e.height=A/C,e.width=T/C;const E=e.canvas;return E.style&&(O||!E.style.height&&!E.style.width)&&(E.style.height=`${e.height}px`,E.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==C||E.height!==A||E.width!==T)&&(e.currentDevicePixelRatio=C,E.height=A,E.width=T,e.ctx.setTransform(C,0,0,C,0,0),!0)}const si=function(){let e=!1;try{const D={get passive(){return e=!0,!1}};window.addEventListener("test",null,D),window.removeEventListener("test",null,D)}catch(e){}return e}();function be(e,D){const O=he(e,D),C=O&&O.match(/^(\d+)(\.\d+)?px$/);return C?+C[1]:void 0}function xe(e){return!e||i(e.size)||i(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function _e(e,D,O,C,A){let T=D[A];return T||(T=D[A]=e.measureText(A).width,O.push(A)),T>C&&(C=T),C}function ye(e,D,O,C){let A=(C=C||{}).data=C.data||{},T=C.garbageCollect=C.garbageCollect||[];C.font!==D&&(A=C.data={},T=C.garbageCollect=[],C.font=D),e.save(),e.font=D;let E=0;const L=O.length;let R,I,z,nt,lt;for(R=0;RO.length){for(R=0;R0&&e.stroke()}}function Se(e,D,O){return O=O||.5,!D||e&&e.x>D.left-O&&e.xD.top-O&&e.y0&&""!==T.strokeColor;let R,I;for(e.save(),e.font=A.string,function(e,D){D.translation&&e.translate(D.translation[0],D.translation[1]);i(D.rotation)||e.rotate(D.rotation);D.color&&(e.fillStyle=D.color);D.textAlign&&(e.textAlign=D.textAlign);D.textBaseline&&(e.textBaseline=D.textBaseline)}(e,T),R=0;Re[0])){M(C)||(C=$e("_fallback",e));const T={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:O,_fallback:C,_getTarget:A,override:A=>Ee([A,...e],D,O,C)};return new Proxy(T,{deleteProperty:(D,O)=>(delete D[O],delete D._keys,delete e[0][O],!0),get:(O,C)=>Ve(O,C,(()=>function(e,D,O,C){let A;for(const T of D)if(A=$e(ze(T,e),O),M(A))return Fe(e,A)?je(O,C,e,A):A}(C,D,e,O))),getOwnPropertyDescriptor:(e,D)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],D),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,D)=>Ye(e).includes(D),ownKeys:e=>Ye(e),set(e,D,O){const C=e._storage||(e._storage=A());return e[D]=C[D]=O,delete e._keys,!0}})}function Re(e,D,O,C){const A={_cacheable:!1,_proxy:e,_context:D,_subProxy:O,_stack:new Set,_descriptors:Ie(e,C),setContext:D=>Re(e,D,O,C),override:A=>Re(e.override(A),D,O,C)};return new Proxy(A,{deleteProperty:(D,O)=>(delete D[O],delete e[O],!0),get:(e,D,O)=>Ve(e,D,(()=>function(e,D,O){const{_proxy:C,_context:A,_subProxy:T,_descriptors:E}=e;let L=C[D];k(L)&&E.isScriptable(D)&&(L=function(e,D,O,C){const{_proxy:A,_context:T,_subProxy:E,_stack:L}=O;if(L.has(e))throw new Error("Recursion detected: "+Array.from(L).join("->")+"->"+e);L.add(e),D=D(T,E||C),L.delete(e),Fe(e,D)&&(D=je(A._scopes,A,e,D));return D}(D,L,e,O));s(L)&&L.length&&(L=function(e,D,O,C){const{_proxy:A,_context:T,_subProxy:E,_descriptors:L}=O;if(M(T.index)&&C(e))D=D[T.index%D.length];else if(n(D[0])){const O=D,C=A._scopes.filter((e=>e!==O));D=[];for(const R of O){const O=je(C,A,e,R);D.push(Re(O,T,E&&E[e],L))}}return D}(D,L,e,E.isIndexable));Fe(D,L)&&(L=Re(L,A,T&&T[D],E));return L}(e,D,O))),getOwnPropertyDescriptor:(D,O)=>D._descriptors.allKeys?Reflect.has(e,O)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,O),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(D,O)=>Reflect.has(e,O),ownKeys:()=>Reflect.ownKeys(e),set:(D,O,C)=>(e[O]=C,delete D[O],!0)})}function Ie(e,D={scriptable:!0,indexable:!0}){const{_scriptable:O=D.scriptable,_indexable:C=D.indexable,_allKeys:A=D.allKeys}=e;return{allKeys:A,scriptable:O,indexable:C,isScriptable:k(O)?O:()=>O,isIndexable:k(C)?C:()=>C}}const ze=(e,D)=>e?e+w(D):D,Fe=(e,D)=>n(D)&&"adapters"!==e&&(null===Object.getPrototypeOf(D)||D.constructor===Object);function Ve(e,D,O){if(Object.prototype.hasOwnProperty.call(e,D))return e[D];const C=O();return e[D]=C,C}function Be(e,D,O){return k(e)?e(D,O):e}const Ne=(e,D)=>!0===e?D:"string"==typeof e?y(D,e):void 0;function We(e,D,O,C,A){for(const T of D){const D=Ne(O,T);if(D){e.add(D);const T=Be(D._fallback,O,A);if(M(T)&&T!==O&&T!==C)return T}else if(!1===D&&M(C)&&O!==C)return null}return!1}function je(e,D,O,C){const A=D._rootScopes,T=Be(D._fallback,O,C),E=[...e,...A],L=new Set;L.add(C);let R=He(L,E,O,T||O,C);return null!==R&&(!M(T)||T===O||(R=He(L,E,T,R,C),null!==R))&&Ee(Array.from(L),[""],A,T,(()=>function(e,D,O){const C=e._getTarget();D in C||(C[D]={});const A=C[D];return s(A)&&n(O)?O:A}(D,O,C)))}function He(e,D,O,C,A){for(;O;)O=We(e,D,O,C,A);return O}function $e(e,D){for(const O of D){if(!O)continue;const D=O[e];if(M(D))return D}}function Ye(e){let D=e._keys;return D||(D=e._keys=function(e){const D=new Set;for(const O of e)for(const e of Object.keys(O).filter((e=>!e.startsWith("_"))))D.add(e);return Array.from(D)}(e._scopes)),D}function Ue(D,O,C,A){const{iScale:T}=D,{key:E="r"}=(this||e)._parsing,L=new Array(A);let R,I,z,nt;for(R=0,I=A;RD"x"===e?"y":"x";function Ge(e,D,O,C){const A=e.skip?D:e,T=D,E=O.skip?D:O,L=X(T,A),R=X(E,T);let I=L/(L+R),z=R/(L+R);I=isNaN(I)?0:I,z=isNaN(z)?0:z;const nt=C*I,lt=C*z;return{previous:{x:T.x-nt*(E.x-A.x),y:T.y-nt*(E.y-A.y)},next:{x:T.x+lt*(E.x-A.x),y:T.y+lt*(E.y-A.y)}}}function Ze(e,D="x"){const O=Ke(D),C=e.length,A=Array(C).fill(0),T=Array(C);let E,L,R,I=qe(e,0);for(E=0;E!e.skip))),"monotone"===D.cubicInterpolationMode)Ze(e,A);else{let O=C?e[e.length-1]:e[0];for(T=0,E=e.length;T0===e||1===e,ei=(e,D,O)=>-Math.pow(2,10*(e-=1))*Math.sin((e-D)*A/O),ii=(e,D,O)=>Math.pow(2,-10*e)*Math.sin((e-D)*A/O)+1,hi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*R),easeOutSine:e=>Math.sin(e*R),easeInOutSine:e=>-.5*(Math.cos(C*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>ti(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ti(e)?e:ei(e,.075,.3),easeOutElastic:e=>ti(e)?e:ii(e,.075,.3),easeInOutElastic(e){const D=.1125;return ti(e)?e:e<.5?.5*ei(2*e,D,.45):.5+.5*ii(2*e-1,D,.45)},easeInBack(e){const D=1.70158;return e*e*((D+1)*e-D)},easeOutBack(e){const D=1.70158;return(e-=1)*e*((D+1)*e+D)+1},easeInOutBack(e){let D=1.70158;return(e/=.5)<1?e*e*((1+(D*=1.525))*e-D)*.5:.5*((e-=2)*e*((1+(D*=1.525))*e+D)+2)},easeInBounce:e=>1-hi.easeOutBounce(1-e),easeOutBounce(e){const D=7.5625,O=2.75;return e<1/O?D*e*e:e<2/O?D*(e-=1.5/O)*e+.75:e<2.5/O?D*(e-=2.25/O)*e+.9375:D*(e-=2.625/O)*e+.984375},easeInOutBounce:e=>e<.5?.5*hi.easeInBounce(2*e):.5*hi.easeOutBounce(2*e-1)+.5};function ni(e,D,O,C){return{x:e.x+O*(D.x-e.x),y:e.y+O*(D.y-e.y)}}function oi(e,D,O,C){return{x:e.x+O*(D.x-e.x),y:"middle"===C?O<.5?e.y:D.y:"after"===C?O<1?e.y:D.y:O>0?D.y:e.y}}function ai(e,D,O,C){const A={x:e.cp2x,y:e.cp2y},T={x:D.cp1x,y:D.cp1y},E=ni(e,A,O),L=ni(A,T,O),R=ni(T,D,O),I=ni(E,L,O),z=ni(L,R,O);return ni(I,z,O)}const ci=new Map;function li(e,D,O){return function(e,D){D=D||{};const O=e+JSON.stringify(D);let C=ci.get(O);return C||(C=new Intl.NumberFormat(e,D),ci.set(O,C)),C}(D,O).format(e)}const Ti=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Bi=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function di(e,D){const O=(""+e).match(Ti);if(!O||"normal"===O[1])return 1.2*D;switch(e=+O[2],O[3]){case"px":return e;case"%":e/=100}return D*e}function ui(e,D){const O={},C=n(D),A=C?Object.keys(D):D,T=n(e)?C?O=>r(e[O],e[D[O]]):D=>e[D]:()=>e;for(const e of A)O[e]=+T(e)||0;return O}function fi(e){return ui(e,{top:"y",right:"x",bottom:"y",left:"x"})}function gi(e){return ui(e,["topLeft","topRight","bottomLeft","bottomRight"])}function pi(e){const D=fi(e);return D.width=D.left+D.right,D.height=D.top+D.bottom,D}function mi(e,D){e=e||{},D=D||me.font;let O=r(e.size,D.size);"string"==typeof O&&(O=parseInt(O,10));let C=r(e.style,D.style);C&&!(""+C).match(Bi)&&(console.warn('Invalid font style specified: "'+C+'"'),C="");const A={family:r(e.family,D.family),lineHeight:di(r(e.lineHeight,D.lineHeight),O),size:O,style:C,weight:r(e.weight,D.weight),string:""};return A.string=xe(A),A}function bi(e,D,O,C){let A,T,E,L=!0;for(A=0,T=e.length;AO&&0===e?0:e+D;return{min:a(C,-Math.abs(T)),max:a(A,T)}}function _i(e,D){return Object.assign(Object.create(e),D)}function yi(e,D,O){return e?function(e,D){return{x:O=>e+e+D-O,setWidth(e){D=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,D)=>e-D,leftForLtr:(e,D)=>e-D}}(D,O):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,D)=>e+D,leftForLtr:(e,D)=>e}}function vi(e,D){let O,C;"ltr"!==D&&"rtl"!==D||(O=e.canvas.style,C=[O.getPropertyValue("direction"),O.getPropertyPriority("direction")],O.setProperty("direction",D,"important"),e.prevTextDirection=C)}function wi(e,D){void 0!==D&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",D[0],D[1]))}function Mi(e){return"angle"===e?{between:G,compare:q,normalize:K}:{between:Q,compare:(e,D)=>e-D,normalize:e=>e}}function ki({start:e,end:D,count:O,loop:C,style:A}){return{start:e%O,end:D%O,loop:C&&(D-e+1)%O==0,style:A}}function Si(e,D,O){if(!O)return[e];const{property:C,start:A,end:T}=O,E=D.length,{compare:L,between:R,normalize:I}=Mi(C),{start:z,end:nt,loop:lt,style:mt}=function(e,D,O){const{property:C,start:A,end:T}=O,{between:E,normalize:L}=Mi(C),R=D.length;let I,z,{start:nt,end:lt,loop:mt}=e;if(mt){for(nt+=R,lt+=R,I=0,z=R;IVt||R(A,Bt,kt)&&0!==L(A,Bt),v=()=>!Vt||0===L(T,kt)||R(T,Bt,kt);for(let e=z,O=z;e<=nt;++e)Ct=D[e%E],Ct.skip||(kt=I(Ct[C]),kt!==Bt&&(Vt=R(kt,A,T),null===Nt&&y()&&(Nt=0===L(kt,A)?e:O),null!==Nt&&v()&&(Mt.push(ki({start:Nt,end:e,loop:lt,count:E,style:mt})),Nt=null),O=e,Bt=kt));return null!==Nt&&Mt.push(ki({start:Nt,end:nt,loop:lt,count:E,style:mt})),Mt}function Pi(e,D){const O=[],C=e.segments;for(let A=0;AA&&e[T%D].skip;)T--;return T%=D,{start:A,end:T}}(O,A,T,C);return Oi(e,!0===C?[{start:E,end:L,loop:T}]:function(e,D,O,C){const A=e.length,T=[];let E,L=D,R=e[D];for(E=D+1;E<=O;++E){const O=e[E%A];O.skip||O.stop?R.skip||(C=!1,T.push({start:D%A,end:(E-1)%A,loop:C}),D=L=O.stop?E:null):(L=E,R.skip&&(D=E)),R=O}return null!==L&&T.push({start:D%A,end:L%A,loop:C}),T}(O,E,L{e[E](D[O],A)&&(T.push({element:e,datasetIndex:C,index:R}),L=L||e.inRange(D.x,D.y,A))})),C&&!L?[]:T}var Zi={evaluateInteractionItems:Ei,modes:{index(e,D,O,C){const A=ue(D,e),T=O.axis||"x",E=O.includeInvisible||!1,L=O.intersect?Ri(e,A,T,C,E):zi(e,A,T,!1,C,E),R=[];return L.length?(e.getSortedVisibleDatasetMetas().forEach((e=>{const D=L[0].index,O=e.data[D];O&&!O.skip&&R.push({element:O,datasetIndex:e.index,index:D})})),R):[]},dataset(e,D,O,C){const A=ue(D,e),T=O.axis||"xy",E=O.includeInvisible||!1;let L=O.intersect?Ri(e,A,T,C,E):zi(e,A,T,!1,C,E);if(L.length>0){const D=L[0].datasetIndex,O=e.getDatasetMeta(D).data;L=[];for(let e=0;eRi(e,ue(D,e),O.axis||"xy",C,O.includeInvisible||!1),nearest(e,D,O,C){const A=ue(D,e),T=O.axis||"xy",E=O.includeInvisible||!1;return zi(e,A,T,O.intersect,C,E)},x:(e,D,O,C)=>Fi(e,ue(D,e),"x",O.intersect,C),y:(e,D,O,C)=>Fi(e,ue(D,e),"y",O.intersect,C)}};const ts=["left","top","right","bottom"];function Ni(e,D){return e.filter((e=>e.pos===D))}function Wi(e,D){return e.filter((e=>-1===ts.indexOf(e.pos)&&e.box.axis===D))}function ji(e,D){return e.sort(((e,O)=>{const C=D?O:e,A=D?e:O;return C.weight===A.weight?C.index-A.index:C.weight-A.weight}))}function Hi(e,D){const O=function(e){const D={};for(const O of e){const{stack:e,pos:C,stackWeight:A}=O;if(!e||!ts.includes(C))continue;const T=D[e]||(D[e]={count:0,placed:0,weight:0,size:0});T.count++,T.weight+=A}return D}(e),{vBoxMaxWidth:C,hBoxMaxHeight:A}=D;let T,E,L;for(T=0,E=e.length;T{C[e]=Math.max(D[e],O[e])})),C}return s(e?["left","right"]:["top","bottom"])}function qi(e,D,O,C){const A=[];let T,E,L,R,I,z;for(T=0,E=e.length,I=0;Te.box.fullSize)),!0),C=ji(Ni(D,"left"),!0),A=ji(Ni(D,"right")),T=ji(Ni(D,"top"),!0),E=ji(Ni(D,"bottom")),L=Wi(D,"x"),R=Wi(D,"y");return{fullSize:O,leftAndTop:C.concat(T),rightAndBottom:A.concat(R).concat(E).concat(L),chartArea:Ni(D,"chartArea"),vertical:C.concat(A).concat(R),horizontal:T.concat(E).concat(L)}}(e.boxes),R=L.vertical,I=L.horizontal;d(e.boxes,(e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()}));const z=R.reduce(((e,D)=>D.box.options&&!1===D.box.options.display?e:e+1),0)||1,nt=Object.freeze({outerWidth:D,outerHeight:O,padding:A,availableWidth:T,availableHeight:E,vBoxMaxWidth:T/2/z,hBoxMaxHeight:E/2}),lt=Object.assign({},A);Yi(lt,pi(C));const mt=Object.assign({maxPadding:lt,w:T,h:E,x:A.left,y:A.top},A),Mt=Hi(R.concat(I),nt);qi(L.fullSize,mt,nt,Mt),qi(R,mt,nt,Mt),qi(I,mt,nt,Mt)&&qi(R,mt,nt,Mt),function(e){const D=e.maxPadding;function i(O){const C=Math.max(D[O]-e[O],0);return e[O]+=C,C}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}(mt),Gi(L.leftAndTop,mt,nt,Mt),mt.x+=mt.w,mt.y+=mt.h,Gi(L.rightAndBottom,mt,nt,Mt),e.chartArea={left:mt.left,top:mt.top,right:mt.left+mt.w,bottom:mt.top+mt.h,height:mt.h,width:mt.w},d(L.chartArea,(D=>{const O=D.box;Object.assign(O,e.chartArea),O.update(mt.w,mt.h,{left:0,top:0,right:0,bottom:0})}))}};class Ji{acquireContext(e,D){}releaseContext(e){return!1}addEventListener(e,D,O){}removeEventListener(e,D,O){}getDevicePixelRatio(){return 1}getMaximumSize(e,D,O,C){return D=Math.max(0,D||e.width),O=O||e.height,{width:D,height:Math.max(0,C?Math.floor(D/C):O)}}isAttached(e){return!0}updateConfig(e){}}class Qi extends Ji{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rs={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},es=e=>null===e||""===e;const ls=!!si&&{passive:!0};function ss(e,D,O){e.canvas.removeEventListener(D,O,ls)}function ns(e,D){for(const O of e)if(O===D||O.contains(D))return!0}function os(e,D,O){const C=e.canvas,A=new MutationObserver((e=>{let D=!1;for(const O of e)D=D||ns(O.addedNodes,C),D=D&&!ns(O.removedNodes,C);D&&O()}));return A.observe(document,{childList:!0,subtree:!0}),A}function as(e,D,O){const C=e.canvas,A=new MutationObserver((e=>{let D=!1;for(const O of e)D=D||ns(O.removedNodes,C),D=D&&!ns(O.addedNodes,C);D&&O()}));return A.observe(document,{childList:!0,subtree:!0}),A}const ps=new Map;let ms=0;function hs(){const e=window.devicePixelRatio;e!==ms&&(ms=e,ps.forEach(((D,O)=>{O.currentDevicePixelRatio!==e&&D()})))}function cs(e,D,O){const C=e.canvas,A=C&&ae(C);if(!A)return;const T=ht(((e,D)=>{const C=A.clientWidth;O(e,D),C{const D=e[0],O=D.contentRect.width,C=D.contentRect.height;0===O&&0===C||T(O,C)}));return E.observe(A),function(e,D){ps.size||window.addEventListener("resize",hs),ps.set(e,D)}(e,T),E}function ds(e,D,O){O&&O.disconnect(),"resize"===D&&function(e){ps.delete(e),ps.size||window.removeEventListener("resize",hs)}(e)}function us(e,D,O){const C=e.canvas,A=ht((D=>{null!==e.ctx&&O(function(e,D){const O=rs[e.type]||e.type,{x:C,y:A}=ue(e,D);return{type:O,chart:D,native:e,x:void 0!==C?C:null,y:void 0!==A?A:null}}(D,e))}),e,(e=>{const D=e[0];return[D,D.offsetX,D.offsetY]}));return function(e,D,O){e.addEventListener(D,O,ls)}(C,D,A),A}class fs extends Ji{acquireContext(e,D){const O=e&&e.getContext&&e.getContext("2d");return O&&O.canvas===e?(function(e,D){const O=e.style,C=e.getAttribute("height"),A=e.getAttribute("width");if(e.$chartjs={initial:{height:C,width:A,style:{display:O.display,height:O.height,width:O.width}}},O.display=O.display||"block",O.boxSizing=O.boxSizing||"border-box",es(A)){const D=be(e,"width");void 0!==D&&(e.width=D)}if(es(C))if(""===e.style.height)e.height=e.width/(D||2);else{const D=be(e,"height");void 0!==D&&(e.height=D)}}(e,D),O):null}releaseContext(e){const D=e.canvas;if(!D.$chartjs)return!1;const O=D.$chartjs.initial;["height","width"].forEach((e=>{const C=O[e];i(C)?D.removeAttribute(e):D.setAttribute(e,C)}));const C=O.style||{};return Object.keys(C).forEach((e=>{D.style[e]=C[e]})),D.width=D.width,delete D.$chartjs,!0}addEventListener(e,D,O){this.removeEventListener(e,D);const C=e.$proxies||(e.$proxies={}),A={attach:os,detach:as,resize:cs}[D]||us;C[D]=A(e,D,O)}removeEventListener(e,D){const O=e.$proxies||(e.$proxies={}),C=O[D];C&&(({attach:ds,detach:ds,resize:ds}[D]||ss)(e,D,C),O[D]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,D,O,C){return ge(e,D,O,C)}isAttached(e){const D=ae(e);return!(!D||!D.isConnected)}}function gs(e){return!oe()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Qi:fs}var bs=Object.freeze({__proto__:null,_detectPlatform:gs,BasePlatform:Ji,BasicPlatform:Qi,DomPlatform:fs});const _s="transparent",Rs={boolean:(e,D,O)=>O>.5?D:e,color(e,D,O){const C=Jt(e||_s),A=C.valid&&Jt(D||_s);return A&&A.valid?A.mix(C,O).hexString():D},number:(e,D,O)=>e+(D-e)*O};class xs{constructor(e,D,O,C){const A=D[O];C=bi([e.to,C,A,e.from]);const T=bi([e.from,A,C]);this._active=!0,this._fn=e.fn||Rs[e.type||typeof T],this._easing=hi[e.easing]||hi.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=D,this._prop=O,this._from=T,this._to=C,this._promises=void 0}active(){return this._active}update(e,D,O){if(this._active){this._notify(!1);const C=this._target[this._prop],A=O-this._start,T=this._duration-A;this._start=O,this._duration=Math.floor(Math.max(T,e.duration)),this._total+=A,this._loop=!!e.loop,this._to=bi([e.to,D,C,e.from]),this._from=bi([e.from,C,D])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const D=e-this._start,O=this._duration,C=this._prop,A=this._from,T=this._loop,E=this._to;let L;if(this._active=A!==E&&(T||D1?2-L:L,L=this._easing(Math.min(1,Math.max(0,L))),this._target[C]=this._fn(A,E,L))}wait(){const e=this._promises||(this._promises=[]);return new Promise(((D,O)=>{e.push({res:D,rej:O})}))}_notify(e){const D=e?"res":"rej",O=this._promises||[];for(let e=0;e"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),me.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),me.describe("animations",{_fallback:"animation"}),me.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}});class ys{constructor(e,D){this._chart=e,this._properties=new Map,this.configure(D)}configure(e){if(!n(e))return;const D=this._properties;Object.getOwnPropertyNames(e).forEach((O=>{const C=e[O];if(!n(C))return;const A={};for(const e of Is)A[e]=C[e];(s(C.properties)&&C.properties||[O]).forEach((e=>{e!==O&&D.has(e)||D.set(e,A)}))}))}_animateOptions(e,D){const O=D.options,C=function(e,D){if(!D)return;let O=e.options;if(O){O.$shared&&(e.options=O=Object.assign({},O,{$shared:!1,$animations:{}}));return O}e.options=D}(e,O);if(!C)return[];const A=this._createAnimations(C,O);return O.$shared&&function(e,D){const O=[],C=Object.keys(D);for(let D=0;D{e.options=O}),(()=>{})),A}_createAnimations(e,D){const O=this._properties,C=[],A=e.$animations||(e.$animations={}),T=Object.keys(D),E=Date.now();let L;for(L=T.length-1;L>=0;--L){const R=T[L];if("$"===R.charAt(0))continue;if("options"===R){C.push(...this._animateOptions(e,D));continue}const I=D[R];let z=A[R];const nt=O.get(R);if(z){if(nt&&z.active()){z.update(nt,I,E);continue}z.cancel()}nt&&nt.duration?(A[R]=z=new xs(nt,e,R,I),C.push(z)):e[R]=I}return C}update(e,D){if(0===this._properties.size)return void Object.assign(e,D);const O=this._createAnimations(e,D);return O.length?(kt.add(this._chart,O),!0):void 0}}function vs(e,D){const O=e&&e.options||{},C=O.reverse,A=void 0===O.min?D:0,T=void 0===O.max?D:0;return{start:C?T:A,end:C?A:T}}function ws(e,D){const O=[],C=e._getSortedDatasetMetas(D);let A,T;for(A=0,T=C.length;A0||!O&&D<0)return A.index}return null}function Ds(e,D){const{chart:O,_cachedMeta:C}=e,A=O._stacks||(O._stacks={}),{iScale:T,vScale:E,index:L}=C,R=T.axis,I=E.axis,z=function(e,D,O){return`${e.id}.${D.id}.${O.stack||O.type}`}(T,E,C),nt=D.length;let lt;for(let e=0;eO[e].axis===D)).shift()}function Cs(e,D){const O=e.controller.index,C=e.vScale&&e.vScale.axis;if(C){D=D||e._parsed;for(const e of D){const D=e._stacks;if(!D||void 0===D[C]||void 0===D[C][O])return;delete D[C][O]}}}const As=e=>"reset"===e||"none"===e,Ts=(e,D)=>D?e:Object.assign({},e);class Ls{constructor(e,D){this.chart=e,this._ctx=e.ctx,this.index=D,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=ks(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Cs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,D=this._cachedMeta,O=this.getDataset(),s=(e,D,O,C)=>"x"===e?D:"r"===e?C:O,C=D.xAxisID=r(O.xAxisID,Os(e,"x")),A=D.yAxisID=r(O.yAxisID,Os(e,"y")),T=D.rAxisID=r(O.rAxisID,Os(e,"r")),E=D.indexAxis,L=D.iAxisID=s(E,C,A,T),R=D.vAxisID=s(E,A,C,T);D.xScale=this.getScaleForId(C),D.yScale=this.getScaleForId(A),D.rScale=this.getScaleForId(T),D.iScale=this.getScaleForId(L),D.vScale=this.getScaleForId(R)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const D=this._cachedMeta;return e===D.iScale?D.vScale:D.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&at(this._data,this),e._stacked&&Cs(e)}_dataCheck(){const e=this.getDataset(),D=e.data||(e.data=[]),O=this._data;if(n(D))this._data=function(e){const D=Object.keys(e),O=new Array(D.length);let C,A,T;for(C=0,A=D.length;C0&&O._parsed[e-1];if(!1===this._parsing)O._parsed=C,O._sorted=!0,I=C;else{I=s(C[e])?this.parseArrayData(O,C,e,D):n(C[e])?this.parseObjectData(O,C,e,D):this.parsePrimitiveData(O,C,e,D);const a=()=>null===R[E]||nt&&R[E]e&&!D.hidden&&D._stacked&&{keys:ws(O,!0),values:null})(D,O,this.chart),R={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:I,max:z}=function(e){const{min:D,max:O,minDefined:C,maxDefined:A}=e.getUserBounds();return{min:C?D:Number.NEGATIVE_INFINITY,max:A?O:Number.POSITIVE_INFINITY}}(E);let nt,lt;function g(){lt=C[nt];const D=lt[E.axis];return!o(lt[e.axis])||I>D||z=0;--nt)if(!g()){this.updateRangeFromParsed(R,e,lt,L);break}return R}getAllParsedValues(e){const D=this._cachedMeta._parsed,O=[];let C,A,T;for(C=0,A=D.length;C=0&&ethis.getContext(O,C)),z);return mt.$shared&&(mt.$shared=L,A[T]=Object.freeze(Ts(mt,L))),mt}_resolveAnimations(e,D,O){const C=this.chart,A=this._cachedDataOpts,T=`animation-${D}`,E=A[T];if(E)return E;let L;if(!1!==C.options.animation){const C=this.chart.config,A=C.datasetAnimationScopeKeys(this._type,D),T=C.getOptionScopes(this.getDataset(),A);L=C.createResolver(T,this.getContext(e,O,D))}const R=new ys(C,L&&L.animations);return L&&L._cacheable&&(A[T]=Object.freeze(R)),R}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,D){return!D||As(e)||this.chart._animationsDisabled}_getSharedOptions(e,D){const O=this.resolveDataElementOptions(e,D),C=this._sharedOptions,A=this.getSharedOptions(O),T=this.includeOptions(D,A)||A!==C;return this.updateSharedOptions(A,D,O),{sharedOptions:A,includeOptions:T}}updateElement(e,D,O,C){As(C)?Object.assign(e,O):this._resolveAnimations(D,C).update(e,O)}updateSharedOptions(e,D,O){e&&!As(D)&&this._resolveAnimations(void 0,D).update(e,O)}_setStyle(e,D,O,C){e.active=C;const A=this.getStyle(D,C);this._resolveAnimations(D,O,C).update(e,{options:!C&&this.getSharedOptions(A)||A})}removeHoverStyle(e,D,O){this._setStyle(e,O,"active",!1)}setHoverStyle(e,D,O){this._setStyle(e,O,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const D=this._data,O=this._cachedMeta.data;for(const[e,D,O]of this._syncList)this[e](D,O);this._syncList=[];const C=O.length,A=D.length,T=Math.min(A,C);T&&this.parse(0,T),A>C?this._insertElements(C,A-C,e):A{for(e.length+=D,E=e.length-1;E>=T;E--)e[E]=e[E-D]};for(r(A),E=e;E{C[e]=O[e]&&O[e].active()?O[e]._to:this[e]})),C}}Es.defaults={},Es.defaultRoutes=void 0;const Us={values:e=>s(e)?e:""+e,numeric(D,O,C){if(0===D)return"0";const A=(this||e).chart.options.locale;let T,E=D;if(C.length>1){const e=Math.max(Math.abs(C[0].value),Math.abs(C[C.length-1].value));(e<1e-4||e>1e15)&&(T="scientific"),E=function(e,D){let O=D.length>3?D[2].value-D[1].value:D[1].value-D[0].value;Math.abs(O)>=1&&e!==Math.floor(e)&&(O=e-Math.floor(e));return O}(D,C)}const L=nt(Math.abs(E)),R=Math.max(Math.min(-1*Math.floor(L),20),0),I={notation:T,minimumFractionDigits:R,maximumFractionDigits:R};return Object.assign(I,(this||e).options.ticks.format),li(D,A,I)},logarithmic(D,O,C){if(0===D)return"0";const A=D/Math.pow(10,Math.floor(nt(D)));return 1===A||2===A||5===A?Us.numeric.call(this||e,D,O,C):""}};var tn={formatters:Us};function zs(e,D){const O=e.options.ticks,C=O.maxTicksLimit||function(e){const D=e.options.offset,O=e._tickSize(),C=e._length/O+(D?0:1),A=e._maxLength/O;return Math.floor(Math.min(C,A))}(e),A=O.major.enabled?function(e){const D=[];let O,C;for(O=0,C=e.length;OC)return function(e,D,O,C){let A,T=0,E=O[0];for(C=Math.ceil(C),A=0;AA)return D}return Math.max(A,1)}(A,D,C);if(T>0){let e,O;const C=T>1?Math.round((L-E)/(T-1)):null;for(Fs(D,R,I,i(C)?0:E-C,E),e=0,O=T-1;eD.lineWidth,tickColor:(e,D)=>D.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),me.route("scale.ticks","color","","color"),me.route("scale.grid","color","","borderColor"),me.route("scale.grid","borderColor","","borderColor"),me.route("scale.title","color","","color"),me.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e}),me.describe("scales",{_fallback:"scale"}),me.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e});const Vs=(e,D,O)=>"top"===D||"left"===D?e[D]+O:e[D]-O;function Bs(e,D){const O=[],C=e.length/D,A=e.length;let T=0;for(;TE+L)))return I}function Ws(e){return e.drawTicks?e.tickLength:0}function js(e,D){if(!e.display)return 0;const O=mi(e.font,D),C=pi(e.padding);return(s(e.text)?e.text.length:1)*O.lineHeight+C.height}function Hs(e,D,O){let C=dt(e);return(O&&"right"!==D||!O&&"right"===D)&&(C=(e=>"left"===e?"right":"right"===e?"left":e)(C)),C}class $s extends Es{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,D){return e}getUserBounds(){let{_userMin:e,_userMax:D,_suggestedMin:O,_suggestedMax:C}=this;return e=a(e,Number.POSITIVE_INFINITY),D=a(D,Number.NEGATIVE_INFINITY),O=a(O,Number.POSITIVE_INFINITY),C=a(C,Number.NEGATIVE_INFINITY),{min:a(e,O),max:a(D,C),minDefined:o(e),maxDefined:o(D)}}getMinMax(e){let D,{min:O,max:C,minDefined:A,maxDefined:T}=this.getUserBounds();if(A&&T)return{min:O,max:C};const E=this.getMatchingVisibleMetas();for(let L=0,R=E.length;LC?C:O,C=A&&O>C?O:C,{min:a(O,a(C,O)),max:a(C,a(O,C))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(e,D,O){const{beginAtZero:C,grace:A,ticks:T}=this.options,E=T.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=D,this._margins=O=Object.assign({left:0,right:0,top:0,bottom:0},O),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+O.left+O.right:this.height+O.top+O.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xi(this,A,C),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const L=E=A||O<=1||!this.isHorizontal())return void(this.labelRotation=C);const I=this._getLabelSizes(),z=I.widest.width,nt=I.highest.height,lt=Z(this.chart.width-z,0,this.maxWidth);T=e.offset?this.maxWidth/O:lt/(O-1),z+6>T&&(T=lt/(O-(e.offset?.5:1)),E=this.maxHeight-Ws(e.grid)-D.padding-js(e.title,this.chart.options.font),L=Math.sqrt(z*z+nt*nt),R=$(Math.min(Math.asin(Z((I.highest.height+6)/T,-1,1)),Math.asin(Z(E/L,-1,1))-Math.asin(Z(nt/L,-1,1)))),R=Math.max(C,Math.min(A,R))),this.labelRotation=R}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){c(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:D,options:{ticks:O,title:C,grid:A}}=this,T=this._isVisible(),E=this.isHorizontal();if(T){const T=js(C,D.options.font);if(E?(e.width=this.maxWidth,e.height=Ws(A)+T):(e.height=this.maxHeight,e.width=Ws(A)+T),O.display&&this.ticks.length){const{first:D,last:C,widest:A,highest:T}=this._getLabelSizes(),L=2*O.padding,R=H(this.labelRotation),I=Math.cos(R),z=Math.sin(R);if(E){const D=O.mirror?0:z*A.width+I*T.height;e.height=Math.min(this.maxHeight,e.height+D+L)}else{const D=O.mirror?0:I*A.width+z*T.height;e.width=Math.min(this.maxWidth,e.width+D+L)}this._calculatePadding(D,C,z,I)}}this._handleMargins(),E?(this.width=this._length=D.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=D.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,D,O,C){const{ticks:{align:A,padding:T},position:E}=this.options,L=0!==this.labelRotation,R="top"!==E&&"x"===this.axis;if(this.isHorizontal()){const E=this.getPixelForTick(0)-this.left,I=this.right-this.getPixelForTick(this.ticks.length-1);let z=0,nt=0;L?R?(z=C*e.width,nt=O*D.height):(z=O*e.height,nt=C*D.width):"start"===A?nt=D.width:"end"===A?z=e.width:"inner"!==A&&(z=e.width/2,nt=D.width/2),this.paddingLeft=Math.max((z-E+T)*this.width/(this.width-E),0),this.paddingRight=Math.max((nt-I+T)*this.width/(this.width-I),0)}else{let O=D.height/2,C=e.height/2;"start"===A?(O=0,C=e.height):"end"===A&&(O=D.height,C=0),this.paddingTop=O+T,this.paddingBottom=C+T}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){c(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:D}=this.options;return"top"===D||"bottom"===D||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let D,O;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),D=0,O=e.length;D{const O=e.gc,C=O.length/2;let A;if(C>D){for(A=0;A({width:A[e]||0,height:T[e]||0});return{first:k(0),last:k(D-1),widest:k(Nt),highest:k(jt),widths:A,heights:T}}getLabelForValue(e){return e}getPixelForValue(e,D){return NaN}getValueForPixel(e){}getPixelForTick(e){const D=this.ticks;return e<0||e>D.length-1?null:this.getPixelForValue(D[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const D=this._startPixel+e*this._length;return J(this._alignToPixels?ve(this.chart,D,0):D)}getDecimalForPixel(e){const D=(e-this._startPixel)/this._length;return this._reversePixels?1-D:D}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:D}=this;return e<0&&D<0?D:e>0&&D>0?e:0}getContext(e){const D=this.ticks||[];if(e>=0&&eE*C?E/O:L/C:L*C0}_computeGridLineItems(e){const D=this.axis,O=this.chart,C=this.options,{grid:A,position:T}=C,E=A.offset,L=this.isHorizontal(),R=this.ticks.length+(E?1:0),I=Ws(A),z=[],nt=A.setContext(this.getContext()),lt=nt.drawBorder?nt.borderWidth:0,mt=lt/2,m=function(e){return ve(O,e,lt)};let Mt,kt,Ct,Bt,Vt,Nt,jt,te,ee,ne,ce,me;if("top"===T)Mt=m(this.bottom),Nt=this.bottom-I,te=Mt-mt,ne=m(e.top)+mt,me=e.bottom;else if("bottom"===T)Mt=m(this.top),ne=e.top,me=m(e.bottom)-mt,Nt=Mt+mt,te=this.top+I;else if("left"===T)Mt=m(this.right),Vt=this.right-I,jt=Mt-mt,ee=m(e.left)+mt,ce=e.right;else if("right"===T)Mt=m(this.left),ee=e.left,ce=m(e.right)-mt,Vt=Mt+mt,jt=this.left+I;else if("x"===D){if("center"===T)Mt=m((e.top+e.bottom)/2+.5);else if(n(T)){const e=Object.keys(T)[0],D=T[e];Mt=m(this.chart.scales[e].getPixelForValue(D))}ne=e.top,me=e.bottom,Nt=Mt+mt,te=Nt+I}else if("y"===D){if("center"===T)Mt=m((e.left+e.right)/2);else if(n(T)){const e=Object.keys(T)[0],D=T[e];Mt=m(this.chart.scales[e].getPixelForValue(D))}Vt=Mt-mt,jt=Vt-I,ee=e.left,ce=e.right}const Xe=r(C.ticks.maxTicksLimit,R),si=Math.max(1,Math.ceil(R/Xe));for(kt=0;ktD.value===e));return O>=0?D.setContext(this.getContext(O)).lineWidth:0}drawGrid(e){const D=this.options.grid,O=this.ctx,C=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let A,T;const a=(e,D,C)=>{C.width&&C.color&&(O.save(),O.lineWidth=C.width,O.strokeStyle=C.color,O.setLineDash(C.borderDash||[]),O.lineDashOffset=C.borderDashOffset,O.beginPath(),O.moveTo(e.x,e.y),O.lineTo(D.x,D.y),O.stroke(),O.restore())};if(D.display)for(A=0,T=C.length;A{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:O+1,draw:()=>{this.drawBorder()}},{z:D,draw:e=>{this.drawLabels(e)}}]:[{z:D,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const D=this.chart.getSortedVisibleDatasetMetas(),O=this.axis+"AxisID",C=[];let A,T;for(A=0,T=D.length;A{const C=O.split("."),A=C.pop(),T=[e].concat(C).join("."),E=D[O].split("."),L=E.pop(),R=E.join(".");me.route(T,A,R,L)}))}(D,e.defaultRoutes);e.descriptors&&me.describe(D,e.descriptors)}(e,T,O),this.override&&me.override(e.id,e.overrides)),T}get(e){return this.items[e]}unregister(e){const D=this.items,O=e.id,C=this.scope;O in D&&delete D[O],C&&O in me[C]&&(delete me[C][O],this.override&&delete ne[O])}}var en=new class{constructor(){this.controllers=new Ys(Ls,"datasets",!0),this.elements=new Ys(Es,"elements"),this.plugins=new Ys(Object,"plugins"),this.scales=new Ys($s,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,D,O){[...D].forEach((D=>{const C=O||this._getRegistryForType(D);O||C.isForType(D)||C===this.plugins&&D.id?this._exec(e,C,D):d(D,(D=>{const C=O||this._getRegistryForType(D);this._exec(e,C,D)}))}))}_exec(e,D,O){const C=w(e);c(O["before"+C],[],O),D[e](O),c(O["after"+C],[],O)}_getRegistryForType(e){for(let D=0;De.filter((e=>!D.some((D=>e.plugin.id===D.plugin.id))));this._notify(s(D,O),e,"stop"),this._notify(s(O,D),e,"start")}}function qs(e,D){return D||!1!==e?!0===e?{}:e:null}function Ks(e,{plugin:D,local:O},C,A){const T=e.pluginScopeKeys(D),E=e.getOptionScopes(C,T);return O&&D.defaults&&E.push(D.defaults),e.createResolver(E,A,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Gs(e,D){const O=me.datasets[e]||{};return((D.datasets||{})[e]||{}).indexAxis||D.indexAxis||O.indexAxis||"x"}function Zs(e,D){return"x"===e||"y"===e?e:D.axis||("top"===(O=D.position)||"bottom"===O?"x":"left"===O||"right"===O?"y":void 0)||e.charAt(0).toLowerCase();var O}function Js(e){const D=e.options||(e.options={});D.plugins=r(D.plugins,{}),D.scales=function(e,D){const O=ne[e.type]||{scales:{}},C=D.scales||{},A=Gs(e.type,D),T=Object.create(null),E=Object.create(null);return Object.keys(C).forEach((e=>{const D=C[e];if(!n(D))return console.error(`Invalid scale configuration for scale: ${e}`);if(D._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const L=Zs(e,D),R=function(e,D){return e===D?"_index_":"_value_"}(L,A),I=O.scales||{};T[L]=T[L]||e,E[e]=b(Object.create(null),[{axis:L},D,I[L],I[R]])})),e.data.datasets.forEach((O=>{const A=O.type||e.type,L=O.indexAxis||Gs(A,D),R=(ne[A]||{}).scales||{};Object.keys(R).forEach((e=>{const D=function(e,D){let O=e;return"_index_"===e?O=D:"_value_"===e&&(O="x"===D?"y":"x"),O}(e,L),A=O[D+"AxisID"]||T[D]||D;E[A]=E[A]||Object.create(null),b(E[A],[{axis:D},C[A],R[e]])}))})),Object.keys(E).forEach((e=>{const D=E[e];b(D,[me.scales[D.type],me.scale])})),E}(e,D)}function Qs(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const ln=new Map,gn=new Set;function sn(e,D){let O=ln.get(e);return O||(O=D(),ln.set(e,O),gn.add(O)),O}const nn=(e,D,O)=>{const C=y(D,O);void 0!==C&&e.add(C)};class on{constructor(e){this._config=function(e){return(e=e||{}).data=Qs(e.data),Js(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Qs(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Js(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return sn(e,(()=>[[`datasets.${e}`,""]]))}datasetAnimationScopeKeys(e,D){return sn(`${e}.transition.${D}`,(()=>[[`datasets.${e}.transitions.${D}`,`transitions.${D}`],[`datasets.${e}`,""]]))}datasetElementScopeKeys(e,D){return sn(`${e}-${D}`,(()=>[[`datasets.${e}.elements.${D}`,`datasets.${e}`,`elements.${D}`,""]]))}pluginScopeKeys(e){const D=e.id;return sn(`${this.type}-plugin-${D}`,(()=>[[`plugins.${D}`,...e.additionalOptionScopes||[]]]))}_cachedScopes(e,D){const O=this._scopeCache;let C=O.get(e);return C&&!D||(C=new Map,O.set(e,C)),C}getOptionScopes(e,D,O){const{options:C,type:A}=this,T=this._cachedScopes(e,O),E=T.get(D);if(E)return E;const L=new Set;D.forEach((D=>{e&&(L.add(e),D.forEach((D=>nn(L,e,D)))),D.forEach((e=>nn(L,C,e))),D.forEach((e=>nn(L,ne[A]||{},e))),D.forEach((e=>nn(L,me,e))),D.forEach((e=>nn(L,ce,e)))}));const R=Array.from(L);return 0===R.length&&R.push(Object.create(null)),gn.has(D)&&T.set(D,R),R}chartOptionScopes(){const{options:e,type:D}=this;return[e,ne[D]||{},me.datasets[D]||{},{type:D},me,ce]}resolveNamedOptions(e,D,O,C=[""]){const A={$shared:!0},{resolver:T,subPrefixes:E}=an(this._resolverCache,e,C);let L=T;if(function(e,D){const{isScriptable:O,isIndexable:C}=Ie(e);for(const A of D){const D=O(A),T=C(A),E=(T||D)&&e[A];if(D&&(k(E)||rn(E))||T&&s(E))return!0}return!1}(T,D)){A.$shared=!1;L=Re(T,O=k(O)?O():O,this.createResolver(e,O,E))}for(const e of D)A[e]=L[e];return A}createResolver(e,D,O=[""],C){const{resolver:A}=an(this._resolverCache,e,O);return n(D)?Re(A,D,void 0,C):A}}function an(e,D,O){let C=e.get(D);C||(C=new Map,e.set(D,C));const A=O.join();let T=C.get(A);T||(T={resolver:Ee(D,O),subPrefixes:O.filter((e=>!e.toLowerCase().includes("hover")))},C.set(A,T));return T}const rn=e=>n(e)&&Object.getOwnPropertyNames(e).reduce(((D,O)=>D||k(e[O])),!1);const _n=["top","bottom","left","right","chartArea"];function hn(e,D){return"top"===e||"bottom"===e||-1===_n.indexOf(e)&&"x"===D}function cn(e,D){return function(O,C){return O[e]===C[e]?O[D]-C[D]:O[e]-C[e]}}function dn(e){const D=e.chart,O=D.options.animation;D.notifyPlugins("afterRender"),c(O&&O.onComplete,[e],D)}function un(e){const D=e.chart,O=D.options.animation;c(O&&O.onProgress,[e],D)}function fn(e){return oe()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const wn={},pn=e=>{const D=fn(e);return Object.values(wn).filter((e=>e.canvas===D)).pop()};function mn(e,D,O){const C=Object.keys(e);for(const A of C){const C=+A;if(C>=D){const T=e[A];delete e[A],(O>0||C>D)&&(e[C+O]=T)}}}class bn{constructor(e,O){const C=this.config=new on(O),A=fn(e),T=pn(A);if(T)throw new Error("Canvas is already in use. Chart with ID '"+T.id+"' must be destroyed before the canvas with ID '"+T.canvas.id+"' can be reused.");const E=C.createResolver(C.chartOptionScopes(),this.getContext());this.platform=new(C.platform||gs(A)),this.platform.updateConfig(C);const L=this.platform.acquireContext(A,E.aspectRatio),R=L&&L.canvas,I=R&&R.height,z=R&&R.width;this.id=D(),this.ctx=L,this.canvas=R,this.width=z,this.height=I,this._options=E,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ct((e=>this.update(e)),E.resizeDelay||0),this._dataChanges=[],wn[this.id]=this,L&&R?(kt.listen(this,"complete",dn),kt.listen(this,"progress",un),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:D},width:O,height:C,_aspectRatio:A}=this;return i(e)?D&&A?A:C?O/C:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return we(this.canvas,this.ctx),this}stop(){return kt.stop(this),this}resize(e,D){kt.running(this)?this._resizeBeforeDraw={width:e,height:D}:this._resize(e,D)}_resize(e,D){const O=this.options,C=this.canvas,A=O.maintainAspectRatio&&this.aspectRatio,T=this.platform.getMaximumSize(C,e,D,A),E=O.devicePixelRatio||this.platform.getDevicePixelRatio(),L=this.width?"resize":"attach";this.width=T.width,this.height=T.height,this._aspectRatio=this.aspectRatio,pe(this,E,!0)&&(this.notifyPlugins("resize",{size:T}),c(O.onResize,[this,T],this),this.attached&&this._doResize(L)&&this.render())}ensureScalesHaveIDs(){d(this.options.scales||{},((e,D)=>{e.id=D}))}buildOrUpdateScales(){const e=this.options,D=e.scales,O=this.scales,C=Object.keys(O).reduce(((e,D)=>(e[D]=!1,e)),{});let A=[];D&&(A=A.concat(Object.keys(D).map((e=>{const O=D[e],C=Zs(e,O),A="r"===C,T="x"===C;return{options:O,dposition:A?"chartArea":T?"bottom":"left",dtype:A?"radialLinear":T?"category":"linear"}})))),d(A,(D=>{const A=D.options,T=A.id,E=Zs(T,A),L=r(A.type,D.dtype);void 0!==A.position&&hn(A.position,E)===hn(D.dposition)||(A.position=D.dposition),C[T]=!0;let R=null;T in O&&O[T].type===L?R=O[T]:(R=new(en.getScale(L))({id:T,type:L,ctx:this.ctx,chart:this}),O[R.id]=R);R.init(A,e)})),d(C,((e,D)=>{e||delete O[D]})),d(O,(e=>{is.configure(this,e,e.options),is.addBox(this,e)}))}_updateMetasets(){const e=this._metasets,D=this.data.datasets.length,O=e.length;if(e.sort(((e,D)=>e.index-D.index)),O>D){for(let e=D;eD.length&&delete this._stacks,e.forEach(((e,O)=>{0===D.filter((D=>D===e._dataset)).length&&this._destroyDatasetMeta(O)}))}buildOrUpdateControllers(){const e=[],D=this.data.datasets;let O,C;for(this._removeUnreferencedMetasets(),O=0,C=D.length;O{this.getDatasetMeta(D).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const D=this.config;D.update();const O=this._options=D.createResolver(D.chartOptionScopes(),this.getContext()),C=this._animationsDisabled=!O.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const A=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let T=0;for(let e=0,D=this.data.datasets.length;e{e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(cn("z","_idx"));const{_active:E,_lastEvent:L}=this;L?this._eventHandler(L,!0):E.length&&this._updateHoverStyles(E,E,!0),this.render()}_updateScales(){d(this.scales,(e=>{is.removeBox(this,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,D=new Set(Object.keys(this._listeners)),O=new Set(e.events);S(D,O)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,D=this._getUniformDataChanges()||[];for(const{method:O,start:C,count:A}of D)mn(e,C,"_removeElements"===O?-A:A)}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const D=this.data.datasets.length,i=D=>new Set(e.filter((e=>e[0]===D)).map(((e,D)=>D+","+e.splice(1).join(",")))),O=i(0);for(let e=1;ee.split(","))).map((e=>({method:e[1],start:+e[2],count:+e[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;is.update(this,this.width,this.height,e);const D=this.chartArea,O=D.width<=0||D.height<=0;this._layers=[],d(this.boxes,(e=>{O&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))}),this),this._layers.forEach(((e,D)=>{e._idx=D})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,D=this.data.datasets.length;e=0;--D)this._drawDataset(e[D]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const D=this.ctx,O=e._clip,C=!O.disabled,A=this.chartArea,T={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",T)&&(C&&Pe(D,{left:!1===O.left?0:A.left-O.left,right:!1===O.right?this.width:A.right+O.right,top:!1===O.top?0:A.top-O.top,bottom:!1===O.bottom?this.height:A.bottom+O.bottom}),e.controller.draw(),C&&De(D),T.cancelable=!1,this.notifyPlugins("afterDatasetDraw",T))}isPointInArea(e){return Se(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,D,O,C){const A=Zi.modes[D];return"function"==typeof A?A(this,e,O,C):[]}getDatasetMeta(e){const D=this.data.datasets[e],O=this._metasets;let C=O.filter((e=>e&&e._dataset===D)).pop();return C||(C={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:D&&D.order||0,index:e,_dataset:D,_parsed:[],_sorted:!1},O.push(C)),C}getContext(){return this.$context||(this.$context=_i(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const D=this.data.datasets[e];if(!D)return!1;const O=this.getDatasetMeta(e);return"boolean"==typeof O.hidden?!O.hidden:!D.hidden}setDatasetVisibility(e,D){this.getDatasetMeta(e).hidden=!D}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,D,O){const C=O?"show":"hide",A=this.getDatasetMeta(e),T=A.controller._resolveAnimations(void 0,C);M(D)?(A.data[D].hidden=!O,this.update()):(this.setDatasetVisibility(e,O),T.update(A,{visible:O}),this.update((D=>D.datasetIndex===e?C:void 0)))}hide(e,D){this._updateVisibility(e,D,!1)}show(e,D){this._updateVisibility(e,D,!0)}_destroyDatasetMeta(e){const D=this._metasets[e];D&&D.controller&&D.controller._destroy(),delete this._metasets[e]}_stop(){let e,D;for(this.stop(),kt.remove(this),e=0,D=this.data.datasets.length;e{D.addEventListener(this,O,C),e[O]=C},s=(e,D,O)=>{e.offsetX=D,e.offsetY=O,this._eventHandler(e)};d(this.options.events,(e=>i(e,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,D=this.platform,i=(O,C)=>{D.addEventListener(this,O,C),e[O]=C},s=(O,C)=>{e[O]&&(D.removeEventListener(this,O,C),delete e[O])},n=(e,D)=>{this.canvas&&this.resize(e,D)};let O;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",O)};O=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},D.isAttached(this.canvas)?a():O()}unbindEvents(){d(this._listeners,((e,D)=>{this.platform.removeEventListener(this,D,e)})),this._listeners={},d(this._responsiveListeners,((e,D)=>{this.platform.removeEventListener(this,D,e)})),this._responsiveListeners=void 0}updateHoverStyle(e,D,O){const C=O?"set":"remove";let A,T,E,L;for("dataset"===D&&(A=this.getDatasetMeta(e[0].datasetIndex),A.controller["_"+C+"DatasetHoverStyle"]()),E=0,L=e.length;E{const O=this.getDatasetMeta(e);if(!O)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:O.data[D],index:D}}));!u(O,D)&&(this._active=O,this._lastEvent=null,this._updateHoverStyles(O,D))}notifyPlugins(e,D,O){return this._plugins.notify(this,e,D,O)}_updateHoverStyles(e,D,O){const C=this.options.hover,n=(e,D)=>e.filter((e=>!D.some((D=>e.datasetIndex===D.datasetIndex&&e.index===D.index)))),A=n(D,e),T=O?e:n(e,D);A.length&&this.updateHoverStyle(A,C.mode,!1),T.length&&C.mode&&this.updateHoverStyle(T,C.mode,!0)}_eventHandler(e,D){const O={event:e,replay:D,cancelable:!0,inChartArea:this.isPointInArea(e)},s=D=>(D.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",O,s))return;const C=this._handleEvent(e,D,O.inChartArea);return O.cancelable=!1,this.notifyPlugins("afterEvent",O,s),(C||O.changed)&&this.render(),this}_handleEvent(e,D,O){const{_active:C=[],options:A}=this,T=D,E=this._getActiveElements(e,C,O,T),L=P(e),R=function(e,D,O,C){return O&&"mouseout"!==e.type?C?D:e:null}(e,this._lastEvent,O,L);O&&(this._lastEvent=null,c(A.onHover,[e,E,this],this),L&&c(A.onClick,[e,E,this],this));const I=!u(E,C);return(I||D)&&(this._active=E,this._updateHoverStyles(E,C,D)),this._lastEvent=R,I}_getActiveElements(e,D,O,C){if("mouseout"===e.type)return[];if(!O)return D;const A=this.options.hover;return this.getElementsAtEventForMode(e,A.mode,A,C)}}const xn=()=>d(bn.instances,(e=>e._plugins.invalidate())),Bn=!0;function yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(bn,{defaults:{enumerable:Bn,value:me},instances:{enumerable:Bn,value:wn},overrides:{enumerable:Bn,value:ne},registry:{enumerable:Bn,value:en},version:{enumerable:Bn,value:"3.9.1"},getChart:{enumerable:Bn,value:pn},register:{enumerable:Bn,value:(...e)=>{en.add(...e),xn()}},unregister:{enumerable:Bn,value:(...e)=>{en.remove(...e),xn()}}});class vn{constructor(e){this.options=e||{}}init(e){}formats(){return yn()}parse(e,D){return yn()}format(e,D){return yn()}add(e,D,O){return yn()}diff(e,D,O){return yn()}startOf(e,D,O){return yn()}endOf(e,D){return yn()}}vn.override=function(e){Object.assign(vn.prototype,e)};var Jn={_date:vn};function Mn(e){const D=e.iScale,O=function(e,D){if(!e._cache.$bar){const O=e.getMatchingVisibleMetas(D);let C=[];for(let D=0,A=O.length;De-D)))}return e._cache.$bar}(D,e.type);let C,A,T,E,L=D._length;const l=()=>{32767!==T&&-32768!==T&&(M(E)&&(L=Math.min(L,Math.abs(T-E)||L)),E=T)};for(C=0,A=O.length;CMath.abs(L)&&(R=L,I=E),D[O.axis]=I,D._custom={barStart:R,barEnd:I,start:A,end:T,min:E,max:L}}(e,D,O,C):D[O.axis]=O.parse(e,C),D}function Sn(e,D,O,C){const A=e.iScale,T=e.vScale,E=A.getLabels(),L=A===T,R=[];let I,z,nt,lt;for(I=O,z=O+C;Ie.x,O="left",C="right"):(D=e.basee.controller.options.grouped)),A=O.options.stacked,T=[],r=e=>{const O=e.controller.getParsed(D),C=O&&O[e.vScale.axis];if(i(C)||isNaN(C))return!0};for(const O of C)if((void 0===D||!r(O))&&((!1===A||-1===T.indexOf(O.stack)||void 0===A&&void 0===O.stack)&&T.push(O.stack),O.index===e))break;return T.length||T.push(void 0),T}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,D,O){const C=this._getStacks(e,O),A=void 0!==D?C.indexOf(D):-1;return-1===A?C.length-1:A}_getRuler(){const e=this.options,D=this._cachedMeta,O=D.iScale,C=[];let A,T;for(A=0,T=D.data.length;A=O?1:-1)}(z,D,T)*A,nt===T&&(Ct-=z/2);const e=D.getPixelForDecimal(0),O=D.getPixelForDecimal(1),C=Math.min(e,O),E=Math.max(e,O);Ct=Math.max(Math.min(Ct,E),C),I=Ct+z}if(Ct===D.getPixelForValue(T)){const e=lt(z)*D.getLineWidthForValue(T)/2;Ct+=e,z-=e}return{size:z,base:Ct,head:I,center:I+z/2}}_calculateBarIndexPixels(e,D){const O=D.scale,C=this.options,A=C.skipNull,T=r(C.maxBarThickness,1/0);let E,L;if(D.grouped){const O=A?this._getStackCount(e):D.stackCount,R="flex"===C.barThickness?function(e,D,O,C){const A=D.pixels,T=A[e];let E=e>0?A[e-1]:null,L=e=0;--O)D=Math.max(D,e[O].size(this.resolveDataElementOptions(O))/2);return D>0&&D}getLabelAndValue(e){const D=this._cachedMeta,{xScale:O,yScale:C}=D,A=this.getParsed(e),T=O.getLabelForValue(A.x),E=C.getLabelForValue(A.y),L=A._custom;return{label:D.label,value:"("+T+", "+E+(L?", "+L:"")+")"}}update(e){const D=this._cachedMeta.data;this.updateElements(D,0,D.length,e)}updateElements(e,D,O,C){const A="reset"===C,{iScale:T,vScale:E}=this._cachedMeta,{sharedOptions:L,includeOptions:R}=this._getSharedOptions(D,C),I=T.axis,z=E.axis;for(let nt=D;nt""}}}};class En extends Ls{constructor(e,D){super(e,D),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,D){const O=this.getDataset().data,C=this._cachedMeta;if(!1===this._parsing)C._parsed=O;else{let A,T,r=e=>+O[e];if(n(O[e])){const{key:e="value"}=this._parsing;r=D=>+y(O[D],e)}for(A=e,T=e+D;AG(e,A,z,!0)?1:Math.max(D,D*O,C,C*O),g=(e,D,C)=>G(e,A,z,!0)?-1:Math.min(D,D*O,C,C*O),kt=f(0,nt,mt),Ct=f(R,lt,Mt),Bt=g(C,nt,mt),Vt=g(C+R,lt,Mt);T=(kt-Bt)/2,E=(Ct-Vt)/2,L=-(kt+Bt)/2,I=-(Ct+Vt)/2}return{ratioX:T,ratioY:E,offsetX:L,offsetY:I}}(mt,lt,z),Vt=(O.width-L)/Mt,Nt=(O.height-L)/kt,jt=Math.max(Math.min(Vt,Nt)/2,0),te=h(this.options.radius,jt),ee=(te-Math.max(te*z,0))/this._getVisibleDatasetWeightTotal();this.offsetX=Ct*te,this.offsetY=Bt*te,T.total=this.calculateTotal(),this.outerRadius=te-ee*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-ee*nt,0),this.updateElements(E,0,E.length,e)}_circumference(e,D){const O=this.options,C=this._cachedMeta,T=this._getCircumference();return D&&O.animation.animateRotate||!this.chart.getDataVisibility(e)||null===C._parsed[e]||C.data[e].hidden?0:this.calculateCircumference(C._parsed[e]*T/A)}updateElements(e,D,O,C){const A="reset"===C,T=this.chart,E=T.chartArea,L=T.options.animation,R=(E.left+E.right)/2,I=(E.top+E.bottom)/2,z=A&&L.animateScale,nt=z?0:this.innerRadius,lt=z?0:this.outerRadius,{sharedOptions:mt,includeOptions:Mt}=this._getSharedOptions(D,C);let kt,Ct=this._getRotation();for(kt=0;kt0&&!isNaN(e)?A*(Math.abs(e)/D):0}getLabelAndValue(e){const D=this._cachedMeta,O=this.chart,C=O.data.labels||[],A=li(D._parsed[e],O.options.locale);return{label:C[e]||"",value:A}}getMaxBorderWidth(e){let D=0;const O=this.chart;let C,A,T,E,L;if(!e)for(C=0,A=O.data.datasets.length;C"spacing"!==e,_indexable:e=>"spacing"!==e},En.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const D=e.data;if(D.labels.length&&D.datasets.length){const{labels:{pointStyle:O}}=e.legend.options;return D.labels.map(((D,C)=>{const A=e.getDatasetMeta(0).controller.getStyle(C);return{text:D,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,lineWidth:A.borderWidth,pointStyle:O,hidden:!e.getDataVisibility(C),index:C}}))}return[]}},onClick(e,D,O){O.chart.toggleDataVisibility(D.index),O.chart.update()}},tooltip:{callbacks:{title:()=>"",label(e){let D=e.label;const O=": "+e.formattedValue;return s(D)?(D=D.slice(),D[0]+=O):D+=O,D}}}}};class Rn extends Ls{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const D=this._cachedMeta,{dataset:O,data:C=[],_dataset:A}=D,T=this.chart._animationsDisabled;let{start:E,count:L}=gt(D,C,T);this._drawStart=E,this._drawCount=L,pt(D)&&(E=0,L=C.length),O._chart=this.chart,O._datasetIndex=this.index,O._decimated=!!A._decimated,O.points=C;const R=this.resolveDatasetElementOptions(e);this.options.showLine||(R.borderWidth=0),R.segment=this.options.segment,this.updateElement(O,void 0,{animated:!T,options:R},e),this.updateElements(C,E,L,e)}updateElements(e,D,O,C){const A="reset"===C,{iScale:T,vScale:E,_stacked:L,_dataset:R}=this._cachedMeta,{sharedOptions:I,includeOptions:z}=this._getSharedOptions(D,C),nt=T.axis,lt=E.axis,{spanGaps:mt,segment:Mt}=this.options,kt=B(mt)?mt:Number.POSITIVE_INFINITY,Ct=this.chart._animationsDisabled||A||"none"===C;let Bt=D>0&&this.getParsed(D-1);for(let mt=D;mt0&&Math.abs(O[nt]-Bt[nt])>kt,Mt&&(Vt.parsed=O,Vt.raw=R.data[mt]),z&&(Vt.options=I||this.resolveDataElementOptions(mt,D.active?"active":C)),Ct||this.updateElement(D,mt,Vt,C),Bt=O}}getMaxOverflow(){const e=this._cachedMeta,D=e.dataset,O=D.options&&D.options.borderWidth||0,C=e.data||[];if(!C.length)return O;const A=C[0].size(this.resolveDataElementOptions(0)),T=C[C.length-1].size(this.resolveDataElementOptions(C.length-1));return Math.max(O,A,T)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Rn.id="line",Rn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Rn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class In extends Ls{constructor(e,D){super(e,D),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const D=this._cachedMeta,O=this.chart,C=O.data.labels||[],A=li(D._parsed[e].r,O.options.locale);return{label:C[e]||"",value:A}}parseObjectData(e,D,O,C){return Ue.bind(this)(e,D,O,C)}update(e){const D=this._cachedMeta.data;this._updateRadius(),this.updateElements(D,0,D.length,e)}getMinMax(){const e=this._cachedMeta,D={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(((e,O)=>{const C=this.getParsed(O).r;!isNaN(C)&&this.chart.getDataVisibility(O)&&(CD.max&&(D.max=C))})),D}_updateRadius(){const e=this.chart,D=e.chartArea,O=e.options,C=Math.min(D.right-D.left,D.bottom-D.top),A=Math.max(C/2,0),T=(A-Math.max(O.cutoutPercentage?A/100*O.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=A-T*this.index,this.innerRadius=this.outerRadius-T}updateElements(e,D,O,A){const T="reset"===A,E=this.chart,L=E.options.animation,R=this._cachedMeta.rScale,I=R.xCenter,z=R.yCenter,nt=R.getIndexAngle(0)-.5*C;let lt,mt=nt;const Mt=360/this.countVisibleElements();for(lt=0;lt{!isNaN(this.getParsed(O).r)&&this.chart.getDataVisibility(O)&&D++})),D}_computeAngle(e,D,O){return this.chart.getDataVisibility(e)?H(this.resolveDataElementOptions(e,D).angle||O):0}}In.id="polarArea",In.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},In.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const D=e.data;if(D.labels.length&&D.datasets.length){const{labels:{pointStyle:O}}=e.legend.options;return D.labels.map(((D,C)=>{const A=e.getDatasetMeta(0).controller.getStyle(C);return{text:D,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,lineWidth:A.borderWidth,pointStyle:O,hidden:!e.getDataVisibility(C),index:C}}))}return[]}},onClick(e,D,O){O.chart.toggleDataVisibility(D.index),O.chart.update()}},tooltip:{callbacks:{title:()=>"",label:e=>e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class zn extends En{}zn.id="pie",zn.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Fn extends Ls{getLabelAndValue(e){const D=this._cachedMeta.vScale,O=this.getParsed(e);return{label:D.getLabels()[e],value:""+D.getLabelForValue(O[D.axis])}}parseObjectData(e,D,O,C){return Ue.bind(this)(e,D,O,C)}update(e){const D=this._cachedMeta,O=D.dataset,C=D.data||[],A=D.iScale.getLabels();if(O.points=C,"resize"!==e){const D=this.resolveDatasetElementOptions(e);this.options.showLine||(D.borderWidth=0);const T={_loop:!0,_fullLoop:A.length===C.length,options:D};this.updateElement(O,void 0,T,e)}this.updateElements(C,0,C.length,e)}updateElements(e,D,O,C){const A=this._cachedMeta.rScale,T="reset"===C;for(let E=D;E0&&this.getParsed(D-1);for(let I=D;I0&&Math.abs(O[lt]-Vt[lt])>Ct,kt&&(Mt.parsed=O,Mt.raw=R.data[I]),nt&&(Mt.options=z||this.resolveDataElementOptions(I,D.active?"active":C)),Bt||this.updateElement(D,I,Mt,C),Vt=O}this.updateSharedOptions(z,C,I)}getMaxOverflow(){const e=this._cachedMeta,D=e.data||[];if(!this.options.showLine){let e=0;for(let O=D.length-1;O>=0;--O)e=Math.max(e,D[O].size(this.resolveDataElementOptions(O))/2);return e>0&&e}const O=e.dataset,C=O.options&&O.options.borderWidth||0;if(!D.length)return C;const A=D[0].size(this.resolveDataElementOptions(0)),T=D[D.length-1].size(this.resolveDataElementOptions(D.length-1));return Math.max(C,A,T)/2}}Vn.id="scatter",Vn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Vn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:e=>"("+e.label+", "+e.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var co=Object.freeze({__proto__:null,BarController:Tn,BubbleController:Ln,DoughnutController:En,LineController:Rn,PolarAreaController:In,PieController:zn,RadarController:Fn,ScatterController:Vn});function Nn(e,D,O){const{startAngle:C,pixelMargin:A,x:T,y:E,outerRadius:L,innerRadius:I}=D;let z=A/L;e.beginPath(),e.arc(T,E,L,C-z,O+z),I>A?(z=A/I,e.arc(T,E,I,O+z,C-z,!0)):e.arc(T,E,A,O+R,C-R),e.closePath(),e.clip()}function Wn(e,D,O,C){const A=ui(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const T=(O-D)/2,E=Math.min(T,C*D/2),r=e=>{const D=(O-Math.min(T,e))*C/2;return Z(e,0,Math.min(T,D))};return{outerStart:r(A.outerStart),outerEnd:r(A.outerEnd),innerStart:Z(A.innerStart,0,E),innerEnd:Z(A.innerEnd,0,E)}}function jn(e,D,O,C){return{x:O+e*Math.cos(D),y:C+e*Math.sin(D)}}function Hn(e,D,O,A,T,E){const{x:L,y:I,startAngle:z,pixelMargin:nt,innerRadius:lt}=D,mt=Math.max(D.outerRadius+A+O-nt,0),Mt=lt>0?lt+A+O+nt:0;let kt=0;const Ct=T-z;if(A){const e=((lt>0?lt-A:0)+(mt>0?mt-A:0))/2;kt=(Ct-(0!==e?Ct*e/(e+A):Ct))/2}const Bt=(Ct-Math.max(.001,Ct*mt-O/C)/mt)/2,Vt=z+Bt+kt,Nt=T-Bt-kt,{outerStart:jt,outerEnd:te,innerStart:ee,innerEnd:ne}=Wn(D,Mt,mt,Nt-Vt),ce=mt-jt,me=mt-te,Xe=Vt+jt/ce,si=Nt-te/me,ri=Mt+ee,hi=Mt+ne,ci=Vt+ee/ri,Ti=Nt-ne/hi;if(e.beginPath(),E){if(e.arc(L,I,mt,Xe,si),te>0){const D=jn(me,si,L,I);e.arc(D.x,D.y,te,si,Nt+R)}const D=jn(hi,Nt,L,I);if(e.lineTo(D.x,D.y),ne>0){const D=jn(hi,Ti,L,I);e.arc(D.x,D.y,ne,Nt+R,Ti+Math.PI)}if(e.arc(L,I,Mt,Nt-ne/Mt,Vt+ee/Mt,!0),ee>0){const D=jn(ri,ci,L,I);e.arc(D.x,D.y,ee,ci+Math.PI,Vt-R)}const O=jn(ce,Vt,L,I);if(e.lineTo(O.x,O.y),jt>0){const D=jn(ce,Xe,L,I);e.arc(D.x,D.y,jt,Vt-R,Xe)}}else{e.moveTo(L,I);const D=Math.cos(Xe)*mt+L,O=Math.sin(Xe)*mt+I;e.lineTo(D,O);const C=Math.cos(si)*mt+L,A=Math.sin(si)*mt+I;e.lineTo(C,A)}e.closePath()}function $n(e,D,O,C,T,E){const{options:L}=D,{borderWidth:R,borderJoinStyle:I}=L,z="inner"===L.borderAlign;R&&(z?(e.lineWidth=2*R,e.lineJoin=I||"round"):(e.lineWidth=R,e.lineJoin=I||"bevel"),D.fullCircles&&function(e,D,O){const{x:C,y:T,startAngle:E,pixelMargin:L,fullCircles:R}=D,I=Math.max(D.outerRadius-L,0),z=D.innerRadius+L;let nt;for(O&&Nn(e,D,E+A),e.beginPath(),e.arc(C,T,z,E+A,E,!0),nt=0;nt=A||G(T,L,R),Mt=Q(E,I+lt,z+lt);return mt&&Mt}getCenterPoint(e){const{x:D,y:O,startAngle:C,endAngle:A,innerRadius:T,outerRadius:E}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:L,spacing:R}=this.options,I=(C+A)/2,z=(T+E+R+L)/2;return{x:D+Math.cos(I)*z,y:O+Math.sin(I)*z}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:D,circumference:O}=this,T=(D.offset||0)/2,E=(D.spacing||0)/2,L=D.circular;if(this.pixelMargin="inner"===D.borderAlign?.33:0,this.fullCircles=O>A?Math.floor(O/A):0,0===O||this.innerRadius<0||this.outerRadius<0)return;e.save();let R=0;if(T){R=T/2;const D=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(D)*R,Math.sin(D)*R),this.circumference>=C&&(R=T)}e.fillStyle=D.backgroundColor,e.strokeStyle=D.borderColor;const I=function(e,D,O,C,T){const{fullCircles:E,startAngle:L,circumference:R}=D;let I=D.endAngle;if(E){Hn(e,D,O,C,L+A,T);for(let D=0;DL&&T>L;return{count:C,start:R,loop:D.loop,ilen:I(E+(I?L-e:e))%T,_=()=>{mt!==Mt&&(e.lineTo(Ct,Mt),e.lineTo(Ct,mt),e.lineTo(Ct,kt))};for(R&&(nt=A[x(0)],e.moveTo(nt.x,nt.y)),z=0;z<=L;++z){if(nt=A[x(z)],nt.skip)continue;const D=nt.x,O=nt.y,C=0|D;C===lt?(OMt&&(Mt=O),Ct=(Bt*Ct+D)/++Bt):(_(),e.lineTo(D,O),lt=C,Bt=0,mt=Mt=O),kt=O}_()}function Zn(e){const D=e.options,O=D.borderDash&&D.borderDash.length;return e._decimated||e._loop||D.tension||"monotone"===D.cubicInterpolationMode||D.stepped||O?Kn:Gn}Yn.id="arc",Yn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Yn.defaultRoutes={backgroundColor:"backgroundColor"};const go="function"==typeof Path2D;function Qn(e,D,O,C){go&&!D.options.segment?function(e,D,O,C){let A=D._path;A||(A=D._path=new Path2D,D.path(A,O,C)&&A.closePath()),Un(e,D.options),e.stroke(A)}(e,D,O,C):function(e,D,O,C){const{segments:A,options:T}=D,E=Zn(D);for(const L of A)Un(e,T,L.style),e.beginPath(),E(e,D,L,{start:O,end:O+C-1})&&e.closePath(),e.stroke()}(e,D,O,C)}class to extends Es{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,D){const O=this.options;if((O.tension||"monotone"===O.cubicInterpolationMode)&&!O.stepped&&!this._pointsUpdated){const C=O.spanGaps?this._loop:this._fullLoop;Qe(this._points,O,e,C,D),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Di(this,this.options.segment))}first(){const e=this.segments,D=this.points;return e.length&&D[e[0].start]}last(){const e=this.segments,D=this.points,O=e.length;return O&&D[e[O-1].end]}interpolate(e,D){const O=this.options,C=e[D],A=this.points,T=Pi(this,{property:D,start:C,end:C});if(!T.length)return;const E=[],L=function(e){return e.stepped?oi:e.tension||"monotone"===e.cubicInterpolationMode?ai:ni}(O);let R,I;for(R=0,I=T.length;R"borderDash"!==e&&"fill"!==e};class io extends Es{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,D,O){const C=this.options,{x:A,y:T}=this.getProps(["x","y"],O);return Math.pow(e-A,2)+Math.pow(D-T,2){uo(e)}))}var Ro={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(D,O,C)=>{if(!C.enabled)return void fo(D);const A=D.width;D.data.datasets.forEach(((O,T)=>{const{_data:E,indexAxis:L}=O,R=D.getDatasetMeta(T),I=E||O.data;if("y"===bi([L,D.options.indexAxis]))return;if(!R.controller.supportsDecimation)return;const z=D.scales[R.xAxisID];if("linear"!==z.type&&"time"!==z.type)return;if(D.options.parsing)return;let{start:nt,count:lt}=function(e,D){const O=D.length;let C,A=0;const{iScale:T}=e,{min:E,max:L,minDefined:R,maxDefined:I}=T.getUserBounds();return R&&(A=Z(et(D,T.axis,E).lo,0,O-1)),C=I?Z(et(D,T.axis,L).hi+1,A,O)-A:O-A,{start:A,count:C}}(R,I);if(lt<=(C.threshold||4*A))return void uo(O);let mt;switch(i(E)&&(O._data=I,delete O.data,Object.defineProperty(O,"data",{configurable:!0,enumerable:!0,get:function(){return(this||e)._decimated},set:function(D){(this||e)._data=D}})),C.algorithm){case"lttb":mt=function(e,D,O,C,A){const T=A.samples||C;if(T>=O)return e.slice(D,D+O);const E=[],L=(O-2)/(T-2);let R=0;const I=D+O-1;let z,nt,lt,mt,Mt,kt=D;for(E[R++]=e[kt],z=0;zlt&&(lt=mt,nt=e[C],Mt=C);E[R++]=nt,kt=Mt}return E[R++]=e[I],E}(I,nt,lt,A,C);break;case"min-max":mt=function(e,D,O,C){let A,T,E,L,R,I,z,nt,lt,mt,Mt=0,kt=0;const Ct=[],Bt=D+O-1,Vt=e[D].x,Nt=e[Bt].x-Vt;for(A=D;Amt&&(mt=L,z=A),Mt=(kt*Mt+T.x)/++kt;else{const O=A-1;if(!i(I)&&!i(z)){const D=Math.min(I,z),C=Math.max(I,z);D!==nt&&D!==O&&Ct.push({...e[D],x:Mt}),C!==nt&&C!==O&&Ct.push({...e[C],x:Mt})}A>0&&O!==nt&&Ct.push(e[O]),Ct.push(T),R=D,kt=0,lt=mt=L,I=z=nt=A}}return Ct}(I,nt,lt,A);break;default:throw new Error(`Unsupported decimation algorithm '${C.algorithm}'`)}O._decimated=mt}))},destroy(e){fo(e)}};function po(e,D,O,C){if(C)return;let A=D[e],T=O[e];return"angle"===e&&(A=K(A),T=K(T)),{property:e,start:A,end:T}}function mo(e,D,O){for(;D>e;D--){const e=O[D];if(!isNaN(e.x)&&!isNaN(e.y))break}return D}function bo(e,D,O,C){return e&&D?C(e[O],D[O]):e?e[O]:D?D[O]:0}function xo(e,D){let O=[],C=!1;return s(e)?(C=!0,O=e):O=function(e,D){const{x:O=null,y:C=null}=e||{},A=D.points,T=[];return D.segments.forEach((({start:e,end:D})=>{D=mo(e,D,A);const E=A[e],L=A[D];null!==C?(T.push({x:E.x,y:C}),T.push({x:L.x,y:C})):null!==O&&(T.push({x:O,y:E.y}),T.push({x:O,y:L.y}))})),T}(e,D),O.length?new to({points:O,options:{tension:0},_loop:C,_fullLoop:C}):null}function _o(e){return e&&!1!==e.fill}function yo(e,D,O){let C=e[D].fill;const A=[D];let T;if(!O)return C;for(;!1!==C&&-1===A.indexOf(C);){if(!o(C))return C;if(T=e[C],!T)return!1;if(T.visible)return C;A.push(C),C=T.fill}return!1}function vo(e,D,O){const C=function(e){const D=e.options,O=D.fill;let C=r(O&&O.target,O);void 0===C&&(C=!!D.backgroundColor);return!1!==C&&null!==C&&(!0===C?"origin":C)}(e);if(n(C))return!isNaN(C.value)&&C;let A=parseFloat(C);return o(A)&&Math.floor(A)===A?function(e,D,O,C){"-"!==e&&"+"!==e||(O=D+O);return!(O===D||O<0||O>=C)&&O}(C[0],D,A,O):["origin","start","end","stack","shape"].indexOf(C)>=0&&C}function wo(e,D,O){const C=[];for(let A=0;A=0;--D){const O=A[D].$filler;O&&(O.line.updateControlPoints(T,O.axis),C&&O.fill&&Po(e.ctx,O,T))}},beforeDatasetsDraw(e,D,O){if("beforeDatasetsDraw"!==O.drawTime)return;const C=e.getSortedVisibleDatasetMetas();for(let D=C.length-1;D>=0;--D){const O=C[D].$filler;_o(O)&&Po(e.ctx,O,e.chartArea)}},beforeDatasetDraw(e,D,O){const C=D.meta.$filler;_o(C)&&"beforeDatasetDraw"===O.drawTime&&Po(e.ctx,C,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Lo=(e,D)=>{let{boxHeight:O=D,boxWidth:C=D}=e;return e.usePointStyle&&(O=Math.min(O,D),C=e.pointStyleWidth||Math.min(C,D)),{boxWidth:C,boxHeight:O,itemHeight:Math.max(D,O)}};class Eo extends Es{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,D,O){this.maxWidth=e,this.maxHeight=D,this._margins=O,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let D=c(e.generateLabels,[this.chart],this)||[];e.filter&&(D=D.filter((D=>e.filter(D,this.chart.data)))),e.sort&&(D=D.sort(((D,O)=>e.sort(D,O,this.chart.data)))),this.options.reverse&&D.reverse(),this.legendItems=D}fit(){const{options:e,ctx:D}=this;if(!e.display)return void(this.width=this.height=0);const O=e.labels,C=mi(O.font),A=C.size,T=this._computeTitleHeight(),{boxWidth:E,itemHeight:L}=Lo(O,A);let R,I;D.font=C.string,this.isHorizontal()?(R=this.maxWidth,I=this._fitRows(T,A,E,L)+10):(I=this.maxHeight,R=this._fitCols(T,A,E,L)+10),this.width=Math.min(R,e.maxWidth||this.maxWidth),this.height=Math.min(I,e.maxHeight||this.maxHeight)}_fitRows(e,D,O,C){const{ctx:A,maxWidth:T,options:{labels:{padding:E}}}=this,L=this.legendHitBoxes=[],R=this.lineWidths=[0],I=C+E;let z=e;A.textAlign="left",A.textBaseline="middle";let nt=-1,lt=-I;return this.legendItems.forEach(((e,mt)=>{const Mt=O+D/2+A.measureText(e.text).width;(0===mt||R[R.length-1]+Mt+2*E>T)&&(z+=I,R[R.length-(mt>0?0:1)]=0,lt+=I,nt++),L[mt]={left:0,top:lt,row:nt,width:Mt,height:C},R[R.length-1]+=Mt+E})),z}_fitCols(e,D,O,C){const{ctx:A,maxHeight:T,options:{labels:{padding:E}}}=this,L=this.legendHitBoxes=[],R=this.columnSizes=[],I=T-e;let z=E,nt=0,lt=0,mt=0,Mt=0;return this.legendItems.forEach(((e,T)=>{const kt=O+D/2+A.measureText(e.text).width;T>0&<+C+2*E>I&&(z+=nt+E,R.push({width:nt,height:lt}),mt+=nt+E,Mt++,nt=lt=0),L[T]={left:mt,top:lt,col:Mt,width:kt,height:C},nt=Math.max(nt,kt),lt+=C+E})),z+=nt,R.push({width:nt,height:lt}),z}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:D,options:{align:O,labels:{padding:C},rtl:A}}=this,T=yi(A,this.left,this.width);if(this.isHorizontal()){let A=0,E=ut(O,this.left+C,this.right-this.lineWidths[A]);for(const L of D)A!==L.row&&(A=L.row,E=ut(O,this.left+C,this.right-this.lineWidths[A])),L.top+=this.top+e+C,L.left=T.leftForLtr(T.x(E),L.width),E+=L.width+C}else{let A=0,E=ut(O,this.top+e+C,this.bottom-this.columnSizes[A].height);for(const L of D)L.col!==A&&(A=L.col,E=ut(O,this.top+e+C,this.bottom-this.columnSizes[A].height)),L.top=E,L.left+=this.left+C,L.left=T.leftForLtr(T.x(L.left),L.width),E+=L.height+C}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;Pe(e,this),this._draw(),De(e)}}_draw(){const{options:e,columnSizes:D,lineWidths:O,ctx:C}=this,{align:A,labels:T}=e,E=me.color,L=yi(e.rtl,this.left,this.width),R=mi(T.font),{color:I,padding:z}=T,nt=R.size,lt=nt/2;let mt;this.drawTitle(),C.textAlign=L.textAlign("left"),C.textBaseline="middle",C.lineWidth=.5,C.font=R.string;const{boxWidth:Mt,boxHeight:kt,itemHeight:Ct}=Lo(T,nt),Bt=this.isHorizontal(),Vt=this._computeTitleHeight();mt=Bt?{x:ut(A,this.left+z,this.right-O[0]),y:this.top+z+Vt,line:0}:{x:this.left+z,y:ut(A,this.top+Vt+z,this.bottom-D[0].height),line:0},vi(this.ctx,e.textDirection);const Nt=Ct+z;this.legendItems.forEach(((jt,te)=>{C.strokeStyle=jt.fontColor||I,C.fillStyle=jt.fontColor||I;const ee=C.measureText(jt.text).width,ne=L.textAlign(jt.textAlign||(jt.textAlign=T.textAlign)),ce=Mt+lt+ee;let me=mt.x,Xe=mt.y;L.setWidth(this.width),Bt?te>0&&me+ce+z>this.right&&(Xe=mt.y+=Nt,mt.line++,me=mt.x=ut(A,this.left+z,this.right-O[mt.line])):te>0&&Xe+Nt>this.bottom&&(me=mt.x=me+D[mt.line].width+z,mt.line++,Xe=mt.y=ut(A,this.top+Vt+z,this.bottom-D[mt.line].height));!function(e,D,O){if(isNaN(Mt)||Mt<=0||isNaN(kt)||kt<0)return;C.save();const A=r(O.lineWidth,1);if(C.fillStyle=r(O.fillStyle,E),C.lineCap=r(O.lineCap,"butt"),C.lineDashOffset=r(O.lineDashOffset,0),C.lineJoin=r(O.lineJoin,"miter"),C.lineWidth=A,C.strokeStyle=r(O.strokeStyle,E),C.setLineDash(r(O.lineDash,[])),T.usePointStyle){const E={radius:kt*Math.SQRT2/2,pointStyle:O.pointStyle,rotation:O.rotation,borderWidth:A},R=L.xPlus(e,Mt/2);ke(C,E,R,D+lt,T.pointStyleWidth&&Mt)}else{const T=D+Math.max((nt-kt)/2,0),E=L.leftForLtr(e,Mt),R=gi(O.borderRadius);C.beginPath(),Object.values(R).some((e=>0!==e))?Le(C,{x:E,y:T,w:Mt,h:kt,radius:R}):C.rect(E,T,Mt,kt),C.fill(),0!==A&&C.stroke()}C.restore()}(L.x(me),Xe,jt),me=ft(ne,me+Mt+lt,Bt?me+ce:this.right,e.rtl),function(e,D,O){Ae(C,O.text,e,D+Ct/2,R,{strikethrough:O.hidden,textAlign:L.textAlign(O.textAlign)})}(L.x(me),Xe,jt),Bt?mt.x+=ce+z:mt.y+=Nt})),wi(this.ctx,e.textDirection)}drawTitle(){const e=this.options,D=e.title,O=mi(D.font),C=pi(D.padding);if(!D.display)return;const A=yi(e.rtl,this.left,this.width),T=this.ctx,E=D.position,L=O.size/2,R=C.top+L;let I,z=this.left,nt=this.width;if(this.isHorizontal())nt=Math.max(...this.lineWidths),I=this.top+R,z=ut(e.align,z,this.right-nt);else{const D=this.columnSizes.reduce(((e,D)=>Math.max(e,D.height)),0);I=R+ut(e.align,this.top,this.bottom-D-e.labels.padding-this._computeTitleHeight())}const lt=ut(E,z,z+nt);T.textAlign=A.textAlign(dt(E)),T.textBaseline="middle",T.strokeStyle=D.color,T.fillStyle=D.color,T.font=O.string,Ae(T,D.text,lt,I,O)}_computeTitleHeight(){const e=this.options.title,D=mi(e.font),O=pi(e.padding);return e.display?D.lineHeight+O.height:0}_getLegendItemAt(e,D){let O,C,A;if(Q(e,this.left,this.right)&&Q(D,this.top,this.bottom))for(A=this.legendHitBoxes,O=0;Oe.chart.options.color,boxWidth:40,padding:10,generateLabels(D){const O=D.data.datasets,{labels:{usePointStyle:C,pointStyle:A,textAlign:T,color:E}}=D.legend.options;return D._getSortedDatasetMetas().map((e=>{const D=e.controller.getStyle(C?0:void 0),L=pi(D.borderWidth);return{text:O[e.index].label,fillStyle:D.backgroundColor,fontColor:E,hidden:!e.visible,lineCap:D.borderCapStyle,lineDash:D.borderDash,lineDashOffset:D.borderDashOffset,lineJoin:D.borderJoinStyle,lineWidth:(L.width+L.height)/4,strokeStyle:D.borderColor,pointStyle:A||D.pointStyle,rotation:D.rotation,textAlign:T||D.textAlign,borderRadius:0,datasetIndex:e.index}}),this||e)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Io extends Es{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,D){const O=this.options;if(this.left=0,this.top=0,!O.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=D;const C=s(O.text)?O.text.length:1;this._padding=pi(O.padding);const A=C*mi(O.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=A:this.width=A}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:D,left:O,bottom:A,right:T,options:E}=this,L=E.align;let R,I,z,nt=0;return this.isHorizontal()?(I=ut(L,O,T),z=D+e,R=T-O):("left"===E.position?(I=O+e,z=ut(L,A,D),nt=-.5*C):(I=T-e,z=ut(L,D,A),nt=.5*C),R=A-D),{titleX:I,titleY:z,maxWidth:R,rotation:nt}}draw(){const e=this.ctx,D=this.options;if(!D.display)return;const O=mi(D.font),C=O.lineHeight/2+this._padding.top,{titleX:A,titleY:T,maxWidth:E,rotation:L}=this._drawArgs(C);Ae(e,D.text,0,0,O,{color:D.color,maxWidth:E,rotation:L,textAlign:dt(D.align),textBaseline:"middle",translation:[A,T]})}}var Bo={id:"title",_element:Io,start(e,D,O){!function(e,D){const O=new Io({ctx:e.ctx,options:D,chart:e});is.configure(e,O,D),is.addBox(e,O),e.titleBlock=O}(e,O)},stop(e){const D=e.titleBlock;is.removeBox(e,D),delete e.titleBlock},beforeUpdate(e,D,O){const C=e.titleBlock;is.configure(e,C,O),C.options=O},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Vo=new WeakMap;var Zo={id:"subtitle",start(e,D,O){const C=new Io({ctx:e.ctx,options:O,chart:e});is.configure(e,C,O),is.addBox(e,C),Vo.set(e,C)},stop(e){is.removeBox(e,Vo.get(e)),Vo.delete(e)},beforeUpdate(e,D,O){const C=Vo.get(e);is.configure(e,C,O),C.options=O},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Jo={average(e){if(!e.length)return!1;let D,O,C=0,A=0,T=0;for(D=0,O=e.length;D-1?e.split("\n"):e}function jo(e,D){const{element:O,datasetIndex:C,index:A}=D,T=e.getDatasetMeta(C).controller,{label:E,value:L}=T.getLabelAndValue(A);return{chart:e,label:E,parsed:T.getParsed(A),raw:e.data.datasets[C].data[A],formattedValue:L,dataset:T.getDataset(),dataIndex:A,datasetIndex:C,element:O}}function Ho(e,D){const O=e.chart.ctx,{body:C,footer:A,title:T}=e,{boxWidth:E,boxHeight:L}=D,R=mi(D.bodyFont),I=mi(D.titleFont),z=mi(D.footerFont),nt=T.length,lt=A.length,mt=C.length,Mt=pi(D.padding);let kt=Mt.height,Ct=0,Bt=C.reduce(((e,D)=>e+D.before.length+D.lines.length+D.after.length),0);(Bt+=e.beforeBody.length+e.afterBody.length,nt&&(kt+=nt*I.lineHeight+(nt-1)*D.titleSpacing+D.titleMarginBottom),Bt)&&(kt+=mt*(D.displayColors?Math.max(L,R.lineHeight):R.lineHeight)+(Bt-mt)*R.lineHeight+(Bt-1)*D.bodySpacing);lt&&(kt+=D.footerMarginTop+lt*z.lineHeight+(lt-1)*D.footerSpacing);let Vt=0;const y=function(e){Ct=Math.max(Ct,O.measureText(e).width+Vt)};return O.save(),O.font=I.string,d(e.title,y),O.font=R.string,d(e.beforeBody.concat(e.afterBody),y),Vt=D.displayColors?E+2+D.boxPadding:0,d(C,(e=>{d(e.before,y),d(e.lines,y),d(e.after,y)})),Vt=0,O.font=z.string,d(e.footer,y),O.restore(),Ct+=Mt.width,{width:Ct,height:kt}}function $o(e,D,O,C){const{x:A,width:T}=O,{width:E,chartArea:{left:L,right:R}}=e;let I="center";return"center"===C?I=A<=(L+R)/2?"left":"right":A<=T/2?I="left":A>=E-T/2&&(I="right"),function(e,D,O,C){const{x:A,width:T}=C,E=O.caretSize+O.caretPadding;return"left"===e&&A+T+E>D.width||"right"===e&&A-T-E<0||void 0}(I,e,D,O)&&(I="center"),I}function Yo(e,D,O){const C=O.yAlign||D.yAlign||function(e,D){const{y:O,height:C}=D;return Oe.height-C/2?"bottom":"center"}(e,O);return{xAlign:O.xAlign||D.xAlign||$o(e,D,O,C),yAlign:C}}function Uo(e,D,O,C){const{caretSize:A,caretPadding:T,cornerRadius:E}=e,{xAlign:L,yAlign:R}=O,I=A+T,{topLeft:z,topRight:nt,bottomLeft:lt,bottomRight:mt}=gi(E);let Mt=function(e,D){let{x:O,width:C}=e;return"right"===D?O-=C:"center"===D&&(O-=C/2),O}(D,L);const kt=function(e,D,O){let{y:C,height:A}=e;return"top"===D?C+=O:C-="bottom"===D?A+O:A/2,C}(D,R,I);return"center"===R?"left"===L?Mt+=I:"right"===L&&(Mt-=I):"left"===L?Mt-=Math.max(z,lt)+A:"right"===L&&(Mt+=Math.max(nt,mt)+A),{x:Z(Mt,0,C.width-D.width),y:Z(kt,0,C.height-D.height)}}function Xo(e,D,O){const C=pi(O.padding);return"center"===D?e.x+e.width/2:"right"===D?e.x+e.width-C.right:e.x+C.left}function qo(e){return No([],Wo(e))}function Ko(e,D){const O=D&&D.dataset&&D.dataset.tooltip&&D.dataset.tooltip.callbacks;return O?e.override(O):e}class Go extends Es{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const D=this.chart,O=this.options.setContext(this.getContext()),C=O.enabled&&D.options.animation&&O.animations,A=new ys(this.chart,C);return C._cacheable&&(this._cachedAnimations=Object.freeze(A)),A}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),D=this,O=this._tooltipItems,_i(e,{tooltip:D,tooltipItems:O,type:"tooltip"})));var e,D,O}getTitle(e,D){const{callbacks:O}=D,C=O.beforeTitle.apply(this,[e]),A=O.title.apply(this,[e]),T=O.afterTitle.apply(this,[e]);let E=[];return E=No(E,Wo(C)),E=No(E,Wo(A)),E=No(E,Wo(T)),E}getBeforeBody(e,D){return qo(D.callbacks.beforeBody.apply(this,[e]))}getBody(e,D){const{callbacks:O}=D,C=[];return d(e,(e=>{const D={before:[],lines:[],after:[]},A=Ko(O,e);No(D.before,Wo(A.beforeLabel.call(this,e))),No(D.lines,A.label.call(this,e)),No(D.after,Wo(A.afterLabel.call(this,e))),C.push(D)})),C}getAfterBody(e,D){return qo(D.callbacks.afterBody.apply(this,[e]))}getFooter(e,D){const{callbacks:O}=D,C=O.beforeFooter.apply(this,[e]),A=O.footer.apply(this,[e]),T=O.afterFooter.apply(this,[e]);let E=[];return E=No(E,Wo(C)),E=No(E,Wo(A)),E=No(E,Wo(T)),E}_createItems(e){const D=this._active,O=this.chart.data,C=[],A=[],T=[];let E,L,R=[];for(E=0,L=D.length;Ee.filter(D,C,A,O)))),e.itemSort&&(R=R.sort(((D,C)=>e.itemSort(D,C,O)))),d(R,(D=>{const O=Ko(e.callbacks,D);C.push(O.labelColor.call(this,D)),A.push(O.labelPointStyle.call(this,D)),T.push(O.labelTextColor.call(this,D))})),this.labelColors=C,this.labelPointStyles=A,this.labelTextColors=T,this.dataPoints=R,R}update(e,D){const O=this.options.setContext(this.getContext()),C=this._active;let A,T=[];if(C.length){const e=Jo[O.position].call(this,C,this._eventPosition);T=this._createItems(O),this.title=this.getTitle(T,O),this.beforeBody=this.getBeforeBody(T,O),this.body=this.getBody(T,O),this.afterBody=this.getAfterBody(T,O),this.footer=this.getFooter(T,O);const D=this._size=Ho(this,O),E=Object.assign({},e,D),L=Yo(this.chart,O,E),R=Uo(O,E,L,this.chart);this.xAlign=L.xAlign,this.yAlign=L.yAlign,A={opacity:1,x:R.x,y:R.y,width:D.width,height:D.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(A={opacity:0});this._tooltipItems=T,this.$context=void 0,A&&this._resolveAnimations().update(this,A),e&&O.external&&O.external.call(this,{chart:this.chart,tooltip:this,replay:D})}drawCaret(e,D,O,C){const A=this.getCaretPosition(e,O,C);D.lineTo(A.x1,A.y1),D.lineTo(A.x2,A.y2),D.lineTo(A.x3,A.y3)}getCaretPosition(e,D,O){const{xAlign:C,yAlign:A}=this,{caretSize:T,cornerRadius:E}=O,{topLeft:L,topRight:R,bottomLeft:I,bottomRight:z}=gi(E),{x:nt,y:lt}=e,{width:mt,height:Mt}=D;let kt,Ct,Bt,Vt,Nt,jt;return"center"===A?(Nt=lt+Mt/2,"left"===C?(kt=nt,Ct=kt-T,Vt=Nt+T,jt=Nt-T):(kt=nt+mt,Ct=kt+T,Vt=Nt-T,jt=Nt+T),Bt=kt):(Ct="left"===C?nt+Math.max(L,I)+T:"right"===C?nt+mt-Math.max(R,z)-T:this.caretX,"top"===A?(Vt=lt,Nt=Vt-T,kt=Ct-T,Bt=Ct+T):(Vt=lt+Mt,Nt=Vt+T,kt=Ct+T,Bt=Ct-T),jt=Vt),{x1:kt,x2:Ct,x3:Bt,y1:Vt,y2:Nt,y3:jt}}drawTitle(e,D,O){const C=this.title,A=C.length;let T,E,L;if(A){const R=yi(O.rtl,this.x,this.width);for(e.x=Xo(this,O.titleAlign,O),D.textAlign=R.textAlign(O.titleAlign),D.textBaseline="middle",T=mi(O.titleFont),E=O.titleSpacing,D.fillStyle=O.titleColor,D.font=T.string,L=0;L0!==e))?(e.beginPath(),e.fillStyle=A.multiKeyBackground,Le(e,{x:D,y:Mt,w:R,h:L,radius:E}),e.fill(),e.stroke(),e.fillStyle=T.backgroundColor,e.beginPath(),Le(e,{x:O,y:Mt+1,w:R-2,h:L-2,radius:E}),e.fill()):(e.fillStyle=A.multiKeyBackground,e.fillRect(D,Mt,R,L),e.strokeRect(D,Mt,R,L),e.fillStyle=T.backgroundColor,e.fillRect(O,Mt+1,R-2,L-2))}e.fillStyle=this.labelTextColors[O]}drawBody(e,D,O){const{body:C}=this,{bodySpacing:A,bodyAlign:T,displayColors:E,boxHeight:L,boxWidth:R,boxPadding:I}=O,z=mi(O.bodyFont);let nt=z.lineHeight,lt=0;const mt=yi(O.rtl,this.x,this.width),p=function(O){D.fillText(O,mt.x(e.x+lt),e.y+nt/2),e.y+=nt+A},Mt=mt.textAlign(T);let kt,Ct,Bt,Vt,Nt,jt,te;for(D.textAlign=T,D.textBaseline="middle",D.font=z.string,e.x=Xo(this,Mt,O),D.fillStyle=O.bodyColor,d(this.beforeBody,p),lt=E&&"right"!==Mt?"center"===T?R/2+I:R+2+I:0,Vt=0,jt=C.length;Vt0&&D.stroke()}_updateAnimationTarget(e){const D=this.chart,O=this.$animations,C=O&&O.x,A=O&&O.y;if(C||A){const O=Jo[e.position].call(this,this._active,this._eventPosition);if(!O)return;const T=this._size=Ho(this,e),E=Object.assign({},O,this._size),L=Yo(D,e,E),R=Uo(e,E,L,D);C._to===R.x&&A._to===R.y||(this.xAlign=L.xAlign,this.yAlign=L.yAlign,this.width=T.width,this.height=T.height,this.caretX=O.x,this.caretY=O.y,this._resolveAnimations().update(this,R))}}_willRender(){return!!this.opacity}draw(e){const D=this.options.setContext(this.getContext());let O=this.opacity;if(!O)return;this._updateAnimationTarget(D);const C={width:this.width,height:this.height},A={x:this.x,y:this.y};O=Math.abs(O)<.001?0:O;const T=pi(D.padding),E=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;D.enabled&&E&&(e.save(),e.globalAlpha=O,this.drawBackground(A,e,C,D),vi(e,D.textDirection),A.y+=T.top,this.drawTitle(A,e,D),this.drawBody(A,e,D),this.drawFooter(A,e,D),wi(e,D.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,D){const O=this._active,C=e.map((({datasetIndex:e,index:D})=>{const O=this.chart.getDatasetMeta(e);if(!O)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:O.data[D],index:D}})),A=!u(O,C),T=this._positionChanged(C,D);(A||T)&&(this._active=C,this._eventPosition=D,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,D,O=!0){if(D&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const C=this.options,A=this._active||[],T=this._getActiveElements(e,A,D,O),E=this._positionChanged(T,e),L=D||!u(T,A)||E;return L&&(this._active=T,(C.enabled||C.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,D))),L}_getActiveElements(e,D,O,C){const A=this.options;if("mouseout"===e.type)return[];if(!C)return D;const T=this.chart.getElementsAtEventForMode(e,A.mode,A,O);return A.reverse&&T.reverse(),T}_positionChanged(e,D){const{caretX:O,caretY:C,options:A}=this,T=Jo[A.position].call(this,e,D);return!1!==T&&(O!==T.x||C!==T.y)}}Go.positioners=Jo;var pa={id:"tooltip",_element:Go,positioners:Jo,afterInit(e,D,O){O&&(e.tooltip=new Go({chart:e,options:O}))},beforeUpdate(e,D,O){e.tooltip&&e.tooltip.initialize(O)},reset(e,D,O){e.tooltip&&e.tooltip.initialize(O)},afterDraw(e){const D=e.tooltip;if(D&&D._willRender()){const O={tooltip:D};if(!1===e.notifyPlugins("beforeTooltipDraw",O))return;D.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",O)}},afterEvent(e,D){if(e.tooltip){const O=D.replay;e.tooltip.handleEvent(D.event,O,D.inChartArea)&&(D.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,D)=>D.bodyFont.size,boxWidth:(e,D)=>D.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:t,title(D){if(D.length>0){const O=D[0],C=O.chart.data.labels,A=C?C.length:0;if((this||e)&&(this||e).options&&"dataset"===(this||e).options.mode)return O.dataset.label||"";if(O.label)return O.label;if(A>0&&O.dataIndex"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ma=Object.freeze({__proto__:null,Decimation:Ro,Filler:zo,Legend:Fo,SubTitle:Zo,Title:Bo,Tooltip:pa});function Qo(e,D,O,C){const A=e.indexOf(D);return-1===A?((e,D,O,C)=>("string"==typeof D?(O=e.push(D)-1,C.unshift({index:O,label:D})):isNaN(D)&&(O=null),O))(e,D,O,C):A!==e.lastIndexOf(D)?O:A}class ta extends $s{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const D=this._addedLabels;if(D.length){const e=this.getLabels();for(const{index:O,label:C}of D)e[O]===C&&e.splice(O,1);this._addedLabels=[]}super.init(e)}parse(e,D){if(i(e))return null;const O=this.getLabels();return((e,D)=>null===e?null:Z(Math.round(e),0,D))(D=isFinite(D)&&O[D]===e?D:Qo(O,e,r(D,e),this._addedLabels),O.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:D}=this.getUserBounds();let{min:O,max:C}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(O=0),D||(C=this.getLabels().length-1)),this.min=O,this.max=C}buildTicks(){const e=this.min,D=this.max,O=this.options.offset,C=[];let A=this.getLabels();A=0===e&&D===A.length-1?A:A.slice(e,D+1),this._valueRange=Math.max(A.length-(O?0:1),1),this._startValue=this.min-(O?.5:0);for(let O=e;O<=D;O++)C.push({value:O});return C}getLabelForValue(e){const D=this.getLabels();return e>=0&&eD.length-1?null:this.getPixelForValue(D[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function ea(e,D,{horizontal:O,minRotation:C}){const A=H(C),T=(O?Math.sin(A):Math.cos(A))||.001,E=.75*D*(""+e).length;return Math.min(D/T,E)}ta.id="category",ta.defaults={ticks:{callback:ta.prototype.getLabelForValue}};class ia extends $s{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,D){return i(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:D,maxDefined:O}=this.getUserBounds();let{min:C,max:A}=this;const o=e=>C=D?C:e,a=e=>A=O?A:e;if(e){const e=lt(C),D=lt(A);e<0&&D<0?a(0):e>0&&D>0&&o(0)}if(C===A){let D=1;(A>=Number.MAX_SAFE_INTEGER||C<=Number.MIN_SAFE_INTEGER)&&(D=Math.abs(.05*A)),a(A+D),e||o(C-D)}this.min=C,this.max=A}getTickLimit(){const e=this.options.ticks;let D,{maxTicksLimit:O,stepSize:C}=e;return C?(D=Math.ceil(this.max/C)-Math.floor(this.min/C)+1,D>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${C} would result generating up to ${D} ticks. Limiting to 1000.`),D=1e3)):(D=this.computeTickLimit(),O=O||11),O&&(D=Math.min(O,D)),D}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,D=e.ticks;let O=this.getTickLimit();O=Math.max(2,O);const C=function(e,D){const O=[],{bounds:C,step:A,min:T,max:E,precision:L,count:R,maxTicks:I,maxDigits:z,includeBounds:nt}=e,lt=A||1,mt=I-1,{min:Mt,max:kt}=D,Ct=!i(T),Bt=!i(E),Vt=!i(R),Nt=(kt-Mt)/(z+1);let jt,te,ee,ne,ce=F((kt-Mt)/mt/lt)*lt;if(ce<1e-14&&!Ct&&!Bt)return[{value:Mt},{value:kt}];ne=Math.ceil(kt/ce)-Math.floor(Mt/ce),ne>mt&&(ce=F(ne*ce/mt/lt)*lt),i(L)||(jt=Math.pow(10,L),ce=Math.ceil(ce*jt)/jt),"ticks"===C?(te=Math.floor(Mt/ce)*ce,ee=Math.ceil(kt/ce)*ce):(te=Mt,ee=kt),Ct&&Bt&&A&&W((E-T)/A,ce/1e3)?(ne=Math.round(Math.min((E-T)/ce,I)),ce=(E-T)/ne,te=T,ee=E):Vt?(te=Ct?T:te,ee=Bt?E:ee,ne=R-1,ce=(ee-te)/ne):(ne=(ee-te)/ce,ne=N(ne,Math.round(ne),ce/1e3)?Math.round(ne):Math.ceil(ne));const me=Math.max(Y(ce),Y(te));jt=Math.pow(10,i(L)?me:L),te=Math.round(te*jt)/jt,ee=Math.round(ee*jt)/jt;let Xe=0;for(Ct&&(nt&&te!==T?(O.push({value:T}),te0?O:null;this._zero=!0}determineDataLimits(){const{min:e,max:D}=this.getMinMax(!0);this.min=o(e)?Math.max(0,e):null,this.max=o(D)?Math.max(0,D):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:D}=this.getUserBounds();let O=this.min,C=this.max;const n=D=>O=e?O:D,o=e=>C=D?C:e,a=(e,D)=>Math.pow(10,Math.floor(nt(e))+D);O===C&&(O<=0?(n(1),o(10)):(n(a(O,-1)),o(a(C,1)))),O<=0&&n(a(C,-1)),C<=0&&o(a(O,1)),this._zero&&this.min!==this._suggestedMin&&O===a(this.min,0)&&n(a(O,-1)),this.min=O,this.max=C}buildTicks(){const e=this.options,D=function(e,D){const O=Math.floor(nt(D.max)),C=Math.ceil(D.max/Math.pow(10,O)),A=[];let T=a(e.min,Math.pow(10,Math.floor(nt(D.min)))),E=Math.floor(nt(T)),L=Math.floor(T/Math.pow(10,E)),R=E<0?Math.pow(10,Math.abs(E)):1;do{A.push({value:T,major:na(T)}),++L,10===L&&(L=1,++E,R=E>=0?1:R),T=Math.round(L*Math.pow(10,E)*R)/R}while(EA?{start:D-O,end:D}:{start:D,end:D+O}}function la(e){const D={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},O=Object.assign({},D),A=[],T=[],E=e._pointLabels.length,L=e.options.pointLabels,I=L.centerPointLabels?C/E:0;for(let C=0;CD.r&&(L=(C.end-D.r)/T,e.r=Math.max(e.r,D.r+L)),A.startD.b&&(R=(A.end-D.b)/E,e.b=Math.max(e.b,D.b+R))}function ca(e){return 0===e||180===e?"center":e<180?"left":"right"}function da(e,D,O){return"right"===O?e-=D:"center"===O&&(e-=D/2),e}function ua(e,D,O){return 90===O||270===O?e-=D/2:(O>270||O<90)&&(e-=D),e}function fa(e,D,O,C){const{ctx:T}=e;if(O)T.arc(e.xCenter,e.yCenter,D,0,A);else{let O=e.getPointPosition(0,D);T.moveTo(O.x,O.y);for(let A=1;A{const O=c(this.options.pointLabels.callback,[e,D],this);return O||0===O?O:""})).filter(((e,D)=>this.chart.getDataVisibility(D)))}fit(){const e=this.options;e.display&&e.pointLabels.display?la(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,D,O,C){this.xCenter+=Math.floor((e-D)/2),this.yCenter+=Math.floor((O-C)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,D,O,C))}getIndexAngle(e){return K(e*(A/(this._pointLabels.length||1))+H(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(i(e))return NaN;const D=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*D:(e-this.min)*D}getValueForDistanceFromCenter(e){if(i(e))return NaN;const D=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-D:this.min+D}getPointLabelContext(e){const D=this._pointLabels||[];if(e>=0&&e=0;A--){const D=C.setContext(e.getPointLabelContext(A)),T=mi(D.font),{x:E,y:L,textAlign:R,left:I,top:z,right:nt,bottom:lt}=e._pointLabelItems[A],{backdropColor:mt}=D;if(!i(mt)){const e=gi(D.borderRadius),C=pi(D.backdropPadding);O.fillStyle=mt;const A=I-C.left,T=z-C.top,E=nt-I+C.width,L=lt-z+C.height;Object.values(e).some((e=>0!==e))?(O.beginPath(),Le(O,{x:A,y:T,w:E,h:L,radius:e}),O.fill()):O.fillRect(A,T,E,L)}Ae(O,e._pointLabels[A],E,L+T.lineHeight/2,T,{color:D.color,textAlign:R,textBaseline:"middle"})}}(this,A),C.display&&this.ticks.forEach(((e,D)=>{if(0!==D){E=this.getDistanceFromCenterForValue(e.value);!function(e,D,O,C){const A=e.ctx,T=D.circular,{color:E,lineWidth:L}=D;!T&&!C||!E||!L||O<0||(A.save(),A.strokeStyle=E,A.lineWidth=L,A.setLineDash(D.borderDash),A.lineDashOffset=D.borderDashOffset,A.beginPath(),fa(e,O,T,C),A.closePath(),A.stroke(),A.restore())}(this,C.setContext(this.getContext(D-1)),E,A)}})),O.display){for(e.save(),T=A-1;T>=0;T--){const C=O.setContext(this.getPointLabelContext(T)),{color:A,lineWidth:R}=C;R&&A&&(e.lineWidth=R,e.strokeStyle=A,e.setLineDash(C.borderDash),e.lineDashOffset=C.borderDashOffset,E=this.getDistanceFromCenterForValue(D.ticks.reverse?this.min:this.max),L=this.getPointPosition(T,E),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(L.x,L.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,D=this.options,O=D.ticks;if(!O.display)return;const C=this.getIndexAngle(0);let A,T;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(C),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((C,E)=>{if(0===E&&!D.reverse)return;const L=O.setContext(this.getContext(E)),R=mi(L.font);if(A=this.getDistanceFromCenterForValue(this.ticks[E].value),L.showLabelBackdrop){e.font=R.string,T=e.measureText(C.label).width,e.fillStyle=L.backdropColor;const D=pi(L.backdropPadding);e.fillRect(-T/2-D.left,-A-R.size/2-D.top,T+D.width,R.size+D.height)}Ae(e,C.label,0,-A,R,{color:L.color})})),e.restore()}drawTitle(){}}ga.id="radialLinear",ga.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}},ga.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ga.descriptors={angleLines:{_fallback:"grid"}};const Sa={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}},Pa=Object.keys(Sa);function ba(e,D){return e-D}function xa(e,D){if(i(D))return null;const O=e._adapter,{parser:C,round:A,isoWeekday:T}=e._parseOpts;let E=D;return"function"==typeof C&&(E=C(E)),o(E)||(E="string"==typeof C?O.parse(E,C):O.parse(E)),null===E?null:(A&&(E="week"!==A||!B(T)&&!0!==T?O.startOf(E,A):O.startOf(E,"isoWeek",T)),+E)}function _a(e,D,O,C){const A=Pa.length;for(let T=Pa.indexOf(e);T=D?O[C]:O[A]]=!0}}else e[D]=!0}function va(e,D,O){const C=[],A={},T=D.length;let E,L;for(E=0;E=0&&(D[R].major=!0);return D}(e,C,A,O):C}class wa extends $s{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,D){const O=e.time||(e.time={}),C=this._adapter=new Jn._date(e.adapters.date);C.init(D),b(O.displayFormats,C.formats()),this._parseOpts={parser:O.parser,round:O.round,isoWeekday:O.isoWeekday},super.init(e),this._normalized=D.normalized}parse(e,D){return void 0===e?null:xa(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,D=this._adapter,O=e.time.unit||"day";let{min:C,max:A,minDefined:T,maxDefined:E}=this.getUserBounds();function l(e){T||isNaN(e.min)||(C=Math.min(C,e.min)),E||isNaN(e.max)||(A=Math.max(A,e.max))}T&&E||(l(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(this.getMinMax(!1))),C=o(C)&&!isNaN(C)?C:+D.startOf(Date.now(),O),A=o(A)&&!isNaN(A)?A:+D.endOf(Date.now(),O)+1,this.min=Math.min(C,A-1),this.max=Math.max(C+1,A)}_getLabelBounds(){const e=this.getLabelTimestamps();let D=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY;return e.length&&(D=e[0],O=e[e.length-1]),{min:D,max:O}}buildTicks(){const e=this.options,D=e.time,O=e.ticks,C="labels"===O.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&C.length&&(this.min=this._userMin||C[0],this.max=this._userMax||C[C.length-1]);const A=this.min,T=st(C,A,this.max);return this._unit=D.unit||(O.autoSkip?_a(D.minUnit,this.min,this.max,this._getLabelCapacity(A)):function(e,D,O,C,A){for(let T=Pa.length-1;T>=Pa.indexOf(O);T--){const O=Pa[T];if(Sa[O].common&&e._adapter.diff(A,C,O)>=D-1)return O}return Pa[O?Pa.indexOf(O):0]}(this,T.length,D.minUnit,this.min,this.max)),this._majorUnit=O.major.enabled&&"year"!==this._unit?function(e){for(let D=Pa.indexOf(e)+1,O=Pa.length;D+e.value)))}initOffsets(e){let D,O,C=0,A=0;this.options.offset&&e.length&&(D=this.getDecimalForValue(e[0]),C=1===e.length?1-D:(this.getDecimalForValue(e[1])-D)/2,O=this.getDecimalForValue(e[e.length-1]),A=1===e.length?O:(O-this.getDecimalForValue(e[e.length-2]))/2);const T=e.length<3?.5:.25;C=Z(C,0,T),A=Z(A,0,T),this._offsets={start:C,end:A,factor:1/(C+1+A)}}_generate(){const e=this._adapter,D=this.min,O=this.max,C=this.options,A=C.time,T=A.unit||_a(A.minUnit,D,O,this._getLabelCapacity(D)),E=r(A.stepSize,1),L="week"===T&&A.isoWeekday,R=B(L)||!0===L,I={};let z,nt,lt=D;if(R&&(lt=+e.startOf(lt,"isoWeek",L)),lt=+e.startOf(lt,R?"day":T),e.diff(O,D,T)>1e5*E)throw new Error(D+" and "+O+" are too far apart with stepSize of "+E+" "+T);const mt="data"===C.ticks.source&&this.getDataTimestamps();for(z=lt,nt=0;ze-D)).map((e=>+e))}getLabelForValue(e){const D=this._adapter,O=this.options.time;return O.tooltipFormat?D.format(e,O.tooltipFormat):D.format(e,O.displayFormats.datetime)}_tickFormatFunction(e,D,O,C){const A=this.options,T=A.time.displayFormats,E=this._unit,L=this._majorUnit,R=E&&T[E],I=L&&T[L],z=O[D],nt=L&&I&&z&&z.major,lt=this._adapter.format(e,C||(nt?I:R)),mt=A.ticks.callback;return mt?c(mt,[lt,D,O],this):lt}generateTickLabels(e){let D,O,C;for(D=0,O=e.length;D0?E:1}getDataTimestamps(){let e,D,O=this._cache.data||[];if(O.length)return O;const C=this.getMatchingVisibleMetas();if(this._normalized&&C.length)return this._cache.data=C[0].controller.getAllParsedValues(this);for(e=0,D=C.length;e=e[L].pos&&D<=e[R].pos&&({lo:L,hi:R}=et(e,"pos",D)),({pos:C,time:T}=e[L]),({pos:A,time:E}=e[R])):(D>=e[L].time&&D<=e[R].time&&({lo:L,hi:R}=et(e,"time",D)),({time:C,pos:T}=e[L]),({time:A,pos:E}=e[R]));const I=A-C;return I?T+(E-T)*(D-C)/I:T}wa.id="time",wa.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class ka extends wa{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),D=this._table=this.buildLookupTable(e);this._minPos=Ma(D,this.min),this._tableRange=Ma(D,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:D,max:O}=this,C=[],A=[];let T,E,L,R,I;for(T=0,E=e.length;T=D&&R<=O&&C.push(R);if(C.length<2)return[{time:D,pos:0},{time:O,pos:1}];for(T=0,E=C.length;T {} + * + * @example + * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 }) + * const result = getDefaultOptions() + * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 } + */function getDefaultOptions(){return x({},t())}export{getDefaultOptions}; + diff --git a/vendor/javascript/fuse.js.js b/vendor/javascript/fuse.js.js new file mode 100644 index 0000000..cb9f64e --- /dev/null +++ b/vendor/javascript/fuse.js.js @@ -0,0 +1,4 @@ +// fuse.js@7.0.0 downloaded from https://ga.jspm.io/npm:fuse.js@7.0.0/dist/fuse.mjs + +function isArray(e){return Array.isArray?Array.isArray(e):"[object Array]"===getTag(e)}const e=1/0;function baseToString(t){if("string"==typeof t)return t;let s=t+"";return"0"==s&&1/t==-e?"-0":s}function toString(e){return null==e?"":baseToString(e)}function isString(e){return"string"===typeof e}function isNumber(e){return"number"===typeof e}function isBoolean(e){return true===e||false===e||isObjectLike(e)&&"[object Boolean]"==getTag(e)}function isObject(e){return"object"===typeof e}function isObjectLike(e){return isObject(e)&&null!==e}function isDefined(e){return void 0!==e&&null!==e}function isBlank(e){return!e.trim().length}function getTag(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const t="Extended search is not available";const s="Incorrect 'index' type";const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY=e=>`Invalid value for key ${e}`;const PATTERN_LENGTH_TOO_LARGE=e=>`Pattern length exceeds max of ${e}.`;const MISSING_KEY_PROPERTY=e=>`Missing ${e} property in key`;const INVALID_KEY_WEIGHT_VALUE=e=>`Property 'weight' in key '${e}' must be a positive integer`;const n=Object.prototype.hasOwnProperty;class KeyStore{constructor(e){this._keys=[];this._keyMap={};let t=0;e.forEach((e=>{let s=createKey(e);this._keys.push(s);this._keyMap[s.id]=s;t+=s.weight}));this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function createKey(e){let t=null;let s=null;let r=null;let i=1;let c=null;if(isString(e)||isArray(e)){r=e;t=createKeyPath(e);s=createKeyId(e)}else{if(!n.call(e,"name"))throw new Error(MISSING_KEY_PROPERTY("name"));const o=e.name;r=o;if(n.call(e,"weight")){i=e.weight;if(i<=0)throw new Error(INVALID_KEY_WEIGHT_VALUE(o))}t=createKeyPath(o);s=createKeyId(o);c=e.getFn}return{path:t,id:s,weight:i,src:r,getFn:c}}function createKeyPath(e){return isArray(e)?e:e.split(".")}function createKeyId(e){return isArray(e)?e.join("."):e}function get(e,t){let s=[];let n=false;const deepGet=(e,t,r)=>{if(isDefined(e))if(t[r]){let i=t[r];const c=e[i];if(!isDefined(c))return;if(r===t.length-1&&(isString(c)||isNumber(c)||isBoolean(c)))s.push(toString(c));else if(isArray(c)){n=true;for(let e=0,s=c.length;ee.score===t.score?e.idx{this._keysMap[e.id]=t}))}create(){if(!this.isCreated&&this.docs.length){this.isCreated=true;isString(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)}));this.norm.clear()}}add(e){const t=this.size();isString(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t{let r=t.getFn?t.getFn(e):this.getFn(e,t.path);if(isDefined(r))if(isArray(r)){let e=[];const t=[{nestedArrIndex:-1,value:r}];while(t.length){const{nestedArrIndex:s,value:n}=t.pop();if(isDefined(n))if(isString(n)&&!isBlank(n)){let t={v:n,i:s,n:this.norm.get(n)};e.push(t)}else isArray(n)&&n.forEach(((e,s)=>{t.push({nestedArrIndex:s,value:e})}))}s.$[n]=e}else if(isString(r)&&!isBlank(r)){let e={v:r,n:this.norm.get(r)};s.$[n]=e}}));this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function createIndex(e,t,{getFn:s=a.getFn,fieldNormWeight:n=a.fieldNormWeight}={}){const r=new FuseIndex({getFn:s,fieldNormWeight:n});r.setKeys(e.map(createKey));r.setSources(t);r.create();return r}function parseIndex(e,{getFn:t=a.getFn,fieldNormWeight:s=a.fieldNormWeight}={}){const{keys:n,records:r}=e;const i=new FuseIndex({getFn:t,fieldNormWeight:s});i.setKeys(n);i.setIndexRecords(r);return i}function computeScore$1(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:r=a.distance,ignoreLocation:i=a.ignoreLocation}={}){const c=t/e.length;if(i)return c;const o=Math.abs(n-s);return r?c+o/r:o?1:c}function convertMaskToIndices(e=[],t=a.minMatchCharLength){let s=[];let n=-1;let r=-1;let i=0;for(let c=e.length;i=t&&s.push([n,r]);n=-1}}e[i-1]&&i-n>=t&&s.push([n,i-1]);return s}const l=32;function search(e,t,s,{location:n=a.location,distance:r=a.distance,threshold:i=a.threshold,findAllMatches:c=a.findAllMatches,minMatchCharLength:o=a.minMatchCharLength,includeMatches:h=a.includeMatches,ignoreLocation:u=a.ignoreLocation}={}){if(t.length>l)throw new Error(PATTERN_LENGTH_TOO_LARGE(l));const d=t.length;const g=e.length;const f=Math.max(0,Math.min(n,g));let p=i;let M=f;const m=o>1||h;const x=m?Array(g):[];let y;while((y=e.indexOf(t,M))>-1){let e=computeScore$1(t,{currentLocation:y,expectedLocation:f,distance:r,ignoreLocation:u});p=Math.min(e,p);M=y+d;if(m){let e=0;while(e=a;i-=1){let c=i-1;let o=s[e.charAt(c)];m&&(x[c]=+!!o);l[i]=(l[i+1]<<1|1)&o;n&&(l[i]|=(S[i+1]|S[i])<<1|1|S[i+1]);if(l[i]&k){I=computeScore$1(t,{errors:n,currentLocation:c,expectedLocation:f,distance:r,ignoreLocation:u});if(I<=p){p=I;M=c;if(M<=f)break;a=Math.max(1,2*f-M)}}}const y=computeScore$1(t,{errors:n+1,currentLocation:f,expectedLocation:f,distance:r,ignoreLocation:u});if(y>p)break;S=l}const v={isMatch:M>=0,score:Math.max(.001,I)};if(m){const e=convertMaskToIndices(x,o);e.length?h&&(v.indices=e):v.isMatch=false}return v}function createPatternAlphabet(e){let t={};for(let s=0,n=e.length;s{this.chunks.push({pattern:e,alphabet:createPatternAlphabet(e),startIndex:t})};const u=this.pattern.length;if(u>l){let e=0;const t=u%l;const s=u-t;while(e{const{isMatch:f,score:p,indices:M}=search(e,t,d,{location:n+g,distance:r,threshold:i,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:a});f&&(u=true);l+=p;f&&M&&(h=[...h,...M])}));let d={isMatch:u,score:u?l/this.chunks.length:1};u&&s&&(d.indices=h);return d}}class BaseMatch{constructor(e){this.pattern=e}static isMultiMatch(e){return getMatch(e,this.multiRegex)}static isSingleMatch(e){return getMatch(e,this.singleRegex)}search(){}}function getMatch(e,t){const s=e.match(t);return s?s[1]:null}class ExactMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class InverseExactMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=e.indexOf(this.pattern);const s=-1===t;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class PrefixExactMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class InversePrefixExactMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class SuffixExactMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class InverseSuffixExactMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class FuzzyMatch extends BaseMatch{constructor(e,{location:t=a.location,threshold:s=a.threshold,distance:n=a.distance,includeMatches:r=a.includeMatches,findAllMatches:i=a.findAllMatches,minMatchCharLength:c=a.minMatchCharLength,isCaseSensitive:o=a.isCaseSensitive,ignoreLocation:h=a.ignoreLocation}={}){super(e);this._bitapSearch=new BitapSearch(e,{location:t,threshold:s,distance:n,includeMatches:r,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class IncludeMatch extends BaseMatch{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0;let s;const n=[];const r=this.pattern.length;while((s=e.indexOf(this.pattern,t))>-1){t=s+r;n.push([s,t-1])}const i=!!n.length;return{isMatch:i,score:i?0:1,indices:n}}}const u=[ExactMatch,IncludeMatch,PrefixExactMatch,InversePrefixExactMatch,InverseSuffixExactMatch,SuffixExactMatch,InverseExactMatch,FuzzyMatch];const d=u.length;const g=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const f="|";function parseQuery(e,t={}){return e.split(f).map((e=>{let s=e.trim().split(g).filter((e=>e&&!!e.trim()));let n=[];for(let e=0,r=s.length;e!!(e[m.AND]||e[m.OR]);const isPath=e=>!!e[x.PATH];const isLeaf=e=>!isArray(e)&&isObject(e)&&!isExpression(e);const convertToExplicit=e=>({[m.AND]:Object.keys(e).map((t=>({[t]:e[t]})))});function parse(e,t,{auto:s=true}={}){const next=e=>{let n=Object.keys(e);const r=isPath(e);if(!r&&n.length>1&&!isExpression(e))return next(convertToExplicit(e));if(isLeaf(e)){const i=r?e[x.PATH]:n[0];const c=r?e[x.PATTERN]:e[i];if(!isString(c))throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(i));const o={keyId:createKeyId(i),pattern:c};s&&(o.searcher=createSearcher(c,t));return o}let i={children:[],operator:n[0]};n.forEach((t=>{const s=e[t];isArray(s)&&s.forEach((e=>{i.children.push(next(e))}))}));return i};isExpression(e)||(e=convertToExplicit(e));return next(e)}function computeScore(e,{ignoreFieldNorm:t=a.ignoreFieldNorm}){e.forEach((e=>{let s=1;e.matches.forEach((({key:e,norm:n,score:r})=>{const i=e?e.weight:null;s*=Math.pow(0===r&&i?Number.EPSILON:r,(i||1)*(t?1:n))}));e.score=s}))}function transformMatches(e,t){const s=e.matches;t.matches=[];isDefined(s)&&s.forEach((e=>{if(!isDefined(e.indices)||!e.indices.length)return;const{indices:s,value:n}=e;let r={indices:s,value:n};e.key&&(r.key=e.key.src);e.idx>-1&&(r.refIndex=e.idx);t.matches.push(r)}))}function transformScore(e,t){t.score=e.score}function format(e,t,{includeMatches:s=a.includeMatches,includeScore:n=a.includeScore}={}){const r=[];s&&r.push(transformMatches);n&&r.push(transformScore);return e.map((e=>{const{idx:s}=e;const n={item:t[s],refIndex:s};r.length&&r.forEach((t=>{t(e,n)}));return n}))}class Fuse{constructor(e,s={},n){this.options={...a,...s};if(this.options.useExtendedSearch&&false)throw new Error(t);this._keyStore=new KeyStore(this.options.keys);this.setCollection(e,n)}setCollection(e,t){this._docs=e;if(t&&!(t instanceof FuseIndex))throw new Error(s);this._myIndex=t||createIndex(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){if(isDefined(e)){this._docs.push(e);this._myIndex.add(e)}}remove(e=(()=>false)){const t=[];for(let s=0,n=this._docs.length;s-1&&(o=o.slice(0,t));return format(o,this._docs,{includeMatches:s,includeScore:n})}_searchStringList(e){const t=createSearcher(e,this.options);const{records:s}=this._myIndex;const n=[];s.forEach((({v:e,i:s,n:r})=>{if(!isDefined(e))return;const{isMatch:i,score:c,indices:o}=t.searchIn(e);i&&n.push({item:e,idx:s,matches:[{score:c,value:e,norm:r,indices:o}]})}));return n}_searchLogical(e){const t=parse(e,this.options);const evaluate=(e,t,s)=>{if(!e.children){const{keyId:n,searcher:r}=e;const i=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:r});return i&&i.length?[{idx:s,item:t,matches:i}]:[]}const n=[];for(let r=0,i=e.children.length;r{if(isDefined(e)){let i=evaluate(t,e,s);if(i.length){if(!n[s]){n[s]={idx:s,item:e,matches:[]};r.push(n[s])}i.forEach((({matches:e})=>{n[s].matches.push(...e)}))}}}));return r}_searchObjectList(e){const t=createSearcher(e,this.options);const{keys:s,records:n}=this._myIndex;const r=[];n.forEach((({$:e,i:n})=>{if(!isDefined(e))return;let i=[];s.forEach(((s,n)=>{i.push(...this._findMatches({key:s,value:e[n],searcher:t}))}));i.length&&r.push({idx:n,item:e,matches:i})}));return r}_findMatches({key:e,value:t,searcher:s}){if(!isDefined(t))return[];let n=[];if(isArray(t))t.forEach((({v:t,i:r,n:i})=>{if(!isDefined(t))return;const{isMatch:c,score:o,indices:a}=s.searchIn(t);c&&n.push({score:o,key:e,value:t,idx:r,norm:i,indices:a})}));else{const{v:r,n:i}=t;const{isMatch:c,score:o,indices:a}=s.searchIn(r);c&&n.push({score:o,key:e,value:r,norm:i,indices:a})}return n}}Fuse.version="7.0.0";Fuse.createIndex=createIndex;Fuse.parseIndex=parseIndex;Fuse.config=a;Fuse.parseQuery=parse;register(ExtendedSearch);export{Fuse as default}; + diff --git a/vendor/javascript/hey-listen.js b/vendor/javascript/hey-listen.js new file mode 100644 index 0000000..124dbc1 --- /dev/null +++ b/vendor/javascript/hey-listen.js @@ -0,0 +1,4 @@ +// hey-listen@1.0.8 downloaded from https://ga.jspm.io/npm:hey-listen@1.0.8/dist/index.js + +var n={};Object.defineProperty(n,"__esModule",{value:true});n.warning=function(){};n.invariant=function(){};const e=n.__esModule,t=n.warning,r=n.invariant;export default n;export{e as __esModule,r as invariant,t as warning}; + diff --git a/vendor/javascript/motion.js b/vendor/javascript/motion.js new file mode 100644 index 0000000..304f580 --- /dev/null +++ b/vendor/javascript/motion.js @@ -0,0 +1,4 @@ +// motion@10.18.0 downloaded from https://ga.jspm.io/npm:motion@10.18.0/dist/main.es.js + +import{withControls as o,animate as n}from"@motionone/dom";export*from"@motionone/dom";export*from"@motionone/types";import{isFunction as t}from"@motionone/utils";import{Animation as r}from"@motionone/animation";function animateProgress(n,t={}){return o([()=>{const o=new r(n,[0,1],t);o.finished.catch((()=>{}));return o}],t,t.duration)}function animate(o,r,e){const i=t(o)?animateProgress:n;return i(o,r,e)}export{animate}; + diff --git a/vendor/javascript/mustache.js b/vendor/javascript/mustache.js new file mode 100644 index 0000000..d5956c1 --- /dev/null +++ b/vendor/javascript/mustache.js @@ -0,0 +1,4 @@ +// mustache@4.2.0 downloaded from https://ga.jspm.io/npm:mustache@4.2.0/mustache.mjs + +var e=Object.prototype.toString;var t=Array.isArray||function isArrayPolyfill(t){return"[object Array]"===e.call(t)};function isFunction(e){return"function"===typeof e}function typeStr(e){return t(e)?"array":typeof e}function escapeRegExp(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(e,t){return null!=e&&"object"===typeof e&&t in e}function primitiveHasOwnProperty(e,t){return null!=e&&"object"!==typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var r=RegExp.prototype.test;function testRegExp(e,t){return r.call(e,t)}var n=/\S/;function isWhitespace(e){return!testRegExp(n,e)}var a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(e){return String(e).replace(/[&<>"'`=\/]/g,(function fromEntityMap(e){return a[e]}))}var i=/\s*/;var s=/\s+/;var o=/\s*=/;var p=/\s*\}/;var c=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(e,r){if(!e)return[];var n=false;var a=[];var u=[];var h=[];var f=false;var v=false;var g="";var d=0;function stripSpace(){if(f&&!v)while(h.length)delete u[h.pop()];else h=[];f=false;v=false}var y,w,m;function compileTags(e){"string"===typeof e&&(e=e.split(s,2));if(!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);y=new RegExp(escapeRegExp(e[0])+"\\s*");w=new RegExp("\\s*"+escapeRegExp(e[1]));m=new RegExp("\\s*"+escapeRegExp("}"+e[1]))}compileTags(r||l.tags);var C=new Scanner(e);var x,k,T,b,E,S;while(!C.eos()){x=C.pos;T=C.scanUntil(y);if(T)for(var W=0,P=T.length;W0?n[n.length-1][4]:t;break;default:r.push(a)}}return t}function Scanner(e){this.string=e;this.tail=e;this.pos=0}Scanner.prototype.eos=function eos(){return""===this.tail};Scanner.prototype.scan=function scan(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];this.tail=this.tail.substring(r.length);this.pos+=r.length;return r};Scanner.prototype.scanUntil=function scanUntil(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail;this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r);this.tail=this.tail.substring(r)}this.pos+=t.length;return t};function Context(e,t){this.view=e;this.cache={".":this.view};this.parent=t}Context.prototype.push=function push(e){return new Context(e,this)};Context.prototype.lookup=function lookup(e){var t=this.cache;var r;if(t.hasOwnProperty(e))r=t[e];else{var n,a,i,s=this,o=false;while(s){if(e.indexOf(".")>0){n=s.view;a=e.split(".");i=0;while(null!=n&&i"===o?p=this.renderPartial(s,t,r,a):"&"===o?p=this.unescapedValue(s,t):"name"===o?p=this.escapedValue(s,t,a):"text"===o&&(p=this.rawValue(s));void 0!==p&&(i+=p)}return i};Writer.prototype.renderSection=function renderSection(e,r,n,a,i){var s=this;var o="";var p=r.lookup(e[1]);function subRender(e){return s.render(e,r,n,i)}if(p){if(t(p))for(var c=0,l=p.length;c0||!r)&&(a[i]=n+a[i]);return a.join("\n")};Writer.prototype.renderPartial=function renderPartial(e,t,r,n){if(r){var a=this.getConfigTags(n);var i=isFunction(r)?r(e[1]):r[e[1]];if(null!=i){var s=e[6];var o=e[5];var p=e[4];var c=i;0==o&&p&&(c=this.indentPartial(i,p,s));var l=this.parse(c,a);return this.renderTokens(l,t,r,c,n)}}};Writer.prototype.unescapedValue=function unescapedValue(e,t){var r=t.lookup(e[1]);if(null!=r)return r};Writer.prototype.escapedValue=function escapedValue(e,t,r){var n=this.getConfigEscape(r)||l.escape;var a=t.lookup(e[1]);if(null!=a)return"number"===typeof a&&n===l.escape?String(a):n(a)};Writer.prototype.rawValue=function rawValue(e){return e[1]};Writer.prototype.getConfigTags=function getConfigTags(e){return t(e)?e:e&&"object"===typeof e?e.tags:void 0};Writer.prototype.getConfigEscape=function getConfigEscape(e){return e&&"object"===typeof e&&!t(e)?e.escape:void 0};var l={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){u.templateCache=e},get templateCache(){return u.templateCache}};var u=new Writer;l.clearCache=function clearCache(){return u.clearCache()};l.parse=function parse(e,t){return u.parse(e,t)};l.render=function render(e,t,r,n){if("string"!==typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+typeStr(e)+'" was given as the first argument for mustache#render(template, view, partials)');return u.render(e,t,r,n)};l.escape=escapeHtml;l.Scanner=Scanner;l.Context=Context;l.Writer=Writer;export default l; + diff --git a/vendor/javascript/rbui-js.js b/vendor/javascript/rbui-js.js new file mode 100644 index 0000000..eb19334 --- /dev/null +++ b/vendor/javascript/rbui-js.js @@ -0,0 +1,4 @@ +// rbui-js@1.0.0 downloaded from https://ga.jspm.io/npm:rbui-js@1.0.0-alpha.4/lib/rbui/index.js + +import{Controller as e}from"@hotwired/stimulus";import{animate as t}from"motion";import{format as s}from"date-fns";import i from"mustache";import n from"chart.js/auto";import{computePosition as r,flip as a,shift as o,autoUpdate as l,offset as d}from"@floating-ui/dom";import h from"fuse.js";import c from"tippy.js";class AccordionController extends e{static targets=["icon","content"];static values={open:{type:Boolean,default:false},animationDuration:{type:Number,default:.15},animationEasing:{type:String,default:"ease-in-out"},rotateIcon:{type:Number,default:180}};connect(){let e=this.animationDurationValue;this.animationDurationValue=0;this.openValue?this.open():this.close();this.animationDurationValue=e}toggle(){this.openValue=!this.openValue}openValueChanged(e,t){e?this.open():this.close()}open(){if(this.hasContentTarget){this.revealContent();this.hasIconTarget&&this.rotateIcon();this.openValue=true}}close(){if(this.hasContentTarget){this.hideContent();this.hasIconTarget&&this.rotateIcon();this.openValue=false}}revealContent(){const e=this.contentTarget.scrollHeight;t(this.contentTarget,{height:`${e}px`},{duration:this.animationDurationValue,easing:this.animationEasingValue})}hideContent(){t(this.contentTarget,{height:0},{duration:this.animationDurationValue,easing:this.animationEasingValue})}rotateIcon(){t(this.iconTarget,{rotate:`${this.openValue?this.rotateIconValue:0}deg`})}}class AlertDialogController extends e{static targets=["content"];static values={open:{type:Boolean,default:false}};connect(){this.openValue&&this.open()}open(){document.body.insertAdjacentHTML("beforeend",this.contentTarget.innerHTML);document.body.classList.add("overflow-hidden")}dismiss(e){document.body.classList.remove("overflow-hidden");this.element.remove()}}class CalendarController extends e{static targets=["calendar","title","weekdaysTemplate","selectedDateTemplate","todayDateTemplate","currentMonthDateTemplate","otherMonthDateTemplate"];static values={selectedDate:{type:String,default:null},viewDate:{type:String,default:(new Date).toISOString().slice(0,10)},format:{type:String,default:"yyyy-MM-dd"}};static outlets=["rbui--calendar-input"];initialize(){this.updateCalendar()}nextMonth(e){e.preventDefault();this.viewDateValue=this.adjustMonth(1)}prevMonth(e){e.preventDefault();this.viewDateValue=this.adjustMonth(-1)}selectDay(e){e.preventDefault();this.selectedDateValue=e.currentTarget.dataset.day}selectedDateValueChanged(e,t){const s=new Date(this.selectedDateValue);s.setDate(2);this.viewDateValue=s.toISOString().slice(0,10);this.updateCalendar();this.rbuiCalendarInputOutlets.forEach((e=>{const t=this.formatDate(this.selectedDate());e.setValue(t)}))}viewDateValueChanged(e,t){this.updateCalendar()}adjustMonth(e){const t=this.viewDate();t.setDate(2);t.setMonth(t.getMonth()+e);return t.toISOString().slice(0,10)}updateCalendar(){this.titleTarget.textContent=this.monthAndYear();this.calendarTarget.innerHTML=this.calendarHTML()}calendarHTML(){return this.weekdaysTemplateTarget.innerHTML+this.calendarDays()}calendarDays(){return this.getFullWeeksStartAndEndInMonth().map((e=>this.renderWeek(e))).join("")}renderWeek(e){const t=e.map((e=>this.renderDay(e))).join("");return`${t}`}renderDay(e){const t=new Date;let s="";const n={day:e,dayDate:e.getDate()};s=e.toDateString()===this.selectedDate().toDateString()?i.render(this.selectedDateTemplateTarget.innerHTML,n):e.toDateString()===t.toDateString()?i.render(this.todayDateTemplateTarget.innerHTML,n):e.getMonth()===this.viewDate().getMonth()?i.render(this.currentMonthDateTemplateTarget.innerHTML,n):i.render(this.otherMonthDateTemplateTarget.innerHTML,n);return s}monthAndYear(){const e=this.viewDate().toLocaleString("default",{month:"long"});const t=this.viewDate().getFullYear();return`${e} ${t}`}selectedDate(){return new Date(this.selectedDateValue)}viewDate(){return this.viewDateValue?new Date(this.viewDateValue):this.selectedDate()}getFullWeeksStartAndEndInMonth(){const e=this.viewDate().getMonth();const t=this.viewDate().getFullYear();let s=[],i=new Date(t,e,1),n=new Date(t,e+1,0),r=n.getDate();let a=1;let o;if(i.getDay()===1)o=7;else if(i.getDay()===0){let s=new Date(t,e,0);a=s.getDate()-6+1;o=1}else{let n=new Date(t,e,0);a=n.getDate()+1-i.getDay()+1;o=7-i.getDay()+1;s.push({start:a,end:o});a=o+1;o+=7}while(a<=r){s.push({start:a,end:o});a=o+1;o+=7;o=a===1&&o===8?1:o;if(o>r&&a<=r){o-=r;s.push({start:a,end:o});break}}return s.map((({start:s,end:i},n)=>{const r=+(s>i&&n===0);return Array.from({length:7},((i,n)=>{const a=new Date(t,e-r,s+n);return a}))}))}formatDate(e){return s(e,this.formatValue)}}class CalendarInputController extends e{setValue(e){this.element.value=e}}class CollapsibleController extends e{static targets=["content"];static values={open:{type:Boolean,default:false}};connect(){this.openValue?this.open():this.close()}toggle(){this.openValue=!this.openValue}openValueChanged(e,t){e?this.open():this.close()}open(){if(this.hasContentTarget){this.contentTarget.classList.remove("hidden");this.openValue=true}}close(){if(this.hasContentTarget){this.contentTarget.classList.add("hidden");this.openValue=false}}}class ChartController extends e{static values={options:{type:Object,default:{}}};connect(){this.initDarkModeObserver();this.initChart()}disconnect(){this.darkModeObserver?.disconnect();this.chart?.destroy()}initChart(){this.setColors();const e=this.element.getContext("2d");this.chart=new n(e,this.mergeOptionsWithDefaults())}setColors(){this.setDefaultColorsForChart()}getThemeColor(e){const t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`);const[s,i,n]=t.split(" ");return`hsl(${s}, ${i}, ${n})`}defaultThemeColor(){return{backgroundColor:this.getThemeColor("background"),hoverBackgroundColor:this.getThemeColor("accent"),borderColor:this.getThemeColor("primary"),borderWidth:1}}setDefaultColorsForChart(){n.defaults.color=this.getThemeColor("muted-foreground");n.defaults.borderColor=this.getThemeColor("border");n.defaults.backgroundColor=this.getThemeColor("background");n.defaults.plugins.tooltip.backgroundColor=this.getThemeColor("background");n.defaults.plugins.tooltip.borderColor=this.getThemeColor("border");n.defaults.plugins.tooltip.titleColor=this.getThemeColor("foreground");n.defaults.plugins.tooltip.bodyColor=this.getThemeColor("muted-foreground");n.defaults.plugins.tooltip.borderWidth=1;n.defaults.plugins.legend.labels.boxWidth=12;n.defaults.plugins.legend.labels.boxHeight=12;n.defaults.plugins.legend.labels.borderWidth=0;n.defaults.plugins.legend.labels.useBorderRadius=true;n.defaults.plugins.legend.labels.borderRadius=this.getThemeColor("radius")}refreshChart(){this.chart?.destroy();this.initChart()}initDarkModeObserver(){this.darkModeObserver=new MutationObserver((()=>{this.refreshChart()}));this.darkModeObserver.observe(document.documentElement,{attributeFilter:["class"]})}mergeOptionsWithDefaults(){return{...this.optionsValue,data:{...this.optionsValue.data,datasets:this.optionsValue.data.datasets.map((e=>({...this.defaultThemeColor(),...e})))}}}}class CheckboxGroupController extends e{static targets=["checkbox"];connect(){this.element.hasAttribute("data-required")&&this.checkboxTargets.forEach((e=>{e.required=true}))}onChange(e){if(this.element.hasAttribute("data-required")){const e=this.checkboxTargets.some((e=>e.checked));this.checkboxTargets.forEach((t=>{t.required=!e}))}}}class ClipboardController extends e{static targets=["trigger","source","successPopover","errorPopover"];static values={options:{type:Object,default:{}}};copy(){let e=this.sourceTarget.children[0];if(!e){this.showErrorPopover();return}let t=e.tagName==="INPUT"?e.value:e.innerText;navigator.clipboard.writeText(t).then((()=>{this.#e()})).catch((()=>{this.#t()}))}onClickOutside(){this.successPopoverTarget.classList.contains("hidden")||this.successPopoverTarget.classList.add("hidden");this.errorPopoverTarget.classList.contains("hidden")||this.errorPopoverTarget.classList.add("hidden")}#s(e){r(this.triggerTarget,e,{placement:this.optionsValue.placement||"top",middleware:[a(),o()]}).then((({x:t,y:s})=>{Object.assign(e.style,{left:`${t}px`,top:`${s}px`})}))}#e(){this.#s(this.successPopoverTarget);this.successPopoverTarget.classList.remove("hidden")}#t(){this.#s(this.errorPopoverTarget);this.errorPopoverTarget.classList.remove("hidden")}}class ComboboxController extends e{static targets=["input","trigger","value","content","search","list","item"];static values={open:Boolean};static outlets=["rbui--combobox-item","rbui--combobox-content"];constructor(...e){super(...e);this.cleanup}connect(){this.#i();this.#n()}disconnect(){this.cleanup()}onTriggerClick(e){e.preventDefault();this.openValue?this.#r():this.#a()}onItemSelected(e){e.preventDefault();this.#o(e.target)}onKeyEnter(e){e.preventDefault();const t=this.itemTargets.find((e=>e.getAttribute("aria-current")==="true"));t||this.#r();this.#o(t)}onSearchInput(e){this.rbuiComboboxContentOutlet.handleSearchInput(e.target.value);this.#l()}onClickOutside(e){if(this.openValue&&!this.element.contains(e.target)){e.preventDefault();this.#r()}}onEscKey(e){e.preventDefault();this.#r()}onKeyDown(e){e.preventDefault();const t=this.itemTargets.findIndex((e=>e.getAttribute("aria-current")==="true"));if(t+1e.getAttribute("aria-current")==="true"));if(t>0){this.itemTargets[t].removeAttribute("aria-current");const e=this.itemTargets[t-1];this.#d(e)}}#r(){this.openValue=false;this.contentTarget.classList.add("hidden");this.triggerTarget.setAttribute("aria-expanded",false);this.triggerTarget.setAttribute("aria-activedescendant",true);this.itemTargets.forEach((e=>e.removeAttribute("aria-current")));this.triggerTarget.focus({preventScroll:true})}#a(){this.openValue=true;this.contentTarget.classList.remove("hidden");this.triggerTarget.setAttribute("aria-expanded",true);this.#l();this.searchTarget.focus({preventScroll:true})}#l(){const e=this.itemTargets.find((e=>e.getAttribute("aria-selected")==="true"));if(e){this.#d(e);return}const t=this.itemTargets.find((e=>!e.classList.contains("hidden")));this.#d(t)}#d(e){if(e){e.setAttribute("aria-current","true");this.triggerTarget.setAttribute("aria-activedescendant",e.getAttribute("id"))}}#o(e){const t=this.inputTarget.value;const s=e.dataset.value;this.rbuiComboboxItemOutlets.forEach((e=>e.handleItemSelected(s)));this.inputTarget.value=e.dataset.value;this.valueTarget.innerText=e.innerText;this.#h(t,s);this.#r()}#h(e,t){if(e===t)return;const s=new InputEvent("change",{bubbles:true,cancelable:true});this.inputTarget.dispatchEvent(s)}#n(){const e=this.listTarget.getAttribute("id");this.triggerTarget.setAttribute("aria-controls",e);this.itemTargets.forEach(((t,s)=>{t.id=`${e}-${s}`}))}#i(){this.cleanup=l(this.triggerTarget,this.contentTarget,(()=>{r(this.triggerTarget,this.contentTarget,{middleware:[d(4)]}).then((({x:e,y:t})=>{Object.assign(this.contentTarget.style,{left:`${e}px`,top:`${t}px`})}))}))}}class ComboboxContentController extends e{static targets=["item","empty","group"];handleSearchInput(e){const t=this.#c(e);this.#u(this.itemTargets,false);const s=this.#g(t);this.#u(s,true);this.#u(this.emptyTargets,s.length===0);this.#p()}#p(){this.groupTargets.forEach((e=>{const t=e.querySelectorAll("[data-rbui--combobox-content-target='item']:not(.hidden)").length>0;this.#u([e],t)}))}#g(e){return this.itemTargets.filter((t=>this.#c(t.innerText).includes(e)))}#u(e,t){e.forEach((e=>e.classList.toggle("hidden",!t)))}#c(e){return e.toLowerCase().trim()}}class ComboboxItemController extends e{handleItemSelected(e){this.element.dataset.value==e?this.element.setAttribute("aria-selected",true):this.element.removeAttribute("aria-selected")}}class CommandController extends e{static targets=["input","group","item","empty","content"];static values={open:{type:Boolean,default:false}};connect(){this.inputTarget.focus();this.searchIndex=this.buildSearchIndex();this.toggleVisibility(this.emptyTargets,false);this.selectedIndex=-1;this.openValue&&this.open()}open(e){e.preventDefault();document.body.insertAdjacentHTML("beforeend",this.contentTarget.innerHTML);document.body.classList.add("overflow-hidden")}dismiss(){document.body.classList.remove("overflow-hidden");console.log("this.element",this.element);this.element.remove()}filter(e){this.deselectAll();const t=e.target.value.toLowerCase();if(t.length===0){this.resetVisibility();return}this.toggleVisibility(this.itemTargets,false);const s=this.searchIndex.search(t);s.forEach((e=>this.toggleVisibility([e.item.element],true)));this.toggleVisibility(this.emptyTargets,s.length===0);this.updateGroupVisibility()}toggleVisibility(e,t){e.forEach((e=>e.classList.toggle("hidden",!t)))}updateGroupVisibility(){this.groupTargets.forEach((e=>{const t=e.querySelectorAll("[data-rbui--command-target='item']:not(.hidden)").length>0;this.toggleVisibility([e],t)}))}resetVisibility(){this.toggleVisibility(this.itemTargets,true);this.toggleVisibility(this.groupTargets,true);this.toggleVisibility(this.emptyTargets,false)}buildSearchIndex(){const e={keys:["value"],threshold:.2,includeMatches:true};const t=this.itemTargets.map((e=>({value:e.dataset.value,element:e})));return new h(t,e)}handleKeydown(e){const t=this.itemTargets.filter((e=>!e.classList.contains("hidden")));if(e.key==="ArrowDown"){e.preventDefault();this.updateSelectedItem(t,1)}else if(e.key==="ArrowUp"){e.preventDefault();this.updateSelectedItem(t,-1)}else if(e.key==="Enter"&&this.selectedIndex!==-1){e.preventDefault();t[this.selectedIndex].click()}}updateSelectedItem(e,t){this.selectedIndex>=0&&this.toggleAriaSelected(e[this.selectedIndex],false);this.selectedIndex+=t;this.selectedIndex<0?this.selectedIndex=e.length-1:this.selectedIndex>=e.length&&(this.selectedIndex=0);this.toggleAriaSelected(e[this.selectedIndex],true)}toggleAriaSelected(e,t){e.setAttribute("aria-selected",t.toString())}deselectAll(){this.itemTargets.forEach((e=>this.toggleAriaSelected(e,false)));this.selectedIndex=-1}}class ContextMenuController extends e{static targets=["trigger","content","menuItem"];static values={options:{type:Object,default:{}},matchWidth:{type:Boolean,default:false}};connect(){this.boundHandleKeydown=this.handleKeydown.bind(this);this.initializeTippy();this.selectedIndex=-1}disconnect(){this.destroyTippy()}initializeTippy(){const e={content:this.contentTarget.innerHTML,allowHTML:true,interactive:true,onShow:e=>{this.matchWidthValue&&this.setContentWidth(e);this.addEventListeners()},onHide:()=>{this.removeEventListeners();this.deselectAll()},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,4]}}]}};const t={...this.optionsValue,...e};this.tippy=c(this.triggerTarget,t)}destroyTippy(){this.tippy&&this.tippy.destroy()}setContentWidth(e){const t=e.popper.querySelector(".tippy-content");t&&(t.style.width=`${e.reference.offsetWidth}px`)}handleContextMenu(e){e.preventDefault();this.open()}open(){this.tippy.show()}close(){this.tippy.hide()}handleKeydown(e){if(this.menuItemTargets.length!==0)if(e.key==="ArrowDown"){e.preventDefault();this.updateSelectedItem(1)}else if(e.key==="ArrowUp"){e.preventDefault();this.updateSelectedItem(-1)}else if(e.key==="Enter"&&this.selectedIndex!==-1){e.preventDefault();this.menuItemTargets[this.selectedIndex].click()}}updateSelectedItem(e){this.menuItemTargets.forEach(((e,t)=>{e.getAttribute("aria-selected")==="true"&&(this.selectedIndex=t)}));this.selectedIndex>=0&&this.toggleAriaSelected(this.menuItemTargets[this.selectedIndex],false);this.selectedIndex+=e;this.selectedIndex<0?this.selectedIndex=this.menuItemTargets.length-1:this.selectedIndex>=this.menuItemTargets.length&&(this.selectedIndex=0);this.toggleAriaSelected(this.menuItemTargets[this.selectedIndex],true)}toggleAriaSelected(e,t){t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected")}deselectAll(){this.menuItemTargets.forEach((e=>this.toggleAriaSelected(e,false)));this.selectedIndex=-1}addEventListeners(){document.addEventListener("keydown",this.boundHandleKeydown)}removeEventListeners(){document.removeEventListener("keydown",this.boundHandleKeydown)}}class DialogController extends e{static targets=["content"];static values={open:{type:Boolean,default:false}};connect(){this.openValue&&this.open()}open(e){e.preventDefault();document.body.insertAdjacentHTML("beforeend",this.contentTarget.innerHTML);document.body.classList.add("overflow-hidden")}dismiss(){document.body.classList.remove("overflow-hidden");this.element.remove()}}class DropdownMenuController extends e{static targets=["trigger","content","menuItem"];static values={open:{type:Boolean,default:false},options:{type:Object,default:{}}};connect(){this.boundHandleKeydown=this.#m.bind(this);this.selectedIndex=-1}#s(){r(this.triggerTarget,this.contentTarget,{placement:this.optionsValue.placement||"top",middleware:[a(),o(),d(8)]}).then((({x:e,y:t})=>{Object.assign(this.contentTarget.style,{left:`${e}px`,top:`${t}px`})}))}onClickOutside(e){if(this.openValue&&!this.element.contains(e.target)){e.preventDefault();this.close()}}toggle(){this.contentTarget.classList.contains("hidden")?this.#f():this.close()}#f(){this.openValue=true;this.#T();this.#v();this.#s();this.contentTarget.classList.remove("hidden")}close(){this.openValue=false;this.#b();this.contentTarget.classList.add("hidden")}#m(e){if(this.menuItemTargets.length!==0)if(e.key==="ArrowDown"){e.preventDefault();this.#y(1)}else if(e.key==="ArrowUp"){e.preventDefault();this.#y(-1)}else if(e.key==="Enter"&&this.selectedIndex!==-1){e.preventDefault();this.menuItemTargets[this.selectedIndex].click()}}#y(e){this.menuItemTargets.forEach(((e,t)=>{e.getAttribute("aria-selected")==="true"&&(this.selectedIndex=t)}));this.selectedIndex>=0&&this.#C(this.menuItemTargets[this.selectedIndex],false);this.selectedIndex+=e;this.selectedIndex<0?this.selectedIndex=this.menuItemTargets.length-1:this.selectedIndex>=this.menuItemTargets.length&&(this.selectedIndex=0);this.#C(this.menuItemTargets[this.selectedIndex],true)}#C(e,t){t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected")}#T(){this.menuItemTargets.forEach((e=>this.#C(e,false)));this.selectedIndex=-1}#v(){document.addEventListener("keydown",this.boundHandleKeydown)}#b(){document.removeEventListener("keydown",this.boundHandleKeydown)}}class FormFieldController extends e{static targets=["input","error"];static values={shouldValidate:false};connect(){this.errorTarget.textContent?this.shouldValidateValue=true:this.errorTarget.classList.add("hidden")}onInvalid(e){e.preventDefault();this.shouldValidateValue=true;this.#I()}onInput(){this.#I()}onChange(){this.#I()}#I(){if(this.shouldValidateValue)if(this.inputTarget.validity.valid){this.errorTarget.textContent="";this.errorTarget.classList.add("hidden")}else{this.errorTarget.textContent=this.#x();this.errorTarget.classList.remove("hidden")}}#x(){const e=this.inputTarget;const t=this.inputTarget.validationMessage;return e.validity.valueMissing?e.dataset.valueMissing||t:e.validity.badInput?e.dataset.badInput||t:e.validity.patternMismatch?e.dataset.patternMismatch||t:e.validity.rangeOverflow?e.dataset.rangeOverflow||t:e.validity.rangeUnderflow?e.dataset.rangeUnderflow||t:e.validity.stepMismatch?e.dataset.stepMismatch||t:e.validity.tooLong?e.dataset.tooLong||t:e.validity.tooShort?e.dataset.tooShort||t:e.validity.typeMismatch&&e.dataset.typeMismatch||t}}class HoverCardController extends e{static targets=["trigger","content","menuItem"];static values={options:{type:Object,default:{}},matchWidth:{type:Boolean,default:false}};connect(){this.boundHandleKeydown=this.handleKeydown.bind(this);this.initializeTippy();this.selectedIndex=-1}disconnect(){this.destroyTippy()}initializeTippy(){const e={content:this.contentTarget.innerHTML,allowHTML:true,interactive:true,onShow:e=>{this.matchWidthValue&&this.setContentWidth(e);this.addEventListeners()},onHide:()=>{this.removeEventListeners();this.deselectAll()},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,4]}}]}};const t={...this.optionsValue,...e};this.tippy=c(this.triggerTarget,t)}destroyTippy(){this.tippy&&this.tippy.destroy()}setContentWidth(e){const t=e.popper.querySelector(".tippy-content");t&&(t.style.width=`${e.reference.offsetWidth}px`)}handleContextMenu(e){e.preventDefault();this.open()}open(){this.tippy.show()}close(){this.tippy.hide()}handleKeydown(e){if(this.menuItemTargets.length!==0)if(e.key==="ArrowDown"){e.preventDefault();this.updateSelectedItem(1)}else if(e.key==="ArrowUp"){e.preventDefault();this.updateSelectedItem(-1)}else if(e.key==="Enter"&&this.selectedIndex!==-1){e.preventDefault();this.menuItemTargets[this.selectedIndex].click()}}updateSelectedItem(e){this.menuItemTargets.forEach(((e,t)=>{e.getAttribute("aria-selected")==="true"&&(this.selectedIndex=t)}));this.selectedIndex>=0&&this.toggleAriaSelected(this.menuItemTargets[this.selectedIndex],false);this.selectedIndex+=e;this.selectedIndex<0?this.selectedIndex=this.menuItemTargets.length-1:this.selectedIndex>=this.menuItemTargets.length&&(this.selectedIndex=0);this.toggleAriaSelected(this.menuItemTargets[this.selectedIndex],true)}toggleAriaSelected(e,t){t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected")}deselectAll(){this.menuItemTargets.forEach((e=>this.toggleAriaSelected(e,false)));this.selectedIndex=-1}addEventListeners(){document.addEventListener("keydown",this.boundHandleKeydown)}removeEventListeners(){document.removeEventListener("keydown",this.boundHandleKeydown)}}class PopoverController extends e{static targets=["trigger","content","menuItem"];static values={options:{type:Object,default:{}},matchWidth:{type:Boolean,default:false}};connect(){this.boundHandleKeydown=this.handleKeydown.bind(this);this.initializeTippy();this.selectedIndex=-1}disconnect(){this.destroyTippy()}initializeTippy(){const e={content:this.contentTarget.innerHTML,allowHTML:true,interactive:true,onShow:e=>{this.matchWidthValue&&this.setContentWidth(e);this.addEventListeners()},onHide:()=>{this.removeEventListeners();this.deselectAll()},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,4]}}]}};const t={...this.optionsValue,...e};this.tippy=c(this.triggerTarget,t)}destroyTippy(){this.tippy&&this.tippy.destroy()}setContentWidth(e){const t=e.popper.querySelector(".tippy-content");t&&(t.style.width=`${e.reference.offsetWidth}px`)}handleContextMenu(e){e.preventDefault();this.open()}open(){this.tippy.show()}close(){this.tippy.hide()}handleKeydown(e){if(this.menuItemTargets.length!==0)if(e.key==="ArrowDown"){e.preventDefault();this.updateSelectedItem(1)}else if(e.key==="ArrowUp"){e.preventDefault();this.updateSelectedItem(-1)}else if(e.key==="Enter"&&this.selectedIndex!==-1){e.preventDefault();this.menuItemTargets[this.selectedIndex].click()}}updateSelectedItem(e){this.menuItemTargets.forEach(((e,t)=>{e.getAttribute("aria-selected")==="true"&&(this.selectedIndex=t)}));this.selectedIndex>=0&&this.toggleAriaSelected(this.menuItemTargets[this.selectedIndex],false);this.selectedIndex+=e;this.selectedIndex<0?this.selectedIndex=this.menuItemTargets.length-1:this.selectedIndex>=this.menuItemTargets.length&&(this.selectedIndex=0);this.toggleAriaSelected(this.menuItemTargets[this.selectedIndex],true)}toggleAriaSelected(e,t){t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected")}deselectAll(){this.menuItemTargets.forEach((e=>this.toggleAriaSelected(e,false)));this.selectedIndex=-1}addEventListeners(){document.addEventListener("keydown",this.boundHandleKeydown)}removeEventListeners(){document.removeEventListener("keydown",this.boundHandleKeydown)}}class TabsController extends e{static targets=["trigger","content"];static values={active:String};connect(){!this.hasActiveValue&&this.triggerTargets.length>0&&(this.activeValue=this.triggerTargets[0].dataset.value)}show(e){this.activeValue=e.currentTarget.dataset.value}activeValueChanged(e,t){if(e!=""&&e!=t){this.contentTargets.forEach((e=>{e.classList.add("hidden")}));this.triggerTargets.forEach((e=>{e.dataset.state="inactive"}));this.activeContentTarget()&&this.activeContentTarget().classList.remove("hidden");this.activeTriggerTarget().dataset.state="active"}}activeTriggerTarget(){return this.triggerTargets.find((e=>e.dataset.value==this.activeValue))}activeContentTarget(){return this.contentTargets.find((e=>e.dataset.value==this.activeValue))}}class ThemeToggleController extends e{initialize(){this.setTheme()}setTheme(){if(localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches){document.documentElement.classList.add("dark");document.documentElement.classList.remove("light")}else{document.documentElement.classList.remove("dark");document.documentElement.classList.add("light")}}setLightTheme(){localStorage.theme="light";this.setTheme()}setDarkTheme(){localStorage.theme="dark";this.setTheme()}}class TooltipController extends e{static targets=["trigger","content"];static values={placement:String};constructor(...e){super(...e);this.cleanup}connect(){this.setFloatingElement();const e=this.contentTarget.getAttribute("id");this.triggerTarget.setAttribute("aria-describedby",e)}disconnect(){this.cleanup()}setFloatingElement(){console.log(this.placementValue);this.cleanup=l(this.triggerTarget,this.contentTarget,(()=>{r(this.triggerTarget,this.contentTarget,{placement:this.placementValue,middleware:[d(4)]}).then((({x:e,y:t})=>{Object.assign(this.contentTarget.style,{left:`${e}px`,top:`${t}px`})}))}))}}class SelectController extends e{static targets=["trigger","content","input","value","item"];static values={open:Boolean};static outlets=["rbui--select-item"];constructor(...e){super(...e);this.cleanup}connect(){this.setFloatingElement();this.generateItemsIds()}disconnect(){this.cleanup()}selectItem(e){e.preventDefault();this.rbuiSelectItemOutlets.forEach((t=>t.handleSelectItem(e)));const t=this.inputTarget.value;const s=e.target.dataset.value;this.inputTarget.value=s;this.valueTarget.innerText=e.target.innerText;this.dispatchOnChange(t,s);this.closeContent()}onClick(){this.toogleContent();this.openValue?this.setFocusAndCurrent():this.resetCurrent()}handleKeyDown(e){e.preventDefault();const t=this.itemTargets.findIndex((e=>e.getAttribute("aria-current")==="true"));if(t+1e.getAttribute("aria-current")==="true"));if(t>0){this.itemTargets[t].removeAttribute("aria-current");this.setAriaCurrentAndActiveDescendant(t-1)}}handleEsc(e){e.preventDefault();this.closeContent()}setFocusAndCurrent(){const e=this.itemTargets.find((e=>e.getAttribute("aria-selected")==="true"));if(e){e.focus({preventScroll:true});e.setAttribute("aria-current","true");this.triggerTarget.setAttribute("aria-activedescendant",e.getAttribute("id"))}else{this.itemTarget.focus({preventScroll:true});this.itemTarget.setAttribute("aria-current","true");this.triggerTarget.setAttribute("aria-activedescendant",this.itemTarget.getAttribute("id"))}}resetCurrent(){this.itemTargets.forEach((e=>e.removeAttribute("aria-current")))}clickOutside(e){if(this.openValue&&!this.element.contains(e.target)){e.preventDefault();this.toogleContent()}}toogleContent(){this.openValue=!this.openValue;this.contentTarget.classList.toggle("hidden");this.triggerTarget.setAttribute("aria-expanded",this.openValue)}setFloatingElement(){this.cleanup=l(this.triggerTarget,this.contentTarget,(()=>{r(this.triggerTarget,this.contentTarget,{middleware:[d(4)]}).then((({x:e,y:t})=>{Object.assign(this.contentTarget.style,{left:`${e}px`,top:`${t}px`})}))}))}generateItemsIds(){const e=this.contentTarget.getAttribute("id");this.triggerTarget.setAttribute("aria-controls",e);this.itemTargets.forEach(((t,s)=>{t.id=`${e}-${s}`}))}setAriaCurrentAndActiveDescendant(e){const t=this.itemTargets[e];t.focus({preventScroll:true});t.setAttribute("aria-current","true");this.triggerTarget.setAttribute("aria-activedescendant",t.getAttribute("id"))}closeContent(){this.toogleContent();this.resetCurrent();this.triggerTarget.setAttribute("aria-activedescendant",true);this.triggerTarget.focus({preventScroll:true})}dispatchOnChange(e,t){if(e===t)return;const s=new InputEvent("change",{bubbles:true,cancelable:true});this.inputTarget.dispatchEvent(s)}}class SelectItemController extends e{handleSelectItem({target:e}){this.element.dataset.value==e.dataset.value?this.element.setAttribute("aria-selected",true):this.element.removeAttribute("aria-selected")}}class SheetController extends e{static targets=["content"];open(){document.body.insertAdjacentHTML("beforeend",this.contentTarget.innerHTML)}}class SheetContentController extends e{close(){this.element.remove()}}function initialize(e){const registerIfNotExists=(t,s)=>{e.router.modulesByIdentifier.has(t)||e.register(t,s)};registerIfNotExists("rbui--accordion",AccordionController);registerIfNotExists("rbui--alert-dialog",AlertDialogController);registerIfNotExists("rbui--calendar",CalendarController);registerIfNotExists("rbui--calendar-input",CalendarInputController);registerIfNotExists("rbui--collapsible",CollapsibleController);registerIfNotExists("rbui--chart",ChartController);registerIfNotExists("rbui--checkbox-group",CheckboxGroupController);registerIfNotExists("rbui--clipboard",ClipboardController);registerIfNotExists("rbui--combobox",ComboboxController);registerIfNotExists("rbui--combobox-content",ComboboxContentController);registerIfNotExists("rbui--combobox-item",ComboboxItemController);registerIfNotExists("rbui--command",CommandController);registerIfNotExists("rbui--context-menu",ContextMenuController);registerIfNotExists("rbui--dialog",DialogController);registerIfNotExists("rbui--dropdown-menu",DropdownMenuController);registerIfNotExists("rbui--form-field",FormFieldController);registerIfNotExists("rbui--hover-card",HoverCardController);registerIfNotExists("rbui--popover",PopoverController);registerIfNotExists("rbui--tabs",TabsController);registerIfNotExists("rbui--theme-toggle",ThemeToggleController);registerIfNotExists("rbui--tooltip",TooltipController);registerIfNotExists("rbui--select",SelectController);registerIfNotExists("rbui--select-item",SelectItemController);registerIfNotExists("rbui--sheet",SheetController);registerIfNotExists("rbui--sheet-content",SheetContentController)}const u={initialize:initialize};export{u as default,initialize}; + diff --git a/vendor/javascript/stupid-popper-lib-2024.js b/vendor/javascript/stupid-popper-lib-2024.js new file mode 100644 index 0000000..c81df62 --- /dev/null +++ b/vendor/javascript/stupid-popper-lib-2024.js @@ -0,0 +1,9 @@ +// @popperjs/core/+esm@2.11.8 downloaded from https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/+esm + +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@popperjs/core@2.11.8/lib/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +var e="top",t="bottom",n="right",r="left",o="auto",i=[e,t,n,r],a="start",s="end",f="clippingParents",c="viewport",p="popper",u="reference",l=i.reduce((function(e,t){return e.concat([t+"-"+a,t+"-"+s])}),[]),d=[].concat(i,[o]).reduce((function(e,t){return e.concat([t,t+"-"+a,t+"-"+s])}),[]),h="beforeRead",m="read",v="afterRead",g="beforeMain",y="main",b="afterMain",x="beforeWrite",w="write",O="afterWrite",j=[h,m,v,g,y,b,x,w,O];function E(e){return e?(e.nodeName||"").toLowerCase():null}function D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function A(e){return e instanceof D(e).Element||e instanceof Element}function L(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function k(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var P={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];L(o)&&E(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});L(r)&&E(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function M(e){return e.split("-")[0]}var W=Math.max,B=Math.min,H=Math.round;function R(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function T(){return!/^((?!chrome|android).)*safari/i.test(R())}function S(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&L(e)&&(o=e.offsetWidth>0&&H(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&H(r.height)/e.offsetHeight||1);var a=(A(e)?D(e):window).visualViewport,s=!T()&&n,f=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,p=r.width/o,u=r.height/i;return{width:p,height:u,top:c,right:f+p,bottom:c+u,left:f,x:f,y:c}}function V(e){var t=S(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&k(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function C(e){return D(e).getComputedStyle(e)}function N(e){return["table","td","th"].indexOf(E(e))>=0}function I(e){return((A(e)?e.ownerDocument:e.document)||window.document).documentElement}function F(e){return"html"===E(e)?e:e.assignedSlot||e.parentNode||(k(e)?e.host:null)||I(e)}function U(e){return L(e)&&"fixed"!==C(e).position?e.offsetParent:null}function z(e){for(var t=D(e),n=U(e);n&&N(n)&&"static"===C(n).position;)n=U(n);return n&&("html"===E(n)||"body"===E(n)&&"static"===C(n).position)?t:n||function(e){var t=/firefox/i.test(R());if(/Trident/i.test(R())&&L(e)&&"fixed"===C(e).position)return null;var n=F(e);for(k(n)&&(n=n.host);L(n)&&["html","body"].indexOf(E(n))<0;){var r=C(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function _(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e,t,n){return W(e,B(t,n))}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var J={name:"arrow",enabled:!0,phase:"main",fn:function(o){var a,s=o.state,f=o.name,c=o.options,p=s.elements.arrow,u=s.modifiersData.popperOffsets,l=M(s.placement),d=_(l),h=[r,n].indexOf(l)>=0?"height":"width";if(p&&u){var m=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,i))}(c.padding,s),v=V(p),g="y"===d?e:r,y="y"===d?t:n,b=s.rects.reference[h]+s.rects.reference[d]-u[d]-s.rects.popper[h],x=u[d]-s.rects.reference[d],w=z(p),O=w?"y"===d?w.clientHeight||0:w.clientWidth||0:0,j=b/2-x/2,E=m[g],D=O-v[h]-m[y],A=O/2-v[h]/2+j,L=X(E,A,D),k=d;s.modifiersData[f]=((a={})[k]=L,a.centerOffset=L-A,a)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function K(e){return e.split("-")[1]}var Q={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Z(o){var i,a=o.popper,f=o.popperRect,c=o.placement,p=o.variation,u=o.offsets,l=o.position,d=o.gpuAcceleration,h=o.adaptive,m=o.roundOffsets,v=o.isFixed,g=u.x,y=void 0===g?0:g,b=u.y,x=void 0===b?0:b,w="function"==typeof m?m({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var O=u.hasOwnProperty("x"),j=u.hasOwnProperty("y"),E=r,A=e,L=window;if(h){var k=z(a),P="clientHeight",M="clientWidth";if(k===D(a)&&"static"!==C(k=I(a)).position&&"absolute"===l&&(P="scrollHeight",M="scrollWidth"),c===e||(c===r||c===n)&&p===s)A=t,x-=(v&&k===L&&L.visualViewport?L.visualViewport.height:k[P])-f.height,x*=d?1:-1;if(c===r||(c===e||c===t)&&p===s)E=n,y-=(v&&k===L&&L.visualViewport?L.visualViewport.width:k[M])-f.width,y*=d?1:-1}var W,B=Object.assign({position:l},h&&Q),R=!0===m?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:H(n*o)/o||0,y:H(r*o)/o||0}}({x:y,y:x},D(a)):{x:y,y:x};return y=R.x,x=R.y,d?Object.assign({},B,((W={})[A]=j?"0":"",W[E]=O?"0":"",W.transform=(L.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",W)):Object.assign({},B,((i={})[A]=j?x+"px":"",i[E]=O?y+"px":"",i.transform="",i))}var $={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:M(t.placement),variation:K(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Z(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Z(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ee={passive:!0};var te={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,f=D(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,ee)})),s&&f.addEventListener("resize",n.update,ee),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ee)})),s&&f.removeEventListener("resize",n.update,ee)}},data:{}},ne={left:"right",right:"left",bottom:"top",top:"bottom"};function re(e){return e.replace(/left|right|bottom|top/g,(function(e){return ne[e]}))}var oe={start:"end",end:"start"};function ie(e){return e.replace(/start|end/g,(function(e){return oe[e]}))}function ae(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function se(e){return S(I(e)).left+ae(e).scrollLeft}function fe(e){var t=C(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ce(e){return["html","body","#document"].indexOf(E(e))>=0?e.ownerDocument.body:L(e)&&fe(e)?e:ce(F(e))}function pe(e,t){var n;void 0===t&&(t=[]);var r=ce(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=D(r),a=o?[i].concat(i.visualViewport||[],fe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(pe(F(a)))}function ue(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function le(e,t,n){return t===c?ue(function(e,t){var n=D(e),r=I(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,f=0;if(o){i=o.width,a=o.height;var c=T();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,f=o.offsetTop)}return{width:i,height:a,x:s+se(e),y:f}}(e,n)):A(t)?function(e,t){var n=S(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ue(function(e){var t,n=I(e),r=ae(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=W(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=W(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+se(e),f=-r.scrollTop;return"rtl"===C(o||n).direction&&(s+=W(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:f}}(I(e)))}function de(e,t,n,r){var o="clippingParents"===t?function(e){var t=pe(F(e)),n=["absolute","fixed"].indexOf(C(e).position)>=0&&L(e)?z(e):e;return A(n)?t.filter((function(e){return A(e)&&q(e,n)&&"body"!==E(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=le(e,n,r);return t.top=W(o.top,t.top),t.right=B(o.right,t.right),t.bottom=B(o.bottom,t.bottom),t.left=W(o.left,t.left),t}),le(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function he(o){var i,f=o.reference,c=o.element,p=o.placement,u=p?M(p):null,l=p?K(p):null,d=f.x+f.width/2-c.width/2,h=f.y+f.height/2-c.height/2;switch(u){case e:i={x:d,y:f.y-c.height};break;case t:i={x:d,y:f.y+f.height};break;case n:i={x:f.x+f.width,y:h};break;case r:i={x:f.x-c.width,y:h};break;default:i={x:f.x,y:f.y}}var m=u?_(u):null;if(null!=m){var v="y"===m?"height":"width";switch(l){case a:i[m]=i[m]-(f[v]/2-c[v]/2);break;case s:i[m]=i[m]+(f[v]/2-c[v]/2)}}return i}function me(r,o){void 0===o&&(o={});var a=o,s=a.placement,l=void 0===s?r.placement:s,d=a.strategy,h=void 0===d?r.strategy:d,m=a.boundary,v=void 0===m?f:m,g=a.rootBoundary,y=void 0===g?c:g,b=a.elementContext,x=void 0===b?p:b,w=a.altBoundary,O=void 0!==w&&w,j=a.padding,E=void 0===j?0:j,D=Y("number"!=typeof E?E:G(E,i)),L=x===p?u:p,k=r.rects.popper,P=r.elements[O?L:x],M=de(A(P)?P:P.contextElement||I(r.elements.popper),v,y,h),W=S(r.elements.reference),B=he({reference:W,element:k,strategy:"absolute",placement:l}),H=ue(Object.assign({},k,B)),R=x===p?H:W,T={top:M.top-R.top+D.top,bottom:R.bottom-M.bottom+D.bottom,left:M.left-R.left+D.left,right:R.right-M.right+D.right},V=r.modifiersData.offset;if(x===p&&V){var q=V[l];Object.keys(T).forEach((function(r){var o=[n,t].indexOf(r)>=0?1:-1,i=[e,t].indexOf(r)>=0?"y":"x";T[r]+=q[i]*o}))}return T}function ve(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,s=n.padding,f=n.flipVariations,c=n.allowedAutoPlacements,p=void 0===c?d:c,u=K(r),h=u?f?l:l.filter((function(e){return K(e)===u})):i,m=h.filter((function(e){return p.indexOf(e)>=0}));0===m.length&&(m=h);var v=m.reduce((function(t,n){return t[n]=me(e,{placement:n,boundary:o,rootBoundary:a,padding:s})[M(n)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ge={name:"flip",enabled:!0,phase:"main",fn:function(i){var s=i.state,f=i.options,c=i.name;if(!s.modifiersData[c]._skip){for(var p=f.mainAxis,u=void 0===p||p,l=f.altAxis,d=void 0===l||l,h=f.fallbackPlacements,m=f.padding,v=f.boundary,g=f.rootBoundary,y=f.altBoundary,b=f.flipVariations,x=void 0===b||b,w=f.allowedAutoPlacements,O=s.options.placement,j=M(O),E=h||(j===O||!x?[re(O)]:function(e){if(M(e)===o)return[];var t=re(e);return[ie(e),t,ie(t)]}(O)),D=[O].concat(E).reduce((function(e,t){return e.concat(M(t)===o?ve(s,{placement:t,boundary:v,rootBoundary:g,padding:m,flipVariations:x,allowedAutoPlacements:w}):t)}),[]),A=s.rects.reference,L=s.rects.popper,k=new Map,P=!0,W=D[0],B=0;B=0,V=S?"width":"height",q=me(s,{placement:H,boundary:v,rootBoundary:g,altBoundary:y,padding:m}),C=S?T?n:r:T?t:e;A[V]>L[V]&&(C=re(C));var N=re(C),I=[];if(u&&I.push(q[R]<=0),d&&I.push(q[C]<=0,q[N]<=0),I.every((function(e){return e}))){W=H,P=!1;break}k.set(H,I)}if(P)for(var F=function(e){var t=D.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return W=t,"break"},U=x?3:1;U>0;U--){if("break"===F(U))break}s.placement!==W&&(s.modifiersData[c]._skip=!0,s.placement=W,s.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function be(o){return[e,n,t,r].some((function(e){return o[e]>=0}))}var xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=me(t,{elementContext:"reference"}),s=me(t,{altBoundary:!0}),f=ye(a,r),c=ye(s,o,i),p=be(f),u=be(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}};var we={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var o=t.state,i=t.options,a=t.name,s=i.offset,f=void 0===s?[0,0]:s,c=d.reduce((function(t,i){return t[i]=function(t,o,i){var a=M(t),s=[r,e].indexOf(a)>=0?-1:1,f="function"==typeof i?i(Object.assign({},o,{placement:t})):i,c=f[0],p=f[1];return c=c||0,p=(p||0)*s,[r,n].indexOf(a)>=0?{x:p,y:c}:{x:c,y:p}}(i,o.rects,f),t}),{}),p=c[o.placement],u=p.x,l=p.y;null!=o.modifiersData.popperOffsets&&(o.modifiersData.popperOffsets.x+=u,o.modifiersData.popperOffsets.y+=l),o.modifiersData[a]=c}};var Oe={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=he({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(o){var i=o.state,s=o.options,f=o.name,c=s.mainAxis,p=void 0===c||c,u=s.altAxis,l=void 0!==u&&u,d=s.boundary,h=s.rootBoundary,m=s.altBoundary,v=s.padding,g=s.tether,y=void 0===g||g,b=s.tetherOffset,x=void 0===b?0:b,w=me(i,{boundary:d,rootBoundary:h,padding:v,altBoundary:m}),O=M(i.placement),j=K(i.placement),E=!j,D=_(O),A="x"===D?"y":"x",L=i.modifiersData.popperOffsets,k=i.rects.reference,P=i.rects.popper,H="function"==typeof x?x(Object.assign({},i.rects,{placement:i.placement})):x,R="number"==typeof H?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),T=i.modifiersData.offset?i.modifiersData.offset[i.placement]:null,S={x:0,y:0};if(L){if(p){var q,C="y"===D?e:r,N="y"===D?t:n,I="y"===D?"height":"width",F=L[D],U=F+w[C],Y=F-w[N],G=y?-P[I]/2:0,J=j===a?k[I]:P[I],Q=j===a?-P[I]:-k[I],Z=i.elements.arrow,$=y&&Z?V(Z):{width:0,height:0},ee=i.modifiersData["arrow#persistent"]?i.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[C],ne=ee[N],re=X(0,k[I],$[I]),oe=E?k[I]/2-G-re-te-R.mainAxis:J-re-te-R.mainAxis,ie=E?-k[I]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=i.elements.arrow&&z(i.elements.arrow),se=ae?"y"===D?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==T?void 0:T[D])?q:0,ce=F+ie-fe,pe=X(y?B(U,F+oe-fe-se):U,F,y?W(Y,ce):Y);L[D]=pe,S[D]=pe-F}if(l){var ue,le="x"===D?e:r,de="x"===D?t:n,he=L[A],ve="y"===A?"height":"width",ge=he+w[le],ye=he-w[de],be=-1!==[e,r].indexOf(O),xe=null!=(ue=null==T?void 0:T[A])?ue:0,we=be?ge:he-k[ve]-P[ve]-xe+R.altAxis,Oe=be?he+k[ve]+P[ve]-xe-R.altAxis:ye,je=y&&be?function(e,t,n){var r=X(e,t,n);return r>n?n:r}(we,he,Oe):X(y?we:ge,he,y?Oe:ye);L[A]=je,S[A]=je-he}i.modifiersData[f]=S}},requiresIfExists:["offset"]};function Ee(e,t,n){void 0===n&&(n=!1);var r,o,i=L(t),a=L(t)&&function(e){var t=e.getBoundingClientRect(),n=H(t.width)/e.offsetWidth||1,r=H(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=I(t),f=S(e,a,n),c={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(i||!i&&!n)&&(("body"!==E(t)||fe(s))&&(c=(r=t)!==D(r)&&L(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:ae(r)),L(t)?((p=S(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):s&&(p.x=se(s))),{x:f.left+c.scrollLeft-p.x,y:f.top+c.scrollTop-p.y,width:f.width,height:f.height}}function De(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var Ae={placement:"bottom",modifiers:[],strategy:"absolute"};function Le(){for(var e=arguments.length,t=new Array(e),n=0;n({}))){const optionsFunction=function(n){return{__options:n,handler:e(n),config:t(n)}};optionsFunction.__isOptionsFunction=true;optionsFunction.__pluginFunction=e;optionsFunction.__configFunction=t;return optionsFunction};const t=createPlugin$1;var n={};Object.defineProperty(n,"__esModule",{value:true});Object.defineProperty(n,"default",{enumerable:true,get:function(){return u}});const r=_interop_require_default(e);function _interop_require_default(e){return e&&e.__esModule?e:{default:e}}const u=r.default;var o={};let i=n;o=(i.__esModule?i:{default:i}).default;var l=o;export{l as default}; + diff --git a/vendor/javascript/tailwindcss-animate.js b/vendor/javascript/tailwindcss-animate.js new file mode 100644 index 0000000..0f5b494 --- /dev/null +++ b/vendor/javascript/tailwindcss-animate.js @@ -0,0 +1,4 @@ +// tailwindcss-animate@1.0.7 downloaded from https://ga.jspm.io/npm:tailwindcss-animate@1.0.7/index.js + +import*as t from"tailwindcss/plugin";var a="default"in t?t.default:t;var e={};const i=a;function filterDefault(t){return Object.fromEntries(Object.entries(t).filter((([t])=>"DEFAULT"!==t)))}e=i((({addUtilities:t,matchUtilities:a,theme:e})=>{t({"@keyframes enter":e("keyframes.enter"),"@keyframes exit":e("keyframes.exit"),".animate-in":{animationName:"enter",animationDuration:e("animationDuration.DEFAULT"),"--tw-enter-opacity":"initial","--tw-enter-scale":"initial","--tw-enter-rotate":"initial","--tw-enter-translate-x":"initial","--tw-enter-translate-y":"initial"},".animate-out":{animationName:"exit",animationDuration:e("animationDuration.DEFAULT"),"--tw-exit-opacity":"initial","--tw-exit-scale":"initial","--tw-exit-rotate":"initial","--tw-exit-translate-x":"initial","--tw-exit-translate-y":"initial"}});a({"fade-in":t=>({"--tw-enter-opacity":t}),"fade-out":t=>({"--tw-exit-opacity":t})},{values:e("animationOpacity")});a({"zoom-in":t=>({"--tw-enter-scale":t}),"zoom-out":t=>({"--tw-exit-scale":t})},{values:e("animationScale")});a({"spin-in":t=>({"--tw-enter-rotate":t}),"spin-out":t=>({"--tw-exit-rotate":t})},{values:e("animationRotate")});a({"slide-in-from-top":t=>({"--tw-enter-translate-y":`-${t}`}),"slide-in-from-bottom":t=>({"--tw-enter-translate-y":t}),"slide-in-from-left":t=>({"--tw-enter-translate-x":`-${t}`}),"slide-in-from-right":t=>({"--tw-enter-translate-x":t}),"slide-out-to-top":t=>({"--tw-exit-translate-y":`-${t}`}),"slide-out-to-bottom":t=>({"--tw-exit-translate-y":t}),"slide-out-to-left":t=>({"--tw-exit-translate-x":`-${t}`}),"slide-out-to-right":t=>({"--tw-exit-translate-x":t})},{values:e("animationTranslate")});a({duration:t=>({animationDuration:t})},{values:filterDefault(e("animationDuration"))});a({delay:t=>({animationDelay:t})},{values:e("animationDelay")});a({ease:t=>({animationTimingFunction:t})},{values:filterDefault(e("animationTimingFunction"))});t({".running":{animationPlayState:"running"},".paused":{animationPlayState:"paused"}});a({"fill-mode":t=>({animationFillMode:t})},{values:e("animationFillMode")});a({direction:t=>({animationDirection:t})},{values:e("animationDirection")});a({repeat:t=>({animationIterationCount:t})},{values:e("animationRepeat")})}),{theme:{extend:{animationDelay:({theme:t})=>({...t("transitionDelay")}),animationDuration:({theme:t})=>({0:"0ms",...t("transitionDuration")}),animationTimingFunction:({theme:t})=>({...t("transitionTimingFunction")}),animationFillMode:{none:"none",forwards:"forwards",backwards:"backwards",both:"both"},animationDirection:{normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},animationOpacity:({theme:t})=>({DEFAULT:0,...t("opacity")}),animationTranslate:({theme:t})=>({DEFAULT:"100%",...t("translate")}),animationScale:({theme:t})=>({DEFAULT:0,...t("scale")}),animationRotate:({theme:t})=>({DEFAULT:"30deg",...t("rotate")}),animationRepeat:{0:"0",1:"1",infinite:"infinite"},keyframes:{enter:{from:{opacity:"var(--tw-enter-opacity, 1)",transform:"translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))"}},exit:{to:{opacity:"var(--tw-exit-opacity, 1)",transform:"translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))"}}}}}});var n=e;export{n as default}; + diff --git a/vendor/javascript/tippy.js.js b/vendor/javascript/tippy.js.js new file mode 100644 index 0000000..7bbdc19 --- /dev/null +++ b/vendor/javascript/tippy.js.js @@ -0,0 +1,4 @@ +// tippy.js@6.3.7 downloaded from https://ga.jspm.io/npm:tippy.js@6.3.7/dist/tippy.esm.js + +import{createPopper as e,applyStyles as t}from"@popperjs/core";var n='';var r="tippy-box";var o="tippy-content";var i="tippy-backdrop";var a="tippy-arrow";var s="tippy-svg-arrow";var u={passive:true,capture:true};var c=function TIPPY_DEFAULT_APPEND_TO(){return document.body};function hasOwnProperty(e,t){return{}.hasOwnProperty.call(e,t)}function getValueAtIndexOrReturn(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function isType(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function invokeWithArgsOrReturn(e,t){return"function"===typeof e?e.apply(void 0,t):e}function debounce(e,t){return 0===t?e:function(r){clearTimeout(n);n=setTimeout((function(){e(r)}),t)};var n}function removeProperties(e,t){var n=Object.assign({},e);t.forEach((function(e){delete n[e]}));return n}function splitBySpaces(e){return e.split(/\s+/).filter(Boolean)}function normalizeToArray(e){return[].concat(e)}function pushIfUnique(e,t){-1===e.indexOf(t)&&e.push(t)}function unique(e){return e.filter((function(t,n){return e.indexOf(t)===n}))}function getBasePlacement(e){return e.split("-")[0]}function arrayFrom(e){return[].slice.call(e)}function removeUndefinedProps(e){return Object.keys(e).reduce((function(t,n){void 0!==e[n]&&(t[n]=e[n]);return t}),{})}function div(){return document.createElement("div")}function isElement(e){return["Element","Fragment"].some((function(t){return isType(e,t)}))}function isNodeList(e){return isType(e,"NodeList")}function isMouseEvent(e){return isType(e,"MouseEvent")}function isReferenceElement(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function getArrayOfElements(e){return isElement(e)?[e]:isNodeList(e)?arrayFrom(e):Array.isArray(e)?e:arrayFrom(document.querySelectorAll(e))}function setTransitionDuration(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function setVisibilityState(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function getOwnerDocument(e){var t;var n=normalizeToArray(e),r=n[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function isCursorOutsideInteractiveBorder(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props;var a=i.interactiveBorder;var s=getBasePlacement(o.placement);var u=o.modifiersData.offset;if(!u)return true;var c="bottom"===s?u.top.y:0;var p="top"===s?u.bottom.y:0;var l="right"===s?u.left.x:0;var d="left"===s?u.right.x:0;var f=t.top-r+c>a;var v=r-t.bottom-p>a;var g=t.left-n+l>a;var m=n-t.right-d>a;return f||v||g||m}))}function updateTransitionEndListener(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function actualContains(e,t){var n=t;while(n){var r;if(e.contains(n))return true;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return false}var p={isTouch:false};var l=0;function onDocumentTouchStart(){if(!p.isTouch){p.isTouch=true;window.performance&&document.addEventListener("mousemove",onDocumentMouseMove)}}function onDocumentMouseMove(){var e=performance.now();if(e-l<20){p.isTouch=false;document.removeEventListener("mousemove",onDocumentMouseMove)}l=e}function onWindowBlur(){var e=document.activeElement;if(isReferenceElement(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function bindGlobalEventListeners(){document.addEventListener("touchstart",onDocumentTouchStart,u);window.addEventListener("blur",onWindowBlur)}var d="undefined"!==typeof window&&"undefined"!==typeof document;var f=!!d&&!!window.msCrypto;function createMemoryLeakWarning(e){var t="destroy"===e?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function clean(e){var t=/[ \t]{2,}/g;var n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function getDevMessage(e){return clean("\n %ctippy.js\n\n %c"+clean(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function getFormattedMessage(e){return[getDevMessage(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var v;"production"!==process.env.NODE_ENV&&resetVisitedMessages();function resetVisitedMessages(){v=new Set}function warnWhen(e,t){if(e&&!v.has(t)){var n;v.add(t);(n=console).warn.apply(n,getFormattedMessage(t))}}function errorWhen(e,t){if(e&&!v.has(t)){var n;v.add(t);(n=console).error.apply(n,getFormattedMessage(t))}}function validateTargets(e){var t=!e;var n="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;errorWhen(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" "));errorWhen(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var g={animateFill:false,followCursor:false,inlinePositioning:false,sticky:false};var m={allowHTML:false,animation:"fade",arrow:true,content:"",inertia:false,maxWidth:350,role:"tooltip",theme:"",zIndex:9999};var h=Object.assign({appendTo:c,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:true,ignoreAttributes:false,interactive:false,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function onAfterUpdate(){},onBeforeUpdate:function onBeforeUpdate(){},onCreate:function onCreate(){},onDestroy:function onDestroy(){},onHidden:function onHidden(){},onHide:function onHide(){},onMount:function onMount(){},onShow:function onShow(){},onShown:function onShown(){},onTrigger:function onTrigger(){},onUntrigger:function onUntrigger(){},onClickOutside:function onClickOutside(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:false,touch:true,trigger:"mouseenter focus",triggerTarget:null},g,m);var y=Object.keys(h);var b=function setDefaultProps(e){"production"!==process.env.NODE_ENV&&validateProps(e,[]);var t=Object.keys(e);t.forEach((function(t){h[t]=e[t]}))};function getExtendedPassedProps(e){var t=e.plugins||[];var n=t.reduce((function(t,n){var r=n.name,o=n.defaultValue;if(r){var i;t[r]=void 0!==e[r]?e[r]:null!=(i=h[r])?i:o}return t}),{});return Object.assign({},e,n)}function getDataAttributeProps(e,t){var n=t?Object.keys(getExtendedPassedProps(Object.assign({},h,{plugins:t}))):y;var r=n.reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{});return r}function evaluateProps(e,t){var n=Object.assign({},t,{content:invokeWithArgsOrReturn(t.content,[e])},t.ignoreAttributes?{}:getDataAttributeProps(e,t.plugins));n.aria=Object.assign({},h.aria,n.aria);n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content};return n}function validateProps(e,t){void 0===e&&(e={});void 0===t&&(t=[]);var n=Object.keys(e);n.forEach((function(e){var n=removeProperties(h,Object.keys(g));var r=!hasOwnProperty(n,e);r&&(r=0===t.filter((function(t){return t.name===e})).length);warnWhen(r,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}var T=function innerHTML(){return"innerHTML"};function dangerouslySetInnerHTML(e,t){e[T()]=t}function createArrowElement(e){var t=div();if(true===e)t.className=a;else{t.className=s;isElement(e)?t.appendChild(e):dangerouslySetInnerHTML(t,e)}return t}function setContent(e,t){if(isElement(t.content)){dangerouslySetInnerHTML(e,"");e.appendChild(t.content)}else"function"!==typeof t.content&&(t.allowHTML?dangerouslySetInnerHTML(e,t.content):e.textContent=t.content)}function getChildren(e){var t=e.firstElementChild;var n=arrayFrom(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(o)})),arrow:n.find((function(e){return e.classList.contains(a)||e.classList.contains(s)})),backdrop:n.find((function(e){return e.classList.contains(i)}))}}function render(e){var t=div();var n=div();n.className=r;n.setAttribute("data-state","hidden");n.setAttribute("tabindex","-1");var i=div();i.className=o;i.setAttribute("data-state","hidden");setContent(i,e.props);t.appendChild(n);n.appendChild(i);onUpdate(e.props,e.props);function onUpdate(n,r){var o=getChildren(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme");"string"===typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation");r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia");i.style.maxWidth="number"===typeof r.maxWidth?r.maxWidth+"px":r.maxWidth;r.role?i.setAttribute("role",r.role):i.removeAttribute("role");n.content===r.content&&n.allowHTML===r.allowHTML||setContent(a,e.props);if(r.arrow)if(s){if(n.arrow!==r.arrow){i.removeChild(s);i.appendChild(createArrowElement(r.arrow))}}else i.appendChild(createArrowElement(r.arrow));else s&&i.removeChild(s)}return{popper:t,onUpdate:onUpdate}}render.$$tippy=true;var E=1;var w=[];var C=[];function createTippy(t,n){var r=evaluateProps(t,Object.assign({},h,getExtendedPassedProps(removeUndefinedProps(n))));var o;var i;var a;var s=false;var l=false;var d=false;var v=false;var g;var m;var y;var b=[];var T=debounce(onMouseMove,r.interactiveDebounce);var D;var O=E++;var A=null;var M=unique(r.plugins);var P={isEnabled:true,isVisible:false,isDestroyed:false,isMounted:false,isShown:false};var L={id:O,reference:t,popper:div(),popperInstance:A,props:r,state:P,plugins:M,clearDelayTimeouts:clearDelayTimeouts,setProps:setProps,setContent:setContent,show:show,hide:hide,hideWithInteractivity:hideWithInteractivity,enable:enable,disable:disable,unmount:unmount,destroy:destroy};if(!r.render){"production"!==process.env.NODE_ENV&&errorWhen(true,"render() function has not been supplied.");return L}var I=r.render(L),k=I.popper,R=I.onUpdate;k.setAttribute("data-tippy-root","");k.id="tippy-"+L.id;L.popper=k;t._tippy=L;k._tippy=L;var x=M.map((function(e){return e.fn(L)}));var S=t.hasAttribute("aria-expanded");addListeners();handleAriaExpandedAttribute();handleStyles();invokeHook("onCreate",[L]);r.showOnCreate&&scheduleShow();k.addEventListener("mouseenter",(function(){L.props.interactive&&L.state.isVisible&&L.clearDelayTimeouts()}));k.addEventListener("mouseleave",(function(){L.props.interactive&&L.props.trigger.indexOf("mouseenter")>=0&&getDocument().addEventListener("mousemove",T)}));return L;function getNormalizedTouchSettings(){var e=L.props.touch;return Array.isArray(e)?e:[e,0]}function getIsCustomTouchBehavior(){return"hold"===getNormalizedTouchSettings()[0]}function getIsDefaultRenderFn(){var e;return!!(null!=(e=L.props.render)&&e.$$tippy)}function getCurrentTarget(){return D||t}function getDocument(){var e=getCurrentTarget().parentNode;return e?getOwnerDocument(e):document}function getDefaultTemplateChildren(){return getChildren(k)}function getDelay(e){return L.state.isMounted&&!L.state.isVisible||p.isTouch||g&&"focus"===g.type?0:getValueAtIndexOrReturn(L.props.delay,e?0:1,h.delay)}function handleStyles(e){void 0===e&&(e=false);k.style.pointerEvents=L.props.interactive&&!e?"":"none";k.style.zIndex=""+L.props.zIndex}function invokeHook(e,t,n){void 0===n&&(n=true);x.forEach((function(n){n[e]&&n[e].apply(n,t)}));if(n){var r;(r=L.props)[e].apply(r,t)}}function handleAriaContentAttribute(){var e=L.props.aria;if(e.content){var n="aria-"+e.content;var r=k.id;var o=normalizeToArray(L.props.triggerTarget||t);o.forEach((function(e){var t=e.getAttribute(n);if(L.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function handleAriaExpandedAttribute(){if(!S&&L.props.aria.expanded){var e=normalizeToArray(L.props.triggerTarget||t);e.forEach((function(e){L.props.interactive?e.setAttribute("aria-expanded",L.state.isVisible&&e===getCurrentTarget()?"true":"false"):e.removeAttribute("aria-expanded")}))}}function cleanupInteractiveMouseListeners(){getDocument().removeEventListener("mousemove",T);w=w.filter((function(e){return e!==T}))}function onDocumentPress(e){if(!p.isTouch||!d&&"mousedown"!==e.type){var n=e.composedPath&&e.composedPath()[0]||e.target;if(!L.props.interactive||!actualContains(k,n)){if(normalizeToArray(L.props.triggerTarget||t).some((function(e){return actualContains(e,n)}))){if(p.isTouch)return;if(L.state.isVisible&&L.props.trigger.indexOf("click")>=0)return}else invokeHook("onClickOutside",[L,e]);if(true===L.props.hideOnClick){L.clearDelayTimeouts();L.hide();l=true;setTimeout((function(){l=false}));L.state.isMounted||removeDocumentPress()}}}}function onTouchMove(){d=true}function onTouchStart(){d=false}function addDocumentPress(){var e=getDocument();e.addEventListener("mousedown",onDocumentPress,true);e.addEventListener("touchend",onDocumentPress,u);e.addEventListener("touchstart",onTouchStart,u);e.addEventListener("touchmove",onTouchMove,u)}function removeDocumentPress(){var e=getDocument();e.removeEventListener("mousedown",onDocumentPress,true);e.removeEventListener("touchend",onDocumentPress,u);e.removeEventListener("touchstart",onTouchStart,u);e.removeEventListener("touchmove",onTouchMove,u)}function onTransitionedOut(e,t){onTransitionEnd(e,(function(){!L.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&t()}))}function onTransitionedIn(e,t){onTransitionEnd(e,t)}function onTransitionEnd(e,t){var n=getDefaultTemplateChildren().box;function listener(e){if(e.target===n){updateTransitionEndListener(n,"remove",listener);t()}}if(0===e)return t();updateTransitionEndListener(n,"remove",m);updateTransitionEndListener(n,"add",listener);m=listener}function on(e,n,r){void 0===r&&(r=false);var o=normalizeToArray(L.props.triggerTarget||t);o.forEach((function(t){t.addEventListener(e,n,r);b.push({node:t,eventType:e,handler:n,options:r})}))}function addListeners(){if(getIsCustomTouchBehavior()){on("touchstart",onTrigger,{passive:true});on("touchend",onMouseLeave,{passive:true})}splitBySpaces(L.props.trigger).forEach((function(e){if("manual"!==e){on(e,onTrigger);switch(e){case"mouseenter":on("mouseleave",onMouseLeave);break;case"focus":on(f?"focusout":"blur",onBlurOrFocusOut);break;case"focusin":on("focusout",onBlurOrFocusOut);break}}}))}function removeListeners(){b.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)}));b=[]}function onTrigger(e){var t;var n=false;if(L.state.isEnabled&&!isEventListenerStopped(e)&&!l){var r="focus"===(null==(t=g)?void 0:t.type);g=e;D=e.currentTarget;handleAriaExpandedAttribute();!L.state.isVisible&&isMouseEvent(e)&&w.forEach((function(t){return t(e)}));"click"===e.type&&(L.props.trigger.indexOf("mouseenter")<0||s)&&false!==L.props.hideOnClick&&L.state.isVisible?n=true:scheduleShow(e);"click"===e.type&&(s=!n);n&&!r&&scheduleHide(e)}}function onMouseMove(e){var t=e.target;var n=getCurrentTarget().contains(t)||k.contains(t);if("mousemove"!==e.type||!n){var o=getNestedPopperTree().concat(k).map((function(e){var t;var n=e._tippy;var o=null==(t=n.popperInstance)?void 0:t.state;return o?{popperRect:e.getBoundingClientRect(),popperState:o,props:r}:null})).filter(Boolean);if(isCursorOutsideInteractiveBorder(o,e)){cleanupInteractiveMouseListeners();scheduleHide(e)}}}function onMouseLeave(e){var t=isEventListenerStopped(e)||L.props.trigger.indexOf("click")>=0&&s;t||(L.props.interactive?L.hideWithInteractivity(e):scheduleHide(e))}function onBlurOrFocusOut(e){L.props.trigger.indexOf("focusin")<0&&e.target!==getCurrentTarget()||L.props.interactive&&e.relatedTarget&&k.contains(e.relatedTarget)||scheduleHide(e)}function isEventListenerStopped(e){return!!p.isTouch&&getIsCustomTouchBehavior()!==e.type.indexOf("touch")>=0}function createPopperInstance(){destroyPopperInstance();var n=L.props,r=n.popperOptions,o=n.placement,i=n.offset,a=n.getReferenceClientRect,s=n.moveTransition;var u=getIsDefaultRenderFn()?getChildren(k).arrow:null;var c=a?{getBoundingClientRect:a,contextElement:a.contextElement||getCurrentTarget()}:t;var p={name:"$$tippy",enabled:true,phase:"beforeWrite",requires:["computeStyles"],fn:function fn(e){var t=e.state;if(getIsDefaultRenderFn()){var n=getDefaultTemplateChildren(),r=n.box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}));t.attributes.popper={}}}};var l=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},p];getIsDefaultRenderFn()&&u&&l.push({name:"arrow",options:{element:u,padding:3}});l.push.apply(l,(null==r?void 0:r.modifiers)||[]);L.popperInstance=e(c,k,Object.assign({},r,{placement:o,onFirstUpdate:y,modifiers:l}))}function destroyPopperInstance(){if(L.popperInstance){L.popperInstance.destroy();L.popperInstance=null}}function mount(){var e=L.props.appendTo;var t;var n=getCurrentTarget();t=L.props.interactive&&e===c||"parent"===e?n.parentNode:invokeWithArgsOrReturn(e,[n]);t.contains(k)||t.appendChild(k);L.state.isMounted=true;createPopperInstance();"production"!==process.env.NODE_ENV&&warnWhen(L.props.interactive&&e===h.appendTo&&n.nextElementSibling!==k,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function getNestedPopperTree(){return arrayFrom(k.querySelectorAll("[data-tippy-root]"))}function scheduleShow(e){L.clearDelayTimeouts();e&&invokeHook("onTrigger",[L,e]);addDocumentPress();var t=getDelay(true);var n=getNormalizedTouchSettings(),r=n[0],i=n[1];p.isTouch&&"hold"===r&&i&&(t=i);t?o=setTimeout((function(){L.show()}),t):L.show()}function scheduleHide(e){L.clearDelayTimeouts();invokeHook("onUntrigger",[L,e]);if(L.state.isVisible){if(!(L.props.trigger.indexOf("mouseenter")>=0&&L.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&s)){var t=getDelay(false);t?i=setTimeout((function(){L.state.isVisible&&L.hide()}),t):a=requestAnimationFrame((function(){L.hide()}))}}else removeDocumentPress()}function enable(){L.state.isEnabled=true}function disable(){L.hide();L.state.isEnabled=false}function clearDelayTimeouts(){clearTimeout(o);clearTimeout(i);cancelAnimationFrame(a)}function setProps(e){"production"!==process.env.NODE_ENV&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("setProps"));if(!L.state.isDestroyed){invokeHook("onBeforeUpdate",[L,e]);removeListeners();var n=L.props;var r=evaluateProps(t,Object.assign({},n,removeUndefinedProps(e),{ignoreAttributes:true}));L.props=r;addListeners();if(n.interactiveDebounce!==r.interactiveDebounce){cleanupInteractiveMouseListeners();T=debounce(onMouseMove,r.interactiveDebounce)}n.triggerTarget&&!r.triggerTarget?normalizeToArray(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&t.removeAttribute("aria-expanded");handleAriaExpandedAttribute();handleStyles();R&&R(n,r);if(L.popperInstance){createPopperInstance();getNestedPopperTree().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))}invokeHook("onAfterUpdate",[L,e])}}function setContent(e){L.setProps({content:e})}function show(){"production"!==process.env.NODE_ENV&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("show"));var e=L.state.isVisible;var t=L.state.isDestroyed;var n=!L.state.isEnabled;var r=p.isTouch&&!L.props.touch;var o=getValueAtIndexOrReturn(L.props.duration,0,h.duration);if(!(e||t||n||r)&&!getCurrentTarget().hasAttribute("disabled")){invokeHook("onShow",[L],false);if(false!==L.props.onShow(L)){L.state.isVisible=true;getIsDefaultRenderFn()&&(k.style.visibility="visible");handleStyles();addDocumentPress();L.state.isMounted||(k.style.transition="none");if(getIsDefaultRenderFn()){var i=getDefaultTemplateChildren(),a=i.box,s=i.content;setTransitionDuration([a,s],0)}y=function onFirstUpdate(){var e;if(L.state.isVisible&&!v){v=true;void k.offsetHeight;k.style.transition=L.props.moveTransition;if(getIsDefaultRenderFn()&&L.props.animation){var t=getDefaultTemplateChildren(),n=t.box,r=t.content;setTransitionDuration([n,r],o);setVisibilityState([n,r],"visible")}handleAriaContentAttribute();handleAriaExpandedAttribute();pushIfUnique(C,L);null==(e=L.popperInstance)?void 0:e.forceUpdate();invokeHook("onMount",[L]);L.props.animation&&getIsDefaultRenderFn()&&onTransitionedIn(o,(function(){L.state.isShown=true;invokeHook("onShown",[L])}))}};mount()}}}function hide(){"production"!==process.env.NODE_ENV&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("hide"));var e=!L.state.isVisible;var t=L.state.isDestroyed;var n=!L.state.isEnabled;var r=getValueAtIndexOrReturn(L.props.duration,1,h.duration);if(!(e||t||n)){invokeHook("onHide",[L],false);if(false!==L.props.onHide(L)){L.state.isVisible=false;L.state.isShown=false;v=false;s=false;getIsDefaultRenderFn()&&(k.style.visibility="hidden");cleanupInteractiveMouseListeners();removeDocumentPress();handleStyles(true);if(getIsDefaultRenderFn()){var o=getDefaultTemplateChildren(),i=o.box,a=o.content;if(L.props.animation){setTransitionDuration([i,a],r);setVisibilityState([i,a],"hidden")}}handleAriaContentAttribute();handleAriaExpandedAttribute();L.props.animation?getIsDefaultRenderFn()&&onTransitionedOut(r,L.unmount):L.unmount()}}}function hideWithInteractivity(e){"production"!==process.env.NODE_ENV&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("hideWithInteractivity"));getDocument().addEventListener("mousemove",T);pushIfUnique(w,T);T(e)}function unmount(){"production"!==process.env.NODE_ENV&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("unmount"));L.state.isVisible&&L.hide();if(L.state.isMounted){destroyPopperInstance();getNestedPopperTree().forEach((function(e){e._tippy.unmount()}));k.parentNode&&k.parentNode.removeChild(k);C=C.filter((function(e){return e!==L}));L.state.isMounted=false;invokeHook("onHidden",[L])}}function destroy(){"production"!==process.env.NODE_ENV&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("destroy"));if(!L.state.isDestroyed){L.clearDelayTimeouts();L.unmount();removeListeners();delete t._tippy;L.state.isDestroyed=true;invokeHook("onDestroy",[L])}}}function tippy(e,t){void 0===t&&(t={});var n=h.plugins.concat(t.plugins||[]);if("production"!==process.env.NODE_ENV){validateTargets(e);validateProps(t,n)}bindGlobalEventListeners();var r=Object.assign({},t,{plugins:n});var o=getArrayOfElements(e);if("production"!==process.env.NODE_ENV){var i=isElement(r.content);var a=o.length>1;warnWhen(i&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=o.reduce((function(e,t){var n=t&&createTippy(t,r);n&&e.push(n);return e}),[]);return isElement(e)?s[0]:s}tippy.defaultProps=h;tippy.setDefaultProps=b;tippy.currentInput=p;var D=function hideAll(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;C.forEach((function(e){var t=false;n&&(t=isReferenceElement(n)?e.reference===n:e.popper===n.popper);if(!t){var o=e.props.duration;e.setProps({duration:r});e.hide();e.state.isDestroyed||e.setProps({duration:o})}}))};var O=Object.assign({},t,{effect:function effect(e){var t=e.state;var n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper);t.styles=n;t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var A=function createSingleton(e,t){var n;void 0===t&&(t={});"production"!==process.env.NODE_ENV&&errorWhen(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var r=e;var o=[];var i=[];var a;var s=t.overrides;var u=[];var c=false;function setTriggerTargets(){i=r.map((function(e){return normalizeToArray(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function setReferences(){o=r.map((function(e){return e.reference}))}function enableInstances(e){r.forEach((function(t){e?t.enable():t.disable()}))}function interceptSetProps(e){return r.map((function(t){var n=t.setProps;t.setProps=function(r){n(r);t.reference===a&&e.setProps(r)};return function(){t.setProps=n}}))}function prepareInstance(e,t){var n=i.indexOf(t);if(t!==a){a=t;var u=(s||[]).concat("content").reduce((function(e,t){e[t]=r[n].props[t];return e}),{});e.setProps(Object.assign({},u,{getReferenceClientRect:"function"===typeof u.getReferenceClientRect?u.getReferenceClientRect:function(){var e;return null==(e=o[n])?void 0:e.getBoundingClientRect()}}))}}enableInstances(false);setReferences();setTriggerTargets();var p={fn:function fn(){return{onDestroy:function onDestroy(){enableInstances(true)},onHidden:function onHidden(){a=null},onClickOutside:function onClickOutside(e){if(e.props.showOnCreate&&!c){c=true;a=null}},onShow:function onShow(e){if(e.props.showOnCreate&&!c){c=true;prepareInstance(e,o[0])}},onTrigger:function onTrigger(e,t){prepareInstance(e,t.currentTarget)}}}};var l=tippy(div(),Object.assign({},removeProperties(t,["overrides"]),{plugins:[p].concat(t.plugins||[]),triggerTarget:i,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[O])})}));var d=l.show;l.show=function(e){d();if(!a&&null==e)return prepareInstance(l,o[0]);if(!a||null!=e){if("number"===typeof e)return o[e]&&prepareInstance(l,o[e]);if(r.indexOf(e)>=0){var t=e.reference;return prepareInstance(l,t)}return o.indexOf(e)>=0?prepareInstance(l,e):void 0}};l.showNext=function(){var e=o[0];if(!a)return l.show(0);var t=o.indexOf(a);l.show(o[t+1]||e)};l.showPrevious=function(){var e=o[o.length-1];if(!a)return l.show(e);var t=o.indexOf(a);var n=o[t-1]||e;l.show(n)};var f=l.setProps;l.setProps=function(e){s=e.overrides||s;f(e)};l.setInstances=function(e){enableInstances(true);u.forEach((function(e){return e()}));r=e;enableInstances(false);setReferences();setTriggerTargets();u=interceptSetProps(l);l.setProps({triggerTarget:i})};u=interceptSetProps(l);return l};var M={mouseover:"mouseenter",focusin:"focus",click:"click"};function delegate(e,t){"production"!==process.env.NODE_ENV&&errorWhen(!(t&&t.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var n=[];var r=[];var o=false;var i=t.target;var a=removeProperties(t,["target"]);var s=Object.assign({},a,{trigger:"manual",touch:false});var c=Object.assign({touch:h.touch},a,{showOnCreate:true});var p=tippy(e,s);var l=normalizeToArray(p);function onTrigger(e){if(e.target&&!o){var n=e.target.closest(i);if(n){var a=n.getAttribute("data-tippy-trigger")||t.trigger||h.trigger;if(!n._tippy&&("touchstart"!==e.type||"boolean"!==typeof c.touch)&&!("touchstart"!==e.type&&a.indexOf(M[e.type])<0)){var s=tippy(n,c);s&&(r=r.concat(s))}}}}function on(e,t,r,o){void 0===o&&(o=false);e.addEventListener(t,r,o);n.push({node:e,eventType:t,handler:r,options:o})}function addEventListeners(e){var t=e.reference;on(t,"touchstart",onTrigger,u);on(t,"mouseover",onTrigger);on(t,"focusin",onTrigger);on(t,"click",onTrigger)}function removeEventListeners(){n.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)}));n=[]}function applyMutations(e){var t=e.destroy;var n=e.enable;var i=e.disable;e.destroy=function(e){void 0===e&&(e=true);e&&r.forEach((function(e){e.destroy()}));r=[];removeEventListeners();t()};e.enable=function(){n();r.forEach((function(e){return e.enable()}));o=false};e.disable=function(){i();r.forEach((function(e){return e.disable()}));o=true};addEventListeners(e)}l.forEach(applyMutations);return p}var P={name:"animateFill",defaultValue:false,fn:function fn(e){var t;if(!(null!=(t=e.props.render)&&t.$$tippy)){"production"!==process.env.NODE_ENV&&errorWhen(e.props.animateFill,"The `animateFill` plugin requires the default render function.");return{}}var n=getChildren(e.popper),r=n.box,o=n.content;var i=e.props.animateFill?createBackdropElement():null;return{onCreate:function onCreate(){if(i){r.insertBefore(i,r.firstElementChild);r.setAttribute("data-animatefill","");r.style.overflow="hidden";e.setProps({arrow:false,animation:"shift-away"})}},onMount:function onMount(){if(i){var e=r.style.transitionDuration;var t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms";i.style.transitionDuration=e;setVisibilityState([i],"visible")}},onShow:function onShow(){i&&(i.style.transitionDuration="0ms")},onHide:function onHide(){i&&setVisibilityState([i],"hidden")}}}};function createBackdropElement(){var e=div();e.className=i;setVisibilityState([e],"hidden");return e}var L={clientX:0,clientY:0};var I=[];function storeMouseCoords(e){var t=e.clientX,n=e.clientY;L={clientX:t,clientY:n}}function addMouseCoordsListener(e){e.addEventListener("mousemove",storeMouseCoords)}function removeMouseCoordsListener(e){e.removeEventListener("mousemove",storeMouseCoords)}var k={name:"followCursor",defaultValue:false,fn:function fn(e){var t=e.reference;var n=getOwnerDocument(e.props.triggerTarget||t);var r=false;var o=false;var i=true;var a=e.props;function getIsInitialBehavior(){return"initial"===e.props.followCursor&&e.state.isVisible}function addListener(){n.addEventListener("mousemove",onMouseMove)}function removeListener(){n.removeEventListener("mousemove",onMouseMove)}function unsetGetReferenceClientRect(){r=true;e.setProps({getReferenceClientRect:null});r=false}function onMouseMove(n){var r=!n.target||t.contains(n.target);var o=e.props.followCursor;var i=n.clientX,a=n.clientY;var s=t.getBoundingClientRect();var u=i-s.left;var c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function getReferenceClientRect(){var e=t.getBoundingClientRect();var n=i;var r=a;if("initial"===o){n=e.left+u;r=e.top+c}var s="horizontal"===o?e.top:r;var p="vertical"===o?e.right:n;var l="horizontal"===o?e.bottom:r;var d="vertical"===o?e.left:n;return{width:p-d,height:l-s,top:s,right:p,bottom:l,left:d}}})}function create(){if(e.props.followCursor){I.push({instance:e,doc:n});addMouseCoordsListener(n)}}function destroy(){I=I.filter((function(t){return t.instance!==e}));0===I.filter((function(e){return e.doc===n})).length&&removeMouseCoordsListener(n)}return{onCreate:create,onDestroy:destroy,onBeforeUpdate:function onBeforeUpdate(){a=e.props},onAfterUpdate:function onAfterUpdate(t,n){var i=n.followCursor;if(!r&&void 0!==i&&a.followCursor!==i){destroy();if(i){create();!e.state.isMounted||o||getIsInitialBehavior()||addListener()}else{removeListener();unsetGetReferenceClientRect()}}},onMount:function onMount(){if(e.props.followCursor&&!o){if(i){onMouseMove(L);i=false}getIsInitialBehavior()||addListener()}},onTrigger:function onTrigger(e,t){isMouseEvent(t)&&(L={clientX:t.clientX,clientY:t.clientY});o="focus"===t.type},onHidden:function onHidden(){if(e.props.followCursor){unsetGetReferenceClientRect();removeListener();i=true}}}}};function getProps(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){var n=e.name;return n!==t.name})),[t])})}}var R={name:"inlinePositioning",defaultValue:false,fn:function fn(e){var t=e.reference;function isEnabled(){return!!e.props.inlinePositioning}var n;var r=-1;var o=false;var i=[];var a={name:"tippyInlinePositioning",enabled:true,phase:"afterWrite",fn:function fn(t){var r=t.state;if(isEnabled()){-1!==i.indexOf(r.placement)&&(i=[]);if(n!==r.placement&&-1===i.indexOf(r.placement)){i.push(r.placement);e.setProps({getReferenceClientRect:function getReferenceClientRect(){return _getReferenceClientRect(r.placement)}})}n=r.placement}}};function _getReferenceClientRect(e){return getInlineBoundingClientRect(getBasePlacement(e),t.getBoundingClientRect(),arrayFrom(t.getClientRects()),r)}function setInternalProps(t){o=true;e.setProps(t);o=false}function addModifier(){o||setInternalProps(getProps(e.props,a))}return{onCreate:addModifier,onAfterUpdate:addModifier,onTrigger:function onTrigger(t,n){if(isMouseEvent(n)){var o=arrayFrom(e.reference.getClientRects());var i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY}));var a=o.indexOf(i);r=a>-1?a:r}},onHidden:function onHidden(){r=-1}}}};function getInlineBoundingClientRect(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0];var i=n[n.length-1];var a="top"===e;var s=o.top;var u=i.bottom;var c=a?o.left:i.left;var p=a?o.right:i.right;var l=p-c;var d=u-s;return{top:s,bottom:u,left:c,right:p,width:l,height:d};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left})));var v=Math.max.apply(Math,n.map((function(e){return e.right})));var g=n.filter((function(t){return"left"===e?t.left===f:t.right===v}));var m=g[0].top;var h=g[g.length-1].bottom;var y=f;var b=v;var T=b-y;var E=h-m;return{top:m,bottom:h,left:y,right:b,width:T,height:E};default:return t}}var x={name:"sticky",defaultValue:false,fn:function fn(e){var t=e.reference,n=e.popper;function getReference(){return e.popperInstance?e.popperInstance.state.elements.reference:t}function shouldCheck(t){return true===e.props.sticky||e.props.sticky===t}var r=null;var o=null;function updatePosition(){var t=shouldCheck("reference")?getReference().getBoundingClientRect():null;var i=shouldCheck("popper")?n.getBoundingClientRect():null;(t&&areRectsDifferent(r,t)||i&&areRectsDifferent(o,i))&&e.popperInstance&&e.popperInstance.update();r=t;o=i;e.state.isMounted&&requestAnimationFrame(updatePosition)}return{onMount:function onMount(){e.props.sticky&&updatePosition()}}}};function areRectsDifferent(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}tippy.setDefaultProps({render:render});export{P as animateFill,A as createSingleton,tippy as default,delegate,k as followCursor,D as hideAll,R as inlinePositioning,n as roundArrow,x as sticky}; + diff --git a/vendor/javascript/tslib.js b/vendor/javascript/tslib.js new file mode 100644 index 0000000..4dec660 --- /dev/null +++ b/vendor/javascript/tslib.js @@ -0,0 +1,6 @@ +// tslib@2.7.0 downloaded from https://ga.jspm.io/npm:tslib@2.7.0/tslib.es6.mjs + +var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])};return extendStatics(e,t)};function __extends(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){__assign=Object.assign||function __assign(e){for(var t,r=1,n=arguments.length;r=0;c--)(o=e[c])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function __param(e,t){return function(r,n){t(r,n,e)}}function __esDecorate(e,t,r,n,o,a){function accept(e){if(e!==void 0&&typeof e!=="function")throw new TypeError("Function expected");return e}var i=n.kind,c=i==="getter"?"get":i==="setter"?"set":"value";var s=!t&&e?n.static?e:e.prototype:null;var u=t||(s?Object.getOwnPropertyDescriptor(s,n.name):{});var l,_=false;for(var f=r.length-1;f>=0;f--){var p={};for(var y in n)p[y]=y==="access"?{}:n[y];for(var y in n.access)p.access[y]=n.access[y];p.addInitializer=function(e){if(_)throw new TypeError("Cannot add initializers after decoration has completed");a.push(accept(e||null))};var d=(0,r[f])(i==="accessor"?{get:u.get,set:u.set}:u[c],p);if(i==="accessor"){if(d===void 0)continue;if(d===null||typeof d!=="object")throw new TypeError("Object expected");(l=accept(d.get))&&(u.get=l);(l=accept(d.set))&&(u.set=l);(l=accept(d.init))&&o.unshift(l)}else(l=accept(d))&&(i==="field"?o.unshift(l):u[c]=l)}s&&Object.defineProperty(s,n.name,u);_=true}function __runInitializers(e,t,r){var n=arguments.length>2;for(var o=0;o0&&o[o.length-1])&&(c[0]===6||c[0]===2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0);return{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i} +/** @deprecated */function __spread(){for(var e=[],t=0;t1||resume(e,t)}))};t&&(n[e]=t(n[e]))}}function resume(e,t){try{step(o[e](t))}catch(e){settle(a[0][3],e)}}function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(a[0][2],e)}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){(e(t),a.shift(),a.length)&&resume(a[0][0],a[0][1])}}function __asyncDelegator(e){var t,r;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:__await(e[n](t)),done:false}:o?o(t):t}:o}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t);function verb(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){t=e[r](t),settle(n,o,t.done,t.value)}))}}function settle(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}}function __makeTemplateObject(e,t){Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t;return e}var t=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e.default=t};function __importStar(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&e(n,r,o);t(n,r);return n}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function __classPrivateFieldSet(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function __classPrivateFieldIn(e,t){if(t===null||typeof t!=="object"&&typeof t!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e==="function"?t===e:e.has(t)}function __addDisposableResource(e,t,r){if(t!==null&&t!==void 0){if(typeof t!=="object"&&typeof t!=="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose];r&&(o=n)}if(typeof n!=="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}});e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:true});return t}var r=typeof SuppressedError==="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function __disposeResources(e){function fail(t){e.error=e.hasError?new r(t,e.error,"An error was suppressed during disposal."):t;e.hasError=true}var t,n=0;function next(){while(t=e.stack.pop())try{if(!t.async&&n===1)return n=0,e.stack.push(t),Promise.resolve().then(next);if(t.dispose){var r=t.dispose.call(t.value);if(t.async)return n|=2,Promise.resolve(r).then(next,(function(e){fail(e);return next()}))}else n|=1}catch(e){fail(e)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return next()}var n={__extends:__extends,__assign:__assign,__rest:__rest,__decorate:__decorate,__param:__param,__metadata:__metadata,__awaiter:__awaiter,__generator:__generator,__createBinding:e,__exportStar:__exportStar,__values:__values,__read:__read,__spread:__spread,__spreadArrays:__spreadArrays,__spreadArray:__spreadArray,__await:__await,__asyncGenerator:__asyncGenerator,__asyncDelegator:__asyncDelegator,__asyncValues:__asyncValues,__makeTemplateObject:__makeTemplateObject,__importStar:__importStar,__importDefault:__importDefault,__classPrivateFieldGet:__classPrivateFieldGet,__classPrivateFieldSet:__classPrivateFieldSet,__classPrivateFieldIn:__classPrivateFieldIn,__addDisposableResource:__addDisposableResource,__disposeResources:__disposeResources};export{__addDisposableResource,__assign,__asyncDelegator,__asyncGenerator,__asyncValues,__await,__awaiter,__classPrivateFieldGet,__classPrivateFieldIn,__classPrivateFieldSet,e as __createBinding,__decorate,__disposeResources,__esDecorate,__exportStar,__extends,__generator,__importDefault,__importStar,__makeTemplateObject,__metadata,__param,__propKey,__read,__rest,__runInitializers,__setFunctionName,__spread,__spreadArray,__spreadArrays,__values,n as default}; +