rails_omnibar 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/tests.yml +24 -0
  3. data/.gitignore +41 -0
  4. data/CHANGELOG.md +9 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +178 -0
  8. data/Rakefile +45 -0
  9. data/app/controllers/rails_omnibar/base_controller.rb +2 -0
  10. data/app/controllers/rails_omnibar/js_controller.rb +11 -0
  11. data/app/controllers/rails_omnibar/queries_controller.rb +7 -0
  12. data/bin/console +7 -0
  13. data/bin/setup +8 -0
  14. data/config/routes.rb +4 -0
  15. data/javascript/compiled.js +2 -0
  16. data/javascript/src/app.tsx +44 -0
  17. data/javascript/src/hooks/index.ts +5 -0
  18. data/javascript/src/hooks/use_hotkey.ts +18 -0
  19. data/javascript/src/hooks/use_item_action.tsx +20 -0
  20. data/javascript/src/hooks/use_modal.tsx +33 -0
  21. data/javascript/src/hooks/use_omnibar_extensions.ts +33 -0
  22. data/javascript/src/hooks/use_toggle_focus.ts +15 -0
  23. data/javascript/src/index.ts +1 -0
  24. data/javascript/src/types.ts +34 -0
  25. data/lib/rails_omnibar/command/base.rb +44 -0
  26. data/lib/rails_omnibar/command/search.rb +68 -0
  27. data/lib/rails_omnibar/commands.rb +28 -0
  28. data/lib/rails_omnibar/config.rb +35 -0
  29. data/lib/rails_omnibar/engine.rb +5 -0
  30. data/lib/rails_omnibar/item/base.rb +21 -0
  31. data/lib/rails_omnibar/item/help.rb +22 -0
  32. data/lib/rails_omnibar/items.rb +25 -0
  33. data/lib/rails_omnibar/rendering.rb +34 -0
  34. data/lib/rails_omnibar/version.rb +3 -0
  35. data/lib/rails_omnibar.rb +8 -0
  36. data/package.json +27 -0
  37. data/rails_omnibar.gemspec +31 -0
  38. data/spec/app_template.rb +17 -0
  39. data/spec/lib/rails_omnibar/config_spec.rb +53 -0
  40. data/spec/lib/rails_omnibar/version_spec.rb +7 -0
  41. data/spec/my_omnibar_template.rb +45 -0
  42. data/spec/rails_helper.rb +22 -0
  43. data/spec/support/factories.rb +8 -0
  44. data/spec/system/rails_omnibar_spec.rb +87 -0
  45. data/tsconfig.json +18 -0
  46. data/webpack.config.js +32 -0
  47. metadata +226 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d34fc49a0962e25e0c01aad9ddfee2ec4351cda88ebd923152f53bf3a2b8c5cd
