@unabridged/midwest 0.0.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -15
- package/app/assets/icons/accessibility-outline.svg +1 -1
- package/app/assets/icons/accessibility-sharp.svg +1 -1
- package/app/assets/icons/accessibility.svg +1 -1
- package/app/assets/icons/add-circle-outline.svg +1 -1
- package/app/assets/icons/add-circle-sharp.svg +1 -1
- package/app/assets/icons/add-circle.svg +1 -1
- package/app/assets/icons/add-outline.svg +1 -1
- package/app/assets/icons/add-sharp.svg +1 -1
- package/app/assets/icons/add.svg +1 -1
- package/app/assets/icons/airplane-outline.svg +1 -1
- package/app/assets/icons/airplane-sharp.svg +1 -1
- package/app/assets/icons/airplane.svg +1 -1
- package/app/assets/icons/alarm-outline.svg +1 -1
- package/app/assets/icons/alarm-sharp.svg +1 -1
- package/app/assets/icons/alarm.svg +1 -1
- package/app/assets/icons/albums-outline.svg +1 -1
- package/app/assets/icons/albums-sharp.svg +1 -1
- package/app/assets/icons/albums.svg +1 -1
- package/app/assets/icons/alert-circle-outline.svg +1 -1
- package/app/assets/icons/alert-circle-sharp.svg +1 -1
- package/app/assets/icons/alert-circle.svg +1 -1
- package/app/assets/icons/alert-outline.svg +1 -1
- package/app/assets/icons/alert-sharp.svg +1 -1
- package/app/assets/icons/alert.svg +1 -1
- package/app/assets/icons/american-football-outline.svg +1 -1
- package/app/assets/icons/american-football-sharp.svg +1 -1
- package/app/assets/icons/american-football.svg +1 -1
- package/app/assets/icons/analytics-outline.svg +1 -1
- package/app/assets/icons/analytics-sharp.svg +1 -1
- package/app/assets/icons/analytics.svg +1 -1
- package/app/assets/icons/aperture-outline.svg +1 -1
- package/app/assets/icons/aperture-sharp.svg +1 -1
- package/app/assets/icons/aperture.svg +1 -1
- package/app/assets/icons/apps-outline.svg +1 -1
- package/app/assets/icons/apps-sharp.svg +1 -1
- package/app/assets/icons/apps.svg +1 -1
- package/app/assets/icons/archive-outline.svg +1 -1
- package/app/assets/icons/archive-sharp.svg +1 -1
- package/app/assets/icons/archive.svg +1 -1
- package/app/assets/icons/arrow-back-circle-outline.svg +1 -1
- package/app/assets/icons/arrow-back-circle-sharp.svg +1 -1
- package/app/assets/icons/arrow-back-circle.svg +1 -1
- package/app/assets/icons/arrow-back-outline.svg +1 -1
- package/app/assets/icons/arrow-back-sharp.svg +1 -1
- package/app/assets/icons/arrow-back.svg +1 -1
- package/app/assets/icons/arrow-down-circle-outline.svg +1 -1
- package/app/assets/icons/arrow-down-circle-sharp.svg +1 -1
- package/app/assets/icons/arrow-down-circle.svg +1 -1
- package/app/assets/icons/arrow-down-outline.svg +1 -1
- package/app/assets/icons/arrow-down-sharp.svg +1 -1
- package/app/assets/icons/arrow-down.svg +1 -1
- package/app/assets/icons/arrow-forward-circle-outline.svg +1 -1
- package/app/assets/icons/arrow-forward-circle-sharp.svg +1 -1
- package/app/assets/icons/arrow-forward-circle.svg +1 -1
- package/app/assets/icons/arrow-forward-outline.svg +1 -1
- package/app/assets/icons/arrow-forward-sharp.svg +1 -1
- package/app/assets/icons/arrow-forward.svg +1 -1
- package/app/assets/icons/arrow-redo-circle-outline.svg +1 -1
- package/app/assets/icons/arrow-redo-circle-sharp.svg +1 -1
- package/app/assets/icons/arrow-redo-circle.svg +1 -1
- package/app/assets/icons/arrow-redo-outline.svg +1 -1
- package/app/assets/icons/arrow-redo-sharp.svg +1 -1
- package/app/assets/icons/arrow-redo.svg +1 -1
- package/app/assets/icons/arrow-undo-circle-outline.svg +1 -1
- package/app/assets/icons/arrow-undo-circle-sharp.svg +1 -1
- package/app/assets/icons/arrow-undo-circle.svg +1 -1
- package/app/assets/icons/arrow-undo-outline.svg +1 -1
- package/app/assets/icons/arrow-undo-sharp.svg +1 -1
- package/app/assets/icons/arrow-undo.svg +1 -1
- package/app/assets/icons/arrow-up-circle-outline.svg +1 -1
- package/app/assets/icons/arrow-up-circle-sharp.svg +1 -1
- package/app/assets/icons/arrow-up-circle.svg +1 -1
- package/app/assets/icons/arrow-up-outline.svg +1 -1
- package/app/assets/icons/arrow-up-sharp.svg +1 -1
- package/app/assets/icons/arrow-up.svg +1 -1
- package/app/assets/icons/at-circle-outline.svg +1 -1
- package/app/assets/icons/at-circle-sharp.svg +1 -1
- package/app/assets/icons/at-circle.svg +1 -1
- package/app/assets/icons/at-outline.svg +1 -1
- package/app/assets/icons/at-sharp.svg +1 -1
- package/app/assets/icons/at.svg +1 -1
- package/app/assets/icons/attach-outline.svg +1 -1
- package/app/assets/icons/attach-sharp.svg +1 -1
- package/app/assets/icons/attach.svg +1 -1
- package/app/assets/icons/available-icons.yml +1 -0
- package/app/assets/icons/backspace-outline.svg +1 -1
- package/app/assets/icons/backspace-sharp.svg +1 -1
- package/app/assets/icons/backspace.svg +1 -1
- package/app/assets/icons/bag-add-outline.svg +1 -1
- package/app/assets/icons/bag-add-sharp.svg +1 -1
- package/app/assets/icons/bag-add.svg +1 -1
- package/app/assets/icons/bag-check-outline.svg +1 -1
- package/app/assets/icons/bag-check-sharp.svg +1 -1
- package/app/assets/icons/bag-check.svg +1 -1
- package/app/assets/icons/bag-handle-outline.svg +1 -1
- package/app/assets/icons/bag-handle-sharp.svg +1 -1
- package/app/assets/icons/bag-handle.svg +1 -1
- package/app/assets/icons/bag-outline.svg +1 -1
- package/app/assets/icons/bag-remove-outline.svg +1 -1
- package/app/assets/icons/bag-remove-sharp.svg +1 -1
- package/app/assets/icons/bag-remove.svg +1 -1
- package/app/assets/icons/bag-sharp.svg +1 -1
- package/app/assets/icons/bag.svg +1 -1
- package/app/assets/icons/balloon-outline.svg +1 -1
- package/app/assets/icons/balloon-sharp.svg +1 -1
- package/app/assets/icons/balloon.svg +1 -1
- package/app/assets/icons/ban-outline.svg +1 -1
- package/app/assets/icons/ban-sharp.svg +1 -1
- package/app/assets/icons/ban.svg +1 -1
- package/app/assets/icons/bandage-outline.svg +1 -1
- package/app/assets/icons/bandage-sharp.svg +1 -1
- package/app/assets/icons/bandage.svg +1 -1
- package/app/assets/icons/bar-chart-outline.svg +1 -1
- package/app/assets/icons/bar-chart-sharp.svg +1 -1
- package/app/assets/icons/bar-chart.svg +1 -1
- package/app/assets/icons/barbell-outline.svg +1 -1
- package/app/assets/icons/barbell-sharp.svg +1 -1
- package/app/assets/icons/barbell.svg +1 -1
- package/app/assets/icons/barcode-outline.svg +1 -1
- package/app/assets/icons/barcode-sharp.svg +1 -1
- package/app/assets/icons/barcode.svg +1 -1
- package/app/assets/icons/baseball-outline.svg +1 -1
- package/app/assets/icons/baseball-sharp.svg +1 -1
- package/app/assets/icons/baseball.svg +1 -1
- package/app/assets/icons/basket-outline.svg +1 -1
- package/app/assets/icons/basket-sharp.svg +1 -1
- package/app/assets/icons/basket.svg +1 -1
- package/app/assets/icons/basketball-outline.svg +1 -1
- package/app/assets/icons/basketball-sharp.svg +1 -1
- package/app/assets/icons/basketball.svg +1 -1
- package/app/assets/icons/battery-charging-outline.svg +1 -1
- package/app/assets/icons/battery-charging-sharp.svg +1 -1
- package/app/assets/icons/battery-charging.svg +1 -1
- package/app/assets/icons/battery-dead-outline.svg +1 -1
- package/app/assets/icons/battery-dead-sharp.svg +1 -1
- package/app/assets/icons/battery-dead.svg +1 -1
- package/app/assets/icons/battery-full-outline.svg +1 -1
- package/app/assets/icons/battery-full-sharp.svg +1 -1
- package/app/assets/icons/battery-full.svg +1 -1
- package/app/assets/icons/battery-half-outline.svg +1 -1
- package/app/assets/icons/battery-half-sharp.svg +1 -1
- package/app/assets/icons/battery-half.svg +1 -1
- package/app/assets/icons/beaker-outline.svg +1 -1
- package/app/assets/icons/beaker-sharp.svg +1 -1
- package/app/assets/icons/beaker.svg +1 -1
- package/app/assets/icons/bed-outline.svg +1 -1
- package/app/assets/icons/bed-sharp.svg +1 -1
- package/app/assets/icons/bed.svg +1 -1
- package/app/assets/icons/beer-outline.svg +1 -1
- package/app/assets/icons/beer-sharp.svg +1 -1
- package/app/assets/icons/beer.svg +1 -1
- package/app/assets/icons/bicycle-outline.svg +1 -1
- package/app/assets/icons/bicycle-sharp.svg +1 -1
- package/app/assets/icons/bicycle.svg +1 -1
- package/app/assets/icons/bluetooth-outline.svg +1 -1
- package/app/assets/icons/bluetooth-sharp.svg +1 -1
- package/app/assets/icons/bluetooth.svg +1 -1
- package/app/assets/icons/boat-outline.svg +1 -1
- package/app/assets/icons/boat-sharp.svg +1 -1
- package/app/assets/icons/boat.svg +1 -1
- package/app/assets/icons/body-outline.svg +1 -1
- package/app/assets/icons/body-sharp.svg +1 -1
- package/app/assets/icons/body.svg +1 -1
- package/app/assets/icons/bonfire-outline.svg +1 -1
- package/app/assets/icons/bonfire-sharp.svg +1 -1
- package/app/assets/icons/bonfire.svg +1 -1
- package/app/assets/icons/book-outline.svg +1 -1
- package/app/assets/icons/book-sharp.svg +1 -1
- package/app/assets/icons/book.svg +1 -1
- package/app/assets/icons/bookmark-outline.svg +1 -1
- package/app/assets/icons/bookmark-sharp.svg +1 -1
- package/app/assets/icons/bookmark.svg +1 -1
- package/app/assets/icons/bookmarks-outline.svg +1 -1
- package/app/assets/icons/bookmarks-sharp.svg +1 -1
- package/app/assets/icons/bookmarks.svg +1 -1
- package/app/assets/icons/bowling-ball-outline.svg +1 -1
- package/app/assets/icons/bowling-ball-sharp.svg +1 -1
- package/app/assets/icons/bowling-ball.svg +1 -1
- package/app/assets/icons/briefcase-outline.svg +1 -1
- package/app/assets/icons/briefcase-sharp.svg +1 -1
- package/app/assets/icons/briefcase.svg +1 -1
- package/app/assets/icons/browsers-outline.svg +1 -1
- package/app/assets/icons/browsers-sharp.svg +1 -1
- package/app/assets/icons/browsers.svg +1 -1
- package/app/assets/icons/brush-outline.svg +1 -1
- package/app/assets/icons/brush-sharp.svg +1 -1
- package/app/assets/icons/brush.svg +1 -1
- package/app/assets/icons/bug-outline.svg +1 -1
- package/app/assets/icons/bug-sharp.svg +1 -1
- package/app/assets/icons/bug.svg +1 -1
- package/app/assets/icons/build-outline.svg +1 -1
- package/app/assets/icons/build-sharp.svg +1 -1
- package/app/assets/icons/build.svg +1 -1
- package/app/assets/icons/bulb-outline.svg +1 -1
- package/app/assets/icons/bulb-sharp.svg +1 -1
- package/app/assets/icons/bulb.svg +1 -1
- package/app/assets/icons/bus-outline.svg +1 -1
- package/app/assets/icons/bus-sharp.svg +1 -1
- package/app/assets/icons/bus.svg +1 -1
- package/app/assets/icons/business-outline.svg +1 -1
- package/app/assets/icons/business-sharp.svg +1 -1
- package/app/assets/icons/business.svg +1 -1
- package/app/assets/icons/cafe-outline.svg +1 -1
- package/app/assets/icons/cafe-sharp.svg +1 -1
- package/app/assets/icons/cafe.svg +1 -1
- package/app/assets/icons/calculator-outline.svg +1 -1
- package/app/assets/icons/calculator-sharp.svg +1 -1
- package/app/assets/icons/calculator.svg +1 -1
- package/app/assets/icons/calendar-clear-outline.svg +1 -1
- package/app/assets/icons/calendar-clear-sharp.svg +1 -1
- package/app/assets/icons/calendar-clear.svg +1 -1
- package/app/assets/icons/calendar-number-outline.svg +1 -1
- package/app/assets/icons/calendar-number-sharp.svg +1 -1
- package/app/assets/icons/calendar-number.svg +1 -1
- package/app/assets/icons/calendar-outline.svg +1 -1
- package/app/assets/icons/calendar-sharp.svg +1 -1
- package/app/assets/icons/calendar.svg +1 -1
- package/app/assets/icons/call-outline.svg +1 -1
- package/app/assets/icons/call-sharp.svg +1 -1
- package/app/assets/icons/call.svg +1 -1
- package/app/assets/icons/camera-outline.svg +1 -1
- package/app/assets/icons/camera-reverse-outline.svg +1 -1
- package/app/assets/icons/camera-reverse-sharp.svg +1 -1
- package/app/assets/icons/camera-reverse.svg +1 -1
- package/app/assets/icons/camera-sharp.svg +1 -1
- package/app/assets/icons/camera.svg +1 -1
- package/app/assets/icons/car-outline.svg +1 -1
- package/app/assets/icons/car-sharp.svg +1 -1
- package/app/assets/icons/car-sport-outline.svg +1 -1
- package/app/assets/icons/car-sport-sharp.svg +1 -1
- package/app/assets/icons/car-sport.svg +1 -1
- package/app/assets/icons/car.svg +1 -1
- package/app/assets/icons/card-outline.svg +1 -1
- package/app/assets/icons/card-sharp.svg +1 -1
- package/app/assets/icons/card.svg +1 -1
- package/app/assets/icons/caret-back-circle-outline.svg +1 -1
- package/app/assets/icons/caret-back-circle-sharp.svg +1 -1
- package/app/assets/icons/caret-back-circle.svg +1 -1
- package/app/assets/icons/caret-back-outline.svg +1 -1
- package/app/assets/icons/caret-back-sharp.svg +1 -1
- package/app/assets/icons/caret-back.svg +1 -1
- package/app/assets/icons/caret-down-circle-outline.svg +1 -1
- package/app/assets/icons/caret-down-circle-sharp.svg +1 -1
- package/app/assets/icons/caret-down-circle.svg +1 -1
- package/app/assets/icons/caret-down-outline.svg +1 -1
- package/app/assets/icons/caret-down-sharp.svg +1 -1
- package/app/assets/icons/caret-down.svg +1 -1
- package/app/assets/icons/caret-forward-circle-outline.svg +1 -1
- package/app/assets/icons/caret-forward-circle-sharp.svg +1 -1
- package/app/assets/icons/caret-forward-circle.svg +1 -1
- package/app/assets/icons/caret-forward-outline.svg +1 -1
- package/app/assets/icons/caret-forward-sharp.svg +1 -1
- package/app/assets/icons/caret-forward.svg +1 -1
- package/app/assets/icons/caret-up-circle-outline.svg +1 -1
- package/app/assets/icons/caret-up-circle-sharp.svg +1 -1
- package/app/assets/icons/caret-up-circle.svg +1 -1
- package/app/assets/icons/caret-up-outline.svg +1 -1
- package/app/assets/icons/caret-up-sharp.svg +1 -1
- package/app/assets/icons/caret-up.svg +1 -1
- package/app/assets/icons/cart-outline.svg +1 -1
- package/app/assets/icons/cart-sharp.svg +1 -1
- package/app/assets/icons/cart.svg +1 -1
- package/app/assets/icons/cash-outline.svg +1 -1
- package/app/assets/icons/cash-sharp.svg +1 -1
- package/app/assets/icons/cash.svg +1 -1
- package/app/assets/icons/cellular-outline.svg +1 -1
- package/app/assets/icons/cellular-sharp.svg +1 -1
- package/app/assets/icons/cellular.svg +1 -1
- package/app/assets/icons/chatbox-ellipses-outline.svg +1 -1
- package/app/assets/icons/chatbox-ellipses-sharp.svg +1 -1
- package/app/assets/icons/chatbox-ellipses.svg +1 -1
- package/app/assets/icons/chatbox-outline.svg +1 -1
- package/app/assets/icons/chatbox-sharp.svg +1 -1
- package/app/assets/icons/chatbox.svg +1 -1
- package/app/assets/icons/chatbubble-ellipses-outline.svg +1 -1
- package/app/assets/icons/chatbubble-ellipses-sharp.svg +1 -1
- package/app/assets/icons/chatbubble-ellipses.svg +1 -1
- package/app/assets/icons/chatbubble-outline.svg +1 -1
- package/app/assets/icons/chatbubble-sharp.svg +1 -1
- package/app/assets/icons/chatbubble.svg +1 -1
- package/app/assets/icons/chatbubbles-outline.svg +1 -1
- package/app/assets/icons/chatbubbles-sharp.svg +1 -1
- package/app/assets/icons/chatbubbles.svg +1 -1
- package/app/assets/icons/checkbox-outline.svg +1 -1
- package/app/assets/icons/checkbox-sharp.svg +1 -1
- package/app/assets/icons/checkbox.svg +1 -1
- package/app/assets/icons/checkmark-circle-outline.svg +1 -1
- package/app/assets/icons/checkmark-circle-sharp.svg +1 -1
- package/app/assets/icons/checkmark-circle.svg +1 -1
- package/app/assets/icons/checkmark-done-circle-outline.svg +1 -1
- package/app/assets/icons/checkmark-done-circle-sharp.svg +1 -1
- package/app/assets/icons/checkmark-done-circle.svg +1 -1
- package/app/assets/icons/checkmark-done-outline.svg +1 -1
- package/app/assets/icons/checkmark-done-sharp.svg +1 -1
- package/app/assets/icons/checkmark-done.svg +1 -1
- package/app/assets/icons/checkmark-outline.svg +1 -1
- package/app/assets/icons/checkmark-sharp.svg +1 -1
- package/app/assets/icons/checkmark.svg +1 -1
- package/app/assets/icons/chevron-back-circle-outline.svg +1 -1
- package/app/assets/icons/chevron-back-circle-sharp.svg +1 -1
- package/app/assets/icons/chevron-back-circle.svg +1 -1
- package/app/assets/icons/chevron-back-outline.svg +1 -1
- package/app/assets/icons/chevron-back-sharp.svg +1 -1
- package/app/assets/icons/chevron-back.svg +1 -1
- package/app/assets/icons/chevron-down-circle-outline.svg +1 -1
- package/app/assets/icons/chevron-down-circle-sharp.svg +1 -1
- package/app/assets/icons/chevron-down-circle.svg +1 -1
- package/app/assets/icons/chevron-down-outline.svg +1 -1
- package/app/assets/icons/chevron-down-sharp.svg +1 -1
- package/app/assets/icons/chevron-down.svg +1 -1
- package/app/assets/icons/chevron-forward-circle-outline.svg +1 -1
- package/app/assets/icons/chevron-forward-circle-sharp.svg +1 -1
- package/app/assets/icons/chevron-forward-circle.svg +1 -1
- package/app/assets/icons/chevron-forward-outline.svg +1 -1
- package/app/assets/icons/chevron-forward-sharp.svg +1 -1
- package/app/assets/icons/chevron-forward.svg +1 -1
- package/app/assets/icons/chevron-up-circle-outline.svg +1 -1
- package/app/assets/icons/chevron-up-circle-sharp.svg +1 -1
- package/app/assets/icons/chevron-up-circle.svg +1 -1
- package/app/assets/icons/chevron-up-outline.svg +1 -1
- package/app/assets/icons/chevron-up-sharp.svg +1 -1
- package/app/assets/icons/chevron-up.svg +1 -1
- package/app/assets/icons/clipboard-outline.svg +1 -1
- package/app/assets/icons/clipboard-sharp.svg +1 -1
- package/app/assets/icons/clipboard.svg +1 -1
- package/app/assets/icons/close-circle-outline.svg +1 -1
- package/app/assets/icons/close-circle-sharp.svg +1 -1
- package/app/assets/icons/close-circle.svg +1 -1
- package/app/assets/icons/close-outline.svg +1 -1
- package/app/assets/icons/close-sharp.svg +1 -1
- package/app/assets/icons/close.svg +1 -1
- package/app/assets/icons/cloud-circle-outline.svg +1 -1
- package/app/assets/icons/cloud-circle-sharp.svg +1 -1
- package/app/assets/icons/cloud-circle.svg +1 -1
- package/app/assets/icons/cloud-done-outline.svg +1 -1
- package/app/assets/icons/cloud-done-sharp.svg +1 -1
- package/app/assets/icons/cloud-done.svg +1 -1
- package/app/assets/icons/cloud-download-outline.svg +1 -1
- package/app/assets/icons/cloud-download-sharp.svg +1 -1
- package/app/assets/icons/cloud-download.svg +1 -1
- package/app/assets/icons/cloud-offline-outline.svg +1 -1
- package/app/assets/icons/cloud-offline-sharp.svg +1 -1
- package/app/assets/icons/cloud-offline.svg +1 -1
- package/app/assets/icons/cloud-outline.svg +1 -1
- package/app/assets/icons/cloud-sharp.svg +1 -1
- package/app/assets/icons/cloud-upload-outline.svg +1 -1
- package/app/assets/icons/cloud-upload-sharp.svg +1 -1
- package/app/assets/icons/cloud-upload.svg +1 -1
- package/app/assets/icons/cloud.svg +1 -1
- package/app/assets/icons/cloudy-night-outline.svg +1 -1
- package/app/assets/icons/cloudy-night-sharp.svg +1 -1
- package/app/assets/icons/cloudy-night.svg +1 -1
- package/app/assets/icons/cloudy-outline.svg +1 -1
- package/app/assets/icons/cloudy-sharp.svg +1 -1
- package/app/assets/icons/cloudy.svg +1 -1
- package/app/assets/icons/code-download-outline.svg +1 -1
- package/app/assets/icons/code-download-sharp.svg +1 -1
- package/app/assets/icons/code-download.svg +1 -1
- package/app/assets/icons/code-outline.svg +1 -1
- package/app/assets/icons/code-sharp.svg +1 -1
- package/app/assets/icons/code-slash-outline.svg +1 -1
- package/app/assets/icons/code-slash-sharp.svg +1 -1
- package/app/assets/icons/code-slash.svg +1 -1
- package/app/assets/icons/code-working-outline.svg +1 -1
- package/app/assets/icons/code-working-sharp.svg +1 -1
- package/app/assets/icons/code-working.svg +1 -1
- package/app/assets/icons/code.svg +1 -1
- package/app/assets/icons/cog-outline.svg +1 -1
- package/app/assets/icons/cog-sharp.svg +1 -1
- package/app/assets/icons/cog.svg +1 -1
- package/app/assets/icons/color-fill-outline.svg +1 -1
- package/app/assets/icons/color-fill-sharp.svg +1 -1
- package/app/assets/icons/color-fill.svg +1 -1
- package/app/assets/icons/color-filter-outline.svg +1 -1
- package/app/assets/icons/color-filter-sharp.svg +1 -1
- package/app/assets/icons/color-filter.svg +1 -1
- package/app/assets/icons/color-palette-outline.svg +1 -1
- package/app/assets/icons/color-palette-sharp.svg +1 -1
- package/app/assets/icons/color-palette.svg +1 -1
- package/app/assets/icons/color-wand-outline.svg +1 -1
- package/app/assets/icons/color-wand-sharp.svg +1 -1
- package/app/assets/icons/color-wand.svg +1 -1
- package/app/assets/icons/compass-outline.svg +1 -1
- package/app/assets/icons/compass-sharp.svg +1 -1
- package/app/assets/icons/compass.svg +1 -1
- package/app/assets/icons/construct-outline.svg +1 -1
- package/app/assets/icons/construct-sharp.svg +1 -1
- package/app/assets/icons/construct.svg +1 -1
- package/app/assets/icons/contract-outline.svg +1 -1
- package/app/assets/icons/contract-sharp.svg +1 -1
- package/app/assets/icons/contract.svg +1 -1
- package/app/assets/icons/contrast-outline.svg +1 -1
- package/app/assets/icons/contrast-sharp.svg +1 -1
- package/app/assets/icons/contrast.svg +1 -1
- package/app/assets/icons/copy-outline.svg +1 -1
- package/app/assets/icons/copy-sharp.svg +1 -1
- package/app/assets/icons/copy.svg +1 -1
- package/app/assets/icons/create-outline.svg +1 -1
- package/app/assets/icons/create-sharp.svg +1 -1
- package/app/assets/icons/create.svg +1 -1
- package/app/assets/icons/crop-outline.svg +1 -1
- package/app/assets/icons/crop-sharp.svg +1 -1
- package/app/assets/icons/crop.svg +1 -1
- package/app/assets/icons/cube-outline.svg +1 -1
- package/app/assets/icons/cube-sharp.svg +1 -1
- package/app/assets/icons/cube.svg +1 -1
- package/app/assets/icons/cut-outline.svg +1 -1
- package/app/assets/icons/cut-sharp.svg +1 -1
- package/app/assets/icons/cut.svg +1 -1
- package/app/assets/icons/desktop-outline.svg +1 -1
- package/app/assets/icons/desktop-sharp.svg +1 -1
- package/app/assets/icons/desktop.svg +1 -1
- package/app/assets/icons/diamond-outline.svg +1 -1
- package/app/assets/icons/diamond-sharp.svg +1 -1
- package/app/assets/icons/diamond.svg +1 -1
- package/app/assets/icons/dice-outline.svg +1 -1
- package/app/assets/icons/dice-sharp.svg +1 -1
- package/app/assets/icons/dice.svg +1 -1
- package/app/assets/icons/disc-outline.svg +1 -1
- package/app/assets/icons/disc-sharp.svg +1 -1
- package/app/assets/icons/disc.svg +1 -1
- package/app/assets/icons/document-attach-outline.svg +1 -1
- package/app/assets/icons/document-attach-sharp.svg +1 -1
- package/app/assets/icons/document-attach.svg +1 -1
- package/app/assets/icons/document-lock-outline.svg +1 -1
- package/app/assets/icons/document-lock-sharp.svg +1 -1
- package/app/assets/icons/document-lock.svg +1 -1
- package/app/assets/icons/document-outline.svg +1 -1
- package/app/assets/icons/document-sharp.svg +1 -1
- package/app/assets/icons/document-text-outline.svg +1 -1
- package/app/assets/icons/document-text-sharp.svg +1 -1
- package/app/assets/icons/document-text.svg +1 -1
- package/app/assets/icons/document.svg +1 -1
- package/app/assets/icons/documents-outline.svg +1 -1
- package/app/assets/icons/documents-sharp.svg +1 -1
- package/app/assets/icons/documents.svg +1 -1
- package/app/assets/icons/download-outline.svg +1 -1
- package/app/assets/icons/download-sharp.svg +1 -1
- package/app/assets/icons/download.svg +1 -1
- package/app/assets/icons/duplicate-outline.svg +1 -1
- package/app/assets/icons/duplicate-sharp.svg +1 -1
- package/app/assets/icons/duplicate.svg +1 -1
- package/app/assets/icons/ear-outline.svg +1 -1
- package/app/assets/icons/ear-sharp.svg +1 -1
- package/app/assets/icons/ear.svg +1 -1
- package/app/assets/icons/earth-outline.svg +1 -1
- package/app/assets/icons/earth-sharp.svg +1 -1
- package/app/assets/icons/earth.svg +1 -1
- package/app/assets/icons/easel-outline.svg +1 -1
- package/app/assets/icons/easel-sharp.svg +1 -1
- package/app/assets/icons/easel.svg +1 -1
- package/app/assets/icons/egg-outline.svg +1 -1
- package/app/assets/icons/egg-sharp.svg +1 -1
- package/app/assets/icons/egg.svg +1 -1
- package/app/assets/icons/ellipse-outline.svg +1 -1
- package/app/assets/icons/ellipse-sharp.svg +1 -1
- package/app/assets/icons/ellipse.svg +1 -1
- package/app/assets/icons/ellipsis-horizontal-circle-outline.svg +1 -1
- package/app/assets/icons/ellipsis-horizontal-circle-sharp.svg +1 -1
- package/app/assets/icons/ellipsis-horizontal-circle.svg +1 -1
- package/app/assets/icons/ellipsis-horizontal-outline.svg +1 -1
- package/app/assets/icons/ellipsis-horizontal-sharp.svg +1 -1
- package/app/assets/icons/ellipsis-horizontal.svg +1 -1
- package/app/assets/icons/ellipsis-vertical-circle-outline.svg +1 -1
- package/app/assets/icons/ellipsis-vertical-circle-sharp.svg +1 -1
- package/app/assets/icons/ellipsis-vertical-circle.svg +1 -1
- package/app/assets/icons/ellipsis-vertical-outline.svg +1 -1
- package/app/assets/icons/ellipsis-vertical-sharp.svg +1 -1
- package/app/assets/icons/ellipsis-vertical.svg +1 -1
- package/app/assets/icons/enter-outline.svg +1 -1
- package/app/assets/icons/enter-sharp.svg +1 -1
- package/app/assets/icons/enter.svg +1 -1
- package/app/assets/icons/exit-outline.svg +1 -1
- package/app/assets/icons/exit-sharp.svg +1 -1
- package/app/assets/icons/exit.svg +1 -1
- package/app/assets/icons/expand-outline.svg +1 -1
- package/app/assets/icons/expand-sharp.svg +1 -1
- package/app/assets/icons/expand.svg +1 -1
- package/app/assets/icons/extension-puzzle-outline.svg +1 -1
- package/app/assets/icons/extension-puzzle-sharp.svg +1 -1
- package/app/assets/icons/extension-puzzle.svg +1 -1
- package/app/assets/icons/eye-off-outline.svg +1 -1
- package/app/assets/icons/eye-off-sharp.svg +1 -1
- package/app/assets/icons/eye-off.svg +1 -1
- package/app/assets/icons/eye-outline.svg +1 -1
- package/app/assets/icons/eye-sharp.svg +1 -1
- package/app/assets/icons/eye.svg +1 -1
- package/app/assets/icons/eyedrop-outline.svg +1 -1
- package/app/assets/icons/eyedrop-sharp.svg +1 -1
- package/app/assets/icons/eyedrop.svg +1 -1
- package/app/assets/icons/fast-food-outline.svg +1 -1
- package/app/assets/icons/fast-food-sharp.svg +1 -1
- package/app/assets/icons/fast-food.svg +1 -1
- package/app/assets/icons/female-outline.svg +1 -1
- package/app/assets/icons/female-sharp.svg +1 -1
- package/app/assets/icons/female.svg +1 -1
- package/app/assets/icons/file-tray-full-outline.svg +1 -1
- package/app/assets/icons/file-tray-full-sharp.svg +1 -1
- package/app/assets/icons/file-tray-full.svg +1 -1
- package/app/assets/icons/file-tray-outline.svg +1 -1
- package/app/assets/icons/file-tray-sharp.svg +1 -1
- package/app/assets/icons/file-tray-stacked-outline.svg +1 -1
- package/app/assets/icons/file-tray-stacked-sharp.svg +1 -1
- package/app/assets/icons/file-tray-stacked.svg +1 -1
- package/app/assets/icons/file-tray.svg +1 -1
- package/app/assets/icons/film-outline.svg +1 -1
- package/app/assets/icons/film-sharp.svg +1 -1
- package/app/assets/icons/film.svg +1 -1
- package/app/assets/icons/filter-circle-outline.svg +1 -1
- package/app/assets/icons/filter-circle-sharp.svg +1 -1
- package/app/assets/icons/filter-circle.svg +1 -1
- package/app/assets/icons/filter-outline.svg +1 -1
- package/app/assets/icons/filter-sharp.svg +1 -1
- package/app/assets/icons/filter.svg +1 -1
- package/app/assets/icons/finger-print-outline.svg +1 -1
- package/app/assets/icons/finger-print-sharp.svg +1 -1
- package/app/assets/icons/finger-print.svg +1 -1
- package/app/assets/icons/fish-outline.svg +1 -1
- package/app/assets/icons/fish-sharp.svg +1 -1
- package/app/assets/icons/fish.svg +1 -1
- package/app/assets/icons/fitness-outline.svg +1 -1
- package/app/assets/icons/fitness-sharp.svg +1 -1
- package/app/assets/icons/fitness.svg +1 -1
- package/app/assets/icons/flag-outline.svg +1 -1
- package/app/assets/icons/flag-sharp.svg +1 -1
- package/app/assets/icons/flag.svg +1 -1
- package/app/assets/icons/flame-outline.svg +1 -1
- package/app/assets/icons/flame-sharp.svg +1 -1
- package/app/assets/icons/flame.svg +1 -1
- package/app/assets/icons/flash-off-outline.svg +1 -1
- package/app/assets/icons/flash-off-sharp.svg +1 -1
- package/app/assets/icons/flash-off.svg +1 -1
- package/app/assets/icons/flash-outline.svg +1 -1
- package/app/assets/icons/flash-sharp.svg +1 -1
- package/app/assets/icons/flash.svg +1 -1
- package/app/assets/icons/flashlight-outline.svg +1 -1
- package/app/assets/icons/flashlight-sharp.svg +1 -1
- package/app/assets/icons/flashlight.svg +1 -1
- package/app/assets/icons/flask-outline.svg +1 -1
- package/app/assets/icons/flask-sharp.svg +1 -1
- package/app/assets/icons/flask.svg +1 -1
- package/app/assets/icons/flower-outline.svg +1 -1
- package/app/assets/icons/flower-sharp.svg +1 -1
- package/app/assets/icons/flower.svg +1 -1
- package/app/assets/icons/folder-open-outline.svg +1 -1
- package/app/assets/icons/folder-open-sharp.svg +1 -1
- package/app/assets/icons/folder-open.svg +1 -1
- package/app/assets/icons/folder-outline.svg +1 -1
- package/app/assets/icons/folder-sharp.svg +1 -1
- package/app/assets/icons/folder.svg +1 -1
- package/app/assets/icons/football-outline.svg +1 -1
- package/app/assets/icons/football-sharp.svg +1 -1
- package/app/assets/icons/football.svg +1 -1
- package/app/assets/icons/footsteps-outline.svg +1 -1
- package/app/assets/icons/footsteps-sharp.svg +1 -1
- package/app/assets/icons/footsteps.svg +1 -1
- package/app/assets/icons/funnel-outline.svg +1 -1
- package/app/assets/icons/funnel-sharp.svg +1 -1
- package/app/assets/icons/funnel.svg +1 -1
- package/app/assets/icons/game-controller-outline.svg +1 -1
- package/app/assets/icons/game-controller-sharp.svg +1 -1
- package/app/assets/icons/game-controller.svg +1 -1
- package/app/assets/icons/gift-outline.svg +1 -1
- package/app/assets/icons/gift-sharp.svg +1 -1
- package/app/assets/icons/gift.svg +1 -1
- package/app/assets/icons/git-branch-outline.svg +1 -1
- package/app/assets/icons/git-branch-sharp.svg +1 -1
- package/app/assets/icons/git-branch.svg +1 -1
- package/app/assets/icons/git-commit-outline.svg +1 -1
- package/app/assets/icons/git-commit-sharp.svg +1 -1
- package/app/assets/icons/git-commit.svg +1 -1
- package/app/assets/icons/git-compare-outline.svg +1 -1
- package/app/assets/icons/git-compare-sharp.svg +1 -1
- package/app/assets/icons/git-compare.svg +1 -1
- package/app/assets/icons/git-merge-outline.svg +1 -1
- package/app/assets/icons/git-merge-sharp.svg +1 -1
- package/app/assets/icons/git-merge.svg +1 -1
- package/app/assets/icons/git-network-outline.svg +1 -1
- package/app/assets/icons/git-network-sharp.svg +1 -1
- package/app/assets/icons/git-network.svg +1 -1
- package/app/assets/icons/git-pull-request-outline.svg +1 -1
- package/app/assets/icons/git-pull-request-sharp.svg +1 -1
- package/app/assets/icons/git-pull-request.svg +1 -1
- package/app/assets/icons/glasses-outline.svg +1 -1
- package/app/assets/icons/glasses-sharp.svg +1 -1
- package/app/assets/icons/glasses.svg +1 -1
- package/app/assets/icons/globe-outline.svg +1 -1
- package/app/assets/icons/globe-sharp.svg +1 -1
- package/app/assets/icons/globe.svg +1 -1
- package/app/assets/icons/golf-outline.svg +1 -1
- package/app/assets/icons/golf-sharp.svg +1 -1
- package/app/assets/icons/golf.svg +1 -1
- package/app/assets/icons/grid-outline.svg +1 -1
- package/app/assets/icons/grid-sharp.svg +1 -1
- package/app/assets/icons/grid.svg +1 -1
- package/app/assets/icons/hammer-outline.svg +1 -1
- package/app/assets/icons/hammer-sharp.svg +1 -1
- package/app/assets/icons/hammer.svg +1 -1
- package/app/assets/icons/hand-left-outline.svg +1 -1
- package/app/assets/icons/hand-left-sharp.svg +1 -1
- package/app/assets/icons/hand-left.svg +1 -1
- package/app/assets/icons/hand-right-outline.svg +1 -1
- package/app/assets/icons/hand-right-sharp.svg +1 -1
- package/app/assets/icons/hand-right.svg +1 -1
- package/app/assets/icons/happy-outline.svg +1 -1
- package/app/assets/icons/happy-sharp.svg +1 -1
- package/app/assets/icons/happy.svg +1 -1
- package/app/assets/icons/hardware-chip-outline.svg +1 -1
- package/app/assets/icons/hardware-chip-sharp.svg +1 -1
- package/app/assets/icons/hardware-chip.svg +1 -1
- package/app/assets/icons/headset-outline.svg +1 -1
- package/app/assets/icons/headset-sharp.svg +1 -1
- package/app/assets/icons/headset.svg +1 -1
- package/app/assets/icons/heart-circle-outline.svg +1 -1
- package/app/assets/icons/heart-circle-sharp.svg +1 -1
- package/app/assets/icons/heart-circle.svg +1 -1
- package/app/assets/icons/heart-dislike-circle-outline.svg +1 -1
- package/app/assets/icons/heart-dislike-circle-sharp.svg +1 -1
- package/app/assets/icons/heart-dislike-circle.svg +1 -1
- package/app/assets/icons/heart-dislike-outline.svg +1 -1
- package/app/assets/icons/heart-dislike-sharp.svg +1 -1
- package/app/assets/icons/heart-dislike.svg +1 -1
- package/app/assets/icons/heart-half-outline.svg +1 -1
- package/app/assets/icons/heart-half-sharp.svg +1 -1
- package/app/assets/icons/heart-half.svg +1 -1
- package/app/assets/icons/heart-outline.svg +1 -1
- package/app/assets/icons/heart-sharp.svg +1 -1
- package/app/assets/icons/heart.svg +1 -1
- package/app/assets/icons/help-buoy-outline.svg +1 -1
- package/app/assets/icons/help-buoy-sharp.svg +1 -1
- package/app/assets/icons/help-buoy.svg +1 -1
- package/app/assets/icons/help-circle-outline.svg +1 -1
- package/app/assets/icons/help-circle-sharp.svg +1 -1
- package/app/assets/icons/help-circle.svg +1 -1
- package/app/assets/icons/help-outline.svg +1 -1
- package/app/assets/icons/help-sharp.svg +1 -1
- package/app/assets/icons/help.svg +1 -1
- package/app/assets/icons/home-outline.svg +1 -1
- package/app/assets/icons/home-sharp.svg +1 -1
- package/app/assets/icons/home.svg +1 -1
- package/app/assets/icons/hourglass-outline.svg +1 -1
- package/app/assets/icons/hourglass-sharp.svg +1 -1
- package/app/assets/icons/hourglass.svg +1 -1
- package/app/assets/icons/ice-cream-outline.svg +1 -1
- package/app/assets/icons/ice-cream-sharp.svg +1 -1
- package/app/assets/icons/ice-cream.svg +1 -1
- package/app/assets/icons/id-card-outline.svg +1 -1
- package/app/assets/icons/id-card-sharp.svg +1 -1
- package/app/assets/icons/id-card.svg +1 -1
- package/app/assets/icons/image-outline.svg +1 -1
- package/app/assets/icons/image-sharp.svg +1 -1
- package/app/assets/icons/image.svg +1 -1
- package/app/assets/icons/images-outline.svg +1 -1
- package/app/assets/icons/images-sharp.svg +1 -1
- package/app/assets/icons/images.svg +1 -1
- package/app/assets/icons/infinite-outline.svg +1 -1
- package/app/assets/icons/infinite-sharp.svg +1 -1
- package/app/assets/icons/infinite.svg +1 -1
- package/app/assets/icons/information-circle-outline.svg +1 -1
- package/app/assets/icons/information-circle-sharp.svg +1 -1
- package/app/assets/icons/information-circle.svg +1 -1
- package/app/assets/icons/information-outline.svg +1 -1
- package/app/assets/icons/information-sharp.svg +1 -1
- package/app/assets/icons/information.svg +1 -1
- package/app/assets/icons/invert-mode-outline.svg +1 -1
- package/app/assets/icons/invert-mode-sharp.svg +1 -1
- package/app/assets/icons/invert-mode.svg +1 -1
- package/app/assets/icons/journal-outline.svg +1 -1
- package/app/assets/icons/journal-sharp.svg +1 -1
- package/app/assets/icons/journal.svg +1 -1
- package/app/assets/icons/key-outline.svg +1 -1
- package/app/assets/icons/key-sharp.svg +1 -1
- package/app/assets/icons/key.svg +1 -1
- package/app/assets/icons/keypad-outline.svg +1 -1
- package/app/assets/icons/keypad-sharp.svg +1 -1
- package/app/assets/icons/keypad.svg +1 -1
- package/app/assets/icons/language-outline.svg +1 -1
- package/app/assets/icons/language-sharp.svg +1 -1
- package/app/assets/icons/language.svg +1 -1
- package/app/assets/icons/laptop-outline.svg +1 -1
- package/app/assets/icons/laptop-sharp.svg +1 -1
- package/app/assets/icons/laptop.svg +1 -1
- package/app/assets/icons/layers-outline.svg +1 -1
- package/app/assets/icons/layers-sharp.svg +1 -1
- package/app/assets/icons/layers.svg +1 -1
- package/app/assets/icons/leaf-outline.svg +1 -1
- package/app/assets/icons/leaf-sharp.svg +1 -1
- package/app/assets/icons/leaf.svg +1 -1
- package/app/assets/icons/library-outline.svg +1 -1
- package/app/assets/icons/library-sharp.svg +1 -1
- package/app/assets/icons/library.svg +1 -1
- package/app/assets/icons/link-outline.svg +1 -1
- package/app/assets/icons/link-sharp.svg +1 -1
- package/app/assets/icons/link.svg +1 -1
- package/app/assets/icons/list-circle-outline.svg +1 -1
- package/app/assets/icons/list-circle-sharp.svg +1 -1
- package/app/assets/icons/list-circle.svg +1 -1
- package/app/assets/icons/list-outline.svg +1 -1
- package/app/assets/icons/list-sharp.svg +1 -1
- package/app/assets/icons/list.svg +1 -1
- package/app/assets/icons/locate-outline.svg +1 -1
- package/app/assets/icons/locate-sharp.svg +1 -1
- package/app/assets/icons/locate.svg +1 -1
- package/app/assets/icons/location-outline.svg +1 -1
- package/app/assets/icons/location-sharp.svg +1 -1
- package/app/assets/icons/location.svg +1 -1
- package/app/assets/icons/lock-closed-outline.svg +1 -1
- package/app/assets/icons/lock-closed-sharp.svg +1 -1
- package/app/assets/icons/lock-closed.svg +1 -1
- package/app/assets/icons/lock-open-outline.svg +1 -1
- package/app/assets/icons/lock-open-sharp.svg +1 -1
- package/app/assets/icons/lock-open.svg +1 -1
- package/app/assets/icons/log-in-outline.svg +1 -1
- package/app/assets/icons/log-in-sharp.svg +1 -1
- package/app/assets/icons/log-in.svg +1 -1
- package/app/assets/icons/log-out-outline.svg +1 -1
- package/app/assets/icons/log-out-sharp.svg +1 -1
- package/app/assets/icons/log-out.svg +1 -1
- package/app/assets/icons/logo-alipay.svg +1 -1
- package/app/assets/icons/logo-amazon.svg +1 -1
- package/app/assets/icons/logo-amplify.svg +1 -1
- package/app/assets/icons/logo-android.svg +1 -1
- package/app/assets/icons/logo-angular.svg +1 -1
- package/app/assets/icons/logo-apple-appstore.svg +1 -1
- package/app/assets/icons/logo-apple-ar.svg +1 -1
- package/app/assets/icons/logo-apple.svg +1 -1
- package/app/assets/icons/logo-behance.svg +1 -1
- package/app/assets/icons/logo-bitbucket.svg +1 -1
- package/app/assets/icons/logo-bitcoin.svg +1 -1
- package/app/assets/icons/logo-buffer.svg +1 -1
- package/app/assets/icons/logo-capacitor.svg +1 -1
- package/app/assets/icons/logo-chrome.svg +1 -1
- package/app/assets/icons/logo-closed-captioning.svg +1 -1
- package/app/assets/icons/logo-codepen.svg +1 -1
- package/app/assets/icons/logo-css3.svg +1 -1
- package/app/assets/icons/logo-designernews.svg +1 -1
- package/app/assets/icons/logo-deviantart.svg +1 -1
- package/app/assets/icons/logo-discord.svg +1 -1
- package/app/assets/icons/logo-docker.svg +1 -1
- package/app/assets/icons/logo-dribbble.svg +1 -1
- package/app/assets/icons/logo-dropbox.svg +1 -1
- package/app/assets/icons/logo-edge.svg +1 -1
- package/app/assets/icons/logo-electron.svg +1 -1
- package/app/assets/icons/logo-euro.svg +1 -1
- package/app/assets/icons/logo-facebook.svg +1 -1
- package/app/assets/icons/logo-figma.svg +1 -1
- package/app/assets/icons/logo-firebase.svg +1 -1
- package/app/assets/icons/logo-firefox.svg +1 -1
- package/app/assets/icons/logo-flickr.svg +1 -1
- package/app/assets/icons/logo-foursquare.svg +1 -1
- package/app/assets/icons/logo-github.svg +1 -1
- package/app/assets/icons/logo-gitlab.svg +1 -1
- package/app/assets/icons/logo-google-playstore.svg +1 -1
- package/app/assets/icons/logo-google.svg +1 -1
- package/app/assets/icons/logo-hackernews.svg +1 -1
- package/app/assets/icons/logo-html5.svg +1 -1
- package/app/assets/icons/logo-instagram.svg +1 -1
- package/app/assets/icons/logo-ionic.svg +1 -1
- package/app/assets/icons/logo-ionitron.svg +1 -1
- package/app/assets/icons/logo-javascript.svg +1 -1
- package/app/assets/icons/logo-laravel.svg +1 -1
- package/app/assets/icons/logo-linkedin.svg +1 -1
- package/app/assets/icons/logo-markdown.svg +1 -1
- package/app/assets/icons/logo-mastodon.svg +1 -1
- package/app/assets/icons/logo-medium.svg +1 -1
- package/app/assets/icons/logo-microsoft.svg +1 -1
- package/app/assets/icons/logo-no-smoking.svg +1 -1
- package/app/assets/icons/logo-nodejs.svg +1 -1
- package/app/assets/icons/logo-npm.svg +1 -1
- package/app/assets/icons/logo-octocat.svg +1 -1
- package/app/assets/icons/logo-paypal.svg +1 -1
- package/app/assets/icons/logo-pinterest.svg +1 -1
- package/app/assets/icons/logo-playstation.svg +1 -1
- package/app/assets/icons/logo-pwa.svg +1 -1
- package/app/assets/icons/logo-python.svg +1 -1
- package/app/assets/icons/logo-react.svg +1 -1
- package/app/assets/icons/logo-reddit.svg +1 -1
- package/app/assets/icons/logo-rss.svg +1 -1
- package/app/assets/icons/logo-sass.svg +1 -1
- package/app/assets/icons/logo-skype.svg +1 -1
- package/app/assets/icons/logo-slack.svg +1 -1
- package/app/assets/icons/logo-snapchat.svg +1 -1
- package/app/assets/icons/logo-soundcloud.svg +1 -1
- package/app/assets/icons/logo-stackoverflow.svg +1 -1
- package/app/assets/icons/logo-steam.svg +1 -1
- package/app/assets/icons/logo-stencil.svg +1 -1
- package/app/assets/icons/logo-tableau.svg +1 -1
- package/app/assets/icons/logo-tiktok.svg +1 -1
- package/app/assets/icons/logo-tumblr.svg +1 -1
- package/app/assets/icons/logo-tux.svg +1 -1
- package/app/assets/icons/logo-twitch.svg +1 -1
- package/app/assets/icons/logo-twitter.svg +1 -1
- package/app/assets/icons/logo-usd.svg +1 -1
- package/app/assets/icons/logo-venmo.svg +1 -1
- package/app/assets/icons/logo-vercel.svg +1 -1
- package/app/assets/icons/logo-vimeo.svg +1 -1
- package/app/assets/icons/logo-vk.svg +1 -1
- package/app/assets/icons/logo-vue.svg +1 -1
- package/app/assets/icons/logo-web-component.svg +1 -1
- package/app/assets/icons/logo-wechat.svg +1 -1
- package/app/assets/icons/logo-whatsapp.svg +1 -1
- package/app/assets/icons/logo-windows.svg +1 -1
- package/app/assets/icons/logo-wordpress.svg +1 -1
- package/app/assets/icons/logo-xbox.svg +1 -1
- package/app/assets/icons/logo-xing.svg +1 -1
- package/app/assets/icons/logo-yahoo.svg +1 -1
- package/app/assets/icons/logo-yen.svg +1 -1
- package/app/assets/icons/logo-youtube.svg +1 -1
- package/app/assets/icons/magnet-outline.svg +1 -1
- package/app/assets/icons/magnet-sharp.svg +1 -1
- package/app/assets/icons/magnet.svg +1 -1
- package/app/assets/icons/mail-open-outline.svg +1 -1
- package/app/assets/icons/mail-open-sharp.svg +1 -1
- package/app/assets/icons/mail-open.svg +1 -1
- package/app/assets/icons/mail-outline.svg +1 -1
- package/app/assets/icons/mail-sharp.svg +1 -1
- package/app/assets/icons/mail-unread-outline.svg +1 -1
- package/app/assets/icons/mail-unread-sharp.svg +1 -1
- package/app/assets/icons/mail-unread.svg +1 -1
- package/app/assets/icons/mail.svg +1 -1
- package/app/assets/icons/male-female-outline.svg +1 -1
- package/app/assets/icons/male-female-sharp.svg +1 -1
- package/app/assets/icons/male-female.svg +1 -1
- package/app/assets/icons/male-outline.svg +1 -1
- package/app/assets/icons/male-sharp.svg +1 -1
- package/app/assets/icons/male.svg +1 -1
- package/app/assets/icons/man-outline.svg +1 -1
- package/app/assets/icons/man-sharp.svg +1 -1
- package/app/assets/icons/man.svg +1 -1
- package/app/assets/icons/map-outline.svg +1 -1
- package/app/assets/icons/map-sharp.svg +1 -1
- package/app/assets/icons/map.svg +1 -1
- package/app/assets/icons/medal-outline.svg +1 -1
- package/app/assets/icons/medal-sharp.svg +1 -1
- package/app/assets/icons/medal.svg +1 -1
- package/app/assets/icons/medical-outline.svg +1 -1
- package/app/assets/icons/medical-sharp.svg +1 -1
- package/app/assets/icons/medical.svg +1 -1
- package/app/assets/icons/medkit-outline.svg +1 -1
- package/app/assets/icons/medkit-sharp.svg +1 -1
- package/app/assets/icons/medkit.svg +1 -1
- package/app/assets/icons/megaphone-outline.svg +1 -1
- package/app/assets/icons/megaphone-sharp.svg +1 -1
- package/app/assets/icons/megaphone.svg +1 -1
- package/app/assets/icons/menu-outline.svg +1 -1
- package/app/assets/icons/menu-sharp.svg +1 -1
- package/app/assets/icons/menu.svg +1 -1
- package/app/assets/icons/mic-circle-outline.svg +1 -1
- package/app/assets/icons/mic-circle-sharp.svg +1 -1
- package/app/assets/icons/mic-circle.svg +1 -1
- package/app/assets/icons/mic-off-circle-outline.svg +1 -1
- package/app/assets/icons/mic-off-circle-sharp.svg +1 -1
- package/app/assets/icons/mic-off-circle.svg +1 -1
- package/app/assets/icons/mic-off-outline.svg +1 -1
- package/app/assets/icons/mic-off-sharp.svg +1 -1
- package/app/assets/icons/mic-off.svg +1 -1
- package/app/assets/icons/mic-outline.svg +1 -1
- package/app/assets/icons/mic-sharp.svg +1 -1
- package/app/assets/icons/mic.svg +1 -1
- package/app/assets/icons/moon-outline.svg +1 -1
- package/app/assets/icons/moon-sharp.svg +1 -1
- package/app/assets/icons/moon.svg +1 -1
- package/app/assets/icons/move-outline.svg +1 -1
- package/app/assets/icons/move-sharp.svg +1 -1
- package/app/assets/icons/move.svg +1 -1
- package/app/assets/icons/musical-note-outline.svg +1 -1
- package/app/assets/icons/musical-note-sharp.svg +1 -1
- package/app/assets/icons/musical-note.svg +1 -1
- package/app/assets/icons/musical-notes-outline.svg +1 -1
- package/app/assets/icons/musical-notes-sharp.svg +1 -1
- package/app/assets/icons/musical-notes.svg +1 -1
- package/app/assets/icons/navigate-circle-outline.svg +1 -1
- package/app/assets/icons/navigate-circle-sharp.svg +1 -1
- package/app/assets/icons/navigate-circle.svg +1 -1
- package/app/assets/icons/navigate-outline.svg +1 -1
- package/app/assets/icons/navigate-sharp.svg +1 -1
- package/app/assets/icons/navigate.svg +1 -1
- package/app/assets/icons/newspaper-outline.svg +1 -1
- package/app/assets/icons/newspaper-sharp.svg +1 -1
- package/app/assets/icons/newspaper.svg +1 -1
- package/app/assets/icons/notifications-circle-outline.svg +1 -1
- package/app/assets/icons/notifications-circle-sharp.svg +1 -1
- package/app/assets/icons/notifications-circle.svg +1 -1
- package/app/assets/icons/notifications-off-circle-outline.svg +1 -1
- package/app/assets/icons/notifications-off-circle-sharp.svg +1 -1
- package/app/assets/icons/notifications-off-circle.svg +1 -1
- package/app/assets/icons/notifications-off-outline.svg +1 -1
- package/app/assets/icons/notifications-off-sharp.svg +1 -1
- package/app/assets/icons/notifications-off.svg +1 -1
- package/app/assets/icons/notifications-outline.svg +1 -1
- package/app/assets/icons/notifications-sharp.svg +1 -1
- package/app/assets/icons/notifications.svg +1 -1
- package/app/assets/icons/nuclear-outline.svg +1 -1
- package/app/assets/icons/nuclear-sharp.svg +1 -1
- package/app/assets/icons/nuclear.svg +1 -1
- package/app/assets/icons/nutrition-outline.svg +1 -1
- package/app/assets/icons/nutrition-sharp.svg +1 -1
- package/app/assets/icons/nutrition.svg +1 -1
- package/app/assets/icons/open-outline.svg +1 -1
- package/app/assets/icons/open-sharp.svg +1 -1
- package/app/assets/icons/open.svg +1 -1
- package/app/assets/icons/options-outline.svg +1 -1
- package/app/assets/icons/options-sharp.svg +1 -1
- package/app/assets/icons/options.svg +1 -1
- package/app/assets/icons/paper-plane-outline.svg +1 -1
- package/app/assets/icons/paper-plane-sharp.svg +1 -1
- package/app/assets/icons/paper-plane.svg +1 -1
- package/app/assets/icons/partly-sunny-outline.svg +1 -1
- package/app/assets/icons/partly-sunny-sharp.svg +1 -1
- package/app/assets/icons/partly-sunny.svg +1 -1
- package/app/assets/icons/pause-circle-outline.svg +1 -1
- package/app/assets/icons/pause-circle-sharp.svg +1 -1
- package/app/assets/icons/pause-circle.svg +1 -1
- package/app/assets/icons/pause-outline.svg +1 -1
- package/app/assets/icons/pause-sharp.svg +1 -1
- package/app/assets/icons/pause.svg +1 -1
- package/app/assets/icons/paw-outline.svg +1 -1
- package/app/assets/icons/paw-sharp.svg +1 -1
- package/app/assets/icons/paw.svg +1 -1
- package/app/assets/icons/pencil-outline.svg +1 -1
- package/app/assets/icons/pencil-sharp.svg +1 -1
- package/app/assets/icons/pencil.svg +1 -1
- package/app/assets/icons/people-circle-outline.svg +1 -1
- package/app/assets/icons/people-circle-sharp.svg +1 -1
- package/app/assets/icons/people-circle.svg +1 -1
- package/app/assets/icons/people-outline.svg +1 -1
- package/app/assets/icons/people-sharp.svg +1 -1
- package/app/assets/icons/people.svg +1 -1
- package/app/assets/icons/person-add-outline.svg +1 -1
- package/app/assets/icons/person-add-sharp.svg +1 -1
- package/app/assets/icons/person-add.svg +1 -1
- package/app/assets/icons/person-circle-outline.svg +1 -1
- package/app/assets/icons/person-circle-sharp.svg +1 -1
- package/app/assets/icons/person-circle.svg +1 -1
- package/app/assets/icons/person-outline.svg +1 -1
- package/app/assets/icons/person-remove-outline.svg +1 -1
- package/app/assets/icons/person-remove-sharp.svg +1 -1
- package/app/assets/icons/person-remove.svg +1 -1
- package/app/assets/icons/person-sharp.svg +1 -1
- package/app/assets/icons/person.svg +1 -1
- package/app/assets/icons/phone-landscape-outline.svg +1 -1
- package/app/assets/icons/phone-landscape-sharp.svg +1 -1
- package/app/assets/icons/phone-landscape.svg +1 -1
- package/app/assets/icons/phone-portrait-outline.svg +1 -1
- package/app/assets/icons/phone-portrait-sharp.svg +1 -1
- package/app/assets/icons/phone-portrait.svg +1 -1
- package/app/assets/icons/pie-chart-outline.svg +1 -1
- package/app/assets/icons/pie-chart-sharp.svg +1 -1
- package/app/assets/icons/pie-chart.svg +1 -1
- package/app/assets/icons/pin-outline.svg +1 -1
- package/app/assets/icons/pin-sharp.svg +1 -1
- package/app/assets/icons/pin.svg +1 -1
- package/app/assets/icons/pint-outline.svg +1 -1
- package/app/assets/icons/pint-sharp.svg +1 -1
- package/app/assets/icons/pint.svg +1 -1
- package/app/assets/icons/pizza-outline.svg +1 -1
- package/app/assets/icons/pizza-sharp.svg +1 -1
- package/app/assets/icons/pizza.svg +1 -1
- package/app/assets/icons/planet-outline.svg +1 -1
- package/app/assets/icons/planet-sharp.svg +1 -1
- package/app/assets/icons/planet.svg +1 -1
- package/app/assets/icons/play-back-circle-outline.svg +1 -1
- package/app/assets/icons/play-back-circle-sharp.svg +1 -1
- package/app/assets/icons/play-back-circle.svg +1 -1
- package/app/assets/icons/play-back-outline.svg +1 -1
- package/app/assets/icons/play-back-sharp.svg +1 -1
- package/app/assets/icons/play-back.svg +1 -1
- package/app/assets/icons/play-circle-outline.svg +1 -1
- package/app/assets/icons/play-circle-sharp.svg +1 -1
- package/app/assets/icons/play-circle.svg +1 -1
- package/app/assets/icons/play-forward-circle-outline.svg +1 -1
- package/app/assets/icons/play-forward-circle-sharp.svg +1 -1
- package/app/assets/icons/play-forward-circle.svg +1 -1
- package/app/assets/icons/play-forward-outline.svg +1 -1
- package/app/assets/icons/play-forward-sharp.svg +1 -1
- package/app/assets/icons/play-forward.svg +1 -1
- package/app/assets/icons/play-outline.svg +1 -1
- package/app/assets/icons/play-sharp.svg +1 -1
- package/app/assets/icons/play-skip-back-circle-outline.svg +1 -1
- package/app/assets/icons/play-skip-back-circle-sharp.svg +1 -1
- package/app/assets/icons/play-skip-back-circle.svg +1 -1
- package/app/assets/icons/play-skip-back-outline.svg +1 -1
- package/app/assets/icons/play-skip-back-sharp.svg +1 -1
- package/app/assets/icons/play-skip-back.svg +1 -1
- package/app/assets/icons/play-skip-forward-circle-outline.svg +1 -1
- package/app/assets/icons/play-skip-forward-circle-sharp.svg +1 -1
- package/app/assets/icons/play-skip-forward-circle.svg +1 -1
- package/app/assets/icons/play-skip-forward-outline.svg +1 -1
- package/app/assets/icons/play-skip-forward-sharp.svg +1 -1
- package/app/assets/icons/play-skip-forward.svg +1 -1
- package/app/assets/icons/play.svg +1 -1
- package/app/assets/icons/podium-outline.svg +1 -1
- package/app/assets/icons/podium-sharp.svg +1 -1
- package/app/assets/icons/podium.svg +1 -1
- package/app/assets/icons/power-outline.svg +1 -1
- package/app/assets/icons/power-sharp.svg +1 -1
- package/app/assets/icons/power.svg +1 -1
- package/app/assets/icons/pricetag-outline.svg +1 -1
- package/app/assets/icons/pricetag-sharp.svg +1 -1
- package/app/assets/icons/pricetag.svg +1 -1
- package/app/assets/icons/pricetags-outline.svg +1 -1
- package/app/assets/icons/pricetags-sharp.svg +1 -1
- package/app/assets/icons/pricetags.svg +1 -1
- package/app/assets/icons/print-outline.svg +1 -1
- package/app/assets/icons/print-sharp.svg +1 -1
- package/app/assets/icons/print.svg +1 -1
- package/app/assets/icons/prism-outline.svg +1 -1
- package/app/assets/icons/prism-sharp.svg +1 -1
- package/app/assets/icons/prism.svg +1 -1
- package/app/assets/icons/pulse-outline.svg +1 -1
- package/app/assets/icons/pulse-sharp.svg +1 -1
- package/app/assets/icons/pulse.svg +1 -1
- package/app/assets/icons/push-outline.svg +1 -1
- package/app/assets/icons/push-sharp.svg +1 -1
- package/app/assets/icons/push.svg +1 -1
- package/app/assets/icons/qr-code-outline.svg +1 -1
- package/app/assets/icons/qr-code-sharp.svg +1 -1
- package/app/assets/icons/qr-code.svg +1 -1
- package/app/assets/icons/radio-button-off-outline.svg +1 -1
- package/app/assets/icons/radio-button-off-sharp.svg +1 -1
- package/app/assets/icons/radio-button-off.svg +1 -1
- package/app/assets/icons/radio-button-on-outline.svg +1 -1
- package/app/assets/icons/radio-button-on-sharp.svg +1 -1
- package/app/assets/icons/radio-button-on.svg +1 -1
- package/app/assets/icons/radio-outline.svg +1 -1
- package/app/assets/icons/radio-sharp.svg +1 -1
- package/app/assets/icons/radio.svg +1 -1
- package/app/assets/icons/rainy-outline.svg +1 -1
- package/app/assets/icons/rainy-sharp.svg +1 -1
- package/app/assets/icons/rainy.svg +1 -1
- package/app/assets/icons/reader-outline.svg +1 -1
- package/app/assets/icons/reader-sharp.svg +1 -1
- package/app/assets/icons/reader.svg +1 -1
- package/app/assets/icons/receipt-outline.svg +1 -1
- package/app/assets/icons/receipt-sharp.svg +1 -1
- package/app/assets/icons/receipt.svg +1 -1
- package/app/assets/icons/recording-outline.svg +1 -1
- package/app/assets/icons/recording-sharp.svg +1 -1
- package/app/assets/icons/recording.svg +1 -1
- package/app/assets/icons/refresh-circle-outline.svg +1 -1
- package/app/assets/icons/refresh-circle-sharp.svg +1 -1
- package/app/assets/icons/refresh-circle.svg +1 -1
- package/app/assets/icons/refresh-outline.svg +1 -1
- package/app/assets/icons/refresh-sharp.svg +1 -1
- package/app/assets/icons/refresh.svg +1 -1
- package/app/assets/icons/reload-circle-outline.svg +1 -1
- package/app/assets/icons/reload-circle-sharp.svg +1 -1
- package/app/assets/icons/reload-circle.svg +1 -1
- package/app/assets/icons/reload-outline.svg +1 -1
- package/app/assets/icons/reload-sharp.svg +1 -1
- package/app/assets/icons/reload.svg +1 -1
- package/app/assets/icons/remove-circle-outline.svg +1 -1
- package/app/assets/icons/remove-circle-sharp.svg +1 -1
- package/app/assets/icons/remove-circle.svg +1 -1
- package/app/assets/icons/remove-outline.svg +1 -1
- package/app/assets/icons/remove-sharp.svg +1 -1
- package/app/assets/icons/remove.svg +1 -1
- package/app/assets/icons/reorder-four-outline.svg +1 -1
- package/app/assets/icons/reorder-four-sharp.svg +1 -1
- package/app/assets/icons/reorder-four.svg +1 -1
- package/app/assets/icons/reorder-three-outline.svg +1 -1
- package/app/assets/icons/reorder-three-sharp.svg +1 -1
- package/app/assets/icons/reorder-three.svg +1 -1
- package/app/assets/icons/reorder-two-outline.svg +1 -1
- package/app/assets/icons/reorder-two-sharp.svg +1 -1
- package/app/assets/icons/reorder-two.svg +1 -1
- package/app/assets/icons/repeat-outline.svg +1 -1
- package/app/assets/icons/repeat-sharp.svg +1 -1
- package/app/assets/icons/repeat.svg +1 -1
- package/app/assets/icons/resize-outline.svg +1 -1
- package/app/assets/icons/resize-sharp.svg +1 -1
- package/app/assets/icons/resize.svg +1 -1
- package/app/assets/icons/restaurant-outline.svg +1 -1
- package/app/assets/icons/restaurant-sharp.svg +1 -1
- package/app/assets/icons/restaurant.svg +1 -1
- package/app/assets/icons/return-down-back-outline.svg +1 -1
- package/app/assets/icons/return-down-back-sharp.svg +1 -1
- package/app/assets/icons/return-down-back.svg +1 -1
- package/app/assets/icons/return-down-forward-outline.svg +1 -1
- package/app/assets/icons/return-down-forward-sharp.svg +1 -1
- package/app/assets/icons/return-down-forward.svg +1 -1
- package/app/assets/icons/return-up-back-outline.svg +1 -1
- package/app/assets/icons/return-up-back-sharp.svg +1 -1
- package/app/assets/icons/return-up-back.svg +1 -1
- package/app/assets/icons/return-up-forward-outline.svg +1 -1
- package/app/assets/icons/return-up-forward-sharp.svg +1 -1
- package/app/assets/icons/return-up-forward.svg +1 -1
- package/app/assets/icons/ribbon-outline.svg +1 -1
- package/app/assets/icons/ribbon-sharp.svg +1 -1
- package/app/assets/icons/ribbon.svg +1 -1
- package/app/assets/icons/rocket-outline.svg +1 -1
- package/app/assets/icons/rocket-sharp.svg +1 -1
- package/app/assets/icons/rocket.svg +1 -1
- package/app/assets/icons/rose-outline.svg +1 -1
- package/app/assets/icons/rose-sharp.svg +1 -1
- package/app/assets/icons/rose.svg +1 -1
- package/app/assets/icons/sad-outline.svg +1 -1
- package/app/assets/icons/sad-sharp.svg +1 -1
- package/app/assets/icons/sad.svg +1 -1
- package/app/assets/icons/save-outline.svg +1 -1
- package/app/assets/icons/save-sharp.svg +1 -1
- package/app/assets/icons/save.svg +1 -1
- package/app/assets/icons/scale-outline.svg +1 -1
- package/app/assets/icons/scale-sharp.svg +1 -1
- package/app/assets/icons/scale.svg +1 -1
- package/app/assets/icons/scan-circle-outline.svg +1 -1
- package/app/assets/icons/scan-circle-sharp.svg +1 -1
- package/app/assets/icons/scan-circle.svg +1 -1
- package/app/assets/icons/scan-outline.svg +1 -1
- package/app/assets/icons/scan-sharp.svg +1 -1
- package/app/assets/icons/scan.svg +1 -1
- package/app/assets/icons/school-outline.svg +1 -1
- package/app/assets/icons/school-sharp.svg +1 -1
- package/app/assets/icons/school.svg +1 -1
- package/app/assets/icons/search-circle-outline.svg +1 -1
- package/app/assets/icons/search-circle-sharp.svg +1 -1
- package/app/assets/icons/search-circle.svg +1 -1
- package/app/assets/icons/search-outline.svg +1 -1
- package/app/assets/icons/search-sharp.svg +1 -1
- package/app/assets/icons/search.svg +1 -1
- package/app/assets/icons/send-outline.svg +1 -1
- package/app/assets/icons/send-sharp.svg +1 -1
- package/app/assets/icons/send.svg +1 -1
- package/app/assets/icons/server-outline.svg +1 -1
- package/app/assets/icons/server-sharp.svg +1 -1
- package/app/assets/icons/server.svg +1 -1
- package/app/assets/icons/settings-outline.svg +1 -1
- package/app/assets/icons/settings-sharp.svg +1 -1
- package/app/assets/icons/settings.svg +1 -1
- package/app/assets/icons/shapes-outline.svg +1 -1
- package/app/assets/icons/shapes-sharp.svg +1 -1
- package/app/assets/icons/shapes.svg +1 -1
- package/app/assets/icons/share-outline.svg +1 -1
- package/app/assets/icons/share-sharp.svg +1 -1
- package/app/assets/icons/share-social-outline.svg +1 -1
- package/app/assets/icons/share-social-sharp.svg +1 -1
- package/app/assets/icons/share-social.svg +1 -1
- package/app/assets/icons/share.svg +1 -1
- package/app/assets/icons/shield-checkmark-outline.svg +1 -1
- package/app/assets/icons/shield-checkmark-sharp.svg +1 -1
- package/app/assets/icons/shield-checkmark.svg +1 -1
- package/app/assets/icons/shield-half-outline.svg +1 -1
- package/app/assets/icons/shield-half-sharp.svg +1 -1
- package/app/assets/icons/shield-half.svg +1 -1
- package/app/assets/icons/shield-outline.svg +1 -1
- package/app/assets/icons/shield-sharp.svg +1 -1
- package/app/assets/icons/shield.svg +1 -1
- package/app/assets/icons/shirt-outline.svg +1 -1
- package/app/assets/icons/shirt-sharp.svg +1 -1
- package/app/assets/icons/shirt.svg +1 -1
- package/app/assets/icons/shuffle-outline.svg +1 -1
- package/app/assets/icons/shuffle-sharp.svg +1 -1
- package/app/assets/icons/shuffle.svg +1 -1
- package/app/assets/icons/skull-outline.svg +1 -1
- package/app/assets/icons/skull-sharp.svg +1 -1
- package/app/assets/icons/skull.svg +1 -1
- package/app/assets/icons/snow-outline.svg +1 -1
- package/app/assets/icons/snow-sharp.svg +1 -1
- package/app/assets/icons/snow.svg +1 -1
- package/app/assets/icons/sparkles-outline.svg +1 -1
- package/app/assets/icons/sparkles-sharp.svg +1 -1
- package/app/assets/icons/sparkles.svg +1 -1
- package/app/assets/icons/speedometer-outline.svg +1 -1
- package/app/assets/icons/speedometer-sharp.svg +1 -1
- package/app/assets/icons/speedometer.svg +1 -1
- package/app/assets/icons/square-outline.svg +1 -1
- package/app/assets/icons/square-sharp.svg +1 -1
- package/app/assets/icons/square.svg +1 -1
- package/app/assets/icons/star-half-outline.svg +1 -1
- package/app/assets/icons/star-half-sharp.svg +1 -1
- package/app/assets/icons/star-half.svg +1 -1
- package/app/assets/icons/star-outline.svg +1 -1
- package/app/assets/icons/star-sharp.svg +1 -1
- package/app/assets/icons/star.svg +1 -1
- package/app/assets/icons/stats-chart-outline.svg +1 -1
- package/app/assets/icons/stats-chart-sharp.svg +1 -1
- package/app/assets/icons/stats-chart.svg +1 -1
- package/app/assets/icons/stop-circle-outline.svg +1 -1
- package/app/assets/icons/stop-circle-sharp.svg +1 -1
- package/app/assets/icons/stop-circle.svg +1 -1
- package/app/assets/icons/stop-outline.svg +1 -1
- package/app/assets/icons/stop-sharp.svg +1 -1
- package/app/assets/icons/stop.svg +1 -1
- package/app/assets/icons/stopwatch-outline.svg +1 -1
- package/app/assets/icons/stopwatch-sharp.svg +1 -1
- package/app/assets/icons/stopwatch.svg +1 -1
- package/app/assets/icons/storefront-outline.svg +1 -1
- package/app/assets/icons/storefront-sharp.svg +1 -1
- package/app/assets/icons/storefront.svg +1 -1
- package/app/assets/icons/subway-outline.svg +1 -1
- package/app/assets/icons/subway-sharp.svg +1 -1
- package/app/assets/icons/subway.svg +1 -1
- package/app/assets/icons/sunny-outline.svg +1 -1
- package/app/assets/icons/sunny-sharp.svg +1 -1
- package/app/assets/icons/sunny.svg +1 -1
- package/app/assets/icons/swap-horizontal-outline.svg +1 -1
- package/app/assets/icons/swap-horizontal-sharp.svg +1 -1
- package/app/assets/icons/swap-horizontal.svg +1 -1
- package/app/assets/icons/swap-vertical-outline.svg +1 -1
- package/app/assets/icons/swap-vertical-sharp.svg +1 -1
- package/app/assets/icons/swap-vertical.svg +1 -1
- package/app/assets/icons/sync-circle-outline.svg +1 -1
- package/app/assets/icons/sync-circle-sharp.svg +1 -1
- package/app/assets/icons/sync-circle.svg +1 -1
- package/app/assets/icons/sync-outline.svg +1 -1
- package/app/assets/icons/sync-sharp.svg +1 -1
- package/app/assets/icons/sync.svg +1 -1
- package/app/assets/icons/tablet-landscape-outline.svg +1 -1
- package/app/assets/icons/tablet-landscape-sharp.svg +1 -1
- package/app/assets/icons/tablet-landscape.svg +1 -1
- package/app/assets/icons/tablet-portrait-outline.svg +1 -1
- package/app/assets/icons/tablet-portrait-sharp.svg +1 -1
- package/app/assets/icons/tablet-portrait.svg +1 -1
- package/app/assets/icons/telescope-outline.svg +1 -1
- package/app/assets/icons/telescope-sharp.svg +1 -1
- package/app/assets/icons/telescope.svg +1 -1
- package/app/assets/icons/tennisball-outline.svg +1 -1
- package/app/assets/icons/tennisball-sharp.svg +1 -1
- package/app/assets/icons/tennisball.svg +1 -1
- package/app/assets/icons/terminal-outline.svg +1 -1
- package/app/assets/icons/terminal-sharp.svg +1 -1
- package/app/assets/icons/terminal.svg +1 -1
- package/app/assets/icons/text-outline.svg +1 -1
- package/app/assets/icons/text-sharp.svg +1 -1
- package/app/assets/icons/text.svg +1 -1
- package/app/assets/icons/thermometer-outline.svg +1 -1
- package/app/assets/icons/thermometer-sharp.svg +1 -1
- package/app/assets/icons/thermometer.svg +1 -1
- package/app/assets/icons/thumbs-down-outline.svg +1 -1
- package/app/assets/icons/thumbs-down-sharp.svg +1 -1
- package/app/assets/icons/thumbs-down.svg +1 -1
- package/app/assets/icons/thumbs-up-outline.svg +1 -1
- package/app/assets/icons/thumbs-up-sharp.svg +1 -1
- package/app/assets/icons/thumbs-up.svg +1 -1
- package/app/assets/icons/thunderstorm-outline.svg +1 -1
- package/app/assets/icons/thunderstorm-sharp.svg +1 -1
- package/app/assets/icons/thunderstorm.svg +1 -1
- package/app/assets/icons/ticket-outline.svg +1 -1
- package/app/assets/icons/ticket-sharp.svg +1 -1
- package/app/assets/icons/ticket.svg +1 -1
- package/app/assets/icons/time-outline.svg +1 -1
- package/app/assets/icons/time-sharp.svg +1 -1
- package/app/assets/icons/time.svg +1 -1
- package/app/assets/icons/timer-outline.svg +1 -1
- package/app/assets/icons/timer-sharp.svg +1 -1
- package/app/assets/icons/timer.svg +1 -1
- package/app/assets/icons/today-outline.svg +1 -1
- package/app/assets/icons/today-sharp.svg +1 -1
- package/app/assets/icons/today.svg +1 -1
- package/app/assets/icons/toggle-outline.svg +1 -1
- package/app/assets/icons/toggle-sharp.svg +1 -1
- package/app/assets/icons/toggle.svg +1 -1
- package/app/assets/icons/trail-sign-outline.svg +1 -1
- package/app/assets/icons/trail-sign-sharp.svg +1 -1
- package/app/assets/icons/trail-sign.svg +1 -1
- package/app/assets/icons/train-outline.svg +1 -1
- package/app/assets/icons/train-sharp.svg +1 -1
- package/app/assets/icons/train.svg +1 -1
- package/app/assets/icons/transgender-outline.svg +1 -1
- package/app/assets/icons/transgender-sharp.svg +1 -1
- package/app/assets/icons/transgender.svg +1 -1
- package/app/assets/icons/trash-bin-outline.svg +1 -1
- package/app/assets/icons/trash-bin-sharp.svg +1 -1
- package/app/assets/icons/trash-bin.svg +1 -1
- package/app/assets/icons/trash-outline.svg +1 -1
- package/app/assets/icons/trash-sharp.svg +1 -1
- package/app/assets/icons/trash.svg +1 -1
- package/app/assets/icons/trending-down-outline.svg +1 -1
- package/app/assets/icons/trending-down-sharp.svg +1 -1
- package/app/assets/icons/trending-down.svg +1 -1
- package/app/assets/icons/trending-up-outline.svg +1 -1
- package/app/assets/icons/trending-up-sharp.svg +1 -1
- package/app/assets/icons/trending-up.svg +1 -1
- package/app/assets/icons/triangle-outline.svg +1 -1
- package/app/assets/icons/triangle-sharp.svg +1 -1
- package/app/assets/icons/triangle.svg +1 -1
- package/app/assets/icons/trophy-outline.svg +1 -1
- package/app/assets/icons/trophy-sharp.svg +1 -1
- package/app/assets/icons/trophy.svg +1 -1
- package/app/assets/icons/tv-outline.svg +1 -1
- package/app/assets/icons/tv-sharp.svg +1 -1
- package/app/assets/icons/tv.svg +1 -1
- package/app/assets/icons/umbrella-outline.svg +1 -1
- package/app/assets/icons/umbrella-sharp.svg +1 -1
- package/app/assets/icons/umbrella.svg +1 -1
- package/app/assets/icons/unabridged-software.svg +22 -0
- package/app/assets/icons/unlink-outline.svg +1 -1
- package/app/assets/icons/unlink-sharp.svg +1 -1
- package/app/assets/icons/unlink.svg +1 -1
- package/app/assets/icons/videocam-off-outline.svg +1 -1
- package/app/assets/icons/videocam-off-sharp.svg +1 -1
- package/app/assets/icons/videocam-off.svg +1 -1
- package/app/assets/icons/videocam-outline.svg +1 -1
- package/app/assets/icons/videocam-sharp.svg +1 -1
- package/app/assets/icons/videocam.svg +1 -1
- package/app/assets/icons/volume-high-outline.svg +1 -1
- package/app/assets/icons/volume-high-sharp.svg +1 -1
- package/app/assets/icons/volume-high.svg +1 -1
- package/app/assets/icons/volume-low-outline.svg +1 -1
- package/app/assets/icons/volume-low-sharp.svg +1 -1
- package/app/assets/icons/volume-low.svg +1 -1
- package/app/assets/icons/volume-medium-outline.svg +1 -1
- package/app/assets/icons/volume-medium-sharp.svg +1 -1
- package/app/assets/icons/volume-medium.svg +1 -1
- package/app/assets/icons/volume-mute-outline.svg +1 -1
- package/app/assets/icons/volume-mute-sharp.svg +1 -1
- package/app/assets/icons/volume-mute.svg +1 -1
- package/app/assets/icons/volume-off-outline.svg +1 -1
- package/app/assets/icons/volume-off-sharp.svg +1 -1
- package/app/assets/icons/volume-off.svg +1 -1
- package/app/assets/icons/walk-outline.svg +1 -1
- package/app/assets/icons/walk-sharp.svg +1 -1
- package/app/assets/icons/walk.svg +1 -1
- package/app/assets/icons/wallet-outline.svg +1 -1
- package/app/assets/icons/wallet-sharp.svg +1 -1
- package/app/assets/icons/wallet.svg +1 -1
- package/app/assets/icons/warning-outline.svg +1 -1
- package/app/assets/icons/warning-sharp.svg +1 -1
- package/app/assets/icons/warning.svg +1 -1
- package/app/assets/icons/watch-outline.svg +1 -1
- package/app/assets/icons/watch-sharp.svg +1 -1
- package/app/assets/icons/watch.svg +1 -1
- package/app/assets/icons/water-outline.svg +1 -1
- package/app/assets/icons/water-sharp.svg +1 -1
- package/app/assets/icons/water.svg +1 -1
- package/app/assets/icons/wifi-outline.svg +1 -1
- package/app/assets/icons/wifi-sharp.svg +1 -1
- package/app/assets/icons/wifi.svg +1 -1
- package/app/assets/icons/wine-outline.svg +1 -1
- package/app/assets/icons/wine-sharp.svg +1 -1
- package/app/assets/icons/wine.svg +1 -1
- package/app/assets/icons/woman-outline.svg +1 -1
- package/app/assets/icons/woman-sharp.svg +1 -1
- package/app/assets/icons/woman.svg +1 -1
- package/app/assets/javascript/midwest/index.ts +30 -4
- package/app/assets/javascript/midwest.js +2954 -2
- package/app/assets/javascript/midwest.js.map +1 -1
- package/app/assets/stylesheets/midwest/color-system.css +207 -186
- package/app/assets/stylesheets/midwest/form-group.css +17 -0
- package/app/assets/stylesheets/midwest/responsive-system.css +9 -6
- package/app/assets/stylesheets/midwest/scrollbars.css +36 -0
- package/app/assets/stylesheets/midwest/utilities.css +21 -1
- package/app/assets/stylesheets/midwest.css +2 -2
- package/app/assets/stylesheets/midwest.tailwind.css +34 -14
- package/dist/css/midwest.css +2 -2
- package/dist/javascript/collection/app/assets/javascript/midwest/index.js +36 -0
- package/dist/javascript/collection/app/assets/javascript/midwest/index.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/avatar_component/avatar_component_controller.js +10 -0
- package/dist/javascript/collection/app/components/midwest/avatar_component/avatar_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/banner_component/banner_component_controller.js +17 -0
- package/dist/javascript/collection/app/components/midwest/banner_component/banner_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/callout_component/callout_component_controller.js +10 -0
- package/dist/javascript/collection/app/components/midwest/callout_component/callout_component_controller.js.map +1 -0
- package/dist/javascript/{midwest/midwest.js → collection/app/components/midwest/card_component/card_component_controller.js} +2 -6
- package/dist/javascript/collection/app/components/midwest/card_component/card_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/dialog_component/dialog_component_controller.js +93 -0
- package/dist/javascript/collection/app/components/midwest/dialog_component/dialog_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/dropdown_component/dropdown_component_controller.js +90 -0
- package/dist/javascript/collection/app/components/midwest/dropdown_component/dropdown_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/dropdown_item_component/dropdown_item_component_controller.js +10 -0
- package/dist/javascript/collection/app/components/midwest/dropdown_item_component/dropdown_item_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/form/file_component/file_component_controller.js +40 -0
- package/dist/javascript/collection/app/components/midwest/form/file_component/file_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/form/input_component/input_component_controller.js +19 -0
- package/dist/javascript/collection/app/components/midwest/form/input_component/input_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/form/switch_component/switch_component_controller.js +10 -0
- package/dist/javascript/collection/app/components/midwest/form/switch_component/switch_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/prose_component/prose_component_controller.js +28 -0
- package/dist/javascript/collection/app/components/midwest/prose_component/prose_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/tabs_component/tabs_component_controller.js +35 -0
- package/dist/javascript/collection/app/components/midwest/tabs_component/tabs_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/tooltip_component/tooltip_component_controller.js +14 -0
- package/dist/javascript/collection/app/components/midwest/tooltip_component/tooltip_component_controller.js.map +1 -0
- package/dist/javascript/collection/app/components/midwest/video_component/video_component_controller.js +10 -0
- package/dist/javascript/collection/app/components/midwest/video_component/video_component_controller.js.map +1 -0
- package/dist/javascript/collection/assets/javascript/midwest/index.js +32 -0
- package/dist/javascript/collection/assets/javascript/midwest/index.js.map +1 -0
- package/dist/javascript/collection/components/midwest/avatar_component/avatar_component_controller.js +10 -0
- package/dist/javascript/collection/components/midwest/avatar_component/avatar_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/banner_component/banner_component_controller.js +17 -0
- package/dist/javascript/collection/components/midwest/banner_component/banner_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/callout_component/callout_component_controller.js +10 -0
- package/dist/javascript/collection/components/midwest/callout_component/callout_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/card_component/card_component_controller.js +38 -0
- package/dist/javascript/collection/components/midwest/card_component/card_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/dialog_component/dialog_component_controller.js +89 -0
- package/dist/javascript/collection/components/midwest/dialog_component/dialog_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/dropdown_component/dropdown_component_controller.js +14 -0
- package/dist/javascript/collection/components/midwest/dropdown_component/dropdown_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/dropdown_item_component/dropdown_item_component_controller.js +10 -0
- package/dist/javascript/collection/components/midwest/dropdown_item_component/dropdown_item_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/form/file_component/file_component_controller.js +40 -0
- package/dist/javascript/collection/components/midwest/form/file_component/file_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/form/input_component/input_component_controller.js +19 -0
- package/dist/javascript/collection/components/midwest/form/input_component/input_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/form/switch_component/switch_component_controller.js +10 -0
- package/dist/javascript/collection/components/midwest/form/switch_component/switch_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/prose_component/prose_component_controller.js +28 -0
- package/dist/javascript/collection/components/midwest/prose_component/prose_component_controller.js.map +1 -0
- package/dist/javascript/collection/components/midwest/video_component/video_component_controller.js +10 -0
- package/dist/javascript/collection/components/midwest/video_component/video_component_controller.js.map +1 -0
- package/dist/javascript/collection/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +1059 -0
- package/dist/javascript/collection/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js.map +1 -0
- package/dist/javascript/collection/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +772 -0
- package/dist/javascript/collection/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js.map +1 -0
- package/dist/javascript/collection/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.js +166 -0
- package/dist/javascript/collection/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.js.map +1 -0
- package/dist/javascript/collection/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +137 -0
- package/dist/javascript/collection/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js.map +1 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js +3910 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js.map +1 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js +22 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js.map +1 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js +32 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js.map +1 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js +53 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js.map +1 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js +6 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js.map +1 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js +34 -0
- package/dist/javascript/collection/node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/adapters.js +7 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/adapters.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/connection.js +170 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/connection.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/connection_monitor.js +128 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/connection_monitor.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/consumer.js +78 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/consumer.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/index.js +25 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/index.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/internal.js +22 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/internal.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/logger.js +25 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/logger.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/subscription.js +92 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/subscription.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/subscription_guarantor.js +53 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/subscription_guarantor.js.map +1 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/subscriptions.js +106 -0
- package/dist/javascript/collection/node_modules/@rails/actioncable/src/subscriptions.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/assets/javascript/midwest/index.js +29 -0
- package/dist/javascript/collection/vendor/midwest/app/assets/javascript/midwest/index.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/avatar_component/avatar_component_controller.js +10 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/avatar_component/avatar_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/banner_component/banner_component_controller.js +17 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/banner_component/banner_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/callout_component/callout_component_controller.js +10 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/callout_component/callout_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/card_component/card_component_controller.js +38 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/card_component/card_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/dialog_component/dialog_component_controller.js +83 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/dialog_component/dialog_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/dropdown_component/dropdown_component_controller.js +14 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/dropdown_component/dropdown_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/form/file_component/file_component_controller.js +40 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/form/file_component/file_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/form/input_component/input_component_controller.js +19 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/form/input_component/input_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/form/switch_component/switch_component_controller.js +10 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/form/switch_component/switch_component_controller.js.map +1 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/prose_component/prose_component_controller.js +28 -0
- package/dist/javascript/collection/vendor/midwest/app/components/midwest/prose_component/prose_component_controller.js.map +1 -0
- package/dist/javascript/midwest.d.ts +6 -1
- package/dist/javascript/midwest.js +2954 -2
- package/dist/javascript/midwest.js.map +1 -1
- package/package.json +17 -4
- package/dist/javascript/midwest/midwest.js.map +0 -1
|
@@ -0,0 +1,3910 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Turbo 7.2.5
|
|
3
|
+
Copyright © 2023 37signals LLC
|
|
4
|
+
*/
|
|
5
|
+
(function () {
|
|
6
|
+
if (window.Reflect === undefined ||
|
|
7
|
+
window.customElements === undefined ||
|
|
8
|
+
window.customElements.polyfillWrapFlushCallback) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const BuiltInHTMLElement = HTMLElement;
|
|
12
|
+
const wrapperForTheName = {
|
|
13
|
+
HTMLElement: function HTMLElement() {
|
|
14
|
+
return Reflect.construct(BuiltInHTMLElement, [], this.constructor);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
window.HTMLElement = wrapperForTheName["HTMLElement"];
|
|
18
|
+
HTMLElement.prototype = BuiltInHTMLElement.prototype;
|
|
19
|
+
HTMLElement.prototype.constructor = HTMLElement;
|
|
20
|
+
Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);
|
|
21
|
+
})();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The MIT License (MIT)
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) 2019 Javan Makhmali
|
|
27
|
+
*
|
|
28
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
30
|
+
* in the Software without restriction, including without limitation the rights
|
|
31
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
33
|
+
* furnished to do so, subject to the following conditions:
|
|
34
|
+
*
|
|
35
|
+
* The above copyright notice and this permission notice shall be included in
|
|
36
|
+
* all copies or substantial portions of the Software.
|
|
37
|
+
*
|
|
38
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
|
+
* THE SOFTWARE.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
(function(prototype) {
|
|
48
|
+
if (typeof prototype.requestSubmit == "function") return
|
|
49
|
+
|
|
50
|
+
prototype.requestSubmit = function(submitter) {
|
|
51
|
+
if (submitter) {
|
|
52
|
+
validateSubmitter(submitter, this);
|
|
53
|
+
submitter.click();
|
|
54
|
+
} else {
|
|
55
|
+
submitter = document.createElement("input");
|
|
56
|
+
submitter.type = "submit";
|
|
57
|
+
submitter.hidden = true;
|
|
58
|
+
this.appendChild(submitter);
|
|
59
|
+
submitter.click();
|
|
60
|
+
this.removeChild(submitter);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
function validateSubmitter(submitter, form) {
|
|
65
|
+
submitter instanceof HTMLElement || raise(TypeError, "parameter 1 is not of type 'HTMLElement'");
|
|
66
|
+
submitter.type == "submit" || raise(TypeError, "The specified element is not a submit button");
|
|
67
|
+
submitter.form == form || raise(DOMException, "The specified element is not owned by this form element", "NotFoundError");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function raise(errorConstructor, message, name) {
|
|
71
|
+
throw new errorConstructor("Failed to execute 'requestSubmit' on 'HTMLFormElement': " + message + ".", name)
|
|
72
|
+
}
|
|
73
|
+
})(HTMLFormElement.prototype);
|
|
74
|
+
|
|
75
|
+
const submittersByForm = new WeakMap();
|
|
76
|
+
function findSubmitterFromClickTarget(target) {
|
|
77
|
+
const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;
|
|
78
|
+
const candidate = element ? element.closest("input, button") : null;
|
|
79
|
+
return (candidate === null || candidate === void 0 ? void 0 : candidate.type) == "submit" ? candidate : null;
|
|
80
|
+
}
|
|
81
|
+
function clickCaptured(event) {
|
|
82
|
+
const submitter = findSubmitterFromClickTarget(event.target);
|
|
83
|
+
if (submitter && submitter.form) {
|
|
84
|
+
submittersByForm.set(submitter.form, submitter);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
(function () {
|
|
88
|
+
if ("submitter" in Event.prototype)
|
|
89
|
+
return;
|
|
90
|
+
let prototype;
|
|
91
|
+
if ("SubmitEvent" in window && /Apple Computer/.test(navigator.vendor)) {
|
|
92
|
+
prototype = window.SubmitEvent.prototype;
|
|
93
|
+
}
|
|
94
|
+
else if ("SubmitEvent" in window) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
prototype = window.Event.prototype;
|
|
99
|
+
}
|
|
100
|
+
addEventListener("click", clickCaptured, true);
|
|
101
|
+
Object.defineProperty(prototype, "submitter", {
|
|
102
|
+
get() {
|
|
103
|
+
if (this.type == "submit" && this.target instanceof HTMLFormElement) {
|
|
104
|
+
return submittersByForm.get(this.target);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
})();
|
|
109
|
+
|
|
110
|
+
var FrameLoadingStyle;
|
|
111
|
+
(function (FrameLoadingStyle) {
|
|
112
|
+
FrameLoadingStyle["eager"] = "eager";
|
|
113
|
+
FrameLoadingStyle["lazy"] = "lazy";
|
|
114
|
+
})(FrameLoadingStyle || (FrameLoadingStyle = {}));
|
|
115
|
+
class FrameElement extends HTMLElement {
|
|
116
|
+
constructor() {
|
|
117
|
+
super();
|
|
118
|
+
this.loaded = Promise.resolve();
|
|
119
|
+
this.delegate = new FrameElement.delegateConstructor(this);
|
|
120
|
+
}
|
|
121
|
+
static get observedAttributes() {
|
|
122
|
+
return ["disabled", "complete", "loading", "src"];
|
|
123
|
+
}
|
|
124
|
+
connectedCallback() {
|
|
125
|
+
this.delegate.connect();
|
|
126
|
+
}
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
this.delegate.disconnect();
|
|
129
|
+
}
|
|
130
|
+
reload() {
|
|
131
|
+
return this.delegate.sourceURLReloaded();
|
|
132
|
+
}
|
|
133
|
+
attributeChangedCallback(name) {
|
|
134
|
+
if (name == "loading") {
|
|
135
|
+
this.delegate.loadingStyleChanged();
|
|
136
|
+
}
|
|
137
|
+
else if (name == "complete") {
|
|
138
|
+
this.delegate.completeChanged();
|
|
139
|
+
}
|
|
140
|
+
else if (name == "src") {
|
|
141
|
+
this.delegate.sourceURLChanged();
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
this.delegate.disabledChanged();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
get src() {
|
|
148
|
+
return this.getAttribute("src");
|
|
149
|
+
}
|
|
150
|
+
set src(value) {
|
|
151
|
+
if (value) {
|
|
152
|
+
this.setAttribute("src", value);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.removeAttribute("src");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
get loading() {
|
|
159
|
+
return frameLoadingStyleFromString(this.getAttribute("loading") || "");
|
|
160
|
+
}
|
|
161
|
+
set loading(value) {
|
|
162
|
+
if (value) {
|
|
163
|
+
this.setAttribute("loading", value);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.removeAttribute("loading");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
get disabled() {
|
|
170
|
+
return this.hasAttribute("disabled");
|
|
171
|
+
}
|
|
172
|
+
set disabled(value) {
|
|
173
|
+
if (value) {
|
|
174
|
+
this.setAttribute("disabled", "");
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.removeAttribute("disabled");
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
get autoscroll() {
|
|
181
|
+
return this.hasAttribute("autoscroll");
|
|
182
|
+
}
|
|
183
|
+
set autoscroll(value) {
|
|
184
|
+
if (value) {
|
|
185
|
+
this.setAttribute("autoscroll", "");
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this.removeAttribute("autoscroll");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
get complete() {
|
|
192
|
+
return !this.delegate.isLoading;
|
|
193
|
+
}
|
|
194
|
+
get isActive() {
|
|
195
|
+
return this.ownerDocument === document && !this.isPreview;
|
|
196
|
+
}
|
|
197
|
+
get isPreview() {
|
|
198
|
+
var _a, _b;
|
|
199
|
+
return (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.hasAttribute("data-turbo-preview");
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function frameLoadingStyleFromString(style) {
|
|
203
|
+
switch (style.toLowerCase()) {
|
|
204
|
+
case "lazy":
|
|
205
|
+
return FrameLoadingStyle.lazy;
|
|
206
|
+
default:
|
|
207
|
+
return FrameLoadingStyle.eager;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function expandURL(locatable) {
|
|
212
|
+
return new URL(locatable.toString(), document.baseURI);
|
|
213
|
+
}
|
|
214
|
+
function getAnchor(url) {
|
|
215
|
+
let anchorMatch;
|
|
216
|
+
if (url.hash) {
|
|
217
|
+
return url.hash.slice(1);
|
|
218
|
+
}
|
|
219
|
+
else if ((anchorMatch = url.href.match(/#(.*)$/))) {
|
|
220
|
+
return anchorMatch[1];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function getAction(form, submitter) {
|
|
224
|
+
const action = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute("formaction")) || form.getAttribute("action") || form.action;
|
|
225
|
+
return expandURL(action);
|
|
226
|
+
}
|
|
227
|
+
function getExtension(url) {
|
|
228
|
+
return (getLastPathComponent(url).match(/\.[^.]*$/) || [])[0] || "";
|
|
229
|
+
}
|
|
230
|
+
function isHTML(url) {
|
|
231
|
+
return !!getExtension(url).match(/^(?:|\.(?:htm|html|xhtml|php))$/);
|
|
232
|
+
}
|
|
233
|
+
function isPrefixedBy(baseURL, url) {
|
|
234
|
+
const prefix = getPrefix(url);
|
|
235
|
+
return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);
|
|
236
|
+
}
|
|
237
|
+
function locationIsVisitable(location, rootLocation) {
|
|
238
|
+
return isPrefixedBy(location, rootLocation) && isHTML(location);
|
|
239
|
+
}
|
|
240
|
+
function getRequestURL(url) {
|
|
241
|
+
const anchor = getAnchor(url);
|
|
242
|
+
return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;
|
|
243
|
+
}
|
|
244
|
+
function toCacheKey(url) {
|
|
245
|
+
return getRequestURL(url);
|
|
246
|
+
}
|
|
247
|
+
function urlsAreEqual(left, right) {
|
|
248
|
+
return expandURL(left).href == expandURL(right).href;
|
|
249
|
+
}
|
|
250
|
+
function getPathComponents(url) {
|
|
251
|
+
return url.pathname.split("/").slice(1);
|
|
252
|
+
}
|
|
253
|
+
function getLastPathComponent(url) {
|
|
254
|
+
return getPathComponents(url).slice(-1)[0];
|
|
255
|
+
}
|
|
256
|
+
function getPrefix(url) {
|
|
257
|
+
return addTrailingSlash(url.origin + url.pathname);
|
|
258
|
+
}
|
|
259
|
+
function addTrailingSlash(value) {
|
|
260
|
+
return value.endsWith("/") ? value : value + "/";
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
class FetchResponse {
|
|
264
|
+
constructor(response) {
|
|
265
|
+
this.response = response;
|
|
266
|
+
}
|
|
267
|
+
get succeeded() {
|
|
268
|
+
return this.response.ok;
|
|
269
|
+
}
|
|
270
|
+
get failed() {
|
|
271
|
+
return !this.succeeded;
|
|
272
|
+
}
|
|
273
|
+
get clientError() {
|
|
274
|
+
return this.statusCode >= 400 && this.statusCode <= 499;
|
|
275
|
+
}
|
|
276
|
+
get serverError() {
|
|
277
|
+
return this.statusCode >= 500 && this.statusCode <= 599;
|
|
278
|
+
}
|
|
279
|
+
get redirected() {
|
|
280
|
+
return this.response.redirected;
|
|
281
|
+
}
|
|
282
|
+
get location() {
|
|
283
|
+
return expandURL(this.response.url);
|
|
284
|
+
}
|
|
285
|
+
get isHTML() {
|
|
286
|
+
return this.contentType && this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/);
|
|
287
|
+
}
|
|
288
|
+
get statusCode() {
|
|
289
|
+
return this.response.status;
|
|
290
|
+
}
|
|
291
|
+
get contentType() {
|
|
292
|
+
return this.header("Content-Type");
|
|
293
|
+
}
|
|
294
|
+
get responseText() {
|
|
295
|
+
return this.response.clone().text();
|
|
296
|
+
}
|
|
297
|
+
get responseHTML() {
|
|
298
|
+
if (this.isHTML) {
|
|
299
|
+
return this.response.clone().text();
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
return Promise.resolve(undefined);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
header(name) {
|
|
306
|
+
return this.response.headers.get(name);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function activateScriptElement(element) {
|
|
311
|
+
if (element.getAttribute("data-turbo-eval") == "false") {
|
|
312
|
+
return element;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
const createdScriptElement = document.createElement("script");
|
|
316
|
+
const cspNonce = getMetaContent("csp-nonce");
|
|
317
|
+
if (cspNonce) {
|
|
318
|
+
createdScriptElement.nonce = cspNonce;
|
|
319
|
+
}
|
|
320
|
+
createdScriptElement.textContent = element.textContent;
|
|
321
|
+
createdScriptElement.async = false;
|
|
322
|
+
copyElementAttributes(createdScriptElement, element);
|
|
323
|
+
return createdScriptElement;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function copyElementAttributes(destinationElement, sourceElement) {
|
|
327
|
+
for (const { name, value } of sourceElement.attributes) {
|
|
328
|
+
destinationElement.setAttribute(name, value);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function createDocumentFragment(html) {
|
|
332
|
+
const template = document.createElement("template");
|
|
333
|
+
template.innerHTML = html;
|
|
334
|
+
return template.content;
|
|
335
|
+
}
|
|
336
|
+
function dispatch(eventName, { target, cancelable, detail } = {}) {
|
|
337
|
+
const event = new CustomEvent(eventName, {
|
|
338
|
+
cancelable,
|
|
339
|
+
bubbles: true,
|
|
340
|
+
composed: true,
|
|
341
|
+
detail,
|
|
342
|
+
});
|
|
343
|
+
if (target && target.isConnected) {
|
|
344
|
+
target.dispatchEvent(event);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
document.documentElement.dispatchEvent(event);
|
|
348
|
+
}
|
|
349
|
+
return event;
|
|
350
|
+
}
|
|
351
|
+
function nextAnimationFrame() {
|
|
352
|
+
return new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
353
|
+
}
|
|
354
|
+
function nextEventLoopTick() {
|
|
355
|
+
return new Promise((resolve) => setTimeout(() => resolve(), 0));
|
|
356
|
+
}
|
|
357
|
+
function nextMicrotask() {
|
|
358
|
+
return Promise.resolve();
|
|
359
|
+
}
|
|
360
|
+
function parseHTMLDocument(html = "") {
|
|
361
|
+
return new DOMParser().parseFromString(html, "text/html");
|
|
362
|
+
}
|
|
363
|
+
function unindent(strings, ...values) {
|
|
364
|
+
const lines = interpolate(strings, values).replace(/^\n/, "").split("\n");
|
|
365
|
+
const match = lines[0].match(/^\s+/);
|
|
366
|
+
const indent = match ? match[0].length : 0;
|
|
367
|
+
return lines.map((line) => line.slice(indent)).join("\n");
|
|
368
|
+
}
|
|
369
|
+
function interpolate(strings, values) {
|
|
370
|
+
return strings.reduce((result, string, i) => {
|
|
371
|
+
const value = values[i] == undefined ? "" : values[i];
|
|
372
|
+
return result + string + value;
|
|
373
|
+
}, "");
|
|
374
|
+
}
|
|
375
|
+
function uuid() {
|
|
376
|
+
return Array.from({ length: 36 })
|
|
377
|
+
.map((_, i) => {
|
|
378
|
+
if (i == 8 || i == 13 || i == 18 || i == 23) {
|
|
379
|
+
return "-";
|
|
380
|
+
}
|
|
381
|
+
else if (i == 14) {
|
|
382
|
+
return "4";
|
|
383
|
+
}
|
|
384
|
+
else if (i == 19) {
|
|
385
|
+
return (Math.floor(Math.random() * 4) + 8).toString(16);
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
return Math.floor(Math.random() * 15).toString(16);
|
|
389
|
+
}
|
|
390
|
+
})
|
|
391
|
+
.join("");
|
|
392
|
+
}
|
|
393
|
+
function getAttribute(attributeName, ...elements) {
|
|
394
|
+
for (const value of elements.map((element) => element === null || element === void 0 ? void 0 : element.getAttribute(attributeName))) {
|
|
395
|
+
if (typeof value == "string")
|
|
396
|
+
return value;
|
|
397
|
+
}
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
function hasAttribute(attributeName, ...elements) {
|
|
401
|
+
return elements.some((element) => element && element.hasAttribute(attributeName));
|
|
402
|
+
}
|
|
403
|
+
function markAsBusy(...elements) {
|
|
404
|
+
for (const element of elements) {
|
|
405
|
+
if (element.localName == "turbo-frame") {
|
|
406
|
+
element.setAttribute("busy", "");
|
|
407
|
+
}
|
|
408
|
+
element.setAttribute("aria-busy", "true");
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function clearBusyState(...elements) {
|
|
412
|
+
for (const element of elements) {
|
|
413
|
+
if (element.localName == "turbo-frame") {
|
|
414
|
+
element.removeAttribute("busy");
|
|
415
|
+
}
|
|
416
|
+
element.removeAttribute("aria-busy");
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function waitForLoad(element, timeoutInMilliseconds = 2000) {
|
|
420
|
+
return new Promise((resolve) => {
|
|
421
|
+
const onComplete = () => {
|
|
422
|
+
element.removeEventListener("error", onComplete);
|
|
423
|
+
element.removeEventListener("load", onComplete);
|
|
424
|
+
resolve();
|
|
425
|
+
};
|
|
426
|
+
element.addEventListener("load", onComplete, { once: true });
|
|
427
|
+
element.addEventListener("error", onComplete, { once: true });
|
|
428
|
+
setTimeout(resolve, timeoutInMilliseconds);
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function getHistoryMethodForAction(action) {
|
|
432
|
+
switch (action) {
|
|
433
|
+
case "replace":
|
|
434
|
+
return history.replaceState;
|
|
435
|
+
case "advance":
|
|
436
|
+
case "restore":
|
|
437
|
+
return history.pushState;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function isAction(action) {
|
|
441
|
+
return action == "advance" || action == "replace" || action == "restore";
|
|
442
|
+
}
|
|
443
|
+
function getVisitAction(...elements) {
|
|
444
|
+
const action = getAttribute("data-turbo-action", ...elements);
|
|
445
|
+
return isAction(action) ? action : null;
|
|
446
|
+
}
|
|
447
|
+
function getMetaElement(name) {
|
|
448
|
+
return document.querySelector(`meta[name="${name}"]`);
|
|
449
|
+
}
|
|
450
|
+
function getMetaContent(name) {
|
|
451
|
+
const element = getMetaElement(name);
|
|
452
|
+
return element && element.content;
|
|
453
|
+
}
|
|
454
|
+
function setMetaContent(name, content) {
|
|
455
|
+
let element = getMetaElement(name);
|
|
456
|
+
if (!element) {
|
|
457
|
+
element = document.createElement("meta");
|
|
458
|
+
element.setAttribute("name", name);
|
|
459
|
+
document.head.appendChild(element);
|
|
460
|
+
}
|
|
461
|
+
element.setAttribute("content", content);
|
|
462
|
+
return element;
|
|
463
|
+
}
|
|
464
|
+
function findClosestRecursively(element, selector) {
|
|
465
|
+
var _a;
|
|
466
|
+
if (element instanceof Element) {
|
|
467
|
+
return (element.closest(selector) ||
|
|
468
|
+
findClosestRecursively(element.assignedSlot || ((_a = element.getRootNode()) === null || _a === void 0 ? void 0 : _a.host), selector));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
var FetchMethod;
|
|
473
|
+
(function (FetchMethod) {
|
|
474
|
+
FetchMethod[FetchMethod["get"] = 0] = "get";
|
|
475
|
+
FetchMethod[FetchMethod["post"] = 1] = "post";
|
|
476
|
+
FetchMethod[FetchMethod["put"] = 2] = "put";
|
|
477
|
+
FetchMethod[FetchMethod["patch"] = 3] = "patch";
|
|
478
|
+
FetchMethod[FetchMethod["delete"] = 4] = "delete";
|
|
479
|
+
})(FetchMethod || (FetchMethod = {}));
|
|
480
|
+
function fetchMethodFromString(method) {
|
|
481
|
+
switch (method.toLowerCase()) {
|
|
482
|
+
case "get":
|
|
483
|
+
return FetchMethod.get;
|
|
484
|
+
case "post":
|
|
485
|
+
return FetchMethod.post;
|
|
486
|
+
case "put":
|
|
487
|
+
return FetchMethod.put;
|
|
488
|
+
case "patch":
|
|
489
|
+
return FetchMethod.patch;
|
|
490
|
+
case "delete":
|
|
491
|
+
return FetchMethod.delete;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
class FetchRequest {
|
|
495
|
+
constructor(delegate, method, location, body = new URLSearchParams(), target = null) {
|
|
496
|
+
this.abortController = new AbortController();
|
|
497
|
+
this.resolveRequestPromise = (_value) => { };
|
|
498
|
+
this.delegate = delegate;
|
|
499
|
+
this.method = method;
|
|
500
|
+
this.headers = this.defaultHeaders;
|
|
501
|
+
this.body = body;
|
|
502
|
+
this.url = location;
|
|
503
|
+
this.target = target;
|
|
504
|
+
}
|
|
505
|
+
get location() {
|
|
506
|
+
return this.url;
|
|
507
|
+
}
|
|
508
|
+
get params() {
|
|
509
|
+
return this.url.searchParams;
|
|
510
|
+
}
|
|
511
|
+
get entries() {
|
|
512
|
+
return this.body ? Array.from(this.body.entries()) : [];
|
|
513
|
+
}
|
|
514
|
+
cancel() {
|
|
515
|
+
this.abortController.abort();
|
|
516
|
+
}
|
|
517
|
+
async perform() {
|
|
518
|
+
const { fetchOptions } = this;
|
|
519
|
+
this.delegate.prepareRequest(this);
|
|
520
|
+
await this.allowRequestToBeIntercepted(fetchOptions);
|
|
521
|
+
try {
|
|
522
|
+
this.delegate.requestStarted(this);
|
|
523
|
+
const response = await fetch(this.url.href, fetchOptions);
|
|
524
|
+
return await this.receive(response);
|
|
525
|
+
}
|
|
526
|
+
catch (error) {
|
|
527
|
+
if (error.name !== "AbortError") {
|
|
528
|
+
if (this.willDelegateErrorHandling(error)) {
|
|
529
|
+
this.delegate.requestErrored(this, error);
|
|
530
|
+
}
|
|
531
|
+
throw error;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
finally {
|
|
535
|
+
this.delegate.requestFinished(this);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
async receive(response) {
|
|
539
|
+
const fetchResponse = new FetchResponse(response);
|
|
540
|
+
const event = dispatch("turbo:before-fetch-response", {
|
|
541
|
+
cancelable: true,
|
|
542
|
+
detail: { fetchResponse },
|
|
543
|
+
target: this.target,
|
|
544
|
+
});
|
|
545
|
+
if (event.defaultPrevented) {
|
|
546
|
+
this.delegate.requestPreventedHandlingResponse(this, fetchResponse);
|
|
547
|
+
}
|
|
548
|
+
else if (fetchResponse.succeeded) {
|
|
549
|
+
this.delegate.requestSucceededWithResponse(this, fetchResponse);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
this.delegate.requestFailedWithResponse(this, fetchResponse);
|
|
553
|
+
}
|
|
554
|
+
return fetchResponse;
|
|
555
|
+
}
|
|
556
|
+
get fetchOptions() {
|
|
557
|
+
var _a;
|
|
558
|
+
return {
|
|
559
|
+
method: FetchMethod[this.method].toUpperCase(),
|
|
560
|
+
credentials: "same-origin",
|
|
561
|
+
headers: this.headers,
|
|
562
|
+
redirect: "follow",
|
|
563
|
+
body: this.isIdempotent ? null : this.body,
|
|
564
|
+
signal: this.abortSignal,
|
|
565
|
+
referrer: (_a = this.delegate.referrer) === null || _a === void 0 ? void 0 : _a.href,
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
get defaultHeaders() {
|
|
569
|
+
return {
|
|
570
|
+
Accept: "text/html, application/xhtml+xml",
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
get isIdempotent() {
|
|
574
|
+
return this.method == FetchMethod.get;
|
|
575
|
+
}
|
|
576
|
+
get abortSignal() {
|
|
577
|
+
return this.abortController.signal;
|
|
578
|
+
}
|
|
579
|
+
acceptResponseType(mimeType) {
|
|
580
|
+
this.headers["Accept"] = [mimeType, this.headers["Accept"]].join(", ");
|
|
581
|
+
}
|
|
582
|
+
async allowRequestToBeIntercepted(fetchOptions) {
|
|
583
|
+
const requestInterception = new Promise((resolve) => (this.resolveRequestPromise = resolve));
|
|
584
|
+
const event = dispatch("turbo:before-fetch-request", {
|
|
585
|
+
cancelable: true,
|
|
586
|
+
detail: {
|
|
587
|
+
fetchOptions,
|
|
588
|
+
url: this.url,
|
|
589
|
+
resume: this.resolveRequestPromise,
|
|
590
|
+
},
|
|
591
|
+
target: this.target,
|
|
592
|
+
});
|
|
593
|
+
if (event.defaultPrevented)
|
|
594
|
+
await requestInterception;
|
|
595
|
+
}
|
|
596
|
+
willDelegateErrorHandling(error) {
|
|
597
|
+
const event = dispatch("turbo:fetch-request-error", {
|
|
598
|
+
target: this.target,
|
|
599
|
+
cancelable: true,
|
|
600
|
+
detail: { request: this, error: error },
|
|
601
|
+
});
|
|
602
|
+
return !event.defaultPrevented;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
class AppearanceObserver {
|
|
607
|
+
constructor(delegate, element) {
|
|
608
|
+
this.started = false;
|
|
609
|
+
this.intersect = (entries) => {
|
|
610
|
+
const lastEntry = entries.slice(-1)[0];
|
|
611
|
+
if (lastEntry === null || lastEntry === void 0 ? void 0 : lastEntry.isIntersecting) {
|
|
612
|
+
this.delegate.elementAppearedInViewport(this.element);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
this.delegate = delegate;
|
|
616
|
+
this.element = element;
|
|
617
|
+
this.intersectionObserver = new IntersectionObserver(this.intersect);
|
|
618
|
+
}
|
|
619
|
+
start() {
|
|
620
|
+
if (!this.started) {
|
|
621
|
+
this.started = true;
|
|
622
|
+
this.intersectionObserver.observe(this.element);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
stop() {
|
|
626
|
+
if (this.started) {
|
|
627
|
+
this.started = false;
|
|
628
|
+
this.intersectionObserver.unobserve(this.element);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
class StreamMessage {
|
|
634
|
+
constructor(fragment) {
|
|
635
|
+
this.fragment = importStreamElements(fragment);
|
|
636
|
+
}
|
|
637
|
+
static wrap(message) {
|
|
638
|
+
if (typeof message == "string") {
|
|
639
|
+
return new this(createDocumentFragment(message));
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
return message;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
StreamMessage.contentType = "text/vnd.turbo-stream.html";
|
|
647
|
+
function importStreamElements(fragment) {
|
|
648
|
+
for (const element of fragment.querySelectorAll("turbo-stream")) {
|
|
649
|
+
const streamElement = document.importNode(element, true);
|
|
650
|
+
for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll("script")) {
|
|
651
|
+
inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));
|
|
652
|
+
}
|
|
653
|
+
element.replaceWith(streamElement);
|
|
654
|
+
}
|
|
655
|
+
return fragment;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
var FormSubmissionState;
|
|
659
|
+
(function (FormSubmissionState) {
|
|
660
|
+
FormSubmissionState[FormSubmissionState["initialized"] = 0] = "initialized";
|
|
661
|
+
FormSubmissionState[FormSubmissionState["requesting"] = 1] = "requesting";
|
|
662
|
+
FormSubmissionState[FormSubmissionState["waiting"] = 2] = "waiting";
|
|
663
|
+
FormSubmissionState[FormSubmissionState["receiving"] = 3] = "receiving";
|
|
664
|
+
FormSubmissionState[FormSubmissionState["stopping"] = 4] = "stopping";
|
|
665
|
+
FormSubmissionState[FormSubmissionState["stopped"] = 5] = "stopped";
|
|
666
|
+
})(FormSubmissionState || (FormSubmissionState = {}));
|
|
667
|
+
var FormEnctype;
|
|
668
|
+
(function (FormEnctype) {
|
|
669
|
+
FormEnctype["urlEncoded"] = "application/x-www-form-urlencoded";
|
|
670
|
+
FormEnctype["multipart"] = "multipart/form-data";
|
|
671
|
+
FormEnctype["plain"] = "text/plain";
|
|
672
|
+
})(FormEnctype || (FormEnctype = {}));
|
|
673
|
+
function formEnctypeFromString(encoding) {
|
|
674
|
+
switch (encoding.toLowerCase()) {
|
|
675
|
+
case FormEnctype.multipart:
|
|
676
|
+
return FormEnctype.multipart;
|
|
677
|
+
case FormEnctype.plain:
|
|
678
|
+
return FormEnctype.plain;
|
|
679
|
+
default:
|
|
680
|
+
return FormEnctype.urlEncoded;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
class FormSubmission {
|
|
684
|
+
constructor(delegate, formElement, submitter, mustRedirect = false) {
|
|
685
|
+
this.state = FormSubmissionState.initialized;
|
|
686
|
+
this.delegate = delegate;
|
|
687
|
+
this.formElement = formElement;
|
|
688
|
+
this.submitter = submitter;
|
|
689
|
+
this.formData = buildFormData(formElement, submitter);
|
|
690
|
+
this.location = expandURL(this.action);
|
|
691
|
+
if (this.method == FetchMethod.get) {
|
|
692
|
+
mergeFormDataEntries(this.location, [...this.body.entries()]);
|
|
693
|
+
}
|
|
694
|
+
this.fetchRequest = new FetchRequest(this, this.method, this.location, this.body, this.formElement);
|
|
695
|
+
this.mustRedirect = mustRedirect;
|
|
696
|
+
}
|
|
697
|
+
static confirmMethod(message, _element, _submitter) {
|
|
698
|
+
return Promise.resolve(confirm(message));
|
|
699
|
+
}
|
|
700
|
+
get method() {
|
|
701
|
+
var _a;
|
|
702
|
+
const method = ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute("formmethod")) || this.formElement.getAttribute("method") || "";
|
|
703
|
+
return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;
|
|
704
|
+
}
|
|
705
|
+
get action() {
|
|
706
|
+
var _a;
|
|
707
|
+
const formElementAction = typeof this.formElement.action === "string" ? this.formElement.action : null;
|
|
708
|
+
if ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.hasAttribute("formaction")) {
|
|
709
|
+
return this.submitter.getAttribute("formaction") || "";
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
return this.formElement.getAttribute("action") || formElementAction || "";
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
get body() {
|
|
716
|
+
if (this.enctype == FormEnctype.urlEncoded || this.method == FetchMethod.get) {
|
|
717
|
+
return new URLSearchParams(this.stringFormData);
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
return this.formData;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
get enctype() {
|
|
724
|
+
var _a;
|
|
725
|
+
return formEnctypeFromString(((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute("formenctype")) || this.formElement.enctype);
|
|
726
|
+
}
|
|
727
|
+
get isIdempotent() {
|
|
728
|
+
return this.fetchRequest.isIdempotent;
|
|
729
|
+
}
|
|
730
|
+
get stringFormData() {
|
|
731
|
+
return [...this.formData].reduce((entries, [name, value]) => {
|
|
732
|
+
return entries.concat(typeof value == "string" ? [[name, value]] : []);
|
|
733
|
+
}, []);
|
|
734
|
+
}
|
|
735
|
+
async start() {
|
|
736
|
+
const { initialized, requesting } = FormSubmissionState;
|
|
737
|
+
const confirmationMessage = getAttribute("data-turbo-confirm", this.submitter, this.formElement);
|
|
738
|
+
if (typeof confirmationMessage === "string") {
|
|
739
|
+
const answer = await FormSubmission.confirmMethod(confirmationMessage, this.formElement, this.submitter);
|
|
740
|
+
if (!answer) {
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (this.state == initialized) {
|
|
745
|
+
this.state = requesting;
|
|
746
|
+
return this.fetchRequest.perform();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
stop() {
|
|
750
|
+
const { stopping, stopped } = FormSubmissionState;
|
|
751
|
+
if (this.state != stopping && this.state != stopped) {
|
|
752
|
+
this.state = stopping;
|
|
753
|
+
this.fetchRequest.cancel();
|
|
754
|
+
return true;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
prepareRequest(request) {
|
|
758
|
+
if (!request.isIdempotent) {
|
|
759
|
+
const token = getCookieValue(getMetaContent("csrf-param")) || getMetaContent("csrf-token");
|
|
760
|
+
if (token) {
|
|
761
|
+
request.headers["X-CSRF-Token"] = token;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
if (this.requestAcceptsTurboStreamResponse(request)) {
|
|
765
|
+
request.acceptResponseType(StreamMessage.contentType);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
requestStarted(_request) {
|
|
769
|
+
var _a;
|
|
770
|
+
this.state = FormSubmissionState.waiting;
|
|
771
|
+
(_a = this.submitter) === null || _a === void 0 ? void 0 : _a.setAttribute("disabled", "");
|
|
772
|
+
dispatch("turbo:submit-start", {
|
|
773
|
+
target: this.formElement,
|
|
774
|
+
detail: { formSubmission: this },
|
|
775
|
+
});
|
|
776
|
+
this.delegate.formSubmissionStarted(this);
|
|
777
|
+
}
|
|
778
|
+
requestPreventedHandlingResponse(request, response) {
|
|
779
|
+
this.result = { success: response.succeeded, fetchResponse: response };
|
|
780
|
+
}
|
|
781
|
+
requestSucceededWithResponse(request, response) {
|
|
782
|
+
if (response.clientError || response.serverError) {
|
|
783
|
+
this.delegate.formSubmissionFailedWithResponse(this, response);
|
|
784
|
+
}
|
|
785
|
+
else if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {
|
|
786
|
+
const error = new Error("Form responses must redirect to another location");
|
|
787
|
+
this.delegate.formSubmissionErrored(this, error);
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
this.state = FormSubmissionState.receiving;
|
|
791
|
+
this.result = { success: true, fetchResponse: response };
|
|
792
|
+
this.delegate.formSubmissionSucceededWithResponse(this, response);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
requestFailedWithResponse(request, response) {
|
|
796
|
+
this.result = { success: false, fetchResponse: response };
|
|
797
|
+
this.delegate.formSubmissionFailedWithResponse(this, response);
|
|
798
|
+
}
|
|
799
|
+
requestErrored(request, error) {
|
|
800
|
+
this.result = { success: false, error };
|
|
801
|
+
this.delegate.formSubmissionErrored(this, error);
|
|
802
|
+
}
|
|
803
|
+
requestFinished(_request) {
|
|
804
|
+
var _a;
|
|
805
|
+
this.state = FormSubmissionState.stopped;
|
|
806
|
+
(_a = this.submitter) === null || _a === void 0 ? void 0 : _a.removeAttribute("disabled");
|
|
807
|
+
dispatch("turbo:submit-end", {
|
|
808
|
+
target: this.formElement,
|
|
809
|
+
detail: Object.assign({ formSubmission: this }, this.result),
|
|
810
|
+
});
|
|
811
|
+
this.delegate.formSubmissionFinished(this);
|
|
812
|
+
}
|
|
813
|
+
requestMustRedirect(request) {
|
|
814
|
+
return !request.isIdempotent && this.mustRedirect;
|
|
815
|
+
}
|
|
816
|
+
requestAcceptsTurboStreamResponse(request) {
|
|
817
|
+
return !request.isIdempotent || hasAttribute("data-turbo-stream", this.submitter, this.formElement);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
function buildFormData(formElement, submitter) {
|
|
821
|
+
const formData = new FormData(formElement);
|
|
822
|
+
const name = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute("name");
|
|
823
|
+
const value = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute("value");
|
|
824
|
+
if (name) {
|
|
825
|
+
formData.append(name, value || "");
|
|
826
|
+
}
|
|
827
|
+
return formData;
|
|
828
|
+
}
|
|
829
|
+
function getCookieValue(cookieName) {
|
|
830
|
+
if (cookieName != null) {
|
|
831
|
+
const cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
832
|
+
const cookie = cookies.find((cookie) => cookie.startsWith(cookieName));
|
|
833
|
+
if (cookie) {
|
|
834
|
+
const value = cookie.split("=").slice(1).join("=");
|
|
835
|
+
return value ? decodeURIComponent(value) : undefined;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
function responseSucceededWithoutRedirect(response) {
|
|
840
|
+
return response.statusCode == 200 && !response.redirected;
|
|
841
|
+
}
|
|
842
|
+
function mergeFormDataEntries(url, entries) {
|
|
843
|
+
const searchParams = new URLSearchParams();
|
|
844
|
+
for (const [name, value] of entries) {
|
|
845
|
+
if (value instanceof File)
|
|
846
|
+
continue;
|
|
847
|
+
searchParams.append(name, value);
|
|
848
|
+
}
|
|
849
|
+
url.search = searchParams.toString();
|
|
850
|
+
return url;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
class Snapshot {
|
|
854
|
+
constructor(element) {
|
|
855
|
+
this.element = element;
|
|
856
|
+
}
|
|
857
|
+
get activeElement() {
|
|
858
|
+
return this.element.ownerDocument.activeElement;
|
|
859
|
+
}
|
|
860
|
+
get children() {
|
|
861
|
+
return [...this.element.children];
|
|
862
|
+
}
|
|
863
|
+
hasAnchor(anchor) {
|
|
864
|
+
return this.getElementForAnchor(anchor) != null;
|
|
865
|
+
}
|
|
866
|
+
getElementForAnchor(anchor) {
|
|
867
|
+
return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;
|
|
868
|
+
}
|
|
869
|
+
get isConnected() {
|
|
870
|
+
return this.element.isConnected;
|
|
871
|
+
}
|
|
872
|
+
get firstAutofocusableElement() {
|
|
873
|
+
const inertDisabledOrHidden = "[inert], :disabled, [hidden], details:not([open]), dialog:not([open])";
|
|
874
|
+
for (const element of this.element.querySelectorAll("[autofocus]")) {
|
|
875
|
+
if (element.closest(inertDisabledOrHidden) == null)
|
|
876
|
+
return element;
|
|
877
|
+
else
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
get permanentElements() {
|
|
883
|
+
return queryPermanentElementsAll(this.element);
|
|
884
|
+
}
|
|
885
|
+
getPermanentElementById(id) {
|
|
886
|
+
return getPermanentElementById(this.element, id);
|
|
887
|
+
}
|
|
888
|
+
getPermanentElementMapForSnapshot(snapshot) {
|
|
889
|
+
const permanentElementMap = {};
|
|
890
|
+
for (const currentPermanentElement of this.permanentElements) {
|
|
891
|
+
const { id } = currentPermanentElement;
|
|
892
|
+
const newPermanentElement = snapshot.getPermanentElementById(id);
|
|
893
|
+
if (newPermanentElement) {
|
|
894
|
+
permanentElementMap[id] = [currentPermanentElement, newPermanentElement];
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return permanentElementMap;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
function getPermanentElementById(node, id) {
|
|
901
|
+
return node.querySelector(`#${id}[data-turbo-permanent]`);
|
|
902
|
+
}
|
|
903
|
+
function queryPermanentElementsAll(node) {
|
|
904
|
+
return node.querySelectorAll("[id][data-turbo-permanent]");
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
class FormSubmitObserver {
|
|
908
|
+
constructor(delegate, eventTarget) {
|
|
909
|
+
this.started = false;
|
|
910
|
+
this.submitCaptured = () => {
|
|
911
|
+
this.eventTarget.removeEventListener("submit", this.submitBubbled, false);
|
|
912
|
+
this.eventTarget.addEventListener("submit", this.submitBubbled, false);
|
|
913
|
+
};
|
|
914
|
+
this.submitBubbled = ((event) => {
|
|
915
|
+
if (!event.defaultPrevented) {
|
|
916
|
+
const form = event.target instanceof HTMLFormElement ? event.target : undefined;
|
|
917
|
+
const submitter = event.submitter || undefined;
|
|
918
|
+
if (form &&
|
|
919
|
+
submissionDoesNotDismissDialog(form, submitter) &&
|
|
920
|
+
submissionDoesNotTargetIFrame(form, submitter) &&
|
|
921
|
+
this.delegate.willSubmitForm(form, submitter)) {
|
|
922
|
+
event.preventDefault();
|
|
923
|
+
event.stopImmediatePropagation();
|
|
924
|
+
this.delegate.formSubmitted(form, submitter);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
this.delegate = delegate;
|
|
929
|
+
this.eventTarget = eventTarget;
|
|
930
|
+
}
|
|
931
|
+
start() {
|
|
932
|
+
if (!this.started) {
|
|
933
|
+
this.eventTarget.addEventListener("submit", this.submitCaptured, true);
|
|
934
|
+
this.started = true;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
stop() {
|
|
938
|
+
if (this.started) {
|
|
939
|
+
this.eventTarget.removeEventListener("submit", this.submitCaptured, true);
|
|
940
|
+
this.started = false;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
function submissionDoesNotDismissDialog(form, submitter) {
|
|
945
|
+
const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute("formmethod")) || form.getAttribute("method");
|
|
946
|
+
return method != "dialog";
|
|
947
|
+
}
|
|
948
|
+
function submissionDoesNotTargetIFrame(form, submitter) {
|
|
949
|
+
if ((submitter === null || submitter === void 0 ? void 0 : submitter.hasAttribute("formtarget")) || form.hasAttribute("target")) {
|
|
950
|
+
const target = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute("formtarget")) || form.target;
|
|
951
|
+
for (const element of document.getElementsByName(target)) {
|
|
952
|
+
if (element instanceof HTMLIFrameElement)
|
|
953
|
+
return false;
|
|
954
|
+
}
|
|
955
|
+
return true;
|
|
956
|
+
}
|
|
957
|
+
else {
|
|
958
|
+
return true;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
class View {
|
|
963
|
+
constructor(delegate, element) {
|
|
964
|
+
this.resolveRenderPromise = (_value) => { };
|
|
965
|
+
this.resolveInterceptionPromise = (_value) => { };
|
|
966
|
+
this.delegate = delegate;
|
|
967
|
+
this.element = element;
|
|
968
|
+
}
|
|
969
|
+
scrollToAnchor(anchor) {
|
|
970
|
+
const element = this.snapshot.getElementForAnchor(anchor);
|
|
971
|
+
if (element) {
|
|
972
|
+
this.scrollToElement(element);
|
|
973
|
+
this.focusElement(element);
|
|
974
|
+
}
|
|
975
|
+
else {
|
|
976
|
+
this.scrollToPosition({ x: 0, y: 0 });
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
scrollToAnchorFromLocation(location) {
|
|
980
|
+
this.scrollToAnchor(getAnchor(location));
|
|
981
|
+
}
|
|
982
|
+
scrollToElement(element) {
|
|
983
|
+
element.scrollIntoView();
|
|
984
|
+
}
|
|
985
|
+
focusElement(element) {
|
|
986
|
+
if (element instanceof HTMLElement) {
|
|
987
|
+
if (element.hasAttribute("tabindex")) {
|
|
988
|
+
element.focus();
|
|
989
|
+
}
|
|
990
|
+
else {
|
|
991
|
+
element.setAttribute("tabindex", "-1");
|
|
992
|
+
element.focus();
|
|
993
|
+
element.removeAttribute("tabindex");
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
scrollToPosition({ x, y }) {
|
|
998
|
+
this.scrollRoot.scrollTo(x, y);
|
|
999
|
+
}
|
|
1000
|
+
scrollToTop() {
|
|
1001
|
+
this.scrollToPosition({ x: 0, y: 0 });
|
|
1002
|
+
}
|
|
1003
|
+
get scrollRoot() {
|
|
1004
|
+
return window;
|
|
1005
|
+
}
|
|
1006
|
+
async render(renderer) {
|
|
1007
|
+
const { isPreview, shouldRender, newSnapshot: snapshot } = renderer;
|
|
1008
|
+
if (shouldRender) {
|
|
1009
|
+
try {
|
|
1010
|
+
this.renderPromise = new Promise((resolve) => (this.resolveRenderPromise = resolve));
|
|
1011
|
+
this.renderer = renderer;
|
|
1012
|
+
await this.prepareToRenderSnapshot(renderer);
|
|
1013
|
+
const renderInterception = new Promise((resolve) => (this.resolveInterceptionPromise = resolve));
|
|
1014
|
+
const options = { resume: this.resolveInterceptionPromise, render: this.renderer.renderElement };
|
|
1015
|
+
const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);
|
|
1016
|
+
if (!immediateRender)
|
|
1017
|
+
await renderInterception;
|
|
1018
|
+
await this.renderSnapshot(renderer);
|
|
1019
|
+
this.delegate.viewRenderedSnapshot(snapshot, isPreview);
|
|
1020
|
+
this.delegate.preloadOnLoadLinksForView(this.element);
|
|
1021
|
+
this.finishRenderingSnapshot(renderer);
|
|
1022
|
+
}
|
|
1023
|
+
finally {
|
|
1024
|
+
delete this.renderer;
|
|
1025
|
+
this.resolveRenderPromise(undefined);
|
|
1026
|
+
delete this.renderPromise;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
else {
|
|
1030
|
+
this.invalidate(renderer.reloadReason);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
invalidate(reason) {
|
|
1034
|
+
this.delegate.viewInvalidated(reason);
|
|
1035
|
+
}
|
|
1036
|
+
async prepareToRenderSnapshot(renderer) {
|
|
1037
|
+
this.markAsPreview(renderer.isPreview);
|
|
1038
|
+
await renderer.prepareToRender();
|
|
1039
|
+
}
|
|
1040
|
+
markAsPreview(isPreview) {
|
|
1041
|
+
if (isPreview) {
|
|
1042
|
+
this.element.setAttribute("data-turbo-preview", "");
|
|
1043
|
+
}
|
|
1044
|
+
else {
|
|
1045
|
+
this.element.removeAttribute("data-turbo-preview");
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
async renderSnapshot(renderer) {
|
|
1049
|
+
await renderer.render();
|
|
1050
|
+
}
|
|
1051
|
+
finishRenderingSnapshot(renderer) {
|
|
1052
|
+
renderer.finishRendering();
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
class FrameView extends View {
|
|
1057
|
+
invalidate() {
|
|
1058
|
+
this.element.innerHTML = "";
|
|
1059
|
+
}
|
|
1060
|
+
get snapshot() {
|
|
1061
|
+
return new Snapshot(this.element);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
class LinkInterceptor {
|
|
1066
|
+
constructor(delegate, element) {
|
|
1067
|
+
this.clickBubbled = (event) => {
|
|
1068
|
+
if (this.respondsToEventTarget(event.target)) {
|
|
1069
|
+
this.clickEvent = event;
|
|
1070
|
+
}
|
|
1071
|
+
else {
|
|
1072
|
+
delete this.clickEvent;
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
this.linkClicked = ((event) => {
|
|
1076
|
+
if (this.clickEvent && this.respondsToEventTarget(event.target) && event.target instanceof Element) {
|
|
1077
|
+
if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {
|
|
1078
|
+
this.clickEvent.preventDefault();
|
|
1079
|
+
event.preventDefault();
|
|
1080
|
+
this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
delete this.clickEvent;
|
|
1084
|
+
});
|
|
1085
|
+
this.willVisit = ((_event) => {
|
|
1086
|
+
delete this.clickEvent;
|
|
1087
|
+
});
|
|
1088
|
+
this.delegate = delegate;
|
|
1089
|
+
this.element = element;
|
|
1090
|
+
}
|
|
1091
|
+
start() {
|
|
1092
|
+
this.element.addEventListener("click", this.clickBubbled);
|
|
1093
|
+
document.addEventListener("turbo:click", this.linkClicked);
|
|
1094
|
+
document.addEventListener("turbo:before-visit", this.willVisit);
|
|
1095
|
+
}
|
|
1096
|
+
stop() {
|
|
1097
|
+
this.element.removeEventListener("click", this.clickBubbled);
|
|
1098
|
+
document.removeEventListener("turbo:click", this.linkClicked);
|
|
1099
|
+
document.removeEventListener("turbo:before-visit", this.willVisit);
|
|
1100
|
+
}
|
|
1101
|
+
respondsToEventTarget(target) {
|
|
1102
|
+
const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;
|
|
1103
|
+
return element && element.closest("turbo-frame, html") == this.element;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
class LinkClickObserver {
|
|
1108
|
+
constructor(delegate, eventTarget) {
|
|
1109
|
+
this.started = false;
|
|
1110
|
+
this.clickCaptured = () => {
|
|
1111
|
+
this.eventTarget.removeEventListener("click", this.clickBubbled, false);
|
|
1112
|
+
this.eventTarget.addEventListener("click", this.clickBubbled, false);
|
|
1113
|
+
};
|
|
1114
|
+
this.clickBubbled = (event) => {
|
|
1115
|
+
if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {
|
|
1116
|
+
const target = (event.composedPath && event.composedPath()[0]) || event.target;
|
|
1117
|
+
const link = this.findLinkFromClickTarget(target);
|
|
1118
|
+
if (link && doesNotTargetIFrame(link)) {
|
|
1119
|
+
const location = this.getLocationForLink(link);
|
|
1120
|
+
if (this.delegate.willFollowLinkToLocation(link, location, event)) {
|
|
1121
|
+
event.preventDefault();
|
|
1122
|
+
this.delegate.followedLinkToLocation(link, location);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
this.delegate = delegate;
|
|
1128
|
+
this.eventTarget = eventTarget;
|
|
1129
|
+
}
|
|
1130
|
+
start() {
|
|
1131
|
+
if (!this.started) {
|
|
1132
|
+
this.eventTarget.addEventListener("click", this.clickCaptured, true);
|
|
1133
|
+
this.started = true;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
stop() {
|
|
1137
|
+
if (this.started) {
|
|
1138
|
+
this.eventTarget.removeEventListener("click", this.clickCaptured, true);
|
|
1139
|
+
this.started = false;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
clickEventIsSignificant(event) {
|
|
1143
|
+
return !((event.target && event.target.isContentEditable) ||
|
|
1144
|
+
event.defaultPrevented ||
|
|
1145
|
+
event.which > 1 ||
|
|
1146
|
+
event.altKey ||
|
|
1147
|
+
event.ctrlKey ||
|
|
1148
|
+
event.metaKey ||
|
|
1149
|
+
event.shiftKey);
|
|
1150
|
+
}
|
|
1151
|
+
findLinkFromClickTarget(target) {
|
|
1152
|
+
return findClosestRecursively(target, "a[href]:not([target^=_]):not([download])");
|
|
1153
|
+
}
|
|
1154
|
+
getLocationForLink(link) {
|
|
1155
|
+
return expandURL(link.getAttribute("href") || "");
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
function doesNotTargetIFrame(anchor) {
|
|
1159
|
+
if (anchor.hasAttribute("target")) {
|
|
1160
|
+
for (const element of document.getElementsByName(anchor.target)) {
|
|
1161
|
+
if (element instanceof HTMLIFrameElement)
|
|
1162
|
+
return false;
|
|
1163
|
+
}
|
|
1164
|
+
return true;
|
|
1165
|
+
}
|
|
1166
|
+
else {
|
|
1167
|
+
return true;
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
class FormLinkClickObserver {
|
|
1172
|
+
constructor(delegate, element) {
|
|
1173
|
+
this.delegate = delegate;
|
|
1174
|
+
this.linkInterceptor = new LinkClickObserver(this, element);
|
|
1175
|
+
}
|
|
1176
|
+
start() {
|
|
1177
|
+
this.linkInterceptor.start();
|
|
1178
|
+
}
|
|
1179
|
+
stop() {
|
|
1180
|
+
this.linkInterceptor.stop();
|
|
1181
|
+
}
|
|
1182
|
+
willFollowLinkToLocation(link, location, originalEvent) {
|
|
1183
|
+
return (this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) &&
|
|
1184
|
+
link.hasAttribute("data-turbo-method"));
|
|
1185
|
+
}
|
|
1186
|
+
followedLinkToLocation(link, location) {
|
|
1187
|
+
const form = document.createElement("form");
|
|
1188
|
+
const type = "hidden";
|
|
1189
|
+
for (const [name, value] of location.searchParams) {
|
|
1190
|
+
form.append(Object.assign(document.createElement("input"), { type, name, value }));
|
|
1191
|
+
}
|
|
1192
|
+
const action = Object.assign(location, { search: "" });
|
|
1193
|
+
form.setAttribute("data-turbo", "true");
|
|
1194
|
+
form.setAttribute("action", action.href);
|
|
1195
|
+
form.setAttribute("hidden", "");
|
|
1196
|
+
const method = link.getAttribute("data-turbo-method");
|
|
1197
|
+
if (method)
|
|
1198
|
+
form.setAttribute("method", method);
|
|
1199
|
+
const turboFrame = link.getAttribute("data-turbo-frame");
|
|
1200
|
+
if (turboFrame)
|
|
1201
|
+
form.setAttribute("data-turbo-frame", turboFrame);
|
|
1202
|
+
const turboAction = getVisitAction(link);
|
|
1203
|
+
if (turboAction)
|
|
1204
|
+
form.setAttribute("data-turbo-action", turboAction);
|
|
1205
|
+
const turboConfirm = link.getAttribute("data-turbo-confirm");
|
|
1206
|
+
if (turboConfirm)
|
|
1207
|
+
form.setAttribute("data-turbo-confirm", turboConfirm);
|
|
1208
|
+
const turboStream = link.hasAttribute("data-turbo-stream");
|
|
1209
|
+
if (turboStream)
|
|
1210
|
+
form.setAttribute("data-turbo-stream", "");
|
|
1211
|
+
this.delegate.submittedFormLinkToLocation(link, location, form);
|
|
1212
|
+
document.body.appendChild(form);
|
|
1213
|
+
form.addEventListener("turbo:submit-end", () => form.remove(), { once: true });
|
|
1214
|
+
requestAnimationFrame(() => form.requestSubmit());
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
class Bardo {
|
|
1219
|
+
constructor(delegate, permanentElementMap) {
|
|
1220
|
+
this.delegate = delegate;
|
|
1221
|
+
this.permanentElementMap = permanentElementMap;
|
|
1222
|
+
}
|
|
1223
|
+
static async preservingPermanentElements(delegate, permanentElementMap, callback) {
|
|
1224
|
+
const bardo = new this(delegate, permanentElementMap);
|
|
1225
|
+
bardo.enter();
|
|
1226
|
+
await callback();
|
|
1227
|
+
bardo.leave();
|
|
1228
|
+
}
|
|
1229
|
+
enter() {
|
|
1230
|
+
for (const id in this.permanentElementMap) {
|
|
1231
|
+
const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];
|
|
1232
|
+
this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);
|
|
1233
|
+
this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
leave() {
|
|
1237
|
+
for (const id in this.permanentElementMap) {
|
|
1238
|
+
const [currentPermanentElement] = this.permanentElementMap[id];
|
|
1239
|
+
this.replaceCurrentPermanentElementWithClone(currentPermanentElement);
|
|
1240
|
+
this.replacePlaceholderWithPermanentElement(currentPermanentElement);
|
|
1241
|
+
this.delegate.leavingBardo(currentPermanentElement);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
replaceNewPermanentElementWithPlaceholder(permanentElement) {
|
|
1245
|
+
const placeholder = createPlaceholderForPermanentElement(permanentElement);
|
|
1246
|
+
permanentElement.replaceWith(placeholder);
|
|
1247
|
+
}
|
|
1248
|
+
replaceCurrentPermanentElementWithClone(permanentElement) {
|
|
1249
|
+
const clone = permanentElement.cloneNode(true);
|
|
1250
|
+
permanentElement.replaceWith(clone);
|
|
1251
|
+
}
|
|
1252
|
+
replacePlaceholderWithPermanentElement(permanentElement) {
|
|
1253
|
+
const placeholder = this.getPlaceholderById(permanentElement.id);
|
|
1254
|
+
placeholder === null || placeholder === void 0 ? void 0 : placeholder.replaceWith(permanentElement);
|
|
1255
|
+
}
|
|
1256
|
+
getPlaceholderById(id) {
|
|
1257
|
+
return this.placeholders.find((element) => element.content == id);
|
|
1258
|
+
}
|
|
1259
|
+
get placeholders() {
|
|
1260
|
+
return [...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")];
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
function createPlaceholderForPermanentElement(permanentElement) {
|
|
1264
|
+
const element = document.createElement("meta");
|
|
1265
|
+
element.setAttribute("name", "turbo-permanent-placeholder");
|
|
1266
|
+
element.setAttribute("content", permanentElement.id);
|
|
1267
|
+
return element;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
class Renderer {
|
|
1271
|
+
constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
|
|
1272
|
+
this.activeElement = null;
|
|
1273
|
+
this.currentSnapshot = currentSnapshot;
|
|
1274
|
+
this.newSnapshot = newSnapshot;
|
|
1275
|
+
this.isPreview = isPreview;
|
|
1276
|
+
this.willRender = willRender;
|
|
1277
|
+
this.renderElement = renderElement;
|
|
1278
|
+
this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }));
|
|
1279
|
+
}
|
|
1280
|
+
get shouldRender() {
|
|
1281
|
+
return true;
|
|
1282
|
+
}
|
|
1283
|
+
get reloadReason() {
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
prepareToRender() {
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
finishRendering() {
|
|
1290
|
+
if (this.resolvingFunctions) {
|
|
1291
|
+
this.resolvingFunctions.resolve();
|
|
1292
|
+
delete this.resolvingFunctions;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
async preservingPermanentElements(callback) {
|
|
1296
|
+
await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);
|
|
1297
|
+
}
|
|
1298
|
+
focusFirstAutofocusableElement() {
|
|
1299
|
+
const element = this.connectedSnapshot.firstAutofocusableElement;
|
|
1300
|
+
if (elementIsFocusable(element)) {
|
|
1301
|
+
element.focus();
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
enteringBardo(currentPermanentElement) {
|
|
1305
|
+
if (this.activeElement)
|
|
1306
|
+
return;
|
|
1307
|
+
if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {
|
|
1308
|
+
this.activeElement = this.currentSnapshot.activeElement;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
leavingBardo(currentPermanentElement) {
|
|
1312
|
+
if (currentPermanentElement.contains(this.activeElement) && this.activeElement instanceof HTMLElement) {
|
|
1313
|
+
this.activeElement.focus();
|
|
1314
|
+
this.activeElement = null;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
get connectedSnapshot() {
|
|
1318
|
+
return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;
|
|
1319
|
+
}
|
|
1320
|
+
get currentElement() {
|
|
1321
|
+
return this.currentSnapshot.element;
|
|
1322
|
+
}
|
|
1323
|
+
get newElement() {
|
|
1324
|
+
return this.newSnapshot.element;
|
|
1325
|
+
}
|
|
1326
|
+
get permanentElementMap() {
|
|
1327
|
+
return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
function elementIsFocusable(element) {
|
|
1331
|
+
return element && typeof element.focus == "function";
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
class FrameRenderer extends Renderer {
|
|
1335
|
+
constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
|
|
1336
|
+
super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);
|
|
1337
|
+
this.delegate = delegate;
|
|
1338
|
+
}
|
|
1339
|
+
static renderElement(currentElement, newElement) {
|
|
1340
|
+
var _a;
|
|
1341
|
+
const destinationRange = document.createRange();
|
|
1342
|
+
destinationRange.selectNodeContents(currentElement);
|
|
1343
|
+
destinationRange.deleteContents();
|
|
1344
|
+
const frameElement = newElement;
|
|
1345
|
+
const sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();
|
|
1346
|
+
if (sourceRange) {
|
|
1347
|
+
sourceRange.selectNodeContents(frameElement);
|
|
1348
|
+
currentElement.appendChild(sourceRange.extractContents());
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
get shouldRender() {
|
|
1352
|
+
return true;
|
|
1353
|
+
}
|
|
1354
|
+
async render() {
|
|
1355
|
+
await nextAnimationFrame();
|
|
1356
|
+
this.preservingPermanentElements(() => {
|
|
1357
|
+
this.loadFrameElement();
|
|
1358
|
+
});
|
|
1359
|
+
this.scrollFrameIntoView();
|
|
1360
|
+
await nextAnimationFrame();
|
|
1361
|
+
this.focusFirstAutofocusableElement();
|
|
1362
|
+
await nextAnimationFrame();
|
|
1363
|
+
this.activateScriptElements();
|
|
1364
|
+
}
|
|
1365
|
+
loadFrameElement() {
|
|
1366
|
+
this.delegate.willRenderFrame(this.currentElement, this.newElement);
|
|
1367
|
+
this.renderElement(this.currentElement, this.newElement);
|
|
1368
|
+
}
|
|
1369
|
+
scrollFrameIntoView() {
|
|
1370
|
+
if (this.currentElement.autoscroll || this.newElement.autoscroll) {
|
|
1371
|
+
const element = this.currentElement.firstElementChild;
|
|
1372
|
+
const block = readScrollLogicalPosition(this.currentElement.getAttribute("data-autoscroll-block"), "end");
|
|
1373
|
+
const behavior = readScrollBehavior(this.currentElement.getAttribute("data-autoscroll-behavior"), "auto");
|
|
1374
|
+
if (element) {
|
|
1375
|
+
element.scrollIntoView({ block, behavior });
|
|
1376
|
+
return true;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
return false;
|
|
1380
|
+
}
|
|
1381
|
+
activateScriptElements() {
|
|
1382
|
+
for (const inertScriptElement of this.newScriptElements) {
|
|
1383
|
+
const activatedScriptElement = activateScriptElement(inertScriptElement);
|
|
1384
|
+
inertScriptElement.replaceWith(activatedScriptElement);
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
get newScriptElements() {
|
|
1388
|
+
return this.currentElement.querySelectorAll("script");
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
function readScrollLogicalPosition(value, defaultValue) {
|
|
1392
|
+
if (value == "end" || value == "start" || value == "center" || value == "nearest") {
|
|
1393
|
+
return value;
|
|
1394
|
+
}
|
|
1395
|
+
else {
|
|
1396
|
+
return defaultValue;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
function readScrollBehavior(value, defaultValue) {
|
|
1400
|
+
if (value == "auto" || value == "smooth") {
|
|
1401
|
+
return value;
|
|
1402
|
+
}
|
|
1403
|
+
else {
|
|
1404
|
+
return defaultValue;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
class ProgressBar {
|
|
1409
|
+
constructor() {
|
|
1410
|
+
this.hiding = false;
|
|
1411
|
+
this.value = 0;
|
|
1412
|
+
this.visible = false;
|
|
1413
|
+
this.trickle = () => {
|
|
1414
|
+
this.setValue(this.value + Math.random() / 100);
|
|
1415
|
+
};
|
|
1416
|
+
this.stylesheetElement = this.createStylesheetElement();
|
|
1417
|
+
this.progressElement = this.createProgressElement();
|
|
1418
|
+
this.installStylesheetElement();
|
|
1419
|
+
this.setValue(0);
|
|
1420
|
+
}
|
|
1421
|
+
static get defaultCSS() {
|
|
1422
|
+
return unindent `
|
|
1423
|
+
.turbo-progress-bar {
|
|
1424
|
+
position: fixed;
|
|
1425
|
+
display: block;
|
|
1426
|
+
top: 0;
|
|
1427
|
+
left: 0;
|
|
1428
|
+
height: 3px;
|
|
1429
|
+
background: #0076ff;
|
|
1430
|
+
z-index: 2147483647;
|
|
1431
|
+
transition:
|
|
1432
|
+
width ${ProgressBar.animationDuration}ms ease-out,
|
|
1433
|
+
opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;
|
|
1434
|
+
transform: translate3d(0, 0, 0);
|
|
1435
|
+
}
|
|
1436
|
+
`;
|
|
1437
|
+
}
|
|
1438
|
+
show() {
|
|
1439
|
+
if (!this.visible) {
|
|
1440
|
+
this.visible = true;
|
|
1441
|
+
this.installProgressElement();
|
|
1442
|
+
this.startTrickling();
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
hide() {
|
|
1446
|
+
if (this.visible && !this.hiding) {
|
|
1447
|
+
this.hiding = true;
|
|
1448
|
+
this.fadeProgressElement(() => {
|
|
1449
|
+
this.uninstallProgressElement();
|
|
1450
|
+
this.stopTrickling();
|
|
1451
|
+
this.visible = false;
|
|
1452
|
+
this.hiding = false;
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
setValue(value) {
|
|
1457
|
+
this.value = value;
|
|
1458
|
+
this.refresh();
|
|
1459
|
+
}
|
|
1460
|
+
installStylesheetElement() {
|
|
1461
|
+
document.head.insertBefore(this.stylesheetElement, document.head.firstChild);
|
|
1462
|
+
}
|
|
1463
|
+
installProgressElement() {
|
|
1464
|
+
this.progressElement.style.width = "0";
|
|
1465
|
+
this.progressElement.style.opacity = "1";
|
|
1466
|
+
document.documentElement.insertBefore(this.progressElement, document.body);
|
|
1467
|
+
this.refresh();
|
|
1468
|
+
}
|
|
1469
|
+
fadeProgressElement(callback) {
|
|
1470
|
+
this.progressElement.style.opacity = "0";
|
|
1471
|
+
setTimeout(callback, ProgressBar.animationDuration * 1.5);
|
|
1472
|
+
}
|
|
1473
|
+
uninstallProgressElement() {
|
|
1474
|
+
if (this.progressElement.parentNode) {
|
|
1475
|
+
document.documentElement.removeChild(this.progressElement);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
startTrickling() {
|
|
1479
|
+
if (!this.trickleInterval) {
|
|
1480
|
+
this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
stopTrickling() {
|
|
1484
|
+
window.clearInterval(this.trickleInterval);
|
|
1485
|
+
delete this.trickleInterval;
|
|
1486
|
+
}
|
|
1487
|
+
refresh() {
|
|
1488
|
+
requestAnimationFrame(() => {
|
|
1489
|
+
this.progressElement.style.width = `${10 + this.value * 90}%`;
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
createStylesheetElement() {
|
|
1493
|
+
const element = document.createElement("style");
|
|
1494
|
+
element.type = "text/css";
|
|
1495
|
+
element.textContent = ProgressBar.defaultCSS;
|
|
1496
|
+
if (this.cspNonce) {
|
|
1497
|
+
element.nonce = this.cspNonce;
|
|
1498
|
+
}
|
|
1499
|
+
return element;
|
|
1500
|
+
}
|
|
1501
|
+
createProgressElement() {
|
|
1502
|
+
const element = document.createElement("div");
|
|
1503
|
+
element.className = "turbo-progress-bar";
|
|
1504
|
+
return element;
|
|
1505
|
+
}
|
|
1506
|
+
get cspNonce() {
|
|
1507
|
+
return getMetaContent("csp-nonce");
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
ProgressBar.animationDuration = 300;
|
|
1511
|
+
|
|
1512
|
+
class HeadSnapshot extends Snapshot {
|
|
1513
|
+
constructor() {
|
|
1514
|
+
super(...arguments);
|
|
1515
|
+
this.detailsByOuterHTML = this.children
|
|
1516
|
+
.filter((element) => !elementIsNoscript(element))
|
|
1517
|
+
.map((element) => elementWithoutNonce(element))
|
|
1518
|
+
.reduce((result, element) => {
|
|
1519
|
+
const { outerHTML } = element;
|
|
1520
|
+
const details = outerHTML in result
|
|
1521
|
+
? result[outerHTML]
|
|
1522
|
+
: {
|
|
1523
|
+
type: elementType(element),
|
|
1524
|
+
tracked: elementIsTracked(element),
|
|
1525
|
+
elements: [],
|
|
1526
|
+
};
|
|
1527
|
+
return Object.assign(Object.assign({}, result), { [outerHTML]: Object.assign(Object.assign({}, details), { elements: [...details.elements, element] }) });
|
|
1528
|
+
}, {});
|
|
1529
|
+
}
|
|
1530
|
+
get trackedElementSignature() {
|
|
1531
|
+
return Object.keys(this.detailsByOuterHTML)
|
|
1532
|
+
.filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked)
|
|
1533
|
+
.join("");
|
|
1534
|
+
}
|
|
1535
|
+
getScriptElementsNotInSnapshot(snapshot) {
|
|
1536
|
+
return this.getElementsMatchingTypeNotInSnapshot("script", snapshot);
|
|
1537
|
+
}
|
|
1538
|
+
getStylesheetElementsNotInSnapshot(snapshot) {
|
|
1539
|
+
return this.getElementsMatchingTypeNotInSnapshot("stylesheet", snapshot);
|
|
1540
|
+
}
|
|
1541
|
+
getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {
|
|
1542
|
+
return Object.keys(this.detailsByOuterHTML)
|
|
1543
|
+
.filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML))
|
|
1544
|
+
.map((outerHTML) => this.detailsByOuterHTML[outerHTML])
|
|
1545
|
+
.filter(({ type }) => type == matchedType)
|
|
1546
|
+
.map(({ elements: [element] }) => element);
|
|
1547
|
+
}
|
|
1548
|
+
get provisionalElements() {
|
|
1549
|
+
return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {
|
|
1550
|
+
const { type, tracked, elements } = this.detailsByOuterHTML[outerHTML];
|
|
1551
|
+
if (type == null && !tracked) {
|
|
1552
|
+
return [...result, ...elements];
|
|
1553
|
+
}
|
|
1554
|
+
else if (elements.length > 1) {
|
|
1555
|
+
return [...result, ...elements.slice(1)];
|
|
1556
|
+
}
|
|
1557
|
+
else {
|
|
1558
|
+
return result;
|
|
1559
|
+
}
|
|
1560
|
+
}, []);
|
|
1561
|
+
}
|
|
1562
|
+
getMetaValue(name) {
|
|
1563
|
+
const element = this.findMetaElementByName(name);
|
|
1564
|
+
return element ? element.getAttribute("content") : null;
|
|
1565
|
+
}
|
|
1566
|
+
findMetaElementByName(name) {
|
|
1567
|
+
return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {
|
|
1568
|
+
const { elements: [element], } = this.detailsByOuterHTML[outerHTML];
|
|
1569
|
+
return elementIsMetaElementWithName(element, name) ? element : result;
|
|
1570
|
+
}, undefined);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
function elementType(element) {
|
|
1574
|
+
if (elementIsScript(element)) {
|
|
1575
|
+
return "script";
|
|
1576
|
+
}
|
|
1577
|
+
else if (elementIsStylesheet(element)) {
|
|
1578
|
+
return "stylesheet";
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
function elementIsTracked(element) {
|
|
1582
|
+
return element.getAttribute("data-turbo-track") == "reload";
|
|
1583
|
+
}
|
|
1584
|
+
function elementIsScript(element) {
|
|
1585
|
+
const tagName = element.localName;
|
|
1586
|
+
return tagName == "script";
|
|
1587
|
+
}
|
|
1588
|
+
function elementIsNoscript(element) {
|
|
1589
|
+
const tagName = element.localName;
|
|
1590
|
+
return tagName == "noscript";
|
|
1591
|
+
}
|
|
1592
|
+
function elementIsStylesheet(element) {
|
|
1593
|
+
const tagName = element.localName;
|
|
1594
|
+
return tagName == "style" || (tagName == "link" && element.getAttribute("rel") == "stylesheet");
|
|
1595
|
+
}
|
|
1596
|
+
function elementIsMetaElementWithName(element, name) {
|
|
1597
|
+
const tagName = element.localName;
|
|
1598
|
+
return tagName == "meta" && element.getAttribute("name") == name;
|
|
1599
|
+
}
|
|
1600
|
+
function elementWithoutNonce(element) {
|
|
1601
|
+
if (element.hasAttribute("nonce")) {
|
|
1602
|
+
element.setAttribute("nonce", "");
|
|
1603
|
+
}
|
|
1604
|
+
return element;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
class PageSnapshot extends Snapshot {
|
|
1608
|
+
constructor(element, headSnapshot) {
|
|
1609
|
+
super(element);
|
|
1610
|
+
this.headSnapshot = headSnapshot;
|
|
1611
|
+
}
|
|
1612
|
+
static fromHTMLString(html = "") {
|
|
1613
|
+
return this.fromDocument(parseHTMLDocument(html));
|
|
1614
|
+
}
|
|
1615
|
+
static fromElement(element) {
|
|
1616
|
+
return this.fromDocument(element.ownerDocument);
|
|
1617
|
+
}
|
|
1618
|
+
static fromDocument({ head, body }) {
|
|
1619
|
+
return new this(body, new HeadSnapshot(head));
|
|
1620
|
+
}
|
|
1621
|
+
clone() {
|
|
1622
|
+
const clonedElement = this.element.cloneNode(true);
|
|
1623
|
+
const selectElements = this.element.querySelectorAll("select");
|
|
1624
|
+
const clonedSelectElements = clonedElement.querySelectorAll("select");
|
|
1625
|
+
for (const [index, source] of selectElements.entries()) {
|
|
1626
|
+
const clone = clonedSelectElements[index];
|
|
1627
|
+
for (const option of clone.selectedOptions)
|
|
1628
|
+
option.selected = false;
|
|
1629
|
+
for (const option of source.selectedOptions)
|
|
1630
|
+
clone.options[option.index].selected = true;
|
|
1631
|
+
}
|
|
1632
|
+
for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type="password"]')) {
|
|
1633
|
+
clonedPasswordInput.value = "";
|
|
1634
|
+
}
|
|
1635
|
+
return new PageSnapshot(clonedElement, this.headSnapshot);
|
|
1636
|
+
}
|
|
1637
|
+
get headElement() {
|
|
1638
|
+
return this.headSnapshot.element;
|
|
1639
|
+
}
|
|
1640
|
+
get rootLocation() {
|
|
1641
|
+
var _a;
|
|
1642
|
+
const root = (_a = this.getSetting("root")) !== null && _a !== void 0 ? _a : "/";
|
|
1643
|
+
return expandURL(root);
|
|
1644
|
+
}
|
|
1645
|
+
get cacheControlValue() {
|
|
1646
|
+
return this.getSetting("cache-control");
|
|
1647
|
+
}
|
|
1648
|
+
get isPreviewable() {
|
|
1649
|
+
return this.cacheControlValue != "no-preview";
|
|
1650
|
+
}
|
|
1651
|
+
get isCacheable() {
|
|
1652
|
+
return this.cacheControlValue != "no-cache";
|
|
1653
|
+
}
|
|
1654
|
+
get isVisitable() {
|
|
1655
|
+
return this.getSetting("visit-control") != "reload";
|
|
1656
|
+
}
|
|
1657
|
+
getSetting(name) {
|
|
1658
|
+
return this.headSnapshot.getMetaValue(`turbo-${name}`);
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
var TimingMetric;
|
|
1663
|
+
(function (TimingMetric) {
|
|
1664
|
+
TimingMetric["visitStart"] = "visitStart";
|
|
1665
|
+
TimingMetric["requestStart"] = "requestStart";
|
|
1666
|
+
TimingMetric["requestEnd"] = "requestEnd";
|
|
1667
|
+
TimingMetric["visitEnd"] = "visitEnd";
|
|
1668
|
+
})(TimingMetric || (TimingMetric = {}));
|
|
1669
|
+
var VisitState;
|
|
1670
|
+
(function (VisitState) {
|
|
1671
|
+
VisitState["initialized"] = "initialized";
|
|
1672
|
+
VisitState["started"] = "started";
|
|
1673
|
+
VisitState["canceled"] = "canceled";
|
|
1674
|
+
VisitState["failed"] = "failed";
|
|
1675
|
+
VisitState["completed"] = "completed";
|
|
1676
|
+
})(VisitState || (VisitState = {}));
|
|
1677
|
+
const defaultOptions = {
|
|
1678
|
+
action: "advance",
|
|
1679
|
+
historyChanged: false,
|
|
1680
|
+
visitCachedSnapshot: () => { },
|
|
1681
|
+
willRender: true,
|
|
1682
|
+
updateHistory: true,
|
|
1683
|
+
shouldCacheSnapshot: true,
|
|
1684
|
+
acceptsStreamResponse: false,
|
|
1685
|
+
};
|
|
1686
|
+
var SystemStatusCode;
|
|
1687
|
+
(function (SystemStatusCode) {
|
|
1688
|
+
SystemStatusCode[SystemStatusCode["networkFailure"] = 0] = "networkFailure";
|
|
1689
|
+
SystemStatusCode[SystemStatusCode["timeoutFailure"] = -1] = "timeoutFailure";
|
|
1690
|
+
SystemStatusCode[SystemStatusCode["contentTypeMismatch"] = -2] = "contentTypeMismatch";
|
|
1691
|
+
})(SystemStatusCode || (SystemStatusCode = {}));
|
|
1692
|
+
class Visit {
|
|
1693
|
+
constructor(delegate, location, restorationIdentifier, options = {}) {
|
|
1694
|
+
this.identifier = uuid();
|
|
1695
|
+
this.timingMetrics = {};
|
|
1696
|
+
this.followedRedirect = false;
|
|
1697
|
+
this.historyChanged = false;
|
|
1698
|
+
this.scrolled = false;
|
|
1699
|
+
this.shouldCacheSnapshot = true;
|
|
1700
|
+
this.acceptsStreamResponse = false;
|
|
1701
|
+
this.snapshotCached = false;
|
|
1702
|
+
this.state = VisitState.initialized;
|
|
1703
|
+
this.delegate = delegate;
|
|
1704
|
+
this.location = location;
|
|
1705
|
+
this.restorationIdentifier = restorationIdentifier || uuid();
|
|
1706
|
+
const { action, historyChanged, referrer, snapshot, snapshotHTML, response, visitCachedSnapshot, willRender, updateHistory, shouldCacheSnapshot, acceptsStreamResponse, } = Object.assign(Object.assign({}, defaultOptions), options);
|
|
1707
|
+
this.action = action;
|
|
1708
|
+
this.historyChanged = historyChanged;
|
|
1709
|
+
this.referrer = referrer;
|
|
1710
|
+
this.snapshot = snapshot;
|
|
1711
|
+
this.snapshotHTML = snapshotHTML;
|
|
1712
|
+
this.response = response;
|
|
1713
|
+
this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);
|
|
1714
|
+
this.visitCachedSnapshot = visitCachedSnapshot;
|
|
1715
|
+
this.willRender = willRender;
|
|
1716
|
+
this.updateHistory = updateHistory;
|
|
1717
|
+
this.scrolled = !willRender;
|
|
1718
|
+
this.shouldCacheSnapshot = shouldCacheSnapshot;
|
|
1719
|
+
this.acceptsStreamResponse = acceptsStreamResponse;
|
|
1720
|
+
}
|
|
1721
|
+
get adapter() {
|
|
1722
|
+
return this.delegate.adapter;
|
|
1723
|
+
}
|
|
1724
|
+
get view() {
|
|
1725
|
+
return this.delegate.view;
|
|
1726
|
+
}
|
|
1727
|
+
get history() {
|
|
1728
|
+
return this.delegate.history;
|
|
1729
|
+
}
|
|
1730
|
+
get restorationData() {
|
|
1731
|
+
return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);
|
|
1732
|
+
}
|
|
1733
|
+
get silent() {
|
|
1734
|
+
return this.isSamePage;
|
|
1735
|
+
}
|
|
1736
|
+
start() {
|
|
1737
|
+
if (this.state == VisitState.initialized) {
|
|
1738
|
+
this.recordTimingMetric(TimingMetric.visitStart);
|
|
1739
|
+
this.state = VisitState.started;
|
|
1740
|
+
this.adapter.visitStarted(this);
|
|
1741
|
+
this.delegate.visitStarted(this);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
cancel() {
|
|
1745
|
+
if (this.state == VisitState.started) {
|
|
1746
|
+
if (this.request) {
|
|
1747
|
+
this.request.cancel();
|
|
1748
|
+
}
|
|
1749
|
+
this.cancelRender();
|
|
1750
|
+
this.state = VisitState.canceled;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
complete() {
|
|
1754
|
+
if (this.state == VisitState.started) {
|
|
1755
|
+
this.recordTimingMetric(TimingMetric.visitEnd);
|
|
1756
|
+
this.state = VisitState.completed;
|
|
1757
|
+
this.followRedirect();
|
|
1758
|
+
if (!this.followedRedirect) {
|
|
1759
|
+
this.adapter.visitCompleted(this);
|
|
1760
|
+
this.delegate.visitCompleted(this);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
fail() {
|
|
1765
|
+
if (this.state == VisitState.started) {
|
|
1766
|
+
this.state = VisitState.failed;
|
|
1767
|
+
this.adapter.visitFailed(this);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
changeHistory() {
|
|
1771
|
+
var _a;
|
|
1772
|
+
if (!this.historyChanged && this.updateHistory) {
|
|
1773
|
+
const actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.href) ? "replace" : this.action;
|
|
1774
|
+
const method = getHistoryMethodForAction(actionForHistory);
|
|
1775
|
+
this.history.update(method, this.location, this.restorationIdentifier);
|
|
1776
|
+
this.historyChanged = true;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
issueRequest() {
|
|
1780
|
+
if (this.hasPreloadedResponse()) {
|
|
1781
|
+
this.simulateRequest();
|
|
1782
|
+
}
|
|
1783
|
+
else if (this.shouldIssueRequest() && !this.request) {
|
|
1784
|
+
this.request = new FetchRequest(this, FetchMethod.get, this.location);
|
|
1785
|
+
this.request.perform();
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
simulateRequest() {
|
|
1789
|
+
if (this.response) {
|
|
1790
|
+
this.startRequest();
|
|
1791
|
+
this.recordResponse();
|
|
1792
|
+
this.finishRequest();
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
startRequest() {
|
|
1796
|
+
this.recordTimingMetric(TimingMetric.requestStart);
|
|
1797
|
+
this.adapter.visitRequestStarted(this);
|
|
1798
|
+
}
|
|
1799
|
+
recordResponse(response = this.response) {
|
|
1800
|
+
this.response = response;
|
|
1801
|
+
if (response) {
|
|
1802
|
+
const { statusCode } = response;
|
|
1803
|
+
if (isSuccessful(statusCode)) {
|
|
1804
|
+
this.adapter.visitRequestCompleted(this);
|
|
1805
|
+
}
|
|
1806
|
+
else {
|
|
1807
|
+
this.adapter.visitRequestFailedWithStatusCode(this, statusCode);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
finishRequest() {
|
|
1812
|
+
this.recordTimingMetric(TimingMetric.requestEnd);
|
|
1813
|
+
this.adapter.visitRequestFinished(this);
|
|
1814
|
+
}
|
|
1815
|
+
loadResponse() {
|
|
1816
|
+
if (this.response) {
|
|
1817
|
+
const { statusCode, responseHTML } = this.response;
|
|
1818
|
+
this.render(async () => {
|
|
1819
|
+
if (this.shouldCacheSnapshot)
|
|
1820
|
+
this.cacheSnapshot();
|
|
1821
|
+
if (this.view.renderPromise)
|
|
1822
|
+
await this.view.renderPromise;
|
|
1823
|
+
if (isSuccessful(statusCode) && responseHTML != null) {
|
|
1824
|
+
await this.view.renderPage(PageSnapshot.fromHTMLString(responseHTML), false, this.willRender, this);
|
|
1825
|
+
this.performScroll();
|
|
1826
|
+
this.adapter.visitRendered(this);
|
|
1827
|
+
this.complete();
|
|
1828
|
+
}
|
|
1829
|
+
else {
|
|
1830
|
+
await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);
|
|
1831
|
+
this.adapter.visitRendered(this);
|
|
1832
|
+
this.fail();
|
|
1833
|
+
}
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
getCachedSnapshot() {
|
|
1838
|
+
const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();
|
|
1839
|
+
if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {
|
|
1840
|
+
if (this.action == "restore" || snapshot.isPreviewable) {
|
|
1841
|
+
return snapshot;
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
getPreloadedSnapshot() {
|
|
1846
|
+
if (this.snapshotHTML) {
|
|
1847
|
+
return PageSnapshot.fromHTMLString(this.snapshotHTML);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
hasCachedSnapshot() {
|
|
1851
|
+
return this.getCachedSnapshot() != null;
|
|
1852
|
+
}
|
|
1853
|
+
loadCachedSnapshot() {
|
|
1854
|
+
const snapshot = this.getCachedSnapshot();
|
|
1855
|
+
if (snapshot) {
|
|
1856
|
+
const isPreview = this.shouldIssueRequest();
|
|
1857
|
+
this.render(async () => {
|
|
1858
|
+
this.cacheSnapshot();
|
|
1859
|
+
if (this.isSamePage) {
|
|
1860
|
+
this.adapter.visitRendered(this);
|
|
1861
|
+
}
|
|
1862
|
+
else {
|
|
1863
|
+
if (this.view.renderPromise)
|
|
1864
|
+
await this.view.renderPromise;
|
|
1865
|
+
await this.view.renderPage(snapshot, isPreview, this.willRender, this);
|
|
1866
|
+
this.performScroll();
|
|
1867
|
+
this.adapter.visitRendered(this);
|
|
1868
|
+
if (!isPreview) {
|
|
1869
|
+
this.complete();
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
followRedirect() {
|
|
1876
|
+
var _a;
|
|
1877
|
+
if (this.redirectedToLocation && !this.followedRedirect && ((_a = this.response) === null || _a === void 0 ? void 0 : _a.redirected)) {
|
|
1878
|
+
this.adapter.visitProposedToLocation(this.redirectedToLocation, {
|
|
1879
|
+
action: "replace",
|
|
1880
|
+
response: this.response,
|
|
1881
|
+
shouldCacheSnapshot: false,
|
|
1882
|
+
willRender: false,
|
|
1883
|
+
});
|
|
1884
|
+
this.followedRedirect = true;
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
goToSamePageAnchor() {
|
|
1888
|
+
if (this.isSamePage) {
|
|
1889
|
+
this.render(async () => {
|
|
1890
|
+
this.cacheSnapshot();
|
|
1891
|
+
this.performScroll();
|
|
1892
|
+
this.changeHistory();
|
|
1893
|
+
this.adapter.visitRendered(this);
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
prepareRequest(request) {
|
|
1898
|
+
if (this.acceptsStreamResponse) {
|
|
1899
|
+
request.acceptResponseType(StreamMessage.contentType);
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
requestStarted() {
|
|
1903
|
+
this.startRequest();
|
|
1904
|
+
}
|
|
1905
|
+
requestPreventedHandlingResponse(_request, _response) { }
|
|
1906
|
+
async requestSucceededWithResponse(request, response) {
|
|
1907
|
+
const responseHTML = await response.responseHTML;
|
|
1908
|
+
const { redirected, statusCode } = response;
|
|
1909
|
+
if (responseHTML == undefined) {
|
|
1910
|
+
this.recordResponse({
|
|
1911
|
+
statusCode: SystemStatusCode.contentTypeMismatch,
|
|
1912
|
+
redirected,
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
else {
|
|
1916
|
+
this.redirectedToLocation = response.redirected ? response.location : undefined;
|
|
1917
|
+
this.recordResponse({ statusCode: statusCode, responseHTML, redirected });
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
async requestFailedWithResponse(request, response) {
|
|
1921
|
+
const responseHTML = await response.responseHTML;
|
|
1922
|
+
const { redirected, statusCode } = response;
|
|
1923
|
+
if (responseHTML == undefined) {
|
|
1924
|
+
this.recordResponse({
|
|
1925
|
+
statusCode: SystemStatusCode.contentTypeMismatch,
|
|
1926
|
+
redirected,
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
else {
|
|
1930
|
+
this.recordResponse({ statusCode: statusCode, responseHTML, redirected });
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
requestErrored(_request, _error) {
|
|
1934
|
+
this.recordResponse({
|
|
1935
|
+
statusCode: SystemStatusCode.networkFailure,
|
|
1936
|
+
redirected: false,
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
requestFinished() {
|
|
1940
|
+
this.finishRequest();
|
|
1941
|
+
}
|
|
1942
|
+
performScroll() {
|
|
1943
|
+
if (!this.scrolled && !this.view.forceReloaded) {
|
|
1944
|
+
if (this.action == "restore") {
|
|
1945
|
+
this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();
|
|
1946
|
+
}
|
|
1947
|
+
else {
|
|
1948
|
+
this.scrollToAnchor() || this.view.scrollToTop();
|
|
1949
|
+
}
|
|
1950
|
+
if (this.isSamePage) {
|
|
1951
|
+
this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);
|
|
1952
|
+
}
|
|
1953
|
+
this.scrolled = true;
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
scrollToRestoredPosition() {
|
|
1957
|
+
const { scrollPosition } = this.restorationData;
|
|
1958
|
+
if (scrollPosition) {
|
|
1959
|
+
this.view.scrollToPosition(scrollPosition);
|
|
1960
|
+
return true;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
scrollToAnchor() {
|
|
1964
|
+
const anchor = getAnchor(this.location);
|
|
1965
|
+
if (anchor != null) {
|
|
1966
|
+
this.view.scrollToAnchor(anchor);
|
|
1967
|
+
return true;
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
recordTimingMetric(metric) {
|
|
1971
|
+
this.timingMetrics[metric] = new Date().getTime();
|
|
1972
|
+
}
|
|
1973
|
+
getTimingMetrics() {
|
|
1974
|
+
return Object.assign({}, this.timingMetrics);
|
|
1975
|
+
}
|
|
1976
|
+
getHistoryMethodForAction(action) {
|
|
1977
|
+
switch (action) {
|
|
1978
|
+
case "replace":
|
|
1979
|
+
return history.replaceState;
|
|
1980
|
+
case "advance":
|
|
1981
|
+
case "restore":
|
|
1982
|
+
return history.pushState;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
hasPreloadedResponse() {
|
|
1986
|
+
return typeof this.response == "object";
|
|
1987
|
+
}
|
|
1988
|
+
shouldIssueRequest() {
|
|
1989
|
+
if (this.isSamePage) {
|
|
1990
|
+
return false;
|
|
1991
|
+
}
|
|
1992
|
+
else if (this.action == "restore") {
|
|
1993
|
+
return !this.hasCachedSnapshot();
|
|
1994
|
+
}
|
|
1995
|
+
else {
|
|
1996
|
+
return this.willRender;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
cacheSnapshot() {
|
|
2000
|
+
if (!this.snapshotCached) {
|
|
2001
|
+
this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));
|
|
2002
|
+
this.snapshotCached = true;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
async render(callback) {
|
|
2006
|
+
this.cancelRender();
|
|
2007
|
+
await new Promise((resolve) => {
|
|
2008
|
+
this.frame = requestAnimationFrame(() => resolve());
|
|
2009
|
+
});
|
|
2010
|
+
await callback();
|
|
2011
|
+
delete this.frame;
|
|
2012
|
+
}
|
|
2013
|
+
cancelRender() {
|
|
2014
|
+
if (this.frame) {
|
|
2015
|
+
cancelAnimationFrame(this.frame);
|
|
2016
|
+
delete this.frame;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
function isSuccessful(statusCode) {
|
|
2021
|
+
return statusCode >= 200 && statusCode < 300;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
class BrowserAdapter {
|
|
2025
|
+
constructor(session) {
|
|
2026
|
+
this.progressBar = new ProgressBar();
|
|
2027
|
+
this.showProgressBar = () => {
|
|
2028
|
+
this.progressBar.show();
|
|
2029
|
+
};
|
|
2030
|
+
this.session = session;
|
|
2031
|
+
}
|
|
2032
|
+
visitProposedToLocation(location, options) {
|
|
2033
|
+
this.navigator.startVisit(location, (options === null || options === void 0 ? void 0 : options.restorationIdentifier) || uuid(), options);
|
|
2034
|
+
}
|
|
2035
|
+
visitStarted(visit) {
|
|
2036
|
+
this.location = visit.location;
|
|
2037
|
+
visit.loadCachedSnapshot();
|
|
2038
|
+
visit.issueRequest();
|
|
2039
|
+
visit.goToSamePageAnchor();
|
|
2040
|
+
}
|
|
2041
|
+
visitRequestStarted(visit) {
|
|
2042
|
+
this.progressBar.setValue(0);
|
|
2043
|
+
if (visit.hasCachedSnapshot() || visit.action != "restore") {
|
|
2044
|
+
this.showVisitProgressBarAfterDelay();
|
|
2045
|
+
}
|
|
2046
|
+
else {
|
|
2047
|
+
this.showProgressBar();
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
visitRequestCompleted(visit) {
|
|
2051
|
+
visit.loadResponse();
|
|
2052
|
+
}
|
|
2053
|
+
visitRequestFailedWithStatusCode(visit, statusCode) {
|
|
2054
|
+
switch (statusCode) {
|
|
2055
|
+
case SystemStatusCode.networkFailure:
|
|
2056
|
+
case SystemStatusCode.timeoutFailure:
|
|
2057
|
+
case SystemStatusCode.contentTypeMismatch:
|
|
2058
|
+
return this.reload({
|
|
2059
|
+
reason: "request_failed",
|
|
2060
|
+
context: {
|
|
2061
|
+
statusCode,
|
|
2062
|
+
},
|
|
2063
|
+
});
|
|
2064
|
+
default:
|
|
2065
|
+
return visit.loadResponse();
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
visitRequestFinished(_visit) {
|
|
2069
|
+
this.progressBar.setValue(1);
|
|
2070
|
+
this.hideVisitProgressBar();
|
|
2071
|
+
}
|
|
2072
|
+
visitCompleted(_visit) { }
|
|
2073
|
+
pageInvalidated(reason) {
|
|
2074
|
+
this.reload(reason);
|
|
2075
|
+
}
|
|
2076
|
+
visitFailed(_visit) { }
|
|
2077
|
+
visitRendered(_visit) { }
|
|
2078
|
+
formSubmissionStarted(_formSubmission) {
|
|
2079
|
+
this.progressBar.setValue(0);
|
|
2080
|
+
this.showFormProgressBarAfterDelay();
|
|
2081
|
+
}
|
|
2082
|
+
formSubmissionFinished(_formSubmission) {
|
|
2083
|
+
this.progressBar.setValue(1);
|
|
2084
|
+
this.hideFormProgressBar();
|
|
2085
|
+
}
|
|
2086
|
+
showVisitProgressBarAfterDelay() {
|
|
2087
|
+
this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);
|
|
2088
|
+
}
|
|
2089
|
+
hideVisitProgressBar() {
|
|
2090
|
+
this.progressBar.hide();
|
|
2091
|
+
if (this.visitProgressBarTimeout != null) {
|
|
2092
|
+
window.clearTimeout(this.visitProgressBarTimeout);
|
|
2093
|
+
delete this.visitProgressBarTimeout;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
showFormProgressBarAfterDelay() {
|
|
2097
|
+
if (this.formProgressBarTimeout == null) {
|
|
2098
|
+
this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
hideFormProgressBar() {
|
|
2102
|
+
this.progressBar.hide();
|
|
2103
|
+
if (this.formProgressBarTimeout != null) {
|
|
2104
|
+
window.clearTimeout(this.formProgressBarTimeout);
|
|
2105
|
+
delete this.formProgressBarTimeout;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
reload(reason) {
|
|
2109
|
+
var _a;
|
|
2110
|
+
dispatch("turbo:reload", { detail: reason });
|
|
2111
|
+
window.location.href = ((_a = this.location) === null || _a === void 0 ? void 0 : _a.toString()) || window.location.href;
|
|
2112
|
+
}
|
|
2113
|
+
get navigator() {
|
|
2114
|
+
return this.session.navigator;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
class CacheObserver {
|
|
2119
|
+
constructor() {
|
|
2120
|
+
this.started = false;
|
|
2121
|
+
this.removeStaleElements = ((_event) => {
|
|
2122
|
+
const staleElements = [...document.querySelectorAll('[data-turbo-cache="false"]')];
|
|
2123
|
+
for (const element of staleElements) {
|
|
2124
|
+
element.remove();
|
|
2125
|
+
}
|
|
2126
|
+
});
|
|
2127
|
+
}
|
|
2128
|
+
start() {
|
|
2129
|
+
if (!this.started) {
|
|
2130
|
+
this.started = true;
|
|
2131
|
+
addEventListener("turbo:before-cache", this.removeStaleElements, false);
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
stop() {
|
|
2135
|
+
if (this.started) {
|
|
2136
|
+
this.started = false;
|
|
2137
|
+
removeEventListener("turbo:before-cache", this.removeStaleElements, false);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
class FrameRedirector {
|
|
2143
|
+
constructor(session, element) {
|
|
2144
|
+
this.session = session;
|
|
2145
|
+
this.element = element;
|
|
2146
|
+
this.linkInterceptor = new LinkInterceptor(this, element);
|
|
2147
|
+
this.formSubmitObserver = new FormSubmitObserver(this, element);
|
|
2148
|
+
}
|
|
2149
|
+
start() {
|
|
2150
|
+
this.linkInterceptor.start();
|
|
2151
|
+
this.formSubmitObserver.start();
|
|
2152
|
+
}
|
|
2153
|
+
stop() {
|
|
2154
|
+
this.linkInterceptor.stop();
|
|
2155
|
+
this.formSubmitObserver.stop();
|
|
2156
|
+
}
|
|
2157
|
+
shouldInterceptLinkClick(element, _location, _event) {
|
|
2158
|
+
return this.shouldRedirect(element);
|
|
2159
|
+
}
|
|
2160
|
+
linkClickIntercepted(element, url, event) {
|
|
2161
|
+
const frame = this.findFrameElement(element);
|
|
2162
|
+
if (frame) {
|
|
2163
|
+
frame.delegate.linkClickIntercepted(element, url, event);
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
willSubmitForm(element, submitter) {
|
|
2167
|
+
return (element.closest("turbo-frame") == null &&
|
|
2168
|
+
this.shouldSubmit(element, submitter) &&
|
|
2169
|
+
this.shouldRedirect(element, submitter));
|
|
2170
|
+
}
|
|
2171
|
+
formSubmitted(element, submitter) {
|
|
2172
|
+
const frame = this.findFrameElement(element, submitter);
|
|
2173
|
+
if (frame) {
|
|
2174
|
+
frame.delegate.formSubmitted(element, submitter);
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
shouldSubmit(form, submitter) {
|
|
2178
|
+
var _a;
|
|
2179
|
+
const action = getAction(form, submitter);
|
|
2180
|
+
const meta = this.element.ownerDocument.querySelector(`meta[name="turbo-root"]`);
|
|
2181
|
+
const rootLocation = expandURL((_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : "/");
|
|
2182
|
+
return this.shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);
|
|
2183
|
+
}
|
|
2184
|
+
shouldRedirect(element, submitter) {
|
|
2185
|
+
const isNavigatable = element instanceof HTMLFormElement
|
|
2186
|
+
? this.session.submissionIsNavigatable(element, submitter)
|
|
2187
|
+
: this.session.elementIsNavigatable(element);
|
|
2188
|
+
if (isNavigatable) {
|
|
2189
|
+
const frame = this.findFrameElement(element, submitter);
|
|
2190
|
+
return frame ? frame != element.closest("turbo-frame") : false;
|
|
2191
|
+
}
|
|
2192
|
+
else {
|
|
2193
|
+
return false;
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
findFrameElement(element, submitter) {
|
|
2197
|
+
const id = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute("data-turbo-frame")) || element.getAttribute("data-turbo-frame");
|
|
2198
|
+
if (id && id != "_top") {
|
|
2199
|
+
const frame = this.element.querySelector(`#${id}:not([disabled])`);
|
|
2200
|
+
if (frame instanceof FrameElement) {
|
|
2201
|
+
return frame;
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
class History {
|
|
2208
|
+
constructor(delegate) {
|
|
2209
|
+
this.restorationIdentifier = uuid();
|
|
2210
|
+
this.restorationData = {};
|
|
2211
|
+
this.started = false;
|
|
2212
|
+
this.pageLoaded = false;
|
|
2213
|
+
this.onPopState = (event) => {
|
|
2214
|
+
if (this.shouldHandlePopState()) {
|
|
2215
|
+
const { turbo } = event.state || {};
|
|
2216
|
+
if (turbo) {
|
|
2217
|
+
this.location = new URL(window.location.href);
|
|
2218
|
+
const { restorationIdentifier } = turbo;
|
|
2219
|
+
this.restorationIdentifier = restorationIdentifier;
|
|
2220
|
+
this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location, restorationIdentifier);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
};
|
|
2224
|
+
this.onPageLoad = async (_event) => {
|
|
2225
|
+
await nextMicrotask();
|
|
2226
|
+
this.pageLoaded = true;
|
|
2227
|
+
};
|
|
2228
|
+
this.delegate = delegate;
|
|
2229
|
+
}
|
|
2230
|
+
start() {
|
|
2231
|
+
if (!this.started) {
|
|
2232
|
+
addEventListener("popstate", this.onPopState, false);
|
|
2233
|
+
addEventListener("load", this.onPageLoad, false);
|
|
2234
|
+
this.started = true;
|
|
2235
|
+
this.replace(new URL(window.location.href));
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
stop() {
|
|
2239
|
+
if (this.started) {
|
|
2240
|
+
removeEventListener("popstate", this.onPopState, false);
|
|
2241
|
+
removeEventListener("load", this.onPageLoad, false);
|
|
2242
|
+
this.started = false;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
push(location, restorationIdentifier) {
|
|
2246
|
+
this.update(history.pushState, location, restorationIdentifier);
|
|
2247
|
+
}
|
|
2248
|
+
replace(location, restorationIdentifier) {
|
|
2249
|
+
this.update(history.replaceState, location, restorationIdentifier);
|
|
2250
|
+
}
|
|
2251
|
+
update(method, location, restorationIdentifier = uuid()) {
|
|
2252
|
+
const state = { turbo: { restorationIdentifier } };
|
|
2253
|
+
method.call(history, state, "", location.href);
|
|
2254
|
+
this.location = location;
|
|
2255
|
+
this.restorationIdentifier = restorationIdentifier;
|
|
2256
|
+
}
|
|
2257
|
+
getRestorationDataForIdentifier(restorationIdentifier) {
|
|
2258
|
+
return this.restorationData[restorationIdentifier] || {};
|
|
2259
|
+
}
|
|
2260
|
+
updateRestorationData(additionalData) {
|
|
2261
|
+
const { restorationIdentifier } = this;
|
|
2262
|
+
const restorationData = this.restorationData[restorationIdentifier];
|
|
2263
|
+
this.restorationData[restorationIdentifier] = Object.assign(Object.assign({}, restorationData), additionalData);
|
|
2264
|
+
}
|
|
2265
|
+
assumeControlOfScrollRestoration() {
|
|
2266
|
+
var _a;
|
|
2267
|
+
if (!this.previousScrollRestoration) {
|
|
2268
|
+
this.previousScrollRestoration = (_a = history.scrollRestoration) !== null && _a !== void 0 ? _a : "auto";
|
|
2269
|
+
history.scrollRestoration = "manual";
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
relinquishControlOfScrollRestoration() {
|
|
2273
|
+
if (this.previousScrollRestoration) {
|
|
2274
|
+
history.scrollRestoration = this.previousScrollRestoration;
|
|
2275
|
+
delete this.previousScrollRestoration;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
shouldHandlePopState() {
|
|
2279
|
+
return this.pageIsLoaded();
|
|
2280
|
+
}
|
|
2281
|
+
pageIsLoaded() {
|
|
2282
|
+
return this.pageLoaded || document.readyState == "complete";
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
class Navigator {
|
|
2287
|
+
constructor(delegate) {
|
|
2288
|
+
this.delegate = delegate;
|
|
2289
|
+
}
|
|
2290
|
+
proposeVisit(location, options = {}) {
|
|
2291
|
+
if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {
|
|
2292
|
+
if (locationIsVisitable(location, this.view.snapshot.rootLocation)) {
|
|
2293
|
+
this.delegate.visitProposedToLocation(location, options);
|
|
2294
|
+
}
|
|
2295
|
+
else {
|
|
2296
|
+
window.location.href = location.toString();
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
startVisit(locatable, restorationIdentifier, options = {}) {
|
|
2301
|
+
this.stop();
|
|
2302
|
+
this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, Object.assign({ referrer: this.location }, options));
|
|
2303
|
+
this.currentVisit.start();
|
|
2304
|
+
}
|
|
2305
|
+
submitForm(form, submitter) {
|
|
2306
|
+
this.stop();
|
|
2307
|
+
this.formSubmission = new FormSubmission(this, form, submitter, true);
|
|
2308
|
+
this.formSubmission.start();
|
|
2309
|
+
}
|
|
2310
|
+
stop() {
|
|
2311
|
+
if (this.formSubmission) {
|
|
2312
|
+
this.formSubmission.stop();
|
|
2313
|
+
delete this.formSubmission;
|
|
2314
|
+
}
|
|
2315
|
+
if (this.currentVisit) {
|
|
2316
|
+
this.currentVisit.cancel();
|
|
2317
|
+
delete this.currentVisit;
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
get adapter() {
|
|
2321
|
+
return this.delegate.adapter;
|
|
2322
|
+
}
|
|
2323
|
+
get view() {
|
|
2324
|
+
return this.delegate.view;
|
|
2325
|
+
}
|
|
2326
|
+
get history() {
|
|
2327
|
+
return this.delegate.history;
|
|
2328
|
+
}
|
|
2329
|
+
formSubmissionStarted(formSubmission) {
|
|
2330
|
+
if (typeof this.adapter.formSubmissionStarted === "function") {
|
|
2331
|
+
this.adapter.formSubmissionStarted(formSubmission);
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {
|
|
2335
|
+
if (formSubmission == this.formSubmission) {
|
|
2336
|
+
const responseHTML = await fetchResponse.responseHTML;
|
|
2337
|
+
if (responseHTML) {
|
|
2338
|
+
const shouldCacheSnapshot = formSubmission.method == FetchMethod.get;
|
|
2339
|
+
if (!shouldCacheSnapshot) {
|
|
2340
|
+
this.view.clearSnapshotCache();
|
|
2341
|
+
}
|
|
2342
|
+
const { statusCode, redirected } = fetchResponse;
|
|
2343
|
+
const action = this.getActionForFormSubmission(formSubmission);
|
|
2344
|
+
const visitOptions = {
|
|
2345
|
+
action,
|
|
2346
|
+
shouldCacheSnapshot,
|
|
2347
|
+
response: { statusCode, responseHTML, redirected },
|
|
2348
|
+
};
|
|
2349
|
+
this.proposeVisit(fetchResponse.location, visitOptions);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {
|
|
2354
|
+
const responseHTML = await fetchResponse.responseHTML;
|
|
2355
|
+
if (responseHTML) {
|
|
2356
|
+
const snapshot = PageSnapshot.fromHTMLString(responseHTML);
|
|
2357
|
+
if (fetchResponse.serverError) {
|
|
2358
|
+
await this.view.renderError(snapshot, this.currentVisit);
|
|
2359
|
+
}
|
|
2360
|
+
else {
|
|
2361
|
+
await this.view.renderPage(snapshot, false, true, this.currentVisit);
|
|
2362
|
+
}
|
|
2363
|
+
this.view.scrollToTop();
|
|
2364
|
+
this.view.clearSnapshotCache();
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
formSubmissionErrored(formSubmission, error) {
|
|
2368
|
+
console.error(error);
|
|
2369
|
+
}
|
|
2370
|
+
formSubmissionFinished(formSubmission) {
|
|
2371
|
+
if (typeof this.adapter.formSubmissionFinished === "function") {
|
|
2372
|
+
this.adapter.formSubmissionFinished(formSubmission);
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
visitStarted(visit) {
|
|
2376
|
+
this.delegate.visitStarted(visit);
|
|
2377
|
+
}
|
|
2378
|
+
visitCompleted(visit) {
|
|
2379
|
+
this.delegate.visitCompleted(visit);
|
|
2380
|
+
}
|
|
2381
|
+
locationWithActionIsSamePage(location, action) {
|
|
2382
|
+
const anchor = getAnchor(location);
|
|
2383
|
+
const currentAnchor = getAnchor(this.view.lastRenderedLocation);
|
|
2384
|
+
const isRestorationToTop = action === "restore" && typeof anchor === "undefined";
|
|
2385
|
+
return (action !== "replace" &&
|
|
2386
|
+
getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) &&
|
|
2387
|
+
(isRestorationToTop || (anchor != null && anchor !== currentAnchor)));
|
|
2388
|
+
}
|
|
2389
|
+
visitScrolledToSamePageLocation(oldURL, newURL) {
|
|
2390
|
+
this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);
|
|
2391
|
+
}
|
|
2392
|
+
get location() {
|
|
2393
|
+
return this.history.location;
|
|
2394
|
+
}
|
|
2395
|
+
get restorationIdentifier() {
|
|
2396
|
+
return this.history.restorationIdentifier;
|
|
2397
|
+
}
|
|
2398
|
+
getActionForFormSubmission({ submitter, formElement }) {
|
|
2399
|
+
return getVisitAction(submitter, formElement) || "advance";
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
var PageStage;
|
|
2404
|
+
(function (PageStage) {
|
|
2405
|
+
PageStage[PageStage["initial"] = 0] = "initial";
|
|
2406
|
+
PageStage[PageStage["loading"] = 1] = "loading";
|
|
2407
|
+
PageStage[PageStage["interactive"] = 2] = "interactive";
|
|
2408
|
+
PageStage[PageStage["complete"] = 3] = "complete";
|
|
2409
|
+
})(PageStage || (PageStage = {}));
|
|
2410
|
+
class PageObserver {
|
|
2411
|
+
constructor(delegate) {
|
|
2412
|
+
this.stage = PageStage.initial;
|
|
2413
|
+
this.started = false;
|
|
2414
|
+
this.interpretReadyState = () => {
|
|
2415
|
+
const { readyState } = this;
|
|
2416
|
+
if (readyState == "interactive") {
|
|
2417
|
+
this.pageIsInteractive();
|
|
2418
|
+
}
|
|
2419
|
+
else if (readyState == "complete") {
|
|
2420
|
+
this.pageIsComplete();
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2423
|
+
this.pageWillUnload = () => {
|
|
2424
|
+
this.delegate.pageWillUnload();
|
|
2425
|
+
};
|
|
2426
|
+
this.delegate = delegate;
|
|
2427
|
+
}
|
|
2428
|
+
start() {
|
|
2429
|
+
if (!this.started) {
|
|
2430
|
+
if (this.stage == PageStage.initial) {
|
|
2431
|
+
this.stage = PageStage.loading;
|
|
2432
|
+
}
|
|
2433
|
+
document.addEventListener("readystatechange", this.interpretReadyState, false);
|
|
2434
|
+
addEventListener("pagehide", this.pageWillUnload, false);
|
|
2435
|
+
this.started = true;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
stop() {
|
|
2439
|
+
if (this.started) {
|
|
2440
|
+
document.removeEventListener("readystatechange", this.interpretReadyState, false);
|
|
2441
|
+
removeEventListener("pagehide", this.pageWillUnload, false);
|
|
2442
|
+
this.started = false;
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
pageIsInteractive() {
|
|
2446
|
+
if (this.stage == PageStage.loading) {
|
|
2447
|
+
this.stage = PageStage.interactive;
|
|
2448
|
+
this.delegate.pageBecameInteractive();
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
pageIsComplete() {
|
|
2452
|
+
this.pageIsInteractive();
|
|
2453
|
+
if (this.stage == PageStage.interactive) {
|
|
2454
|
+
this.stage = PageStage.complete;
|
|
2455
|
+
this.delegate.pageLoaded();
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
get readyState() {
|
|
2459
|
+
return document.readyState;
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
class ScrollObserver {
|
|
2464
|
+
constructor(delegate) {
|
|
2465
|
+
this.started = false;
|
|
2466
|
+
this.onScroll = () => {
|
|
2467
|
+
this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });
|
|
2468
|
+
};
|
|
2469
|
+
this.delegate = delegate;
|
|
2470
|
+
}
|
|
2471
|
+
start() {
|
|
2472
|
+
if (!this.started) {
|
|
2473
|
+
addEventListener("scroll", this.onScroll, false);
|
|
2474
|
+
this.onScroll();
|
|
2475
|
+
this.started = true;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
stop() {
|
|
2479
|
+
if (this.started) {
|
|
2480
|
+
removeEventListener("scroll", this.onScroll, false);
|
|
2481
|
+
this.started = false;
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
updatePosition(position) {
|
|
2485
|
+
this.delegate.scrollPositionChanged(position);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
class StreamMessageRenderer {
|
|
2490
|
+
render({ fragment }) {
|
|
2491
|
+
Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => document.documentElement.appendChild(fragment));
|
|
2492
|
+
}
|
|
2493
|
+
enteringBardo(currentPermanentElement, newPermanentElement) {
|
|
2494
|
+
newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));
|
|
2495
|
+
}
|
|
2496
|
+
leavingBardo() { }
|
|
2497
|
+
}
|
|
2498
|
+
function getPermanentElementMapForFragment(fragment) {
|
|
2499
|
+
const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);
|
|
2500
|
+
const permanentElementMap = {};
|
|
2501
|
+
for (const permanentElementInDocument of permanentElementsInDocument) {
|
|
2502
|
+
const { id } = permanentElementInDocument;
|
|
2503
|
+
for (const streamElement of fragment.querySelectorAll("turbo-stream")) {
|
|
2504
|
+
const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);
|
|
2505
|
+
if (elementInStream) {
|
|
2506
|
+
permanentElementMap[id] = [permanentElementInDocument, elementInStream];
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
return permanentElementMap;
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
class StreamObserver {
|
|
2514
|
+
constructor(delegate) {
|
|
2515
|
+
this.sources = new Set();
|
|
2516
|
+
this.started = false;
|
|
2517
|
+
this.inspectFetchResponse = ((event) => {
|
|
2518
|
+
const response = fetchResponseFromEvent(event);
|
|
2519
|
+
if (response && fetchResponseIsStream(response)) {
|
|
2520
|
+
event.preventDefault();
|
|
2521
|
+
this.receiveMessageResponse(response);
|
|
2522
|
+
}
|
|
2523
|
+
});
|
|
2524
|
+
this.receiveMessageEvent = (event) => {
|
|
2525
|
+
if (this.started && typeof event.data == "string") {
|
|
2526
|
+
this.receiveMessageHTML(event.data);
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
this.delegate = delegate;
|
|
2530
|
+
}
|
|
2531
|
+
start() {
|
|
2532
|
+
if (!this.started) {
|
|
2533
|
+
this.started = true;
|
|
2534
|
+
addEventListener("turbo:before-fetch-response", this.inspectFetchResponse, false);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
stop() {
|
|
2538
|
+
if (this.started) {
|
|
2539
|
+
this.started = false;
|
|
2540
|
+
removeEventListener("turbo:before-fetch-response", this.inspectFetchResponse, false);
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
connectStreamSource(source) {
|
|
2544
|
+
if (!this.streamSourceIsConnected(source)) {
|
|
2545
|
+
this.sources.add(source);
|
|
2546
|
+
source.addEventListener("message", this.receiveMessageEvent, false);
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
disconnectStreamSource(source) {
|
|
2550
|
+
if (this.streamSourceIsConnected(source)) {
|
|
2551
|
+
this.sources.delete(source);
|
|
2552
|
+
source.removeEventListener("message", this.receiveMessageEvent, false);
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
streamSourceIsConnected(source) {
|
|
2556
|
+
return this.sources.has(source);
|
|
2557
|
+
}
|
|
2558
|
+
async receiveMessageResponse(response) {
|
|
2559
|
+
const html = await response.responseHTML;
|
|
2560
|
+
if (html) {
|
|
2561
|
+
this.receiveMessageHTML(html);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
receiveMessageHTML(html) {
|
|
2565
|
+
this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
function fetchResponseFromEvent(event) {
|
|
2569
|
+
var _a;
|
|
2570
|
+
const fetchResponse = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.fetchResponse;
|
|
2571
|
+
if (fetchResponse instanceof FetchResponse) {
|
|
2572
|
+
return fetchResponse;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
function fetchResponseIsStream(response) {
|
|
2576
|
+
var _a;
|
|
2577
|
+
const contentType = (_a = response.contentType) !== null && _a !== void 0 ? _a : "";
|
|
2578
|
+
return contentType.startsWith(StreamMessage.contentType);
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
class ErrorRenderer extends Renderer {
|
|
2582
|
+
static renderElement(currentElement, newElement) {
|
|
2583
|
+
const { documentElement, body } = document;
|
|
2584
|
+
documentElement.replaceChild(newElement, body);
|
|
2585
|
+
}
|
|
2586
|
+
async render() {
|
|
2587
|
+
this.replaceHeadAndBody();
|
|
2588
|
+
this.activateScriptElements();
|
|
2589
|
+
}
|
|
2590
|
+
replaceHeadAndBody() {
|
|
2591
|
+
const { documentElement, head } = document;
|
|
2592
|
+
documentElement.replaceChild(this.newHead, head);
|
|
2593
|
+
this.renderElement(this.currentElement, this.newElement);
|
|
2594
|
+
}
|
|
2595
|
+
activateScriptElements() {
|
|
2596
|
+
for (const replaceableElement of this.scriptElements) {
|
|
2597
|
+
const parentNode = replaceableElement.parentNode;
|
|
2598
|
+
if (parentNode) {
|
|
2599
|
+
const element = activateScriptElement(replaceableElement);
|
|
2600
|
+
parentNode.replaceChild(element, replaceableElement);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
get newHead() {
|
|
2605
|
+
return this.newSnapshot.headSnapshot.element;
|
|
2606
|
+
}
|
|
2607
|
+
get scriptElements() {
|
|
2608
|
+
return document.documentElement.querySelectorAll("script");
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
class PageRenderer extends Renderer {
|
|
2613
|
+
static renderElement(currentElement, newElement) {
|
|
2614
|
+
if (document.body && newElement instanceof HTMLBodyElement) {
|
|
2615
|
+
document.body.replaceWith(newElement);
|
|
2616
|
+
}
|
|
2617
|
+
else {
|
|
2618
|
+
document.documentElement.appendChild(newElement);
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
get shouldRender() {
|
|
2622
|
+
return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;
|
|
2623
|
+
}
|
|
2624
|
+
get reloadReason() {
|
|
2625
|
+
if (!this.newSnapshot.isVisitable) {
|
|
2626
|
+
return {
|
|
2627
|
+
reason: "turbo_visit_control_is_reload",
|
|
2628
|
+
};
|
|
2629
|
+
}
|
|
2630
|
+
if (!this.trackedElementsAreIdentical) {
|
|
2631
|
+
return {
|
|
2632
|
+
reason: "tracked_element_mismatch",
|
|
2633
|
+
};
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
async prepareToRender() {
|
|
2637
|
+
await this.mergeHead();
|
|
2638
|
+
}
|
|
2639
|
+
async render() {
|
|
2640
|
+
if (this.willRender) {
|
|
2641
|
+
await this.replaceBody();
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
finishRendering() {
|
|
2645
|
+
super.finishRendering();
|
|
2646
|
+
if (!this.isPreview) {
|
|
2647
|
+
this.focusFirstAutofocusableElement();
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
get currentHeadSnapshot() {
|
|
2651
|
+
return this.currentSnapshot.headSnapshot;
|
|
2652
|
+
}
|
|
2653
|
+
get newHeadSnapshot() {
|
|
2654
|
+
return this.newSnapshot.headSnapshot;
|
|
2655
|
+
}
|
|
2656
|
+
get newElement() {
|
|
2657
|
+
return this.newSnapshot.element;
|
|
2658
|
+
}
|
|
2659
|
+
async mergeHead() {
|
|
2660
|
+
const mergedHeadElements = this.mergeProvisionalElements();
|
|
2661
|
+
const newStylesheetElements = this.copyNewHeadStylesheetElements();
|
|
2662
|
+
this.copyNewHeadScriptElements();
|
|
2663
|
+
await mergedHeadElements;
|
|
2664
|
+
await newStylesheetElements;
|
|
2665
|
+
}
|
|
2666
|
+
async replaceBody() {
|
|
2667
|
+
await this.preservingPermanentElements(async () => {
|
|
2668
|
+
this.activateNewBody();
|
|
2669
|
+
await this.assignNewBody();
|
|
2670
|
+
});
|
|
2671
|
+
}
|
|
2672
|
+
get trackedElementsAreIdentical() {
|
|
2673
|
+
return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;
|
|
2674
|
+
}
|
|
2675
|
+
async copyNewHeadStylesheetElements() {
|
|
2676
|
+
const loadingElements = [];
|
|
2677
|
+
for (const element of this.newHeadStylesheetElements) {
|
|
2678
|
+
loadingElements.push(waitForLoad(element));
|
|
2679
|
+
document.head.appendChild(element);
|
|
2680
|
+
}
|
|
2681
|
+
await Promise.all(loadingElements);
|
|
2682
|
+
}
|
|
2683
|
+
copyNewHeadScriptElements() {
|
|
2684
|
+
for (const element of this.newHeadScriptElements) {
|
|
2685
|
+
document.head.appendChild(activateScriptElement(element));
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
async mergeProvisionalElements() {
|
|
2689
|
+
const newHeadElements = [...this.newHeadProvisionalElements];
|
|
2690
|
+
for (const element of this.currentHeadProvisionalElements) {
|
|
2691
|
+
if (!this.isCurrentElementInElementList(element, newHeadElements)) {
|
|
2692
|
+
document.head.removeChild(element);
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
for (const element of newHeadElements) {
|
|
2696
|
+
document.head.appendChild(element);
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
isCurrentElementInElementList(element, elementList) {
|
|
2700
|
+
for (const [index, newElement] of elementList.entries()) {
|
|
2701
|
+
if (element.tagName == "TITLE") {
|
|
2702
|
+
if (newElement.tagName != "TITLE") {
|
|
2703
|
+
continue;
|
|
2704
|
+
}
|
|
2705
|
+
if (element.innerHTML == newElement.innerHTML) {
|
|
2706
|
+
elementList.splice(index, 1);
|
|
2707
|
+
return true;
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
if (newElement.isEqualNode(element)) {
|
|
2711
|
+
elementList.splice(index, 1);
|
|
2712
|
+
return true;
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
return false;
|
|
2716
|
+
}
|
|
2717
|
+
removeCurrentHeadProvisionalElements() {
|
|
2718
|
+
for (const element of this.currentHeadProvisionalElements) {
|
|
2719
|
+
document.head.removeChild(element);
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
copyNewHeadProvisionalElements() {
|
|
2723
|
+
for (const element of this.newHeadProvisionalElements) {
|
|
2724
|
+
document.head.appendChild(element);
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
activateNewBody() {
|
|
2728
|
+
document.adoptNode(this.newElement);
|
|
2729
|
+
this.activateNewBodyScriptElements();
|
|
2730
|
+
}
|
|
2731
|
+
activateNewBodyScriptElements() {
|
|
2732
|
+
for (const inertScriptElement of this.newBodyScriptElements) {
|
|
2733
|
+
const activatedScriptElement = activateScriptElement(inertScriptElement);
|
|
2734
|
+
inertScriptElement.replaceWith(activatedScriptElement);
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
async assignNewBody() {
|
|
2738
|
+
await this.renderElement(this.currentElement, this.newElement);
|
|
2739
|
+
}
|
|
2740
|
+
get newHeadStylesheetElements() {
|
|
2741
|
+
return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);
|
|
2742
|
+
}
|
|
2743
|
+
get newHeadScriptElements() {
|
|
2744
|
+
return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);
|
|
2745
|
+
}
|
|
2746
|
+
get currentHeadProvisionalElements() {
|
|
2747
|
+
return this.currentHeadSnapshot.provisionalElements;
|
|
2748
|
+
}
|
|
2749
|
+
get newHeadProvisionalElements() {
|
|
2750
|
+
return this.newHeadSnapshot.provisionalElements;
|
|
2751
|
+
}
|
|
2752
|
+
get newBodyScriptElements() {
|
|
2753
|
+
return this.newElement.querySelectorAll("script");
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
class SnapshotCache {
|
|
2758
|
+
constructor(size) {
|
|
2759
|
+
this.keys = [];
|
|
2760
|
+
this.snapshots = {};
|
|
2761
|
+
this.size = size;
|
|
2762
|
+
}
|
|
2763
|
+
has(location) {
|
|
2764
|
+
return toCacheKey(location) in this.snapshots;
|
|
2765
|
+
}
|
|
2766
|
+
get(location) {
|
|
2767
|
+
if (this.has(location)) {
|
|
2768
|
+
const snapshot = this.read(location);
|
|
2769
|
+
this.touch(location);
|
|
2770
|
+
return snapshot;
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
put(location, snapshot) {
|
|
2774
|
+
this.write(location, snapshot);
|
|
2775
|
+
this.touch(location);
|
|
2776
|
+
return snapshot;
|
|
2777
|
+
}
|
|
2778
|
+
clear() {
|
|
2779
|
+
this.snapshots = {};
|
|
2780
|
+
}
|
|
2781
|
+
read(location) {
|
|
2782
|
+
return this.snapshots[toCacheKey(location)];
|
|
2783
|
+
}
|
|
2784
|
+
write(location, snapshot) {
|
|
2785
|
+
this.snapshots[toCacheKey(location)] = snapshot;
|
|
2786
|
+
}
|
|
2787
|
+
touch(location) {
|
|
2788
|
+
const key = toCacheKey(location);
|
|
2789
|
+
const index = this.keys.indexOf(key);
|
|
2790
|
+
if (index > -1)
|
|
2791
|
+
this.keys.splice(index, 1);
|
|
2792
|
+
this.keys.unshift(key);
|
|
2793
|
+
this.trim();
|
|
2794
|
+
}
|
|
2795
|
+
trim() {
|
|
2796
|
+
for (const key of this.keys.splice(this.size)) {
|
|
2797
|
+
delete this.snapshots[key];
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
class PageView extends View {
|
|
2803
|
+
constructor() {
|
|
2804
|
+
super(...arguments);
|
|
2805
|
+
this.snapshotCache = new SnapshotCache(10);
|
|
2806
|
+
this.lastRenderedLocation = new URL(location.href);
|
|
2807
|
+
this.forceReloaded = false;
|
|
2808
|
+
}
|
|
2809
|
+
renderPage(snapshot, isPreview = false, willRender = true, visit) {
|
|
2810
|
+
const renderer = new PageRenderer(this.snapshot, snapshot, PageRenderer.renderElement, isPreview, willRender);
|
|
2811
|
+
if (!renderer.shouldRender) {
|
|
2812
|
+
this.forceReloaded = true;
|
|
2813
|
+
}
|
|
2814
|
+
else {
|
|
2815
|
+
visit === null || visit === void 0 ? void 0 : visit.changeHistory();
|
|
2816
|
+
}
|
|
2817
|
+
return this.render(renderer);
|
|
2818
|
+
}
|
|
2819
|
+
renderError(snapshot, visit) {
|
|
2820
|
+
visit === null || visit === void 0 ? void 0 : visit.changeHistory();
|
|
2821
|
+
const renderer = new ErrorRenderer(this.snapshot, snapshot, ErrorRenderer.renderElement, false);
|
|
2822
|
+
return this.render(renderer);
|
|
2823
|
+
}
|
|
2824
|
+
clearSnapshotCache() {
|
|
2825
|
+
this.snapshotCache.clear();
|
|
2826
|
+
}
|
|
2827
|
+
async cacheSnapshot(snapshot = this.snapshot) {
|
|
2828
|
+
if (snapshot.isCacheable) {
|
|
2829
|
+
this.delegate.viewWillCacheSnapshot();
|
|
2830
|
+
const { lastRenderedLocation: location } = this;
|
|
2831
|
+
await nextEventLoopTick();
|
|
2832
|
+
const cachedSnapshot = snapshot.clone();
|
|
2833
|
+
this.snapshotCache.put(location, cachedSnapshot);
|
|
2834
|
+
return cachedSnapshot;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
getCachedSnapshotForLocation(location) {
|
|
2838
|
+
return this.snapshotCache.get(location);
|
|
2839
|
+
}
|
|
2840
|
+
get snapshot() {
|
|
2841
|
+
return PageSnapshot.fromElement(this.element);
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
class Preloader {
|
|
2846
|
+
constructor(delegate) {
|
|
2847
|
+
this.selector = "a[data-turbo-preload]";
|
|
2848
|
+
this.delegate = delegate;
|
|
2849
|
+
}
|
|
2850
|
+
get snapshotCache() {
|
|
2851
|
+
return this.delegate.navigator.view.snapshotCache;
|
|
2852
|
+
}
|
|
2853
|
+
start() {
|
|
2854
|
+
if (document.readyState === "loading") {
|
|
2855
|
+
return document.addEventListener("DOMContentLoaded", () => {
|
|
2856
|
+
this.preloadOnLoadLinksForView(document.body);
|
|
2857
|
+
});
|
|
2858
|
+
}
|
|
2859
|
+
else {
|
|
2860
|
+
this.preloadOnLoadLinksForView(document.body);
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
preloadOnLoadLinksForView(element) {
|
|
2864
|
+
for (const link of element.querySelectorAll(this.selector)) {
|
|
2865
|
+
this.preloadURL(link);
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
async preloadURL(link) {
|
|
2869
|
+
const location = new URL(link.href);
|
|
2870
|
+
if (this.snapshotCache.has(location)) {
|
|
2871
|
+
return;
|
|
2872
|
+
}
|
|
2873
|
+
try {
|
|
2874
|
+
const response = await fetch(location.toString(), { headers: { "VND.PREFETCH": "true", Accept: "text/html" } });
|
|
2875
|
+
const responseText = await response.text();
|
|
2876
|
+
const snapshot = PageSnapshot.fromHTMLString(responseText);
|
|
2877
|
+
this.snapshotCache.put(location, snapshot);
|
|
2878
|
+
}
|
|
2879
|
+
catch (_) {
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
class Session {
|
|
2885
|
+
constructor() {
|
|
2886
|
+
this.navigator = new Navigator(this);
|
|
2887
|
+
this.history = new History(this);
|
|
2888
|
+
this.preloader = new Preloader(this);
|
|
2889
|
+
this.view = new PageView(this, document.documentElement);
|
|
2890
|
+
this.adapter = new BrowserAdapter(this);
|
|
2891
|
+
this.pageObserver = new PageObserver(this);
|
|
2892
|
+
this.cacheObserver = new CacheObserver();
|
|
2893
|
+
this.linkClickObserver = new LinkClickObserver(this, window);
|
|
2894
|
+
this.formSubmitObserver = new FormSubmitObserver(this, document);
|
|
2895
|
+
this.scrollObserver = new ScrollObserver(this);
|
|
2896
|
+
this.streamObserver = new StreamObserver(this);
|
|
2897
|
+
this.formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement);
|
|
2898
|
+
this.frameRedirector = new FrameRedirector(this, document.documentElement);
|
|
2899
|
+
this.streamMessageRenderer = new StreamMessageRenderer();
|
|
2900
|
+
this.drive = true;
|
|
2901
|
+
this.enabled = true;
|
|
2902
|
+
this.progressBarDelay = 500;
|
|
2903
|
+
this.started = false;
|
|
2904
|
+
this.formMode = "on";
|
|
2905
|
+
}
|
|
2906
|
+
start() {
|
|
2907
|
+
if (!this.started) {
|
|
2908
|
+
this.pageObserver.start();
|
|
2909
|
+
this.cacheObserver.start();
|
|
2910
|
+
this.formLinkClickObserver.start();
|
|
2911
|
+
this.linkClickObserver.start();
|
|
2912
|
+
this.formSubmitObserver.start();
|
|
2913
|
+
this.scrollObserver.start();
|
|
2914
|
+
this.streamObserver.start();
|
|
2915
|
+
this.frameRedirector.start();
|
|
2916
|
+
this.history.start();
|
|
2917
|
+
this.preloader.start();
|
|
2918
|
+
this.started = true;
|
|
2919
|
+
this.enabled = true;
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
disable() {
|
|
2923
|
+
this.enabled = false;
|
|
2924
|
+
}
|
|
2925
|
+
stop() {
|
|
2926
|
+
if (this.started) {
|
|
2927
|
+
this.pageObserver.stop();
|
|
2928
|
+
this.cacheObserver.stop();
|
|
2929
|
+
this.formLinkClickObserver.stop();
|
|
2930
|
+
this.linkClickObserver.stop();
|
|
2931
|
+
this.formSubmitObserver.stop();
|
|
2932
|
+
this.scrollObserver.stop();
|
|
2933
|
+
this.streamObserver.stop();
|
|
2934
|
+
this.frameRedirector.stop();
|
|
2935
|
+
this.history.stop();
|
|
2936
|
+
this.started = false;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
registerAdapter(adapter) {
|
|
2940
|
+
this.adapter = adapter;
|
|
2941
|
+
}
|
|
2942
|
+
visit(location, options = {}) {
|
|
2943
|
+
const frameElement = options.frame ? document.getElementById(options.frame) : null;
|
|
2944
|
+
if (frameElement instanceof FrameElement) {
|
|
2945
|
+
frameElement.src = location.toString();
|
|
2946
|
+
frameElement.loaded;
|
|
2947
|
+
}
|
|
2948
|
+
else {
|
|
2949
|
+
this.navigator.proposeVisit(expandURL(location), options);
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
connectStreamSource(source) {
|
|
2953
|
+
this.streamObserver.connectStreamSource(source);
|
|
2954
|
+
}
|
|
2955
|
+
disconnectStreamSource(source) {
|
|
2956
|
+
this.streamObserver.disconnectStreamSource(source);
|
|
2957
|
+
}
|
|
2958
|
+
renderStreamMessage(message) {
|
|
2959
|
+
this.streamMessageRenderer.render(StreamMessage.wrap(message));
|
|
2960
|
+
}
|
|
2961
|
+
clearCache() {
|
|
2962
|
+
this.view.clearSnapshotCache();
|
|
2963
|
+
}
|
|
2964
|
+
setProgressBarDelay(delay) {
|
|
2965
|
+
this.progressBarDelay = delay;
|
|
2966
|
+
}
|
|
2967
|
+
setFormMode(mode) {
|
|
2968
|
+
this.formMode = mode;
|
|
2969
|
+
}
|
|
2970
|
+
get location() {
|
|
2971
|
+
return this.history.location;
|
|
2972
|
+
}
|
|
2973
|
+
get restorationIdentifier() {
|
|
2974
|
+
return this.history.restorationIdentifier;
|
|
2975
|
+
}
|
|
2976
|
+
historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier) {
|
|
2977
|
+
if (this.enabled) {
|
|
2978
|
+
this.navigator.startVisit(location, restorationIdentifier, {
|
|
2979
|
+
action: "restore",
|
|
2980
|
+
historyChanged: true,
|
|
2981
|
+
});
|
|
2982
|
+
}
|
|
2983
|
+
else {
|
|
2984
|
+
this.adapter.pageInvalidated({
|
|
2985
|
+
reason: "turbo_disabled",
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
scrollPositionChanged(position) {
|
|
2990
|
+
this.history.updateRestorationData({ scrollPosition: position });
|
|
2991
|
+
}
|
|
2992
|
+
willSubmitFormLinkToLocation(link, location) {
|
|
2993
|
+
return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation);
|
|
2994
|
+
}
|
|
2995
|
+
submittedFormLinkToLocation() { }
|
|
2996
|
+
willFollowLinkToLocation(link, location, event) {
|
|
2997
|
+
return (this.elementIsNavigatable(link) &&
|
|
2998
|
+
locationIsVisitable(location, this.snapshot.rootLocation) &&
|
|
2999
|
+
this.applicationAllowsFollowingLinkToLocation(link, location, event));
|
|
3000
|
+
}
|
|
3001
|
+
followedLinkToLocation(link, location) {
|
|
3002
|
+
const action = this.getActionForLink(link);
|
|
3003
|
+
const acceptsStreamResponse = link.hasAttribute("data-turbo-stream");
|
|
3004
|
+
this.visit(location.href, { action, acceptsStreamResponse });
|
|
3005
|
+
}
|
|
3006
|
+
allowsVisitingLocationWithAction(location, action) {
|
|
3007
|
+
return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location);
|
|
3008
|
+
}
|
|
3009
|
+
visitProposedToLocation(location, options) {
|
|
3010
|
+
extendURLWithDeprecatedProperties(location);
|
|
3011
|
+
this.adapter.visitProposedToLocation(location, options);
|
|
3012
|
+
}
|
|
3013
|
+
visitStarted(visit) {
|
|
3014
|
+
if (!visit.acceptsStreamResponse) {
|
|
3015
|
+
markAsBusy(document.documentElement);
|
|
3016
|
+
}
|
|
3017
|
+
extendURLWithDeprecatedProperties(visit.location);
|
|
3018
|
+
if (!visit.silent) {
|
|
3019
|
+
this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
visitCompleted(visit) {
|
|
3023
|
+
clearBusyState(document.documentElement);
|
|
3024
|
+
this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());
|
|
3025
|
+
}
|
|
3026
|
+
locationWithActionIsSamePage(location, action) {
|
|
3027
|
+
return this.navigator.locationWithActionIsSamePage(location, action);
|
|
3028
|
+
}
|
|
3029
|
+
visitScrolledToSamePageLocation(oldURL, newURL) {
|
|
3030
|
+
this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);
|
|
3031
|
+
}
|
|
3032
|
+
willSubmitForm(form, submitter) {
|
|
3033
|
+
const action = getAction(form, submitter);
|
|
3034
|
+
return (this.submissionIsNavigatable(form, submitter) &&
|
|
3035
|
+
locationIsVisitable(expandURL(action), this.snapshot.rootLocation));
|
|
3036
|
+
}
|
|
3037
|
+
formSubmitted(form, submitter) {
|
|
3038
|
+
this.navigator.submitForm(form, submitter);
|
|
3039
|
+
}
|
|
3040
|
+
pageBecameInteractive() {
|
|
3041
|
+
this.view.lastRenderedLocation = this.location;
|
|
3042
|
+
this.notifyApplicationAfterPageLoad();
|
|
3043
|
+
}
|
|
3044
|
+
pageLoaded() {
|
|
3045
|
+
this.history.assumeControlOfScrollRestoration();
|
|
3046
|
+
}
|
|
3047
|
+
pageWillUnload() {
|
|
3048
|
+
this.history.relinquishControlOfScrollRestoration();
|
|
3049
|
+
}
|
|
3050
|
+
receivedMessageFromStream(message) {
|
|
3051
|
+
this.renderStreamMessage(message);
|
|
3052
|
+
}
|
|
3053
|
+
viewWillCacheSnapshot() {
|
|
3054
|
+
var _a;
|
|
3055
|
+
if (!((_a = this.navigator.currentVisit) === null || _a === void 0 ? void 0 : _a.silent)) {
|
|
3056
|
+
this.notifyApplicationBeforeCachingSnapshot();
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
allowsImmediateRender({ element }, options) {
|
|
3060
|
+
const event = this.notifyApplicationBeforeRender(element, options);
|
|
3061
|
+
const { defaultPrevented, detail: { render }, } = event;
|
|
3062
|
+
if (this.view.renderer && render) {
|
|
3063
|
+
this.view.renderer.renderElement = render;
|
|
3064
|
+
}
|
|
3065
|
+
return !defaultPrevented;
|
|
3066
|
+
}
|
|
3067
|
+
viewRenderedSnapshot(_snapshot, _isPreview) {
|
|
3068
|
+
this.view.lastRenderedLocation = this.history.location;
|
|
3069
|
+
this.notifyApplicationAfterRender();
|
|
3070
|
+
}
|
|
3071
|
+
preloadOnLoadLinksForView(element) {
|
|
3072
|
+
this.preloader.preloadOnLoadLinksForView(element);
|
|
3073
|
+
}
|
|
3074
|
+
viewInvalidated(reason) {
|
|
3075
|
+
this.adapter.pageInvalidated(reason);
|
|
3076
|
+
}
|
|
3077
|
+
frameLoaded(frame) {
|
|
3078
|
+
this.notifyApplicationAfterFrameLoad(frame);
|
|
3079
|
+
}
|
|
3080
|
+
frameRendered(fetchResponse, frame) {
|
|
3081
|
+
this.notifyApplicationAfterFrameRender(fetchResponse, frame);
|
|
3082
|
+
}
|
|
3083
|
+
applicationAllowsFollowingLinkToLocation(link, location, ev) {
|
|
3084
|
+
const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);
|
|
3085
|
+
return !event.defaultPrevented;
|
|
3086
|
+
}
|
|
3087
|
+
applicationAllowsVisitingLocation(location) {
|
|
3088
|
+
const event = this.notifyApplicationBeforeVisitingLocation(location);
|
|
3089
|
+
return !event.defaultPrevented;
|
|
3090
|
+
}
|
|
3091
|
+
notifyApplicationAfterClickingLinkToLocation(link, location, event) {
|
|
3092
|
+
return dispatch("turbo:click", {
|
|
3093
|
+
target: link,
|
|
3094
|
+
detail: { url: location.href, originalEvent: event },
|
|
3095
|
+
cancelable: true,
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3098
|
+
notifyApplicationBeforeVisitingLocation(location) {
|
|
3099
|
+
return dispatch("turbo:before-visit", {
|
|
3100
|
+
detail: { url: location.href },
|
|
3101
|
+
cancelable: true,
|
|
3102
|
+
});
|
|
3103
|
+
}
|
|
3104
|
+
notifyApplicationAfterVisitingLocation(location, action) {
|
|
3105
|
+
return dispatch("turbo:visit", { detail: { url: location.href, action } });
|
|
3106
|
+
}
|
|
3107
|
+
notifyApplicationBeforeCachingSnapshot() {
|
|
3108
|
+
return dispatch("turbo:before-cache");
|
|
3109
|
+
}
|
|
3110
|
+
notifyApplicationBeforeRender(newBody, options) {
|
|
3111
|
+
return dispatch("turbo:before-render", {
|
|
3112
|
+
detail: Object.assign({ newBody }, options),
|
|
3113
|
+
cancelable: true,
|
|
3114
|
+
});
|
|
3115
|
+
}
|
|
3116
|
+
notifyApplicationAfterRender() {
|
|
3117
|
+
return dispatch("turbo:render");
|
|
3118
|
+
}
|
|
3119
|
+
notifyApplicationAfterPageLoad(timing = {}) {
|
|
3120
|
+
return dispatch("turbo:load", {
|
|
3121
|
+
detail: { url: this.location.href, timing },
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {
|
|
3125
|
+
dispatchEvent(new HashChangeEvent("hashchange", {
|
|
3126
|
+
oldURL: oldURL.toString(),
|
|
3127
|
+
newURL: newURL.toString(),
|
|
3128
|
+
}));
|
|
3129
|
+
}
|
|
3130
|
+
notifyApplicationAfterFrameLoad(frame) {
|
|
3131
|
+
return dispatch("turbo:frame-load", { target: frame });
|
|
3132
|
+
}
|
|
3133
|
+
notifyApplicationAfterFrameRender(fetchResponse, frame) {
|
|
3134
|
+
return dispatch("turbo:frame-render", {
|
|
3135
|
+
detail: { fetchResponse },
|
|
3136
|
+
target: frame,
|
|
3137
|
+
cancelable: true,
|
|
3138
|
+
});
|
|
3139
|
+
}
|
|
3140
|
+
submissionIsNavigatable(form, submitter) {
|
|
3141
|
+
if (this.formMode == "off") {
|
|
3142
|
+
return false;
|
|
3143
|
+
}
|
|
3144
|
+
else {
|
|
3145
|
+
const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;
|
|
3146
|
+
if (this.formMode == "optin") {
|
|
3147
|
+
return submitterIsNavigatable && form.closest('[data-turbo="true"]') != null;
|
|
3148
|
+
}
|
|
3149
|
+
else {
|
|
3150
|
+
return submitterIsNavigatable && this.elementIsNavigatable(form);
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
elementIsNavigatable(element) {
|
|
3155
|
+
const container = findClosestRecursively(element, "[data-turbo]");
|
|
3156
|
+
const withinFrame = findClosestRecursively(element, "turbo-frame");
|
|
3157
|
+
if (this.drive || withinFrame) {
|
|
3158
|
+
if (container) {
|
|
3159
|
+
return container.getAttribute("data-turbo") != "false";
|
|
3160
|
+
}
|
|
3161
|
+
else {
|
|
3162
|
+
return true;
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
else {
|
|
3166
|
+
if (container) {
|
|
3167
|
+
return container.getAttribute("data-turbo") == "true";
|
|
3168
|
+
}
|
|
3169
|
+
else {
|
|
3170
|
+
return false;
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
getActionForLink(link) {
|
|
3175
|
+
return getVisitAction(link) || "advance";
|
|
3176
|
+
}
|
|
3177
|
+
get snapshot() {
|
|
3178
|
+
return this.view.snapshot;
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
function extendURLWithDeprecatedProperties(url) {
|
|
3182
|
+
Object.defineProperties(url, deprecatedLocationPropertyDescriptors);
|
|
3183
|
+
}
|
|
3184
|
+
const deprecatedLocationPropertyDescriptors = {
|
|
3185
|
+
absoluteURL: {
|
|
3186
|
+
get() {
|
|
3187
|
+
return this.toString();
|
|
3188
|
+
},
|
|
3189
|
+
},
|
|
3190
|
+
};
|
|
3191
|
+
|
|
3192
|
+
class Cache {
|
|
3193
|
+
constructor(session) {
|
|
3194
|
+
this.session = session;
|
|
3195
|
+
}
|
|
3196
|
+
clear() {
|
|
3197
|
+
this.session.clearCache();
|
|
3198
|
+
}
|
|
3199
|
+
resetCacheControl() {
|
|
3200
|
+
this.setCacheControl("");
|
|
3201
|
+
}
|
|
3202
|
+
exemptPageFromCache() {
|
|
3203
|
+
this.setCacheControl("no-cache");
|
|
3204
|
+
}
|
|
3205
|
+
exemptPageFromPreview() {
|
|
3206
|
+
this.setCacheControl("no-preview");
|
|
3207
|
+
}
|
|
3208
|
+
setCacheControl(value) {
|
|
3209
|
+
setMetaContent("turbo-cache-control", value);
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
|
|
3213
|
+
const StreamActions = {
|
|
3214
|
+
after() {
|
|
3215
|
+
this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e.nextSibling); });
|
|
3216
|
+
},
|
|
3217
|
+
append() {
|
|
3218
|
+
this.removeDuplicateTargetChildren();
|
|
3219
|
+
this.targetElements.forEach((e) => e.append(this.templateContent));
|
|
3220
|
+
},
|
|
3221
|
+
before() {
|
|
3222
|
+
this.targetElements.forEach((e) => { var _a; return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e); });
|
|
3223
|
+
},
|
|
3224
|
+
prepend() {
|
|
3225
|
+
this.removeDuplicateTargetChildren();
|
|
3226
|
+
this.targetElements.forEach((e) => e.prepend(this.templateContent));
|
|
3227
|
+
},
|
|
3228
|
+
remove() {
|
|
3229
|
+
this.targetElements.forEach((e) => e.remove());
|
|
3230
|
+
},
|
|
3231
|
+
replace() {
|
|
3232
|
+
this.targetElements.forEach((e) => e.replaceWith(this.templateContent));
|
|
3233
|
+
},
|
|
3234
|
+
update() {
|
|
3235
|
+
this.targetElements.forEach((targetElement) => {
|
|
3236
|
+
targetElement.innerHTML = "";
|
|
3237
|
+
targetElement.append(this.templateContent);
|
|
3238
|
+
});
|
|
3239
|
+
},
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3242
|
+
const session = new Session();
|
|
3243
|
+
const cache = new Cache(session);
|
|
3244
|
+
const { navigator: navigator$1 } = session;
|
|
3245
|
+
function start() {
|
|
3246
|
+
session.start();
|
|
3247
|
+
}
|
|
3248
|
+
function registerAdapter(adapter) {
|
|
3249
|
+
session.registerAdapter(adapter);
|
|
3250
|
+
}
|
|
3251
|
+
function visit(location, options) {
|
|
3252
|
+
session.visit(location, options);
|
|
3253
|
+
}
|
|
3254
|
+
function connectStreamSource(source) {
|
|
3255
|
+
session.connectStreamSource(source);
|
|
3256
|
+
}
|
|
3257
|
+
function disconnectStreamSource(source) {
|
|
3258
|
+
session.disconnectStreamSource(source);
|
|
3259
|
+
}
|
|
3260
|
+
function renderStreamMessage(message) {
|
|
3261
|
+
session.renderStreamMessage(message);
|
|
3262
|
+
}
|
|
3263
|
+
function clearCache() {
|
|
3264
|
+
console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`");
|
|
3265
|
+
session.clearCache();
|
|
3266
|
+
}
|
|
3267
|
+
function setProgressBarDelay(delay) {
|
|
3268
|
+
session.setProgressBarDelay(delay);
|
|
3269
|
+
}
|
|
3270
|
+
function setConfirmMethod(confirmMethod) {
|
|
3271
|
+
FormSubmission.confirmMethod = confirmMethod;
|
|
3272
|
+
}
|
|
3273
|
+
function setFormMode(mode) {
|
|
3274
|
+
session.setFormMode(mode);
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
var Turbo = /*#__PURE__*/Object.freeze({
|
|
3278
|
+
__proto__: null,
|
|
3279
|
+
navigator: navigator$1,
|
|
3280
|
+
session: session,
|
|
3281
|
+
cache: cache,
|
|
3282
|
+
PageRenderer: PageRenderer,
|
|
3283
|
+
PageSnapshot: PageSnapshot,
|
|
3284
|
+
FrameRenderer: FrameRenderer,
|
|
3285
|
+
start: start,
|
|
3286
|
+
registerAdapter: registerAdapter,
|
|
3287
|
+
visit: visit,
|
|
3288
|
+
connectStreamSource: connectStreamSource,
|
|
3289
|
+
disconnectStreamSource: disconnectStreamSource,
|
|
3290
|
+
renderStreamMessage: renderStreamMessage,
|
|
3291
|
+
clearCache: clearCache,
|
|
3292
|
+
setProgressBarDelay: setProgressBarDelay,
|
|
3293
|
+
setConfirmMethod: setConfirmMethod,
|
|
3294
|
+
setFormMode: setFormMode,
|
|
3295
|
+
StreamActions: StreamActions
|
|
3296
|
+
});
|
|
3297
|
+
|
|
3298
|
+
class FrameController {
|
|
3299
|
+
constructor(element) {
|
|
3300
|
+
this.fetchResponseLoaded = (_fetchResponse) => { };
|
|
3301
|
+
this.currentFetchRequest = null;
|
|
3302
|
+
this.resolveVisitPromise = () => { };
|
|
3303
|
+
this.connected = false;
|
|
3304
|
+
this.hasBeenLoaded = false;
|
|
3305
|
+
this.ignoredAttributes = new Set();
|
|
3306
|
+
this.action = null;
|
|
3307
|
+
this.visitCachedSnapshot = ({ element }) => {
|
|
3308
|
+
const frame = element.querySelector("#" + this.element.id);
|
|
3309
|
+
if (frame && this.previousFrameElement) {
|
|
3310
|
+
frame.replaceChildren(...this.previousFrameElement.children);
|
|
3311
|
+
}
|
|
3312
|
+
delete this.previousFrameElement;
|
|
3313
|
+
};
|
|
3314
|
+
this.element = element;
|
|
3315
|
+
this.view = new FrameView(this, this.element);
|
|
3316
|
+
this.appearanceObserver = new AppearanceObserver(this, this.element);
|
|
3317
|
+
this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);
|
|
3318
|
+
this.linkInterceptor = new LinkInterceptor(this, this.element);
|
|
3319
|
+
this.restorationIdentifier = uuid();
|
|
3320
|
+
this.formSubmitObserver = new FormSubmitObserver(this, this.element);
|
|
3321
|
+
}
|
|
3322
|
+
connect() {
|
|
3323
|
+
if (!this.connected) {
|
|
3324
|
+
this.connected = true;
|
|
3325
|
+
if (this.loadingStyle == FrameLoadingStyle.lazy) {
|
|
3326
|
+
this.appearanceObserver.start();
|
|
3327
|
+
}
|
|
3328
|
+
else {
|
|
3329
|
+
this.loadSourceURL();
|
|
3330
|
+
}
|
|
3331
|
+
this.formLinkClickObserver.start();
|
|
3332
|
+
this.linkInterceptor.start();
|
|
3333
|
+
this.formSubmitObserver.start();
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
disconnect() {
|
|
3337
|
+
if (this.connected) {
|
|
3338
|
+
this.connected = false;
|
|
3339
|
+
this.appearanceObserver.stop();
|
|
3340
|
+
this.formLinkClickObserver.stop();
|
|
3341
|
+
this.linkInterceptor.stop();
|
|
3342
|
+
this.formSubmitObserver.stop();
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
disabledChanged() {
|
|
3346
|
+
if (this.loadingStyle == FrameLoadingStyle.eager) {
|
|
3347
|
+
this.loadSourceURL();
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
sourceURLChanged() {
|
|
3351
|
+
if (this.isIgnoringChangesTo("src"))
|
|
3352
|
+
return;
|
|
3353
|
+
if (this.element.isConnected) {
|
|
3354
|
+
this.complete = false;
|
|
3355
|
+
}
|
|
3356
|
+
if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {
|
|
3357
|
+
this.loadSourceURL();
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
sourceURLReloaded() {
|
|
3361
|
+
const { src } = this.element;
|
|
3362
|
+
this.ignoringChangesToAttribute("complete", () => {
|
|
3363
|
+
this.element.removeAttribute("complete");
|
|
3364
|
+
});
|
|
3365
|
+
this.element.src = null;
|
|
3366
|
+
this.element.src = src;
|
|
3367
|
+
return this.element.loaded;
|
|
3368
|
+
}
|
|
3369
|
+
completeChanged() {
|
|
3370
|
+
if (this.isIgnoringChangesTo("complete"))
|
|
3371
|
+
return;
|
|
3372
|
+
this.loadSourceURL();
|
|
3373
|
+
}
|
|
3374
|
+
loadingStyleChanged() {
|
|
3375
|
+
if (this.loadingStyle == FrameLoadingStyle.lazy) {
|
|
3376
|
+
this.appearanceObserver.start();
|
|
3377
|
+
}
|
|
3378
|
+
else {
|
|
3379
|
+
this.appearanceObserver.stop();
|
|
3380
|
+
this.loadSourceURL();
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
async loadSourceURL() {
|
|
3384
|
+
if (this.enabled && this.isActive && !this.complete && this.sourceURL) {
|
|
3385
|
+
this.element.loaded = this.visit(expandURL(this.sourceURL));
|
|
3386
|
+
this.appearanceObserver.stop();
|
|
3387
|
+
await this.element.loaded;
|
|
3388
|
+
this.hasBeenLoaded = true;
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
async loadResponse(fetchResponse) {
|
|
3392
|
+
if (fetchResponse.redirected || (fetchResponse.succeeded && fetchResponse.isHTML)) {
|
|
3393
|
+
this.sourceURL = fetchResponse.response.url;
|
|
3394
|
+
}
|
|
3395
|
+
try {
|
|
3396
|
+
const html = await fetchResponse.responseHTML;
|
|
3397
|
+
if (html) {
|
|
3398
|
+
const { body } = parseHTMLDocument(html);
|
|
3399
|
+
const newFrameElement = await this.extractForeignFrameElement(body);
|
|
3400
|
+
if (newFrameElement) {
|
|
3401
|
+
const snapshot = new Snapshot(newFrameElement);
|
|
3402
|
+
const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false, false);
|
|
3403
|
+
if (this.view.renderPromise)
|
|
3404
|
+
await this.view.renderPromise;
|
|
3405
|
+
this.changeHistory();
|
|
3406
|
+
await this.view.render(renderer);
|
|
3407
|
+
this.complete = true;
|
|
3408
|
+
session.frameRendered(fetchResponse, this.element);
|
|
3409
|
+
session.frameLoaded(this.element);
|
|
3410
|
+
this.fetchResponseLoaded(fetchResponse);
|
|
3411
|
+
}
|
|
3412
|
+
else if (this.willHandleFrameMissingFromResponse(fetchResponse)) {
|
|
3413
|
+
console.warn(`A matching frame for #${this.element.id} was missing from the response, transforming into full-page Visit.`);
|
|
3414
|
+
this.visitResponse(fetchResponse.response);
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
catch (error) {
|
|
3419
|
+
console.error(error);
|
|
3420
|
+
this.view.invalidate();
|
|
3421
|
+
}
|
|
3422
|
+
finally {
|
|
3423
|
+
this.fetchResponseLoaded = () => { };
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
elementAppearedInViewport(element) {
|
|
3427
|
+
this.proposeVisitIfNavigatedWithAction(element, element);
|
|
3428
|
+
this.loadSourceURL();
|
|
3429
|
+
}
|
|
3430
|
+
willSubmitFormLinkToLocation(link) {
|
|
3431
|
+
return this.shouldInterceptNavigation(link);
|
|
3432
|
+
}
|
|
3433
|
+
submittedFormLinkToLocation(link, _location, form) {
|
|
3434
|
+
const frame = this.findFrameElement(link);
|
|
3435
|
+
if (frame)
|
|
3436
|
+
form.setAttribute("data-turbo-frame", frame.id);
|
|
3437
|
+
}
|
|
3438
|
+
shouldInterceptLinkClick(element, _location, _event) {
|
|
3439
|
+
return this.shouldInterceptNavigation(element);
|
|
3440
|
+
}
|
|
3441
|
+
linkClickIntercepted(element, location) {
|
|
3442
|
+
this.navigateFrame(element, location);
|
|
3443
|
+
}
|
|
3444
|
+
willSubmitForm(element, submitter) {
|
|
3445
|
+
return element.closest("turbo-frame") == this.element && this.shouldInterceptNavigation(element, submitter);
|
|
3446
|
+
}
|
|
3447
|
+
formSubmitted(element, submitter) {
|
|
3448
|
+
if (this.formSubmission) {
|
|
3449
|
+
this.formSubmission.stop();
|
|
3450
|
+
}
|
|
3451
|
+
this.formSubmission = new FormSubmission(this, element, submitter);
|
|
3452
|
+
const { fetchRequest } = this.formSubmission;
|
|
3453
|
+
this.prepareRequest(fetchRequest);
|
|
3454
|
+
this.formSubmission.start();
|
|
3455
|
+
}
|
|
3456
|
+
prepareRequest(request) {
|
|
3457
|
+
var _a;
|
|
3458
|
+
request.headers["Turbo-Frame"] = this.id;
|
|
3459
|
+
if ((_a = this.currentNavigationElement) === null || _a === void 0 ? void 0 : _a.hasAttribute("data-turbo-stream")) {
|
|
3460
|
+
request.acceptResponseType(StreamMessage.contentType);
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
requestStarted(_request) {
|
|
3464
|
+
markAsBusy(this.element);
|
|
3465
|
+
}
|
|
3466
|
+
requestPreventedHandlingResponse(_request, _response) {
|
|
3467
|
+
this.resolveVisitPromise();
|
|
3468
|
+
}
|
|
3469
|
+
async requestSucceededWithResponse(request, response) {
|
|
3470
|
+
await this.loadResponse(response);
|
|
3471
|
+
this.resolveVisitPromise();
|
|
3472
|
+
}
|
|
3473
|
+
async requestFailedWithResponse(request, response) {
|
|
3474
|
+
console.error(response);
|
|
3475
|
+
await this.loadResponse(response);
|
|
3476
|
+
this.resolveVisitPromise();
|
|
3477
|
+
}
|
|
3478
|
+
requestErrored(request, error) {
|
|
3479
|
+
console.error(error);
|
|
3480
|
+
this.resolveVisitPromise();
|
|
3481
|
+
}
|
|
3482
|
+
requestFinished(_request) {
|
|
3483
|
+
clearBusyState(this.element);
|
|
3484
|
+
}
|
|
3485
|
+
formSubmissionStarted({ formElement }) {
|
|
3486
|
+
markAsBusy(formElement, this.findFrameElement(formElement));
|
|
3487
|
+
}
|
|
3488
|
+
formSubmissionSucceededWithResponse(formSubmission, response) {
|
|
3489
|
+
const frame = this.findFrameElement(formSubmission.formElement, formSubmission.submitter);
|
|
3490
|
+
frame.delegate.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);
|
|
3491
|
+
frame.delegate.loadResponse(response);
|
|
3492
|
+
}
|
|
3493
|
+
formSubmissionFailedWithResponse(formSubmission, fetchResponse) {
|
|
3494
|
+
this.element.delegate.loadResponse(fetchResponse);
|
|
3495
|
+
}
|
|
3496
|
+
formSubmissionErrored(formSubmission, error) {
|
|
3497
|
+
console.error(error);
|
|
3498
|
+
}
|
|
3499
|
+
formSubmissionFinished({ formElement }) {
|
|
3500
|
+
clearBusyState(formElement, this.findFrameElement(formElement));
|
|
3501
|
+
}
|
|
3502
|
+
allowsImmediateRender({ element: newFrame }, options) {
|
|
3503
|
+
const event = dispatch("turbo:before-frame-render", {
|
|
3504
|
+
target: this.element,
|
|
3505
|
+
detail: Object.assign({ newFrame }, options),
|
|
3506
|
+
cancelable: true,
|
|
3507
|
+
});
|
|
3508
|
+
const { defaultPrevented, detail: { render }, } = event;
|
|
3509
|
+
if (this.view.renderer && render) {
|
|
3510
|
+
this.view.renderer.renderElement = render;
|
|
3511
|
+
}
|
|
3512
|
+
return !defaultPrevented;
|
|
3513
|
+
}
|
|
3514
|
+
viewRenderedSnapshot(_snapshot, _isPreview) { }
|
|
3515
|
+
preloadOnLoadLinksForView(element) {
|
|
3516
|
+
session.preloadOnLoadLinksForView(element);
|
|
3517
|
+
}
|
|
3518
|
+
viewInvalidated() { }
|
|
3519
|
+
willRenderFrame(currentElement, _newElement) {
|
|
3520
|
+
this.previousFrameElement = currentElement.cloneNode(true);
|
|
3521
|
+
}
|
|
3522
|
+
async visit(url) {
|
|
3523
|
+
var _a;
|
|
3524
|
+
const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);
|
|
3525
|
+
(_a = this.currentFetchRequest) === null || _a === void 0 ? void 0 : _a.cancel();
|
|
3526
|
+
this.currentFetchRequest = request;
|
|
3527
|
+
return new Promise((resolve) => {
|
|
3528
|
+
this.resolveVisitPromise = () => {
|
|
3529
|
+
this.resolveVisitPromise = () => { };
|
|
3530
|
+
this.currentFetchRequest = null;
|
|
3531
|
+
resolve();
|
|
3532
|
+
};
|
|
3533
|
+
request.perform();
|
|
3534
|
+
});
|
|
3535
|
+
}
|
|
3536
|
+
navigateFrame(element, url, submitter) {
|
|
3537
|
+
const frame = this.findFrameElement(element, submitter);
|
|
3538
|
+
frame.delegate.proposeVisitIfNavigatedWithAction(frame, element, submitter);
|
|
3539
|
+
this.withCurrentNavigationElement(element, () => {
|
|
3540
|
+
frame.src = url;
|
|
3541
|
+
});
|
|
3542
|
+
}
|
|
3543
|
+
proposeVisitIfNavigatedWithAction(frame, element, submitter) {
|
|
3544
|
+
this.action = getVisitAction(submitter, element, frame);
|
|
3545
|
+
if (this.action) {
|
|
3546
|
+
const pageSnapshot = PageSnapshot.fromElement(frame).clone();
|
|
3547
|
+
const { visitCachedSnapshot } = frame.delegate;
|
|
3548
|
+
frame.delegate.fetchResponseLoaded = (fetchResponse) => {
|
|
3549
|
+
if (frame.src) {
|
|
3550
|
+
const { statusCode, redirected } = fetchResponse;
|
|
3551
|
+
const responseHTML = frame.ownerDocument.documentElement.outerHTML;
|
|
3552
|
+
const response = { statusCode, redirected, responseHTML };
|
|
3553
|
+
const options = {
|
|
3554
|
+
response,
|
|
3555
|
+
visitCachedSnapshot,
|
|
3556
|
+
willRender: false,
|
|
3557
|
+
updateHistory: false,
|
|
3558
|
+
restorationIdentifier: this.restorationIdentifier,
|
|
3559
|
+
snapshot: pageSnapshot,
|
|
3560
|
+
};
|
|
3561
|
+
if (this.action)
|
|
3562
|
+
options.action = this.action;
|
|
3563
|
+
session.visit(frame.src, options);
|
|
3564
|
+
}
|
|
3565
|
+
};
|
|
3566
|
+
}
|
|
3567
|
+
}
|
|
3568
|
+
changeHistory() {
|
|
3569
|
+
if (this.action) {
|
|
3570
|
+
const method = getHistoryMethodForAction(this.action);
|
|
3571
|
+
session.history.update(method, expandURL(this.element.src || ""), this.restorationIdentifier);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
willHandleFrameMissingFromResponse(fetchResponse) {
|
|
3575
|
+
this.element.setAttribute("complete", "");
|
|
3576
|
+
const response = fetchResponse.response;
|
|
3577
|
+
const visit = async (url, options = {}) => {
|
|
3578
|
+
if (url instanceof Response) {
|
|
3579
|
+
this.visitResponse(url);
|
|
3580
|
+
}
|
|
3581
|
+
else {
|
|
3582
|
+
session.visit(url, options);
|
|
3583
|
+
}
|
|
3584
|
+
};
|
|
3585
|
+
const event = dispatch("turbo:frame-missing", {
|
|
3586
|
+
target: this.element,
|
|
3587
|
+
detail: { response, visit },
|
|
3588
|
+
cancelable: true,
|
|
3589
|
+
});
|
|
3590
|
+
return !event.defaultPrevented;
|
|
3591
|
+
}
|
|
3592
|
+
async visitResponse(response) {
|
|
3593
|
+
const wrapped = new FetchResponse(response);
|
|
3594
|
+
const responseHTML = await wrapped.responseHTML;
|
|
3595
|
+
const { location, redirected, statusCode } = wrapped;
|
|
3596
|
+
return session.visit(location, { response: { redirected, statusCode, responseHTML } });
|
|
3597
|
+
}
|
|
3598
|
+
findFrameElement(element, submitter) {
|
|
3599
|
+
var _a;
|
|
3600
|
+
const id = getAttribute("data-turbo-frame", submitter, element) || this.element.getAttribute("target");
|
|
3601
|
+
return (_a = getFrameElementById(id)) !== null && _a !== void 0 ? _a : this.element;
|
|
3602
|
+
}
|
|
3603
|
+
async extractForeignFrameElement(container) {
|
|
3604
|
+
let element;
|
|
3605
|
+
const id = CSS.escape(this.id);
|
|
3606
|
+
try {
|
|
3607
|
+
element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);
|
|
3608
|
+
if (element) {
|
|
3609
|
+
return element;
|
|
3610
|
+
}
|
|
3611
|
+
element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);
|
|
3612
|
+
if (element) {
|
|
3613
|
+
await element.loaded;
|
|
3614
|
+
return await this.extractForeignFrameElement(element);
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
catch (error) {
|
|
3618
|
+
console.error(error);
|
|
3619
|
+
return new FrameElement();
|
|
3620
|
+
}
|
|
3621
|
+
return null;
|
|
3622
|
+
}
|
|
3623
|
+
formActionIsVisitable(form, submitter) {
|
|
3624
|
+
const action = getAction(form, submitter);
|
|
3625
|
+
return locationIsVisitable(expandURL(action), this.rootLocation);
|
|
3626
|
+
}
|
|
3627
|
+
shouldInterceptNavigation(element, submitter) {
|
|
3628
|
+
const id = getAttribute("data-turbo-frame", submitter, element) || this.element.getAttribute("target");
|
|
3629
|
+
if (element instanceof HTMLFormElement && !this.formActionIsVisitable(element, submitter)) {
|
|
3630
|
+
return false;
|
|
3631
|
+
}
|
|
3632
|
+
if (!this.enabled || id == "_top") {
|
|
3633
|
+
return false;
|
|
3634
|
+
}
|
|
3635
|
+
if (id) {
|
|
3636
|
+
const frameElement = getFrameElementById(id);
|
|
3637
|
+
if (frameElement) {
|
|
3638
|
+
return !frameElement.disabled;
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
if (!session.elementIsNavigatable(element)) {
|
|
3642
|
+
return false;
|
|
3643
|
+
}
|
|
3644
|
+
if (submitter && !session.elementIsNavigatable(submitter)) {
|
|
3645
|
+
return false;
|
|
3646
|
+
}
|
|
3647
|
+
return true;
|
|
3648
|
+
}
|
|
3649
|
+
get id() {
|
|
3650
|
+
return this.element.id;
|
|
3651
|
+
}
|
|
3652
|
+
get enabled() {
|
|
3653
|
+
return !this.element.disabled;
|
|
3654
|
+
}
|
|
3655
|
+
get sourceURL() {
|
|
3656
|
+
if (this.element.src) {
|
|
3657
|
+
return this.element.src;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
set sourceURL(sourceURL) {
|
|
3661
|
+
this.ignoringChangesToAttribute("src", () => {
|
|
3662
|
+
this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3665
|
+
get loadingStyle() {
|
|
3666
|
+
return this.element.loading;
|
|
3667
|
+
}
|
|
3668
|
+
get isLoading() {
|
|
3669
|
+
return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;
|
|
3670
|
+
}
|
|
3671
|
+
get complete() {
|
|
3672
|
+
return this.element.hasAttribute("complete");
|
|
3673
|
+
}
|
|
3674
|
+
set complete(value) {
|
|
3675
|
+
this.ignoringChangesToAttribute("complete", () => {
|
|
3676
|
+
if (value) {
|
|
3677
|
+
this.element.setAttribute("complete", "");
|
|
3678
|
+
}
|
|
3679
|
+
else {
|
|
3680
|
+
this.element.removeAttribute("complete");
|
|
3681
|
+
}
|
|
3682
|
+
});
|
|
3683
|
+
}
|
|
3684
|
+
get isActive() {
|
|
3685
|
+
return this.element.isActive && this.connected;
|
|
3686
|
+
}
|
|
3687
|
+
get rootLocation() {
|
|
3688
|
+
var _a;
|
|
3689
|
+
const meta = this.element.ownerDocument.querySelector(`meta[name="turbo-root"]`);
|
|
3690
|
+
const root = (_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : "/";
|
|
3691
|
+
return expandURL(root);
|
|
3692
|
+
}
|
|
3693
|
+
isIgnoringChangesTo(attributeName) {
|
|
3694
|
+
return this.ignoredAttributes.has(attributeName);
|
|
3695
|
+
}
|
|
3696
|
+
ignoringChangesToAttribute(attributeName, callback) {
|
|
3697
|
+
this.ignoredAttributes.add(attributeName);
|
|
3698
|
+
callback();
|
|
3699
|
+
this.ignoredAttributes.delete(attributeName);
|
|
3700
|
+
}
|
|
3701
|
+
withCurrentNavigationElement(element, callback) {
|
|
3702
|
+
this.currentNavigationElement = element;
|
|
3703
|
+
callback();
|
|
3704
|
+
delete this.currentNavigationElement;
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
function getFrameElementById(id) {
|
|
3708
|
+
if (id != null) {
|
|
3709
|
+
const element = document.getElementById(id);
|
|
3710
|
+
if (element instanceof FrameElement) {
|
|
3711
|
+
return element;
|
|
3712
|
+
}
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
function activateElement(element, currentURL) {
|
|
3716
|
+
if (element) {
|
|
3717
|
+
const src = element.getAttribute("src");
|
|
3718
|
+
if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {
|
|
3719
|
+
throw new Error(`Matching <turbo-frame id="${element.id}"> element has a source URL which references itself`);
|
|
3720
|
+
}
|
|
3721
|
+
if (element.ownerDocument !== document) {
|
|
3722
|
+
element = document.importNode(element, true);
|
|
3723
|
+
}
|
|
3724
|
+
if (element instanceof FrameElement) {
|
|
3725
|
+
element.connectedCallback();
|
|
3726
|
+
element.disconnectedCallback();
|
|
3727
|
+
return element;
|
|
3728
|
+
}
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
class StreamElement extends HTMLElement {
|
|
3733
|
+
static async renderElement(newElement) {
|
|
3734
|
+
await newElement.performAction();
|
|
3735
|
+
}
|
|
3736
|
+
async connectedCallback() {
|
|
3737
|
+
try {
|
|
3738
|
+
await this.render();
|
|
3739
|
+
}
|
|
3740
|
+
catch (error) {
|
|
3741
|
+
console.error(error);
|
|
3742
|
+
}
|
|
3743
|
+
finally {
|
|
3744
|
+
this.disconnect();
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
async render() {
|
|
3748
|
+
var _a;
|
|
3749
|
+
return ((_a = this.renderPromise) !== null && _a !== void 0 ? _a : (this.renderPromise = (async () => {
|
|
3750
|
+
const event = this.beforeRenderEvent;
|
|
3751
|
+
if (this.dispatchEvent(event)) {
|
|
3752
|
+
await nextAnimationFrame();
|
|
3753
|
+
await event.detail.render(this);
|
|
3754
|
+
}
|
|
3755
|
+
})()));
|
|
3756
|
+
}
|
|
3757
|
+
disconnect() {
|
|
3758
|
+
try {
|
|
3759
|
+
this.remove();
|
|
3760
|
+
}
|
|
3761
|
+
catch (_a) { }
|
|
3762
|
+
}
|
|
3763
|
+
removeDuplicateTargetChildren() {
|
|
3764
|
+
this.duplicateChildren.forEach((c) => c.remove());
|
|
3765
|
+
}
|
|
3766
|
+
get duplicateChildren() {
|
|
3767
|
+
var _a;
|
|
3768
|
+
const existingChildren = this.targetElements.flatMap((e) => [...e.children]).filter((c) => !!c.id);
|
|
3769
|
+
const newChildrenIds = [...(((_a = this.templateContent) === null || _a === void 0 ? void 0 : _a.children) || [])].filter((c) => !!c.id).map((c) => c.id);
|
|
3770
|
+
return existingChildren.filter((c) => newChildrenIds.includes(c.id));
|
|
3771
|
+
}
|
|
3772
|
+
get performAction() {
|
|
3773
|
+
if (this.action) {
|
|
3774
|
+
const actionFunction = StreamActions[this.action];
|
|
3775
|
+
if (actionFunction) {
|
|
3776
|
+
return actionFunction;
|
|
3777
|
+
}
|
|
3778
|
+
this.raise("unknown action");
|
|
3779
|
+
}
|
|
3780
|
+
this.raise("action attribute is missing");
|
|
3781
|
+
}
|
|
3782
|
+
get targetElements() {
|
|
3783
|
+
if (this.target) {
|
|
3784
|
+
return this.targetElementsById;
|
|
3785
|
+
}
|
|
3786
|
+
else if (this.targets) {
|
|
3787
|
+
return this.targetElementsByQuery;
|
|
3788
|
+
}
|
|
3789
|
+
else {
|
|
3790
|
+
this.raise("target or targets attribute is missing");
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
get templateContent() {
|
|
3794
|
+
return this.templateElement.content.cloneNode(true);
|
|
3795
|
+
}
|
|
3796
|
+
get templateElement() {
|
|
3797
|
+
if (this.firstElementChild === null) {
|
|
3798
|
+
const template = this.ownerDocument.createElement("template");
|
|
3799
|
+
this.appendChild(template);
|
|
3800
|
+
return template;
|
|
3801
|
+
}
|
|
3802
|
+
else if (this.firstElementChild instanceof HTMLTemplateElement) {
|
|
3803
|
+
return this.firstElementChild;
|
|
3804
|
+
}
|
|
3805
|
+
this.raise("first child element must be a <template> element");
|
|
3806
|
+
}
|
|
3807
|
+
get action() {
|
|
3808
|
+
return this.getAttribute("action");
|
|
3809
|
+
}
|
|
3810
|
+
get target() {
|
|
3811
|
+
return this.getAttribute("target");
|
|
3812
|
+
}
|
|
3813
|
+
get targets() {
|
|
3814
|
+
return this.getAttribute("targets");
|
|
3815
|
+
}
|
|
3816
|
+
raise(message) {
|
|
3817
|
+
throw new Error(`${this.description}: ${message}`);
|
|
3818
|
+
}
|
|
3819
|
+
get description() {
|
|
3820
|
+
var _a, _b;
|
|
3821
|
+
return (_b = ((_a = this.outerHTML.match(/<[^>]+>/)) !== null && _a !== void 0 ? _a : [])[0]) !== null && _b !== void 0 ? _b : "<turbo-stream>";
|
|
3822
|
+
}
|
|
3823
|
+
get beforeRenderEvent() {
|
|
3824
|
+
return new CustomEvent("turbo:before-stream-render", {
|
|
3825
|
+
bubbles: true,
|
|
3826
|
+
cancelable: true,
|
|
3827
|
+
detail: { newStream: this, render: StreamElement.renderElement },
|
|
3828
|
+
});
|
|
3829
|
+
}
|
|
3830
|
+
get targetElementsById() {
|
|
3831
|
+
var _a;
|
|
3832
|
+
const element = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.getElementById(this.target);
|
|
3833
|
+
if (element !== null) {
|
|
3834
|
+
return [element];
|
|
3835
|
+
}
|
|
3836
|
+
else {
|
|
3837
|
+
return [];
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
get targetElementsByQuery() {
|
|
3841
|
+
var _a;
|
|
3842
|
+
const elements = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.targets);
|
|
3843
|
+
if (elements.length !== 0) {
|
|
3844
|
+
return Array.prototype.slice.call(elements);
|
|
3845
|
+
}
|
|
3846
|
+
else {
|
|
3847
|
+
return [];
|
|
3848
|
+
}
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
|
|
3852
|
+
class StreamSourceElement extends HTMLElement {
|
|
3853
|
+
constructor() {
|
|
3854
|
+
super(...arguments);
|
|
3855
|
+
this.streamSource = null;
|
|
3856
|
+
}
|
|
3857
|
+
connectedCallback() {
|
|
3858
|
+
this.streamSource = this.src.match(/^ws{1,2}:/) ? new WebSocket(this.src) : new EventSource(this.src);
|
|
3859
|
+
connectStreamSource(this.streamSource);
|
|
3860
|
+
}
|
|
3861
|
+
disconnectedCallback() {
|
|
3862
|
+
if (this.streamSource) {
|
|
3863
|
+
disconnectStreamSource(this.streamSource);
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
get src() {
|
|
3867
|
+
return this.getAttribute("src") || "";
|
|
3868
|
+
}
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
FrameElement.delegateConstructor = FrameController;
|
|
3872
|
+
if (customElements.get("turbo-frame") === undefined) {
|
|
3873
|
+
customElements.define("turbo-frame", FrameElement);
|
|
3874
|
+
}
|
|
3875
|
+
if (customElements.get("turbo-stream") === undefined) {
|
|
3876
|
+
customElements.define("turbo-stream", StreamElement);
|
|
3877
|
+
}
|
|
3878
|
+
if (customElements.get("turbo-stream-source") === undefined) {
|
|
3879
|
+
customElements.define("turbo-stream-source", StreamSourceElement);
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3882
|
+
(() => {
|
|
3883
|
+
let element = document.currentScript;
|
|
3884
|
+
if (!element)
|
|
3885
|
+
return;
|
|
3886
|
+
if (element.hasAttribute("data-turbo-suppress-warning"))
|
|
3887
|
+
return;
|
|
3888
|
+
element = element.parentElement;
|
|
3889
|
+
while (element) {
|
|
3890
|
+
if (element == document.body) {
|
|
3891
|
+
return console.warn(unindent `
|
|
3892
|
+
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
|
3893
|
+
|
|
3894
|
+
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
|
3895
|
+
|
|
3896
|
+
For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
|
|
3897
|
+
|
|
3898
|
+
——
|
|
3899
|
+
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
|
3900
|
+
`, element.outerHTML);
|
|
3901
|
+
}
|
|
3902
|
+
element = element.parentElement;
|
|
3903
|
+
}
|
|
3904
|
+
})();
|
|
3905
|
+
|
|
3906
|
+
window.Turbo = Turbo;
|
|
3907
|
+
start();
|
|
3908
|
+
|
|
3909
|
+
export { FrameElement, FrameLoadingStyle, FrameRenderer, PageRenderer, PageSnapshot, StreamActions, StreamElement, StreamSourceElement, cache, clearCache, connectStreamSource, disconnectStreamSource, navigator$1 as navigator, registerAdapter, renderStreamMessage, session, setConfirmMethod, setFormMode, setProgressBarDelay, start, visit };
|
|
3910
|
+
//# sourceMappingURL=turbo.es2017-esm.js.map
|