diff --git a/.gitignore b/.gitignore index baecfaa..ad957c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +*~ *.pyc dist/ docs/_build/ +style/dist/ +style/node_modules/ diff --git a/CHANGELOG.md b/CHANGELOG.md index c24d5c8..f1eedfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,251 @@ All notable changes to WuttaFarm will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.8.0 (2026-03-04) + +### Feat + +- improve support for exporting quantity, log data +- show related Quantity records when viewing a Measure +- show related Quantity records when viewing a Unit +- show link to Log record when viewing Quantity + +### Fix + +- bump version requirement for wuttaweb + +## v0.7.0 (2026-03-04) + +### Feat + +- expose "group membership" for assets +- expose "current location" for assets +- add schema, sync support for `Log.is_movement` +- add schema, import support for `Asset.owners` +- add schema, import support for `Log.quick` +- show quantities when viewing log +- add sync support for `MedicalLog.vet` +- add schema, import support for `Log.quantities` +- add schema, import support for `Log.groups` +- add schema, import support for `Log.locations` +- add sync support for `Log.is_group_assignment` +- add support for exporting log status, timestamp to farmOS +- add support for log 'owners' +- add support for edit, import/export of plant type data +- add way to create animal type when editing animal +- add related version tables for asset/log revision history +- improve mirror/deletion for assets, logs, animal types +- auto-delete asset from farmOS if deleting via mirror app + +### Fix + +- show drupal ID column for asset types +- remove unique constraint for `LandAsset.land_type_uuid` +- move farmOS UUID field below the Drupal ID +- add links for Parents column in All Assets grid +- set timestamp for new log in quick eggs form +- set default grid pagesize to 50 +- add placeholder for log 'quick' field +- define log grid columns to match farmOS +- make AllLogView inherit from LogMasterView +- rename views for "all records" (all assets, all logs etc.) +- ensure token refresh works regardless where API client is used +- render links for Plant Type column in Plant Assets grid +- fix land asset type +- prevent edit for asset types, land types when app is mirror +- add farmOS-style links for Parents column in Land Assets grid +- remove unique constraint for `AnimalType.name` +- prevent delete if animal type is still being referenced +- add reminder to restart if changing integration mode +- prevent edit for user farmos_uuid, drupal_id +- remove 'contains' verb for sex filter +- add enum, row hilite for log status +- fix Sex field when empty and deleting an animal +- add `get_farmos_client_for_user()` convenience function +- use current user token for auto-sync within web app +- set log type, status enums for log grids +- add more default perms for first site admin user +- only show quick form menu if perms allow +- expose config for farmOS OAuth2 client_id and scope +- add separate permission for each quick form view + +## v0.6.0 (2026-02-25) + +### Feat + +- add common normalizer to simplify code in view, importer etc. +- overhaul farmOS log views; add Eggs quick form +- add basic CRUD for direct API views: animal types, animal assets +- use 'include' API param for better Animal Assets grid data +- add backend filters, sorting for farmOS animal types, assets +- include/exclude certain views, menus based on integration mode +- add Standard Quantities table, views, import +- add Quantity Types table, views, import +- add Units table, views, import/export + +### Fix + +- add `Notes` schema type +- add grid filter for animal birthdate +- add thumbnail to farmOS asset base view +- add setting to toggle "farmOS-style grid links" +- standardize a bit more for the farmOS Animal Assets view +- set *default* instead of configured menu handler +- expose farmOS integration mode, URL in app settings +- reword some menu entries +- add WuttaFarm -> farmOS export for Plant Assets +- fix default admin user perms, per new log schema + +## v0.5.0 (2026-02-18) + +### Feat + +- add `produces_eggs` flag for animal, group assets +- add more assets (plant) and logs (harvest, medical, observation) +- refactor log models, views to use generic/common base + +### Fix + +- rename db model modules, for better convention +- add override for requests cert validation + +## v0.4.1 (2026-02-17) + +### Fix + +- remove `AnimalType.changed` column + +## v0.4.0 (2026-02-17) + +### Feat + +- add basic support for WuttaFarm → farmOS export +- convert group assets to use common base/mixin +- convert structure assets to use common base/mixin +- convert land assets to use common base/mixin +- add "generic" assets, new animal assets based on that + +### Fix + +- misc. field tweaks for asset forms +- show warning when viewing an archived asset +- fix some perms for all assets view +- fix initial admin perms per route renaming +- add parent relationships support for land assets +- cleanup Land views to better match farmOS +- cleanup Structure views to better match farmOS +- cleanup Group views to better match farmOS +- add / display thumbnail image for animals +- improve handling of 'archived' records for grid/form views +- use Male/Female dict enum for animal sex field +- prevent direct edit of `farmos_uuid` and `drupal_id` fields +- use same datetime display format as farmOS +- convert `active` flag to `archived` +- suppress output when user farmos/drupal keys are empty +- customize page footer to mention farmOS + +## v0.3.1 (2026-02-14) + +### Fix + +- update sterile, archived flags per farmOS 4.x + +## v0.3.0 (2026-02-13) + +### Feat + +- add native table for Activity Logs; import from farmOS API +- add native table for Groups; import from farmOS API +- add native table for Animals; import from farmOS API +- add native table for Structures; import from farmOS API +- add native table for Land Assets; import from farmOS API +- add native table for Log Types; import from farmOS API +- add native table for Structure Types; import from farmOS API +- add native table for Land Types; import from farmOS API +- add native table for Asset Types; import from farmOS API +- add extension table for Users; import from farmOS API +- add native table for Animal Types; import from farmOS API +- add "See raw JSON data" button for farmOS API views + +### Fix + +- always make 'farmos' system user in app setup +- avoid error for Create User form +- add more perms to Site Admin role in app setup +- rename `drupal_internal_id` => `drupal_id` + +## v0.2.3 (2026-02-08) + +### Fix + +- add custom (built) buefy css to repo + +## v0.2.2 (2026-02-08) + +### Fix + +- update project links for PyPI + +## v0.2.1 (2026-02-08) + +### Fix + +- run web app via uvicorn/ASGI by default + +## v0.2.0 (2026-02-08) + +### Feat + +- add view for farmOS activity logs +- add view for farmOS log types +- add view for farmOS structure types +- add view for farmOS land types +- add view for farmOS land assets +- add view for farmOS groups +- add view for farmOS asset types +- add view for farmOS structures +- add view for farmOS animal types +- add view for farmOS users + +### Fix + +- add pyramid_exclog dependency +- add menu option, "Go to farmOS" +- ensure Buefy version matches what we use for custom css + +## v0.1.5 (2026-02-07) + +### Fix + +- fix built wheel to include custom buefy css + +## v0.1.4 (2026-02-07) + +### Fix + +- add custom style to better match farmOS color scheme + +## v0.1.3 (2026-02-06) + +### Fix + +- fix a couple more edge cases around oauth2 token refresh + +## v0.1.2 (2026-02-06) + +### Fix + +- add support for farmOS/OAuth2 Authorization Code grant/workflow + +## v0.1.1 (2026-02-05) + +### Fix + +- preserve oauth2 token so auto-refresh works correctly +- customize app installer to configure farmos_url +- add some more info when viewing animal +- require minimum version for wuttaweb + ## v0.1.0 (2026-02-03) ### Feat diff --git a/README.md b/README.md index 5385326..301161c 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,4 @@ include: - possibly add more schema / extra features - possibly sync data back to farmOS - -## Quick Start - -Make a virtual environment and install the app: - - python3 -m venv .venv - .venv/bin/pip install -e . - .venv/bin/wuttafarm install - -For more info see -https://docs.wuttaproject.org/wuttjamaican/narr/install/index.html +See full docs at https://docs.wuttaproject.org/wuttafarm/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/.keepme b/docs/_static/.keepme new file mode 100644 index 0000000..e69de29 diff --git a/docs/api/wuttafarm.app.rst b/docs/api/wuttafarm.app.rst new file mode 100644 index 0000000..6d56e37 --- /dev/null +++ b/docs/api/wuttafarm.app.rst @@ -0,0 +1,6 @@ + +``wuttafarm.app`` +================= + +.. automodule:: wuttafarm.app + :members: diff --git a/docs/api/wuttafarm.auth.rst b/docs/api/wuttafarm.auth.rst new file mode 100644 index 0000000..380c570 --- /dev/null +++ b/docs/api/wuttafarm.auth.rst @@ -0,0 +1,6 @@ + +``wuttafarm.auth`` +================== + +.. automodule:: wuttafarm.auth + :members: diff --git a/docs/api/wuttafarm.cli.base.rst b/docs/api/wuttafarm.cli.base.rst new file mode 100644 index 0000000..19afd5c --- /dev/null +++ b/docs/api/wuttafarm.cli.base.rst @@ -0,0 +1,6 @@ + +``wuttafarm.cli.base`` +====================== + +.. automodule:: wuttafarm.cli.base + :members: diff --git a/docs/api/wuttafarm.cli.import_farmos.rst b/docs/api/wuttafarm.cli.import_farmos.rst new file mode 100644 index 0000000..12a6d03 --- /dev/null +++ b/docs/api/wuttafarm.cli.import_farmos.rst @@ -0,0 +1,6 @@ + +``wuttafarm.cli.import_farmos`` +=============================== + +.. automodule:: wuttafarm.cli.import_farmos + :members: diff --git a/docs/api/wuttafarm.cli.install.rst b/docs/api/wuttafarm.cli.install.rst new file mode 100644 index 0000000..e825989 --- /dev/null +++ b/docs/api/wuttafarm.cli.install.rst @@ -0,0 +1,6 @@ + +``wuttafarm.cli.install`` +========================= + +.. automodule:: wuttafarm.cli.install + :members: diff --git a/docs/api/wuttafarm.cli.rst b/docs/api/wuttafarm.cli.rst new file mode 100644 index 0000000..beb05dd --- /dev/null +++ b/docs/api/wuttafarm.cli.rst @@ -0,0 +1,6 @@ + +``wuttafarm.cli`` +================= + +.. automodule:: wuttafarm.cli + :members: diff --git a/docs/api/wuttafarm.config.rst b/docs/api/wuttafarm.config.rst new file mode 100644 index 0000000..5dc3eb0 --- /dev/null +++ b/docs/api/wuttafarm.config.rst @@ -0,0 +1,6 @@ + +``wuttafarm.config`` +==================== + +.. automodule:: wuttafarm.config + :members: diff --git a/docs/api/wuttafarm.db.model.rst b/docs/api/wuttafarm.db.model.rst new file mode 100644 index 0000000..6de7095 --- /dev/null +++ b/docs/api/wuttafarm.db.model.rst @@ -0,0 +1,6 @@ + +``wuttafarm.db.model`` +====================== + +.. automodule:: wuttafarm.db.model + :members: diff --git a/docs/api/wuttafarm.db.rst b/docs/api/wuttafarm.db.rst new file mode 100644 index 0000000..c184f5b --- /dev/null +++ b/docs/api/wuttafarm.db.rst @@ -0,0 +1,6 @@ + +``wuttafarm.db`` +================ + +.. automodule:: wuttafarm.db + :members: diff --git a/docs/api/wuttafarm.farmos.handler.rst b/docs/api/wuttafarm.farmos.handler.rst new file mode 100644 index 0000000..7d7d918 --- /dev/null +++ b/docs/api/wuttafarm.farmos.handler.rst @@ -0,0 +1,6 @@ + +``wuttafarm.farmos.handler`` +============================ + +.. automodule:: wuttafarm.farmos.handler + :members: diff --git a/docs/api/wuttafarm.farmos.rst b/docs/api/wuttafarm.farmos.rst new file mode 100644 index 0000000..a61f198 --- /dev/null +++ b/docs/api/wuttafarm.farmos.rst @@ -0,0 +1,6 @@ + +``wuttafarm.farmos`` +==================== + +.. automodule:: wuttafarm.farmos + :members: diff --git a/docs/api/wuttafarm.importing.farmos.rst b/docs/api/wuttafarm.importing.farmos.rst new file mode 100644 index 0000000..b6e00b4 --- /dev/null +++ b/docs/api/wuttafarm.importing.farmos.rst @@ -0,0 +1,6 @@ + +``wuttafarm.importing.farmos`` +============================== + +.. automodule:: wuttafarm.importing.farmos + :members: diff --git a/docs/api/wuttafarm.importing.rst b/docs/api/wuttafarm.importing.rst new file mode 100644 index 0000000..5c331b9 --- /dev/null +++ b/docs/api/wuttafarm.importing.rst @@ -0,0 +1,6 @@ + +``wuttafarm.importing`` +======================= + +.. automodule:: wuttafarm.importing + :members: diff --git a/docs/api/wuttafarm.install.rst b/docs/api/wuttafarm.install.rst new file mode 100644 index 0000000..4cb2972 --- /dev/null +++ b/docs/api/wuttafarm.install.rst @@ -0,0 +1,6 @@ + +``wuttafarm.install`` +===================== + +.. automodule:: wuttafarm.install + :members: diff --git a/docs/api/wuttafarm.rst b/docs/api/wuttafarm.rst new file mode 100644 index 0000000..d7c5327 --- /dev/null +++ b/docs/api/wuttafarm.rst @@ -0,0 +1,6 @@ + +``wuttafarm`` +============= + +.. automodule:: wuttafarm + :members: diff --git a/docs/api/wuttafarm.web.app.rst b/docs/api/wuttafarm.web.app.rst new file mode 100644 index 0000000..5610e44 --- /dev/null +++ b/docs/api/wuttafarm.web.app.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.app`` +===================== + +.. automodule:: wuttafarm.web.app + :members: diff --git a/docs/api/wuttafarm.web.forms.rst b/docs/api/wuttafarm.web.forms.rst new file mode 100644 index 0000000..76c23cc --- /dev/null +++ b/docs/api/wuttafarm.web.forms.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.forms`` +======================= + +.. automodule:: wuttafarm.web.forms + :members: diff --git a/docs/api/wuttafarm.web.forms.schema.rst b/docs/api/wuttafarm.web.forms.schema.rst new file mode 100644 index 0000000..4606293 --- /dev/null +++ b/docs/api/wuttafarm.web.forms.schema.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.forms.schema`` +============================== + +.. automodule:: wuttafarm.web.forms.schema + :members: diff --git a/docs/api/wuttafarm.web.forms.widgets.rst b/docs/api/wuttafarm.web.forms.widgets.rst new file mode 100644 index 0000000..86f39f6 --- /dev/null +++ b/docs/api/wuttafarm.web.forms.widgets.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.forms.widgets`` +=============================== + +.. automodule:: wuttafarm.web.forms.widgets + :members: diff --git a/docs/api/wuttafarm.web.menus.rst b/docs/api/wuttafarm.web.menus.rst new file mode 100644 index 0000000..b278be0 --- /dev/null +++ b/docs/api/wuttafarm.web.menus.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.menus`` +======================= + +.. automodule:: wuttafarm.web.menus + :members: diff --git a/docs/api/wuttafarm.web.rst b/docs/api/wuttafarm.web.rst new file mode 100644 index 0000000..2d8295c --- /dev/null +++ b/docs/api/wuttafarm.web.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web`` +================= + +.. automodule:: wuttafarm.web + :members: diff --git a/docs/api/wuttafarm.web.static.rst b/docs/api/wuttafarm.web.static.rst new file mode 100644 index 0000000..512b04d --- /dev/null +++ b/docs/api/wuttafarm.web.static.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.static`` +======================== + +.. automodule:: wuttafarm.web.static + :members: diff --git a/docs/api/wuttafarm.web.subscribers.rst b/docs/api/wuttafarm.web.subscribers.rst new file mode 100644 index 0000000..d71b3e1 --- /dev/null +++ b/docs/api/wuttafarm.web.subscribers.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.subscribers`` +============================= + +.. automodule:: wuttafarm.web.subscribers + :members: diff --git a/docs/api/wuttafarm.web.util.rst b/docs/api/wuttafarm.web.util.rst new file mode 100644 index 0000000..21785e9 --- /dev/null +++ b/docs/api/wuttafarm.web.util.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.util`` +====================== + +.. automodule:: wuttafarm.web.util + :members: diff --git a/docs/api/wuttafarm.web.views.auth.rst b/docs/api/wuttafarm.web.views.auth.rst new file mode 100644 index 0000000..ef9c360 --- /dev/null +++ b/docs/api/wuttafarm.web.views.auth.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.auth`` +============================ + +.. automodule:: wuttafarm.web.views.auth + :members: diff --git a/docs/api/wuttafarm.web.views.common.rst b/docs/api/wuttafarm.web.views.common.rst new file mode 100644 index 0000000..3bf1b09 --- /dev/null +++ b/docs/api/wuttafarm.web.views.common.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.common`` +============================== + +.. automodule:: wuttafarm.web.views.common + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.animal_types.rst b/docs/api/wuttafarm.web.views.farmos.animal_types.rst new file mode 100644 index 0000000..f4a1cbe --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.animal_types.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.animal_types`` +=========================================== + +.. automodule:: wuttafarm.web.views.farmos.animal_types + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.animals.rst b/docs/api/wuttafarm.web.views.farmos.animals.rst new file mode 100644 index 0000000..4e20df6 --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.animals.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.animals`` +====================================== + +.. automodule:: wuttafarm.web.views.farmos.animals + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.asset_types.rst b/docs/api/wuttafarm.web.views.farmos.asset_types.rst new file mode 100644 index 0000000..6066efe --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.asset_types.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.asset_types`` +========================================== + +.. automodule:: wuttafarm.web.views.farmos.asset_types + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.groups.rst b/docs/api/wuttafarm.web.views.farmos.groups.rst new file mode 100644 index 0000000..464b617 --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.groups.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.groups`` +===================================== + +.. automodule:: wuttafarm.web.views.farmos.groups + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.land_assets.rst b/docs/api/wuttafarm.web.views.farmos.land_assets.rst new file mode 100644 index 0000000..2723ceb --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.land_assets.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.land_assets`` +========================================== + +.. automodule:: wuttafarm.web.views.farmos.land_assets + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.land_types.rst b/docs/api/wuttafarm.web.views.farmos.land_types.rst new file mode 100644 index 0000000..29a247d --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.land_types.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.land_types`` +========================================= + +.. automodule:: wuttafarm.web.views.farmos.land_types + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.log_types.rst b/docs/api/wuttafarm.web.views.farmos.log_types.rst new file mode 100644 index 0000000..c9d125a --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.log_types.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.log_types`` +======================================== + +.. automodule:: wuttafarm.web.views.farmos.log_types + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.logs_activity.rst b/docs/api/wuttafarm.web.views.farmos.logs_activity.rst new file mode 100644 index 0000000..fa6ed5b --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.logs_activity.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.logs_activity`` +============================================ + +.. automodule:: wuttafarm.web.views.farmos.logs_activity + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.master.rst b/docs/api/wuttafarm.web.views.farmos.master.rst new file mode 100644 index 0000000..ed212c8 --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.master.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.master`` +===================================== + +.. automodule:: wuttafarm.web.views.farmos.master + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.rst b/docs/api/wuttafarm.web.views.farmos.rst new file mode 100644 index 0000000..372b15a --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos`` +============================== + +.. automodule:: wuttafarm.web.views.farmos + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.structure_types.rst b/docs/api/wuttafarm.web.views.farmos.structure_types.rst new file mode 100644 index 0000000..249b674 --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.structure_types.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.structure_types`` +============================================== + +.. automodule:: wuttafarm.web.views.farmos.structure_types + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.structures.rst b/docs/api/wuttafarm.web.views.farmos.structures.rst new file mode 100644 index 0000000..1171abe --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.structures.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.structures`` +========================================= + +.. automodule:: wuttafarm.web.views.farmos.structures + :members: diff --git a/docs/api/wuttafarm.web.views.farmos.users.rst b/docs/api/wuttafarm.web.views.farmos.users.rst new file mode 100644 index 0000000..917b18e --- /dev/null +++ b/docs/api/wuttafarm.web.views.farmos.users.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views.farmos.users`` +==================================== + +.. automodule:: wuttafarm.web.views.farmos.users + :members: diff --git a/docs/api/wuttafarm.web.views.rst b/docs/api/wuttafarm.web.views.rst new file mode 100644 index 0000000..dbcd81d --- /dev/null +++ b/docs/api/wuttafarm.web.views.rst @@ -0,0 +1,6 @@ + +``wuttafarm.web.views`` +======================= + +.. automodule:: wuttafarm.web.views + :members: diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..f3fd9e2 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,40 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +from importlib.metadata import version as get_version + +project = "WuttaFarm" +copyright = "2026, Lance Edgar" +author = "Lance Edgar" +release = get_version("WuttaFarm") + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", + "sphinx.ext.todo", + "sphinxcontrib.programoutput", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +intersphinx_mapping = { + "wuttjamaican": ("https://docs.wuttaproject.org/wuttjamaican/", None), + "wutta-continuum": ("https://docs.wuttaproject.org/wutta-continuum/", None), +} + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "furo" +html_static_path = ["_static"] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..be04bee --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,84 @@ + +WuttaFarm +========= + +This is a Python web app (built with `WuttaWeb`_), to integrate with +and extend `farmOS`_. + +.. _WuttaWeb: https://wuttaproject.org +.. _farmOS: https://farmos.org + +It is just an experiment so far; the ideas I hope to play with +include: + +- display farmOS data directly, via real-time API fetch +- add "mirror" schema and sync data from farmOS to app DB (and display it) +- possibly add more schema / extra features +- possibly sync data back to farmOS + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + + +.. toctree:: + :maxdepth: 2 + :caption: Documentation: + + narr/install + narr/auth + narr/features + narr/cli + + +.. toctree:: + :maxdepth: 1 + :caption: Package API: + + api/wuttafarm + api/wuttafarm.app + api/wuttafarm.auth + api/wuttafarm.cli + api/wuttafarm.cli.base + api/wuttafarm.cli.import_farmos + api/wuttafarm.cli.install + api/wuttafarm.config + api/wuttafarm.db + api/wuttafarm.db.model + api/wuttafarm.farmos + api/wuttafarm.farmos.handler + api/wuttafarm.importing + api/wuttafarm.importing.farmos + api/wuttafarm.install + api/wuttafarm.web + api/wuttafarm.web.app + api/wuttafarm.web.forms + api/wuttafarm.web.forms.schema + api/wuttafarm.web.forms.widgets + api/wuttafarm.web.menus + api/wuttafarm.web.static + api/wuttafarm.web.subscribers + api/wuttafarm.web.util + api/wuttafarm.web.views + api/wuttafarm.web.views.auth + api/wuttafarm.web.views.common + api/wuttafarm.web.views.farmos + api/wuttafarm.web.views.farmos.animals + api/wuttafarm.web.views.farmos.animal_types + api/wuttafarm.web.views.farmos.asset_types + api/wuttafarm.web.views.farmos.groups + api/wuttafarm.web.views.farmos.land_assets + api/wuttafarm.web.views.farmos.land_types + api/wuttafarm.web.views.farmos.logs_activity + api/wuttafarm.web.views.farmos.log_types + api/wuttafarm.web.views.farmos.master + api/wuttafarm.web.views.farmos.structures + api/wuttafarm.web.views.farmos.structure_types + api/wuttafarm.web.views.farmos.users + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/narr/auth.rst b/docs/narr/auth.rst new file mode 100644 index 0000000..536f3d0 --- /dev/null +++ b/docs/narr/auth.rst @@ -0,0 +1,58 @@ + +============== +Authentication +============== + +At the moment, the expected user login process is as follows: + + +First Launch +------------ + +When you first visit the app, it will not have any user accounts so +you will be shown a form to create one. + +The username should ideally match your main (daily driver) username +within farmOS. The password you give can be anything though, does not +need to (and perhaps should not) match farmOS. + +This account will belong to the Administrator role within WuttaFarm, +which means it can "become root" (same concept as ``sudo`` basically). + +Once the account is created you will be shown the normal login page. +Go ahead and login with this account using the username and password +you gave it. But then you should logout again, for the next step. + + +OAuth2 +------ + +The assumption (for now) is that users will login via farmOS / OAuth2 +for normal operations. Doing so will embed the access token within +the WuttaFarm app user session, which means the user can actually +browse farmOS data within the WuttaFarm views. + +.. note:: + + If you login to WuttaFarm directly with username/password, then + your user session will not have a farmOS access token and so the + farmOS data views in WuttaFarm will not work (i.e. anything under + the **farmOS** menu). + + (However this does not affect the "native" data views for + WuttaFarm. Users can see data which was already imported from + farmOS without an access token - if they have appropriate + permissions in WuttaFarm.) + +On the login page, click the "Login via farmOS / OAuth2" button. This +will initiate the OAuth2 workflow, at which point you may be asked to +login to farmOS (if you're not already) and if you wish to grant +access to the 3rd party app (WuttaFarm; if you didn't already). + +If all goes well you should be back in WuttaFarm, logged in as the +same username you have in farmOS. + +Note that your first admin user in WuttaFarm ideally *should* have the +same username as farmOS, but regardless when you login via OAuth2, a +user account will be automatically created if necessary in WuttaFarm, +with that same username. diff --git a/docs/narr/cli.rst b/docs/narr/cli.rst new file mode 100644 index 0000000..70b7c1e --- /dev/null +++ b/docs/narr/cli.rst @@ -0,0 +1,39 @@ + +======================== + Command Line Interface +======================== + +WuttaFarm ships with the following commands. + +For more general info about CLI see +:doc:`wuttjamaican:narr/cli/index`. + + +.. _wuttafarm-install: + +``wuttafarm install`` +--------------------- + +Run the WuttaFarm app installer. + +This will create the :term:`app dir` and initial config files, and +create the schema within the :term:`app database`. + +Defined in: :mod:`wuttafarm.cli.install` + +.. program-output:: wuttafarm install --help + + +.. _wuttafarm-import-farmos: + +``wuttafarm import-farmos`` +--------------------------- + +Import data from the farmOS API into the WuttaFarm :term:`app +database`. + +Defined in: :mod:`wuttafarm.cli.import_farmos` + +.. program-output:: wuttafarm import-farmos --help + + diff --git a/docs/narr/features.rst b/docs/narr/features.rst new file mode 100644 index 0000000..f072b41 --- /dev/null +++ b/docs/narr/features.rst @@ -0,0 +1,122 @@ + +======== +Features +======== + +Here is the list of features currently supported: + +* login via farmOS / OAuth2 workflows + * Authorization Code workflow is supported + * (technically, Password Grant workflow is also supported, for now) + +* view some farmOS data directly + * limited data is fetched via farmOS API for several views + * performance isn't bad, but data is not very "complete" + * more data could be fetched, but not sure this is the best way..? + +* import some data from farmOS + * limited data is imported from farmOS API into native app tables + * this data is exposed in views, similar to direct farmOS views (above) + +* export some data back to farmOS + * limited data is exported back via farmOS API, from native tables + * supported tables are auto-synced when a record is created/updated + * AnimalType + * AnimalAsset + * GroupAsset + * LandAsset + * StructureAsset + + +How I Use This App +------------------ + +My production farmOS instance is deployed via Podman container, which +I prefer over Docker. (Not that I know much about any of that +really.) It has a PostgreSQL database which runs in a separate +container. + +My production WuttaFarm instance is installed directly on the same +host machine, in a Python virtual environment. PostgreSQL is also +installed on the host machine; the app uses that for DB. + +I ran the initial "special" import to establish the user accounts; +then I ran the "full" import (farmOS → WuttaFarm). See also +:doc:`/narr/install`. + +I configured a cron job to run the full import every night, but in +dry-run mode with warnings. This means I will get an email if +WuttaFarm is ever out of sync with farmOS. + +With all that in place, I can use WuttaFarm as my "daily driver" to +add/edit assets (and soon, logs). Changes I make are immediately +synced to farmOS, so as long as the overnight check does not send me +an email, I know everything is good. + + +Roadmap +------- + +Here are some things I still have planned so far: + +* finish support for auto-sync, in current asset models + * must make "asset parents" editable + +* add more asset models? + * i may only add those i need for now, but others can add more + +* flesh out the log model support + * add more tables, fields to schema + * add/improve import and export + * basically this should be as good as the asset model support + * although again i may only add those i need for now + +* add custom "quick forms" for assets and logs + * again i probably will just add a few (e.g. egg collection) + * but this could be an interesting path to go down, we'll see + +* add custom "CSV/file importers" + * the framework has some pretty neat tools around this, so.. + * ..even if i don't need CSV import i'd like to show what's possible + +Notably **off the table** for now are: + +* anything involving maps +* file/image attachments + +I will just import "thumbnail" and "large" image URLs from farmOS for +each asset for now. Will have to think more on the image/attachment +stuff before I'll know if/how to add support in WuttaFarm. + +Maps will wait mostly because I have never done anything involving +those (or GIS etc. - if that's even the right term). And anyway the +main "use" for this app is probably around data entry, so it may never +"need" maps support. + + +Screenshots +----------- + + +Login Screen +~~~~~~~~~~~~ + +.. image:: https://wuttaproject.org/images/wuttafarm/screenshot001.png + + +List All Assets +~~~~~~~~~~~~~~~ + +.. image:: https://wuttaproject.org/images/wuttafarm/screenshot002.png + + +View Animal Asset +~~~~~~~~~~~~~~~~~ + +.. image:: https://wuttaproject.org/images/wuttafarm/screenshot003.png + + +Edit Animal Asset +~~~~~~~~~~~~~~~~~ + +.. image:: https://wuttaproject.org/images/wuttafarm/screenshot004.png diff --git a/docs/narr/install.rst b/docs/narr/install.rst new file mode 100644 index 0000000..ba5d8e3 --- /dev/null +++ b/docs/narr/install.rst @@ -0,0 +1,185 @@ + +============== + Installation +============== + +For now, these instructions mostly reflect my own dev workflow. It +uses a Python virtual environment but no (Docker) containers. + +Eventually it may make sense to add production deployment steps using +Docker etc. - but that will wait for now. + + +Requirements +------------ + +WuttaFarm is designed to run on a (Debian-based) Linux machine; YMMV +with others. + + +farmOS +~~~~~~ + +First you must have a *production* `farmOS`_ instance running +somewhere. For more on that see `Hosting farmOS`_. + +.. _farmOS: https://farmos.org +.. _Hosting farmOS: https://farmos.org/hosting/ + +This must use HTTPS for the OAuth2 workflows to work correctly. (Not +sure but it may also need to be at the root of the domain, i.e. no +subpath.) + + +Database +~~~~~~~~ + +You also must create a PostgreSQL (or MySQL) database for the +WuttaFarm app to use. See also :ref:`wuttjamaican:create-appdb`. + + +App Setup +--------- + +The short version: + +.. code-block:: sh + + python3 -m venv ./venv + ./venv/bin/pip install WuttaFarm + ./venv/bin/wuttafarm install + +The app installer (last command above) will prompt you for DB +credentials, and the farmOS URL. + +One of the questions is about data versioning with +:doc:`wutta-continuum:index`. You should probaby enable that even +though as of writing the default is disabled. It adds "revision +history" for most types of records in the WuttaFarm app DB. + +When the installer completes it will output a command you can then use +to run the web app. Do that and you can then view the app in a +browser at http://localhost:9080 + + +OAuth2 Setup +------------ + +At this point the web app should be ready for OAuth2 login; however +the OAuth2 provider in farmOS needs some more config before it will +work. + +WuttaFarm uses the default ``farm`` consumer, so the only thing you +should have to do here is edit that to add your redirect URL. This +will vary based on your WuttaFarm site name, e.g. + +.. code-block:: none + + https://wuttafarm.example.com/farmos/oauth/callback + +With that in place you should be able to login via OAuth2; see also +:doc:`/narr/auth`. + +However while you're there, you should also do some setup for the sake +of the farmOS → WuttaFarm data import. This import will also use the +farmOS API and therefore also needs an oauth2 access token; however it +uses the Client Credentials workflow instead of the Authorization Code +workflow. Therefore you must create a new *user* and a new OAuth2 +*consumer* for it. + +First add a new user in farmOS, named ``wuttafarm``. It should +probably be given the Manager role, since WuttaFarm will eventually +also support "exporting" data back to farmOS. + +Then add a new OAuth2 consumer (aka. client) with these attributes: + +* **Label:** WuttaFarm +* **Client ID:** wuttafarm +* **New Secret:** (put something in here, to be used as client secret) +* **Grant Types:** Client Credentials, Refresh Token (maybe more?) +* **User:** wuttafarm +* **3rd Party?** yes +* **Confidential?** yes +* **Access Token Expiration Time:** maybe set to 3600? or maybe 300 + default is okay? +* **Allowed Origins:** put your oauth callback URL here (same as for + default ``farm`` consumer) + +WuttaFarm also needs to know the client secret for sake of running the +import; so add this to your ``app/wutta.conf`` file. Of course +replace the value with whatever client secret you gave the new +consumer: + +.. code-block:: ini + + [farmos.oauth2] + importing.client_secret = you_cant_guess_me + + +Email Setup +----------- + +WuttaFarm can send emails of various kinds; of note are: + +* when user submits Feedback via button in top right of screen +* importer diff warning for farmOS → WuttaFarm + +That last one is optional, triggered via the ``-W`` flag in the +importer command line. + +Anyway the app basically assumes there is a Postfix or similar mail +server running on "localhost" which it can use as the SMTP server, and +which is in turn responsible for "really" sending the email out via +some configured relay. This has always worked very well for me since +I tend to want to have email working for other reasons on each Linux +server I maintain. (And since I have not traditionally used Docker +and/or containers.) + +So if you need something else, touch base and we'll figure something +out. But assuming localhost is okay to use: + +In the web app menu, see Admin -> App Info and then click Configure. +Check the box to enable email and plug in the default sender and +recipient (which should be the admin responsible for the app). I +often create an alias so I can use e.g. wuttafarm@edbob.org as +sender - aliased back to myself in case it generates bounces so I can +see them. + +From there you can also see Admin -> Email Settings in the menu; this +lets you control and preview each type of email separately. + + +Import Data from farmOS +----------------------- + +You must have done all the OAuth2 setup (previous section) before the +import will work. + +But now that you did all that, importing should be quick and easy. + +The very first import will be limited and "special" to account for any +users which were already created in WuttaFarm. This command will +ensure WuttaFarm gets *all* user accounts and each is appropriately +mapped to the farmOS account: + +.. code-block:: sh + + ./venv/bin/wuttafarm --runas farmos import-farmos User --key username + +Note also the ``--runas farmos`` arg which helps the WuttaFarm data +versioning know "who" is responsible for the changes. We use a +dedicated ``farmos`` user account in WuttaFarm, to represent the +farmOS system as a whole. + +From now on you can run the "full" import normally: + +.. code-block:: sh + + ./venv/bin/wuttafarm --runas farmos import-farmos + +And it can sometimes be helpful to "double-check" in order to make +sure all data is fully synced: + +.. code-block:: sh + + ./venv/bin/wuttafarm --runas farmos import-farmos --delete --dry-run -W diff --git a/pyproject.toml b/pyproject.toml index c159419..1bb1dda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "WuttaFarm" -version = "0.1.0" +version = "0.8.0" description = "Web app to integrate with and extend farmOS" readme = "README.md" authors = [ @@ -31,28 +31,42 @@ license = {text = "GNU General Public License v3"} dependencies = [ "farmOS", "psycopg2", - "WuttaWeb[continuum]", + "pyramid_exclog", + "uvicorn[standard]", + "WuttaSync", + "WuttaWeb[continuum]>=0.29.0", ] +[project.optional-dependencies] +docs = ["Sphinx", "furo", "sphinxcontrib-programoutput"] + + [project.scripts] "wuttafarm" = "wuttafarm.cli:wuttafarm_typer" [project.entry-points."paste.app_factory"] "main" = "wuttafarm.web.app:main" +[project.entry-points."wutta.app.providers"] +wuttafarm = "wuttafarm.app:WuttaFarmAppProvider" + [project.entry-points."wutta.config.extensions"] "wuttafarm" = "wuttafarm.config:WuttaFarmConfig" [project.entry-points."wutta.web.menus"] "wuttafarm" = "wuttafarm.web.menus:WuttaFarmMenuHandler" +[project.entry-points."wuttasync.importing"] +"export.to_farmos.from_wuttafarm" = "wuttafarm.farmos.importing.wuttafarm:FromWuttaFarmToFarmOS" +"import.to_wuttafarm.from_farmos" = "wuttafarm.importing.farmos:FromFarmOSToWuttaFarm" + [project.urls] -Homepage = "https://forgejo.wuttaproject.org/lance/wuttafarm" -Repository = "https://forgejo.wuttaproject.org/lance/wuttafarm" -Issues = "https://forgejo.wuttaproject.org/lance/wuttafarm/issues" -Changelog = "https://forgejo.wuttaproject.org/lance/wuttafarm/src/branch/master/CHANGELOG.md" +Homepage = "https://forgejo.wuttaproject.org/wutta/wuttafarm" +Repository = "https://forgejo.wuttaproject.org/wutta/wuttafarm" +Issues = "https://forgejo.wuttaproject.org/wutta/wuttafarm/issues" +Changelog = "https://forgejo.wuttaproject.org/wutta/wuttafarm/src/branch/master/CHANGELOG.md" [tool.commitizen] @@ -62,3 +76,8 @@ update_changelog_on_bump = true [tool.hatch.build.targets.wheel] packages = ["src/wuttafarm"] + +[tool.hatch.build.targets.sdist] +exclude = [ + "style/node_modules/", +] diff --git a/src/wuttafarm/app.py b/src/wuttafarm/app.py index bafbdad..cb9aed3 100644 --- a/src/wuttafarm/app.py +++ b/src/wuttafarm/app.py @@ -31,7 +31,25 @@ class WuttaFarmAppHandler(base.AppHandler): Custom :term:`app handler` for WuttaFarm. """ + display_format_datetime = "%a, %m/%d/%Y - %H:%M" + default_auth_handler_spec = "wuttafarm.auth:WuttaFarmAuthHandler" + default_install_handler_spec = "wuttafarm.install:WuttaFarmInstallHandler" + + def get_asset_handler(self): + """ + Get the configured asset handler. + + :rtype: :class:`~wuttafarm.assets.AssetHandler` + """ + if "asset" not in self.handlers: + spec = self.config.get( + f"{self.appname}.asset_handler", + default="wuttafarm.assets:AssetHandler", + ) + factory = self.load_object(spec) + self.handlers["asset"] = factory(self.config) + return self.handlers["asset"] def get_farmos_handler(self): """ @@ -42,16 +60,167 @@ class WuttaFarmAppHandler(base.AppHandler): if "farmos" not in self.handlers: spec = self.config.get( f"{self.appname}.farmos_handler", - default="wuttafarm.farmos:FarmOSHandler", + default="wuttafarm.farmos.handler:FarmOSHandler", ) factory = self.load_object(spec) self.handlers["farmos"] = factory(self.config) return self.handlers["farmos"] + def get_farmos_integration_mode(self): + """ + Returns the integration mode for farmOS, i.e. to control the + app's behavior regarding that. + """ + enum = self.enum + return self.config.get( + f"{self.appname}.farmos_integration_mode", + default=enum.FARMOS_INTEGRATION_MODE_WRAPPER, + ) + + def is_farmos_mirror(self): + """ + Returns ``True`` if the app is configured in "mirror" + integration mode with regard to farmOS. + """ + enum = self.enum + mode = self.get_farmos_integration_mode() + return mode == enum.FARMOS_INTEGRATION_MODE_MIRROR + + def is_farmos_wrapper(self): + """ + Returns ``True`` if the app is configured in "wrapper" + integration mode with regard to farmOS. + """ + enum = self.enum + mode = self.get_farmos_integration_mode() + return mode == enum.FARMOS_INTEGRATION_MODE_WRAPPER + + def is_standalone(self): + """ + Returns ``True`` if the app is configured in "standalone" mode + with regard to farmOS. + """ + enum = self.enum + mode = self.get_farmos_integration_mode() + return mode == enum.FARMOS_INTEGRATION_MODE_NONE + def get_farmos_url(self, *args, **kwargs): """ Get a farmOS URL. This is a convenience wrapper around - :meth:`~wuttafarm.farmos.FarmOSHandler.get_farmos_url()`. + :meth:`~wuttafarm.farmos.handler.FarmOSHandler.get_farmos_url()`. """ handler = self.get_farmos_handler() return handler.get_farmos_url(*args, **kwargs) + + def get_farmos_client(self, *args, **kwargs): + """ + Get a farmOS client. This is a convenience wrapper around + :meth:`~wuttafarm.farmos.handler.FarmOSHandler.get_farmos_client()`. + """ + handler = self.get_farmos_handler() + return handler.get_farmos_client(*args, **kwargs) + + def is_farmos_3x(self, *args, **kwargs): + """ + Check if the farmOS version is 3.x. This is a convenience + wrapper around + :meth:`~wuttafarm.farmos.handler.FarmOSHandler.is_farmos_3x()`. + """ + handler = self.get_farmos_handler() + return handler.is_farmos_3x(*args, **kwargs) + + def is_farmos_4x(self, *args, **kwargs): + """ + Check if the farmOS version is 4.x. This is a convenience + wrapper around + :meth:`~wuttafarm.farmos.handler.FarmOSHandler.is_farmos_4x()`. + """ + handler = self.get_farmos_handler() + return handler.is_farmos_4x(*args, **kwargs) + + def get_normalizer(self, farmos_client=None): + """ + Get the configured farmOS integration handler. + + :rtype: :class:`~wuttafarm.farmos.FarmOSHandler` + """ + spec = self.config.get( + f"{self.appname}.normalizer_spec", + default="wuttafarm.normal:Normalizer", + ) + factory = self.load_object(spec) + return factory(self.config, farmos_client) + + def auto_sync_to_farmos(self, obj, model_name=None, client=None, require=True): + """ + Export the given object to farmOS, using configured handler. + + This should ensure the given object is also *updated* with the + farmOS UUID and Drupal ID, when new record is created in + farmOS. + + :param obj: Any data object in WuttaFarm, e.g. AnimalAsset + instance. + + :param client: Existing farmOS API client to use. If not + specified, a new one will be instantiated. + + :param require: If true, this will *require* the export + handler to support objects of the given type. If false, + then nothing will happen / export is silently skipped when + there is no such exporter. + """ + handler = self.app.get_import_handler("export.to_farmos.from_wuttafarm") + + if not model_name: + model_name = type(obj).__name__ + if model_name not in handler.importers: + if require: + raise ValueError(f"no exporter found for {model_name}") + return + + # nb. begin txn to establish the API client + handler.begin_target_transaction(client) + importer = handler.get_importer(model_name, caches_target=False) + normal = importer.normalize_source_object(obj) + importer.process_data(source_data=[normal]) + + def auto_sync_from_farmos(self, obj, model_name, client=None, require=True): + """ + Import the given object from farmOS, using configured handler. + + :param obj: Any data record from farmOS. + + :param model_name': Model name for the importer to use, + e.g. ``"AnimalAsset"``. + + :param client: Existing farmOS API client to use. If not + specified, a new one will be instantiated. + + :param require: If true, this will *require* the import + handler to support objects of the given type. If false, + then nothing will happen / import is silently skipped when + there is no such importer. + """ + handler = self.app.get_import_handler("import.to_wuttafarm.from_farmos") + + if model_name not in handler.importers: + if require: + raise ValueError(f"no importer found for {model_name}") + return + + # nb. begin txn to establish the API client + handler.begin_source_transaction(client) + with self.short_session(commit=True) as session: + handler.target_session = session + importer = handler.get_importer(model_name, caches_target=False) + normal = importer.normalize_source_object(obj) + importer.process_data(source_data=[normal]) + + +class WuttaFarmAppProvider(base.AppProvider): + """ + The :term:`app provider` for WuttaFarm. + """ + + email_modules = ["wuttafarm.emails"] diff --git a/src/wuttafarm/assets.py b/src/wuttafarm/assets.py new file mode 100644 index 0000000..36d3b22 --- /dev/null +++ b/src/wuttafarm/assets.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Asset handler +""" + +from wuttjamaican.app import GenericHandler + + +class AssetHandler(GenericHandler): + """ + Base class and default implementation for the asset + :term:`handler`. + """ + + def get_groups(self, asset): + model = self.app.model + session = self.app.get_session(asset) + + grplog = ( + session.query(model.Log) + .join(model.LogAsset) + .filter(model.LogAsset.asset == asset) + .filter(model.Log.is_group_assignment == True) + .order_by(model.Log.timestamp.desc()) + .first() + ) + if grplog: + return grplog.groups + return [] + + def get_locations(self, asset): + model = self.app.model + session = self.app.get_session(asset) + + loclog = ( + session.query(model.Log) + .join(model.LogAsset) + .filter(model.LogAsset.asset == asset) + .filter(model.Log.is_movement == True) + .order_by(model.Log.timestamp.desc()) + .first() + ) + if loclog: + return loclog.locations + return [] diff --git a/src/wuttafarm/auth.py b/src/wuttafarm/auth.py index ab3f67a..1155046 100644 --- a/src/wuttafarm/auth.py +++ b/src/wuttafarm/auth.py @@ -25,7 +25,6 @@ Auth handler for use with farmOS from uuid import UUID -from farmOS import farmOS from oauthlib.oauth2.rfc6749.errors import InvalidGrantError from sqlalchemy import orm @@ -89,8 +88,7 @@ class WuttaFarmAuthHandler(AuthHandler): return None def get_farmos_oauth2_token(self, username, password): - url = self.app.get_farmos_url() - client = farmOS(url) + client = self.app.get_farmos_client() try: return client.authorize(username=username, password=password) except InvalidGrantError: diff --git a/src/wuttafarm/cli/__init__.py b/src/wuttafarm/cli/__init__.py new file mode 100644 index 0000000..cd06344 --- /dev/null +++ b/src/wuttafarm/cli/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +WuttaFarm CLI +""" + +from .base import wuttafarm_typer + +# nb. must bring in all modules for discovery to work +from . import export_farmos +from . import import_farmos +from . import install diff --git a/src/wuttafarm/cli/base.py b/src/wuttafarm/cli/base.py new file mode 100644 index 0000000..de16ead --- /dev/null +++ b/src/wuttafarm/cli/base.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +WuttaFarm CLI - base Typer instance +""" + +from wuttjamaican.cli import make_typer + + +wuttafarm_typer = make_typer( + name="wuttafarm", help="WuttaFarm -- Web app to integrate with and extend farmOS" +) diff --git a/src/wuttafarm/cli/export_farmos.py b/src/wuttafarm/cli/export_farmos.py new file mode 100644 index 0000000..18a21dd --- /dev/null +++ b/src/wuttafarm/cli/export_farmos.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +See also: :ref:`wuttafarm-export-farmos` +""" + +import typer + +from wuttasync.cli import import_command, ImportCommandHandler + +from wuttafarm.cli import wuttafarm_typer + + +@wuttafarm_typer.command() +@import_command +def export_farmos(ctx: typer.Context, **kwargs): + """ + Export data from WuttaFarm to farmOS API + """ + config = ctx.parent.wutta_config + handler = ImportCommandHandler(config, key="export.to_farmos.from_wuttafarm") + handler.run(ctx) diff --git a/src/wuttafarm/cli/import_farmos.py b/src/wuttafarm/cli/import_farmos.py new file mode 100644 index 0000000..4343d43 --- /dev/null +++ b/src/wuttafarm/cli/import_farmos.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +See also: :ref:`wuttafarm-import-farmos` +""" + +import typer + +from wuttasync.cli import import_command, ImportCommandHandler + +from wuttafarm.cli import wuttafarm_typer + + +@wuttafarm_typer.command() +@import_command +def import_farmos(ctx: typer.Context, **kwargs): + """ + Import data from farmOS API to WuttaFarm + """ + config = ctx.parent.wutta_config + handler = ImportCommandHandler(config, key="import.to_wuttafarm.from_farmos") + handler.run(ctx) diff --git a/src/wuttafarm/cli.py b/src/wuttafarm/cli/install.py similarity index 89% rename from src/wuttafarm/cli.py rename to src/wuttafarm/cli/install.py index 2f377a3..c82dab2 100644 --- a/src/wuttafarm/cli.py +++ b/src/wuttafarm/cli/install.py @@ -25,12 +25,7 @@ WuttaFarm CLI import typer -from wuttjamaican.cli import make_typer - - -wuttafarm_typer = make_typer( - name="wuttafarm", help="WuttaFarm -- Web app to integrate with and extend farmOS" -) +from wuttafarm.cli import wuttafarm_typer @wuttafarm_typer.command() diff --git a/src/wuttafarm/config.py b/src/wuttafarm/config.py index fcc8aae..b0c860b 100644 --- a/src/wuttafarm/config.py +++ b/src/wuttafarm/config.py @@ -23,6 +23,8 @@ WuttaFarm config extensions """ +import os + from wuttjamaican.conf import WuttaConfigExtension @@ -39,19 +41,26 @@ class WuttaFarmConfig(WuttaConfigExtension): config.setdefault(f"{config.appname}.app_title", "WuttaFarm") config.setdefault(f"{config.appname}.app_dist", "WuttaFarm") - # app model + # app model/enum config.setdefault(f"{config.appname}.model_spec", "wuttafarm.db.model") + config.setdefault(f"{config.appname}.enum_spec", "wuttafarm.enum") # app handler config.setdefault( f"{config.appname}.app.handler", "wuttafarm.app:WuttaFarmAppHandler" ) - # web app menu + # web app stuff config.setdefault( - f"{config.appname}.web.menus.handler.spec", + f"{config.appname}.web.menus.handler.default_spec", "wuttafarm.web.menus:WuttaFarmMenuHandler", ) + config.setdefault("wuttaweb.grids.default_pagesize", "50") # web app libcache # config.setdefault('wuttaweb.static_libcache.module', 'wuttafarm.web.static') + + # maybe override cert validation for requests lib. + # nb. this is "global" and not "specific" to the farmos API requests! + if bundle := config.get(f"{config.appname}.requests_ca_bundle"): + os.environ.setdefault("REQUESTS_CA_BUNDLE", bundle) diff --git a/src/wuttafarm/db/alembic/versions/0771322957bd_add_log_is_movement.py b/src/wuttafarm/db/alembic/versions/0771322957bd_add_log_is_movement.py new file mode 100644 index 0000000..0aa9d54 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/0771322957bd_add_log_is_movement.py @@ -0,0 +1,37 @@ +"""add Log.is_movement + +Revision ID: 0771322957bd +Revises: 12de43facb95 +Create Date: 2026-03-02 20:21:03.889847 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "0771322957bd" +down_revision: Union[str, None] = "12de43facb95" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log + op.add_column("log", sa.Column("is_movement", sa.Boolean(), nullable=True)) + op.add_column( + "log_version", + sa.Column("is_movement", sa.Boolean(), autoincrement=False, nullable=True), + ) + + +def downgrade() -> None: + + # log + op.drop_column("log_version", "is_movement") + op.drop_column("log", "is_movement") diff --git a/src/wuttafarm/db/alembic/versions/11e0e46f48a6_add_plant_assets_and_more_logs.py b/src/wuttafarm/db/alembic/versions/11e0e46f48a6_add_plant_assets_and_more_logs.py new file mode 100644 index 0000000..7df55c4 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/11e0e46f48a6_add_plant_assets_and_more_logs.py @@ -0,0 +1,596 @@ +"""add Plant Assets and more Logs + +Revision ID: 11e0e46f48a6 +Revises: dd6351e69233 +Create Date: 2026-02-18 18:11:46.536930 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "11e0e46f48a6" +down_revision: Union[str, None] = "dd6351e69233" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # plant_type + op.create_table( + "plant_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("description", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_plant_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_plant_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_plant_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_plant_type_name")), + ) + op.create_table( + "plant_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "description", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_plant_type_version") + ), + ) + op.create_index( + op.f("ix_plant_type_version_end_transaction_id"), + "plant_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_plant_type_version_operation_type"), + "plant_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_plant_type_version_pk_transaction_id", + "plant_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_plant_type_version_pk_validity", + "plant_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_plant_type_version_transaction_id"), + "plant_type_version", + ["transaction_id"], + unique=False, + ) + + # asset_plant + op.create_table( + "asset_plant", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["uuid"], ["asset.uuid"], name=op.f("fk_asset_plant_uuid_asset") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_plant")), + ) + op.create_table( + "asset_plant_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_plant_version") + ), + ) + op.create_index( + op.f("ix_asset_plant_version_end_transaction_id"), + "asset_plant_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_plant_version_operation_type"), + "asset_plant_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_plant_version_pk_transaction_id", + "asset_plant_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_plant_version_pk_validity", + "asset_plant_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_plant_version_transaction_id"), + "asset_plant_version", + ["transaction_id"], + unique=False, + ) + + # asset_plant_plant_type + op.create_table( + "asset_plant_plant_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("plant_asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("plant_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["plant_asset_uuid"], + ["asset_plant.uuid"], + name=op.f("fk_asset_plant_plant_type_plant_asset_uuid_asset_plant"), + ), + sa.ForeignKeyConstraint( + ["plant_type_uuid"], + ["plant_type.uuid"], + name=op.f("fk_asset_plant_plant_type_plant_type_uuid_plant_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_plant_plant_type")), + ) + op.create_table( + "asset_plant_plant_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "plant_asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "plant_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_plant_plant_type_version") + ), + ) + op.create_index( + op.f("ix_asset_plant_plant_type_version_end_transaction_id"), + "asset_plant_plant_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_plant_plant_type_version_operation_type"), + "asset_plant_plant_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_plant_plant_type_version_pk_transaction_id", + "asset_plant_plant_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_plant_plant_type_version_pk_validity", + "asset_plant_plant_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_plant_plant_type_version_transaction_id"), + "asset_plant_plant_type_version", + ["transaction_id"], + unique=False, + ) + + # log_asset + op.create_table( + "log_asset", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("log_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["asset_uuid"], ["asset.uuid"], name=op.f("fk_log_asset_asset_uuid_asset") + ), + sa.ForeignKeyConstraint( + ["log_uuid"], ["log.uuid"], name=op.f("fk_log_asset_log_uuid_log") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_asset")), + ) + op.create_table( + "log_asset_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "log_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_asset_version") + ), + ) + op.create_index( + op.f("ix_log_asset_version_end_transaction_id"), + "log_asset_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_asset_version_operation_type"), + "log_asset_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_asset_version_pk_transaction_id", + "log_asset_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_asset_version_pk_validity", + "log_asset_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_asset_version_transaction_id"), + "log_asset_version", + ["transaction_id"], + unique=False, + ) + + # log_harvest + op.create_table( + "log_harvest", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["uuid"], ["log.uuid"], name=op.f("fk_log_harvest_uuid_log") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_harvest")), + ) + op.create_table( + "log_harvest_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_harvest_version") + ), + ) + op.create_index( + op.f("ix_log_harvest_version_end_transaction_id"), + "log_harvest_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_harvest_version_operation_type"), + "log_harvest_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_harvest_version_pk_transaction_id", + "log_harvest_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_harvest_version_pk_validity", + "log_harvest_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_harvest_version_transaction_id"), + "log_harvest_version", + ["transaction_id"], + unique=False, + ) + + # log_medical + op.create_table( + "log_medical", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["uuid"], ["log.uuid"], name=op.f("fk_log_medical_uuid_log") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_medical")), + ) + op.create_table( + "log_medical_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_medical_version") + ), + ) + op.create_index( + op.f("ix_log_medical_version_end_transaction_id"), + "log_medical_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_medical_version_operation_type"), + "log_medical_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_medical_version_pk_transaction_id", + "log_medical_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_medical_version_pk_validity", + "log_medical_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_medical_version_transaction_id"), + "log_medical_version", + ["transaction_id"], + unique=False, + ) + + # log_observation + op.create_table( + "log_observation", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["uuid"], ["log.uuid"], name=op.f("fk_log_observation_uuid_log") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_observation")), + ) + op.create_table( + "log_observation_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_observation_version") + ), + ) + op.create_index( + op.f("ix_log_observation_version_end_transaction_id"), + "log_observation_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_observation_version_operation_type"), + "log_observation_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_observation_version_pk_transaction_id", + "log_observation_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_observation_version_pk_validity", + "log_observation_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_observation_version_transaction_id"), + "log_observation_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_observation + op.drop_index( + op.f("ix_log_observation_version_transaction_id"), + table_name="log_observation_version", + ) + op.drop_index( + "ix_log_observation_version_pk_validity", table_name="log_observation_version" + ) + op.drop_index( + "ix_log_observation_version_pk_transaction_id", + table_name="log_observation_version", + ) + op.drop_index( + op.f("ix_log_observation_version_operation_type"), + table_name="log_observation_version", + ) + op.drop_index( + op.f("ix_log_observation_version_end_transaction_id"), + table_name="log_observation_version", + ) + op.drop_table("log_observation_version") + op.drop_table("log_observation") + + # log_medical + op.drop_index( + op.f("ix_log_medical_version_transaction_id"), table_name="log_medical_version" + ) + op.drop_index( + "ix_log_medical_version_pk_validity", table_name="log_medical_version" + ) + op.drop_index( + "ix_log_medical_version_pk_transaction_id", table_name="log_medical_version" + ) + op.drop_index( + op.f("ix_log_medical_version_operation_type"), table_name="log_medical_version" + ) + op.drop_index( + op.f("ix_log_medical_version_end_transaction_id"), + table_name="log_medical_version", + ) + op.drop_table("log_medical_version") + op.drop_table("log_medical") + + # log_harvest + op.drop_index( + op.f("ix_log_harvest_version_transaction_id"), table_name="log_harvest_version" + ) + op.drop_index( + "ix_log_harvest_version_pk_validity", table_name="log_harvest_version" + ) + op.drop_index( + "ix_log_harvest_version_pk_transaction_id", table_name="log_harvest_version" + ) + op.drop_index( + op.f("ix_log_harvest_version_operation_type"), table_name="log_harvest_version" + ) + op.drop_index( + op.f("ix_log_harvest_version_end_transaction_id"), + table_name="log_harvest_version", + ) + op.drop_table("log_harvest_version") + op.drop_table("log_harvest") + + # log_asset + op.drop_index( + op.f("ix_log_asset_version_transaction_id"), table_name="log_asset_version" + ) + op.drop_index("ix_log_asset_version_pk_validity", table_name="log_asset_version") + op.drop_index( + "ix_log_asset_version_pk_transaction_id", table_name="log_asset_version" + ) + op.drop_index( + op.f("ix_log_asset_version_operation_type"), table_name="log_asset_version" + ) + op.drop_index( + op.f("ix_log_asset_version_end_transaction_id"), table_name="log_asset_version" + ) + op.drop_table("log_asset_version") + op.drop_table("log_asset") + + # asset_plant_plant_type + op.drop_index( + op.f("ix_asset_plant_plant_type_version_transaction_id"), + table_name="asset_plant_plant_type_version", + ) + op.drop_index( + "ix_asset_plant_plant_type_version_pk_validity", + table_name="asset_plant_plant_type_version", + ) + op.drop_index( + "ix_asset_plant_plant_type_version_pk_transaction_id", + table_name="asset_plant_plant_type_version", + ) + op.drop_index( + op.f("ix_asset_plant_plant_type_version_operation_type"), + table_name="asset_plant_plant_type_version", + ) + op.drop_index( + op.f("ix_asset_plant_plant_type_version_end_transaction_id"), + table_name="asset_plant_plant_type_version", + ) + op.drop_table("asset_plant_plant_type_version") + op.drop_table("asset_plant_plant_type") + + # asset_plant + op.drop_index( + op.f("ix_asset_plant_version_transaction_id"), table_name="asset_plant_version" + ) + op.drop_index( + "ix_asset_plant_version_pk_validity", table_name="asset_plant_version" + ) + op.drop_index( + "ix_asset_plant_version_pk_transaction_id", table_name="asset_plant_version" + ) + op.drop_index( + op.f("ix_asset_plant_version_operation_type"), table_name="asset_plant_version" + ) + op.drop_index( + op.f("ix_asset_plant_version_end_transaction_id"), + table_name="asset_plant_version", + ) + op.drop_table("asset_plant_version") + op.drop_table("asset_plant") + + # plant_type + op.drop_index( + op.f("ix_plant_type_version_transaction_id"), table_name="plant_type_version" + ) + op.drop_index("ix_plant_type_version_pk_validity", table_name="plant_type_version") + op.drop_index( + "ix_plant_type_version_pk_transaction_id", table_name="plant_type_version" + ) + op.drop_index( + op.f("ix_plant_type_version_operation_type"), table_name="plant_type_version" + ) + op.drop_index( + op.f("ix_plant_type_version_end_transaction_id"), + table_name="plant_type_version", + ) + op.drop_table("plant_type_version") + op.drop_table("plant_type") diff --git a/src/wuttafarm/db/alembic/versions/12de43facb95_add_asset_owners.py b/src/wuttafarm/db/alembic/versions/12de43facb95_add_asset_owners.py new file mode 100644 index 0000000..67a4c25 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/12de43facb95_add_asset_owners.py @@ -0,0 +1,114 @@ +"""add Asset.owners + +Revision ID: 12de43facb95 +Revises: 85d4851e8292 +Create Date: 2026-03-02 19:03:35.511398 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "12de43facb95" +down_revision: Union[str, None] = "85d4851e8292" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_owner + op.create_table( + "asset_owner", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("user_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["asset_uuid"], ["asset.uuid"], name=op.f("fk_asset_owner_asset_uuid_asset") + ), + sa.ForeignKeyConstraint( + ["user_uuid"], ["user.uuid"], name=op.f("fk_asset_owner_user_uuid_user") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_owner")), + ) + op.create_table( + "asset_owner_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "user_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_owner_version") + ), + ) + op.create_index( + op.f("ix_asset_owner_version_end_transaction_id"), + "asset_owner_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_owner_version_operation_type"), + "asset_owner_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_owner_version_pk_transaction_id", + "asset_owner_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_owner_version_pk_validity", + "asset_owner_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_owner_version_transaction_id"), + "asset_owner_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # asset_owner + op.drop_index( + op.f("ix_asset_owner_version_transaction_id"), table_name="asset_owner_version" + ) + op.drop_index( + "ix_asset_owner_version_pk_validity", table_name="asset_owner_version" + ) + op.drop_index( + "ix_asset_owner_version_pk_transaction_id", table_name="asset_owner_version" + ) + op.drop_index( + op.f("ix_asset_owner_version_operation_type"), table_name="asset_owner_version" + ) + op.drop_index( + op.f("ix_asset_owner_version_end_transaction_id"), + table_name="asset_owner_version", + ) + op.drop_table("asset_owner_version") + op.drop_table("asset_owner") diff --git a/src/wuttafarm/db/alembic/versions/1b2d3224e5dc_add_animals.py b/src/wuttafarm/db/alembic/versions/1b2d3224e5dc_add_animals.py new file mode 100644 index 0000000..78400ac --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/1b2d3224e5dc_add_animals.py @@ -0,0 +1,127 @@ +"""add Animals + +Revision ID: 1b2d3224e5dc +Revises: 4dbba8aeb1e5 +Create Date: 2026-02-13 11:55:19.564221 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "1b2d3224e5dc" +down_revision: Union[str, None] = "4dbba8aeb1e5" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal + op.create_table( + "animal", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("animal_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("birthdate", sa.DateTime(), nullable=True), + sa.Column("sex", sa.String(length=1), nullable=True), + sa.Column("is_sterile", sa.Boolean(), nullable=True), + sa.Column("active", sa.Boolean(), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("image_url", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["animal_type_uuid"], + ["animal_type.uuid"], + name=op.f("fk_animal_animal_type_uuid_animal_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_animal")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_animal_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_animal_farmos_uuid")), + ) + op.create_table( + "animal_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "animal_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("birthdate", sa.DateTime(), autoincrement=False, nullable=True), + sa.Column("sex", sa.String(length=1), autoincrement=False, nullable=True), + sa.Column("is_sterile", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("active", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column( + "image_url", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_animal_version") + ), + ) + op.create_index( + op.f("ix_animal_version_end_transaction_id"), + "animal_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_animal_version_operation_type"), + "animal_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_animal_version_pk_transaction_id", + "animal_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_animal_version_pk_validity", + "animal_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_animal_version_transaction_id"), + "animal_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # animal + op.drop_index(op.f("ix_animal_version_transaction_id"), table_name="animal_version") + op.drop_index("ix_animal_version_pk_validity", table_name="animal_version") + op.drop_index("ix_animal_version_pk_transaction_id", table_name="animal_version") + op.drop_index(op.f("ix_animal_version_operation_type"), table_name="animal_version") + op.drop_index( + op.f("ix_animal_version_end_transaction_id"), table_name="animal_version" + ) + op.drop_table("animal_version") + op.drop_table("animal") diff --git a/src/wuttafarm/db/alembic/versions/1f98d27cabeb_add_quantity_types.py b/src/wuttafarm/db/alembic/versions/1f98d27cabeb_add_quantity_types.py new file mode 100644 index 0000000..816f05c --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/1f98d27cabeb_add_quantity_types.py @@ -0,0 +1,119 @@ +"""add Quantity Types + +Revision ID: 1f98d27cabeb +Revises: ea88e72a5fa5 +Create Date: 2026-02-18 21:03:52.245619 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "1f98d27cabeb" +down_revision: Union[str, None] = "ea88e72a5fa5" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # quantity_type + op.create_table( + "quantity_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("description", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.String(length=50), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_quantity_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_quantity_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_quantity_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_quantity_type_name")), + ) + op.create_table( + "quantity_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "description", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "drupal_id", sa.String(length=50), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_quantity_type_version") + ), + ) + op.create_index( + op.f("ix_quantity_type_version_end_transaction_id"), + "quantity_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_quantity_type_version_operation_type"), + "quantity_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_quantity_type_version_pk_transaction_id", + "quantity_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_quantity_type_version_pk_validity", + "quantity_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_quantity_type_version_transaction_id"), + "quantity_type_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # quantity_type + op.drop_index( + op.f("ix_quantity_type_version_transaction_id"), + table_name="quantity_type_version", + ) + op.drop_index( + "ix_quantity_type_version_pk_validity", table_name="quantity_type_version" + ) + op.drop_index( + "ix_quantity_type_version_pk_transaction_id", table_name="quantity_type_version" + ) + op.drop_index( + op.f("ix_quantity_type_version_operation_type"), + table_name="quantity_type_version", + ) + op.drop_index( + op.f("ix_quantity_type_version_end_transaction_id"), + table_name="quantity_type_version", + ) + op.drop_table("quantity_type_version") + op.drop_table("quantity_type") diff --git a/src/wuttafarm/db/alembic/versions/2a49127e974b_add_animal_thumbnail_url.py b/src/wuttafarm/db/alembic/versions/2a49127e974b_add_animal_thumbnail_url.py new file mode 100644 index 0000000..7c32b29 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/2a49127e974b_add_animal_thumbnail_url.py @@ -0,0 +1,41 @@ +"""add animal thumbnail url + +Revision ID: 2a49127e974b +Revises: 8898184c5c75 +Create Date: 2026-02-14 19:41:22.039343 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "2a49127e974b" +down_revision: Union[str, None] = "8898184c5c75" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal + op.add_column( + "animal", sa.Column("thumbnail_url", sa.String(length=255), nullable=True) + ) + op.add_column( + "animal_version", + sa.Column( + "thumbnail_url", sa.String(length=255), autoincrement=False, nullable=True + ), + ) + + +def downgrade() -> None: + + # animal + op.drop_column("animal_version", "thumbnail_url") + op.drop_column("animal", "thumbnail_url") diff --git a/src/wuttafarm/db/alembic/versions/2b6385d0fa17_add_animal_types.py b/src/wuttafarm/db/alembic/versions/2b6385d0fa17_add_animal_types.py new file mode 100644 index 0000000..4e1481f --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/2b6385d0fa17_add_animal_types.py @@ -0,0 +1,116 @@ +"""add Animal Types + +Revision ID: 2b6385d0fa17 +Revises: +Create Date: 2026-02-08 14:55:42.236918 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "2b6385d0fa17" +down_revision: Union[str, None] = None +branch_labels: Union[str, Sequence[str], None] = ("wuttafarm",) +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal_type + op.create_table( + "animal_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("description", sa.String(length=255), nullable=True), + sa.Column("changed", sa.DateTime(), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_animal_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_animal_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_animal_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_animal_type_name")), + ) + op.create_table( + "animal_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "description", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_animal_type_version") + ), + ) + op.create_index( + op.f("ix_animal_type_version_end_transaction_id"), + "animal_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_animal_type_version_operation_type"), + "animal_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_animal_type_version_pk_transaction_id", + "animal_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_animal_type_version_pk_validity", + "animal_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_animal_type_version_transaction_id"), + "animal_type_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # animal_type + op.drop_index( + op.f("ix_animal_type_version_transaction_id"), table_name="animal_type_version" + ) + op.drop_index( + "ix_animal_type_version_pk_validity", table_name="animal_type_version" + ) + op.drop_index( + "ix_animal_type_version_pk_transaction_id", table_name="animal_type_version" + ) + op.drop_index( + op.f("ix_animal_type_version_operation_type"), table_name="animal_type_version" + ) + op.drop_index( + op.f("ix_animal_type_version_end_transaction_id"), + table_name="animal_type_version", + ) + op.drop_table("animal_type_version") + op.drop_table("animal_type") diff --git a/src/wuttafarm/db/alembic/versions/34ec51d80f52_use_shared_base_for_structure_assets.py b/src/wuttafarm/db/alembic/versions/34ec51d80f52_use_shared_base_for_structure_assets.py new file mode 100644 index 0000000..4be383f --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/34ec51d80f52_use_shared_base_for_structure_assets.py @@ -0,0 +1,236 @@ +"""use shared base for Structure Assets + +Revision ID: 34ec51d80f52 +Revises: d882682c82f9 +Create Date: 2026-02-15 13:19:18.814523 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "34ec51d80f52" +down_revision: Union[str, None] = "d882682c82f9" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_structure + op.create_table( + "asset_structure", + sa.Column("structure_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["structure_type_uuid"], + ["structure_type.uuid"], + name=op.f("fk_asset_structure_structure_type_uuid_structure_type"), + ), + sa.ForeignKeyConstraint( + ["uuid"], ["asset.uuid"], name=op.f("fk_asset_structure_uuid_asset") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_structure")), + ) + op.create_table( + "asset_structure_version", + sa.Column( + "structure_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_structure_version") + ), + ) + op.create_index( + op.f("ix_asset_structure_version_end_transaction_id"), + "asset_structure_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_structure_version_operation_type"), + "asset_structure_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_structure_version_pk_transaction_id", + "asset_structure_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_structure_version_pk_validity", + "asset_structure_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_structure_version_transaction_id"), + "asset_structure_version", + ["transaction_id"], + unique=False, + ) + + # structure + op.drop_index( + op.f("ix_structure_version_end_transaction_id"), table_name="structure_version" + ) + op.drop_index( + op.f("ix_structure_version_operation_type"), table_name="structure_version" + ) + op.drop_index( + op.f("ix_structure_version_pk_transaction_id"), table_name="structure_version" + ) + op.drop_index( + op.f("ix_structure_version_pk_validity"), table_name="structure_version" + ) + op.drop_index( + op.f("ix_structure_version_transaction_id"), table_name="structure_version" + ) + op.drop_table("structure_version") + op.drop_table("structure") + + +def downgrade() -> None: + + # structure + op.create_table( + "structure", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=False), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column( + "structure_type_uuid", sa.UUID(), autoincrement=False, nullable=False + ), + sa.Column("is_location", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("is_fixed", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column( + "image_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column( + "thumbnail_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.ForeignKeyConstraint( + ["structure_type_uuid"], + ["structure_type.uuid"], + name=op.f("fk_structure_structure_type_uuid_structure_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_structure")), + sa.UniqueConstraint( + "drupal_id", + name=op.f("uq_structure_drupal_id"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "farmos_uuid", + name=op.f("uq_structure_farmos_uuid"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "name", + name=op.f("uq_structure_name"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + ) + op.create_table( + "structure_version", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("structure_type_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("is_location", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column( + "image_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column("transaction_id", sa.BIGINT(), autoincrement=False, nullable=False), + sa.Column( + "end_transaction_id", sa.BIGINT(), autoincrement=False, nullable=True + ), + sa.Column("operation_type", sa.SMALLINT(), autoincrement=False, nullable=False), + sa.Column( + "thumbnail_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_structure_version") + ), + ) + op.create_index( + op.f("ix_structure_version_transaction_id"), + "structure_version", + ["transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_structure_version_pk_validity"), + "structure_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_structure_version_pk_transaction_id"), + "structure_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + op.f("ix_structure_version_operation_type"), + "structure_version", + ["operation_type"], + unique=False, + ) + op.create_index( + op.f("ix_structure_version_end_transaction_id"), + "structure_version", + ["end_transaction_id"], + unique=False, + ) + + # asset_structure + op.drop_index( + op.f("ix_asset_structure_version_transaction_id"), + table_name="asset_structure_version", + ) + op.drop_index( + "ix_asset_structure_version_pk_validity", table_name="asset_structure_version" + ) + op.drop_index( + "ix_asset_structure_version_pk_transaction_id", + table_name="asset_structure_version", + ) + op.drop_index( + op.f("ix_asset_structure_version_operation_type"), + table_name="asset_structure_version", + ) + op.drop_index( + op.f("ix_asset_structure_version_end_transaction_id"), + table_name="asset_structure_version", + ) + op.drop_table("asset_structure_version") + op.drop_table("asset_structure") diff --git a/src/wuttafarm/db/alembic/versions/3bef7d380a38_add_loglocation.py b/src/wuttafarm/db/alembic/versions/3bef7d380a38_add_loglocation.py new file mode 100644 index 0000000..0ed92d9 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/3bef7d380a38_add_loglocation.py @@ -0,0 +1,118 @@ +"""add LogLocation + +Revision ID: 3bef7d380a38 +Revises: f3c7e273bfa3 +Create Date: 2026-02-28 20:41:56.051847 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "3bef7d380a38" +down_revision: Union[str, None] = "f3c7e273bfa3" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_location + op.create_table( + "log_location", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("log_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["asset_uuid"], + ["asset.uuid"], + name=op.f("fk_log_location_asset_uuid_asset"), + ), + sa.ForeignKeyConstraint( + ["log_uuid"], ["log.uuid"], name=op.f("fk_log_location_log_uuid_log") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_location")), + ) + op.create_table( + "log_location_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "log_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_location_version") + ), + ) + op.create_index( + op.f("ix_log_location_version_end_transaction_id"), + "log_location_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_location_version_operation_type"), + "log_location_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_location_version_pk_transaction_id", + "log_location_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_location_version_pk_validity", + "log_location_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_location_version_transaction_id"), + "log_location_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_location + op.drop_index( + op.f("ix_log_location_version_transaction_id"), + table_name="log_location_version", + ) + op.drop_index( + "ix_log_location_version_pk_validity", table_name="log_location_version" + ) + op.drop_index( + "ix_log_location_version_pk_transaction_id", table_name="log_location_version" + ) + op.drop_index( + op.f("ix_log_location_version_operation_type"), + table_name="log_location_version", + ) + op.drop_index( + op.f("ix_log_location_version_end_transaction_id"), + table_name="log_location_version", + ) + op.drop_table("log_location_version") + op.drop_table("log_location") diff --git a/src/wuttafarm/db/alembic/versions/3e2ef02bf264_add_activity_logs.py b/src/wuttafarm/db/alembic/versions/3e2ef02bf264_add_activity_logs.py new file mode 100644 index 0000000..5fca4be --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/3e2ef02bf264_add_activity_logs.py @@ -0,0 +1,118 @@ +"""add Activity Logs + +Revision ID: 3e2ef02bf264 +Revises: 92b813360b99 +Create Date: 2026-02-13 14:36:47.191922 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "3e2ef02bf264" +down_revision: Union[str, None] = "92b813360b99" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_activity + op.create_table( + "log_activity", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("message", sa.String(length=255), nullable=False), + sa.Column("timestamp", sa.DateTime(), nullable=False), + sa.Column("status", sa.String(length=20), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_activity")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_log_activity_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_log_activity_farmos_uuid")), + ) + op.create_table( + "log_activity_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("message", sa.String(length=255), autoincrement=False, nullable=True), + sa.Column("timestamp", sa.DateTime(), autoincrement=False, nullable=True), + sa.Column("status", sa.String(length=20), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_activity_version") + ), + ) + op.create_index( + op.f("ix_log_activity_version_end_transaction_id"), + "log_activity_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_activity_version_operation_type"), + "log_activity_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_activity_version_pk_transaction_id", + "log_activity_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_activity_version_pk_validity", + "log_activity_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_activity_version_transaction_id"), + "log_activity_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_activity + op.drop_index( + op.f("ix_log_activity_version_transaction_id"), + table_name="log_activity_version", + ) + op.drop_index( + "ix_log_activity_version_pk_validity", table_name="log_activity_version" + ) + op.drop_index( + "ix_log_activity_version_pk_transaction_id", table_name="log_activity_version" + ) + op.drop_index( + op.f("ix_log_activity_version_operation_type"), + table_name="log_activity_version", + ) + op.drop_index( + op.f("ix_log_activity_version_end_transaction_id"), + table_name="log_activity_version", + ) + op.drop_table("log_activity_version") + op.drop_table("log_activity") diff --git a/src/wuttafarm/db/alembic/versions/45c7718d2ed2_remove_unique_for_animal_type_name.py b/src/wuttafarm/db/alembic/versions/45c7718d2ed2_remove_unique_for_animal_type_name.py new file mode 100644 index 0000000..03759cf --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/45c7718d2ed2_remove_unique_for_animal_type_name.py @@ -0,0 +1,37 @@ +"""remove unique for animal_type.name + +Revision ID: 45c7718d2ed2 +Revises: 5b6c87d8cddf +Create Date: 2026-02-27 16:53:59.310342 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "45c7718d2ed2" +down_revision: Union[str, None] = "5b6c87d8cddf" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal_type + op.drop_constraint(op.f("uq_animal_type_name"), "animal_type", type_="unique") + + +def downgrade() -> None: + + # animal_type + op.create_unique_constraint( + op.f("uq_animal_type_name"), + "animal_type", + ["name"], + postgresql_nulls_not_distinct=False, + ) diff --git a/src/wuttafarm/db/alembic/versions/47d0ebd84554_add_logowner.py b/src/wuttafarm/db/alembic/versions/47d0ebd84554_add_logowner.py new file mode 100644 index 0000000..8dffce9 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/47d0ebd84554_add_logowner.py @@ -0,0 +1,108 @@ +"""add LogOwner + +Revision ID: 47d0ebd84554 +Revises: 45c7718d2ed2 +Create Date: 2026-02-28 19:18:49.122090 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "47d0ebd84554" +down_revision: Union[str, None] = "45c7718d2ed2" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_owner + op.create_table( + "log_owner", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("log_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("user_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["log_uuid"], ["log.uuid"], name=op.f("fk_log_owner_log_uuid_log") + ), + sa.ForeignKeyConstraint( + ["user_uuid"], ["user.uuid"], name=op.f("fk_log_owner_user_uuid_user") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_owner")), + ) + op.create_table( + "log_owner_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "log_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "user_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_owner_version") + ), + ) + op.create_index( + op.f("ix_log_owner_version_end_transaction_id"), + "log_owner_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_owner_version_operation_type"), + "log_owner_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_owner_version_pk_transaction_id", + "log_owner_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_owner_version_pk_validity", + "log_owner_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_owner_version_transaction_id"), + "log_owner_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_owner + op.drop_index( + op.f("ix_log_owner_version_transaction_id"), table_name="log_owner_version" + ) + op.drop_index("ix_log_owner_version_pk_validity", table_name="log_owner_version") + op.drop_index( + "ix_log_owner_version_pk_transaction_id", table_name="log_owner_version" + ) + op.drop_index( + op.f("ix_log_owner_version_operation_type"), table_name="log_owner_version" + ) + op.drop_index( + op.f("ix_log_owner_version_end_transaction_id"), table_name="log_owner_version" + ) + op.drop_table("log_owner_version") + op.drop_table("log_owner") diff --git a/src/wuttafarm/db/alembic/versions/4dbba8aeb1e5_add_structures.py b/src/wuttafarm/db/alembic/versions/4dbba8aeb1e5_add_structures.py new file mode 100644 index 0000000..94e8186 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/4dbba8aeb1e5_add_structures.py @@ -0,0 +1,132 @@ +"""add Structures + +Revision ID: 4dbba8aeb1e5 +Revises: e416b96467fc +Create Date: 2026-02-13 10:17:15.179202 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "4dbba8aeb1e5" +down_revision: Union[str, None] = "e416b96467fc" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # structure + op.create_table( + "structure", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("active", sa.Boolean(), nullable=False), + sa.Column("structure_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("is_location", sa.Boolean(), nullable=False), + sa.Column("is_fixed", sa.Boolean(), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("image_url", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["structure_type_uuid"], + ["structure_type.uuid"], + name=op.f("fk_structure_structure_type_uuid_structure_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_structure")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_structure_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_structure_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_structure_name")), + ) + op.create_table( + "structure_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column("active", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column( + "structure_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("is_location", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column( + "image_url", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_structure_version") + ), + ) + op.create_index( + op.f("ix_structure_version_end_transaction_id"), + "structure_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_structure_version_operation_type"), + "structure_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_structure_version_pk_transaction_id", + "structure_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_structure_version_pk_validity", + "structure_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_structure_version_transaction_id"), + "structure_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # structure + op.drop_index( + op.f("ix_structure_version_transaction_id"), table_name="structure_version" + ) + op.drop_index("ix_structure_version_pk_validity", table_name="structure_version") + op.drop_index( + "ix_structure_version_pk_transaction_id", table_name="structure_version" + ) + op.drop_index( + op.f("ix_structure_version_operation_type"), table_name="structure_version" + ) + op.drop_index( + op.f("ix_structure_version_end_transaction_id"), table_name="structure_version" + ) + op.drop_table("structure_version") + op.drop_table("structure") diff --git a/src/wuttafarm/db/alembic/versions/554e6168c339_add_landassetparent_model.py b/src/wuttafarm/db/alembic/versions/554e6168c339_add_landassetparent_model.py new file mode 100644 index 0000000..e943f77 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/554e6168c339_add_landassetparent_model.py @@ -0,0 +1,125 @@ +"""add LandAssetParent model + +Revision ID: 554e6168c339 +Revises: 8cc1565d38e7 +Create Date: 2026-02-14 20:41:24.859064 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "554e6168c339" +down_revision: Union[str, None] = "8cc1565d38e7" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # land_asset_parent + op.create_table( + "land_asset_parent", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("land_asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("parent_asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["land_asset_uuid"], + ["land_asset.uuid"], + name=op.f("fk_land_asset_parent_land_asset_uuid_land_asset"), + ), + sa.ForeignKeyConstraint( + ["parent_asset_uuid"], + ["land_asset.uuid"], + name=op.f("fk_land_asset_parent_parent_asset_uuid_land_asset"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_land_asset_parent")), + ) + op.create_table( + "land_asset_parent_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "land_asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "parent_asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_land_asset_parent_version") + ), + ) + op.create_index( + op.f("ix_land_asset_parent_version_end_transaction_id"), + "land_asset_parent_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_parent_version_operation_type"), + "land_asset_parent_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_land_asset_parent_version_pk_transaction_id", + "land_asset_parent_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_land_asset_parent_version_pk_validity", + "land_asset_parent_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_parent_version_transaction_id"), + "land_asset_parent_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # land_asset_parent + op.drop_index( + op.f("ix_land_asset_parent_version_transaction_id"), + table_name="land_asset_parent_version", + ) + op.drop_index( + "ix_land_asset_parent_version_pk_validity", + table_name="land_asset_parent_version", + ) + op.drop_index( + "ix_land_asset_parent_version_pk_transaction_id", + table_name="land_asset_parent_version", + ) + op.drop_index( + op.f("ix_land_asset_parent_version_operation_type"), + table_name="land_asset_parent_version", + ) + op.drop_index( + op.f("ix_land_asset_parent_version_end_transaction_id"), + table_name="land_asset_parent_version", + ) + op.drop_table("land_asset_parent_version") + op.drop_table("land_asset_parent") diff --git a/src/wuttafarm/db/alembic/versions/5b6c87d8cddf_add_standard_quantities.py b/src/wuttafarm/db/alembic/versions/5b6c87d8cddf_add_standard_quantities.py new file mode 100644 index 0000000..a6aab9d --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/5b6c87d8cddf_add_standard_quantities.py @@ -0,0 +1,293 @@ +"""add Standard Quantities + +Revision ID: 5b6c87d8cddf +Revises: 1f98d27cabeb +Create Date: 2026-02-19 15:42:19.691148 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "5b6c87d8cddf" +down_revision: Union[str, None] = "1f98d27cabeb" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # measure + op.create_table( + "measure", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("drupal_id", sa.String(length=20), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_measure")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_measure_drupal_id")), + sa.UniqueConstraint("name", name=op.f("uq_measure_name")), + ) + op.create_table( + "measure_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "drupal_id", sa.String(length=20), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_measure_version") + ), + ) + op.create_index( + op.f("ix_measure_version_end_transaction_id"), + "measure_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_measure_version_operation_type"), + "measure_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_measure_version_pk_transaction_id", + "measure_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_measure_version_pk_validity", + "measure_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_measure_version_transaction_id"), + "measure_version", + ["transaction_id"], + unique=False, + ) + + # quantity + op.create_table( + "quantity", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("quantity_type_id", sa.String(length=50), nullable=False), + sa.Column("measure_id", sa.String(length=20), nullable=False), + sa.Column("value_numerator", sa.Integer(), nullable=False), + sa.Column("value_denominator", sa.Integer(), nullable=False), + sa.Column("units_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("label", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["measure_id"], + ["measure.drupal_id"], + name=op.f("fk_quantity_measure_id_measure"), + ), + sa.ForeignKeyConstraint( + ["quantity_type_id"], + ["quantity_type.drupal_id"], + name=op.f("fk_quantity_quantity_type_id_quantity_type"), + ), + sa.ForeignKeyConstraint( + ["units_uuid"], ["unit.uuid"], name=op.f("fk_quantity_units_uuid_unit") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_quantity")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_quantity_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_quantity_farmos_uuid")), + ) + op.create_table( + "quantity_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "quantity_type_id", sa.String(length=50), autoincrement=False, nullable=True + ), + sa.Column( + "measure_id", sa.String(length=20), autoincrement=False, nullable=True + ), + sa.Column("value_numerator", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "value_denominator", sa.Integer(), autoincrement=False, nullable=True + ), + sa.Column( + "units_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("label", sa.String(length=255), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_quantity_version") + ), + ) + op.create_index( + op.f("ix_quantity_version_end_transaction_id"), + "quantity_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_quantity_version_operation_type"), + "quantity_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_quantity_version_pk_transaction_id", + "quantity_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_quantity_version_pk_validity", + "quantity_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_quantity_version_transaction_id"), + "quantity_version", + ["transaction_id"], + unique=False, + ) + + # quantity_standard + op.create_table( + "quantity_standard", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["uuid"], ["quantity.uuid"], name=op.f("fk_quantity_standard_uuid_quantity") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_quantity_standard")), + ) + op.create_table( + "quantity_standard_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_quantity_standard_version") + ), + ) + op.create_index( + op.f("ix_quantity_standard_version_end_transaction_id"), + "quantity_standard_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_quantity_standard_version_operation_type"), + "quantity_standard_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_quantity_standard_version_pk_transaction_id", + "quantity_standard_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_quantity_standard_version_pk_validity", + "quantity_standard_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_quantity_standard_version_transaction_id"), + "quantity_standard_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # quantity_standard + op.drop_index( + op.f("ix_quantity_standard_version_transaction_id"), + table_name="quantity_standard_version", + ) + op.drop_index( + "ix_quantity_standard_version_pk_validity", + table_name="quantity_standard_version", + ) + op.drop_index( + "ix_quantity_standard_version_pk_transaction_id", + table_name="quantity_standard_version", + ) + op.drop_index( + op.f("ix_quantity_standard_version_operation_type"), + table_name="quantity_standard_version", + ) + op.drop_index( + op.f("ix_quantity_standard_version_end_transaction_id"), + table_name="quantity_standard_version", + ) + op.drop_table("quantity_standard_version") + op.drop_table("quantity_standard") + + # quantity + op.drop_index( + op.f("ix_quantity_version_transaction_id"), table_name="quantity_version" + ) + op.drop_index("ix_quantity_version_pk_validity", table_name="quantity_version") + op.drop_index( + "ix_quantity_version_pk_transaction_id", table_name="quantity_version" + ) + op.drop_index( + op.f("ix_quantity_version_operation_type"), table_name="quantity_version" + ) + op.drop_index( + op.f("ix_quantity_version_end_transaction_id"), table_name="quantity_version" + ) + op.drop_table("quantity_version") + op.drop_table("quantity") + + # measure + op.drop_index( + op.f("ix_measure_version_transaction_id"), table_name="measure_version" + ) + op.drop_index("ix_measure_version_pk_validity", table_name="measure_version") + op.drop_index("ix_measure_version_pk_transaction_id", table_name="measure_version") + op.drop_index( + op.f("ix_measure_version_operation_type"), table_name="measure_version" + ) + op.drop_index( + op.f("ix_measure_version_end_transaction_id"), table_name="measure_version" + ) + op.drop_table("measure_version") + op.drop_table("measure") diff --git a/src/wuttafarm/db/alembic/versions/5f474125a80e_remove_unwanted_unique_constraint.py b/src/wuttafarm/db/alembic/versions/5f474125a80e_remove_unwanted_unique_constraint.py new file mode 100644 index 0000000..e5d28ab --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/5f474125a80e_remove_unwanted_unique_constraint.py @@ -0,0 +1,39 @@ +"""remove unwanted unique constraint + +Revision ID: 5f474125a80e +Revises: 0771322957bd +Create Date: 2026-03-04 12:03:16.034291 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "5f474125a80e" +down_revision: Union[str, None] = "0771322957bd" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_land + op.drop_constraint( + op.f("uq_asset_land_land_type_uuid"), "asset_land", type_="unique" + ) + + +def downgrade() -> None: + + # asset_land + op.create_unique_constraint( + op.f("uq_asset_land_land_type_uuid"), + "asset_land", + ["land_type_uuid"], + postgresql_nulls_not_distinct=False, + ) diff --git a/src/wuttafarm/db/alembic/versions/6c56bcd1c028_add_wuttafarmuser.py b/src/wuttafarm/db/alembic/versions/6c56bcd1c028_add_wuttafarmuser.py new file mode 100644 index 0000000..0dc2d29 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/6c56bcd1c028_add_wuttafarmuser.py @@ -0,0 +1,112 @@ +"""add WuttaFarmUser + +Revision ID: 6c56bcd1c028 +Revises: 2b6385d0fa17 +Create Date: 2026-02-09 20:46:20.995903 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "6c56bcd1c028" +down_revision: Union[str, None] = "2b6385d0fa17" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # wuttafarm_user + op.create_table( + "wuttafarm_user", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["uuid"], ["user.uuid"], name=op.f("fk_wuttafarm_user_uuid_user") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_wuttafarm_user")), + ) + op.create_table( + "wuttafarm_user_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_wuttafarm_user_version") + ), + ) + op.create_index( + op.f("ix_wuttafarm_user_version_end_transaction_id"), + "wuttafarm_user_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_wuttafarm_user_version_operation_type"), + "wuttafarm_user_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_wuttafarm_user_version_pk_transaction_id", + "wuttafarm_user_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_wuttafarm_user_version_pk_validity", + "wuttafarm_user_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_wuttafarm_user_version_transaction_id"), + "wuttafarm_user_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # wuttafarm_user + op.drop_index( + op.f("ix_wuttafarm_user_version_transaction_id"), + table_name="wuttafarm_user_version", + ) + op.drop_index( + "ix_wuttafarm_user_version_pk_validity", table_name="wuttafarm_user_version" + ) + op.drop_index( + "ix_wuttafarm_user_version_pk_transaction_id", + table_name="wuttafarm_user_version", + ) + op.drop_index( + op.f("ix_wuttafarm_user_version_operation_type"), + table_name="wuttafarm_user_version", + ) + op.drop_index( + op.f("ix_wuttafarm_user_version_end_transaction_id"), + table_name="wuttafarm_user_version", + ) + op.drop_table("wuttafarm_user_version") + op.drop_table("wuttafarm_user") diff --git a/src/wuttafarm/db/alembic/versions/74d32b4ec210_add_loggroup.py b/src/wuttafarm/db/alembic/versions/74d32b4ec210_add_loggroup.py new file mode 100644 index 0000000..170e3d2 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/74d32b4ec210_add_loggroup.py @@ -0,0 +1,111 @@ +"""add LogGroup + +Revision ID: 74d32b4ec210 +Revises: 3bef7d380a38 +Create Date: 2026-02-28 21:35:24.125784 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "74d32b4ec210" +down_revision: Union[str, None] = "3bef7d380a38" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_group + op.create_table( + "log_group", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("log_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["asset_uuid"], ["asset.uuid"], name=op.f("fk_log_group_asset_uuid_asset") + ), + sa.ForeignKeyConstraint( + ["log_uuid"], ["log.uuid"], name=op.f("fk_log_group_log_uuid_log") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_group")), + ) + op.create_table( + "log_group_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "log_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_group_version") + ), + ) + op.create_index( + op.f("ix_log_group_version_end_transaction_id"), + "log_group_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_group_version_operation_type"), + "log_group_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_group_version_pk_transaction_id", + "log_group_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_group_version_pk_validity", + "log_group_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_group_version_transaction_id"), + "log_group_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_group + op.drop_index( + op.f("ix_log_group_version_transaction_id"), table_name="log_group_version" + ) + op.drop_index("ix_log_group_version_pk_validity", table_name="log_group_version") + op.drop_index( + "ix_log_group_version_pk_transaction_id", table_name="log_group_version" + ) + op.drop_index( + op.f("ix_log_group_version_operation_type"), table_name="log_group_version" + ) + op.drop_index( + op.f("ix_log_group_version_end_transaction_id"), table_name="log_group_version" + ) + op.drop_table("log_group_version") + op.drop_table("log_group") diff --git a/src/wuttafarm/db/alembic/versions/82a03f4ef1a4_add_produces_eggs_via_eggmixin.py b/src/wuttafarm/db/alembic/versions/82a03f4ef1a4_add_produces_eggs_via_eggmixin.py new file mode 100644 index 0000000..9bed92c --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/82a03f4ef1a4_add_produces_eggs_via_eggmixin.py @@ -0,0 +1,52 @@ +"""add produces_eggs via EggMixin + +Revision ID: 82a03f4ef1a4 +Revises: 11e0e46f48a6 +Create Date: 2026-02-18 18:45:36.015144 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "82a03f4ef1a4" +down_revision: Union[str, None] = "11e0e46f48a6" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_animal + op.add_column( + "asset_animal", sa.Column("produces_eggs", sa.Boolean(), nullable=True) + ) + op.add_column( + "asset_animal_version", + sa.Column("produces_eggs", sa.Boolean(), autoincrement=False, nullable=True), + ) + + # asset_group + op.add_column( + "asset_group", sa.Column("produces_eggs", sa.Boolean(), nullable=True) + ) + op.add_column( + "asset_group_version", + sa.Column("produces_eggs", sa.Boolean(), autoincrement=False, nullable=True), + ) + + +def downgrade() -> None: + + # asset_group + op.drop_column("asset_group_version", "produces_eggs") + op.drop_column("asset_group", "produces_eggs") + + # asset_animal + op.drop_column("asset_animal_version", "produces_eggs") + op.drop_column("asset_animal", "produces_eggs") diff --git a/src/wuttafarm/db/alembic/versions/85d4851e8292_add_log_quick.py b/src/wuttafarm/db/alembic/versions/85d4851e8292_add_log_quick.py new file mode 100644 index 0000000..97e87bc --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/85d4851e8292_add_log_quick.py @@ -0,0 +1,37 @@ +"""add Log.quick + +Revision ID: 85d4851e8292 +Revises: d459db991404 +Create Date: 2026-03-02 18:42:56.070281 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "85d4851e8292" +down_revision: Union[str, None] = "d459db991404" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log + op.add_column("log", sa.Column("quick", sa.String(length=20), nullable=True)) + op.add_column( + "log_version", + sa.Column("quick", sa.String(length=20), autoincrement=False, nullable=True), + ) + + +def downgrade() -> None: + + # log + op.drop_column("log_version", "quick") + op.drop_column("log", "quick") diff --git a/src/wuttafarm/db/alembic/versions/8898184c5c75_convert_active_to_archived.py b/src/wuttafarm/db/alembic/versions/8898184c5c75_convert_active_to_archived.py new file mode 100644 index 0000000..70bbe2c --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/8898184c5c75_convert_active_to_archived.py @@ -0,0 +1,250 @@ +"""convert active to archived + +Revision ID: 8898184c5c75 +Revises: 3e2ef02bf264 +Create Date: 2026-02-14 18:41:23.042951 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "8898184c5c75" +down_revision: Union[str, None] = "3e2ef02bf264" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal + op.alter_column("animal", "active", new_column_name="archived") + animal = sa.sql.table( + "animal", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(animal.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + animal.update() + .where(animal.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + op.alter_column("animal_version", "active", new_column_name="archived") + animal_version = sa.sql.table( + "animal_version", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(animal_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + animal_version.update() + .where(animal_version.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + + # group + op.alter_column("group", "active", new_column_name="archived") + group = sa.sql.table( + "group", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(group.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + group.update() + .where(group.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + op.alter_column("group_version", "active", new_column_name="archived") + group_version = sa.sql.table( + "group_version", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(group_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + group_version.update() + .where(group_version.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + + # land_asset + op.alter_column("land_asset", "active", new_column_name="archived") + land_asset = sa.sql.table( + "land_asset", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(land_asset.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + land_asset.update() + .where(land_asset.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + op.alter_column("land_asset_version", "active", new_column_name="archived") + land_asset_version = sa.sql.table( + "land_asset_version", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(land_asset_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + land_asset_version.update() + .where(land_asset_version.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + + # structure + op.alter_column("structure", "active", new_column_name="archived") + structure = sa.sql.table( + "structure", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(structure.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + structure.update() + .where(structure.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + op.alter_column("structure_version", "active", new_column_name="archived") + structure_version = sa.sql.table( + "structure_version", + sa.sql.column("uuid"), + sa.sql.column("archived"), + ) + cursor = op.get_bind().execute(structure_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + structure_version.update() + .where(structure_version.c.uuid == row.uuid) + .values({"archived": not row.archived}) + ) + + +def downgrade() -> None: + + # structure + op.alter_column("structure", "archived", new_column_name="active") + structure = sa.sql.table( + "structure", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(structure.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + structure.update() + .where(structure.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + op.alter_column("structure_version", "archived", new_column_name="active") + structure_version = sa.sql.table( + "structure_version", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(structure_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + structure_version.update() + .where(structure_version.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + + # land_asset + op.alter_column("land_asset", "archived", new_column_name="active") + land_asset = sa.sql.table( + "land_asset", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(land_asset.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + land_asset.update() + .where(land_asset.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + op.alter_column("land_asset_version", "archived", new_column_name="active") + land_asset_version = sa.sql.table( + "land_asset_version", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(land_asset_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + land_asset_version.update() + .where(land_asset_version.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + + # group + op.alter_column("group", "archived", new_column_name="active") + group = sa.sql.table( + "group", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(group.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + group.update() + .where(group.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + op.alter_column("group_version", "archived", new_column_name="active") + group_version = sa.sql.table( + "group_version", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(group_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + group_version.update() + .where(group_version.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + + # animal + op.alter_column("animal", "archived", new_column_name="active") + animal = sa.sql.table( + "animal", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(animal.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + animal.update() + .where(animal.c.uuid == row.uuid) + .values({"active": not row.active}) + ) + op.alter_column("animal_version", "archived", new_column_name="active") + animal_version = sa.sql.table( + "animal_version", + sa.sql.column("uuid"), + sa.sql.column("active"), + ) + cursor = op.get_bind().execute(animal_version.select()) + for row in cursor.fetchall(): + op.get_bind().execute( + animal_version.update() + .where(animal_version.c.uuid == row.uuid) + .values({"active": not row.active}) + ) diff --git a/src/wuttafarm/db/alembic/versions/8cc1565d38e7_add_structure_thumbnail_url.py b/src/wuttafarm/db/alembic/versions/8cc1565d38e7_add_structure_thumbnail_url.py new file mode 100644 index 0000000..6bcd51b --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/8cc1565d38e7_add_structure_thumbnail_url.py @@ -0,0 +1,41 @@ +"""add structure thumbnail url + +Revision ID: 8cc1565d38e7 +Revises: 2a49127e974b +Create Date: 2026-02-14 20:07:33.913573 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "8cc1565d38e7" +down_revision: Union[str, None] = "2a49127e974b" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # structure + op.add_column( + "structure", sa.Column("thumbnail_url", sa.String(length=255), nullable=True) + ) + op.add_column( + "structure_version", + sa.Column( + "thumbnail_url", sa.String(length=255), autoincrement=False, nullable=True + ), + ) + + +def downgrade() -> None: + + # structure + op.drop_column("structure_version", "thumbnail_url") + op.drop_column("structure", "thumbnail_url") diff --git a/src/wuttafarm/db/alembic/versions/92b813360b99_add_groups.py b/src/wuttafarm/db/alembic/versions/92b813360b99_add_groups.py new file mode 100644 index 0000000..7223844 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/92b813360b99_add_groups.py @@ -0,0 +1,110 @@ +"""add Groups + +Revision ID: 92b813360b99 +Revises: 1b2d3224e5dc +Create Date: 2026-02-13 13:09:48.718064 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "92b813360b99" +down_revision: Union[str, None] = "1b2d3224e5dc" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # group + op.create_table( + "group", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("is_location", sa.Boolean(), nullable=False), + sa.Column("is_fixed", sa.Boolean(), nullable=False), + sa.Column("active", sa.Boolean(), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_group")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_group_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_group_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_group_name")), + ) + op.create_table( + "group_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column("is_location", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("active", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_group_version") + ), + ) + op.create_index( + op.f("ix_group_version_end_transaction_id"), + "group_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_group_version_operation_type"), + "group_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_group_version_pk_transaction_id", + "group_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_group_version_pk_validity", + "group_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_group_version_transaction_id"), + "group_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # group + op.drop_index(op.f("ix_group_version_transaction_id"), table_name="group_version") + op.drop_index("ix_group_version_pk_validity", table_name="group_version") + op.drop_index("ix_group_version_pk_transaction_id", table_name="group_version") + op.drop_index(op.f("ix_group_version_operation_type"), table_name="group_version") + op.drop_index( + op.f("ix_group_version_end_transaction_id"), table_name="group_version" + ) + op.drop_table("group_version") + op.drop_table("group") diff --git a/src/wuttafarm/db/alembic/versions/9e875e5cbdc1_add_logquantity.py b/src/wuttafarm/db/alembic/versions/9e875e5cbdc1_add_logquantity.py new file mode 100644 index 0000000..3867b17 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/9e875e5cbdc1_add_logquantity.py @@ -0,0 +1,118 @@ +"""add LogQuantity + +Revision ID: 9e875e5cbdc1 +Revises: 74d32b4ec210 +Create Date: 2026-02-28 21:55:31.876087 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "9e875e5cbdc1" +down_revision: Union[str, None] = "74d32b4ec210" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_quantity + op.create_table( + "log_quantity", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("log_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("quantity_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["log_uuid"], ["log.uuid"], name=op.f("fk_log_quantity_log_uuid_log") + ), + sa.ForeignKeyConstraint( + ["quantity_uuid"], + ["quantity.uuid"], + name=op.f("fk_log_quantity_quantity_uuid_quantity"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_quantity")), + ) + op.create_table( + "log_quantity_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "log_uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "quantity_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_quantity_version") + ), + ) + op.create_index( + op.f("ix_log_quantity_version_end_transaction_id"), + "log_quantity_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_quantity_version_operation_type"), + "log_quantity_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_quantity_version_pk_transaction_id", + "log_quantity_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_quantity_version_pk_validity", + "log_quantity_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_quantity_version_transaction_id"), + "log_quantity_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_quantity + op.drop_index( + op.f("ix_log_quantity_version_transaction_id"), + table_name="log_quantity_version", + ) + op.drop_index( + "ix_log_quantity_version_pk_validity", table_name="log_quantity_version" + ) + op.drop_index( + "ix_log_quantity_version_pk_transaction_id", table_name="log_quantity_version" + ) + op.drop_index( + op.f("ix_log_quantity_version_operation_type"), + table_name="log_quantity_version", + ) + op.drop_index( + op.f("ix_log_quantity_version_end_transaction_id"), + table_name="log_quantity_version", + ) + op.drop_table("log_quantity_version") + op.drop_table("log_quantity") diff --git a/src/wuttafarm/db/alembic/versions/9f2243df9566_add_land_types.py b/src/wuttafarm/db/alembic/versions/9f2243df9566_add_land_types.py new file mode 100644 index 0000000..15d89fa --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/9f2243df9566_add_land_types.py @@ -0,0 +1,110 @@ +"""add Land Types + +Revision ID: 9f2243df9566 +Revises: cf3f8f46d8bc +Create Date: 2026-02-10 19:10:02.851756 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "9f2243df9566" +down_revision: Union[str, None] = "cf3f8f46d8bc" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # land_type + op.create_table( + "land_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.String(length=50), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_land_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_land_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_land_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_land_type_name")), + ) + op.create_table( + "land_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "drupal_id", sa.String(length=50), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_land_type_version") + ), + ) + op.create_index( + op.f("ix_land_type_version_end_transaction_id"), + "land_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_type_version_operation_type"), + "land_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_land_type_version_pk_transaction_id", + "land_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_land_type_version_pk_validity", + "land_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_type_version_transaction_id"), + "land_type_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # land_type + op.drop_index( + op.f("ix_land_type_version_transaction_id"), table_name="land_type_version" + ) + op.drop_index("ix_land_type_version_pk_validity", table_name="land_type_version") + op.drop_index( + "ix_land_type_version_pk_transaction_id", table_name="land_type_version" + ) + op.drop_index( + op.f("ix_land_type_version_operation_type"), table_name="land_type_version" + ) + op.drop_index( + op.f("ix_land_type_version_end_transaction_id"), table_name="land_type_version" + ) + op.drop_table("land_type_version") + op.drop_table("land_type") diff --git a/src/wuttafarm/db/alembic/versions/aecfd9175624_use_shared_base_for_group_assets.py b/src/wuttafarm/db/alembic/versions/aecfd9175624_use_shared_base_for_group_assets.py new file mode 100644 index 0000000..1295d40 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/aecfd9175624_use_shared_base_for_group_assets.py @@ -0,0 +1,194 @@ +"""use shared base for Group Assets + +Revision ID: aecfd9175624 +Revises: 34ec51d80f52 +Create Date: 2026-02-15 13:57:01.055304 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "aecfd9175624" +down_revision: Union[str, None] = "34ec51d80f52" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_group + op.create_table( + "asset_group", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["uuid"], ["asset.uuid"], name=op.f("fk_asset_group_uuid_asset") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_group")), + ) + op.create_table( + "asset_group_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_group_version") + ), + ) + op.create_index( + op.f("ix_asset_group_version_end_transaction_id"), + "asset_group_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_group_version_operation_type"), + "asset_group_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_group_version_pk_transaction_id", + "asset_group_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_group_version_pk_validity", + "asset_group_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_group_version_transaction_id"), + "asset_group_version", + ["transaction_id"], + unique=False, + ) + + # group + op.drop_index( + op.f("ix_group_version_end_transaction_id"), table_name="group_version" + ) + op.drop_index(op.f("ix_group_version_operation_type"), table_name="group_version") + op.drop_index( + op.f("ix_group_version_pk_transaction_id"), table_name="group_version" + ) + op.drop_index(op.f("ix_group_version_pk_validity"), table_name="group_version") + op.drop_index(op.f("ix_group_version_transaction_id"), table_name="group_version") + op.drop_table("group_version") + op.drop_table("group") + + +def downgrade() -> None: + + # group + op.create_table( + "group", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=False), + sa.Column("is_location", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("is_fixed", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_group")), + sa.UniqueConstraint( + "drupal_id", + name=op.f("uq_group_drupal_id"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "farmos_uuid", + name=op.f("uq_group_farmos_uuid"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "name", + name=op.f("uq_group_name"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + ) + op.create_table( + "group_version", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), + sa.Column("is_location", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column("transaction_id", sa.BIGINT(), autoincrement=False, nullable=False), + sa.Column( + "end_transaction_id", sa.BIGINT(), autoincrement=False, nullable=True + ), + sa.Column("operation_type", sa.SMALLINT(), autoincrement=False, nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_group_version") + ), + ) + op.create_index( + op.f("ix_group_version_transaction_id"), + "group_version", + ["transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_group_version_pk_validity"), + "group_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_group_version_pk_transaction_id"), + "group_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + op.f("ix_group_version_operation_type"), + "group_version", + ["operation_type"], + unique=False, + ) + op.create_index( + op.f("ix_group_version_end_transaction_id"), + "group_version", + ["end_transaction_id"], + unique=False, + ) + + # asset_group + op.drop_index( + op.f("ix_asset_group_version_transaction_id"), table_name="asset_group_version" + ) + op.drop_index( + "ix_asset_group_version_pk_validity", table_name="asset_group_version" + ) + op.drop_index( + "ix_asset_group_version_pk_transaction_id", table_name="asset_group_version" + ) + op.drop_index( + op.f("ix_asset_group_version_operation_type"), table_name="asset_group_version" + ) + op.drop_index( + op.f("ix_asset_group_version_end_transaction_id"), + table_name="asset_group_version", + ) + op.drop_table("asset_group_version") + op.drop_table("asset_group") diff --git a/src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py b/src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py new file mode 100644 index 0000000..a43a6d4 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/b8cd4a8f981f_remove_animaltype_changed.py @@ -0,0 +1,37 @@ +"""remove AnimalType.changed + +Revision ID: b8cd4a8f981f +Revises: aecfd9175624 +Create Date: 2026-02-17 18:11:06.110003 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision: str = "b8cd4a8f981f" +down_revision: Union[str, None] = "aecfd9175624" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal_type + op.drop_column("animal_type", "changed") + + +def downgrade() -> None: + + # animal_type + op.add_column( + "animal_type", + sa.Column( + "changed", postgresql.TIMESTAMP(), autoincrement=False, nullable=True + ), + ) diff --git a/src/wuttafarm/db/alembic/versions/cf3f8f46d8bc_add_asset_types.py b/src/wuttafarm/db/alembic/versions/cf3f8f46d8bc_add_asset_types.py new file mode 100644 index 0000000..ed4c344 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/cf3f8f46d8bc_add_asset_types.py @@ -0,0 +1,115 @@ +"""add Asset Types + +Revision ID: cf3f8f46d8bc +Revises: 6c56bcd1c028 +Create Date: 2026-02-10 18:42:24.560312 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "cf3f8f46d8bc" +down_revision: Union[str, None] = "6c56bcd1c028" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_type + op.create_table( + "asset_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("description", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.String(length=50), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_asset_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_asset_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_asset_type_name")), + ) + op.create_table( + "asset_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "description", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "drupal_id", sa.String(length=50), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_type_version") + ), + ) + op.create_index( + op.f("ix_asset_type_version_end_transaction_id"), + "asset_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_type_version_operation_type"), + "asset_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_type_version_pk_transaction_id", + "asset_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_type_version_pk_validity", + "asset_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_type_version_transaction_id"), + "asset_type_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # asset_type + op.drop_index( + op.f("ix_asset_type_version_transaction_id"), table_name="asset_type_version" + ) + op.drop_index("ix_asset_type_version_pk_validity", table_name="asset_type_version") + op.drop_index( + "ix_asset_type_version_pk_transaction_id", table_name="asset_type_version" + ) + op.drop_index( + op.f("ix_asset_type_version_operation_type"), table_name="asset_type_version" + ) + op.drop_index( + op.f("ix_asset_type_version_end_transaction_id"), + table_name="asset_type_version", + ) + op.drop_table("asset_type_version") + op.drop_table("asset_type") diff --git a/src/wuttafarm/db/alembic/versions/d459db991404_add_medicallog_vet.py b/src/wuttafarm/db/alembic/versions/d459db991404_add_medicallog_vet.py new file mode 100644 index 0000000..c65c93e --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/d459db991404_add_medicallog_vet.py @@ -0,0 +1,37 @@ +"""add MedicalLog.vet + +Revision ID: d459db991404 +Revises: 9e875e5cbdc1 +Create Date: 2026-02-28 22:17:57.001134 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "d459db991404" +down_revision: Union[str, None] = "9e875e5cbdc1" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_medical + op.add_column("log_medical", sa.Column("vet", sa.String(length=100), nullable=True)) + op.add_column( + "log_medical_version", + sa.Column("vet", sa.String(length=100), autoincrement=False, nullable=True), + ) + + +def downgrade() -> None: + + # log_medical + op.drop_column("log_medical_version", "vet") + op.drop_column("log_medical", "vet") diff --git a/src/wuttafarm/db/alembic/versions/d6e8d16d6854_add_generic_animal_assets.py b/src/wuttafarm/db/alembic/versions/d6e8d16d6854_add_generic_animal_assets.py new file mode 100644 index 0000000..cd0a34a --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/d6e8d16d6854_add_generic_animal_assets.py @@ -0,0 +1,333 @@ +"""add generic, animal assets + +Revision ID: d6e8d16d6854 +Revises: 554e6168c339 +Create Date: 2026-02-15 09:11:04.886362 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "d6e8d16d6854" +down_revision: Union[str, None] = "554e6168c339" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # animal + op.drop_table("animal") + op.drop_index( + op.f("ix_animal_version_end_transaction_id"), table_name="animal_version" + ) + op.drop_index(op.f("ix_animal_version_operation_type"), table_name="animal_version") + op.drop_index( + op.f("ix_animal_version_pk_transaction_id"), table_name="animal_version" + ) + op.drop_index(op.f("ix_animal_version_pk_validity"), table_name="animal_version") + op.drop_index(op.f("ix_animal_version_transaction_id"), table_name="animal_version") + op.drop_table("animal_version") + + # asset + op.create_table( + "asset", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.Column("asset_type", sa.String(length=100), nullable=False), + sa.Column("asset_name", sa.String(length=100), nullable=False), + sa.Column("is_location", sa.Boolean(), nullable=False), + sa.Column("is_fixed", sa.Boolean(), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("thumbnail_url", sa.String(length=255), nullable=True), + sa.Column("image_url", sa.String(length=255), nullable=True), + sa.Column("archived", sa.Boolean(), nullable=False), + sa.ForeignKeyConstraint( + ["asset_type"], + ["asset_type.drupal_id"], + name=op.f("fk_asset_asset_type_asset_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_asset_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_asset_farmos_uuid")), + ) + op.create_table( + "asset_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "asset_type", sa.String(length=100), autoincrement=False, nullable=True + ), + sa.Column( + "asset_name", sa.String(length=100), autoincrement=False, nullable=True + ), + sa.Column("is_location", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column( + "thumbnail_url", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "image_url", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column("archived", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_version") + ), + ) + op.create_index( + op.f("ix_asset_version_end_transaction_id"), + "asset_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_version_operation_type"), + "asset_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_version_pk_transaction_id", + "asset_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_version_pk_validity", + "asset_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_version_transaction_id"), + "asset_version", + ["transaction_id"], + unique=False, + ) + + # asset_animal + op.create_table( + "asset_animal", + sa.Column("animal_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("birthdate", sa.DateTime(), nullable=True), + sa.Column("sex", sa.String(length=1), nullable=True), + sa.Column("is_sterile", sa.Boolean(), nullable=True), + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["animal_type_uuid"], + ["animal_type.uuid"], + name=op.f("fk_asset_animal_animal_type_uuid_animal_type"), + ), + sa.ForeignKeyConstraint( + ["uuid"], ["asset.uuid"], name=op.f("fk_asset_animal_uuid_asset") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_animal")), + ) + op.create_table( + "asset_animal_version", + sa.Column( + "animal_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("birthdate", sa.DateTime(), autoincrement=False, nullable=True), + sa.Column("sex", sa.String(length=1), autoincrement=False, nullable=True), + sa.Column("is_sterile", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_animal_version") + ), + ) + op.create_index( + op.f("ix_asset_animal_version_end_transaction_id"), + "asset_animal_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_animal_version_operation_type"), + "asset_animal_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_animal_version_pk_transaction_id", + "asset_animal_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_animal_version_pk_validity", + "asset_animal_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_animal_version_transaction_id"), + "asset_animal_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # asset_animal + op.drop_index( + op.f("ix_asset_animal_version_transaction_id"), + table_name="asset_animal_version", + ) + op.drop_index( + "ix_asset_animal_version_pk_validity", table_name="asset_animal_version" + ) + op.drop_index( + "ix_asset_animal_version_pk_transaction_id", table_name="asset_animal_version" + ) + op.drop_index( + op.f("ix_asset_animal_version_operation_type"), + table_name="asset_animal_version", + ) + op.drop_index( + op.f("ix_asset_animal_version_end_transaction_id"), + table_name="asset_animal_version", + ) + op.drop_table("asset_animal_version") + op.drop_table("asset_animal") + + # asset + op.drop_index(op.f("ix_asset_version_transaction_id"), table_name="asset_version") + op.drop_index("ix_asset_version_pk_validity", table_name="asset_version") + op.drop_index("ix_asset_version_pk_transaction_id", table_name="asset_version") + op.drop_index(op.f("ix_asset_version_operation_type"), table_name="asset_version") + op.drop_index( + op.f("ix_asset_version_end_transaction_id"), table_name="asset_version" + ) + op.drop_table("asset_version") + op.drop_table("asset") + + # animal + op.create_table( + "animal", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=False), + sa.Column("animal_type_uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("birthdate", sa.DateTime(), autoincrement=False, nullable=True), + sa.Column("sex", sa.VARCHAR(length=1), autoincrement=False, nullable=True), + sa.Column("is_sterile", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column( + "image_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column( + "thumbnail_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.ForeignKeyConstraint( + ["animal_type_uuid"], + ["animal_type.uuid"], + name=op.f("fk_animal_animal_type_uuid_animal_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_animal")), + sa.UniqueConstraint( + "drupal_id", + name=op.f("uq_animal_drupal_id"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "farmos_uuid", + name=op.f("uq_animal_farmos_uuid"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + ) + op.create_table( + "animal_version", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), + sa.Column("animal_type_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column( + "birthdate", postgresql.TIMESTAMP(), autoincrement=False, nullable=True + ), + sa.Column("sex", sa.VARCHAR(length=1), autoincrement=False, nullable=True), + sa.Column("is_sterile", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column( + "image_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column("transaction_id", sa.BIGINT(), autoincrement=False, nullable=False), + sa.Column( + "end_transaction_id", sa.BIGINT(), autoincrement=False, nullable=True + ), + sa.Column("operation_type", sa.SMALLINT(), autoincrement=False, nullable=False), + sa.Column( + "thumbnail_url", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_animal_version") + ), + ) + op.create_index( + op.f("ix_animal_version_transaction_id"), + "animal_version", + ["transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_animal_version_pk_validity"), + "animal_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_animal_version_pk_transaction_id"), + "animal_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + op.f("ix_animal_version_operation_type"), + "animal_version", + ["operation_type"], + unique=False, + ) + op.create_index( + op.f("ix_animal_version_end_transaction_id"), + "animal_version", + ["end_transaction_id"], + unique=False, + ) diff --git a/src/wuttafarm/db/alembic/versions/d7479d7161a8_add_structure_types.py b/src/wuttafarm/db/alembic/versions/d7479d7161a8_add_structure_types.py new file mode 100644 index 0000000..b71c4a6 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/d7479d7161a8_add_structure_types.py @@ -0,0 +1,116 @@ +"""add Structure Types + +Revision ID: d7479d7161a8 +Revises: 9f2243df9566 +Create Date: 2026-02-10 19:24:20.249826 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "d7479d7161a8" +down_revision: Union[str, None] = "9f2243df9566" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # structure_type + op.create_table( + "structure_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.String(length=50), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_structure_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_structure_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_structure_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_structure_type_name")), + ) + op.create_table( + "structure_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "drupal_id", sa.String(length=50), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_structure_type_version") + ), + ) + op.create_index( + op.f("ix_structure_type_version_end_transaction_id"), + "structure_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_structure_type_version_operation_type"), + "structure_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_structure_type_version_pk_transaction_id", + "structure_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_structure_type_version_pk_validity", + "structure_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_structure_type_version_transaction_id"), + "structure_type_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # structure_type + op.drop_index( + op.f("ix_structure_type_version_transaction_id"), + table_name="structure_type_version", + ) + op.drop_index( + "ix_structure_type_version_pk_validity", table_name="structure_type_version" + ) + op.drop_index( + "ix_structure_type_version_pk_transaction_id", + table_name="structure_type_version", + ) + op.drop_index( + op.f("ix_structure_type_version_operation_type"), + table_name="structure_type_version", + ) + op.drop_index( + op.f("ix_structure_type_version_end_transaction_id"), + table_name="structure_type_version", + ) + op.drop_table("structure_type_version") + op.drop_table("structure_type") diff --git a/src/wuttafarm/db/alembic/versions/d882682c82f9_use_shared_base_for_land_assets.py b/src/wuttafarm/db/alembic/versions/d882682c82f9_use_shared_base_for_land_assets.py new file mode 100644 index 0000000..7c9b5f7 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/d882682c82f9_use_shared_base_for_land_assets.py @@ -0,0 +1,411 @@ +"""use shared base for Land Assets + +Revision ID: d882682c82f9 +Revises: d6e8d16d6854 +Create Date: 2026-02-15 12:00:27.036011 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "d882682c82f9" +down_revision: Union[str, None] = "d6e8d16d6854" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # asset_parent + op.create_table( + "asset_parent", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("asset_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("parent_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["asset_uuid"], + ["asset.uuid"], + name=op.f("fk_asset_parent_asset_uuid_asset"), + ), + sa.ForeignKeyConstraint( + ["parent_uuid"], + ["asset.uuid"], + name=op.f("fk_asset_parent_parent_uuid_asset"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_parent")), + ) + op.create_table( + "asset_parent_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "asset_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "parent_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_parent_version") + ), + ) + op.create_index( + op.f("ix_asset_parent_version_end_transaction_id"), + "asset_parent_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_parent_version_operation_type"), + "asset_parent_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_parent_version_pk_transaction_id", + "asset_parent_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_parent_version_pk_validity", + "asset_parent_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_parent_version_transaction_id"), + "asset_parent_version", + ["transaction_id"], + unique=False, + ) + + # asset_land + op.create_table( + "asset_land", + sa.Column("land_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.ForeignKeyConstraint( + ["land_type_uuid"], + ["land_type.uuid"], + name=op.f("fk_asset_land_land_type_uuid_land_type"), + ), + sa.ForeignKeyConstraint( + ["uuid"], ["asset.uuid"], name=op.f("fk_asset_land_uuid_asset") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_asset_land")), + sa.UniqueConstraint( + "land_type_uuid", name=op.f("uq_asset_land_land_type_uuid") + ), + ) + op.create_table( + "asset_land_version", + sa.Column( + "land_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_asset_land_version") + ), + ) + op.create_index( + op.f("ix_asset_land_version_end_transaction_id"), + "asset_land_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_land_version_operation_type"), + "asset_land_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_asset_land_version_pk_transaction_id", + "asset_land_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_asset_land_version_pk_validity", + "asset_land_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_asset_land_version_transaction_id"), + "asset_land_version", + ["transaction_id"], + unique=False, + ) + + # land_asset_parent + op.drop_index( + op.f("ix_land_asset_parent_version_end_transaction_id"), + table_name="land_asset_parent_version", + ) + op.drop_index( + op.f("ix_land_asset_parent_version_operation_type"), + table_name="land_asset_parent_version", + ) + op.drop_index( + op.f("ix_land_asset_parent_version_pk_transaction_id"), + table_name="land_asset_parent_version", + ) + op.drop_index( + op.f("ix_land_asset_parent_version_pk_validity"), + table_name="land_asset_parent_version", + ) + op.drop_index( + op.f("ix_land_asset_parent_version_transaction_id"), + table_name="land_asset_parent_version", + ) + op.drop_table("land_asset_parent_version") + op.drop_table("land_asset_parent") + + # land_asset + op.drop_index( + op.f("ix_land_asset_version_end_transaction_id"), + table_name="land_asset_version", + ) + op.drop_index( + op.f("ix_land_asset_version_operation_type"), table_name="land_asset_version" + ) + op.drop_index( + op.f("ix_land_asset_version_pk_transaction_id"), table_name="land_asset_version" + ) + op.drop_index( + op.f("ix_land_asset_version_pk_validity"), table_name="land_asset_version" + ) + op.drop_index( + op.f("ix_land_asset_version_transaction_id"), table_name="land_asset_version" + ) + op.drop_table("land_asset_version") + op.drop_table("land_asset") + + +def downgrade() -> None: + + # land_asset + op.create_table( + "land_asset", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=False), + sa.Column("land_type_uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("is_location", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("is_fixed", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=False), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.ForeignKeyConstraint( + ["land_type_uuid"], + ["land_type.uuid"], + name=op.f("fk_land_asset_land_type_uuid_land_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_land_asset")), + sa.UniqueConstraint( + "drupal_id", + name=op.f("uq_land_asset_drupal_id"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "farmos_uuid", + name=op.f("uq_land_asset_farmos_uuid"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "land_type_uuid", + name=op.f("uq_land_asset_land_type_uuid"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + sa.UniqueConstraint( + "name", + name=op.f("uq_land_asset_name"), + postgresql_include=[], + postgresql_nulls_not_distinct=False, + ), + ) + op.create_table( + "land_asset_version", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("name", sa.VARCHAR(length=100), autoincrement=False, nullable=True), + sa.Column("land_type_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("is_location", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + sa.Column("archived", sa.BOOLEAN(), autoincrement=False, nullable=True), + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + sa.Column("transaction_id", sa.BIGINT(), autoincrement=False, nullable=False), + sa.Column( + "end_transaction_id", sa.BIGINT(), autoincrement=False, nullable=True + ), + sa.Column("operation_type", sa.SMALLINT(), autoincrement=False, nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_land_asset_version") + ), + ) + op.create_index( + op.f("ix_land_asset_version_transaction_id"), + "land_asset_version", + ["transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_version_pk_validity"), + "land_asset_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_version_pk_transaction_id"), + "land_asset_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_version_operation_type"), + "land_asset_version", + ["operation_type"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_version_end_transaction_id"), + "land_asset_version", + ["end_transaction_id"], + unique=False, + ) + + # land_asset_parent + op.create_table( + "land_asset_parent", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("land_asset_uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("parent_asset_uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.ForeignKeyConstraint( + ["land_asset_uuid"], + ["land_asset.uuid"], + name=op.f("fk_land_asset_parent_land_asset_uuid_land_asset"), + ), + sa.ForeignKeyConstraint( + ["parent_asset_uuid"], + ["land_asset.uuid"], + name=op.f("fk_land_asset_parent_parent_asset_uuid_land_asset"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_land_asset_parent")), + ) + op.create_table( + "land_asset_parent_version", + sa.Column("uuid", sa.UUID(), autoincrement=False, nullable=False), + sa.Column("land_asset_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("parent_asset_uuid", sa.UUID(), autoincrement=False, nullable=True), + sa.Column("transaction_id", sa.BIGINT(), autoincrement=False, nullable=False), + sa.Column( + "end_transaction_id", sa.BIGINT(), autoincrement=False, nullable=True + ), + sa.Column("operation_type", sa.SMALLINT(), autoincrement=False, nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_land_asset_parent_version") + ), + ) + op.create_index( + op.f("ix_land_asset_parent_version_transaction_id"), + "land_asset_parent_version", + ["transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_parent_version_pk_validity"), + "land_asset_parent_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_parent_version_pk_transaction_id"), + "land_asset_parent_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_parent_version_operation_type"), + "land_asset_parent_version", + ["operation_type"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_parent_version_end_transaction_id"), + "land_asset_parent_version", + ["end_transaction_id"], + unique=False, + ) + + # asset_land + op.drop_table("asset_land") + op.drop_index( + op.f("ix_asset_land_version_transaction_id"), table_name="asset_land_version" + ) + op.drop_index("ix_asset_land_version_pk_validity", table_name="asset_land_version") + op.drop_index( + "ix_asset_land_version_pk_transaction_id", table_name="asset_land_version" + ) + op.drop_index( + op.f("ix_asset_land_version_operation_type"), table_name="asset_land_version" + ) + op.drop_index( + op.f("ix_asset_land_version_end_transaction_id"), + table_name="asset_land_version", + ) + op.drop_table("asset_land_version") + + # asset_parent + op.drop_index( + op.f("ix_asset_parent_version_transaction_id"), + table_name="asset_parent_version", + ) + op.drop_index( + "ix_asset_parent_version_pk_validity", table_name="asset_parent_version" + ) + op.drop_index( + "ix_asset_parent_version_pk_transaction_id", table_name="asset_parent_version" + ) + op.drop_index( + op.f("ix_asset_parent_version_operation_type"), + table_name="asset_parent_version", + ) + op.drop_index( + op.f("ix_asset_parent_version_end_transaction_id"), + table_name="asset_parent_version", + ) + op.drop_table("asset_parent_version") + op.drop_table("asset_parent") diff --git a/src/wuttafarm/db/alembic/versions/dd6351e69233_add_generic_log_base.py b/src/wuttafarm/db/alembic/versions/dd6351e69233_add_generic_log_base.py new file mode 100644 index 0000000..0b82da9 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/dd6351e69233_add_generic_log_base.py @@ -0,0 +1,206 @@ +"""add generic log base + +Revision ID: dd6351e69233 +Revises: b8cd4a8f981f +Create Date: 2026-02-18 12:09:05.200134 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision: str = "dd6351e69233" +down_revision: Union[str, None] = "b8cd4a8f981f" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log + op.create_table( + "log", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("log_type", sa.String(length=100), nullable=False), + sa.Column("message", sa.String(length=255), nullable=False), + sa.Column("timestamp", sa.DateTime(), nullable=False), + sa.Column("status", sa.String(length=20), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["log_type"], ["log_type.drupal_id"], name=op.f("fk_log_log_type_log_type") + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_log_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_log_farmos_uuid")), + ) + op.create_table( + "log_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column( + "log_type", sa.String(length=100), autoincrement=False, nullable=True + ), + sa.Column("message", sa.String(length=255), autoincrement=False, nullable=True), + sa.Column("timestamp", sa.DateTime(), autoincrement=False, nullable=True), + sa.Column("status", sa.String(length=20), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint("uuid", "transaction_id", name=op.f("pk_log_version")), + ) + op.create_index( + op.f("ix_log_version_end_transaction_id"), + "log_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_version_operation_type"), + "log_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_version_pk_transaction_id", + "log_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_version_pk_validity", + "log_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_version_transaction_id"), + "log_version", + ["transaction_id"], + unique=False, + ) + + # log_activity + op.drop_column("log_activity_version", "status") + op.drop_column("log_activity_version", "farmos_uuid") + op.drop_column("log_activity_version", "timestamp") + op.drop_column("log_activity_version", "message") + op.drop_column("log_activity_version", "drupal_id") + op.drop_column("log_activity_version", "notes") + op.drop_constraint( + op.f("uq_log_activity_drupal_id"), "log_activity", type_="unique" + ) + op.drop_constraint( + op.f("uq_log_activity_farmos_uuid"), "log_activity", type_="unique" + ) + op.create_foreign_key( + op.f("fk_log_activity_uuid_log"), "log_activity", "log", ["uuid"], ["uuid"] + ) + op.drop_column("log_activity", "status") + op.drop_column("log_activity", "farmos_uuid") + op.drop_column("log_activity", "timestamp") + op.drop_column("log_activity", "message") + op.drop_column("log_activity", "drupal_id") + op.drop_column("log_activity", "notes") + + +def downgrade() -> None: + + # log_activity + op.add_column( + "log_activity", + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + ) + op.add_column( + "log_activity", + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + ) + op.add_column( + "log_activity", + sa.Column( + "message", sa.VARCHAR(length=255), autoincrement=False, nullable=False + ), + ) + op.add_column( + "log_activity", + sa.Column( + "timestamp", postgresql.TIMESTAMP(), autoincrement=False, nullable=False + ), + ) + op.add_column( + "log_activity", + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + ) + op.add_column( + "log_activity", + sa.Column("status", sa.VARCHAR(length=20), autoincrement=False, nullable=False), + ) + op.drop_constraint( + op.f("fk_log_activity_uuid_log"), "log_activity", type_="foreignkey" + ) + op.create_unique_constraint( + op.f("uq_log_activity_farmos_uuid"), + "log_activity", + ["farmos_uuid"], + postgresql_nulls_not_distinct=False, + ) + op.create_unique_constraint( + op.f("uq_log_activity_drupal_id"), + "log_activity", + ["drupal_id"], + postgresql_nulls_not_distinct=False, + ) + op.add_column( + "log_activity_version", + sa.Column("notes", sa.TEXT(), autoincrement=False, nullable=True), + ) + op.add_column( + "log_activity_version", + sa.Column("drupal_id", sa.INTEGER(), autoincrement=False, nullable=True), + ) + op.add_column( + "log_activity_version", + sa.Column( + "message", sa.VARCHAR(length=255), autoincrement=False, nullable=True + ), + ) + op.add_column( + "log_activity_version", + sa.Column( + "timestamp", postgresql.TIMESTAMP(), autoincrement=False, nullable=True + ), + ) + op.add_column( + "log_activity_version", + sa.Column("farmos_uuid", sa.UUID(), autoincrement=False, nullable=True), + ) + op.add_column( + "log_activity_version", + sa.Column("status", sa.VARCHAR(length=20), autoincrement=False, nullable=True), + ) + + # log + op.drop_index(op.f("ix_log_version_transaction_id"), table_name="log_version") + op.drop_index("ix_log_version_pk_validity", table_name="log_version") + op.drop_index("ix_log_version_pk_transaction_id", table_name="log_version") + op.drop_index(op.f("ix_log_version_operation_type"), table_name="log_version") + op.drop_index(op.f("ix_log_version_end_transaction_id"), table_name="log_version") + op.drop_table("log_version") + op.drop_table("log") diff --git a/src/wuttafarm/db/alembic/versions/e0d9f72575d6_add_log_types.py b/src/wuttafarm/db/alembic/versions/e0d9f72575d6_add_log_types.py new file mode 100644 index 0000000..862d3be --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/e0d9f72575d6_add_log_types.py @@ -0,0 +1,114 @@ +"""add Log Types + +Revision ID: e0d9f72575d6 +Revises: d7479d7161a8 +Create Date: 2026-02-10 19:35:06.631814 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "e0d9f72575d6" +down_revision: Union[str, None] = "d7479d7161a8" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log_type + op.create_table( + "log_type", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("description", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.String(length=50), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_log_type")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_log_type_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_log_type_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_log_type_name")), + ) + op.create_table( + "log_type_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "description", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column( + "drupal_id", sa.String(length=50), autoincrement=False, nullable=True + ), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_log_type_version") + ), + ) + op.create_index( + op.f("ix_log_type_version_end_transaction_id"), + "log_type_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_type_version_operation_type"), + "log_type_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_log_type_version_pk_transaction_id", + "log_type_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_log_type_version_pk_validity", + "log_type_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_log_type_version_transaction_id"), + "log_type_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # log_type + op.drop_index( + op.f("ix_log_type_version_transaction_id"), table_name="log_type_version" + ) + op.drop_index("ix_log_type_version_pk_validity", table_name="log_type_version") + op.drop_index( + "ix_log_type_version_pk_transaction_id", table_name="log_type_version" + ) + op.drop_index( + op.f("ix_log_type_version_operation_type"), table_name="log_type_version" + ) + op.drop_index( + op.f("ix_log_type_version_end_transaction_id"), table_name="log_type_version" + ) + op.drop_table("log_type_version") + op.drop_table("log_type") diff --git a/src/wuttafarm/db/alembic/versions/e416b96467fc_add_land_assets.py b/src/wuttafarm/db/alembic/versions/e416b96467fc_add_land_assets.py new file mode 100644 index 0000000..5f7dd87 --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/e416b96467fc_add_land_assets.py @@ -0,0 +1,132 @@ +"""add Land Assets + +Revision ID: e416b96467fc +Revises: e0d9f72575d6 +Create Date: 2026-02-13 09:39:31.327442 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "e416b96467fc" +down_revision: Union[str, None] = "e0d9f72575d6" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # land_asset + op.create_table( + "land_asset", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("land_type_uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("is_location", sa.Boolean(), nullable=False), + sa.Column("is_fixed", sa.Boolean(), nullable=False), + sa.Column("notes", sa.Text(), nullable=True), + sa.Column("active", sa.Boolean(), nullable=False), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["land_type_uuid"], + ["land_type.uuid"], + name=op.f("fk_land_asset_land_type_uuid_land_type"), + ), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_land_asset")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_land_asset_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_land_asset_farmos_uuid")), + sa.UniqueConstraint( + "land_type_uuid", name=op.f("uq_land_asset_land_type_uuid") + ), + sa.UniqueConstraint("name", name=op.f("uq_land_asset_name")), + ) + op.create_table( + "land_asset_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "land_type_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("is_location", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("is_fixed", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column("notes", sa.Text(), autoincrement=False, nullable=True), + sa.Column("active", sa.Boolean(), autoincrement=False, nullable=True), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint( + "uuid", "transaction_id", name=op.f("pk_land_asset_version") + ), + ) + op.create_index( + op.f("ix_land_asset_version_end_transaction_id"), + "land_asset_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_version_operation_type"), + "land_asset_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_land_asset_version_pk_transaction_id", + "land_asset_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_land_asset_version_pk_validity", + "land_asset_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_land_asset_version_transaction_id"), + "land_asset_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # land_asset + op.drop_index( + op.f("ix_land_asset_version_transaction_id"), table_name="land_asset_version" + ) + op.drop_index("ix_land_asset_version_pk_validity", table_name="land_asset_version") + op.drop_index( + "ix_land_asset_version_pk_transaction_id", table_name="land_asset_version" + ) + op.drop_index( + op.f("ix_land_asset_version_operation_type"), table_name="land_asset_version" + ) + op.drop_index( + op.f("ix_land_asset_version_end_transaction_id"), + table_name="land_asset_version", + ) + op.drop_table("land_asset_version") + op.drop_table("land_asset") diff --git a/src/wuttafarm/db/alembic/versions/ea88e72a5fa5_add_units.py b/src/wuttafarm/db/alembic/versions/ea88e72a5fa5_add_units.py new file mode 100644 index 0000000..e85afed --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/ea88e72a5fa5_add_units.py @@ -0,0 +1,102 @@ +"""add Units + +Revision ID: ea88e72a5fa5 +Revises: 82a03f4ef1a4 +Create Date: 2026-02-18 20:01:40.720138 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "ea88e72a5fa5" +down_revision: Union[str, None] = "82a03f4ef1a4" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # unit + op.create_table( + "unit", + sa.Column("uuid", wuttjamaican.db.util.UUID(), nullable=False), + sa.Column("name", sa.String(length=100), nullable=False), + sa.Column("description", sa.String(length=255), nullable=True), + sa.Column("farmos_uuid", wuttjamaican.db.util.UUID(), nullable=True), + sa.Column("drupal_id", sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint("uuid", name=op.f("pk_unit")), + sa.UniqueConstraint("drupal_id", name=op.f("uq_unit_drupal_id")), + sa.UniqueConstraint("farmos_uuid", name=op.f("uq_unit_farmos_uuid")), + sa.UniqueConstraint("name", name=op.f("uq_unit_name")), + ) + op.create_table( + "unit_version", + sa.Column( + "uuid", wuttjamaican.db.util.UUID(), autoincrement=False, nullable=False + ), + sa.Column("name", sa.String(length=100), autoincrement=False, nullable=True), + sa.Column( + "description", sa.String(length=255), autoincrement=False, nullable=True + ), + sa.Column( + "farmos_uuid", + wuttjamaican.db.util.UUID(), + autoincrement=False, + nullable=True, + ), + sa.Column("drupal_id", sa.Integer(), autoincrement=False, nullable=True), + sa.Column( + "transaction_id", sa.BigInteger(), autoincrement=False, nullable=False + ), + sa.Column("end_transaction_id", sa.BigInteger(), nullable=True), + sa.Column("operation_type", sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint("uuid", "transaction_id", name=op.f("pk_unit_version")), + ) + op.create_index( + op.f("ix_unit_version_end_transaction_id"), + "unit_version", + ["end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_unit_version_operation_type"), + "unit_version", + ["operation_type"], + unique=False, + ) + op.create_index( + "ix_unit_version_pk_transaction_id", + "unit_version", + ["uuid", sa.literal_column("transaction_id DESC")], + unique=False, + ) + op.create_index( + "ix_unit_version_pk_validity", + "unit_version", + ["uuid", "transaction_id", "end_transaction_id"], + unique=False, + ) + op.create_index( + op.f("ix_unit_version_transaction_id"), + "unit_version", + ["transaction_id"], + unique=False, + ) + + +def downgrade() -> None: + + # unit + op.drop_index(op.f("ix_unit_version_transaction_id"), table_name="unit_version") + op.drop_index("ix_unit_version_pk_validity", table_name="unit_version") + op.drop_index("ix_unit_version_pk_transaction_id", table_name="unit_version") + op.drop_index(op.f("ix_unit_version_operation_type"), table_name="unit_version") + op.drop_index(op.f("ix_unit_version_end_transaction_id"), table_name="unit_version") + op.drop_table("unit_version") + op.drop_table("unit") diff --git a/src/wuttafarm/db/alembic/versions/f3c7e273bfa3_add_log_is_group_assignment.py b/src/wuttafarm/db/alembic/versions/f3c7e273bfa3_add_log_is_group_assignment.py new file mode 100644 index 0000000..986f4db --- /dev/null +++ b/src/wuttafarm/db/alembic/versions/f3c7e273bfa3_add_log_is_group_assignment.py @@ -0,0 +1,39 @@ +"""add Log.is_group_assignment + +Revision ID: f3c7e273bfa3 +Revises: 47d0ebd84554 +Create Date: 2026-02-28 20:04:40.700474 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +import wuttjamaican.db.util + + +# revision identifiers, used by Alembic. +revision: str = "f3c7e273bfa3" +down_revision: Union[str, None] = "47d0ebd84554" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + + # log + op.add_column("log", sa.Column("is_group_assignment", sa.Boolean(), nullable=True)) + op.add_column( + "log_version", + sa.Column( + "is_group_assignment", sa.Boolean(), autoincrement=False, nullable=True + ), + ) + + +def downgrade() -> None: + + # log + op.drop_column("log_version", "is_group_assignment") + op.drop_column("log", "is_group_assignment") diff --git a/src/wuttafarm/db/model/__init__.py b/src/wuttafarm/db/model/__init__.py index b52d7c8..15514fb 100644 --- a/src/wuttafarm/db/model/__init__.py +++ b/src/wuttafarm/db/model/__init__.py @@ -26,4 +26,20 @@ WuttaFarm data models # bring in all of wutta from wuttjamaican.db.model import * -# TODO: import other/custom models here... +# wutta model extensions +from .users import WuttaFarmUser + +# wuttafarm proper models +from .unit import Unit, Measure +from .quantities import QuantityType, Quantity, StandardQuantity +from .asset import AssetType, Asset, AssetParent +from .asset_land import LandType, LandAsset +from .asset_structure import StructureType, StructureAsset +from .asset_animal import AnimalType, AnimalAsset +from .asset_group import GroupAsset +from .asset_plant import PlantType, PlantAsset, PlantAssetPlantType +from .log import LogType, Log, LogAsset, LogGroup, LogLocation, LogQuantity, LogOwner +from .log_activity import ActivityLog +from .log_harvest import HarvestLog +from .log_medical import MedicalLog +from .log_observation import ObservationLog diff --git a/src/wuttafarm/db/model/asset.py b/src/wuttafarm/db/model/asset.py new file mode 100644 index 0000000..0face47 --- /dev/null +++ b/src/wuttafarm/db/model/asset.py @@ -0,0 +1,303 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Asset Types +""" + +import sqlalchemy as sa +from sqlalchemy import orm +from sqlalchemy.ext.declarative import declared_attr +from sqlalchemy.ext.associationproxy import association_proxy + +from wuttjamaican.db import model + + +class AssetType(model.Base): + """ + Represents an "asset type" from farmOS + """ + + __tablename__ = "asset_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Asset Type", + "model_title_plural": "Asset Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the asset type. + """, + ) + + description = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Description for the asset type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the asset type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.String(length=50), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the asset type. + """, + ) + + def __str__(self): + return self.name or "" + + +class Asset(model.Base): + """ + Represents an asset (of any kind) from farmOS. + """ + + __tablename__ = "asset" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Asset", + "model_title_plural": "All Assets", + } + + uuid = model.uuid_column() + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the asset within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the asset. + """, + ) + + asset_type = sa.Column( + sa.String(length=100), sa.ForeignKey("asset_type.drupal_id"), nullable=False + ) + + asset_name = sa.Column( + sa.String(length=100), + nullable=False, + doc=""" + Name of the asset. + """, + ) + + is_location = sa.Column( + sa.Boolean(), + nullable=False, + default=False, + doc=""" + Whether the asset should be considered a location. + """, + ) + + is_fixed = sa.Column( + sa.Boolean(), + nullable=False, + default=False, + doc=""" + Whether the asset's location is fixed. + """, + ) + + notes = sa.Column( + sa.Text(), + nullable=True, + doc=""" + Notes for the asset. + """, + ) + + thumbnail_url = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional thumbnail URL for the asset. + """, + ) + + image_url = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional image URL for the asset. + """, + ) + + archived = sa.Column( + sa.Boolean(), + nullable=False, + default=False, + doc=""" + Whether the asset is archived. + """, + ) + + _parents = orm.relationship( + "AssetParent", + foreign_keys="AssetParent.asset_uuid", + back_populates="asset", + cascade="all, delete-orphan", + cascade_backrefs=False, + ) + + parents = association_proxy( + "_parents", + "parent", + creator=lambda parent: AssetParent(parent=parent), + ) + + _owners = orm.relationship( + "AssetOwner", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="asset", + ) + + owners = association_proxy( + "_owners", + "user", + creator=lambda user: AssetOwner(user=user), + ) + + def __str__(self): + return self.asset_name or "" + + +class AssetMixin: + + uuid = model.uuid_fk_column("asset.uuid", nullable=False, primary_key=True) + + @declared_attr + def asset(cls): + return orm.relationship( + Asset, + single_parent=True, + cascade="all, delete-orphan", + cascade_backrefs=False, + ) + + def __str__(self): + return self.asset_name or "" + + +def add_asset_proxies(subclass): + Asset.make_proxy(subclass, "asset", "farmos_uuid") + Asset.make_proxy(subclass, "asset", "drupal_id") + Asset.make_proxy(subclass, "asset", "asset_type") + Asset.make_proxy(subclass, "asset", "asset_name") + Asset.make_proxy(subclass, "asset", "is_location") + Asset.make_proxy(subclass, "asset", "is_fixed") + Asset.make_proxy(subclass, "asset", "notes") + Asset.make_proxy(subclass, "asset", "thumbnail_url") + Asset.make_proxy(subclass, "asset", "image_url") + Asset.make_proxy(subclass, "asset", "archived") + Asset.make_proxy(subclass, "asset", "parents") + Asset.make_proxy(subclass, "asset", "owners") + + +class EggMixin: + + produces_eggs = sa.Column( + sa.Boolean(), + nullable=True, + doc=""" + Whether the group asset produces eggs (i.e. it should be + available in the egg harvest form). + """, + ) + + +class AssetParent(model.Base): + """ + Represents an "asset's parent relationship" from farmOS. + """ + + __tablename__ = "asset_parent" + __versioned__ = {} + + uuid = model.uuid_column() + + asset_uuid = model.uuid_fk_column("asset.uuid", nullable=False) + + asset = orm.relationship( + Asset, + foreign_keys=asset_uuid, + ) + + parent_uuid = model.uuid_fk_column("asset.uuid", nullable=False) + + parent = orm.relationship( + Asset, + foreign_keys=parent_uuid, + ) + + +class AssetOwner(model.Base): + """ + Represents a "asset's owner relationship" from farmOS. + """ + + __tablename__ = "asset_owner" + __versioned__ = {} + + uuid = model.uuid_column() + + asset_uuid = model.uuid_fk_column("asset.uuid", nullable=False) + asset = orm.relationship( + Asset, + foreign_keys=asset_uuid, + back_populates="_owners", + ) + + user_uuid = model.uuid_fk_column("user.uuid", nullable=False) + user = orm.relationship( + model.User, + foreign_keys=user_uuid, + ) diff --git a/src/wuttafarm/db/model/asset_animal.py b/src/wuttafarm/db/model/asset_animal.py new file mode 100644 index 0000000..443a984 --- /dev/null +++ b/src/wuttafarm/db/model/asset_animal.py @@ -0,0 +1,141 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Animal Types +""" + +import sqlalchemy as sa +from sqlalchemy import orm + +from wuttjamaican.db import model + +from wuttafarm.db.model.asset import AssetMixin, add_asset_proxies, EggMixin + + +class AnimalType(model.Base): + """ + Represents an "animal type" (taxonomy term) from farmOS + """ + + __tablename__ = "animal_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Animal Type", + "model_title_plural": "Animal Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + doc=""" + Name of the animal type. + """, + ) + + description = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional description for the animal type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the animal type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the animal type. + """, + ) + + animal_assets = orm.relationship( + "AnimalAsset", + doc=""" + List of animal assets of this type. + """, + back_populates="animal_type", + ) + + def __str__(self): + return self.name or "" + + +class AnimalAsset(AssetMixin, EggMixin, model.Base): + """ + Represents an animal asset from farmOS + """ + + __tablename__ = "asset_animal" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Animal Asset", + "model_title_plural": "Animal Assets", + "farmos_asset_type": "animal", + } + + animal_type_uuid = model.uuid_fk_column("animal_type.uuid", nullable=False) + animal_type = orm.relationship( + "AnimalType", + doc=""" + Reference to the animal type. + """, + back_populates="animal_assets", + ) + + birthdate = sa.Column( + sa.DateTime(), + nullable=True, + doc=""" + Birth date (and time) for the animal, if known. + """, + ) + + sex = sa.Column( + sa.String(length=1), + nullable=True, + doc=""" + Sex of the animal. + """, + ) + + is_sterile = sa.Column( + sa.Boolean(), + nullable=True, + doc=""" + Whether the animal is sterile (e.g. castrated). + """, + ) + + +add_asset_proxies(AnimalAsset) diff --git a/src/wuttafarm/db/model/asset_group.py b/src/wuttafarm/db/model/asset_group.py new file mode 100644 index 0000000..ad4d184 --- /dev/null +++ b/src/wuttafarm/db/model/asset_group.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Groups +""" + +from wuttjamaican.db import model + +from wuttafarm.db.model.asset import AssetMixin, add_asset_proxies, EggMixin + + +class GroupAsset(AssetMixin, EggMixin, model.Base): + """ + Represents a group asset from farmOS + """ + + __tablename__ = "asset_group" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Group Asset", + "model_title_plural": "Group Assets", + "farmos_asset_type": "group", + } + + +add_asset_proxies(GroupAsset) diff --git a/src/wuttafarm/db/model/asset_land.py b/src/wuttafarm/db/model/asset_land.py new file mode 100644 index 0000000..6c65c54 --- /dev/null +++ b/src/wuttafarm/db/model/asset_land.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Land Types +""" + +import sqlalchemy as sa +from sqlalchemy import orm + +from wuttjamaican.db import model + +from wuttafarm.db.model.asset import AssetMixin, add_asset_proxies + + +class LandType(model.Base): + """ + Represents a "land type" from farmOS + """ + + __tablename__ = "land_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Land Type", + "model_title_plural": "Land Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the land type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the land type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.String(length=50), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the land type. + """, + ) + + land_assets = orm.relationship("LandAsset", back_populates="land_type") + + def __str__(self): + return self.name or "" + + +class LandAsset(AssetMixin, model.Base): + """ + Represents a "land asset" from farmOS + """ + + __tablename__ = "asset_land" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Land Asset", + "model_title_plural": "Land Assets", + "farmos_asset_type": "land", + } + + land_type_uuid = model.uuid_fk_column("land_type.uuid", nullable=False) + land_type = orm.relationship(LandType, back_populates="land_assets") + + +add_asset_proxies(LandAsset) diff --git a/src/wuttafarm/db/model/asset_plant.py b/src/wuttafarm/db/model/asset_plant.py new file mode 100644 index 0000000..62f7e9b --- /dev/null +++ b/src/wuttafarm/db/model/asset_plant.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Plant Assets +""" + +import sqlalchemy as sa +from sqlalchemy import orm +from sqlalchemy.ext.associationproxy import association_proxy + +from wuttjamaican.db import model + +from wuttafarm.db.model.asset import AssetMixin, add_asset_proxies + + +class PlantType(model.Base): + """ + Represents a "plant type" (taxonomy term) from farmOS + """ + + __tablename__ = "plant_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Plant Type", + "model_title_plural": "Plant Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the plant type. + """, + ) + + description = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional description for the plant type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the plant type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the plant type. + """, + ) + + _plant_assets = orm.relationship( + "PlantAssetPlantType", + cascade_backrefs=False, + back_populates="plant_type", + ) + + def __str__(self): + return self.name or "" + + +class PlantAsset(AssetMixin, model.Base): + """ + Represents a plant asset from farmOS + """ + + __tablename__ = "asset_plant" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Plant Asset", + "model_title_plural": "Plant Assets", + "farmos_asset_type": "plant", + } + + _plant_types = orm.relationship( + "PlantAssetPlantType", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="plant_asset", + ) + + plant_types = association_proxy( + "_plant_types", + "plant_type", + creator=lambda pt: PlantAssetPlantType(plant_type=pt), + ) + + +add_asset_proxies(PlantAsset) + + +class PlantAssetPlantType(model.Base): + """ + Associates one or more plant types with a plant asset. + """ + + __tablename__ = "asset_plant_plant_type" + __versioned__ = {} + + uuid = model.uuid_column() + + plant_asset_uuid = model.uuid_fk_column("asset_plant.uuid", nullable=False) + plant_asset = orm.relationship( + PlantAsset, + foreign_keys=plant_asset_uuid, + back_populates="_plant_types", + ) + + plant_type_uuid = model.uuid_fk_column("plant_type.uuid", nullable=False) + plant_type = orm.relationship( + PlantType, + doc=""" + Reference to the plant type. + """, + back_populates="_plant_assets", + ) diff --git a/src/wuttafarm/db/model/asset_structure.py b/src/wuttafarm/db/model/asset_structure.py new file mode 100644 index 0000000..7f4fc23 --- /dev/null +++ b/src/wuttafarm/db/model/asset_structure.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Structure Types +""" + +import sqlalchemy as sa +from sqlalchemy import orm + +from wuttjamaican.db import model + +from wuttafarm.db.model.asset import AssetMixin, add_asset_proxies + + +class StructureType(model.Base): + """ + Represents a "structure type" from farmOS + """ + + __tablename__ = "structure_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Structure Type", + "model_title_plural": "Structure Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the structure type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the structure type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.String(length=50), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the structure type. + """, + ) + + def __str__(self): + return self.name or "" + + +class StructureAsset(AssetMixin, model.Base): + """ + Represents a structure from farmOS + """ + + __tablename__ = "asset_structure" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Structure Asset", + "model_title_plural": "Structure Assets", + "farmos_asset_type": "structure", + } + + structure_type_uuid = model.uuid_fk_column("structure_type.uuid", nullable=False) + structure_type = orm.relationship( + "StructureType", + doc=""" + Reference to the type of structure. + """, + ) + + +add_asset_proxies(StructureAsset) diff --git a/src/wuttafarm/db/model/log.py b/src/wuttafarm/db/model/log.py new file mode 100644 index 0000000..7823353 --- /dev/null +++ b/src/wuttafarm/db/model/log.py @@ -0,0 +1,404 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Logs +""" + +import sqlalchemy as sa +from sqlalchemy import orm +from sqlalchemy.ext.declarative import declared_attr +from sqlalchemy.ext.associationproxy import association_proxy + +from wuttjamaican.db import model + + +class LogType(model.Base): + """ + Represents a "log type" from farmOS + """ + + __tablename__ = "log_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Log Type", + "model_title_plural": "Log Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the log type. + """, + ) + + description = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional description for the log type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the log type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.String(length=50), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the log type. + """, + ) + + def __str__(self): + return self.name or "" + + +class Log(model.Base): + """ + Represents a base log record from farmOS + """ + + __tablename__ = "log" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Log", + "model_title_plural": "All Logs", + } + + uuid = model.uuid_column() + + log_type = sa.Column( + sa.String(length=100), + sa.ForeignKey("log_type.drupal_id"), + nullable=False, + ) + + message = sa.Column( + sa.String(length=255), + nullable=False, + doc=""" + Message text for the log. + """, + ) + + timestamp = sa.Column( + sa.DateTime(), + nullable=False, + doc=""" + Date and time when the log event occurred / will occur. + """, + ) + + is_movement = sa.Column( + sa.Boolean(), + nullable=True, + doc=""" + Whether the log represents a movement to new location. + """, + ) + + is_group_assignment = sa.Column( + sa.Boolean(), + nullable=True, + doc=""" + Whether the log represents a group assignment. + """, + ) + + status = sa.Column( + sa.String(length=20), + nullable=False, + doc=""" + Current status of the log event. + """, + ) + + notes = sa.Column( + sa.Text(), + nullable=True, + doc=""" + Arbitrary notes for the log event. + """, + ) + + quick = sa.Column( + sa.String(length=20), + nullable=True, + doc=""" + Identifier of quick form used to create the log, if + applicable. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the log within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the log. + """, + ) + + _assets = orm.relationship( + "LogAsset", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="log", + ) + + assets = association_proxy( + "_assets", + "asset", + creator=lambda asset: LogAsset(asset=asset), + ) + + _groups = orm.relationship( + "LogGroup", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="log", + ) + + groups = association_proxy( + "_groups", + "asset", + creator=lambda asset: LogGroup(asset=asset), + ) + + _locations = orm.relationship( + "LogLocation", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="log", + ) + + locations = association_proxy( + "_locations", + "asset", + creator=lambda asset: LogLocation(asset=asset), + ) + + _quantities = orm.relationship( + "LogQuantity", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="log", + ) + + quantities = association_proxy( + "_quantities", + "quantity", + creator=lambda quantity: LogQuantity(quantity=quantity), + ) + + _owners = orm.relationship( + "LogOwner", + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="log", + ) + + owners = association_proxy( + "_owners", + "user", + creator=lambda user: LogOwner(user=user), + ) + + def __str__(self): + return self.message or "" + + +class LogMixin: + + uuid = model.uuid_fk_column("log.uuid", nullable=False, primary_key=True) + + @declared_attr + def log(cls): + return orm.relationship( + Log, + single_parent=True, + cascade="all, delete-orphan", + cascade_backrefs=False, + ) + + def __str__(self): + return self.message or "" + + +def add_log_proxies(subclass): + Log.make_proxy(subclass, "log", "farmos_uuid") + Log.make_proxy(subclass, "log", "drupal_id") + Log.make_proxy(subclass, "log", "log_type") + Log.make_proxy(subclass, "log", "message") + Log.make_proxy(subclass, "log", "timestamp") + Log.make_proxy(subclass, "log", "is_movement") + Log.make_proxy(subclass, "log", "is_group_assignment") + Log.make_proxy(subclass, "log", "status") + Log.make_proxy(subclass, "log", "notes") + Log.make_proxy(subclass, "log", "quick") + Log.make_proxy(subclass, "log", "assets") + Log.make_proxy(subclass, "log", "groups") + Log.make_proxy(subclass, "log", "locations") + Log.make_proxy(subclass, "log", "quantities") + Log.make_proxy(subclass, "log", "owners") + + +class LogAsset(model.Base): + """ + Represents a "log's asset relationship" from farmOS. + """ + + __tablename__ = "log_asset" + __versioned__ = {} + + uuid = model.uuid_column() + + log_uuid = model.uuid_fk_column("log.uuid", nullable=False) + log = orm.relationship( + Log, + foreign_keys=log_uuid, + back_populates="_assets", + ) + + asset_uuid = model.uuid_fk_column("asset.uuid", nullable=False) + asset = orm.relationship( + "Asset", + foreign_keys=asset_uuid, + ) + + +class LogGroup(model.Base): + """ + Represents a "log's group relationship" from farmOS. + """ + + __tablename__ = "log_group" + __versioned__ = {} + + uuid = model.uuid_column() + + log_uuid = model.uuid_fk_column("log.uuid", nullable=False) + log = orm.relationship( + Log, + foreign_keys=log_uuid, + back_populates="_groups", + ) + + asset_uuid = model.uuid_fk_column("asset.uuid", nullable=False) + asset = orm.relationship( + "Asset", + foreign_keys=asset_uuid, + ) + + +class LogLocation(model.Base): + """ + Represents a "log's location relationship" from farmOS. + """ + + __tablename__ = "log_location" + __versioned__ = {} + + uuid = model.uuid_column() + + log_uuid = model.uuid_fk_column("log.uuid", nullable=False) + log = orm.relationship( + Log, + foreign_keys=log_uuid, + back_populates="_locations", + ) + + asset_uuid = model.uuid_fk_column("asset.uuid", nullable=False) + asset = orm.relationship( + "Asset", + foreign_keys=asset_uuid, + ) + + +class LogQuantity(model.Base): + """ + Represents a "log's quantity relationship" from farmOS. + """ + + __tablename__ = "log_quantity" + __versioned__ = {} + + uuid = model.uuid_column() + + log_uuid = model.uuid_fk_column("log.uuid", nullable=False) + log = orm.relationship( + Log, + foreign_keys=log_uuid, + back_populates="_quantities", + ) + + quantity_uuid = model.uuid_fk_column("quantity.uuid", nullable=False) + quantity = orm.relationship( + "Quantity", + foreign_keys=quantity_uuid, + back_populates="_log", + ) + + +class LogOwner(model.Base): + """ + Represents a "log's owner relationship" from farmOS. + """ + + __tablename__ = "log_owner" + __versioned__ = {} + + uuid = model.uuid_column() + + log_uuid = model.uuid_fk_column("log.uuid", nullable=False) + log = orm.relationship( + Log, + foreign_keys=log_uuid, + back_populates="_owners", + ) + + user_uuid = model.uuid_fk_column("user.uuid", nullable=False) + user = orm.relationship( + model.User, + foreign_keys=user_uuid, + ) diff --git a/src/wuttafarm/db/model/log_activity.py b/src/wuttafarm/db/model/log_activity.py new file mode 100644 index 0000000..2f5f6e5 --- /dev/null +++ b/src/wuttafarm/db/model/log_activity.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Activity Logs +""" + +from wuttjamaican.db import model + +from wuttafarm.db.model.log import LogMixin, add_log_proxies + + +class ActivityLog(LogMixin, model.Base): + """ + Represents an Activity Log from farmOS + """ + + __tablename__ = "log_activity" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Activity Log", + "model_title_plural": "Activity Logs", + "farmos_log_type": "activity", + } + + +add_log_proxies(ActivityLog) diff --git a/src/wuttafarm/db/model/log_harvest.py b/src/wuttafarm/db/model/log_harvest.py new file mode 100644 index 0000000..35c3105 --- /dev/null +++ b/src/wuttafarm/db/model/log_harvest.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Harvest Logs +""" + +from wuttjamaican.db import model + +from wuttafarm.db.model.log import LogMixin, add_log_proxies + + +class HarvestLog(LogMixin, model.Base): + """ + Represents a Harvest Log from farmOS + """ + + __tablename__ = "log_harvest" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Harvest Log", + "model_title_plural": "Harvest Logs", + "farmos_log_type": "harvest", + } + + +add_log_proxies(HarvestLog) diff --git a/src/wuttafarm/db/model/log_medical.py b/src/wuttafarm/db/model/log_medical.py new file mode 100644 index 0000000..6cf308f --- /dev/null +++ b/src/wuttafarm/db/model/log_medical.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Medical Logs +""" + +import sqlalchemy as sa + +from wuttjamaican.db import model + +from wuttafarm.db.model.log import LogMixin, add_log_proxies + + +class MedicalLog(LogMixin, model.Base): + """ + Represents a Medical Log from farmOS + """ + + __tablename__ = "log_medical" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Medical Log", + "model_title_plural": "Medical Logs", + "farmos_log_type": "medical", + } + + vet = sa.Column( + sa.String(length=100), + nullable=True, + doc=""" + Name of the veterinarian, if applicable. + """, + ) + + +add_log_proxies(MedicalLog) diff --git a/src/wuttafarm/db/model/log_observation.py b/src/wuttafarm/db/model/log_observation.py new file mode 100644 index 0000000..ab89c3f --- /dev/null +++ b/src/wuttafarm/db/model/log_observation.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Observation Logs +""" + +from wuttjamaican.db import model + +from wuttafarm.db.model.log import LogMixin, add_log_proxies + + +class ObservationLog(LogMixin, model.Base): + """ + Represents a Observation Log from farmOS + """ + + __tablename__ = "log_observation" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Observation Log", + "model_title_plural": "Observation Logs", + "farmos_log_type": "observation", + } + + +add_log_proxies(ObservationLog) diff --git a/src/wuttafarm/db/model/quantities.py b/src/wuttafarm/db/model/quantities.py new file mode 100644 index 0000000..4bed6a0 --- /dev/null +++ b/src/wuttafarm/db/model/quantities.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Quantities +""" + +import sqlalchemy as sa +from sqlalchemy import orm +from sqlalchemy.ext.declarative import declared_attr +from sqlalchemy.ext.associationproxy import association_proxy + +from wuttjamaican.db import model + + +class QuantityType(model.Base): + """ + Represents an "quantity type" from farmOS + """ + + __tablename__ = "quantity_type" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Quantity Type", + "model_title_plural": "Quantity Types", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the quantity type. + """, + ) + + description = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Description for the quantity type. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the quantity type within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.String(length=50), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the quantity type. + """, + ) + + def __str__(self): + return self.name or "" + + +class Quantity(model.Base): + """ + Represents a base quantity record from farmOS + """ + + __tablename__ = "quantity" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Quantity", + "model_title_plural": "All Quantities", + } + + uuid = model.uuid_column() + + quantity_type_id = sa.Column( + sa.String(length=50), + sa.ForeignKey("quantity_type.drupal_id"), + nullable=False, + ) + + quantity_type = orm.relationship(QuantityType) + + measure_id = sa.Column( + sa.String(length=20), + sa.ForeignKey("measure.drupal_id"), + nullable=False, + doc=""" + Measure for the quantity. + """, + ) + + measure = orm.relationship("Measure") + + value_numerator = sa.Column( + sa.Integer(), + nullable=False, + doc=""" + Numerator for the quantity value. + """, + ) + + value_denominator = sa.Column( + sa.Integer(), + nullable=False, + doc=""" + Denominator for the quantity value. + """, + ) + + units_uuid = model.uuid_fk_column("unit.uuid", nullable=False) + units = orm.relationship("Unit") + + label = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional label for the quantity. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the quantity within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the quantity. + """, + ) + + _log = orm.relationship( + "LogQuantity", + uselist=False, + cascade="all, delete-orphan", + cascade_backrefs=False, + back_populates="quantity", + ) + + def make_log_quantity(log): + from wuttafarm.db.model import LogQuantity + + return LogQuantity(log=log) + + log = association_proxy( + "_log", + "log", + creator=make_log_quantity, + ) + + def render_as_text(self, config=None): + measure = str(self.measure or self.measure_id or "") + value = self.value_numerator / self.value_denominator + if config: + app = config.get_app() + value = app.render_quantity(value) + units = str(self.units or "") + return f"( {measure} ) {value} {units}" + + def __str__(self): + return self.render_as_text() + + +class QuantityMixin: + + uuid = model.uuid_fk_column("quantity.uuid", nullable=False, primary_key=True) + + @declared_attr + def quantity(cls): + return orm.relationship(Quantity) + + def render_as_text(self, config=None): + return self.quantity.render_as_text(config) + + def __str__(self): + return self.render_as_text() + + +def add_quantity_proxies(subclass): + Quantity.make_proxy(subclass, "quantity", "farmos_uuid") + Quantity.make_proxy(subclass, "quantity", "drupal_id") + Quantity.make_proxy(subclass, "quantity", "quantity_type") + Quantity.make_proxy(subclass, "quantity", "quantity_type_id") + Quantity.make_proxy(subclass, "quantity", "measure") + Quantity.make_proxy(subclass, "quantity", "measure_id") + Quantity.make_proxy(subclass, "quantity", "value_numerator") + Quantity.make_proxy(subclass, "quantity", "value_denominator") + Quantity.make_proxy(subclass, "quantity", "value_decimal") + Quantity.make_proxy(subclass, "quantity", "units_uuid") + Quantity.make_proxy(subclass, "quantity", "units") + Quantity.make_proxy(subclass, "quantity", "label") + Quantity.make_proxy(subclass, "quantity", "log") + + +class StandardQuantity(QuantityMixin, model.Base): + """ + Represents a Standard Quantity from farmOS + """ + + __tablename__ = "quantity_standard" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Standard Quantity", + "model_title_plural": "Standard Quantities", + "farmos_quantity_type": "standard", + } + + +add_quantity_proxies(StandardQuantity) diff --git a/src/wuttafarm/db/model/unit.py b/src/wuttafarm/db/model/unit.py new file mode 100644 index 0000000..e9c6e70 --- /dev/null +++ b/src/wuttafarm/db/model/unit.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Units +""" + +import sqlalchemy as sa + +from wuttjamaican.db import model + + +class Measure(model.Base): + """ + Represents a "measure" option (for quantities) from farmOS + """ + + __tablename__ = "measure" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Measure", + "model_title_plural": "Measures", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the measure. + """, + ) + + drupal_id = sa.Column( + sa.String(length=20), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the measure. + """, + ) + + def __str__(self): + return self.name or "" + + +class Unit(model.Base): + """ + Represents an "unit" (taxonomy term) from farmOS + """ + + __tablename__ = "unit" + __versioned__ = {} + __wutta_hint__ = { + "model_title": "Unit", + "model_title_plural": "Units", + } + + uuid = model.uuid_column() + + name = sa.Column( + sa.String(length=100), + nullable=False, + unique=True, + doc=""" + Name of the unit. + """, + ) + + description = sa.Column( + sa.String(length=255), + nullable=True, + doc=""" + Optional description for the unit. + """, + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + unique=True, + doc=""" + UUID for the unit within farmOS. + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + unique=True, + doc=""" + Drupal internal ID for the unit. + """, + ) + + def __str__(self): + return self.name or "" diff --git a/src/wuttafarm/db/model/users.py b/src/wuttafarm/db/model/users.py new file mode 100644 index 0000000..d194175 --- /dev/null +++ b/src/wuttafarm/db/model/users.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Model definition for Users (extension) +""" + +import sqlalchemy as sa +from sqlalchemy import orm + +from wuttjamaican.db import model + + +class WuttaFarmUser(model.Base): + """ + WuttaFarm extension for the User model. + """ + + __tablename__ = "wuttafarm_user" + __versioned__ = {} + + uuid = model.uuid_column(sa.ForeignKey("user.uuid"), default=None) + + user = orm.relationship( + model.User, + doc=""" + Reference to the User which this record extends. + """, + backref=orm.backref( + "_wuttafarm", + uselist=False, + cascade="all, delete-orphan", + cascade_backrefs=False, + doc=""" + Reference to the WuttaFarm-specific extension record for + the user. + """, + ), + ) + + farmos_uuid = sa.Column( + model.UUID(), + nullable=True, + doc=""" + UUID for the user within farmOS + """, + ) + + drupal_id = sa.Column( + sa.Integer(), + nullable=True, + doc=""" + Drupal internal ID for the user. + """, + ) + + def __str__(self): + return str(self.user or "") + + +WuttaFarmUser.make_proxy(model.User, "_wuttafarm", "farmos_uuid") +WuttaFarmUser.make_proxy(model.User, "_wuttafarm", "drupal_id") diff --git a/src/wuttafarm/emails.py b/src/wuttafarm/emails.py new file mode 100644 index 0000000..05416ab --- /dev/null +++ b/src/wuttafarm/emails.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Email sending config for WuttaFarm +""" + +from wuttasync.emails import ImportExportWarning + + +class export_to_farmos_from_wuttafarm_warning(ImportExportWarning): + """ + Diff warning for WuttaFarm → farmOS export. + """ + + +class import_to_wuttafarm_from_farmos_warning(ImportExportWarning): + """ + Diff warning for farmOS → WuttaFarm import. + """ diff --git a/src/wuttafarm/enum.py b/src/wuttafarm/enum.py new file mode 100644 index 0000000..870e4cd --- /dev/null +++ b/src/wuttafarm/enum.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +WuttaFarm enum values +""" + +from collections import OrderedDict + +from wuttjamaican.enum import * + + +FARMOS_INTEGRATION_MODE_WRAPPER = "wrapper" +FARMOS_INTEGRATION_MODE_MIRROR = "mirror" +FARMOS_INTEGRATION_MODE_NONE = "none" + +FARMOS_INTEGRATION_MODE = OrderedDict( + [ + (FARMOS_INTEGRATION_MODE_WRAPPER, "wrapper (API only)"), + (FARMOS_INTEGRATION_MODE_MIRROR, "mirror (2-way sync)"), + (FARMOS_INTEGRATION_MODE_NONE, "none (standalone)"), + ] +) + + +ANIMAL_SEX = OrderedDict( + [ + ("M", "Male"), + ("F", "Female"), + ] +) + + +LOG_STATUS = OrderedDict( + [ + ("pending", "Pending"), + ("done", "Done"), + ("abandoned", "Abandoned"), + ] +) diff --git a/src/wuttafarm/farmos/__init__.py b/src/wuttafarm/farmos/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/wuttafarm/farmos.py b/src/wuttafarm/farmos/handler.py similarity index 57% rename from src/wuttafarm/farmos.py rename to src/wuttafarm/farmos/handler.py index 16ec1a6..e905f92 100644 --- a/src/wuttafarm/farmos.py +++ b/src/wuttafarm/farmos/handler.py @@ -23,6 +23,8 @@ farmOS integration handler """ +from farmOS import farmOS + from wuttjamaican.app import GenericHandler @@ -32,6 +34,43 @@ class FarmOSHandler(GenericHandler): :term:`handler`. """ + def get_farmos_client(self, hostname=None, **kwargs): + """ + Returns a new farmOS API client. + """ + if not hostname: + hostname = self.get_farmos_url() + return farmOS(hostname, **kwargs) + + def get_farmos_version(self, client=None, *args, **kwargs): + """ + Returns the farmOS version in use. + """ + if not client: + client = self.get_farmos_client(*args, **kwargs) + info = client.info() + return info["meta"]["farm"]["version"] + + def is_farmos_3x(self, client=None, *args, **kwargs): + """ + Check if the farmOS version is 3.x. + """ + if not client: + client = self.get_farmos_client(*args, **kwargs) + + version = self.get_farmos_version(client) + return version[0] == "3" + + def is_farmos_4x(self, client=None, *args, **kwargs): + """ + Check if the farmOS version is 4.x. + """ + if not client: + client = self.get_farmos_client(*args, **kwargs) + + version = self.get_farmos_version(client) + return version[0] == "4" + def get_farmos_url(self, path=None, require=True): """ Returns the base URL for farmOS, or one with ``path`` appended. @@ -55,3 +94,9 @@ class FarmOSHandler(GenericHandler): return f"{base}/{path}" return base + + def get_oauth2_client_id(self): + return self.config.get("farmos.oauth2.client_id", default="farm") + + def get_oauth2_scope(self): + return self.config.get("farmos.oauth2.scope", default="farm_manager") diff --git a/src/wuttafarm/farmos/importing/__init__.py b/src/wuttafarm/farmos/importing/__init__.py new file mode 100644 index 0000000..a4b17eb --- /dev/null +++ b/src/wuttafarm/farmos/importing/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Importing data *into* farmOS +""" + +from . import model diff --git a/src/wuttafarm/farmos/importing/model.py b/src/wuttafarm/farmos/importing/model.py new file mode 100644 index 0000000..ad1cb38 --- /dev/null +++ b/src/wuttafarm/farmos/importing/model.py @@ -0,0 +1,758 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Importer models targeting farmOS +""" + +import datetime +from uuid import UUID + +import requests + +from wuttasync.importing import Importer + + +class ToFarmOS(Importer): + """ + Base class for data importer targeting the farmOS API. + """ + + key = "uuid" + caches_target = True + + def format_datetime(self, dt): + """ + Convert a WuttaFarm datetime object to the format required for + pushing to the farmOS API. + """ + if dt is None: + return None + dt = self.app.localtime(dt) + return dt.timestamp() + + def normalize_datetime(self, dt): + """ + Convert a farmOS datetime value to naive UTC used by + WuttaFarm. + + :param dt: Date/time string value "as-is" from the farmOS API. + + :returns: Equivalent naive UTC ``datetime`` + """ + if dt is None: + return None + dt = datetime.datetime.fromisoformat(dt) + return self.app.make_utc(dt) + + +class ToFarmOSTaxonomy(ToFarmOS): + + farmos_taxonomy_type = None + + supported_fields = [ + "uuid", + "name", + ] + + def get_target_objects(self, **kwargs): + result = self.farmos_client.resource.get( + "taxonomy_term", self.farmos_taxonomy_type + ) + return result["data"] + + def get_target_object(self, key): + + # fetch from cache, if applicable + if self.caches_target: + return super().get_target_object(key) + + # okay now must fetch via API + if self.get_keys() != ["uuid"]: + raise ValueError("must use uuid key for this to work") + uuid = key[0] + + try: + result = self.farmos_client.resource.get_id( + "taxonomy_term", self.farmos_taxonomy_type, str(uuid) + ) + except requests.HTTPError as exc: + if exc.response.status_code == 404: + return None + raise + return result["data"] + + def normalize_target_object(self, obj): + return { + "uuid": UUID(obj["id"]), + "name": obj["attributes"]["name"], + } + + def get_term_payload(self, source_data): + return { + "attributes": { + "name": source_data["name"], + } + } + + def create_target_object(self, key, source_data): + if source_data.get("__ignoreme__"): + return None + if self.dry_run: + return source_data + + payload = self.get_term_payload(source_data) + result = self.farmos_client.resource.send( + "taxonomy_term", self.farmos_taxonomy_type, payload + ) + normal = self.normalize_target_object(result["data"]) + normal["_new_object"] = result["data"] + return normal + + def update_target_object(self, asset, source_data, target_data=None): + if self.dry_run: + return asset + + payload = self.get_term_payload(source_data) + payload["id"] = str(source_data["uuid"]) + result = self.farmos_client.resource.send( + "taxonomy_term", self.farmos_taxonomy_type, payload + ) + return self.normalize_target_object(result["data"]) + + +class ToFarmOSAsset(ToFarmOS): + """ + Base class for asset data importer targeting the farmOS API. + """ + + farmos_asset_type = None + + def get_target_objects(self, **kwargs): + assets = self.farmos_client.asset.get(self.farmos_asset_type) + return assets["data"] + + def get_target_object(self, key): + + # fetch from cache, if applicable + if self.caches_target: + return super().get_target_object(key) + + # okay now must fetch via API + if self.get_keys() != ["uuid"]: + raise ValueError("must use uuid key for this to work") + uuid = key[0] + + try: + asset = self.farmos_client.asset.get_id(self.farmos_asset_type, str(uuid)) + except requests.HTTPError as exc: + if exc.response.status_code == 404: + return None + raise + return asset["data"] + + def create_target_object(self, key, source_data): + if source_data.get("__ignoreme__"): + return None + if self.dry_run: + return source_data + + payload = self.get_asset_payload(source_data) + result = self.farmos_client.asset.send(self.farmos_asset_type, payload) + normal = self.normalize_target_object(result["data"]) + normal["_new_object"] = result["data"] + return normal + + def update_target_object(self, asset, source_data, target_data=None): + if self.dry_run: + return asset + + payload = self.get_asset_payload(source_data) + payload["id"] = str(source_data["uuid"]) + result = self.farmos_client.asset.send(self.farmos_asset_type, payload) + return self.normalize_target_object(result["data"]) + + def normalize_target_object(self, asset): + + if notes := asset["attributes"]["notes"]: + notes = notes["value"] + + return { + "uuid": UUID(asset["id"]), + "asset_name": asset["attributes"]["name"], + "is_location": asset["attributes"]["is_location"], + "is_fixed": asset["attributes"]["is_fixed"], + "produces_eggs": asset["attributes"].get("produces_eggs"), + "notes": notes, + "archived": asset["attributes"]["archived"], + } + + def get_asset_payload(self, source_data): + + attrs = {} + if "asset_name" in self.fields: + attrs["name"] = source_data["asset_name"] + if "is_location" in self.fields: + attrs["is_location"] = source_data["is_location"] + if "is_fixed" in self.fields: + attrs["is_fixed"] = source_data["is_fixed"] + if "produces_eggs" in self.fields: + attrs["produces_eggs"] = source_data["produces_eggs"] + if "notes" in self.fields: + attrs["notes"] = {"value": source_data["notes"]} + if "archived" in self.fields: + attrs["archived"] = source_data["archived"] + + payload = {"attributes": attrs} + + return payload + + +class UnitImporter(ToFarmOSTaxonomy): + + model_title = "Unit" + farmos_taxonomy_type = "unit" + + +class AnimalAssetImporter(ToFarmOSAsset): + + model_title = "AnimalAsset" + farmos_asset_type = "animal" + + supported_fields = [ + "uuid", + "asset_name", + "animal_type_uuid", + "sex", + "is_sterile", + "produces_eggs", + "birthdate", + "notes", + "archived", + ] + + def normalize_target_object(self, animal): + data = super().normalize_target_object(animal) + data.update( + { + "animal_type_uuid": UUID( + animal["relationships"]["animal_type"]["data"]["id"] + ), + "sex": animal["attributes"]["sex"], + "is_sterile": animal["attributes"]["is_sterile"], + "birthdate": self.normalize_datetime(animal["attributes"]["birthdate"]), + } + ) + return data + + def get_asset_payload(self, source_data): + payload = super().get_asset_payload(source_data) + + attrs = {} + if "sex" in self.fields: + attrs["sex"] = source_data["sex"] + if "is_sterile" in self.fields: + attrs["is_sterile"] = source_data["is_sterile"] + if "birthdate" in self.fields: + attrs["birthdate"] = self.format_datetime(source_data["birthdate"]) + + rels = {} + if "animal_type_uuid" in self.fields: + rels["animal_type"] = { + "data": { + "id": str(source_data["animal_type_uuid"]), + "type": "taxonomy_term--animal_type", + } + } + + payload["attributes"].update(attrs) + if rels: + payload.setdefault("relationships", {}).update(rels) + + return payload + + +class AnimalTypeImporter(ToFarmOSTaxonomy): + + model_title = "AnimalType" + farmos_taxonomy_type = "animal_type" + + +class GroupAssetImporter(ToFarmOSAsset): + + model_title = "GroupAsset" + farmos_asset_type = "group" + + supported_fields = [ + "uuid", + "asset_name", + "produces_eggs", + "notes", + "archived", + ] + + +class LandAssetImporter(ToFarmOSAsset): + + model_title = "LandAsset" + farmos_asset_type = "land" + + supported_fields = [ + "uuid", + "asset_name", + "land_type_id", + "is_location", + "is_fixed", + "notes", + "archived", + ] + + def normalize_target_object(self, land): + data = super().normalize_target_object(land) + data.update( + { + "land_type_id": land["attributes"]["land_type"], + } + ) + return data + + def get_asset_payload(self, source_data): + payload = super().get_asset_payload(source_data) + + attrs = {} + if "land_type_id" in self.fields: + attrs["land_type"] = source_data["land_type_id"] + + if attrs: + payload["attributes"].update(attrs) + + return payload + + +class PlantTypeImporter(ToFarmOSTaxonomy): + + model_title = "PlantType" + farmos_taxonomy_type = "plant_type" + + +class PlantAssetImporter(ToFarmOSAsset): + + model_title = "PlantAsset" + farmos_asset_type = "plant" + + supported_fields = [ + "uuid", + "asset_name", + "plant_type_uuids", + "notes", + "archived", + ] + + def normalize_target_object(self, plant): + data = super().normalize_target_object(plant) + data.update( + { + "plant_type_uuids": [ + UUID(p["id"]) for p in plant["relationships"]["plant_type"]["data"] + ], + } + ) + return data + + def get_asset_payload(self, source_data): + payload = super().get_asset_payload(source_data) + + attrs = {} + if "sex" in self.fields: + attrs["sex"] = source_data["sex"] + if "is_sterile" in self.fields: + attrs["is_sterile"] = source_data["is_sterile"] + if "birthdate" in self.fields: + attrs["birthdate"] = self.format_datetime(source_data["birthdate"]) + + rels = {} + if "plant_type_uuids" in self.fields: + rels["plant_type"] = {"data": []} + for uuid in source_data["plant_type_uuids"]: + rels["plant_type"]["data"].append( + { + "id": str(uuid), + "type": "taxonomy_term--plant_type", + } + ) + + payload["attributes"].update(attrs) + if rels: + payload.setdefault("relationships", {}).update(rels) + + return payload + + +class StructureAssetImporter(ToFarmOSAsset): + + model_title = "StructureAsset" + farmos_asset_type = "structure" + + supported_fields = [ + "uuid", + "asset_name", + "structure_type_id", + "is_location", + "is_fixed", + "notes", + "archived", + ] + + def normalize_target_object(self, structure): + data = super().normalize_target_object(structure) + data.update( + { + "structure_type_id": structure["attributes"]["structure_type"], + } + ) + return data + + def get_asset_payload(self, source_data): + payload = super().get_asset_payload(source_data) + + attrs = {} + if "structure_type_id" in self.fields: + attrs["structure_type"] = source_data["structure_type_id"] + + if attrs: + payload["attributes"].update(attrs) + + return payload + + +############################## +# quantity importers +############################## + + +class ToFarmOSQuantity(ToFarmOS): + """ + Base class for quantity data importer targeting the farmOS API. + """ + + farmos_quantity_type = None + + supported_fields = [ + "uuid", + "measure", + "value_numerator", + "value_denominator", + "label", + "quantity_type_uuid", + "unit_uuid", + ] + + def get_target_objects(self, **kwargs): + return list( + self.farmos_client.resource.iterate("quantity", self.farmos_quantity_type) + ) + + def get_target_object(self, key): + + # fetch from cache, if applicable + if self.caches_target: + return super().get_target_object(key) + + # okay now must fetch via API + if self.get_keys() != ["uuid"]: + raise ValueError("must use uuid key for this to work") + uuid = key[0] + + try: + qty = self.farmos_client.resource.get_id( + "quantity", self.farmos_quantity_type, str(uuid) + ) + except requests.HTTPError as exc: + if exc.response.status_code == 404: + return None + raise + return qty["data"] + + def create_target_object(self, key, source_data): + if source_data.get("__ignoreme__"): + return None + if self.dry_run: + return source_data + + payload = self.get_quantity_payload(source_data) + result = self.farmos_client.resource.send( + "quantity", self.farmos_quantity_type, payload + ) + normal = self.normalize_target_object(result["data"]) + normal["_new_object"] = result["data"] + return normal + + def update_target_object(self, quantity, source_data, target_data=None): + if self.dry_run: + return quantity + + payload = self.get_quantity_payload(source_data) + payload["id"] = str(source_data["uuid"]) + result = self.farmos_client.resource.send( + "quantity", self.farmos_quantity_type, payload + ) + return self.normalize_target_object(result["data"]) + + def normalize_target_object(self, qty): + + result = { + "uuid": UUID(qty["id"]), + "measure": qty["attributes"]["measure"], + "value_numerator": qty["attributes"]["value"]["numerator"], + "value_denominator": qty["attributes"]["value"]["denominator"], + "label": qty["attributes"]["label"], + "quantity_type_uuid": UUID( + qty["relationships"]["quantity_type"]["data"]["id"] + ), + "unit_uuid": None, + } + + if unit := qty["relationships"]["units"]["data"]: + result["unit_uuid"] = UUID(unit["id"]) + + return result + + def get_quantity_payload(self, source_data): + + attrs = {} + if "measure" in self.fields: + attrs["measure"] = source_data["measure"] + if "value_numerator" in self.fields and "value_denominator" in self.fields: + attrs["value"] = { + "numerator": source_data["value_numerator"], + "denominator": source_data["value_denominator"], + } + if "label" in self.fields: + attrs["label"] = source_data["label"] + + rels = {} + if "quantity_type_uuid" in self.fields: + rels["quantity_type"] = { + "data": { + "id": str(source_data["quantity_type_uuid"]), + "type": "quantity_type--quantity_type", + } + } + if "unit_uuid" in self.fields: + rels["units"] = { + "data": { + "id": str(source_data["unit_uuid"]), + "type": "taxonomy_term--unit", + } + } + + payload = {"attributes": attrs, "relationships": rels} + + return payload + + +class StandardQuantityImporter(ToFarmOSQuantity): + + model_title = "StandardQuantity" + farmos_quantity_type = "standard" + + +############################## +# log importers +############################## + + +class ToFarmOSLog(ToFarmOS): + """ + Base class for log data importer targeting the farmOS API. + """ + + farmos_log_type = None + + supported_fields = [ + "uuid", + "name", + "timestamp", + "is_movement", + "is_group_assignment", + "status", + "notes", + "quick", + "assets", + "quantities", + ] + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.normal = self.app.get_normalizer(self.farmos_client) + + def get_target_objects(self, **kwargs): + result = self.farmos_client.log.get(self.farmos_log_type) + return result["data"] + + def get_target_object(self, key): + + # fetch from cache, if applicable + if self.caches_target: + return super().get_target_object(key) + + # okay now must fetch via API + if self.get_keys() != ["uuid"]: + raise ValueError("must use uuid key for this to work") + uuid = key[0] + + try: + log = self.farmos_client.log.get_id(self.farmos_log_type, str(uuid)) + except requests.HTTPError as exc: + if exc.response.status_code == 404: + return None + raise + return log["data"] + + def create_target_object(self, key, source_data): + if source_data.get("__ignoreme__"): + return None + if self.dry_run: + return source_data + + payload = self.get_log_payload(source_data) + result = self.farmos_client.log.send(self.farmos_log_type, payload) + normal = self.normalize_target_object(result["data"]) + normal["_new_object"] = result["data"] + return normal + + def update_target_object(self, asset, source_data, target_data=None): + if self.dry_run: + return asset + + payload = self.get_log_payload(source_data) + payload["id"] = str(source_data["uuid"]) + result = self.farmos_client.log.send(self.farmos_log_type, payload) + return self.normalize_target_object(result["data"]) + + def normalize_target_object(self, log): + normal = self.normal.normalize_farmos_log(log) + return { + "uuid": UUID(normal["uuid"]), + "name": normal["name"], + "timestamp": self.app.make_utc(normal["timestamp"]), + "is_movement": normal["is_movement"], + "is_group_assignment": normal["is_group_assignment"], + "status": normal["status"], + "notes": normal["notes"], + "quick": normal["quick"], + "assets": [(a["asset_type"], UUID(a["uuid"])) for a in normal["assets"]], + "quantities": [UUID(uuid) for uuid in normal["quantity_uuids"]], + } + + def get_log_payload(self, source_data): + + attrs = {} + if "name" in self.fields: + attrs["name"] = source_data["name"] + if "timestamp" in self.fields: + attrs["timestamp"] = self.format_datetime(source_data["timestamp"]) + if "is_movement" in self.fields: + attrs["is_movement"] = source_data["is_movement"] + if "is_group_assignment" in self.fields: + attrs["is_group_assignment"] = source_data["is_group_assignment"] + if "status" in self.fields: + attrs["status"] = source_data["status"] + if "notes" in self.fields: + attrs["notes"] = {"value": source_data["notes"]} + if "quick" in self.fields: + attrs["quick"] = source_data["quick"] + + rels = {} + if "assets" in self.fields: + assets = [] + for asset_type, uuid in source_data["assets"]: + assets.append( + { + "type": f"asset--{asset_type}", + "id": str(uuid), + } + ) + rels["asset"] = {"data": assets} + if "quantities" in self.fields: + quantities = [] + for uuid in source_data["quantities"]: + quantities.append( + { + # TODO: support other quantity types + "type": "quantity--standard", + "id": str(uuid), + } + ) + rels["quantity"] = {"data": quantities} + + payload = {"attributes": attrs, "relationships": rels} + return payload + + +class ActivityLogImporter(ToFarmOSLog): + + model_title = "ActivityLog" + farmos_log_type = "activity" + + +class HarvestLogImporter(ToFarmOSLog): + + model_title = "HarvestLog" + farmos_log_type = "harvest" + + +class MedicalLogImporter(ToFarmOSLog): + + model_title = "MedicalLog" + farmos_log_type = "medical" + + def get_supported_fields(self): + fields = list(super().get_supported_fields()) + fields.extend( + [ + "vet", + ] + ) + return fields + + def normalize_target_object(self, log): + data = super().normalize_target_object(log) + data.update( + { + "vet": log["attributes"]["vet"], + } + ) + return data + + def get_log_payload(self, source_data): + payload = super().get_log_payload(source_data) + + if "vet" in self.fields: + payload["attributes"]["vet"] = source_data["vet"] + + return payload + + +class ObservationLogImporter(ToFarmOSLog): + + model_title = "ObservationLog" + farmos_log_type = "observation" diff --git a/src/wuttafarm/farmos/importing/wuttafarm.py b/src/wuttafarm/farmos/importing/wuttafarm.py new file mode 100644 index 0000000..8394e4c --- /dev/null +++ b/src/wuttafarm/farmos/importing/wuttafarm.py @@ -0,0 +1,482 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +WuttaFarm → farmOS data export +""" + +from oauthlib.oauth2 import BackendApplicationClient +from requests_oauthlib import OAuth2Session + +from wuttasync.importing import ImportHandler, FromWuttaHandler, FromWutta, Orientation + +from wuttafarm.db import model +from wuttafarm.farmos import importing as farmos_importing + + +class FromWuttaFarmHandler(FromWuttaHandler): + """ + Base class for import handler targeting WuttaFarm + """ + + source_key = "wuttafarm" + + +class ToFarmOSHandler(ImportHandler): + """ + Base class for export handlers using CSV file(s) as data target. + """ + + target_key = "farmos" + generic_target_title = "farmOS" + + # TODO: a lot of duplication to cleanup here; see FromFarmOSHandler + + def begin_target_transaction(self, client=None): + """ + Establish the farmOS API client. + """ + if client: + self.farmos_client = client + else: + token = self.get_farmos_oauth2_token() + self.farmos_client = self.app.get_farmos_client(token=token) + self.farmos_4x = self.app.is_farmos_4x(self.farmos_client) + + def get_farmos_oauth2_token(self): + + client_id = self.config.get( + "farmos.oauth2.importing.client_id", default="wuttafarm" + ) + client_secret = self.config.require("farmos.oauth2.importing.client_secret") + scope = self.config.get("farmos.oauth2.importing.scope", default="farm_manager") + + client = BackendApplicationClient(client_id=client_id) + oauth = OAuth2Session(client=client) + + return oauth.fetch_token( + token_url=self.app.get_farmos_url("/oauth/token"), + include_client_id=True, + client_secret=client_secret, + scope=scope, + ) + + def get_importer_kwargs(self, key, **kwargs): + kwargs = super().get_importer_kwargs(key, **kwargs) + kwargs["farmos_client"] = self.farmos_client + kwargs["farmos_4x"] = self.farmos_4x + return kwargs + + +class FromWuttaFarmToFarmOS(FromWuttaFarmHandler, ToFarmOSHandler): + """ + Handler for WuttaFarm → farmOS API export. + """ + + orientation = Orientation.EXPORT + + def define_importers(self): + """ """ + importers = super().define_importers() + importers["LandAsset"] = LandAssetImporter + importers["StructureAsset"] = StructureAssetImporter + importers["AnimalType"] = AnimalTypeImporter + importers["AnimalAsset"] = AnimalAssetImporter + importers["GroupAsset"] = GroupAssetImporter + importers["PlantType"] = PlantTypeImporter + importers["PlantAsset"] = PlantAssetImporter + importers["Unit"] = UnitImporter + importers["StandardQuantity"] = StandardQuantityImporter + importers["ActivityLog"] = ActivityLogImporter + importers["HarvestLog"] = HarvestLogImporter + importers["MedicalLog"] = MedicalLogImporter + importers["ObservationLog"] = ObservationLogImporter + return importers + + +class FromWuttaFarm(FromWutta): + + drupal_internal_id_field = "drupal_internal__id" + + def create_target_object(self, key, source_data): + obj = super().create_target_object(key, source_data) + if obj is None: + return None + + if not self.dry_run: + + # set farmOS, Drupal key fields in WuttaFarm + api_object = obj["_new_object"] + wf_object = source_data["_src_object"] + wf_object.farmos_uuid = obj["uuid"] + wf_object.drupal_id = api_object["attributes"][ + self.drupal_internal_id_field + ] + + return obj + + +class AnimalAssetImporter(FromWuttaFarm, farmos_importing.model.AnimalAssetImporter): + """ + WuttaFarm → farmOS API exporter for Animal Assets + """ + + source_model_class = model.AnimalAsset + + supported_fields = [ + "uuid", + "asset_name", + "animal_type_uuid", + "sex", + "is_sterile", + "produces_eggs", + "birthdate", + "notes", + "archived", + ] + + def normalize_source_object(self, animal): + return { + "uuid": animal.farmos_uuid or self.app.make_true_uuid(), + "asset_name": animal.asset_name, + "animal_type_uuid": animal.animal_type.farmos_uuid, + "sex": animal.sex, + "is_sterile": animal.is_sterile, + "produces_eggs": animal.produces_eggs, + "birthdate": animal.birthdate, + "notes": animal.notes, + "archived": animal.archived, + "_src_object": animal, + } + + +class AnimalTypeImporter(FromWuttaFarm, farmos_importing.model.AnimalTypeImporter): + """ + WuttaFarm → farmOS API exporter for Animal Types + """ + + source_model_class = model.AnimalType + + supported_fields = [ + "uuid", + "name", + ] + + drupal_internal_id_field = "drupal_internal__tid" + + def normalize_source_object(self, animal_type): + return { + "uuid": animal_type.farmos_uuid or self.app.make_true_uuid(), + "name": animal_type.name, + "_src_object": animal_type, + } + + +class UnitImporter(FromWuttaFarm, farmos_importing.model.UnitImporter): + """ + WuttaFarm → farmOS API exporter for Units + """ + + source_model_class = model.Unit + + supported_fields = [ + "uuid", + "name", + ] + + drupal_internal_id_field = "drupal_internal__tid" + + def normalize_source_object(self, unit): + return { + "uuid": unit.farmos_uuid or self.app.make_true_uuid(), + "name": unit.name, + "_src_object": unit, + } + + +class GroupAssetImporter(FromWuttaFarm, farmos_importing.model.GroupAssetImporter): + """ + WuttaFarm → farmOS API exporter for Group Assets + """ + + source_model_class = model.GroupAsset + + supported_fields = [ + "uuid", + "asset_name", + "produces_eggs", + "notes", + "archived", + ] + + def normalize_source_object(self, group): + return { + "uuid": group.farmos_uuid or self.app.make_true_uuid(), + "asset_name": group.asset_name, + "produces_eggs": group.produces_eggs, + "notes": group.notes, + "archived": group.archived, + "_src_object": group, + } + + +class LandAssetImporter(FromWuttaFarm, farmos_importing.model.LandAssetImporter): + """ + WuttaFarm → farmOS API exporter for Land Assets + """ + + source_model_class = model.LandAsset + + supported_fields = [ + "uuid", + "asset_name", + "land_type_id", + "is_location", + "is_fixed", + "notes", + "archived", + ] + + def normalize_source_object(self, land): + return { + "uuid": land.farmos_uuid or self.app.make_true_uuid(), + "asset_name": land.asset_name, + "land_type_id": land.land_type.drupal_id, + "is_location": land.is_location, + "is_fixed": land.is_fixed, + "notes": land.notes, + "archived": land.archived, + "_src_object": land, + } + + +class PlantTypeImporter(FromWuttaFarm, farmos_importing.model.PlantTypeImporter): + """ + WuttaFarm → farmOS API exporter for Plant Types + """ + + source_model_class = model.PlantType + + supported_fields = [ + "uuid", + "name", + ] + + drupal_internal_id_field = "drupal_internal__tid" + + def normalize_source_object(self, plant_type): + return { + "uuid": plant_type.farmos_uuid or self.app.make_true_uuid(), + "name": plant_type.name, + "_src_object": plant_type, + } + + +class PlantAssetImporter(FromWuttaFarm, farmos_importing.model.PlantAssetImporter): + """ + WuttaFarm → farmOS API exporter for Plant Assets + """ + + source_model_class = model.PlantAsset + + supported_fields = [ + "uuid", + "asset_name", + "plant_type_uuids", + "notes", + "archived", + ] + + def normalize_source_object(self, plant): + return { + "uuid": plant.farmos_uuid or self.app.make_true_uuid(), + "asset_name": plant.asset_name, + "plant_type_uuids": [t.plant_type.farmos_uuid for t in plant._plant_types], + "notes": plant.notes, + "archived": plant.archived, + "_src_object": plant, + } + + +class StructureAssetImporter( + FromWuttaFarm, farmos_importing.model.StructureAssetImporter +): + """ + WuttaFarm → farmOS API exporter for Structure Assets + """ + + source_model_class = model.StructureAsset + + supported_fields = [ + "uuid", + "asset_name", + "structure_type_id", + "is_location", + "is_fixed", + "notes", + "archived", + ] + + def normalize_source_object(self, structure): + return { + "uuid": structure.farmos_uuid or self.app.make_true_uuid(), + "asset_name": structure.asset_name, + "structure_type_id": structure.structure_type.drupal_id, + "is_location": structure.is_location, + "is_fixed": structure.is_fixed, + "notes": structure.notes, + "archived": structure.archived, + "_src_object": structure, + } + + +############################## +# quantity importers +############################## + + +class FromWuttaFarmQuantity(FromWuttaFarm): + """ + Base class for WuttaFarm -> farmOS quantity importers + """ + + supported_fields = [ + "uuid", + "measure", + "value_numerator", + "value_denominator", + "label", + "quantity_type_uuid", + "unit_uuid", + ] + + def normalize_source_object(self, qty): + return { + "uuid": qty.farmos_uuid or self.app.make_true_uuid(), + "measure": qty.measure_id, + "value_numerator": qty.value_numerator, + "value_denominator": qty.value_denominator, + "label": qty.label, + "quantity_type_uuid": qty.quantity_type.farmos_uuid, + "unit_uuid": qty.units.farmos_uuid, + "_src_object": qty, + } + + +class StandardQuantityImporter( + FromWuttaFarmQuantity, farmos_importing.model.StandardQuantityImporter +): + """ + WuttaFarm → farmOS API exporter for Standard Quantities + """ + + source_model_class = model.StandardQuantity + + +############################## +# log importers +############################## + + +class FromWuttaFarmLog(FromWuttaFarm): + """ + Base class for WuttaFarm -> farmOS log importers + """ + + supported_fields = [ + "uuid", + "name", + "timestamp", + "is_movement", + "is_group_assignment", + "status", + "notes", + "quick", + "assets", + "quantities", + ] + + def normalize_source_object(self, log): + return { + "uuid": log.farmos_uuid or self.app.make_true_uuid(), + "name": log.message, + "timestamp": log.timestamp, + "is_movement": log.is_movement, + "is_group_assignment": log.is_group_assignment, + "status": log.status, + "notes": log.notes, + "quick": self.config.parse_list(log.quick) if log.quick else [], + "assets": [(a.asset_type, a.farmos_uuid) for a in log.assets], + "quantities": [qty.farmos_uuid for qty in log.quantities], + "_src_object": log, + } + + +class ActivityLogImporter(FromWuttaFarmLog, farmos_importing.model.ActivityLogImporter): + """ + WuttaFarm → farmOS API exporter for Activity Logs + """ + + source_model_class = model.ActivityLog + + +class HarvestLogImporter(FromWuttaFarmLog, farmos_importing.model.HarvestLogImporter): + """ + WuttaFarm → farmOS API exporter for Harvest Logs + """ + + source_model_class = model.HarvestLog + + +class MedicalLogImporter(FromWuttaFarmLog, farmos_importing.model.MedicalLogImporter): + """ + WuttaFarm → farmOS API exporter for Medical Logs + """ + + source_model_class = model.MedicalLog + + def get_supported_fields(self): + fields = list(super().get_supported_fields()) + fields.extend( + [ + "vet", + ] + ) + return fields + + def normalize_source_object(self, log): + data = super().normalize_source_object(log) + data.update( + { + "vet": log.vet, + } + ) + return data + + +class ObservationLogImporter( + FromWuttaFarmLog, farmos_importing.model.ObservationLogImporter +): + """ + WuttaFarm → farmOS API exporter for Observation Logs + """ + + source_model_class = model.ObservationLog diff --git a/src/wuttafarm/importing/__init__.py b/src/wuttafarm/importing/__init__.py new file mode 100644 index 0000000..6711d56 --- /dev/null +++ b/src/wuttafarm/importing/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Importing data to WuttaFarm +""" diff --git a/src/wuttafarm/importing/farmos.py b/src/wuttafarm/importing/farmos.py new file mode 100644 index 0000000..6b21090 --- /dev/null +++ b/src/wuttafarm/importing/farmos.py @@ -0,0 +1,1357 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Data import for farmOS -> WuttaFarm +""" + +import datetime +import logging +from uuid import UUID + +from oauthlib.oauth2 import BackendApplicationClient +from requests_oauthlib import OAuth2Session + +from wuttasync.importing import ImportHandler, ToWuttaHandler, Importer, ToWutta + +from wuttafarm.db import model + + +log = logging.getLogger(__name__) + + +class FromFarmOSHandler(ImportHandler): + """ + Base class for import handler using farmOS API as data source. + """ + + source_key = "farmos" + generic_source_title = "farmOS" + + def begin_source_transaction(self, client=None): + """ + Establish the farmOS API client. + """ + if client: + self.farmos_client = client + else: + token = self.get_farmos_oauth2_token() + self.farmos_client = self.app.get_farmos_client(token=token) + self.farmos_4x = self.app.is_farmos_4x(self.farmos_client) + self.normal = self.app.get_normalizer(self.farmos_client) + + def get_farmos_oauth2_token(self): + + client_id = self.config.get( + "farmos.oauth2.importing.client_id", default="wuttafarm" + ) + client_secret = self.config.require("farmos.oauth2.importing.client_secret") + scope = self.config.get("farmos.oauth2.importing.scope", default="farm_manager") + + client = BackendApplicationClient(client_id=client_id) + oauth = OAuth2Session(client=client) + + return oauth.fetch_token( + token_url=self.app.get_farmos_url("/oauth/token"), + include_client_id=True, + client_secret=client_secret, + scope=scope, + ) + + def get_importer_kwargs(self, key, **kwargs): + kwargs = super().get_importer_kwargs(key, **kwargs) + kwargs["farmos_client"] = self.farmos_client + kwargs["farmos_4x"] = self.farmos_4x + kwargs["normal"] = self.normal + return kwargs + + +class ToWuttaFarmHandler(ToWuttaHandler): + """ + Base class for import handler targeting WuttaFarm + """ + + target_key = "wuttafarm" + + +class FromFarmOSToWuttaFarm(FromFarmOSHandler, ToWuttaFarmHandler): + """ + Handler for farmOS → WuttaFarm import. + """ + + def define_importers(self): + """ """ + importers = super().define_importers() + importers["User"] = UserImporter + importers["AssetType"] = AssetTypeImporter + importers["LandType"] = LandTypeImporter + importers["LandAsset"] = LandAssetImporter + importers["StructureType"] = StructureTypeImporter + importers["StructureAsset"] = StructureAssetImporter + importers["AnimalType"] = AnimalTypeImporter + importers["AnimalAsset"] = AnimalAssetImporter + importers["GroupAsset"] = GroupAssetImporter + importers["PlantType"] = PlantTypeImporter + importers["PlantAsset"] = PlantAssetImporter + importers["Measure"] = MeasureImporter + importers["Unit"] = UnitImporter + importers["QuantityType"] = QuantityTypeImporter + importers["StandardQuantity"] = StandardQuantityImporter + importers["LogType"] = LogTypeImporter + importers["ActivityLog"] = ActivityLogImporter + importers["HarvestLog"] = HarvestLogImporter + importers["MedicalLog"] = MedicalLogImporter + importers["ObservationLog"] = ObservationLogImporter + return importers + + +class FromFarmOS(Importer): + """ + Base class for importers using farmOS API as data source. + """ + + key = "farmos_uuid" + + def get_supported_fields(self): + """ + Auto-remove the ``uuid`` field, since we use ``farmos_uuid`` + instead for the importer key. + """ + fields = list(super().get_supported_fields()) + if "uuid" in fields: + fields.remove("uuid") + return fields + + def normalize_datetime(self, dt): + """ + Convert a farmOS datetime value to naive UTC used by + WuttaFarm. + + :param dt: Date/time string value "as-is" from the farmOS API. + + :returns: Equivalent naive UTC ``datetime`` + """ + dt = datetime.datetime.fromisoformat(dt) + return self.app.make_utc(dt) + + +class AssetImporterBase(FromFarmOS, ToWutta): + """ + Base class for farmOS API → WuttaFarm asset importers + """ + + def get_farmos_asset_type(self): + return self.model_class.__wutta_hint__["farmos_asset_type"] + + def get_simple_fields(self): + """ """ + fields = list(super().get_simple_fields()) + # nb. must explicitly declare proxy fields + fields.extend( + [ + "farmos_uuid", + "drupal_id", + "asset_type", + "asset_name", + "is_location", + "is_fixed", + "notes", + "archived", + "image_url", + "thumbnail_url", + ] + ) + return fields + + def get_supported_fields(self): + """ """ + fields = list(super().get_supported_fields()) + fields.extend( + [ + "parents", + "owners", + ] + ) + return fields + + def get_source_objects(self): + """ """ + asset_type = self.get_farmos_asset_type() + return list( + self.farmos_client.asset.iterate(asset_type, params={"include": "image"}) + ) + + def normalize_source_data(self, **kwargs): + """ """ + data = super().normalize_source_data(**kwargs) + + if "parents" in self.fields: + # nb. make sure parent-less (root) assets come first, so they + # exist when child assets need to reference them + data.sort(key=lambda l: len(l["parents"])) + + return data + + def normalize_source_object(self, asset): + """ """ + data = self.normal.normalize_farmos_asset(asset) + + data["farmos_uuid"] = UUID(data.pop("uuid")) + data["asset_type"] = self.get_asset_type(asset) + + if "image_url" in self.fields or "thumbnail_url" in self.fields: + data["image_url"] = None + data["thumbnail_url"] = None + if relationships := asset.get("relationships"): + + if image := relationships.get("image"): + if image["data"]: + image = self.farmos_client.resource.get_id( + "file", "file", image["data"][0]["id"] + ) + if image_style := image["data"]["attributes"].get( + "image_style_uri" + ): + data["image_url"] = image_style["large"] + data["thumbnail_url"] = image_style["thumbnail"] + + if "parents" in self.fields: + data["parents"] = [] + for parent in asset["relationships"]["parent"]["data"]: + data["parents"].append( + (self.get_asset_type(parent), UUID(parent["id"])) + ) + + if "owners" in self.fields: + data["owners"] = [UUID(uuid) for uuid in data["owner_uuids"]] + + return data + + def get_asset_type(self, asset): + return asset["type"].split("--")[1] + + def normalize_target_object(self, asset): + data = super().normalize_target_object(asset) + + if "parents" in self.fields: + data["parents"] = [(p.asset_type, p.farmos_uuid) for p in asset.parents] + + if "owners" in self.fields: + data["owners"] = [user.farmos_uuid for user in asset.owners] + + return data + + def update_target_object(self, asset, source_data, target_data=None): + model = self.app.model + asset = super().update_target_object(asset, source_data, target_data) + + if "parents" in self.fields: + if not target_data or target_data["parents"] != source_data["parents"]: + + for key in source_data["parents"]: + asset_type, farmos_uuid = key + if not target_data or key not in target_data["parents"]: + self.target_session.flush() + parent = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + asset.asset._parents.append(model.AssetParent(parent=parent)) + + if target_data: + for key in target_data["parents"]: + asset_type, farmos_uuid = key + if key not in source_data["parents"]: + parent = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + parent = ( + self.target_session.query(model.AssetParent) + .filter(model.AssetParent.asset == asset) + .filter(model.AssetParent.parent == parent) + .one() + ) + self.target_session.delete(parent) + + if "owners" in self.fields: + if not target_data or target_data["owners"] != source_data["owners"]: + + for farmos_uuid in source_data["owners"]: + if not target_data or farmos_uuid not in target_data["owners"]: + user = ( + self.target_session.query(model.User) + .join(model.WuttaFarmUser) + .filter(model.WuttaFarmUser.farmos_uuid == farmos_uuid) + .one() + ) + asset.owners.append(user) + + if target_data: + for farmos_uuid in target_data["owners"]: + if farmos_uuid not in source_data["owners"]: + user = ( + self.target_session.query(model.User) + .join(model.WuttaFarmUser) + .filter(model.WuttaFarmUser.farmos_uuid == farmos_uuid) + .one() + ) + asset.owners.remove(user) + + return asset + + +class AnimalAssetImporter(AssetImporterBase): + """ + farmOS API → WuttaFarm importer for Animals + """ + + model_class = model.AnimalAsset + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "asset_type", + "asset_name", + "animal_type_uuid", + "sex", + "is_sterile", + "produces_eggs", + "birthdate", + "notes", + "archived", + "image_url", + "thumbnail_url", + ] + + def setup(self): + super().setup() + model = self.app.model + + self.animal_types_by_farmos_uuid = {} + for animal_type in self.target_session.query(model.AnimalType): + if animal_type.farmos_uuid: + self.animal_types_by_farmos_uuid[animal_type.farmos_uuid] = animal_type + + def normalize_source_object(self, animal): + """ """ + animal_type_uuid = None + if relationships := animal.get("relationships"): + + if animal_type := relationships.get("animal_type"): + if animal_type["data"]: + if wf_animal_type := self.animal_types_by_farmos_uuid.get( + UUID(animal_type["data"]["id"]) + ): + animal_type_uuid = wf_animal_type.uuid + else: + log.warning( + "animal type not found: %s", animal_type["data"]["id"] + ) + + if not animal_type_uuid: + log.warning("missing/invalid animal_type for farmOS Animal: %s", animal) + return None + + birthdate = animal["attributes"]["birthdate"] + if birthdate: + birthdate = datetime.datetime.fromisoformat(birthdate) + birthdate = self.app.localtime(birthdate) + birthdate = self.app.make_utc(birthdate) + + if self.farmos_4x: + sterile = animal["attributes"]["is_sterile"] + else: + sterile = animal["attributes"]["is_castrated"] + + data = super().normalize_source_object(animal) + data.update( + { + "animal_type_uuid": animal_type_uuid, + "sex": animal["attributes"]["sex"], + "is_sterile": sterile, + "produces_eggs": animal["attributes"]["produces_eggs"], + "birthdate": birthdate, + } + ) + return data + + +class AnimalTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Animal Types + """ + + model_class = model.AnimalType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + "description", + ] + + def get_source_objects(self): + """ """ + animal_types = self.farmos_client.resource.get("taxonomy_term", "animal_type") + return animal_types["data"] + + def normalize_source_object(self, animal_type): + """ """ + return { + "farmos_uuid": UUID(animal_type["id"]), + "drupal_id": animal_type["attributes"]["drupal_internal__tid"], + "name": animal_type["attributes"]["name"], + "description": animal_type["attributes"]["description"], + } + + +class AssetTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Asset Types + """ + + model_class = model.AssetType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + "description", + ] + + def get_source_objects(self): + """ """ + asset_types = self.farmos_client.resource.get("asset_type") + return asset_types["data"] + + def normalize_source_object(self, asset_type): + """ """ + return { + "farmos_uuid": UUID(asset_type["id"]), + "drupal_id": asset_type["attributes"]["drupal_internal__id"], + "name": asset_type["attributes"]["label"], + "description": asset_type["attributes"]["description"], + } + + +class GroupAssetImporter(AssetImporterBase): + """ + farmOS API → WuttaFarm importer for Group Assets + """ + + model_class = model.GroupAsset + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "asset_type", + "asset_name", + "is_location", + "is_fixed", + "produces_eggs", + "notes", + "archived", + "image_url", + "thumbnail_url", + "parents", + ] + + def normalize_source_object(self, group): + """ """ + data = super().normalize_source_object(group) + data.update( + { + "produces_eggs": group["attributes"]["produces_eggs"], + } + ) + return data + + +class LandAssetImporter(AssetImporterBase): + """ + farmOS API → WuttaFarm importer for Land Assets + """ + + model_class = model.LandAsset + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "asset_type", + "asset_name", + "land_type_uuid", + "is_location", + "is_fixed", + "notes", + "archived", + "parents", + ] + + def setup(self): + """ """ + super().setup() + model = self.app.model + + self.land_types_by_id = {} + for land_type in self.target_session.query(model.LandType): + self.land_types_by_id[land_type.drupal_id] = land_type + + def normalize_source_object(self, land): + """ """ + land_type_id = land["attributes"]["land_type"] + land_type = self.land_types_by_id.get(land_type_id) + if not land_type: + log.warning( + "invalid land_type '%s' for farmOS Land Asset: %s", land_type_id, land + ) + return None + + data = super().normalize_source_object(land) + data.update( + { + "land_type_uuid": land_type.uuid, + } + ) + return data + + +class LandTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Land Types + """ + + model_class = model.LandType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + ] + + def get_source_objects(self): + """ """ + land_types = self.farmos_client.resource.get("land_type") + return land_types["data"] + + def normalize_source_object(self, land_type): + """ """ + return { + "farmos_uuid": UUID(land_type["id"]), + "drupal_id": land_type["attributes"]["drupal_internal__id"], + "name": land_type["attributes"]["label"], + } + + +class PlantTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Plant Types + """ + + model_class = model.PlantType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + "description", + ] + + def get_source_objects(self): + """ """ + result = self.farmos_client.resource.get("taxonomy_term", "plant_type") + return result["data"] + + def normalize_source_object(self, plant_type): + """ """ + return { + "farmos_uuid": UUID(plant_type["id"]), + "drupal_id": plant_type["attributes"]["drupal_internal__tid"], + "name": plant_type["attributes"]["name"], + "description": plant_type["attributes"]["description"], + } + + +class PlantAssetImporter(AssetImporterBase): + """ + farmOS API → WuttaFarm importer for Plant Assets + """ + + model_class = model.PlantAsset + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "asset_type", + "asset_name", + "plant_types", + "notes", + "archived", + "image_url", + "thumbnail_url", + ] + + def setup(self): + super().setup() + model = self.app.model + + self.plant_types_by_farmos_uuid = {} + for plant_type in self.target_session.query(model.PlantType): + if plant_type.farmos_uuid: + self.plant_types_by_farmos_uuid[plant_type.farmos_uuid] = plant_type + + def normalize_source_object(self, plant): + """ """ + plant_types = [] + if relationships := plant.get("relationships"): + + if plant_type := relationships.get("plant_type"): + plant_types = [] + for plant_type in plant_type["data"]: + if wf_plant_type := self.plant_types_by_farmos_uuid.get( + UUID(plant_type["id"]) + ): + plant_types.append(wf_plant_type.uuid) + else: + log.warning("plant type not found: %s", plant_type["id"]) + + data = super().normalize_source_object(plant) + data.update( + { + "plant_types": set(plant_types), + } + ) + return data + + def normalize_target_object(self, plant): + data = super().normalize_target_object(plant) + + if "plant_types" in self.fields: + data["plant_types"] = set([pt.uuid for pt in plant.plant_types]) + + return data + + def update_target_object(self, plant, source_data, target_data=None): + model = self.app.model + plant = super().update_target_object(plant, source_data, target_data) + + if "plant_types" in self.fields: + if ( + not target_data + or target_data["plant_types"] != source_data["plant_types"] + ): + + for uuid in source_data["plant_types"]: + if not target_data or uuid not in target_data["plant_types"]: + self.target_session.flush() + plant._plant_types.append( + model.PlantAssetPlantType(plant_type_uuid=uuid) + ) + + if target_data: + for uuid in target_data["plant_types"]: + if uuid not in source_data["plant_types"]: + plant_type = ( + self.target_session.query(model.PlantAssetPlantType) + .filter(model.PlantAssetPlantType.plant_asset == plant) + .filter( + model.PlantAssetPlantType.plant_type_uuid == uuid + ) + .one() + ) + self.target_session.delete(plant_type) + + return plant + + +class StructureAssetImporter(AssetImporterBase): + """ + farmOS API → WuttaFarm importer for Structure Assets + """ + + model_class = model.StructureAsset + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "asset_type", + "asset_name", + "structure_type_uuid", + "is_location", + "is_fixed", + "notes", + "archived", + "image_url", + "thumbnail_url", + "parents", + ] + + def setup(self): + super().setup() + model = self.app.model + + self.structure_types_by_id = {} + for structure_type in self.target_session.query(model.StructureType): + self.structure_types_by_id[structure_type.drupal_id] = structure_type + + def normalize_source_object(self, structure): + """ """ + structure_type_id = structure["attributes"]["structure_type"] + structure_type = self.structure_types_by_id.get(structure_type_id) + if not structure_type: + log.warning( + "invalid structure_type '%s' for farmOS Structure Asset: %s", + structure_type_id, + structure, + ) + return None + + data = super().normalize_source_object(structure) + data.update( + { + "structure_type_uuid": structure_type.uuid, + } + ) + return data + + +class StructureTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Structure Types + """ + + model_class = model.StructureType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + ] + + def get_source_objects(self): + """ """ + structure_types = self.farmos_client.resource.get("structure_type") + return structure_types["data"] + + def normalize_source_object(self, structure_type): + """ """ + return { + "farmos_uuid": UUID(structure_type["id"]), + "drupal_id": structure_type["attributes"]["drupal_internal__id"], + "name": structure_type["attributes"]["label"], + } + + +class UserImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Users + """ + + model_class = model.User + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "username", + ] + + def get_simple_fields(self): + """ """ + fields = list(super().get_simple_fields()) + # nb. must explicitly declare extension fields + fields.extend( + [ + "farmos_uuid", + "drupal_id", + ] + ) + return fields + + def get_source_objects(self): + """ """ + users = self.farmos_client.resource.get("user") + return users["data"] + + def normalize_source_object(self, user): + """ """ + + # nb. skip Anonymous user which does not have drupal id + drupal_id = user["attributes"].get("drupal_internal__uid") + if not drupal_id: + return None + + return { + "farmos_uuid": UUID(user["id"]), + "drupal_id": drupal_id, + "username": user["attributes"]["name"], + } + + def can_delete_object(self, user, data=None): + """ + Prevent delete for users which do not exist in farmOS. + """ + if not user.farmos_uuid: + return False + return True + + +############################## +# log importers +############################## + + +class MeasureImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Measures + """ + + model_class = model.Measure + + key = "drupal_id" + + supported_fields = [ + "drupal_id", + "name", + ] + + def get_source_objects(self): + """ """ + response = self.farmos_client.session.get( + self.app.get_farmos_url("/api/quantity/standard/resource/schema") + ) + response.raise_for_status() + data = response.json() + return data["definitions"]["attributes"]["properties"]["measure"]["oneOf"] + + def normalize_source_object(self, measure): + """ """ + return { + "drupal_id": measure["const"], + "name": measure["title"], + } + + +class UnitImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Units + """ + + model_class = model.Unit + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + "description", + ] + + def get_source_objects(self): + """ """ + result = self.farmos_client.resource.get("taxonomy_term", "unit") + return result["data"] + + def normalize_source_object(self, unit): + """ """ + return { + "farmos_uuid": UUID(unit["id"]), + "drupal_id": unit["attributes"]["drupal_internal__tid"], + "name": unit["attributes"]["name"], + "description": unit["attributes"]["description"], + } + + +class QuantityTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Quantity Types + """ + + model_class = model.QuantityType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + "description", + ] + + def get_source_objects(self): + """ """ + result = self.farmos_client.resource.get("quantity_type") + return result["data"] + + def normalize_source_object(self, quantity_type): + """ """ + return { + "farmos_uuid": UUID(quantity_type["id"]), + "drupal_id": quantity_type["attributes"]["drupal_internal__id"], + "name": quantity_type["attributes"]["label"], + "description": quantity_type["attributes"]["description"], + } + + +class LogTypeImporter(FromFarmOS, ToWutta): + """ + farmOS API → WuttaFarm importer for Log Types + """ + + model_class = model.LogType + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "name", + "description", + ] + + def get_source_objects(self): + """ """ + log_types = self.farmos_client.resource.get("log_type") + return log_types["data"] + + def normalize_source_object(self, log_type): + """ """ + return { + "farmos_uuid": UUID(log_type["id"]), + "drupal_id": log_type["attributes"]["drupal_internal__id"], + "name": log_type["attributes"]["label"], + "description": log_type["attributes"]["description"], + } + + +class LogImporterBase(FromFarmOS, ToWutta): + """ + Base class for farmOS API → WuttaFarm log importers + """ + + def get_farmos_log_type(self): + return self.model_class.__wutta_hint__["farmos_log_type"] + + def get_simple_fields(self): + """ """ + fields = list(super().get_simple_fields()) + # nb. must explicitly declare proxy fields + fields.extend( + [ + "farmos_uuid", + "drupal_id", + "log_type", + "message", + "timestamp", + "is_movement", + "is_group_assignment", + "notes", + "status", + "quick", + ] + ) + return fields + + def get_supported_fields(self): + """ """ + fields = list(super().get_supported_fields()) + fields.extend( + [ + "assets", + "groups", + "locations", + "quantities", + "owners", + ] + ) + return fields + + def get_source_objects(self): + """ """ + log_type = self.get_farmos_log_type() + return list(self.farmos_client.log.iterate(log_type)) + + def normalize_source_object(self, log): + """ """ + data = self.normal.normalize_farmos_log(log) + + data["farmos_uuid"] = UUID(data.pop("uuid")) + data["message"] = data.pop("name") + data["timestamp"] = self.app.make_utc(data["timestamp"]) + data["quick"] = ", ".join(data["quick"]) if data["quick"] else None + + # TODO + data["log_type"] = self.get_farmos_log_type() + + if "assets" in self.fields: + data["assets"] = [ + (a["asset_type"], UUID(a["uuid"])) for a in data["assets"] + ] + + if "groups" in self.fields: + data["groups"] = [ + (asset["asset_type"], UUID(asset["uuid"])) for asset in data["groups"] + ] + + if "locations" in self.fields: + data["locations"] = [ + (asset["asset_type"], UUID(asset["uuid"])) + for asset in data["locations"] + ] + + if "quantities" in self.fields: + data["quantities"] = [UUID(uuid) for uuid in data["quantity_uuids"]] + + if "owners" in self.fields: + data["owners"] = [UUID(uuid) for uuid in data["owner_uuids"]] + + return data + + def normalize_target_object(self, log): + data = super().normalize_target_object(log) + + if "assets" in self.fields: + data["assets"] = [ + (asset.asset_type, asset.farmos_uuid) for asset in log.assets + ] + + if "groups" in self.fields: + data["groups"] = [ + (asset.asset_type, asset.farmos_uuid) for asset in log.groups + ] + + if "locations" in self.fields: + data["locations"] = [ + (asset.asset_type, asset.farmos_uuid) for asset in log.locations + ] + + if "quantities" in self.fields: + data["quantities"] = [qty.farmos_uuid for qty in log.quantities] + + if "owners" in self.fields: + data["owners"] = [user.farmos_uuid for user in log.owners] + + return data + + def update_target_object(self, log, source_data, target_data=None): + model = self.app.model + log = super().update_target_object(log, source_data, target_data) + + if "assets" in self.fields: + if not target_data or target_data["assets"] != source_data["assets"]: + + for key in source_data["assets"]: + asset_type, farmos_uuid = key + if not target_data or key not in target_data["assets"]: + asset = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + log.assets.append(asset) + + if target_data: + for key in target_data["assets"]: + asset_type, farmos_uuid = key + if key not in source_data["assets"]: + asset = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + log.assets.remove(asset) + + if "groups" in self.fields: + if not target_data or target_data["groups"] != source_data["groups"]: + + for key in source_data["groups"]: + asset_type, farmos_uuid = key + if not target_data or key not in target_data["groups"]: + asset = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + log.groups.append(asset) + + if target_data: + for key in target_data["groups"]: + asset_type, farmos_uuid = key + if key not in source_data["groups"]: + asset = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + log.groups.remove(asset) + + if "locations" in self.fields: + if not target_data or target_data["locations"] != source_data["locations"]: + + for key in source_data["locations"]: + asset_type, farmos_uuid = key + if not target_data or key not in target_data["locations"]: + asset = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + log.locations.append(asset) + + if target_data: + for key in target_data["locations"]: + asset_type, farmos_uuid = key + if key not in source_data["locations"]: + asset = ( + self.target_session.query(model.Asset) + .filter(model.Asset.asset_type == asset_type) + .filter(model.Asset.farmos_uuid == farmos_uuid) + .one() + ) + log.locations.remove(asset) + + if "quantities" in self.fields: + if ( + not target_data + or target_data["quantities"] != source_data["quantities"] + ): + + for farmos_uuid in source_data["quantities"]: + if not target_data or farmos_uuid not in target_data["quantities"]: + qty = ( + self.target_session.query(model.Quantity) + .filter(model.Quantity.farmos_uuid == farmos_uuid) + .one() + ) + log.quantities.append(qty) + + if target_data: + for farmos_uuid in target_data["quantities"]: + if farmos_uuid not in source_data["quantities"]: + qty = ( + self.target_session.query(model.Quantity) + .filter(model.Quantity.farmos_uuid == farmos_uuid) + .one() + ) + log.quantities.remove(qty) + + if "owners" in self.fields: + if not target_data or target_data["owners"] != source_data["owners"]: + + for farmos_uuid in source_data["owners"]: + if not target_data or farmos_uuid not in target_data["owners"]: + user = ( + self.target_session.query(model.User) + .join(model.WuttaFarmUser) + .filter(model.WuttaFarmUser.farmos_uuid == farmos_uuid) + .one() + ) + log.owners.append(user) + + if target_data: + for farmos_uuid in target_data["owners"]: + if farmos_uuid not in source_data["owners"]: + user = ( + self.target_session.query(model.User) + .join(model.WuttaFarmUser) + .filter(model.WuttaFarmUser.farmos_uuid == farmos_uuid) + .one() + ) + log.owners.remove(user) + + return log + + +class ActivityLogImporter(LogImporterBase): + """ + farmOS API → WuttaFarm importer for Activity Logs + """ + + model_class = model.ActivityLog + + +class HarvestLogImporter(LogImporterBase): + """ + farmOS API → WuttaFarm importer for Harvest Logs + """ + + model_class = model.HarvestLog + + +class MedicalLogImporter(LogImporterBase): + """ + farmOS API → WuttaFarm importer for Medical Logs + """ + + model_class = model.MedicalLog + + def get_simple_fields(self): + """ """ + fields = list(super().get_simple_fields()) + # nb. must explicitly declare proxy fields + fields.extend( + [ + "vet", + ] + ) + return fields + + +class ObservationLogImporter(LogImporterBase): + """ + farmOS API → WuttaFarm importer for Observation Logs + """ + + model_class = model.ObservationLog + + +class QuantityImporterBase(FromFarmOS, ToWutta): + """ + Base class for farmOS API → WuttaFarm quantity importers + """ + + def get_farmos_quantity_type(self): + return self.model_class.__wutta_hint__["farmos_quantity_type"] + + def get_simple_fields(self): + """ """ + fields = list(super().get_simple_fields()) + # nb. must explicitly declare proxy fields + fields.extend( + [ + "farmos_uuid", + "drupal_id", + "quantity_type_id", + "measure_id", + "value_numerator", + "value_denominator", + "units_uuid", + "label", + ] + ) + return fields + + def setup(self): + super().setup() + model = self.app.model + + self.quantity_types_by_farmos_uuid = {} + for quantity_type in self.target_session.query(model.QuantityType): + if quantity_type.farmos_uuid: + self.quantity_types_by_farmos_uuid[quantity_type.farmos_uuid] = ( + quantity_type + ) + + self.units_by_farmos_uuid = {} + for unit in self.target_session.query(model.Unit): + if unit.farmos_uuid: + self.units_by_farmos_uuid[unit.farmos_uuid] = unit + + def get_source_objects(self): + """ """ + quantity_type = self.get_farmos_quantity_type() + result = self.farmos_client.resource.get("quantity", quantity_type) + return result["data"] + + def get_quantity_type_by_farmos_uuid(self, uuid): + if hasattr(self, "quantity_types_by_farmos_uuid"): + return self.quantity_types_by_farmos_uuid.get(UUID(uuid)) + + model = self.app.model + return ( + self.target_session.query(model.QuantityType) + .filter(model.QuantityType.farmos_uuid == uuid) + .one() + ) + + def get_unit_by_farmos_uuid(self, uuid): + if hasattr(self, "units_by_farmos_uuid"): + return self.units_by_farmos_uuid.get(UUID(uuid)) + + model = self.app.model + return ( + self.target_session.query(model.Unit) + .filter(model.Unit.farmos_uuid == uuid) + .one() + ) + + def normalize_source_object(self, quantity): + """ """ + quantity_type_id = None + units_uuid = None + if relationships := quantity.get("relationships"): + + if quantity_type := relationships.get("quantity_type"): + if quantity_type["data"]: + if wf_quantity_type := self.get_quantity_type_by_farmos_uuid( + quantity_type["data"]["id"] + ): + quantity_type_id = wf_quantity_type.drupal_id + + if units := relationships.get("units"): + if units["data"]: + if wf_unit := self.get_unit_by_farmos_uuid(units["data"]["id"]): + units_uuid = wf_unit.uuid + + if not quantity_type_id: + log.warning( + "missing/invalid quantity_type for farmOS Quantity: %s", quantity + ) + return None + + if not units_uuid: + log.warning("missing/invalid units for farmOS Quantity: %s", quantity) + return None + + value = quantity["attributes"]["value"] + + return { + "farmos_uuid": UUID(quantity["id"]), + "drupal_id": quantity["attributes"]["drupal_internal__id"], + "quantity_type_id": quantity_type_id, + "measure_id": quantity["attributes"]["measure"], + "value_numerator": value["numerator"], + "value_denominator": value["denominator"], + "units_uuid": units_uuid, + "label": quantity["attributes"]["label"], + } + + +class StandardQuantityImporter(QuantityImporterBase): + """ + farmOS API → WuttaFarm importer for Standard Quantities + """ + + model_class = model.StandardQuantity + + supported_fields = [ + "farmos_uuid", + "drupal_id", + "quantity_type_id", + "measure_id", + "value_numerator", + "value_denominator", + "units_uuid", + "label", + ] diff --git a/src/wuttafarm/install.py b/src/wuttafarm/install.py new file mode 100644 index 0000000..b67b6e2 --- /dev/null +++ b/src/wuttafarm/install.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Install handler for WuttaFarm +""" + +from wuttjamaican import install as base + + +class WuttaFarmInstallHandler(base.InstallHandler): + """ + Custom install handler for WuttaFarm + """ + + template_paths = ["wuttafarm:installer-templates"] + + def prompt_user_for_context(self): + context = super().prompt_user_for_context() + + context["farmos_url"] = self.prompt_generic("farmos_url", required=True) + + return context diff --git a/src/wuttafarm/normal.py b/src/wuttafarm/normal.py new file mode 100644 index 0000000..4fc8796 --- /dev/null +++ b/src/wuttafarm/normal.py @@ -0,0 +1,292 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Data normalizer for WuttaFarm / farmOS +""" + +import datetime + +from wuttjamaican.app import GenericHandler + + +class Normalizer(GenericHandler): + """ + Base class and default implementation for the global data + normalizer. This should be used for normalizing records from + WuttaFarm and/or farmOS. + + The point here is to have a single place to put the normalization + logic, and let it be another thing which can be customized via + subclass. + """ + + _farmos_units = None + _farmos_measures = None + + def __init__(self, config, farmos_client=None): + super().__init__(config) + self.farmos_client = farmos_client + + def get_farmos_measures(self): + if self._farmos_measures: + return self._farmos_measures + + measures = {} + response = self.farmos_client.session.get( + self.app.get_farmos_url("/api/quantity/standard/resource/schema") + ) + response.raise_for_status() + data = response.json() + for measure in data["definitions"]["attributes"]["properties"]["measure"][ + "oneOf" + ]: + measures[measure["const"]] = measure["title"] + + self._farmos_measures = measures + return self._farmos_measures + + def get_farmos_measure_name(self, measure_id): + measures = self.get_farmos_measures() + return measures[measure_id] + + def get_farmos_unit(self, uuid): + units = self.get_farmos_units() + return units[uuid] + + def get_farmos_units(self): + if self._farmos_units: + return self._farmos_units + + units = {} + result = self.farmos_client.resource.get("taxonomy_term", "unit") + for unit in result["data"]: + units[unit["id"]] = unit + + self._farmos_units = units + return self._farmos_units + + def normalize_farmos_asset(self, asset, included={}): + """ """ + + if notes := asset["attributes"]["notes"]: + notes = notes["value"] + + owner_objects = [] + owner_uuids = [] + if relationships := asset.get("relationships"): + + if owners := relationships.get("owner"): + for user in owners["data"]: + user_uuid = user["id"] + owner_uuids.append(user_uuid) + if user := included.get(user_uuid): + owner_objects.append( + { + "uuid": user["id"], + "name": user["attributes"]["name"], + } + ) + + return { + "uuid": asset["id"], + "drupal_id": asset["attributes"]["drupal_internal__id"], + "asset_name": asset["attributes"]["name"], + "is_location": asset["attributes"]["is_location"], + "is_fixed": asset["attributes"]["is_fixed"], + "archived": asset["attributes"]["archived"], + "notes": notes, + "owners": owner_objects, + "owner_uuids": owner_uuids, + } + + def normalize_farmos_log(self, log, included={}): + + if timestamp := log["attributes"]["timestamp"]: + timestamp = datetime.datetime.fromisoformat(timestamp) + timestamp = self.app.localtime(timestamp) + + if notes := log["attributes"]["notes"]: + notes = notes["value"] + + log_type_object = {} + log_type_uuid = None + asset_objects = [] + group_objects = [] + group_uuids = [] + quantity_objects = [] + quantity_uuids = [] + location_objects = [] + location_uuids = [] + owner_objects = [] + owner_uuids = [] + if relationships := log.get("relationships"): + + if log_type := relationships.get("log_type"): + log_type_uuid = log_type["data"]["id"] + if log_type := included.get(log_type_uuid): + log_type_object = { + "uuid": log_type["id"], + "name": log_type["attributes"]["label"], + } + + if assets := relationships.get("asset"): + for asset in assets["data"]: + asset_object = { + "uuid": asset["id"], + "type": asset["type"], + "asset_type": asset["type"].split("--")[1], + } + if asset := included.get(asset["id"]): + attrs = asset["attributes"] + rels = asset["relationships"] + asset_object.update( + { + "drupal_id": attrs["drupal_internal__id"], + "name": attrs["name"], + "is_location": attrs["is_location"], + "is_fixed": attrs["is_fixed"], + "archived": attrs["archived"], + "notes": attrs["notes"], + } + ) + asset_objects.append(asset_object) + + if groups := relationships.get("group"): + for group in groups["data"]: + group_uuid = group["id"] + group_uuids.append(group_uuid) + group_object = { + "uuid": group["id"], + "type": group["type"], + "asset_type": group["type"].split("--")[1], + } + if group := included.get(group_uuid): + attrs = group["attributes"] + rels = group["relationships"] + group_object.update( + { + "drupal_id": attrs["drupal_internal__id"], + "name": attrs["name"], + "is_location": attrs["is_location"], + "is_fixed": attrs["is_fixed"], + "archived": attrs["archived"], + "notes": attrs["notes"], + } + ) + group_objects.append(group_object) + + if locations := relationships.get("location"): + for location in locations["data"]: + location_uuid = location["id"] + location_uuids.append(location_uuid) + location_object = { + "uuid": location["id"], + "type": location["type"], + "asset_type": location["type"].split("--")[1], + } + if location := included.get(location_uuid): + attrs = location["attributes"] + rels = location["relationships"] + location_object.update( + { + "drupal_id": attrs["drupal_internal__id"], + "name": attrs["name"], + "is_location": attrs["is_location"], + "is_fixed": attrs["is_fixed"], + "archived": attrs["archived"], + "notes": attrs["notes"], + } + ) + location_objects.append(location_object) + + if quantities := relationships.get("quantity"): + for quantity in quantities["data"]: + quantity_uuid = quantity["id"] + quantity_uuids.append(quantity_uuid) + if quantity := included.get(quantity_uuid): + attrs = quantity["attributes"] + rels = quantity["relationships"] + value = attrs["value"] + + unit_uuid = rels["units"]["data"]["id"] + unit = self.get_farmos_unit(unit_uuid) + + measure_id = attrs["measure"] + + quantity_objects.append( + { + "uuid": quantity["id"], + "drupal_id": attrs["drupal_internal__id"], + "quantity_type_uuid": rels["quantity_type"]["data"][ + "id" + ], + "quantity_type_id": rels["quantity_type"]["data"][ + "meta" + ]["drupal_internal__target_id"], + "measure_id": measure_id, + "measure_name": self.get_farmos_measure_name( + measure_id + ), + "value_numerator": value["numerator"], + "value_decimal": value["decimal"], + "value_denominator": value["denominator"], + "unit_uuid": unit_uuid, + "unit_name": unit["attributes"]["name"], + } + ) + + if owners := relationships.get("owner"): + for user in owners["data"]: + user_uuid = user["id"] + owner_uuids.append(user_uuid) + if user := included.get(user_uuid): + owner_objects.append( + { + "uuid": user["id"], + "name": user["attributes"]["name"], + } + ) + + return { + "uuid": log["id"], + "drupal_id": log["attributes"]["drupal_internal__id"], + "log_type_uuid": log_type_uuid, + "log_type": log_type_object, + "name": log["attributes"]["name"], + "timestamp": timestamp, + "assets": asset_objects, + "groups": group_objects, + "group_uuids": group_uuids, + "quantities": quantity_objects, + "quantity_uuids": quantity_uuids, + "is_group_assignment": log["attributes"]["is_group_assignment"], + "is_movement": log["attributes"]["is_movement"], + "quick": log["attributes"]["quick"], + "status": log["attributes"]["status"], + "notes": notes, + "locations": location_objects, + "location_uuids": location_uuids, + "owners": owner_objects, + "owner_uuids": owner_uuids, + # TODO: should we do this here or make caller do it? + "vet": log["attributes"].get("vet"), + } diff --git a/src/wuttafarm/templates/install/upgrade.sh.mako b/src/wuttafarm/templates/install/upgrade.sh.mako new file mode 100755 index 0000000..aadc31a --- /dev/null +++ b/src/wuttafarm/templates/install/upgrade.sh.mako @@ -0,0 +1,29 @@ +#!/bin/sh -e +<%text>################################################## +# +# ${app_title} - upgrade script +# +<%text>################################################## + +if [ "$1" = "--verbose" ]; then + VERBOSE='--verbose' + QUIET= +else + VERBOSE= + QUIET='--quiet' +fi + +cd ${envdir} + +PIP='bin/pip' +ALEMBIC='bin/alembic' + +# upgrade pip and friends +$PIP install $QUIET --disable-pip-version-check --upgrade pip +$PIP install $QUIET --upgrade setuptools wheel + +# upgrade app proper +$PIP install $QUIET --upgrade --upgrade-strategy eager '${pypi_name}' + +# migrate schema +$ALEMBIC -c app/wutta.conf upgrade heads diff --git a/src/wuttafarm/templates/install/web.conf.mako b/src/wuttafarm/templates/install/web.conf.mako new file mode 100644 index 0000000..11824ab --- /dev/null +++ b/src/wuttafarm/templates/install/web.conf.mako @@ -0,0 +1,100 @@ +## -*- mode: conf; -*- + +<%text>############################################################ +# +# ${app_title} - web app config +# +<%text>############################################################ + + +<%text>############################## +# wutta +<%text>############################## + +${self.section_wutta_config()} + +${self.section_wutta_web()} + + +<%text>############################## +# pyramid +<%text>############################## + +${self.section_app_main()} + +${self.section_server_main()} + + +<%text>############################## +# logging +<%text>############################## + +${self.sectiongroup_logging()} + + +###################################################################### +## section templates below +###################################################################### + +<%def name="section_wutta_config()"> +[wutta.config] +require = %(here)s/wutta.conf + + +<%def name="section_wutta_web()"> +[wutta.web] +app.runner = uvicorn +app.spec = ${pkg_name}.web.app:make_asgi_app +app.factory = true +app.interface = asgi3 +app.port = ${pyramid_port} + + +<%def name="section_app_main()"> +[app:main] +use = egg:${egg_name} + +pyramid.reload_templates = true +pyramid.debug_all = true +pyramid.default_locale_name = en +#pyramid.includes = pyramid_debugtoolbar pyramid_exclog + +beaker.session.type = file +beaker.session.data_dir = %(here)s/cache/sessions/data +beaker.session.lock_dir = %(here)s/cache/sessions/lock +beaker.session.secret = ${beaker_secret} +beaker.session.key = ${beaker_key} + +exclog.extra_info = true + +# required for wuttaweb +wutta.config = %(__file__)s + + +<%def name="section_server_main()"> +[server:main] +use = egg:waitress#main +host = ${pyramid_host} +port = ${pyramid_port} + +# NOTE: this is needed for local reverse proxy stuff to work with HTTPS +# https://docs.pylonsproject.org/projects/waitress/en/latest/reverse-proxy.html +# https://docs.pylonsproject.org/projects/waitress/en/latest/arguments.html +trusted_proxy = 127.0.0.1 +trusted_proxy_headers = x-forwarded-for x-forwarded-host x-forwarded-proto x-forwarded-port +clear_untrusted_proxy_headers = True + +# TODO: leave this empty if proxy serves as root site, e.g. https://wutta.example.com/ +# url_prefix = + +# TODO: or, if proxy serves as subpath of root site, e.g. https://wutta.example.com/backend/ +# url_prefix = /backend + + +<%def name="sectiongroup_logging()"> +[handler_console] +level = INFO + +[handler_file] +args = (${repr(os.path.join(appdir, 'log', 'web.log'))}, 'a', 1000000, 100, 'utf_8') + diff --git a/src/wuttafarm/templates/install/wutta.conf.mako b/src/wuttafarm/templates/install/wutta.conf.mako new file mode 100644 index 0000000..5049808 --- /dev/null +++ b/src/wuttafarm/templates/install/wutta.conf.mako @@ -0,0 +1,171 @@ +## -*- mode: conf; -*- + +<%text>############################################################ +# +# ${app_title} - base config +# +<%text>############################################################ + + +[farmos] +url.base = ${farmos_url} + + +<%text>############################## +# wutta +<%text>############################## + +${self.section_wutta()} + +${self.section_wutta_config()} + +${self.section_wutta_db()} + +${self.section_wutta_mail()} + +${self.section_wutta_upgrades()} + + +<%text>############################## +# alembic +<%text>############################## + +${self.section_alembic()} + + +<%text>############################## +# logging +<%text>############################## + +${self.sectiongroup_logging()} + + +###################################################################### +## section templates below +###################################################################### + +<%def name="section_wutta()"> +[wutta] +#app_title = ${app_title} + + +<%def name="section_wutta_config()"> +[wutta.config] +#require = /etc/wutta/wutta.conf +configure_logging = true +usedb = true +preferdb = true + + +<%def name="section_wutta_db()"> +[wutta.db] +default.url = ${db_url} + +% if wants_continuum: +[wutta_continuum] +enable_versioning = true +% endif + + +<%def name="section_wutta_mail()"> +[wutta.mail] + +# this is the global email shutoff switch +#send_emails = false + +# recommended setup is to always talk to postfix on localhost and then +# it can handle any need complexities, e.g. sending to relay +smtp.server = localhost + +# by default only email templates from wuttjamaican are used +templates = wuttjamaican:templates/mail + +## TODO +## # this is the "default" email profile, from which all others initially +## # inherit, but most/all profiles will override these values +## default.prefix = [${app_title}] +## default.from = wutta@localhost +## default.to = root@localhost +# nb. in test environment it can be useful to disable by default, and +# then selectively enable certain (e.g. feedback, upgrade) emails +#default.enabled = false + + +<%def name="section_wutta_upgrades()"> +## TODO +## [wutta.upgrades] +## command = ${os.path.join(appdir, 'upgrade.sh')} --verbose +## files = ${os.path.join(appdir, 'data', 'upgrades')} + + +<%def name="section_alembic()"> +[alembic] +script_location = wuttjamaican.db:alembic +% if wants_continuum: +version_locations = ${pkg_name}.db:alembic/versions wutta_continuum.db:alembic/versions wuttjamaican.db:alembic/versions +% else: +version_locations = ${pkg_name}.db:alembic/versions wuttjamaican.db:alembic/versions +% endif + + +<%def name="sectiongroup_logging()"> +[loggers] +keys = root, beaker, exc_logger, sqlalchemy, txn + +[handlers] +keys = file, console, email + +[formatters] +keys = generic, console + +[logger_root] +handlers = file, console +level = DEBUG + +[logger_beaker] +qualname = beaker +handlers = +level = INFO + +[logger_exc_logger] +qualname = exc_logger +handlers = email +level = ERROR + +[logger_sqlalchemy] +qualname = sqlalchemy.engine +handlers = +# handlers = file +# level = INFO + +[logger_txn] +qualname = txn +handlers = +level = INFO + +[handler_file] +class = handlers.RotatingFileHandler +args = (${repr(os.path.join(appdir, 'log', 'wutta.log'))}, 'a', 1000000, 100, 'utf_8') +formatter = generic + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +formatter = console +# formatter = generic +# level = INFO +# level = WARNING + +[handler_email] +class = handlers.SMTPHandler +args = ('localhost', 'wutta@localhost', ['root@localhost'], "[${app_title}] Logging") +formatter = generic +level = ERROR + +[formatter_generic] +format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(funcName)s: %(message)s +datefmt = %Y-%m-%d %H:%M:%S + +[formatter_console] +format = %(levelname)-5.5s [%(name)s][%(threadName)s] %(funcName)s: %(message)s + diff --git a/src/wuttafarm/util.py b/src/wuttafarm/util.py new file mode 100644 index 0000000..1700998 --- /dev/null +++ b/src/wuttafarm/util.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +misc. utilities +""" + +from collections import OrderedDict + + +def get_log_type_enum(config, session=None): + app = config.get_app() + model = app.model + log_types = OrderedDict() + with app.short_session(session=session) as sess: + query = sess.query(model.LogType).order_by(model.LogType.name) + for log_type in query: + log_types[log_type.drupal_id] = log_type.name + return log_types diff --git a/src/wuttafarm/web/app.py b/src/wuttafarm/web/app.py index b21bd5c..161a876 100644 --- a/src/wuttafarm/web/app.py +++ b/src/wuttafarm/web/app.py @@ -23,6 +23,8 @@ WuttaFarm web app """ +import os + from wuttaweb import app as base @@ -38,10 +40,29 @@ def main(global_config, **settings): "wuttaweb:templates", ], ) + settings.setdefault( + "pyramid_deform.template_search_path", + " ".join( + [ + "wuttafarm.web:templates/deform", + "wuttaweb:templates/deform", + ] + ), + ) # make config objects wutta_config = base.make_wutta_config(settings) pyramid_config = base.make_pyramid_config(settings) + app = wutta_config.get_app() + + # custom buefy css + # TODO: this is not robust enough, probably..but works for me/now + wutta_config.setdefault( + "wuttaweb.liburl.buefy_css", "/wuttafarm/css/wuttafarm-buefy.css" + ) + # nb. ensure buefy version matches what we use for custom css + wutta_config.setdefault("wuttaweb.libver.buefy", "0.9.29") + wutta_config.setdefault("wuttaweb.libver.buefy_css", "0.9.29") # bring in the rest of WuttaFarm pyramid_config.include("wuttafarm.web.static") diff --git a/src/wuttafarm/web/forms/schema.py b/src/wuttafarm/web/forms/schema.py new file mode 100644 index 0000000..6bf434e --- /dev/null +++ b/src/wuttafarm/web/forms/schema.py @@ -0,0 +1,462 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Custom form widgets for WuttaFarm +""" + +import json + +import colander + +from wuttaweb.db import Session +from wuttaweb.forms.schema import ObjectRef, WuttaSet +from wuttaweb.forms.widgets import NotesWidget + + +class AnimalTypeRef(ObjectRef): + """ + Custom schema type for a + :class:`~wuttafarm.db.model.animals.AnimalType` reference field. + + This is a subclass of + :class:`~wuttaweb:wuttaweb.forms.schema.ObjectRef`. + """ + + @property + def model_class(self): # pylint: disable=empty-docstring + """ """ + model = self.app.model + return model.AnimalType + + def sort_query(self, query): # pylint: disable=empty-docstring + """ """ + return query.order_by(self.model_class.name) + + def get_object_url(self, obj): # pylint: disable=empty-docstring + """ """ + animal_type = obj + return self.request.route_url("animal_types.view", uuid=animal_type.uuid) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import AnimalTypeRefWidget + + kwargs["factory"] = AnimalTypeRefWidget + return super().widget_maker(**kwargs) + + +class LogQuick(WuttaSet): + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import LogQuickWidget + + return LogQuickWidget(**kwargs) + + +class LogRef(ObjectRef): + """ + Custom schema type for a + :class:`~wuttafarm.db.model.log.Log` reference field. + + This is a subclass of + :class:`~wuttaweb:wuttaweb.forms.schema.ObjectRef`. + """ + + @property + def model_class(self): # pylint: disable=empty-docstring + """ """ + model = self.app.model + return model.Log + + def sort_query(self, query): # pylint: disable=empty-docstring + """ """ + return query.order_by(self.model_class.message) + + def get_object_url(self, obj): # pylint: disable=empty-docstring + """ """ + log = obj + return self.request.route_url(f"logs_{log.log_type}.view", uuid=log.uuid) + + +class FarmOSUnitRef(colander.SchemaType): + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import FarmOSUnitRefWidget + + return FarmOSUnitRefWidget(**kwargs) + + +class FarmOSRef(colander.SchemaType): + + def __init__(self, request, route_prefix, *args, **kwargs): + self.values = kwargs.pop("values", None) + super().__init__(*args, **kwargs) + self.request = request + self.route_prefix = route_prefix + + def get_values(self): + if callable(self.values): + self.values = self.values() + return self.values + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + # nb. keep a ref to this for later use + node.model_instance = appstruct + + # serialize to PK as string + return appstruct["uuid"] + + def deserialize(self, node, cstruct): + if not cstruct: + return colander.null + + # nb. deserialize to PK string, not dict + return cstruct + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import FarmOSRefWidget + + if not kwargs.get("readonly"): + if "values" not in kwargs: + if values := self.get_values(): + kwargs["values"] = values + + return FarmOSRefWidget(self.request, self.route_prefix, **kwargs) + + +class FarmOSRefs(WuttaSet): + + def __init__(self, request, route_prefix, *args, **kwargs): + super().__init__(request, *args, **kwargs) + self.route_prefix = route_prefix + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import FarmOSRefsWidget + + return FarmOSRefsWidget(self.request, self.route_prefix, **kwargs) + + +class FarmOSAssetRefs(WuttaSet): + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import FarmOSAssetRefsWidget + + return FarmOSAssetRefsWidget(self.request, **kwargs) + + +class FarmOSLocationRefs(WuttaSet): + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import FarmOSLocationRefsWidget + + return FarmOSLocationRefsWidget(self.request, **kwargs) + + +class FarmOSQuantityRefs(WuttaSet): + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import FarmOSQuantityRefsWidget + + return FarmOSQuantityRefsWidget(**kwargs) + + +class FarmOSPlantTypes(colander.SchemaType): + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): # pylint: disable=empty-docstring + """ """ + from wuttafarm.web.forms.widgets import FarmOSPlantTypesWidget + + return FarmOSPlantTypesWidget(self.request, **kwargs) + + +class LandTypeRef(ObjectRef): + """ + Custom schema type for a + :class:`~wuttafarm.db.model.land.LandType` reference field. + + This is a subclass of + :class:`~wuttaweb:wuttaweb.forms.schema.ObjectRef`. + """ + + @property + def model_class(self): # pylint: disable=empty-docstring + """ """ + model = self.app.model + return model.LandType + + def sort_query(self, query): # pylint: disable=empty-docstring + """ """ + return query.order_by(self.model_class.name) + + def get_object_url(self, obj): # pylint: disable=empty-docstring + """ """ + land_type = obj + return self.request.route_url("land_types.view", uuid=land_type.uuid) + + +class PlantTypeRefs(WuttaSet): + """ + Schema type for Plant Types field (on a Plant Asset). + """ + + def serialize(self, node, appstruct): + if not appstruct: + return colander.null + + return [uuid.hex for uuid in appstruct] + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import PlantTypeRefsWidget + + model = self.app.model + session = Session() + + if "values" not in kwargs: + plant_types = ( + session.query(model.PlantType).order_by(model.PlantType.name).all() + ) + values = [(pt.uuid.hex, str(pt)) for pt in plant_types] + kwargs["values"] = values + + return PlantTypeRefsWidget(self.request, **kwargs) + + +class StructureType(colander.SchemaType): + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): # pylint: disable=empty-docstring + """ """ + from wuttafarm.web.forms.widgets import StructureWidget + + return StructureWidget(self.request, **kwargs) + + +class StructureTypeRef(ObjectRef): + """ + Custom schema type for a + :class:`~wuttafarm.db.model.structures.Structure` reference field. + + This is a subclass of + :class:`~wuttaweb:wuttaweb.forms.schema.ObjectRef`. + """ + + @property + def model_class(self): # pylint: disable=empty-docstring + """ """ + model = self.app.model + return model.StructureType + + def sort_query(self, query): # pylint: disable=empty-docstring + """ """ + return query.order_by(self.model_class.name) + + def get_object_url(self, obj): # pylint: disable=empty-docstring + """ """ + structure_type = obj + return self.request.route_url("structure_types.view", uuid=structure_type.uuid) + + +class UnitRef(ObjectRef): + """ + Custom schema type for a :class:`~wuttafarm.db.model.units.Unit` + reference field. + + This is a subclass of + :class:`~wuttaweb:wuttaweb.forms.schema.ObjectRef`. + """ + + @property + def model_class(self): + model = self.app.model + return model.Unit + + def sort_query(self, query): + return query.order_by(self.model_class.name) + + def get_object_url(self, unit): + return self.request.route_url("units.view", uuid=unit.uuid) + + +class UsersType(colander.SchemaType): + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, node, appstruct): + if appstruct is colander.null: + return colander.null + + return json.dumps(appstruct) + + def widget_maker(self, **kwargs): # pylint: disable=empty-docstring + """ """ + from wuttafarm.web.forms.widgets import UsersWidget + + return UsersWidget(self.request, **kwargs) + + +class AssetParentRefs(WuttaSet): + """ + Schema type for Parents field which references assets. + """ + + def serialize(self, node, appstruct): + if not appstruct: + appstruct = [] + uuids = [u.hex for u in appstruct] + return json.dumps(uuids) + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import AssetParentRefsWidget + + return AssetParentRefsWidget(self.request, **kwargs) + + +class AssetRefs(WuttaSet): + """ + Schema type for Assets field (on a Log record) + """ + + def serialize(self, node, appstruct): + if not appstruct: + return colander.null + + return {asset.uuid for asset in appstruct} + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import AssetRefsWidget + + return AssetRefsWidget(self.request, **kwargs) + + +class LogQuantityRefs(WuttaSet): + """ + Schema type for Quantities field (on a Log record) + """ + + def serialize(self, node, appstruct): + if not appstruct: + return colander.null + + return {qty.uuid for qty in appstruct} + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import LogQuantityRefsWidget + + return LogQuantityRefsWidget(self.request, **kwargs) + + +class OwnerRefs(WuttaSet): + """ + Schema type for Owners field (on a Log record) + """ + + def serialize(self, node, appstruct): + if not appstruct: + return colander.null + + return {user.uuid for user in appstruct} + + def widget_maker(self, **kwargs): + from wuttafarm.web.forms.widgets import OwnerRefsWidget + + return OwnerRefsWidget(self.request, **kwargs) + + +class Notes(colander.String): + """ + Custom schema type for "note" fields. + """ + + def serialize(self, node, appstruct): + """ """ + if not appstruct: + return colander.null + + return super().serialize(node, appstruct) + + def widget_maker(self, **kwargs): + """ + Construct a default widget for the field. + + :returns: Instance of + :class:`~wuttaweb.forms.widgets.NotesWidget`. + """ + return NotesWidget(**kwargs) diff --git a/src/wuttafarm/web/forms/widgets.py b/src/wuttafarm/web/forms/widgets.py index 047a8cd..0a14638 100644 --- a/src/wuttafarm/web/forms/widgets.py +++ b/src/wuttafarm/web/forms/widgets.py @@ -23,25 +23,515 @@ Custom form widgets for WuttaFarm """ +import json + import colander -from deform.widget import Widget +from deform.widget import Widget, SelectWidget, sequence_types, _normalize_choices from webhelpers2.html import HTML, tags +from wuttaweb.forms.widgets import WuttaCheckboxChoiceWidget, ObjectRefWidget +from wuttaweb.db import Session -class AnimalImage(Widget): - """ - Widget to display an image URL for an animal. +from wuttafarm.web.util import render_quantity_objects - TODO: this should be refactored to a more general name, once more - types of images need to be supported. + +class ImageWidget(Widget): """ + Widget to display an image URL for a record. + """ + + def __init__(self, alt_text, *args, **kwargs): + super().__init__(*args, **kwargs) + self.alt_text = alt_text def serialize(self, field, cstruct, **kw): + """ """ readonly = kw.get("readonly", self.readonly) if readonly: if cstruct in (colander.null, None): return HTML.tag("span") - return tags.image(cstruct, "animal image", **kw) + return tags.image(cstruct, self.alt_text, **kw) return super().serialize(field, cstruct, **kw) + + +class LogQuickWidget(Widget): + """ + Widget to display an image URL for a record. + """ + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + items = [] + for quick in json.loads(cstruct): + items.append(HTML.tag("li", c=quick)) + return HTML.tag("ul", c=items) + + return super().serialize(field, cstruct, **kw) + + +class FarmOSRefWidget(SelectWidget): + """ + Generic widget to display "any reference field" - as a link to + view the farmOS record it references. Only used by the farmOS + direct API views. + """ + + def __init__(self, request, route_prefix, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + self.route_prefix = route_prefix + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + try: + obj = json.loads(cstruct) + except json.JSONDecodeError: + name = dict(self.values)[cstruct] + obj = {"uuid": cstruct, "name": name} + + return tags.link_to( + obj["name"], + self.request.route_url(f"{self.route_prefix}.view", uuid=obj["uuid"]), + ) + + return super().serialize(field, cstruct, **kw) + + +class FarmOSRefsWidget(Widget): + + def __init__(self, request, route_prefix, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + self.route_prefix = route_prefix + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + links = [] + for obj in json.loads(cstruct): + url = self.request.route_url( + f"{self.route_prefix}.view", uuid=obj["uuid"] + ) + links.append(HTML.tag("li", c=tags.link_to(obj["name"], url))) + + return HTML.tag("ul", c=links) + + return super().serialize(field, cstruct, **kw) + + +class FarmOSAssetRefsWidget(Widget): + """ + Widget to display a "Assets" field for an asset. + """ + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + assets = [] + for asset in json.loads(cstruct): + url = self.request.route_url( + f"farmos_{asset['asset_type']}_assets.view", uuid=asset["uuid"] + ) + assets.append(HTML.tag("li", c=tags.link_to(asset["name"], url))) + + return HTML.tag("ul", c=assets) + + return super().serialize(field, cstruct, **kw) + + +class FarmOSLocationRefsWidget(Widget): + """ + Widget to display a "Locations" field for an asset. + """ + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + locations = [] + for location in json.loads(cstruct): + asset_type = location["type"].split("--")[1] + url = self.request.route_url( + f"farmos_{asset_type}_assets.view", uuid=location["uuid"] + ) + locations.append(HTML.tag("li", c=tags.link_to(location["name"], url))) + + return HTML.tag("ul", c=locations) + + return super().serialize(field, cstruct, **kw) + + +class FarmOSQuantityRefsWidget(Widget): + """ + Widget to display a "Quantities" field for a log. + """ + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + quantities = json.loads(cstruct) + return render_quantity_objects(quantities) + + return super().serialize(field, cstruct, **kw) + + +class FarmOSUnitRefWidget(Widget): + """ + Widget to display a "Units" field for a quantity. + """ + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + unit = json.loads(cstruct) + return unit["name"] + + return super().serialize(field, cstruct, **kw) + + +class FarmOSPlantTypesWidget(Widget): + """ + Widget to display a farmOS "plant types" field. + """ + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + links = [] + for plant_type in json.loads(cstruct): + link = tags.link_to( + plant_type["name"], + self.request.route_url( + "farmos_plant_types.view", uuid=plant_type["uuid"] + ), + ) + links.append(HTML.tag("li", c=link)) + return HTML.tag("ul", c=links) + + return super().serialize(field, cstruct, **kw) + + +class PlantTypeRefsWidget(Widget): + """ + Widget for Plant Types field (on a Plant Asset). + """ + + template = "planttyperefs" + values = () + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + self.config = self.request.wutta_config + self.app = self.config.get_app() + + def serialize(self, field, cstruct, **kw): + """ """ + model = self.app.model + session = Session() + + if cstruct in (colander.null, None): + cstruct = () + + if readonly := kw.get("readonly", self.readonly): + items = [] + + plant_types = ( + session.query(model.PlantType) + .filter(model.PlantType.uuid.in_(cstruct)) + .order_by(model.PlantType.name) + .all() + ) + + for plant_type in plant_types: + items.append( + HTML.tag( + "li", + c=tags.link_to( + str(plant_type), + self.request.route_url( + "plant_types.view", uuid=plant_type.uuid + ), + ), + ) + ) + + return HTML.tag("ul", c=items) + + values = kw.get("values", self.values) + if not isinstance(values, sequence_types): + raise TypeError("Values must be a sequence type (list, tuple, or range).") + + kw["values"] = _normalize_choices(values) + tmpl_values = self.get_template_values(field, cstruct, kw) + return field.renderer(self.template, **tmpl_values) + + def get_template_values(self, field, cstruct, kw): + """ """ + values = super().get_template_values(field, cstruct, kw) + + values["js_values"] = json.dumps(values["values"]) + + if self.request.has_perm("plant_types.create"): + values["can_create"] = True + + return values + + def deserialize(self, field, pstruct): + """ """ + if not pstruct: + return colander.null + + return set(pstruct.split(",")) + + +class StructureWidget(Widget): + """ + Widget to display a "structure" field. + """ + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + structure = json.loads(cstruct) + return tags.link_to( + structure["name"], + self.request.route_url( + "farmos_structure_assets.view", uuid=structure["uuid"] + ), + ) + + return super().serialize(field, cstruct, **kw) + + +class UsersWidget(Widget): + """ + Widget to display the list of owners for an asset etc. + """ + + def __init__(self, request, *args, **kwargs): + super().__init__(*args, **kwargs) + self.request = request + + def serialize(self, field, cstruct, **kw): + """ """ + readonly = kw.get("readonly", self.readonly) + if readonly: + if cstruct in (colander.null, None): + return HTML.tag("span") + + items = [] + for user in json.loads(cstruct): + link = tags.link_to( + user["display_name"], + self.request.route_url("farmos_users.view", uuid=user["uuid"]), + ) + items.append(HTML.tag("li", c=link)) + + return HTML.tag("ul", c=items) + + return super().serialize(field, cstruct, **kw) + + +############################## +# native data widgets +############################## + + +class AssetParentRefsWidget(WuttaCheckboxChoiceWidget): + """ + Widget for Parents field which references assets. + """ + + def serialize(self, field, cstruct, **kw): + """ """ + model = self.app.model + session = Session() + + readonly = kw.get("readonly", self.readonly) + if readonly: + parents = [] + for uuid in json.loads(cstruct): + parent = session.get(model.Asset, uuid) + parents.append( + HTML.tag( + "li", + c=tags.link_to( + str(parent), + self.request.route_url( + f"{parent.asset_type}_assets.view", uuid=parent.uuid + ), + ), + ) + ) + return HTML.tag("ul", c=parents) + + return super().serialize(field, cstruct, **kw) + + +class AssetRefsWidget(WuttaCheckboxChoiceWidget): + """ + Widget for Assets field (of various kinds). + """ + + def serialize(self, field, cstruct, **kw): + """ """ + model = self.app.model + session = Session() + + readonly = kw.get("readonly", self.readonly) + if readonly: + assets = [] + for uuid in cstruct or []: + asset = session.get(model.Asset, uuid) + assets.append( + HTML.tag( + "li", + c=tags.link_to( + str(asset), + self.request.route_url( + f"{asset.asset_type}_assets.view", uuid=asset.uuid + ), + ), + ) + ) + return HTML.tag("ul", c=assets) + + return super().serialize(field, cstruct, **kw) + + +class LogQuantityRefsWidget(WuttaCheckboxChoiceWidget): + """ + Widget for Quantities field (on a Log record) + """ + + def serialize(self, field, cstruct, **kw): + """ """ + model = self.app.model + session = Session() + + readonly = kw.get("readonly", self.readonly) + if readonly: + quantities = [] + for uuid in cstruct or []: + qty = session.get(model.Quantity, uuid) + quantities.append( + HTML.tag( + "li", + c=tags.link_to( + qty.render_as_text(self.config), + # TODO + self.request.route_url( + "quantities_standard.view", uuid=qty.uuid + ), + ), + ) + ) + return HTML.tag("ul", c=quantities) + + return super().serialize(field, cstruct, **kw) + + +class OwnerRefsWidget(WuttaCheckboxChoiceWidget): + """ + Widget for Owners field (on an Asset or Log record) + """ + + def serialize(self, field, cstruct, **kw): + """ """ + model = self.app.model + session = Session() + + readonly = kw.get("readonly", self.readonly) + if readonly: + owners = [session.get(model.User, uuid) for uuid in cstruct or []] + owners = [user for user in owners if user] + owners.sort(key=lambda user: user.username) + links = [] + for user in owners: + links.append( + HTML.tag( + "li", + c=tags.link_to( + user.username, + self.request.route_url("users.view", uuid=user.uuid), + ), + ) + ) + return HTML.tag("ul", c=links) + + return super().serialize(field, cstruct, **kw) + + +class AnimalTypeRefWidget(ObjectRefWidget): + """ + Custom widget which uses the ```` component. + """ + + template = "animaltyperef" + + def get_template_values(self, field, cstruct, kw): + """ """ + values = super().get_template_values(field, cstruct, kw) + + values["js_values"] = json.dumps(values["values"]) + + if self.request.has_perm("animal_types.create"): + values["can_create"] = True + + return values diff --git a/src/wuttafarm/web/grids.py b/src/wuttafarm/web/grids.py new file mode 100644 index 0000000..8f4cde5 --- /dev/null +++ b/src/wuttafarm/web/grids.py @@ -0,0 +1,300 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Custom grid stuff for use with farmOS / JSONAPI +""" + +import datetime + +from wuttaweb.grids.filters import GridFilter + + +class SimpleFilter(GridFilter): + + default_verbs = ["equal", "not_equal"] + + def __init__(self, request, key, path=None, **kwargs): + super().__init__(request, key, **kwargs) + self.path = path or key + + def filter_equal(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, "=", value) + return data + + def filter_not_equal(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, "<>", value) + return data + + def filter_is_null(self, data, value): + data.add_filter(self.path, "IS NULL", None) + return data + + def filter_is_not_null(self, data, value): + data.add_filter(self.path, "IS NOT NULL", None) + return data + + +class StringFilter(SimpleFilter): + + default_verbs = ["contains", "equal", "not_equal"] + + def filter_contains(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, "CONTAINS", value) + return data + + +class NullableStringFilter(StringFilter): + + default_verbs = ["contains", "equal", "not_equal", "is_null", "is_not_null"] + + +class IntegerFilter(SimpleFilter): + + default_verbs = [ + "equal", + "not_equal", + "less_than", + "less_equal", + "greater_than", + "greater_equal", + ] + + def filter_less_than(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, "<", value) + return data + + def filter_less_equal(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, "<=", value) + return data + + def filter_greater_than(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, ">", value) + return data + + def filter_greater_equal(self, data, value): + if value := self.coerce_value(value): + data.add_filter(self.path, ">=", value) + return data + + +class NullableIntegerFilter(IntegerFilter): + + default_verbs = ["equal", "not_equal", "is_null", "is_not_null"] + + +class BooleanFilter(SimpleFilter): + + default_verbs = ["is_true", "is_false"] + + def filter_is_true(self, data, value): + data.add_filter(self.path, "=", 1) + return data + + def filter_is_false(self, data, value): + data.add_filter(self.path, "=", 0) + return data + + +class NullableBooleanFilter(BooleanFilter): + + default_verbs = ["is_true", "is_false", "is_null", "is_not_null"] + + +# TODO: this may not work, it's not used anywhere yet +class DateFilter(SimpleFilter): + + data_type = "date" + + default_verbs = [ + "equal", + "not_equal", + "greater_than", + "greater_equal", + "less_than", + "less_equal", + # 'between', + ] + + default_verb_labels = { + "equal": "on", + "not_equal": "not on", + "greater_than": "after", + "greater_equal": "on or after", + "less_than": "before", + "less_equal": "on or before", + # "between": "between", + "is_null": "is null", + "is_not_null": "is not null", + "is_any": "is any", + } + + def coerce_value(self, value): + if value: + if isinstance(value, datetime.date): + return value + + try: + dt = datetime.datetime.strptime(value, "%Y-%m-%d") + except ValueError: + log.warning("invalid date value: %s", value) + else: + return dt.date() + + return None + + +# TODO: this is not very complete yet, so far used only for animal birthdate +class DateTimeFilter(DateFilter): + + default_verbs = ["equal", "is_null", "is_not_null"] + + def coerce_value(self, value): + """ + Convert user input to a proper ``datetime.date`` object. + """ + if value: + if isinstance(value, datetime.date): + return value + + try: + dt = datetime.datetime.strptime(value, "%Y-%m-%d") + except ValueError: + log.warning("invalid date value: %s", value) + else: + return dt.date() + + return None + + def filter_equal(self, data, value): + if value := self.coerce_value(value): + + start = datetime.datetime.combine(value, datetime.time(0)) + start = self.app.localtime(start, from_utc=False) + + stop = datetime.datetime.combine( + value + datetime.timedelta(days=1), datetime.time(0) + ) + stop = self.app.localtime(stop, from_utc=False) + + data.add_filter(self.path, ">=", int(start.timestamp())) + data.add_filter(self.path, "<", int(stop.timestamp())) + + return data + + +class SimpleSorter: + + def __init__(self, key): + self.key = key + + def __call__(self, data, sortdir): + data.add_sorter(self.key, sortdir) + return data + + +class ResourceData: + + def __init__( + self, + config, + farmos_client, + content_type, + include=None, + normalizer=None, + ): + self.config = config + self.farmos_client = farmos_client + self.entity, self.bundle = content_type.split("--") + self.filters = [] + self.sorters = [] + self.include = include + self.normalizer = normalizer + self._data = None + + def __bool__(self): + return True + + def __getitem__(self, subscript): + return self.get_data()[subscript] + + def __len__(self): + return len(self._data) + + def add_filter(self, path, operator, value): + self.filters.append((path, operator, value)) + + def add_sorter(self, path, sortdir): + self.sorters.append((path, sortdir)) + + def get_data(self): + if self._data is None: + params = {} + + i = 0 + for path, operator, value in self.filters: + i += 1 + key = f"{i:03d}" + params[f"filter[{key}][condition][path]"] = path + params[f"filter[{key}][condition][operator]"] = operator + params[f"filter[{key}][condition][value]"] = value + + sorters = [] + for path, sortdir in self.sorters: + prefix = "-" if sortdir == "desc" else "" + sorters.append(f"{prefix}{path}") + if sorters: + params["sort"] = ",".join(sorters) + + # nb. while the API allows for pagination, it does not + # tell me how many total records there are (IIUC). also + # if i ask for e.g. items 21-40 (page 2 @ 20/page) i am + # not guaranteed to get 20 items even if there are plenty + # in the DB, since Drupal may filter some out based on + # permissions. (granted that may not be an issue in + # practice, but can't rule it out.) so the punchline is, + # we fetch "all" (sic) data and send it to the frontend, + # and pagination happens there. + + # TODO: if we ever try again, this sort of works... + # params["page[offset]"] = start + # params["page[limit]"] = stop - start + + if self.include: + params["include"] = self.include + + result = self.farmos_client.resource.get( + self.entity, self.bundle, params=params + ) + data = result["data"] + included = {obj["id"]: obj for obj in result.get("included", [])} + + if self.normalizer: + data = [self.normalizer(d, included) for d in data] + + self._data = data + return self._data diff --git a/src/wuttafarm/web/menus.py b/src/wuttafarm/web/menus.py index e999944..fe7719e 100644 --- a/src/wuttafarm/web/menus.py +++ b/src/wuttafarm/web/menus.py @@ -32,20 +32,425 @@ class WuttaFarmMenuHandler(base.MenuHandler): """ def make_menus(self, request, **kwargs): - return [ - self.make_farmos_menu(request), - self.make_admin_menu(request, include_people=True), - ] + enum = self.app.enum + mode = self.app.get_farmos_integration_mode() - def make_farmos_menu(self, request): + quick_menu = self.make_quick_menu(request) + admin_menu = self.make_admin_menu(request, include_people=True) + + if mode == enum.FARMOS_INTEGRATION_MODE_WRAPPER: + return [ + quick_menu, + self.make_farmos_asset_menu(request), + self.make_farmos_log_menu(request), + self.make_farmos_other_menu(request), + admin_menu, + ] + + elif mode == enum.FARMOS_INTEGRATION_MODE_MIRROR: + return [ + quick_menu, + self.make_asset_menu(request), + self.make_log_menu(request), + self.make_farmos_full_menu(request), + admin_menu, + ] + + else: # FARMOS_INTEGRATION_MODE_NONE + return [ + quick_menu, + self.make_asset_menu(request), + self.make_log_menu(request), + admin_menu, + ] + + def make_quick_menu(self, request): + return { + "title": "Quick", + "type": "menu", + "items": [ + { + "title": "Eggs", + "route": "quick.eggs", + "perm": "quick.eggs", + }, + ], + } + + def make_asset_menu(self, request): + return { + "title": "Assets", + "type": "menu", + "items": [ + { + "title": "All Assets", + "route": "assets", + "perm": "assets.list", + }, + { + "title": "Animal", + "route": "animal_assets", + "perm": "animal_assets.list", + }, + { + "title": "Group", + "route": "group_assets", + "perm": "group_assets.list", + }, + { + "title": "Land", + "route": "land_assets", + "perm": "land_assets.list", + }, + { + "title": "Plant", + "route": "plant_assets", + "perm": "plant_assets.list", + }, + { + "title": "Structure", + "route": "structure_assets", + "perm": "structure_assets.list", + }, + {"type": "sep"}, + { + "title": "Animal Types", + "route": "animal_types", + "perm": "animal_types.list", + }, + { + "title": "Land Types", + "route": "land_types", + "perm": "land_types.list", + }, + { + "title": "Plant Types", + "route": "plant_types", + "perm": "plant_types.list", + }, + { + "title": "Structure Types", + "route": "structure_types", + "perm": "structure_types.list", + }, + { + "title": "Asset Types", + "route": "asset_types", + "perm": "asset_types.list", + }, + ], + } + + def make_log_menu(self, request): + return { + "title": "Logs", + "type": "menu", + "items": [ + { + "title": "All Logs", + "route": "log", + "perm": "log.list", + }, + { + "title": "Activity", + "route": "logs_activity", + "perm": "logs_activity.list", + }, + { + "title": "Harvest", + "route": "logs_harvest", + "perm": "logs_harvest.list", + }, + { + "title": "Medical", + "route": "logs_medical", + "perm": "logs_medical.list", + }, + { + "title": "Observation", + "route": "logs_observation", + "perm": "logs_observation.list", + }, + {"type": "sep"}, + { + "title": "All Quantities", + "route": "quantities", + "perm": "quantities.list", + }, + { + "title": "Standard Quantities", + "route": "quantities_standard", + "perm": "quantities_standard.list", + }, + {"type": "sep"}, + { + "title": "Log Types", + "route": "log_types", + "perm": "log_types.list", + }, + { + "title": "Measures", + "route": "measures", + "perm": "measures.list", + }, + { + "title": "Quantity Types", + "route": "quantity_types", + "perm": "quantity_types.list", + }, + { + "title": "Units", + "route": "units", + "perm": "units.list", + }, + ], + } + + def make_farmos_full_menu(self, request): + config = request.wutta_config + app = config.get_app() return { "title": "farmOS", "type": "menu", "items": [ { - "title": "Animals", - "route": "farmos_animals", - "perm": "farmos_animals.list", + "title": "Go to farmOS", + "url": app.get_farmos_url(), + "target": "_blank", + }, + {"type": "sep"}, + { + "title": "Animal Assets", + "route": "farmos_animal_assets", + "perm": "farmos_animal_assets.list", + }, + { + "title": "Group Assets", + "route": "farmos_group_assets", + "perm": "farmos_group_assets.list", + }, + { + "title": "Land Assets", + "route": "farmos_land_assets", + "perm": "farmos_land_assets.list", + }, + { + "title": "Plant Assets", + "route": "farmos_plant_assets", + "perm": "farmos_plant_assets.list", + }, + { + "title": "Structure Assets", + "route": "farmos_structure_assets", + "perm": "farmos_structure_assets.list", + }, + {"type": "sep"}, + { + "title": "Activity Logs", + "route": "farmos_logs_activity", + "perm": "farmos_logs_activity.list", + }, + { + "title": "Harvest Logs", + "route": "farmos_logs_harvest", + "perm": "farmos_logs_harvest.list", + }, + { + "title": "Medical Logs", + "route": "farmos_logs_medical", + "perm": "farmos_logs_medical.list", + }, + { + "title": "Observation Logs", + "route": "farmos_logs_observation", + "perm": "farmos_logs_observation.list", + }, + {"type": "sep"}, + { + "title": "Animal Types", + "route": "farmos_animal_types", + "perm": "farmos_animal_types.list", + }, + { + "title": "Land Types", + "route": "farmos_land_types", + "perm": "farmos_land_types.list", + }, + { + "title": "Plant Types", + "route": "farmos_plant_types", + "perm": "farmos_plant_types.list", + }, + { + "title": "Structure Types", + "route": "farmos_structure_types", + "perm": "farmos_structure_types.list", + }, + {"type": "sep"}, + { + "title": "Asset Types", + "route": "farmos_asset_types", + "perm": "farmos_asset_types.list", + }, + { + "title": "Log Types", + "route": "farmos_log_types", + "perm": "farmos_log_types.list", + }, + { + "title": "Quantity Types", + "route": "farmos_quantity_types", + "perm": "farmos_quantity_types.list", + }, + { + "title": "Standard Quantities", + "route": "farmos_quantities_standard", + "perm": "farmos_quantities_standard.list", + }, + { + "title": "Units", + "route": "farmos_units", + "perm": "farmos_units.list", + }, + {"type": "sep"}, + { + "title": "Users", + "route": "farmos_users", + "perm": "farmos_users.list", + }, + ], + } + + def make_farmos_asset_menu(self, request): + config = request.wutta_config + app = config.get_app() + return { + "title": "Assets", + "type": "menu", + "items": [ + { + "title": "Animal", + "route": "farmos_animal_assets", + "perm": "farmos_animal_assets.list", + }, + { + "title": "Group", + "route": "farmos_group_assets", + "perm": "farmos_group_assets.list", + }, + { + "title": "Land", + "route": "farmos_land_assets", + "perm": "farmos_land_assets.list", + }, + { + "title": "Plant", + "route": "farmos_plant_assets", + "perm": "farmos_plant_assets.list", + }, + { + "title": "Structure", + "route": "farmos_structure_assets", + "perm": "farmos_structure_assets.list", + }, + {"type": "sep"}, + { + "title": "Animal Types", + "route": "farmos_animal_types", + "perm": "farmos_animal_types.list", + }, + { + "title": "Land Types", + "route": "farmos_land_types", + "perm": "farmos_land_types.list", + }, + { + "title": "Plant Types", + "route": "farmos_plant_types", + "perm": "farmos_plant_types.list", + }, + { + "title": "Structure Types", + "route": "farmos_structure_types", + "perm": "farmos_structure_types.list", + }, + {"type": "sep"}, + { + "title": "Asset Types", + "route": "farmos_asset_types", + "perm": "farmos_asset_types.list", + }, + ], + } + + def make_farmos_log_menu(self, request): + config = request.wutta_config + app = config.get_app() + return { + "title": "Logs", + "type": "menu", + "items": [ + { + "title": "Activity", + "route": "farmos_logs_activity", + "perm": "farmos_logs_activity.list", + }, + { + "title": "Harvest", + "route": "farmos_logs_harvest", + "perm": "farmos_logs_harvest.list", + }, + { + "title": "Medical", + "route": "farmos_logs_medical", + "perm": "farmos_logs_medical.list", + }, + { + "title": "Observation", + "route": "farmos_logs_observation", + "perm": "farmos_logs_observation.list", + }, + {"type": "sep"}, + { + "title": "Log Types", + "route": "farmos_log_types", + "perm": "farmos_log_types.list", + }, + { + "title": "Quantity Types", + "route": "farmos_quantity_types", + "perm": "farmos_quantity_types.list", + }, + { + "title": "Standard Quantities", + "route": "farmos_quantities_standard", + "perm": "farmos_quantities_standard.list", + }, + { + "title": "Units", + "route": "farmos_units", + "perm": "farmos_units.list", + }, + ], + } + + def make_farmos_other_menu(self, request): + config = request.wutta_config + app = config.get_app() + return { + "title": "farmOS", + "type": "menu", + "items": [ + { + "title": "Go to farmOS", + "url": app.get_farmos_url(), + "target": "_blank", + }, + {"type": "sep"}, + { + "title": "Users", + "route": "farmos_users", + "perm": "farmos_users.list", }, ], } diff --git a/src/wuttafarm/web/static/css/wuttafarm-buefy.css b/src/wuttafarm/web/static/css/wuttafarm-buefy.css new file mode 100644 index 0000000..80062ae --- /dev/null +++ b/src/wuttafarm/web/static/css/wuttafarm-buefy.css @@ -0,0 +1 @@ +.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis,.file-cta,.file-name,.select select,.taginput .taginput-container.is-focusable,.textarea,.input,.button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid rgba(0,0,0,0);border-radius:4px;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.5em - 1px);padding-left:calc(.75em - 1px);padding-right:calc(.75em - 1px);padding-top:calc(.5em - 1px);position:relative;vertical-align:top}.pagination-previous:focus,.pagination-next:focus,.pagination-link:focus,.pagination-ellipsis:focus,.file-cta:focus,.file-name:focus,.select select:focus,.taginput .taginput-container.is-focusable:focus,.textarea:focus,.input:focus,.button:focus,.is-focused.pagination-previous,.is-focused.pagination-next,.is-focused.pagination-link,.is-focused.pagination-ellipsis,.is-focused.file-cta,.is-focused.file-name,.select select.is-focused,.taginput .is-focused.taginput-container.is-focusable,.is-focused.textarea,.is-focused.input,.is-focused.button,.pagination-previous:active,.pagination-next:active,.pagination-link:active,.pagination-ellipsis:active,.file-cta:active,.file-name:active,.select select:active,.taginput .taginput-container.is-focusable:active,.textarea:active,.input:active,.button:active,.is-active.pagination-previous,.is-active.pagination-next,.is-active.pagination-link,.is-active.pagination-ellipsis,.is-active.file-cta,.is-active.file-name,.select select.is-active,.taginput .is-active.taginput-container.is-focusable,.is-active.textarea,.is-active.input,.is-active.button{outline:none}[disabled].pagination-previous,[disabled].pagination-next,[disabled].pagination-link,[disabled].pagination-ellipsis,[disabled].file-cta,[disabled].file-name,.select select[disabled],.taginput [disabled].taginput-container.is-focusable,[disabled].textarea,[disabled].input,[disabled].button,fieldset[disabled] .pagination-previous,fieldset[disabled] .pagination-next,fieldset[disabled] .pagination-link,fieldset[disabled] .pagination-ellipsis,fieldset[disabled] .file-cta,fieldset[disabled] .file-name,fieldset[disabled] .select select,.select fieldset[disabled] select,fieldset[disabled] .taginput .taginput-container.is-focusable,.taginput fieldset[disabled] .taginput-container.is-focusable,fieldset[disabled] .textarea,fieldset[disabled] .input,fieldset[disabled] .button{cursor:not-allowed}.switch,.b-radio.radio,.b-checkbox.checkbox,.carousel-list,.carousel,.is-unselectable,.tabs,.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis,.breadcrumb,.file,.button{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.navbar-link:not(.is-arrowless)::after,.select:not(.is-multiple):not(.is-loading)::after{border:3px solid rgba(0,0,0,0);border-radius:2px;border-right:0;border-top:0;content:" ";display:block;height:.625em;margin-top:-0.4375em;pointer-events:none;position:absolute;top:50%;transform:rotate(-45deg);transform-origin:center;width:.625em}.tabs:not(:last-child),.pagination:not(:last-child),.message:not(:last-child),.level:not(:last-child),.breadcrumb:not(:last-child),.block:not(:last-child),.title:not(:last-child),.subtitle:not(:last-child),.table-container:not(:last-child),.table:not(:last-child),.progress:not(:last-child),.progress-wrapper.is-not-native:not(:last-child),.notification:not(:last-child),.content:not(:last-child),.box:not(:last-child){margin-bottom:1.5rem}.modal-close,.delete{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:hsla(0,0%,4%,.2);border:none;border-radius:9999px;cursor:pointer;pointer-events:auto;display:inline-block;flex-grow:0;flex-shrink:0;font-size:0;height:20px;max-height:20px;max-width:20px;min-height:20px;min-width:20px;outline:none;position:relative;vertical-align:top;width:20px}.modal-close::before,.delete::before,.modal-close::after,.delete::after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.modal-close::before,.delete::before{height:2px;width:50%}.modal-close::after,.delete::after{height:50%;width:2px}.modal-close:hover,.delete:hover,.modal-close:focus,.delete:focus{background-color:hsla(0,0%,4%,.3)}.modal-close:active,.delete:active{background-color:hsla(0,0%,4%,.4)}.is-small.modal-close,.is-small.delete{height:16px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;width:16px}.is-medium.modal-close,.is-medium.delete{height:24px;max-height:24px;max-width:24px;min-height:24px;min-width:24px;width:24px}.is-large.modal-close,.is-large.delete{height:32px;max-height:32px;max-width:32px;min-height:32px;min-width:32px;width:32px}.control.is-loading::after,.select.is-loading::after,.loader,.button.is-loading::after{animation:spinAround 500ms infinite linear;border:2px solid hsl(0,0%,86%);border-radius:9999px;border-right-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);content:"";display:block;height:1em;position:relative;width:1em}.b-image-wrapper>img.has-ratio,.b-image-wrapper>img.placeholder,.hero-video,.is-overlay,.modal-background,.modal,.image.is-square img,.image.is-square .has-ratio,.image.is-1by1 img,.image.is-1by1 .has-ratio,.image.is-5by4 img,.image.is-5by4 .has-ratio,.image.is-4by3 img,.image.is-4by3 .has-ratio,.image.is-3by2 img,.image.is-3by2 .has-ratio,.image.is-5by3 img,.image.is-5by3 .has-ratio,.image.is-16by9 img,.image.is-16by9 .has-ratio,.image.is-2by1 img,.image.is-2by1 .has-ratio,.image.is-3by1 img,.image.is-3by1 .has-ratio,.image.is-4by5 img,.image.is-4by5 .has-ratio,.image.is-3by4 img,.image.is-3by4 .has-ratio,.image.is-2by3 img,.image.is-2by3 .has-ratio,.image.is-3by5 img,.image.is-3by5 .has-ratio,.image.is-9by16 img,.image.is-9by16 .has-ratio,.image.is-1by2 img,.image.is-1by2 .has-ratio,.image.is-1by3 img,.image.is-1by3 .has-ratio{bottom:0;left:0;position:absolute;right:0;top:0}.navbar-burger{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:none;border:none;color:currentColor;font-family:inherit;font-size:1em;margin:0;padding:0}/*! bulma.io v0.9.4 | MIT License | github.com/jgthms/bulma */.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis,.file-cta,.file-name,.select select,.taginput .taginput-container.is-focusable,.textarea,.input,.button{-moz-appearance:none;-webkit-appearance:none;align-items:center;border:1px solid rgba(0,0,0,0);border-radius:4px;box-shadow:none;display:inline-flex;font-size:1rem;height:2.5em;justify-content:flex-start;line-height:1.5;padding-bottom:calc(.5em - 1px);padding-left:calc(.75em - 1px);padding-right:calc(.75em - 1px);padding-top:calc(.5em - 1px);position:relative;vertical-align:top}.pagination-previous:focus,.pagination-next:focus,.pagination-link:focus,.pagination-ellipsis:focus,.file-cta:focus,.file-name:focus,.select select:focus,.taginput .taginput-container.is-focusable:focus,.textarea:focus,.input:focus,.button:focus,.is-focused.pagination-previous,.is-focused.pagination-next,.is-focused.pagination-link,.is-focused.pagination-ellipsis,.is-focused.file-cta,.is-focused.file-name,.select select.is-focused,.taginput .is-focused.taginput-container.is-focusable,.is-focused.textarea,.is-focused.input,.is-focused.button,.pagination-previous:active,.pagination-next:active,.pagination-link:active,.pagination-ellipsis:active,.file-cta:active,.file-name:active,.select select:active,.taginput .taginput-container.is-focusable:active,.textarea:active,.input:active,.button:active,.is-active.pagination-previous,.is-active.pagination-next,.is-active.pagination-link,.is-active.pagination-ellipsis,.is-active.file-cta,.is-active.file-name,.select select.is-active,.taginput .is-active.taginput-container.is-focusable,.is-active.textarea,.is-active.input,.is-active.button{outline:none}[disabled].pagination-previous,[disabled].pagination-next,[disabled].pagination-link,[disabled].pagination-ellipsis,[disabled].file-cta,[disabled].file-name,.select select[disabled],.taginput [disabled].taginput-container.is-focusable,[disabled].textarea,[disabled].input,[disabled].button,fieldset[disabled] .pagination-previous,fieldset[disabled] .pagination-next,fieldset[disabled] .pagination-link,fieldset[disabled] .pagination-ellipsis,fieldset[disabled] .file-cta,fieldset[disabled] .file-name,fieldset[disabled] .select select,.select fieldset[disabled] select,fieldset[disabled] .taginput .taginput-container.is-focusable,.taginput fieldset[disabled] .taginput-container.is-focusable,fieldset[disabled] .textarea,fieldset[disabled] .input,fieldset[disabled] .button{cursor:not-allowed}.switch,.b-radio.radio,.b-checkbox.checkbox,.carousel-list,.carousel,.is-unselectable,.tabs,.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis,.breadcrumb,.file,.button{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.navbar-link:not(.is-arrowless)::after,.select:not(.is-multiple):not(.is-loading)::after{border:3px solid rgba(0,0,0,0);border-radius:2px;border-right:0;border-top:0;content:" ";display:block;height:.625em;margin-top:-0.4375em;pointer-events:none;position:absolute;top:50%;transform:rotate(-45deg);transform-origin:center;width:.625em}.tabs:not(:last-child),.pagination:not(:last-child),.message:not(:last-child),.level:not(:last-child),.breadcrumb:not(:last-child),.block:not(:last-child),.title:not(:last-child),.subtitle:not(:last-child),.table-container:not(:last-child),.table:not(:last-child),.progress:not(:last-child),.progress-wrapper.is-not-native:not(:last-child),.notification:not(:last-child),.content:not(:last-child),.box:not(:last-child){margin-bottom:1.5rem}.modal-close,.delete{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:hsla(0,0%,4%,.2);border:none;border-radius:9999px;cursor:pointer;pointer-events:auto;display:inline-block;flex-grow:0;flex-shrink:0;font-size:0;height:20px;max-height:20px;max-width:20px;min-height:20px;min-width:20px;outline:none;position:relative;vertical-align:top;width:20px}.modal-close::before,.delete::before,.modal-close::after,.delete::after{background-color:#fff;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.modal-close::before,.delete::before{height:2px;width:50%}.modal-close::after,.delete::after{height:50%;width:2px}.modal-close:hover,.delete:hover,.modal-close:focus,.delete:focus{background-color:hsla(0,0%,4%,.3)}.modal-close:active,.delete:active{background-color:hsla(0,0%,4%,.4)}.is-small.modal-close,.is-small.delete{height:16px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;width:16px}.is-medium.modal-close,.is-medium.delete{height:24px;max-height:24px;max-width:24px;min-height:24px;min-width:24px;width:24px}.is-large.modal-close,.is-large.delete{height:32px;max-height:32px;max-width:32px;min-height:32px;min-width:32px;width:32px}.control.is-loading::after,.select.is-loading::after,.loader,.button.is-loading::after{animation:spinAround 500ms infinite linear;border:2px solid hsl(0,0%,86%);border-radius:9999px;border-right-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);content:"";display:block;height:1em;position:relative;width:1em}.b-image-wrapper>img.has-ratio,.b-image-wrapper>img.placeholder,.hero-video,.is-overlay,.modal-background,.modal,.image.is-square img,.image.is-square .has-ratio,.image.is-1by1 img,.image.is-1by1 .has-ratio,.image.is-5by4 img,.image.is-5by4 .has-ratio,.image.is-4by3 img,.image.is-4by3 .has-ratio,.image.is-3by2 img,.image.is-3by2 .has-ratio,.image.is-5by3 img,.image.is-5by3 .has-ratio,.image.is-16by9 img,.image.is-16by9 .has-ratio,.image.is-2by1 img,.image.is-2by1 .has-ratio,.image.is-3by1 img,.image.is-3by1 .has-ratio,.image.is-4by5 img,.image.is-4by5 .has-ratio,.image.is-3by4 img,.image.is-3by4 .has-ratio,.image.is-2by3 img,.image.is-2by3 .has-ratio,.image.is-3by5 img,.image.is-3by5 .has-ratio,.image.is-9by16 img,.image.is-9by16 .has-ratio,.image.is-1by2 img,.image.is-1by2 .has-ratio,.image.is-1by3 img,.image.is-1by3 .has-ratio{bottom:0;left:0;position:absolute;right:0;top:0}.navbar-burger{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:none;border:none;color:currentColor;font-family:inherit;font-size:1em;margin:0;padding:0}/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}img,video{height:auto;max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}td:not([align]),th:not([align]){text-align:inherit}html{background-color:#fff;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;text-size-adjust:100%}article,aside,figure,footer,header,hgroup,section{display:block}body,button,input,optgroup,select,textarea{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue","Helvetica","Arial",sans-serif}code,pre{-moz-osx-font-smoothing:auto;-webkit-font-smoothing:auto;font-family:monospace}body{color:hsl(0,0%,29%);font-size:1em;font-weight:400;line-height:1.5}a{color:#00875f;cursor:pointer;text-decoration:none}a strong{color:currentColor}a:hover{color:hsl(0,0%,21%)}code{background-color:hsl(0,0%,96%);color:hsl(348,86%,46%);font-size:.875em;font-weight:normal;padding:.25em .5em .25em}hr{background-color:hsl(0,0%,96%);border:none;display:block;height:2px;margin:1.5rem 0}img{height:auto;max-width:100%}input[type=checkbox],input[type=radio]{vertical-align:baseline}small{font-size:.875em}span{font-style:inherit;font-weight:inherit}strong{color:hsl(0,0%,21%);font-weight:700}fieldset{border:none}pre{-webkit-overflow-scrolling:touch;background-color:hsl(0,0%,96%);color:hsl(0,0%,29%);font-size:.875em;overflow-x:auto;padding:1.25rem 1.5rem;white-space:pre;word-wrap:normal}pre code{background-color:rgba(0,0,0,0);color:currentColor;font-size:1em;padding:0}table td,table th{vertical-align:top}table td:not([align]),table th:not([align]){text-align:inherit}table th{color:hsl(0,0%,21%)}@keyframes spinAround{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}.box{background-color:#fff;border-radius:6px;box-shadow:0 .5em 1em -0.125em hsla(0,0%,4%,.1),0 0px 0 1px hsla(0,0%,4%,.02);color:hsl(0,0%,29%);display:block;padding:1.25rem}a.box:hover,a.box:focus{box-shadow:0 .5em 1em -0.125em hsla(0,0%,4%,.1),0 0 0 1px #00875f}a.box:active{box-shadow:inset 0 1px 2px hsla(0,0%,4%,.2),0 0 0 1px #00875f}.button{background-color:#fff;border-color:hsl(0,0%,86%);border-width:1px;color:hsl(0,0%,21%);cursor:pointer;justify-content:center;padding-bottom:calc(.5em - 1px);padding-left:1em;padding-right:1em;padding-top:calc(.5em - 1px);text-align:center;white-space:nowrap}.button strong{color:inherit}.button .icon,.button .icon.is-small,.button .icon.is-medium,.button .icon.is-large{height:1.5em;width:1.5em}.button .icon:first-child:not(:last-child){margin-left:calc(-0.5em - 1px);margin-right:.25em}.button .icon:last-child:not(:first-child){margin-left:.25em;margin-right:calc(-0.5em - 1px)}.button .icon:first-child:last-child{margin-left:calc(-0.5em - 1px);margin-right:calc(-0.5em - 1px)}.button:hover,.button.is-hovered{border-color:hsl(0,0%,71%);color:hsl(0,0%,21%)}.button:focus,.button.is-focused{border-color:#00875f;color:hsl(0,0%,21%)}.button:focus:not(:active),.button.is-focused:not(:active){box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.button:active,.button.is-active{border-color:hsl(0,0%,29%);color:hsl(0,0%,21%)}.button.is-text{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);color:hsl(0,0%,29%);text-decoration:underline}.button.is-text:hover,.button.is-text.is-hovered,.button.is-text:focus,.button.is-text.is-focused{background-color:hsl(0,0%,96%);color:hsl(0,0%,21%)}.button.is-text:active,.button.is-text.is-active{background-color:hsl(0,0%,91%);color:hsl(0,0%,21%)}.button.is-text[disabled],fieldset[disabled] .button.is-text{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);box-shadow:none}.button.is-ghost{background:none;border-color:rgba(0,0,0,0);color:#00875f;text-decoration:none}.button.is-ghost:hover,.button.is-ghost.is-hovered{color:#00875f;text-decoration:underline}.button.is-white{background-color:#fff;border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.button.is-white:hover,.button.is-white.is-hovered{background-color:hsl(0,0%,97.5%);border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.button.is-white:focus,.button.is-white.is-focused{border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.button.is-white:focus:not(:active),.button.is-white.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(0,0%,100%,.25)}.button.is-white:active,.button.is-white.is-active{background-color:hsl(0,0%,95%);border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.button.is-white[disabled],fieldset[disabled] .button.is-white{background-color:#fff;border-color:#fff;box-shadow:none}.button.is-white.is-inverted{background-color:hsl(0,0%,4%);color:#fff}.button.is-white.is-inverted:hover,.button.is-white.is-inverted.is-hovered{background-color:#000}.button.is-white.is-inverted[disabled],fieldset[disabled] .button.is-white.is-inverted{background-color:hsl(0,0%,4%);border-color:rgba(0,0,0,0);box-shadow:none;color:#fff}.button.is-white.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,4%) hsl(0,0%,4%) !important}.button.is-white.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-white.is-outlined:hover,.button.is-white.is-outlined.is-hovered,.button.is-white.is-outlined:focus,.button.is-white.is-outlined.is-focused{background-color:#fff;border-color:#fff;color:hsl(0,0%,4%)}.button.is-white.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-white.is-outlined.is-loading:hover::after,.button.is-white.is-outlined.is-loading.is-hovered::after,.button.is-white.is-outlined.is-loading:focus::after,.button.is-white.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,4%) hsl(0,0%,4%) !important}.button.is-white.is-outlined[disabled],fieldset[disabled] .button.is-white.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-white.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,4%);color:hsl(0,0%,4%)}.button.is-white.is-inverted.is-outlined:hover,.button.is-white.is-inverted.is-outlined.is-hovered,.button.is-white.is-inverted.is-outlined:focus,.button.is-white.is-inverted.is-outlined.is-focused{background-color:hsl(0,0%,4%);color:#fff}.button.is-white.is-inverted.is-outlined.is-loading:hover::after,.button.is-white.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-white.is-inverted.is-outlined.is-loading:focus::after,.button.is-white.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-white.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-white.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,4%);box-shadow:none;color:hsl(0,0%,4%)}.button.is-black{background-color:hsl(0,0%,4%);border-color:rgba(0,0,0,0);color:#fff}.button.is-black:hover,.button.is-black.is-hovered{background-color:hsl(0,0%,1.5%);border-color:rgba(0,0,0,0);color:#fff}.button.is-black:focus,.button.is-black.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-black:focus:not(:active),.button.is-black.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(0,0%,4%,.25)}.button.is-black:active,.button.is-black.is-active{background-color:#000;border-color:rgba(0,0,0,0);color:#fff}.button.is-black[disabled],fieldset[disabled] .button.is-black{background-color:hsl(0,0%,4%);border-color:hsl(0,0%,4%);box-shadow:none}.button.is-black.is-inverted{background-color:#fff;color:hsl(0,0%,4%)}.button.is-black.is-inverted:hover,.button.is-black.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-black.is-inverted[disabled],fieldset[disabled] .button.is-black.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(0,0%,4%)}.button.is-black.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-black.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,4%);color:hsl(0,0%,4%)}.button.is-black.is-outlined:hover,.button.is-black.is-outlined.is-hovered,.button.is-black.is-outlined:focus,.button.is-black.is-outlined.is-focused{background-color:hsl(0,0%,4%);border-color:hsl(0,0%,4%);color:#fff}.button.is-black.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,4%) hsl(0,0%,4%) !important}.button.is-black.is-outlined.is-loading:hover::after,.button.is-black.is-outlined.is-loading.is-hovered::after,.button.is-black.is-outlined.is-loading:focus::after,.button.is-black.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-black.is-outlined[disabled],fieldset[disabled] .button.is-black.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,4%);box-shadow:none;color:hsl(0,0%,4%)}.button.is-black.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-black.is-inverted.is-outlined:hover,.button.is-black.is-inverted.is-outlined.is-hovered,.button.is-black.is-inverted.is-outlined:focus,.button.is-black.is-inverted.is-outlined.is-focused{background-color:#fff;color:hsl(0,0%,4%)}.button.is-black.is-inverted.is-outlined.is-loading:hover::after,.button.is-black.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-black.is-inverted.is-outlined.is-loading:focus::after,.button.is-black.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,4%) hsl(0,0%,4%) !important}.button.is-black.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-black.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-light{background-color:hsl(0,0%,96%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-light:hover,.button.is-light.is-hovered{background-color:hsl(0,0%,93.5%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-light:focus,.button.is-light.is-focused{border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-light:focus:not(:active),.button.is-light.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(0,0%,96%,.25)}.button.is-light:active,.button.is-light.is-active{background-color:hsl(0,0%,91%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-light[disabled],fieldset[disabled] .button.is-light{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,96%);box-shadow:none}.button.is-light.is-inverted{background-color:rgba(0,0,0,.7);color:hsl(0,0%,96%)}.button.is-light.is-inverted:hover,.button.is-light.is-inverted.is-hovered{background-color:rgba(0,0,0,.7)}.button.is-light.is-inverted[disabled],fieldset[disabled] .button.is-light.is-inverted{background-color:rgba(0,0,0,.7);border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(0,0%,96%)}.button.is-light.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,.7) rgba(0,0,0,.7) !important}.button.is-light.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,96%);color:hsl(0,0%,96%)}.button.is-light.is-outlined:hover,.button.is-light.is-outlined.is-hovered,.button.is-light.is-outlined:focus,.button.is-light.is-outlined.is-focused{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.button.is-light.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,96%) hsl(0,0%,96%) !important}.button.is-light.is-outlined.is-loading:hover::after,.button.is-light.is-outlined.is-loading.is-hovered::after,.button.is-light.is-outlined.is-loading:focus::after,.button.is-light.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,.7) rgba(0,0,0,.7) !important}.button.is-light.is-outlined[disabled],fieldset[disabled] .button.is-light.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,96%);box-shadow:none;color:hsl(0,0%,96%)}.button.is-light.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,.7);color:rgba(0,0,0,.7)}.button.is-light.is-inverted.is-outlined:hover,.button.is-light.is-inverted.is-outlined.is-hovered,.button.is-light.is-inverted.is-outlined:focus,.button.is-light.is-inverted.is-outlined.is-focused{background-color:rgba(0,0,0,.7);color:hsl(0,0%,96%)}.button.is-light.is-inverted.is-outlined.is-loading:hover::after,.button.is-light.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-light.is-inverted.is-outlined.is-loading:focus::after,.button.is-light.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,96%) hsl(0,0%,96%) !important}.button.is-light.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-light.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,.7);box-shadow:none;color:rgba(0,0,0,.7)}.button.is-dark{background-color:hsl(0,0%,21%);border-color:rgba(0,0,0,0);color:#fff}.button.is-dark:hover,.button.is-dark.is-hovered{background-color:hsl(0,0%,18.5%);border-color:rgba(0,0,0,0);color:#fff}.button.is-dark:focus,.button.is-dark.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-dark:focus:not(:active),.button.is-dark.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(0,0%,21%,.25)}.button.is-dark:active,.button.is-dark.is-active{background-color:hsl(0,0%,16%);border-color:rgba(0,0,0,0);color:#fff}.button.is-dark[disabled],fieldset[disabled] .button.is-dark{background-color:hsl(0,0%,21%);border-color:hsl(0,0%,21%);box-shadow:none}.button.is-dark.is-inverted{background-color:#fff;color:hsl(0,0%,21%)}.button.is-dark.is-inverted:hover,.button.is-dark.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-dark.is-inverted[disabled],fieldset[disabled] .button.is-dark.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(0,0%,21%)}.button.is-dark.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-dark.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,21%);color:hsl(0,0%,21%)}.button.is-dark.is-outlined:hover,.button.is-dark.is-outlined.is-hovered,.button.is-dark.is-outlined:focus,.button.is-dark.is-outlined.is-focused{background-color:hsl(0,0%,21%);border-color:hsl(0,0%,21%);color:#fff}.button.is-dark.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,21%) hsl(0,0%,21%) !important}.button.is-dark.is-outlined.is-loading:hover::after,.button.is-dark.is-outlined.is-loading.is-hovered::after,.button.is-dark.is-outlined.is-loading:focus::after,.button.is-dark.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-dark.is-outlined[disabled],fieldset[disabled] .button.is-dark.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(0,0%,21%);box-shadow:none;color:hsl(0,0%,21%)}.button.is-dark.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-dark.is-inverted.is-outlined:hover,.button.is-dark.is-inverted.is-outlined.is-hovered,.button.is-dark.is-inverted.is-outlined:focus,.button.is-dark.is-inverted.is-outlined.is-focused{background-color:#fff;color:hsl(0,0%,21%)}.button.is-dark.is-inverted.is-outlined.is-loading:hover::after,.button.is-dark.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-dark.is-inverted.is-outlined.is-loading:focus::after,.button.is-dark.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(0,0%,21%) hsl(0,0%,21%) !important}.button.is-dark.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-dark.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-primary{background-color:#00875f;border-color:rgba(0,0,0,0);color:#fff}.button.is-primary:hover,.button.is-primary.is-hovered{background-color:rgb(0,122.25,86.0277777778);border-color:rgba(0,0,0,0);color:#fff}.button.is-primary:focus,.button.is-primary.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-primary:focus:not(:active),.button.is-primary.is-focused:not(:active){box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.button.is-primary:active,.button.is-primary.is-active{background-color:rgb(0,109.5,77.0555555556);border-color:rgba(0,0,0,0);color:#fff}.button.is-primary[disabled],fieldset[disabled] .button.is-primary{background-color:#00875f;border-color:#00875f;box-shadow:none}.button.is-primary.is-inverted{background-color:#fff;color:#00875f}.button.is-primary.is-inverted:hover,.button.is-primary.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-primary.is-inverted[disabled],fieldset[disabled] .button.is-primary.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:#00875f}.button.is-primary.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-primary.is-outlined{background-color:rgba(0,0,0,0);border-color:#00875f;color:#00875f}.button.is-primary.is-outlined:hover,.button.is-primary.is-outlined.is-hovered,.button.is-primary.is-outlined:focus,.button.is-primary.is-outlined.is-focused{background-color:#00875f;border-color:#00875f;color:#fff}.button.is-primary.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #00875f #00875f !important}.button.is-primary.is-outlined.is-loading:hover::after,.button.is-primary.is-outlined.is-loading.is-hovered::after,.button.is-primary.is-outlined.is-loading:focus::after,.button.is-primary.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-primary.is-outlined[disabled],fieldset[disabled] .button.is-primary.is-outlined{background-color:rgba(0,0,0,0);border-color:#00875f;box-shadow:none;color:#00875f}.button.is-primary.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-primary.is-inverted.is-outlined:hover,.button.is-primary.is-inverted.is-outlined.is-hovered,.button.is-primary.is-inverted.is-outlined:focus,.button.is-primary.is-inverted.is-outlined.is-focused{background-color:#fff;color:#00875f}.button.is-primary.is-inverted.is-outlined.is-loading:hover::after,.button.is-primary.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-primary.is-inverted.is-outlined.is-loading:focus::after,.button.is-primary.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #00875f #00875f !important}.button.is-primary.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-primary.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-primary.is-light{background-color:hsl(162.2222222222,100%,96%);color:rgb(0,229.5,161.5)}.button.is-primary.is-light:hover,.button.is-primary.is-light.is-hovered{background-color:rgb(221.85,255,245.1777777778);border-color:rgba(0,0,0,0);color:rgb(0,229.5,161.5)}.button.is-primary.is-light:active,.button.is-primary.is-light.is-active{background-color:rgb(209.1,255,241.4);border-color:rgba(0,0,0,0);color:rgb(0,229.5,161.5)}.button.is-link{background-color:hsl(229,53%,53%);border-color:rgba(0,0,0,0);color:#fff}.button.is-link:hover,.button.is-link.is-hovered{background-color:hsl(229,53%,50.5%);border-color:rgba(0,0,0,0);color:#fff}.button.is-link:focus,.button.is-link.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-link:focus:not(:active),.button.is-link.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(229,53%,53%,.25)}.button.is-link:active,.button.is-link.is-active{background-color:hsl(229,53%,48%);border-color:rgba(0,0,0,0);color:#fff}.button.is-link[disabled],fieldset[disabled] .button.is-link{background-color:hsl(229,53%,53%);border-color:hsl(229,53%,53%);box-shadow:none}.button.is-link.is-inverted{background-color:#fff;color:hsl(229,53%,53%)}.button.is-link.is-inverted:hover,.button.is-link.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-link.is-inverted[disabled],fieldset[disabled] .button.is-link.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(229,53%,53%)}.button.is-link.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-link.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(229,53%,53%);color:hsl(229,53%,53%)}.button.is-link.is-outlined:hover,.button.is-link.is-outlined.is-hovered,.button.is-link.is-outlined:focus,.button.is-link.is-outlined.is-focused{background-color:hsl(229,53%,53%);border-color:hsl(229,53%,53%);color:#fff}.button.is-link.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(229,53%,53%) hsl(229,53%,53%) !important}.button.is-link.is-outlined.is-loading:hover::after,.button.is-link.is-outlined.is-loading.is-hovered::after,.button.is-link.is-outlined.is-loading:focus::after,.button.is-link.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-link.is-outlined[disabled],fieldset[disabled] .button.is-link.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(229,53%,53%);box-shadow:none;color:hsl(229,53%,53%)}.button.is-link.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-link.is-inverted.is-outlined:hover,.button.is-link.is-inverted.is-outlined.is-hovered,.button.is-link.is-inverted.is-outlined:focus,.button.is-link.is-inverted.is-outlined.is-focused{background-color:#fff;color:hsl(229,53%,53%)}.button.is-link.is-inverted.is-outlined.is-loading:hover::after,.button.is-link.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-link.is-inverted.is-outlined.is-loading:focus::after,.button.is-link.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(229,53%,53%) hsl(229,53%,53%) !important}.button.is-link.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-link.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-link.is-light{background-color:hsl(229,53%,96%);color:hsl(229,53%,47%)}.button.is-link.is-light:hover,.button.is-link.is-light.is-hovered{background-color:hsl(229,53%,93.5%);border-color:rgba(0,0,0,0);color:hsl(229,53%,47%)}.button.is-link.is-light:active,.button.is-link.is-light.is-active{background-color:hsl(229,53%,91%);border-color:rgba(0,0,0,0);color:hsl(229,53%,47%)}.button.is-info{background-color:hsl(207,61%,53%);border-color:rgba(0,0,0,0);color:#fff}.button.is-info:hover,.button.is-info.is-hovered{background-color:hsl(207,61%,50.5%);border-color:rgba(0,0,0,0);color:#fff}.button.is-info:focus,.button.is-info.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-info:focus:not(:active),.button.is-info.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(207,61%,53%,.25)}.button.is-info:active,.button.is-info.is-active{background-color:hsl(207,61%,48%);border-color:rgba(0,0,0,0);color:#fff}.button.is-info[disabled],fieldset[disabled] .button.is-info{background-color:hsl(207,61%,53%);border-color:hsl(207,61%,53%);box-shadow:none}.button.is-info.is-inverted{background-color:#fff;color:hsl(207,61%,53%)}.button.is-info.is-inverted:hover,.button.is-info.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-info.is-inverted[disabled],fieldset[disabled] .button.is-info.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(207,61%,53%)}.button.is-info.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-info.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(207,61%,53%);color:hsl(207,61%,53%)}.button.is-info.is-outlined:hover,.button.is-info.is-outlined.is-hovered,.button.is-info.is-outlined:focus,.button.is-info.is-outlined.is-focused{background-color:hsl(207,61%,53%);border-color:hsl(207,61%,53%);color:#fff}.button.is-info.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(207,61%,53%) hsl(207,61%,53%) !important}.button.is-info.is-outlined.is-loading:hover::after,.button.is-info.is-outlined.is-loading.is-hovered::after,.button.is-info.is-outlined.is-loading:focus::after,.button.is-info.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-info.is-outlined[disabled],fieldset[disabled] .button.is-info.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(207,61%,53%);box-shadow:none;color:hsl(207,61%,53%)}.button.is-info.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-info.is-inverted.is-outlined:hover,.button.is-info.is-inverted.is-outlined.is-hovered,.button.is-info.is-inverted.is-outlined:focus,.button.is-info.is-inverted.is-outlined.is-focused{background-color:#fff;color:hsl(207,61%,53%)}.button.is-info.is-inverted.is-outlined.is-loading:hover::after,.button.is-info.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-info.is-inverted.is-outlined.is-loading:focus::after,.button.is-info.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(207,61%,53%) hsl(207,61%,53%) !important}.button.is-info.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-info.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-info.is-light{background-color:hsl(207,61%,96%);color:hsl(207,61%,41%)}.button.is-info.is-light:hover,.button.is-info.is-light.is-hovered{background-color:hsl(207,61%,93.5%);border-color:rgba(0,0,0,0);color:hsl(207,61%,41%)}.button.is-info.is-light:active,.button.is-info.is-light.is-active{background-color:hsl(207,61%,91%);border-color:rgba(0,0,0,0);color:hsl(207,61%,41%)}.button.is-success{background-color:hsl(153,53%,53%);border-color:rgba(0,0,0,0);color:#fff}.button.is-success:hover,.button.is-success.is-hovered{background-color:hsl(153,53%,50.5%);border-color:rgba(0,0,0,0);color:#fff}.button.is-success:focus,.button.is-success.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-success:focus:not(:active),.button.is-success.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(153,53%,53%,.25)}.button.is-success:active,.button.is-success.is-active{background-color:hsl(153,53%,48%);border-color:rgba(0,0,0,0);color:#fff}.button.is-success[disabled],fieldset[disabled] .button.is-success{background-color:hsl(153,53%,53%);border-color:hsl(153,53%,53%);box-shadow:none}.button.is-success.is-inverted{background-color:#fff;color:hsl(153,53%,53%)}.button.is-success.is-inverted:hover,.button.is-success.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-success.is-inverted[disabled],fieldset[disabled] .button.is-success.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(153,53%,53%)}.button.is-success.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-success.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(153,53%,53%);color:hsl(153,53%,53%)}.button.is-success.is-outlined:hover,.button.is-success.is-outlined.is-hovered,.button.is-success.is-outlined:focus,.button.is-success.is-outlined.is-focused{background-color:hsl(153,53%,53%);border-color:hsl(153,53%,53%);color:#fff}.button.is-success.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(153,53%,53%) hsl(153,53%,53%) !important}.button.is-success.is-outlined.is-loading:hover::after,.button.is-success.is-outlined.is-loading.is-hovered::after,.button.is-success.is-outlined.is-loading:focus::after,.button.is-success.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-success.is-outlined[disabled],fieldset[disabled] .button.is-success.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(153,53%,53%);box-shadow:none;color:hsl(153,53%,53%)}.button.is-success.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-success.is-inverted.is-outlined:hover,.button.is-success.is-inverted.is-outlined.is-hovered,.button.is-success.is-inverted.is-outlined:focus,.button.is-success.is-inverted.is-outlined.is-focused{background-color:#fff;color:hsl(153,53%,53%)}.button.is-success.is-inverted.is-outlined.is-loading:hover::after,.button.is-success.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-success.is-inverted.is-outlined.is-loading:focus::after,.button.is-success.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(153,53%,53%) hsl(153,53%,53%) !important}.button.is-success.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-success.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-success.is-light{background-color:hsl(153,53%,96%);color:hsl(153,53%,31%)}.button.is-success.is-light:hover,.button.is-success.is-light.is-hovered{background-color:hsl(153,53%,93.5%);border-color:rgba(0,0,0,0);color:hsl(153,53%,31%)}.button.is-success.is-light:active,.button.is-success.is-light.is-active{background-color:hsl(153,53%,91%);border-color:rgba(0,0,0,0);color:hsl(153,53%,31%)}.button.is-warning{background-color:hsl(44,100%,77%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-warning:hover,.button.is-warning.is-hovered{background-color:hsl(44,100%,74.5%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-warning:focus,.button.is-warning.is-focused{border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-warning:focus:not(:active),.button.is-warning.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(44,100%,77%,.25)}.button.is-warning:active,.button.is-warning.is-active{background-color:hsl(44,100%,72%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.button.is-warning[disabled],fieldset[disabled] .button.is-warning{background-color:hsl(44,100%,77%);border-color:hsl(44,100%,77%);box-shadow:none}.button.is-warning.is-inverted{background-color:rgba(0,0,0,.7);color:hsl(44,100%,77%)}.button.is-warning.is-inverted:hover,.button.is-warning.is-inverted.is-hovered{background-color:rgba(0,0,0,.7)}.button.is-warning.is-inverted[disabled],fieldset[disabled] .button.is-warning.is-inverted{background-color:rgba(0,0,0,.7);border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(44,100%,77%)}.button.is-warning.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,.7) rgba(0,0,0,.7) !important}.button.is-warning.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(44,100%,77%);color:hsl(44,100%,77%)}.button.is-warning.is-outlined:hover,.button.is-warning.is-outlined.is-hovered,.button.is-warning.is-outlined:focus,.button.is-warning.is-outlined.is-focused{background-color:hsl(44,100%,77%);border-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.button.is-warning.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(44,100%,77%) hsl(44,100%,77%) !important}.button.is-warning.is-outlined.is-loading:hover::after,.button.is-warning.is-outlined.is-loading.is-hovered::after,.button.is-warning.is-outlined.is-loading:focus::after,.button.is-warning.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,.7) rgba(0,0,0,.7) !important}.button.is-warning.is-outlined[disabled],fieldset[disabled] .button.is-warning.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(44,100%,77%);box-shadow:none;color:hsl(44,100%,77%)}.button.is-warning.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,.7);color:rgba(0,0,0,.7)}.button.is-warning.is-inverted.is-outlined:hover,.button.is-warning.is-inverted.is-outlined.is-hovered,.button.is-warning.is-inverted.is-outlined:focus,.button.is-warning.is-inverted.is-outlined.is-focused{background-color:rgba(0,0,0,.7);color:hsl(44,100%,77%)}.button.is-warning.is-inverted.is-outlined.is-loading:hover::after,.button.is-warning.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-warning.is-inverted.is-outlined.is-loading:focus::after,.button.is-warning.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(44,100%,77%) hsl(44,100%,77%) !important}.button.is-warning.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-warning.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,.7);box-shadow:none;color:rgba(0,0,0,.7)}.button.is-warning.is-light{background-color:hsl(44,100%,96%);color:hsl(44,100%,29%)}.button.is-warning.is-light:hover,.button.is-warning.is-light.is-hovered{background-color:hsl(44,100%,93.5%);border-color:rgba(0,0,0,0);color:hsl(44,100%,29%)}.button.is-warning.is-light:active,.button.is-warning.is-light.is-active{background-color:hsl(44,100%,91%);border-color:rgba(0,0,0,0);color:hsl(44,100%,29%)}.button.is-danger{background-color:hsl(348,86%,61%);border-color:rgba(0,0,0,0);color:#fff}.button.is-danger:hover,.button.is-danger.is-hovered{background-color:hsl(348,86%,58.5%);border-color:rgba(0,0,0,0);color:#fff}.button.is-danger:focus,.button.is-danger.is-focused{border-color:rgba(0,0,0,0);color:#fff}.button.is-danger:focus:not(:active),.button.is-danger.is-focused:not(:active){box-shadow:0 0 0 .125em hsla(348,86%,61%,.25)}.button.is-danger:active,.button.is-danger.is-active{background-color:hsl(348,86%,56%);border-color:rgba(0,0,0,0);color:#fff}.button.is-danger[disabled],fieldset[disabled] .button.is-danger{background-color:hsl(348,86%,61%);border-color:hsl(348,86%,61%);box-shadow:none}.button.is-danger.is-inverted{background-color:#fff;color:hsl(348,86%,61%)}.button.is-danger.is-inverted:hover,.button.is-danger.is-inverted.is-hovered{background-color:hsl(0,0%,95%)}.button.is-danger.is-inverted[disabled],fieldset[disabled] .button.is-danger.is-inverted{background-color:#fff;border-color:rgba(0,0,0,0);box-shadow:none;color:hsl(348,86%,61%)}.button.is-danger.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-danger.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(348,86%,61%);color:hsl(348,86%,61%)}.button.is-danger.is-outlined:hover,.button.is-danger.is-outlined.is-hovered,.button.is-danger.is-outlined:focus,.button.is-danger.is-outlined.is-focused{background-color:hsl(348,86%,61%);border-color:hsl(348,86%,61%);color:#fff}.button.is-danger.is-outlined.is-loading::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(348,86%,61%) hsl(348,86%,61%) !important}.button.is-danger.is-outlined.is-loading:hover::after,.button.is-danger.is-outlined.is-loading.is-hovered::after,.button.is-danger.is-outlined.is-loading:focus::after,.button.is-danger.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #fff #fff !important}.button.is-danger.is-outlined[disabled],fieldset[disabled] .button.is-danger.is-outlined{background-color:rgba(0,0,0,0);border-color:hsl(348,86%,61%);box-shadow:none;color:hsl(348,86%,61%)}.button.is-danger.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;color:#fff}.button.is-danger.is-inverted.is-outlined:hover,.button.is-danger.is-inverted.is-outlined.is-hovered,.button.is-danger.is-inverted.is-outlined:focus,.button.is-danger.is-inverted.is-outlined.is-focused{background-color:#fff;color:hsl(348,86%,61%)}.button.is-danger.is-inverted.is-outlined.is-loading:hover::after,.button.is-danger.is-inverted.is-outlined.is-loading.is-hovered::after,.button.is-danger.is-inverted.is-outlined.is-loading:focus::after,.button.is-danger.is-inverted.is-outlined.is-loading.is-focused::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) hsl(348,86%,61%) hsl(348,86%,61%) !important}.button.is-danger.is-inverted.is-outlined[disabled],fieldset[disabled] .button.is-danger.is-inverted.is-outlined{background-color:rgba(0,0,0,0);border-color:#fff;box-shadow:none;color:#fff}.button.is-danger.is-light{background-color:hsl(348,86%,96%);color:hsl(348,86%,43%)}.button.is-danger.is-light:hover,.button.is-danger.is-light.is-hovered{background-color:hsl(348,86%,93.5%);border-color:rgba(0,0,0,0);color:hsl(348,86%,43%)}.button.is-danger.is-light:active,.button.is-danger.is-light.is-active{background-color:hsl(348,86%,91%);border-color:rgba(0,0,0,0);color:hsl(348,86%,43%)}.button.is-small:not(.is-rounded){border-radius:2px}.button.is-small{font-size:.75rem}.button.is-normal{font-size:1rem}.button.is-medium{font-size:1.25rem}.button.is-large{font-size:1.5rem}.button[disabled],fieldset[disabled] .button{background-color:#fff;border-color:hsl(0,0%,86%);box-shadow:none;opacity:.5}.button.is-fullwidth{display:flex;width:100%}.button.is-loading{color:rgba(0,0,0,0) !important;pointer-events:none}.button.is-loading::after{position:absolute;left:calc(50% - 1em*.5);top:calc(50% - 1em*.5);position:absolute !important}.button.is-static{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,86%);color:hsl(0,0%,48%);box-shadow:none;pointer-events:none}.button.is-rounded{border-radius:9999px;padding-left:calc(1em + .25em);padding-right:calc(1em + .25em)}.buttons{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.buttons .button{margin-bottom:.5rem}.buttons .button:not(:last-child):not(.is-fullwidth){margin-right:.5rem}.buttons:last-child{margin-bottom:-0.5rem}.buttons:not(:last-child){margin-bottom:1rem}.buttons.are-small .button:not(.is-normal):not(.is-medium):not(.is-large):not(.is-rounded){border-radius:2px}.buttons.are-small .button:not(.is-normal):not(.is-medium):not(.is-large){font-size:.75rem}.buttons.are-medium .button:not(.is-small):not(.is-normal):not(.is-large){font-size:1.25rem}.buttons.are-large .button:not(.is-small):not(.is-normal):not(.is-medium){font-size:1.5rem}.buttons.has-addons .button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.buttons.has-addons .button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.buttons.has-addons .button:last-child{margin-right:0}.buttons.has-addons .button:hover,.buttons.has-addons .button.is-hovered{z-index:2}.buttons.has-addons .button:focus,.buttons.has-addons .button.is-focused,.buttons.has-addons .button:active,.buttons.has-addons .button.is-active,.buttons.has-addons .button.is-selected{z-index:3}.buttons.has-addons .button:focus:hover,.buttons.has-addons .button.is-focused:hover,.buttons.has-addons .button:active:hover,.buttons.has-addons .button.is-active:hover,.buttons.has-addons .button.is-selected:hover{z-index:4}.buttons.has-addons .button.is-expanded{flex-grow:1;flex-shrink:1}.buttons.is-centered{justify-content:center}.buttons.is-centered:not(.has-addons) .button:not(.is-fullwidth){margin-left:.25rem;margin-right:.25rem}.buttons.is-right{justify-content:flex-end}.buttons.is-right:not(.has-addons) .button:not(.is-fullwidth){margin-left:.25rem;margin-right:.25rem}@media screen and (max-width: 768px){.button.is-responsive.is-small{font-size:.5625rem}.button.is-responsive,.button.is-responsive.is-normal{font-size:.65625rem}.button.is-responsive.is-medium{font-size:.75rem}.button.is-responsive.is-large{font-size:1rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.button.is-responsive.is-small{font-size:.65625rem}.button.is-responsive,.button.is-responsive.is-normal{font-size:.75rem}.button.is-responsive.is-medium{font-size:1rem}.button.is-responsive.is-large{font-size:1.25rem}}.container{flex-grow:1;margin:0 auto;position:relative;width:auto}.container.is-fluid{max-width:none !important;padding-left:32px;padding-right:32px;width:100%}@media screen and (min-width: 1024px){.container{max-width:960px}}@media screen and (max-width: 1215px){.container.is-widescreen:not(.is-max-desktop){max-width:1152px}}@media screen and (max-width: 1407px){.container.is-fullhd:not(.is-max-desktop):not(.is-max-widescreen){max-width:1344px}}@media screen and (min-width: 1216px){.container:not(.is-max-desktop){max-width:1152px}}@media screen and (min-width: 1408px){.container:not(.is-max-desktop):not(.is-max-widescreen){max-width:1344px}}.content li+li{margin-top:.25em}.content p:not(:last-child),.content dl:not(:last-child),.content ol:not(:last-child),.content ul:not(:last-child),.content blockquote:not(:last-child),.content pre:not(:last-child),.content table:not(:last-child){margin-bottom:1em}.content h1,.content h2,.content h3,.content h4,.content h5,.content h6{color:hsl(0,0%,21%);font-weight:600;line-height:1.125}.content h1{font-size:2em;margin-bottom:.5em}.content h1:not(:first-child){margin-top:1em}.content h2{font-size:1.75em;margin-bottom:.5714em}.content h2:not(:first-child){margin-top:1.1428em}.content h3{font-size:1.5em;margin-bottom:.6666em}.content h3:not(:first-child){margin-top:1.3333em}.content h4{font-size:1.25em;margin-bottom:.8em}.content h5{font-size:1.125em;margin-bottom:.8888em}.content h6{font-size:1em;margin-bottom:1em}.content blockquote{background-color:hsl(0,0%,96%);border-left:5px solid hsl(0,0%,86%);padding:1.25em 1.5em}.content ol{list-style-position:outside;margin-left:2em;margin-top:1em}.content ol:not([type]){list-style-type:decimal}.content ol:not([type]).is-lower-alpha{list-style-type:lower-alpha}.content ol:not([type]).is-lower-roman{list-style-type:lower-roman}.content ol:not([type]).is-upper-alpha{list-style-type:upper-alpha}.content ol:not([type]).is-upper-roman{list-style-type:upper-roman}.content ul{list-style:disc outside;margin-left:2em;margin-top:1em}.content ul ul{list-style-type:circle;margin-top:.5em}.content ul ul ul{list-style-type:square}.content dd{margin-left:2em}.content figure{margin-left:2em;margin-right:2em;text-align:center}.content figure:not(:first-child){margin-top:2em}.content figure:not(:last-child){margin-bottom:2em}.content figure img{display:inline-block}.content figure figcaption{font-style:italic}.content pre{-webkit-overflow-scrolling:touch;overflow-x:auto;padding:1.25em 1.5em;white-space:pre;word-wrap:normal}.content sup,.content sub{font-size:75%}.content table{width:100%}.content table td,.content table th{border:1px solid hsl(0,0%,86%);border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.content table th{color:hsl(0,0%,21%)}.content table th:not([align]){text-align:inherit}.content table thead td,.content table thead th{border-width:0 0 2px;color:hsl(0,0%,21%)}.content table tfoot td,.content table tfoot th{border-width:2px 0 0;color:hsl(0,0%,21%)}.content table tbody tr:last-child td,.content table tbody tr:last-child th{border-bottom-width:0}.content .tabs li+li{margin-top:0}.content.is-small{font-size:.75rem}.content.is-normal{font-size:1rem}.content.is-medium{font-size:1.25rem}.content.is-large{font-size:1.5rem}.icon{align-items:center;display:inline-flex;justify-content:center;height:1.5rem;width:1.5rem}.icon.is-small{height:1rem;width:1rem}.icon.is-medium{height:2rem;width:2rem}.icon.is-large{height:3rem;width:3rem}.icon-text{align-items:flex-start;color:inherit;display:inline-flex;flex-wrap:wrap;line-height:1.5rem;vertical-align:top}.icon-text .icon{flex-grow:0;flex-shrink:0}.icon-text .icon:not(:last-child){margin-right:.25em}.icon-text .icon:not(:first-child){margin-left:.25em}div.icon-text{display:flex}.image{display:block;position:relative}.image img{display:block;height:auto;width:100%}.image img.is-rounded{border-radius:9999px}.image.is-fullwidth{width:100%}.image.is-square img,.image.is-square .has-ratio,.image.is-1by1 img,.image.is-1by1 .has-ratio,.image.is-5by4 img,.image.is-5by4 .has-ratio,.image.is-4by3 img,.image.is-4by3 .has-ratio,.image.is-3by2 img,.image.is-3by2 .has-ratio,.image.is-5by3 img,.image.is-5by3 .has-ratio,.image.is-16by9 img,.image.is-16by9 .has-ratio,.image.is-2by1 img,.image.is-2by1 .has-ratio,.image.is-3by1 img,.image.is-3by1 .has-ratio,.image.is-4by5 img,.image.is-4by5 .has-ratio,.image.is-3by4 img,.image.is-3by4 .has-ratio,.image.is-2by3 img,.image.is-2by3 .has-ratio,.image.is-3by5 img,.image.is-3by5 .has-ratio,.image.is-9by16 img,.image.is-9by16 .has-ratio,.image.is-1by2 img,.image.is-1by2 .has-ratio,.image.is-1by3 img,.image.is-1by3 .has-ratio{height:100%;width:100%}.image.is-square,.image.is-1by1{padding-top:100%}.image.is-5by4{padding-top:80%}.image.is-4by3{padding-top:75%}.image.is-3by2{padding-top:66.6666%}.image.is-5by3{padding-top:60%}.image.is-16by9{padding-top:56.25%}.image.is-2by1{padding-top:50%}.image.is-3by1{padding-top:33.3333%}.image.is-4by5{padding-top:125%}.image.is-3by4{padding-top:133.3333%}.image.is-2by3{padding-top:150%}.image.is-3by5{padding-top:166.6666%}.image.is-9by16{padding-top:177.7777%}.image.is-1by2{padding-top:200%}.image.is-1by3{padding-top:300%}.image.is-16x16{height:16px;width:16px}.image.is-24x24{height:24px;width:24px}.image.is-32x32{height:32px;width:32px}.image.is-48x48{height:48px;width:48px}.image.is-64x64{height:64px;width:64px}.image.is-96x96{height:96px;width:96px}.image.is-128x128{height:128px;width:128px}.notification{background-color:hsl(0,0%,96%);border-radius:4px;position:relative;padding:1.25rem 2.5rem 1.25rem 1.5rem}.notification a:not(.button):not(.dropdown-item){color:currentColor;text-decoration:underline}.notification strong{color:currentColor}.notification code,.notification pre{background:#fff}.notification pre code{background:rgba(0,0,0,0)}.notification>.delete{right:.5rem;position:absolute;top:.5rem}.notification .title,.notification .subtitle,.notification .content{color:currentColor}.notification.is-white{background-color:#fff;color:hsl(0,0%,4%)}.notification.is-black{background-color:hsl(0,0%,4%);color:#fff}.notification.is-light{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.notification.is-dark{background-color:hsl(0,0%,21%);color:#fff}.notification.is-primary{background-color:#00875f;color:#fff}.notification.is-primary.is-light{background-color:hsl(162.2222222222,100%,96%);color:rgb(0,229.5,161.5)}.notification.is-link{background-color:hsl(229,53%,53%);color:#fff}.notification.is-link.is-light{background-color:hsl(229,53%,96%);color:hsl(229,53%,47%)}.notification.is-info{background-color:hsl(207,61%,53%);color:#fff}.notification.is-info.is-light{background-color:hsl(207,61%,96%);color:hsl(207,61%,41%)}.notification.is-success{background-color:hsl(153,53%,53%);color:#fff}.notification.is-success.is-light{background-color:hsl(153,53%,96%);color:hsl(153,53%,31%)}.notification.is-warning{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.notification.is-warning.is-light{background-color:hsl(44,100%,96%);color:hsl(44,100%,29%)}.notification.is-danger{background-color:hsl(348,86%,61%);color:#fff}.notification.is-danger.is-light{background-color:hsl(348,86%,96%);color:hsl(348,86%,43%)}.progress,.progress-wrapper.is-not-native{-moz-appearance:none;-webkit-appearance:none;border:none;border-radius:9999px;display:block;height:1rem;overflow:hidden;padding:0;width:100%}.progress::-webkit-progress-bar,.progress-wrapper.is-not-native::-webkit-progress-bar{background-color:hsl(0,0%,93%)}.progress::-webkit-progress-value,.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(0,0%,29%)}.progress::-moz-progress-bar,.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(0,0%,29%)}.progress::-ms-fill,.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(0,0%,29%);border:none}.progress.is-white::-webkit-progress-value,.is-white.progress-wrapper.is-not-native::-webkit-progress-value{background-color:#fff}.progress.is-white::-moz-progress-bar,.is-white.progress-wrapper.is-not-native::-moz-progress-bar{background-color:#fff}.progress.is-white::-ms-fill,.is-white.progress-wrapper.is-not-native::-ms-fill{background-color:#fff}.progress.is-white:indeterminate,.is-white.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(0, 0%, 100%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-black::-webkit-progress-value,.is-black.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(0,0%,4%)}.progress.is-black::-moz-progress-bar,.is-black.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(0,0%,4%)}.progress.is-black::-ms-fill,.is-black.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(0,0%,4%)}.progress.is-black:indeterminate,.is-black.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(0, 0%, 4%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-light::-webkit-progress-value,.is-light.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(0,0%,96%)}.progress.is-light::-moz-progress-bar,.is-light.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(0,0%,96%)}.progress.is-light::-ms-fill,.is-light.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(0,0%,96%)}.progress.is-light:indeterminate,.is-light.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(0, 0%, 96%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-dark::-webkit-progress-value,.is-dark.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(0,0%,21%)}.progress.is-dark::-moz-progress-bar,.is-dark.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(0,0%,21%)}.progress.is-dark::-ms-fill,.is-dark.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(0,0%,21%)}.progress.is-dark:indeterminate,.is-dark.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(0, 0%, 21%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-primary::-webkit-progress-value,.is-primary.progress-wrapper.is-not-native::-webkit-progress-value{background-color:#00875f}.progress.is-primary::-moz-progress-bar,.is-primary.progress-wrapper.is-not-native::-moz-progress-bar{background-color:#00875f}.progress.is-primary::-ms-fill,.is-primary.progress-wrapper.is-not-native::-ms-fill{background-color:#00875f}.progress.is-primary:indeterminate,.is-primary.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, rgb(0, 135, 95) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-link::-webkit-progress-value,.is-link.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(229,53%,53%)}.progress.is-link::-moz-progress-bar,.is-link.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(229,53%,53%)}.progress.is-link::-ms-fill,.is-link.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(229,53%,53%)}.progress.is-link:indeterminate,.is-link.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(229, 53%, 53%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-info::-webkit-progress-value,.is-info.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(207,61%,53%)}.progress.is-info::-moz-progress-bar,.is-info.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(207,61%,53%)}.progress.is-info::-ms-fill,.is-info.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(207,61%,53%)}.progress.is-info:indeterminate,.is-info.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(207, 61%, 53%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-success::-webkit-progress-value,.is-success.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(153,53%,53%)}.progress.is-success::-moz-progress-bar,.is-success.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(153,53%,53%)}.progress.is-success::-ms-fill,.is-success.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(153,53%,53%)}.progress.is-success:indeterminate,.is-success.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(153, 53%, 53%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-warning::-webkit-progress-value,.is-warning.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(44,100%,77%)}.progress.is-warning::-moz-progress-bar,.is-warning.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(44,100%,77%)}.progress.is-warning::-ms-fill,.is-warning.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(44,100%,77%)}.progress.is-warning:indeterminate,.is-warning.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(44, 100%, 77%) 30%, hsl(0, 0%, 93%) 30%)}.progress.is-danger::-webkit-progress-value,.is-danger.progress-wrapper.is-not-native::-webkit-progress-value{background-color:hsl(348,86%,61%)}.progress.is-danger::-moz-progress-bar,.is-danger.progress-wrapper.is-not-native::-moz-progress-bar{background-color:hsl(348,86%,61%)}.progress.is-danger::-ms-fill,.is-danger.progress-wrapper.is-not-native::-ms-fill{background-color:hsl(348,86%,61%)}.progress.is-danger:indeterminate,.is-danger.progress-wrapper.is-not-native:indeterminate{background-image:linear-gradient(to right, hsl(348, 86%, 61%) 30%, hsl(0, 0%, 93%) 30%)}.progress:indeterminate,.progress-wrapper.is-not-native:indeterminate{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:moveIndeterminate;animation-timing-function:linear;background-color:hsl(0,0%,93%);background-image:linear-gradient(to right, hsl(0, 0%, 29%) 30%, hsl(0, 0%, 93%) 30%);background-position:top left;background-repeat:no-repeat;background-size:150% 150%}.progress:indeterminate::-webkit-progress-bar,.progress-wrapper.is-not-native:indeterminate::-webkit-progress-bar{background-color:rgba(0,0,0,0)}.progress:indeterminate::-moz-progress-bar,.progress-wrapper.is-not-native:indeterminate::-moz-progress-bar{background-color:rgba(0,0,0,0)}.progress:indeterminate::-ms-fill,.progress-wrapper.is-not-native:indeterminate::-ms-fill{animation-name:none}.progress.is-small,.is-small.progress-wrapper.is-not-native{height:.75rem}.progress.is-medium,.is-medium.progress-wrapper.is-not-native{height:1.25rem}.progress.is-large,.is-large.progress-wrapper.is-not-native{height:1.5rem}@keyframes moveIndeterminate{from{background-position:200% 0}to{background-position:-200% 0}}.table{background-color:#fff;color:hsl(0,0%,21%)}.table td,.table th{border:1px solid hsl(0,0%,86%);border-width:0 0 1px;padding:.5em .75em;vertical-align:top}.table td.is-white,.table th.is-white{background-color:#fff;border-color:#fff;color:hsl(0,0%,4%)}.table td.is-black,.table th.is-black{background-color:hsl(0,0%,4%);border-color:hsl(0,0%,4%);color:#fff}.table td.is-light,.table th.is-light{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.table td.is-dark,.table th.is-dark{background-color:hsl(0,0%,21%);border-color:hsl(0,0%,21%);color:#fff}.table td.is-primary,.table th.is-primary{background-color:#00875f;border-color:#00875f;color:#fff}.table td.is-link,.table th.is-link{background-color:hsl(229,53%,53%);border-color:hsl(229,53%,53%);color:#fff}.table td.is-info,.table th.is-info{background-color:hsl(207,61%,53%);border-color:hsl(207,61%,53%);color:#fff}.table td.is-success,.table th.is-success{background-color:hsl(153,53%,53%);border-color:hsl(153,53%,53%);color:#fff}.table td.is-warning,.table th.is-warning{background-color:hsl(44,100%,77%);border-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.table td.is-danger,.table th.is-danger{background-color:hsl(348,86%,61%);border-color:hsl(348,86%,61%);color:#fff}.table td.is-narrow,.table th.is-narrow{white-space:nowrap;width:1%}.table td.is-selected,.table th.is-selected{background-color:#00875f;color:#fff}.table td.is-selected a,.table td.is-selected strong,.table th.is-selected a,.table th.is-selected strong{color:currentColor}.table td.is-vcentered,.table th.is-vcentered{vertical-align:middle}.table th{color:hsl(0,0%,21%)}.table th:not([align]){text-align:left}.table tr.is-selected{background-color:#00875f;color:#fff}.table tr.is-selected a,.table tr.is-selected strong{color:currentColor}.table tr.is-selected td,.table tr.is-selected th{border-color:#fff;color:currentColor}.table thead{background-color:rgba(0,0,0,0)}.table thead td,.table thead th{border-width:0 0 2px;color:hsl(0,0%,21%)}.table tfoot{background-color:rgba(0,0,0,0)}.table tfoot td,.table tfoot th{border-width:2px 0 0;color:hsl(0,0%,21%)}.table tbody{background-color:rgba(0,0,0,0)}.table tbody tr:last-child td,.table tbody tr:last-child th{border-bottom-width:0}.table.is-bordered td,.table.is-bordered th{border-width:1px}.table.is-bordered tr:last-child td,.table.is-bordered tr:last-child th{border-bottom-width:1px}.table.is-fullwidth{width:100%}.table.is-hoverable tbody tr:not(.is-selected):hover{background-color:hsl(0,0%,98%)}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover{background-color:hsl(0,0%,98%)}.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover:nth-child(even){background-color:hsl(0,0%,96%)}.table.is-narrow td,.table.is-narrow th{padding:.25em .5em}.table.is-striped tbody tr:not(.is-selected):nth-child(even){background-color:hsl(0,0%,98%)}.table-container{-webkit-overflow-scrolling:touch;overflow:auto;overflow-y:hidden;max-width:100%}.tags{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.tags .tag{margin-bottom:.5rem}.tags .tag:not(:last-child){margin-right:.5rem}.tags:last-child{margin-bottom:-0.5rem}.tags:not(:last-child){margin-bottom:1rem}.tags.are-medium .tag:not(.is-normal):not(.is-large){font-size:1rem}.tags.are-large .tag:not(.is-normal):not(.is-medium){font-size:1.25rem}.tags.is-centered{justify-content:center}.tags.is-centered .tag{margin-right:.25rem;margin-left:.25rem}.tags.is-right{justify-content:flex-end}.tags.is-right .tag:not(:first-child){margin-left:.5rem}.tags.is-right .tag:not(:last-child){margin-right:0}.tags.has-addons .tag{margin-right:0}.tags.has-addons .tag:not(:first-child){margin-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.tags.has-addons .tag:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.tag:not(body){align-items:center;background-color:hsl(0,0%,96%);border-radius:4px;color:hsl(0,0%,29%);display:inline-flex;font-size:.75rem;height:2em;justify-content:center;line-height:1.5;padding-left:.75em;padding-right:.75em;white-space:nowrap}.tag:not(body) .delete{margin-left:.25rem;margin-right:-0.375rem}.tag:not(body).is-white{background-color:#fff;color:hsl(0,0%,4%)}.tag:not(body).is-black{background-color:hsl(0,0%,4%);color:#fff}.tag:not(body).is-light{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.tag:not(body).is-dark{background-color:hsl(0,0%,21%);color:#fff}.tag:not(body).is-primary{background-color:#00875f;color:#fff}.tag:not(body).is-primary.is-light{background-color:hsl(162.2222222222,100%,96%);color:rgb(0,229.5,161.5)}.tag:not(body).is-link{background-color:hsl(229,53%,53%);color:#fff}.tag:not(body).is-link.is-light{background-color:hsl(229,53%,96%);color:hsl(229,53%,47%)}.tag:not(body).is-info{background-color:hsl(207,61%,53%);color:#fff}.tag:not(body).is-info.is-light{background-color:hsl(207,61%,96%);color:hsl(207,61%,41%)}.tag:not(body).is-success{background-color:hsl(153,53%,53%);color:#fff}.tag:not(body).is-success.is-light{background-color:hsl(153,53%,96%);color:hsl(153,53%,31%)}.tag:not(body).is-warning{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.tag:not(body).is-warning.is-light{background-color:hsl(44,100%,96%);color:hsl(44,100%,29%)}.tag:not(body).is-danger{background-color:hsl(348,86%,61%);color:#fff}.tag:not(body).is-danger.is-light{background-color:hsl(348,86%,96%);color:hsl(348,86%,43%)}.tag:not(body).is-normal{font-size:.75rem}.tag:not(body).is-medium{font-size:1rem}.tag:not(body).is-large{font-size:1.25rem}.tag:not(body) .icon:first-child:not(:last-child){margin-left:-0.375em;margin-right:.1875em}.tag:not(body) .icon:last-child:not(:first-child){margin-left:.1875em;margin-right:-0.375em}.tag:not(body) .icon:first-child:last-child{margin-left:-0.375em;margin-right:-0.375em}.tag:not(body).is-delete{margin-left:1px;padding:0;position:relative;width:2em}.tag:not(body).is-delete::before,.tag:not(body).is-delete::after{background-color:currentColor;content:"";display:block;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) rotate(45deg);transform-origin:center center}.tag:not(body).is-delete::before{height:1px;width:50%}.tag:not(body).is-delete::after{height:50%;width:1px}.tag:not(body).is-delete:hover,.tag:not(body).is-delete:focus{background-color:hsl(0,0%,91%)}.tag:not(body).is-delete:active{background-color:hsl(0,0%,86%)}.tag:not(body).is-rounded{border-radius:9999px}a.tag:hover{text-decoration:underline}.title,.subtitle{word-break:break-word}.title em,.title span,.subtitle em,.subtitle span{font-weight:inherit}.title sub,.subtitle sub{font-size:.75em}.title sup,.subtitle sup{font-size:.75em}.title .tag,.subtitle .tag{vertical-align:middle}.title{color:hsl(0,0%,21%);font-size:2rem;font-weight:600;line-height:1.125}.title strong{color:inherit;font-weight:inherit}.title:not(.is-spaced)+.subtitle{margin-top:-1.25rem}.title.is-1{font-size:3rem}.title.is-2{font-size:2.5rem}.title.is-3{font-size:2rem}.title.is-4{font-size:1.5rem}.title.is-5{font-size:1.25rem}.title.is-6{font-size:1rem}.title.is-7{font-size:.75rem}.subtitle{color:hsl(0,0%,29%);font-size:1.25rem;font-weight:400;line-height:1.25}.subtitle strong{color:hsl(0,0%,21%);font-weight:600}.subtitle:not(.is-spaced)+.title{margin-top:-1.25rem}.subtitle.is-1{font-size:3rem}.subtitle.is-2{font-size:2.5rem}.subtitle.is-3{font-size:2rem}.subtitle.is-4{font-size:1.5rem}.subtitle.is-5{font-size:1.25rem}.subtitle.is-6{font-size:1rem}.subtitle.is-7{font-size:.75rem}.heading{display:block;font-size:11px;letter-spacing:1px;margin-bottom:5px;text-transform:uppercase}.number{align-items:center;background-color:hsl(0,0%,96%);border-radius:9999px;display:inline-flex;font-size:1.25rem;height:2em;justify-content:center;margin-right:1.5rem;min-width:2.5em;padding:.25rem .5rem;text-align:center;vertical-align:top}.select select,.taginput .taginput-container.is-focusable,.textarea,.input{background-color:#fff;border-color:hsl(0,0%,86%);border-radius:4px;color:hsl(0,0%,21%)}.select select::-moz-placeholder,.taginput .taginput-container.is-focusable::-moz-placeholder,.textarea::-moz-placeholder,.input::-moz-placeholder{color:hsla(0,0%,21%,.3)}.select select::-webkit-input-placeholder,.taginput .taginput-container.is-focusable::-webkit-input-placeholder,.textarea::-webkit-input-placeholder,.input::-webkit-input-placeholder{color:hsla(0,0%,21%,.3)}.select select:-moz-placeholder,.taginput .taginput-container.is-focusable:-moz-placeholder,.textarea:-moz-placeholder,.input:-moz-placeholder{color:hsla(0,0%,21%,.3)}.select select:-ms-input-placeholder,.taginput .taginput-container.is-focusable:-ms-input-placeholder,.textarea:-ms-input-placeholder,.input:-ms-input-placeholder{color:hsla(0,0%,21%,.3)}.select select:hover,.taginput .taginput-container.is-focusable:hover,.textarea:hover,.input:hover,.select select.is-hovered,.taginput .is-hovered.taginput-container.is-focusable,.is-hovered.textarea,.is-hovered.input{border-color:hsl(0,0%,71%)}.select select:focus,.taginput .taginput-container.is-focusable:focus,.textarea:focus,.input:focus,.select select.is-focused,.taginput .is-focused.taginput-container.is-focusable,.is-focused.textarea,.is-focused.input,.select select:active,.taginput .taginput-container.is-focusable:active,.textarea:active,.input:active,.select select.is-active,.taginput .is-active.taginput-container.is-focusable,.is-active.textarea,.is-active.input{border-color:#00875f;box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.select select[disabled],.taginput [disabled].taginput-container.is-focusable,[disabled].textarea,[disabled].input,fieldset[disabled] .select select,.select fieldset[disabled] select,fieldset[disabled] .taginput .taginput-container.is-focusable,.taginput fieldset[disabled] .taginput-container.is-focusable,fieldset[disabled] .textarea,fieldset[disabled] .input{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,96%);box-shadow:none;color:hsl(0,0%,48%)}.select select[disabled]::-moz-placeholder,.taginput [disabled].taginput-container.is-focusable::-moz-placeholder,[disabled].textarea::-moz-placeholder,[disabled].input::-moz-placeholder,fieldset[disabled] .select select::-moz-placeholder,.select fieldset[disabled] select::-moz-placeholder,fieldset[disabled] .taginput .taginput-container.is-focusable::-moz-placeholder,.taginput fieldset[disabled] .taginput-container.is-focusable::-moz-placeholder,fieldset[disabled] .textarea::-moz-placeholder,fieldset[disabled] .input::-moz-placeholder{color:hsla(0,0%,48%,.3)}.select select[disabled]::-webkit-input-placeholder,.taginput [disabled].taginput-container.is-focusable::-webkit-input-placeholder,[disabled].textarea::-webkit-input-placeholder,[disabled].input::-webkit-input-placeholder,fieldset[disabled] .select select::-webkit-input-placeholder,.select fieldset[disabled] select::-webkit-input-placeholder,fieldset[disabled] .taginput .taginput-container.is-focusable::-webkit-input-placeholder,.taginput fieldset[disabled] .taginput-container.is-focusable::-webkit-input-placeholder,fieldset[disabled] .textarea::-webkit-input-placeholder,fieldset[disabled] .input::-webkit-input-placeholder{color:hsla(0,0%,48%,.3)}.select select[disabled]:-moz-placeholder,.taginput [disabled].taginput-container.is-focusable:-moz-placeholder,[disabled].textarea:-moz-placeholder,[disabled].input:-moz-placeholder,fieldset[disabled] .select select:-moz-placeholder,.select fieldset[disabled] select:-moz-placeholder,fieldset[disabled] .taginput .taginput-container.is-focusable:-moz-placeholder,.taginput fieldset[disabled] .taginput-container.is-focusable:-moz-placeholder,fieldset[disabled] .textarea:-moz-placeholder,fieldset[disabled] .input:-moz-placeholder{color:hsla(0,0%,48%,.3)}.select select[disabled]:-ms-input-placeholder,.taginput [disabled].taginput-container.is-focusable:-ms-input-placeholder,[disabled].textarea:-ms-input-placeholder,[disabled].input:-ms-input-placeholder,fieldset[disabled] .select select:-ms-input-placeholder,.select fieldset[disabled] select:-ms-input-placeholder,fieldset[disabled] .taginput .taginput-container.is-focusable:-ms-input-placeholder,.taginput fieldset[disabled] .taginput-container.is-focusable:-ms-input-placeholder,fieldset[disabled] .textarea:-ms-input-placeholder,fieldset[disabled] .input:-ms-input-placeholder{color:hsla(0,0%,48%,.3)}.taginput .taginput-container.is-focusable,.textarea,.input{box-shadow:inset 0 .0625em .125em hsla(0,0%,4%,.05);max-width:100%;width:100%}.taginput [readonly].taginput-container.is-focusable,[readonly].textarea,[readonly].input{box-shadow:none}.taginput .is-white.taginput-container.is-focusable,.is-white.textarea,.is-white.input{border-color:#fff}.taginput .is-white.taginput-container.is-focusable:focus,.is-white.textarea:focus,.is-white.input:focus,.taginput .is-white.is-focused.taginput-container.is-focusable,.is-white.is-focused.textarea,.is-white.is-focused.input,.taginput .is-white.taginput-container.is-focusable:active,.is-white.textarea:active,.is-white.input:active,.taginput .is-white.is-active.taginput-container.is-focusable,.is-white.is-active.textarea,.is-white.is-active.input{box-shadow:0 0 0 .125em hsla(0,0%,100%,.25)}.taginput .is-black.taginput-container.is-focusable,.is-black.textarea,.is-black.input{border-color:hsl(0,0%,4%)}.taginput .is-black.taginput-container.is-focusable:focus,.is-black.textarea:focus,.is-black.input:focus,.taginput .is-black.is-focused.taginput-container.is-focusable,.is-black.is-focused.textarea,.is-black.is-focused.input,.taginput .is-black.taginput-container.is-focusable:active,.is-black.textarea:active,.is-black.input:active,.taginput .is-black.is-active.taginput-container.is-focusable,.is-black.is-active.textarea,.is-black.is-active.input{box-shadow:0 0 0 .125em hsla(0,0%,4%,.25)}.taginput .is-light.taginput-container.is-focusable,.is-light.textarea,.is-light.input{border-color:hsl(0,0%,96%)}.taginput .is-light.taginput-container.is-focusable:focus,.is-light.textarea:focus,.is-light.input:focus,.taginput .is-light.is-focused.taginput-container.is-focusable,.is-light.is-focused.textarea,.is-light.is-focused.input,.taginput .is-light.taginput-container.is-focusable:active,.is-light.textarea:active,.is-light.input:active,.taginput .is-light.is-active.taginput-container.is-focusable,.is-light.is-active.textarea,.is-light.is-active.input{box-shadow:0 0 0 .125em hsla(0,0%,96%,.25)}.taginput .is-dark.taginput-container.is-focusable,.is-dark.textarea,.is-dark.input{border-color:hsl(0,0%,21%)}.taginput .is-dark.taginput-container.is-focusable:focus,.is-dark.textarea:focus,.is-dark.input:focus,.taginput .is-dark.is-focused.taginput-container.is-focusable,.is-dark.is-focused.textarea,.is-dark.is-focused.input,.taginput .is-dark.taginput-container.is-focusable:active,.is-dark.textarea:active,.is-dark.input:active,.taginput .is-dark.is-active.taginput-container.is-focusable,.is-dark.is-active.textarea,.is-dark.is-active.input{box-shadow:0 0 0 .125em hsla(0,0%,21%,.25)}.taginput .is-primary.taginput-container.is-focusable,.is-primary.textarea,.is-primary.input{border-color:#00875f}.taginput .is-primary.taginput-container.is-focusable:focus,.is-primary.textarea:focus,.is-primary.input:focus,.taginput .is-primary.is-focused.taginput-container.is-focusable,.is-primary.is-focused.textarea,.is-primary.is-focused.input,.taginput .is-primary.taginput-container.is-focusable:active,.is-primary.textarea:active,.is-primary.input:active,.taginput .is-primary.is-active.taginput-container.is-focusable,.is-primary.is-active.textarea,.is-primary.is-active.input{box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.taginput .is-link.taginput-container.is-focusable,.is-link.textarea,.is-link.input{border-color:hsl(229,53%,53%)}.taginput .is-link.taginput-container.is-focusable:focus,.is-link.textarea:focus,.is-link.input:focus,.taginput .is-link.is-focused.taginput-container.is-focusable,.is-link.is-focused.textarea,.is-link.is-focused.input,.taginput .is-link.taginput-container.is-focusable:active,.is-link.textarea:active,.is-link.input:active,.taginput .is-link.is-active.taginput-container.is-focusable,.is-link.is-active.textarea,.is-link.is-active.input{box-shadow:0 0 0 .125em hsla(229,53%,53%,.25)}.taginput .is-info.taginput-container.is-focusable,.is-info.textarea,.is-info.input{border-color:hsl(207,61%,53%)}.taginput .is-info.taginput-container.is-focusable:focus,.is-info.textarea:focus,.is-info.input:focus,.taginput .is-info.is-focused.taginput-container.is-focusable,.is-info.is-focused.textarea,.is-info.is-focused.input,.taginput .is-info.taginput-container.is-focusable:active,.is-info.textarea:active,.is-info.input:active,.taginput .is-info.is-active.taginput-container.is-focusable,.is-info.is-active.textarea,.is-info.is-active.input{box-shadow:0 0 0 .125em hsla(207,61%,53%,.25)}.taginput .is-success.taginput-container.is-focusable,.is-success.textarea,.is-success.input{border-color:hsl(153,53%,53%)}.taginput .is-success.taginput-container.is-focusable:focus,.is-success.textarea:focus,.is-success.input:focus,.taginput .is-success.is-focused.taginput-container.is-focusable,.is-success.is-focused.textarea,.is-success.is-focused.input,.taginput .is-success.taginput-container.is-focusable:active,.is-success.textarea:active,.is-success.input:active,.taginput .is-success.is-active.taginput-container.is-focusable,.is-success.is-active.textarea,.is-success.is-active.input{box-shadow:0 0 0 .125em hsla(153,53%,53%,.25)}.taginput .is-warning.taginput-container.is-focusable,.is-warning.textarea,.is-warning.input{border-color:hsl(44,100%,77%)}.taginput .is-warning.taginput-container.is-focusable:focus,.is-warning.textarea:focus,.is-warning.input:focus,.taginput .is-warning.is-focused.taginput-container.is-focusable,.is-warning.is-focused.textarea,.is-warning.is-focused.input,.taginput .is-warning.taginput-container.is-focusable:active,.is-warning.textarea:active,.is-warning.input:active,.taginput .is-warning.is-active.taginput-container.is-focusable,.is-warning.is-active.textarea,.is-warning.is-active.input{box-shadow:0 0 0 .125em hsla(44,100%,77%,.25)}.taginput .is-danger.taginput-container.is-focusable,.is-danger.textarea,.is-danger.input{border-color:hsl(348,86%,61%)}.taginput .is-danger.taginput-container.is-focusable:focus,.is-danger.textarea:focus,.is-danger.input:focus,.taginput .is-danger.is-focused.taginput-container.is-focusable,.is-danger.is-focused.textarea,.is-danger.is-focused.input,.taginput .is-danger.taginput-container.is-focusable:active,.is-danger.textarea:active,.is-danger.input:active,.taginput .is-danger.is-active.taginput-container.is-focusable,.is-danger.is-active.textarea,.is-danger.is-active.input{box-shadow:0 0 0 .125em hsla(348,86%,61%,.25)}.taginput .is-small.taginput-container.is-focusable,.is-small.textarea,.is-small.input{border-radius:2px;font-size:.75rem}.taginput .is-medium.taginput-container.is-focusable,.is-medium.textarea,.is-medium.input{font-size:1.25rem}.taginput .is-large.taginput-container.is-focusable,.is-large.textarea,.is-large.input{font-size:1.5rem}.taginput .is-fullwidth.taginput-container.is-focusable,.is-fullwidth.textarea,.is-fullwidth.input{display:block;width:100%}.taginput .is-inline.taginput-container.is-focusable,.is-inline.textarea,.is-inline.input{display:inline;width:auto}.input.is-rounded{border-radius:9999px;padding-left:calc(calc(0.75em - 1px) + .375em);padding-right:calc(calc(0.75em - 1px) + .375em)}.input.is-static{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);box-shadow:none;padding-left:0;padding-right:0}.textarea{display:block;max-width:100%;min-width:100%;padding:calc(.75em - 1px);resize:vertical}.textarea:not([rows]){max-height:40em;min-height:8em}.textarea[rows]{height:initial}.textarea.has-fixed-size{resize:none}.radio,.checkbox{cursor:pointer;display:inline-block;line-height:1.25;position:relative}.radio input,.checkbox input{cursor:pointer}.radio:hover,.checkbox:hover{color:hsl(0,0%,21%)}[disabled].radio,[disabled].checkbox,fieldset[disabled] .radio,fieldset[disabled] .checkbox,.radio input[disabled],.checkbox input[disabled]{color:hsl(0,0%,48%);cursor:not-allowed}.radio+.radio{margin-left:.5em}.select{display:inline-block;max-width:100%;position:relative;vertical-align:top}.select:not(.is-multiple){height:2.5em}.select:not(.is-multiple):not(.is-loading)::after{border-color:#00875f;right:1.125em;z-index:4}.select.is-rounded select{border-radius:9999px;padding-left:1em}.select select{cursor:pointer;display:block;font-size:1em;max-width:100%;outline:none}.select select::-ms-expand{display:none}.select select[disabled]:hover,fieldset[disabled] .select select:hover{border-color:hsl(0,0%,96%)}.select select:not([multiple]){padding-right:2.5em}.select select[multiple]{height:auto;padding:0}.select select[multiple] option{padding:.5em 1em}.select:not(.is-multiple):not(.is-loading):hover::after{border-color:hsl(0,0%,21%)}.select.is-white:not(:hover)::after{border-color:#fff}.select.is-white select{border-color:#fff}.select.is-white select:hover,.select.is-white select.is-hovered{border-color:hsl(0,0%,95%)}.select.is-white select:focus,.select.is-white select.is-focused,.select.is-white select:active,.select.is-white select.is-active{box-shadow:0 0 0 .125em hsla(0,0%,100%,.25)}.select.is-black:not(:hover)::after{border-color:hsl(0,0%,4%)}.select.is-black select{border-color:hsl(0,0%,4%)}.select.is-black select:hover,.select.is-black select.is-hovered{border-color:#000}.select.is-black select:focus,.select.is-black select.is-focused,.select.is-black select:active,.select.is-black select.is-active{box-shadow:0 0 0 .125em hsla(0,0%,4%,.25)}.select.is-light:not(:hover)::after{border-color:hsl(0,0%,96%)}.select.is-light select{border-color:hsl(0,0%,96%)}.select.is-light select:hover,.select.is-light select.is-hovered{border-color:hsl(0,0%,91%)}.select.is-light select:focus,.select.is-light select.is-focused,.select.is-light select:active,.select.is-light select.is-active{box-shadow:0 0 0 .125em hsla(0,0%,96%,.25)}.select.is-dark:not(:hover)::after{border-color:hsl(0,0%,21%)}.select.is-dark select{border-color:hsl(0,0%,21%)}.select.is-dark select:hover,.select.is-dark select.is-hovered{border-color:hsl(0,0%,16%)}.select.is-dark select:focus,.select.is-dark select.is-focused,.select.is-dark select:active,.select.is-dark select.is-active{box-shadow:0 0 0 .125em hsla(0,0%,21%,.25)}.select.is-primary:not(:hover)::after{border-color:#00875f}.select.is-primary select{border-color:#00875f}.select.is-primary select:hover,.select.is-primary select.is-hovered{border-color:rgb(0,109.5,77.0555555556)}.select.is-primary select:focus,.select.is-primary select.is-focused,.select.is-primary select:active,.select.is-primary select.is-active{box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.select.is-link:not(:hover)::after{border-color:hsl(229,53%,53%)}.select.is-link select{border-color:hsl(229,53%,53%)}.select.is-link select:hover,.select.is-link select.is-hovered{border-color:hsl(229,53%,48%)}.select.is-link select:focus,.select.is-link select.is-focused,.select.is-link select:active,.select.is-link select.is-active{box-shadow:0 0 0 .125em hsla(229,53%,53%,.25)}.select.is-info:not(:hover)::after{border-color:hsl(207,61%,53%)}.select.is-info select{border-color:hsl(207,61%,53%)}.select.is-info select:hover,.select.is-info select.is-hovered{border-color:hsl(207,61%,48%)}.select.is-info select:focus,.select.is-info select.is-focused,.select.is-info select:active,.select.is-info select.is-active{box-shadow:0 0 0 .125em hsla(207,61%,53%,.25)}.select.is-success:not(:hover)::after{border-color:hsl(153,53%,53%)}.select.is-success select{border-color:hsl(153,53%,53%)}.select.is-success select:hover,.select.is-success select.is-hovered{border-color:hsl(153,53%,48%)}.select.is-success select:focus,.select.is-success select.is-focused,.select.is-success select:active,.select.is-success select.is-active{box-shadow:0 0 0 .125em hsla(153,53%,53%,.25)}.select.is-warning:not(:hover)::after{border-color:hsl(44,100%,77%)}.select.is-warning select{border-color:hsl(44,100%,77%)}.select.is-warning select:hover,.select.is-warning select.is-hovered{border-color:hsl(44,100%,72%)}.select.is-warning select:focus,.select.is-warning select.is-focused,.select.is-warning select:active,.select.is-warning select.is-active{box-shadow:0 0 0 .125em hsla(44,100%,77%,.25)}.select.is-danger:not(:hover)::after{border-color:hsl(348,86%,61%)}.select.is-danger select{border-color:hsl(348,86%,61%)}.select.is-danger select:hover,.select.is-danger select.is-hovered{border-color:hsl(348,86%,56%)}.select.is-danger select:focus,.select.is-danger select.is-focused,.select.is-danger select:active,.select.is-danger select.is-active{box-shadow:0 0 0 .125em hsla(348,86%,61%,.25)}.select.is-small{border-radius:2px;font-size:.75rem}.select.is-medium{font-size:1.25rem}.select.is-large{font-size:1.5rem}.select.is-disabled::after{border-color:hsl(0,0%,48%) !important;opacity:.5}.select.is-fullwidth{width:100%}.select.is-fullwidth select{width:100%}.select.is-loading::after{margin-top:0;position:absolute;right:.625em;top:.625em;transform:none}.select.is-loading.is-small:after{font-size:.75rem}.select.is-loading.is-medium:after{font-size:1.25rem}.select.is-loading.is-large:after{font-size:1.5rem}.file{align-items:stretch;display:flex;justify-content:flex-start;position:relative}.file.is-white .file-cta{background-color:#fff;border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.file.is-white:hover .file-cta,.file.is-white.is-hovered .file-cta{background-color:hsl(0,0%,97.5%);border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.file.is-white:focus .file-cta,.file.is-white.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(0,0%,100%,.25);color:hsl(0,0%,4%)}.file.is-white:active .file-cta,.file.is-white.is-active .file-cta{background-color:hsl(0,0%,95%);border-color:rgba(0,0,0,0);color:hsl(0,0%,4%)}.file.is-black .file-cta{background-color:hsl(0,0%,4%);border-color:rgba(0,0,0,0);color:#fff}.file.is-black:hover .file-cta,.file.is-black.is-hovered .file-cta{background-color:hsl(0,0%,1.5%);border-color:rgba(0,0,0,0);color:#fff}.file.is-black:focus .file-cta,.file.is-black.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(0,0%,4%,.25);color:#fff}.file.is-black:active .file-cta,.file.is-black.is-active .file-cta{background-color:#000;border-color:rgba(0,0,0,0);color:#fff}.file.is-light .file-cta{background-color:hsl(0,0%,96%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.file.is-light:hover .file-cta,.file.is-light.is-hovered .file-cta{background-color:hsl(0,0%,93.5%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.file.is-light:focus .file-cta,.file.is-light.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(0,0%,96%,.25);color:rgba(0,0,0,.7)}.file.is-light:active .file-cta,.file.is-light.is-active .file-cta{background-color:hsl(0,0%,91%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.file.is-dark .file-cta{background-color:hsl(0,0%,21%);border-color:rgba(0,0,0,0);color:#fff}.file.is-dark:hover .file-cta,.file.is-dark.is-hovered .file-cta{background-color:hsl(0,0%,18.5%);border-color:rgba(0,0,0,0);color:#fff}.file.is-dark:focus .file-cta,.file.is-dark.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(0,0%,21%,.25);color:#fff}.file.is-dark:active .file-cta,.file.is-dark.is-active .file-cta{background-color:hsl(0,0%,16%);border-color:rgba(0,0,0,0);color:#fff}.file.is-primary .file-cta{background-color:#00875f;border-color:rgba(0,0,0,0);color:#fff}.file.is-primary:hover .file-cta,.file.is-primary.is-hovered .file-cta{background-color:rgb(0,122.25,86.0277777778);border-color:rgba(0,0,0,0);color:#fff}.file.is-primary:focus .file-cta,.file.is-primary.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em rgba(0,135,95,.25);color:#fff}.file.is-primary:active .file-cta,.file.is-primary.is-active .file-cta{background-color:rgb(0,109.5,77.0555555556);border-color:rgba(0,0,0,0);color:#fff}.file.is-link .file-cta{background-color:hsl(229,53%,53%);border-color:rgba(0,0,0,0);color:#fff}.file.is-link:hover .file-cta,.file.is-link.is-hovered .file-cta{background-color:hsl(229,53%,50.5%);border-color:rgba(0,0,0,0);color:#fff}.file.is-link:focus .file-cta,.file.is-link.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(229,53%,53%,.25);color:#fff}.file.is-link:active .file-cta,.file.is-link.is-active .file-cta{background-color:hsl(229,53%,48%);border-color:rgba(0,0,0,0);color:#fff}.file.is-info .file-cta{background-color:hsl(207,61%,53%);border-color:rgba(0,0,0,0);color:#fff}.file.is-info:hover .file-cta,.file.is-info.is-hovered .file-cta{background-color:hsl(207,61%,50.5%);border-color:rgba(0,0,0,0);color:#fff}.file.is-info:focus .file-cta,.file.is-info.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(207,61%,53%,.25);color:#fff}.file.is-info:active .file-cta,.file.is-info.is-active .file-cta{background-color:hsl(207,61%,48%);border-color:rgba(0,0,0,0);color:#fff}.file.is-success .file-cta{background-color:hsl(153,53%,53%);border-color:rgba(0,0,0,0);color:#fff}.file.is-success:hover .file-cta,.file.is-success.is-hovered .file-cta{background-color:hsl(153,53%,50.5%);border-color:rgba(0,0,0,0);color:#fff}.file.is-success:focus .file-cta,.file.is-success.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(153,53%,53%,.25);color:#fff}.file.is-success:active .file-cta,.file.is-success.is-active .file-cta{background-color:hsl(153,53%,48%);border-color:rgba(0,0,0,0);color:#fff}.file.is-warning .file-cta{background-color:hsl(44,100%,77%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.file.is-warning:hover .file-cta,.file.is-warning.is-hovered .file-cta{background-color:hsl(44,100%,74.5%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.file.is-warning:focus .file-cta,.file.is-warning.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(44,100%,77%,.25);color:rgba(0,0,0,.7)}.file.is-warning:active .file-cta,.file.is-warning.is-active .file-cta{background-color:hsl(44,100%,72%);border-color:rgba(0,0,0,0);color:rgba(0,0,0,.7)}.file.is-danger .file-cta{background-color:hsl(348,86%,61%);border-color:rgba(0,0,0,0);color:#fff}.file.is-danger:hover .file-cta,.file.is-danger.is-hovered .file-cta{background-color:hsl(348,86%,58.5%);border-color:rgba(0,0,0,0);color:#fff}.file.is-danger:focus .file-cta,.file.is-danger.is-focused .file-cta{border-color:rgba(0,0,0,0);box-shadow:0 0 .5em hsla(348,86%,61%,.25);color:#fff}.file.is-danger:active .file-cta,.file.is-danger.is-active .file-cta{background-color:hsl(348,86%,56%);border-color:rgba(0,0,0,0);color:#fff}.file.is-small{font-size:.75rem}.file.is-normal{font-size:1rem}.file.is-medium{font-size:1.25rem}.file.is-medium .file-icon .fa{font-size:21px}.file.is-large{font-size:1.5rem}.file.is-large .file-icon .fa{font-size:28px}.file.has-name .file-cta{border-bottom-right-radius:0;border-top-right-radius:0}.file.has-name .file-name{border-bottom-left-radius:0;border-top-left-radius:0}.file.has-name.is-empty .file-cta{border-radius:4px}.file.has-name.is-empty .file-name{display:none}.file.is-boxed .file-label{flex-direction:column}.file.is-boxed .file-cta{flex-direction:column;height:auto;padding:1em 3em}.file.is-boxed .file-name{border-width:0 1px 1px}.file.is-boxed .file-icon{height:1.5em;width:1.5em}.file.is-boxed .file-icon .fa{font-size:21px}.file.is-boxed.is-small .file-icon .fa{font-size:14px}.file.is-boxed.is-medium .file-icon .fa{font-size:28px}.file.is-boxed.is-large .file-icon .fa{font-size:35px}.file.is-boxed.has-name .file-cta{border-radius:4px 4px 0 0}.file.is-boxed.has-name .file-name{border-radius:0 0 4px 4px;border-width:0 1px 1px}.file.is-centered{justify-content:center}.file.is-fullwidth .file-label{width:100%}.file.is-fullwidth .file-name{flex-grow:1;max-width:none}.file.is-right{justify-content:flex-end}.file.is-right .file-cta{border-radius:0 4px 4px 0}.file.is-right .file-name{border-radius:4px 0 0 4px;border-width:1px 0 1px 1px;order:-1}.file-label{align-items:stretch;display:flex;cursor:pointer;justify-content:flex-start;overflow:hidden;position:relative}.file-label:hover .file-cta{background-color:hsl(0,0%,93.5%);color:hsl(0,0%,21%)}.file-label:hover .file-name{border-color:hsl(0,0%,83.5%)}.file-label:active .file-cta{background-color:hsl(0,0%,91%);color:hsl(0,0%,21%)}.file-label:active .file-name{border-color:hsl(0,0%,81%)}.file-input{height:100%;left:0;opacity:0;outline:none;position:absolute;top:0;width:100%}.file-cta,.file-name{border-color:hsl(0,0%,86%);border-radius:4px;font-size:1em;padding-left:1em;padding-right:1em;white-space:nowrap}.file-cta{background-color:hsl(0,0%,96%);color:hsl(0,0%,29%)}.file-name{border-color:hsl(0,0%,86%);border-style:solid;border-width:1px 1px 1px 0;display:block;max-width:16em;overflow:hidden;text-align:inherit;text-overflow:ellipsis}.file-icon{align-items:center;display:flex;height:1em;justify-content:center;margin-right:.5em;width:1em}.file-icon .fa{font-size:14px}.label{color:hsl(0,0%,21%);display:block;font-size:1rem;font-weight:700}.label:not(:last-child){margin-bottom:.5em}.label.is-small{font-size:.75rem}.label.is-medium{font-size:1.25rem}.label.is-large{font-size:1.5rem}.help{display:block;font-size:.75rem;margin-top:.25rem}.help.is-white{color:#fff}.help.is-black{color:hsl(0,0%,4%)}.help.is-light{color:hsl(0,0%,96%)}.help.is-dark{color:hsl(0,0%,21%)}.help.is-primary{color:#00875f}.help.is-link{color:hsl(229,53%,53%)}.help.is-info{color:hsl(207,61%,53%)}.help.is-success{color:hsl(153,53%,53%)}.help.is-warning{color:hsl(44,100%,77%)}.help.is-danger{color:hsl(348,86%,61%)}.field:not(:last-child){margin-bottom:.75rem}.field.has-addons{display:flex;justify-content:flex-start}.field.has-addons .control:not(:last-child){margin-right:-1px}.field.has-addons .control:not(:first-child):not(:last-child) .button,.field.has-addons .control:not(:first-child):not(:last-child) .input,.field.has-addons .control:not(:first-child):not(:last-child) .select select{border-radius:0}.field.has-addons .control:first-child:not(:only-child) .button,.field.has-addons .control:first-child:not(:only-child) .input,.field.has-addons .control:first-child:not(:only-child) .select select{border-bottom-right-radius:0;border-top-right-radius:0}.field.has-addons .control:last-child:not(:only-child) .button,.field.has-addons .control:last-child:not(:only-child) .input,.field.has-addons .control:last-child:not(:only-child) .select select{border-bottom-left-radius:0;border-top-left-radius:0}.field.has-addons .control .button:not([disabled]):hover,.field.has-addons .control .button:not([disabled]).is-hovered,.field.has-addons .control .input:not([disabled]):hover,.field.has-addons .control .input:not([disabled]).is-hovered,.field.has-addons .control .select select:not([disabled]):hover,.field.has-addons .control .select select:not([disabled]).is-hovered{z-index:2}.field.has-addons .control .button:not([disabled]):focus,.field.has-addons .control .button:not([disabled]).is-focused,.field.has-addons .control .button:not([disabled]):active,.field.has-addons .control .button:not([disabled]).is-active,.field.has-addons .control .input:not([disabled]):focus,.field.has-addons .control .input:not([disabled]).is-focused,.field.has-addons .control .input:not([disabled]):active,.field.has-addons .control .input:not([disabled]).is-active,.field.has-addons .control .select select:not([disabled]):focus,.field.has-addons .control .select select:not([disabled]).is-focused,.field.has-addons .control .select select:not([disabled]):active,.field.has-addons .control .select select:not([disabled]).is-active{z-index:3}.field.has-addons .control .button:not([disabled]):focus:hover,.field.has-addons .control .button:not([disabled]).is-focused:hover,.field.has-addons .control .button:not([disabled]):active:hover,.field.has-addons .control .button:not([disabled]).is-active:hover,.field.has-addons .control .input:not([disabled]):focus:hover,.field.has-addons .control .input:not([disabled]).is-focused:hover,.field.has-addons .control .input:not([disabled]):active:hover,.field.has-addons .control .input:not([disabled]).is-active:hover,.field.has-addons .control .select select:not([disabled]):focus:hover,.field.has-addons .control .select select:not([disabled]).is-focused:hover,.field.has-addons .control .select select:not([disabled]):active:hover,.field.has-addons .control .select select:not([disabled]).is-active:hover{z-index:4}.field.has-addons .control.is-expanded{flex-grow:1;flex-shrink:1}.field.has-addons.has-addons-centered{justify-content:center}.field.has-addons.has-addons-right{justify-content:flex-end}.field.has-addons.has-addons-fullwidth .control{flex-grow:1;flex-shrink:0}.field.is-grouped{display:flex;justify-content:flex-start}.field.is-grouped>.control{flex-shrink:0}.field.is-grouped>.control:not(:last-child){margin-bottom:0;margin-right:.75rem}.field.is-grouped>.control.is-expanded{flex-grow:1;flex-shrink:1}.field.is-grouped.is-grouped-centered{justify-content:center}.field.is-grouped.is-grouped-right{justify-content:flex-end}.field.is-grouped.is-grouped-multiline{flex-wrap:wrap}.field.is-grouped.is-grouped-multiline>.control:last-child,.field.is-grouped.is-grouped-multiline>.control:not(:last-child){margin-bottom:.75rem}.field.is-grouped.is-grouped-multiline:last-child{margin-bottom:-0.75rem}.field.is-grouped.is-grouped-multiline:not(:last-child){margin-bottom:0}@media screen and (min-width: 769px),print{.field.is-horizontal{display:flex}}.field-label .label{font-size:inherit}@media screen and (max-width: 768px){.field-label{margin-bottom:.5rem}}@media screen and (min-width: 769px),print{.field-label{flex-basis:0;flex-grow:1;flex-shrink:0;margin-right:1.5rem;text-align:right}.field-label.is-small{font-size:.75rem;padding-top:.375em}.field-label.is-normal{padding-top:.375em}.field-label.is-medium{font-size:1.25rem;padding-top:.375em}.field-label.is-large{font-size:1.5rem;padding-top:.375em}}.field-body .field .field{margin-bottom:0}@media screen and (min-width: 769px),print{.field-body{display:flex;flex-basis:0;flex-grow:5;flex-shrink:1}.field-body .field{margin-bottom:0}.field-body>.field{flex-shrink:1}.field-body>.field:not(.is-narrow){flex-grow:1}.field-body>.field:not(:last-child){margin-right:.75rem}}.control{box-sizing:border-box;clear:both;font-size:1rem;position:relative;text-align:inherit}.control.has-icons-left .input:focus~.icon,.control.has-icons-left .select:focus~.icon,.control.has-icons-right .input:focus~.icon,.control.has-icons-right .select:focus~.icon{color:hsl(0,0%,29%)}.control.has-icons-left .input.is-small~.icon,.control.has-icons-left .select.is-small~.icon,.control.has-icons-right .input.is-small~.icon,.control.has-icons-right .select.is-small~.icon{font-size:.75rem}.control.has-icons-left .input.is-medium~.icon,.control.has-icons-left .select.is-medium~.icon,.control.has-icons-right .input.is-medium~.icon,.control.has-icons-right .select.is-medium~.icon{font-size:1.25rem}.control.has-icons-left .input.is-large~.icon,.control.has-icons-left .select.is-large~.icon,.control.has-icons-right .input.is-large~.icon,.control.has-icons-right .select.is-large~.icon{font-size:1.5rem}.control.has-icons-left .icon,.control.has-icons-right .icon{color:hsl(0,0%,86%);height:2.5em;pointer-events:none;position:absolute;top:0;width:2.5em;z-index:4}.control.has-icons-left .input,.control.has-icons-left .select select{padding-left:2.5em}.control.has-icons-left .icon.is-left{left:0}.control.has-icons-right .input,.control.has-icons-right .select select{padding-right:2.5em}.control.has-icons-right .icon.is-right{right:0}.control.is-loading::after{position:absolute !important;right:.625em;top:.625em;z-index:4}.control.is-loading.is-small:after{font-size:.75rem}.control.is-loading.is-medium:after{font-size:1.25rem}.control.is-loading.is-large:after{font-size:1.5rem}.breadcrumb{font-size:1rem;white-space:nowrap}.breadcrumb a{align-items:center;color:#00875f;display:flex;justify-content:center;padding:0 .75em}.breadcrumb a:hover{color:hsl(0,0%,21%)}.breadcrumb li{align-items:center;display:flex}.breadcrumb li:first-child a{padding-left:0}.breadcrumb li.is-active a{color:hsl(0,0%,21%);cursor:default;pointer-events:none}.breadcrumb li+li::before{color:hsl(0,0%,71%);content:"/"}.breadcrumb ul,.breadcrumb ol{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start}.breadcrumb .icon:first-child{margin-right:.5em}.breadcrumb .icon:last-child{margin-left:.5em}.breadcrumb.is-centered ol,.breadcrumb.is-centered ul{justify-content:center}.breadcrumb.is-right ol,.breadcrumb.is-right ul{justify-content:flex-end}.breadcrumb.is-small{font-size:.75rem}.breadcrumb.is-medium{font-size:1.25rem}.breadcrumb.is-large{font-size:1.5rem}.breadcrumb.has-arrow-separator li+li::before{content:"→"}.breadcrumb.has-bullet-separator li+li::before{content:"•"}.breadcrumb.has-dot-separator li+li::before{content:"·"}.breadcrumb.has-succeeds-separator li+li::before{content:"≻"}.card{background-color:#fff;border-radius:.25rem;box-shadow:0 .5em 1em -0.125em hsla(0,0%,4%,.1),0 0px 0 1px hsla(0,0%,4%,.02);color:hsl(0,0%,29%);max-width:100%;position:relative}.card-footer:first-child,.card-content:first-child,.card-header:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-footer:last-child,.card-content:last-child,.card-header:last-child{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.card-header{background-color:rgba(0,0,0,0);align-items:stretch;box-shadow:0 .125em .25em hsla(0,0%,4%,.1);display:flex}.card-header-title{align-items:center;color:hsl(0,0%,21%);display:flex;flex-grow:1;font-weight:700;padding:.75rem 1rem}.card-header-title.is-centered{justify-content:center}.card-header-icon{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:none;border:none;color:currentColor;font-family:inherit;font-size:1em;margin:0;padding:0;align-items:center;cursor:pointer;display:flex;justify-content:center;padding:.75rem 1rem}.card-image{display:block;position:relative}.card-image:first-child img{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-image:last-child img{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.card-content{background-color:rgba(0,0,0,0);padding:1.5rem}.card-footer{background-color:rgba(0,0,0,0);border-top:1px solid hsl(0,0%,93%);align-items:stretch;display:flex}.card-footer-item{align-items:center;display:flex;flex-basis:0;flex-grow:1;flex-shrink:0;justify-content:center;padding:.75rem}.card-footer-item:not(:last-child){border-right:1px solid hsl(0,0%,93%)}.card .media:not(:last-child){margin-bottom:1.5rem}.dropdown{display:inline-flex;position:relative;vertical-align:top}.dropdown.is-active .dropdown-menu,.dropdown.is-hoverable:hover .dropdown-menu{display:block}.dropdown.is-right .dropdown-menu{left:auto;right:0}.dropdown.is-up .dropdown-menu{bottom:100%;padding-bottom:4px;padding-top:initial;top:auto}.dropdown-menu{display:none;left:0;min-width:12rem;padding-top:4px;position:absolute;top:100%;z-index:20}.dropdown-content{background-color:#fff;border-radius:4px;box-shadow:0 .5em 1em -0.125em hsla(0,0%,4%,.1),0 0px 0 1px hsla(0,0%,4%,.02);padding-bottom:.5rem;padding-top:.5rem}.dropdown-item,.dropdown .dropdown-menu .has-link a{color:hsl(0,0%,29%);display:block;font-size:.875rem;line-height:1.5;padding:.375rem 1rem;position:relative}a.dropdown-item,.dropdown .dropdown-menu .has-link a,button.dropdown-item{padding-right:3rem;text-align:inherit;white-space:nowrap;width:100%}a.dropdown-item:hover,.dropdown .dropdown-menu .has-link a:hover,button.dropdown-item:hover{background-color:hsl(0,0%,96%);color:hsl(0,0%,4%)}a.dropdown-item.is-active,.dropdown .dropdown-menu .has-link a.is-active,button.dropdown-item.is-active{background-color:#00875f;color:#fff}.dropdown-divider{background-color:hsl(0,0%,93%);border:none;display:block;height:1px;margin:.5rem 0}.level{align-items:center;justify-content:space-between}.level code{border-radius:4px}.level img{display:inline-block;vertical-align:top}.level.is-mobile{display:flex}.level.is-mobile .level-left,.level.is-mobile .level-right{display:flex}.level.is-mobile .level-left+.level-right{margin-top:0}.level.is-mobile .level-item:not(:last-child){margin-bottom:0;margin-right:.75rem}.level.is-mobile .level-item:not(.is-narrow){flex-grow:1}@media screen and (min-width: 769px),print{.level{display:flex}.level>.level-item:not(.is-narrow){flex-grow:1}}.level-item{align-items:center;display:flex;flex-basis:auto;flex-grow:0;flex-shrink:0;justify-content:center}.level-item .title,.level-item .subtitle{margin-bottom:0}@media screen and (max-width: 768px){.level-item:not(:last-child){margin-bottom:.75rem}}.level-left,.level-right{flex-basis:auto;flex-grow:0;flex-shrink:0}.level-left .level-item.is-flexible,.level-right .level-item.is-flexible{flex-grow:1}@media screen and (min-width: 769px),print{.level-left .level-item:not(:last-child),.level-right .level-item:not(:last-child){margin-right:.75rem}}.level-left{align-items:center;justify-content:flex-start}@media screen and (max-width: 768px){.level-left+.level-right{margin-top:1.5rem}}@media screen and (min-width: 769px),print{.level-left{display:flex}}.level-right{align-items:center;justify-content:flex-end}@media screen and (min-width: 769px),print{.level-right{display:flex}}.media{align-items:flex-start;display:flex;text-align:inherit}.media .content:not(:last-child){margin-bottom:.75rem}.media .media{border-top:1px solid hsla(0,0%,86%,.5);display:flex;padding-top:.75rem}.media .media .content:not(:last-child),.media .media .control:not(:last-child){margin-bottom:.5rem}.media .media .media{padding-top:.5rem}.media .media .media+.media{margin-top:.5rem}.media+.media{border-top:1px solid hsla(0,0%,86%,.5);margin-top:1rem;padding-top:1rem}.media.is-large+.media{margin-top:1.5rem;padding-top:1.5rem}.media-left,.media-right{flex-basis:auto;flex-grow:0;flex-shrink:0}.media-left{margin-right:1rem}.media-right{margin-left:1rem}.media-content{flex-basis:auto;flex-grow:1;flex-shrink:1;text-align:inherit}@media screen and (max-width: 768px){.media-content{overflow-x:auto}}.menu{font-size:1rem}.menu.is-small{font-size:.75rem}.menu.is-medium{font-size:1.25rem}.menu.is-large{font-size:1.5rem}.menu-list{line-height:1.25}.menu-list a{border-radius:2px;color:hsl(0,0%,29%);display:block;padding:.5em .75em}.menu-list a:hover{background-color:hsl(0,0%,96%);color:hsl(0,0%,21%)}.menu-list a.is-active{background-color:#00875f;color:#fff}.menu-list li ul{border-left:1px solid hsl(0,0%,86%);margin:.75em;padding-left:.75em}.menu-label{color:hsl(0,0%,48%);font-size:.75em;letter-spacing:.1em;text-transform:uppercase}.menu-label:not(:first-child){margin-top:1em}.menu-label:not(:last-child){margin-bottom:1em}.message{background-color:hsl(0,0%,96%);border-radius:4px;font-size:1rem}.message strong{color:currentColor}.message a:not(.button):not(.tag):not(.dropdown-item){color:currentColor;text-decoration:underline}.message.is-small{font-size:.75rem}.message.is-medium{font-size:1.25rem}.message.is-large{font-size:1.5rem}.message.is-white{background-color:#fff}.message.is-white .message-header{background-color:#fff;color:hsl(0,0%,4%)}.message.is-white .message-body{border-color:#fff}.message.is-black{background-color:hsl(0,0%,98%)}.message.is-black .message-header{background-color:hsl(0,0%,4%);color:#fff}.message.is-black .message-body{border-color:hsl(0,0%,4%)}.message.is-light{background-color:hsl(0,0%,98%)}.message.is-light .message-header{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.message.is-light .message-body{border-color:hsl(0,0%,96%)}.message.is-dark{background-color:hsl(0,0%,98%)}.message.is-dark .message-header{background-color:hsl(0,0%,21%);color:#fff}.message.is-dark .message-body{border-color:hsl(0,0%,21%)}.message.is-primary{background-color:hsl(162.2222222222,100%,96%)}.message.is-primary .message-header{background-color:#00875f;color:#fff}.message.is-primary .message-body{border-color:#00875f;color:rgb(0,229.5,161.5)}.message.is-link{background-color:hsl(229,53%,96%)}.message.is-link .message-header{background-color:hsl(229,53%,53%);color:#fff}.message.is-link .message-body{border-color:hsl(229,53%,53%);color:hsl(229,53%,47%)}.message.is-info{background-color:hsl(207,61%,96%)}.message.is-info .message-header{background-color:hsl(207,61%,53%);color:#fff}.message.is-info .message-body{border-color:hsl(207,61%,53%);color:hsl(207,61%,41%)}.message.is-success{background-color:hsl(153,53%,96%)}.message.is-success .message-header{background-color:hsl(153,53%,53%);color:#fff}.message.is-success .message-body{border-color:hsl(153,53%,53%);color:hsl(153,53%,31%)}.message.is-warning{background-color:hsl(44,100%,96%)}.message.is-warning .message-header{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.message.is-warning .message-body{border-color:hsl(44,100%,77%);color:hsl(44,100%,29%)}.message.is-danger{background-color:hsl(348,86%,96%)}.message.is-danger .message-header{background-color:hsl(348,86%,61%);color:#fff}.message.is-danger .message-body{border-color:hsl(348,86%,61%);color:hsl(348,86%,43%)}.message-header{align-items:center;background-color:hsl(0,0%,29%);border-radius:4px 4px 0 0;color:#fff;display:flex;font-weight:700;justify-content:space-between;line-height:1.25;padding:.75em 1em;position:relative}.message-header .delete{flex-grow:0;flex-shrink:0;margin-left:.75em}.message-header+.message-body{border-width:0;border-top-left-radius:0;border-top-right-radius:0}.message-body{border-color:hsl(0,0%,86%);border-radius:4px;border-style:solid;border-width:0 0 0 4px;color:hsl(0,0%,29%);padding:1.25em 1.5em}.message-body code,.message-body pre{background-color:#fff}.message-body pre code{background-color:rgba(0,0,0,0)}.modal{align-items:center;display:none;flex-direction:column;justify-content:center;overflow:hidden;position:fixed;z-index:40}.modal.is-active{display:flex}.modal-background{background-color:hsla(0,0%,4%,.86)}.modal-content,.modal-card{margin:0 20px;max-height:calc(100vh - 160px);overflow:auto;position:relative;width:100%}@media screen and (min-width: 769px){.modal-content,.modal-card{margin:0 auto;max-height:calc(100vh - 40px);width:640px}}.modal-close{background:none;height:40px;position:fixed;right:20px;top:20px;width:40px}.modal-card{display:flex;flex-direction:column;max-height:calc(100vh - 40px);overflow:hidden;-ms-overflow-y:visible}.modal-card-head,.modal-card-foot{align-items:center;background-color:hsl(0,0%,96%);display:flex;flex-shrink:0;justify-content:flex-start;padding:20px;position:relative}.modal-card-head{border-bottom:1px solid hsl(0,0%,86%);border-top-left-radius:6px;border-top-right-radius:6px}.modal-card-title{color:hsl(0,0%,21%);flex-grow:1;flex-shrink:0;font-size:1.5rem;line-height:1}.modal-card-foot{border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:1px solid hsl(0,0%,86%)}.modal-card-foot .button:not(:last-child){margin-right:.5em}.modal-card-body{-webkit-overflow-scrolling:touch;background-color:#fff;flex-grow:1;flex-shrink:1;overflow:auto;padding:20px}.navbar{background-color:#fff;min-height:3.25rem;position:relative;z-index:30}.navbar.is-white{background-color:#fff;color:hsl(0,0%,4%)}.navbar.is-white .navbar-brand>.navbar-item,.navbar.is-white .navbar-brand .navbar-link{color:hsl(0,0%,4%)}.navbar.is-white .navbar-brand>a.navbar-item:focus,.navbar.is-white .navbar-brand>a.navbar-item:hover,.navbar.is-white .navbar-brand>a.navbar-item.is-active,.navbar.is-white .navbar-brand .navbar-link:focus,.navbar.is-white .navbar-brand .navbar-link:hover,.navbar.is-white .navbar-brand .navbar-link.is-active{background-color:hsl(0,0%,95%);color:hsl(0,0%,4%)}.navbar.is-white .navbar-brand .navbar-link::after{border-color:hsl(0,0%,4%)}.navbar.is-white .navbar-burger{color:hsl(0,0%,4%)}@media screen and (min-width: 1024px){.navbar.is-white .navbar-start>.navbar-item,.navbar.is-white .navbar-start .navbar-link,.navbar.is-white .navbar-end>.navbar-item,.navbar.is-white .navbar-end .navbar-link{color:hsl(0,0%,4%)}.navbar.is-white .navbar-start>a.navbar-item:focus,.navbar.is-white .navbar-start>a.navbar-item:hover,.navbar.is-white .navbar-start>a.navbar-item.is-active,.navbar.is-white .navbar-start .navbar-link:focus,.navbar.is-white .navbar-start .navbar-link:hover,.navbar.is-white .navbar-start .navbar-link.is-active,.navbar.is-white .navbar-end>a.navbar-item:focus,.navbar.is-white .navbar-end>a.navbar-item:hover,.navbar.is-white .navbar-end>a.navbar-item.is-active,.navbar.is-white .navbar-end .navbar-link:focus,.navbar.is-white .navbar-end .navbar-link:hover,.navbar.is-white .navbar-end .navbar-link.is-active{background-color:hsl(0,0%,95%);color:hsl(0,0%,4%)}.navbar.is-white .navbar-start .navbar-link::after,.navbar.is-white .navbar-end .navbar-link::after{border-color:hsl(0,0%,4%)}.navbar.is-white .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-white .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-white .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(0,0%,95%);color:hsl(0,0%,4%)}.navbar.is-white .navbar-dropdown a.navbar-item.is-active{background-color:#fff;color:hsl(0,0%,4%)}}.navbar.is-black{background-color:hsl(0,0%,4%);color:#fff}.navbar.is-black .navbar-brand>.navbar-item,.navbar.is-black .navbar-brand .navbar-link{color:#fff}.navbar.is-black .navbar-brand>a.navbar-item:focus,.navbar.is-black .navbar-brand>a.navbar-item:hover,.navbar.is-black .navbar-brand>a.navbar-item.is-active,.navbar.is-black .navbar-brand .navbar-link:focus,.navbar.is-black .navbar-brand .navbar-link:hover,.navbar.is-black .navbar-brand .navbar-link.is-active{background-color:#000;color:#fff}.navbar.is-black .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-black .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-black .navbar-start>.navbar-item,.navbar.is-black .navbar-start .navbar-link,.navbar.is-black .navbar-end>.navbar-item,.navbar.is-black .navbar-end .navbar-link{color:#fff}.navbar.is-black .navbar-start>a.navbar-item:focus,.navbar.is-black .navbar-start>a.navbar-item:hover,.navbar.is-black .navbar-start>a.navbar-item.is-active,.navbar.is-black .navbar-start .navbar-link:focus,.navbar.is-black .navbar-start .navbar-link:hover,.navbar.is-black .navbar-start .navbar-link.is-active,.navbar.is-black .navbar-end>a.navbar-item:focus,.navbar.is-black .navbar-end>a.navbar-item:hover,.navbar.is-black .navbar-end>a.navbar-item.is-active,.navbar.is-black .navbar-end .navbar-link:focus,.navbar.is-black .navbar-end .navbar-link:hover,.navbar.is-black .navbar-end .navbar-link.is-active{background-color:#000;color:#fff}.navbar.is-black .navbar-start .navbar-link::after,.navbar.is-black .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-black .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-black .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-black .navbar-item.has-dropdown.is-active .navbar-link{background-color:#000;color:#fff}.navbar.is-black .navbar-dropdown a.navbar-item.is-active{background-color:hsl(0,0%,4%);color:#fff}}.navbar.is-light{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.navbar.is-light .navbar-brand>.navbar-item,.navbar.is-light .navbar-brand .navbar-link{color:rgba(0,0,0,.7)}.navbar.is-light .navbar-brand>a.navbar-item:focus,.navbar.is-light .navbar-brand>a.navbar-item:hover,.navbar.is-light .navbar-brand>a.navbar-item.is-active,.navbar.is-light .navbar-brand .navbar-link:focus,.navbar.is-light .navbar-brand .navbar-link:hover,.navbar.is-light .navbar-brand .navbar-link.is-active{background-color:hsl(0,0%,91%);color:rgba(0,0,0,.7)}.navbar.is-light .navbar-brand .navbar-link::after{border-color:rgba(0,0,0,.7)}.navbar.is-light .navbar-burger{color:rgba(0,0,0,.7)}@media screen and (min-width: 1024px){.navbar.is-light .navbar-start>.navbar-item,.navbar.is-light .navbar-start .navbar-link,.navbar.is-light .navbar-end>.navbar-item,.navbar.is-light .navbar-end .navbar-link{color:rgba(0,0,0,.7)}.navbar.is-light .navbar-start>a.navbar-item:focus,.navbar.is-light .navbar-start>a.navbar-item:hover,.navbar.is-light .navbar-start>a.navbar-item.is-active,.navbar.is-light .navbar-start .navbar-link:focus,.navbar.is-light .navbar-start .navbar-link:hover,.navbar.is-light .navbar-start .navbar-link.is-active,.navbar.is-light .navbar-end>a.navbar-item:focus,.navbar.is-light .navbar-end>a.navbar-item:hover,.navbar.is-light .navbar-end>a.navbar-item.is-active,.navbar.is-light .navbar-end .navbar-link:focus,.navbar.is-light .navbar-end .navbar-link:hover,.navbar.is-light .navbar-end .navbar-link.is-active{background-color:hsl(0,0%,91%);color:rgba(0,0,0,.7)}.navbar.is-light .navbar-start .navbar-link::after,.navbar.is-light .navbar-end .navbar-link::after{border-color:rgba(0,0,0,.7)}.navbar.is-light .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-light .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-light .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(0,0%,91%);color:rgba(0,0,0,.7)}.navbar.is-light .navbar-dropdown a.navbar-item.is-active{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}}.navbar.is-dark{background-color:hsl(0,0%,21%);color:#fff}.navbar.is-dark .navbar-brand>.navbar-item,.navbar.is-dark .navbar-brand .navbar-link{color:#fff}.navbar.is-dark .navbar-brand>a.navbar-item:focus,.navbar.is-dark .navbar-brand>a.navbar-item:hover,.navbar.is-dark .navbar-brand>a.navbar-item.is-active,.navbar.is-dark .navbar-brand .navbar-link:focus,.navbar.is-dark .navbar-brand .navbar-link:hover,.navbar.is-dark .navbar-brand .navbar-link.is-active{background-color:hsl(0,0%,16%);color:#fff}.navbar.is-dark .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-dark .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-dark .navbar-start>.navbar-item,.navbar.is-dark .navbar-start .navbar-link,.navbar.is-dark .navbar-end>.navbar-item,.navbar.is-dark .navbar-end .navbar-link{color:#fff}.navbar.is-dark .navbar-start>a.navbar-item:focus,.navbar.is-dark .navbar-start>a.navbar-item:hover,.navbar.is-dark .navbar-start>a.navbar-item.is-active,.navbar.is-dark .navbar-start .navbar-link:focus,.navbar.is-dark .navbar-start .navbar-link:hover,.navbar.is-dark .navbar-start .navbar-link.is-active,.navbar.is-dark .navbar-end>a.navbar-item:focus,.navbar.is-dark .navbar-end>a.navbar-item:hover,.navbar.is-dark .navbar-end>a.navbar-item.is-active,.navbar.is-dark .navbar-end .navbar-link:focus,.navbar.is-dark .navbar-end .navbar-link:hover,.navbar.is-dark .navbar-end .navbar-link.is-active{background-color:hsl(0,0%,16%);color:#fff}.navbar.is-dark .navbar-start .navbar-link::after,.navbar.is-dark .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-dark .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-dark .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-dark .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(0,0%,16%);color:#fff}.navbar.is-dark .navbar-dropdown a.navbar-item.is-active{background-color:hsl(0,0%,21%);color:#fff}}.navbar.is-primary{background-color:#00875f;color:#fff}.navbar.is-primary .navbar-brand>.navbar-item,.navbar.is-primary .navbar-brand .navbar-link{color:#fff}.navbar.is-primary .navbar-brand>a.navbar-item:focus,.navbar.is-primary .navbar-brand>a.navbar-item:hover,.navbar.is-primary .navbar-brand>a.navbar-item.is-active,.navbar.is-primary .navbar-brand .navbar-link:focus,.navbar.is-primary .navbar-brand .navbar-link:hover,.navbar.is-primary .navbar-brand .navbar-link.is-active{background-color:rgb(0,109.5,77.0555555556);color:#fff}.navbar.is-primary .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-primary .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-primary .navbar-start>.navbar-item,.navbar.is-primary .navbar-start .navbar-link,.navbar.is-primary .navbar-end>.navbar-item,.navbar.is-primary .navbar-end .navbar-link{color:#fff}.navbar.is-primary .navbar-start>a.navbar-item:focus,.navbar.is-primary .navbar-start>a.navbar-item:hover,.navbar.is-primary .navbar-start>a.navbar-item.is-active,.navbar.is-primary .navbar-start .navbar-link:focus,.navbar.is-primary .navbar-start .navbar-link:hover,.navbar.is-primary .navbar-start .navbar-link.is-active,.navbar.is-primary .navbar-end>a.navbar-item:focus,.navbar.is-primary .navbar-end>a.navbar-item:hover,.navbar.is-primary .navbar-end>a.navbar-item.is-active,.navbar.is-primary .navbar-end .navbar-link:focus,.navbar.is-primary .navbar-end .navbar-link:hover,.navbar.is-primary .navbar-end .navbar-link.is-active{background-color:rgb(0,109.5,77.0555555556);color:#fff}.navbar.is-primary .navbar-start .navbar-link::after,.navbar.is-primary .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-primary .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-primary .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-primary .navbar-item.has-dropdown.is-active .navbar-link{background-color:rgb(0,109.5,77.0555555556);color:#fff}.navbar.is-primary .navbar-dropdown a.navbar-item.is-active{background-color:#00875f;color:#fff}}.navbar.is-link{background-color:hsl(229,53%,53%);color:#fff}.navbar.is-link .navbar-brand>.navbar-item,.navbar.is-link .navbar-brand .navbar-link{color:#fff}.navbar.is-link .navbar-brand>a.navbar-item:focus,.navbar.is-link .navbar-brand>a.navbar-item:hover,.navbar.is-link .navbar-brand>a.navbar-item.is-active,.navbar.is-link .navbar-brand .navbar-link:focus,.navbar.is-link .navbar-brand .navbar-link:hover,.navbar.is-link .navbar-brand .navbar-link.is-active{background-color:hsl(229,53%,48%);color:#fff}.navbar.is-link .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-link .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-link .navbar-start>.navbar-item,.navbar.is-link .navbar-start .navbar-link,.navbar.is-link .navbar-end>.navbar-item,.navbar.is-link .navbar-end .navbar-link{color:#fff}.navbar.is-link .navbar-start>a.navbar-item:focus,.navbar.is-link .navbar-start>a.navbar-item:hover,.navbar.is-link .navbar-start>a.navbar-item.is-active,.navbar.is-link .navbar-start .navbar-link:focus,.navbar.is-link .navbar-start .navbar-link:hover,.navbar.is-link .navbar-start .navbar-link.is-active,.navbar.is-link .navbar-end>a.navbar-item:focus,.navbar.is-link .navbar-end>a.navbar-item:hover,.navbar.is-link .navbar-end>a.navbar-item.is-active,.navbar.is-link .navbar-end .navbar-link:focus,.navbar.is-link .navbar-end .navbar-link:hover,.navbar.is-link .navbar-end .navbar-link.is-active{background-color:hsl(229,53%,48%);color:#fff}.navbar.is-link .navbar-start .navbar-link::after,.navbar.is-link .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-link .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-link .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-link .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(229,53%,48%);color:#fff}.navbar.is-link .navbar-dropdown a.navbar-item.is-active{background-color:hsl(229,53%,53%);color:#fff}}.navbar.is-info{background-color:hsl(207,61%,53%);color:#fff}.navbar.is-info .navbar-brand>.navbar-item,.navbar.is-info .navbar-brand .navbar-link{color:#fff}.navbar.is-info .navbar-brand>a.navbar-item:focus,.navbar.is-info .navbar-brand>a.navbar-item:hover,.navbar.is-info .navbar-brand>a.navbar-item.is-active,.navbar.is-info .navbar-brand .navbar-link:focus,.navbar.is-info .navbar-brand .navbar-link:hover,.navbar.is-info .navbar-brand .navbar-link.is-active{background-color:hsl(207,61%,48%);color:#fff}.navbar.is-info .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-info .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-info .navbar-start>.navbar-item,.navbar.is-info .navbar-start .navbar-link,.navbar.is-info .navbar-end>.navbar-item,.navbar.is-info .navbar-end .navbar-link{color:#fff}.navbar.is-info .navbar-start>a.navbar-item:focus,.navbar.is-info .navbar-start>a.navbar-item:hover,.navbar.is-info .navbar-start>a.navbar-item.is-active,.navbar.is-info .navbar-start .navbar-link:focus,.navbar.is-info .navbar-start .navbar-link:hover,.navbar.is-info .navbar-start .navbar-link.is-active,.navbar.is-info .navbar-end>a.navbar-item:focus,.navbar.is-info .navbar-end>a.navbar-item:hover,.navbar.is-info .navbar-end>a.navbar-item.is-active,.navbar.is-info .navbar-end .navbar-link:focus,.navbar.is-info .navbar-end .navbar-link:hover,.navbar.is-info .navbar-end .navbar-link.is-active{background-color:hsl(207,61%,48%);color:#fff}.navbar.is-info .navbar-start .navbar-link::after,.navbar.is-info .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-info .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-info .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-info .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(207,61%,48%);color:#fff}.navbar.is-info .navbar-dropdown a.navbar-item.is-active{background-color:hsl(207,61%,53%);color:#fff}}.navbar.is-success{background-color:hsl(153,53%,53%);color:#fff}.navbar.is-success .navbar-brand>.navbar-item,.navbar.is-success .navbar-brand .navbar-link{color:#fff}.navbar.is-success .navbar-brand>a.navbar-item:focus,.navbar.is-success .navbar-brand>a.navbar-item:hover,.navbar.is-success .navbar-brand>a.navbar-item.is-active,.navbar.is-success .navbar-brand .navbar-link:focus,.navbar.is-success .navbar-brand .navbar-link:hover,.navbar.is-success .navbar-brand .navbar-link.is-active{background-color:hsl(153,53%,48%);color:#fff}.navbar.is-success .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-success .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-success .navbar-start>.navbar-item,.navbar.is-success .navbar-start .navbar-link,.navbar.is-success .navbar-end>.navbar-item,.navbar.is-success .navbar-end .navbar-link{color:#fff}.navbar.is-success .navbar-start>a.navbar-item:focus,.navbar.is-success .navbar-start>a.navbar-item:hover,.navbar.is-success .navbar-start>a.navbar-item.is-active,.navbar.is-success .navbar-start .navbar-link:focus,.navbar.is-success .navbar-start .navbar-link:hover,.navbar.is-success .navbar-start .navbar-link.is-active,.navbar.is-success .navbar-end>a.navbar-item:focus,.navbar.is-success .navbar-end>a.navbar-item:hover,.navbar.is-success .navbar-end>a.navbar-item.is-active,.navbar.is-success .navbar-end .navbar-link:focus,.navbar.is-success .navbar-end .navbar-link:hover,.navbar.is-success .navbar-end .navbar-link.is-active{background-color:hsl(153,53%,48%);color:#fff}.navbar.is-success .navbar-start .navbar-link::after,.navbar.is-success .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-success .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-success .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-success .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(153,53%,48%);color:#fff}.navbar.is-success .navbar-dropdown a.navbar-item.is-active{background-color:hsl(153,53%,53%);color:#fff}}.navbar.is-warning{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-brand>.navbar-item,.navbar.is-warning .navbar-brand .navbar-link{color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-brand>a.navbar-item:focus,.navbar.is-warning .navbar-brand>a.navbar-item:hover,.navbar.is-warning .navbar-brand>a.navbar-item.is-active,.navbar.is-warning .navbar-brand .navbar-link:focus,.navbar.is-warning .navbar-brand .navbar-link:hover,.navbar.is-warning .navbar-brand .navbar-link.is-active{background-color:hsl(44,100%,72%);color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-brand .navbar-link::after{border-color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-burger{color:rgba(0,0,0,.7)}@media screen and (min-width: 1024px){.navbar.is-warning .navbar-start>.navbar-item,.navbar.is-warning .navbar-start .navbar-link,.navbar.is-warning .navbar-end>.navbar-item,.navbar.is-warning .navbar-end .navbar-link{color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-start>a.navbar-item:focus,.navbar.is-warning .navbar-start>a.navbar-item:hover,.navbar.is-warning .navbar-start>a.navbar-item.is-active,.navbar.is-warning .navbar-start .navbar-link:focus,.navbar.is-warning .navbar-start .navbar-link:hover,.navbar.is-warning .navbar-start .navbar-link.is-active,.navbar.is-warning .navbar-end>a.navbar-item:focus,.navbar.is-warning .navbar-end>a.navbar-item:hover,.navbar.is-warning .navbar-end>a.navbar-item.is-active,.navbar.is-warning .navbar-end .navbar-link:focus,.navbar.is-warning .navbar-end .navbar-link:hover,.navbar.is-warning .navbar-end .navbar-link.is-active{background-color:hsl(44,100%,72%);color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-start .navbar-link::after,.navbar.is-warning .navbar-end .navbar-link::after{border-color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-warning .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-warning .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(44,100%,72%);color:rgba(0,0,0,.7)}.navbar.is-warning .navbar-dropdown a.navbar-item.is-active{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}}.navbar.is-danger{background-color:hsl(348,86%,61%);color:#fff}.navbar.is-danger .navbar-brand>.navbar-item,.navbar.is-danger .navbar-brand .navbar-link{color:#fff}.navbar.is-danger .navbar-brand>a.navbar-item:focus,.navbar.is-danger .navbar-brand>a.navbar-item:hover,.navbar.is-danger .navbar-brand>a.navbar-item.is-active,.navbar.is-danger .navbar-brand .navbar-link:focus,.navbar.is-danger .navbar-brand .navbar-link:hover,.navbar.is-danger .navbar-brand .navbar-link.is-active{background-color:hsl(348,86%,56%);color:#fff}.navbar.is-danger .navbar-brand .navbar-link::after{border-color:#fff}.navbar.is-danger .navbar-burger{color:#fff}@media screen and (min-width: 1024px){.navbar.is-danger .navbar-start>.navbar-item,.navbar.is-danger .navbar-start .navbar-link,.navbar.is-danger .navbar-end>.navbar-item,.navbar.is-danger .navbar-end .navbar-link{color:#fff}.navbar.is-danger .navbar-start>a.navbar-item:focus,.navbar.is-danger .navbar-start>a.navbar-item:hover,.navbar.is-danger .navbar-start>a.navbar-item.is-active,.navbar.is-danger .navbar-start .navbar-link:focus,.navbar.is-danger .navbar-start .navbar-link:hover,.navbar.is-danger .navbar-start .navbar-link.is-active,.navbar.is-danger .navbar-end>a.navbar-item:focus,.navbar.is-danger .navbar-end>a.navbar-item:hover,.navbar.is-danger .navbar-end>a.navbar-item.is-active,.navbar.is-danger .navbar-end .navbar-link:focus,.navbar.is-danger .navbar-end .navbar-link:hover,.navbar.is-danger .navbar-end .navbar-link.is-active{background-color:hsl(348,86%,56%);color:#fff}.navbar.is-danger .navbar-start .navbar-link::after,.navbar.is-danger .navbar-end .navbar-link::after{border-color:#fff}.navbar.is-danger .navbar-item.has-dropdown:focus .navbar-link,.navbar.is-danger .navbar-item.has-dropdown:hover .navbar-link,.navbar.is-danger .navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(348,86%,56%);color:#fff}.navbar.is-danger .navbar-dropdown a.navbar-item.is-active{background-color:hsl(348,86%,61%);color:#fff}}.navbar>.container{align-items:stretch;display:flex;min-height:3.25rem;width:100%}.navbar.has-shadow{box-shadow:0 2px 0 0 hsl(0,0%,96%)}.navbar.is-fixed-bottom,.navbar.is-fixed-top{left:0;position:fixed;right:0;z-index:30}.navbar.is-fixed-bottom{bottom:0}.navbar.is-fixed-bottom.has-shadow{box-shadow:0 -2px 0 0 hsl(0,0%,96%)}.navbar.is-fixed-top{top:0}html.has-navbar-fixed-top,body.has-navbar-fixed-top{padding-top:3.25rem}html.has-navbar-fixed-bottom,body.has-navbar-fixed-bottom{padding-bottom:3.25rem}.navbar-brand,.navbar-tabs{align-items:stretch;display:flex;flex-shrink:0;min-height:3.25rem}.navbar-brand a.navbar-item:focus,.navbar-brand a.navbar-item:hover{background-color:rgba(0,0,0,0)}.navbar-tabs{-webkit-overflow-scrolling:touch;max-width:100vw;overflow-x:auto;overflow-y:hidden}.navbar-burger{color:hsl(0,0%,29%);-moz-appearance:none;-webkit-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:block;height:3.25rem;position:relative;width:3.25rem}.navbar-burger span{background-color:currentColor;display:block;height:1px;left:calc(50% - 8px);position:absolute;transform-origin:center;transition-duration:86ms;transition-property:background-color,opacity,transform;transition-timing-function:ease-out;width:16px}.navbar-burger span:nth-child(1){top:calc(50% - 6px)}.navbar-burger span:nth-child(2){top:calc(50% - 1px)}.navbar-burger span:nth-child(3){top:calc(50% + 4px)}.navbar-burger:hover{background-color:rgba(0,0,0,.05)}.navbar-burger.is-active span:nth-child(1){transform:translateY(5px) rotate(45deg)}.navbar-burger.is-active span:nth-child(2){opacity:0}.navbar-burger.is-active span:nth-child(3){transform:translateY(-5px) rotate(-45deg)}.navbar-burger{margin-left:auto}.navbar-menu{display:none}.navbar-item,.navbar-link{color:hsl(0,0%,29%);display:block;line-height:1.5;padding:.5rem .75rem;position:relative}.navbar-item .icon:only-child,.navbar-link .icon:only-child{margin-left:-0.25rem;margin-right:-0.25rem}a.navbar-item,.navbar-link{cursor:pointer}a.navbar-item:focus,a.navbar-item:focus-within,a.navbar-item:hover,a.navbar-item.is-active,.navbar-link:focus,.navbar-link:focus-within,.navbar-link:hover,.navbar-link.is-active{background-color:hsl(0,0%,98%);color:#00875f}.navbar-item{flex-grow:0;flex-shrink:0}.navbar-item img{max-height:1.75rem}.navbar-item.has-dropdown{padding:0}.navbar-item.is-expanded{flex-grow:1;flex-shrink:1}.navbar-item.is-tab{border-bottom:1px solid rgba(0,0,0,0);min-height:3.25rem;padding-bottom:calc(.5rem - 1px)}.navbar-item.is-tab:focus,.navbar-item.is-tab:hover{background-color:rgba(0,0,0,0);border-bottom-color:#00875f}.navbar-item.is-tab.is-active{background-color:rgba(0,0,0,0);border-bottom-color:#00875f;border-bottom-style:solid;border-bottom-width:3px;color:#00875f;padding-bottom:calc(.5rem - 3px)}.navbar-content{flex-grow:1;flex-shrink:1}.navbar-link:not(.is-arrowless){padding-right:2.5em}.navbar-link:not(.is-arrowless)::after{border-color:#00875f;margin-top:-0.375em;right:1.125em}.navbar-dropdown{font-size:.875rem;padding-bottom:.5rem;padding-top:.5rem}.navbar-dropdown .navbar-item{padding-left:1.5rem;padding-right:1.5rem}.navbar-divider{background-color:hsl(0,0%,96%);border:none;display:none;height:2px;margin:.5rem 0}@media screen and (max-width: 1023px){.navbar>.container{display:block}.navbar-brand .navbar-item,.navbar-tabs .navbar-item{align-items:center;display:flex}.navbar-link::after{display:none}.navbar-menu{background-color:#fff;box-shadow:0 8px 16px hsla(0,0%,4%,.1);padding:.5rem 0}.navbar-menu.is-active{display:block}.navbar.is-fixed-bottom-touch,.navbar.is-fixed-top-touch{left:0;position:fixed;right:0;z-index:30}.navbar.is-fixed-bottom-touch{bottom:0}.navbar.is-fixed-bottom-touch.has-shadow{box-shadow:0 -2px 3px hsla(0,0%,4%,.1)}.navbar.is-fixed-top-touch{top:0}.navbar.is-fixed-top .navbar-menu,.navbar.is-fixed-top-touch .navbar-menu{-webkit-overflow-scrolling:touch;max-height:calc(100vh - 3.25rem);overflow:auto}html.has-navbar-fixed-top-touch,body.has-navbar-fixed-top-touch{padding-top:3.25rem}html.has-navbar-fixed-bottom-touch,body.has-navbar-fixed-bottom-touch{padding-bottom:3.25rem}}@media screen and (min-width: 1024px){.navbar,.navbar-menu,.navbar-start,.navbar-end{align-items:stretch;display:flex}.navbar{min-height:3.25rem}.navbar.is-spaced{padding:1rem 2rem}.navbar.is-spaced .navbar-start,.navbar.is-spaced .navbar-end{align-items:center}.navbar.is-spaced a.navbar-item,.navbar.is-spaced .navbar-link{border-radius:4px}.navbar.is-transparent a.navbar-item:focus,.navbar.is-transparent a.navbar-item:hover,.navbar.is-transparent a.navbar-item.is-active,.navbar.is-transparent .navbar-link:focus,.navbar.is-transparent .navbar-link:hover,.navbar.is-transparent .navbar-link.is-active{background-color:rgba(0,0,0,0) !important}.navbar.is-transparent .navbar-item.has-dropdown.is-active .navbar-link,.navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:focus .navbar-link,.navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:focus-within .navbar-link,.navbar.is-transparent .navbar-item.has-dropdown.is-hoverable:hover .navbar-link{background-color:rgba(0,0,0,0) !important}.navbar.is-transparent .navbar-dropdown a.navbar-item:focus,.navbar.is-transparent .navbar-dropdown a.navbar-item:hover{background-color:hsl(0,0%,96%);color:hsl(0,0%,4%)}.navbar.is-transparent .navbar-dropdown a.navbar-item.is-active{background-color:hsl(0,0%,96%);color:#00875f}.navbar-burger{display:none}.navbar-item,.navbar-link{align-items:center;display:flex}.navbar-item.has-dropdown{align-items:stretch}.navbar-item.has-dropdown-up .navbar-link::after{transform:rotate(135deg) translate(0.25em, -0.25em)}.navbar-item.has-dropdown-up .navbar-dropdown{border-bottom:2px solid hsl(0,0%,86%);border-radius:6px 6px 0 0;border-top:none;bottom:100%;box-shadow:0 -8px 8px hsla(0,0%,4%,.1);top:auto}.navbar-item.is-active .navbar-dropdown,.navbar-item.is-hoverable:focus .navbar-dropdown,.navbar-item.is-hoverable:focus-within .navbar-dropdown,.navbar-item.is-hoverable:hover .navbar-dropdown{display:block}.navbar.is-spaced .navbar-item.is-active .navbar-dropdown,.navbar-item.is-active .navbar-dropdown.is-boxed,.navbar.is-spaced .navbar-item.is-hoverable:focus .navbar-dropdown,.navbar-item.is-hoverable:focus .navbar-dropdown.is-boxed,.navbar.is-spaced .navbar-item.is-hoverable:focus-within .navbar-dropdown,.navbar-item.is-hoverable:focus-within .navbar-dropdown.is-boxed,.navbar.is-spaced .navbar-item.is-hoverable:hover .navbar-dropdown,.navbar-item.is-hoverable:hover .navbar-dropdown.is-boxed{opacity:1;pointer-events:auto;transform:translateY(0)}.navbar-menu{flex-grow:1;flex-shrink:0}.navbar-start{justify-content:flex-start;margin-right:auto}.navbar-end{justify-content:flex-end;margin-left:auto}.navbar-dropdown{background-color:#fff;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:2px solid hsl(0,0%,86%);box-shadow:0 8px 8px hsla(0,0%,4%,.1);display:none;font-size:.875rem;left:0;min-width:100%;position:absolute;top:100%;z-index:20}.navbar-dropdown .navbar-item{padding:.375rem 1rem;white-space:nowrap}.navbar-dropdown a.navbar-item{padding-right:3rem}.navbar-dropdown a.navbar-item:focus,.navbar-dropdown a.navbar-item:hover{background-color:hsl(0,0%,96%);color:hsl(0,0%,4%)}.navbar-dropdown a.navbar-item.is-active{background-color:hsl(0,0%,96%);color:#00875f}.navbar.is-spaced .navbar-dropdown,.navbar-dropdown.is-boxed{border-radius:6px;border-top:none;box-shadow:0 8px 8px hsla(0,0%,4%,.1),0 0 0 1px hsla(0,0%,4%,.1);display:block;opacity:0;pointer-events:none;top:calc(100% + (-4px));transform:translateY(-5px);transition-duration:86ms;transition-property:opacity,transform}.navbar-dropdown.is-right{left:auto;right:0}.navbar-divider{display:block}.navbar>.container .navbar-brand,.container>.navbar .navbar-brand{margin-left:-0.75rem}.navbar>.container .navbar-menu,.container>.navbar .navbar-menu{margin-right:-0.75rem}.navbar.is-fixed-bottom-desktop,.navbar.is-fixed-top-desktop{left:0;position:fixed;right:0;z-index:30}.navbar.is-fixed-bottom-desktop{bottom:0}.navbar.is-fixed-bottom-desktop.has-shadow{box-shadow:0 -2px 3px hsla(0,0%,4%,.1)}.navbar.is-fixed-top-desktop{top:0}html.has-navbar-fixed-top-desktop,body.has-navbar-fixed-top-desktop{padding-top:3.25rem}html.has-navbar-fixed-bottom-desktop,body.has-navbar-fixed-bottom-desktop{padding-bottom:3.25rem}html.has-spaced-navbar-fixed-top,body.has-spaced-navbar-fixed-top{padding-top:5.25rem}html.has-spaced-navbar-fixed-bottom,body.has-spaced-navbar-fixed-bottom{padding-bottom:5.25rem}a.navbar-item.is-active,.navbar-link.is-active{color:hsl(0,0%,4%)}a.navbar-item.is-active:not(:focus):not(:hover),.navbar-link.is-active:not(:focus):not(:hover){background-color:rgba(0,0,0,0)}.navbar-item.has-dropdown:focus .navbar-link,.navbar-item.has-dropdown:hover .navbar-link,.navbar-item.has-dropdown.is-active .navbar-link{background-color:hsl(0,0%,98%)}}.hero.is-fullheight-with-navbar{min-height:calc(100vh - 3.25rem)}.pagination{font-size:1rem;margin:-0.25rem}.pagination.is-small{font-size:.75rem}.pagination.is-medium{font-size:1.25rem}.pagination.is-large{font-size:1.5rem}.pagination.is-rounded .pagination-previous,.pagination.is-rounded .pagination-next{padding-left:1em;padding-right:1em;border-radius:9999px}.pagination.is-rounded .pagination-link{border-radius:9999px}.pagination,.pagination-list{align-items:center;display:flex;justify-content:center;text-align:center}.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis{font-size:1em;justify-content:center;margin:.25rem;padding-left:.5em;padding-right:.5em;text-align:center}.pagination-previous,.pagination-next,.pagination-link{border-color:hsl(0,0%,86%);color:hsl(0,0%,21%);min-width:2.5em}.pagination-previous:hover,.pagination-next:hover,.pagination-link:hover{border-color:hsl(0,0%,71%);color:hsl(0,0%,21%)}.pagination-previous:focus,.pagination-next:focus,.pagination-link:focus{border-color:#00875f}.pagination-previous:active,.pagination-next:active,.pagination-link:active{box-shadow:inset 0 1px 2px hsla(0,0%,4%,.2)}.pagination-previous[disabled],.pagination-previous.is-disabled,.pagination-next[disabled],.pagination-next.is-disabled,.pagination-link[disabled],.pagination-link.is-disabled{background-color:hsl(0,0%,86%);border-color:hsl(0,0%,86%);box-shadow:none;color:hsl(0,0%,48%);opacity:.5}.pagination-previous,.pagination-next{padding-left:.75em;padding-right:.75em;white-space:nowrap}.pagination-link.is-current{background-color:#00875f;border-color:#00875f;color:#fff}.pagination-ellipsis{color:hsl(0,0%,71%);pointer-events:none}.pagination-list{flex-wrap:wrap}.pagination-list li{list-style:none}@media screen and (max-width: 768px){.pagination{flex-wrap:wrap}.pagination-previous,.pagination-next{flex-grow:1;flex-shrink:1}.pagination-list li{flex-grow:1;flex-shrink:1}}@media screen and (min-width: 769px),print{.pagination-list{flex-grow:1;flex-shrink:1;justify-content:flex-start;order:1}.pagination-previous,.pagination-next,.pagination-link,.pagination-ellipsis{margin-bottom:0;margin-top:0}.pagination-previous{order:2}.pagination-next{order:3}.pagination{justify-content:space-between;margin-bottom:0;margin-top:0}.pagination.is-centered .pagination-previous{order:1}.pagination.is-centered .pagination-list{justify-content:center;order:2}.pagination.is-centered .pagination-next{order:3}.pagination.is-right .pagination-previous{order:1}.pagination.is-right .pagination-next{order:2}.pagination.is-right .pagination-list{justify-content:flex-end;order:3}}.panel{border-radius:6px;box-shadow:0 .5em 1em -0.125em hsla(0,0%,4%,.1),0 0px 0 1px hsla(0,0%,4%,.02);font-size:1rem}.panel:not(:last-child){margin-bottom:1.5rem}.panel.is-white .panel-heading{background-color:#fff;color:hsl(0,0%,4%)}.panel.is-white .panel-tabs a.is-active{border-bottom-color:#fff}.panel.is-white .panel-block.is-active .panel-icon{color:#fff}.panel.is-black .panel-heading{background-color:hsl(0,0%,4%);color:#fff}.panel.is-black .panel-tabs a.is-active{border-bottom-color:hsl(0,0%,4%)}.panel.is-black .panel-block.is-active .panel-icon{color:hsl(0,0%,4%)}.panel.is-light .panel-heading{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.panel.is-light .panel-tabs a.is-active{border-bottom-color:hsl(0,0%,96%)}.panel.is-light .panel-block.is-active .panel-icon{color:hsl(0,0%,96%)}.panel.is-dark .panel-heading{background-color:hsl(0,0%,21%);color:#fff}.panel.is-dark .panel-tabs a.is-active{border-bottom-color:hsl(0,0%,21%)}.panel.is-dark .panel-block.is-active .panel-icon{color:hsl(0,0%,21%)}.panel.is-primary .panel-heading{background-color:#00875f;color:#fff}.panel.is-primary .panel-tabs a.is-active{border-bottom-color:#00875f}.panel.is-primary .panel-block.is-active .panel-icon{color:#00875f}.panel.is-link .panel-heading{background-color:hsl(229,53%,53%);color:#fff}.panel.is-link .panel-tabs a.is-active{border-bottom-color:hsl(229,53%,53%)}.panel.is-link .panel-block.is-active .panel-icon{color:hsl(229,53%,53%)}.panel.is-info .panel-heading{background-color:hsl(207,61%,53%);color:#fff}.panel.is-info .panel-tabs a.is-active{border-bottom-color:hsl(207,61%,53%)}.panel.is-info .panel-block.is-active .panel-icon{color:hsl(207,61%,53%)}.panel.is-success .panel-heading{background-color:hsl(153,53%,53%);color:#fff}.panel.is-success .panel-tabs a.is-active{border-bottom-color:hsl(153,53%,53%)}.panel.is-success .panel-block.is-active .panel-icon{color:hsl(153,53%,53%)}.panel.is-warning .panel-heading{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.panel.is-warning .panel-tabs a.is-active{border-bottom-color:hsl(44,100%,77%)}.panel.is-warning .panel-block.is-active .panel-icon{color:hsl(44,100%,77%)}.panel.is-danger .panel-heading{background-color:hsl(348,86%,61%);color:#fff}.panel.is-danger .panel-tabs a.is-active{border-bottom-color:hsl(348,86%,61%)}.panel.is-danger .panel-block.is-active .panel-icon{color:hsl(348,86%,61%)}.panel-tabs:not(:last-child),.panel-block:not(:last-child){border-bottom:1px solid hsl(0,0%,93%)}.panel-heading{background-color:hsl(0,0%,93%);border-radius:6px 6px 0 0;color:hsl(0,0%,21%);font-size:1.25em;font-weight:700;line-height:1.25;padding:.75em 1em}.panel-tabs{align-items:flex-end;display:flex;font-size:.875em;justify-content:center}.panel-tabs a{border-bottom:1px solid hsl(0,0%,86%);margin-bottom:-1px;padding:.5em}.panel-tabs a.is-active{border-bottom-color:hsl(0,0%,29%);color:hsl(0,0%,21%)}.panel-list a{color:hsl(0,0%,29%)}.panel-list a:hover{color:#00875f}.panel-block{align-items:center;color:hsl(0,0%,21%);display:flex;justify-content:flex-start;padding:.5em .75em}.panel-block input[type=checkbox]{margin-right:.75em}.panel-block>.control{flex-grow:1;flex-shrink:1;width:100%}.panel-block.is-wrapped{flex-wrap:wrap}.panel-block.is-active{border-left-color:#00875f;color:hsl(0,0%,21%)}.panel-block.is-active .panel-icon{color:#00875f}.panel-block:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}a.panel-block,label.panel-block{cursor:pointer}a.panel-block:hover,label.panel-block:hover{background-color:hsl(0,0%,96%)}.panel-icon{display:inline-block;font-size:14px;height:1em;line-height:1em;text-align:center;vertical-align:top;width:1em;color:hsl(0,0%,48%);margin-right:.75em}.panel-icon .fa{font-size:inherit;line-height:inherit}.tabs{-webkit-overflow-scrolling:touch;align-items:stretch;display:flex;font-size:1rem;justify-content:space-between;overflow:hidden;overflow-x:auto;white-space:nowrap}.tabs a{align-items:center;border-bottom-color:hsl(0,0%,86%);border-bottom-style:solid;border-bottom-width:1px;color:hsl(0,0%,29%);display:flex;justify-content:center;margin-bottom:-1px;padding:.5em 1em;vertical-align:top}.tabs a:hover{border-bottom-color:hsl(0,0%,21%);color:hsl(0,0%,21%)}.tabs li{display:block}.tabs li.is-active a{border-bottom-color:#00875f;color:#00875f}.tabs ul{align-items:center;border-bottom-color:hsl(0,0%,86%);border-bottom-style:solid;border-bottom-width:1px;display:flex;flex-grow:1;flex-shrink:0;justify-content:flex-start}.tabs ul.is-left{padding-right:.75em}.tabs ul.is-center{flex:none;justify-content:center;padding-left:.75em;padding-right:.75em}.tabs ul.is-right{justify-content:flex-end;padding-left:.75em}.tabs .icon:first-child{margin-right:.5em}.tabs .icon:last-child{margin-left:.5em}.tabs.is-centered ul{justify-content:center}.tabs.is-right ul{justify-content:flex-end}.tabs.is-boxed a{border:1px solid rgba(0,0,0,0);border-radius:4px 4px 0 0}.tabs.is-boxed a:hover{background-color:hsl(0,0%,96%);border-bottom-color:hsl(0,0%,86%)}.tabs.is-boxed li.is-active a{background-color:#fff;border-color:hsl(0,0%,86%);border-bottom-color:rgba(0,0,0,0) !important}.tabs.is-fullwidth li{flex-grow:1;flex-shrink:0}.tabs.is-toggle a{border-color:hsl(0,0%,86%);border-style:solid;border-width:1px;margin-bottom:0;position:relative}.tabs.is-toggle a:hover{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,71%);z-index:2}.tabs.is-toggle li+li{margin-left:-1px}.tabs.is-toggle li:first-child a{border-top-left-radius:4px;border-bottom-left-radius:4px}.tabs.is-toggle li:last-child a{border-top-right-radius:4px;border-bottom-right-radius:4px}.tabs.is-toggle li.is-active a{background-color:#00875f;border-color:#00875f;color:#fff;z-index:1}.tabs.is-toggle ul{border-bottom:none}.tabs.is-toggle.is-toggle-rounded li:first-child a{border-bottom-left-radius:9999px;border-top-left-radius:9999px;padding-left:1.25em}.tabs.is-toggle.is-toggle-rounded li:last-child a{border-bottom-right-radius:9999px;border-top-right-radius:9999px;padding-right:1.25em}.tabs.is-small{font-size:.75rem}.tabs.is-medium{font-size:1.25rem}.tabs.is-large{font-size:1.5rem}.column{display:block;flex-basis:0;flex-grow:1;flex-shrink:1;padding:.75rem}.columns.is-mobile>.column.is-narrow{flex:none;width:unset}.columns.is-mobile>.column.is-full{flex:none;width:100%}.columns.is-mobile>.column.is-three-quarters{flex:none;width:75%}.columns.is-mobile>.column.is-two-thirds{flex:none;width:66.6666%}.columns.is-mobile>.column.is-half{flex:none;width:50%}.columns.is-mobile>.column.is-one-third{flex:none;width:33.3333%}.columns.is-mobile>.column.is-one-quarter{flex:none;width:25%}.columns.is-mobile>.column.is-one-fifth{flex:none;width:20%}.columns.is-mobile>.column.is-two-fifths{flex:none;width:40%}.columns.is-mobile>.column.is-three-fifths{flex:none;width:60%}.columns.is-mobile>.column.is-four-fifths{flex:none;width:80%}.columns.is-mobile>.column.is-offset-three-quarters{margin-left:75%}.columns.is-mobile>.column.is-offset-two-thirds{margin-left:66.6666%}.columns.is-mobile>.column.is-offset-half{margin-left:50%}.columns.is-mobile>.column.is-offset-one-third{margin-left:33.3333%}.columns.is-mobile>.column.is-offset-one-quarter{margin-left:25%}.columns.is-mobile>.column.is-offset-one-fifth{margin-left:20%}.columns.is-mobile>.column.is-offset-two-fifths{margin-left:40%}.columns.is-mobile>.column.is-offset-three-fifths{margin-left:60%}.columns.is-mobile>.column.is-offset-four-fifths{margin-left:80%}.columns.is-mobile>.column.is-0{flex:none;width:0%}.columns.is-mobile>.column.is-offset-0{margin-left:0%}.columns.is-mobile>.column.is-1{flex:none;width:8.33333337%}.columns.is-mobile>.column.is-offset-1{margin-left:8.33333337%}.columns.is-mobile>.column.is-2{flex:none;width:16.66666674%}.columns.is-mobile>.column.is-offset-2{margin-left:16.66666674%}.columns.is-mobile>.column.is-3{flex:none;width:25%}.columns.is-mobile>.column.is-offset-3{margin-left:25%}.columns.is-mobile>.column.is-4{flex:none;width:33.33333337%}.columns.is-mobile>.column.is-offset-4{margin-left:33.33333337%}.columns.is-mobile>.column.is-5{flex:none;width:41.66666674%}.columns.is-mobile>.column.is-offset-5{margin-left:41.66666674%}.columns.is-mobile>.column.is-6{flex:none;width:50%}.columns.is-mobile>.column.is-offset-6{margin-left:50%}.columns.is-mobile>.column.is-7{flex:none;width:58.33333337%}.columns.is-mobile>.column.is-offset-7{margin-left:58.33333337%}.columns.is-mobile>.column.is-8{flex:none;width:66.66666674%}.columns.is-mobile>.column.is-offset-8{margin-left:66.66666674%}.columns.is-mobile>.column.is-9{flex:none;width:75%}.columns.is-mobile>.column.is-offset-9{margin-left:75%}.columns.is-mobile>.column.is-10{flex:none;width:83.33333337%}.columns.is-mobile>.column.is-offset-10{margin-left:83.33333337%}.columns.is-mobile>.column.is-11{flex:none;width:91.66666674%}.columns.is-mobile>.column.is-offset-11{margin-left:91.66666674%}.columns.is-mobile>.column.is-12{flex:none;width:100%}.columns.is-mobile>.column.is-offset-12{margin-left:100%}@media screen and (max-width: 768px){.column.is-narrow-mobile{flex:none;width:unset}.column.is-full-mobile{flex:none;width:100%}.column.is-three-quarters-mobile{flex:none;width:75%}.column.is-two-thirds-mobile{flex:none;width:66.6666%}.column.is-half-mobile{flex:none;width:50%}.column.is-one-third-mobile{flex:none;width:33.3333%}.column.is-one-quarter-mobile{flex:none;width:25%}.column.is-one-fifth-mobile{flex:none;width:20%}.column.is-two-fifths-mobile{flex:none;width:40%}.column.is-three-fifths-mobile{flex:none;width:60%}.column.is-four-fifths-mobile{flex:none;width:80%}.column.is-offset-three-quarters-mobile{margin-left:75%}.column.is-offset-two-thirds-mobile{margin-left:66.6666%}.column.is-offset-half-mobile{margin-left:50%}.column.is-offset-one-third-mobile{margin-left:33.3333%}.column.is-offset-one-quarter-mobile{margin-left:25%}.column.is-offset-one-fifth-mobile{margin-left:20%}.column.is-offset-two-fifths-mobile{margin-left:40%}.column.is-offset-three-fifths-mobile{margin-left:60%}.column.is-offset-four-fifths-mobile{margin-left:80%}.column.is-0-mobile{flex:none;width:0%}.column.is-offset-0-mobile{margin-left:0%}.column.is-1-mobile{flex:none;width:8.33333337%}.column.is-offset-1-mobile{margin-left:8.33333337%}.column.is-2-mobile{flex:none;width:16.66666674%}.column.is-offset-2-mobile{margin-left:16.66666674%}.column.is-3-mobile{flex:none;width:25%}.column.is-offset-3-mobile{margin-left:25%}.column.is-4-mobile{flex:none;width:33.33333337%}.column.is-offset-4-mobile{margin-left:33.33333337%}.column.is-5-mobile{flex:none;width:41.66666674%}.column.is-offset-5-mobile{margin-left:41.66666674%}.column.is-6-mobile{flex:none;width:50%}.column.is-offset-6-mobile{margin-left:50%}.column.is-7-mobile{flex:none;width:58.33333337%}.column.is-offset-7-mobile{margin-left:58.33333337%}.column.is-8-mobile{flex:none;width:66.66666674%}.column.is-offset-8-mobile{margin-left:66.66666674%}.column.is-9-mobile{flex:none;width:75%}.column.is-offset-9-mobile{margin-left:75%}.column.is-10-mobile{flex:none;width:83.33333337%}.column.is-offset-10-mobile{margin-left:83.33333337%}.column.is-11-mobile{flex:none;width:91.66666674%}.column.is-offset-11-mobile{margin-left:91.66666674%}.column.is-12-mobile{flex:none;width:100%}.column.is-offset-12-mobile{margin-left:100%}}@media screen and (min-width: 769px),print{.column.is-narrow,.column.is-narrow-tablet{flex:none;width:unset}.column.is-full,.column.is-full-tablet{flex:none;width:100%}.column.is-three-quarters,.column.is-three-quarters-tablet{flex:none;width:75%}.column.is-two-thirds,.column.is-two-thirds-tablet{flex:none;width:66.6666%}.column.is-half,.column.is-half-tablet{flex:none;width:50%}.column.is-one-third,.column.is-one-third-tablet{flex:none;width:33.3333%}.column.is-one-quarter,.column.is-one-quarter-tablet{flex:none;width:25%}.column.is-one-fifth,.column.is-one-fifth-tablet{flex:none;width:20%}.column.is-two-fifths,.column.is-two-fifths-tablet{flex:none;width:40%}.column.is-three-fifths,.column.is-three-fifths-tablet{flex:none;width:60%}.column.is-four-fifths,.column.is-four-fifths-tablet{flex:none;width:80%}.column.is-offset-three-quarters,.column.is-offset-three-quarters-tablet{margin-left:75%}.column.is-offset-two-thirds,.column.is-offset-two-thirds-tablet{margin-left:66.6666%}.column.is-offset-half,.column.is-offset-half-tablet{margin-left:50%}.column.is-offset-one-third,.column.is-offset-one-third-tablet{margin-left:33.3333%}.column.is-offset-one-quarter,.column.is-offset-one-quarter-tablet{margin-left:25%}.column.is-offset-one-fifth,.column.is-offset-one-fifth-tablet{margin-left:20%}.column.is-offset-two-fifths,.column.is-offset-two-fifths-tablet{margin-left:40%}.column.is-offset-three-fifths,.column.is-offset-three-fifths-tablet{margin-left:60%}.column.is-offset-four-fifths,.column.is-offset-four-fifths-tablet{margin-left:80%}.column.is-0,.column.is-0-tablet{flex:none;width:0%}.column.is-offset-0,.column.is-offset-0-tablet{margin-left:0%}.column.is-1,.column.is-1-tablet{flex:none;width:8.33333337%}.column.is-offset-1,.column.is-offset-1-tablet{margin-left:8.33333337%}.column.is-2,.column.is-2-tablet{flex:none;width:16.66666674%}.column.is-offset-2,.column.is-offset-2-tablet{margin-left:16.66666674%}.column.is-3,.column.is-3-tablet{flex:none;width:25%}.column.is-offset-3,.column.is-offset-3-tablet{margin-left:25%}.column.is-4,.column.is-4-tablet{flex:none;width:33.33333337%}.column.is-offset-4,.column.is-offset-4-tablet{margin-left:33.33333337%}.column.is-5,.column.is-5-tablet{flex:none;width:41.66666674%}.column.is-offset-5,.column.is-offset-5-tablet{margin-left:41.66666674%}.column.is-6,.column.is-6-tablet{flex:none;width:50%}.column.is-offset-6,.column.is-offset-6-tablet{margin-left:50%}.column.is-7,.column.is-7-tablet{flex:none;width:58.33333337%}.column.is-offset-7,.column.is-offset-7-tablet{margin-left:58.33333337%}.column.is-8,.column.is-8-tablet{flex:none;width:66.66666674%}.column.is-offset-8,.column.is-offset-8-tablet{margin-left:66.66666674%}.column.is-9,.column.is-9-tablet{flex:none;width:75%}.column.is-offset-9,.column.is-offset-9-tablet{margin-left:75%}.column.is-10,.column.is-10-tablet{flex:none;width:83.33333337%}.column.is-offset-10,.column.is-offset-10-tablet{margin-left:83.33333337%}.column.is-11,.column.is-11-tablet{flex:none;width:91.66666674%}.column.is-offset-11,.column.is-offset-11-tablet{margin-left:91.66666674%}.column.is-12,.column.is-12-tablet{flex:none;width:100%}.column.is-offset-12,.column.is-offset-12-tablet{margin-left:100%}}@media screen and (max-width: 1023px){.column.is-narrow-touch{flex:none;width:unset}.column.is-full-touch{flex:none;width:100%}.column.is-three-quarters-touch{flex:none;width:75%}.column.is-two-thirds-touch{flex:none;width:66.6666%}.column.is-half-touch{flex:none;width:50%}.column.is-one-third-touch{flex:none;width:33.3333%}.column.is-one-quarter-touch{flex:none;width:25%}.column.is-one-fifth-touch{flex:none;width:20%}.column.is-two-fifths-touch{flex:none;width:40%}.column.is-three-fifths-touch{flex:none;width:60%}.column.is-four-fifths-touch{flex:none;width:80%}.column.is-offset-three-quarters-touch{margin-left:75%}.column.is-offset-two-thirds-touch{margin-left:66.6666%}.column.is-offset-half-touch{margin-left:50%}.column.is-offset-one-third-touch{margin-left:33.3333%}.column.is-offset-one-quarter-touch{margin-left:25%}.column.is-offset-one-fifth-touch{margin-left:20%}.column.is-offset-two-fifths-touch{margin-left:40%}.column.is-offset-three-fifths-touch{margin-left:60%}.column.is-offset-four-fifths-touch{margin-left:80%}.column.is-0-touch{flex:none;width:0%}.column.is-offset-0-touch{margin-left:0%}.column.is-1-touch{flex:none;width:8.33333337%}.column.is-offset-1-touch{margin-left:8.33333337%}.column.is-2-touch{flex:none;width:16.66666674%}.column.is-offset-2-touch{margin-left:16.66666674%}.column.is-3-touch{flex:none;width:25%}.column.is-offset-3-touch{margin-left:25%}.column.is-4-touch{flex:none;width:33.33333337%}.column.is-offset-4-touch{margin-left:33.33333337%}.column.is-5-touch{flex:none;width:41.66666674%}.column.is-offset-5-touch{margin-left:41.66666674%}.column.is-6-touch{flex:none;width:50%}.column.is-offset-6-touch{margin-left:50%}.column.is-7-touch{flex:none;width:58.33333337%}.column.is-offset-7-touch{margin-left:58.33333337%}.column.is-8-touch{flex:none;width:66.66666674%}.column.is-offset-8-touch{margin-left:66.66666674%}.column.is-9-touch{flex:none;width:75%}.column.is-offset-9-touch{margin-left:75%}.column.is-10-touch{flex:none;width:83.33333337%}.column.is-offset-10-touch{margin-left:83.33333337%}.column.is-11-touch{flex:none;width:91.66666674%}.column.is-offset-11-touch{margin-left:91.66666674%}.column.is-12-touch{flex:none;width:100%}.column.is-offset-12-touch{margin-left:100%}}@media screen and (min-width: 1024px){.column.is-narrow-desktop{flex:none;width:unset}.column.is-full-desktop{flex:none;width:100%}.column.is-three-quarters-desktop{flex:none;width:75%}.column.is-two-thirds-desktop{flex:none;width:66.6666%}.column.is-half-desktop{flex:none;width:50%}.column.is-one-third-desktop{flex:none;width:33.3333%}.column.is-one-quarter-desktop{flex:none;width:25%}.column.is-one-fifth-desktop{flex:none;width:20%}.column.is-two-fifths-desktop{flex:none;width:40%}.column.is-three-fifths-desktop{flex:none;width:60%}.column.is-four-fifths-desktop{flex:none;width:80%}.column.is-offset-three-quarters-desktop{margin-left:75%}.column.is-offset-two-thirds-desktop{margin-left:66.6666%}.column.is-offset-half-desktop{margin-left:50%}.column.is-offset-one-third-desktop{margin-left:33.3333%}.column.is-offset-one-quarter-desktop{margin-left:25%}.column.is-offset-one-fifth-desktop{margin-left:20%}.column.is-offset-two-fifths-desktop{margin-left:40%}.column.is-offset-three-fifths-desktop{margin-left:60%}.column.is-offset-four-fifths-desktop{margin-left:80%}.column.is-0-desktop{flex:none;width:0%}.column.is-offset-0-desktop{margin-left:0%}.column.is-1-desktop{flex:none;width:8.33333337%}.column.is-offset-1-desktop{margin-left:8.33333337%}.column.is-2-desktop{flex:none;width:16.66666674%}.column.is-offset-2-desktop{margin-left:16.66666674%}.column.is-3-desktop{flex:none;width:25%}.column.is-offset-3-desktop{margin-left:25%}.column.is-4-desktop{flex:none;width:33.33333337%}.column.is-offset-4-desktop{margin-left:33.33333337%}.column.is-5-desktop{flex:none;width:41.66666674%}.column.is-offset-5-desktop{margin-left:41.66666674%}.column.is-6-desktop{flex:none;width:50%}.column.is-offset-6-desktop{margin-left:50%}.column.is-7-desktop{flex:none;width:58.33333337%}.column.is-offset-7-desktop{margin-left:58.33333337%}.column.is-8-desktop{flex:none;width:66.66666674%}.column.is-offset-8-desktop{margin-left:66.66666674%}.column.is-9-desktop{flex:none;width:75%}.column.is-offset-9-desktop{margin-left:75%}.column.is-10-desktop{flex:none;width:83.33333337%}.column.is-offset-10-desktop{margin-left:83.33333337%}.column.is-11-desktop{flex:none;width:91.66666674%}.column.is-offset-11-desktop{margin-left:91.66666674%}.column.is-12-desktop{flex:none;width:100%}.column.is-offset-12-desktop{margin-left:100%}}@media screen and (min-width: 1216px){.column.is-narrow-widescreen{flex:none;width:unset}.column.is-full-widescreen{flex:none;width:100%}.column.is-three-quarters-widescreen{flex:none;width:75%}.column.is-two-thirds-widescreen{flex:none;width:66.6666%}.column.is-half-widescreen{flex:none;width:50%}.column.is-one-third-widescreen{flex:none;width:33.3333%}.column.is-one-quarter-widescreen{flex:none;width:25%}.column.is-one-fifth-widescreen{flex:none;width:20%}.column.is-two-fifths-widescreen{flex:none;width:40%}.column.is-three-fifths-widescreen{flex:none;width:60%}.column.is-four-fifths-widescreen{flex:none;width:80%}.column.is-offset-three-quarters-widescreen{margin-left:75%}.column.is-offset-two-thirds-widescreen{margin-left:66.6666%}.column.is-offset-half-widescreen{margin-left:50%}.column.is-offset-one-third-widescreen{margin-left:33.3333%}.column.is-offset-one-quarter-widescreen{margin-left:25%}.column.is-offset-one-fifth-widescreen{margin-left:20%}.column.is-offset-two-fifths-widescreen{margin-left:40%}.column.is-offset-three-fifths-widescreen{margin-left:60%}.column.is-offset-four-fifths-widescreen{margin-left:80%}.column.is-0-widescreen{flex:none;width:0%}.column.is-offset-0-widescreen{margin-left:0%}.column.is-1-widescreen{flex:none;width:8.33333337%}.column.is-offset-1-widescreen{margin-left:8.33333337%}.column.is-2-widescreen{flex:none;width:16.66666674%}.column.is-offset-2-widescreen{margin-left:16.66666674%}.column.is-3-widescreen{flex:none;width:25%}.column.is-offset-3-widescreen{margin-left:25%}.column.is-4-widescreen{flex:none;width:33.33333337%}.column.is-offset-4-widescreen{margin-left:33.33333337%}.column.is-5-widescreen{flex:none;width:41.66666674%}.column.is-offset-5-widescreen{margin-left:41.66666674%}.column.is-6-widescreen{flex:none;width:50%}.column.is-offset-6-widescreen{margin-left:50%}.column.is-7-widescreen{flex:none;width:58.33333337%}.column.is-offset-7-widescreen{margin-left:58.33333337%}.column.is-8-widescreen{flex:none;width:66.66666674%}.column.is-offset-8-widescreen{margin-left:66.66666674%}.column.is-9-widescreen{flex:none;width:75%}.column.is-offset-9-widescreen{margin-left:75%}.column.is-10-widescreen{flex:none;width:83.33333337%}.column.is-offset-10-widescreen{margin-left:83.33333337%}.column.is-11-widescreen{flex:none;width:91.66666674%}.column.is-offset-11-widescreen{margin-left:91.66666674%}.column.is-12-widescreen{flex:none;width:100%}.column.is-offset-12-widescreen{margin-left:100%}}@media screen and (min-width: 1408px){.column.is-narrow-fullhd{flex:none;width:unset}.column.is-full-fullhd{flex:none;width:100%}.column.is-three-quarters-fullhd{flex:none;width:75%}.column.is-two-thirds-fullhd{flex:none;width:66.6666%}.column.is-half-fullhd{flex:none;width:50%}.column.is-one-third-fullhd{flex:none;width:33.3333%}.column.is-one-quarter-fullhd{flex:none;width:25%}.column.is-one-fifth-fullhd{flex:none;width:20%}.column.is-two-fifths-fullhd{flex:none;width:40%}.column.is-three-fifths-fullhd{flex:none;width:60%}.column.is-four-fifths-fullhd{flex:none;width:80%}.column.is-offset-three-quarters-fullhd{margin-left:75%}.column.is-offset-two-thirds-fullhd{margin-left:66.6666%}.column.is-offset-half-fullhd{margin-left:50%}.column.is-offset-one-third-fullhd{margin-left:33.3333%}.column.is-offset-one-quarter-fullhd{margin-left:25%}.column.is-offset-one-fifth-fullhd{margin-left:20%}.column.is-offset-two-fifths-fullhd{margin-left:40%}.column.is-offset-three-fifths-fullhd{margin-left:60%}.column.is-offset-four-fifths-fullhd{margin-left:80%}.column.is-0-fullhd{flex:none;width:0%}.column.is-offset-0-fullhd{margin-left:0%}.column.is-1-fullhd{flex:none;width:8.33333337%}.column.is-offset-1-fullhd{margin-left:8.33333337%}.column.is-2-fullhd{flex:none;width:16.66666674%}.column.is-offset-2-fullhd{margin-left:16.66666674%}.column.is-3-fullhd{flex:none;width:25%}.column.is-offset-3-fullhd{margin-left:25%}.column.is-4-fullhd{flex:none;width:33.33333337%}.column.is-offset-4-fullhd{margin-left:33.33333337%}.column.is-5-fullhd{flex:none;width:41.66666674%}.column.is-offset-5-fullhd{margin-left:41.66666674%}.column.is-6-fullhd{flex:none;width:50%}.column.is-offset-6-fullhd{margin-left:50%}.column.is-7-fullhd{flex:none;width:58.33333337%}.column.is-offset-7-fullhd{margin-left:58.33333337%}.column.is-8-fullhd{flex:none;width:66.66666674%}.column.is-offset-8-fullhd{margin-left:66.66666674%}.column.is-9-fullhd{flex:none;width:75%}.column.is-offset-9-fullhd{margin-left:75%}.column.is-10-fullhd{flex:none;width:83.33333337%}.column.is-offset-10-fullhd{margin-left:83.33333337%}.column.is-11-fullhd{flex:none;width:91.66666674%}.column.is-offset-11-fullhd{margin-left:91.66666674%}.column.is-12-fullhd{flex:none;width:100%}.column.is-offset-12-fullhd{margin-left:100%}}.columns{margin-left:-0.75rem;margin-right:-0.75rem;margin-top:-0.75rem}.columns:last-child{margin-bottom:-0.75rem}.columns:not(:last-child){margin-bottom:calc(1.5rem - 0.75rem)}.columns.is-centered{justify-content:center}.columns.is-gapless{margin-left:0;margin-right:0;margin-top:0}.columns.is-gapless>.column{margin:0;padding:0 !important}.columns.is-gapless:not(:last-child){margin-bottom:1.5rem}.columns.is-gapless:last-child{margin-bottom:0}.columns.is-mobile{display:flex}.columns.is-multiline{flex-wrap:wrap}.columns.is-vcentered{align-items:center}@media screen and (min-width: 769px),print{.columns:not(.is-desktop){display:flex}}@media screen and (min-width: 1024px){.columns.is-desktop{display:flex}}.columns.is-variable{--columnGap: 0.75rem;margin-left:calc(-1*var(--columnGap));margin-right:calc(-1*var(--columnGap))}.columns.is-variable>.column{padding-left:var(--columnGap);padding-right:var(--columnGap)}.columns.is-variable.is-0{--columnGap: 0rem}@media screen and (max-width: 768px){.columns.is-variable.is-0-mobile{--columnGap: 0rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-0-tablet{--columnGap: 0rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-0-tablet-only{--columnGap: 0rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-0-touch{--columnGap: 0rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-0-desktop{--columnGap: 0rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-0-desktop-only{--columnGap: 0rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-0-widescreen{--columnGap: 0rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-0-widescreen-only{--columnGap: 0rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-0-fullhd{--columnGap: 0rem}}.columns.is-variable.is-1{--columnGap: 0.25rem}@media screen and (max-width: 768px){.columns.is-variable.is-1-mobile{--columnGap: 0.25rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-1-tablet{--columnGap: 0.25rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-1-tablet-only{--columnGap: 0.25rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-1-touch{--columnGap: 0.25rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-1-desktop{--columnGap: 0.25rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-1-desktop-only{--columnGap: 0.25rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-1-widescreen{--columnGap: 0.25rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-1-widescreen-only{--columnGap: 0.25rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-1-fullhd{--columnGap: 0.25rem}}.columns.is-variable.is-2{--columnGap: 0.5rem}@media screen and (max-width: 768px){.columns.is-variable.is-2-mobile{--columnGap: 0.5rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-2-tablet{--columnGap: 0.5rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-2-tablet-only{--columnGap: 0.5rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-2-touch{--columnGap: 0.5rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-2-desktop{--columnGap: 0.5rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-2-desktop-only{--columnGap: 0.5rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-2-widescreen{--columnGap: 0.5rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-2-widescreen-only{--columnGap: 0.5rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-2-fullhd{--columnGap: 0.5rem}}.columns.is-variable.is-3{--columnGap: 0.75rem}@media screen and (max-width: 768px){.columns.is-variable.is-3-mobile{--columnGap: 0.75rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-3-tablet{--columnGap: 0.75rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-3-tablet-only{--columnGap: 0.75rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-3-touch{--columnGap: 0.75rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-3-desktop{--columnGap: 0.75rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-3-desktop-only{--columnGap: 0.75rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-3-widescreen{--columnGap: 0.75rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-3-widescreen-only{--columnGap: 0.75rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-3-fullhd{--columnGap: 0.75rem}}.columns.is-variable.is-4{--columnGap: 1rem}@media screen and (max-width: 768px){.columns.is-variable.is-4-mobile{--columnGap: 1rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-4-tablet{--columnGap: 1rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-4-tablet-only{--columnGap: 1rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-4-touch{--columnGap: 1rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-4-desktop{--columnGap: 1rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-4-desktop-only{--columnGap: 1rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-4-widescreen{--columnGap: 1rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-4-widescreen-only{--columnGap: 1rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-4-fullhd{--columnGap: 1rem}}.columns.is-variable.is-5{--columnGap: 1.25rem}@media screen and (max-width: 768px){.columns.is-variable.is-5-mobile{--columnGap: 1.25rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-5-tablet{--columnGap: 1.25rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-5-tablet-only{--columnGap: 1.25rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-5-touch{--columnGap: 1.25rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-5-desktop{--columnGap: 1.25rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-5-desktop-only{--columnGap: 1.25rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-5-widescreen{--columnGap: 1.25rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-5-widescreen-only{--columnGap: 1.25rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-5-fullhd{--columnGap: 1.25rem}}.columns.is-variable.is-6{--columnGap: 1.5rem}@media screen and (max-width: 768px){.columns.is-variable.is-6-mobile{--columnGap: 1.5rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-6-tablet{--columnGap: 1.5rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-6-tablet-only{--columnGap: 1.5rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-6-touch{--columnGap: 1.5rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-6-desktop{--columnGap: 1.5rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-6-desktop-only{--columnGap: 1.5rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-6-widescreen{--columnGap: 1.5rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-6-widescreen-only{--columnGap: 1.5rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-6-fullhd{--columnGap: 1.5rem}}.columns.is-variable.is-7{--columnGap: 1.75rem}@media screen and (max-width: 768px){.columns.is-variable.is-7-mobile{--columnGap: 1.75rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-7-tablet{--columnGap: 1.75rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-7-tablet-only{--columnGap: 1.75rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-7-touch{--columnGap: 1.75rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-7-desktop{--columnGap: 1.75rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-7-desktop-only{--columnGap: 1.75rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-7-widescreen{--columnGap: 1.75rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-7-widescreen-only{--columnGap: 1.75rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-7-fullhd{--columnGap: 1.75rem}}.columns.is-variable.is-8{--columnGap: 2rem}@media screen and (max-width: 768px){.columns.is-variable.is-8-mobile{--columnGap: 2rem}}@media screen and (min-width: 769px),print{.columns.is-variable.is-8-tablet{--columnGap: 2rem}}@media screen and (min-width: 769px)and (max-width: 1023px){.columns.is-variable.is-8-tablet-only{--columnGap: 2rem}}@media screen and (max-width: 1023px){.columns.is-variable.is-8-touch{--columnGap: 2rem}}@media screen and (min-width: 1024px){.columns.is-variable.is-8-desktop{--columnGap: 2rem}}@media screen and (min-width: 1024px)and (max-width: 1215px){.columns.is-variable.is-8-desktop-only{--columnGap: 2rem}}@media screen and (min-width: 1216px){.columns.is-variable.is-8-widescreen{--columnGap: 2rem}}@media screen and (min-width: 1216px)and (max-width: 1407px){.columns.is-variable.is-8-widescreen-only{--columnGap: 2rem}}@media screen and (min-width: 1408px){.columns.is-variable.is-8-fullhd{--columnGap: 2rem}}.tile{align-items:stretch;display:block;flex-basis:0;flex-grow:1;flex-shrink:1;min-height:min-content}.tile.is-ancestor{margin-left:-0.75rem;margin-right:-0.75rem;margin-top:-0.75rem}.tile.is-ancestor:last-child{margin-bottom:-0.75rem}.tile.is-ancestor:not(:last-child){margin-bottom:.75rem}.tile.is-child{margin:0 !important}.tile.is-parent{padding:.75rem}.tile.is-vertical{flex-direction:column}.tile.is-vertical>.tile.is-child:not(:last-child){margin-bottom:1.5rem !important}@media screen and (min-width: 769px),print{.tile:not(.is-child){display:flex}.tile.is-1{flex:none;width:8.33333337%}.tile.is-2{flex:none;width:16.66666674%}.tile.is-3{flex:none;width:25%}.tile.is-4{flex:none;width:33.33333337%}.tile.is-5{flex:none;width:41.66666674%}.tile.is-6{flex:none;width:50%}.tile.is-7{flex:none;width:58.33333337%}.tile.is-8{flex:none;width:66.66666674%}.tile.is-9{flex:none;width:75%}.tile.is-10{flex:none;width:83.33333337%}.tile.is-11{flex:none;width:91.66666674%}.tile.is-12{flex:none;width:100%}}.has-text-white{color:#fff !important}a.has-text-white:hover,a.has-text-white:focus{color:hsl(0,0%,90%) !important}.has-background-white{background-color:#fff !important}.has-text-black{color:hsl(0,0%,4%) !important}a.has-text-black:hover,a.has-text-black:focus{color:#000 !important}.has-background-black{background-color:hsl(0,0%,4%) !important}.has-text-light{color:hsl(0,0%,96%) !important}a.has-text-light:hover,a.has-text-light:focus{color:hsl(0,0%,86%) !important}.has-background-light{background-color:hsl(0,0%,96%) !important}.has-text-dark{color:hsl(0,0%,21%) !important}a.has-text-dark:hover,a.has-text-dark:focus{color:hsl(0,0%,11%) !important}.has-background-dark{background-color:hsl(0,0%,21%) !important}.has-text-primary{color:#00875f !important}a.has-text-primary:hover,a.has-text-primary:focus{color:rgb(0,84,59.1111111111) !important}.has-background-primary{background-color:#00875f !important}.has-text-primary-light{color:hsl(162.2222222222,100%,96%) !important}a.has-text-primary-light:hover,a.has-text-primary-light:focus{color:hsl(162.2222222222,100%,86%) !important}.has-background-primary-light{background-color:hsl(162.2222222222,100%,96%) !important}.has-text-primary-dark{color:rgb(0,229.5,161.5) !important}a.has-text-primary-dark:hover,a.has-text-primary-dark:focus{color:rgb(25.5,255,187) !important}.has-background-primary-dark{background-color:rgb(0,229.5,161.5) !important}.has-text-link{color:hsl(229,53%,53%) !important}a.has-text-link:hover,a.has-text-link:focus{color:hsl(229,53%,43%) !important}.has-background-link{background-color:hsl(229,53%,53%) !important}.has-text-link-light{color:hsl(229,53%,96%) !important}a.has-text-link-light:hover,a.has-text-link-light:focus{color:hsl(229,53%,86%) !important}.has-background-link-light{background-color:hsl(229,53%,96%) !important}.has-text-link-dark{color:hsl(229,53%,47%) !important}a.has-text-link-dark:hover,a.has-text-link-dark:focus{color:hsl(229,53%,57%) !important}.has-background-link-dark{background-color:hsl(229,53%,47%) !important}.has-text-info{color:hsl(207,61%,53%) !important}a.has-text-info:hover,a.has-text-info:focus{color:hsl(207,61%,43%) !important}.has-background-info{background-color:hsl(207,61%,53%) !important}.has-text-info-light{color:hsl(207,61%,96%) !important}a.has-text-info-light:hover,a.has-text-info-light:focus{color:hsl(207,61%,86%) !important}.has-background-info-light{background-color:hsl(207,61%,96%) !important}.has-text-info-dark{color:hsl(207,61%,41%) !important}a.has-text-info-dark:hover,a.has-text-info-dark:focus{color:hsl(207,61%,51%) !important}.has-background-info-dark{background-color:hsl(207,61%,41%) !important}.has-text-success{color:hsl(153,53%,53%) !important}a.has-text-success:hover,a.has-text-success:focus{color:hsl(153,53%,43%) !important}.has-background-success{background-color:hsl(153,53%,53%) !important}.has-text-success-light{color:hsl(153,53%,96%) !important}a.has-text-success-light:hover,a.has-text-success-light:focus{color:hsl(153,53%,86%) !important}.has-background-success-light{background-color:hsl(153,53%,96%) !important}.has-text-success-dark{color:hsl(153,53%,31%) !important}a.has-text-success-dark:hover,a.has-text-success-dark:focus{color:hsl(153,53%,41%) !important}.has-background-success-dark{background-color:hsl(153,53%,31%) !important}.has-text-warning{color:hsl(44,100%,77%) !important}a.has-text-warning:hover,a.has-text-warning:focus{color:hsl(44,100%,67%) !important}.has-background-warning{background-color:hsl(44,100%,77%) !important}.has-text-warning-light{color:hsl(44,100%,96%) !important}a.has-text-warning-light:hover,a.has-text-warning-light:focus{color:hsl(44,100%,86%) !important}.has-background-warning-light{background-color:hsl(44,100%,96%) !important}.has-text-warning-dark{color:hsl(44,100%,29%) !important}a.has-text-warning-dark:hover,a.has-text-warning-dark:focus{color:hsl(44,100%,39%) !important}.has-background-warning-dark{background-color:hsl(44,100%,29%) !important}.has-text-danger{color:hsl(348,86%,61%) !important}a.has-text-danger:hover,a.has-text-danger:focus{color:hsl(348,86%,51%) !important}.has-background-danger{background-color:hsl(348,86%,61%) !important}.has-text-danger-light{color:hsl(348,86%,96%) !important}a.has-text-danger-light:hover,a.has-text-danger-light:focus{color:hsl(348,86%,86%) !important}.has-background-danger-light{background-color:hsl(348,86%,96%) !important}.has-text-danger-dark{color:hsl(348,86%,43%) !important}a.has-text-danger-dark:hover,a.has-text-danger-dark:focus{color:hsl(348,86%,53%) !important}.has-background-danger-dark{background-color:hsl(348,86%,43%) !important}.has-text-black-bis{color:hsl(0,0%,7%) !important}.has-background-black-bis{background-color:hsl(0,0%,7%) !important}.has-text-black-ter{color:hsl(0,0%,14%) !important}.has-background-black-ter{background-color:hsl(0,0%,14%) !important}.has-text-grey-darker{color:hsl(0,0%,21%) !important}.has-background-grey-darker{background-color:hsl(0,0%,21%) !important}.has-text-grey-dark{color:hsl(0,0%,29%) !important}.has-background-grey-dark{background-color:hsl(0,0%,29%) !important}.has-text-grey{color:hsl(0,0%,48%) !important}.has-background-grey{background-color:hsl(0,0%,48%) !important}.has-text-grey-light{color:hsl(0,0%,71%) !important}.has-background-grey-light{background-color:hsl(0,0%,71%) !important}.has-text-grey-lighter{color:hsl(0,0%,86%) !important}.has-background-grey-lighter{background-color:hsl(0,0%,86%) !important}.has-text-white-ter{color:hsl(0,0%,96%) !important}.has-background-white-ter{background-color:hsl(0,0%,96%) !important}.has-text-white-bis{color:hsl(0,0%,98%) !important}.has-background-white-bis{background-color:hsl(0,0%,98%) !important}.is-flex-direction-row{flex-direction:row !important}.is-flex-direction-row-reverse{flex-direction:row-reverse !important}.is-flex-direction-column{flex-direction:column !important}.is-flex-direction-column-reverse{flex-direction:column-reverse !important}.is-flex-wrap-nowrap{flex-wrap:nowrap !important}.is-flex-wrap-wrap{flex-wrap:wrap !important}.is-flex-wrap-wrap-reverse{flex-wrap:wrap-reverse !important}.is-justify-content-flex-start{justify-content:flex-start !important}.is-justify-content-flex-end{justify-content:flex-end !important}.is-justify-content-center{justify-content:center !important}.is-justify-content-space-between{justify-content:space-between !important}.is-justify-content-space-around{justify-content:space-around !important}.is-justify-content-space-evenly{justify-content:space-evenly !important}.is-justify-content-start{justify-content:start !important}.is-justify-content-end{justify-content:end !important}.is-justify-content-left{justify-content:left !important}.is-justify-content-right{justify-content:right !important}.is-align-content-flex-start{align-content:flex-start !important}.is-align-content-flex-end{align-content:flex-end !important}.is-align-content-center{align-content:center !important}.is-align-content-space-between{align-content:space-between !important}.is-align-content-space-around{align-content:space-around !important}.is-align-content-space-evenly{align-content:space-evenly !important}.is-align-content-stretch{align-content:stretch !important}.is-align-content-start{align-content:start !important}.is-align-content-end{align-content:end !important}.is-align-content-baseline{align-content:baseline !important}.is-align-items-stretch{align-items:stretch !important}.is-align-items-flex-start{align-items:flex-start !important}.is-align-items-flex-end{align-items:flex-end !important}.is-align-items-center{align-items:center !important}.is-align-items-baseline{align-items:baseline !important}.is-align-items-start{align-items:start !important}.is-align-items-end{align-items:end !important}.is-align-items-self-start{align-items:self-start !important}.is-align-items-self-end{align-items:self-end !important}.is-align-self-auto{align-self:auto !important}.is-align-self-flex-start{align-self:flex-start !important}.is-align-self-flex-end{align-self:flex-end !important}.is-align-self-center{align-self:center !important}.is-align-self-baseline{align-self:baseline !important}.is-align-self-stretch{align-self:stretch !important}.is-flex-grow-0{flex-grow:0 !important}.is-flex-grow-1{flex-grow:1 !important}.is-flex-grow-2{flex-grow:2 !important}.is-flex-grow-3{flex-grow:3 !important}.is-flex-grow-4{flex-grow:4 !important}.is-flex-grow-5{flex-grow:5 !important}.is-flex-shrink-0{flex-shrink:0 !important}.is-flex-shrink-1{flex-shrink:1 !important}.is-flex-shrink-2{flex-shrink:2 !important}.is-flex-shrink-3{flex-shrink:3 !important}.is-flex-shrink-4{flex-shrink:4 !important}.is-flex-shrink-5{flex-shrink:5 !important}.is-clearfix::after{clear:both;content:" ";display:table}.is-pulled-left{float:left !important}.is-pulled-right{float:right !important}.is-radiusless{border-radius:0 !important}.is-shadowless{box-shadow:none !important}.is-clickable{cursor:pointer !important;pointer-events:all !important}.is-clipped{overflow:hidden !important}.is-relative{position:relative !important}.is-marginless{margin:0 !important}.is-paddingless{padding:0 !important}.m-0{margin:0 !important}.mt-0{margin-top:0 !important}.mr-0{margin-right:0 !important}.mb-0{margin-bottom:0 !important}.ml-0{margin-left:0 !important}.mx-0{margin-left:0 !important;margin-right:0 !important}.my-0{margin-top:0 !important;margin-bottom:0 !important}.m-1{margin:.25rem !important}.mt-1{margin-top:.25rem !important}.mr-1{margin-right:.25rem !important}.mb-1{margin-bottom:.25rem !important}.ml-1{margin-left:.25rem !important}.mx-1{margin-left:.25rem !important;margin-right:.25rem !important}.my-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.m-2{margin:.5rem !important}.mt-2{margin-top:.5rem !important}.mr-2{margin-right:.5rem !important}.mb-2{margin-bottom:.5rem !important}.ml-2{margin-left:.5rem !important}.mx-2{margin-left:.5rem !important;margin-right:.5rem !important}.my-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.m-3{margin:.75rem !important}.mt-3{margin-top:.75rem !important}.mr-3{margin-right:.75rem !important}.mb-3{margin-bottom:.75rem !important}.ml-3{margin-left:.75rem !important}.mx-3{margin-left:.75rem !important;margin-right:.75rem !important}.my-3{margin-top:.75rem !important;margin-bottom:.75rem !important}.m-4{margin:1rem !important}.mt-4{margin-top:1rem !important}.mr-4{margin-right:1rem !important}.mb-4{margin-bottom:1rem !important}.ml-4{margin-left:1rem !important}.mx-4{margin-left:1rem !important;margin-right:1rem !important}.my-4{margin-top:1rem !important;margin-bottom:1rem !important}.m-5{margin:1.5rem !important}.mt-5{margin-top:1.5rem !important}.mr-5{margin-right:1.5rem !important}.mb-5{margin-bottom:1.5rem !important}.ml-5{margin-left:1.5rem !important}.mx-5{margin-left:1.5rem !important;margin-right:1.5rem !important}.my-5{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.m-6{margin:3rem !important}.mt-6{margin-top:3rem !important}.mr-6{margin-right:3rem !important}.mb-6{margin-bottom:3rem !important}.ml-6{margin-left:3rem !important}.mx-6{margin-left:3rem !important;margin-right:3rem !important}.my-6{margin-top:3rem !important;margin-bottom:3rem !important}.m-auto{margin:auto !important}.mt-auto{margin-top:auto !important}.mr-auto{margin-right:auto !important}.mb-auto{margin-bottom:auto !important}.ml-auto{margin-left:auto !important}.mx-auto{margin-left:auto !important;margin-right:auto !important}.my-auto{margin-top:auto !important;margin-bottom:auto !important}.p-0{padding:0 !important}.pt-0{padding-top:0 !important}.pr-0{padding-right:0 !important}.pb-0{padding-bottom:0 !important}.pl-0{padding-left:0 !important}.px-0{padding-left:0 !important;padding-right:0 !important}.py-0{padding-top:0 !important;padding-bottom:0 !important}.p-1{padding:.25rem !important}.pt-1{padding-top:.25rem !important}.pr-1{padding-right:.25rem !important}.pb-1{padding-bottom:.25rem !important}.pl-1{padding-left:.25rem !important}.px-1{padding-left:.25rem !important;padding-right:.25rem !important}.py-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.p-2{padding:.5rem !important}.pt-2{padding-top:.5rem !important}.pr-2{padding-right:.5rem !important}.pb-2{padding-bottom:.5rem !important}.pl-2{padding-left:.5rem !important}.px-2{padding-left:.5rem !important;padding-right:.5rem !important}.py-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.p-3{padding:.75rem !important}.pt-3{padding-top:.75rem !important}.pr-3{padding-right:.75rem !important}.pb-3{padding-bottom:.75rem !important}.pl-3{padding-left:.75rem !important}.px-3{padding-left:.75rem !important;padding-right:.75rem !important}.py-3{padding-top:.75rem !important;padding-bottom:.75rem !important}.p-4{padding:1rem !important}.pt-4{padding-top:1rem !important}.pr-4{padding-right:1rem !important}.pb-4{padding-bottom:1rem !important}.pl-4{padding-left:1rem !important}.px-4{padding-left:1rem !important;padding-right:1rem !important}.py-4{padding-top:1rem !important;padding-bottom:1rem !important}.p-5{padding:1.5rem !important}.pt-5{padding-top:1.5rem !important}.pr-5{padding-right:1.5rem !important}.pb-5{padding-bottom:1.5rem !important}.pl-5{padding-left:1.5rem !important}.px-5{padding-left:1.5rem !important;padding-right:1.5rem !important}.py-5{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.p-6{padding:3rem !important}.pt-6{padding-top:3rem !important}.pr-6{padding-right:3rem !important}.pb-6{padding-bottom:3rem !important}.pl-6{padding-left:3rem !important}.px-6{padding-left:3rem !important;padding-right:3rem !important}.py-6{padding-top:3rem !important;padding-bottom:3rem !important}.p-auto{padding:auto !important}.pt-auto{padding-top:auto !important}.pr-auto{padding-right:auto !important}.pb-auto{padding-bottom:auto !important}.pl-auto{padding-left:auto !important}.px-auto{padding-left:auto !important;padding-right:auto !important}.py-auto{padding-top:auto !important;padding-bottom:auto !important}.is-size-1{font-size:3rem !important}.is-size-2{font-size:2.5rem !important}.is-size-3{font-size:2rem !important}.is-size-4{font-size:1.5rem !important}.is-size-5{font-size:1.25rem !important}.is-size-6{font-size:1rem !important}.is-size-7{font-size:.75rem !important}@media screen and (max-width: 768px){.is-size-1-mobile{font-size:3rem !important}.is-size-2-mobile{font-size:2.5rem !important}.is-size-3-mobile{font-size:2rem !important}.is-size-4-mobile{font-size:1.5rem !important}.is-size-5-mobile{font-size:1.25rem !important}.is-size-6-mobile{font-size:1rem !important}.is-size-7-mobile{font-size:.75rem !important}}@media screen and (min-width: 769px),print{.is-size-1-tablet{font-size:3rem !important}.is-size-2-tablet{font-size:2.5rem !important}.is-size-3-tablet{font-size:2rem !important}.is-size-4-tablet{font-size:1.5rem !important}.is-size-5-tablet{font-size:1.25rem !important}.is-size-6-tablet{font-size:1rem !important}.is-size-7-tablet{font-size:.75rem !important}}@media screen and (max-width: 1023px){.is-size-1-touch{font-size:3rem !important}.is-size-2-touch{font-size:2.5rem !important}.is-size-3-touch{font-size:2rem !important}.is-size-4-touch{font-size:1.5rem !important}.is-size-5-touch{font-size:1.25rem !important}.is-size-6-touch{font-size:1rem !important}.is-size-7-touch{font-size:.75rem !important}}@media screen and (min-width: 1024px){.is-size-1-desktop{font-size:3rem !important}.is-size-2-desktop{font-size:2.5rem !important}.is-size-3-desktop{font-size:2rem !important}.is-size-4-desktop{font-size:1.5rem !important}.is-size-5-desktop{font-size:1.25rem !important}.is-size-6-desktop{font-size:1rem !important}.is-size-7-desktop{font-size:.75rem !important}}@media screen and (min-width: 1216px){.is-size-1-widescreen{font-size:3rem !important}.is-size-2-widescreen{font-size:2.5rem !important}.is-size-3-widescreen{font-size:2rem !important}.is-size-4-widescreen{font-size:1.5rem !important}.is-size-5-widescreen{font-size:1.25rem !important}.is-size-6-widescreen{font-size:1rem !important}.is-size-7-widescreen{font-size:.75rem !important}}@media screen and (min-width: 1408px){.is-size-1-fullhd{font-size:3rem !important}.is-size-2-fullhd{font-size:2.5rem !important}.is-size-3-fullhd{font-size:2rem !important}.is-size-4-fullhd{font-size:1.5rem !important}.is-size-5-fullhd{font-size:1.25rem !important}.is-size-6-fullhd{font-size:1rem !important}.is-size-7-fullhd{font-size:.75rem !important}}.has-text-centered{text-align:center !important}.has-text-justified{text-align:justify !important}.has-text-left{text-align:left !important}.has-text-right{text-align:right !important}@media screen and (max-width: 768px){.has-text-centered-mobile{text-align:center !important}}@media screen and (min-width: 769px),print{.has-text-centered-tablet{text-align:center !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.has-text-centered-tablet-only{text-align:center !important}}@media screen and (max-width: 1023px){.has-text-centered-touch{text-align:center !important}}@media screen and (min-width: 1024px){.has-text-centered-desktop{text-align:center !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.has-text-centered-desktop-only{text-align:center !important}}@media screen and (min-width: 1216px){.has-text-centered-widescreen{text-align:center !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.has-text-centered-widescreen-only{text-align:center !important}}@media screen and (min-width: 1408px){.has-text-centered-fullhd{text-align:center !important}}@media screen and (max-width: 768px){.has-text-justified-mobile{text-align:justify !important}}@media screen and (min-width: 769px),print{.has-text-justified-tablet{text-align:justify !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.has-text-justified-tablet-only{text-align:justify !important}}@media screen and (max-width: 1023px){.has-text-justified-touch{text-align:justify !important}}@media screen and (min-width: 1024px){.has-text-justified-desktop{text-align:justify !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.has-text-justified-desktop-only{text-align:justify !important}}@media screen and (min-width: 1216px){.has-text-justified-widescreen{text-align:justify !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.has-text-justified-widescreen-only{text-align:justify !important}}@media screen and (min-width: 1408px){.has-text-justified-fullhd{text-align:justify !important}}@media screen and (max-width: 768px){.has-text-left-mobile{text-align:left !important}}@media screen and (min-width: 769px),print{.has-text-left-tablet{text-align:left !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.has-text-left-tablet-only{text-align:left !important}}@media screen and (max-width: 1023px){.has-text-left-touch{text-align:left !important}}@media screen and (min-width: 1024px){.has-text-left-desktop{text-align:left !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.has-text-left-desktop-only{text-align:left !important}}@media screen and (min-width: 1216px){.has-text-left-widescreen{text-align:left !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.has-text-left-widescreen-only{text-align:left !important}}@media screen and (min-width: 1408px){.has-text-left-fullhd{text-align:left !important}}@media screen and (max-width: 768px){.has-text-right-mobile{text-align:right !important}}@media screen and (min-width: 769px),print{.has-text-right-tablet{text-align:right !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.has-text-right-tablet-only{text-align:right !important}}@media screen and (max-width: 1023px){.has-text-right-touch{text-align:right !important}}@media screen and (min-width: 1024px){.has-text-right-desktop{text-align:right !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.has-text-right-desktop-only{text-align:right !important}}@media screen and (min-width: 1216px){.has-text-right-widescreen{text-align:right !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.has-text-right-widescreen-only{text-align:right !important}}@media screen and (min-width: 1408px){.has-text-right-fullhd{text-align:right !important}}.is-capitalized{text-transform:capitalize !important}.is-lowercase{text-transform:lowercase !important}.is-uppercase{text-transform:uppercase !important}.is-italic{font-style:italic !important}.is-underlined{text-decoration:underline !important}.has-text-weight-light{font-weight:300 !important}.has-text-weight-normal{font-weight:400 !important}.has-text-weight-medium{font-weight:500 !important}.has-text-weight-semibold{font-weight:600 !important}.has-text-weight-bold{font-weight:700 !important}.is-family-primary{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue","Helvetica","Arial",sans-serif !important}.is-family-secondary{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue","Helvetica","Arial",sans-serif !important}.is-family-sans-serif{font-family:BlinkMacSystemFont,-apple-system,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue","Helvetica","Arial",sans-serif !important}.is-family-monospace{font-family:monospace !important}.is-family-code{font-family:monospace !important}.is-block{display:block !important}@media screen and (max-width: 768px){.is-block-mobile{display:block !important}}@media screen and (min-width: 769px),print{.is-block-tablet{display:block !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-block-tablet-only{display:block !important}}@media screen and (max-width: 1023px){.is-block-touch{display:block !important}}@media screen and (min-width: 1024px){.is-block-desktop{display:block !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-block-desktop-only{display:block !important}}@media screen and (min-width: 1216px){.is-block-widescreen{display:block !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-block-widescreen-only{display:block !important}}@media screen and (min-width: 1408px){.is-block-fullhd{display:block !important}}.is-flex{display:flex !important}@media screen and (max-width: 768px){.is-flex-mobile{display:flex !important}}@media screen and (min-width: 769px),print{.is-flex-tablet{display:flex !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-flex-tablet-only{display:flex !important}}@media screen and (max-width: 1023px){.is-flex-touch{display:flex !important}}@media screen and (min-width: 1024px){.is-flex-desktop{display:flex !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-flex-desktop-only{display:flex !important}}@media screen and (min-width: 1216px){.is-flex-widescreen{display:flex !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-flex-widescreen-only{display:flex !important}}@media screen and (min-width: 1408px){.is-flex-fullhd{display:flex !important}}.is-inline{display:inline !important}@media screen and (max-width: 768px){.is-inline-mobile{display:inline !important}}@media screen and (min-width: 769px),print{.is-inline-tablet{display:inline !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-inline-tablet-only{display:inline !important}}@media screen and (max-width: 1023px){.is-inline-touch{display:inline !important}}@media screen and (min-width: 1024px){.is-inline-desktop{display:inline !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-inline-desktop-only{display:inline !important}}@media screen and (min-width: 1216px){.is-inline-widescreen{display:inline !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-inline-widescreen-only{display:inline !important}}@media screen and (min-width: 1408px){.is-inline-fullhd{display:inline !important}}.is-inline-block{display:inline-block !important}@media screen and (max-width: 768px){.is-inline-block-mobile{display:inline-block !important}}@media screen and (min-width: 769px),print{.is-inline-block-tablet{display:inline-block !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-inline-block-tablet-only{display:inline-block !important}}@media screen and (max-width: 1023px){.is-inline-block-touch{display:inline-block !important}}@media screen and (min-width: 1024px){.is-inline-block-desktop{display:inline-block !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-inline-block-desktop-only{display:inline-block !important}}@media screen and (min-width: 1216px){.is-inline-block-widescreen{display:inline-block !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-inline-block-widescreen-only{display:inline-block !important}}@media screen and (min-width: 1408px){.is-inline-block-fullhd{display:inline-block !important}}.is-inline-flex{display:inline-flex !important}@media screen and (max-width: 768px){.is-inline-flex-mobile{display:inline-flex !important}}@media screen and (min-width: 769px),print{.is-inline-flex-tablet{display:inline-flex !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-inline-flex-tablet-only{display:inline-flex !important}}@media screen and (max-width: 1023px){.is-inline-flex-touch{display:inline-flex !important}}@media screen and (min-width: 1024px){.is-inline-flex-desktop{display:inline-flex !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-inline-flex-desktop-only{display:inline-flex !important}}@media screen and (min-width: 1216px){.is-inline-flex-widescreen{display:inline-flex !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-inline-flex-widescreen-only{display:inline-flex !important}}@media screen and (min-width: 1408px){.is-inline-flex-fullhd{display:inline-flex !important}}.is-hidden{display:none !important}.is-sr-only{border:none !important;clip:rect(0, 0, 0, 0) !important;height:.01em !important;overflow:hidden !important;padding:0 !important;position:absolute !important;white-space:nowrap !important;width:.01em !important}@media screen and (max-width: 768px){.is-hidden-mobile{display:none !important}}@media screen and (min-width: 769px),print{.is-hidden-tablet{display:none !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-hidden-tablet-only{display:none !important}}@media screen and (max-width: 1023px){.is-hidden-touch{display:none !important}}@media screen and (min-width: 1024px){.is-hidden-desktop{display:none !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-hidden-desktop-only{display:none !important}}@media screen and (min-width: 1216px){.is-hidden-widescreen{display:none !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-hidden-widescreen-only{display:none !important}}@media screen and (min-width: 1408px){.is-hidden-fullhd{display:none !important}}.is-invisible{visibility:hidden !important}@media screen and (max-width: 768px){.is-invisible-mobile{visibility:hidden !important}}@media screen and (min-width: 769px),print{.is-invisible-tablet{visibility:hidden !important}}@media screen and (min-width: 769px)and (max-width: 1023px){.is-invisible-tablet-only{visibility:hidden !important}}@media screen and (max-width: 1023px){.is-invisible-touch{visibility:hidden !important}}@media screen and (min-width: 1024px){.is-invisible-desktop{visibility:hidden !important}}@media screen and (min-width: 1024px)and (max-width: 1215px){.is-invisible-desktop-only{visibility:hidden !important}}@media screen and (min-width: 1216px){.is-invisible-widescreen{visibility:hidden !important}}@media screen and (min-width: 1216px)and (max-width: 1407px){.is-invisible-widescreen-only{visibility:hidden !important}}@media screen and (min-width: 1408px){.is-invisible-fullhd{visibility:hidden !important}}.hero{align-items:stretch;display:flex;flex-direction:column;justify-content:space-between}.hero .navbar{background:none}.hero .tabs ul{border-bottom:none}.hero.is-white{background-color:#fff;color:hsl(0,0%,4%)}.hero.is-white a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-white strong{color:inherit}.hero.is-white .title{color:hsl(0,0%,4%)}.hero.is-white .subtitle{color:hsla(0,0%,4%,.9)}.hero.is-white .subtitle a:not(.button),.hero.is-white .subtitle strong{color:hsl(0,0%,4%)}@media screen and (max-width: 1023px){.hero.is-white .navbar-menu{background-color:#fff}}.hero.is-white .navbar-item,.hero.is-white .navbar-link{color:hsla(0,0%,4%,.7)}.hero.is-white a.navbar-item:hover,.hero.is-white a.navbar-item.is-active,.hero.is-white .navbar-link:hover,.hero.is-white .navbar-link.is-active{background-color:hsl(0,0%,95%);color:hsl(0,0%,4%)}.hero.is-white .tabs a{color:hsl(0,0%,4%);opacity:.9}.hero.is-white .tabs a:hover{opacity:1}.hero.is-white .tabs li.is-active a{color:#fff !important;opacity:1}.hero.is-white .tabs.is-boxed a,.hero.is-white .tabs.is-toggle a{color:hsl(0,0%,4%)}.hero.is-white .tabs.is-boxed a:hover,.hero.is-white .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-white .tabs.is-boxed li.is-active a,.hero.is-white .tabs.is-boxed li.is-active a:hover,.hero.is-white .tabs.is-toggle li.is-active a,.hero.is-white .tabs.is-toggle li.is-active a:hover{background-color:hsl(0,0%,4%);border-color:hsl(0,0%,4%);color:#fff}.hero.is-white.is-bold{background-image:linear-gradient(141deg, hsl(350, 10%, 90%) 0%, hsl(0, 0%, 100%) 71%, hsl(10, 5%, 100%) 100%)}@media screen and (max-width: 768px){.hero.is-white.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(350, 10%, 90%) 0%, hsl(0, 0%, 100%) 71%, hsl(10, 5%, 100%) 100%)}}.hero.is-black{background-color:hsl(0,0%,4%);color:#fff}.hero.is-black a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-black strong{color:inherit}.hero.is-black .title{color:#fff}.hero.is-black .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-black .subtitle a:not(.button),.hero.is-black .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-black .navbar-menu{background-color:hsl(0,0%,4%)}}.hero.is-black .navbar-item,.hero.is-black .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-black a.navbar-item:hover,.hero.is-black a.navbar-item.is-active,.hero.is-black .navbar-link:hover,.hero.is-black .navbar-link.is-active{background-color:#000;color:#fff}.hero.is-black .tabs a{color:#fff;opacity:.9}.hero.is-black .tabs a:hover{opacity:1}.hero.is-black .tabs li.is-active a{color:hsl(0,0%,4%) !important;opacity:1}.hero.is-black .tabs.is-boxed a,.hero.is-black .tabs.is-toggle a{color:#fff}.hero.is-black .tabs.is-boxed a:hover,.hero.is-black .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-black .tabs.is-boxed li.is-active a,.hero.is-black .tabs.is-boxed li.is-active a:hover,.hero.is-black .tabs.is-toggle li.is-active a,.hero.is-black .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:hsl(0,0%,4%)}.hero.is-black.is-bold{background-image:linear-gradient(141deg, hsl(350, 10%, 0%) 0%, hsl(0, 0%, 4%) 71%, hsl(10, 5%, 9%) 100%)}@media screen and (max-width: 768px){.hero.is-black.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(350, 10%, 0%) 0%, hsl(0, 0%, 4%) 71%, hsl(10, 5%, 9%) 100%)}}.hero.is-light{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.hero.is-light a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-light strong{color:inherit}.hero.is-light .title{color:rgba(0,0,0,.7)}.hero.is-light .subtitle{color:rgba(0,0,0,.9)}.hero.is-light .subtitle a:not(.button),.hero.is-light .subtitle strong{color:rgba(0,0,0,.7)}@media screen and (max-width: 1023px){.hero.is-light .navbar-menu{background-color:hsl(0,0%,96%)}}.hero.is-light .navbar-item,.hero.is-light .navbar-link{color:rgba(0,0,0,.7)}.hero.is-light a.navbar-item:hover,.hero.is-light a.navbar-item.is-active,.hero.is-light .navbar-link:hover,.hero.is-light .navbar-link.is-active{background-color:hsl(0,0%,91%);color:rgba(0,0,0,.7)}.hero.is-light .tabs a{color:rgba(0,0,0,.7);opacity:.9}.hero.is-light .tabs a:hover{opacity:1}.hero.is-light .tabs li.is-active a{color:hsl(0,0%,96%) !important;opacity:1}.hero.is-light .tabs.is-boxed a,.hero.is-light .tabs.is-toggle a{color:rgba(0,0,0,.7)}.hero.is-light .tabs.is-boxed a:hover,.hero.is-light .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-light .tabs.is-boxed li.is-active a,.hero.is-light .tabs.is-boxed li.is-active a:hover,.hero.is-light .tabs.is-toggle li.is-active a,.hero.is-light .tabs.is-toggle li.is-active a:hover{background-color:rgba(0,0,0,.7);border-color:rgba(0,0,0,.7);color:hsl(0,0%,96%)}.hero.is-light.is-bold{background-image:linear-gradient(141deg, hsl(350, 10%, 86%) 0%, hsl(0, 0%, 96%) 71%, hsl(10, 5%, 100%) 100%)}@media screen and (max-width: 768px){.hero.is-light.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(350, 10%, 86%) 0%, hsl(0, 0%, 96%) 71%, hsl(10, 5%, 100%) 100%)}}.hero.is-dark{background-color:hsl(0,0%,21%);color:#fff}.hero.is-dark a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-dark strong{color:inherit}.hero.is-dark .title{color:#fff}.hero.is-dark .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-dark .subtitle a:not(.button),.hero.is-dark .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-dark .navbar-menu{background-color:hsl(0,0%,21%)}}.hero.is-dark .navbar-item,.hero.is-dark .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-dark a.navbar-item:hover,.hero.is-dark a.navbar-item.is-active,.hero.is-dark .navbar-link:hover,.hero.is-dark .navbar-link.is-active{background-color:hsl(0,0%,16%);color:#fff}.hero.is-dark .tabs a{color:#fff;opacity:.9}.hero.is-dark .tabs a:hover{opacity:1}.hero.is-dark .tabs li.is-active a{color:hsl(0,0%,21%) !important;opacity:1}.hero.is-dark .tabs.is-boxed a,.hero.is-dark .tabs.is-toggle a{color:#fff}.hero.is-dark .tabs.is-boxed a:hover,.hero.is-dark .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-dark .tabs.is-boxed li.is-active a,.hero.is-dark .tabs.is-boxed li.is-active a:hover,.hero.is-dark .tabs.is-toggle li.is-active a,.hero.is-dark .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:hsl(0,0%,21%)}.hero.is-dark.is-bold{background-image:linear-gradient(141deg, hsl(350, 10%, 11%) 0%, hsl(0, 0%, 21%) 71%, hsl(10, 5%, 26%) 100%)}@media screen and (max-width: 768px){.hero.is-dark.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(350, 10%, 11%) 0%, hsl(0, 0%, 21%) 71%, hsl(10, 5%, 26%) 100%)}}.hero.is-primary{background-color:#00875f;color:#fff}.hero.is-primary a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-primary strong{color:inherit}.hero.is-primary .title{color:#fff}.hero.is-primary .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-primary .subtitle a:not(.button),.hero.is-primary .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-primary .navbar-menu{background-color:#00875f}}.hero.is-primary .navbar-item,.hero.is-primary .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-primary a.navbar-item:hover,.hero.is-primary a.navbar-item.is-active,.hero.is-primary .navbar-link:hover,.hero.is-primary .navbar-link.is-active{background-color:rgb(0,109.5,77.0555555556);color:#fff}.hero.is-primary .tabs a{color:#fff;opacity:.9}.hero.is-primary .tabs a:hover{opacity:1}.hero.is-primary .tabs li.is-active a{color:#00875f !important;opacity:1}.hero.is-primary .tabs.is-boxed a,.hero.is-primary .tabs.is-toggle a{color:#fff}.hero.is-primary .tabs.is-boxed a:hover,.hero.is-primary .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-primary .tabs.is-boxed li.is-active a,.hero.is-primary .tabs.is-boxed li.is-active a:hover,.hero.is-primary .tabs.is-toggle li.is-active a,.hero.is-primary .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:#00875f}.hero.is-primary.is-bold{background-image:linear-gradient(141deg, rgb(0, 84, 45.1111111111) 0%, rgb(0, 135, 95) 71%, rgb(0, 160.5, 139.6944444444) 100%)}@media screen and (max-width: 768px){.hero.is-primary.is-bold .navbar-menu{background-image:linear-gradient(141deg, rgb(0, 84, 45.1111111111) 0%, rgb(0, 135, 95) 71%, rgb(0, 160.5, 139.6944444444) 100%)}}.hero.is-link{background-color:hsl(229,53%,53%);color:#fff}.hero.is-link a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-link strong{color:inherit}.hero.is-link .title{color:#fff}.hero.is-link .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-link .subtitle a:not(.button),.hero.is-link .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-link .navbar-menu{background-color:hsl(229,53%,53%)}}.hero.is-link .navbar-item,.hero.is-link .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-link a.navbar-item:hover,.hero.is-link a.navbar-item.is-active,.hero.is-link .navbar-link:hover,.hero.is-link .navbar-link.is-active{background-color:hsl(229,53%,48%);color:#fff}.hero.is-link .tabs a{color:#fff;opacity:.9}.hero.is-link .tabs a:hover{opacity:1}.hero.is-link .tabs li.is-active a{color:hsl(229,53%,53%) !important;opacity:1}.hero.is-link .tabs.is-boxed a,.hero.is-link .tabs.is-toggle a{color:#fff}.hero.is-link .tabs.is-boxed a:hover,.hero.is-link .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-link .tabs.is-boxed li.is-active a,.hero.is-link .tabs.is-boxed li.is-active a:hover,.hero.is-link .tabs.is-toggle li.is-active a,.hero.is-link .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:hsl(229,53%,53%)}.hero.is-link.is-bold{background-image:linear-gradient(141deg, hsl(219, 63%, 43%) 0%, hsl(229, 53%, 53%) 71%, hsl(239, 58%, 58%) 100%)}@media screen and (max-width: 768px){.hero.is-link.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(219, 63%, 43%) 0%, hsl(229, 53%, 53%) 71%, hsl(239, 58%, 58%) 100%)}}.hero.is-info{background-color:hsl(207,61%,53%);color:#fff}.hero.is-info a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-info strong{color:inherit}.hero.is-info .title{color:#fff}.hero.is-info .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-info .subtitle a:not(.button),.hero.is-info .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-info .navbar-menu{background-color:hsl(207,61%,53%)}}.hero.is-info .navbar-item,.hero.is-info .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-info a.navbar-item:hover,.hero.is-info a.navbar-item.is-active,.hero.is-info .navbar-link:hover,.hero.is-info .navbar-link.is-active{background-color:hsl(207,61%,48%);color:#fff}.hero.is-info .tabs a{color:#fff;opacity:.9}.hero.is-info .tabs a:hover{opacity:1}.hero.is-info .tabs li.is-active a{color:hsl(207,61%,53%) !important;opacity:1}.hero.is-info .tabs.is-boxed a,.hero.is-info .tabs.is-toggle a{color:#fff}.hero.is-info .tabs.is-boxed a:hover,.hero.is-info .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-info .tabs.is-boxed li.is-active a,.hero.is-info .tabs.is-boxed li.is-active a:hover,.hero.is-info .tabs.is-toggle li.is-active a,.hero.is-info .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:hsl(207,61%,53%)}.hero.is-info.is-bold{background-image:linear-gradient(141deg, hsl(197, 71%, 43%) 0%, hsl(207, 61%, 53%) 71%, hsl(217, 66%, 58%) 100%)}@media screen and (max-width: 768px){.hero.is-info.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(197, 71%, 43%) 0%, hsl(207, 61%, 53%) 71%, hsl(217, 66%, 58%) 100%)}}.hero.is-success{background-color:hsl(153,53%,53%);color:#fff}.hero.is-success a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-success strong{color:inherit}.hero.is-success .title{color:#fff}.hero.is-success .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-success .subtitle a:not(.button),.hero.is-success .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-success .navbar-menu{background-color:hsl(153,53%,53%)}}.hero.is-success .navbar-item,.hero.is-success .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-success a.navbar-item:hover,.hero.is-success a.navbar-item.is-active,.hero.is-success .navbar-link:hover,.hero.is-success .navbar-link.is-active{background-color:hsl(153,53%,48%);color:#fff}.hero.is-success .tabs a{color:#fff;opacity:.9}.hero.is-success .tabs a:hover{opacity:1}.hero.is-success .tabs li.is-active a{color:hsl(153,53%,53%) !important;opacity:1}.hero.is-success .tabs.is-boxed a,.hero.is-success .tabs.is-toggle a{color:#fff}.hero.is-success .tabs.is-boxed a:hover,.hero.is-success .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-success .tabs.is-boxed li.is-active a,.hero.is-success .tabs.is-boxed li.is-active a:hover,.hero.is-success .tabs.is-toggle li.is-active a,.hero.is-success .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:hsl(153,53%,53%)}.hero.is-success.is-bold{background-image:linear-gradient(141deg, hsl(143, 63%, 43%) 0%, hsl(153, 53%, 53%) 71%, hsl(163, 58%, 58%) 100%)}@media screen and (max-width: 768px){.hero.is-success.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(143, 63%, 43%) 0%, hsl(153, 53%, 53%) 71%, hsl(163, 58%, 58%) 100%)}}.hero.is-warning{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.hero.is-warning a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-warning strong{color:inherit}.hero.is-warning .title{color:rgba(0,0,0,.7)}.hero.is-warning .subtitle{color:rgba(0,0,0,.9)}.hero.is-warning .subtitle a:not(.button),.hero.is-warning .subtitle strong{color:rgba(0,0,0,.7)}@media screen and (max-width: 1023px){.hero.is-warning .navbar-menu{background-color:hsl(44,100%,77%)}}.hero.is-warning .navbar-item,.hero.is-warning .navbar-link{color:rgba(0,0,0,.7)}.hero.is-warning a.navbar-item:hover,.hero.is-warning a.navbar-item.is-active,.hero.is-warning .navbar-link:hover,.hero.is-warning .navbar-link.is-active{background-color:hsl(44,100%,72%);color:rgba(0,0,0,.7)}.hero.is-warning .tabs a{color:rgba(0,0,0,.7);opacity:.9}.hero.is-warning .tabs a:hover{opacity:1}.hero.is-warning .tabs li.is-active a{color:hsl(44,100%,77%) !important;opacity:1}.hero.is-warning .tabs.is-boxed a,.hero.is-warning .tabs.is-toggle a{color:rgba(0,0,0,.7)}.hero.is-warning .tabs.is-boxed a:hover,.hero.is-warning .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-warning .tabs.is-boxed li.is-active a,.hero.is-warning .tabs.is-boxed li.is-active a:hover,.hero.is-warning .tabs.is-toggle li.is-active a,.hero.is-warning .tabs.is-toggle li.is-active a:hover{background-color:rgba(0,0,0,.7);border-color:rgba(0,0,0,.7);color:hsl(44,100%,77%)}.hero.is-warning.is-bold{background-image:linear-gradient(141deg, hsl(34, 100%, 67%) 0%, hsl(44, 100%, 77%) 71%, hsl(54, 100%, 82%) 100%)}@media screen and (max-width: 768px){.hero.is-warning.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(34, 100%, 67%) 0%, hsl(44, 100%, 77%) 71%, hsl(54, 100%, 82%) 100%)}}.hero.is-danger{background-color:hsl(348,86%,61%);color:#fff}.hero.is-danger a:not(.button):not(.dropdown-item):not(.tag):not(.pagination-link.is-current),.hero.is-danger strong{color:inherit}.hero.is-danger .title{color:#fff}.hero.is-danger .subtitle{color:hsla(0,0%,100%,.9)}.hero.is-danger .subtitle a:not(.button),.hero.is-danger .subtitle strong{color:#fff}@media screen and (max-width: 1023px){.hero.is-danger .navbar-menu{background-color:hsl(348,86%,61%)}}.hero.is-danger .navbar-item,.hero.is-danger .navbar-link{color:hsla(0,0%,100%,.7)}.hero.is-danger a.navbar-item:hover,.hero.is-danger a.navbar-item.is-active,.hero.is-danger .navbar-link:hover,.hero.is-danger .navbar-link.is-active{background-color:hsl(348,86%,56%);color:#fff}.hero.is-danger .tabs a{color:#fff;opacity:.9}.hero.is-danger .tabs a:hover{opacity:1}.hero.is-danger .tabs li.is-active a{color:hsl(348,86%,61%) !important;opacity:1}.hero.is-danger .tabs.is-boxed a,.hero.is-danger .tabs.is-toggle a{color:#fff}.hero.is-danger .tabs.is-boxed a:hover,.hero.is-danger .tabs.is-toggle a:hover{background-color:hsla(0,0%,4%,.1)}.hero.is-danger .tabs.is-boxed li.is-active a,.hero.is-danger .tabs.is-boxed li.is-active a:hover,.hero.is-danger .tabs.is-toggle li.is-active a,.hero.is-danger .tabs.is-toggle li.is-active a:hover{background-color:#fff;border-color:#fff;color:hsl(348,86%,61%)}.hero.is-danger.is-bold{background-image:linear-gradient(141deg, hsl(338, 96%, 51%) 0%, hsl(348, 86%, 61%) 71%, hsl(358, 91%, 66%) 100%)}@media screen and (max-width: 768px){.hero.is-danger.is-bold .navbar-menu{background-image:linear-gradient(141deg, hsl(338, 96%, 51%) 0%, hsl(348, 86%, 61%) 71%, hsl(358, 91%, 66%) 100%)}}.hero.is-small .hero-body{padding:1.5rem}@media screen and (min-width: 769px),print{.hero.is-medium .hero-body{padding:9rem 4.5rem}}@media screen and (min-width: 769px),print{.hero.is-large .hero-body{padding:18rem 6rem}}.hero.is-halfheight .hero-body,.hero.is-fullheight .hero-body,.hero.is-fullheight-with-navbar .hero-body{align-items:center;display:flex}.hero.is-halfheight .hero-body>.container,.hero.is-fullheight .hero-body>.container,.hero.is-fullheight-with-navbar .hero-body>.container{flex-grow:1;flex-shrink:1}.hero.is-halfheight{min-height:50vh}.hero.is-fullheight{min-height:100vh}.hero-video{overflow:hidden}.hero-video video{left:50%;min-height:100%;min-width:100%;position:absolute;top:50%;transform:translate3d(-50%, -50%, 0)}.hero-video.is-transparent{opacity:.3}@media screen and (max-width: 768px){.hero-video{display:none}}.hero-buttons{margin-top:1.5rem}@media screen and (max-width: 768px){.hero-buttons .button{display:flex}.hero-buttons .button:not(:last-child){margin-bottom:.75rem}}@media screen and (min-width: 769px),print{.hero-buttons{display:flex;justify-content:center}.hero-buttons .button:not(:last-child){margin-right:1.5rem}}.hero-head,.hero-foot{flex-grow:0;flex-shrink:0}.hero-body{flex-grow:1;flex-shrink:0;padding:3rem 1.5rem}@media screen and (min-width: 769px),print{.hero-body{padding:3rem 3rem}}.section{padding:3rem 1.5rem}@media screen and (min-width: 1024px){.section{padding:3rem 3rem}.section.is-medium{padding:9rem 4.5rem}.section.is-large{padding:18rem 6rem}}.footer{background-color:hsl(0,0%,98%);padding:3rem 1.5rem 6rem}.is-noscroll{position:fixed;overflow-y:hidden;width:100%;bottom:0}@keyframes fadeOut{from{opacity:1}to{opacity:0}}.fadeOut{animation-name:fadeOut}@keyframes fadeOutDown{from{opacity:1}to{opacity:0;transform:translate3d(0, 100%, 0)}}.fadeOutDown{animation-name:fadeOutDown}@keyframes fadeOutUp{from{opacity:1}to{opacity:0;transform:translate3d(0, -100%, 0)}}.fadeOutUp{animation-name:fadeOutUp}@keyframes fadeIn{from{opacity:0}to{opacity:1}}.fadeIn{animation-name:fadeIn}@keyframes fadeInDown{from{opacity:0;transform:translate3d(0, -100%, 0)}to{opacity:1;transform:none}}.fadeInDown{animation-name:fadeInDown}@keyframes fadeInUp{from{opacity:0;transform:translate3d(0, 100%, 0)}to{opacity:1;transform:none}}.fadeInUp{animation-name:fadeInUp}.fade-enter-active,.fade-leave-active{transition:opacity 150ms ease-out}.fade-enter,.fade-leave-to{opacity:0}.zoom-in-enter-active,.zoom-in-leave-active{transition:opacity 150ms ease-out}.zoom-in-enter-active .animation-content,.zoom-in-enter-active .animation-content,.zoom-in-leave-active .animation-content,.zoom-in-leave-active .animation-content{transition:transform 150ms ease-out}.zoom-in-enter,.zoom-in-leave-active{opacity:0}.zoom-in-enter .animation-content,.zoom-in-enter .animation-content,.zoom-in-leave-active .animation-content,.zoom-in-leave-active .animation-content{transform:scale(0.95)}.zoom-out-enter-active,.zoom-out-leave-active{transition:opacity 150ms ease-out}.zoom-out-enter-active .animation-content,.zoom-out-enter-active .animation-content,.zoom-out-leave-active .animation-content,.zoom-out-leave-active .animation-content{transition:transform 150ms ease-out}.zoom-out-enter,.zoom-out-leave-active{opacity:0}.zoom-out-enter .animation-content,.zoom-out-enter .animation-content,.zoom-out-leave-active .animation-content,.zoom-out-leave-active .animation-content{transform:scale(1.05)}.slide-next-enter-active,.slide-next-leave-active,.slide-prev-enter-active,.slide-prev-leave-active{transition:transform 250ms cubic-bezier(0.785, 0.135, 0.15, 0.86)}.slide-prev-leave-to,.slide-next-enter{transform:translate3d(-100%, 0, 0);position:absolute;width:100%}.slide-prev-enter,.slide-next-leave-to{transform:translate3d(100%, 0, 0);position:absolute;width:100%}.slide-down-enter-active,.slide-down-leave-active,.slide-up-enter-active,.slide-up-leave-active{transition:transform 250ms cubic-bezier(0.785, 0.135, 0.15, 0.86)}.slide-up-leave-to,.slide-down-enter{transform:translate3d(0, -100%, 0);position:absolute;height:100%}.slide-up-enter,.slide-down-leave-to{transform:translate3d(0, 100%, 0);position:absolute;height:100%}.slide-enter-active{transition:150ms ease-out}.slide-leave-active{transition:150ms ease-out;transition-timing-function:cubic-bezier(0, 1, 0.5, 1)}.slide-enter-to,.slide-leave{max-height:100px;overflow:hidden}.slide-enter,.slide-leave-to{overflow:hidden;max-height:0}.autocomplete{position:relative}.autocomplete .dropdown-menu{display:block;width:100%}.autocomplete .dropdown-menu.is-opened-top{top:auto;bottom:100%}.autocomplete .dropdown-content{overflow:auto;max-height:200px}.autocomplete .dropdown-item,.autocomplete .dropdown .dropdown-menu .has-link a,.dropdown .dropdown-menu .has-link .autocomplete a{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.autocomplete .dropdown-item.is-hovered,.autocomplete .dropdown .dropdown-menu .has-link a.is-hovered,.dropdown .dropdown-menu .has-link .autocomplete a.is-hovered{background:hsl(0,0%,96%);color:hsl(0,0%,4%)}.autocomplete .dropdown-item.is-disabled,.autocomplete .dropdown .dropdown-menu .has-link a.is-disabled,.dropdown .dropdown-menu .has-link .autocomplete a.is-disabled{opacity:.5;cursor:not-allowed}.autocomplete.is-small{border-radius:2px;font-size:.75rem}.autocomplete.is-medium{font-size:1.25rem}.autocomplete.is-large{font-size:1.5rem}.carousel{min-height:120px;position:relative}.carousel.is-overlay{background-color:hsla(0,0%,4%,.86);align-items:center;flex-direction:column;justify-content:center;display:flex;max-height:100vh;position:fixed;z-index:40}.carousel.is-overlay .carousel-item img{cursor:default}.carousel.is-overlay .carousel-indicator.has-background{background:rgba(0,0,0,0)}.carousel .progress,.carousel .progress-wrapper.is-not-native{border-radius:2px;height:.25rem;margin-bottom:0}.carousel .carousel-items{position:relative;display:flex;overflow:hidden;width:100%}@media screen and (min-width: 769px),print{.carousel .carousel-items:hover .carousel-arrow.is-hovered{opacity:1}}.carousel .carousel-items .carousel-item{flex-shrink:0;width:100%}.carousel .carousel-pause{pointer-events:none;position:absolute;top:0;right:.15rem;z-index:1}.carousel .carousel-indicator{width:100%;padding:.5rem;display:flex;align-items:center;justify-content:center}.carousel .carousel-indicator.has-background{background:hsla(0,0%,4%,.5)}.carousel .carousel-indicator.has-custom{flex-wrap:nowrap;justify-content:flex-start;-webkit-overflow-scrolling:touch;overflow:hidden;overflow-x:auto}.carousel .carousel-indicator.has-custom.is-small .indicator-item{flex:1 0 10%}.carousel .carousel-indicator.has-custom.is-medium .indicator-item{flex:1 0 16.66667%}.carousel .carousel-indicator.is-inside{position:absolute}.carousel .carousel-indicator.is-inside.is-bottom{bottom:0}.carousel .carousel-indicator.is-inside.is-top{top:0}.carousel .carousel-indicator .indicator-item:not(:last-child){margin-right:.5rem}.carousel .carousel-indicator .indicator-item.is-active .indicator-style,.carousel .carousel-indicator .indicator-item .indicator-style:hover{background:#00875f;border:1px solid #fff}.carousel .carousel-indicator .indicator-item .indicator-style{display:block;border:1px solid #00875f;background:#fff;outline:none;transition:150ms ease-out}.carousel .carousel-indicator .indicator-item .indicator-style.is-boxes{height:10px;width:10px}.carousel .carousel-indicator .indicator-item .indicator-style.is-dots{border-radius:9999px;height:10px;width:10px}.carousel .carousel-indicator .indicator-item .indicator-style.is-lines{height:5px;width:25px}.carousel-list{position:relative;overflow:hidden;width:100%}.carousel-list.has-shadow{box-shadow:0px 0px 10px rgba(0,0,0,.25)}@media screen and (min-width: 769px),print{.carousel-list:hover .carousel-arrow.is-hovered{opacity:1}}.carousel-list .carousel-slides{position:relative;display:flex;width:100%}.carousel-list .carousel-slides:not(.is-dragging){transition:all 250ms ease-out 0s}.carousel-list .carousel-slides.has-grayscale .carousel-slide img{filter:grayscale(100%)}.carousel-list .carousel-slides.has-grayscale .carousel-slide.is-active img{filter:grayscale(0%)}.carousel-list .carousel-slides.has-opacity .carousel-slide img{opacity:.25}.carousel-list .carousel-slides.has-opacity .carousel-slide.is-active img{opacity:1}.carousel-list .carousel-slides .carousel-slide{border:2px solid rgba(0,0,0,0);flex-shrink:0}.carousel-arrow{transition:150ms ease-out}.carousel-arrow.is-hovered{opacity:0}.carousel-arrow .icon{background:#fff;color:#00875f;cursor:pointer;border:1px solid #fff;border-radius:9999px;outline:0}.carousel-arrow .icon:hover{border:1px solid #00875f;opacity:1}.carousel-arrow .icon.has-icons-left,.carousel-arrow .icon.has-icons-right{position:absolute;top:50%;transform:translateY(-50%);z-index:1}.carousel-arrow .icon.has-icons-left{left:1.5rem}.carousel-arrow .icon.has-icons-right{right:1.5rem}.b-checkbox.checkbox{outline:none;display:inline-flex;align-items:center}.b-checkbox.checkbox:not(.button){margin-right:.5em}.b-checkbox.checkbox:not(.button)+.checkbox:last-child{margin-right:0}.b-checkbox.checkbox input[type=checkbox]{position:absolute;left:0;opacity:0;outline:none;z-index:-1}.b-checkbox.checkbox input[type=checkbox]+.check{width:1.25em;height:1.25em;flex-shrink:0;border-radius:4px;border:2px solid hsl(0,0%,48%);transition:background 150ms ease-out;background:rgba(0,0,0,0)}.b-checkbox.checkbox input[type=checkbox]:checked+.check{background:#00875f url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:#00875f}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-white{background:#fff url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:hsl%280, 0%25, 4%25%29%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:#fff}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-black{background:hsl(0,0%,4%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:hsl%280, 0%25, 100%25%29%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(0,0%,4%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-light{background:hsl(0,0%,96%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:rgba%280, 0, 0, 0.7%29%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(0,0%,96%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-dark{background:hsl(0,0%,21%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(0,0%,21%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-primary{background:#00875f url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:#00875f}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-link{background:hsl(229,53%,53%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(229,53%,53%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-info{background:hsl(207,61%,53%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(207,61%,53%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-success{background:hsl(153,53%,53%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(153,53%,53%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-warning{background:hsl(44,100%,77%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:rgba%280, 0, 0, 0.7%29%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(44,100%,77%)}.b-checkbox.checkbox input[type=checkbox]:checked+.check.is-danger{background:hsl(348,86%,61%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:%23fff%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center;border-color:hsl(348,86%,61%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check{background:#00875f url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:#00875f}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-white{background:#fff url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:hsl%280, 0%25, 4%25%29%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:#fff}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-black{background:hsl(0,0%,4%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:hsl%280, 0%25, 100%25%29%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(0,0%,4%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-light{background:hsl(0,0%,96%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:rgba%280, 0, 0, 0.7%29%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(0,0%,96%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-dark{background:hsl(0,0%,21%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(0,0%,21%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-primary{background:#00875f url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:#00875f}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-link{background:hsl(229,53%,53%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(229,53%,53%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-info{background:hsl(207,61%,53%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(207,61%,53%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-success{background:hsl(153,53%,53%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(153,53%,53%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-warning{background:hsl(44,100%,77%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:rgba%280, 0, 0, 0.7%29%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(44,100%,77%)}.b-checkbox.checkbox input[type=checkbox]:indeterminate+.check.is-danger{background:hsl(348,86%,61%) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Crect style=%27fill:%23fff%27 width=%270.7%27 height=%270.2%27 x=%27.15%27 y=%27.4%27%3E%3C/rect%3E%3C/svg%3E") no-repeat center center;border-color:hsl(348,86%,61%)}.b-checkbox.checkbox input[type=checkbox]:focus+.check{box-shadow:0 0 .5em hsla(0,0%,48%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check{box-shadow:0 0 .5em rgba(0,135,95,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-white{box-shadow:0 0 .5em hsla(0,0%,100%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-black{box-shadow:0 0 .5em hsla(0,0%,4%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-light{box-shadow:0 0 .5em hsla(0,0%,96%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-dark{box-shadow:0 0 .5em hsla(0,0%,21%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-primary{box-shadow:0 0 .5em rgba(0,135,95,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-link{box-shadow:0 0 .5em hsla(229,53%,53%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-info{box-shadow:0 0 .5em hsla(207,61%,53%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-success{box-shadow:0 0 .5em hsla(153,53%,53%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-warning{box-shadow:0 0 .5em hsla(44,100%,77%,.8)}.b-checkbox.checkbox input[type=checkbox]:focus:checked+.check.is-danger{box-shadow:0 0 .5em hsla(348,86%,61%,.8)}.b-checkbox.checkbox .control-label{padding-left:calc(.75em - 1px)}.b-checkbox.checkbox.button{display:flex}.b-checkbox.checkbox[disabled]{opacity:.5}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check{border-color:#00875f}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-white{border-color:#fff}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-black{border-color:hsl(0,0%,4%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-light{border-color:hsl(0,0%,96%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-dark{border-color:hsl(0,0%,21%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-primary{border-color:#00875f}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-link{border-color:hsl(229,53%,53%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-info{border-color:hsl(207,61%,53%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-success{border-color:hsl(153,53%,53%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-warning{border-color:hsl(44,100%,77%)}.b-checkbox.checkbox:hover input[type=checkbox]:not(:disabled)+.check.is-danger{border-color:hsl(348,86%,61%)}.b-checkbox.checkbox.is-small{border-radius:2px;font-size:.75rem}.b-checkbox.checkbox.is-medium{font-size:1.25rem}.b-checkbox.checkbox.is-large{font-size:1.5rem}.b-clockpicker .card-header{background-color:#00875f;color:#fff}.b-clockpicker .b-clockpicker-face:after{background-color:#00875f}.b-clockpicker .b-clockpicker-face-hand{background-color:#00875f;border-color:#00875f}.b-clockpicker .b-clockpicker-face-number.active{background-color:#00875f;color:#fff}.b-clockpicker.is-white .card-header{background-color:#fff;color:hsl(0,0%,4%)}.b-clockpicker.is-white .b-clockpicker-face:after{background-color:#fff}.b-clockpicker.is-white .b-clockpicker-face-hand{background-color:#fff;border-color:#fff}.b-clockpicker.is-white .b-clockpicker-face-number.active{background-color:#fff;color:hsl(0,0%,4%)}.b-clockpicker.is-black .card-header{background-color:hsl(0,0%,4%);color:#fff}.b-clockpicker.is-black .b-clockpicker-face:after{background-color:hsl(0,0%,4%)}.b-clockpicker.is-black .b-clockpicker-face-hand{background-color:hsl(0,0%,4%);border-color:hsl(0,0%,4%)}.b-clockpicker.is-black .b-clockpicker-face-number.active{background-color:hsl(0,0%,4%);color:#fff}.b-clockpicker.is-light .card-header{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.b-clockpicker.is-light .b-clockpicker-face:after{background-color:hsl(0,0%,96%)}.b-clockpicker.is-light .b-clockpicker-face-hand{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,96%)}.b-clockpicker.is-light .b-clockpicker-face-number.active{background-color:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.b-clockpicker.is-dark .card-header{background-color:hsl(0,0%,21%);color:#fff}.b-clockpicker.is-dark .b-clockpicker-face:after{background-color:hsl(0,0%,21%)}.b-clockpicker.is-dark .b-clockpicker-face-hand{background-color:hsl(0,0%,21%);border-color:hsl(0,0%,21%)}.b-clockpicker.is-dark .b-clockpicker-face-number.active{background-color:hsl(0,0%,21%);color:#fff}.b-clockpicker.is-primary .card-header{background-color:#00875f;color:#fff}.b-clockpicker.is-primary .b-clockpicker-face:after{background-color:#00875f}.b-clockpicker.is-primary .b-clockpicker-face-hand{background-color:#00875f;border-color:#00875f}.b-clockpicker.is-primary .b-clockpicker-face-number.active{background-color:#00875f;color:#fff}.b-clockpicker.is-link .card-header{background-color:hsl(229,53%,53%);color:#fff}.b-clockpicker.is-link .b-clockpicker-face:after{background-color:hsl(229,53%,53%)}.b-clockpicker.is-link .b-clockpicker-face-hand{background-color:hsl(229,53%,53%);border-color:hsl(229,53%,53%)}.b-clockpicker.is-link .b-clockpicker-face-number.active{background-color:hsl(229,53%,53%);color:#fff}.b-clockpicker.is-info .card-header{background-color:hsl(207,61%,53%);color:#fff}.b-clockpicker.is-info .b-clockpicker-face:after{background-color:hsl(207,61%,53%)}.b-clockpicker.is-info .b-clockpicker-face-hand{background-color:hsl(207,61%,53%);border-color:hsl(207,61%,53%)}.b-clockpicker.is-info .b-clockpicker-face-number.active{background-color:hsl(207,61%,53%);color:#fff}.b-clockpicker.is-success .card-header{background-color:hsl(153,53%,53%);color:#fff}.b-clockpicker.is-success .b-clockpicker-face:after{background-color:hsl(153,53%,53%)}.b-clockpicker.is-success .b-clockpicker-face-hand{background-color:hsl(153,53%,53%);border-color:hsl(153,53%,53%)}.b-clockpicker.is-success .b-clockpicker-face-number.active{background-color:hsl(153,53%,53%);color:#fff}.b-clockpicker.is-warning .card-header{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.b-clockpicker.is-warning .b-clockpicker-face:after{background-color:hsl(44,100%,77%)}.b-clockpicker.is-warning .b-clockpicker-face-hand{background-color:hsl(44,100%,77%);border-color:hsl(44,100%,77%)}.b-clockpicker.is-warning .b-clockpicker-face-number.active{background-color:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.b-clockpicker.is-danger .card-header{background-color:hsl(348,86%,61%);color:#fff}.b-clockpicker.is-danger .b-clockpicker-face:after{background-color:hsl(348,86%,61%)}.b-clockpicker.is-danger .b-clockpicker-face-hand{background-color:hsl(348,86%,61%);border-color:hsl(348,86%,61%)}.b-clockpicker.is-danger .b-clockpicker-face-number.active{background-color:hsl(348,86%,61%);color:#fff}.b-clockpicker .dropdown-menu{min-width:0}.b-clockpicker .dropdown,.b-clockpicker .dropdown-trigger{width:100%}.b-clockpicker .dropdown .input[readonly],.b-clockpicker .dropdown-trigger .input[readonly]{cursor:pointer;box-shadow:inset 0 .0625em .125em hsla(0,0%,4%,.05)}.b-clockpicker .dropdown .input[readonly]:focus,.b-clockpicker .dropdown .input[readonly].is-focused,.b-clockpicker .dropdown .input[readonly]:active,.b-clockpicker .dropdown .input[readonly].is-active,.b-clockpicker .dropdown-trigger .input[readonly]:focus,.b-clockpicker .dropdown-trigger .input[readonly].is-focused,.b-clockpicker .dropdown-trigger .input[readonly]:active,.b-clockpicker .dropdown-trigger .input[readonly].is-active{box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.b-clockpicker .dropdown-item,.b-clockpicker .dropdown .dropdown-menu .has-link a,.dropdown .dropdown-menu .has-link .b-clockpicker a{font-size:inherit;padding:0}.b-clockpicker .dropdown-content{padding-top:0;padding-bottom:0}.b-clockpicker .card{border-radius:.25rem}.b-clockpicker .card-header{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.b-clockpicker .card-content{padding:12px}.b-clockpicker-btn{cursor:pointer;opacity:.6}.b-clockpicker-btn:hover,.b-clockpicker-btn.active{opacity:1}.b-clockpicker-period .b-clockpicker-btn{font-size:16px}.b-clockpicker-time span{align-items:center;display:inline-flex;justify-content:center}.b-clockpicker-header{display:flex;line-height:1;justify-content:flex-end;color:inherit}.b-clockpicker-header .b-clockpicker-time{white-space:nowrap}.b-clockpicker-header .b-clockpicker-time span{height:60px;font-size:60px}.b-clockpicker-header .b-clockpicker-period{align-self:flex-end;display:flex;flex-direction:column;margin:8px 0 6px 8px}.b-clockpicker-body{transition:.9s cubic-bezier(0.25, 0.8, 0.5, 1)}.b-clockpicker-body .b-clockpicker-btn{padding:0 8px;border-radius:9999px;margin-bottom:2px}.b-clockpicker-body .b-clockpicker-btn:hover,.b-clockpicker-body .b-clockpicker-btn.active{background-color:#00875f;color:#fff}.b-clockpicker-body .b-clockpicker-period{position:absolute;top:5px;right:5px}.b-clockpicker-body .b-clockpicker-time{position:absolute;top:5px;left:5px;font-size:16px}.b-clockpicker-body .b-clockpicker-face{border-radius:50%;position:relative;background-color:hsl(0,0%,86%);width:100%;height:100%;align-items:center;display:flex;justify-content:center}.b-clockpicker-body .b-clockpicker-face:after{border-radius:50%;content:"";position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);width:12px;height:12px;z-index:10}.b-clockpicker-body .b-clockpicker-face-outer-ring{user-select:none;height:calc(100% - 50px);width:calc(100% - 50px);position:relative;border-radius:50%}.b-clockpicker-body .b-clockpicker-face-number{align-items:center;border-radius:100%;cursor:default;display:flex;font-size:18px;text-align:center;justify-content:center;position:absolute;width:40px;height:40px;left:calc(50% - 40px*.5);top:calc(50% - 40px*.5);user-select:none}.b-clockpicker-body .b-clockpicker-face-number>span{z-index:1}.b-clockpicker-body .b-clockpicker-face-number:before,.b-clockpicker-body .b-clockpicker-face-number:after{content:"";height:40px;width:40px;border-radius:100%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.b-clockpicker-body .b-clockpicker-face-number.active{cursor:default;z-index:2}.b-clockpicker-body .b-clockpicker-face-number.disabled{pointer-events:none;opacity:.25}.b-clockpicker-body .b-clockpicker-face-hand{height:calc(50% - 6px);width:2px;bottom:50%;left:calc(50% - 1px);transform-origin:center bottom;position:absolute;will-change:transform;z-index:1}.b-clockpicker-body .b-clockpicker-face-hand:before{background:rgba(0,0,0,0);border-width:2px;border-style:solid;border-color:inherit;border-radius:100%;width:12px;height:12px;content:"";position:absolute;top:-6px;left:50%;transform:translate(-50%, -50%)}.b-clockpicker-footer{display:block;padding:12px}.b-clockpicker.is-small{border-radius:2px;font-size:.75rem}.b-clockpicker.is-medium{font-size:1.25rem}.b-clockpicker.is-large{font-size:1.5rem}.collapse .collapse-trigger{display:inline;cursor:pointer}.collapse .collapse-content{display:inherit}.colorpicker .color-name{font-family:monospace;text-transform:uppercase}.colorpicker .colorpicker-footer{margin-top:.875rem;padding-top:.875rem;border:1px solid #dbdbdb;border-width:1px 0 0 0}.colorpicker .colorpicker-footer .colorpicker-fields{margin-bottom:.875rem}.colorpicker .colorpicker-footer .colorpicker-fields .field{flex-grow:1}.colorpicker .colorpicker-footer .colorpicker-fields .field .field-label{margin-right:.5rem}.colorpicker .colorpicker-footer .colorpicker-fields .field .control{display:flex}.colorpicker .colorpicker-footer .colorpicker-fields .field .control .input{-webkit-appearance:none;-moz-appearance:textfield;appearance:textfield;flex-grow:1;width:0;min-width:42px;text-align:right}.colorpicker .colorpicker-footer .colorpicker-fields .field .control .input::-webkit-outer-spin-button,.colorpicker .colorpicker-footer .colorpicker-fields .field .control .input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.colorpicker .dropdown.is-expanded .dropdown-menu,.colorpicker .dropdown.is-expanded.is-mobile-modal .dropdown-menu{width:unset}.colorpicker .dropdown-horizontal-colorpicker{display:flex;flex-direction:row}.colorpicker .dropdown-horizontal-colorpicker .colorpicker-footer{border-width:0 0 0 1px;margin-top:0;padding-top:0;margin-left:.875rem;padding-left:.875rem}svg.b-colorpicker-triangle{width:200px;height:200px;user-select:none}@media(max-width: 769px){svg.b-colorpicker-triangle{width:100%;height:auto}}svg.b-colorpicker-triangle .colorpicker-triangle-hue{width:100%;height:100%;background:conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)}svg.b-colorpicker-triangle .colorpicker-triangle-slider-hue,svg.b-colorpicker-triangle .colorpicker-triangle-slider-hue foreignObject,svg.b-colorpicker-triangle .colorpicker-triangle-slider-hue g,svg.b-colorpicker-triangle .colorpicker-triangle-slider-sl,svg.b-colorpicker-triangle .colorpicker-triangle-slider-sl foreignObject,svg.b-colorpicker-triangle .colorpicker-triangle-slider-sl g{transform-origin:50% 50%}svg.b-colorpicker-triangle .hue-range-thumb,svg.b-colorpicker-triangle .sl-range-thumb{background:rgba(0,0,0,0);border-radius:4px;box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #dbdbdb;cursor:grab;height:calc(100% - .25em);width:calc(100% - .25em);margin:.125em}svg.b-colorpicker-triangle .hue-range-thumb:hover,svg.b-colorpicker-triangle .sl-range-thumb:hover{box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #b5b5b5}svg.b-colorpicker-triangle .hue-range-thumb:focus,svg.b-colorpicker-triangle .sl-range-thumb:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #00875f,0 0 0 .125em rgba(0,135,95,.25)}svg.b-colorpicker-triangle .hue-range-thumb:active,svg.b-colorpicker-triangle .sl-range-thumb:active{cursor:grabbing}div.b-colorpicker-square{position:relative;aspect-ratio:1/1;user-select:none}div.b-colorpicker-square .colorpicker-square-slider-hue{background:conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);border-radius:4px;position:absolute;top:0;right:0;bottom:0;left:0}div.b-colorpicker-square .colorpicker-square-slider-hue .hue-range-thumb{border-radius:calc(4px/1.75);position:absolute;aspect-ratio:1/1;transform:translate(-50%, -50%);box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #dbdbdb;cursor:grab}div.b-colorpicker-square .colorpicker-square-slider-hue .hue-range-thumb:hover{box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 2px #b5b5b5,0 0 0 1px #b5b5b5}div.b-colorpicker-square .colorpicker-square-slider-hue .hue-range-thumb:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #00875f,0 0 0 .125em rgba(0,135,95,.25)}div.b-colorpicker-square .colorpicker-square-slider-hue .hue-range-thumb:active{cursor:grabbing}div.b-colorpicker-square .colorpicker-square-slider-sl{background:#fff;border-radius:2px;position:absolute;top:0;right:0;bottom:0;left:0}div.b-colorpicker-square .colorpicker-square-slider-sl::before{content:"";background:linear-gradient(0deg, #000, #fff);position:absolute;top:0;right:0;bottom:0;left:0;mix-blend-mode:hard-light}div.b-colorpicker-square .colorpicker-square-slider-sl .sl-range-thumb{display:block;border-radius:4px;position:absolute;width:8px;height:8px;transform:translate(-50%, -50%);box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #dbdbdb;cursor:grab}div.b-colorpicker-square .colorpicker-square-slider-sl .sl-range-thumb:hover{box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 2px #b5b5b5,0 0 0 1px #b5b5b5}div.b-colorpicker-square .colorpicker-square-slider-sl .sl-range-thumb:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #00875f,0 0 0 .125em rgba(0,135,95,.25)}div.b-colorpicker-square .colorpicker-square-slider-sl .sl-range-thumb:active{cursor:grabbing}.b-colorpicker-alpha-slider{height:1em;background-image:linear-gradient(45deg, #c7c7c7 25%, transparent 25%, transparent 75%, #c7c7c7 75%, #c7c7c7),linear-gradient(45deg, #c7c7c7 25%, transparent 25%, transparent 75%, #c7c7c7 75%, #c7c7c7);background-size:1em 1em;background-position:.5em .5em,0 0;border-radius:4px;margin-top:.125em;margin-bottom:.875rem;position:relative}.b-colorpicker-alpha-slider .alpha-range-thumb{width:.4em;height:1.25em;border-radius:4px;box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 2px #dbdbdb,0 0 0 1px #dbdbdb;cursor:grab;position:absolute;top:50%;left:0;transform:translate(-50%, -50%)}.b-colorpicker-alpha-slider .alpha-range-thumb:hover{box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 2px #b5b5b5,0 0 0 1px #b5b5b5}.b-colorpicker-alpha-slider .alpha-range-thumb:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 1px #00875f,0 0 0 .125em rgba(0,135,95,.25)}.b-colorpicker-alpha-slider .alpha-range-thumb:active{cursor:grabbing}.b-colorpicker-alpha-slider .alpha-range-thumb>.b-tooltip,.b-colorpicker-alpha-slider .alpha-range-thumb>.b-tooltip>.tooltip-trigger{position:absolute;display:block;top:0;right:0;bottom:0;left:0}.datepicker{font-size:.875rem}.datepicker .dropdown,.datepicker .dropdown-trigger{width:100%}.datepicker .dropdown .input[readonly],.datepicker .dropdown-trigger .input[readonly]{cursor:pointer;box-shadow:inset 0 .0625em .125em hsla(0,0%,4%,.05)}.datepicker .dropdown .input[readonly]:focus,.datepicker .dropdown .input[readonly].is-focused,.datepicker .dropdown .input[readonly]:active,.datepicker .dropdown .input[readonly].is-active,.datepicker .dropdown-trigger .input[readonly]:focus,.datepicker .dropdown-trigger .input[readonly].is-focused,.datepicker .dropdown-trigger .input[readonly]:active,.datepicker .dropdown-trigger .input[readonly].is-active{box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.datepicker .dropdown.is-disabled{opacity:1}.datepicker .dropdown-content{background-color:#fff;border-radius:4px;box-shadow:0 .5em 1em -0.125em hsla(0,0%,4%,.1),0 0px 0 1px hsla(0,0%,4%,.02)}.datepicker .dropdown-item,.datepicker .dropdown .dropdown-menu .has-link a,.dropdown .dropdown-menu .has-link .datepicker a{font-size:inherit}.datepicker .datepicker-header{padding-bottom:.875rem;margin-bottom:.875rem;border-bottom:1px solid hsl(0,0%,86%)}.datepicker .datepicker-footer{margin-top:.875rem;padding-top:.875rem;border-top:1px solid hsl(0,0%,86%)}.datepicker .datepicker-table{display:table;margin:0 auto 0 auto}.datepicker .datepicker-table .datepicker-cell{text-align:center;vertical-align:middle;display:table-cell;border-radius:4px;padding:.5rem .75rem}.datepicker .datepicker-table .datepicker-header{display:table-header-group}.datepicker .datepicker-table .datepicker-header .datepicker-cell{color:hsl(0,0%,48%);font-weight:600}.datepicker .datepicker-table .datepicker-body{display:table-row-group}.datepicker .datepicker-table .datepicker-body .datepicker-row{display:table-row}.datepicker .datepicker-table .datepicker-body .datepicker-months{display:inline-flex;flex-wrap:wrap;flex-direction:row;width:17rem}.datepicker .datepicker-table .datepicker-body .datepicker-months .datepicker-cell{display:flex;align-items:center;justify-content:center;width:33.33%;height:2.5rem}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-unselectable{color:hsl(0,0%,71%)}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-today{border:solid 1px rgba(0,135,95,.5)}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selectable{color:hsl(0,0%,29%)}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selectable:hover:not(.is-selected),.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selectable:focus:not(.is-selected){background-color:hsl(0,0%,96%);color:hsl(0,0%,4%);cursor:pointer}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selectable.is-within-hovered-range.is-first-hovered{background-color:hsl(0,0%,48%);color:hsl(0,0%,86%);border-bottom-right-radius:0;border-top-right-radius:0}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selectable.is-within-hovered-range.is-within-hovered{background-color:hsl(0,0%,96%);color:hsl(0,0%,4%);border-radius:0}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selectable.is-within-hovered-range.is-last-hovered{background-color:hsl(0,0%,48%);color:hsl(0,0%,86%);border-bottom-left-radius:0;border-top-left-radius:0}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selected{background-color:#00875f;color:#fff}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selected.is-first-selected{background-color:#00875f;color:#fff;border-bottom-right-radius:0;border-top-right-radius:0}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selected.is-within-selected{background-color:rgba(0,135,95,.5);border-radius:0}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-selected.is-last-selected{background-color:#00875f;color:#fff;border-bottom-left-radius:0;border-top-left-radius:0}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-nearby:not(.is-selected){color:hsl(0,0%,71%)}.datepicker .datepicker-table .datepicker-body .datepicker-cell.is-week-number{cursor:default}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell{padding:.3rem .75rem .75rem}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event{position:relative}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events{bottom:.425rem;display:flex;justify-content:center;left:0;padding:0 .35rem;position:absolute;width:100%}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-white{background-color:#fff}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-black{background-color:hsl(0,0%,4%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-light{background-color:hsl(0,0%,96%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-dark{background-color:hsl(0,0%,21%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-primary{background-color:#00875f}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-link{background-color:hsl(229,53%,53%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-info{background-color:hsl(207,61%,53%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-success{background-color:hsl(153,53%,53%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-warning{background-color:hsl(44,100%,77%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event .events .event.is-danger{background-color:hsl(348,86%,61%)}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event.dots .event{border-radius:50%;height:.35em;margin:0 .1em;width:.35em}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.has-event.bars .event{height:.25em;width:100%}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.is-selected{overflow:hidden}.datepicker .datepicker-table .datepicker-body.has-events .datepicker-cell.is-selected .events .event.is-primary{background-color:rgb(0,211.5,148.8333333333)}.datepicker.is-small{border-radius:2px;font-size:.75rem}.datepicker.is-medium{font-size:1.25rem}.datepicker.is-large{font-size:1.5rem}@media screen and (min-width: 1024px){.datepicker .footer-horizontal-timepicker{border:none;padding-left:10px;margin-left:5px;display:flex}.datepicker .dropdown-horizontal-timepicker{display:flex}.datepicker .content-horizontal-timepicker{border-right:1px solid #dbdbdb}}.dialog .modal-card{max-width:460px;width:auto}.dialog .modal-card .modal-card-head{font-size:1.25rem;font-weight:600}.dialog .modal-card .modal-card-body .field{margin-top:16px}.dialog .modal-card .modal-card-body.is-titleless{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.dialog .modal-card .modal-card-foot{justify-content:flex-end}.dialog .modal-card .modal-card-foot .button{display:inline;min-width:5em;font-weight:600}@media screen and (min-width: 769px),print{.dialog .modal-card{min-width:320px}}.dialog.is-small .modal-card,.dialog.is-small .input,.dialog.is-small .button{border-radius:2px;font-size:.75rem}.dialog.is-medium .modal-card,.dialog.is-medium .input,.dialog.is-medium .button{font-size:1.25rem}.dialog.is-large .modal-card,.dialog.is-large .input,.dialog.is-large .button{font-size:1.5rem}.dialog.has-custom-container{position:absolute}.dropdown+.dropdown{margin-left:.5em}.dropdown .background{bottom:0;left:0;position:absolute;right:0;top:0;position:fixed;background-color:hsla(0,0%,4%,.86);z-index:40;cursor:pointer}@media screen and (min-width: 1024px){.dropdown .background{display:none}}.dropdown.dropdown-menu-animation .dropdown-menu{display:block}.dropdown .dropdown-menu .dropdown-item.is-disabled,.dropdown .dropdown-menu .has-link a.is-disabled{cursor:not-allowed}.dropdown .dropdown-menu .dropdown-item.is-disabled:hover,.dropdown .dropdown-menu .has-link a.is-disabled:hover{background:inherit;color:inherit}.dropdown .dropdown-menu .has-link a{padding-right:3rem;white-space:nowrap}.dropdown.is-hoverable:not(.is-active) .dropdown-menu{display:none}.dropdown.is-hoverable:not(.is-touch-enabled):hover .dropdown-menu{display:inherit}.dropdown.is-expanded{width:100%}.dropdown.is-expanded .dropdown-trigger{width:100%}.dropdown.is-expanded .dropdown-menu{width:100%}.dropdown.is-expanded.is-mobile-modal .dropdown-menu{max-width:100%}.dropdown:not(.is-disabled) .dropdown-menu .dropdown-item.is-disabled,.dropdown:not(.is-disabled) .dropdown-menu .has-link a.is-disabled{opacity:.5}.dropdown .navbar-item{height:100%}.dropdown.is-disabled{opacity:.5;cursor:not-allowed}.dropdown.is-disabled .dropdown-trigger{pointer-events:none}.dropdown.is-inline .dropdown-menu{position:static;display:inline-block;padding:0}.dropdown.is-top-right .dropdown-menu{top:auto;bottom:100%}.dropdown.is-top-left .dropdown-menu{top:auto;bottom:100%;right:0;left:auto}.dropdown.is-bottom-left .dropdown-menu{right:0;left:auto}@media screen and (max-width: 1023px){.dropdown.is-mobile-modal:not(.is-hoverable)>.dropdown-menu,.dropdown.is-mobile-modal.is-touch-enabled>.dropdown-menu{position:fixed !important;width:calc(100vw - 40px);max-width:460px;max-height:calc(100vh - 120px);top:25% !important;left:50% !important;bottom:auto !important;right:auto !important;transform:translate3d(-50%, -25%, 0);white-space:normal;overflow-y:auto;z-index:50 !important}.dropdown.is-mobile-modal:not(.is-hoverable)>.dropdown-menu>.dropdown-content>.dropdown-item,.dropdown .dropdown-menu .has-link .dropdown.is-mobile-modal:not(.is-hoverable)>.dropdown-menu>.dropdown-content>a,.dropdown.is-mobile-modal:not(.is-hoverable)>.dropdown-menu>.dropdown-content>.has-link a,.dropdown.is-mobile-modal.is-touch-enabled>.dropdown-menu>.dropdown-content>.dropdown-item,.dropdown .dropdown-menu .has-link .dropdown.is-mobile-modal.is-touch-enabled>.dropdown-menu>.dropdown-content>a,.dropdown.is-mobile-modal.is-touch-enabled>.dropdown-menu>.dropdown-content>.has-link a{padding:1rem 1.5rem}}@media screen and (max-width: 1023px){html.is-clipped-touch{overflow:hidden !important}}.field.is-grouped .field{flex-shrink:0}.field.is-grouped .field:not(:last-child){margin-right:.75rem}.field.is-grouped .field.is-expanded{flex-grow:1;flex-shrink:1}.field.has-addons .control:first-child .control .button,.field.has-addons .control:first-child .control .input,.field.has-addons .control:first-child .control .select select{border-bottom-left-radius:4px;border-top-left-radius:4px}.field.has-addons .control:last-child .control .button,.field.has-addons .control:last-child .control .input,.field.has-addons .control:last-child .control .select select{border-bottom-right-radius:4px;border-top-right-radius:4px}.field.has-addons .control .control .button,.field.has-addons .control .control .input,.field.has-addons .control .control .select select{border-radius:0}.field.has-addons .b-numberinput:not(:first-child) .control:first-child .button,.field.has-addons .b-numberinput:not(:first-child) .control:first-child .input,.field.has-addons .b-numberinput:not(:first-child) .control:first-child .select select{border-bottom-left-radius:0;border-top-left-radius:0}.field.has-addons .b-numberinput:not(:last-child) .control:last-child .button,.field.has-addons .b-numberinput:not(:last-child) .control:last-child .input,.field.has-addons .b-numberinput:not(:last-child) .control:last-child .select select{border-bottom-right-radius:0;border-top-right-radius:0}.field.has-addons.b-numberinput .control{margin-right:unset}.field.is-floating-label,.field.is-floating-in-label{position:relative}.field.is-floating-label .label,.field.is-floating-in-label .label{position:absolute;left:1em;font-size:calc(1rem*.75);background-color:rgba(0,0,0,0);z-index:5;white-space:nowrap;text-overflow:ellipsis;max-width:calc(100% - 2em);overflow:hidden}.field.is-floating-label .label.is-small,.field.is-floating-in-label .label.is-small{font-size:calc(0.75rem*.75)}.field.is-floating-label .label.is-medium,.field.is-floating-in-label .label.is-medium{font-size:calc(1.25rem*.75)}.field.is-floating-label .label.is-large,.field.is-floating-in-label .label.is-large{font-size:calc(1.5rem*.75)}.field.is-floating-label .taginput .counter,.field.is-floating-in-label .taginput .counter{float:none;text-align:right}.field.is-floating-label.has-addons>.label+.control .button,.field.is-floating-label.has-addons>.label+.control .input,.field.is-floating-label.has-addons>.label+.control .select select,.field.is-floating-in-label.has-addons>.label+.control .button,.field.is-floating-in-label.has-addons>.label+.control .input,.field.is-floating-in-label.has-addons>.label+.control .select select{border-bottom-left-radius:4px;border-top-left-radius:4px}.field.is-floating-label .label{top:-0.775em;padding-left:.125em;padding-right:.125em}.field.is-floating-label .label:before{content:"";display:block;position:absolute;top:.775em;left:0;right:0;height:.375em;background-color:#fff;z-index:-1}.field.is-floating-label .input:focus,.field.is-floating-label .textarea:focus,.field.is-floating-label .select select:focus{box-shadow:none}.field.is-floating-label .taginput .taginput-container{padding-top:.475em}.field.is-floating-label .taginput .taginput-container.is-focused{box-shadow:none}.field.is-floating-in-label>.label{top:.25em}.field.is-floating-in-label>.label+.control.datepicker .input,.field.is-floating-in-label>.label+.control.timepicker .input{padding-top:calc(3.25em*.5 - 1.5rem*.75*.5);padding-bottom:1px;height:3.25em}.field.is-floating-in-label>.label+.control:not(.datepicker):not(.timepicker):not(.taginput) .input,.field.is-floating-in-label>.label+.control:not(.datepicker):not(.timepicker):not(.taginput) .textarea,.field.is-floating-in-label>.label+.control:not(.datepicker):not(.timepicker):not(.taginput) select{padding-top:calc(3.25em*.5 - 1.5rem*.75*.5);padding-bottom:1px;height:3.25em}.field.is-floating-in-label>.label+.control:not(.datepicker):not(.timepicker):not(.taginput) .select:not(multiple){height:3.25em}.field.is-floating-in-label>.label+.control:not(.datepicker):not(.timepicker):not(.taginput) .select:not(multiple).is-loading::after{margin-top:calc(3.25em*.5 - 1.5rem*.75*.5)}.field.is-floating-in-label>.label+.control:not(.datepicker):not(.timepicker):not(.taginput) .select:not(multiple)::after{margin-top:1px}.field.is-floating-in-label>.label+.control.taginput .taginput-container{padding-top:calc(3.25em*.5 - 1.5rem*.75*.5 + .275em - 1px)}.field.is-floating-in-label>.label+.control:not(.taginput) .is-left.icon,.field.is-floating-in-label>.label+.control:not(.taginput) .is-right.icon{height:3.25em}.field.is-floating-in-label>.label+.control:not(.taginput) .is-left.icon{padding-top:calc(3.25em*.5 - 1.5rem*.75*.5)}.field.is-floating-in-label>.label+.control.is-loading::after{margin-top:calc(3.25em*.5 - 1.5rem*.75*.5)}.field.is-floating-in-label>.label+.field-body>.is-grouped .control .input,.field.is-floating-in-label>.label+.field-body>.is-grouped .control .textarea,.field.is-floating-in-label>.label+.field-body>.is-grouped .control select,.field.is-floating-in-label>.label+.field-body>.has-addons .control .input,.field.is-floating-in-label>.label+.field-body>.has-addons .control .textarea,.field.is-floating-in-label>.label+.field-body>.has-addons .control select{padding-top:calc(3.25em*.5 - 1.5rem*.75*.5);padding-bottom:1px}.field.is-floating-in-label>.label+.field-body>.is-grouped .control .input,.field.is-floating-in-label>.label+.field-body>.is-grouped .control .textarea,.field.is-floating-in-label>.label+.field-body>.is-grouped .control select,.field.is-floating-in-label>.label+.field-body>.is-grouped .control .button,.field.is-floating-in-label>.label+.field-body>.has-addons .control .input,.field.is-floating-in-label>.label+.field-body>.has-addons .control .textarea,.field.is-floating-in-label>.label+.field-body>.has-addons .control select,.field.is-floating-in-label>.label+.field-body>.has-addons .control .button{height:3.25em}.field.is-floating-in-label.has-numberinput .b-numberinput .control .input,.field.is-floating-in-label.has-numberinput .b-numberinput .control .button{height:3.25em}.field.is-floating-label.has-numberinput .label,.field.is-floating-in-label.has-numberinput .label{margin-left:calc(1rem*3)}.field.is-floating-label.has-numberinput.has-numberinput-is-small .label,.field.is-floating-in-label.has-numberinput.has-numberinput-is-small .label{margin-left:calc(0.75rem*3)}.field.is-floating-label.has-numberinput.has-numberinput-is-medium .label,.field.is-floating-in-label.has-numberinput.has-numberinput-is-medium .label{margin-left:calc(1.25rem*3)}.field.is-floating-label.has-numberinput.has-numberinput-is-large .label,.field.is-floating-in-label.has-numberinput.has-numberinput-is-large .label{margin-left:calc(1.5rem*3)}.field.is-floating-label.has-numberinput-compact .label,.field.is-floating-in-label.has-numberinput-compact .label{margin-left:calc(1rem*2.25)}.field.is-floating-label.has-numberinput-compact.has-numberinput-is-small .label,.field.is-floating-in-label.has-numberinput-compact.has-numberinput-is-small .label{margin-left:calc(0.75rem*2.25)}.field.is-floating-label.has-numberinput-compact.has-numberinput-is-medium .label,.field.is-floating-in-label.has-numberinput-compact.has-numberinput-is-medium .label{margin-left:calc(1.25rem*2.25)}.field.is-floating-label.has-numberinput-compact.has-numberinput-is-large .label,.field.is-floating-in-label.has-numberinput-compact.has-numberinput-is-large .label{margin-left:calc(1.5rem*2.25)}.field.is-grouped-right.is-floating-in-label .label,.field.has-addons-right.is-floating-in-label .label{position:relative;left:5.25em}.field.is-grouped-right.is-floating-label .label,.field.has-addons-right.is-floating-label .label{position:relative;left:5.25em}.control .help.counter{float:right;margin-left:.5em}.control .icon.is-clickable{pointer-events:auto;cursor:pointer}.control.is-loading::after{top:calc(50% - .5em);right:.75em}.icon{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit}.icon svg{background-color:rgba(0,0,0,0);fill:currentColor;stroke-width:0;stroke:currentColor;pointer-events:none;width:100%;height:100%}.b-image-wrapper>img{object-fit:cover}.b-image-wrapper>img.has-ratio,.b-image-wrapper>img.placeholder{height:100%;width:100%}.b-image-wrapper>img.placeholder{filter:blur(10px)}.loading-overlay{bottom:0;left:0;position:absolute;right:0;top:0;align-items:center;display:none;justify-content:center;overflow:hidden;z-index:29}.loading-overlay.is-active{display:flex}.loading-overlay.is-full-page{position:fixed;z-index:999}.loading-overlay.is-full-page .loading-icon:after{top:calc(50% - 2.5em);left:calc(50% - 2.5em);width:5em;height:5em}.loading-overlay .loading-background{bottom:0;left:0;position:absolute;right:0;top:0;background:#7f7f7f;background:hsla(0,0%,100%,.5)}.loading-overlay .loading-icon{position:relative}.loading-overlay .loading-icon:after{animation:spinAround 500ms infinite linear;border:2px solid hsl(0,0%,86%);border-radius:9999px;border-right-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);content:"";display:block;height:1em;position:relative;width:1em;position:absolute;top:calc(50% - 1.5em);left:calc(50% - 1.5em);width:3em;height:3em;border-width:.25em}.menu .menu-list li>a.is-disabled{pointer-events:none;cursor:not-allowed;opacity:.5}.message .media,.notification .media{padding-top:0;border:0}.message .auto-close-progress progress,.notification .auto-close-progress progress{border-top-left-radius:0 !important;border-top-right-radius:0 !important;border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important;height:10px !important}.modal.is-full-screen>.animation-content,.modal.is-full-screen>.animation-content>.modal-card{width:100%;height:100%;max-height:100vh;margin:0;background-color:hsl(0,0%,96%)}.modal .animation-content{margin:0 20px}.modal .animation-content .modal-card{margin:0}@media screen and (max-width: 768px){.modal .animation-content{width:100%}}.modal .modal-content{width:100%}@media screen and (max-width: 768px){.modal .modal-close{background-color:color-mix(in hsl, rgba(10.2, 10.2, 10.2, 0.86) 10%, transparent)}.modal .modal-close:hover,.modal .modal-close :focus{background-color:color-mix(in hsl, rgba(10.2, 10.2, 10.2, 0.86) 20%, transparent)}.modal .modal-close:active{background-color:color-mix(in hsl, rgba(10.2, 10.2, 10.2, 0.86) 30%, transparent)}}.navbar.has-navbar-centered .navbar-start{justify-content:center;margin-left:auto}.navbar.has-navbar-centered .navbar-end{margin-left:0}.navbar .navbar-dropdown.is-boxed{visibility:hidden;transition-property:opacity,visibility,transform}.navbar .navbar-item.has-dropdown.is-active .is-boxed,.navbar .navbar-item.has-dropdown.is-hoverable:hover .is-boxed{visibility:visible}.notices{position:fixed;display:flex;top:0;bottom:0;left:0;right:0;padding:2em;overflow:hidden;z-index:1000;pointer-events:none}.notices .toast{display:inline-flex;animation-duration:150ms;margin:.5em 0;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border-radius:2em;padding:.75em 1.5em;pointer-events:auto;opacity:.92}.notices .toast.is-white{color:hsl(0,0%,4%);background:#fff}.notices .toast.is-black{color:#fff;background:hsl(0,0%,4%)}.notices .toast.is-light{color:rgba(0,0,0,.7);background:hsl(0,0%,96%)}.notices .toast.is-dark{color:#fff;background:hsl(0,0%,21%)}.notices .toast.is-primary{color:#fff;background:#00875f}.notices .toast.is-link{color:#fff;background:hsl(229,53%,53%)}.notices .toast.is-info{color:#fff;background:hsl(207,61%,53%)}.notices .toast.is-success{color:#fff;background:hsl(153,53%,53%)}.notices .toast.is-warning{color:rgba(0,0,0,.7);background:hsl(44,100%,77%)}.notices .toast.is-danger{color:#fff;background:hsl(348,86%,61%)}.notices .snackbar{display:inline-flex;align-items:center;justify-content:space-around;animation-duration:150ms;margin:.5em 0;box-shadow:0 1px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border-radius:4px;pointer-events:auto;background:hsl(0,0%,21%);color:#fff;min-height:3em}.notices .snackbar .text{padding:.5em 1em}.notices .snackbar .action{margin-left:auto;padding:.5em;padding-left:0}.notices .snackbar .action .button{font-weight:600;text-transform:uppercase;background:hsl(0,0%,21%);border:rgba(0,0,0,0)}.notices .snackbar .action .button:hover{background:hsl(0,0%,16%)}.notices .snackbar .action .button:active{background:hsl(0,0%,16%)}.notices .snackbar .action.is-white .button{color:#fff}.notices .snackbar .action.is-black .button{color:hsl(0,0%,4%)}.notices .snackbar .action.is-light .button{color:hsl(0,0%,96%)}.notices .snackbar .action.is-dark .button{color:hsl(0,0%,21%)}.notices .snackbar .action.is-primary .button{color:#00875f}.notices .snackbar .action.is-link .button{color:hsl(229,53%,53%)}.notices .snackbar .action.is-info .button{color:hsl(207,61%,53%)}.notices .snackbar .action.is-success .button{color:hsl(153,53%,53%)}.notices .snackbar .action.is-warning .button{color:hsl(44,100%,77%)}.notices .snackbar .action.is-danger .button{color:hsl(348,86%,61%)}.notices .snackbar .action.is-cancel{padding-right:0}@media screen and (max-width: 768px){.notices .snackbar{width:100%;margin:0;border-radius:0}}@media screen and (min-width: 769px),print{.notices .snackbar{min-width:350px;max-width:600px;overflow:hidden}}.notices .notification{pointer-events:auto;max-width:600px}.notices .toast.is-top,.notices .toast.is-bottom,.notices .snackbar.is-top,.notices .snackbar.is-bottom,.notices .notification.is-top,.notices .notification.is-bottom{align-self:center}.notices .toast.is-top-right,.notices .toast.is-bottom-right,.notices .snackbar.is-top-right,.notices .snackbar.is-bottom-right,.notices .notification.is-top-right,.notices .notification.is-bottom-right{align-self:flex-end}.notices .toast.is-top-left,.notices .toast.is-bottom-left,.notices .snackbar.is-top-left,.notices .snackbar.is-bottom-left,.notices .notification.is-top-left,.notices .notification.is-bottom-left{align-self:flex-start}.notices .toast.is-toast,.notices .snackbar.is-toast,.notices .notification.is-toast{opacity:.92}.notices.is-top{flex-direction:column}.notices.is-bottom{flex-direction:column-reverse}.notices.is-bottom .notification{margin-bottom:0}.notices.is-bottom .notification:not(:first-child){margin-bottom:1.5rem}.notices.has-custom-container{position:absolute}@media screen and (max-width: 768px){.notices{padding:0;position:fixed !important}}.notification .auto-close-progress.progress-wrapper{position:absolute;bottom:0;left:0;width:100%}.b-numberinput.field{margin-bottom:0}.b-numberinput.field.is-grouped div.control{flex-grow:1;flex-shrink:1}.b-numberinput.field.has-addons.is-expanded{flex-grow:1;flex-shrink:1}.b-numberinput input[type=number]::-webkit-inner-spin-button,.b-numberinput input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.b-numberinput input[type=number]{-moz-appearance:textfield}.b-numberinput input[type=number]{text-align:center}.b-numberinput .button.is-rounded{padding-left:1em;padding-right:1em}.pagination .pagination-next,.pagination .pagination-previous{padding-left:.75em;padding-right:.75em}.pagination .pagination-next.is-disabled,.pagination .pagination-previous.is-disabled{pointer-events:none;cursor:not-allowed;opacity:.5}.pagination.is-simple{justify-content:normal}.pagination.is-simple.is-centered{justify-content:center}.pagination.is-simple.is-right{justify-content:flex-end}.pagination .is-current{pointer-events:none;cursor:not-allowed}@media screen and (min-width: 769px),print{.pagination.has-input .pagination-list{order:1}.pagination.has-input .pagination-input{order:2}.pagination.has-input .pagination-previous{order:3}.pagination.has-input .pagination-next{order:4}.pagination.has-input.is-centered .pagination-previous{order:1}.pagination.has-input.is-centered .pagination-list{order:2}.pagination.has-input.is-centered .pagination-input{order:3}.pagination.has-input.is-centered .pagination-next{order:4}.pagination.has-input.is-centered.is-input-right .pagination-previous{order:1}.pagination.has-input.is-centered.is-input-right .pagination-list{order:2}.pagination.has-input.is-centered.is-input-right .pagination-next{order:3}.pagination.has-input.is-centered.is-input-right .pagination-input{order:4}.pagination.has-input.is-centered.is-input-left .pagination-input{order:1}.pagination.has-input.is-centered.is-input-left .pagination-previous{order:2}.pagination.has-input.is-centered.is-input-left .pagination-list{order:3}.pagination.has-input.is-centered.is-input-left .pagination-next{order:4}.pagination.has-input.is-right .pagination-previous{order:1}.pagination.has-input.is-right .pagination-next{order:2}.pagination.has-input.is-right .pagination-input{order:3}.pagination.has-input.is-right .pagination-list{order:4}.pagination.has-input.is-right.is-input-right .pagination-previous{order:1}.pagination.has-input.is-right.is-input-right .pagination-next{order:2}.pagination.has-input.is-right.is-input-right .pagination-list{order:3}.pagination.has-input.is-right.is-input-right .pagination-input{order:4}.pagination.has-input.is-right.is-input-left .pagination-input{order:1}.pagination.has-input.is-right.is-input-left .pagination-previous{order:2}.pagination.has-input.is-right.is-input-left .pagination-next{order:3}.pagination.has-input.is-right.is-input-left .pagination-list{order:4}.pagination.has-input.is-input-right .pagination-list{order:1}.pagination.has-input.is-input-right .pagination-previous{order:2}.pagination.has-input.is-input-right .pagination-next{order:3}.pagination.has-input.is-input-right .pagination-input{order:4}.pagination.has-input.is-input-left .pagination-input{order:1}.pagination.has-input.is-input-left .pagination-list{order:2}.pagination.has-input.is-input-left .pagination-previous{order:3}.pagination.has-input.is-input-left .pagination-next{order:4}}.progress-wrapper{position:relative;overflow:hidden}.progress-wrapper:not(:last-child){margin-bottom:1.5rem}.progress-wrapper .progress-value{position:absolute;top:0;left:50%;transform:translateX(-50%);font-size:calc(1rem/1.5);line-height:1rem;font-weight:700;color:rgba(0,0,0,.7);white-space:nowrap}.progress-wrapper .progress,.progress-wrapper .progress-wrapper.is-not-native,.progress-wrapper .progress-bar{margin-bottom:0}.progress-wrapper .progress.is-small+.progress-value,.progress-wrapper .is-small.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress.is-small .progress-value,.progress-wrapper .is-small.progress-wrapper.is-not-native .progress-value,.progress-wrapper .progress-bar.is-small+.progress-value,.progress-wrapper .progress-bar.is-small .progress-value{font-size:calc(0.75rem/1.5);line-height:.75rem}.progress-wrapper .progress.is-medium+.progress-value,.progress-wrapper .is-medium.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress.is-medium .progress-value,.progress-wrapper .is-medium.progress-wrapper.is-not-native .progress-value,.progress-wrapper .progress-bar.is-medium+.progress-value,.progress-wrapper .progress-bar.is-medium .progress-value{font-size:calc(1.25rem/1.5);line-height:1.25rem}.progress-wrapper .progress.is-large+.progress-value,.progress-wrapper .is-large.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress.is-large .progress-value,.progress-wrapper .is-large.progress-wrapper.is-not-native .progress-value,.progress-wrapper .progress-bar.is-large+.progress-value,.progress-wrapper .progress-bar.is-large .progress-value{font-size:calc(1.5rem/1.5);line-height:1.5rem}.progress-wrapper .progress::-webkit-progress-value,.progress-wrapper .progress-wrapper.is-not-native::-webkit-progress-value,.progress-wrapper .progress-bar::-webkit-progress-value{transition:width .5s ease}.progress-wrapper .progress.is-more-than-half+.progress-value,.progress-wrapper .is-more-than-half.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-white+.progress-value,.progress-wrapper .is-more-than-half.is-white.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-white+.progress-value{color:hsl(0,0%,4%)}.progress-wrapper .progress.is-more-than-half.is-black+.progress-value,.progress-wrapper .is-more-than-half.is-black.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-black+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-light+.progress-value,.progress-wrapper .is-more-than-half.is-light.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-light+.progress-value{color:rgba(0,0,0,.7)}.progress-wrapper .progress.is-more-than-half.is-dark+.progress-value,.progress-wrapper .is-more-than-half.is-dark.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-dark+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-primary+.progress-value,.progress-wrapper .is-more-than-half.is-primary.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-primary+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-link+.progress-value,.progress-wrapper .is-more-than-half.is-link.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-link+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-info+.progress-value,.progress-wrapper .is-more-than-half.is-info.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-info+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-success+.progress-value,.progress-wrapper .is-more-than-half.is-success.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-success+.progress-value{color:#fff}.progress-wrapper .progress.is-more-than-half.is-warning+.progress-value,.progress-wrapper .is-more-than-half.is-warning.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-warning+.progress-value{color:rgba(0,0,0,.7)}.progress-wrapper .progress.is-more-than-half.is-danger+.progress-value,.progress-wrapper .is-more-than-half.is-danger.progress-wrapper.is-not-native+.progress-value,.progress-wrapper .progress-bar.is-more-than-half.is-danger+.progress-value{color:#fff}.progress-wrapper .progress.is-squared,.progress-wrapper .is-squared.progress-wrapper.is-not-native,.progress-wrapper .progress-bar.is-squared{border-radius:0}.progress-wrapper.is-not-native{white-space:nowrap;background-color:hsl(0,0%,93%);border-radius:9999px}.progress-wrapper.is-not-native .progress-bar{position:relative;display:inline-block;vertical-align:top;height:100%;background-color:hsl(0,0%,29%)}.progress-wrapper.is-not-native .progress-bar .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-white{background-color:#fff}.progress-wrapper.is-not-native .progress-bar.is-white .progress-value{color:hsl(0,0%,4%)}.progress-wrapper.is-not-native .progress-bar.is-black{background-color:hsl(0,0%,4%)}.progress-wrapper.is-not-native .progress-bar.is-black .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-light{background-color:hsl(0,0%,96%)}.progress-wrapper.is-not-native .progress-bar.is-light .progress-value{color:rgba(0,0,0,.7)}.progress-wrapper.is-not-native .progress-bar.is-dark{background-color:hsl(0,0%,21%)}.progress-wrapper.is-not-native .progress-bar.is-dark .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-primary{background-color:#00875f}.progress-wrapper.is-not-native .progress-bar.is-primary .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-link{background-color:hsl(229,53%,53%)}.progress-wrapper.is-not-native .progress-bar.is-link .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-info{background-color:hsl(207,61%,53%)}.progress-wrapper.is-not-native .progress-bar.is-info .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-success{background-color:hsl(153,53%,53%)}.progress-wrapper.is-not-native .progress-bar.is-success .progress-value{color:#fff}.progress-wrapper.is-not-native .progress-bar.is-warning{background-color:hsl(44,100%,77%)}.progress-wrapper.is-not-native .progress-bar.is-warning .progress-value{color:rgba(0,0,0,.7)}.progress-wrapper.is-not-native .progress-bar.is-danger{background-color:hsl(348,86%,61%)}.progress-wrapper.is-not-native .progress-bar.is-danger .progress-value{color:#fff}.progress-wrapper.is-squared{border-radius:0}.b-radio.radio{outline:none;display:inline-flex;align-items:center}.b-radio.radio:not(.button){margin-right:.5em}.b-radio.radio:not(.button)+.radio:last-child{margin-right:0}.b-radio.radio+.radio{margin-left:0}.b-radio.radio input[type=radio]{position:absolute;left:0;opacity:0;outline:none;z-index:-1}.b-radio.radio input[type=radio]+.check{display:flex;flex-shrink:0;position:relative;cursor:pointer;width:1.25em;height:1.25em;transition:background 150ms ease-out;border-radius:50%;border:2px solid hsl(0,0%,48%)}.b-radio.radio input[type=radio]+.check:before{content:"";display:flex;position:absolute;left:50%;margin-left:calc(-1.25em*.5);bottom:50%;margin-bottom:calc(-1.25em*.5);width:1.25em;height:1.25em;transition:transform 150ms ease-out;border-radius:50%;transform:scale(0);background-color:#00875f}.b-radio.radio input[type=radio]+.check.is-white:before{background:#fff}.b-radio.radio input[type=radio]+.check.is-black:before{background:hsl(0,0%,4%)}.b-radio.radio input[type=radio]+.check.is-light:before{background:hsl(0,0%,96%)}.b-radio.radio input[type=radio]+.check.is-dark:before{background:hsl(0,0%,21%)}.b-radio.radio input[type=radio]+.check.is-primary:before{background:#00875f}.b-radio.radio input[type=radio]+.check.is-link:before{background:hsl(229,53%,53%)}.b-radio.radio input[type=radio]+.check.is-info:before{background:hsl(207,61%,53%)}.b-radio.radio input[type=radio]+.check.is-success:before{background:hsl(153,53%,53%)}.b-radio.radio input[type=radio]+.check.is-warning:before{background:hsl(44,100%,77%)}.b-radio.radio input[type=radio]+.check.is-danger:before{background:hsl(348,86%,61%)}.b-radio.radio input[type=radio]:checked+.check{border-color:#00875f}.b-radio.radio input[type=radio]:checked+.check.is-white{border-color:#fff}.b-radio.radio input[type=radio]:checked+.check.is-black{border-color:hsl(0,0%,4%)}.b-radio.radio input[type=radio]:checked+.check.is-light{border-color:hsl(0,0%,96%)}.b-radio.radio input[type=radio]:checked+.check.is-dark{border-color:hsl(0,0%,21%)}.b-radio.radio input[type=radio]:checked+.check.is-primary{border-color:#00875f}.b-radio.radio input[type=radio]:checked+.check.is-link{border-color:hsl(229,53%,53%)}.b-radio.radio input[type=radio]:checked+.check.is-info{border-color:hsl(207,61%,53%)}.b-radio.radio input[type=radio]:checked+.check.is-success{border-color:hsl(153,53%,53%)}.b-radio.radio input[type=radio]:checked+.check.is-warning{border-color:hsl(44,100%,77%)}.b-radio.radio input[type=radio]:checked+.check.is-danger{border-color:hsl(348,86%,61%)}.b-radio.radio input[type=radio]:checked+.check:before{transform:scale(0.5)}.b-radio.radio input[type=radio]:focus+.check{box-shadow:0 0 .5em hsla(0,0%,48%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check{box-shadow:0 0 .5em rgba(0,135,95,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-white{box-shadow:0 0 .5em hsla(0,0%,100%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-black{box-shadow:0 0 .5em hsla(0,0%,4%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-light{box-shadow:0 0 .5em hsla(0,0%,96%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-dark{box-shadow:0 0 .5em hsla(0,0%,21%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-primary{box-shadow:0 0 .5em rgba(0,135,95,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-link{box-shadow:0 0 .5em hsla(229,53%,53%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-info{box-shadow:0 0 .5em hsla(207,61%,53%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-success{box-shadow:0 0 .5em hsla(153,53%,53%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-warning{box-shadow:0 0 .5em hsla(44,100%,77%,.8)}.b-radio.radio input[type=radio]:focus:checked+.check.is-danger{box-shadow:0 0 .5em hsla(348,86%,61%,.8)}.b-radio.radio input[type=radio][disabled]+.check{cursor:not-allowed}.b-radio.radio .control-label{padding-left:calc(.75em - 1px)}.b-radio.radio.button{display:flex}.b-radio.radio.button.is-selected{z-index:1}.b-radio.radio[disabled]{opacity:.5}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check{border-color:#00875f}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-white{border-color:#fff}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-black{border-color:hsl(0,0%,4%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-light{border-color:hsl(0,0%,96%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-dark{border-color:hsl(0,0%,21%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-primary{border-color:#00875f}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-link{border-color:hsl(229,53%,53%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-info{border-color:hsl(207,61%,53%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-success{border-color:hsl(153,53%,53%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-warning{border-color:hsl(44,100%,77%)}.b-radio.radio:hover input[type=radio]:not(:disabled)+.check.is-danger{border-color:hsl(348,86%,61%)}.b-radio.radio.is-small{border-radius:2px;font-size:.75rem}.b-radio.radio.is-medium{font-size:1.25rem}.b-radio.radio.is-large{font-size:1.5rem}.rate{align-items:center;display:flex}.rate:not(:last-child){margin-bottom:.75rem}.rate.is-spaced .rate-item:not(:last-child){margin-right:.25rem}.rate.is-disabled .rate-item{cursor:initial}.rate.is-disabled .rate-item:hover{transform:none}.rate.is-rtl .rate-item{order:1}.rate.is-rtl .rate-text{margin-left:0;margin-right:.35rem}.rate .rate-item{cursor:pointer;display:inline-flex;position:relative;transition:all .3s}.rate .rate-item:hover{transform:scale(1.1)}.rate .rate-item.set-on .icon,.rate .rate-item.set-half .is-half{color:hsl(44,100%,72%)}.rate .rate-item.set-half .is-half{position:absolute;left:0;top:0;overflow:hidden}.rate .icon{color:hsl(0,0%,86%);line-height:1;pointer-events:none;width:inherit}.rate .is-half>i{position:absolute;left:0}.rate .rate-text{font-size:calc(1rem/1.25);margin-left:.35rem}.rate .rate-text.is-small{font-size:calc(0.75rem/1.25)}.rate .rate-text.is-medium{font-size:calc(1.25rem/1.25)}.rate .rate-text.is-large{font-size:calc(1.5rem/1.25)}.select select{text-rendering:auto !important;padding-right:2.5em}.select select option{color:hsl(0,0%,29%);padding:calc(.5em - 1px) calc(.75em - 1px)}.select select option:disabled{cursor:not-allowed;opacity:.5}.select select optgroup{color:hsl(0,0%,71%);font-weight:400;font-style:normal;padding:.25em 0}.select select[disabled]{opacity:1}.select.is-empty select{color:hsla(0,0%,48%,.7)}.select.is-loading::after{top:calc(50% - .5em);right:.75em}.b-skeleton{display:inline-flex;flex-direction:column;vertical-align:middle;width:100%}.b-skeleton>.b-skeleton-item{background:linear-gradient(90deg, hsl(0, 0%, 86%) 25%, rgba(219.3, 219.3, 219.3, 0.5) 50%, hsl(0, 0%, 86%) 75%);background-size:400% 100%;width:100%}.b-skeleton>.b-skeleton-item.is-rounded{border-radius:4px}.b-skeleton>.b-skeleton-item::after{content:" "}.b-skeleton>.b-skeleton-item+.b-skeleton-item{margin-top:.5rem}.b-skeleton.is-animated>.b-skeleton-item{animation:skeleton-loading 1.5s infinite}.b-skeleton.is-centered{align-items:center}.b-skeleton.is-right{align-items:flex-end}.b-skeleton+.b-skeleton{margin-top:.5rem}.b-skeleton>.b-skeleton-item{line-height:1rem}.b-skeleton.is-small>.b-skeleton-item{line-height:.75rem}.b-skeleton.is-medium>.b-skeleton-item{line-height:1.25rem}.b-skeleton.is-large>.b-skeleton-item{line-height:1.5rem}@keyframes skeleton-loading{0%{background-position:100% 50%}100%{background-position:0 50%}}.b-sidebar .sidebar-content{background-color:hsl(0,0%,96%);box-shadow:5px 0px 13px 3px hsla(0,0%,4%,.1);width:260px;z-index:39}.b-sidebar .sidebar-content.is-white{background-color:#fff}.b-sidebar .sidebar-content.is-black{background-color:hsl(0,0%,4%)}.b-sidebar .sidebar-content.is-light{background-color:hsl(0,0%,96%)}.b-sidebar .sidebar-content.is-dark{background-color:hsl(0,0%,21%)}.b-sidebar .sidebar-content.is-primary{background-color:#00875f}.b-sidebar .sidebar-content.is-link{background-color:hsl(229,53%,53%)}.b-sidebar .sidebar-content.is-info{background-color:hsl(207,61%,53%)}.b-sidebar .sidebar-content.is-success{background-color:hsl(153,53%,53%)}.b-sidebar .sidebar-content.is-warning{background-color:hsl(44,100%,77%)}.b-sidebar .sidebar-content.is-danger{background-color:hsl(348,86%,61%)}.b-sidebar .sidebar-content.is-fixed{position:fixed;left:0;top:0}.b-sidebar .sidebar-content.is-fixed.is-right{left:auto;right:0}.b-sidebar .sidebar-content.is-absolute{position:absolute;left:0;top:0}.b-sidebar .sidebar-content.is-absolute.is-right{left:auto;right:0}.b-sidebar .sidebar-content.is-mini{width:80px}.b-sidebar .sidebar-content.is-mini.is-mini-expand:hover:not(.is-mini-delayed){transition:width 150ms ease-out}.b-sidebar .sidebar-content.is-mini.is-mini-expand:hover:not(.is-mini-delayed):not(.is-fullwidth){width:260px}.b-sidebar .sidebar-content.is-mini.is-mini-expand:hover:not(.is-mini-delayed):not(.is-fullwidth).is-mini-expand-fixed{position:fixed}.b-sidebar .sidebar-content.is-static{position:static}.b-sidebar .sidebar-content.is-absolute,.b-sidebar .sidebar-content.is-static{transition:width 150ms ease-out}.b-sidebar .sidebar-content.is-fullwidth{width:100%;max-width:100%}.b-sidebar .sidebar-content.is-fullheight{height:100%;max-height:100%;overflow:hidden;overflow-y:auto;display:flex;flex-direction:column;align-content:stretch}@media screen and (max-width: 768px){.b-sidebar .sidebar-content.is-mini-mobile{width:80px}.b-sidebar .sidebar-content.is-mini-mobile.is-mini-expand:hover:not(.is-fullwidth-mobile){width:260px}.b-sidebar .sidebar-content.is-mini-mobile.is-mini-expand:hover:not(.is-fullwidth-mobile).is-mini-expand-fixed{position:fixed}.b-sidebar .sidebar-content.is-hidden-mobile{width:0;height:0;overflow:hidden}.b-sidebar .sidebar-content.is-fullwidth-mobile{width:100%;max-width:100%}}.b-sidebar .sidebar-content .sidebar-close{background:rgba(10,10,10,.3)}.b-sidebar .sidebar-content .sidebar-close:hover{background:rgba(10,10,10,.86)}.b-sidebar .sidebar-background{bottom:0;left:0;position:absolute;right:0;top:0;background:hsla(0,0%,4%,.86);position:fixed;z-index:38}.b-slider{margin:1em 0;background:rgba(0,0,0,0);width:100%}.b-slider .b-slider-track{display:flex;align-items:center;position:relative;cursor:pointer;background:hsl(0,0%,86%);border-radius:4px}.b-slider .b-slider-fill{position:absolute;height:100%;box-shadow:0px 0px 0px hsl(0,0%,48%);background:hsl(0,0%,86%);border-radius:4px;border:0px solid hsl(0,0%,48%);top:50%;transform:translateY(-50%)}.b-slider .b-slider-thumb-wrapper{display:inline-flex;align-items:center;position:absolute;cursor:grab;transform:translate(-50%, -50%);top:50%;flex-direction:column}.b-slider .b-slider-thumb-wrapper .b-slider-thumb{box-shadow:none;border:1px solid hsl(0,0%,71%);border-radius:4px;background:#fff}.b-slider .b-slider-thumb-wrapper .b-slider-thumb:focus{transform:scale(1.25)}.b-slider .b-slider-thumb-wrapper.is-dragging{cursor:grabbing}.b-slider .b-slider-thumb-wrapper.is-dragging .b-slider-thumb{transform:scale(1.25)}.b-slider .b-slider-thumb-wrapper.has-indicator .b-slider-thumb{padding:16px 10px;display:flex;align-items:center;width:auto}.b-slider.slider-focus{padding-top:20px;padding-bottom:20px;margin-top:-20px;margin-bottom:-20px;cursor:pointer}.b-slider.is-rounded .b-slider-thumb{border-radius:9999px}.b-slider.is-disabled .b-slider-track{cursor:not-allowed;opacity:.5}.b-slider.is-disabled .b-slider-thumb-wrapper{cursor:not-allowed}.b-slider.is-disabled .b-slider-thumb-wrapper .b-slider-thumb{transform:scale(1)}.b-slider .b-slider-track{height:.5rem}.b-slider .b-slider-thumb{height:1rem;width:1rem}.b-slider .b-slider-tick{height:.25rem}.b-slider .b-slider-tick-label{font-size:.75rem;position:absolute;top:calc(0.5rem*.5 + 2px);left:50%;transform:translateX(-50%)}.b-slider.is-small .b-slider-track{height:.375rem}.b-slider.is-small .b-slider-thumb{height:.75rem;width:.75rem}.b-slider.is-small .b-slider-tick{height:.1875rem}.b-slider.is-small .b-slider-tick-label{font-size:.75rem;position:absolute;top:calc(0.375rem*.5 + 2px);left:50%;transform:translateX(-50%)}.b-slider.is-medium .b-slider-track{height:.625rem}.b-slider.is-medium .b-slider-thumb{height:1.25rem;width:1.25rem}.b-slider.is-medium .b-slider-tick{height:.3125rem}.b-slider.is-medium .b-slider-tick-label{font-size:.75rem;position:absolute;top:calc(0.625rem*.5 + 2px);left:50%;transform:translateX(-50%)}.b-slider.is-large .b-slider-track{height:.75rem}.b-slider.is-large .b-slider-thumb{height:1.5rem;width:1.5rem}.b-slider.is-large .b-slider-tick{height:.375rem}.b-slider.is-large .b-slider-tick-label{font-size:.75rem;position:absolute;top:calc(0.75rem*.5 + 2px);left:50%;transform:translateX(-50%)}.b-slider.is-white .b-slider-fill{background:#fff !important}.b-slider.is-black .b-slider-fill{background:hsl(0,0%,4%) !important}.b-slider.is-light .b-slider-fill{background:hsl(0,0%,96%) !important}.b-slider.is-dark .b-slider-fill{background:hsl(0,0%,21%) !important}.b-slider.is-primary .b-slider-fill{background:#00875f !important}.b-slider.is-link .b-slider-fill{background:hsl(229,53%,53%) !important}.b-slider.is-info .b-slider-fill{background:hsl(207,61%,53%) !important}.b-slider.is-success .b-slider-fill{background:hsl(153,53%,53%) !important}.b-slider.is-warning .b-slider-fill{background:hsl(44,100%,77%) !important}.b-slider.is-danger .b-slider-fill{background:hsl(348,86%,61%) !important}.b-slider .b-slider-tick{position:absolute;width:3px;transform:translate(-50%, -50%);top:50%;background:hsl(0,0%,71%);border-radius:4px}.b-slider .b-slider-tick.is-tick-hidden{background:rgba(0,0,0,0)}.b-steps .steps .step-items{display:flex;flex-wrap:wrap}.b-steps .steps .step-items .step-item{margin-top:0;position:relative;flex-grow:1;flex-basis:1em}.b-steps .steps .step-items .step-item .step-link{display:flex;align-items:center;justify-content:center;flex-direction:column;color:hsl(0,0%,29%)}.b-steps .steps .step-items .step-item .step-link:not(.is-clickable){cursor:not-allowed}.b-steps .steps .step-items .step-item .step-marker{align-items:center;display:flex;border-radius:4px;font-weight:700;justify-content:center;background:hsl(0,0%,71%);color:#fff;border:.2em solid #fff;z-index:1;overflow:hidden}.b-steps .steps .step-items .step-item.is-white::before,.b-steps .steps .step-items .step-item.is-white::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 100%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-white.is-active .step-marker{background-color:#fff;border-color:#fff;color:#fff}.b-steps .steps .step-items .step-item.is-white.is-active::before,.b-steps .steps .step-items .step-item.is-white.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-white.is-previous .step-marker{color:hsl(0,0%,4%);background-color:#fff}.b-steps .steps .step-items .step-item.is-white.is-previous::before,.b-steps .steps .step-items .step-item.is-white.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-black::before,.b-steps .steps .step-items .step-item.is-black::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 4%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-black.is-active .step-marker{background-color:#fff;border-color:hsl(0,0%,4%);color:hsl(0,0%,4%)}.b-steps .steps .step-items .step-item.is-black.is-active::before,.b-steps .steps .step-items .step-item.is-black.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-black.is-previous .step-marker{color:#fff;background-color:hsl(0,0%,4%)}.b-steps .steps .step-items .step-item.is-black.is-previous::before,.b-steps .steps .step-items .step-item.is-black.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-light::before,.b-steps .steps .step-items .step-item.is-light::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 96%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-light.is-active .step-marker{background-color:#fff;border-color:hsl(0,0%,96%);color:hsl(0,0%,96%)}.b-steps .steps .step-items .step-item.is-light.is-active::before,.b-steps .steps .step-items .step-item.is-light.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-light.is-previous .step-marker{color:rgba(0,0,0,.7);background-color:hsl(0,0%,96%)}.b-steps .steps .step-items .step-item.is-light.is-previous::before,.b-steps .steps .step-items .step-item.is-light.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-dark::before,.b-steps .steps .step-items .step-item.is-dark::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 21%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-dark.is-active .step-marker{background-color:#fff;border-color:hsl(0,0%,21%);color:hsl(0,0%,21%)}.b-steps .steps .step-items .step-item.is-dark.is-active::before,.b-steps .steps .step-items .step-item.is-dark.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-dark.is-previous .step-marker{color:#fff;background-color:hsl(0,0%,21%)}.b-steps .steps .step-items .step-item.is-dark.is-previous::before,.b-steps .steps .step-items .step-item.is-dark.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-primary::before,.b-steps .steps .step-items .step-item.is-primary::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, rgb(0, 135, 95) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-primary.is-active .step-marker{background-color:#fff;border-color:#00875f;color:#00875f}.b-steps .steps .step-items .step-item.is-primary.is-active::before,.b-steps .steps .step-items .step-item.is-primary.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-primary.is-previous .step-marker{color:#fff;background-color:#00875f}.b-steps .steps .step-items .step-item.is-primary.is-previous::before,.b-steps .steps .step-items .step-item.is-primary.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-link::before,.b-steps .steps .step-items .step-item.is-link::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(229, 53%, 53%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-link.is-active .step-marker{background-color:#fff;border-color:hsl(229,53%,53%);color:hsl(229,53%,53%)}.b-steps .steps .step-items .step-item.is-link.is-active::before,.b-steps .steps .step-items .step-item.is-link.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-link.is-previous .step-marker{color:#fff;background-color:hsl(229,53%,53%)}.b-steps .steps .step-items .step-item.is-link.is-previous::before,.b-steps .steps .step-items .step-item.is-link.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-info::before,.b-steps .steps .step-items .step-item.is-info::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(207, 61%, 53%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-info.is-active .step-marker{background-color:#fff;border-color:hsl(207,61%,53%);color:hsl(207,61%,53%)}.b-steps .steps .step-items .step-item.is-info.is-active::before,.b-steps .steps .step-items .step-item.is-info.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-info.is-previous .step-marker{color:#fff;background-color:hsl(207,61%,53%)}.b-steps .steps .step-items .step-item.is-info.is-previous::before,.b-steps .steps .step-items .step-item.is-info.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-success::before,.b-steps .steps .step-items .step-item.is-success::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(153, 53%, 53%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-success.is-active .step-marker{background-color:#fff;border-color:hsl(153,53%,53%);color:hsl(153,53%,53%)}.b-steps .steps .step-items .step-item.is-success.is-active::before,.b-steps .steps .step-items .step-item.is-success.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-success.is-previous .step-marker{color:#fff;background-color:hsl(153,53%,53%)}.b-steps .steps .step-items .step-item.is-success.is-previous::before,.b-steps .steps .step-items .step-item.is-success.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-warning::before,.b-steps .steps .step-items .step-item.is-warning::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(44, 100%, 77%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-warning.is-active .step-marker{background-color:#fff;border-color:hsl(44,100%,77%);color:hsl(44,100%,77%)}.b-steps .steps .step-items .step-item.is-warning.is-active::before,.b-steps .steps .step-items .step-item.is-warning.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-warning.is-previous .step-marker{color:rgba(0,0,0,.7);background-color:hsl(44,100%,77%)}.b-steps .steps .step-items .step-item.is-warning.is-previous::before,.b-steps .steps .step-items .step-item.is-warning.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-danger::before,.b-steps .steps .step-items .step-item.is-danger::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, hsl(348, 86%, 61%) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-danger.is-active .step-marker{background-color:#fff;border-color:hsl(348,86%,61%);color:hsl(348,86%,61%)}.b-steps .steps .step-items .step-item.is-danger.is-active::before,.b-steps .steps .step-items .step-item.is-danger.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-danger.is-previous .step-marker{color:#fff;background-color:hsl(348,86%,61%)}.b-steps .steps .step-items .step-item.is-danger.is-previous::before,.b-steps .steps .step-items .step-item.is-danger.is-previous::after{background-position:left bottom}.b-steps .steps .step-items .step-item .step-marker{color:#fff}.b-steps .steps .step-items .step-item .step-details{text-align:center;z-index:1}.b-steps .steps .step-items .step-item:not(:first-child),.b-steps .steps .step-items .step-item:only-child{flex-shrink:1}.b-steps .steps .step-items .step-item:not(:first-child)::before,.b-steps .steps .step-items .step-item:only-child::before{content:" ";display:block;position:absolute;width:100%;bottom:0;left:-50%}.b-steps .steps .step-items .step-item:only-child::after{content:" ";display:block;position:absolute;height:.2em;bottom:0}.b-steps .steps .step-items .step-item:only-child::before,.b-steps .steps .step-items .step-item:only-child::after{width:25%;left:50%}.b-steps .steps .step-items .step-item:only-child::before{right:50%;left:auto}.b-steps .steps .step-items .step-item::before,.b-steps .steps .step-items .step-item::after{background:linear-gradient(to left, hsl(0, 0%, 86%) 50%, rgb(0, 135, 95) 50%);background-size:200% 100%;background-position:right bottom}.b-steps .steps .step-items .step-item.is-active .step-link{cursor:default}.b-steps .steps .step-items .step-item.is-active .step-marker{background-color:#fff;border-color:#00875f;color:#00875f}.b-steps .steps .step-items .step-item.is-active::before,.b-steps .steps .step-items .step-item.is-active::after{background-position:left bottom}.b-steps .steps .step-items .step-item.is-previous .step-marker{color:#fff;background-color:#00875f}.b-steps .steps .step-items .step-item.is-previous::before,.b-steps .steps .step-items .step-item.is-previous::after{background-position:left bottom}.b-steps .steps+.step-content{position:relative;overflow:visible;display:flex;flex-direction:column;padding:1rem}.b-steps .steps+.step-content .step-item{flex-shrink:0;flex-basis:auto}.b-steps .steps+.step-content .step-item:focus{outline:none}.b-steps .steps+.step-content.is-transitioning{overflow:hidden}.b-steps .steps.is-rounded .step-item .step-marker{border-radius:9999px}.b-steps .steps.is-animated .step-item:not(:first-child)::before,.b-steps .steps.is-animated .step-item:only-child::before{transition:background 150ms ease-out}.b-steps .steps.has-label-right .step-items .step-item .step-link,.b-steps .steps.has-label-left .step-items .step-item .step-link{flex-direction:row}.b-steps .steps.has-label-right .step-items .step-item .step-link>.step-details,.b-steps .steps.has-label-left .step-items .step-item .step-link>.step-details{background-color:#fff;padding:.2em}.b-steps .steps.has-label-left .step-items .step-item .step-link{flex-direction:row-reverse}.b-steps .steps{font-size:1rem;min-height:2rem}.b-steps .steps .step-items .step-item .step-marker{height:2rem;width:2rem}.b-steps .steps .step-items .step-item .step-marker .icon *,.b-steps .steps .step-items .step-item .step-marker .icon *:before{font-size:1rem}.b-steps .steps .step-items .step-item .step-details .step-title{font-size:1.2rem;font-weight:600;line-height:1rem}.b-steps .steps .step-items .step-item:not(:first-child)::before,.b-steps .steps .step-items .step-item:only-child::before{height:.2em;top:1rem}.b-steps .steps .step-items .step-item:only-child::after{top:1rem}@media screen and (max-width: 768px){.b-steps .steps .step-items .step-item::before,.b-steps .steps .step-items .step-item::after,.b-steps .steps .step-items .step-item:not(:first-child)::before{top:1rem}}.b-steps.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-vertical>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-vertical>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(1rem - 0.1em)}.b-steps.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-vertical>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-vertical>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(1rem - 0.1em)}.b-steps.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(1rem - 0.1em)}.b-steps.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(1rem - 0.1em)}.b-steps.is-small .steps{font-size:.75rem;min-height:1.5rem}.b-steps.is-small .steps .step-items .step-item .step-marker{height:1.5rem;width:1.5rem}.b-steps.is-small .steps .step-items .step-item .step-marker .icon *,.b-steps.is-small .steps .step-items .step-item .step-marker .icon *:before{font-size:.75rem}.b-steps.is-small .steps .step-items .step-item .step-details .step-title{font-size:.9rem;font-weight:600;line-height:.75rem}.b-steps.is-small .steps .step-items .step-item:not(:first-child)::before,.b-steps.is-small .steps .step-items .step-item:only-child::before{height:.2em;top:0.75rem}.b-steps.is-small .steps .step-items .step-item:only-child::after{top:0.75rem}@media screen and (max-width: 768px){.b-steps.is-small .steps .step-items .step-item::before,.b-steps.is-small .steps .step-items .step-item::after,.b-steps.is-small .steps .step-items .step-item:not(:first-child)::before{top:0.75rem}}.b-steps.is-small.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-small.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-small.is-vertical>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-small.is-vertical>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(0.75rem - 0.1em)}.b-steps.is-small.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-small.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-small.is-vertical>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-small.is-vertical>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(0.75rem - 0.1em)}.b-steps.is-small.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-small.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-small.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-small.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(0.75rem - 0.1em)}.b-steps.is-small.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-small.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-small.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-small.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(0.75rem - 0.1em)}.b-steps.is-medium .steps{font-size:1.25rem;min-height:2.5rem}.b-steps.is-medium .steps .step-items .step-item .step-marker{height:2.5rem;width:2.5rem}.b-steps.is-medium .steps .step-items .step-item .step-marker .icon *,.b-steps.is-medium .steps .step-items .step-item .step-marker .icon *:before{font-size:1.25rem}.b-steps.is-medium .steps .step-items .step-item .step-details .step-title{font-size:1.5rem;font-weight:600;line-height:1.25rem}.b-steps.is-medium .steps .step-items .step-item:not(:first-child)::before,.b-steps.is-medium .steps .step-items .step-item:only-child::before{height:.2em;top:1.25rem}.b-steps.is-medium .steps .step-items .step-item:only-child::after{top:1.25rem}@media screen and (max-width: 768px){.b-steps.is-medium .steps .step-items .step-item::before,.b-steps.is-medium .steps .step-items .step-item::after,.b-steps.is-medium .steps .step-items .step-item:not(:first-child)::before{top:1.25rem}}.b-steps.is-medium.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-medium.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-medium.is-vertical>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-medium.is-vertical>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(1.25rem - 0.1em)}.b-steps.is-medium.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-medium.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-medium.is-vertical>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-medium.is-vertical>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(1.25rem - 0.1em)}.b-steps.is-medium.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-medium.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-medium.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-medium.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(1.25rem - 0.1em)}.b-steps.is-medium.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-medium.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-medium.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-medium.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(1.25rem - 0.1em)}.b-steps.is-large .steps{font-size:1.5rem;min-height:3rem}.b-steps.is-large .steps .step-items .step-item .step-marker{height:3rem;width:3rem}.b-steps.is-large .steps .step-items .step-item .step-marker .icon *,.b-steps.is-large .steps .step-items .step-item .step-marker .icon *:before{font-size:1.5rem}.b-steps.is-large .steps .step-items .step-item .step-details .step-title{font-size:1.8rem;font-weight:600;line-height:1.5rem}.b-steps.is-large .steps .step-items .step-item:not(:first-child)::before,.b-steps.is-large .steps .step-items .step-item:only-child::before{height:.2em;top:1.5rem}.b-steps.is-large .steps .step-items .step-item:only-child::after{top:1.5rem}@media screen and (max-width: 768px){.b-steps.is-large .steps .step-items .step-item::before,.b-steps.is-large .steps .step-items .step-item::after,.b-steps.is-large .steps .step-items .step-item:not(:first-child)::before{top:1.5rem}}.b-steps.is-large.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-large.is-vertical>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-large.is-vertical>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-large.is-vertical>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(1.5rem - 0.1em)}.b-steps.is-large.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-large.is-vertical>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-large.is-vertical>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-large.is-vertical>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(1.5rem - 0.1em)}.b-steps.is-large.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::before,.b-steps.is-large.is-vertical.is-right>.steps.has-label-right .step-items .step-item:not(:first-child)::after,.b-steps.is-large.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::before,.b-steps.is-large.is-vertical.is-right>.steps.has-label-right .step-items .step-item:only-child::after{left:calc(1.5rem - 0.1em)}.b-steps.is-large.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::before,.b-steps.is-large.is-vertical.is-right>.steps.has-label-left .step-items .step-item:not(:first-child)::after,.b-steps.is-large.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::before,.b-steps.is-large.is-vertical.is-right>.steps.has-label-left .step-items .step-item:only-child::after{left:auto;right:calc(1.5rem - 0.1em)}.b-steps.is-vertical{display:flex;flex-direction:row;flex-wrap:wrap}.b-steps.is-vertical>.steps .step-items{height:100%;flex-direction:column;border-bottom-color:rgba(0,0,0,0)}.b-steps.is-vertical>.steps .step-items .step-item{width:100%;display:flex;align-items:center;justify-content:center;padding:1em 0}.b-steps.is-vertical>.steps .step-items .step-item::before,.b-steps.is-vertical>.steps .step-items .step-item::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, rgb(0, 135, 95) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-white::before,.b-steps.is-vertical>.steps .step-items .step-item.is-white::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 100%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-black::before,.b-steps.is-vertical>.steps .step-items .step-item.is-black::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 4%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-light::before,.b-steps.is-vertical>.steps .step-items .step-item.is-light::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 96%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-dark::before,.b-steps.is-vertical>.steps .step-items .step-item.is-dark::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(0, 0%, 21%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-primary::before,.b-steps.is-vertical>.steps .step-items .step-item.is-primary::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, rgb(0, 135, 95) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-link::before,.b-steps.is-vertical>.steps .step-items .step-item.is-link::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(229, 53%, 53%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-info::before,.b-steps.is-vertical>.steps .step-items .step-item.is-info::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(207, 61%, 53%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-success::before,.b-steps.is-vertical>.steps .step-items .step-item.is-success::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(153, 53%, 53%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-warning::before,.b-steps.is-vertical>.steps .step-items .step-item.is-warning::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(44, 100%, 77%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item.is-danger::before,.b-steps.is-vertical>.steps .step-items .step-item.is-danger::after{background:linear-gradient(to top, hsl(0, 0%, 86%) 50%, hsl(348, 86%, 61%) 50%);background-size:100% 200%;background-position:left bottom}.b-steps.is-vertical>.steps .step-items .step-item:not(:first-child)::before,.b-steps.is-vertical>.steps .step-items .step-item:only-child::before{height:100%;width:.2em;top:-50%;left:calc(50% - 0.1em)}.b-steps.is-vertical>.steps .step-items .step-item.is-active::before,.b-steps.is-vertical>.steps .step-items .step-item.is-active::after,.b-steps.is-vertical>.steps .step-items .step-item.is-previous::before,.b-steps.is-vertical>.steps .step-items .step-item.is-previous::after{background-position:right top}.b-steps.is-vertical>.steps .step-items .step-item:only-child::before{top:50%}.b-steps.is-vertical>.steps .step-items .step-item:only-child::after{width:.2em;top:auto;bottom:50%}.b-steps.is-vertical>.steps .step-items .step-item:only-child::before,.b-steps.is-vertical>.steps .step-items .step-item:only-child::after{height:25%}.b-steps.is-vertical>.steps.has-label-right .step-items .step-item{justify-content:flex-start}.b-steps.is-vertical>.steps.has-label-left .step-items .step-item{justify-content:flex-end}.b-steps.is-vertical>.steps:not(.has-label-right):not(.has-label-left) .step-items .step-item .step-link>.step-details{background-color:#fff}.b-steps.is-vertical>.step-content{flex-grow:1}.b-steps.is-vertical>.step-navigation{flex-basis:100%}.b-steps.is-vertical.is-right{flex-direction:row-reverse}@media screen and (max-width: 768px){.b-steps:not(.is-vertical) .steps.mobile-minimalist .step-items .step-item:not(.is-active){display:none}.b-steps:not(.is-vertical) .steps.mobile-minimalist .step-items .step-item::before,.b-steps:not(.is-vertical) .steps.mobile-minimalist .step-items .step-item::after,.b-steps:not(.is-vertical) .steps.mobile-minimalist .step-items .step-item:not(:first-child)::before{content:" ";display:block;position:absolute;height:.2em;width:25%;bottom:0;left:50%}.b-steps:not(.is-vertical) .steps.mobile-minimalist .step-items .step-item::before,.b-steps:not(.is-vertical) .steps.mobile-minimalist .step-items .step-item:not(:first-child)::before{right:50%;left:auto}.b-steps:not(.is-vertical) .steps.mobile-compact .step-items .step-item:not(.is-active) .step-details{display:none}}.switch{cursor:pointer;display:inline-flex;align-items:center;position:relative;margin-right:.5em}.switch+.switch:last-child{margin-right:0}.switch input[type=checkbox]{position:absolute;left:0;opacity:0;outline:none;z-index:-1}.switch input[type=checkbox]+.check{display:flex;align-items:center;flex-shrink:0;width:2.75em;height:1.575em;padding:.2em;background:hsl(0,0%,71%);border-radius:4px;transition:background 150ms ease-out,box-shadow 150ms ease-out}.switch input[type=checkbox]+.check.is-white-passive,.switch input[type=checkbox]+.check:hover{background:#fff}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-black-passive,.switch input[type=checkbox]+.check:hover{background:hsl(0,0%,4%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-light-passive,.switch input[type=checkbox]+.check:hover{background:hsl(0,0%,96%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-dark-passive,.switch input[type=checkbox]+.check:hover{background:hsl(0,0%,21%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-primary-passive,.switch input[type=checkbox]+.check:hover{background:#00875f}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-link-passive,.switch input[type=checkbox]+.check:hover{background:hsl(229,53%,53%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-info-passive,.switch input[type=checkbox]+.check:hover{background:hsl(207,61%,53%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-success-passive,.switch input[type=checkbox]+.check:hover{background:hsl(153,53%,53%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-warning-passive,.switch input[type=checkbox]+.check:hover{background:hsl(44,100%,77%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check.is-danger-passive,.switch input[type=checkbox]+.check:hover{background:hsl(348,86%,61%)}.switch input[type=checkbox]+.check.input[type=checkbox]+.switch input[type=checkbox]+.check.check{background:"pink"}.switch input[type=checkbox]+.check:before{content:"";display:block;border-radius:4px;width:1.175em;height:1.175em;background:hsl(0,0%,96%);box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:transform 150ms ease-out;will-change:transform;transform-origin:left}.switch input[type=checkbox]+.check.is-elastic:before{transform:scaleX(1.5);border-radius:4px}.switch input[type=checkbox]:checked+.check{background:#00875f}.switch input[type=checkbox]:checked+.check.is-white{background:#fff}.switch input[type=checkbox]:checked+.check.is-black{background:hsl(0,0%,4%)}.switch input[type=checkbox]:checked+.check.is-light{background:hsl(0,0%,96%)}.switch input[type=checkbox]:checked+.check.is-dark{background:hsl(0,0%,21%)}.switch input[type=checkbox]:checked+.check.is-primary{background:#00875f}.switch input[type=checkbox]:checked+.check.is-link{background:hsl(229,53%,53%)}.switch input[type=checkbox]:checked+.check.is-info{background:hsl(207,61%,53%)}.switch input[type=checkbox]:checked+.check.is-success{background:hsl(153,53%,53%)}.switch input[type=checkbox]:checked+.check.is-warning{background:hsl(44,100%,77%)}.switch input[type=checkbox]:checked+.check.is-danger{background:hsl(348,86%,61%)}.switch input[type=checkbox]:checked+.check:before{transform:translate3d(100%, 0, 0)}.switch input[type=checkbox]:checked+.check.is-elastic:before{transform:translate3d(50%, 0, 0) scaleX(1.5)}.switch input[type=checkbox]:focus,.switch input[type=checkbox]:active{outline:none}.switch input[type=checkbox]:focus+.check,.switch input[type=checkbox]:active+.check{box-shadow:0 0 .5em hsla(0,0%,48%,.6)}.switch input[type=checkbox]:focus+.check.is-white-passive,.switch input[type=checkbox]:active+.check.is-white-passive{box-shadow:0 0 .5em hsla(0,0%,100%,.8)}.switch input[type=checkbox]:focus+.check.is-black-passive,.switch input[type=checkbox]:active+.check.is-black-passive{box-shadow:0 0 .5em hsla(0,0%,4%,.8)}.switch input[type=checkbox]:focus+.check.is-light-passive,.switch input[type=checkbox]:active+.check.is-light-passive{box-shadow:0 0 .5em hsla(0,0%,96%,.8)}.switch input[type=checkbox]:focus+.check.is-dark-passive,.switch input[type=checkbox]:active+.check.is-dark-passive{box-shadow:0 0 .5em hsla(0,0%,21%,.8)}.switch input[type=checkbox]:focus+.check.is-primary-passive,.switch input[type=checkbox]:active+.check.is-primary-passive{box-shadow:0 0 .5em rgba(0,135,95,.8)}.switch input[type=checkbox]:focus+.check.is-link-passive,.switch input[type=checkbox]:active+.check.is-link-passive{box-shadow:0 0 .5em hsla(229,53%,53%,.8)}.switch input[type=checkbox]:focus+.check.is-info-passive,.switch input[type=checkbox]:active+.check.is-info-passive{box-shadow:0 0 .5em hsla(207,61%,53%,.8)}.switch input[type=checkbox]:focus+.check.is-success-passive,.switch input[type=checkbox]:active+.check.is-success-passive{box-shadow:0 0 .5em hsla(153,53%,53%,.8)}.switch input[type=checkbox]:focus+.check.is-warning-passive,.switch input[type=checkbox]:active+.check.is-warning-passive{box-shadow:0 0 .5em hsla(44,100%,77%,.8)}.switch input[type=checkbox]:focus+.check.is-danger-passive,.switch input[type=checkbox]:active+.check.is-danger-passive{box-shadow:0 0 .5em hsla(348,86%,61%,.8)}.switch input[type=checkbox]:focus:checked+.check,.switch input[type=checkbox]:active:checked+.check{box-shadow:0 0 .5em rgba(0,135,95,.8)}.switch input[type=checkbox]:focus:checked+.check.is-white,.switch input[type=checkbox]:active:checked+.check.is-white{box-shadow:0 0 .5em hsla(0,0%,100%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-black,.switch input[type=checkbox]:active:checked+.check.is-black{box-shadow:0 0 .5em hsla(0,0%,4%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-light,.switch input[type=checkbox]:active:checked+.check.is-light{box-shadow:0 0 .5em hsla(0,0%,96%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-dark,.switch input[type=checkbox]:active:checked+.check.is-dark{box-shadow:0 0 .5em hsla(0,0%,21%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-primary,.switch input[type=checkbox]:active:checked+.check.is-primary{box-shadow:0 0 .5em rgba(0,135,95,.8)}.switch input[type=checkbox]:focus:checked+.check.is-link,.switch input[type=checkbox]:active:checked+.check.is-link{box-shadow:0 0 .5em hsla(229,53%,53%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-info,.switch input[type=checkbox]:active:checked+.check.is-info{box-shadow:0 0 .5em hsla(207,61%,53%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-success,.switch input[type=checkbox]:active:checked+.check.is-success{box-shadow:0 0 .5em hsla(153,53%,53%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-warning,.switch input[type=checkbox]:active:checked+.check.is-warning{box-shadow:0 0 .5em hsla(44,100%,77%,.8)}.switch input[type=checkbox]:focus:checked+.check.is-danger,.switch input[type=checkbox]:active:checked+.check.is-danger{box-shadow:0 0 .5em hsla(348,86%,61%,.8)}.switch.has-left-label{flex-direction:row-reverse}.switch.has-left-label .control-label{padding-right:calc(.75em - 1px)}.switch:not(.has-left-label) .control-label{padding-left:calc(.75em - 1px)}.switch:hover input[type=checkbox]+.check{background:hsla(0,0%,71%,.9)}.switch:hover input[type=checkbox]+.check.is-white-passive{background:hsla(0,0%,100%,.9)}.switch:hover input[type=checkbox]+.check.is-black-passive{background:hsla(0,0%,4%,.9)}.switch:hover input[type=checkbox]+.check.is-light-passive{background:hsla(0,0%,96%,.9)}.switch:hover input[type=checkbox]+.check.is-dark-passive{background:hsla(0,0%,21%,.9)}.switch:hover input[type=checkbox]+.check.is-primary-passive{background:rgba(0,135,95,.9)}.switch:hover input[type=checkbox]+.check.is-link-passive{background:hsla(229,53%,53%,.9)}.switch:hover input[type=checkbox]+.check.is-info-passive{background:hsla(207,61%,53%,.9)}.switch:hover input[type=checkbox]+.check.is-success-passive{background:hsla(153,53%,53%,.9)}.switch:hover input[type=checkbox]+.check.is-warning-passive{background:hsla(44,100%,77%,.9)}.switch:hover input[type=checkbox]+.check.is-danger-passive{background:hsla(348,86%,61%,.9)}.switch:hover input[type=checkbox]:checked+.check{background:rgba(0,135,95,.9)}.switch:hover input[type=checkbox]:checked+.check.is-white{background:hsla(0,0%,100%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-black{background:hsla(0,0%,4%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-light{background:hsla(0,0%,96%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-dark{background:hsla(0,0%,21%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-primary{background:rgba(0,135,95,.9)}.switch:hover input[type=checkbox]:checked+.check.is-link{background:hsla(229,53%,53%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-info{background:hsla(207,61%,53%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-success{background:hsla(153,53%,53%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-warning{background:hsla(44,100%,77%,.9)}.switch:hover input[type=checkbox]:checked+.check.is-danger{background:hsla(348,86%,61%,.9)}.switch.is-rounded input[type=checkbox]+.check{border-radius:9999px}.switch.is-rounded input[type=checkbox]+.check:before{border-radius:9999px}.switch.is-rounded input[type=checkbox].is-elastic:before{transform:scaleX(1.5);border-radius:9999px}.switch.is-outlined input[type=checkbox]+.check{background:rgba(0,0,0,0);border:.1rem solid hsl(0,0%,71%)}.switch.is-outlined input[type=checkbox]+.check.is-white-passive{border:.1rem solid hsla(0,0%,100%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-white-passive:before{background:#fff}.switch.is-outlined input[type=checkbox]+.check.is-white-passive:hover{border-color:hsla(0,0%,100%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-black-passive{border:.1rem solid hsla(0,0%,4%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-black-passive:before{background:hsl(0,0%,4%)}.switch.is-outlined input[type=checkbox]+.check.is-black-passive:hover{border-color:hsla(0,0%,4%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-light-passive{border:.1rem solid hsla(0,0%,96%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-light-passive:before{background:hsl(0,0%,96%)}.switch.is-outlined input[type=checkbox]+.check.is-light-passive:hover{border-color:hsla(0,0%,96%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-dark-passive{border:.1rem solid hsla(0,0%,21%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-dark-passive:before{background:hsl(0,0%,21%)}.switch.is-outlined input[type=checkbox]+.check.is-dark-passive:hover{border-color:hsla(0,0%,21%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-primary-passive{border:.1rem solid rgba(0,135,95,.9)}.switch.is-outlined input[type=checkbox]+.check.is-primary-passive:before{background:#00875f}.switch.is-outlined input[type=checkbox]+.check.is-primary-passive:hover{border-color:rgba(0,135,95,.9)}.switch.is-outlined input[type=checkbox]+.check.is-link-passive{border:.1rem solid hsla(229,53%,53%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-link-passive:before{background:hsl(229,53%,53%)}.switch.is-outlined input[type=checkbox]+.check.is-link-passive:hover{border-color:hsla(229,53%,53%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-info-passive{border:.1rem solid hsla(207,61%,53%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-info-passive:before{background:hsl(207,61%,53%)}.switch.is-outlined input[type=checkbox]+.check.is-info-passive:hover{border-color:hsla(207,61%,53%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-success-passive{border:.1rem solid hsla(153,53%,53%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-success-passive:before{background:hsl(153,53%,53%)}.switch.is-outlined input[type=checkbox]+.check.is-success-passive:hover{border-color:hsla(153,53%,53%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-warning-passive{border:.1rem solid hsla(44,100%,77%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-warning-passive:before{background:hsl(44,100%,77%)}.switch.is-outlined input[type=checkbox]+.check.is-warning-passive:hover{border-color:hsla(44,100%,77%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-danger-passive{border:.1rem solid hsla(348,86%,61%,.9)}.switch.is-outlined input[type=checkbox]+.check.is-danger-passive:before{background:hsl(348,86%,61%)}.switch.is-outlined input[type=checkbox]+.check.is-danger-passive:hover{border-color:hsla(348,86%,61%,.9)}.switch.is-outlined input[type=checkbox]+.check:before{background:hsl(0,0%,71%)}.switch.is-outlined input[type=checkbox]:checked+.check{border-color:#00875f}.switch.is-outlined input[type=checkbox]:checked+.check.is-white{background:rgba(0,0,0,0);border-color:#fff}.switch.is-outlined input[type=checkbox]:checked+.check.is-white:before{background:#fff}.switch.is-outlined input[type=checkbox]:checked+.check.is-black{background:rgba(0,0,0,0);border-color:hsl(0,0%,4%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-black:before{background:hsl(0,0%,4%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-light{background:rgba(0,0,0,0);border-color:hsl(0,0%,96%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-light:before{background:hsl(0,0%,96%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-dark{background:rgba(0,0,0,0);border-color:hsl(0,0%,21%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-dark:before{background:hsl(0,0%,21%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-primary{background:rgba(0,0,0,0);border-color:#00875f}.switch.is-outlined input[type=checkbox]:checked+.check.is-primary:before{background:#00875f}.switch.is-outlined input[type=checkbox]:checked+.check.is-link{background:rgba(0,0,0,0);border-color:hsl(229,53%,53%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-link:before{background:hsl(229,53%,53%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-info{background:rgba(0,0,0,0);border-color:hsl(207,61%,53%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-info:before{background:hsl(207,61%,53%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-success{background:rgba(0,0,0,0);border-color:hsl(153,53%,53%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-success:before{background:hsl(153,53%,53%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-warning{background:rgba(0,0,0,0);border-color:hsl(44,100%,77%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-warning:before{background:hsl(44,100%,77%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-danger{background:rgba(0,0,0,0);border-color:hsl(348,86%,61%)}.switch.is-outlined input[type=checkbox]:checked+.check.is-danger:before{background:hsl(348,86%,61%)}.switch.is-outlined input[type=checkbox]:checked+.check:before{background:#00875f}.switch.is-outlined:hover input[type=checkbox]+.check{background:rgba(0,0,0,0);border-color:hsla(0,0%,71%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check{background:rgba(0,0,0,0);border-color:rgba(0,135,95,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-white{border-color:hsla(0,0%,100%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-black{border-color:hsla(0,0%,4%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-light{border-color:hsla(0,0%,96%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-dark{border-color:hsla(0,0%,21%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-primary{border-color:rgba(0,135,95,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-link{border-color:hsla(229,53%,53%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-info{border-color:hsla(207,61%,53%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-success{border-color:hsla(153,53%,53%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-warning{border-color:hsla(44,100%,77%,.9)}.switch.is-outlined:hover input[type=checkbox]:checked+.check.is-danger{border-color:hsla(348,86%,61%,.9)}.switch.is-small{border-radius:2px;font-size:.75rem}.switch.is-medium{font-size:1.25rem}.switch.is-large{font-size:1.5rem}.switch[disabled]{opacity:.5;cursor:not-allowed;color:hsl(0,0%,48%)}.table-wrapper .table{margin-bottom:0}.table-wrapper:not(:last-child){margin-bottom:1.5rem}@media screen and (max-width: 1023px){.table-wrapper{overflow-x:auto}}.b-table{transition:opacity 86ms ease-out}@media screen and (min-width: 769px),print{.b-table .table-mobile-sort{display:none}}.b-table .icon{transition:transform 150ms ease-out,opacity 86ms ease-out}.b-table .icon.is-desc{transform:rotate(180deg)}.b-table .icon.is-expanded{transform:rotate(90deg)}.b-table .sort-icon.icon.is-desc{transform:rotate(180deg) translateY(-50%) !important}.b-table .table{width:100%;border:1px solid rgba(0,0,0,0);border-radius:4px;border-collapse:separate}.b-table .table th{font-weight:600}.b-table .table th .th-wrap{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.b-table .table th .th-wrap .icon{margin-left:.5rem;margin-right:0;font-size:1rem}.b-table .table th .th-wrap.is-numeric{flex-direction:row-reverse;text-align:right;width:95%}.b-table .table th .th-wrap.is-numeric .sort-icon{margin-left:0;margin-right:.5rem;left:0;right:auto}.b-table .table th .th-wrap.is-centered{justify-content:center;text-align:center}.b-table .table th.is-current-sort{border-color:hsl(0,0%,48%);font-weight:700}.b-table .table th.is-sortable:hover{border-color:hsl(0,0%,48%)}.b-table .table th.is-sortable,.b-table .table th.is-sortable .th-wrap{cursor:pointer}.b-table .table th.is-sortable .is-relative,.b-table .table th.is-sortable .th-wrap .is-relative{position:absolute}.b-table .table th .sort-icon{position:absolute;bottom:50%;right:0;transform:translateY(50%)}.b-table .table th .multi-sort-icons{display:flex;align-items:center}.b-table .table th .multi-sort-icons .multi-sort-cancel-icon{margin-left:10px}.b-table .table th.is-sticky{position:-webkit-sticky;position:sticky;left:0;z-index:3 !important;background:rgba(0,0,0,0)}.b-table .table tr.is-selected .checkbox input:checked+.check{background:#fff url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 1 1%27%3E%3Cpath style=%27fill:rgb%280, 135, 95%29%27 d=%27M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z%27%3E%3C/path%3E%3C/svg%3E") no-repeat center center}.b-table .table tr.is-selected .checkbox input+.check{border-color:#fff}.b-table .table tr.is-empty:hover{background-color:rgba(0,0,0,0)}.b-table .table .chevron-cell{vertical-align:middle}.b-table .table .chevron-cell>a{color:#00875f !important}.b-table .table .checkbox-cell{width:40px}.b-table .table .checkbox-cell .checkbox{vertical-align:middle}.b-table .table .checkbox-cell .checkbox .check{transition:none}.b-table .table tr.detail{box-shadow:inset 0 1px 3px hsl(0,0%,86%);background:hsl(0,0%,98%)}.b-table .table tr.detail .detail-container{padding:1rem}.b-table .table:focus{border-color:#00875f;box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.b-table .table.is-bordered th.is-current-sort,.b-table .table.is-bordered th.is-sortable:hover{border-color:hsl(0,0%,86%);background:hsl(0,0%,96%)}.b-table .table td.is-sticky{position:-webkit-sticky;position:sticky;left:0;z-index:1;background:#fff}.b-table .table.is-striped tbody tr:not(.is-selected):nth-child(even) td.is-sticky{background:hsl(0,0%,98%)}.b-table .level:not(.top){padding-bottom:1.5rem}.b-table .table-wrapper{position:relative}.b-table .table-wrapper.has-sticky-header{height:300px;overflow-y:auto}@media screen and (max-width: 768px){.b-table .table-wrapper.has-sticky-header.has-mobile-cards{height:initial !important;overflow-y:initial !important}}.b-table .table-wrapper.has-sticky-header tr:first-child th{position:-webkit-sticky;position:sticky;top:0;z-index:2;background:#fff}@media screen and (max-width: 768px){.b-table .table-wrapper.has-mobile-cards .table{background-color:rgba(0,0,0,0)}.b-table .table-wrapper.has-mobile-cards thead tr{box-shadow:none;border-width:0}.b-table .table-wrapper.has-mobile-cards thead tr th{display:none}.b-table .table-wrapper.has-mobile-cards thead tr .checkbox-cell{display:block;width:100%;text-align:right;margin-bottom:1rem;border:0}.b-table .table-wrapper.has-mobile-cards tfoot th{border:0;display:inherit}.b-table .table-wrapper.has-mobile-cards tr{box-shadow:0 2px 3px hsla(0,0%,4%,.1),0 0 0 1px hsla(0,0%,4%,.1);max-width:100%;position:relative;display:block}.b-table .table-wrapper.has-mobile-cards tr td{border:0;display:inherit}.b-table .table-wrapper.has-mobile-cards tr td:last-child{border-bottom:0}.b-table .table-wrapper.has-mobile-cards tr:not(:last-child){margin-bottom:1rem}.b-table .table-wrapper.has-mobile-cards tr:not([class*=is-]){background:#fff}.b-table .table-wrapper.has-mobile-cards tr:not([class*=is-]):hover{background-color:#fff}.b-table .table-wrapper.has-mobile-cards tr.detail{margin-top:-1rem}.b-table .table-wrapper.has-mobile-cards tr:not(.detail):not(.is-empty):not(.table-footer) td{display:flex;width:auto;justify-content:space-between;text-align:right;border-bottom:1px solid hsl(0,0%,96%)}.b-table .table-wrapper.has-mobile-cards tr:not(.detail):not(.is-empty):not(.table-footer) td:before{content:attr(data-label);font-weight:600;padding-right:.5em;text-align:left}}.b-table .table-wrapper.is-card-list .table{background-color:rgba(0,0,0,0)}.b-table .table-wrapper.is-card-list thead tr{box-shadow:none;border-width:0}.b-table .table-wrapper.is-card-list thead tr th{display:none}.b-table .table-wrapper.is-card-list thead tr .checkbox-cell{display:block;width:100%;text-align:right;margin-bottom:1rem;border:0}.b-table .table-wrapper.is-card-list tfoot th{border:0;display:inherit}.b-table .table-wrapper.is-card-list tr{box-shadow:0 2px 3px hsla(0,0%,4%,.1),0 0 0 1px hsla(0,0%,4%,.1);max-width:100%;position:relative;display:block}.b-table .table-wrapper.is-card-list tr td{border:0;display:inherit}.b-table .table-wrapper.is-card-list tr td:last-child{border-bottom:0}.b-table .table-wrapper.is-card-list tr:not(:last-child){margin-bottom:1rem}.b-table .table-wrapper.is-card-list tr:not([class*=is-]){background:#fff}.b-table .table-wrapper.is-card-list tr:not([class*=is-]):hover{background-color:#fff}.b-table .table-wrapper.is-card-list tr.detail{margin-top:-1rem}.b-table .table-wrapper.is-card-list tr:not(.detail):not(.is-empty):not(.table-footer) td{display:flex;width:auto;justify-content:space-between;text-align:right;border-bottom:1px solid hsl(0,0%,96%)}.b-table .table-wrapper.is-card-list tr:not(.detail):not(.is-empty):not(.table-footer) td:before{content:attr(data-label);font-weight:600;padding-right:.5em;text-align:left}.touch-dragged-cell{position:absolute}.touch-dragged-cell,.touch-dragged-cell .table{pointer-events:none;background-color:color-mix(in srgb, hsl(0, 0%, 100%) 10%, transparent)}.touch-dragged-cell .table{width:100%}.touch-dragged-cell .table tr,.touch-dragged-cell .table td{background-color:rgba(0,0,0,0)}@media screen and (max-width: 768px){.touch-dragged-cell.has-mobile-cards .table tr{display:block}.touch-dragged-cell.has-mobile-cards .table tr td{display:flex;justify-content:space-between;text-align:right}.touch-dragged-cell.has-mobile-cards .table tr td:before{content:attr(data-label);font-weight:600;padding-right:.5em;text-align:left}}.b-tabs .tabs{margin-bottom:0;flex-shrink:0}.b-tabs .tabs li a:focus{outline:none;border-bottom-color:#00875f}.b-tabs .tabs li:not(.is-active) a:focus{border-bottom-color:hsl(0,0%,21%)}.b-tabs .tabs li.is-disabled{pointer-events:none;cursor:not-allowed;opacity:.5}.b-tabs .tabs.is-boxed li a:focus{background-color:#fff;border-bottom-color:rgba(0,0,0,0)}.b-tabs .tabs.is-boxed li:not(.is-active) a:focus{background-color:hsl(0,0%,96%);border-bottom-color:hsl(0,0%,86%)}.b-tabs .tabs.is-toggle li a:focus{background-color:#00875f;border-color:#00875f}.b-tabs .tabs.is-toggle li:not(.is-active) a:focus{background-color:hsl(0,0%,96%);border-color:hsl(0,0%,71%)}.b-tabs .tab-content{position:relative;overflow:visible;display:flex;flex-direction:column;padding:1rem}.b-tabs .tab-content .tab-item{flex-shrink:0;flex-basis:auto}.b-tabs .tab-content .tab-item:focus{outline:none}.b-tabs .tab-content.is-transitioning{overflow:hidden}.b-tabs:not(:last-child){margin-bottom:1.5rem}.b-tabs.is-fullwidth{width:100%}.b-tabs.is-vertical{display:flex;flex-direction:row;flex-wrap:wrap}.b-tabs.is-vertical>.tabs ul{flex-direction:column;border-bottom-color:rgba(0,0,0,0)}.b-tabs.is-vertical>.tabs ul li{width:100%}.b-tabs.is-vertical>.tabs ul li a{justify-content:left}.b-tabs.is-vertical>.tabs.is-boxed li a{border-bottom-color:rgba(0,0,0,0) !important;border-right-color:hsl(0,0%,86%) !important;border-radius:4px 0 0 4px}.b-tabs.is-vertical>.tabs.is-boxed li.is-active a{border-bottom-color:hsl(0,0%,86%) !important;border-right-color:rgba(0,0,0,0) !important}.b-tabs.is-vertical>.tabs.is-toggle li+li{margin-left:0}.b-tabs.is-vertical>.tabs.is-toggle li:first-child a{border-radius:4px 4px 0 0}.b-tabs.is-vertical>.tabs.is-toggle li:last-child a{border-radius:0 0 4px 4px}.b-tabs.is-vertical>.tabs.is-fullwidth li a{height:100%}.b-tabs.is-vertical>.tab-content{flex-grow:1}.b-tabs.is-vertical.is-right{flex-direction:row-reverse}.b-tabs.is-vertical.is-right>.tabs ul a{flex-direction:row-reverse}.b-tabs.is-vertical.is-right>.tabs ul a .icon:first-child{margin-right:0;margin-left:.5em}.b-tabs.is-vertical.is-right>.tabs.is-boxed li a{border-bottom-color:rgba(0,0,0,0) !important;border-right-color:rgba(0,0,0,0) !important;border-left-color:hsl(0,0%,86%) !important;border-radius:0 4px 4px 0}.b-tabs.is-vertical.is-right>.tabs.is-boxed li.is-active a{border-bottom-color:hsl(0,0%,86%) !important;border-right-color:hsl(0,0%,86%) !important;border-left-color:rgba(0,0,0,0) !important}.b-tabs.is-multiline>.tabs ul{flex-wrap:wrap;flex-shrink:1}.tag .has-ellipsis{max-width:10em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tag .delete.is-white,.tag.is-delete.is-white,.tag.has-delete-icon.is-white{background:#fff}.tag .delete.is-white:hover,.tag.is-delete.is-white:hover,.tag.has-delete-icon.is-white:hover{background-color:hsl(0,0%,90%);text-decoration:none}.tag .delete.is-black,.tag.is-delete.is-black,.tag.has-delete-icon.is-black{background:hsl(0,0%,4%)}.tag .delete.is-black:hover,.tag.is-delete.is-black:hover,.tag.has-delete-icon.is-black:hover{background-color:#000;text-decoration:none}.tag .delete.is-light,.tag.is-delete.is-light,.tag.has-delete-icon.is-light{background:hsl(0,0%,96%)}.tag .delete.is-light:hover,.tag.is-delete.is-light:hover,.tag.has-delete-icon.is-light:hover{background-color:hsl(0,0%,86%);text-decoration:none}.tag .delete.is-dark,.tag.is-delete.is-dark,.tag.has-delete-icon.is-dark{background:hsl(0,0%,21%)}.tag .delete.is-dark:hover,.tag.is-delete.is-dark:hover,.tag.has-delete-icon.is-dark:hover{background-color:hsl(0,0%,11%);text-decoration:none}.tag .delete.is-primary,.tag.is-delete.is-primary,.tag.has-delete-icon.is-primary{background:#00875f}.tag .delete.is-primary:hover,.tag.is-delete.is-primary:hover,.tag.has-delete-icon.is-primary:hover{background-color:rgb(0,84,59.1111111111);text-decoration:none}.tag .delete.is-link,.tag.is-delete.is-link,.tag.has-delete-icon.is-link{background:hsl(229,53%,53%)}.tag .delete.is-link:hover,.tag.is-delete.is-link:hover,.tag.has-delete-icon.is-link:hover{background-color:hsl(229,53%,43%);text-decoration:none}.tag .delete.is-info,.tag.is-delete.is-info,.tag.has-delete-icon.is-info{background:hsl(207,61%,53%)}.tag .delete.is-info:hover,.tag.is-delete.is-info:hover,.tag.has-delete-icon.is-info:hover{background-color:hsl(207,61%,43%);text-decoration:none}.tag .delete.is-success,.tag.is-delete.is-success,.tag.has-delete-icon.is-success{background:hsl(153,53%,53%)}.tag .delete.is-success:hover,.tag.is-delete.is-success:hover,.tag.has-delete-icon.is-success:hover{background-color:hsl(153,53%,43%);text-decoration:none}.tag .delete.is-warning,.tag.is-delete.is-warning,.tag.has-delete-icon.is-warning{background:hsl(44,100%,77%)}.tag .delete.is-warning:hover,.tag.is-delete.is-warning:hover,.tag.has-delete-icon.is-warning:hover{background-color:hsl(44,100%,67%);text-decoration:none}.tag .delete.is-danger,.tag.is-delete.is-danger,.tag.has-delete-icon.is-danger{background:hsl(348,86%,61%)}.tag .delete.is-danger:hover,.tag.is-delete.is-danger:hover,.tag.has-delete-icon.is-danger:hover{background-color:hsl(348,86%,51%);text-decoration:none}.tag.has-delete-icon{padding:0px}.tag.has-delete-icon .icon:first-child:not(:last-child){margin-right:0px;margin-left:0px}.tags.inline-tags{margin-bottom:0px}.tags.inline-tags:not(:last-child){margin-right:.5rem}.taginput .taginput-container{display:flex}.taginput .taginput-container.is-focusable{padding-bottom:0;padding-top:calc(.275em - 1px);padding-left:0;padding-right:0;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:auto;cursor:text}.taginput .taginput-container:not(.is-focusable){align-items:center;flex-wrap:wrap;justify-content:flex-start;height:auto}.taginput .taginput-container:not(.is-focusable).is-small{border-radius:2px;font-size:.75rem}.taginput .taginput-container:not(.is-focusable).is-medium{font-size:1.25rem}.taginput .taginput-container:not(.is-focusable).is-large{font-size:1.5rem}.taginput .taginput-container>.tag,.taginput .taginput-container>.tags{margin-left:.275rem;margin-bottom:calc(.275em - 1px);font-size:.9em;height:calc(2em - 1px)}.taginput .taginput-container>.tag .tag,.taginput .taginput-container>.tags .tag{margin-bottom:0;font-size:.9em;height:calc(2em - 1px)}.taginput .taginput-container>.tag .tag.is-delete,.taginput .taginput-container>.tags .tag.is-delete{width:calc(2em - 1px)}.taginput .taginput-container .autocomplete{position:static;flex:1}.taginput .taginput-container .autocomplete input{height:calc(2em - 1px);margin-bottom:calc(.275em - 1px);padding-top:0;padding-bottom:0;border:none;box-shadow:none;min-width:8em}.taginput .taginput-container .autocomplete input:focus{box-shadow:none !important}.taginput .taginput-container .autocomplete .icon{height:calc(2em - 1px)}.taginput .taginput-container .autocomplete>.control.is-loading::after{top:.375em}.timepicker .dropdown-menu{min-width:0}.timepicker .dropdown,.timepicker .dropdown-trigger{width:100%}.timepicker .dropdown .input[readonly],.timepicker .dropdown-trigger .input[readonly]{cursor:pointer;box-shadow:inset 0 .0625em .125em hsla(0,0%,4%,.05)}.timepicker .dropdown .input[readonly]:focus,.timepicker .dropdown .input[readonly].is-focused,.timepicker .dropdown .input[readonly]:active,.timepicker .dropdown .input[readonly].is-active,.timepicker .dropdown-trigger .input[readonly]:focus,.timepicker .dropdown-trigger .input[readonly].is-focused,.timepicker .dropdown-trigger .input[readonly]:active,.timepicker .dropdown-trigger .input[readonly].is-active{box-shadow:0 0 0 .125em rgba(0,135,95,.25)}.timepicker .dropdown.is-disabled{opacity:1}.timepicker .dropdown-item,.timepicker .dropdown .dropdown-menu .has-link a,.dropdown .dropdown-menu .has-link .timepicker a{font-size:inherit;padding:0}.timepicker .timepicker-footer{padding:0 .5rem 0 .5rem}.timepicker .dropdown-content .control{font-size:1.25em;margin-right:0 !important}.timepicker .dropdown-content .control .select{margin:0 .125em}.timepicker .dropdown-content .control .select select{font-weight:600;padding-right:calc(.75em - 1px);border:0}.timepicker .dropdown-content .control .select select option:disabled{color:hsla(0,0%,48%,.7)}.timepicker .dropdown-content .control .select:after{display:none}.timepicker .dropdown-content .control.is-colon{font-size:1.7em;line-height:1.7em}.timepicker .dropdown-content .control.is-colon:last-child{padding-right:calc(.75em - 1px)}.timepicker.is-small{border-radius:2px;font-size:.75rem}.timepicker.is-medium{font-size:1.25rem}.timepicker.is-large{font-size:1.5rem}.b-tooltip.is-top .tooltip-content{top:auto;right:auto;bottom:calc(100% + 5px + 2px);left:50%;transform:translateX(-50%)}.b-tooltip.is-top .tooltip-content::before{top:100%;right:auto;bottom:auto;left:50%;transform:translateX(-50%);border-top:5px solid #00875f;border-right:5px solid rgba(0,0,0,0);border-left:5px solid rgba(0,0,0,0)}.b-tooltip.is-top.is-white .tooltip-content::before{border-top-color:#fff}.b-tooltip.is-top.is-black .tooltip-content::before{border-top-color:hsl(0,0%,4%)}.b-tooltip.is-top.is-light .tooltip-content::before{border-top-color:hsl(0,0%,96%)}.b-tooltip.is-top.is-dark .tooltip-content::before{border-top-color:hsl(0,0%,21%)}.b-tooltip.is-top.is-primary .tooltip-content::before{border-top-color:#00875f}.b-tooltip.is-top.is-primary.is-light .tooltip-content::before{border-top-color:hsl(162.2222222222,100%,96%)}.b-tooltip.is-top.is-link .tooltip-content::before{border-top-color:hsl(229,53%,53%)}.b-tooltip.is-top.is-link.is-light .tooltip-content::before{border-top-color:hsl(229,53%,96%)}.b-tooltip.is-top.is-info .tooltip-content::before{border-top-color:hsl(207,61%,53%)}.b-tooltip.is-top.is-info.is-light .tooltip-content::before{border-top-color:hsl(207,61%,96%)}.b-tooltip.is-top.is-success .tooltip-content::before{border-top-color:hsl(153,53%,53%)}.b-tooltip.is-top.is-success.is-light .tooltip-content::before{border-top-color:hsl(153,53%,96%)}.b-tooltip.is-top.is-warning .tooltip-content::before{border-top-color:hsl(44,100%,77%)}.b-tooltip.is-top.is-warning.is-light .tooltip-content::before{border-top-color:hsl(44,100%,96%)}.b-tooltip.is-top.is-danger .tooltip-content::before{border-top-color:hsl(348,86%,61%)}.b-tooltip.is-top.is-danger.is-light .tooltip-content::before{border-top-color:hsl(348,86%,96%)}.b-tooltip.is-right .tooltip-content{top:50%;right:auto;bottom:auto;left:calc(100% + 5px + 2px);transform:translateY(-50%)}.b-tooltip.is-right .tooltip-content::before{top:50%;right:100%;bottom:auto;left:auto;transform:translateY(-50%);border-top:5px solid rgba(0,0,0,0);border-right:5px solid #00875f;border-bottom:5px solid rgba(0,0,0,0)}.b-tooltip.is-right.is-white .tooltip-content::before{border-right-color:#fff}.b-tooltip.is-right.is-black .tooltip-content::before{border-right-color:hsl(0,0%,4%)}.b-tooltip.is-right.is-light .tooltip-content::before{border-right-color:hsl(0,0%,96%)}.b-tooltip.is-right.is-dark .tooltip-content::before{border-right-color:hsl(0,0%,21%)}.b-tooltip.is-right.is-primary .tooltip-content::before{border-right-color:#00875f}.b-tooltip.is-right.is-primary.is-light .tooltip-content::before{border-right-color:hsl(162.2222222222,100%,96%)}.b-tooltip.is-right.is-link .tooltip-content::before{border-right-color:hsl(229,53%,53%)}.b-tooltip.is-right.is-link.is-light .tooltip-content::before{border-right-color:hsl(229,53%,96%)}.b-tooltip.is-right.is-info .tooltip-content::before{border-right-color:hsl(207,61%,53%)}.b-tooltip.is-right.is-info.is-light .tooltip-content::before{border-right-color:hsl(207,61%,96%)}.b-tooltip.is-right.is-success .tooltip-content::before{border-right-color:hsl(153,53%,53%)}.b-tooltip.is-right.is-success.is-light .tooltip-content::before{border-right-color:hsl(153,53%,96%)}.b-tooltip.is-right.is-warning .tooltip-content::before{border-right-color:hsl(44,100%,77%)}.b-tooltip.is-right.is-warning.is-light .tooltip-content::before{border-right-color:hsl(44,100%,96%)}.b-tooltip.is-right.is-danger .tooltip-content::before{border-right-color:hsl(348,86%,61%)}.b-tooltip.is-right.is-danger.is-light .tooltip-content::before{border-right-color:hsl(348,86%,96%)}.b-tooltip.is-bottom .tooltip-content{top:calc(100% + 5px + 2px);right:auto;bottom:auto;left:50%;transform:translateX(-50%)}.b-tooltip.is-bottom .tooltip-content::before{top:auto;right:auto;bottom:100%;left:50%;transform:translateX(-50%);border-right:5px solid rgba(0,0,0,0);border-bottom:5px solid #00875f;border-left:5px solid rgba(0,0,0,0)}.b-tooltip.is-bottom.is-white .tooltip-content::before{border-bottom-color:#fff}.b-tooltip.is-bottom.is-black .tooltip-content::before{border-bottom-color:hsl(0,0%,4%)}.b-tooltip.is-bottom.is-light .tooltip-content::before{border-bottom-color:hsl(0,0%,96%)}.b-tooltip.is-bottom.is-dark .tooltip-content::before{border-bottom-color:hsl(0,0%,21%)}.b-tooltip.is-bottom.is-primary .tooltip-content::before{border-bottom-color:#00875f}.b-tooltip.is-bottom.is-primary.is-light .tooltip-content::before{border-bottom-color:hsl(162.2222222222,100%,96%)}.b-tooltip.is-bottom.is-link .tooltip-content::before{border-bottom-color:hsl(229,53%,53%)}.b-tooltip.is-bottom.is-link.is-light .tooltip-content::before{border-bottom-color:hsl(229,53%,96%)}.b-tooltip.is-bottom.is-info .tooltip-content::before{border-bottom-color:hsl(207,61%,53%)}.b-tooltip.is-bottom.is-info.is-light .tooltip-content::before{border-bottom-color:hsl(207,61%,96%)}.b-tooltip.is-bottom.is-success .tooltip-content::before{border-bottom-color:hsl(153,53%,53%)}.b-tooltip.is-bottom.is-success.is-light .tooltip-content::before{border-bottom-color:hsl(153,53%,96%)}.b-tooltip.is-bottom.is-warning .tooltip-content::before{border-bottom-color:hsl(44,100%,77%)}.b-tooltip.is-bottom.is-warning.is-light .tooltip-content::before{border-bottom-color:hsl(44,100%,96%)}.b-tooltip.is-bottom.is-danger .tooltip-content::before{border-bottom-color:hsl(348,86%,61%)}.b-tooltip.is-bottom.is-danger.is-light .tooltip-content::before{border-bottom-color:hsl(348,86%,96%)}.b-tooltip.is-left .tooltip-content{top:50%;right:calc(100% + 5px + 2px);bottom:auto;left:auto;transform:translateY(-50%)}.b-tooltip.is-left .tooltip-content::before{top:50%;right:auto;bottom:auto;left:100%;transform:translateY(-50%);border-top:5px solid rgba(0,0,0,0);border-bottom:5px solid rgba(0,0,0,0);border-left:5px solid #00875f}.b-tooltip.is-left.is-white .tooltip-content::before{border-left-color:#fff}.b-tooltip.is-left.is-black .tooltip-content::before{border-left-color:hsl(0,0%,4%)}.b-tooltip.is-left.is-light .tooltip-content::before{border-left-color:hsl(0,0%,96%)}.b-tooltip.is-left.is-dark .tooltip-content::before{border-left-color:hsl(0,0%,21%)}.b-tooltip.is-left.is-primary .tooltip-content::before{border-left-color:#00875f}.b-tooltip.is-left.is-primary.is-light .tooltip-content::before{border-left-color:hsl(162.2222222222,100%,96%)}.b-tooltip.is-left.is-link .tooltip-content::before{border-left-color:hsl(229,53%,53%)}.b-tooltip.is-left.is-link.is-light .tooltip-content::before{border-left-color:hsl(229,53%,96%)}.b-tooltip.is-left.is-info .tooltip-content::before{border-left-color:hsl(207,61%,53%)}.b-tooltip.is-left.is-info.is-light .tooltip-content::before{border-left-color:hsl(207,61%,96%)}.b-tooltip.is-left.is-success .tooltip-content::before{border-left-color:hsl(153,53%,53%)}.b-tooltip.is-left.is-success.is-light .tooltip-content::before{border-left-color:hsl(153,53%,96%)}.b-tooltip.is-left.is-warning .tooltip-content::before{border-left-color:hsl(44,100%,77%)}.b-tooltip.is-left.is-warning.is-light .tooltip-content::before{border-left-color:hsl(44,100%,96%)}.b-tooltip.is-left.is-danger .tooltip-content::before{border-left-color:hsl(348,86%,61%)}.b-tooltip.is-left.is-danger.is-light .tooltip-content::before{border-left-color:hsl(348,86%,96%)}.b-tooltip{position:relative;display:inline-flex}.b-tooltip .tooltip-content{width:auto;padding:.35rem .75rem;border-radius:6px;font-size:.85rem;font-weight:400;box-shadow:0px 1px 2px 1px rgba(0,1,0,.2);z-index:38;white-space:nowrap;position:absolute}.b-tooltip .tooltip-content::before{position:absolute;content:"";pointer-events:none;z-index:38}.b-tooltip .tooltip-trigger{width:100%}.b-tooltip.is-white .tooltip-content{background:#fff;color:hsl(0,0%,4%)}.b-tooltip.is-black .tooltip-content{background:hsl(0,0%,4%);color:#fff}.b-tooltip.is-light .tooltip-content{background:hsl(0,0%,96%);color:rgba(0,0,0,.7)}.b-tooltip.is-dark .tooltip-content{background:hsl(0,0%,21%);color:#fff}.b-tooltip.is-primary .tooltip-content{background:#00875f;color:#fff}.b-tooltip.is-primary.is-light .tooltip-content{background:hsl(162.2222222222,100%,96%);color:rgb(0,229.5,161.5)}.b-tooltip.is-link .tooltip-content{background:hsl(229,53%,53%);color:#fff}.b-tooltip.is-link.is-light .tooltip-content{background:hsl(229,53%,96%);color:hsl(229,53%,47%)}.b-tooltip.is-info .tooltip-content{background:hsl(207,61%,53%);color:#fff}.b-tooltip.is-info.is-light .tooltip-content{background:hsl(207,61%,96%);color:hsl(207,61%,41%)}.b-tooltip.is-success .tooltip-content{background:hsl(153,53%,53%);color:#fff}.b-tooltip.is-success.is-light .tooltip-content{background:hsl(153,53%,96%);color:hsl(153,53%,31%)}.b-tooltip.is-warning .tooltip-content{background:hsl(44,100%,77%);color:rgba(0,0,0,.7)}.b-tooltip.is-warning.is-light .tooltip-content{background:hsl(44,100%,96%);color:hsl(44,100%,29%)}.b-tooltip.is-danger .tooltip-content{background:hsl(348,86%,61%);color:#fff}.b-tooltip.is-danger.is-light .tooltip-content{background:hsl(348,86%,96%);color:hsl(348,86%,43%)}.b-tooltip.is-always .tooltip-content::before,.b-tooltip.is-always .tooltip-content{opacity:1;visibility:visible}.b-tooltip.is-multiline .tooltip-content{display:flex-block;text-align:center;white-space:normal}.b-tooltip.is-multiline.is-small .tooltip-content{width:180px}.b-tooltip.is-multiline.is-medium .tooltip-content{width:240px}.b-tooltip.is-multiline.is-large .tooltip-content{width:300px}.b-tooltip.is-dashed .tooltip-trigger{border-bottom:1px dashed hsl(0,0%,71%);cursor:default}.b-tooltip.is-square .tooltip-content{border-radius:0}.upload{position:relative;display:inline-flex}.upload input[type=file]{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;outline:none;cursor:pointer;z-index:-1}.upload .upload-draggable{cursor:pointer;padding:.25em;border:1px dashed hsl(0,0%,71%);border-radius:6px}.upload .upload-draggable.is-disabled{opacity:.5;cursor:not-allowed}.upload .upload-draggable.is-loading{position:relative;pointer-events:none;opacity:.5}.upload .upload-draggable.is-loading:after{animation:spinAround 500ms infinite linear;border:2px solid hsl(0,0%,86%);border-radius:9999px;border-right-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);content:"";display:block;height:1em;position:relative;width:1em;top:0;left:calc(50% - 1.5em);width:3em;height:3em;border-width:.25em}.upload .upload-draggable:hover.is-white,.upload .upload-draggable.is-hovered.is-white{border-color:#fff;background:hsla(0,0%,100%,.05)}.upload .upload-draggable:hover.is-black,.upload .upload-draggable.is-hovered.is-black{border-color:hsl(0,0%,4%);background:hsla(0,0%,4%,.05)}.upload .upload-draggable:hover.is-light,.upload .upload-draggable.is-hovered.is-light{border-color:hsl(0,0%,96%);background:hsla(0,0%,96%,.05)}.upload .upload-draggable:hover.is-dark,.upload .upload-draggable.is-hovered.is-dark{border-color:hsl(0,0%,21%);background:hsla(0,0%,21%,.05)}.upload .upload-draggable:hover.is-primary,.upload .upload-draggable.is-hovered.is-primary{border-color:#00875f;background:rgba(0,135,95,.05)}.upload .upload-draggable:hover.is-link,.upload .upload-draggable.is-hovered.is-link{border-color:hsl(229,53%,53%);background:hsla(229,53%,53%,.05)}.upload .upload-draggable:hover.is-info,.upload .upload-draggable.is-hovered.is-info{border-color:hsl(207,61%,53%);background:hsla(207,61%,53%,.05)}.upload .upload-draggable:hover.is-success,.upload .upload-draggable.is-hovered.is-success{border-color:hsl(153,53%,53%);background:hsla(153,53%,53%,.05)}.upload .upload-draggable:hover.is-warning,.upload .upload-draggable.is-hovered.is-warning{border-color:hsl(44,100%,77%);background:hsla(44,100%,77%,.05)}.upload .upload-draggable:hover.is-danger,.upload .upload-draggable.is-hovered.is-danger{border-color:hsl(348,86%,61%);background:hsla(348,86%,61%,.05)}.upload .upload-draggable.is-expanded{width:100%}.upload.is-expanded{width:100%}.upload.is-rounded{border-radius:9999px}.upload.is-rounded .file-name{border-top-right-radius:9999px;border-bottom-right-radius:9999px}@media screen and (-ms-high-contrast: active),screen and (-ms-high-contrast: none){.upload input[type=file]{z-index:auto}.upload .upload-draggable+input[type=file]{z-index:-1}} diff --git a/src/wuttafarm/web/templates/appinfo/configure.mako b/src/wuttafarm/web/templates/appinfo/configure.mako new file mode 100644 index 0000000..912eef0 --- /dev/null +++ b/src/wuttafarm/web/templates/appinfo/configure.mako @@ -0,0 +1,82 @@ +## -*- coding: utf-8; -*- +<%inherit file="wuttaweb:templates/appinfo/configure.mako" /> + +<%def name="form_content()"> + ${parent.form_content()} + +

farmOS

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + % for value, label in enum.FARMOS_INTEGRATION_MODE.items(): + + % endfor + + <${b}-tooltip position="${'right' if request.use_oruga else 'is-right'}"> + + + +
+
+ + + Use farmOS-style grid links + + <${b}-tooltip position="${'right' if request.use_oruga else 'is-right'}"> + + + + +
+ diff --git a/src/wuttafarm/web/templates/assets/master/view.mako b/src/wuttafarm/web/templates/assets/master/view.mako new file mode 100644 index 0000000..dac5a1c --- /dev/null +++ b/src/wuttafarm/web/templates/assets/master/view.mako @@ -0,0 +1,14 @@ +## -*- coding: utf-8; -*- +<%inherit file="/master/view.mako" /> + +<%def name="page_content()"> + + % if instance.archived: + + This asset is archived. + Archived assets should only be edited if they need corrections. + + % endif + + ${parent.page_content()} + diff --git a/src/wuttafarm/web/templates/auth/login.mako b/src/wuttafarm/web/templates/auth/login.mako new file mode 100644 index 0000000..2c71694 --- /dev/null +++ b/src/wuttafarm/web/templates/auth/login.mako @@ -0,0 +1,33 @@ +## -*- coding: utf-8; -*- +<%inherit file="wuttaweb:templates/auth/login.mako" /> +<%namespace name="base_meta" file="/base_meta.mako" /> + +<%def name="page_content()"> +
+ +
+ +
+
+ ${form.render_vue_tag()} +
+
+ +
+ - OR - +
+ +
+
+ +
+
+ +
+
+ diff --git a/src/wuttafarm/web/templates/base.mako b/src/wuttafarm/web/templates/base.mako index 3e5d544..b28b52f 100644 --- a/src/wuttafarm/web/templates/base.mako +++ b/src/wuttafarm/web/templates/base.mako @@ -1,4 +1,5 @@ <%inherit file="wuttaweb:templates/base.mako" /> +<%namespace file="/wuttafarm-components.mako" import="make_wuttafarm_components" /> <%def name="index_title_controls()"> ${parent.index_title_controls()} @@ -14,3 +15,8 @@ % endif + +<%def name="render_vue_templates()"> + ${parent.render_vue_templates()} + ${make_wuttafarm_components()} + diff --git a/src/wuttafarm/web/templates/base_meta.mako b/src/wuttafarm/web/templates/base_meta.mako index 78c1d53..36bf3be 100644 --- a/src/wuttafarm/web/templates/base_meta.mako +++ b/src/wuttafarm/web/templates/base_meta.mako @@ -12,5 +12,10 @@ <%def name="footer()"> - ${parent.footer()} +

+ powered by + ${h.link_to("WuttaWeb", 'https://wuttaproject.org/', target='_blank')} + and + ${h.link_to("farmOS", 'https://farmos.org/', target='_blank')} +

diff --git a/src/wuttafarm/web/templates/deform/animaltyperef.pt b/src/wuttafarm/web/templates/deform/animaltyperef.pt new file mode 100644 index 0000000..61dd770 --- /dev/null +++ b/src/wuttafarm/web/templates/deform/animaltyperef.pt @@ -0,0 +1,13 @@ +
+ + + +
diff --git a/src/wuttafarm/web/templates/deform/planttyperefs.pt b/src/wuttafarm/web/templates/deform/planttyperefs.pt new file mode 100644 index 0000000..83cb095 --- /dev/null +++ b/src/wuttafarm/web/templates/deform/planttyperefs.pt @@ -0,0 +1,13 @@ +
+ + + +
diff --git a/src/wuttafarm/web/templates/farmos/master/view.mako b/src/wuttafarm/web/templates/farmos/master/view.mako new file mode 100644 index 0000000..5e7bcd0 --- /dev/null +++ b/src/wuttafarm/web/templates/farmos/master/view.mako @@ -0,0 +1,45 @@ +## -*- coding: utf-8; -*- +<%inherit file="/master/view.mako" /> + +<%def name="tool_panels()"> + ${parent.tool_panels()} + ${self.tool_panel_tools()} + + +<%def name="tool_panel_tools()"> + % if raw_json: + + + + See raw JSON data + + + + <${b}-modal :width="1200" + % if request.use_oruga: + v-model:active="viewJsonShowDialog" + % else: + :active.sync="viewJsonShowDialog" + % endif + > +
+
+ ${rendered_json|n} +
+
+ + + % endif + + +<%def name="modify_vue_vars()"> + ${parent.modify_vue_vars()} + % if raw_json: + + % endif + diff --git a/src/wuttafarm/web/templates/quick/form.mako b/src/wuttafarm/web/templates/quick/form.mako new file mode 100644 index 0000000..4a4f75c --- /dev/null +++ b/src/wuttafarm/web/templates/quick/form.mako @@ -0,0 +1,14 @@ +<%inherit file="/form.mako" /> + +<%def name="title()">${index_title} » ${form_title} + +<%def name="content_title()">${form_title} + +<%def name="render_form_tag()"> + +

+ ${help_text} +

+ + ${parent.render_form_tag()} + diff --git a/src/wuttafarm/web/templates/wuttafarm-components.mako b/src/wuttafarm/web/templates/wuttafarm-components.mako new file mode 100644 index 0000000..37b176e --- /dev/null +++ b/src/wuttafarm/web/templates/wuttafarm-components.mako @@ -0,0 +1,324 @@ + +<%def name="make_wuttafarm_components()"> + ${self.make_animal_type_picker_component()} + ${self.make_plant_types_picker_component()} + + +<%def name="make_animal_type_picker_component()"> + + + + +<%def name="make_plant_types_picker_component()"> + + + diff --git a/src/wuttafarm/web/util.py b/src/wuttafarm/web/util.py new file mode 100644 index 0000000..977550a --- /dev/null +++ b/src/wuttafarm/web/util.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Misc. utilities for web app +""" + +from pyramid import httpexceptions +from webhelpers2.html import HTML + + +def get_farmos_client_for_user(request): + token = request.session.get("farmos.oauth2.token") + if not token: + raise httpexceptions.HTTPForbidden() + + # nb. must give a *copy* of the token to farmOS client, since it + # will mutate it in-place and we don't want that to happen for our + # original copy in the user session. (otherwise the auto-refresh + # will not work correctly for subsequent calls.) + token = dict(token) + + def token_updater(token): + save_farmos_oauth2_token(request, token) + + config = request.wutta_config + app = config.get_app() + return app.get_farmos_client(token=token, token_updater=token_updater) + + +def save_farmos_oauth2_token(request, token): + """ + Common logic for saving the given OAuth2 token within the user + session. This function is called from 2 places: + + * :meth:`wuttafarm.web.views.auth.farmos_oauth_callback()` + * :meth:`wuttafarm.web.views.farmos.master.FarmOSMasterView.get_farmos_client()` + """ + # nb. we pretend the token expires 1 minute early, to avoid edge + # cases around token refresh + token["expires_at"] -= 60 + + # save token to user session + request.session["farmos.oauth2.token"] = token + + +def use_farmos_style_grid_links(config): + return config.get_bool(f"{config.appname}.farmos_style_grid_links", default=True) + + +def render_quantity_objects(quantities): + items = [] + for quantity in quantities: + text = render_quantity_object(quantity) + items.append(HTML.tag("li", c=text)) + return HTML.tag("ul", c=items) + + +def render_quantity_object(quantity): + measure = quantity["measure_name"] + value = quantity["value_decimal"] + unit = quantity["unit_name"] + return f"( {measure} ) {value} {unit}" diff --git a/src/wuttafarm/web/views/__init__.py b/src/wuttafarm/web/views/__init__.py index 63ce536..0d58a72 100644 --- a/src/wuttafarm/web/views/__init__.py +++ b/src/wuttafarm/web/views/__init__.py @@ -25,8 +25,14 @@ WuttaFarm Views from wuttaweb.views import essential +from .master import WuttaFarmMasterView + def includeme(config): + wutta_config = config.registry.settings.get("wutta_config") + app = wutta_config.get_app() + enum = app.enum + mode = app.get_farmos_integration_mode() # wuttaweb core essential.defaults( @@ -34,8 +40,32 @@ def includeme(config): **{ "wuttaweb.views.auth": "wuttafarm.web.views.auth", "wuttaweb.views.common": "wuttafarm.web.views.common", + "wuttaweb.views.settings": "wuttafarm.web.views.settings", + "wuttaweb.views.users": "wuttafarm.web.views.users", } ) + # native table views + if mode != enum.FARMOS_INTEGRATION_MODE_WRAPPER: + config.include("wuttafarm.web.views.units") + config.include("wuttafarm.web.views.quantities") + config.include("wuttafarm.web.views.asset_types") + config.include("wuttafarm.web.views.assets") + config.include("wuttafarm.web.views.land") + config.include("wuttafarm.web.views.structures") + config.include("wuttafarm.web.views.animals") + config.include("wuttafarm.web.views.groups") + config.include("wuttafarm.web.views.plants") + config.include("wuttafarm.web.views.logs") + config.include("wuttafarm.web.views.logs_activity") + config.include("wuttafarm.web.views.logs_harvest") + config.include("wuttafarm.web.views.logs_medical") + config.include("wuttafarm.web.views.logs_observation") + + # quick form views + # (nb. these work with all integration modes) + config.include("wuttafarm.web.views.quick") + # views for farmOS - config.include("wuttafarm.web.views.farmos") + if mode != enum.FARMOS_INTEGRATION_MODE_NONE: + config.include("wuttafarm.web.views.farmos") diff --git a/src/wuttafarm/web/views/animals.py b/src/wuttafarm/web/views/animals.py new file mode 100644 index 0000000..f4c97e2 --- /dev/null +++ b/src/wuttafarm/web/views/animals.py @@ -0,0 +1,312 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Animals +""" + +from webhelpers2.html import tags + +from wuttaweb.forms.schema import WuttaDictEnum +from wuttaweb.util import get_form_data + +from wuttafarm.db.model import AnimalType, AnimalAsset +from wuttafarm.web.views.assets import AssetTypeMasterView, AssetMasterView +from wuttafarm.web.forms.schema import AnimalTypeRef +from wuttafarm.web.forms.widgets import ImageWidget +from wuttafarm.web.util import get_farmos_client_for_user + + +class AnimalTypeView(AssetTypeMasterView): + """ + Master view for Animal Types + """ + + model_class = AnimalType + route_prefix = "animal_types" + url_prefix = "/animal-types" + + farmos_entity_type = "taxonomy_term" + farmos_bundle = "animal_type" + farmos_refurl_path = "/admin/structure/taxonomy/manage/animal_type/overview" + + grid_columns = [ + "name", + "description", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "drupal_id", + "farmos_uuid", + ] + + has_rows = True + row_model_class = AnimalAsset + rows_viewable = True + + row_grid_columns = [ + "asset_name", + "sex", + "is_sterile", + "birthdate", + "archived", + ] + + rows_sort_defaults = "asset_name" + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_farmos_url(self, animal_type): + return self.app.get_farmos_url(f"/taxonomy/term/{animal_type.drupal_id}") + + def get_xref_buttons(self, animal_type): + buttons = super().get_xref_buttons(animal_type) + + if animal_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_animal_types.view", uuid=animal_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + def delete(self): + animal_type = self.get_instance() + + if animal_type.animal_assets: + self.request.session.flash( + "Cannot delete animal type which is still referenced by animal assets.", + "warning", + ) + url = self.get_action_url("view", animal_type) + return self.redirect(self.request.get_referrer(default=url)) + + return super().delete() + + def get_row_grid_data(self, animal_type): + model = self.app.model + session = self.Session() + return ( + session.query(model.AnimalAsset) + .join(model.Asset) + .filter(model.AnimalAsset.animal_type == animal_type) + ) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + model = self.app.model + enum = self.app.enum + + # asset_name + g.set_link("asset_name") + g.set_sorter("asset_name", model.Asset.asset_name) + g.set_filter("asset_name", model.Asset.asset_name) + + # sex + g.set_enum("sex", enum.ANIMAL_SEX) + g.filters["sex"].verbs = ["equal", "not_equal"] + + # archived + g.set_renderer("archived", "boolean") + g.set_sorter("archived", model.Asset.archived) + g.set_filter("archived", model.Asset.archived) + + def get_row_action_url_view(self, animal, i): + return self.request.route_url("animal_assets.view", uuid=animal.uuid) + + def ajax_create(self): + """ + AJAX view to create a new animal type. + """ + model = self.app.model + session = self.Session() + data = get_form_data(self.request) + + name = data.get("name") + if not name: + return {"error": "Name is required"} + + animal_type = model.AnimalType(name=name) + session.add(animal_type) + session.flush() + + if self.app.is_farmos_mirror(): + client = get_farmos_client_for_user(self.request) + self.app.auto_sync_to_farmos(animal_type, client=client) + + return { + "uuid": animal_type.uuid.hex, + "name": animal_type.name, + "farmos_uuid": animal_type.farmos_uuid.hex, + "drupal_id": animal_type.drupal_id, + } + + @classmethod + def defaults(cls, config): + """ """ + cls._defaults(config) + cls._animal_type_defaults(config) + + @classmethod + def _animal_type_defaults(cls, config): + route_prefix = cls.get_route_prefix() + permission_prefix = cls.get_permission_prefix() + url_prefix = cls.get_url_prefix() + + # ajax_create + config.add_route(f"{route_prefix}.ajax_create", f"{url_prefix}/ajax/new") + config.add_view( + cls, + attr="ajax_create", + route_name=f"{route_prefix}.ajax_create", + permission=f"{permission_prefix}.create", + renderer="json", + ) + + +class AnimalAssetView(AssetMasterView): + """ + Master view for Animal Assets + """ + + model_class = AnimalAsset + route_prefix = "animal_assets" + url_prefix = "/assets/animal" + + farmos_refurl_path = "/assets/animal" + farmos_bundle = "animal" + + labels = { + "animal_type": "Species / Breed", + "is_sterile": "Sterile", + } + + grid_columns = [ + "thumbnail", + "drupal_id", + "asset_name", + "produces_eggs", + "animal_type", + "birthdate", + "is_sterile", + "sex", + "groups", + "owners", + "locations", + "archived", + ] + + form_fields = [ + "asset_name", + "animal_type", + "birthdate", + "produces_eggs", + "sex", + "is_sterile", + "notes", + "asset_type", + "owners", + "locations", + "groups", + "archived", + "drupal_id", + "farmos_uuid", + "thumbnail_url", + "image_url", + "thumbnail", + "image", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + model = self.app.model + enum = self.app.enum + + # animal_type + g.set_joiner("animal_type", lambda q: q.join(model.AnimalType)) + g.set_sorter("animal_type", model.AnimalType.name) + g.set_filter("animal_type", model.AnimalType.name) + if self.farmos_style_grid_links: + g.set_renderer("animal_type", self.render_animal_type_for_grid) + else: + g.set_link("animal_type") + + # birthdate + g.set_renderer("birthdate", "date") + + # sex + g.set_enum("sex", enum.ANIMAL_SEX) + g.filters["sex"].verbs = ["equal", "not_equal"] + + def render_animal_type_for_grid(self, animal, field, value): + url = self.request.route_url("animal_types.view", uuid=animal.animal_type_uuid) + return tags.link_to(value, url) + + def configure_form(self, form): + f = form + super().configure_form(f) + enum = self.app.enum + animal = f.model_instance + + # animal_type + f.set_node("animal_type", AnimalTypeRef(self.request)) + + # sex + if not (self.creating or self.editing) and animal.sex is None: + pass # TODO: dict enum widget does not handle null values well + else: + f.set_node("sex", WuttaDictEnum(self.request, enum.ANIMAL_SEX)) + f.set_required("sex", False) + + +def defaults(config, **kwargs): + base = globals() + + AnimalTypeView = kwargs.get("AnimalTypeView", base["AnimalTypeView"]) + AnimalTypeView.defaults(config) + + AnimalAssetView = kwargs.get("AnimalAssetView", base["AnimalAssetView"]) + AnimalAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/asset_types.py b/src/wuttafarm/web/views/asset_types.py new file mode 100644 index 0000000..2fb0239 --- /dev/null +++ b/src/wuttafarm/web/views/asset_types.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Asset Types +""" + +from wuttafarm.db.model import AssetType +from wuttafarm.web.views import WuttaFarmMasterView + + +class AssetTypeView(WuttaFarmMasterView): + """ + Master view for Asset Types + """ + + model_class = AssetType + route_prefix = "asset_types" + url_prefix = "/asset-types" + + grid_columns = [ + "name", + "drupal_id", + "description", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "drupal_id", + "farmos_uuid", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_xref_buttons(self, asset_type): + buttons = super().get_xref_buttons(asset_type) + + if asset_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_asset_types.view", uuid=asset_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + @classmethod + def defaults(cls, config): + """ """ + wutta_config = config.registry.settings.get("wutta_config") + app = wutta_config.get_app() + + if app.is_farmos_mirror(): + cls.creatable = False + cls.editable = False + cls.deletable = False + + cls._defaults(config) + + +def defaults(config, **kwargs): + base = globals() + + AssetTypeView = kwargs.get("AssetTypeView", base["AssetTypeView"]) + AssetTypeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/assets.py b/src/wuttafarm/web/views/assets.py new file mode 100644 index 0000000..b4e4d31 --- /dev/null +++ b/src/wuttafarm/web/views/assets.py @@ -0,0 +1,433 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Assets +""" + +from collections import OrderedDict + +from webhelpers2.html import tags + +from wuttaweb.forms.schema import WuttaDictEnum +from wuttaweb.db import Session + +from wuttafarm.web.views import WuttaFarmMasterView +from wuttafarm.db.model import Asset, Log +from wuttafarm.web.forms.schema import AssetParentRefs, OwnerRefs, AssetRefs +from wuttafarm.web.forms.widgets import ImageWidget +from wuttafarm.util import get_log_type_enum +from wuttafarm.web.util import get_farmos_client_for_user + + +def get_asset_type_enum(config): + app = config.get_app() + model = app.model + session = Session() + asset_types = OrderedDict() + query = session.query(model.AssetType).order_by(model.AssetType.name) + for asset_type in query: + asset_types[asset_type.drupal_id] = asset_type.name + return asset_types + + +class AssetTypeMasterView(WuttaFarmMasterView): + """ + Base class for "Asset Type" master views. + + A bit of a misnmer perhaps, this is *not* for the actual AssetType + model, but rather the "secondary" types, e.g. AnimalType, + LandType etc. + """ + + +class AssetMasterView(WuttaFarmMasterView): + """ + Base class for Asset master views + """ + + farmos_entity_type = "asset" + + labels = { + "groups": "Group Membership", + } + + sort_defaults = "asset_name" + + filter_defaults = { + "asset_name": {"active": True, "verb": "contains"}, + "archived": {"active": True, "verb": "is_false"}, + } + + has_rows = True + row_model_class = Log + rows_viewable = True + + row_labels = { + "message": "Log Name", + } + + row_grid_columns = [ + "status", + "drupal_id", + "timestamp", + "message", + "log_type", + "assets", + "location", + "quantity", + "is_group_assignment", + ] + + rows_sort_defaults = ("timestamp", "desc") + + def get_fallback_templates(self, template): + templates = super().get_fallback_templates(template) + + if self.viewing: + templates.insert(0, "/assets/master/view.mako") + + return templates + + def get_query(self, session=None): + """ """ + model = self.app.model + model_class = self.get_model_class() + session = session or self.Session() + query = session.query(model_class) + if model_class is not model.Asset: + query = query.join(model.Asset) + return query + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + model = self.app.model + + # thumbnail + g.set_renderer("thumbnail", self.render_grid_thumbnail) + g.set_label("thumbnail", "", column_only=True) + g.set_centered("thumbnail") + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + g.set_sorter("drupal_id", model.Asset.drupal_id) + g.set_filter("drupal_id", model.Asset.drupal_id) + + # asset_name + g.set_link("asset_name") + g.set_sorter("asset_name", model.Asset.asset_name) + g.set_filter("asset_name", model.Asset.asset_name) + + # parents + g.set_renderer("parents", self.render_parents_for_grid) + + # groups + g.set_renderer("groups", self.render_groups_for_grid) + + # owners + g.set_label("owners", "Owner") + g.set_renderer("owners", self.render_owners_for_grid) + + # locations + g.set_label("locations", "Location") + g.set_renderer("locations", self.render_locations_for_grid) + + # archived + g.set_renderer("archived", "boolean") + g.set_sorter("archived", model.Asset.archived) + g.set_filter("archived", model.Asset.archived) + + def render_parents_for_grid(self, asset, field, value): + + if self.farmos_style_grid_links: + links = [] + for parent in asset.parents: + url = self.request.route_url( + f"{parent.asset_type}_assets.view", uuid=parent.uuid + ) + links.append(tags.link_to(str(parent), url)) + return ", ".join(links) + + parents = [str(p.parent) for p in asset.parents] + return ", ".join(parents) + + def render_owners_for_grid(self, asset, field, value): + + if self.farmos_style_grid_links: + links = [] + for user in asset.owners: + url = self.request.route_url("users.view", uuid=user.uuid) + links.append(tags.link_to(user.username, url)) + return ", ".join(links) + + return ", ".join([user.username for user in asset.owners]) + + def render_groups_for_grid(self, asset, field, value): + asset_handler = self.app.get_asset_handler() + groups = asset_handler.get_groups(asset) + + if self.farmos_style_grid_links: + links = [] + for group in groups: + url = self.request.route_url( + f"{group.asset_type}_assets.view", uuid=group.uuid + ) + links.append(tags.link_to(str(group), url)) + return ", ".join(links) + + return ", ".join([str(group) for group in groups]) + + def render_locations_for_grid(self, asset, field, value): + asset_handler = self.app.get_asset_handler() + locations = asset_handler.get_locations(asset) + + if self.farmos_style_grid_links: + links = [] + for loc in locations: + url = self.request.route_url( + f"{loc.asset_type}_assets.view", uuid=loc.uuid + ) + links.append(tags.link_to(str(loc), url)) + return ", ".join(links) + + return ", ".join([str(loc) for loc in locations]) + + def grid_row_class(self, asset, data, i): + """ """ + if asset.archived: + return "has-background-warning" + return None + + def configure_form(self, form): + f = form + super().configure_form(f) + asset_handler = self.app.get_asset_handler() + asset = form.model_instance + + # asset_type + if self.creating: + f.remove("asset_type") + else: + f.set_node( + "asset_type", + WuttaDictEnum(self.request, get_asset_type_enum(self.config)), + ) + f.set_readonly("asset_type") + + # owners + if self.creating or self.editing: + f.remove("owners") # TODO: need to support this + else: + f.set_node("owners", OwnerRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("owners", asset.owners) + + # locations + if self.creating or self.editing: + # nb. this is a calculated field + f.remove("locations") + else: + f.set_label("locations", "Current Location") + f.set_node("locations", AssetRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("locations", asset_handler.get_locations(asset)) + + # groups + if self.creating or self.editing: + # nb. this is a calculated field + f.remove("groups") + else: + f.set_node("groups", AssetRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("groups", asset_handler.get_groups(asset)) + + # parents + if self.creating or self.editing: + f.remove("parents") # TODO: add support for this + else: + f.set_node("parents", AssetParentRefs(self.request)) + f.set_default("parents", [p.uuid for p in asset.parents]) + + # notes + f.set_widget("notes", "notes") + + # thumbnail_url + if self.creating or self.editing: + f.remove("thumbnail_url") + + # image_url + if self.creating or self.editing: + f.remove("image_url") + + # thumbnail + if self.creating or self.editing: + f.remove("thumbnail") + elif asset.thumbnail_url: + f.set_widget("thumbnail", ImageWidget("animal thumbnail")) + f.set_default("thumbnail", asset.thumbnail_url) + + # image + if self.creating or self.editing: + f.remove("image") + elif asset.image_url: + f.set_widget("image", ImageWidget("animal image")) + f.set_default("image", asset.image_url) + + def objectify(self, form): + asset = super().objectify(form) + + if self.creating: + asset.asset_type = self.get_asset_type() + + return asset + + def get_asset_type(self): + model_class = self.get_model_class() + return model_class.__wutta_hint__["farmos_asset_type"] + + def get_farmos_url(self, asset): + return self.app.get_farmos_url(f"/asset/{asset.drupal_id}") + + def get_xref_buttons(self, asset): + buttons = super().get_xref_buttons(asset) + + if asset.farmos_uuid: + asset_type = self.get_asset_type() + route = f"farmos_{asset_type}_assets.view" + url = self.request.route_url(route, uuid=asset.farmos_uuid) + buttons.append( + self.make_button( + "View farmOS record", primary=True, url=url, icon_left="eye" + ) + ) + + return buttons + + def get_version_joins(self): + """ + We override this to declare the relationship between the + view's data model (which is some type of asset table) and the + canonical ``Asset`` model, so the revision history views + include transactions which reference either version table. + + See also parent method, + :meth:`~wuttaweb:wuttaweb.views.master.MasterView.get_version_joins()` + """ + model = self.app.model + return super().get_version_joins() + [ + model.Asset, + ] + + def get_row_grid_data(self, asset): + model = self.app.model + session = self.Session() + return ( + session.query(model.Log) + .outerjoin(model.LogAsset) + .filter(model.LogAsset.asset_uuid == asset.uuid) + ) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + enum = self.app.enum + model = self.app.model + session = self.Session() + + # status + g.set_enum("status", enum.LOG_STATUS) + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + + # message + g.set_link("message") + g.set_sorter("message", model.Log.message) + g.set_filter("message", model.Log.message) + + # timestamp + g.set_sorter("timestamp", model.Log.timestamp) + g.set_filter("timestamp", model.Log.timestamp) + + # log_type + g.set_sorter("log_type", model.Log.log_type) + g.set_filter("log_type", model.Log.log_type) + g.set_enum("log_type", get_log_type_enum(self.config, session=session)) + + def get_row_action_url_view(self, log, i): + return self.request.route_url(f"logs_{log.log_type}.view", uuid=log.uuid) + + +class AllAssetView(AssetMasterView): + """ + Master view for Assets + """ + + model_class = Asset + route_prefix = "assets" + url_prefix = "/assets" + + farmos_refurl_path = "/assets" + + viewable = False + creatable = False + editable = False + deletable = False + model_is_versioned = False + + grid_columns = [ + "thumbnail", + "drupal_id", + "asset_name", + "groups", + "asset_type", + "parents", + "owners", + "locations", + "archived", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # asset_type + g.set_enum("asset_type", get_asset_type_enum(self.config)) + + # view action links to final asset record + def asset_url(asset, i): + return self.request.route_url( + f"{asset.asset_type}_assets.view", uuid=asset.uuid + ) + + g.add_action("view", icon="eye", url=asset_url) + + +def defaults(config, **kwargs): + base = globals() + + AllAssetView = kwargs.get("AllAssetView", base["AllAssetView"]) + AllAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/auth.py b/src/wuttafarm/web/views/auth.py index ea3207f..0ab893d 100644 --- a/src/wuttafarm/web/views/auth.py +++ b/src/wuttafarm/web/views/auth.py @@ -23,7 +23,14 @@ Auth views """ +from oauthlib.oauth2 import AccessDeniedError +from requests_oauthlib import OAuth2Session + from wuttaweb.views import auth as base +from wuttaweb.auth import login_user +from wuttaweb.db import Session + +from wuttafarm.web.util import save_farmos_oauth2_token class AuthView(base.AuthView): @@ -47,6 +54,94 @@ class AuthView(base.AuthView): return None + def get_farmos_oauth2_session(self): + farmos = self.app.get_farmos_handler() + return OAuth2Session( + client_id=farmos.get_oauth2_client_id(), + scope=farmos.get_oauth2_scope(), + redirect_uri=self.request.route_url("farmos_oauth_callback"), + ) + + def farmos_oauth_login(self): + """ + View to initiate OAuth2 workflow. + """ + oauth = self.get_farmos_oauth2_session() + auth_url, state = oauth.authorization_url( + self.app.get_farmos_url("/oauth/authorize") + ) + return self.redirect(auth_url) + + def farmos_oauth_callback(self): + """ + View for OAuth2 workflow, provided as redirect URL when + authorizing. + """ + session = Session() + auth = self.app.get_auth_handler() + oauth = self.get_farmos_oauth2_session() + + try: + # get oauth token from farmOS + token = oauth.fetch_token( + self.app.get_farmos_url("/oauth/token"), + authorization_response=self.request.current_route_url(), + include_client_id=True, + ) + + except AccessDeniedError: + self.request.session.flash("Access to farmOS was denied.", "error") + return self.redirect(self.request.route_url("login")) + + # save token in user session + save_farmos_oauth2_token(self.request, token) + + # nb. must give a *copy* of the token to farmOS client, since + # it will mutate it in-place and we don't want that to happen + # for our original copy in the user session. (otherwise the + # auto-refresh will not work correctly for subsequent calls.) + token = dict(token) + + # get (or create) native app user + farmos_client = self.app.get_farmos_client(token=token) + info = farmos_client.info() + farmos_user = farmos_client.resource.get_id( + "user", "user", info["meta"]["links"]["me"]["meta"]["id"] + ) + user = auth.get_or_make_farmos_user( + session, farmos_user["data"]["attributes"]["name"] + ) + if not user: + self.request.session.flash( + "farmOS authentication was successful, but user is " + "not allowed login to {self.app.get_node_title()}.", + "error", + ) + return self.redirect(self.request.route_url("login")) + + # delare user is logged in + headers = login_user(self.request, user) + referrer = self.request.get_referrer() + return self.redirect(referrer, headers=headers) + + @classmethod + def defaults(cls, config): + cls._auth_defaults(config) + cls._wuttafarm_defaults(config) + + @classmethod + def _wuttafarm_defaults(cls, config): + + # farmos oauth login + config.add_route("farmos_oauth_login", "/farmos/oauth/login") + config.add_view(cls, attr="farmos_oauth_login", route_name="farmos_oauth_login") + + # farmos oauth callback + config.add_route("farmos_oauth_callback", "/farmos/oauth/callback") + config.add_view( + cls, attr="farmos_oauth_callback", route_name="farmos_oauth_callback" + ) + def defaults(config, **kwargs): local = globals() diff --git a/src/wuttafarm/web/views/common.py b/src/wuttafarm/web/views/common.py index bb8a9c9..674d76e 100644 --- a/src/wuttafarm/web/views/common.py +++ b/src/wuttafarm/web/views/common.py @@ -45,11 +45,106 @@ class CommonView(base.CommonView): farm_viewer = auth.get_role_farm_viewer(session) farm_viewer.notes = "this is meant to mirror the corresponding role in farmOS" + # create system user to represent farmOS + auth.make_user(session, username="farmos", prevent_edit=True) + site_admin = session.query(model.Role).filter_by(name="Site Admin").first() if site_admin: site_admin_perms = [ - "farmos_animals.list", - "farmos_animals.view", + "animal_types.create", + "animal_types.edit", + "animal_types.list", + "animal_types.view", + "animal_types.versions", + "animal_assets.create", + "animal_assets.edit", + "animal_assets.list", + "animal_assets.view", + "animal_assets.versions", + "assets.list", + "asset_types.list", + "asset_types.view", + "asset_types.versions", + "farmos_animal_assets.list", + "farmos_animal_assets.view", + "farmos_animal_types.list", + "farmos_animal_types.view", + "farmos_asset_types.list", + "farmos_asset_types.view", + "farmos_group_assets.list", + "farmos_group_assets.view", + "farmos_land_assets.list", + "farmos_land_assets.view", + "farmos_land_types.list", + "farmos_land_types.view", + "farmos_log_types.list", + "farmos_log_types.view", + "farmos_logs_activity.list", + "farmos_logs_activity.view", + "farmos_logs_harvest.list", + "farmos_logs_harvest.view", + "farmos_logs_medical.list", + "farmos_logs_medical.view", + "farmos_logs_observation.list", + "farmos_logs_observation.view", + "farmos_plant_assets.list", + "farmos_plant_assets.view", + "farmos_plant_types.list", + "farmos_plant_types.view", + "farmos_quantities_standard.list", + "farmos_quantities_standard.view", + "farmos_quantity_types.list", + "farmos_quantity_types.view", + "farmos_structure_assets.list", + "farmos_structure_assets.view", + "farmos_structure_types.list", + "farmos_structure_types.view", + "farmos_units.list", + "farmos_units.view", + "farmos_users.list", + "farmos_users.view", + "group_assets.create", + "group_assets.edit", + "group_assets.list", + "group_assets.view", + "group_assets.versions", + "land_assets.create", + "land_assets.edit", + "land_assets.list", + "land_assets.view", + "land_assets.versions", + "land_types.list", + "land_types.view", + "land_types.versions", + "log_types.list", + "log_types.view", + "log_types.versions", + "logs_activity.list", + "logs_activity.view", + "logs_activity.versions", + "logs_harvest.list", + "logs_harvest.view", + "logs_harvest.versions", + "logs_medical.list", + "logs_medical.view", + "logs_medical.versions", + "logs_observation.list", + "logs_observation.view", + "logs_observation.versions", + "quick.eggs", + "structure_types.list", + "structure_types.view", + "structure_types.versions", + "structure_assets.create", + "structure_assets.edit", + "structure_assets.list", + "structure_assets.view", + "structure_assets.versions", + "units.create", + "units.edit", + "units.list", + "units.view", + "units.versions", ] for perm in site_admin_perms: auth.grant_permission(site_admin, perm) diff --git a/src/wuttafarm/web/views/farmos/__init__.py b/src/wuttafarm/web/views/farmos/__init__.py index df789b3..e59ac1f 100644 --- a/src/wuttafarm/web/views/farmos/__init__.py +++ b/src/wuttafarm/web/views/farmos/__init__.py @@ -27,4 +27,20 @@ from .master import FarmOSMasterView def includeme(config): + config.include("wuttafarm.web.views.farmos.users") + config.include("wuttafarm.web.views.farmos.quantities") + config.include("wuttafarm.web.views.farmos.asset_types") + config.include("wuttafarm.web.views.farmos.units") + config.include("wuttafarm.web.views.farmos.land_types") + config.include("wuttafarm.web.views.farmos.land_assets") + config.include("wuttafarm.web.views.farmos.structure_types") + config.include("wuttafarm.web.views.farmos.structures") + config.include("wuttafarm.web.views.farmos.animal_types") config.include("wuttafarm.web.views.farmos.animals") + config.include("wuttafarm.web.views.farmos.groups") + config.include("wuttafarm.web.views.farmos.plants") + config.include("wuttafarm.web.views.farmos.log_types") + config.include("wuttafarm.web.views.farmos.logs_activity") + config.include("wuttafarm.web.views.farmos.logs_harvest") + config.include("wuttafarm.web.views.farmos.logs_medical") + config.include("wuttafarm.web.views.farmos.logs_observation") diff --git a/src/wuttafarm/web/views/farmos/animal_types.py b/src/wuttafarm/web/views/farmos/animal_types.py new file mode 100644 index 0000000..03bd42c --- /dev/null +++ b/src/wuttafarm/web/views/farmos/animal_types.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS animal types +""" + +from wuttafarm.web.views.farmos.master import TaxonomyMasterView + + +class AnimalTypeView(TaxonomyMasterView): + """ + Master view for Animal Types in farmOS. + """ + + model_name = "farmos_animal_type" + model_title = "farmOS Animal Type" + model_title_plural = "farmOS Animal Types" + + route_prefix = "farmos_animal_types" + url_prefix = "/farmOS/animal-types" + + farmos_taxonomy_type = "animal_type" + farmos_refurl_path = "/admin/structure/taxonomy/manage/animal_type/overview" + + def get_xref_buttons(self, animal_type): + buttons = super().get_xref_buttons(animal_type) + model = self.app.model + session = self.Session() + + if wf_animal_type := ( + session.query(model.AnimalType) + .filter(model.AnimalType.farmos_uuid == animal_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "animal_types.view", uuid=wf_animal_type.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + AnimalTypeView = kwargs.get("AnimalTypeView", base["AnimalTypeView"]) + AnimalTypeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/animals.py b/src/wuttafarm/web/views/farmos/animals.py index d765cd4..c99cc5a 100644 --- a/src/wuttafarm/web/views/farmos/animals.py +++ b/src/wuttafarm/web/views/farmos/animals.py @@ -25,139 +25,309 @@ Master view for Farm Animals import datetime -from farmOS import farmOS +import colander +from webhelpers2.html import tags -from wuttafarm.web.views.farmos import FarmOSMasterView -from wuttafarm.web.forms.widgets import AnimalImage +from wuttaweb.forms.schema import WuttaDateTime, WuttaDictEnum +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.farmos.assets import AssetMasterView +from wuttafarm.web.grids import ( + SimpleSorter, + StringFilter, + BooleanFilter, + NullableBooleanFilter, + DateTimeFilter, +) +from wuttafarm.web.forms.schema import FarmOSRef, FarmOSAssetRefs -class AnimalView(FarmOSMasterView): +class AnimalView(AssetMasterView): """ Master view for Farm Animals """ - model_name = "farmos_animal" - model_title = "farmOS Animal" - model_title_plural = "farmOS Animals" + model_name = "farmos_animal_assets" + model_title = "farmOS Animal Asset" + model_title_plural = "farmOS Animal Assets" - route_prefix = "farmos_animals" - url_prefix = "/farmOS/animals" + route_prefix = "farmos_animal_assets" + url_prefix = "/farmOS/assets/animal" + farmos_asset_type = "animal" farmos_refurl_path = "/assets/animal" labels = { - "species_breed": "Species / Breed", - "raw_image_url": "Raw Image URL", - "large_image_url": "Large Image URL", - "thumbnail_image_url": "Thumbnail Image URL", + "animal_type": "Species / Breed", + "animal_type_name": "Species / Breed", + "is_sterile": "Sterile", } grid_columns = [ + "thumbnail", + "drupal_id", "name", - "species_breed", + "produces_eggs", + "animal_type_name", "birthdate", + "is_sterile", "sex", - "location", + "groups", + "owners", + "locations", + "archived", ] - sort_defaults = "name" - form_fields = [ "name", - "species_breed", + "animal_type", "birthdate", + "produces_eggs", "sex", - "location", - "raw_image_url", - "large_image_url", - "thumbnail_image_url", + "is_sterile", + "notes", + "asset_type_name", + "owners", + "locations", + "groups", + "archived", + "thumbnail_url", + "image_url", + "thumbnail", "image", ] - def get_grid_data(self, columns=None, session=None): - animals = self.farmos_client.resource.get("asset", "animal") - return [self.normalize_animal(a) for a in animals["data"]] + def get_farmos_api_includes(self): + includes = super().get_farmos_api_includes() + includes.add("animal_type") + includes.add("group") + return includes def configure_grid(self, grid): g = grid super().configure_grid(g) + enum = self.app.enum - # name - g.set_link("name") - g.set_searchable("name") + # produces_eggs + g.set_renderer("produces_eggs", "boolean") + g.set_sorter("produces_eggs", SimpleSorter("produces_eggs")) + g.set_filter("produces_eggs", NullableBooleanFilter) + + # animal_type_name + if self.farmos_style_grid_links: + g.set_renderer("animal_type_name", self.render_animal_type_for_grid) + else: + g.set_link("animal_type_name") + g.set_sorter("animal_type_name", SimpleSorter("animal_type.name")) + g.set_filter("animal_type_name", StringFilter, path="animal_type.name") # birthdate g.set_renderer("birthdate", "date") + g.set_sorter("birthdate", SimpleSorter("birthdate")) + g.set_filter("birthdate", DateTimeFilter) + + # sex + g.set_enum("sex", enum.ANIMAL_SEX) + g.set_sorter("sex", SimpleSorter("sex")) + g.set_filter("sex", StringFilter) + + # groups + g.set_label("groups", "Group Membership") + g.set_renderer("groups", self.render_groups_for_grid) + + # is_sterile + g.set_renderer("is_sterile", "boolean") + g.set_sorter("is_sterile", SimpleSorter("is_sterile")) + g.set_filter("is_sterile", BooleanFilter) + + def render_animal_type_for_grid(self, animal, field, value): + uuid = animal["animal_type"]["uuid"] + url = self.request.route_url("farmos_animal_types.view", uuid=uuid) + return tags.link_to(value, url) + + def render_groups_for_grid(self, animal, field, value): + groups = [] + for group in animal["groups"]: + if self.farmos_style_grid_links: + url = self.request.route_url( + "farmos_group_assets.view", uuid=group["uuid"] + ) + groups.append(tags.link_to(group["name"], url)) + else: + groups.append(group["name"]) + return ", ".join(groups) def get_instance(self): - animal = self.farmos_client.resource.get_id( - "asset", "animal", self.request.matchdict["uuid"] - ) + data = super().get_instance() - # instance data - data = self.normalize_animal(animal["data"]) + if relationships := self.raw_json["data"].get("relationships"): - # add image_url - if relationships := animal["data"].get("relationships"): - if image := relationships.get("image"): - if image["data"]: - image = self.farmos_client.resource.get_id( - "file", "file", image["data"][0]["id"] - ) - data["raw_image_url"] = self.app.get_farmos_url( - image["data"]["attributes"]["uri"]["url"] - ) - # nb. other styles available: medium, wide - data["large_image_url"] = image["data"]["attributes"][ - "image_style_uri" - ]["large"] - data["thumbnail_image_url"] = image["data"]["attributes"][ - "image_style_uri" - ]["thumbnail"] + # add animal type + if not data.get("animal_type"): + if animal_type := relationships.get("animal_type"): + if animal_type["data"]: + animal_type = self.farmos_client.resource.get_id( + "taxonomy_term", "animal_type", animal_type["data"]["id"] + ) + data["animal_type"] = { + "uuid": animal_type["data"]["id"], + "name": animal_type["data"]["attributes"]["name"], + } return data - def get_instance_title(self, animal): - return animal["name"] - - def normalize_animal(self, animal): + def normalize_asset(self, animal, included): + normal = super().normalize_asset(animal, included) birthdate = animal["attributes"]["birthdate"] if birthdate: birthdate = datetime.datetime.fromisoformat(birthdate) birthdate = self.app.localtime(birthdate) - return { - "uuid": animal["id"], - "drupal_internal_id": animal["attributes"]["drupal_internal__id"], - "name": animal["attributes"]["name"], - "species_breed": "", # TODO - "birthdate": birthdate, - "sex": animal["attributes"]["sex"], - "location": "", # TODO - } + sterile = None + if self.farmos_4x: + sterile = animal["attributes"]["is_sterile"] + else: + sterile = animal["attributes"]["is_castrated"] + + animal_type_object = None + group_objects = [] + group_names = [] + if relationships := animal.get("relationships"): + + if animal_type := relationships.get("animal_type"): + if animal_type := included.get(animal_type["data"]["id"]): + animal_type_object = { + "uuid": animal_type["id"], + "name": animal_type["attributes"]["name"], + } + + if groups := relationships.get("group"): + for group in groups["data"]: + if group := included.get(group["id"]): + group = { + "uuid": group["id"], + "name": group["attributes"]["name"], + "asset_type": "group", + } + group_objects.append(group) + group_names.append(group["name"]) + + normal.update( + { + "animal_type": animal_type_object, + "animal_type_uuid": animal_type_object["uuid"], + "animal_type_name": animal_type_object["name"], + "groups": group_objects, + "group_names": group_names, + "birthdate": birthdate, + "sex": animal["attributes"]["sex"] or colander.null, + "is_sterile": sterile, + "produces_eggs": animal["attributes"].get("produces_eggs"), + } + ) + + return normal + + def get_animal_types(self): + animal_types = [] + result = self.farmos_client.resource.get( + "taxonomy_term", "animal_type", params={"sort": "name"} + ) + for animal_type in result["data"]: + animal_types.append((animal_type["id"], animal_type["attributes"]["name"])) + return animal_types def configure_form(self, form): f = form super().configure_form(f) + enum = self.app.enum animal = f.model_instance - # image - if url := animal.get("large_image_url"): - f.set_widget("image", AnimalImage()) - f.set_default("image", url) + # animal_type + f.set_node( + "animal_type", + FarmOSRef( + self.request, "farmos_animal_types", values=self.get_animal_types + ), + ) + + # produces_eggs + f.set_node("produces_eggs", colander.Boolean()) + + # birthdate + f.set_node("birthdate", WuttaDateTime()) + f.set_widget("birthdate", WuttaDateTimeWidget(self.request)) + f.set_required("birthdate", False) + + # sex + if not (self.creating or self.editing) and not animal["sex"]: + pass # TODO: dict enum widget does not handle null values well + else: + f.set_node("sex", WuttaDictEnum(self.request, enum.ANIMAL_SEX)) + f.set_required("sex", False) + + # is_sterile + f.set_node("is_sterile", colander.Boolean()) + + # groups + if self.creating or self.editing: + f.remove("groups") # TODO + else: + f.set_node("groups", FarmOSAssetRefs(self.request)) + + def get_api_payload(self, animal): + payload = super().get_api_payload(animal) + + birthdate = None + if animal["birthdate"]: + birthdate = self.app.localtime(animal["birthdate"]).timestamp() + + attrs = { + "sex": animal["sex"] or None, + "is_sterile": animal["is_sterile"], + "produces_eggs": animal["produces_eggs"], + "birthdate": birthdate, + } + + rels = { + "animal_type": { + "data": { + "id": animal["animal_type"], + "type": "taxonomy_term--animal_type", + } + } + } + + payload["attributes"].update(attrs) + payload.setdefault("relationships", {}).update(rels) + return payload def get_xref_buttons(self, animal): - return [ - self.make_button( - "View in farmOS", - primary=True, - url=self.app.get_farmos_url(f"/asset/{animal['drupal_internal_id']}"), - target="_blank", - icon_left="external-link-alt", - ), - ] + buttons = super().get_xref_buttons(animal) + + if self.app.is_farmos_mirror(): + model = self.app.model + session = self.Session() + + if wf_animal := ( + session.query(model.Asset) + .filter(model.Asset.farmos_uuid == animal["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "animal_assets.view", uuid=wf_animal.uuid + ), + icon_left="eye", + ) + ) + + return buttons def defaults(config, **kwargs): diff --git a/src/wuttafarm/web/views/farmos/asset_types.py b/src/wuttafarm/web/views/farmos/asset_types.py new file mode 100644 index 0000000..a2fac2f --- /dev/null +++ b/src/wuttafarm/web/views/farmos/asset_types.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS asset types +""" + +from wuttafarm.web.views.farmos import FarmOSMasterView + + +class AssetTypeView(FarmOSMasterView): + """ + View for farmOS asset types + """ + + model_name = "farmos_asset_type" + model_title = "farmOS Asset Type" + model_title_plural = "farmOS Asset Types" + + route_prefix = "farmos_asset_types" + url_prefix = "/farmOS/asset-types" + + grid_columns = [ + "label", + "description", + ] + + sort_defaults = "label" + + form_fields = [ + "label", + "description", + ] + + def get_grid_data(self, columns=None, session=None): + asset_types = self.farmos_client.resource.get("asset_type", "asset_type") + return [self.normalize_asset_type(t) for t in asset_types["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # label + g.set_link("label") + g.set_searchable("label") + + # description + g.set_searchable("description") + + def get_instance(self): + asset_type = self.farmos_client.resource.get_id( + "asset_type", "asset_type", self.request.matchdict["uuid"] + ) + self.raw_json = asset_type + return self.normalize_asset_type(asset_type["data"]) + + def get_instance_title(self, asset_type): + return asset_type["label"] + + def normalize_asset_type(self, asset_type): + return { + "uuid": asset_type["id"], + "drupal_id": asset_type["attributes"]["drupal_internal__id"], + "label": asset_type["attributes"]["label"], + "description": asset_type["attributes"]["description"], + } + + def configure_form(self, form): + f = form + super().configure_form(f) + + # description + f.set_widget("description", "notes") + + def get_xref_buttons(self, asset_type): + model = self.app.model + session = self.Session() + buttons = [] + + if wf_asset_type := ( + session.query(model.AssetType) + .filter(model.AssetType.farmos_uuid == asset_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "asset_types.view", uuid=wf_asset_type.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + AssetTypeView = kwargs.get("AssetTypeView", base["AssetTypeView"]) + AssetTypeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/assets.py b/src/wuttafarm/web/views/farmos/assets.py new file mode 100644 index 0000000..11f744b --- /dev/null +++ b/src/wuttafarm/web/views/farmos/assets.py @@ -0,0 +1,319 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Base class for Asset master views +""" + +import colander +from webhelpers2.html import tags + +from wuttafarm.web.views.farmos import FarmOSMasterView +from wuttafarm.web.forms.schema import FarmOSRefs, FarmOSLocationRefs +from wuttafarm.web.forms.widgets import ImageWidget +from wuttafarm.web.grids import ( + ResourceData, + StringFilter, + IntegerFilter, + BooleanFilter, + SimpleSorter, +) + + +class AssetMasterView(FarmOSMasterView): + """ + Base class for Asset master views + """ + + farmos_asset_type = None + creatable = True + editable = True + deletable = True + filterable = True + sort_on_backend = True + + labels = { + "name": "Asset Name", + "asset_type_name": "Asset Type", + "locations": "Location", + "groups": "Group Membership", + "thumbnail_url": "Thumbnail URL", + "image_url": "Image URL", + } + + grid_columns = [ + "thumbnail", + "drupal_id", + "name", + "owners", + "locations", + "archived", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + "archived": {"active": True, "verb": "is_false"}, + } + + def get_grid_data(self, **kwargs): + return ResourceData( + self.config, + self.farmos_client, + f"asset--{self.farmos_asset_type}", + include=",".join(self.get_farmos_api_includes()), + normalizer=self.normalize_asset, + ) + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # thumbnail + g.set_renderer("thumbnail", self.render_grid_thumbnail) + g.set_label("thumbnail", "", column_only=True) + g.set_centered("thumbnail") + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + g.set_sorter("drupal_id", SimpleSorter("drupal_internal__id")) + g.set_filter("drupal_id", IntegerFilter, path="drupal_internal__id") + + # name + g.set_link("name") + g.set_sorter("name", SimpleSorter("name")) + g.set_filter("name", StringFilter) + + # owners + g.set_label("owners", "Owner") + g.set_renderer("owners", self.render_owners_for_grid) + + # locations + g.set_renderer("locations", self.render_locations_for_grid) + + # archived + g.set_renderer("archived", "boolean") + g.set_sorter("archived", SimpleSorter("archived")) + g.set_filter("archived", BooleanFilter) + + def render_grid_thumbnail(self, obj, field, value): + if url := obj.get("thumbnail_url"): + return tags.image(url, f"thumbnail for {self.get_model_title()}") + return None + + def render_locations_for_grid(self, asset, field, value): + locations = [] + for location in value: + if self.farmos_style_grid_links: + asset_type = location["type"].split("--")[1] + route = f"farmos_{asset_type}_assets.view" + url = self.request.route_url(route, uuid=location["uuid"]) + locations.append(tags.link_to(location["name"], url)) + else: + locations.append(location["name"]) + return ", ".join(locations) + + def grid_row_class(self, asset, data, i): + """ """ + if asset["archived"]: + return "has-background-warning" + return None + + def get_farmos_api_includes(self): + return {"asset_type", "location", "owner", "image"} + + def get_instance(self): + result = self.farmos_client.asset.get_id( + self.farmos_asset_type, + self.request.matchdict["uuid"], + params={"include": ",".join(self.get_farmos_api_includes())}, + ) + self.raw_json = result + included = {obj["id"]: obj for obj in result.get("included", [])} + return self.normalize_asset(result["data"], included) + + def get_instance_title(self, asset): + return asset["name"] + + def normalize_asset(self, asset, included): + + if notes := asset["attributes"]["notes"]: + notes = notes["value"] + + if self.farmos_4x: + archived = asset["attributes"]["archived"] + else: + archived = asset["attributes"]["status"] == "archived" + + asset_type_object = {} + asset_type_name = None + owner_objects = [] + owner_names = [] + location_objects = [] + location_names = [] + thumbnail_url = None + image_url = None + if relationships := asset.get("relationships"): + + if asset_type := relationships.get("asset_type"): + if asset_type := included.get(asset_type["data"]["id"]): + asset_type_object = { + "uuid": asset_type["id"], + "name": asset_type["attributes"]["label"], + } + asset_type_name = asset_type_object["name"] + + if owners := relationships.get("owner"): + for user in owners["data"]: + if user := included.get(user["id"]): + user = { + "uuid": user["id"], + "name": user["attributes"]["name"], + } + owner_objects.append(user) + owner_names.append(user["name"]) + + if locations := relationships.get("location"): + for location in locations["data"]: + if location := included.get(location["id"]): + location = { + "uuid": location["id"], + "type": location["type"], + "name": location["attributes"]["name"], + } + location_objects.append(location) + location_names.append(location["name"]) + + if images := relationships.get("image"): + for image in images["data"]: + if image := included.get(image["id"]): + thumbnail_url = image["attributes"]["image_style_uri"][ + "thumbnail" + ] + image_url = image["attributes"]["image_style_uri"]["large"] + + return { + "uuid": asset["id"], + "drupal_id": asset["attributes"]["drupal_internal__id"], + "name": asset["attributes"]["name"], + "asset_type": asset_type_object, + "asset_type_name": asset_type_name, + "notes": notes or colander.null, + "owners": owner_objects, + "owner_names": owner_names, + "locations": location_objects, + "location_names": location_names, + "archived": archived, + "thumbnail_url": thumbnail_url or colander.null, + "image_url": image_url or colander.null, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + asset = f.model_instance + + # asset_type_name + if self.creating or self.editing: + f.remove("asset_type_name") + + # locations + if self.creating or self.editing: + f.remove("locations") + else: + f.set_label("locations", "Current Location") + f.set_node("locations", FarmOSLocationRefs(self.request)) + + # owners + if self.creating or self.editing: + f.remove("owners") # TODO + else: + f.set_node("owners", FarmOSRefs(self.request, "farmos_users")) + + # notes + f.set_widget("notes", "notes") + f.set_required("notes", False) + + # archived + f.set_node("archived", colander.Boolean()) + + # thumbnail_url + if self.creating or self.editing: + f.remove("thumbnail_url") + + # image_url + if self.creating or self.editing: + f.remove("image_url") + + # thumbnail + if self.creating or self.editing: + f.remove("thumbnail") + elif asset.get("thumbnail_url"): + f.set_widget("thumbnail", ImageWidget("asset thumbnail")) + f.set_default("thumbnail", asset["thumbnail_url"]) + + # image + if self.creating or self.editing: + f.remove("image") + elif asset.get("image_url"): + f.set_widget("image", ImageWidget("asset image")) + f.set_default("image", asset["image_url"]) + + def persist(self, asset, session=None): + payload = self.get_api_payload(asset) + if self.editing: + payload["id"] = asset["uuid"] + + result = self.farmos_client.asset.send(self.farmos_asset_type, payload) + + if self.creating: + asset["uuid"] = result["data"]["id"] + + def get_api_payload(self, asset): + + attrs = { + "name": asset["name"], + "notes": {"value": asset["notes"] or None}, + "archived": asset["archived"], + } + + if "is_location" in asset: + attrs["is_location"] = asset["is_location"] + + if "is_fixed" in asset: + attrs["is_fixed"] = asset["is_fixed"] + + return {"attributes": attrs} + + def delete_instance(self, asset): + self.farmos_client.asset.delete(self.farmos_asset_type, asset["uuid"]) + + def get_xref_buttons(self, asset): + return [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/asset/{asset['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] diff --git a/src/wuttafarm/web/views/farmos/groups.py b/src/wuttafarm/web/views/farmos/groups.py new file mode 100644 index 0000000..8794965 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/groups.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Groups +""" + +import datetime + +import colander + +from wuttafarm.web.views.farmos import FarmOSMasterView +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + + +class GroupView(FarmOSMasterView): + """ + View for farmOS Groups + """ + + model_name = "farmos_group" + model_title = "farmOS Group" + model_title_plural = "farmOS Groups" + + route_prefix = "farmos_group_assets" + url_prefix = "/farmOS/groups" + + farmos_refurl_path = "/assets/group" + + grid_columns = [ + "name", + "is_fixed", + "is_location", + "archived", + "changed", + ] + + sort_defaults = "name" + + form_fields = [ + "name", + "is_fixed", + "is_location", + "archived", + "notes", + "created", + "changed", + ] + + def get_grid_data(self, columns=None, session=None): + groups = self.farmos_client.resource.get("asset", "group") + return [self.normalize_group(a) for a in groups["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + g.set_searchable("name") + + # is_fixed + g.set_renderer("is_fixed", "boolean") + + # is_location + g.set_renderer("is_location", "boolean") + + # changed + g.set_renderer("changed", "datetime") + + # archived + g.set_renderer("archived", "boolean") + + def get_instance(self): + group = self.farmos_client.resource.get_id( + "asset", "group", self.request.matchdict["uuid"] + ) + self.raw_json = group + return self.normalize_group(group["data"]) + + def get_instance_title(self, group): + return group["name"] + + def normalize_group(self, group): + + if created := group["attributes"].get("created"): + created = datetime.datetime.fromisoformat(created) + created = self.app.localtime(created) + + if changed := group["attributes"].get("changed"): + changed = datetime.datetime.fromisoformat(changed) + changed = self.app.localtime(changed) + + if self.farmos_4x: + archived = group["attributes"]["archived"] + else: + archived = group["attributes"]["status"] == "archived" + + if notes := group["attributes"]["notes"]: + notes = notes["value"] + + return { + "uuid": group["id"], + "drupal_id": group["attributes"]["drupal_internal__id"], + "name": group["attributes"]["name"], + "created": created, + "changed": changed, + "is_fixed": group["attributes"]["is_fixed"], + "is_location": group["attributes"]["is_location"], + "archived": archived, + "notes": notes or colander.null, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + + # is_fixed + f.set_node("is_fixed", colander.Boolean()) + + # is_location + f.set_node("is_location", colander.Boolean()) + + # notes + f.set_widget("notes", "notes") + + # created + f.set_node("created", WuttaDateTime()) + f.set_widget("created", WuttaDateTimeWidget(self.request)) + + # changed + f.set_node("changed", WuttaDateTime()) + f.set_widget("changed", WuttaDateTimeWidget(self.request)) + + # archived + f.set_node("archived", colander.Boolean()) + + def get_xref_buttons(self, group): + model = self.app.model + session = self.Session() + + buttons = [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/asset/{group['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] + + if wf_group := ( + session.query(model.GroupAsset) + .filter(model.GroupAsset.farmos_uuid == group["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url("group_assets.view", uuid=wf_group.uuid), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + GroupView = kwargs.get("GroupView", base["GroupView"]) + GroupView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/land_assets.py b/src/wuttafarm/web/views/farmos/land_assets.py new file mode 100644 index 0000000..ffea76d --- /dev/null +++ b/src/wuttafarm/web/views/farmos/land_assets.py @@ -0,0 +1,214 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Land Assets +""" + +import datetime + +import colander + +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.farmos import FarmOSMasterView + + +class LandAssetView(FarmOSMasterView): + """ + View for farmOS Land Assets + """ + + model_name = "farmos_land_asset" + model_title = "farmOS Land Asset" + model_title_plural = "farmOS Land Assets" + + route_prefix = "farmos_land_assets" + url_prefix = "/farmOS/land" + + farmos_refurl_path = "/assets/land" + + grid_columns = [ + "name", + "land_type", + "is_fixed", + "is_location", + "archived", + "changed", + ] + + sort_defaults = "name" + + form_fields = [ + "name", + "land_type", + "is_fixed", + "is_location", + "archived", + "notes", + "created", + "changed", + ] + + def get_grid_data(self, columns=None, session=None): + land_assets = self.farmos_client.resource.get("asset", "land") + return [self.normalize_land_asset(l) for l in land_assets["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + g.set_searchable("name") + + # is_fixed + g.set_renderer("is_fixed", "boolean") + + # is_location + g.set_renderer("is_location", "boolean") + + # created + g.set_renderer("created", "datetime") + + # changed + g.set_renderer("changed", "datetime") + + # archived + g.set_renderer("archived", "boolean") + + def get_instance(self): + land_asset = self.farmos_client.resource.get_id( + "asset", "land", self.request.matchdict["uuid"] + ) + self.raw_json = land_asset + return self.normalize_land_asset(land_asset["data"]) + + def get_instance_title(self, land_asset): + return land_asset["name"] + + def normalize_land_asset(self, land): + + if created := land["attributes"].get("created"): + created = datetime.datetime.fromisoformat(created) + created = self.app.localtime(created) + + if changed := land["attributes"].get("changed"): + changed = datetime.datetime.fromisoformat(changed) + changed = self.app.localtime(changed) + + if notes := land["attributes"]["notes"]: + notes = notes["value"] + + if self.farmos_4x: + archived = land["attributes"]["archived"] + else: + archived = land["attributes"]["status"] == "archived" + + return { + "uuid": land["id"], + "drupal_id": land["attributes"]["drupal_internal__id"], + "name": land["attributes"]["name"], + "land_type": land["attributes"]["land_type"], + "created": created, + "changed": changed, + "is_fixed": land["attributes"]["is_fixed"], + "is_location": land["attributes"]["is_location"], + "archived": archived, + "notes": notes or colander.null, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + + # is_fixed + f.set_node("is_fixed", colander.Boolean()) + + # is_location + f.set_node("is_location", colander.Boolean()) + + # notes + f.set_widget("notes", "notes") + + # created + f.set_node("created", WuttaDateTime()) + f.set_widget("created", WuttaDateTimeWidget(self.request)) + + # changed + f.set_node("changed", WuttaDateTime()) + f.set_widget("changed", WuttaDateTimeWidget(self.request)) + + # archived + f.set_node("archived", colander.Boolean()) + + def get_xref_buttons(self, land): + return [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/asset/{land['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] + + def get_xref_buttons(self, land): + model = self.app.model + session = self.Session() + + buttons = [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/asset/{land['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] + + if wf_land := ( + session.query(model.LandAsset) + .filter(model.LandAsset.farmos_uuid == land["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url("land_assets.view", uuid=wf_land.uuid), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + LandAssetView = kwargs.get("LandAssetView", base["LandAssetView"]) + LandAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/land_types.py b/src/wuttafarm/web/views/farmos/land_types.py new file mode 100644 index 0000000..e9eccea --- /dev/null +++ b/src/wuttafarm/web/views/farmos/land_types.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS land types +""" + +from wuttafarm.web.views.farmos import FarmOSMasterView + + +class LandTypeView(FarmOSMasterView): + """ + Master view for Land Types in farmOS. + """ + + model_name = "farmos_land_type" + model_title = "farmOS Land Type" + model_title_plural = "farmOS Land Types" + + route_prefix = "farmos_land_types" + url_prefix = "/farmOS/land-types" + + grid_columns = [ + "label", + ] + + sort_defaults = "label" + + form_fields = [ + "label", + ] + + def get_grid_data(self, columns=None, session=None): + land_types = self.farmos_client.resource.get("land_type", "land_type") + return [self.normalize_land_type(t) for t in land_types["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # label + g.set_link("label") + g.set_searchable("label") + + def get_instance(self): + land_type = self.farmos_client.resource.get_id( + "land_type", "land_type", self.request.matchdict["uuid"] + ) + self.raw_json = land_type + return self.normalize_land_type(land_type["data"]) + + def get_instance_title(self, land_type): + return land_type["label"] + + def normalize_land_type(self, land_type): + return { + "uuid": land_type["id"], + "drupal_id": land_type["attributes"]["drupal_internal__id"], + "label": land_type["attributes"]["label"], + } + + def get_xref_buttons(self, land_type): + model = self.app.model + session = self.Session() + buttons = [] + + if wf_land_type := ( + session.query(model.LandType) + .filter(model.LandType.farmos_uuid == land_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "land_types.view", uuid=wf_land_type.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + LandTypeView = kwargs.get("LandTypeView", base["LandTypeView"]) + LandTypeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/log_types.py b/src/wuttafarm/web/views/farmos/log_types.py new file mode 100644 index 0000000..1f6404a --- /dev/null +++ b/src/wuttafarm/web/views/farmos/log_types.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS log types +""" + +from wuttafarm.web.views.farmos import FarmOSMasterView + + +class LogTypeView(FarmOSMasterView): + """ + Master view for Log Types in farmOS. + """ + + model_name = "farmos_log_type" + model_title = "farmOS Log Type" + model_title_plural = "farmOS Log Types" + + route_prefix = "farmos_log_types" + url_prefix = "/farmOS/log-types" + + grid_columns = [ + "label", + "description", + ] + + sort_defaults = "label" + + form_fields = [ + "label", + "description", + ] + + def get_grid_data(self, columns=None, session=None): + log_types = self.farmos_client.resource.get("log_type", "log_type") + return [self.normalize_log_type(t) for t in log_types["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # label + g.set_link("label") + g.set_searchable("label") + + def get_instance(self): + log_type = self.farmos_client.resource.get_id( + "log_type", "log_type", self.request.matchdict["uuid"] + ) + self.raw_json = log_type + return self.normalize_log_type(log_type["data"]) + + def get_instance_title(self, log_type): + return log_type["label"] + + def normalize_log_type(self, log_type): + return { + "uuid": log_type["id"], + "drupal_id": log_type["attributes"]["drupal_internal__id"], + "label": log_type["attributes"]["label"], + "description": log_type["attributes"]["description"], + } + + def configure_form(self, form): + f = form + super().configure_form(f) + + # description + f.set_widget("description", "notes") + + def get_xref_buttons(self, log_type): + model = self.app.model + session = self.Session() + buttons = [] + + if wf_log_type := ( + session.query(model.LogType) + .filter(model.LogType.farmos_uuid == log_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url("log_types.view", uuid=wf_log_type.uuid), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + LogTypeView = kwargs.get("LogTypeView", base["LogTypeView"]) + LogTypeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/logs.py b/src/wuttafarm/web/views/farmos/logs.py new file mode 100644 index 0000000..cb7a87b --- /dev/null +++ b/src/wuttafarm/web/views/farmos/logs.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Harvest Logs +""" + +import colander +from webhelpers2.html import tags + +from wuttaweb.forms.schema import WuttaDateTime, WuttaDictEnum +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.farmos import FarmOSMasterView +from wuttafarm.web.grids import ( + ResourceData, + SimpleSorter, + StringFilter, + IntegerFilter, + DateTimeFilter, + NullableBooleanFilter, +) +from wuttafarm.web.forms.schema import ( + FarmOSQuantityRefs, + FarmOSAssetRefs, + FarmOSRefs, + LogQuick, + Notes, +) +from wuttafarm.web.util import render_quantity_objects + + +class LogMasterView(FarmOSMasterView): + """ + Base class for farmOS Log master views + """ + + farmos_log_type = None + filterable = True + sort_on_backend = True + + labels = { + "name": "Log Name", + "log_type_name": "Log Type", + "locations": "Location", + "quantities": "Quantity", + } + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "name", + "assets", + "locations", + "quantities", + "is_group_assignment", + "owners", + ] + + sort_defaults = ("timestamp", "desc") + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + "status": {"active": True, "verb": "not_equal", "value": "abandoned"}, + } + + form_fields = [ + "name", + "timestamp", + "assets", + "groups", + "locations", + "quantities", + "notes", + "status", + "log_type_name", + "owners", + "is_movement", + "is_group_assignment", + "quick", + "drupal_id", + ] + + def get_farmos_api_includes(self): + return {"log_type", "quantity", "asset", "group", "location", "owner"} + + def get_grid_data(self, **kwargs): + return ResourceData( + self.config, + self.farmos_client, + f"log--{self.farmos_log_type}", + include=",".join(self.get_farmos_api_includes()), + normalizer=self.normalize_log, + ) + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + enum = self.app.enum + + # status + g.set_enum("status", enum.LOG_STATUS) + g.set_sorter("status", SimpleSorter("status")) + g.set_filter( + "status", + StringFilter, + choices=enum.LOG_STATUS, + verbs=["equal", "not_equal"], + ) + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + g.set_sorter("drupal_id", SimpleSorter("drupal_internal__id")) + g.set_filter("drupal_id", IntegerFilter, path="drupal_internal__id") + + # timestamp + g.set_renderer("timestamp", "date") + g.set_link("timestamp") + g.set_sorter("timestamp", SimpleSorter("timestamp")) + g.set_filter("timestamp", DateTimeFilter) + + # name + g.set_link("name") + g.set_sorter("name", SimpleSorter("name")) + g.set_filter("name", StringFilter) + + # assets + g.set_renderer("assets", self.render_assets_for_grid) + + # groups + g.set_renderer("groups", self.render_assets_for_grid) + + # locations + g.set_renderer("locations", self.render_assets_for_grid) + + # quantities + g.set_renderer("quantities", self.render_quantities_for_grid) + + # is_group_assignment + g.set_renderer("is_group_assignment", "boolean") + g.set_sorter("is_group_assignment", SimpleSorter("is_group_assignment")) + g.set_filter("is_group_assignment", NullableBooleanFilter) + + # owners + g.set_label("owners", "Owner") + g.set_renderer("owners", self.render_owners_for_grid) + + def render_assets_for_grid(self, log, field, value): + if not value: + return "" + + assets = [] + for asset in value: + if self.farmos_style_grid_links: + url = self.request.route_url( + f"farmos_{asset['asset_type']}_assets.view", uuid=asset["uuid"] + ) + assets.append(tags.link_to(asset["name"], url)) + else: + assets.append(asset["name"]) + return ", ".join(assets) + + def render_quantities_for_grid(self, log, field, value): + if not value: + return None + return render_quantity_objects(value) + + def grid_row_class(self, log, data, i): + if log["status"] == "pending": + return "has-background-warning" + if log["status"] == "abandoned": + return "has-background-danger" + return None + + def get_instance(self): + result = self.farmos_client.log.get_id( + self.farmos_log_type, + self.request.matchdict["uuid"], + params={"include": ",".join(self.get_farmos_api_includes())}, + ) + self.raw_json = result + included = {obj["id"]: obj for obj in result.get("included", [])} + return self.normalize_log(result["data"], included) + + def get_instance_title(self, log): + return log["name"] + + def normalize_log(self, log, included): + data = self.normal.normalize_farmos_log(log, included) + data.update( + { + "log_type_name": data["log_type"].get("name"), + } + ) + return data + + def configure_form(self, form): + f = form + super().configure_form(f) + enum = self.app.enum + log = f.model_instance + + # timestamp + f.set_node("timestamp", WuttaDateTime()) + f.set_widget("timestamp", WuttaDateTimeWidget(self.request)) + + # assets + f.set_node("assets", FarmOSAssetRefs(self.request)) + + # groups + f.set_node("groups", FarmOSAssetRefs(self.request)) + + # locations + f.set_node("locations", FarmOSAssetRefs(self.request)) + + # quantities + f.set_node("quantities", FarmOSQuantityRefs(self.request)) + + # is_movement + f.set_node("is_movement", colander.Boolean()) + + # is_group_assignment + f.set_node("is_group_assignment", colander.Boolean()) + + # notes + f.set_node("notes", Notes()) + + # status + f.set_node("status", WuttaDictEnum(self.request, enum.LOG_STATUS)) + + # owners + if self.creating or self.editing: + f.remove("owners") # TODO + else: + f.set_node("owners", FarmOSRefs(self.request, "farmos_users")) + + # quick + f.set_node("quick", LogQuick(self.request)) + + def get_xref_buttons(self, log): + model = self.app.model + session = self.Session() + + buttons = [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/log/{log['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] + + if wf_log := ( + session.query(model.Log) + .filter(model.Log.farmos_uuid == log["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + f"logs_{self.farmos_log_type}.view", uuid=wf_log.uuid + ), + icon_left="eye", + ) + ) + + return buttons diff --git a/src/wuttafarm/web/views/farmos/logs_activity.py b/src/wuttafarm/web/views/farmos/logs_activity.py new file mode 100644 index 0000000..972ca31 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/logs_activity.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Activity Logs +""" + +from wuttafarm.web.views.farmos.logs import LogMasterView + + +class ActivityLogView(LogMasterView): + """ + View for farmOS activity logs + """ + + model_name = "farmos_activity_log" + model_title = "farmOS Activity Log" + model_title_plural = "farmOS Activity Logs" + + route_prefix = "farmos_logs_activity" + url_prefix = "/farmOS/logs/activity" + + farmos_log_type = "activity" + farmos_refurl_path = "/logs/activity" + + +def defaults(config, **kwargs): + base = globals() + + ActivityLogView = kwargs.get("ActivityLogView", base["ActivityLogView"]) + ActivityLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/logs_harvest.py b/src/wuttafarm/web/views/farmos/logs_harvest.py new file mode 100644 index 0000000..bfe7121 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/logs_harvest.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Harvest Logs +""" + +from wuttafarm.web.views.farmos.logs import LogMasterView + + +class HarvestLogView(LogMasterView): + """ + View for farmOS harvest logs + """ + + model_name = "farmos_harvest_log" + model_title = "farmOS Harvest Log" + model_title_plural = "farmOS Harvest Logs" + + route_prefix = "farmos_logs_harvest" + url_prefix = "/farmOS/logs/harvest" + + farmos_log_type = "harvest" + farmos_refurl_path = "/logs/harvest" + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "name", + "assets", + "quantities", + "owners", + ] + + +def defaults(config, **kwargs): + base = globals() + + HarvestLogView = kwargs.get("HarvestLogView", base["HarvestLogView"]) + HarvestLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/logs_medical.py b/src/wuttafarm/web/views/farmos/logs_medical.py new file mode 100644 index 0000000..2f6a606 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/logs_medical.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Medical Logs +""" + +from wuttafarm.web.views.farmos.logs import LogMasterView +from wuttafarm.web.grids import SimpleSorter, StringFilter + + +class MedicalLogView(LogMasterView): + """ + View for farmOS medical logs + """ + + model_name = "farmos_medical_log" + model_title = "farmOS Medical Log" + model_title_plural = "farmOS Medical Logs" + + route_prefix = "farmos_logs_medical" + url_prefix = "/farmOS/logs/medical" + + farmos_log_type = "medical" + farmos_refurl_path = "/logs/medical" + + labels = { + "vet": "Veterinarian", + } + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "name", + "assets", + "vet", + "owners", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # vet + g.set_sorter("vet", SimpleSorter("vet")) + g.set_filter("vet", StringFilter) + + def configure_form(self, form): + f = form + super().configure_form(f) + + # vet + f.fields.insert_after("timestamp", "vet") + + +def defaults(config, **kwargs): + base = globals() + + MedicalLogView = kwargs.get("MedicalLogView", base["MedicalLogView"]) + MedicalLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/logs_observation.py b/src/wuttafarm/web/views/farmos/logs_observation.py new file mode 100644 index 0000000..0193f93 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/logs_observation.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Observation Logs +""" + +from wuttafarm.web.views.farmos.logs import LogMasterView + + +class ObservationLogView(LogMasterView): + """ + View for farmOS observation logs + """ + + model_name = "farmos_observation_log" + model_title = "farmOS Observation Log" + model_title_plural = "farmOS Observation Logs" + + route_prefix = "farmos_logs_observation" + url_prefix = "/farmOS/logs/observation" + + farmos_log_type = "observation" + farmos_refurl_path = "/logs/observation" + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "name", + "assets", + "locations", + "groups", + "is_group_assignment", + "owners", + ] + + +def defaults(config, **kwargs): + base = globals() + + ObservationLogView = kwargs.get("ObservationLogView", base["ObservationLogView"]) + ObservationLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/master.py b/src/wuttafarm/web/views/farmos/master.py index 40f7bfc..1e2ceab 100644 --- a/src/wuttafarm/web/views/farmos/master.py +++ b/src/wuttafarm/web/views/farmos/master.py @@ -23,9 +23,25 @@ Base class for farmOS master views """ -from farmOS import farmOS +import datetime +import json + +import colander +import markdown +from webhelpers2.html import tags from wuttaweb.views import MasterView +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.util import get_farmos_client_for_user, use_farmos_style_grid_links +from wuttafarm.web.grids import ( + ResourceData, + StringFilter, + NullableStringFilter, + DateTimeFilter, + SimpleSorter, +) class FarmOSMasterView(MasterView): @@ -45,21 +61,191 @@ class FarmOSMasterView(MasterView): farmos_refurl_path = None + labels = { + "drupal_id": "Drupal ID", + "raw_image_url": "Raw Image URL", + "large_image_url": "Large Image URL", + "thumbnail_image_url": "Thumbnail Image URL", + } + def __init__(self, request, context=None): super().__init__(request, context=context) - self.farmos_client = self.get_farmos_client() + self.farmos_client = get_farmos_client_for_user(self.request) + self.farmos_4x = self.app.is_farmos_4x(self.farmos_client) + self.normal = self.app.get_normalizer(self.farmos_client) + self.raw_json = None + self.farmos_style_grid_links = use_farmos_style_grid_links(self.config) - def get_farmos_client(self): - token = self.request.session.get("farmos.oauth2.token") - if not token: - raise self.forbidden() + def get_fallback_templates(self, template): + """ """ + templates = super().get_fallback_templates(template) - url = self.app.get_farmos_url() - return farmOS(url, token=token) + if template == "view": + templates.insert(0, "/farmos/master/view.mako") + + return templates + + def render_owners_for_grid(self, obj, field, value): + owners = [] + for user in value: + if self.farmos_style_grid_links: + url = self.request.route_url("farmos_users.view", uuid=user["uuid"]) + owners.append(tags.link_to(user["name"], url)) + else: + owners.append(user["name"]) + return ", ".join(owners) def get_template_context(self, context): if self.listing and self.farmos_refurl_path: context["farmos_refurl"] = self.app.get_farmos_url(self.farmos_refurl_path) + if self.viewing and self.raw_json: + context["raw_json"] = self.raw_json + code = "```json\n" + json.dumps(self.raw_json, indent=2) + "\n```" + # TODO: this does not seem to be adding syntax highlight + context["rendered_json"] = markdown.markdown( + code, extensions=["fenced_code", "codehilite"] + ) + return context + + +class TaxonomyMasterView(FarmOSMasterView): + """ + Base class for farmOS "taxonomy term" views + """ + + farmos_taxonomy_type = None + creatable = True + editable = True + deletable = True + filterable = True + sort_on_backend = True + + grid_columns = [ + "name", + "description", + "changed", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "changed", + ] + + def get_grid_data(self, columns=None, session=None): + return ResourceData( + self.config, + self.farmos_client, + f"taxonomy_term--{self.farmos_taxonomy_type}", + normalizer=self.normalize_taxonomy_term, + ) + + def normalize_taxonomy_term(self, term, included): + + if changed := term["attributes"]["changed"]: + changed = datetime.datetime.fromisoformat(changed) + changed = self.app.localtime(changed) + + if description := term["attributes"]["description"]: + description = description["value"] + + return { + "uuid": term["id"], + "drupal_id": term["attributes"]["drupal_internal__tid"], + "name": term["attributes"]["name"], + "description": description or colander.null, + "changed": changed, + } + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + g.set_sorter("name", SimpleSorter("name")) + g.set_filter("name", StringFilter) + + # description + g.set_sorter("description", SimpleSorter("description.value")) + g.set_filter("description", NullableStringFilter, path="description.value") + + # changed + g.set_renderer("changed", "datetime") + g.set_sorter("changed", SimpleSorter("changed")) + g.set_filter("changed", DateTimeFilter) + + def get_instance(self): + result = self.farmos_client.resource.get_id( + "taxonomy_term", self.farmos_taxonomy_type, self.request.matchdict["uuid"] + ) + self.raw_json = result + return self.normalize_taxonomy_term(result["data"], {}) + + def get_instance_title(self, term): + return term["name"] + + def configure_form(self, form): + f = form + super().configure_form(f) + + # description + f.set_widget("description", "notes") + f.set_required("description", False) + + # changed + if self.creating or self.editing: + f.remove("changed") + else: + f.set_node("changed", WuttaDateTime()) + f.set_widget("changed", WuttaDateTimeWidget(self.request)) + + def get_api_payload(self, term): + + attrs = { + "name": term["name"], + } + + if description := term["description"]: + attrs["description"] = {"value": description} + else: + attrs["description"] = None + + return {"attributes": attrs} + + def persist(self, term, session=None): + payload = self.get_api_payload(term) + if self.editing: + payload["id"] = term["uuid"] + + result = self.farmos_client.resource.send( + "taxonomy_term", self.farmos_taxonomy_type, payload + ) + + if self.creating: + term["uuid"] = result["data"]["id"] + + def delete_instance(self, term): + self.farmos_client.resource.delete( + "taxonomy_term", self.farmos_taxonomy_type, term["uuid"] + ) + + def get_xref_buttons(self, term): + return [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/taxonomy/term/{term['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ) + ] diff --git a/src/wuttafarm/web/views/farmos/plants.py b/src/wuttafarm/web/views/farmos/plants.py new file mode 100644 index 0000000..57bf2d4 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/plants.py @@ -0,0 +1,287 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Farm Plants +""" + +import datetime + +import colander + +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.farmos.master import TaxonomyMasterView +from wuttafarm.web.views.farmos import FarmOSMasterView +from wuttafarm.web.forms.schema import UsersType, StructureType, FarmOSPlantTypes +from wuttafarm.web.forms.widgets import ImageWidget + + +class PlantTypeView(TaxonomyMasterView): + """ + Master view for Plant Types in farmOS. + """ + + model_name = "farmos_plant_type" + model_title = "farmOS Plant Type" + model_title_plural = "farmOS Plant Types" + + route_prefix = "farmos_plant_types" + url_prefix = "/farmOS/plant-types" + + farmos_taxonomy_type = "plant_type" + farmos_refurl_path = "/admin/structure/taxonomy/manage/plant_type/overview" + + def get_xref_buttons(self, plant_type): + buttons = super().get_xref_buttons(plant_type) + model = self.app.model + session = self.Session() + + if wf_plant_type := ( + session.query(model.PlantType) + .filter(model.PlantType.farmos_uuid == plant_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "plant_types.view", uuid=wf_plant_type.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +class PlantAssetView(FarmOSMasterView): + """ + Master view for farmOS Plant Assets + """ + + model_name = "farmos_plant_assets" + model_title = "farmOS Plant Asset" + model_title_plural = "farmOS Plant Assets" + + route_prefix = "farmos_plant_assets" + url_prefix = "/farmOS/assets/plant" + + farmos_refurl_path = "/assets/plant" + + grid_columns = [ + "name", + "archived", + ] + + sort_defaults = "name" + + form_fields = [ + "name", + "plant_types", + "archived", + "owners", + "location", + "notes", + "raw_image_url", + "large_image_url", + "thumbnail_image_url", + "image", + ] + + def get_grid_data(self, columns=None, session=None): + result = self.farmos_client.asset.get("plant") + return [self.normalize_plant(a) for a in result["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + g.set_searchable("name") + + # archived + g.set_renderer("archived", "boolean") + + def get_instance(self): + + plant = self.farmos_client.resource.get_id( + "asset", "plant", self.request.matchdict["uuid"] + ) + self.raw_json = plant + + # instance data + data = self.normalize_plant(plant["data"]) + + if relationships := plant["data"].get("relationships"): + + # add plant types + if plant_type := relationships.get("plant_type"): + if plant_type["data"]: + data["plant_types"] = [] + for plant_type in plant_type["data"]: + plant_type = self.farmos_client.resource.get_id( + "taxonomy_term", "plant_type", plant_type["id"] + ) + data["plant_types"].append( + { + "uuid": plant_type["data"]["id"], + "name": plant_type["data"]["attributes"]["name"], + } + ) + + # add location + if location := relationships.get("location"): + if location["data"]: + location = self.farmos_client.resource.get_id( + "asset", "structure", location["data"][0]["id"] + ) + data["location"] = { + "uuid": location["data"]["id"], + "name": location["data"]["attributes"]["name"], + } + + # add owners + if owner := relationships.get("owner"): + data["owners"] = [] + for owner_data in owner["data"]: + owner = self.farmos_client.resource.get_id( + "user", "user", owner_data["id"] + ) + data["owners"].append( + { + "uuid": owner["data"]["id"], + "display_name": owner["data"]["attributes"]["display_name"], + } + ) + + # add image urls + if image := relationships.get("image"): + if image["data"]: + image = self.farmos_client.resource.get_id( + "file", "file", image["data"][0]["id"] + ) + data["raw_image_url"] = self.app.get_farmos_url( + image["data"]["attributes"]["uri"]["url"] + ) + # nb. other styles available: medium, wide + data["large_image_url"] = image["data"]["attributes"][ + "image_style_uri" + ]["large"] + data["thumbnail_image_url"] = image["data"]["attributes"][ + "image_style_uri" + ]["thumbnail"] + + return data + + def get_instance_title(self, plant): + return plant["name"] + + def normalize_plant(self, plant): + + if notes := plant["attributes"]["notes"]: + notes = notes["value"] + + if self.farmos_4x: + archived = plant["attributes"]["archived"] + else: + archived = plant["attributes"]["status"] == "archived" + + return { + "uuid": plant["id"], + "drupal_id": plant["attributes"]["drupal_internal__id"], + "name": plant["attributes"]["name"], + "location": colander.null, # TODO + "archived": archived, + "notes": notes or colander.null, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + plant = f.model_instance + + # plant_types + f.set_node("plant_types", FarmOSPlantTypes(self.request)) + + # location + f.set_node("location", StructureType(self.request)) + + # owners + f.set_node("owners", UsersType(self.request)) + + # notes + f.set_widget("notes", "notes") + + # archived + f.set_node("archived", colander.Boolean()) + + # image + if url := plant.get("large_image_url"): + f.set_widget("image", ImageWidget("plant image")) + f.set_default("image", url) + + def get_xref_buttons(self, plant): + model = self.app.model + session = self.Session() + + buttons = [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/asset/{plant['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] + + if wf_plant := ( + session.query(model.Asset) + .filter(model.Asset.farmos_uuid == plant["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url("plant_assets.view", uuid=wf_plant.uuid), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + PlantTypeView = kwargs.get("PlantTypeView", base["PlantTypeView"]) + PlantTypeView.defaults(config) + + PlantAssetView = kwargs.get("PlantAssetView", base["PlantAssetView"]) + PlantAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/quantities.py b/src/wuttafarm/web/views/farmos/quantities.py new file mode 100644 index 0000000..a388559 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/quantities.py @@ -0,0 +1,345 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Quantity Types +""" + +import datetime + +import colander + +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.farmos import FarmOSMasterView +from wuttafarm.web.forms.schema import FarmOSUnitRef +from wuttafarm.web.grids import ResourceData + + +class QuantityTypeView(FarmOSMasterView): + """ + View for farmOS Quantity Types + """ + + model_name = "farmos_quantity_type" + model_title = "farmOS Quantity Type" + model_title_plural = "farmOS Quantity Types" + + route_prefix = "farmos_quantity_types" + url_prefix = "/farmOS/quantity-types" + + grid_columns = [ + "label", + "description", + ] + + sort_defaults = "label" + + form_fields = [ + "label", + "description", + ] + + def get_grid_data(self, columns=None, session=None): + result = self.farmos_client.resource.get("quantity_type") + return [self.normalize_quantity_type(t) for t in result["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # label + g.set_link("label") + g.set_searchable("label") + + # description + g.set_searchable("description") + + def get_instance(self): + result = self.farmos_client.resource.get_id( + "quantity_type", "quantity_type", self.request.matchdict["uuid"] + ) + self.raw_json = result + return self.normalize_quantity_type(result["data"]) + + def get_instance_title(self, quantity_type): + return quantity_type["label"] + + def normalize_quantity_type(self, quantity_type): + return { + "uuid": quantity_type["id"], + "drupal_id": quantity_type["attributes"]["drupal_internal__id"], + "label": quantity_type["attributes"]["label"], + "description": quantity_type["attributes"]["description"], + } + + def configure_form(self, form): + f = form + super().configure_form(f) + + # description + f.set_widget("description", "notes") + + def get_xref_buttons(self, quantity_type): + model = self.app.model + session = self.Session() + buttons = [] + + if wf_quantity_type := ( + session.query(model.QuantityType) + .filter(model.QuantityType.farmos_uuid == quantity_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "quantity_types.view", uuid=wf_quantity_type.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +class QuantityMasterView(FarmOSMasterView): + """ + Base class for Quantity views + """ + + farmos_quantity_type = None + + grid_columns = [ + "drupal_id", + "as_text", + "measure", + "value", + "unit", + "label", + ] + + sort_defaults = ("drupal_id", "desc") + + form_fields = [ + "measure", + "value", + "units", + "label", + "created", + "changed", + ] + + def get_farmos_api_includes(self): + return {"units"} + + def get_grid_data(self, **kwargs): + return ResourceData( + self.config, + self.farmos_client, + f"quantity--{self.farmos_quantity_type}", + include=",".join(self.get_farmos_api_includes()), + normalizer=self.normalize_quantity, + ) + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + + # as_text + g.set_renderer("as_text", self.render_as_text_for_grid) + + # measure + g.set_renderer("measure", self.render_measure_for_grid) + + # value + g.set_renderer("value", self.render_value_for_grid) + + # unit + g.set_renderer("unit", self.render_unit_for_grid) + + # changed + g.set_renderer("changed", "datetime") + + def render_as_text_for_grid(self, qty, field, value): + measure = qty["measure"].capitalize() + value = qty["value"]["decimal"] + units = qty["unit"]["name"] if qty["unit"] else "??" + return f"( {measure} ) {value} {units}" + + def render_measure_for_grid(self, qty, field, value): + return qty["measure"].capitalize() + + def render_unit_for_grid(self, qty, field, value): + unit = qty[field] + if not unit: + return "" + return unit["name"] + + def render_value_for_grid(self, qty, field, value): + return qty["value"]["decimal"] + + def get_instance(self): + quantity = self.farmos_client.resource.get_id( + "quantity", self.farmos_quantity_type, self.request.matchdict["uuid"] + ) + self.raw_json = quantity + + data = self.normalize_quantity(quantity["data"]) + + if relationships := quantity["data"].get("relationships"): + + # add units + if units := relationships.get("units"): + if units["data"]: + unit = self.farmos_client.resource.get_id( + "taxonomy_term", "unit", units["data"]["id"] + ) + data["units"] = { + "uuid": unit["data"]["id"], + "name": unit["data"]["attributes"]["name"], + } + + return data + + def get_instance_title(self, quantity): + return quantity["value"] + + def normalize_quantity(self, quantity, included={}): + + if created := quantity["attributes"]["created"]: + created = datetime.datetime.fromisoformat(created) + created = self.app.localtime(created) + + if changed := quantity["attributes"]["changed"]: + changed = datetime.datetime.fromisoformat(changed) + changed = self.app.localtime(changed) + + quantity_type_object = None + quantity_type_uuid = None + unit_object = None + unit_uuid = None + if relationships := quantity["relationships"]: + + if quantity_type := relationships["quantity_type"]["data"]: + quantity_type_uuid = quantity_type["id"] + quantity_type_object = { + "uuid": quantity_type_uuid, + "type": "quantity_type--quantity_type", + } + + if unit := relationships["units"]["data"]: + unit_uuid = unit["id"] + if unit := included.get(unit_uuid): + unit_object = { + "uuid": unit_uuid, + "type": "taxonomy_term--unit", + "name": unit["attributes"]["name"], + } + + return { + "uuid": quantity["id"], + "drupal_id": quantity["attributes"]["drupal_internal__id"], + "quantity_type": quantity_type_object, + "quantity_type_uuid": quantity_type_uuid, + "measure": quantity["attributes"]["measure"], + "value": quantity["attributes"]["value"], + "unit": unit_object, + "unit_uuid": unit_uuid, + "label": quantity["attributes"]["label"] or colander.null, + "created": created, + "changed": changed, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + + # created + f.set_node("created", WuttaDateTime(self.request)) + f.set_widget("created", WuttaDateTimeWidget(self.request)) + + # changed + f.set_node("changed", WuttaDateTime(self.request)) + f.set_widget("changed", WuttaDateTimeWidget(self.request)) + + # units + f.set_node("units", FarmOSUnitRef()) + + +class StandardQuantityView(QuantityMasterView): + """ + View for farmOS Standard Quantities + """ + + model_name = "farmos_standard_quantity" + model_title = "farmOS Standard Quantity" + model_title_plural = "farmOS Standard Quantities" + + route_prefix = "farmos_quantities_standard" + url_prefix = "/farmOS/quantities/standard" + + farmos_quantity_type = "standard" + + def get_xref_buttons(self, standard_quantity): + model = self.app.model + session = self.Session() + buttons = [] + + if wf_standard_quantity := ( + session.query(model.StandardQuantity) + .join(model.Quantity) + .filter(model.Quantity.farmos_uuid == standard_quantity["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "quantities_standard.view", uuid=wf_standard_quantity.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + QuantityTypeView = kwargs.get("QuantityTypeView", base["QuantityTypeView"]) + QuantityTypeView.defaults(config) + + StandardQuantityView = kwargs.get( + "StandardQuantityView", base["StandardQuantityView"] + ) + StandardQuantityView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/structure_types.py b/src/wuttafarm/web/views/farmos/structure_types.py new file mode 100644 index 0000000..b7e58d8 --- /dev/null +++ b/src/wuttafarm/web/views/farmos/structure_types.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS structure types +""" + +from wuttafarm.web.views.farmos import FarmOSMasterView + + +class StructureTypeView(FarmOSMasterView): + """ + Master view for Structure Types in farmOS. + """ + + model_name = "farmos_structure_type" + model_title = "farmOS Structure Type" + model_title_plural = "farmOS Structure Types" + + route_prefix = "farmos_structure_types" + url_prefix = "/farmOS/structure-types" + + grid_columns = [ + "label", + ] + + sort_defaults = "label" + + form_fields = [ + "label", + ] + + def get_grid_data(self, columns=None, session=None): + structure_types = self.farmos_client.resource.get( + "structure_type", "structure_type" + ) + return [self.normalize_structure_type(t) for t in structure_types["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # label + g.set_link("label") + g.set_searchable("label") + + def get_instance(self): + structure_type = self.farmos_client.resource.get_id( + "structure_type", "structure_type", self.request.matchdict["uuid"] + ) + self.raw_json = structure_type + return self.normalize_structure_type(structure_type["data"]) + + def get_instance_title(self, structure_type): + return structure_type["label"] + + def normalize_structure_type(self, structure_type): + return { + "uuid": structure_type["id"], + "drupal_id": structure_type["attributes"]["drupal_internal__id"], + "label": structure_type["attributes"]["label"], + } + + def get_xref_buttons(self, structure_type): + model = self.app.model + session = self.Session() + buttons = [] + + if wf_structure_type := ( + session.query(model.StructureType) + .filter(model.StructureType.farmos_uuid == structure_type["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "structure_types.view", uuid=wf_structure_type.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + StructureTypeView = kwargs.get("StructureTypeView", base["StructureTypeView"]) + StructureTypeView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/structures.py b/src/wuttafarm/web/views/farmos/structures.py new file mode 100644 index 0000000..b6dc97b --- /dev/null +++ b/src/wuttafarm/web/views/farmos/structures.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Structures +""" + +import datetime + +import colander + +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.farmos import FarmOSMasterView +from wuttafarm.web.forms.widgets import ImageWidget + + +class StructureView(FarmOSMasterView): + """ + View for farmOS Structures + """ + + model_name = "farmos_structure_asset" + model_title = "farmOS Structure" + model_title_plural = "farmOS Structures" + + route_prefix = "farmos_structure_assets" + url_prefix = "/farmOS/structures" + + farmos_refurl_path = "/assets/structure" + + grid_columns = [ + "name", + "archived", + "created", + "changed", + ] + + sort_defaults = "name" + + form_fields = [ + "name", + "archived", + "structure_type", + "is_location", + "is_fixed", + "notes", + "created", + "changed", + "raw_image_url", + "large_image_url", + "thumbnail_image_url", + "image", + ] + + def get_grid_data(self, columns=None, session=None): + structures = self.farmos_client.resource.get("asset", "structure") + return [self.normalize_structure(s) for s in structures["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + g.set_searchable("name") + + # created + g.set_renderer("created", "datetime") + + # changed + g.set_renderer("changed", "datetime") + + # archived + g.set_renderer("archived", "boolean") + + def get_instance(self): + structure = self.farmos_client.resource.get_id( + "asset", "structure", self.request.matchdict["uuid"] + ) + self.raw_json = structure + data = self.normalize_structure(structure["data"]) + + if relationships := structure["data"].get("relationships"): + + # add owners + if owner := relationships.get("owner"): + data["owners"] = [] + for owner_data in owner["data"]: + owner = self.farmos_client.resource.get_id( + "user", "user", owner_data["id"] + ) + data["owners"].append( + { + "uuid": owner["data"]["id"], + "display_name": owner["data"]["attributes"]["display_name"], + } + ) + + # add image urls + if image := relationships.get("image"): + if image["data"]: + image = self.farmos_client.resource.get_id( + "file", "file", image["data"][0]["id"] + ) + data["raw_image_url"] = self.app.get_farmos_url( + image["data"]["attributes"]["uri"]["url"] + ) + # nb. other styles available: medium, wide + data["large_image_url"] = image["data"]["attributes"][ + "image_style_uri" + ]["large"] + data["thumbnail_image_url"] = image["data"]["attributes"][ + "image_style_uri" + ]["thumbnail"] + + return data + + def get_instance_title(self, structure): + return structure["name"] + + def normalize_structure(self, structure): + + if created := structure["attributes"].get("created"): + created = datetime.datetime.fromisoformat(created) + created = self.app.localtime(created) + + if changed := structure["attributes"].get("changed"): + changed = datetime.datetime.fromisoformat(changed) + changed = self.app.localtime(changed) + + if self.farmos_4x: + archived = structure["attributes"]["archived"] + else: + archived = structure["attributes"]["status"] == "archived" + + return { + "uuid": structure["id"], + "drupal_id": structure["attributes"]["drupal_internal__id"], + "name": structure["attributes"]["name"], + "structure_type": structure["attributes"]["structure_type"], + "is_fixed": structure["attributes"]["is_fixed"], + "is_location": structure["attributes"]["is_location"], + "notes": structure["attributes"]["notes"] or colander.null, + "archived": archived, + "created": created, + "changed": changed, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + structure = f.model_instance + + # is_fixed + f.set_node("is_fixed", colander.Boolean()) + + # is_location + f.set_node("is_location", colander.Boolean()) + + # notes + f.set_widget("notes", "notes") + + # created + f.set_node("created", WuttaDateTime()) + f.set_widget("created", WuttaDateTimeWidget(self.request)) + + # changed + f.set_node("changed", WuttaDateTime()) + f.set_widget("changed", WuttaDateTimeWidget(self.request)) + + # archived + f.set_node("archived", colander.Boolean()) + + # image + if url := structure.get("large_image_url"): + f.set_widget("image", ImageWidget("structure image")) + f.set_default("image", url) + + def get_xref_buttons(self, structure): + model = self.app.model + session = self.Session() + + buttons = [ + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/asset/{structure['drupal_id']}"), + target="_blank", + icon_left="external-link-alt", + ), + ] + + if wf_structure := ( + session.query(model.StructureAsset) + .filter(model.StructureAsset.farmos_uuid == structure["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url( + "structure_assets.view", uuid=wf_structure.uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + StructureView = kwargs.get("StructureView", base["StructureView"]) + StructureView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/units.py b/src/wuttafarm/web/views/farmos/units.py new file mode 100644 index 0000000..397614d --- /dev/null +++ b/src/wuttafarm/web/views/farmos/units.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS units +""" + +from wuttafarm.web.views.farmos.master import TaxonomyMasterView + + +class UnitView(TaxonomyMasterView): + """ + Master view for Units in farmOS. + """ + + model_name = "farmos_unit" + model_title = "farmOS Unit" + model_title_plural = "farmOS Units" + + route_prefix = "farmos_units" + url_prefix = "/farmOS/units" + + farmos_taxonomy_type = "unit" + farmos_refurl_path = "/admin/structure/taxonomy/manage/unit/overview" + + def get_xref_buttons(self, unit): + buttons = super().get_xref_buttons(unit) + model = self.app.model + session = self.Session() + + if wf_unit := ( + session.query(model.Unit) + .filter(model.Unit.farmos_uuid == unit["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url("units.view", uuid=wf_unit.uuid), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + UnitView = kwargs.get("UnitView", base["UnitView"]) + UnitView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/farmos/users.py b/src/wuttafarm/web/views/farmos/users.py new file mode 100644 index 0000000..bb004ee --- /dev/null +++ b/src/wuttafarm/web/views/farmos/users.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +View for farmOS Users +""" + +import datetime + +import colander + +from wuttaweb.forms.schema import WuttaDateTime + +from wuttafarm.web.views.farmos import FarmOSMasterView + + +class UserView(FarmOSMasterView): + """ + Master view for Farm Animals + """ + + model_name = "farmos_user" + model_title = "farmOS User" + model_title_plural = "farmOS Users" + + route_prefix = "farmos_users" + url_prefix = "/farmOS/users" + + farmos_refurl_path = "/people" + + grid_columns = [ + "display_name", + ] + + sort_defaults = "display_name" + + form_fields = [ + "display_name", + "name", + "mail", + "timezone", + "created", + "changed", + ] + + def get_grid_data(self, columns=None, session=None): + users = self.farmos_client.resource.get("user", "user") + return [self.normalize_user(u) for u in users["data"]] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # display_name + g.set_link("display_name") + g.set_searchable("display_name") + + def get_instance(self): + user = self.farmos_client.resource.get_id( + "user", "user", self.request.matchdict["uuid"] + ) + self.raw_json = user + return self.normalize_user(user["data"]) + + def get_instance_title(self, user): + return user["display_name"] + + def normalize_user(self, user): + + if created := user["attributes"].get("created"): + created = datetime.datetime.fromisoformat(created) + created = self.app.localtime(created) + + if changed := user["attributes"].get("changed"): + changed = datetime.datetime.fromisoformat(changed) + changed = self.app.localtime(changed) + + return { + "uuid": user["id"], + "drupal_id": user["attributes"].get("drupal_internal__uid"), + "display_name": user["attributes"]["display_name"], + "name": user["attributes"].get("name") or colander.null, + "mail": user["attributes"].get("mail") or colander.null, + "timezone": user["attributes"].get("timezone") or colander.null, + "created": created, + "changed": changed, + } + + def configure_form(self, form): + f = form + super().configure_form(f) + user = f.model_instance + + # created + f.set_node("created", WuttaDateTime()) + + # changed + f.set_node("changed", WuttaDateTime()) + + def get_xref_buttons(self, user): + model = self.app.model + session = self.Session() + buttons = [] + + if drupal_id := user["drupal_id"]: + buttons.append( + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/user/{drupal_id}"), + target="_blank", + icon_left="external-link-alt", + ) + ) + + if wf_user := ( + session.query(model.WuttaFarmUser) + .filter(model.WuttaFarmUser.farmos_uuid == user["uuid"]) + .first() + ): + buttons.append( + self.make_button( + f"View {self.app.get_title()} record", + primary=True, + url=self.request.route_url("users.view", uuid=wf_user.uuid), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + base = globals() + + UserView = kwargs.get("UserView", base["UserView"]) + UserView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/groups.py b/src/wuttafarm/web/views/groups.py new file mode 100644 index 0000000..4331280 --- /dev/null +++ b/src/wuttafarm/web/views/groups.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Groups +""" + +from wuttafarm.web.views.assets import AssetMasterView +from wuttafarm.db.model import GroupAsset + + +class GroupView(AssetMasterView): + """ + Master view for Groups + """ + + model_class = GroupAsset + route_prefix = "group_assets" + url_prefix = "/assets/group" + + farmos_refurl_path = "/assets/group" + farmos_bundle = "group" + + grid_columns = [ + "thumbnail", + "drupal_id", + "asset_name", + "produces_eggs", + "archived", + ] + + form_fields = [ + "asset_name", + "notes", + "asset_type", + "produces_eggs", + "archived", + "drupal_id", + "farmos_uuid", + ] + + +def defaults(config, **kwargs): + base = globals() + + GroupView = kwargs.get("GroupView", base["GroupView"]) + GroupView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/land.py b/src/wuttafarm/web/views/land.py new file mode 100644 index 0000000..ca1f016 --- /dev/null +++ b/src/wuttafarm/web/views/land.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Land Types +""" + +from webhelpers2.html import HTML, tags + +from wuttafarm.db.model import LandType, LandAsset +from wuttafarm.web.views.assets import AssetTypeMasterView, AssetMasterView +from wuttafarm.web.forms.schema import LandTypeRef + + +class LandTypeView(AssetTypeMasterView): + """ + Master view for Land Types + """ + + model_class = LandType + route_prefix = "land_types" + url_prefix = "/land-types" + + grid_columns = [ + "name", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "drupal_id", + "farmos_uuid", + ] + + has_rows = True + row_model_class = LandAsset + rows_viewable = True + + row_grid_columns = [ + "asset_name", + "is_location", + "is_fixed", + "archived", + ] + + rows_sort_defaults = "asset_name" + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_xref_buttons(self, land_type): + buttons = super().get_xref_buttons(land_type) + + if land_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_land_types.view", uuid=land_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + def get_row_grid_data(self, land_type): + model = self.app.model + session = self.Session() + return ( + session.query(model.LandAsset) + .join(model.Asset) + .filter(model.LandAsset.land_type == land_type) + ) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + model = self.app.model + + # asset_name + g.set_link("asset_name") + g.set_sorter("asset_name", model.Asset.asset_name) + g.set_filter("asset_name", model.Asset.asset_name) + + # is_location + g.set_renderer("is_location", "boolean") + g.set_sorter("is_location", model.Asset.is_location) + g.set_filter("is_location", model.Asset.is_location) + + # is_fixed + g.set_renderer("is_fixed", "boolean") + g.set_sorter("is_fixed", model.Asset.is_fixed) + g.set_filter("is_fixed", model.Asset.is_fixed) + + # archived + g.set_renderer("archived", "boolean") + g.set_sorter("archived", model.Asset.archived) + g.set_filter("archived", model.Asset.archived) + + def get_row_action_url_view(self, land_asset, i): + return self.request.route_url("land_assets.view", uuid=land_asset.uuid) + + @classmethod + def defaults(cls, config): + """ """ + wutta_config = config.registry.settings.get("wutta_config") + app = wutta_config.get_app() + + if app.is_farmos_mirror(): + cls.creatable = False + cls.editable = False + cls.deletable = False + + cls._defaults(config) + + +class LandAssetView(AssetMasterView): + """ + Master view for Land Assets + """ + + model_class = LandAsset + route_prefix = "land_assets" + url_prefix = "/assets/land" + + farmos_bundle = "land" + farmos_refurl_path = "/assets/land" + + grid_columns = [ + "thumbnail", + "drupal_id", + "asset_name", + "land_type", + "parents", + "archived", + ] + + form_fields = [ + "asset_name", + "parents", + "notes", + "asset_type", + "land_type", + "is_location", + "is_fixed", + "archived", + "drupal_id", + "farmos_uuid", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + model = self.app.model + + # land_type + g.set_joiner("land_type", lambda q: q.join(model.LandType)) + g.set_sorter("land_type", model.LandType.name) + g.set_filter("land_type", model.LandType.name, label="Land Type Name") + + def configure_form(self, form): + f = form + super().configure_form(f) + land = f.model_instance + + # land_type + f.set_node("land_type", LandTypeRef(self.request)) + + +def defaults(config, **kwargs): + base = globals() + + LandTypeView = kwargs.get("LandTypeView", base["LandTypeView"]) + LandTypeView.defaults(config) + + LandAssetView = kwargs.get("LandAssetView", base["LandAssetView"]) + LandAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/logs.py b/src/wuttafarm/web/views/logs.py new file mode 100644 index 0000000..9c983b7 --- /dev/null +++ b/src/wuttafarm/web/views/logs.py @@ -0,0 +1,431 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Base views for Logs +""" + +from collections import OrderedDict + +import colander +from webhelpers2.html import tags, HTML + +from wuttaweb.forms.schema import WuttaDictEnum +from wuttaweb.db import Session +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views import WuttaFarmMasterView +from wuttafarm.db.model import LogType, Log +from wuttafarm.web.forms.schema import AssetRefs, LogQuantityRefs, OwnerRefs +from wuttafarm.util import get_log_type_enum + + +class LogTypeView(WuttaFarmMasterView): + """ + Master view for Log Types + """ + + model_class = LogType + route_prefix = "log_types" + url_prefix = "/log-types" + + grid_columns = [ + "name", + "description", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "drupal_id", + "farmos_uuid", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_xref_buttons(self, log_type): + buttons = super().get_xref_buttons(log_type) + + if log_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_log_types.view", uuid=log_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +class LogMasterView(WuttaFarmMasterView): + """ + Base class for Asset master views + """ + + farmos_entity_type = "log" + + labels = { + "message": "Log Name", + "locations": "Location", + "quantities": "Quantity", + } + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "message", + "assets", + "locations", + "quantities", + "is_group_assignment", + "owners", + ] + + sort_defaults = ("timestamp", "desc") + + filter_defaults = { + "message": {"active": True, "verb": "contains"}, + "status": {"active": True, "verb": "not_equal", "value": "abandoned"}, + } + + form_fields = [ + "message", + "timestamp", + "assets", + "groups", + "locations", + "quantities", + "notes", + "status", + "log_type", + "owners", + "is_movement", + "is_group_assignment", + "quick", + "drupal_id", + "farmos_uuid", + ] + + def get_query(self, session=None): + """ """ + model = self.app.model + model_class = self.get_model_class() + session = session or self.Session() + query = session.query(model_class) + if model_class is not model.Log: + query = query.join(model.Log) + return query + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + model = self.app.model + enum = self.app.enum + + # status + g.set_enum("status", enum.LOG_STATUS) + g.set_sorter("status", model.Log.status) + g.set_filter( + "status", + model.Log.status, + verbs=["equal", "not_equal"], + choices=enum.LOG_STATUS, + ) + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + g.set_sorter("drupal_id", model.Log.drupal_id) + g.set_filter("drupal_id", model.Log.drupal_id) + + # timestamp + g.set_renderer("timestamp", "date") + g.set_link("timestamp") + g.set_sorter("timestamp", model.Log.timestamp) + g.set_filter("timestamp", model.Log.timestamp) + + # message + g.set_link("message") + g.set_sorter("message", model.Log.message) + g.set_filter("message", model.Log.message) + + # assets + g.set_renderer("assets", self.render_assets_for_grid) + + # groups + g.set_renderer("groups", self.render_assets_for_grid) + + # locations + g.set_renderer("locations", self.render_assets_for_grid) + + # quantities + g.set_renderer("quantities", self.render_quantities_for_grid) + + # is_group_assignment + g.set_renderer("is_group_assignment", "boolean") + g.set_sorter("is_group_assignment", model.Log.is_group_assignment) + g.set_filter("is_group_assignment", model.Log.is_group_assignment) + + # owners + g.set_label("owners", "Owner") + g.set_renderer("owners", self.render_owners_for_grid) + + def render_assets_for_grid(self, log, field, value): + assets = getattr(log, field) + + if self.farmos_style_grid_links: + links = [] + for asset in assets: + url = self.request.route_url( + f"{asset.asset_type}_assets.view", uuid=asset.uuid + ) + links.append(tags.link_to(str(asset), url)) + return ", ".join(links) + + return ", ".join([str(a) for a in assets]) + + def render_quantities_for_grid(self, log, field, value): + quantities = getattr(log, field) or [] + items = [] + for qty in quantities: + items.append(HTML.tag("li", c=qty.render_as_text(self.config))) + return HTML.tag("ul", c=items) + + def render_owners_for_grid(self, log, field, value): + + if self.farmos_style_grid_links: + links = [] + for user in log.owners: + url = self.request.route_url("users.view", uuid=user.uuid) + links.append(tags.link_to(user.username, url)) + return ", ".join(links) + + return ", ".join([user.username for user in log.owners]) + + def grid_row_class(self, log, data, i): + if log.status == "pending": + return "has-background-warning" + if log.status == "abandoned": + return "has-background-danger" + return None + + def configure_form(self, form): + f = form + super().configure_form(f) + enum = self.app.enum + session = self.Session() + log = f.model_instance + + # timestamp + # TODO: the widget should be automatic (assn proxy field) + f.set_widget("timestamp", WuttaDateTimeWidget(self.request)) + if self.creating: + f.set_default("timestamp", self.app.make_utc()) + + # assets + if self.creating or self.editing: + f.remove("assets") # TODO: need to support this + else: + f.set_node("assets", AssetRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("assets", log.assets) + + # groups + if self.creating or self.editing: + f.remove("groups") # TODO: need to support this + else: + f.set_node("groups", AssetRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("groups", log.groups) + + # locations + if self.creating or self.editing: + f.remove("locations") # TODO: need to support this + else: + f.set_node("locations", AssetRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("locations", log.locations) + + # log_type + if self.creating: + f.remove("log_type") + else: + f.set_node( + "log_type", + WuttaDictEnum( + self.request, get_log_type_enum(self.config, session=session) + ), + ) + f.set_readonly("log_type") + + # quantities + if self.creating or self.editing: + f.remove("quantities") # TODO: need to support this + else: + f.set_node("quantities", LogQuantityRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("quantities", log.quantities) + + # notes + f.set_widget("notes", "notes") + + # owners + if self.creating or self.editing: + f.remove("owners") # TODO: need to support this + else: + f.set_node("owners", OwnerRefs(self.request)) + # nb. must explicity declare value for non-standard field + f.set_default("owners", log.owners) + + # status + f.set_node("status", WuttaDictEnum(self.request, enum.LOG_STATUS)) + + # is_movement + f.set_node("is_movement", colander.Boolean()) + + # is_group_assignment + f.set_node("is_group_assignment", colander.Boolean()) + + # quick + f.set_readonly("quick") # TODO + + def objectify(self, form): + log = super().objectify(form) + + if self.creating: + model_class = self.get_model_class() + log.log_type = self.get_farmos_log_type() + + return log + + def get_farmos_url(self, log): + return self.app.get_farmos_url(f"/log/{log.drupal_id}") + + def get_farmos_log_type(self): + return self.model_class.__wutta_hint__["farmos_log_type"] + + def get_xref_buttons(self, log): + buttons = super().get_xref_buttons(log) + + if log.farmos_uuid: + log_type = self.get_farmos_log_type() + route = f"farmos_logs_{log_type}.view" + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url(route, uuid=log.farmos_uuid), + icon_left="eye", + ) + ) + + return buttons + + def get_version_joins(self): + """ + We override this to declare the relationship between the + view's data model (which is some type of log table) and the + canonical ``Log`` model, so the revision history views include + transactions which reference either version table. + + See also parent method, + :meth:`~wuttaweb:wuttaweb.views.master.MasterView.get_version_joins()` + """ + model = self.app.model + return super().get_version_joins() + [ + model.Log, + (model.LogAsset, "log_uuid", "uuid"), + ] + + +class AllLogView(LogMasterView): + """ + Master view for All Logs + """ + + model_class = Log + route_prefix = "log" + url_prefix = "/logs" + + farmos_refurl_path = "/logs" + + viewable = False + creatable = False + editable = False + deletable = False + model_is_versioned = False + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "message", + "log_type", + "assets", + "locations", + "quantities", + "groups", + "is_group_assignment", + "owners", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + session = self.Session() + + # log_type + g.set_enum("log_type", get_log_type_enum(self.config, session=session)) + + # view action links to final log record + def log_url(log, i): + return self.request.route_url(f"logs_{log.log_type}.view", uuid=log.uuid) + + g.add_action("view", icon="eye", url=log_url) + + +def defaults(config, **kwargs): + base = globals() + + LogTypeView = kwargs.get("LogTypeView", base["LogTypeView"]) + LogTypeView.defaults(config) + + AllLogView = kwargs.get("AllLogView", base["AllLogView"]) + AllLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/logs_activity.py b/src/wuttafarm/web/views/logs_activity.py new file mode 100644 index 0000000..19f8782 --- /dev/null +++ b/src/wuttafarm/web/views/logs_activity.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Activity Logs +""" + +from wuttafarm.web.views.logs import LogMasterView +from wuttafarm.db.model import ActivityLog + + +class ActivityLogView(LogMasterView): + """ + Master view for Activity Logs + """ + + model_class = ActivityLog + route_prefix = "logs_activity" + url_prefix = "/logs/activity" + + farmos_bundle = "activity" + farmos_refurl_path = "/logs/activity" + + +def defaults(config, **kwargs): + base = globals() + + ActivityLogView = kwargs.get("ActivityLogView", base["ActivityLogView"]) + ActivityLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/logs_harvest.py b/src/wuttafarm/web/views/logs_harvest.py new file mode 100644 index 0000000..e38c6d7 --- /dev/null +++ b/src/wuttafarm/web/views/logs_harvest.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Harvest Logs +""" + +from wuttafarm.web.views.logs import LogMasterView +from wuttafarm.db.model import HarvestLog + + +class HarvestLogView(LogMasterView): + """ + Master view for Harvest Logs + """ + + model_class = HarvestLog + route_prefix = "logs_harvest" + url_prefix = "/logs/harvest" + + farmos_bundle = "harvest" + farmos_refurl_path = "/logs/harvest" + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "message", + "assets", + "quantities", + "owners", + ] + + +def defaults(config, **kwargs): + base = globals() + + HarvestLogView = kwargs.get("HarvestLogView", base["HarvestLogView"]) + HarvestLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/logs_medical.py b/src/wuttafarm/web/views/logs_medical.py new file mode 100644 index 0000000..d00d647 --- /dev/null +++ b/src/wuttafarm/web/views/logs_medical.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Medical Logs +""" + +from wuttafarm.web.views.logs import LogMasterView +from wuttafarm.db.model import MedicalLog + + +class MedicalLogView(LogMasterView): + """ + Master view for Medical Logs + """ + + model_class = MedicalLog + route_prefix = "logs_medical" + url_prefix = "/logs/medical" + + farmos_bundle = "medical" + farmos_refurl_path = "/logs/medical" + + labels = { + "vet": "Veterinarian", + } + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "message", + "assets", + "vet", + "owners", + ] + + def configure_form(self, f): + super().configure_form(f) + + # vet + f.fields.insert_after("timestamp", "vet") + + +def defaults(config, **kwargs): + base = globals() + + MedicalLogView = kwargs.get("MedicalLogView", base["MedicalLogView"]) + MedicalLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/logs_observation.py b/src/wuttafarm/web/views/logs_observation.py new file mode 100644 index 0000000..6e283ae --- /dev/null +++ b/src/wuttafarm/web/views/logs_observation.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Observation Logs +""" + +from wuttafarm.web.views.logs import LogMasterView +from wuttafarm.db.model import ObservationLog + + +class ObservationLogView(LogMasterView): + """ + Master view for Observation Logs + """ + + model_class = ObservationLog + route_prefix = "logs_observation" + url_prefix = "/logs/observation" + + farmos_bundle = "observation" + farmos_refurl_path = "/logs/observation" + + grid_columns = [ + "status", + "drupal_id", + "timestamp", + "message", + "assets", + "locations", + "groups", + "is_group_assignment", + "owners", + ] + + +def defaults(config, **kwargs): + base = globals() + + ObservationLogView = kwargs.get("ObservationLogView", base["ObservationLogView"]) + ObservationLogView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/master.py b/src/wuttafarm/web/views/master.py new file mode 100644 index 0000000..747cdc5 --- /dev/null +++ b/src/wuttafarm/web/views/master.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Base class for WuttaFarm master views +""" + +from webhelpers2.html import tags + +from wuttaweb.views import MasterView + +from wuttafarm.web.util import use_farmos_style_grid_links, get_farmos_client_for_user + + +class WuttaFarmMasterView(MasterView): + """ + Base class for WuttaFarm master views + """ + + farmos_refurl_path = None + farmos_entity_type = None + farmos_bundle = None + + labels = { + "farmos_uuid": "farmOS UUID", + "drupal_id": "Drupal ID", + "image_url": "Image URL", + "thumbnail_url": "Thumbnail URL", + } + + row_labels = { + "farmos_uuid": "farmOS UUID", + "drupal_id": "Drupal ID", + "image_url": "Image URL", + "thumbnail_url": "Thumbnail URL", + } + + def __init__(self, request, context=None): + super().__init__(request, context=context) + self.farmos_style_grid_links = use_farmos_style_grid_links(self.config) + + def get_farmos_url(self, obj): + return None + + def get_template_context(self, context): + + if self.listing and self.farmos_refurl_path: + context["farmos_refurl"] = self.app.get_farmos_url(self.farmos_refurl_path) + + return context + + def render_grid_thumbnail(self, obj, field, value): + if obj.thumbnail_url: + return tags.image( + obj.thumbnail_url, f"thumbnail for {self.get_model_title()}" + ) + return None + + def get_xref_buttons(self, obj): + url = self.get_farmos_url(obj) + if url: + return [ + self.make_button( + "View in farmOS", + primary=True, + url=url, + target="_blank", + icon_left="external-link-alt", + ) + ] + return [] + + def configure_form(self, form): + """ """ + f = form + super().configure_form(f) + + # farmos_uuid + if self.creating: + f.remove("farmos_uuid") + else: + f.set_readonly("farmos_uuid") + + # drupal_id + if self.creating: + f.remove("drupal_id") + else: + f.set_readonly("drupal_id") + + def persist(self, obj, session=None): + + # save per usual + super().persist(obj, session) + + # maybe also sync change to farmOS + if self.app.is_farmos_mirror(): + client = get_farmos_client_for_user(self.request) + self.app.auto_sync_to_farmos(obj, client=client, require=False) + + def get_farmos_entity_type(self): + if self.farmos_entity_type: + return self.farmos_entity_type + raise NotImplementedError( + f"must define {self.__class__.__name__}.farmos_entity_type" + ) + + def get_farmos_bundle(self): + if self.farmos_bundle: + return self.farmos_bundle + raise NotImplementedError( + f"must define {self.__class__.__name__}.farmos_bundle" + ) + + def delete_instance(self, obj): + + # save farmOS UUID if we need it + farmos_uuid = None + if hasattr(obj, "farmos_uuid") and self.app.is_farmos_mirror(): + farmos_uuid = obj.farmos_uuid + + # delete per usual + super().delete_instance(obj) + + # maybe delete from farmOS also + if farmos_uuid: + entity_type = self.get_farmos_entity_type() + bundle = self.get_farmos_bundle() + client = get_farmos_client_for_user(self.request) + client.resource.delete(entity_type, bundle, farmos_uuid) diff --git a/src/wuttafarm/web/views/plants.py b/src/wuttafarm/web/views/plants.py new file mode 100644 index 0000000..a114e07 --- /dev/null +++ b/src/wuttafarm/web/views/plants.py @@ -0,0 +1,309 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Plants +""" + +from webhelpers2.html import tags + +from wuttaweb.forms.schema import WuttaDictEnum +from wuttaweb.util import get_form_data + +from wuttafarm.db.model import PlantType, PlantAsset +from wuttafarm.web.views.assets import AssetTypeMasterView, AssetMasterView +from wuttafarm.web.forms.schema import PlantTypeRefs +from wuttafarm.web.forms.widgets import ImageWidget +from wuttafarm.web.util import get_farmos_client_for_user + + +class PlantTypeView(AssetTypeMasterView): + """ + Master view for Plant Types + """ + + model_class = PlantType + route_prefix = "plant_types" + url_prefix = "/plant-types" + + farmos_entity_type = "taxonomy_term" + farmos_bundle = "plant_type" + farmos_refurl_path = "/admin/structure/taxonomy/manage/plant_type/overview" + + grid_columns = [ + "name", + "description", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "drupal_id", + "farmos_uuid", + ] + + has_rows = True + row_model_class = PlantAsset + rows_viewable = True + + row_grid_columns = [ + "asset_name", + "archived", + ] + + rows_sort_defaults = "asset_name" + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_farmos_url(self, plant_type): + return self.app.get_farmos_url(f"/taxonomy/term/{plant_type.drupal_id}") + + def get_xref_buttons(self, plant_type): + buttons = super().get_xref_buttons(plant_type) + + if plant_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_plant_types.view", uuid=plant_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + def delete(self): + plant_type = self.get_instance() + + if plant_type._plant_assets: + self.request.session.flash( + "Cannot delete plant type which is still referenced by plant assets.", + "warning", + ) + url = self.get_action_url("view", plant_type) + return self.redirect(self.request.get_referrer(default=url)) + + return super().delete() + + def get_row_grid_data(self, plant_type): + model = self.app.model + session = self.Session() + return ( + session.query(model.PlantAsset) + .join(model.Asset) + .outerjoin(model.PlantAssetPlantType) + .filter(model.PlantAssetPlantType.plant_type == plant_type) + ) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + model = self.app.model + + # asset_name + g.set_link("asset_name") + g.set_sorter("asset_name", model.Asset.asset_name) + g.set_filter("asset_name", model.Asset.asset_name) + + # archived + g.set_renderer("archived", "boolean") + g.set_sorter("archived", model.Asset.archived) + g.set_filter("archived", model.Asset.archived) + + def get_row_action_url_view(self, plant, i): + return self.request.route_url("plant_assets.view", uuid=plant.uuid) + + def ajax_create(self): + """ + AJAX view to create a new plant type. + """ + model = self.app.model + session = self.Session() + data = get_form_data(self.request) + + name = data.get("name") + if not name: + return {"error": "Name is required"} + + plant_type = model.PlantType(name=name) + session.add(plant_type) + session.flush() + + if self.app.is_farmos_mirror(): + client = get_farmos_client_for_user(self.request) + self.app.auto_sync_to_farmos(plant_type, client=client) + + return { + "uuid": plant_type.uuid.hex, + "name": plant_type.name, + "farmos_uuid": plant_type.farmos_uuid.hex, + "drupal_id": plant_type.drupal_id, + } + + @classmethod + def defaults(cls, config): + """ """ + cls._defaults(config) + cls._plant_type_defaults(config) + + @classmethod + def _plant_type_defaults(cls, config): + route_prefix = cls.get_route_prefix() + permission_prefix = cls.get_permission_prefix() + url_prefix = cls.get_url_prefix() + + # ajax_create + config.add_route(f"{route_prefix}.ajax_create", f"{url_prefix}/ajax/new") + config.add_view( + cls, + attr="ajax_create", + route_name=f"{route_prefix}.ajax_create", + permission=f"{permission_prefix}.create", + renderer="json", + ) + + +class PlantAssetView(AssetMasterView): + """ + Master view for Plant Assets + """ + + model_class = PlantAsset + route_prefix = "plant_assets" + url_prefix = "/assets/plant" + + farmos_bundle = "plant" + farmos_refurl_path = "/assets/plant" + + labels = { + "plant_types": "Crop/Variety", + } + + grid_columns = [ + "thumbnail", + "drupal_id", + "asset_name", + "plant_types", + "season", + "archived", + ] + + form_fields = [ + "asset_name", + "plant_types", + "season", + "notes", + "asset_type", + "archived", + "drupal_id", + "farmos_uuid", + "thumbnail_url", + "image_url", + "thumbnail", + "image", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # plant_types + g.set_renderer("plant_types", self.render_plant_types_for_grid) + + def render_plant_types_for_grid(self, plant, field, value): + plant_types = plant._plant_types + + if self.farmos_style_grid_links: + links = [] + for plant_type in plant_types: + plant_type = plant_type.plant_type + url = self.request.route_url("plant_types.view", uuid=plant_type.uuid) + links.append(tags.link_to(str(plant_type), url)) + return ", ".join(links) + + return ", ".join([str(pt.plant_type) for pt in plant_types]) + + def configure_form(self, form): + f = form + super().configure_form(f) + enum = self.app.enum + plant = f.model_instance + + # plant_types + f.set_node("plant_types", PlantTypeRefs(self.request)) + if not self.creating: + # nb. must explcitly declare value for non-standard field + f.set_default("plant_types", [pt.uuid for pt in plant.plant_types]) + + # season + if self.creating or self.editing: + f.remove("season") # TODO: add support for this + + def objectify(self, form): + model = self.app.model + session = self.Session() + plant = super().objectify(form) + data = form.validated + + current = [pt.uuid for pt in plant.plant_types] + desired = data["plant_types"] + + for uuid in desired: + if uuid not in current: + plant_type = session.get(model.PlantType, uuid) + assert plant_type + plant.plant_types.append(plant_type) + + for uuid in current: + if uuid not in desired: + plant_type = session.get(model.PlantType, uuid) + assert plant_type + plant.plant_types.remove(plant_type) + + return plant + + +def defaults(config, **kwargs): + base = globals() + + PlantTypeView = kwargs.get("PlantTypeView", base["PlantTypeView"]) + PlantTypeView.defaults(config) + + PlantAssetView = kwargs.get("PlantAssetView", base["PlantAssetView"]) + PlantAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/quantities.py b/src/wuttafarm/web/views/quantities.py new file mode 100644 index 0000000..d4112cf --- /dev/null +++ b/src/wuttafarm/web/views/quantities.py @@ -0,0 +1,301 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Quantities +""" + +from collections import OrderedDict + +from wuttaweb.db import Session + +from wuttafarm.web.views import WuttaFarmMasterView +from wuttafarm.db.model import QuantityType, Quantity, StandardQuantity +from wuttafarm.web.forms.schema import UnitRef, LogRef + + +def get_quantity_type_enum(config): + app = config.get_app() + model = app.model + session = Session() + quantity_types = OrderedDict() + query = session.query(model.QuantityType).order_by(model.QuantityType.name) + for quantity_type in query: + quantity_types[quantity_type.drupal_id] = quantity_type.name + return quantity_types + + +class QuantityTypeView(WuttaFarmMasterView): + """ + Master view for Quantity Types + """ + + model_class = QuantityType + route_prefix = "quantity_types" + url_prefix = "/quantity-types" + + grid_columns = [ + "name", + "description", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "drupal_id", + "farmos_uuid", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_xref_buttons(self, quantity_type): + buttons = super().get_xref_buttons(quantity_type) + + if quantity_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_quantity_types.view", uuid=quantity_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +class QuantityMasterView(WuttaFarmMasterView): + """ + Base class for Quantity master views + """ + + grid_columns = [ + "drupal_id", + "as_text", + "quantity_type", + "measure", + "value", + "units", + "label", + ] + + sort_defaults = ("drupal_id", "desc") + + form_fields = [ + "quantity_type", + "as_text", + "measure", + "value", + "units", + "label", + "log", + "drupal_id", + "farmos_uuid", + ] + + def get_query(self, session=None): + """ """ + model = self.app.model + model_class = self.get_model_class() + session = session or self.Session() + query = session.query(model_class) + if model_class is not model.Quantity: + query = query.join(model.Quantity) + query = query.join(model.Measure).join(model.Unit) + return query + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + model = self.app.model + model_class = self.get_model_class() + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + g.set_sorter("drupal_id", model.Quantity.drupal_id) + + # as_text + g.set_renderer("as_text", self.render_as_text_for_grid) + g.set_link("as_text") + + # quantity_type + if model_class is not model.Quantity: + g.remove("quantity_type") + else: + g.set_enum("quantity_type", get_quantity_type_enum(self.config)) + + # measure + g.set_sorter("measure", model.Measure.name) + + # value + g.set_renderer("value", self.render_value_for_grid) + + # units + g.set_sorter("units", model.Unit.name) + + # label + g.set_sorter("label", model.Quantity.label) + + # view action links to final quantity record + if model_class is model.Quantity: + + def quantity_url(quantity, i): + return self.request.route_url( + f"quantities_{quantity.quantity_type_id}.view", uuid=quantity.uuid + ) + + g.add_action("view", icon="eye", url=quantity_url) + + def render_as_text_for_grid(self, quantity, field, value): + return quantity.render_as_text(self.config) + + def render_value_for_grid(self, quantity, field, value): + value = quantity.value_numerator / quantity.value_denominator + return self.app.render_quantity(value) + + def get_instance_title(self, quantity): + return quantity.render_as_text(self.config) + + def configure_form(self, form): + f = form + super().configure_form(f) + quantity = form.model_instance + + # as_text + if self.creating or self.editing: + f.remove("as_text") + else: + f.set_default("as_text", quantity.render_as_text(self.config)) + + # quantity_type + if self.creating: + f.remove("quantity_type") + else: + f.set_readonly("quantity_type") + f.set_default("quantity_type", quantity.quantity_type.name) + + # measure + if self.creating: + f.remove("measure") + else: + f.set_readonly("measure") + f.set_default("measure", quantity.measure.name) + + # value + if self.creating: + f.remove("value") + else: + value = quantity.value_numerator / quantity.value_denominator + value = self.app.render_quantity(value) + f.set_default( + "value", + f"{value} ({quantity.value_numerator} / {quantity.value_denominator})", + ) + + # units + if self.creating: + f.remove("units") + else: + f.set_readonly("units") + f.set_node("units", UnitRef(self.request)) + # TODO: ugh + f.set_default("units", quantity.quantity.units) + + # log + if self.creating or self.editing: + f.remove("log") + else: + f.set_node("log", LogRef(self.request)) + f.set_default("log", quantity.log) + + def get_xref_buttons(self, quantity): + buttons = super().get_xref_buttons(quantity) + + if quantity.farmos_uuid: + url = self.request.route_url( + f"farmos_quantities_{quantity.quantity_type_id}.view", + uuid=quantity.farmos_uuid, + ) + buttons.append( + self.make_button( + "View farmOS record", primary=True, url=url, icon_left="eye" + ) + ) + + return buttons + + +class AllQuantityView(QuantityMasterView): + """ + Master view for All Quantities + """ + + model_class = Quantity + route_prefix = "quantities" + url_prefix = "/quantities" + + viewable = False + creatable = False + editable = False + deletable = False + model_is_versioned = False + + +class StandardQuantityView(QuantityMasterView): + """ + Master view for Standard Quantities + """ + + model_class = StandardQuantity + route_prefix = "quantities_standard" + url_prefix = "/quantities/standard" + + +def defaults(config, **kwargs): + base = globals() + + QuantityTypeView = kwargs.get("QuantityTypeView", base["QuantityTypeView"]) + QuantityTypeView.defaults(config) + + AllQuantityView = kwargs.get("AllQuantityView", base["AllQuantityView"]) + AllQuantityView.defaults(config) + + StandardQuantityView = kwargs.get( + "StandardQuantityView", base["StandardQuantityView"] + ) + StandardQuantityView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/quick/__init__.py b/src/wuttafarm/web/views/quick/__init__.py new file mode 100644 index 0000000..8423b0d --- /dev/null +++ b/src/wuttafarm/web/views/quick/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Quick Form views for farmOS +""" + +from .base import QuickFormView + + +def includeme(config): + + # perm group + config.add_wutta_permission_group("quick", "Quick Forms", overwrite=False) + + # quick form views + config.include("wuttafarm.web.views.quick.eggs") diff --git a/src/wuttafarm/web/views/quick/base.py b/src/wuttafarm/web/views/quick/base.py new file mode 100644 index 0000000..059ac01 --- /dev/null +++ b/src/wuttafarm/web/views/quick/base.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Base class for Quick Form views +""" + +import logging + +from pyramid.renderers import render_to_response + +from wuttaweb.views import View +from wuttaweb.db import Session + +from wuttafarm.web.util import get_farmos_client_for_user + + +log = logging.getLogger(__name__) + + +class QuickFormView(View): + """ + Base class for quick form views. + """ + + Session = Session + + def __init__(self, request, context=None): + super().__init__(request, context=context) + self.farmos_client = get_farmos_client_for_user(self.request) + self.farmos_4x = self.app.is_farmos_4x(self.farmos_client) + self.normal = self.app.get_normalizer(self.farmos_client) + + @classmethod + def get_route_slug(cls): + return cls.route_slug + + @classmethod + def get_url_slug(cls): + return cls.url_slug + + @classmethod + def get_form_title(cls): + return cls.form_title + + def __call__(self): + form = self.make_quick_form() + + if form.validate(): + try: + result = self.save_quick_form(form) + except Exception as err: + log.warning("failed to save 'edit' form", exc_info=True) + self.request.session.flash( + f"Save failed: {self.app.render_error(err)}", "error" + ) + else: + return self.redirect_after_save(result) + + return self.render_to_response({"form": form}) + + def make_quick_form(self): + raise NotImplementedError + + def save_quick_form(self, form): + raise NotImplementedError + + def redirect_after_save(self, result): + return self.redirect(self.request.current_route_url()) + + def render_to_response(self, context): + + defaults = { + "index_title": "Quick Form", + "form_title": self.get_form_title(), + "help_text": self.__doc__.strip(), + } + + defaults.update(context) + context = defaults + + # supplement context further if needed + context = self.get_template_context(context) + + page_templates = self.get_page_templates() + mako_path = page_templates[0] + try: + render_to_response(mako_path, context, request=self.request) + except IOError: + + # try one or more fallback templates + for fallback in page_templates[1:]: + try: + return render_to_response(fallback, context, request=self.request) + except IOError: + pass + + # if we made it all the way here, then we found no + # templates at all, in which case re-attempt the first and + # let that error raise on up + return render_to_response(mako_path, context, request=self.request) + + def get_page_templates(self): + route_slug = self.get_route_slug() + page_templates = [f"/quick/{route_slug}.mako"] + page_templates.extend(self.get_fallback_templates()) + return page_templates + + def get_fallback_templates(self): + return ["/quick/form.mako"] + + def get_template_context(self, context): + return context + + @classmethod + def defaults(cls, config): + cls._defaults(config) + + @classmethod + def _defaults(cls, config): + route_slug = cls.get_route_slug() + url_slug = cls.get_url_slug() + form_title = cls.get_form_title() + + config.add_wutta_permission("quick", f"quick.{route_slug}", form_title) + config.add_route(f"quick.{route_slug}", f"/quick/{url_slug}") + config.add_view( + cls, route_name=f"quick.{route_slug}", permission=f"quick.{route_slug}" + ) diff --git a/src/wuttafarm/web/views/quick/eggs.py b/src/wuttafarm/web/views/quick/eggs.py new file mode 100644 index 0000000..8aae46e --- /dev/null +++ b/src/wuttafarm/web/views/quick/eggs.py @@ -0,0 +1,355 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Quick Form for "Eggs" +""" + +import json + +import colander +from deform.widget import SelectWidget + +from farmOS.subrequests import Action, Subrequest, SubrequestsBlueprint, Format + +from wuttaweb.forms.schema import WuttaDateTime +from wuttaweb.forms.widgets import WuttaDateTimeWidget + +from wuttafarm.web.views.quick import QuickFormView + + +class EggsQuickForm(QuickFormView): + """ + Use this form to record an egg harvest. A harvest log will be + created with standard details filled in. + """ + + form_title = "Eggs" + route_slug = "eggs" + url_slug = "eggs" + + _layer_assets = None + + # TODO: make this configurable? + unit_name = "egg(s)" + + def make_quick_form(self): + f = self.make_form( + fields=[ + "timestamp", + "count", + "asset", + "notes", + ], + labels={ + "timestamp": "Date", + "count": "Quantity", + "asset": "Layer Asset", + }, + ) + + # timestamp + f.set_node("timestamp", WuttaDateTime()) + f.set_widget("timestamp", WuttaDateTimeWidget(self.request)) + f.set_default("timestamp", self.app.make_utc()) + + # count + f.set_node("count", colander.Integer()) + + # asset + assets = self.get_layer_assets() + values = [(a["uuid"], a["name"]) for a in assets] + f.set_widget("asset", SelectWidget(values=values)) + if len(assets) == 1: + f.set_default("asset", assets[0]["uuid"]) + + # notes + f.set_widget("notes", "notes") + f.set_required("notes", False) + + return f + + def get_layer_assets(self): + if self._layer_assets is not None: + return self._layer_assets + + if self.app.is_farmos_wrapper(): + assets = self.get_layer_assets_from_farmos() + else: + assets = self.get_layer_assets_from_wuttafarm() + + assets.sort(key=lambda a: a["name"]) + self._layer_assets = assets + return assets + + def get_layer_assets_from_wuttafarm(self): + model = self.app.model + session = self.Session() + assets = [] + + def normalize(asset): + asset_type = asset.__wutta_hint__["farmos_asset_type"] + return { + "uuid": str(asset.farmos_uuid), + "name": asset.asset_name, + "type": f"asset--{asset_type}", + } + + query = ( + session.query(model.AnimalAsset) + .join(model.Asset) + .filter(model.AnimalAsset.produces_eggs == True) + .order_by(model.Asset.asset_name) + ) + assets.extend([normalize(a) for a in query]) + + query = ( + session.query(model.GroupAsset) + .join(model.Asset) + .filter(model.GroupAsset.produces_eggs == True) + .order_by(model.Asset.asset_name) + ) + assets.extend([normalize(a) for a in query]) + + return assets + + def get_layer_assets_from_farmos(self): + assets = [] + params = { + "filter[produces_eggs]": 1, + "sort": "name", + } + + def normalize(asset): + return { + "uuid": asset["id"], + "name": asset["attributes"]["name"], + "type": asset["type"], + } + + result = self.farmos_client.asset.get("animal", params=params) + assets.extend([normalize(a) for a in result["data"]]) + + result = self.farmos_client.asset.get("group", params=params) + assets.extend([normalize(a) for a in result["data"]]) + + return assets + + def save_quick_form(self, form): + + if self.app.is_farmos_wrapper(): + return self.save_to_farmos(form) + + return self.save_to_wuttafarm(form) + + def save_to_farmos(self, form): + data = form.validated + + assets = self.get_layer_assets() + assets = {a["uuid"]: a for a in assets} + asset = assets[data["asset"]] + + # TODO: make this configurable? + unit_name = self.unit_name + + unit = {"data": {"type": "taxonomy_term--unit"}} + new_unit = None + + result = self.farmos_client.resource.get( + "taxonomy_term", + "unit", + params={ + "filter[name]": unit_name, + }, + ) + if result["data"]: + unit["data"]["id"] = result["data"][0]["id"] + else: + payload = dict(unit) + payload["data"]["attributes"] = {"name": unit_name} + new_unit = Subrequest( + action=Action.create, + requestId="create-unit", + endpoint="api/taxonomy_term/unit", + body=payload, + ) + unit["data"]["id"] = "{{create-unit.body@$.data.id}}" + + quantity = { + "data": { + "type": "quantity--standard", + "attributes": { + "measure": "count", + "value": { + "numerator": data["count"], + "denominator": 1, + }, + }, + "relationships": { + "units": unit, + }, + }, + } + + kw = {} + if new_unit: + kw["waitFor"] = ["create-unit"] + new_quantity = Subrequest( + action=Action.create, + requestId="create-quantity", + endpoint="api/quantity/standard", + body=quantity, + **kw, + ) + + notes = None + if data["notes"]: + notes = {"value": data["notes"]} + + log = { + "data": { + "type": "log--harvest", + "attributes": { + "name": f"Collected {data['count']} {unit_name}", + "timestamp": self.app.localtime(data["timestamp"]).timestamp(), + "notes": notes, + "quick": ["eggs"], + }, + "relationships": { + "asset": { + "data": [ + { + "id": asset["uuid"], + "type": asset["type"], + }, + ], + }, + "quantity": { + "data": [ + { + "id": "{{create-quantity.body@$.data.id}}", + "type": "quantity--standard", + }, + ], + }, + }, + }, + } + + new_log = Subrequest( + action=Action.create, + requestId="create-log", + waitFor=["create-quantity"], + endpoint="api/log/harvest", + body=log, + ) + + blueprints = [new_quantity, new_log] + if new_unit: + blueprints.insert(0, new_unit) + blueprint = SubrequestsBlueprint.parse_obj(blueprints) + response = self.farmos_client.subrequests.send(blueprint, format=Format.json) + + log = json.loads(response["create-log#body{0}"]["body"]) + + if self.app.is_farmos_mirror(): + if new_unit: + unit = json.loads(response["create-unit"]["body"]) + self.app.auto_sync_from_farmos( + unit["data"], "Unit", client=self.farmos_client + ) + quantity = json.loads(response["create-quantity"]["body"]) + self.app.auto_sync_from_farmos( + quantity["data"], "StandardQuantity", client=self.farmos_client + ) + self.app.auto_sync_from_farmos( + log["data"], "HarvestLog", client=self.farmos_client + ) + + return log + + def save_to_wuttafarm(self, form): + model = self.app.model + session = self.Session() + data = form.validated + + asset = ( + session.query(model.Asset) + .filter(model.Asset.farmos_uuid == data["asset"]) + .one() + ) + + # TODO: make this configurable? + unit_name = self.unit_name + + new_unit = False + unit = session.query(model.Unit).filter(model.Unit.name == unit_name).first() + if not unit: + unit = model.Unit(name=unit_name) + session.add(unit) + new_unit = True + + quantity = model.StandardQuantity( + quantity_type_id="standard", + measure_id="count", + value_numerator=data["count"], + value_denominator=1, + units=unit, + ) + session.add(quantity) + + log = model.HarvestLog( + log_type="harvest", + message=f"Collected {data['count']} {unit_name}", + timestamp=self.app.make_utc(data["timestamp"]), + notes=data["notes"] or None, + quick="eggs", + status="done", + ) + session.add(log) + log.assets.append(asset) + log.quantities.append(quantity.quantity) + log.owners.append(self.request.user) + session.flush() + + if self.app.is_farmos_mirror(): + if new_unit: + self.app.auto_sync_to_farmos(unit, client=self.farmos_client) + self.app.auto_sync_to_farmos(quantity, client=self.farmos_client) + self.app.auto_sync_to_farmos(log, client=self.farmos_client) + + return log + + def redirect_after_save(self, log): + model = self.app.model + + if isinstance(log, model.HarvestLog): + return self.redirect( + self.request.route_url("logs_harvest.view", uuid=log.uuid) + ) + + return self.redirect( + self.request.route_url("farmos_logs_harvest.view", uuid=log["data"]["id"]) + ) + + +def includeme(config): + EggsQuickForm.defaults(config) diff --git a/src/wuttafarm/web/views/settings.py b/src/wuttafarm/web/views/settings.py new file mode 100644 index 0000000..74cc0a0 --- /dev/null +++ b/src/wuttafarm/web/views/settings.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Custom views for Settings +""" + +from webhelpers2.html import tags + +from wuttaweb.views import settings as base + +from wuttafarm.web.util import use_farmos_style_grid_links + + +class AppInfoView(base.AppInfoView): + """ + Custom appinfo view + """ + + def get_appinfo_dict(self): + info = super().get_appinfo_dict() + enum = self.app.enum + + mode = self.config.get( + f"{self.app.appname}.farmos_integration_mode", default="wrapper" + ) + + info["farmos_integration"] = { + "label": "farmOS Integration", + "value": enum.FARMOS_INTEGRATION_MODE.get(mode, mode), + } + + url = self.app.get_farmos_url() + info["farmos_url"] = { + "label": "farmOS URL", + "value": tags.link_to(url, url, target="_blank"), + } + + return info + + def configure_get_simple_settings(self): # pylint: disable=empty-docstring + farmos = self.app.get_farmos_handler() + simple_settings = super().configure_get_simple_settings() + simple_settings.extend( + [ + { + "name": "farmos.url.base", + }, + { + "name": "farmos.oauth2.client_id", + "default": farmos.get_oauth2_client_id(), + }, + { + "name": "farmos.oauth2.scope", + "default": farmos.get_oauth2_scope(), + }, + { + "name": f"{self.app.appname}.farmos_integration_mode", + "default": self.app.get_farmos_integration_mode(), + }, + { + "name": f"{self.app.appname}.farmos_style_grid_links", + "type": bool, + "default": use_farmos_style_grid_links(self.config), + }, + ] + ) + return simple_settings + + +def defaults(config, **kwargs): + local = globals() + AppInfoView = kwargs.get("AppInfoView", local["AppInfoView"]) + base.defaults(config, **{"AppInfoView": AppInfoView}) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/structures.py b/src/wuttafarm/web/views/structures.py new file mode 100644 index 0000000..e17a39f --- /dev/null +++ b/src/wuttafarm/web/views/structures.py @@ -0,0 +1,216 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Structures +""" + +from wuttafarm.web.views.assets import AssetTypeMasterView, AssetMasterView +from wuttafarm.db.model import StructureType, StructureAsset +from wuttafarm.web.forms.schema import StructureTypeRef +from wuttafarm.web.forms.widgets import ImageWidget + + +class StructureTypeView(AssetTypeMasterView): + """ + Master view for Structure Types + """ + + model_class = StructureType + route_prefix = "structure_types" + url_prefix = "/structure-types" + + grid_columns = [ + "name", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "drupal_id", + "farmos_uuid", + ] + + has_rows = True + row_model_class = StructureAsset + rows_viewable = True + + row_grid_columns = [ + "asset_name", + "is_location", + "is_fixed", + "archived", + ] + + rows_sort_defaults = "asset_name" + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_xref_buttons(self, structure_type): + buttons = super().get_xref_buttons(structure_type) + + if structure_type.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_structure_types.view", uuid=structure_type.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + def get_row_grid_data(self, structure_type): + model = self.app.model + session = self.Session() + return ( + session.query(model.StructureAsset) + .join(model.Asset) + .filter(model.StructureAsset.structure_type == structure_type) + ) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + model = self.app.model + + # asset_name + g.set_link("asset_name") + g.set_sorter("asset_name", model.Asset.asset_name) + g.set_filter("asset_name", model.Asset.asset_name) + + # is_location + g.set_renderer("is_location", "boolean") + g.set_sorter("is_location", model.Asset.is_location) + g.set_filter("is_location", model.Asset.is_location) + + # is_fixed + g.set_renderer("is_fixed", "boolean") + g.set_sorter("is_fixed", model.Asset.is_fixed) + g.set_filter("is_fixed", model.Asset.is_fixed) + + # archived + g.set_renderer("archived", "boolean") + g.set_sorter("archived", model.Asset.archived) + g.set_filter("archived", model.Asset.archived) + + def get_row_action_url_view(self, structure, i): + return self.request.route_url("structure_assets.view", uuid=structure.uuid) + + @classmethod + def defaults(cls, config): + """ """ + wutta_config = config.registry.settings.get("wutta_config") + app = wutta_config.get_app() + + if app.is_farmos_mirror(): + cls.creatable = False + cls.editable = False + cls.deletable = False + + cls._defaults(config) + + +class StructureAssetView(AssetMasterView): + """ + Master view for Structures + """ + + model_class = StructureAsset + route_prefix = "structure_assets" + url_prefix = "/asset/structures" + + farmos_bundle = "structure" + farmos_refurl_path = "/assets/structure" + + grid_columns = [ + "thumbnail", + "drupal_id", + "asset_name", + "structure_type", + "parents", + "owners", + "archived", + ] + + form_fields = [ + "asset_name", + "parents", + "notes", + "asset_type", + "structure_type", + "is_location", + "is_fixed", + "archived", + "drupal_id", + "farmos_uuid", + "thumbnail_url", + "image_url", + "thumbnail", + "image", + ] + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + model = self.app.model + + # structure_type + g.set_joiner("structure_type", lambda q: q.join(model.StructureType)) + g.set_sorter("structure_type", model.StructureType.name) + g.set_filter( + "structure_type", model.StructureType.name, label="Structure Type Name" + ) + + def configure_form(self, form): + f = form + super().configure_form(f) + structure = form.model_instance + + # structure_type + f.set_node("structure_type", StructureTypeRef(self.request)) + + +def defaults(config, **kwargs): + base = globals() + + StructureTypeView = kwargs.get("StructureTypeView", base["StructureTypeView"]) + StructureTypeView.defaults(config) + + StructureAssetView = kwargs.get("StructureAssetView", base["StructureAssetView"]) + StructureAssetView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/units.py b/src/wuttafarm/web/views/units.py new file mode 100644 index 0000000..fe8dafe --- /dev/null +++ b/src/wuttafarm/web/views/units.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Master view for Units +""" + +from wuttafarm.web.views import WuttaFarmMasterView +from wuttafarm.db.model import Measure, Unit, Quantity + + +class MeasureView(WuttaFarmMasterView): + """ + Master view for Measures + """ + + model_class = Measure + route_prefix = "measures" + url_prefix = "/measures" + + grid_columns = [ + "name", + "drupal_id", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "drupal_id", + ] + + has_rows = True + row_model_class = Quantity + rows_viewable = True + + row_labels = { + "quantity_type_id": "Quantity Type ID", + "measure_id": "Measure ID", + } + + row_grid_columns = [ + "drupal_id", + "as_text", + "quantity_type", + "value", + "units", + "label", + ] + + rows_sort_defaults = ("drupal_id", "desc") + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_row_grid_data(self, measure): + model = self.app.model + session = self.Session() + return session.query(model.Quantity).filter(model.Quantity.measure == measure) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + + # as_text + g.set_renderer("as_text", self.render_as_text_for_grid) + g.set_link("as_text") + + # value + g.set_renderer("value", self.render_value_for_grid) + + def render_as_text_for_grid(self, quantity, field, value): + return quantity.render_as_text(self.config) + + def render_value_for_grid(self, quantity, field, value): + value = quantity.value_numerator / quantity.value_denominator + return self.app.render_quantity(value) + + def get_row_action_url_view(self, quantity, i): + return self.request.route_url( + f"quantities_{quantity.quantity_type_id}.view", uuid=quantity.uuid + ) + + @classmethod + def defaults(cls, config): + """ """ + wutta_config = config.registry.settings.get("wutta_config") + app = wutta_config.get_app() + + if app.is_farmos_mirror(): + cls.creatable = False + cls.editable = False + cls.deletable = False + + cls._defaults(config) + + +class UnitView(WuttaFarmMasterView): + """ + Master view for Units + """ + + model_class = Unit + route_prefix = "units" + url_prefix = "/units" + + farmos_entity_type = "taxonomy_term" + farmos_bundle = "unit" + farmos_refurl_path = "/admin/structure/taxonomy/manage/unit/overview" + + grid_columns = [ + "name", + "description", + ] + + sort_defaults = "name" + + filter_defaults = { + "name": {"active": True, "verb": "contains"}, + } + + form_fields = [ + "name", + "description", + "drupal_id", + "farmos_uuid", + ] + + has_rows = True + row_model_class = Quantity + rows_viewable = True + + row_labels = { + "quantity_type_id": "Quantity Type ID", + "measure_id": "Measure ID", + } + + row_grid_columns = [ + "drupal_id", + "as_text", + "quantity_type", + "measure", + "value", + "label", + ] + + rows_sort_defaults = ("drupal_id", "desc") + + def configure_grid(self, grid): + g = grid + super().configure_grid(g) + + # name + g.set_link("name") + + def get_farmos_url(self, unit): + return self.app.get_farmos_url(f"/taxonomy/term/{unit.drupal_id}") + + def get_xref_buttons(self, unit): + buttons = super().get_xref_buttons(unit) + + if unit.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_units.view", uuid=unit.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + def get_row_grid_data(self, unit): + model = self.app.model + session = self.Session() + return session.query(model.Quantity).filter(model.Quantity.units == unit) + + def configure_row_grid(self, grid): + g = grid + super().configure_row_grid(g) + + # drupal_id + g.set_label("drupal_id", "ID", column_only=True) + + # as_text + g.set_renderer("as_text", self.render_as_text_for_grid) + g.set_link("as_text") + + # value + g.set_renderer("value", self.render_value_for_grid) + + def render_as_text_for_grid(self, quantity, field, value): + return quantity.render_as_text(self.config) + + def render_value_for_grid(self, quantity, field, value): + value = quantity.value_numerator / quantity.value_denominator + return self.app.render_quantity(value) + + def get_row_action_url_view(self, quantity, i): + return self.request.route_url( + f"quantities_{quantity.quantity_type_id}.view", uuid=quantity.uuid + ) + + +def defaults(config, **kwargs): + base = globals() + + MeasureView = kwargs.get("MeasureView", base["MeasureView"]) + MeasureView.defaults(config) + + UnitView = kwargs.get("UnitView", base["UnitView"]) + UnitView.defaults(config) + + +def includeme(config): + defaults(config) diff --git a/src/wuttafarm/web/views/users.py b/src/wuttafarm/web/views/users.py new file mode 100644 index 0000000..ffda747 --- /dev/null +++ b/src/wuttafarm/web/views/users.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# WuttaFarm --Web app to integrate with and extend farmOS +# Copyright © 2026 Lance Edgar +# +# This file is part of WuttaFarm. +# +# WuttaFarm is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# WuttaFarm is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# WuttaFarm. If not, see . +# +################################################################################ +""" +Views for Users +""" + +import colander + +from wuttaweb.views import users as base + + +class UserView(base.UserView): + """ + Custom master view for Users. + """ + + labels = { + "farmos_uuid": "farmOS UUID", + "drupal_id": "Drupal ID", + } + + def get_template_context(self, context): + context = super().get_template_context(context) + + if self.listing: + context["farmos_refurl"] = self.app.get_farmos_url("/admin/people") + + return context + + def configure_form(self, form): + """ """ + f = form + super().configure_form(f) + user = f.model_instance + + # farmos_uuid + if not self.creating: + f.fields.append("farmos_uuid") + f.set_readonly("farmos_uuid") + f.set_default("farmos_uuid", user.farmos_uuid or colander.null) + + # drupal_id + if not self.creating: + f.fields.append("drupal_id") + f.set_readonly("drupal_id") + f.set_default("drupal_id", user.drupal_id or colander.null) + + def get_xref_buttons(self, user): + buttons = [] + + if user.drupal_id: + buttons.append( + self.make_button( + "View in farmOS", + primary=True, + url=self.app.get_farmos_url(f"/user/{user.drupal_id}"), + target="_blank", + icon_left="external-link-alt", + ) + ) + + if user.farmos_uuid: + buttons.append( + self.make_button( + "View farmOS record", + primary=True, + url=self.request.route_url( + "farmos_users.view", uuid=user.farmos_uuid + ), + icon_left="eye", + ) + ) + + return buttons + + +def defaults(config, **kwargs): + local = globals() + UserView = kwargs.get("UserView", local["UserView"]) + base.defaults(config, **{"UserView": UserView}) + + +def includeme(config): + defaults(config) diff --git a/style/package-lock.json b/style/package-lock.json new file mode 100644 index 0000000..94eacb1 --- /dev/null +++ b/style/package-lock.json @@ -0,0 +1,2358 @@ +{ + "name": "style", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "buefy": "^0.9.29", + "css-loader": "^7.1.3", + "mini-css-extract-plugin": "^2.10.0", + "sass": "^1.97.3", + "sass-loader": "^16.0.7", + "webpack-cli": "^6.0.1" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", + "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.6.3.tgz", + "integrity": "sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", + "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.6", + "@parcel/watcher-darwin-arm64": "2.5.6", + "@parcel/watcher-darwin-x64": "2.5.6", + "@parcel/watcher-freebsd-x64": "2.5.6", + "@parcel/watcher-linux-arm-glibc": "2.5.6", + "@parcel/watcher-linux-arm-musl": "2.5.6", + "@parcel/watcher-linux-arm64-glibc": "2.5.6", + "@parcel/watcher-linux-arm64-musl": "2.5.6", + "@parcel/watcher-linux-x64-glibc": "2.5.6", + "@parcel/watcher-linux-x64-musl": "2.5.6", + "@parcel/watcher-win32-arm64": "2.5.6", + "@parcel/watcher-win32-ia32": "2.5.6", + "@parcel/watcher-win32-x64": "2.5.6" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.6.tgz", + "integrity": "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.6.tgz", + "integrity": "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.6.tgz", + "integrity": "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.6.tgz", + "integrity": "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.6.tgz", + "integrity": "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.6.tgz", + "integrity": "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.6.tgz", + "integrity": "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.6.tgz", + "integrity": "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz", + "integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz", + "integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.6.tgz", + "integrity": "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.6.tgz", + "integrity": "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.6.tgz", + "integrity": "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.2.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.1.tgz", + "integrity": "sha512-CPrnr8voK8vC6eEtyRzvMpgp3VyVRhgclonE7qYi6P9sXwYb59ucfrnmFBTaP0yUi8Gk4yZg/LlTJULGxvTNsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz", + "integrity": "sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.23.5", + "postcss": "^8.4.14", + "source-map": "^0.6.1" + }, + "optionalDependencies": { + "prettier": "^1.18.2 || ^2.0.0" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-3.0.1.tgz", + "integrity": "sha512-u8d0pJ5YFgneF/GuvEiDA61Tf1VDomHHYMjv/wc9XzYj7nopltpG96nXN5dJRstxZhcNpV1g+nT6CydO7pHbjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "webpack": "^5.82.0", + "webpack-cli": "6.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-3.0.1.tgz", + "integrity": "sha512-coEmDzc2u/ffMvuW9aCjoRzNSPDl/XLuhPdlFRpT9tZHmJ/039az33CE7uH+8s0uL1j5ZNtfdv0HkfaKRBGJsQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "webpack": "^5.82.0", + "webpack-cli": "6.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-3.0.1.tgz", + "integrity": "sha512-sbgw03xQaCLiT6gcY/6u3qBDn01CWw/nbaXl3gTdTFuJJ75Gffv3E3DBpgvY2fkkrdS1fpjaXNOmJlnbtKauKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "webpack": "^5.82.0", + "webpack-cli": "6.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-phases": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", + "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + }, + "peerDependencies": { + "acorn": "^8.14.0" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.19", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz", + "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buefy": { + "version": "0.9.29", + "resolved": "https://registry.npmjs.org/buefy/-/buefy-0.9.29.tgz", + "integrity": "sha512-iJutB/ezTQcxqcKvKz129DzomMjNRGdy23lJBtoFQBG//2NveTcPkN/VRUF70z2WH3JB/5nmVeoxr8QOPcs42w==", + "dev": true, + "license": "MIT", + "dependencies": { + "bulma": "0.9.4" + }, + "engines": { + "node": ">= 4.0.0", + "npm": ">= 3.0.0" + }, + "peerDependencies": { + "vue": "^2.6.11" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bulma": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.4.tgz", + "integrity": "sha512-86FlT5+1GrsgKbPLRRY7cGDg8fsJiP/jzTqXXVqiUZZ2aZT8uemEOHlU1CDU+TxklPEZ11HZNNWclRBBecP4CQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001769", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", + "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-loader": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.3.tgz", + "integrity": "sha512-frbERmjT0UC5lMheWpJmMilnt9GEhbZJN/heUb7/zaJYeIzj5St9HvDcfshzzOqbsS+rYpMk++2SD3vGETDSyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.40", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.6.3" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.27.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.286", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", + "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", + "dev": true, + "license": "ISC" + }, + "node_modules/enhanced-resolve": { + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz", + "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/envinfo": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.21.0.tgz", + "integrity": "sha512-Lw7I8Zp5YKHFCXL7+Dz95g4CcbMEpgvqZNNq3AmlT5XAV6CgAAk6gyAMqn2zjw08K9BHfcNuKrMiCPLByGafow==", + "dev": true, + "license": "MIT", + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/es-module-lexer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", + "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/immutable": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.4.tgz", + "integrity": "sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==", + "dev": true, + "license": "MIT" + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", + "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mini-css-extract-plugin": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.10.0.tgz", + "integrity": "sha512-540P2c5dYnJlyJxTaSloliZexv8rji6rY8FhQN+WF/82iHQfA23j/xtJx97L+mXOML27EqksSek/g4eK7jaL3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", + "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^7.0.0", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", + "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", + "dev": true, + "license": "ISC", + "dependencies": { + "postcss-selector-parser": "^7.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-selector-parser": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz", + "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/sass": { + "version": "1.97.3", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.97.3.tgz", + "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chokidar": "^4.0.0", + "immutable": "^5.0.2", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, + "node_modules/sass-loader": { + "version": "16.0.7", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.7.tgz", + "integrity": "sha512-w6q+fRHourZ+e+xA1kcsF27iGM6jdB8teexYCfdUw0sYgcDNeZESnDNT9sUmmPm3ooziwUJXGwZJSTF3kOdBfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || ^1.0.0 || ^2.0.0-0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/schema-utils": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "license": "MIT", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/terser": { + "version": "5.46.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.0.tgz", + "integrity": "sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.16", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz", + "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "jest-worker": "^27.4.5", + "schema-utils": "^4.3.0", + "serialize-javascript": "^6.0.2", + "terser": "^5.31.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vue": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.16.tgz", + "integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==", + "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-sfc": "2.7.16", + "csstype": "^3.1.0" + } + }, + "node_modules/watchpack": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz", + "integrity": "sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.105.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.0.tgz", + "integrity": "sha512-gX/dMkRQc7QOMzgTe6KsYFM7DxeIONQSui1s0n/0xht36HvrgbxtM1xBlgx596NbpHuQU8P7QpKwrZYwUX48nw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.8", + "@types/json-schema": "^7.0.15", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.15.0", + "acorn-import-phases": "^1.0.3", + "browserslist": "^4.28.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.19.0", + "es-module-lexer": "^2.0.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.3.1", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^4.3.3", + "tapable": "^2.3.0", + "terser-webpack-plugin": "^5.3.16", + "watchpack": "^2.5.1", + "webpack-sources": "^3.3.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-6.0.1.tgz", + "integrity": "sha512-MfwFQ6SfwinsUVi0rNJm7rHZ31GyTcpVE5pgVA3hwFRb7COD4TzjUUwhGWKfO50+xdc2MQPuEBBJoqIMGt3JDw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.6.1", + "@webpack-cli/configtest": "^3.0.1", + "@webpack-cli/info": "^3.0.1", + "@webpack-cli/serve": "^3.0.1", + "colorette": "^2.0.14", + "commander": "^12.1.0", + "cross-spawn": "^7.0.3", + "envinfo": "^7.14.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^6.0.1" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.82.0" + }, + "peerDependenciesMeta": { + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/webpack-merge": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-6.0.1.tgz", + "integrity": "sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", + "integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/style/package.json b/style/package.json new file mode 100644 index 0000000..85250e1 --- /dev/null +++ b/style/package.json @@ -0,0 +1,14 @@ +{ + "main": "webpack.config.js", + "scripts": { + "build": "webpack --mode production" + }, + "devDependencies": { + "buefy": "^0.9.29", + "css-loader": "^7.1.3", + "mini-css-extract-plugin": "^2.10.0", + "sass": "^1.97.3", + "sass-loader": "^16.0.7", + "webpack-cli": "^6.0.1" + } +} diff --git a/style/src/index.js b/style/src/index.js new file mode 100644 index 0000000..2ab2edf --- /dev/null +++ b/style/src/index.js @@ -0,0 +1 @@ +require("./wuttafarm-buefy.scss"); diff --git a/style/src/wuttafarm-buefy.scss b/style/src/wuttafarm-buefy.scss new file mode 100644 index 0000000..6bbc5e3 --- /dev/null +++ b/style/src/wuttafarm-buefy.scss @@ -0,0 +1,85 @@ +// cf. https://v2.buefy.org/documentation/customization + +// Import Bulma's core +@import "~bulma/sass/utilities/_all"; + +// Set your colors +// nb. primary color was stolen from gin theme in farmOS +$primary: rgb(0, 135, 95); +$primary-light: findLightColor($primary); +$primary-dark: findDarkColor($primary); +$primary-invert: findColorInvert($primary); +$twitter: #4099FF; +$twitter-invert: findColorInvert($twitter); + +// Lists and maps +$custom-colors: null !default; +$custom-shades: null !default; + +// Setup $colors to use as bulma classes (e.g. 'is-twitter') +$colors: mergeColorMaps( + ( + "white": ( + $white, + $black, + ), + "black": ( + $black, + $white, + ), + "light": ( + $light, + $light-invert, + ), + "dark": ( + $dark, + $dark-invert, + ), + "primary": ( + $primary, + $primary-invert, + $primary-light, + $primary-dark, + ), + "link": ( + $link, + $link-invert, + $link-light, + $link-dark, + ), + "info": ( + $info, + $info-invert, + $info-light, + $info-dark, + ), + "success": ( + $success, + $success-invert, + $success-light, + $success-dark, + ), + "warning": ( + $warning, + $warning-invert, + $warning-light, + $warning-dark, + ), + "danger": ( + $danger, + $danger-invert, + $danger-light, + $danger-dark, + ), + ), + $custom-colors +); + +// Links +$link: $primary; +$link-invert: $primary-invert; +$link-focus-border: $primary; + +// Import Bulma and Buefy styles +@import "~bulma"; +@import "~buefy/src/scss/buefy"; diff --git a/style/webpack.config.js b/style/webpack.config.js new file mode 100644 index 0000000..5c8b8ef --- /dev/null +++ b/style/webpack.config.js @@ -0,0 +1,13 @@ +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); + +module.exports = { + plugins: [new MiniCssExtractPlugin({ + filename: "css/wuttafarm-buefy.css", + })], + module: { + rules: [{ + test: /\.scss$/, + use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"], + }] + }, +}; diff --git a/tasks.py b/tasks.py index ce0b62e..03fc70f 100644 --- a/tasks.py +++ b/tasks.py @@ -15,10 +15,25 @@ def release(c, skip_tests=False): Release a new version of WuttaFarm """ if not skip_tests: - c.run("pytest") + # TODO + # c.run("pytest") + pass if os.path.exists("dist"): shutil.rmtree("dist") - c.run("python -m build --sdist") + c.run("python -m build") c.run("twine upload dist/*") + + +@task +def update_style(c): + """ + Build/update the `wuttafarm-buefy.css` file + """ + os.chdir("style") + # c.run("nvm use lts/krypton") + c.run("npm install") + c.run("npm run build") + os.chdir(os.pardir) + shutil.copy("style/dist/css/wuttafarm-buefy.css", "src/wuttafarm/web/static/css/") diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..cd87198 --- /dev/null +++ b/tox.ini @@ -0,0 +1,6 @@ + +[testenv:docs] +basepython = python3.11 +extras = docs +changedir = docs +commands = sphinx-build -b html -d {envtmpdir}/doctrees -W -T . {envtmpdir}/docs