From bee7b9497583ea5a360c581caac9fd4229e849e7 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Wed, 22 Sep 2021 22:59:24 +0800 Subject: [PATCH 01/22] Refactor the base class to support multiple major Bootstrap versions --- flask_bootstrap/__init__.py | 228 ++++++++++++++++++++++++------------ 1 file changed, 154 insertions(+), 74 deletions(-) diff --git a/flask_bootstrap/__init__.py b/flask_bootstrap/__init__.py index 48fdf472..16d92688 100644 --- a/flask_bootstrap/__init__.py +++ b/flask_bootstrap/__init__.py @@ -1,10 +1,3 @@ -# -*- coding: utf-8 -*- -""" - flask_bootstrap - ~~~~~~~~~~~~~~ - :copyright: (c) 2017 by Grey Li. - :license: MIT, see LICENSE for more details. -""" import warnings from flask import current_app, Markup, Blueprint, url_for @@ -18,14 +11,6 @@ def is_hidden_field_filter(field): def is_hidden_field_filter(field): return isinstance(field, HiddenField) -# central definition of used versions and SRI hashes -VERSION_BOOTSTRAP = '4.3.1' -VERSION_JQUERY = '3.4.1' -VERSION_POPPER = '1.14.0' -BOOTSTRAP_CSS_INTEGRITY = 'sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' -BOOTSTRAP_JS_INTEGRITY = 'sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' -JQUERY_INTEGRITY = 'sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh' -POPPER_INTEGRITY = 'sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ' CDN_BASE = 'https://cdn.jsdelivr.net/npm' @@ -48,7 +33,26 @@ def get_table_titles(data, primary_key, primary_key_title): return titles -class Bootstrap(object): +class _Bootstrap: + """ + Base extension class for different Bootstrap versions. + + .. versionadded:: 2.0.0 + """ + + bootstrap_version = None + jquery_version = None + popper_version = None + bootstrap_css_integrity = None + bootstrap_js_integrity = None + jquery_integrity = None + popper_integrity = None + static_folder = None + bootstrap_css_filename = 'bootstrap.min.css' + bootstrap_js_filename = 'bootstrap.min.js' + jquery_filename = 'jquery.min.js' + popper_filename = 'popper.min.js' + def __init__(self, app=None): if app is not None: self.init_app(app) @@ -59,7 +63,7 @@ def init_app(self, app): app.extensions = {} app.extensions['bootstrap'] = self - blueprint = Blueprint('bootstrap', __name__, static_folder='static', + blueprint = Blueprint('bootstrap', __name__, static_folder=f'static/{self.static_folder}', static_url_path=f'/bootstrap{app.static_url_path}', template_folder='templates') app.register_blueprint(blueprint) @@ -83,32 +87,30 @@ def init_app(self, app): app.config.setdefault('BOOTSTRAP_TABLE_DELETE_TITLE', 'Delete') app.config.setdefault('BOOTSTRAP_TABLE_NEW_TITLE', 'New') - @staticmethod - def load_css(version=VERSION_BOOTSTRAP, bootstrap_sri=None): + def load_css(self, version=None, bootstrap_sri=None): """Load Bootstrap's css resources with given version. .. versionadded:: 0.1.0 :param version: The version of Bootstrap. """ - css_filename = 'bootstrap.min.css' serve_local = current_app.config['BOOTSTRAP_SERVE_LOCAL'] bootswatch_theme = current_app.config['BOOTSTRAP_BOOTSWATCH_THEME'] - - if version == VERSION_BOOTSTRAP and serve_local is False and bootstrap_sri is None: - bootstrap_sri = BOOTSTRAP_CSS_INTEGRITY + if version is None: + version = self.bootstrap_version + bootstrap_sri = self._get_sri('bootstrap_css', version, bootstrap_sri) if serve_local: if not bootswatch_theme: base_path = 'css/' else: base_path = f'css/swatch/{bootswatch_theme.lower()}/' - boostrap_url = url_for('bootstrap.static', filename=f'{base_path}{css_filename}') + boostrap_url = url_for('bootstrap.static', filename=f'{base_path}{self.bootstrap_css_filename}') else: if bootswatch_theme: - boostrap_url = f'{CDN_BASE}/bootswatch@{version}/dist/{bootswatch_theme.lower()}/{css_filename}' + boostrap_url = f'{CDN_BASE}/bootswatch@{version}/dist/{bootswatch_theme.lower()}/{self.bootstrap_css_filename}' else: - boostrap_url = f'{CDN_BASE}/bootstrap@{version}/dist/css/{css_filename}' + boostrap_url = f'{CDN_BASE}/bootstrap@{version}/dist/css/{self.bootstrap_css_filename}' if bootstrap_sri and not bootswatch_theme: css = f'' @@ -116,65 +118,143 @@ def load_css(version=VERSION_BOOTSTRAP, bootstrap_sri=None): css = f'' return Markup(css) - @staticmethod - def load_js(version=VERSION_BOOTSTRAP, jquery_version=VERSION_JQUERY, # noqa: C901 - popper_version=VERSION_POPPER, with_jquery=True, with_popper=True, + def _get_js_script(self, version, name, sri): + """Get ' + else: + return f'' + + def _get_sri(self, name, version, sri): + serve_local = current_app.config['BOOTSTRAP_SERVE_LOCAL'] + sris = { + 'bootstrap_css': self.bootstrap_css_integrity, + 'bootstrap_js': self.bootstrap_js_integrity, + 'jquery': self.jquery_integrity, + 'popper': self.popper_integrity, + } + versions = { + 'bootstrap_css': self.bootstrap_version, + 'bootstrap_js': self.bootstrap_version, + 'jquery': self.jquery_version, + 'popper': self.popper_version + } + if sri is not None: + return sri + if version == versions[name] and serve_local is False: + return sris[name] + else: + return None + + def load_js(self, version=None, jquery_version=None, # noqa: C901 + popper_version=None, with_jquery=True, with_popper=True, bootstrap_sri=None, jquery_sri=None, popper_sri=None): """Load Bootstrap and related library's js resources with given version. .. versionadded:: 0.1.0 :param version: The version of Bootstrap. - :param jquery_version: The version of jQuery. + :param jquery_version: The version of jQuery (only needed with Bootstrap 4). :param popper_version: The version of Popper.js. - :param with_jquery: Include jQuery or not. + :param with_jquery: Include jQuery or not (only needed with Bootstrap 4). :param with_popper: Include Popper.js or not. """ - bootstrap_filename = 'bootstrap.min.js' - jquery_filename = 'jquery.min.js' - popper_filename = 'popper.min.js' + if version is None: + version = self.bootstrap_version + if popper_version is None: + popper_version = self.popper_version - serve_local = current_app.config['BOOTSTRAP_SERVE_LOCAL'] + bootstrap_sri = self._get_sri('bootstrap_js', version, bootstrap_sri) + popper_sri = self._get_sri('popper', popper_version, popper_sri) + bootstrap = self._get_js_script(version, 'bootstrap', bootstrap_sri) + popper = self._get_js_script(popper_version, 'popper.js', popper_sri) if with_popper else '' + if version.startswith('4'): + if jquery_version is None: + jquery_version = self.jquery_version + jquery_sri = self._get_sri('jquery', jquery_version, jquery_sri) + jquery = self._get_js_script(jquery_version, 'jquery', jquery_sri) if with_jquery else '' + return Markup(f'''{jquery} + {popper} + {bootstrap}''') + else: + return Markup(f'''{popper} + {bootstrap}''') - if version == VERSION_BOOTSTRAP and serve_local is False and bootstrap_sri is None: - bootstrap_sri = BOOTSTRAP_JS_INTEGRITY - if jquery_version == VERSION_JQUERY and serve_local is False and jquery_sri is None: - jquery_sri = JQUERY_INTEGRITY - if popper_version == VERSION_POPPER and serve_local is False and popper_sri is None: - popper_sri = POPPER_INTEGRITY - if serve_local: - bootstrap_url = url_for('bootstrap.static', filename=f'js/{bootstrap_filename}') - else: - bootstrap_url = f'{CDN_BASE}/bootstrap@{version}/dist/js/{bootstrap_filename}' - if bootstrap_sri: - bootstrap = f'' - else: - bootstrap = f'' +class Bootstrap(_Bootstrap): + """ + Extension class for Bootstrap 4. - if with_jquery: - if serve_local: - jquery_url = url_for('bootstrap.static', filename=jquery_filename) - else: - jquery_url = f'{CDN_BASE}/jquery@{jquery_version}/dist/{jquery_filename}' - if jquery_sri: - jquery = f'' - else: - jquery = f'' - else: - jquery = '' + Initilize the extension:: - if with_popper: - if serve_local: - popper_url = url_for('bootstrap.static', filename=popper_filename) - else: - popper_url = f'{CDN_BASE}/popper.js@{popper_version}/dist/umd/{popper_filename}' - if popper_sri: - popper = f'' - else: - popper = f'' - else: - popper = '' - return Markup(f'''{jquery} - {popper} - {bootstrap}''') + from flask import Flask + from flask_bootstrap import Bootstrap + + app = Flask(__name__) + bootstrap = Bootstrap(app) + + Or with the application factory:: + + from flask import Flask + from flask_bootstrap import Bootstrap + + bootstrap = Bootstrap() + + def create_app(): + app = Flask(__name__) + bootstrap.init_app(app) + + .. versionchanged:: 2.0.0 + Move common logic to base class ``_Bootstrap``. + """ + bootstrap_version = '4.3.1' + jquery_version = '3.4.1' + popper_version = '1.14.0' + bootstrap_css_integrity = 'sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' + bootstrap_js_integrity = 'sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' + jquery_integrity = 'sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh' + popper_integrity = 'sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ' + static_folder = 'bootstrap4' + + +class Bootstrap5(_Bootstrap): + """ + Base class for Bootstrap 5. + + Initilize the extension:: + + from flask import Flask + from flask_bootstrap import Bootstrap5 + + app = Flask(__name__) + bootstrap = Bootstrap5(app) + + Or with the application factory:: + + from flask import Flask + from flask_bootstrap import Bootstrap5 + + bootstrap = Bootstrap5() + + def create_app(): + app = Flask(__name__) + bootstrap5.init_app(app) + + .. versionadded:: 2.0.0 + """ + bootstrap_version = '5.1.1' + popper_version = '2.9.3' + bootstrap_css_integrity = 'sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU' + bootstrap_js_integrity = 'sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/' + popper_integrity = 'sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN' + static_folder = 'bootstrap5' From a38fcc93e3d24bed3fc03baec27923fd552b86ed Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sat, 25 Sep 2021 21:18:52 +0800 Subject: [PATCH 02/22] Refactor tests to support test multiple Bootstrap versions --- tests/conftest.py | 9 +- tests/test_bootstrap.py | 32 +- tests/test_render_breadcrumb_item.py | 3 +- tests/test_render_field.py | 6 +- tests/test_render_form.py | 365 +++++++-------- tests/test_render_form_row.py | 102 +++-- tests/test_render_hidden_errors.py | 2 +- tests/test_render_icon.py | 116 ++--- tests/test_render_messages.py | 105 +++-- tests/test_render_nav_item.py | 2 +- tests/test_render_pager.py | 2 +- tests/test_render_pagination.py | 2 +- tests/test_render_table.py | 658 ++++++++++++++------------- tests/test_themes.py | 39 +- 14 files changed, 728 insertions(+), 715 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0dfcc953..f0d00d10 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ import pytest from flask import Flask, render_template_string -from flask_bootstrap import Bootstrap +from flask_bootstrap import Bootstrap, Bootstrap5 from flask_wtf import FlaskForm from wtforms import BooleanField, PasswordField, StringField, SubmitField, HiddenField from wtforms.validators import DataRequired, Length @@ -35,11 +35,16 @@ def index(): yield app -@pytest.fixture(autouse=True) +@pytest.fixture def bootstrap(app): yield Bootstrap(app) +@pytest.fixture +def bootstrap5(app): + yield Bootstrap5(app) + + @pytest.fixture def client(app): context = app.test_request_context() diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 15de15af..a506533f 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -1,10 +1,6 @@ import pytest from flask import current_app -from flask_bootstrap import ( - VERSION_BOOTSTRAP, VERSION_JQUERY, VERSION_POPPER, - BOOTSTRAP_CSS_INTEGRITY, BOOTSTRAP_JS_INTEGRITY, - JQUERY_INTEGRITY, POPPER_INTEGRITY, CDN_BASE -) +from flask_bootstrap import CDN_BASE @pytest.mark.usefixtures('client') @@ -14,8 +10,8 @@ def test_extension_init(self, bootstrap): def test_load_css_with_default_versions(self, bootstrap): rv = bootstrap.load_css() - bootstrap_css = f'' + bootstrap_css = f'' assert bootstrap_css in rv def test_load_css_with_non_default_versions(self, bootstrap): @@ -24,19 +20,19 @@ def _check_assertions(rv): assert 'integrity="' not in rv assert 'crossorigin="anonymous"' not in rv - rv = bootstrap.load_css(version='1.2.3') + rv = bootstrap.load_css(version='4.5.6') _check_assertions(rv) rv = bootstrap.load_css(version='5.0.0') _check_assertions(rv) def test_load_js_with_default_versions(self, bootstrap): rv = bootstrap.load_js() - bootstrap_js = f'' - jquery_js = f'' - popper_js = f'' + bootstrap_js = f'' + jquery_js = f'' + popper_js = f'' assert bootstrap_js in rv assert jquery_js in rv assert popper_js in rv @@ -49,11 +45,11 @@ def _check_assertions(rv): assert 'integrity="' not in rv assert 'crossorigin="anonymous"' not in rv - rv = bootstrap.load_js(version='1.2.3', jquery_version='1.2.3', - popper_version='1.2.3') + rv = bootstrap.load_js(version='4.5.6', jquery_version='4.5.6', + popper_version='4.5.6') _check_assertions(rv) - rv = bootstrap.load_js(version='5.0.0', jquery_version='5.0.0', - popper_version='5.0.0') + rv = bootstrap.load_js(version='4.0.0', jquery_version='4.0.0', + popper_version='4.0.0') _check_assertions(rv) def test_local_resources(self, bootstrap, client): diff --git a/tests/test_render_breadcrumb_item.py b/tests/test_render_breadcrumb_item.py index 91610462..7613963d 100644 --- a/tests/test_render_breadcrumb_item.py +++ b/tests/test_render_breadcrumb_item.py @@ -1,7 +1,8 @@ +import pytest from flask import render_template_string -def test_render_breadcrumb_item_active(app, client): +def test_render_breadcrumb_item_active(bootstrap, app, client): @app.route('/not_active_item') def foo(): return render_template_string(''' diff --git a/tests/test_render_field.py b/tests/test_render_field.py index 5c45e00a..6323fa07 100644 --- a/tests/test_render_field.py +++ b/tests/test_render_field.py @@ -1,7 +1,7 @@ from flask import render_template_string -def test_render_field(app, client, hello_form): +def test_render_field(bootstrap, app, client, hello_form): @app.route('/field') def test(): form = hello_form() @@ -21,7 +21,7 @@ def test(): assert 'Just check this' in data - - # test WTForm fields for render_form and render_field - def test_render_form_enctype(self, app, client): - class SingleUploadForm(FlaskForm): - avatar = FileField('Avatar') - - class MultiUploadForm(FlaskForm): - photos = MultipleFileField('Multiple photos') - - @app.route('/single') - def single(): - form = SingleUploadForm() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form) }} - ''', form=form) - - @app.route('/multi') - def multi(): - form = SingleUploadForm() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form) }} - ''', form=form) - - response = client.get('/single') - data = response.get_data(as_text=True) - assert 'multipart/form-data' in data - - response = client.get('/multi') - data = response.get_data(as_text=True) - assert 'multipart/form-data' in data - - # test render_kw class for WTForms field - def test_form_render_kw_class(self, app, client): - - class TestForm(FlaskForm): - username = StringField('Username') - password = PasswordField('Password', render_kw={'class': 'my-password-class'}) - submit = SubmitField(render_kw={'class': 'my-awesome-class'}) - - @app.route('/render_kw') - def render_kw(): - form = TestForm() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form) }} - ''', form=form) - - response = client.get('/render_kw') - data = response.get_data(as_text=True) - assert 'class="form-control"' in data - assert 'class="form-control "' not in data - assert 'class="form-control my-password-class"' in data - assert 'my-awesome-class' in data - assert 'btn' in data - - def test_button_size(self, app, client, hello_form): - assert current_app.config['BOOTSTRAP_BTN_SIZE'] == 'md' - current_app.config['BOOTSTRAP_BTN_SIZE'] = 'lg' - - @app.route('/form') - def test(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form) }} - ''', form=form) - - response = client.get('/form') - data = response.get_data(as_text=True) - assert 'btn-lg' in data - - @app.route('/form2') - def test_overwrite(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form, button_size='sm') }} - ''', form=form) - - response = client.get('/form2') - data = response.get_data(as_text=True) - assert 'btn-lg' not in data - assert 'btn-sm' in data - - def test_button_style(self, app, client, hello_form): - assert current_app.config['BOOTSTRAP_BTN_STYLE'] == 'primary' - current_app.config['BOOTSTRAP_BTN_STYLE'] = 'secondary' - - @app.route('/form') - def test(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form) }} - ''', form=form) - - response = client.get('/form') - data = response.get_data(as_text=True) - assert 'btn-secondary' in data - - @app.route('/form2') - def test_overwrite(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form, button_style='success') }} - ''', form=form) - - response = client.get('/form2') - data = response.get_data(as_text=True) - assert 'btn-primary' not in data - assert 'btn-success' in data - - @app.route('/form3') - def test_button_map(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form, button_map={'submit': 'warning'}) }} - ''', form=form) - - response = client.get('/form3') - data = response.get_data(as_text=True) - assert 'btn-primary' not in data - assert 'btn-warning' in data - - def test_error_message_for_radiofield_and_booleanfield(self, app, client): - class TestForm(FlaskForm): - remember = BooleanField('Remember me', validators=[DataRequired()]) - option = RadioField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')], - validators=[DataRequired()]) - - @app.route('/error', methods=['GET', 'POST']) - def error(): - form = TestForm() - if form.validate_on_submit(): - pass - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form %} - {{ render_form(form) }} - ''', form=form) - - response = client.post('/error', follow_redirects=True) - data = response.get_data(as_text=True) - assert 'This field is required' in data +def test_render_form(bootstrap, app, client, hello_form): + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + response = client.get('/form') + data = response.get_data(as_text=True) + assert 'Just check this' in data + + +# test WTForm fields for render_form and render_field +def test_render_form_enctype(bootstrap, app, client): + class SingleUploadForm(FlaskForm): + avatar = FileField('Avatar') + + class MultiUploadForm(FlaskForm): + photos = MultipleFileField('Multiple photos') + + @app.route('/single') + def single(): + form = SingleUploadForm() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + @app.route('/multi') + def multi(): + form = SingleUploadForm() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + response = client.get('/single') + data = response.get_data(as_text=True) + assert 'multipart/form-data' in data + + response = client.get('/multi') + data = response.get_data(as_text=True) + assert 'multipart/form-data' in data + + +# test render_kw class for WTForms field +def test_form_render_kw_class(bootstrap, app, client): + + class TestForm(FlaskForm): + username = StringField('Username') + password = PasswordField('Password', render_kw={'class': 'my-password-class'}) + submit = SubmitField(render_kw={'class': 'my-awesome-class'}) + + @app.route('/render_kw') + def render_kw(): + form = TestForm() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + response = client.get('/render_kw') + data = response.get_data(as_text=True) + assert 'class="form-control"' in data + assert 'class="form-control "' not in data + assert 'class="form-control my-password-class"' in data + assert 'my-awesome-class' in data + assert 'btn' in data + + +def test_button_size(bootstrap, app, client, hello_form): + assert current_app.config['BOOTSTRAP_BTN_SIZE'] == 'md' + current_app.config['BOOTSTRAP_BTN_SIZE'] = 'lg' + + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + response = client.get('/form') + data = response.get_data(as_text=True) + assert 'btn-lg' in data + + @app.route('/form2') + def test_overwrite(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form, button_size='sm') }} + ''', form=form) + + response = client.get('/form2') + data = response.get_data(as_text=True) + assert 'btn-lg' not in data + assert 'btn-sm' in data + + +def test_button_style(bootstrap, app, client, hello_form): + assert current_app.config['BOOTSTRAP_BTN_STYLE'] == 'primary' + current_app.config['BOOTSTRAP_BTN_STYLE'] = 'secondary' + + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + response = client.get('/form') + data = response.get_data(as_text=True) + assert 'btn-secondary' in data + + @app.route('/form2') + def test_overwrite(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form, button_style='success') }} + ''', form=form) + + response = client.get('/form2') + data = response.get_data(as_text=True) + assert 'btn-primary' not in data + assert 'btn-success' in data + + @app.route('/form3') + def test_button_map(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form, button_map={'submit': 'warning'}) }} + ''', form=form) + + response = client.get('/form3') + data = response.get_data(as_text=True) + assert 'btn-primary' not in data + assert 'btn-warning' in data + + +def test_error_message_for_radiofield_and_booleanfield(bootstrap, app, client): + class TestForm(FlaskForm): + remember = BooleanField('Remember me', validators=[DataRequired()]) + option = RadioField(choices=[('dog', 'Dog'), ('cat', 'Cat'), ('bird', 'Bird'), ('alien', 'Alien')], + validators=[DataRequired()]) + + @app.route('/error', methods=['GET', 'POST']) + def error(): + form = TestForm() + if form.validate_on_submit(): + pass + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form %} + {{ render_form(form) }} + ''', form=form) + + response = client.post('/error', follow_redirects=True) + data = response.get_data(as_text=True) + assert 'This field is required' in data diff --git a/tests/test_render_form_row.py b/tests/test_render_form_row.py index 11938bb8..a00492ea 100644 --- a/tests/test_render_form_row.py +++ b/tests/test_render_form_row.py @@ -1,53 +1,55 @@ from flask import render_template_string -class TestRenderFormRow: - def test_render_form_row(self, app, client, hello_form): - @app.route('/form') - def test(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form_row %} - {{ render_form_row([form.username, form.password]) }} - ''', form=form) - response = client.get('/form') - data = response.get_data(as_text=True) - assert '
' in data - assert '
' in data - - def test_render_form_row_row_class(self, app, client, hello_form): - @app.route('/form') - def test(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form_row %} - {{ render_form_row([form.username, form.password], row_class='row') }} - ''', form=form) - response = client.get('/form') - data = response.get_data(as_text=True) - assert '
' in data - - def test_render_form_row_col_class_default(self, app, client, hello_form): - @app.route('/form') - def test(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form_row %} - {{ render_form_row([form.username, form.password], col_class_default='col-md-6') }} - ''', form=form) - response = client.get('/form') - data = response.get_data(as_text=True) - assert '
' in data - - def test_render_form_row_col_map(self, app, client, hello_form): - @app.route('/form') - def test(): - form = hello_form() - return render_template_string(''' - {% from 'bootstrap/form.html' import render_form_row %} - {{ render_form_row([form.username, form.password], col_map={'username': 'col-md-6'}) }} - ''', form=form) - response = client.get('/form') - data = response.get_data(as_text=True) - assert '
' in data - assert '
' in data +def test_render_form_row(bootstrap, app, client, hello_form): + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form_row %} + {{ render_form_row([form.username, form.password]) }} + ''', form=form) + response = client.get('/form') + data = response.get_data(as_text=True) + assert '
' in data + assert '
' in data + + +def test_render_form_row_row_class(bootstrap, app, client, hello_form): + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form_row %} + {{ render_form_row([form.username, form.password], row_class='row') }} + ''', form=form) + response = client.get('/form') + data = response.get_data(as_text=True) + assert '
' in data + + +def test_render_form_row_col_class_default(bootstrap, app, client, hello_form): + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form_row %} + {{ render_form_row([form.username, form.password], col_class_default='col-md-6') }} + ''', form=form) + response = client.get('/form') + data = response.get_data(as_text=True) + assert '
' in data + + +def test_render_form_row_col_map(bootstrap, app, client, hello_form): + @app.route('/form') + def test(): + form = hello_form() + return render_template_string(''' + {% from 'bootstrap/form.html' import render_form_row %} + {{ render_form_row([form.username, form.password], col_map={'username': 'col-md-6'}) }} + ''', form=form) + response = client.get('/form') + data = response.get_data(as_text=True) + assert '
' in data + assert '
' in data diff --git a/tests/test_render_hidden_errors.py b/tests/test_render_hidden_errors.py index 27c5825b..90a47ac1 100644 --- a/tests/test_render_hidden_errors.py +++ b/tests/test_render_hidden_errors.py @@ -4,7 +4,7 @@ from wtforms.validators import DataRequired -def test_render_hidden_errors(app, client): +def test_render_hidden_errors(bootstrap, app, client): class TestForm(FlaskForm): hide = HiddenField('Hide', validators=[DataRequired('Hide field is empty.')]) submit = SubmitField() diff --git a/tests/test_render_icon.py b/tests/test_render_icon.py index b0a5d3e2..47bc6dc0 100644 --- a/tests/test_render_icon.py +++ b/tests/test_render_icon.py @@ -1,71 +1,71 @@ from flask import render_template_string -class TestIcon: - def test_render_icon(self, app, client): - @app.route('/icon') - def icon(): - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_icon %} - {{ render_icon('heart') }} - ''') +def test_render_icon(bootstrap, app, client): + @app.route('/icon') + def icon(): + return render_template_string(''' + {% from 'bootstrap/utils.html' import render_icon %} + {{ render_icon('heart') }} + ''') - @app.route('/icon-size') - def icon_size(): - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_icon %} - {{ render_icon('heart', 32) }} - ''') + @app.route('/icon-size') + def icon_size(): + return render_template_string(''' + {% from 'bootstrap/utils.html' import render_icon %} + {{ render_icon('heart', 32) }} + ''') - @app.route('/icon-style') - def icon_style(): - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_icon %} - {{ render_icon('heart', color='primary') }} - ''') + @app.route('/icon-style') + def icon_style(): + return render_template_string(''' + {% from 'bootstrap/utils.html' import render_icon %} + {{ render_icon('heart', color='primary') }} + ''') - @app.route('/icon-color') - def icon_color(): - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_icon %} - {{ render_icon('heart', color='green') }} - ''') + @app.route('/icon-color') + def icon_color(): + return render_template_string(''' + {% from 'bootstrap/utils.html' import render_icon %} + {{ render_icon('heart', color='green') }} + ''') - response = client.get('/icon') - data = response.get_data(as_text=True) - assert 'bootstrap-icons.svg#heart' in data - assert 'width="1em"' in data - assert 'height="1em"' in data + response = client.get('/icon') + data = response.get_data(as_text=True) + assert 'bootstrap-icons.svg#heart' in data + assert 'width="1em"' in data + assert 'height="1em"' in data - response = client.get('/icon-size') - data = response.get_data(as_text=True) - assert 'bootstrap-icons.svg#heart' in data - assert 'width="32"' in data - assert 'height="32"' in data + response = client.get('/icon-size') + data = response.get_data(as_text=True) + assert 'bootstrap-icons.svg#heart' in data + assert 'width="32"' in data + assert 'height="32"' in data - response = client.get('/icon-style') - data = response.get_data(as_text=True) - assert 'bootstrap-icons.svg#heart' in data - assert 'text-primary' in data + response = client.get('/icon-style') + data = response.get_data(as_text=True) + assert 'bootstrap-icons.svg#heart' in data + assert 'text-primary' in data - response = client.get('/icon-color') - data = response.get_data(as_text=True) - assert 'bootstrap-icons.svg#heart' in data - assert 'style="color: green"' in data + response = client.get('/icon-color') + data = response.get_data(as_text=True) + assert 'bootstrap-icons.svg#heart' in data + assert 'style="color: green"' in data - def test_render_icon_config(self, app, client): - app.config['BOOTSTRAP_ICON_SIZE'] = 100 - app.config['BOOTSTRAP_ICON_COLOR'] = 'success' - @app.route('/icon') - def icon(): - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_icon %} - {{ render_icon('heart') }} - ''') +def test_render_icon_config(bootstrap, app, client): + app.config['BOOTSTRAP_ICON_SIZE'] = 100 + app.config['BOOTSTRAP_ICON_COLOR'] = 'success' - response = client.get('/icon') - data = response.get_data(as_text=True) - assert 'width="100"' in data - assert 'height="100"' in data - assert 'text-success' in data + @app.route('/icon') + def icon(): + return render_template_string(''' + {% from 'bootstrap/utils.html' import render_icon %} + {{ render_icon('heart') }} + ''') + + response = client.get('/icon') + data = response.get_data(as_text=True) + assert 'width="100"' in data + assert 'height="100"' in data + assert 'text-success' in data diff --git a/tests/test_render_messages.py b/tests/test_render_messages.py index 2c1a7437..9dc5c7e3 100644 --- a/tests/test_render_messages.py +++ b/tests/test_render_messages.py @@ -1,56 +1,55 @@ from flask import flash, render_template_string -class TestMessages: - def test_render_messages(self, app, client): - @app.route('/messages') - def test_messages(): - flash('test message', 'danger') - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_messages %} - {{ render_messages() }} - ''') - - @app.route('/container') - def test_container(): - flash('test message', 'danger') - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_messages %} - {{ render_messages(container=True) }} - ''') - - @app.route('/dismissible') - def test_dismissible(): - flash('test message', 'danger') - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_messages %} - {{ render_messages(dismissible=True) }} - ''') - - @app.route('/dismiss_animate') - def test_dismiss_animate(): - flash('test message', 'danger') - return render_template_string(''' - {% from 'bootstrap/utils.html' import render_messages %} - {{ render_messages(dismissible=True, dismiss_animate=True) }} - ''') - - response = client.get('/messages') - data = response.get_data(as_text=True) - assert '
' in data - - response = client.get('/dismissible') - data = response.get_data(as_text=True) - assert 'alert-dismissible' in data - assert '
+{% endif %} +{% endmacro %} diff --git a/flask_bootstrap/templates/bootstrap5/utils.html b/flask_bootstrap/templates/bootstrap5/utils.html new file mode 100644 index 00000000..57f32961 --- /dev/null +++ b/flask_bootstrap/templates/bootstrap5/utils.html @@ -0,0 +1,73 @@ +{% macro render_static(type, filename_or_url, local=True) %} + {% if local -%}{% set filename_or_url = url_for('static', filename=filename_or_url) %}{%- endif %} + {% if type == 'css' -%} + + {%- elif type == 'js' -%} + + {%- elif type == 'icon' -%} + + {%- endif %} +{% endmacro %} + +{# This macro was part of Flask-Bootstrap and was modified under the terms of + its BSD License. Copyright (c) 2013, Marc Brinkmann. All rights reserved. #} + +{# versionadded: New in 1.2.0 #} + +{% macro render_messages(messages=None, container=False, transform={ + 'critical': 'danger', + 'error': 'danger', + 'info': 'info', + 'warning': 'warning', + 'debug': 'primary', + 'notset': 'primary', + 'message': 'primary', + }, default_category=config.BOOTSTRAP_MSG_CATEGORY, dismissible=False, dismiss_animate=False) -%} + + {% with messages = messages or get_flashed_messages(with_categories=True) -%} + {% if messages -%} {# don't output anything if there are no messages #} + + {% if container -%} + +
+
+
+ {% endif -%} + + {% for cat, msg in messages %} + + {%- endfor -%} + + {% if container %} +
+
+
+ + {% endif -%} + + {% endif -%} + {% endwith -%} +{% endmacro -%} + + +{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR) %} +{% set bootstrap_colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'muted'] %} + + + +{% endmacro %} + +{% macro arg_url_for(endpoint, base) %} + {# calls url_for() with a given endpoint and **base as the parameters, + additionally passing on all keyword_arguments (may overwrite existing ones) + #} + {%- with kargs = base.copy() -%} + {%- do kargs.update(kwargs) -%} + {{ url_for(endpoint, **kargs) }} + {%- endwith %} +{%- endmacro %} From f704127ccdfe96740503434c699e5ee4f2e1a34f Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Sep 2021 17:09:52 +0800 Subject: [PATCH 16/22] Add icons file for Bootstrap 5 version of render_icon --- flask_bootstrap/static/bootstrap5/icons/bootstrap-icons.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 flask_bootstrap/static/bootstrap5/icons/bootstrap-icons.svg diff --git a/flask_bootstrap/static/bootstrap5/icons/bootstrap-icons.svg b/flask_bootstrap/static/bootstrap5/icons/bootstrap-icons.svg new file mode 100644 index 00000000..7e2d6429 --- /dev/null +++ b/flask_bootstrap/static/bootstrap5/icons/bootstrap-icons.svg @@ -0,0 +1 @@ + \ No newline at end of file From 824dbe0388898ef8a8a12c69cfcaea106ddd298d Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Sep 2021 17:12:27 +0800 Subject: [PATCH 17/22] Fix Popperjs name and SRI in CDN URL --- flask_bootstrap/__init__.py | 7 +++++-- tests/test_boostrap5/test_bootstrap5.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flask_bootstrap/__init__.py b/flask_bootstrap/__init__.py index 0e72889e..e9f0d3f8 100644 --- a/flask_bootstrap/__init__.py +++ b/flask_bootstrap/__init__.py @@ -125,6 +125,7 @@ def _get_js_script(self, version, name, sri): paths = { 'bootstrap': f'js/{self.bootstrap_js_filename}', 'jquery': f'{self.jquery_filename}', + '@popperjs/core': f'umd/{self.popper_filename}', 'popper.js': f'umd/{self.popper_filename}', } if serve_local: @@ -178,7 +179,7 @@ def load_js(self, version=None, jquery_version=None, # noqa: C901 bootstrap_sri = self._get_sri('bootstrap_js', version, bootstrap_sri) popper_sri = self._get_sri('popper', popper_version, popper_sri) bootstrap = self._get_js_script(version, 'bootstrap', bootstrap_sri) - popper = self._get_js_script(popper_version, 'popper.js', popper_sri) if with_popper else '' + popper = self._get_js_script(popper_version, self.popper_name, popper_sri) if with_popper else '' if version.startswith('4'): if jquery_version is None: jquery_version = self.jquery_version @@ -225,6 +226,7 @@ def create_app(): bootstrap_js_integrity = 'sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' jquery_integrity = 'sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh' popper_integrity = 'sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ' + popper_name = 'popper.js' static_folder = 'bootstrap4' @@ -257,7 +259,8 @@ def create_app(): popper_version = '2.9.3' bootstrap_css_integrity = 'sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU' bootstrap_js_integrity = 'sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/' - popper_integrity = 'sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN' + popper_integrity = 'sha384-eMNCOe7tC1doHpGoWe/6oMVemdAVTMs2xqW4mwXrXsW0L84Iytr2wi5v2QjrP/xp' + popper_name = '@popperjs/core' static_folder = 'bootstrap5' diff --git a/tests/test_boostrap5/test_bootstrap5.py b/tests/test_boostrap5/test_bootstrap5.py index ac0862f5..520df939 100644 --- a/tests/test_boostrap5/test_bootstrap5.py +++ b/tests/test_boostrap5/test_bootstrap5.py @@ -33,7 +33,7 @@ def test_load_js_with_default_versions(self, bootstrap): 'crossorigin="anonymous">' jquery_js = f'' - popper_js = f'' assert bootstrap_js in rv assert jquery_js not in rv From b2d9bcaa14a5be8894475b072bd6ff7eda71c8ef Mon Sep 17 00:00:00 2001 From: Grey Li Date: Sun, 26 Sep 2021 17:36:43 +0800 Subject: [PATCH 18/22] Add Bootstrap 5 support for render_messages --- flask_bootstrap/templates/base/utils.html | 30 +++++++++++++++ .../templates/bootstrap4/utils.html | 31 +--------------- .../templates/bootstrap5/utils.html | 37 +------------------ 3 files changed, 33 insertions(+), 65 deletions(-) create mode 100644 flask_bootstrap/templates/base/utils.html diff --git a/flask_bootstrap/templates/base/utils.html b/flask_bootstrap/templates/base/utils.html new file mode 100644 index 00000000..bcc5491a --- /dev/null +++ b/flask_bootstrap/templates/base/utils.html @@ -0,0 +1,30 @@ +{% macro render_static(type, filename_or_url, local=True) %} + {% if local -%}{% set filename_or_url = url_for('static', filename=filename_or_url) %}{%- endif %} + {% if type == 'css' -%} + + {%- elif type == 'js' -%} + + {%- elif type == 'icon' -%} + + {%- endif %} +{% endmacro %} + + +{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR) %} +{% set bootstrap_colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'muted'] %} + + + +{% endmacro %} + + +{% macro arg_url_for(endpoint, base) %} + {# calls url_for() with a given endpoint and **base as the parameters, + additionally passing on all keyword_arguments (may overwrite existing ones) + #} + {%- with kargs = base.copy() -%} + {%- do kargs.update(kwargs) -%} + {{ url_for(endpoint, **kargs) }} + {%- endwith %} +{%- endmacro %} diff --git a/flask_bootstrap/templates/bootstrap4/utils.html b/flask_bootstrap/templates/bootstrap4/utils.html index 57f32961..54fc3116 100644 --- a/flask_bootstrap/templates/bootstrap4/utils.html +++ b/flask_bootstrap/templates/bootstrap4/utils.html @@ -1,13 +1,4 @@ -{% macro render_static(type, filename_or_url, local=True) %} - {% if local -%}{% set filename_or_url = url_for('static', filename=filename_or_url) %}{%- endif %} - {% if type == 'css' -%} - - {%- elif type == 'js' -%} - - {%- elif type == 'icon' -%} - - {%- endif %} -{% endmacro %} +{% extends 'base/utils.html' %} {# This macro was part of Flask-Bootstrap and was modified under the terms of its BSD License. Copyright (c) 2013, Marc Brinkmann. All rights reserved. #} @@ -48,26 +39,6 @@
{% endif -%} - {% endif -%} {% endwith -%} {% endmacro -%} - - -{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR) %} -{% set bootstrap_colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'muted'] %} - - - -{% endmacro %} - -{% macro arg_url_for(endpoint, base) %} - {# calls url_for() with a given endpoint and **base as the parameters, - additionally passing on all keyword_arguments (may overwrite existing ones) - #} - {%- with kargs = base.copy() -%} - {%- do kargs.update(kwargs) -%} - {{ url_for(endpoint, **kargs) }} - {%- endwith %} -{%- endmacro %} diff --git a/flask_bootstrap/templates/bootstrap5/utils.html b/flask_bootstrap/templates/bootstrap5/utils.html index 57f32961..98aab6bf 100644 --- a/flask_bootstrap/templates/bootstrap5/utils.html +++ b/flask_bootstrap/templates/bootstrap5/utils.html @@ -1,18 +1,4 @@ -{% macro render_static(type, filename_or_url, local=True) %} - {% if local -%}{% set filename_or_url = url_for('static', filename=filename_or_url) %}{%- endif %} - {% if type == 'css' -%} - - {%- elif type == 'js' -%} - - {%- elif type == 'icon' -%} - - {%- endif %} -{% endmacro %} - -{# This macro was part of Flask-Bootstrap and was modified under the terms of - its BSD License. Copyright (c) 2013, Marc Brinkmann. All rights reserved. #} - -{# versionadded: New in 1.2.0 #} +{% extends 'base/utils.html' %} {% macro render_messages(messages=None, container=False, transform={ 'critical': 'danger', @@ -37,7 +23,7 @@ {% for cat, msg in messages %} {%- endfor -%} @@ -52,22 +38,3 @@ {% endif -%} {% endwith -%} {% endmacro -%} - - -{% macro render_icon(name, size=config.BOOTSTRAP_ICON_SIZE, color=config.BOOTSTRAP_ICON_COLOR) %} -{% set bootstrap_colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'muted'] %} - - - -{% endmacro %} - -{% macro arg_url_for(endpoint, base) %} - {# calls url_for() with a given endpoint and **base as the parameters, - additionally passing on all keyword_arguments (may overwrite existing ones) - #} - {%- with kargs = base.copy() -%} - {%- do kargs.update(kwargs) -%} - {{ url_for(endpoint, **kargs) }} - {%- endwith %} -{%- endmacro %} From 17e4fbae33cee78f2524a093cd94c48e5a48e0bd Mon Sep 17 00:00:00 2001 From: Grey Li Date: Tue, 5 Oct 2021 22:34:02 +0800 Subject: [PATCH 19/22] Bump Popperjs version to 2.10.1 Fix for https://github.com/twbs/bootstrap/pull/35067 --- flask_bootstrap/__init__.py | 4 ++-- flask_bootstrap/static/bootstrap5/umd/popper.min.js | 9 +++++---- flask_bootstrap/static/bootstrap5/umd/popper.min.js.map | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/flask_bootstrap/__init__.py b/flask_bootstrap/__init__.py index e9f0d3f8..7ce70f86 100644 --- a/flask_bootstrap/__init__.py +++ b/flask_bootstrap/__init__.py @@ -256,10 +256,10 @@ def create_app(): .. versionadded:: 2.0.0 """ bootstrap_version = '5.1.1' - popper_version = '2.9.3' + popper_version = '2.10.1' bootstrap_css_integrity = 'sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU' bootstrap_js_integrity = 'sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/' - popper_integrity = 'sha384-eMNCOe7tC1doHpGoWe/6oMVemdAVTMs2xqW4mwXrXsW0L84Iytr2wi5v2QjrP/xp' + popper_integrity = 'sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN' popper_name = '@popperjs/core' static_folder = 'bootstrap5' diff --git a/flask_bootstrap/static/bootstrap5/umd/popper.min.js b/flask_bootstrap/static/bootstrap5/umd/popper.min.js index 4553f657..40ca56ba 100644 --- a/flask_bootstrap/static/bootstrap5/umd/popper.min.js +++ b/flask_bootstrap/static/bootstrap5/umd/popper.min.js @@ -1,5 +1,6 @@ -/* - Copyright (C) Federico Zivolo 2017 - Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). - */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=window.getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll)/.test(r+s+p)?e:n(o(e))}function r(e){var o=e&&e.offsetParent,i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===t(o,'position')?r(o):o:window.document.documentElement}function p(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||r(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function d(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,a=document.createRange();a.setStart(i,0),a.setEnd(n,0);var l=a.commonAncestorContainer;if(e!==l&&t!==l||i.contains(n))return p(l)?l:r(l);var f=s(e);return f.host?d(f.host,t):d(e,s(t).host)}function a(e){var t=1=o.clientWidth&&i>=o.clientHeight}),l=0i[e]&&!t.escapeWithReference&&(n=V(p[o],i[e]-('right'===e?p.width:p.height))),se({},o,n)}};return n.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';p=de({},p,s[t](e))}),e.offsets.popper=p,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=_,p=-1!==['top','bottom'].indexOf(n),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(i[s])&&(e.offsets.popper[d]=r(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){if(!F(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var n=e.placement.split('-')[0],r=e.offsets,p=r.popper,s=r.reference,d=-1!==['left','right'].indexOf(n),a=d?'height':'width',l=d?'Top':'Left',f=l.toLowerCase(),m=d?'left':'top',c=d?'bottom':'right',g=O(i)[a];s[c]-gp[c]&&(e.offsets.popper[f]+=s[f]+g-p[c]);var u=s[f]+s[a]/2-g/2,b=t(e.instance.popper,'margin'+l).replace('px',''),y=u-h(e.offsets.popper)[f]-b;return y=X(V(p[a]-g,y),0),e.arrowElement=i,e.offsets.arrow={},e.offsets.arrow[f]=Math.round(y),e.offsets.arrow[m]='',e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split('-')[0],n=L(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case fe.FLIP:p=[i,n];break;case fe.CLOCKWISE:p=K(i);break;case fe.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(i!==s||p.length===d+1)return e;i=e.placement.split('-')[0],n=L(i);var a=e.offsets.popper,l=e.offsets.reference,f=_,m='left'===i&&f(a.right)>f(l.left)||'right'===i&&f(a.left)f(l.top)||'bottom'===i&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===i&&c||'right'===i&&h||'top'===i&&g||'bottom'===i&&u,y=-1!==['top','bottom'].indexOf(i),w=!!t.flipVariations&&(y&&'start'===r&&c||y&&'end'===r&&h||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(i=p[d+1]),w&&(r=j(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=de({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement)),e=N(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return n[p?'left':'top']=r[o]-(s?n[p?'width':'height']:0),e.placement=L(t),e.offsets.popper=h(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!F(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-o)&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function h(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||f(e)}function m(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:o(e)&&l(e)?e:m(h(e))}function v(e,n){var o;void 0===n&&(n=[]);var r=m(e);return e=r===(null==(o=e.ownerDocument)?void 0:o.body),o=t(r),r=e?[o].concat(o.visualViewport||[],l(r)?r:[]):r,n=n.concat(r),e?n:n.concat(v(h(r)))}function g(e){return o(e)&&"fixed"!==c(e).position?e.offsetParent:null}function b(e){for(var n=t(e),r=g(e);r&&0<=["table","td","th"].indexOf(s(r))&&"static"===c(r).position;)r=g(r);if(r&&("html"===s(r)||"body"===s(r)&&"static"===c(r).position))return n;if(!r)e:{if(r=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!o(e)||"fixed"!==c(e).position)for(e=h(e);o(e)&&0>["html","body"].indexOf(s(e));){var i=c(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||r&&"filter"===i.willChange||r&&i.filter&&"none"!==i.filter){r=e;break e}e=e.parentNode}r=null}return r||n}function y(e){function t(e){o.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){o.has(e)||(e=n.get(e))&&t(e)})),r.push(e)}var n=new Map,o=new Set,r=[];return e.forEach((function(e){n.set(e.name,e)})),e.forEach((function(e){o.has(e.name)||t(e)})),r}function w(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function x(e){return e.split("-")[0]}function O(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&r(n))do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E(e,n){if("viewport"===n){n=t(e);var r=f(e);n=n.visualViewport;var s=r.clientWidth;r=r.clientHeight;var l=0,u=0;n&&(s=n.width,r=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=n.offsetLeft,u=n.offsetTop)),e=j(e={width:s,height:r,x:l+p(e),y:u})}else o(n)?((e=i(n)).top+=n.clientTop,e.left+=n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=a(u),n=null==(r=u.ownerDocument)?void 0:r.body,r=z(e.scrollWidth,e.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),l=z(e.scrollHeight,e.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),u=-s.scrollLeft+p(u),s=-s.scrollTop,"rtl"===c(n||e).direction&&(u+=z(e.clientWidth,n?n.clientWidth:0)-r),e=j({width:r,height:l,x:u,y:s}));return e}function D(e,t,r){return t="clippingParents"===t?function(e){var t=v(h(e)),r=0<=["absolute","fixed"].indexOf(c(e).position)&&o(e)?b(e):e;return n(r)?t.filter((function(e){return n(e)&&O(e,r)&&"body"!==s(e)})):[]}(e):[].concat(t),(r=(r=[].concat(t,[r])).reduce((function(t,n){return n=E(e,n),t.top=z(n.top,t.top),t.right=F(n.right,t.right),t.bottom=F(n.bottom,t.bottom),t.left=z(n.left,t.left),t}),E(e,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function L(e){return e.split("-")[1]}function M(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function P(e){var t=e.reference,n=e.element,o=(e=e.placement)?x(e):null;e=e?L(e):null;var r=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(o){case"top":r={x:r,y:t.y-n.height};break;case"bottom":r={x:r,y:t.y+t.height};break;case"right":r={x:t.x+t.width,y:i};break;case"left":r={x:t.x-n.width,y:i};break;default:r={x:t.x,y:t.y}}if(null!=(o=o?M(o):null))switch(i="y"===o?"height":"width",e){case"start":r[o]-=t[i]/2-n[i]/2;break;case"end":r[o]+=t[i]/2-n[i]/2}return r}function k(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function W(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function A(e,t){void 0===t&&(t={});var o=t;t=void 0===(t=o.placement)?e.placement:t;var r=o.boundary,a=void 0===r?"clippingParents":r,s=void 0===(r=o.rootBoundary)?"viewport":r;r=void 0===(r=o.elementContext)?"popper":r;var p=o.altBoundary,c=void 0!==p&&p;o=k("number"!=typeof(o=void 0===(o=o.padding)?0:o)?o:W(o,V)),p=e.rects.popper,a=D(n(c=e.elements[c?"popper"===r?"reference":"popper":r])?c:c.contextElement||f(e.elements.popper),a,s),c=P({reference:s=i(e.elements.reference),element:p,strategy:"absolute",placement:t}),p=j(Object.assign({},p,c)),s="popper"===r?p:s;var l={top:a.top-s.top+o.top,bottom:s.bottom-a.bottom+o.bottom,left:a.left-s.left+o.left,right:s.right-a.right+o.right};if(e=e.modifiersData.offset,"popper"===r&&e){var u=e[t];Object.keys(l).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";l[e]+=u[n]*t}))}return l}function B(){for(var e=arguments.length,t=Array(e),n=0;n=(y.devicePixelRatio||1)?"translate("+e+"px, "+d+"px)":"translate3d("+e+"px, "+d+"px, 0)",m)):Object.assign({},o,((n={})[g]=s?d+"px":"",n[v]=h?e+"px":"",n.transform="",n))}function R(e){return e.replace(/left|right|bottom|top/g,(function(e){return te[e]}))}function S(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function C(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function q(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var N=Math.round,V=["top","bottom","right","left"],I=V.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),_=[].concat(V,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),U="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),z=Math.max,F=Math.min,X=Math.round,Y={placement:"bottom",modifiers:[],strategy:"absolute"},G={passive:!0},J={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,o=e.instance,r=(e=e.options).scroll,i=void 0===r||r,a=void 0===(e=e.resize)||e,s=t(n.elements.popper),f=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",o.update,G)})),a&&s.addEventListener("resize",o.update,G),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",o.update,G)})),a&&s.removeEventListener("resize",o.update,G)}},data:{}},K={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=P({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Q={top:"auto",right:"auto",bottom:"auto",left:"auto"},Z={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var o=n.adaptive;o=void 0===o||o,n=void 0===(n=n.roundOffsets)||n,e={placement:x(t.placement),variation:L(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,T(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,T(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},$={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];o(i)&&s(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),o(r)&&s(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},ee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=void 0===(e=e.options.offset)?[0,0]:e,r=(e=_.reduce((function(e,n){var r=t.rects,i=x(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof o?o(Object.assign({},r,{placement:n})):o;return r=(r=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:r}:{x:r,y:s},e[n]=i,e}),{}))[t.placement],i=r.x;r=r.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=r),t.modifiersData[n]=e}},te={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"},oe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var o=n.mainAxis;o=void 0===o||o;var r=n.altAxis;r=void 0===r||r;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,l=void 0===c||c,u=n.allowedAutoPlacements;c=x(n=t.options.placement),i=i||(c!==n&&l?function(e){if("auto"===x(e))return[];var t=R(e);return[S(e),t,S(t)]}(n):[R(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===x(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,o=t.rootBoundary,r=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?_:a,f=L(t.placement);0===(i=(t=f?i?I:I.filter((function(e){return L(e)===f})):V).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var p=i.reduce((function(t,i){return t[i]=A(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[x(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var h=new Map;c=!0;for(var m=d[0],v=0;vi[O]&&(y=R(y)),O=R(y),w=[],o&&w.push(0>=j[b]),r&&w.push(0>=j[y],0>=j[O]),w.every((function(e){return e}))){m=g,c=!1;break}h.set(g,w)}if(c)for(o=function(e){var t=d.find((function(t){if(t=h.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return m=t,"break"},r=l?3:1;0 ({\n key,\n ...rects[key],\n area: getArea(rects[key]),\n }))\n .sort((a, b) => b.area - a.area);\n\n const filteredAreas = sortedAreas.filter(\n ({ width, height }) =>\n width >= popper.clientWidth && height >= popper.clientHeight\n );\n\n const computedPlacement = filteredAreas.length > 0\n ? filteredAreas[0].key\n : sortedAreas[0].key;\n\n const variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference) {\n const commonOffsetParent = findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n const styles = window.getComputedStyle(element);\n const x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n const y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n const result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x,\n };\n return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n const popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n const popperOffsets = {\n width: popperRect.width,\n height: popperRect.height,\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] =\n referenceOffsets[mainSide] +\n referenceOffsets[measurement] / 2 -\n popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] =\n referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] =\n referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(cur => cur[prop] === value);\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n const match = find(arr, obj => obj[prop] === value);\n return arr.indexOf(match);\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n const modifiersToRun = ends === undefined\n ? modifiers\n : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(modifier => {\n if (modifier.function) {\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n const fn = modifier.function || modifier.fn;\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n let data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {},\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(\n this.state,\n this.popper,\n this.reference\n );\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(\n this.options.placement,\n data.offsets.reference,\n this.popper,\n this.reference,\n this.options.modifiers.flip.boundariesElement,\n this.options.modifiers.flip.padding\n );\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(\n this.popper,\n data.offsets.reference,\n data.placement\n );\n data.offsets.popper.position = 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(\n ({ name, enabled }) => enabled && name === modifierName\n );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (let i = 0; i < prefixes.length - 1; i++) {\n const prefix = prefixes[i];\n const toCheck = prefix ? `${prefix}${upperProp}` : property;\n if (typeof window.document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.left = '';\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n","import getScrollParent from './getScrollParent';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n const isBody = scrollParent.nodeName === 'BODY';\n const target = isBody ? window : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(\n getScrollParent(target.parentNode),\n event,\n callback,\n scrollParents\n );\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n reference,\n options,\n state,\n updateBound\n) {\n // Resize event listener on window\n state.updateBound = updateBound;\n window.addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n const scrollElement = getScrollParent(reference);\n attachToScrollParents(\n scrollElement,\n 'scroll',\n state.updateBound,\n state.scrollParents\n );\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(\n this.reference,\n this.options,\n this.state,\n this.scheduleUpdate\n );\n }\n}\n","/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n window.removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(target => {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger onUpdate callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n if (this.state.eventsEnabled) {\n window.cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n Object.keys(styles).forEach(prop => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (\n ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n -1 &&\n isNumeric(styles[prop])\n ) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function(prop) {\n const value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n modifiers,\n requestingName,\n requestedName\n) {\n const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n const isRequired =\n !!requesting &&\n modifiers.some(modifier => {\n return (\n modifier.name === requestedName &&\n modifier.enabled &&\n modifier.order < requesting.order\n );\n });\n\n if (!isRequired) {\n const requesting = `\\`${requestingName}\\``;\n const requested = `\\`${requestedName}\\``;\n console.warn(\n `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n );\n }\n return isRequired;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n const index = validPlacements.indexOf(placement);\n const arr = validPlacements\n .slice(index + 1)\n .concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n const value = +split[1];\n const unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n let element;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n const rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n let size;\n if (unit === 'vh') {\n size = Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n );\n } else {\n size = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n );\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n offset,\n popperOffsets,\n referenceOffsets,\n basePlacement\n) {\n const offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n const divider = fragments.indexOf(\n find(fragments, frag => frag.search(/,|\\s/) !== -1)\n );\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn(\n 'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n );\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n const splitRegex = /\\s*,\\s*|\\s+/;\n let ops = divider !== -1\n ? [\n fragments\n .slice(0, divider)\n .concat([fragments[divider].split(splitRegex)[0]]),\n [fragments[divider].split(splitRegex)[1]].concat(\n fragments.slice(divider + 1)\n ),\n ]\n : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map((op, index) => {\n // Most of the units rely on the orientation of the popper\n const measurement = (index === 1 ? !useHeight : useHeight)\n ? 'height'\n : 'width';\n let mergeWithPrevious = false;\n return (\n op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce((a, b) => {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n );\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach((op, index) => {\n op.forEach((frag, index2) => {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n const { placement, offsets: { popper, reference } } = data;\n const basePlacement = placement.split('-')[0];\n\n let offsets;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n","import isNative from './isNative';\n\nconst isBrowser = typeof window !== 'undefined';\nconst longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\nlet timeoutDuration = 0;\nfor (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nexport function microtaskDebounce(fn) {\n let scheduled = false;\n let i = 0;\n const elem = document.createElement('span');\n\n // MutationObserver provides a mechanism for scheduling microtasks, which\n // are scheduled *before* the next task. This gives us a way to debounce\n // a function but ensure it's called *before* the next paint.\n const observer = new MutationObserver(() => {\n fn();\n scheduled = false;\n });\n\n observer.observe(elem, { attributes: true });\n\n return () => {\n if (!scheduled) {\n scheduled = true;\n elem.setAttribute('x-index', i);\n i = i + 1; // don't use compund (+=) because it doesn't get optimized in V8\n }\n };\n}\n\nexport function taskDebounce(fn) {\n let scheduled = false;\n return () => {\n if (!scheduled) {\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\n// It's common for MutationObserver polyfills to be seen in the wild, however\n// these rely on Mutation Events which only occur when an element is connected\n// to the DOM. The algorithm used in this module does not use a connected element,\n// and so we must ensure that a *native* MutationObserver is available.\nconst supportsNativeMutationObserver =\n isBrowser && isNative(window.MutationObserver);\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsNativeMutationObserver\n ? microtaskDebounce\n : taskDebounce);\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n let arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn(\n 'WARNING: `arrow.element` must be child of its popper element!'\n );\n return data;\n }\n }\n\n const placement = data.placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase();\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -=\n popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] +=\n reference[side] + arrowElementSize - popper[opSide];\n }\n\n // compute center of the popper\n const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n const popperMarginSide = getStyleComputedProperty(\n data.instance.popper,\n `margin${sideCapitalized}`\n ).replace('px', '');\n let sideValue =\n center - getClientRect(data.offsets.popper)[side] - popperMarginSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {};\n data.offsets.arrow[side] = Math.round(sideValue);\n data.offsets.arrow[altSide] = ''; // make sure to unset any eventual altSide value from the DOM node\n\n return data;\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n const { x, y } = options;\n const { popper } = data.offsets;\n\n // Remove this legacy support in Popper.js v2\n const legacyGpuAccelerationOption = find(\n data.instance.modifiers,\n modifier => modifier.name === 'applyStyle'\n ).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn(\n 'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n );\n }\n const gpuAcceleration =\n legacyGpuAccelerationOption !== undefined\n ? legacyGpuAccelerationOption\n : options.gpuAcceleration;\n\n const offsetParent = getOffsetParent(data.instance.popper);\n const offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n const styles = {\n position: popper.position,\n };\n\n // floor sides to avoid blurry text\n const offsets = {\n left: Math.floor(popper.left),\n top: Math.floor(popper.top),\n bottom: Math.floor(popper.bottom),\n right: Math.floor(popper.right),\n };\n\n const sideA = x === 'bottom' ? 'top' : 'bottom';\n const sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n const prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n let left, top;\n if (sideA === 'bottom') {\n top = -offsetParentRect.height + offsets.bottom;\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n left = -offsetParentRect.width + offsets.right;\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n const invertTop = sideA === 'bottom' ? -1 : 1;\n const invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = `${sideA}, ${sideB}`;\n }\n\n // Attributes\n const attributes = {\n 'x-placement': data.placement,\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = { ...attributes, ...data.attributes };\n data.styles = { ...styles, ...data.styles };\n data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n return data;\n}\n","const nativeHints = [\n 'native code',\n '[object MutationObserverConstructor]', // for mobile safari iOS 9.0\n];\n\n/**\n * Determine if a function is implemented natively (as opposed to a polyfill).\n * @method\n * @memberof Popper.Utils\n * @argument {Function | undefined} fn the function to check\n * @returns {Boolean}\n */\nexport default fn =>\n nativeHints.some(hint => (fn || '').toString().indexOf(hint) > -1);\n","/**\n * Tells if you are running Internet Explorer 10\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean} isIE10\n */\nlet isIE10 = undefined;\n\nexport default function() {\n if (isIE10 === undefined) {\n isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;\n }\n return isIE10;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n options.boundariesElement\n );\n\n let placement = data.placement.split('-')[0];\n let placementOpposite = getOppositePlacement(placement);\n let variation = data.placement.split('-')[1] || '';\n\n let flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n const popperOffsets = data.offsets.popper;\n const refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n const floor = Math.floor;\n const overlapsRef =\n (placement === 'left' &&\n floor(popperOffsets.right) > floor(refOffsets.left)) ||\n (placement === 'right' &&\n floor(popperOffsets.left) < floor(refOffsets.right)) ||\n (placement === 'top' &&\n floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n (placement === 'bottom' &&\n floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n const overflowsBottom =\n floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const flippedVariation =\n !!options.flipVariations &&\n ((isVertical && variation === 'start' && overflowsLeft) ||\n (isVertical && variation === 'end' && overflowsRight) ||\n (!isVertical && variation === 'start' && overflowsTop) ||\n (!isVertical && variation === 'end' && overflowsBottom));\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = {\n ...data.offsets.popper,\n ...getPopperOffsets(\n data.instance.popper,\n data.offsets.reference,\n data.placement\n ),\n };\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n","// Utils\nimport debounce from './utils/debounce';\nimport isFunction from './utils/isFunction';\n\n// Methods\nimport update from './methods/update';\nimport destroy from './methods/destroy';\nimport enableEventListeners from './methods/enableEventListeners';\nimport disableEventListeners from './methods/disableEventListeners';\nimport Defaults from './methods/defaults';\nimport placements from './methods/placements';\n\nexport default class Popper {\n /**\n * Create a new Popper.js instance\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n constructor(reference, popper, options = {}) {\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = { ...Popper.Defaults, ...options };\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: [],\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference.jquery ? reference[0] : reference;\n this.popper = popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys({\n ...Popper.Defaults.modifiers,\n ...options.modifiers,\n }).forEach(name => {\n this.options.modifiers[name] = {\n // If it's a built-in modifier, use it as base\n ...(Popper.Defaults.modifiers[name] || {}),\n // If there are custom options, override and merge with default ones\n ...(options.modifiers ? options.modifiers[name] : {}),\n };\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers)\n .map(name => ({\n name,\n ...this.options.modifiers[name],\n }))\n // sort the modifiers by order\n .sort((a, b) => a.order - b.order);\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(modifierOptions => {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(\n this.reference,\n this.popper,\n this.options,\n modifierOptions,\n this.state\n );\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n const eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n update() {\n return update.call(this);\n }\n destroy() {\n return destroy.call(this);\n }\n enableEventListeners() {\n return enableEventListeners.call(this);\n }\n disableEventListeners() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedule an update, it will run on the next UI update available\n * @method scheduleUpdate\n * @memberof Popper\n */\n scheduleUpdate = () => requestAnimationFrame(this.update);\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n static Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n\n static placements = placements;\n\n static Defaults = Defaults;\n}\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.
\n * These can be overriden using the `options` argument of Popper.js.
\n * To override an option, simply pass as 3rd argument an object with the same\n * structure of this object, example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n /**\n * Popper's placement\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Whether events (resize, scroll) are initially enabled\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: () => {},\n\n /**\n * Callback called when the popper is updated, this callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: () => {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js\n * @prop {modifiers}\n */\n modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift,\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unitless, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the height.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0,\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * An scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper this makes sure the popper has always a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier, can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent',\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near eachothers\n * without leaving any gap between the two. Expecially useful when the arrow is\n * enabled and you want to assure it to point to its reference element.\n * It cares only about the first axis, you can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether,\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjuction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]',\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations).\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position,\n * the popper will never be placed outside of the defined boundaries\n * (except if keepTogether is enabled)\n */\n boundariesElement: 'viewport',\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner,\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide,\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right',\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define you own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: undefined,\n },\n};\n\n/**\n * The `dataObject` is an object containing all the informations used by Popper.js\n * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements.\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n const { reference, popper } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: reference[side] },\n end: {\n [side]: reference[side] + reference[measurement] - popper[measurement],\n },\n };\n\n data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n }\n\n return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n let boundariesElement =\n options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n boundariesElement\n );\n options.boundaries = boundaries;\n\n const order = options.priority;\n let popper = data.offsets.popper;\n\n const check = {\n primary(placement) {\n let value = popper[placement];\n if (\n popper[placement] < boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return { [placement]: value };\n },\n secondary(placement) {\n const mainSide = placement === 'right' ? 'left' : 'top';\n let value = popper[mainSide];\n if (\n popper[placement] > boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.min(\n popper[mainSide],\n boundaries[placement] -\n (placement === 'right' ? popper.width : popper.height)\n );\n }\n return { [mainSide]: value };\n },\n };\n\n order.forEach(placement => {\n const side = ['left', 'top'].indexOf(placement) !== -1\n ? 'primary'\n : 'secondary';\n popper = { ...popper, ...check[side](placement) };\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n const { popper, reference } = data.offsets;\n const placement = data.placement.split('-')[0];\n const floor = Math.floor;\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const side = isVertical ? 'right' : 'bottom';\n const opSide = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] =\n floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] =\n reference[basePlacement] -\n (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n const refRect = data.offsets.reference;\n const bound = find(\n data.instance.modifiers,\n modifier => modifier.name === 'preventOverflow'\n ).boundaries;\n\n if (\n refRect.bottom < bound.top ||\n refRect.left > bound.right ||\n refRect.top > bound.bottom ||\n refRect.right < bound.left\n ) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n reference,\n popper,\n options,\n modifierOptions,\n state\n) {\n // compute reference element offsets\n const referenceOffsets = getReferenceOffsets(state, popper, reference);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n const placement = computeAutoPlacement(\n options.placement,\n referenceOffsets,\n popper,\n reference,\n options.modifiers.flip.boundariesElement,\n options.modifiers.flip.padding\n );\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: 'absolute' });\n\n return options;\n}\n"],"names":["functionToCheck","getType","toString","call","element","nodeType","css","window","getComputedStyle","property","nodeName","parentNode","host","indexOf","document","body","getStyleComputedProperty","overflow","overflowX","overflowY","test","getScrollParent","getParentNode","offsetParent","getOffsetParent","documentElement","firstElementChild","node","getRoot","element1","element2","order","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","start","end","range","createRange","setStart","setEnd","commonAncestorContainer","contains","isOffsetContainer","element1root","findCommonOffsetParent","side","upperSide","html","scrollingElement","subtract","scrollTop","getScroll","scrollLeft","modifier","top","bottom","left","right","sideA","axis","sideB","styles","split","Math","isIE10","computedStyle","getSize","offsets","width","height","rect","getBoundingClientRect","result","sizes","getWindowSizes","clientWidth","clientHeight","horizScrollbar","offsetWidth","vertScrollbar","offsetHeight","getBordersSize","getClientRect","runIsIE10","isHTML","parent","childrenRect","parentRect","scrollParent","borderTopWidth","borderLeftWidth","marginTop","marginLeft","includeScroll","relativeOffset","getOffsetRectRelativeToArbitraryNode","innerWidth","innerHeight","offset","isFixed","boundaries","boundariesElement","getViewportOffsetRectRelativeToArtbitraryNode","boundariesNode","padding","placement","getBoundaries","rects","refRect","sortedAreas","Object","keys","map","getArea","sort","b","area","a","filteredAreas","filter","popper","computedPlacement","length","key","variation","commonOffsetParent","x","parseFloat","marginBottom","y","marginRight","hash","replace","popperRect","getOuterSizes","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","referenceOffsets","getOppositePlacement","Array","prototype","find","arr","findIndex","cur","match","obj","modifiersToRun","ends","modifiers","slice","forEach","function","warn","fn","enabled","isFunction","data","reference","state","isDestroyed","getReferenceOffsets","computeAutoPlacement","options","flip","originalPlacement","getPopperOffsets","position","runModifiers","isCreated","onUpdate","onCreate","some","name","prefixes","upperProp","charAt","toUpperCase","i","prefix","toCheck","style","isModifierEnabled","removeAttribute","getSupportedPropertyName","disableEventListeners","removeOnDestroy","removeChild","isBody","target","addEventListener","passive","push","updateBound","scrollElement","scrollParents","eventsEnabled","setupEventListeners","scheduleUpdate","removeEventListener","cancelAnimationFrame","removeEventListeners","n","isNaN","isFinite","unit","isNumeric","value","attributes","setAttribute","requesting","isRequired","requested","counter","index","validPlacements","concat","reverse","str","size","useHeight","fragments","frag","trim","divider","search","splitRegex","ops","mergeWithPrevious","op","reduce","toValue","index2","basePlacement","parseOffset","min","floor","max","nativeHints","isBrowser","longerTimeoutBrowsers","timeoutDuration","navigator","userAgent","supportsNativeMutationObserver","isNative","MutationObserver","scheduled","elem","createElement","observer","observe","appVersion","placements","BEHAVIORS","Popper","requestAnimationFrame","update","debounce","bind","Defaults","jquery","modifierOptions","onLoad","enableEventListeners","destroy","Utils","global","PopperUtils","shiftvariation","isVertical","shiftOffsets","instance","priority","check","escapeWithReference","opSide","isModifierRequired","arrowElement","querySelector","len","sideCapitalized","toLowerCase","altSide","arrowElementSize","center","popperMarginSide","sideValue","arrow","round","flipped","placementOpposite","flipOrder","behavior","FLIP","CLOCKWISE","clockwise","COUNTERCLOCKWISE","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariation","flipVariations","getOppositeVariation","subtractLength","bound","hide","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","prefixedProperty","willChange","invertTop","invertLeft","arrowStyles"],"mappings":";;;sLAOA,aAAoD,OAGhDA,IAC2C,mBAA3CC,MAAQC,QAARD,CAAiBE,IAAjBF,ICJJ,eAAoE,IACzC,CAArBG,KAAQC,qBAINC,GAAMC,OAAOC,gBAAPD,GAAiC,IAAjCA,QACLE,GAAWH,IAAXG,GCNT,aAA+C,OACpB,MAArBL,KAAQM,QADiC,GAItCN,EAAQO,UAARP,EAAsBA,EAAQQ,KCDvC,aAAiD,IAG7C,IAC4D,CAAC,CAA7D,+BAA8BC,OAA9B,CAAsCT,EAAQM,QAA9C,QAEOH,QAAOO,QAAPP,CAAgBQ,WAIkBC,KAAnCC,IAAAA,SAAUC,IAAAA,UAAWC,IAAAA,UAVkB,MAW3C,iBAAgBC,IAAhB,CAAqBH,KAArB,CAX2C,GAexCI,EAAgBC,IAAhBD,ECjBT,aAAiD,IAEzCE,GAAenB,GAAWA,EAAQmB,aAClCb,EAAWa,GAAgBA,EAAab,SAHC,MAK3C,IAA0B,MAAbA,IAAb,EAAiD,MAAbA,IALO,CAYM,CAAC,CAApD,kBAAgBG,OAAhB,CAAwBU,EAAab,QAArC,GACuD,QAAvDM,OAAuC,UAAvCA,CAb6C,CAetCQ,IAfsC,GAMtCjB,OAAOO,QAAPP,CAAgBkB,6BCZwB,IACzCf,GAAaN,EAAbM,SADyC,MAEhC,MAAbA,IAF6C,GAMlC,MAAbA,MAAuBc,EAAgBpB,EAAQsB,iBAAxBF,KANwB,ECKnD,aAAsC,OACZ,KAApBG,KAAKhB,UAD2B,GAE3BiB,EAAQD,EAAKhB,UAAbiB,ECGX,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AKmH,QAALnH,CAAczC,OAAQyC,EAAKmD,YAGrCnD,EAAKyH,YAALzH,EAAqBnD,OAAOC,IAAPD,CAAYmD,EAAKiK,WAAjBpN,EAA8BY,UAC3CuC,EAAKyH,aAAczH,EAAKiK,eNiSxB,QMjRd,mBAME,IAEMrL,GAAmBwB,SAKnB5D,EAAY6D,EAChBC,EAAQ9D,SADQ6D,OAKhBC,EAAQd,SAARc,CAAkBC,IAAlBD,CAAuBlE,iBALPiE,CAMhBC,EAAQd,SAARc,CAAkBC,IAAlBD,CAAuB/D,OANP8D,WASX+C,aAAa,qBAIF,CAAE1C,SAAU,UAAZ,KNuPN,uBAAA,CA5RC,CDdA"} \ No newline at end of file +{"version":3,"file":"popper.min.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/getNodeName.js","../../src/dom-utils/getDocumentElement.js","../../src/dom-utils/getWindowScrollBarX.js","../../src/dom-utils/getComputedStyle.js","../../src/dom-utils/isScrollParent.js","../../src/dom-utils/getCompositeRect.js","../../src/dom-utils/getNodeScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/getOffsetParent.js","../../src/dom-utils/isTableElement.js","../../src/utils/orderModifiers.js","../../src/utils/debounce.js","../../src/utils/getBasePlacement.js","../../src/dom-utils/contains.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/enums.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js","../../src/utils/computeOffsets.js","../../src/utils/mergePaddingObject.js","../../src/utils/getFreshSideObject.js","../../src/utils/expandToHashMap.js","../../src/utils/detectOverflow.js","../../src/createPopper.js","../../src/utils/mergeByName.js","../../src/modifiers/computeStyles.js","../../src/utils/getOppositePlacement.js","../../src/utils/getOppositeVariationPlacement.js","../../src/modifiers/hide.js","../../src/utils/math.js","../../src/modifiers/eventListeners.js","../../src/modifiers/popperOffsets.js","../../src/modifiers/applyStyles.js","../../src/modifiers/offset.js","../../src/modifiers/flip.js","../../src/utils/computeAutoPlacement.js","../../src/modifiers/preventOverflow.js","../../src/utils/getAltAxis.js","../../src/utils/within.js","../../src/modifiers/arrow.js","../../src/popper-lite.js","../../src/popper.js"],"sourcesContent":["// @flow\nimport type { Window } from '../types';\ndeclare function getWindow(node: Node | Window): Window;\n\nexport default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n const ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}\n","// @flow\nimport getWindow from './getWindow';\n\ndeclare function isElement(node: mixed): boolean %checks(node instanceof\n Element);\nfunction isElement(node) {\n const OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\ndeclare function isHTMLElement(node: mixed): boolean %checks(node instanceof\n HTMLElement);\nfunction isHTMLElement(node) {\n const OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\ndeclare function isShadowRoot(node: mixed): boolean %checks(node instanceof\n ShadowRoot);\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };\n","// @flow\nimport type { ClientRectObject, VirtualElement } from '../types';\nimport { isHTMLElement } from './instanceOf';\n\nconst round = Math.round;\n\nexport default function getBoundingClientRect(\n element: Element | VirtualElement,\n includeScale: boolean = false\n): ClientRectObject {\n const rect = element.getBoundingClientRect();\n let scaleX = 1;\n let scaleY = 1;\n\n if (isHTMLElement(element) && includeScale) {\n const offsetHeight = element.offsetHeight;\n const offsetWidth = element.offsetWidth;\n\n // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n if (offsetWidth > 0) {\n scaleX = rect.width / offsetWidth || 1;\n }\n if (offsetHeight > 0) {\n scaleY = rect.height / offsetHeight || 1;\n }\n }\n\n return {\n width: round(rect.width / scaleX),\n height: round(rect.height / scaleY),\n top: round(rect.top / scaleY),\n right: round(rect.right / scaleX),\n bottom: round(rect.bottom / scaleY),\n left: round(rect.left / scaleX),\n x: round(rect.left / scaleX),\n y: round(rect.top / scaleY),\n };\n}\n","// @flow\nimport getWindow from './getWindow';\nimport type { Window } from '../types';\n\nexport default function getWindowScroll(node: Node | Window) {\n const win = getWindow(node);\n const scrollLeft = win.pageXOffset;\n const scrollTop = win.pageYOffset;\n\n return {\n scrollLeft,\n scrollTop,\n };\n}\n","// @flow\nimport type { Window } from '../types';\n\nexport default function getNodeName(element: ?Node | Window): ?string {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}\n","// @flow\nimport { isElement } from './instanceOf';\nimport type { Window } from '../types';\n\nexport default function getDocumentElement(\n element: Element | Window\n): HTMLElement {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return (\n (isElement(element)\n ? element.ownerDocument\n : // $FlowFixMe[prop-missing]\n element.document) || window.document\n ).documentElement;\n}\n","// @flow\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScroll from './getWindowScroll';\n\nexport default function getWindowScrollBarX(element: Element): number {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return (\n getBoundingClientRect(getDocumentElement(element)).left +\n getWindowScroll(element).scrollLeft\n );\n}\n","// @flow\nimport getWindow from './getWindow';\n\nexport default function getComputedStyle(\n element: Element\n): CSSStyleDeclaration {\n return getWindow(element).getComputedStyle(element);\n}\n","// @flow\nimport getComputedStyle from './getComputedStyle';\n\nexport default function isScrollParent(element: HTMLElement): boolean {\n // Firefox wants us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n","// @flow\nimport type { Rect, VirtualElement, Window } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getNodeScroll from './getNodeScroll';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getDocumentElement from './getDocumentElement';\nimport isScrollParent from './isScrollParent';\n\nfunction isElementScaled(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const scaleX = rect.width / element.offsetWidth || 1;\n const scaleY = rect.height / element.offsetHeight || 1;\n\n return scaleX !== 1 || scaleY !== 1;\n}\n\n// Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\nexport default function getCompositeRect(\n elementOrVirtualElement: Element | VirtualElement,\n offsetParent: Element | Window,\n isFixed: boolean = false\n): Rect {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const offsetParentIsScaled =\n isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(\n elementOrVirtualElement,\n offsetParentIsScaled\n );\n\n let scroll = { scrollLeft: 0, scrollTop: 0 };\n let offsets = { x: 0, y: 0 };\n\n if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {\n if (\n getNodeName(offsetParent) !== 'body' ||\n // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)\n ) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height,\n };\n}\n","// @flow\nimport getWindowScroll from './getWindowScroll';\nimport getWindow from './getWindow';\nimport { isHTMLElement } from './instanceOf';\nimport getHTMLElementScroll from './getHTMLElementScroll';\nimport type { Window } from '../types';\n\nexport default function getNodeScroll(node: Node | Window) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n","// @flow\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\n\n// Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\nexport default function getLayoutRect(element: HTMLElement): Rect {\n const clientRect = getBoundingClientRect(element);\n\n // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width,\n height,\n };\n}\n","// @flow\nimport getNodeName from './getNodeName';\nimport getDocumentElement from './getDocumentElement';\nimport { isShadowRoot } from './instanceOf';\n\nexport default function getParentNode(element: Node | ShadowRoot): Node {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (\n // this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || // DOM Element detected\n (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n );\n}\n","// @flow\nimport getParentNode from './getParentNode';\nimport isScrollParent from './isScrollParent';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\n\nexport default function getScrollParent(node: Node): HTMLElement {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}\n","// @flow\nimport getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getWindow from './getWindow';\nimport type { Window, VisualViewport } from '../types';\nimport isScrollParent from './isScrollParent';\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\nexport default function listScrollParents(\n element: Node,\n list: Array = []\n): Array {\n const scrollParent = getScrollParent(element);\n const isBody = scrollParent === element.ownerDocument?.body;\n const win = getWindow(scrollParent);\n const target = isBody\n ? [win].concat(\n win.visualViewport || [],\n isScrollParent(scrollParent) ? scrollParent : []\n )\n : scrollParent;\n const updatedList = list.concat(target);\n\n return isBody\n ? updatedList\n : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement } from './instanceOf';\nimport isTableElement from './isTableElement';\nimport getParentNode from './getParentNode';\n\nfunction getTrueOffsetParent(element: Element): ?Element {\n if (\n !isHTMLElement(element) ||\n // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed'\n ) {\n return null;\n }\n\n return element.offsetParent;\n}\n\n// `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\nfunction getContainingBlock(element: Element) {\n const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n const isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n const elementCss = getComputedStyle(element);\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n let currentNode = getParentNode(element);\n\n while (\n isHTMLElement(currentNode) &&\n ['html', 'body'].indexOf(getNodeName(currentNode)) < 0\n ) {\n const css = getComputedStyle(currentNode);\n\n // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n if (\n css.transform !== 'none' ||\n css.perspective !== 'none' ||\n css.contain === 'paint' ||\n ['transform', 'perspective'].indexOf(css.willChange) !== -1 ||\n (isFirefox && css.willChange === 'filter') ||\n (isFirefox && css.filter && css.filter !== 'none')\n ) {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nexport default function getOffsetParent(element: Element) {\n const window = getWindow(element);\n\n let offsetParent = getTrueOffsetParent(element);\n\n while (\n offsetParent &&\n isTableElement(offsetParent) &&\n getComputedStyle(offsetParent).position === 'static'\n ) {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (\n offsetParent &&\n (getNodeName(offsetParent) === 'html' ||\n (getNodeName(offsetParent) === 'body' &&\n getComputedStyle(offsetParent).position === 'static'))\n ) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n","// @flow\nimport getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport type { Modifier } from '../types';\nimport { modifierPhases } from '../enums';\n\n// source: https://stackoverflow.com/questions/49875255\nfunction order(modifiers) {\n const map = new Map();\n const visited = new Set();\n const result = [];\n\n modifiers.forEach(modifier => {\n map.set(modifier.name, modifier);\n });\n\n // On visiting object, check for its dependencies and visit them recursively\n function sort(modifier: Modifier) {\n visited.add(modifier.name);\n\n const requires = [\n ...(modifier.requires || []),\n ...(modifier.requiresIfExists || []),\n ];\n\n requires.forEach(dep => {\n if (!visited.has(dep)) {\n const depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n\n result.push(modifier);\n }\n\n modifiers.forEach(modifier => {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n\n return result;\n}\n\nexport default function orderModifiers(\n modifiers: Array>\n): Array> {\n // order based on dependencies\n const orderedModifiers = order(modifiers);\n\n // order based on phase\n return modifierPhases.reduce((acc, phase) => {\n return acc.concat(\n orderedModifiers.filter(modifier => modifier.phase === phase)\n );\n }, []);\n}\n","// @flow\n\nexport default function debounce(fn: Function): () => Promise {\n let pending;\n return () => {\n if (!pending) {\n pending = new Promise(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n","// @flow\nimport { type BasePlacement, type Placement, auto } from '../enums';\n\nexport default function getBasePlacement(\n placement: Placement | typeof auto\n): BasePlacement {\n return (placement.split('-')[0]: any);\n}\n","// @flow\nimport { isShadowRoot } from './instanceOf';\n\nexport default function contains(parent: Element, child: Element) {\n const rootNode = child.getRootNode && child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n }\n // $FlowFixMe[prop-missing]: need a better way to handle this...\n next = next.parentNode || next.host;\n } while (next);\n }\n\n // Give up, the result is false\n return false;\n}\n","// @flow\nimport type { Rect, ClientRectObject } from '../types';\n\nexport default function rectToClientRect(rect: Rect): ClientRectObject {\n return {\n ...rect,\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height,\n };\n}\n","// @flow\nimport type { ClientRectObject } from '../types';\nimport type { Boundary, RootBoundary } from '../enums';\nimport { viewport } from '../enums';\nimport getViewportRect from './getViewportRect';\nimport getDocumentRect from './getDocumentRect';\nimport listScrollParents from './listScrollParents';\nimport getOffsetParent from './getOffsetParent';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport { isElement, isHTMLElement } from './instanceOf';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getParentNode from './getParentNode';\nimport contains from './contains';\nimport getNodeName from './getNodeName';\nimport rectToClientRect from '../utils/rectToClientRect';\nimport { max, min } from '../utils/math';\n\nfunction getInnerBoundingClientRect(element: Element) {\n const rect = getBoundingClientRect(element);\n\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n\n return rect;\n}\n\nfunction getClientRectFromMixedType(\n element: Element,\n clippingParent: Element | RootBoundary\n): ClientRectObject {\n return clippingParent === viewport\n ? rectToClientRect(getViewportRect(element))\n : isHTMLElement(clippingParent)\n ? getInnerBoundingClientRect(clippingParent)\n : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n}\n\n// A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\nfunction getClippingParents(element: Element): Array {\n const clippingParents = listScrollParents(getParentNode(element));\n const canEscapeClipping =\n ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n const clipperElement =\n canEscapeClipping && isHTMLElement(element)\n ? getOffsetParent(element)\n : element;\n\n if (!isElement(clipperElement)) {\n return [];\n }\n\n // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n return clippingParents.filter(\n (clippingParent) =>\n isElement(clippingParent) &&\n contains(clippingParent, clipperElement) &&\n getNodeName(clippingParent) !== 'body'\n );\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping parents\nexport default function getClippingRect(\n element: Element,\n boundary: Boundary,\n rootBoundary: RootBoundary\n): ClientRectObject {\n const mainClippingParents =\n boundary === 'clippingParents'\n ? getClippingParents(element)\n : [].concat(boundary);\n const clippingParents = [...mainClippingParents, rootBoundary];\n const firstClippingParent = clippingParents[0];\n\n const clippingRect = clippingParents.reduce((accRect, clippingParent) => {\n const rect = getClientRectFromMixedType(element, clippingParent);\n\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n\n return clippingRect;\n}\n","// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary =\n | HTMLElement\n | Array\n | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array = basePlacements.reduce(\n (acc: Array, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array = [...basePlacements, auto].reduce(\n (\n acc: Array,\n placement: BasePlacement | typeof auto\n ): Array =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n","// @flow\nimport getWindow from './getWindow';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScrollBarX from './getWindowScrollBarX';\n\nexport default function getViewportRect(element: Element) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n\n // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n\n // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width,\n height,\n x: x + getWindowScrollBarX(element),\n y,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getWindowScroll from './getWindowScroll';\nimport { max } from '../utils/math';\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\nexport default function getDocumentRect(element: HTMLElement): Rect {\n const html = getDocumentElement(element);\n const winScroll = getWindowScroll(element);\n const body = element.ownerDocument?.body;\n\n const width = max(\n html.scrollWidth,\n html.clientWidth,\n body ? body.scrollWidth : 0,\n body ? body.clientWidth : 0\n );\n const height = max(\n html.scrollHeight,\n html.clientHeight,\n body ? body.scrollHeight : 0,\n body ? body.clientHeight : 0\n );\n\n let x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n const y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return { width, height, x, y };\n}\n","// @flow\nimport { type Variation, type Placement } from '../enums';\n\nexport default function getVariation(placement: Placement): ?Variation {\n return (placement.split('-')[1]: any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nexport default function getMainAxisFromPlacement(\n placement: Placement\n): 'x' | 'y' {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n","// @flow\nimport getBasePlacement from './getBasePlacement';\nimport getVariation from './getVariation';\nimport getMainAxisFromPlacement from './getMainAxisFromPlacement';\nimport type {\n Rect,\n PositioningStrategy,\n Offsets,\n ClientRectObject,\n} from '../types';\nimport { top, right, bottom, left, start, end, type Placement } from '../enums';\n\nexport default function computeOffsets({\n reference,\n element,\n placement,\n}: {\n reference: Rect | ClientRectObject,\n element: Rect | ClientRectObject,\n strategy: PositioningStrategy,\n placement?: Placement,\n}): Offsets {\n const basePlacement = placement ? getBasePlacement(placement) : null;\n const variation = placement ? getVariation(placement) : null;\n const commonX = reference.x + reference.width / 2 - element.width / 2;\n const commonY = reference.y + reference.height / 2 - element.height / 2;\n\n let offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height,\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height,\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY,\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY,\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y,\n };\n }\n\n const mainAxis = basePlacement\n ? getMainAxisFromPlacement(basePlacement)\n : null;\n\n if (mainAxis != null) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] =\n offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] =\n offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n\n return offsets;\n}\n","// @flow\nimport type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\n };\n}\n","// @flow\nimport type { SideObject } from '../types';\n\nexport default function getFreshSideObject(): SideObject {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n };\n}\n","// @flow\n\nexport default function expandToHashMap<\n T: number | string | boolean,\n K: string\n>(value: T, keys: Array): { [key: string]: T } {\n return keys.reduce((hashMap, key) => {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}\n","// @flow\nimport type { State, SideObject, Padding } from '../types';\nimport type { Placement, Boundary, RootBoundary, Context } from '../enums';\nimport getClippingRect from '../dom-utils/getClippingRect';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getBoundingClientRect from '../dom-utils/getBoundingClientRect';\nimport computeOffsets from './computeOffsets';\nimport rectToClientRect from './rectToClientRect';\nimport {\n clippingParents,\n reference,\n popper,\n bottom,\n top,\n right,\n basePlacements,\n viewport,\n} from '../enums';\nimport { isElement } from '../dom-utils/instanceOf';\nimport mergePaddingObject from './mergePaddingObject';\nimport expandToHashMap from './expandToHashMap';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n placement: Placement,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n elementContext: Context,\n altBoundary: boolean,\n padding: Padding,\n};\n\nexport default function detectOverflow(\n state: State,\n options: $Shape = {}\n): SideObject {\n const {\n placement = state.placement,\n boundary = clippingParents,\n rootBoundary = viewport,\n elementContext = popper,\n altBoundary = false,\n padding = 0,\n } = options;\n\n const paddingObject = mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n\n const altContext = elementContext === popper ? reference : popper;\n\n const popperRect = state.rects.popper;\n const element = state.elements[altBoundary ? altContext : elementContext];\n\n const clippingClientRect = getClippingRect(\n isElement(element)\n ? element\n : element.contextElement || getDocumentElement(state.elements.popper),\n boundary,\n rootBoundary\n );\n\n const referenceClientRect = getBoundingClientRect(state.elements.reference);\n\n const popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement,\n });\n\n const popperClientRect = rectToClientRect({\n ...popperRect,\n ...popperOffsets,\n });\n\n const elementClientRect =\n elementContext === popper ? popperClientRect : referenceClientRect;\n\n // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n const overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom:\n elementClientRect.bottom -\n clippingClientRect.bottom +\n paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right:\n elementClientRect.right - clippingClientRect.right + paddingObject.right,\n };\n\n const offsetData = state.modifiersData.offset;\n\n // Offsets can be applied only to the popper element\n if (elementContext === popper && offsetData) {\n const offset = offsetData[placement];\n\n Object.keys(overflowOffsets).forEach((key) => {\n const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n const axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}\n","// @flow\nimport type {\n State,\n OptionsGeneric,\n Modifier,\n Instance,\n VirtualElement,\n} from './types';\nimport getCompositeRect from './dom-utils/getCompositeRect';\nimport getLayoutRect from './dom-utils/getLayoutRect';\nimport listScrollParents from './dom-utils/listScrollParents';\nimport getOffsetParent from './dom-utils/getOffsetParent';\nimport getComputedStyle from './dom-utils/getComputedStyle';\nimport orderModifiers from './utils/orderModifiers';\nimport debounce from './utils/debounce';\nimport validateModifiers from './utils/validateModifiers';\nimport uniqueBy from './utils/uniqueBy';\nimport getBasePlacement from './utils/getBasePlacement';\nimport mergeByName from './utils/mergeByName';\nimport detectOverflow from './utils/detectOverflow';\nimport { isElement } from './dom-utils/instanceOf';\nimport { auto } from './enums';\n\nconst INVALID_ELEMENT_ERROR =\n 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nconst INFINITE_LOOP_ERROR =\n 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\n\nconst DEFAULT_OPTIONS: OptionsGeneric = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute',\n};\n\ntype PopperGeneratorArgs = {\n defaultModifiers?: Array>,\n defaultOptions?: $Shape>,\n};\n\nfunction areValidElements(...args: Array): boolean {\n return !args.some(\n (element) =>\n !(element && typeof element.getBoundingClientRect === 'function')\n );\n}\n\nexport function popperGenerator(generatorOptions: PopperGeneratorArgs = {}) {\n const {\n defaultModifiers = [],\n defaultOptions = DEFAULT_OPTIONS,\n } = generatorOptions;\n\n return function createPopper>>(\n reference: Element | VirtualElement,\n popper: HTMLElement,\n options: $Shape> = defaultOptions\n ): Instance {\n let state: $Shape = {\n placement: 'bottom',\n orderedModifiers: [],\n options: { ...DEFAULT_OPTIONS, ...defaultOptions },\n modifiersData: {},\n elements: {\n reference,\n popper,\n },\n attributes: {},\n styles: {},\n };\n\n let effectCleanupFns: Array<() => void> = [];\n let isDestroyed = false;\n\n const instance = {\n state,\n setOptions(setOptionsAction) {\n const options =\n typeof setOptionsAction === 'function'\n ? setOptionsAction(state.options)\n : setOptionsAction;\n\n cleanupModifierEffects();\n\n state.options = {\n // $FlowFixMe[exponential-spread]\n ...defaultOptions,\n ...state.options,\n ...options,\n };\n\n state.scrollParents = {\n reference: isElement(reference)\n ? listScrollParents(reference)\n : reference.contextElement\n ? listScrollParents(reference.contextElement)\n : [],\n popper: listScrollParents(popper),\n };\n\n // Orders the modifiers based on their dependencies and `phase`\n // properties\n const orderedModifiers = orderModifiers(\n mergeByName([...defaultModifiers, ...state.options.modifiers])\n );\n\n // Strip out disabled modifiers\n state.orderedModifiers = orderedModifiers.filter((m) => m.enabled);\n\n // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n if (__DEV__) {\n const modifiers = uniqueBy(\n [...orderedModifiers, ...state.options.modifiers],\n ({ name }) => name\n );\n\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n const flipModifier = state.orderedModifiers.find(\n ({ name }) => name === 'flip'\n );\n\n if (!flipModifier) {\n console.error(\n [\n 'Popper: \"auto\" placements require the \"flip\" modifier be',\n 'present and enabled to work.',\n ].join(' ')\n );\n }\n }\n\n const {\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n } = getComputedStyle(popper);\n\n // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n if (\n [marginTop, marginRight, marginBottom, marginLeft].some((margin) =>\n parseFloat(margin)\n )\n ) {\n console.warn(\n [\n 'Popper: CSS \"margin\" styles cannot be used to apply padding',\n 'between the popper and its reference element or boundary.',\n 'To replicate margin, use the `offset` modifier, as well as',\n 'the `padding` option in the `preventOverflow` and `flip`',\n 'modifiers.',\n ].join(' ')\n );\n }\n }\n\n runModifierEffects();\n\n return instance.update();\n },\n\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n const { reference, popper } = state.elements;\n\n // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n if (!areValidElements(reference, popper)) {\n if (__DEV__) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return;\n }\n\n // Store the reference and popper rects to be read by modifiers\n state.rects = {\n reference: getCompositeRect(\n reference,\n getOffsetParent(popper),\n state.options.strategy === 'fixed'\n ),\n popper: getLayoutRect(popper),\n };\n\n // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n state.reset = false;\n\n state.placement = state.options.placement;\n\n // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n state.orderedModifiers.forEach(\n (modifier) =>\n (state.modifiersData[modifier.name] = {\n ...modifier.data,\n })\n );\n\n let __debug_loops__ = 0;\n for (let index = 0; index < state.orderedModifiers.length; index++) {\n if (__DEV__) {\n __debug_loops__ += 1;\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n const { fn, options = {}, name } = state.orderedModifiers[index];\n\n if (typeof fn === 'function') {\n state = fn({ state, options, name, instance }) || state;\n }\n }\n },\n\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce<$Shape>(\n () =>\n new Promise<$Shape>((resolve) => {\n instance.forceUpdate();\n resolve(state);\n })\n ),\n\n destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n },\n };\n\n if (!areValidElements(reference, popper)) {\n if (__DEV__) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return instance;\n }\n\n instance.setOptions(options).then((state) => {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n });\n\n // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n function runModifierEffects() {\n state.orderedModifiers.forEach(({ name, options = {}, effect }) => {\n if (typeof effect === 'function') {\n const cleanupFn = effect({ state, name, instance, options });\n const noopFn = () => {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach((fn) => fn());\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\n\nexport const createPopper = popperGenerator();\n\n// eslint-disable-next-line import/no-unused-modules\nexport { detectOverflow };\n","// @flow\nimport type { Modifier } from '../types';\n\nexport default function mergeByName(\n modifiers: Array<$Shape>>\n): Array<$Shape>> {\n const merged = modifiers.reduce((merged, current) => {\n const existing = merged[current.name];\n merged[current.name] = existing\n ? {\n ...existing,\n ...current,\n options: { ...existing.options, ...current.options },\n data: { ...existing.data, ...current.data },\n }\n : current;\n return merged;\n }, {});\n\n // IE11 does not support Object.values\n return Object.keys(merged).map(key => merged[key]);\n}\n","// @flow\nimport type {\n PositioningStrategy,\n Offsets,\n Modifier,\n ModifierArguments,\n Rect,\n Window,\n} from '../types';\nimport {\n type BasePlacement,\n type Variation,\n top,\n left,\n right,\n bottom,\n end,\n} from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getVariation from '../utils/getVariation';\nimport { round } from '../utils/math';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type RoundOffsets = (\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>\n) => Offsets;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets?: boolean | RoundOffsets,\n};\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\nfunction roundOffsetsByDPR({ x, y }): Offsets {\n const win: Window = window;\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: round(round(x * dpr) / dpr) || 0,\n y: round(round(y * dpr) / dpr) || 0,\n };\n}\n\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n variation,\n offsets,\n position,\n gpuAcceleration,\n adaptive,\n roundOffsets,\n}: {\n popper: HTMLElement,\n popperRect: Rect,\n placement: BasePlacement,\n variation: ?Variation,\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>,\n position: PositioningStrategy,\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets: boolean | RoundOffsets,\n}) {\n let { x = 0, y = 0 } =\n roundOffsets === true\n ? roundOffsetsByDPR(offsets)\n : typeof roundOffsets === 'function'\n ? roundOffsets(offsets)\n : offsets;\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n let heightProp = 'clientHeight';\n let widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (\n getComputedStyle(offsetParent).position !== 'static' &&\n position === 'absolute'\n ) {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n }\n\n // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n offsetParent = (offsetParent: Element);\n\n if (\n placement === top ||\n ((placement === left || placement === right) && variation === end)\n ) {\n sideY = bottom;\n // $FlowFixMe[prop-missing]\n y -= offsetParent[heightProp] - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (\n placement === left ||\n ((placement === top || placement === bottom) && variation === end)\n ) {\n sideX = right;\n // $FlowFixMe[prop-missing]\n x -= offsetParent[widthProp] - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides),\n };\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform:\n (win.devicePixelRatio || 1) <= 1\n ? `translate(${x}px, ${y}px)`\n : `translate3d(${x}px, ${y}px, 0)`,\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: '',\n };\n}\n\nfunction computeStyles({ state, options }: ModifierArguments) {\n const {\n gpuAcceleration = true,\n adaptive = true,\n // defaults to use builtin `roundOffsetsByDPR`\n roundOffsets = true,\n } = options;\n\n if (__DEV__) {\n const transitionProperty =\n getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (\n adaptive &&\n ['transform', 'top', 'right', 'bottom', 'left'].some(\n (property) => transitionProperty.indexOf(property) >= 0\n )\n ) {\n console.warn(\n [\n 'Popper: Detected CSS transitions on at least one of the following',\n 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".',\n '\\n\\n',\n 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow',\n 'for smooth transitions, or remove these properties from the CSS',\n 'transition declaration on the popper element if only transitioning',\n 'opacity or background-color for example.',\n '\\n\\n',\n 'We recommend using the popper element as a wrapper around an inner',\n 'element that can have any CSS property transitioned for animations.',\n ].join(' ')\n );\n }\n }\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets,\n }),\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets,\n }),\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {},\n}: ComputeStylesModifier);\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n\nexport default function getOppositePlacement(placement: Placement): Placement {\n return (placement.replace(\n /left|right|bottom|top/g,\n matched => hash[matched]\n ): any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { start: 'end', end: 'start' };\n\nexport default function getOppositeVariationPlacement(\n placement: Placement\n): Placement {\n return (placement.replace(/start|end/g, matched => hash[matched]): any);\n}\n","// @flow\nimport type {\n ModifierArguments,\n Modifier,\n Rect,\n SideObject,\n Offsets,\n} from '../types';\nimport { top, bottom, left, right } from '../enums';\nimport detectOverflow from '../utils/detectOverflow';\n\nfunction getSideOffsets(\n overflow: SideObject,\n rect: Rect,\n preventedOffsets: Offsets = { x: 0, y: 0 }\n): SideObject {\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x,\n };\n}\n\nfunction isAnySideFullyClipped(overflow: SideObject): boolean {\n return [top, right, bottom, left].some((side) => overflow[side] >= 0);\n}\n\nfunction hide({ state, name }: ModifierArguments<{||}>) {\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const preventedOffsets = state.modifiersData.preventOverflow;\n\n const referenceOverflow = detectOverflow(state, {\n elementContext: 'reference',\n });\n const popperAltOverflow = detectOverflow(state, {\n altBoundary: true,\n });\n\n const referenceClippingOffsets = getSideOffsets(\n referenceOverflow,\n referenceRect\n );\n const popperEscapeOffsets = getSideOffsets(\n popperAltOverflow,\n popperRect,\n preventedOffsets\n );\n\n const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n\n state.modifiersData[name] = {\n referenceClippingOffsets,\n popperEscapeOffsets,\n isReferenceHidden,\n hasPopperEscaped,\n };\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type HideModifier = Modifier<'hide', {||}>;\nexport default ({\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide,\n}: HideModifier);\n","// @flow\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n scroll: boolean,\n resize: boolean,\n};\n\nconst passive = { passive: true };\n\nfunction effect({ state, instance, options }: ModifierArguments) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [\n ...state.scrollParents.reference,\n ...state.scrollParents.popper,\n ];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default ({\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {},\n}: EventListenersModifier);\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\nfunction popperOffsets({ state, name }: ModifierArguments<{||}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement,\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {||}>;\nexport default ({\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {},\n}: PopperOffsetsModifier);\n","// @flow\nimport type { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles({ state }: ModifierArguments<{||}>) {\n Object.keys(state.elements).forEach((name) => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect({ state }: ModifierArguments<{||}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach((name) => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(\n state.styles.hasOwnProperty(name)\n ? state.styles[name]\n : initialStyles[name]\n );\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((attribute) => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {||}>;\nexport default ({\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles'],\n}: ApplyStylesModifier);\n","// @flow\nimport type { Placement } from '../enums';\nimport type { ModifierArguments, Modifier, Rect, Offsets } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport { top, left, right, placements } from '../enums';\n\ntype OffsetsFunction = ({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n}) => [?number, ?number];\n\ntype Offset = OffsetsFunction | [?number, ?number];\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n offset: Offset,\n};\n\nexport function distanceAndSkiddingToXY(\n placement: Placement,\n rects: { popper: Rect, reference: Rect },\n offset: Offset\n): Offsets {\n const basePlacement = getBasePlacement(placement);\n const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n let [skidding, distance] =\n typeof offset === 'function'\n ? offset({\n ...rects,\n placement,\n })\n : offset;\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n\n return [left, right].indexOf(basePlacement) >= 0\n ? { x: distance, y: skidding }\n : { x: skidding, y: distance };\n}\n\nfunction offset({ state, options, name }: ModifierArguments) {\n const { offset = [0, 0] } = options;\n\n const data = placements.reduce((acc, placement) => {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n\n const { x, y } = data[state.placement];\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetModifier = Modifier<'offset', Options>;\nexport default ({\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset,\n}: OffsetModifier);\n","// @flow\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { ModifierArguments, Modifier, Padding } from '../types';\nimport getOppositePlacement from '../utils/getOppositePlacement';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getOppositeVariationPlacement from '../utils/getOppositeVariationPlacement';\nimport detectOverflow from '../utils/detectOverflow';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\nimport { bottom, top, start, right, left, auto } from '../enums';\nimport getVariation from '../utils/getVariation';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n mainAxis: boolean,\n altAxis: boolean,\n fallbackPlacements: Array,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n altBoundary: boolean,\n flipVariations: boolean,\n allowedAutoPlacements: Array,\n};\n\nfunction getExpandedFallbackPlacements(placement: Placement): Array {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n const oppositePlacement = getOppositePlacement(placement);\n\n return [\n getOppositeVariationPlacement(placement),\n oppositePlacement,\n getOppositeVariationPlacement(oppositePlacement),\n ];\n}\n\nfunction flip({ state, options, name }: ModifierArguments) {\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n padding,\n boundary,\n rootBoundary,\n altBoundary,\n flipVariations = true,\n allowedAutoPlacements,\n } = options;\n\n const preferredPlacement = state.options.placement;\n const basePlacement = getBasePlacement(preferredPlacement);\n const isBasePlacement = basePlacement === preferredPlacement;\n\n const fallbackPlacements =\n specifiedFallbackPlacements ||\n (isBasePlacement || !flipVariations\n ? [getOppositePlacement(preferredPlacement)]\n : getExpandedFallbackPlacements(preferredPlacement));\n\n const placements = [preferredPlacement, ...fallbackPlacements].reduce(\n (acc, placement) => {\n return acc.concat(\n getBasePlacement(placement) === auto\n ? computeAutoPlacement(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements,\n })\n : placement\n );\n },\n []\n );\n\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n\n const checksMap = new Map();\n let makeFallbackChecks = true;\n let firstFittingPlacement = placements[0];\n\n for (let i = 0; i < placements.length; i++) {\n const placement = placements[i];\n const basePlacement = getBasePlacement(placement);\n const isStartVariation = getVariation(placement) === start;\n const isVertical = [top, bottom].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'width' : 'height';\n\n const overflow = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n });\n\n let mainVariationSide: any = isVertical\n ? isStartVariation\n ? right\n : left\n : isStartVariation\n ? bottom\n : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n const altVariationSide: any = getOppositePlacement(mainVariationSide);\n\n const checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(\n overflow[mainVariationSide] <= 0,\n overflow[altVariationSide] <= 0\n );\n }\n\n if (checks.every((check) => check)) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n const numberOfChecks = flipVariations ? 3 : 1;\n\n for (let i = numberOfChecks; i > 0; i--) {\n const fittingPlacement = placements.find((placement) => {\n const checks = checksMap.get(placement);\n if (checks) {\n return checks.slice(0, i).every((check) => check);\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n break;\n }\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type FlipModifier = Modifier<'flip', Options>;\nexport default ({\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: { _skip: false },\n}: FlipModifier);\n","// @flow\nimport type { State, Padding } from '../types';\nimport type {\n Placement,\n ComputedPlacement,\n Boundary,\n RootBoundary,\n} from '../enums';\nimport getVariation from './getVariation';\nimport {\n variationPlacements,\n basePlacements,\n placements as allPlacements,\n} from '../enums';\nimport detectOverflow from './detectOverflow';\nimport getBasePlacement from './getBasePlacement';\n\ntype Options = {\n placement: Placement,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n flipVariations: boolean,\n allowedAutoPlacements?: Array,\n};\n\ntype OverflowsMap = { [ComputedPlacement]: number };\n\nexport default function computeAutoPlacement(\n state: $Shape,\n options: Options = {}\n): Array {\n const {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements = allPlacements,\n } = options;\n\n const variation = getVariation(placement);\n\n const placements = variation\n ? flipVariations\n ? variationPlacements\n : variationPlacements.filter(\n (placement) => getVariation(placement) === variation\n )\n : basePlacements;\n\n let allowedPlacements = placements.filter(\n (placement) => allowedAutoPlacements.indexOf(placement) >= 0\n );\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (__DEV__) {\n console.error(\n [\n 'Popper: The `allowedAutoPlacements` option did not allow any',\n 'placements. Ensure the `placement` option matches the variation',\n 'of the allowed placements.',\n 'For example, \"auto\" cannot be used to allow \"bottom-start\".',\n 'Use \"auto-start\" instead.',\n ].join(' ')\n );\n }\n }\n\n // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n const overflows: OverflowsMap = allowedPlacements.reduce((acc, placement) => {\n acc[placement] = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n })[getBasePlacement(placement)];\n\n return acc;\n }, {});\n\n return Object.keys(overflows).sort((a, b) => overflows[a] - overflows[b]);\n}\n","// @flow\nimport { top, left, right, bottom, start } from '../enums';\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { Rect, ModifierArguments, Modifier, Padding } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport getAltAxis from '../utils/getAltAxis';\nimport within from '../utils/within';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport detectOverflow from '../utils/detectOverflow';\nimport getVariation from '../utils/getVariation';\nimport getFreshSideObject from '../utils/getFreshSideObject';\nimport { max as mathMax, min as mathMin } from '../utils/math';\n\ntype TetherOffset =\n | (({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n }) => number)\n | number;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n /* Prevents boundaries overflow on the main axis */\n mainAxis: boolean,\n /* Prevents boundaries overflow on the alternate axis */\n altAxis: boolean,\n /* The area to check the popper is overflowing in */\n boundary: Boundary,\n /* If the popper is not overflowing the main area, fallback to this one */\n rootBoundary: RootBoundary,\n /* Use the reference's \"clippingParents\" boundary context */\n altBoundary: boolean,\n /**\n * Allows the popper to overflow from its boundaries to keep it near its\n * reference element\n */\n tether: boolean,\n /* Offsets when the `tether` option should activate */\n tetherOffset: TetherOffset,\n /* Sets a padding to the provided boundary */\n padding: Padding,\n};\n\nfunction preventOverflow({ state, options, name }: ModifierArguments) {\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = false,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n tether = true,\n tetherOffset = 0,\n } = options;\n\n const overflow = detectOverflow(state, {\n boundary,\n rootBoundary,\n padding,\n altBoundary,\n });\n const basePlacement = getBasePlacement(state.placement);\n const variation = getVariation(state.placement);\n const isBasePlacement = !variation;\n const mainAxis = getMainAxisFromPlacement(basePlacement);\n const altAxis = getAltAxis(mainAxis);\n const popperOffsets = state.modifiersData.popperOffsets;\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const tetherOffsetValue =\n typeof tetherOffset === 'function'\n ? tetherOffset({\n ...state.rects,\n placement: state.placement,\n })\n : tetherOffset;\n\n const data = { x: 0, y: 0 };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis || checkAltAxis) {\n const mainSide = mainAxis === 'y' ? top : left;\n const altSide = mainAxis === 'y' ? bottom : right;\n const len = mainAxis === 'y' ? 'height' : 'width';\n const offset = popperOffsets[mainAxis];\n\n const min = popperOffsets[mainAxis] + overflow[mainSide];\n const max = popperOffsets[mainAxis] - overflow[altSide];\n\n const additive = tether ? -popperRect[len] / 2 : 0;\n\n const minLen = variation === start ? referenceRect[len] : popperRect[len];\n const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];\n\n // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n const arrowElement = state.elements.arrow;\n const arrowRect =\n tether && arrowElement\n ? getLayoutRect(arrowElement)\n : { width: 0, height: 0 };\n const arrowPaddingObject = state.modifiersData['arrow#persistent']\n ? state.modifiersData['arrow#persistent'].padding\n : getFreshSideObject();\n const arrowPaddingMin = arrowPaddingObject[mainSide];\n const arrowPaddingMax = arrowPaddingObject[altSide];\n\n // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n const arrowLen = within(0, referenceRect[len], arrowRect[len]);\n\n const minOffset = isBasePlacement\n ? referenceRect[len] / 2 -\n additive -\n arrowLen -\n arrowPaddingMin -\n tetherOffsetValue\n : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;\n const maxOffset = isBasePlacement\n ? -referenceRect[len] / 2 +\n additive +\n arrowLen +\n arrowPaddingMax +\n tetherOffsetValue\n : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;\n\n const arrowOffsetParent =\n state.elements.arrow && getOffsetParent(state.elements.arrow);\n const clientOffset = arrowOffsetParent\n ? mainAxis === 'y'\n ? arrowOffsetParent.clientTop || 0\n : arrowOffsetParent.clientLeft || 0\n : 0;\n\n const offsetModifierValue = state.modifiersData.offset\n ? state.modifiersData.offset[state.placement][mainAxis]\n : 0;\n\n const tetherMin =\n popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;\n const tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;\n\n if (checkMainAxis) {\n const preventedOffset = within(\n tether ? mathMin(min, tetherMin) : min,\n offset,\n tether ? mathMax(max, tetherMax) : max\n );\n\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n const mainSide = mainAxis === 'x' ? top : left;\n const altSide = mainAxis === 'x' ? bottom : right;\n const offset = popperOffsets[altAxis];\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const preventedOffset = within(\n tether ? mathMin(min, tetherMin) : min,\n offset,\n tether ? mathMax(max, tetherMax) : max\n );\n\n popperOffsets[altAxis] = preventedOffset;\n data[altAxis] = preventedOffset - offset;\n }\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PreventOverflowModifier = Modifier<'preventOverflow', Options>;\nexport default ({\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset'],\n}: PreventOverflowModifier);\n","// @flow\n\nexport default function getAltAxis(axis: 'x' | 'y'): 'x' | 'y' {\n return axis === 'x' ? 'y' : 'x';\n}\n","// @flow\nimport { max as mathMax, min as mathMin } from './math';\n\nexport default function within(\n min: number,\n value: number,\n max: number\n): number {\n return mathMax(min, mathMin(value, max));\n}\n","// @flow\nimport type { Modifier, ModifierArguments, Padding, Rect } from '../types';\nimport type { Placement } from '../enums';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport contains from '../dom-utils/contains';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport within from '../utils/within';\nimport mergePaddingObject from '../utils/mergePaddingObject';\nimport expandToHashMap from '../utils/expandToHashMap';\nimport { left, right, basePlacements, top, bottom } from '../enums';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n element: HTMLElement | string | null,\n padding:\n | Padding\n | (({|\n popper: Rect,\n reference: Rect,\n placement: Placement,\n |}) => Padding),\n};\n\nconst toPaddingObject = (padding, state) => {\n padding =\n typeof padding === 'function'\n ? padding({ ...state.rects, placement: state.placement })\n : padding;\n\n return mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n};\n\nfunction arrow({ state, name, options }: ModifierArguments) {\n const arrowElement = state.elements.arrow;\n const popperOffsets = state.modifiersData.popperOffsets;\n const basePlacement = getBasePlacement(state.placement);\n const axis = getMainAxisFromPlacement(basePlacement);\n const isVertical = [left, right].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n const paddingObject = toPaddingObject(options.padding, state);\n const arrowRect = getLayoutRect(arrowElement);\n const minProp = axis === 'y' ? top : left;\n const maxProp = axis === 'y' ? bottom : right;\n\n const endDiff =\n state.rects.reference[len] +\n state.rects.reference[axis] -\n popperOffsets[axis] -\n state.rects.popper[len];\n const startDiff = popperOffsets[axis] - state.rects.reference[axis];\n\n const arrowOffsetParent = getOffsetParent(arrowElement);\n const clientSize = arrowOffsetParent\n ? axis === 'y'\n ? arrowOffsetParent.clientHeight || 0\n : arrowOffsetParent.clientWidth || 0\n : 0;\n\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n const min = paddingObject[minProp];\n const max = clientSize - arrowRect[len] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n const offset = within(min, center, max);\n\n // Prevents breaking syntax highlighting...\n const axisProp: string = axis;\n state.modifiersData[name] = {\n [axisProp]: offset,\n centerOffset: offset - center,\n };\n}\n\nfunction effect({ state, options }: ModifierArguments) {\n let { element: arrowElement = '[data-popper-arrow]' } = options;\n\n if (arrowElement == null) {\n return;\n }\n\n // CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (__DEV__) {\n if (!isHTMLElement(arrowElement)) {\n console.error(\n [\n 'Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).',\n 'To use an SVG arrow, wrap it in an HTMLElement that will be used as',\n 'the arrow.',\n ].join(' ')\n );\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (__DEV__) {\n console.error(\n [\n 'Popper: \"arrow\" modifier\\'s `element` must be a child of the popper',\n 'element.',\n ].join(' ')\n );\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ArrowModifier = Modifier<'arrow', Options>;\nexport default ({\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow'],\n}: ArrowModifier);\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\nimport offset from './modifiers/offset';\nimport flip from './modifiers/flip';\nimport preventOverflow from './modifiers/preventOverflow';\nimport arrow from './modifiers/arrow';\nimport hide from './modifiers/hide';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n offset,\n flip,\n preventOverflow,\n arrow,\n hide,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper as createPopperLite } from './popper-lite';\n// eslint-disable-next-line import/no-unused-modules\nexport * from './modifiers';\n"],"names":["getWindow","node","window","ownerDocument","isElement","isHTMLElement","isShadowRoot","getBoundingClientRect","element","includeScale","rect","scaleX","scaleY","offsetHeight","offsetWidth","width","round","height","top","right","bottom","left","x","y","getWindowScroll","scrollLeft","win","scrollTop","getNodeName","getDocumentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","isElementScaled","offsetParentIsScaled","offsets","documentElement","scroll","getLayoutRect","clientRect","Math","getParentNode","getScrollParent","listScrollParents","list","scrollParent","_element$ownerDocumen","isBody","target","updatedList","getTrueOffsetParent","getOffsetParent","a","isFirefox","navigator","getContainingBlock","currentNode","css","order","modifiers","modifier","visited","dep","depModifier","map","sort","Map","Set","result","debounce","fn","pending","Promise","resolve","undefined","getBasePlacement","placement","contains","parent","child","rootNode","next","rectToClientRect","getClientRectFromMixedType","clippingParent","viewport","html","visualViewport","winScroll","body","max","getClippingRect","boundary","rootBoundary","mainClippingParents","getClippingParents","clippingParents","clipperElement","accRect","min","clippingRect","getVariation","getMainAxisFromPlacement","computeOffsets","reference","basePlacement","commonX","commonY","mainAxis","len","variation","start","end","mergePaddingObject","paddingObject","expandToHashMap","value","keys","hashMap","key","detectOverflow","state","options","popper","altBoundary","padding","basePlacements","elementContext","popperRect","strategy","popperOffsets","popperClientRect","referenceClientRect","overflowOffsets","clippingClientRect","elementClientRect","offsetData","offset","multiply","axis","areValidElements","args","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","DEFAULT_OPTIONS","effectCleanupFns","orderedModifiers","modifiersData","elements","attributes","styles","isDestroyed","instance","setOptions","setOptionsAction","orderModifiers","acc","phase","mergeByName","merged","current","existing","data","m","name","cleanupFn","effect","noopFn","forceUpdate","index","update","destroy","cleanupModifierEffects","mapToStyles","position","gpuAcceleration","adaptive","roundOffsets","roundOffsetsByDPR","dpr","g","hasX","sideX","sideY","heightProp","widthProp","commonStyles","unsetSides","hasY","getOppositePlacement","matched","getOppositeVariationPlacement","getSideOffsets","overflow","preventedOffsets","isAnySideFullyClipped","side","variationPlacements","placements","auto","modifierPhases","passive","enabled","effect$2","resize","scrollParents","computeStyles","applyStyles","style","Object","effect$1","initialStyles","margin","arrow","property","attribute","requires","distanceAndSkiddingToXY","invertDistance","rects","distance","skidding","hash","flip","specifiedFallbackPlacements","flipVariations","allowedAutoPlacements","preferredPlacement","getExpandedFallbackPlacements","oppositePlacement","fallbackPlacements","computeAutoPlacement","allPlacements","allowedPlacements","overflows","b","checksMap","firstFittingPlacement","i","isStartVariation","isVertical","mainVariationSide","checks","altVariationSide","check","makeFallbackChecks","fittingPlacement","requiresIfExists","_skip","preventOverflow","checkMainAxis","checkAltAxis","tetherOffset","isBasePlacement","referenceRect","tetherOffsetValue","mainSide","altSide","additive","tether","minLen","arrowElement","arrowPaddingObject","mathMax","min$1","mathMin","arrowRect","arrowLen","arrowPaddingMin","arrowPaddingMax","maxLen","minOffset","offsetModifierValue","arrowOffsetParent","maxOffset","tetherMin","tetherMax","preventedOffset","altAxis","minProp","maxProp","endDiff","startDiff","center","clientSize","hide","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","createPopper","defaultModifiers$1","eventListeners"],"mappings":";;;;8OAIeA,WAAmBC,gBAC5BA,EACKC,OAGe,oBAApBD,cACIE,EAAgBF,kBACCE,eAAsCD,OAGxDD,ECTTG,WAAmBH,uBACED,EAAUC,YACQA,qBAKvCI,WAAuBJ,uBACFD,EAAUC,gBACQA,yBAKvCK,WAAsBL,SAEM,8CAGPD,EAAUC,eACQA,yBCnBxBM,WACbC,EACAC,YAAAA,IAAAA,GAAwB,OAElBC,EAAOF,0BACTG,EAAS,EACTC,EAAS,WAEKJ,IAAYC,IACtBI,EAAeL,eAKH,GAJZM,EAAcN,iBAKlBG,EAASD,QAAaI,GAAe,GAEpB,EAAfD,IACFD,EAASF,SAAcG,GAAgB,IAIpC,C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AAaP,eACb2E,EAAmB3E,gCAEnBuK,EAAoBxK,EAAeC,EAAO,CAC9CM,eAAgB,cAEZkK,EAAoBzK,EAAeC,EAAO,CAC9CG,aAAa,MAGkBsE,EAC/B8F,EACAhC,KAE0B9D,EAC1B+F,EACAjK,EACAoE,KAGwBC,EAAsB6F,KACvB7F,EAAsB8F,mBAE3B7H,GAAQ,CAC1B4H,yBAAAA,EACAC,oBAAAA,EACAC,kBAAAA,EACAC,iBAAAA,wCAIG5K,oDAC6B2K,wBACTC,MY9CrBC,GAAexJ,EAAgB,CAAEE,iBAPduJ,CACvBC,EACAtK,EACA8E,EACAC,KCCIjE,GAAmB,CACvBwJ,EACAtK,EACA8E,EACAC,EACAxE,GACAwF,GACA0B,GACApC,GACAwE,IAGIO,GAAexJ,EAAgB,CAAEE,iBAAAA"} \ No newline at end of file From 878a638f81c872dbcd01055b73268ebe52e55548 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Tue, 5 Oct 2021 22:46:20 +0800 Subject: [PATCH 20/22] Add Bootstrap 5 support for nav macros --- flask_bootstrap/templates/base/nav.html | 21 +++++++++++++++++++ flask_bootstrap/templates/bootstrap4/nav.html | 20 +----------------- flask_bootstrap/templates/bootstrap5/nav.html | 20 +----------------- 3 files changed, 23 insertions(+), 38 deletions(-) create mode 100644 flask_bootstrap/templates/base/nav.html diff --git a/flask_bootstrap/templates/base/nav.html b/flask_bootstrap/templates/base/nav.html new file mode 100644 index 00000000..acc457db --- /dev/null +++ b/flask_bootstrap/templates/base/nav.html @@ -0,0 +1,21 @@ +{% macro render_nav_item(endpoint, text, badge='', use_li=False) %} + {% set active = True if request.endpoint and request.endpoint == endpoint else False %} + {% if use_li %}{% endif %} +{% endmacro %} + + +{% macro render_breadcrumb_item(endpoint, text) %} + {% set active = True if request.endpoint and request.endpoint == endpoint else False %} + +{% endmacro %} diff --git a/flask_bootstrap/templates/bootstrap4/nav.html b/flask_bootstrap/templates/bootstrap4/nav.html index 1863041d..21ee8a4b 100644 --- a/flask_bootstrap/templates/bootstrap4/nav.html +++ b/flask_bootstrap/templates/bootstrap4/nav.html @@ -1,19 +1 @@ -{% macro render_nav_item(endpoint, text, badge='', use_li=False) %} - {% if use_li %}{% endif %} -{% endmacro %} - -{% macro render_breadcrumb_item(endpoint, text) %} - {% set active = True if request.endpoint and request.endpoint == endpoint else False %} - -{% endmacro %} +{% extends 'base/nav.html' %} diff --git a/flask_bootstrap/templates/bootstrap5/nav.html b/flask_bootstrap/templates/bootstrap5/nav.html index 1863041d..21ee8a4b 100644 --- a/flask_bootstrap/templates/bootstrap5/nav.html +++ b/flask_bootstrap/templates/bootstrap5/nav.html @@ -1,19 +1 @@ -{% macro render_nav_item(endpoint, text, badge='', use_li=False) %} - {% if use_li %}{% endif %} -{% endmacro %} - -{% macro render_breadcrumb_item(endpoint, text) %} - {% set active = True if request.endpoint and request.endpoint == endpoint else False %} - -{% endmacro %} +{% extends 'base/nav.html' %} From 2931652f295d4e1f79d93b574916df836bb2641b Mon Sep 17 00:00:00 2001 From: Grey Li Date: Tue, 5 Oct 2021 22:56:58 +0800 Subject: [PATCH 21/22] Add tests for bootstrap5/render_messages --- tests/test_boostrap5/test_render_messages.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/test_boostrap5/test_render_messages.py diff --git a/tests/test_boostrap5/test_render_messages.py b/tests/test_boostrap5/test_render_messages.py new file mode 100644 index 00000000..f6afd362 --- /dev/null +++ b/tests/test_boostrap5/test_render_messages.py @@ -0,0 +1,15 @@ +from flask import flash, render_template_string + + +def test_render_messages(app, client): + @app.route('/messages') + def test_messages(): + flash('test message', 'danger') + return render_template_string(''' + {% from 'bootstrap5/utils.html' import render_messages %} + {{ render_messages(dismissible=True) }} + ''') + + response = client.get('/messages') + data = response.get_data(as_text=True) + assert 'class="btn-close" data-bs-dismiss="alert" aria-label="Close">' in data From 93426f7b8f7c1710c343fe76994fe1281d493046 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Thu, 7 Oct 2021 12:21:03 +0800 Subject: [PATCH 22/22] Add Bootstrap 5 tips to docs --- CHANGES.rst | 3 ++- docs/advanced.rst | 12 +++++++----- docs/basic.rst | 48 ++++++++++++++++++++++++++++++++--------------- docs/macros.rst | 28 +++++++++++++-------------- 4 files changed, 56 insertions(+), 35 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 317076a6..5feb483d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,7 +13,8 @@ Release date: - - Add initial support for Bootstrap 5 (`#161 `__): - Add ``Bootstrap4`` class and deprecate ``Bootstrap``. - Add ``Bootstrap5`` class for Bootstrap 5 support. - - Move Bootstrap 4-related files to `bootstrap4` subfolder, and deprecate template path ``bootstrap/``. + - Move Bootstrap 4-related files to ``bootstrap4`` subfolder, and deprecate template path ``bootstrap/``. + - Bootstrap 4 macros are in the ``bootstrap4/`` template folder, and Bootstrap 5 macros are in ``bootstrap5/``. - Add seperate tests, templates, static files, and examples for Bootstrap 5. diff --git a/docs/advanced.rst b/docs/advanced.rst index 36e91a65..fb5ef678 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -69,7 +69,7 @@ Or you can use ``button_style`` parameter when using ``render_form``, ``render_f .. code-block:: jinja - {% from 'bootstrap/form.html' import render_form %} + {% from 'bootstrap4/form.html' import render_form %} {{ render_form(form, button_style='success') }} @@ -92,10 +92,10 @@ Now you can use a configuration variable called ``BOOTSTRAP_BTN_STYLE`` to set g .. code-block:: python from flask import Flask - from flask_bootstrap import Bootstrap + from flask_bootstrap import Bootstrap4 app = Flask(__name__) - bootstrap = Bootstrap(app) + bootstrap = Bootstrap4(app) app.config['BOOTSTRAP_BTN_SIZE'] = 'sm' # default to 'md' @@ -103,7 +103,7 @@ there also a parameter called ``button_size`` in form related macros (it will ov .. code-block:: jinja - {% from 'bootstrap/form.html' import render_form %} + {% from 'bootstrap4/form.html' import render_form %} {{ render_form(form, button_size='lg') }} @@ -119,7 +119,7 @@ Here is a more complicate example: .. code-block:: jinja - {% from 'bootstrap/form.html' import render_form %} + {% from 'bootstrap4/form.html' import render_form %} {{ render_form(form, button_map={'submit': 'success', 'cancel': 'secondary', 'delete': 'danger'}) }} @@ -138,6 +138,8 @@ The available theme names are: 'cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly' 'lumen', 'lux', 'materia', 'minty', 'pulse', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'united', 'yeti'. +For Bootstrap 5, besides these, you can also use: 'morph', 'quartz', 'vapor', 'zephyr'. + Here is an example to use ``lumen`` theme: .. code-block:: python diff --git a/docs/basic.rst b/docs/basic.rst index f70f763b..5794cb86 100644 --- a/docs/basic.rst +++ b/docs/basic.rst @@ -22,12 +22,23 @@ Initialization .. code-block:: python - from flask_bootstrap import Bootstrap + from flask_bootstrap import Bootstrap4 from flask import Flask app = Flask(__name__) - bootstrap = Bootstrap(app) + bootstrap = Bootstrap4(app) + +If you want to use Bootstrap 5, import and instanzlize the ``Bootstrap5`` class instead: + +.. code-block:: python + + from flask_bootstrap import Bootstrap5 + from flask import Flask + + app = Flask(__name__) + + bootstrap = Bootstrap5(app) Resources helpers ----------------- @@ -96,29 +107,29 @@ Macros +---------------------------+--------------------------------+--------------------------------------------------------------------+ | Macro | Templates Path | Description | +===========================+================================+====================================================================+ -| render_field() | bootstrap/form.html | Render a WTForms form field | +| render_field() | bootstrap4/form.html | Render a WTForms form field | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_form() | bootstrap/form.html | Render a WTForms form | +| render_form() | bootstrap4/form.html | Render a WTForms form | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_form_row() | bootstrap/form.html | Render a row of a grid form | +| render_form_row() | bootstrap4/form.html | Render a row of a grid form | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_hidden_errors() | bootstrap/form.html | Render error messages for hidden form field | +| render_hidden_errors() | bootstrap4/form.html | Render error messages for hidden form field | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_pager() | bootstrap/pagination.html | Render a basic Flask-SQLAlchemy pagniantion | +| render_pager() | bootstrap4/pagination.html | Render a basic Flask-SQLAlchemy pagniantion | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_pagination() | bootstrap/pagination.html | Render a standard Flask-SQLAlchemy pagination | +| render_pagination() | bootstrap4/pagination.html | Render a standard Flask-SQLAlchemy pagination | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_nav_item() | bootstrap/nav.html | Render a navigation item | +| render_nav_item() | bootstrap4/nav.html | Render a navigation item | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_breadcrumb_item() | bootstrap/nav.html | Render a breadcrumb item | +| render_breadcrumb_item() | bootstrap4/nav.html | Render a breadcrumb item | +---------------------------+--------------------------------+--------------------------------------------------------------------+ -| render_static() | bootstrap/utils.html | Render a resource reference code (i.e. ````, ``