4
+ data.tar.gz: b10a548832859cfa683ac89c95f422505e01e4c12682c0f39b8143d4cef0e903
5
+ SHA512:
6
+ metadata.gz: 9c7b45a37d84c0bd7ed91328b7e3b7f4bfb2d6d4ce79940bf1c01b1b34193962e0fdb3141a14b52d5b97b7e7fad8ce039482f2b13f80a594e3bcc78bfda720f3
7
+ data.tar.gz: 6fee2904692473c952fc4de509288025ac00d018cc5e166dcd49ddef9d1560e7bd0be2705c5755ab11d52b3e59465a43712b889e74eff924c4385c44d5de136b
@@ -0,0 +1,24 @@
1
+ name: tests
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ ruby: [ '2.7', '3.0', 'ruby-head' ]
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby ${{ matrix.ruby }}
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Install dependencies
20
+ run: |
21
+ bundle install --jobs 4 --retry 3
22
+ npm install
23
+ - name: Test with Rake
24
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,41 @@
1
+ *.a
2
+ *.bundle
3
+ *.gem
4
+ *.gemfile.lock
5
+ *.iml
6
+ *.o
7
+ *.so
8
+ *.stTheme.cache
9
+ *.sublime-project
10
+ *.sublime-workspace
11
+ *.swp
12
+ *.tmPreferences.cache
13
+ *.tmlanguage.cache
14
+ *~
15
+ .DS_Store
16
+ .byebug_history
17
+ .idea/
18
+ .rspec_status
19
+ .ruby-gemset
20
+ .ruby-version
21
+ .tags
22
+ .tags1
23
+ .tool-versions
24
+ .vscode
25
+ /.bundle/
26
+ /.yardoc
27
+ /_yardoc/
28
+ /coverage/
29
+ /doc/
30
+ /javascript/compiled*
31
+ /node_modules
32
+ /pkg/
33
+ /spec/reports/
34
+ /tmp/
35
+ Gemfile.lock
36
+ bbin/
37
+ binstubs/*
38
+ bundler_stubs/*/.yardoc
39
+ mkmf.log
40
+ package-lock.json
41
+ spec/dummy
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.0.0] - 2023-01-22
8
+
9
+ Initial release.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rails_omnibar.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Janosch Müller
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,178 @@
1
+ [![Gem Version](https://badge.fury.io/rb/rails_omnibar.svg)](http://badge.fury.io/rb/rails_omnibar)
2
+ [![Build Status](https://github.com/jaynetics/rails_omnibar/actions/workflows/tests.yml/badge.svg)](https://github.com/jaynetics/rails_omnibar/actions)
3
+
4
+ # RailsOmnibar
5
+
6
+ Add an Omnibar to Ruby on Rails.
7
+
8
+ ![Screenshot](https://user-images.githubusercontent.com/10758879/213940403-68400aab-6cc6-40ca-82fb-af049f07581b.gif)
9
+
10
+ ## Installation
11
+
12
+ Add `rails_omnibar` to your bundle and add the following line to your `config/routes.rb`:
13
+
14
+ ```ruby
15
+ mount RailsOmnibar::Engine => '/rails_omnibar'
16
+ ```
17
+
18
+ You can pick any path.
19
+
20
+ To limit access, do something like this:
21
+
22
+ ```ruby
23
+ authenticate :user, ->(user){ user.superadmin? } do
24
+ mount RailsOmnibar::Engine => '/rails_omnibar'
25
+ end
26
+ ```
27
+
28
+ ### Configuration
29
+
30
+ ```ruby
31
+ # app/lib/omnibar.rb
32
+
33
+ Omnibar = RailsOmnibar.configure do |c|
34
+ c.max_results = 5 # default is 10
35
+
36
+ # Render as a modal that is hidden by default and toggled with a hotkey.
37
+ # The default value for this setting is false - i.e. render inline.
38
+ c.modal = true # default is false
39
+
40
+ # Use a custom hotkey to focus the omnibar (or toggle it if it is a modal).
41
+ # CTRL+<hotkey> and CMD+<hotkey> will both work.
42
+ c.hotkey = 't' # default is 'k'
43
+
44
+ # Add static items that can be found by fuzzy typing.
45
+ c.add_item(title: 'Important link', url: 'https://www.disney.com')
46
+ c.add_item(title: 'Important info', modal_html: '<b>You rock</b>')
47
+
48
+ # Add all backoffice URLs as searchable items
49
+ Rails.application.routes.routes.each do |route|
50
+ next unless route.defaults[:action] == 'index'
51
+ next unless name = route.name[/^backoffice_(.+)/, 1]
52
+
53
+ c.add_item(title: name.humanize, url: route.format({}))
54
+ end
55
+
56
+ # Add commands
57
+
58
+ # This command will allow searching users by id by typing e.g. 'u123'.
59
+ # The capture group is used to extract the value for the DB query.
60
+ c.add_record_search(
61
+ pattern: /^u(\d+)/,
62
+ example: 'u123',
63
+ model: User,
64
+ )
65
+
66
+ # Search records by column(s) other than id (via LIKE query by default)
67
+ c.add_record_search(
68
+ pattern: /^u (.+)/,
69
+ example: 'u Joe',
70
+ model: User,
71
+ columns: %i[first_name last_name],
72
+ )
73
+
74
+ # The special #add_help method must be called last if you want a help entry.
75
+ # It shows a modal with descriptions and examples of the commands, e.g.:
76
+ #
77
+ # * Search User by id
78
+ # Example: `u123`
79
+ # * Search User by first_name OR last_name
80
+ # Example: `u Joe`
81
+ # * Search User by id
82
+ # Example: `U123`
83
+ # * Search Google
84
+ # Example: `g kittens`
85
+ # * Get count of a DB table
86
+ # Example: `COUNT users`
87
+ #
88
+ c.add_help
89
+ end
90
+ ```
91
+
92
+ Render it somewhere. E.g. `app/views/layouts/application.html.erb`:
93
+
94
+ ```erb
95
+ <%= Omnibar.render %>
96
+ ```
97
+
98
+ ### Using multiple different omnibars
99
+
100
+ ```ruby
101
+ UserOmnibar = Class.new(RailsOmnibar).configure { ... }
102
+ AdminOmnibar = Class.new(RailsOmnibar).configure { ... }
103
+
104
+ UserOmnibar.render
105
+ AdminOmnibar.render
106
+ ```
107
+
108
+ ### Other options and usage patterns
109
+
110
+ ```ruby
111
+ # Add multiple items
112
+ MyOmnibar.add_items(
113
+ *MyRecord.all.map { |rec| { title: rec.title, url: url_for(rec) } }
114
+ )
115
+
116
+ # Add ActiveAdmin index routes as searchable items
117
+ ActiveAdmin.application.namespaces.first.resources.each do |res|
118
+ index = res.route_collection_path rescue next
119
+ title = res.menu_item&.label.presence || next
120
+ MyOmnibar.add_item(title: title, url: index)
121
+ end
122
+
123
+ # Render in ActiveAdmin (`MyOmnibar.modal = true` recommended)
124
+ module AddOmnibar
125
+ def build_page(...)
126
+ within(super) { text_node(MyOmnibar.render) }
127
+ end
128
+ end
129
+ ActiveAdmin::Views::Pages::Base.prepend(AddOmnibar)
130
+
131
+ # Add all index routes as searchable items
132
+ Rails.application.routes.routes.each do |route|
133
+ next unless route.defaults.values_at(:action, :format) == ['index', nil]
134
+ MyOmnibar.add_item(title: route.name.humanize, url: route.format({}))
135
+ end
136
+
137
+ # Custom record lookup and rendering
138
+ MyOmnibar.add_record_search(
139
+ pattern: /^U(\d+)/,
140
+ example: 'U123',
141
+ model: User,
142
+ finder: ->(id) { User.find_by(admin: true, id: id) },
143
+ itemizer: ->(user) { { title: "Admin #{user.name}", url: admin_url(user) } }
144
+ )
145
+
146
+ # Custom search
147
+ MyOmnibar.add_search(
148
+ description: 'Google',
149
+ pattern: /^g (.+)/,
150
+ example: 'g kittens',
151
+ finder: ->(value) { GoogleSearch.fetch(value) },
152
+ itemizer: ->(entry) { { title: entry.title, url: entry.url } },
153
+ )
154
+
155
+ # Completely custom command
156
+ MyOmnibar.add_command(
157
+ description: 'Get count of a DB table',
158
+ pattern: /COUNT (.+)/i,
159
+ example: 'COUNT users',
160
+ resolver: ->(value, _omnibar) do
161
+ { title: value.classify.constantize.count.to_s }
162
+ rescue => e
163
+ { title: e.message }
164
+ end,
165
+ )
166
+ ```
167
+
168
+ ## Development
169
+
170
+ ### Setup
171
+
172
+ * Clone the repository
173
+ * Go into the directory
174
+ * Run `bin/setup` to install Ruby and JS dependencies
175
+
176
+ ## License
177
+
178
+ This program is provided under an MIT open source license, read the [LICENSE.txt](https://github.com/jaynetics/rails_omnibar/blob/master/LICENSE.txt) file for details.
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ require 'rake'
2
+ require 'bundler/gem_tasks'
3
+ require 'rubygems/package_task'
4
+ require 'rspec/core/rake_task'
5
+
6
+ Bundler::GemHelper.install_tasks
7
+
8
+ RSpec::Core::RakeTask.new
9
+ task default: [:compile_js, :generate_spec_app, :spec]
10
+
11
+ task :compile_js do
12
+ sh 'npm run compile'
13
+ end
14
+
15
+ task :generate_spec_app do
16
+ sh 'rm -rf spec/dummy'
17
+ sh *%w[
18
+ rails new spec/dummy
19
+ --template=spec/app_template.rb
20
+ --skip-action-cable
21
+ --skip-action-mailbox
22
+ --skip-action-mailer
23
+ --skip-action-text
24
+ --skip-active-job
25
+ --skip-active-storage
26
+ --skip-asset-pipeline
27
+ --skip-bootsnap
28
+ --skip-bundle
29
+ --skip-git
30
+ --skip-hotwire
31
+ --skip-javascript
32
+ --skip-jbuilder
33
+ --skip-keeps
34
+ --skip-listen
35
+ --skip-spring
36
+ --skip-sprockets
37
+ --skip-system-test
38
+ --skip-test
39
+ --skip-turbolinks
40
+ --skip-webpack
41
+ ]
42
+ end
43
+
44
+ # ensure fresh js is compiled when packaging the gem
45
+ task build: [:compile_js]
@@ -0,0 +1,2 @@
1
+ class RailsOmnibar::BaseController < ActionController::API
2
+ end
@@ -0,0 +1,11 @@
1
+ # This returns the pre-compiled JS for the frontend component.
2
+ # Yes, that is a hacky way to make the gem work without
3
+ # forcing users to install and integrate an npm package.
4
+ class RailsOmnibar::JsController < RailsOmnibar::BaseController
5
+ JS_FILE = File.join(__dir__, '..', '..', '..', 'javascript', 'compiled.js')
6
+
7
+ def show
8
+ expires_in 1.day, public: true
9
+ send_file JS_FILE, type: 'text/javascript', disposition: 'inline'
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ class RailsOmnibar::QueriesController < RailsOmnibar::BaseController
2
+ def show
3
+ omnibar = params['omnibar_class'].constantize
4
+ res = omnibar.handle(params[:q])
5
+ render json: omnibar.handle(params[:q])
6
+ end
7
+ end
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'rails_omnibar'
5
+
6
+ require 'irb'
7
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+ npm install
8
+ npm run compile
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ RailsOmnibar::Engine.routes.draw do
2
+ resource :js, only: :show, defaults: { format: :js }
3
+ resource :query, only: :show
4
+ end
@@ -0,0 +1,2 @@
1
+ /*! For license information please see compiled.js.LICENSE.txt */
2
+ (()=>{var e={875:(e,t,n)=>{var o;!function(){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen};void 0===(o=function(){return i}.call(t,n,t,e))||(e.exports=o)}()},360:function(e,t){var n,o;void 0===(o="function"==typeof(n=e=>{"use strict";var t=(e,t)=>{if(e===E)return E;var n=e.target,o=n.length,r=e._indexes;r=r.slice(0,r.len).sort(((e,t)=>e-t));for(var i="",l=0,a=0,s=!1,u=(e=[],0);u<o;++u){var c=n[u];if(r[a]===u){if(++a,s||(s=!0,e.push(i),i=""),a===r.length){i+=c,e.push(t(i,l++)),i="",e.push(n.substr(u+1));break}}else s&&(s=!1,e.push(t(i,l++)),i="");i+=c}return e},n=e=>{"string"!=typeof e&&(e="");var t=u(e);return{target:e,_targetLower:t._lower,_targetLowerCodes:t.lowerCodes,_nextBeginningIndexes:E,_bitflags:t.bitflags,score:E,_indexes:[0],obj:E}},o=e=>{"string"!=typeof e&&(e=""),e=e.trim();var t=u(e),n=[];if(t.containsSpace){var o=e.split(/\s+/);o=[...new Set(o)];for(var r=0;r<o.length;r++)if(""!==o[r]){var i=u(o[r]);n.push({lowerCodes:i.lowerCodes,_lower:o[r].toLowerCase(),containsSpace:!1})}}return{lowerCodes:t.lowerCodes,bitflags:t.bitflags,containsSpace:t.containsSpace,_lower:t._lower,spaceSearches:n}},r=e=>{if(e.length>999)return n(e);var t=f.get(e);return void 0!==t||(t=n(e),f.set(e,t)),t},i=e=>{if(e.length>999)return o(e);var t=d.get(e);return void 0!==t||(t=o(e),d.set(e,t)),t},l=(e,t,n)=>{var o=[];o.total=t.length;var i=n&&n.limit||m;if(n&&n.key)for(var l=0;l<t.length;l++){var a=t[l];if(f=v(a,n.key)){y(f)||(f=r(f)),f.score=b,f._indexes.len=0;var s=f;if(s={target:s.target,_targetLower:"",_targetLowerCodes:E,_nextBeginningIndexes:E,_bitflags:0,score:f.score,_indexes:E,obj:a},o.push(s),o.length>=i)return o}}else if(n&&n.keys)for(l=0;l<t.length;l++){a=t[l];for(var u=new Array(n.keys.length),c=n.keys.length-1;c>=0;--c)(f=v(a,n.keys[c]))?(y(f)||(f=r(f)),f.score=b,f._indexes.len=0,u[c]=f):u[c]=E;if(u.obj=a,u.score=b,o.push(u),o.length>=i)return o}else for(l=0;l<t.length;l++){var f;if((f=t[l])&&(y(f)||(f=r(f)),f.score=b,f._indexes.len=0,o.push(f),o.length>=i))return o}return o},a=(e,t,n=!1)=>{if(!1===n&&e.containsSpace)return s(e,t);for(var o=e._lower,r=e.lowerCodes,i=r[0],l=t._targetLowerCodes,a=r.length,u=l.length,f=0,d=0,h=0;;){if(i===l[d]){if(p[h++]=d,++f===a)break;i=r[f]}if(++d>=u)return E}f=0;var v=!1,y=0,m=t._nextBeginningIndexes;m===E&&(m=t._nextBeginningIndexes=c(t.target));var b=0;if((d=0===p[0]?0:m[p[0]-1])!==u)for(;;)if(d>=u){if(f<=0)break;if(++b>200)break;--f,d=m[_[--y]]}else if(r[f]===l[d]){if(_[y++]=d,++f===a){v=!0;break}++d}else d=m[d];var g=t._targetLower.indexOf(o,p[0]),w=~g;if(w&&!v)for(var O=0;O<h;++O)p[O]=g+O;var C=!1;if(w&&(C=t._nextBeginningIndexes[g-1]===g),v)var S=_,x=y;else S=p,x=h;var M=0,k=0;for(O=1;O<a;++O)S[O]-S[O-1]!=1&&(M-=S[O],++k);if(M-=(S[a-1]-S[0]-(a-1)+12)*k,0!==S[0]&&(M-=S[0]*S[0]*.2),v){var P=1;for(O=m[0];O<u;O=m[O])++P;P>24&&(M*=10*(P-24))}else M*=1e3;for(w&&(M/=1+a*a*1),C&&(M/=1+a*a*1),M-=u-a,t.score=M,O=0;O<x;++O)t._indexes[O]=S[O];return t._indexes.len=x,t},s=(e,t)=>{for(var n=new Set,o=0,r=E,i=0,l=e.spaceSearches,s=0;s<l.length;++s){var u=l[s];if((r=a(u,t))===E)return E;o+=r.score,r._indexes[0]<i&&(o-=i-r._indexes[0]),i=r._indexes[0];for(var c=0;c<r._indexes.len;++c)n.add(r._indexes[c])}var f=a(e,t,!0);if(f!==E&&f.score>o)return f;r.score=o,s=0;for(let e of n)r._indexes[s++]=e;return r._indexes.len=s,r},u=e=>{for(var t=e.length,n=e.toLowerCase(),o=[],r=0,i=!1,l=0;l<t;++l){var a=o[l]=n.charCodeAt(l);32!==a?r|=1<<(a>=97&&a<=122?a-97:a>=48&&a<=57?26:a<=127?30:31):i=!0}return{lowerCodes:o,bitflags:r,containsSpace:i,_lower:n}},c=e=>{for(var t=e.length,n=(e=>{for(var t=e.length,n=[],o=0,r=!1,i=!1,l=0;l<t;++l){var a=e.charCodeAt(l),s=a>=65&&a<=90,u=s||a>=97&&a<=122||a>=48&&a<=57,c=s&&!r||!i||!u;r=s,i=u,c&&(n[o++]=l)}return n})(e),o=[],r=n[0],i=0,l=0;l<t;++l)r>l?o[l]=r:(r=n[++i],o[l]=void 0===r?t:r);return o},f=new Map,d=new Map,p=[],_=[],h=e=>{for(var t=b,n=e.length,o=0;o<n;++o){var r=e[o];if(r!==E){var i=r.score;i>t&&(t=i)}}return t===b?E:t},v=(e,t)=>{var n=e[t];if(void 0!==n)return n;var o=t;Array.isArray(t)||(o=t.split("."));for(var r=o.length,i=-1;e&&++i<r;)e=e[o[i]];return e},y=e=>"object"==typeof e,m=1/0,b=-m,g=[];g.total=0;var w,O,C,S,E=null,x=(w=[],O=0,S=e=>{for(var t=0,n=w[t],o=1;o<O;){var r=o+1;t=o,r<O&&w[r].score<w[o].score&&(t=r),w[t-1>>1]=w[t],o=1+(t<<1)}for(var i=t-1>>1;t>0&&n.score<w[i].score;i=(t=i)-1>>1)w[t]=w[i];w[t]=n},(C={}).add=e=>{var t=O;w[O++]=e;for(var n=t-1>>1;t>0&&e.score<w[n].score;n=(t=n)-1>>1)w[t]=w[n];w[t]=e},C.poll=e=>{if(0!==O){var t=w[0];return w[0]=w[--O],S(),t}},C.peek=e=>{if(0!==O)return w[0]},C.replaceTop=e=>{w[0]=e,S()},C);return{single:(e,t)=>{if("farzher"==e)return{target:"farzher was here (^-^*)/",score:0,_indexes:[0]};if(!e||!t)return E;var n=i(e);y(t)||(t=r(t));var o=n.bitflags;return(o&t._bitflags)!==o?E:a(n,t)},go:(e,t,n)=>{if("farzher"==e)return[{target:"farzher was here (^-^*)/",score:0,_indexes:[0],obj:t?t[0]:E}];if(!e)return n&&n.all?l(e,t,n):g;var o=i(e),s=o.bitflags,u=(o.containsSpace,n&&n.threshold||b),c=n&&n.limit||m,f=0,d=0,p=t.length;if(n&&n.key)for(var _=n.key,w=0;w<p;++w){var O=t[w];(N=v(O,_))&&(y(N)||(N=r(N)),(s&N._bitflags)===s&&(T=a(o,N))!==E&&(T.score<u||(T={target:T.target,_targetLower:"",_targetLowerCodes:E,_nextBeginningIndexes:E,_bitflags:0,score:T.score,_indexes:T._indexes,obj:O},f<c?(x.add(T),++f):(++d,T.score>x.peek().score&&x.replaceTop(T)))))}else if(n&&n.keys){var C=n.scoreFn||h,S=n.keys,M=S.length;for(w=0;w<p;++w){O=t[w];for(var k=new Array(M),P=0;P<M;++P)_=S[P],(N=v(O,_))?(y(N)||(N=r(N)),(s&N._bitflags)!==s?k[P]=E:k[P]=a(o,N)):k[P]=E;k.obj=O;var R=C(k);R!==E&&(R<u||(k.score=R,f<c?(x.add(k),++f):(++d,R>x.peek().score&&x.replaceTop(k))))}}else for(w=0;w<p;++w){var N,T;(N=t[w])&&(y(N)||(N=r(N)),(s&N._bitflags)===s&&(T=a(o,N))!==E&&(T.score<u||(f<c?(x.add(T),++f):(++d,T.score>x.peek().score&&x.replaceTop(T)))))}if(0===f)return g;var A=new Array(f);for(w=f-1;w>=0;--w)A[w]=x.poll();return A.total=f+d,A},highlight:(e,n,o)=>{if("function"==typeof n)return t(e,n);if(e===E)return E;void 0===n&&(n="<b>"),void 0===o&&(o="</b>");var r="",i=0,l=!1,a=e.target,s=a.length,u=e._indexes;u=u.slice(0,u.len).sort(((e,t)=>e-t));for(var c=0;c<s;++c){var f=a[c];if(u[i]===c){if(l||(l=!0,r+=n),++i===u.length){r+=f+o+a.substr(c+1);break}}else l&&(l=!1,r+=o);r+=f}return r},prepare:n,indexes:e=>e._indexes.slice(0,e._indexes.len).sort(((e,t)=>e-t)),cleanup:()=>{f.clear(),d.clear(),p=[],_=[]}}})?n.apply(t,[]):n)||(e.exports=o)},736:(e,t,n)=>{"use strict";var o=n(655),r=n(661);const i="#ddd",l="#eee",a={borderColor:i,borderStyle:"solid",borderWidth:1,boxSizing:"border-box",fontSize:24,height:50,lineHeight:"24px",outline:0,paddingLeft:15,paddingRight:15,width:"100%"};class s extends r.PureComponent{render(){let e=this.props,{style:t}=e,n=o.__rest(e,["style"]);return r.createElement("input",Object.assign({type:"text",style:Object.assign({},a,t)},n))}}const u={borderBottomWidth:1,borderColor:i,borderLeftWidth:1,borderRightWidth:1,borderStyle:"solid",borderTopWidth:0,boxSizing:"border-box",color:"#000",display:"block",fontSize:24,height:50,lineHeight:"50px",paddingLeft:15,paddingRight:15,textDecoration:"none"};function c(e){const{item:t,isSelected:n,isHighlighted:a,style:s}=e,c=o.__rest(e,["item","isSelected","isHighlighted","style"]),f=Object.assign({},u,s);return n&&(f.backgroundColor=l),a&&(f.backgroundColor=i),r.createElement("a",Object.assign({href:t.url,style:f},c),t.title)}class f extends r.PureComponent{constructor(){super(...arguments),this.state={isHighlighted:!1},this.handleMouseEnter=e=>{this.setState({isHighlighted:!0}),this.props.onMouseEnter&&this.props.onMouseEnter(e)},this.handleMouseLeave=e=>{this.setState({isHighlighted:!1}),this.props.onMouseLeave&&this.props.onMouseLeave(e)}}render(){const e=this.props.item;return(this.props.children?this.props.children:c)({style:this.props.style,item:e,isSelected:this.props.isSelected,isHighlighted:this.state.isHighlighted,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.props.onClickItem})}}f.defaultProps={isSelected:!1};const d={position:"absolute",width:"100%",zIndex:2,listStyleType:"none",margin:0,padding:0,backgroundColor:"#fff"};function p(e){const t=Object.assign({},d,e.style);function n(e,t){return e.bind(this,t)}return e.maxHeight&&(t.maxHeight=e.maxHeight,t.borderBottomWidth=1,t.borderBottomColor=l,t.borderBottomStyle="solid",t.overflow="auto"),r.createElement("ul",{style:t,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave},e.items.map(((t,o)=>r.createElement(f,{key:o,children:e.children,item:t,isSelected:e.selectedIndex===o,onMouseEnter:e.onMouseEnterItem&&n(e.onMouseEnterItem,o),onMouseLeave:e.onMouseLeaveItem&&n(e.onMouseLeaveItem,o),onClickItem:e.onClickItem}))))}function _(e){e.url&&(window.location.href=e.url)}class h extends r.PureComponent{constructor(e){super(e),this.state={displayResults:!1,hoveredIndex:-1,results:[],selectedIndex:0},this.query=e=>{this.props.extensions.length>0&&function(e,t){const n=[];for(let o of t)"function"==typeof o&&n.push(o.call(null,e));return Promise.all(n).then((e=>e.reduce(((e,t)=>e.concat(t)),[])))}(e,this.props.extensions).then((e=>{this.setState({results:this.props.maxResults>0?e.slice(0,this.props.maxResults):e,displayResults:e.length>0,selectedIndex:Math.min(this.state.selectedIndex,e.length-1)}),this.props.onQuery&&this.props.onQuery(e)}))},this.prev=()=>{this.setState((e=>{const t=e.selectedIndex-1;if(t>=0)return{selectedIndex:t}}))},this.next=()=>{this.setState((e=>{const t=e.selectedIndex+1;if(t<e.results.length)return{selectedIndex:t}}))},this.action=(e=!1)=>{const t=e&&this.state.hoveredIndex>-1?this.state.hoveredIndex:this.state.selectedIndex,n=this.state.results[t];(this.props.onAction||_).call(null,n)},this.handleChange=e=>{const t=e.target.value;t||this.props.showEmpty?this.query(t):this.reset()},this.handleKeyDown=e=>{switch(e.keyCode){case 38:this.prev(),e.preventDefault();break;case 40:this.next(),e.preventDefault();break;case 13:this.action()}},this.handleMouseEnterItem=e=>{this.setState({hoveredIndex:e})},this.handleMouseLeave=()=>{this.setState({hoveredIndex:-1})},this.handleBlur=e=>{this.props.onBlur&&this.props.onBlur(e),setTimeout((()=>this.setState({displayResults:!1})),200)},this.handleFocus=e=>{0===this.state.results.length&&this.props.showEmpty&&this.query(""),this.props.onFocus&&this.props.onFocus(e),this.setState({displayResults:!0})},this.handleClickItem=e=>{e.preventDefault(),this.state.hoveredIndex>-1&&this.action(!0)},this.query=function(e,t){let n=null;return(...o)=>{const r=this;clearTimeout(n),n=setTimeout((()=>{n=null,e.apply(r,o)}),t)}}(this.query,this.props.inputDelay)}reset(){this.setState({results:[],displayResults:!1})}render(){let e=this.props,{children:t,render:n,maxResults:i,maxViewableResults:l,extensions:a,inputDelay:u,rootStyle:c,resultStyle:f,onQuery:d,onAction:_,onFocus:h,onBlur:v,showEmpty:y}=e,m=o.__rest(e,["children","render","maxResults","maxViewableResults","extensions","inputDelay","rootStyle","resultStyle","onQuery","onAction","onFocus","onBlur","showEmpty"]),b=l?50*l:null;return n||(n=t),r.createElement("div",{style:c},r.createElement(s,Object.assign({},m,{onBlur:this.handleBlur,onChange:this.handleChange,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown})),this.state.displayResults&&r.createElement(p,{children:n,items:this.state.results,maxHeight:b,onClickItem:this.handleClickItem,onMouseEnterItem:this.handleMouseEnterItem,onMouseLeave:this.handleMouseLeave,selectedIndex:this.state.selectedIndex,style:f}))}}h.defaultProps={children:null,extensions:[],inputDelay:100,maxResults:null,maxViewableResults:null,render:null,resultStyle:{},rootStyle:{position:"relative"},showEmpty:!1},t.ZP=h},661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>_,Component:()=>o.wA,Fragment:()=>o.HY,PureComponent:()=>s,StrictMode:()=>Q,Suspense:()=>b,SuspenseList:()=>O,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>Y,cloneElement:()=>V,createContext:()=>o.kr,createElement:()=>o.az,createFactory:()=>B,createPortal:()=>x,createRef:()=>o.Vf,default:()=>ne,findDOMNode:()=>$,flushSync:()=>J,forwardRef:()=>d,hydrate:()=>T,isValidElement:()=>q,lazy:()=>w,memo:()=>u,render:()=>N,startTransition:()=>G,unmountComponentAtNode:()=>z,unstable_batchedUpdates:()=>K,useCallback:()=>r.I4,useContext:()=>r.qp,useDebugValue:()=>r.Qb,useDeferredValue:()=>Z,useEffect:()=>r.d4,useErrorBoundary:()=>r.cO,useId:()=>r.Me,useImperativeHandle:()=>r.aP,useInsertionEffect:()=>ee,useLayoutEffect:()=>r.bt,useMemo:()=>r.Ye,useReducer:()=>r._Y,useRef:()=>r.sO,useState:()=>r.eJ,useSyncExternalStore:()=>te,useTransition:()=>X,version:()=>W});var o=n(400),r=n(396);function i(e,t){for(var n in t)e[n]=t[n];return e}function l(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function a(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function s(e){this.props=e}function u(e,t){function n(e){var n=this.props.ref,o=n==e.ref;return!o&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!o:l(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,o.az)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(s.prototype=new o.wA).isPureReactComponent=!0,s.prototype.shouldComponentUpdate=function(e,t){return l(this.props,e)||l(this.state,t)};var c=o.YM.__b;o.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),c&&c(e)};var f="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function d(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=f,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:(0,o.bR)((0,o.bR)(e).map(t))},_={map:p,forEach:p,count:function(e){return e?(0,o.bR)(e).length:0},only:function(e){var t=(0,o.bR)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:o.bR},h=o.YM.__e;o.YM.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);h(e,t,n,o)};var v=o.YM.unmount;function y(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)}))),e}function m(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return m(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function b(){this.__u=0,this.t=null,this.__b=null}function g(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function w(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,o.az)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function O(){this.u=null,this.o=null}o.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),v&&v(e)},(b.prototype=new o.wA).__c=function(e,t){var n=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var r=g(o.__v),i=!1,l=function(){i||(i=!0,n.__R=null,r?r(a):a())};n.__R=l;var a=function(){if(!--o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=m(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.t.pop();)t.forceUpdate()}},s=!0===t.__h;o.__u++||s||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},b.prototype.componentWillUnmount=function(){this.t=[]},b.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=y(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&(0,o.az)(o.HY,null,e.fallback);return i&&(i.__h=null),[(0,o.az)(o.HY,null,t.__a?null:e.children),i]};var C=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function S(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,o.sY)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,o.sY)((0,o.az)(S,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function x(e,t){var n=(0,o.az)(E,{__v:e,i:t});return n.containerInfo=t,n}(O.prototype=new o.wA).__a=function(e){var t=this,n=g(t.__v),o=t.o.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),C(t,e,o)):r()};n?n(i):i()}},O.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,o.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},O.prototype.componentDidUpdate=O.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){C(e,n,t)}))};var M="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,k=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,P="undefined"!=typeof document,R=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function N(e,t,n){return null==t.__k&&(t.textContent=""),(0,o.sY)(e,t),"function"==typeof n&&n(),e?e.__c:null}function T(e,t,n){return(0,o.ZB)(e,t),"function"==typeof n&&n(),e?e.__c:null}o.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(o.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var A=o.YM.event;function j(){}function L(){return this.cancelBubble}function D(){return this.defaultPrevented}o.YM.event=function(e){return A&&(e=A(e)),e.persist=j,e.isPropagationStopped=L,e.isDefaultPrevented=D,e.nativeEvent=e};var I,H={configurable:!0,get:function(){return this.class}},U=o.YM.vnode;o.YM.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var l in r={},n){var a=n[l];P&&"children"===l&&"noscript"===t||"value"===l&&"defaultValue"in n&&null==a||("defaultValue"===l&&"value"in n&&null==n.value?l="value":"download"===l&&!0===a?a="":/ondoubleclick/i.test(l)?l="ondblclick":/^onchange(textarea|input)/i.test(l+t)&&!R(n.type)?l="oninput":/^onfocus$/i.test(l)?l="onfocusin":/^onblur$/i.test(l)?l="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(l)?l=l.toLowerCase():i&&k.test(l)?l=l.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(l)&&(l=l.toLowerCase(),r[l]&&(l="oninputCapture")),r[l]=a)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,o.bR)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,o.bR)(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(H.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",H))}e.$$typeof=M,U&&U(e)};var F=o.YM.__r;o.YM.__r=function(e){F&&F(e),I=e.__c};var Y={ReactCurrentDispatcher:{current:{readContext:function(e){return I.__n[e.__c].props.value}}}},W="17.0.2";function B(e){return o.az.bind(null,e)}function q(e){return!!e&&e.$$typeof===M}function V(e){return q(e)?o.Tm.apply(null,arguments):e}function z(e){return!!e.__k&&((0,o.sY)(null,e),!0)}function $(e){return e&&(e.base||1===e.nodeType&&e)||null}var K=function(e,t){return e(t)},J=function(e,t){return e(t)},Q=o.HY;function G(e){e()}function Z(e){return e}function X(){return[!1,G]}var ee=r.bt;function te(e,t){var n=t(),o=(0,r.eJ)({h:{__:n,v:t}}),i=o[0].h,l=o[1];return(0,r.bt)((function(){i.__=n,i.v=t,a(i.__,t())||l({h:i})}),[e,n,t]),(0,r.d4)((function(){return a(i.__,i.v())||l({h:i}),e((function(){a(i.__,i.v())||l({h:i})}))}),[e]),n}var ne={useState:r.eJ,useId:r.Me,useReducer:r._Y,useEffect:r.d4,useLayoutEffect:r.bt,useInsertionEffect:ee,useTransition:X,useDeferredValue:Z,useSyncExternalStore:te,startTransition:G,useRef:r.sO,useImperativeHandle:r.aP,useMemo:r.Ye,useCallback:r.I4,useContext:r.qp,useDebugValue:r.Qb,version:"17.0.2",Children:_,render:N,hydrate:T,unmountComponentAtNode:z,createPortal:x,createElement:o.az,createContext:o.kr,createFactory:B,cloneElement:V,createRef:o.Vf,Fragment:o.HY,isValidElement:q,findDOMNode:$,Component:o.wA,PureComponent:s,memo:u,forwardRef:d,flushSync:J,unstable_batchedUpdates:K,StrictMode:Q,Suspense:b,SuspenseList:O,lazy:w,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Y}},400:(e,t,n)=>{"use strict";n.d(t,{HY:()=>y,Tm:()=>U,Vf:()=>v,YM:()=>r,ZB:()=>H,az:()=>_,bR:()=>E,h:()=>_,kr:()=>F,sY:()=>I,wA:()=>m});var o,r,i,l,a,s,u={},c=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function _(e,t,n){var r,i,l,a={};for(l in t)"key"==l?r=t[l]:"ref"==l?i=t[l]:a[l]=t[l];if(arguments.length>2&&(a.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(l in e.defaultProps)void 0===a[l]&&(a[l]=e.defaultProps[l]);return h(e,a,r,i,null)}function h(e,t,n,o,l){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==l?++i:l};return null==l&&null!=r.vnode&&r.vnode(a),a}function v(){return{current:null}}function y(e){return e.children}function m(e,t){this.props=e,this.context=t}function b(e,t){if(null==t)return e.__?b(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?b(e):null}function g(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return g(e)}}function w(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!O.__r++||a!==r.debounceRendering)&&((a=r.debounceRendering)||setTimeout)(O)}function O(){for(var e;O.__r=l.length;)e=l.sort((function(e,t){return e.__v.__b-t.__v.__b})),l=[],e.some((function(e){var t,n,o,r,i,l;e.__d&&(i=(r=(t=e).__v).__e,(l=t.__P)&&(n=[],(o=d({},r)).__v=r.__v+1,N(l,r,o,t.__n,void 0!==l.ownerSVGElement,null!=r.__h?[i]:null,n,null==i?b(r):i,r.__h),T(n,r),r.__e!=i&&g(r)))}))}function C(e,t,n,o,r,i,l,a,s,f){var d,p,_,v,m,g,w,O=o&&o.__k||c,C=O.length;for(n.__k=[],d=0;d<t.length;d++)if(null!=(v=n.__k[d]=null==(v=t[d])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?h(null,v,null,null,v):Array.isArray(v)?h(y,{children:v},null,null,null):v.__b>0?h(v.type,v.props,v.key,v.ref?v.ref:null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(_=O[d])||_&&v.key==_.key&&v.type===_.type)O[d]=void 0;else for(p=0;p<C;p++){if((_=O[p])&&v.key==_.key&&v.type===_.type){O[p]=void 0;break}_=null}N(e,v,_=_||u,r,i,l,a,s,f),m=v.__e,(p=v.ref)&&_.ref!=p&&(w||(w=[]),_.ref&&w.push(_.ref,null,v),w.push(p,v.__c||m,v)),null!=m?(null==g&&(g=m),"function"==typeof v.type&&v.__k===_.__k?v.__d=s=S(v,s,e):s=x(e,v,_,O,m,s),"function"==typeof n.type&&(n.__d=s)):s&&_.__e==s&&s.parentNode!=e&&(s=b(_))}for(n.__e=g,d=C;d--;)null!=O[d]&&L(O[d],O[d]);if(w)for(d=0;d<w.length;d++)j(w[d],w[++d],w[++d])}function S(e,t,n){for(var o,r=e.__k,i=0;r&&i<r.length;i++)(o=r[i])&&(o.__=e,t="function"==typeof o.type?S(o,t,n):x(n,o,o,r,o.__e,t));return t}function E(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){E(e,t)})):t.push(e)),t}function x(e,t,n,o,r,i){var l,a,s;if(void 0!==t.__d)l=t.__d,t.__d=void 0;else if(null==n||r!=i||null==r.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(r),l=null;else{for(a=i,s=0;(a=a.nextSibling)&&s<o.length;s+=1)if(a==r)break e;e.insertBefore(r,i),l=i}return void 0!==l?l:r.nextSibling}function M(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||f.test(t)?n:n+"px"}function k(e,t,n,o,r){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||M(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||M(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o||e.addEventListener(t,i?R:P,i):e.removeEventListener(t,i?R:P,i);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function P(e){this.l[e.type+!1](r.event?r.event(e):e)}function R(e){this.l[e.type+!0](r.event?r.event(e):e)}function N(e,t,n,o,i,l,a,s,u){var c,f,p,_,h,v,b,g,w,O,S,E,x,M,k,P=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,s=t.__e=n.__e,t.__h=null,l=[s]),(c=r.__b)&&c(t);try{e:if("function"==typeof P){if(g=t.props,w=(c=P.contextType)&&o[c.__c],O=c?w?w.props.value:c.__:o,n.__c?b=(f=t.__c=n.__c).__=f.__E:("prototype"in P&&P.prototype.render?t.__c=f=new P(g,O):(t.__c=f=new m(g,O),f.constructor=P,f.render=D),w&&w.sub(f),f.props=g,f.state||(f.state={}),f.context=O,f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=P.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=d({},f.__s)),d(f.__s,P.getDerivedStateFromProps(g,f.__s))),_=f.props,h=f.state,p)null==P.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==P.getDerivedStateFromProps&&g!==_&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(g,O),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(g,f.__s,O)||t.__v===n.__v){for(f.props=g,f.state=f.__s,t.__v!==n.__v&&(f.__d=!1),f.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&a.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(g,f.__s,O),null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(_,h,v)}))}if(f.context=O,f.props=g,f.__v=t,f.__P=e,E=r.__r,x=0,"prototype"in P&&P.prototype.render){for(f.state=f.__s,f.__d=!1,E&&E(t),c=f.render(f.props,f.state,f.context),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[]}else do{f.__d=!1,E&&E(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++x<25);f.state=f.__s,null!=f.getChildContext&&(o=d(d({},o),f.getChildContext())),p||null==f.getSnapshotBeforeUpdate||(v=f.getSnapshotBeforeUpdate(_,h)),k=null!=c&&c.type===y&&null==c.key?c.props.children:c,C(e,Array.isArray(k)?k:[k],t,n,o,i,l,a,s,u),f.base=t.__e,t.__h=null,f.__h.length&&a.push(f),b&&(f.__E=f.__=null),f.__e=!1}else null==l&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=A(n.__e,t,n,o,i,l,a,u);(c=r.diffed)&&c(t)}catch(e){t.__v=null,(u||null!=l)&&(t.__e=s,t.__h=!!u,l[l.indexOf(s)]=null),r.__e(e,t,n)}}function T(e,t){r.__c&&r.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){r.__e(e,t.__v)}}))}function A(e,t,n,r,i,l,a,s){var c,f,d,_=n.props,h=t.props,v=t.type,y=0;if("svg"===v&&(i=!0),null!=l)for(;y<l.length;y++)if((c=l[y])&&"setAttribute"in c==!!v&&(v?c.localName===v:3===c.nodeType)){e=c,l[y]=null;break}if(null==e){if(null===v)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,h.is&&h),l=null,s=!1}if(null===v)_===h||s&&e.data===h||(e.data=h);else{if(l=l&&o.call(e.childNodes),f=(_=n.props||u).dangerouslySetInnerHTML,d=h.dangerouslySetInnerHTML,!s){if(null!=l)for(_={},y=0;y<e.attributes.length;y++)_[e.attributes[y].name]=e.attributes[y].value;(d||f)&&(d&&(f&&d.__html==f.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,n,o,r){var i;for(i in n)"children"===i||"key"===i||i in t||k(e,i,null,n[i],o);for(i in t)r&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||k(e,i,t[i],n[i],o)}(e,h,_,i,s),d)t.__k=[];else if(y=t.props.children,C(e,Array.isArray(y)?y:[y],t,n,r,i&&"foreignObject"!==v,l,a,l?l[0]:n.__k&&b(n,0),s),null!=l)for(y=l.length;y--;)null!=l[y]&&p(l[y]);s||("value"in h&&void 0!==(y=h.value)&&(y!==e.value||"progress"===v&&!y||"option"===v&&y!==_.value)&&k(e,"value",y,_.value,!1),"checked"in h&&void 0!==(y=h.checked)&&y!==e.checked&&k(e,"checked",y,_.checked,!1))}return e}function j(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function L(e,t,n){var o,i;if(r.unmount&&r.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||j(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&L(o[i],t,n||"function"!=typeof e.type);n||null==e.__e||p(e.__e),e.__=e.__e=e.__d=void 0}function D(e,t,n){return this.constructor(e,n)}function I(e,t,n){var i,l,a;r.__&&r.__(e,t),l=(i="function"==typeof n)?null:n&&n.__k||t.__k,a=[],N(t,e=(!i&&n||t).__k=_(y,null,[e]),l||u,u,void 0!==t.ownerSVGElement,!i&&n?[n]:l?null:t.firstChild?o.call(t.childNodes):null,a,!i&&n?n:l?l.__e:t.firstChild,i),T(a,e)}function H(e,t){I(e,t,H)}function U(e,t,n){var r,i,l,a=d({},e.props);for(l in t)"key"==l?r=t[l]:"ref"==l?i=t[l]:a[l]=t[l];return arguments.length>2&&(a.children=arguments.length>3?o.call(arguments,2):n),h(e.type,a,r||e.key,i||e.ref,null)}function F(e,t){var n={__c:t="__cC"+s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(w)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}o=c.slice,r={__e:function(e,t,n,o){for(var r,i,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(t){e=t}throw e}},i=0,m.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),w(this))},m.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),w(this))},m.prototype.render=y,l=[],O.__r=0,s=0},396:(e,t,n)=>{"use strict";n.d(t,{I4:()=>S,Me:()=>k,Qb:()=>x,Ye:()=>C,_Y:()=>m,aP:()=>O,bt:()=>g,cO:()=>M,d4:()=>b,eJ:()=>y,qp:()=>E,sO:()=>w});var o,r,i,l,a=n(400),s=0,u=[],c=[],f=a.YM.__b,d=a.YM.__r,p=a.YM.diffed,_=a.YM.__c,h=a.YM.unmount;function v(e,t){a.YM.__h&&a.YM.__h(r,e,s||t),s=0;var n=r.__H||(r.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:c}),n.__[e]}function y(e){return s=1,m(L,e)}function m(e,t,n){var i=v(o++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):L(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=r,!r.u)){r.u=!0;var l=r.shouldComponentUpdate;r.shouldComponentUpdate=function(e,t,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!l||l.call(this,e,t,n);var r=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(r=!0)}})),!(!r&&i.__c.props===e)&&(!l||l.call(this,e,t,n))}}return i.__N||i.__}function b(e,t){var n=v(o++,3);!a.YM.__s&&j(n.__H,t)&&(n.__=e,n.i=t,r.__H.__h.push(n))}function g(e,t){var n=v(o++,4);!a.YM.__s&&j(n.__H,t)&&(n.__=e,n.i=t,r.__h.push(n))}function w(e){return s=5,C((function(){return{current:e}}),[])}function O(e,t,n){s=6,g((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function C(e,t){var n=v(o++,7);return j(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function S(e,t){return s=8,C((function(){return e}),t)}function E(e){var t=r.context[e.__c],n=v(o++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(r)),t.props.value):e.__}function x(e,t){a.YM.useDebugValue&&a.YM.useDebugValue(t?t(e):e)}function M(e){var t=v(o++,10),n=y();return t.__=e,r.componentDidCatch||(r.componentDidCatch=function(e,o){t.__&&t.__(e,o),n[1](e)}),[n[0],function(){n[1](void 0)}]}function k(){var e=v(o++,11);if(!e.__){for(var t=r.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function P(){for(var e;e=u.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(T),e.__H.__h.forEach(A),e.__H.__h=[]}catch(t){e.__H.__h=[],a.YM.__e(t,e.__v)}}a.YM.__b=function(e){r=null,f&&f(e)},a.YM.__r=function(e){d&&d(e),o=0;var t=(r=e.__c).__H;t&&(i===r?(t.__h=[],r.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=c,e.__N=e.i=void 0}))):(t.__h.forEach(T),t.__h.forEach(A),t.__h=[])),i=r},a.YM.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&l===a.YM.requestAnimationFrame||((l=a.YM.requestAnimationFrame)||N)(P)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==c&&(e.__=e.__V),e.i=void 0,e.__V=c}))),i=r=null},a.YM.__c=function(e,t){t.some((function(e){try{e.__h.forEach(T),e.__h=e.__h.filter((function(e){return!e.__||A(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.YM.__e(n,e.__v)}})),_&&_(e,t)},a.YM.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{T(e)}catch(e){t=e}})),n.__H=void 0,t&&a.YM.__e(t,n.__v))};var R="function"==typeof requestAnimationFrame;function N(e){var t,n=function(){clearTimeout(o),R&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);R&&(t=requestAnimationFrame(n))}function T(e){var t=r,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),r=t}function A(e){var t=r;e.__c=e.__(),r=t}function j(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function L(e,t){return"function"==typeof t?t(e):t}},703:(e,t,n)=>{"use strict";var o=n(414);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,l){if(l!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},871:(e,t,n)=>{"use strict";function o(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function r(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function l(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,l=null,a=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?l="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(l="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?a="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(a="UNSAFE_componentWillUpdate"),null!==n||null!==l||null!==a){var s=e.displayName||e.name,u="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==l?"\n "+l:"")+(null!==a?"\n "+a:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=o,t.componentWillReceiveProps=r),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,o)}}return e}n.r(t),n.d(t,{polyfill:()=>l}),o.__suppressDeprecationWarning=!0,r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(661),l=_(i),a=_(n(661)),s=_(n(697)),u=_(n(747)),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(149)),f=n(112),d=_(f),p=n(871);function _(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var y=t.portalClassName="ReactModalPortal",m=t.bodyOpenClassName="ReactModal__Body--open",b=f.canUseDOM&&void 0!==a.default.createPortal,g=function(e){return document.createElement(e)},w=function(){return b?a.default.createPortal:a.default.unstable_renderSubtreeIntoContainer};function O(e){return e()}var C=function(e){function t(){var e,n,r;h(this,t);for(var i=arguments.length,s=Array(i),c=0;c<i;c++)s[c]=arguments[c];return n=r=v(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.removePortal=function(){!b&&a.default.unmountComponentAtNode(r.node);var e=O(r.props.parentSelector);e&&e.contains(r.node)?e.removeChild(r.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},r.portalRef=function(e){r.portal=e},r.renderPortal=function(e){var n=w()(r,l.default.createElement(u.default,o({defaultStyles:t.defaultStyles},e)),r.node);r.portalRef(n)},v(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){f.canUseDOM&&(b||(this.node=g("div")),this.node.className=this.props.portalClassName,O(this.props.parentSelector).appendChild(this.node),!b&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:O(e.parentSelector),nextParent:O(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(f.canUseDOM){var o=this.props,r=o.isOpen,i=o.portalClassName;e.portalClassName!==i&&(this.node.className=i);var l=n.prevParent,a=n.nextParent;a!==l&&(l.removeChild(this.node),a.appendChild(this.node)),(e.isOpen||r)&&!b&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(f.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return f.canUseDOM&&b?(!this.node&&b&&(this.node=g("div")),w()(l.default.createElement(u.default,o({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){c.setElement(e)}}]),t}(i.Component);C.propTypes={isOpen:s.default.bool.isRequired,style:s.default.shape({content:s.default.object,overlay:s.default.object}),portalClassName:s.default.string,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,className:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),overlayClassName:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),appElement:s.default.oneOfType([s.default.instanceOf(d.default),s.default.instanceOf(f.SafeHTMLCollection),s.default.instanceOf(f.SafeNodeList),s.default.arrayOf(s.default.instanceOf(d.default))]),onAfterOpen:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,ariaHideApp:s.default.bool,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,parentSelector:s.default.func,aria:s.default.object,data:s.default.object,role:s.default.string,contentLabel:s.default.string,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func},C.defaultProps={isOpen:!1,portalClassName:y,bodyOpenClassName:m,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return l.default.createElement("div",e,t)},contentElement:function(e,t){return l.default.createElement("div",e,t)}},C.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,p.polyfill)(C),t.default=C},747:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(661),a=v(n(697)),s=h(n(685)),u=v(n(338)),c=h(n(149)),f=h(n(409)),d=n(112),p=v(d),_=v(n(623));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function v(e){return e&&e.__esModule?e:{default:e}}n(63);var y={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},m=0,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,o=e.ariaHideApp,r=e.htmlOpenClassName,i=e.bodyOpenClassName,l=e.parentSelector,a=l&&l().ownerDocument||document;i&&f.remove(a.body,i),r&&f.remove(a.getElementsByTagName("html")[0],r),o&&m>0&&0==(m-=1)&&c.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(s.returnFocus(n.props.preventScroll),s.teardownScopedFocus()):s.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),_.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(s.setupScopedFocus(n.node),s.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,u.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var o="object"===(void 0===t?"undefined":r(t))?t:{base:y[e],afterOpen:y[e]+"--after-open",beforeClose:y[e]+"--before-close"},i=o.base;return n.state.afterOpen&&(i=i+" "+o.afterOpen),n.state.beforeClose&&(i=i+" "+o.beforeClose),"string"==typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,o){return n[e+"-"+o]=t[o],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,o=e.htmlOpenClassName,r=e.bodyOpenClassName,i=e.parentSelector,l=i&&i().ownerDocument||document;r&&f.add(l.body,r),o&&f.add(l.getElementsByTagName("html")[0],o),n&&(m+=1,c.hide(t)),_.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,r=e.overlayClassName,i=e.defaultStyles,l=e.children,a=n?{}:i.content,s=r?{}:i.overlay;if(this.shouldBeClosed())return null;var u={ref:this.setOverlayRef,className:this.buildClassName("overlay",r),style:o({},s,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},c=o({id:t,ref:this.setContentRef,style:o({},a,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",o({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),f=this.props.contentElement(c,l);return this.props.overlayElement(u,f)}}]),t}(l.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:a.default.bool.isRequired,defaultStyles:a.default.shape({content:a.default.object,overlay:a.default.object}),style:a.default.shape({content:a.default.object,overlay:a.default.object}),className:a.default.oneOfType([a.default.string,a.default.object]),overlayClassName:a.default.oneOfType([a.default.string,a.default.object]),parentSelector:a.default.func,bodyOpenClassName:a.default.string,htmlOpenClassName:a.default.string,ariaHideApp:a.default.bool,appElement:a.default.oneOfType([a.default.instanceOf(p.default),a.default.instanceOf(d.SafeHTMLCollection),a.default.instanceOf(d.SafeNodeList),a.default.arrayOf(a.default.instanceOf(p.default))]),onAfterOpen:a.default.func,onAfterClose:a.default.func,onRequestClose:a.default.func,closeTimeoutMS:a.default.number,shouldFocusAfterRender:a.default.bool,shouldCloseOnOverlayClick:a.default.bool,shouldReturnFocusAfterClose:a.default.bool,preventScroll:a.default.bool,role:a.default.string,contentLabel:a.default.string,aria:a.default.object,data:a.default.object,children:a.default.node,shouldCloseOnEsc:a.default.bool,overlayRef:a.default.func,contentRef:a.default.func,id:a.default.string,overlayElement:a.default.func,contentElement:a.default.func,testId:a.default.string},t.default=b,e.exports=t.default},149:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){l&&(l.removeAttribute?l.removeAttribute("aria-hidden"):null!=l.length?l.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(l).forEach((function(e){return e.removeAttribute("aria-hidden")}))),l=null},t.log=function(){},t.assertNodeList=a,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);a(n,t),t=n}return l=t||l},t.validateElement=s,t.hide=function(e){var t=!0,n=!1,o=void 0;try{for(var r,i=s(e)[Symbol.iterator]();!(t=(r=i.next()).done);t=!0)r.value.setAttribute("aria-hidden","true")}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}},t.show=function(e){var t=!0,n=!1,o=void 0;try{for(var r,i=s(e)[Symbol.iterator]();!(t=(r=i.next()).done);t=!0)r.value.removeAttribute("aria-hidden")}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}},t.documentNotReadyOrSSRTesting=function(){l=null};var o,r=(o=n(473))&&o.__esModule?o:{default:o},i=n(112),l=null;function a(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function s(e){var t=e||l;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},63:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[i,l],t=0;t<e.length;t++){var n=e[t];n&&n.parentNode&&n.parentNode.removeChild(n)}i=l=null,a=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(a.length);for(var e=[i,l],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var o,r=(o=n(623))&&o.__esModule?o:{default:o},i=void 0,l=void 0,a=[];function s(){0!==a.length&&a[a.length-1].focusContent()}r.default.subscribe((function(e,t){i||l||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",s),(l=i.cloneNode()).addEventListener("focus",s)),(a=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==l&&document.body.appendChild(l)):(i.parentElement&&i.parentElement.removeChild(i),l.parentElement&&l.parentElement.removeChild(l))}))},409:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)r(e,n[t]);var i=document.body;for(var l in o)r(i,o[l]);n={},o={}},t.log=function(){};var n={},o={};function r(e,t){e.classList.remove(t)}t.add=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:o,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),r.add(e)}));var r,i},t.remove=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:o,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&r.remove(e)}));var r,i}},685:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){i=[]},t.log=function(){},t.handleBlur=s,t.handleFocus=u,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){l=e,window.addEventListener?(window.addEventListener("blur",s,!1),document.addEventListener("focus",u,!0)):(window.attachEvent("onBlur",s),document.attachEvent("onFocus",u))},t.teardownScopedFocus=function(){l=null,window.addEventListener?(window.removeEventListener("blur",s),document.removeEventListener("focus",u)):(window.detachEvent("onBlur",s),document.detachEvent("onFocus",u))};var o,r=(o=n(845))&&o.__esModule?o:{default:o},i=[],l=null,a=!1;function s(){a=!0}function u(){if(a){if(a=!1,!l)return;setTimeout((function(){l.contains(document.activeElement)||((0,r.default)(l)[0]||l).focus()}),0)}}},623:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(o.openInstances.length),o.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){o=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},o=new n;t.default=o},112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var o,r=((o=n(875))&&o.__esModule?o:{default:o}).default,i=r.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=r.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=r.canUseDOM?window.NodeList:{},t.canUseDOM=r.canUseDOM,t.default=i},338:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,r.default)(e);if(n.length){var o=void 0,l=t.shiftKey,a=n[0],s=n[n.length-1],u=i();if(e===u){if(!l)return;o=s}if(s!==u||l||(o=a),a===u&&l&&(o=s),o)return t.preventDefault(),void o.focus();var c=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null!=c&&"Chrome"!=c[1]&&null==/\biPod\b|\biPad\b/g.exec(navigator.userAgent)){var f=n.indexOf(u);if(f>-1&&(f+=l?-1:1),void 0===(o=n[f]))return t.preventDefault(),void(o=l?s:a).focus();t.preventDefault(),o.focus()}}else t.preventDefault()};var o,r=(o=n(845))&&o.__esModule?o:{default:o};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?i(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]).filter(r)};var n=/input|select|textarea|button|object|iframe/;function o(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var n=window.getComputedStyle(e),o=n.getPropertyValue("display");return t?"contents"!==o&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,n):"none"===o}catch(e){return console.warn("Failed to inspect element style"),!1}}function r(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var r=isNaN(t);return(r||t>=0)&&function(e,t){var r=e.nodeName.toLowerCase();return(n.test(r)&&!e.disabled||"a"===r&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),o(t))return!1;t=t.parentNode}return!0}(e)}(e,!r)}e.exports=t.default},253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=(o=n(983))&&o.__esModule?o:{default:o};t.default=r.default,e.exports=t.default},655:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__assign:()=>i,__asyncDelegator:()=>w,__asyncGenerator:()=>g,__asyncValues:()=>O,__await:()=>b,__awaiter:()=>c,__classPrivateFieldGet:()=>M,__classPrivateFieldIn:()=>P,__classPrivateFieldSet:()=>k,__createBinding:()=>d,__decorate:()=>a,__exportStar:()=>p,__extends:()=>r,__generator:()=>f,__importDefault:()=>x,__importStar:()=>E,__makeTemplateObject:()=>C,__metadata:()=>u,__param:()=>s,__read:()=>h,__rest:()=>l,__spread:()=>v,__spreadArray:()=>m,__spreadArrays:()=>y,__values:()=>_});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function l(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){var r,i=arguments.length,l=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>3&&l&&Object.defineProperty(t,n,l),l}function s(e,t){return function(n,o){t(n,o,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,o){return new(n||(n=Promise))((function(r,i){function l(e){try{s(o.next(e))}catch(e){i(e)}}function a(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}s((o=o.apply(e,t||[])).next())}))}function f(e,t){var n,o,r,i,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(l=0)),l;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,o=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!((r=(r=l.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){l.label=a[1];break}if(6===a[0]&&l.label<r[1]){l.label=r[1],r=a;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(a);break}r[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(e,l)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var d=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function p(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||d(t,e,n)}function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)l.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return l}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],l=0,a=i.length;l<a;l++,r++)o[r]=i[l];return o}function m(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},l("next"),l("throw"),l("return"),o[Symbol.asyncIterator]=function(){return this},o;function l(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||a(e,t)}))})}function a(e,t){try{(n=r[e](t)).value instanceof b?Promise.resolve(n.value.v).then(s,u):c(i[0][2],n)}catch(e){c(i[0][3],e)}var n}function s(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function w(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:b(e[o](t)),done:"return"===o}:r?r(t):t}:r}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=_(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&d(t,e,n);return S(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function M(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function k(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function P(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},473:e=>{"use strict";e.exports=function(){}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=n(400),t=0;function o(n,o,r,i,l){var a,s,u={};for(s in o)"ref"==s?a=o[s]:u[s]=o[s];var c={type:n,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--t,__source:l,__self:i};if("function"==typeof n&&(a=n.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return e.YM.vnode&&e.YM.vnode(c),c}var r=function(e){var t,n=e.selector,o=e.inline,r=e.clientSpecified,i=[],l=document.currentScript||(t=document.getElementsByTagName("script"))[t.length-1];if(!0===o){var a=l.parentNode;i.push(a)}return!0!==r||n||(n=function(e){var t=e.attributes,n=null;return Object.keys(t).forEach((function(e){t.hasOwnProperty(e)&&"data-mount-in"===t[e].name&&(n=t[e].nodeValue)})),n}(l)),n&&[].forEach.call(document.querySelectorAll(n),(function(e){i.push(e)})),i};const i=function(t){var n=t;return{render:function(t){void 0===t&&(t={});var o=t.selector;void 0===o&&(o=null);var i=t.inline;void 0===i&&(i=!1);var l=t.clean;void 0===l&&(l=!1);var a=t.clientSpecified;void 0===a&&(a=!1);var s=t.defaultProps;void 0===s&&(s={});var u=r({selector:o,inline:i,clientSpecified:a}),c=function(){if(u.length>0){var t=r({selector:o,inline:i,clientSpecified:a});return function(t,n,o,r,i){n.forEach((function(n){var l=n;if(!l._habitat){l._habitat=!0;var a=function(e,t){void 0===t&&(t={});var n=e.attributes,o=Object.assign({},t);return Object.keys(n).forEach((function(e){if(n.hasOwnProperty(e)){var t=n[e].name;if(!t||"string"!=typeof t)return!1;var r=t.split(/(data-props?-)/).pop()||"";if(t!==(r=r.replace(/-([a-z])/gi,(function(e,t){return t.toUpperCase()})))){var i=n[e].nodeValue;o[r]=i}}})),[].forEach.call(e.getElementsByTagName("script"),(function(e){var t={};if(e.hasAttribute("type")){if("text/props"!==e.getAttribute("type")&&"application/json"!==e.getAttribute("type"))return;try{t=JSON.parse(e.innerHTML)}catch(e){throw new Error(e)}Object.assign(o,t)}})),o}(n,i)||i;return r&&(l.innerHTML=""),(0,e.sY)((0,e.h)(t,a),l,o)}}))}(n,t,null,l,s)}};c(),document.addEventListener("DOMContentLoaded",c),document.addEventListener("load",c)}}};var l,a=n(736),s=n(396),u=function(e,t){var n=(0,s.I4)((function(n){var o=n.metaKey,r=n.ctrlKey,i=n.key;(o||r)&&i.toLowerCase()==e&&t()}),[t,e]);(0,s.d4)((function(){return document.addEventListener("keydown",n),function(){return document.removeEventListener("keydown",n)}}),[n])},c=n(253),f=n.n(c),d=function(){return d=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},d.apply(this,arguments)},p=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)l.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return l},_=function(t){var n=p((0,s.eJ)(!1),2),r=n[0],i=n[1],l=p((0,s.eJ)(o(e.HY,{})),2),a=l[0],u=l[1];return{modal:(0,s.Ye)((function(){return o(f(),d({ariaHideApp:!1,isOpen:r,onRequestClose:function(){return i(!1)},style:{overlay:{zIndex:1001},content:{zIndex:1001}}},{children:[o("span",d({onClick:function(){return i(!1)},style:{cursor:"pointer",float:"right"}},{children:"╳"})),o("div",d({style:{visibility:"hidden"}},{children:"╳"})),t||a]}))}),[a,r,i,t]),setBody:u,toggle:(0,s.I4)((function(){return i(!r)}),[i,r])}},h=n(360),v=n.n(h),y=(l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},l(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),m=function(e){function t(n){var o=e.call(this,n)||this;return o.name="YaamError",Object.setPrototypeOf(o,t.prototype),o}return y(t,e),t}(Error),b=function(e){if(e=e.replace(/\s+/g,""),!E.test(e))throw new m("invalid input");var t=new g,n=new Array,o=t;if(e.match(S).forEach((function(e){if("("===e){n.push(o);var t=new g;o.children.push(t),o=t}else if(")"===e){if(!n.length)throw new m("unbalanced parentheses `)`");o=n.pop()}else o.children.push(e)})),n.length)throw new m("unbalanced parentheses `(`");return t},g=function(){function e(){this.children=new Array}return e.prototype.calculate=function(){var e=this,t=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([],this.children,!0);if(t.length%2==0)throw new m("invalid Node ".concat(t));if(w.forEach((function(n){for(var o=t.length-2;o>0;o--)if(t[o]===n){var r=e.toNumber(t[o-1]),i=e.toNumber(t[o+1]),l=void 0;switch(n){case"+":l=r+i;break;case"-":l=r-i;break;case"*":l=r*i;break;case"/":l=r/i;break;case"%":case"%":l=r%i;break;case"^":case"**":l=Math.pow(r,i);break;default:throw new m("unhandled operator ".concat(n))}t.splice(o-1,3,l)}})),1!==t.length)throw new m("invalid Node ".concat(t));return this.toNumber(t[0])},e.prototype.toNumber=function(t){if(t instanceof e)return t.calculate();if("number"==typeof t)return t;if(C.test(t)){var n=t.split("e"),o=n[0],r=n[1],i=Number(o);if(!isNaN(i))return void 0===r?i:i*Math.pow(10,Number(r))}throw new m("invalid token ".concat(t))},e}(),w=["**","^","%","/","*","+","-"],O=new RegExp("(?:"+w.map((function(e){return e.replace(/(?=.)/g,"\\")})).join("|")+")"),C=/(?:(?:\d+\.\d+|\d+)(?:e[+-]?\d+)?)/,S=new RegExp("(?:[()]|".concat(O.source,"|").concat(C.source,")"),"g"),E=new RegExp("\n ^\n ".concat(S.source,"*\n ").concat(C.source,"\n ").concat(S.source,"*\n ").concat(O.source,"\n ").concat(S.source,"*\n ").concat(C.source,"\n ").concat(S.source,"*\n $\n ").replace(/\s+/g,"")),x=function(e){var t=e.commandPattern,n=e.queryPath,o=(0,s.Ye)((function(){return t&&new RegExp(t.source,t.options)}),[t]);return function(e){return t=void 0,r=void 0,l=function(){return function(e,t){var n,o,r,i,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(l=0)),l;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,o=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!((r=(r=l.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){l.label=a[1];break}if(6===a[0]&&l.label<r[1]){l.label=r[1],r=a;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(a);break}r[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(e,l)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}(this,(function(t){switch(t.label){case 0:return n&&(null==o?void 0:o.test(e))?[4,fetch("".concat(n,"&q=").concat(e))]:[2,[]];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{s(l.next(e))}catch(e){n(e)}}function a(e){try{s(l.throw(e))}catch(e){n(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((l=l.apply(t,r||[])).next())}));var t,r,i,l}},M=function(e){var t=e.items;return function(e){return v().go(e,t,{key:"title"}).map((function(e){return e.obj}))}},k=function(e){var t=e.calculator;return function(e){var n=t?function(e,t){void 0===t&&(t={});try{return function(e){return b(e).calculate()}(e)}catch(e){return t.verbose&&console.log(e),null}}(e):null;return null!==n?[{title:String(n),type:"default"}]:new Array}},P="rails-omnibar",R=function(){return R=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},R.apply(this,arguments)};document.addEventListener("DOMContentLoaded",(function(){i(N).render({selector:"#mount-rails-omnibar"})}));var N=function(e){var t=_(),n=(0,s.I4)((function(){setTimeout((function(){var e=document.querySelector("[data-id=".concat(P,"]"));e&&document.activeElement===e?e.blur():e&&e.focus()}),100)}),[]);return u(e.hotkey,n),o(e.modal?A:T,R({},e,{itemModal:t}))},T=function(t){var n,r=function(e){return(0,s.Ye)((function(){return[x(e),M(e),k(e)]}),[e])}(t),i=(n=t.itemModal,(0,s.I4)((function(e){if(e)if(e.url)window.location.href=e.url;else if(e.modalHTML){var t=e.modalHTML;n.setBody(o("div",{dangerouslySetInnerHTML:{__html:t}})),n.toggle()}}),[n]));return o(e.HY,{children:[o(a.ZP,{"data-id":P,extensions:r,maxResults:t.maxResults,onAction:i,placeholder:t.placeholder}),t.itemModal.modal]})},A=function(e){var t=_(o(T,R({},e))),n=t.modal,r=t.toggle;return u(e.hotkey,r),n}})()})();
@@ -0,0 +1,44 @@
1
+ import React, {FunctionComponent} from "preact"
2
+ import habitat from "preact-habitat"
3
+ import Omnibar from "omnibar2"
4
+ import {useItemAction, useOmnibarExtensions} from "./hooks"
5
+ import {useHotkey, useModal, useToggleFocus} from "./hooks"
6
+ import {AppArgs, INPUT_DATA_ID, Item, ModalArg} from "./types"
7
+
8
+ document.addEventListener("DOMContentLoaded", () => {
9
+ habitat(App).render({selector: "#mount-rails-omnibar"})
10
+ })
11
+
12
+ const App: FunctionComponent<AppArgs> = (args) => {
13
+ const itemModal = useModal()
14
+ const toggleFocus = useToggleFocus()
15
+ useHotkey(args.hotkey, toggleFocus)
16
+
17
+ const Component = args.modal ? RailsOmnibarAsModal : RailsOmnibar
18
+ return <Component {...args} itemModal={itemModal} />
19
+ }
20
+
21
+ const RailsOmnibar: FunctionComponent<AppArgs & ModalArg> = (args) => {
22
+ const extensions = useOmnibarExtensions(args)
23
+ const itemAction = useItemAction(args.itemModal)
24
+
25
+ return (
26
+ <>
27
+ <Omnibar<Item>
28
+ data-id={INPUT_DATA_ID}
29
+ extensions={extensions}
30
+ maxResults={args.maxResults}
31
+ onAction={itemAction}
32
+ placeholder={args.placeholder}
33
+ />
34
+ {args.itemModal.modal}
35
+ </>
36
+ )
37
+ }
38
+
39
+ const RailsOmnibarAsModal: FunctionComponent<AppArgs & ModalArg> = (args) => {
40
+ const {modal, toggle} = useModal(<RailsOmnibar {...args} />)
41
+ useHotkey(args.hotkey, toggle)
42
+
43
+ return modal
44
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./use_hotkey"
2
+ export * from "./use_item_action"
3
+ export * from "./use_modal"
4
+ export * from "./use_omnibar_extensions"
5
+ export * from "./use_toggle_focus"