snice 4.36.1 → 4.36.2
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 +1 -1
- package/adapters/react/SniceProvider.js +1 -1
- package/adapters/react/SniceRouter.js +1 -1
- package/adapters/react/matchRoute.js +1 -1
- package/adapters/react/useRequestHandler.js +1 -1
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/accordion/snice-accordion.min.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.min.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.min.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/alert/snice-alert.min.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.min.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.min.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/availability/snice-availability.min.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar/snice-avatar.min.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.min.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/badge/snice-badge.min.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/banner/snice-banner.min.js +1 -1
- package/dist/cdn/binpack/snice-binpack.js +1 -1
- package/dist/cdn/binpack/snice-binpack.min.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/book/snice-book.min.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/booking/snice-booking.min.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
- package/dist/cdn/button/snice-button.js +1 -1
- package/dist/cdn/button/snice-button.min.js +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera/snice-camera.min.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/card/snice-card.min.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/carousel/snice-carousel.min.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/cart/snice-cart.min.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chart/snice-chart.min.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/chat/snice-chat.min.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/chip/snice-chip.min.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-display/snice-color-display.min.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/comments/snice-comments.min.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/countdown/snice-countdown.min.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/cropper/snice-cropper.min.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/data-card/snice-data-card.min.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.min.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.min.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/diff/snice-diff.min.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/divider/snice-divider.min.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/doc/snice-doc.min.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/draw/snice-draw.min.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/drawer/snice-drawer.min.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/estimate/snice-estimate.min.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.min.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/flow/snice-flow.min.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.min.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/funnel/snice-funnel.min.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gantt/snice-gantt.min.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/gauge/snice-gauge.min.js +1 -1
- package/dist/cdn/grid/snice-grid.js +1 -1
- package/dist/cdn/grid/snice-grid.min.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/image/snice-image.min.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/input/snice-input.min.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/invoice/snice-invoice.min.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/kanban/snice-kanban.min.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/key-value/snice-key-value.min.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/kpi/snice-kpi.min.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/layout/snice-layout.min.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.min.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link/snice-link.min.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/list/snice-list.min.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/location/snice-location.min.js +1 -1
- package/dist/cdn/login/snice-login.js +1 -1
- package/dist/cdn/login/snice-login.min.js +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/map/snice-map.min.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/markdown/snice-markdown.min.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/masonry/snice-masonry.min.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/menu/snice-menu.min.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.min.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.min.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/modal/snice-modal.min.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/nav/snice-nav.min.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.min.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.min.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.min.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/pagination/snice-pagination.min.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/paint/snice-paint.min.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.min.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.min.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.min.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/product-card/snice-product-card.min.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.min.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/radio/snice-radio.min.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.min.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/rating/snice-rating.min.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/receipt/snice-receipt.min.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/recipe/snice-recipe.min.js +1 -1
- package/dist/cdn/runtime/README.md +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.js +9 -4
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +5 -5
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +9 -4
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +5 -5
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/sankey/snice-sankey.min.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.min.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/select/snice-select.min.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/slider/snice-slider.min.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sortable/snice-sortable.min.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/spinner/snice-spinner.min.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-button/snice-split-button.min.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.min.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.min.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/step-input/snice-step-input.min.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/stepper/snice-stepper.min.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/switch/snice-switch.min.js +1 -1
- package/dist/cdn/table/snice-table.js +1 -1
- package/dist/cdn/table/snice-table.min.js +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tabs/snice-tabs.min.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag/snice-tag.min.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.min.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.min.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/textarea/snice-textarea.min.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.min.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timeline/snice-timeline.min.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/timer/snice-timer.min.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/toast/snice-toast.min.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/tree/snice-tree.min.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/treemap/snice-treemap.min.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/user-card/snice-user-card.min.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/video-player/snice-video-player.min.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.min.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/weather/snice-weather.min.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/cdn/work-order/snice-work-order.min.js +1 -1
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +6 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +6 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/react/SniceProvider.js +1 -1
- package/dist/react/SniceRouter.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/matchRoute.js +1 -1
- package/dist/react/useRequestHandler.js +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/STORYBOOK.md +1 -0
- package/docs/code-block.md +1 -0
- package/docs/controllers.md +1 -0
- package/docs/elements.md +1 -0
- package/docs/events.md +1 -0
- package/docs/fetcher.md +1 -0
- package/docs/observe.md +1 -0
- package/docs/placards.md +1 -0
- package/docs/request-response.md +1 -0
- package/docs/routing.md +1 -0
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* snice v4.36.
|
|
2
|
+
* snice v4.36.2
|
|
3
3
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
7
|
var Snice=function(t){"use strict";
|
|
8
8
|
/*!
|
|
9
|
-
* snice v4.36.
|
|
9
|
+
* snice v4.36.1
|
|
10
10
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
11
11
|
* (c) 2024
|
|
12
12
|
* Released under the MIT License.
|
|
13
|
-
*/globalThis.snice||(globalThis.snice={controllerRegistry:new Map,controllerIdCounter:0});const e=globalThis.snice;function n(t){return Symbol.for(`snice:${t}`)}const o=n("is-controller-class"),r=n("is-controller-instance"),s=n("is-element-class"),i=n("channel-handlers"),a=n("ready-promise"),c=n("ready-resolve"),l=n("controller"),u=n("initialized"),h=n("controller-key"),d=n("controller-name"),m=n("controller-id"),f=n("controller-operations"),p=n("native-controller"),y=n("cleanup"),g=n("properties"),b=n("property-values"),v=n("pre-init-property-values"),w=n("properties-initialized"),N=n("property-watchers"),S=n("explicitly-set-properties"),T=n("router-context"),E=n("page-transition"),_=n("created-at"),A=n("ready-handlers"),x=n("dispose-handlers"),C=n("moved-handlers"),O=n("adopted-handlers"),M=n("observers"),L=n("setting-from-property"),k=n("moved-timers"),I=n("adopted-timers"),R=n("dispatch-timers"),P=n("render-method"),D=n("render-options"),$=n("render-instance"),F=n("render-timers"),q=n("render-callbacks"),B=n("styles-method"),j=n("styles-applied"),V=n("parent-styles-methods"),U=n("context-handler"),z=n("navigation-context-instance"),H=n("registered-elements"),W=n("is-updating"),K=n("context-register"),G=n("context-unregister"),Q=n("context-notify-element"),J=n("context-timer"),X=n("context-called"),Y=n("context-update");class Z{static{this.SEPARATOR=","}static serialize(t){return Array.isArray(t)?t.map(t=>{if("string"==typeof t){if(t.includes(Z.SEPARATOR))throw new Error(`SimpleArray strings cannot contain the character "${Z.SEPARATOR}" (U+FF0C)`);return t}if("number"==typeof t||"boolean"==typeof t)return String(t);throw new Error("SimpleArray only supports string, number, and boolean types. Got: "+typeof t)}).join(Z.SEPARATOR):""}static parse(t){return null==t||""===t?[]:t.split(Z.SEPARATOR).map(t=>{if(/^-?\d+\.?\d*$/.test(t)){const e=Number(t);if(!isNaN(e))return e}return"true"===t||"false"!==t&&t})}}var tt,et,nt;const ot=Symbol.for("snice:registered-elements-set");let rt=0;class st{constructor(t={},e=[],n="",o={},r){if(this[tt]=new WeakMap,this[et]=new Set,this[nt]=!1,this.id=rt++,this.application=t,this.navigation={placards:e,route:n,params:o},r&&"function"==typeof r.create)this.fetch=r.create(this);else{if("function"!=typeof fetch)throw new Error("No fetch implementation available");this.fetch=fetch.bind(this)}}[(tt=H,et=ot,nt=W,K)](t,e){this[H].set(t,e),this[ot].add(t)}[G](t){this[H].delete(t),this[ot].delete(t)}[Y](t,e,n,o){this.application=t,this.navigation.placards=e,this.navigation.route=n,this.navigation.params=o,this.notify()}update(){this.notify()}notify(){if(this[W])return;this[W]=!0;const t=this[ot],e=this[H];for(const n of t){const t=e.get(n);if(t&&"function"==typeof n[t])try{n[t](this)}catch(e){console.error(`Error calling @context method ${t}:`,e)}}this[W]=!1}[Q](t){const e=this[H].get(t);e&&"function"==typeof t[e]&&t[e](this)}}function it(t){if(null!=t)return"string"==typeof t?String:"number"==typeof t?Number:"boolean"==typeof t?Boolean:t instanceof Date?Date:"bigint"==typeof t?BigInt:Array.isArray(t)?Array:void 0}function at(t,e,n,o){switch(e.type||it(o)){case Boolean:return null!==t&&"false"!==t;case Number:return null!==t?Number(t):null;case String:return t;case Date:return t?new Date(t):null;case BigInt:return t&&t.endsWith("n")?BigInt(t.slice(0,-1)):t?BigInt(t):null;case Z:return Z.parse(t);case Array:try{return t?JSON.parse(t):[]}catch{return[]}case Object:try{return t?JSON.parse(t):{}}catch{return{}}default:return"number"==typeof n&&null!==t?Number(t):t}}function ct(t,e){return"string"==typeof t.attribute?t.attribute:e.toLowerCase()}function lt(t,e){return t[e]||(t[e]=new Set),t[e]}function ut(t,e){return t[e]||(t[e]={}),t[e]}function ht(t,e,n,o,r){const s=e[N];if(s){if(s.has(n))for(const e of s.get(n))try{e.method.call(t,o,r,n)}catch(t){console.error(`Error in @watch('${n}') method ${e.methodName}:`,t)}if(s.has("*"))for(const e of s.get("*"))try{e.method.call(t,o,r,n)}catch(t){console.error(`Error in @watch('*') method ${e.methodName}:`,t)}}}function dt(t,e){let n=null;return function(...o){null!==n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,o),n=null},e)}}function mt(t,e){let n=0,o=null;return function(...r){const s=Date.now(),i=e-(s-n);if(i<=0)return o&&(clearTimeout(o),o=null),n=s,t.apply(this,r);o||(o=setTimeout(()=>{n=Date.now(),o=null,t.apply(this,r)},i))}}const ft=new Map;function pt(t,e){const n=t.constructor[M];if(n&&Array.isArray(n)&&0!==n.length){t[y]?t[y].observers||(t[y].observers=[]):t[y]={events:[],channels:[],observers:[]};for(const o of n){const n=o.method.bind(t),r=o.options?.throttle?mt(n,o.options.throttle):n;switch(o.type){case"intersection":yt(t,e,o,r);break;case"resize":gt(t,e,o,r);break;case"media":bt(t,e,o,r);break;case"mutation":vt(t,e,o,r);break;default:console.warn(`Unknown observer type: ${o.type}`)}}}}function yt(t,e,n,o){const r={threshold:n.options?.threshold??0,rootMargin:n.options?.rootMargin??"0px",root:n.options?.root??null};if("undefined"==typeof IntersectionObserver)return void console.warn("IntersectionObserver is not available in this environment");const s=new IntersectionObserver(t=>{for(const e of t)try{!1===o(e)&&s&&s.unobserve(e.target)}catch(t){console.error(`Error in intersection observer ${n.methodName}:`,t)}},r),i=n.selector?Array.from(e.shadowRoot?.querySelectorAll(n.selector)||[]):[e];i.forEach(t=>s.observe(t)),t[y].observers.push(()=>{i.forEach(t=>s.unobserve(t)),0===s.takeRecords().length&&s.disconnect()})}function gt(t,e,n,o){const r=n.options?.box||"content-box";if("undefined"==typeof ResizeObserver)return void console.warn("ResizeObserver is not available in this environment");const s=new ResizeObserver(t=>{for(const e of t)try{o(e)}catch(t){console.error(`Error in resize observer ${n.methodName}:`,t)}});(n.selector?Array.from(e.shadowRoot?.querySelectorAll(n.selector)||[]):[e]).forEach(t=>{s.observe(t,{box:r})}),t[y].observers.push(()=>{s.disconnect()})}function bt(t,e,n,o){const r=n.target;if(!r)return void console.warn("Media query observer requires a query string");let s=ft.get(r);if(!s)try{s=window.matchMedia(r),ft.set(r,s)}catch(t){return void console.error(`Invalid media query: ${r}`,t)}const i=t=>{try{o(t.matches)}catch(t){console.error(`Error in media query observer ${n.methodName}:`,t)}};i(s);const a=t=>i(t);s.addEventListener?(s.addEventListener("change",a),t[y].observers.push(()=>{s.removeEventListener("change",a)})):(s.addListener(a),t[y].observers.push(()=>{s.removeListener(a)}))}function vt(t,e,n,o){const s=n.target.split(":"),i=s[0]||"childList",a=s[1],c={};switch(i){case"childList":c.childList=!0;break;case"attributes":c.attributes=!0,a&&(c.attributeFilter=[a]);break;default:return void console.warn(`Unknown mutation type: ${i}`)}n.options?.subtree&&(c.subtree=!0,n.options.maxDepth&&console.warn("maxDepth is set but requires custom implementation"));const l=!(!n.options?.maxDepth||!n.options.subtree),u=new MutationObserver(t=>{try{if(!l)return void o(t);const r=n.options.maxDepth,s=e.shadowRoot||e,i=t.filter(t=>{let e=0,n=t.target;for(;n&&n!==s&&e<r;)n=n.parentNode,e++;return e<r});i.length>0&&o(i)}catch(t){console.error(`Error in mutation observer ${n.methodName}:`,t)}}),h=!0===t[r];(n.selector?Array.from(e.shadowRoot?.querySelectorAll(n.selector)||[]):h&&e.shadowRoot?[e.shadowRoot]:[e]).forEach(t=>{u.observe(t,c)}),t[y].observers.push(()=>{u.disconnect()})}function wt(t){if(t[y]?.observers){for(const e of t[y].observers)e();t[y].observers=[]}}function Nt(t,e){const n=t.constructor[i];if(n){t[y]||(t[y]={events:[],channels:[]});for(const o of n){const n=o.method.bind(t),r=`@request/${o.channelName}`;let s,i,a=0;const c=(t=>o.options?.debounce?(...e)=>new Promise((n,r)=>{clearTimeout(s),s=setTimeout(async()=>{try{n(await t(...e))}catch(t){r(t)}},o.options.debounce)}):o.options?.throttle?(...e)=>{const n=Date.now(),r=o.options.throttle-(n-a);return r<=0?(clearTimeout(i),a=n,t(...e)):i?Promise.resolve(void 0):new Promise((n,o)=>{i=setTimeout(async()=>{a=Date.now(),i=null;try{n(await t(...e))}catch(t){o(t)}},r)})}:t)(n),l=t=>{const{data:e,discovery:n,payload:r}=t.detail;t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation(),n.resolve(),Promise.resolve(c(r)).then(t=>{e.resolve(t)}).catch(t=>{e.reject(t),console.error(`Error in response handler ${o.methodName}:`,t)})};e.addEventListener(r,l),t[y].channels.push(()=>{e.removeEventListener(r,l)})}}}function St(t){if(t[y]?.channels){for(const e of t[y].channels)e();t[y].channels=[]}}const Tt=Symbol.for("snice:html-result"),Et=Symbol.for("snice:css-result");function _t(t){return t&&t._$litType$===Tt}function At(t){return t&&t._$litType$===Et}const xt=Symbol.for("snice:nothing"),Ct=Symbol.for("snice:unsafe-html");const Ot=`snice$${Math.random().toFixed(9).slice(2)}$`,Mt="?"+Ot,Lt=`<${Mt}>`,kt=new RegExp(Ot,"g"),It=new WeakMap,Rt=Symbol("not-committed"),Pt=Symbol.for("snice:no-change"),Dt=t=>null===t||"object"!=typeof t&&"function"!=typeof t;class $t{constructor(t,e,n){this.parts=[],this.element=e;const o=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let r=0;const s=[];let i;for(;null!==(i=o.nextNode());)if(i.nodeType===Node.ELEMENT_NODE){const t=i,e=t.tagName.toLowerCase();if("if"===e){const e=t.getAttribute("value");e&&e.includes(Ot)&&(t.removeAttribute("value"),this.parts.push({type:"conditional-if",index:r++,element:t}));continue}if("case"===e){const e=t.getAttribute("value");e&&e.includes(Ot)&&(t.removeAttribute("value"),this.parts.push({type:"conditional-case",index:r++,element:t}));continue}if(t.hasAttributes()){const e=t.attributes,o=[];for(let s=0;s<e.length;s++){const i=e[s],a=i.value;if(a.includes(Ot)){o.push(i);const e=n[r]||i.name,s=a.split(Ot),c=s.length-1;e.startsWith("@@")||e.startsWith("@")?(this.parts.push({type:"event",index:r,name:e.slice(1),element:t}),r+=1):e.startsWith(".")?(this.parts.push({type:"property",index:r,name:e.slice(1),element:t}),r+=1):e.startsWith("?")?(this.parts.push({type:"boolean-attribute",index:r,name:e.slice(1),element:t}),r+=1):(this.parts.push({type:"attribute",index:r,name:i.name,element:t,attrStrings:s}),r+=c)}}for(const e of o)t.removeAttribute(e.name)}}else if(i.nodeType===Node.COMMENT_NODE){const t=i;if(t.data===Mt){const e=t.parentNode,n=document.createComment("");e.insertBefore(n,t.nextSibling),this.parts.push({type:"node",index:r++,startNode:t,endNode:n})}}else if(i.nodeType===Node.TEXT_NODE){const t=i,e=t.data;if(e.includes(Ot)){const n=t.parentNode,o=e.split(kt),i=o.length-1;for(let e=0;e<i;e++){n.insertBefore(document.createTextNode(o[e]),t);const s=document.createComment(""),i=document.createComment("");n.insertBefore(s,t),n.insertBefore(i,t),this.parts.push({type:"node",index:r++,startNode:s,endNode:i})}""!==o[i]?t.data=o[i]:s.push(t)}}for(const t of s)t.parentNode?.removeChild(t)}}class Ft{constructor(t){this.parts=[],this.fragment=null,this.conditionalParts=[],this.regularParts=[],this.template=function(t){const{strings:e}=t,n=It.get(e);if(n)return n;const o=[],r=[];let s=!1,i=!1,a="",c="";for(let t=0;t<e.length;t++){const n=e[t];if(o.push(n),t<e.length-1){for(let t=0;t<n.length;t++){const e=n[t];if(s){if(i)e===a&&(i=!1,a="");else if(">"===e)s=!1;else if('"'===e||"'"===e)i=!0,a=e;else if("="===e){let e=t-1;for(;e>=0&&/[\w\-\.@\?]/.test(n[e]);)e--;c=n.substring(e+1,t).trim()}}else"<"===e&&(s=!0)}if(i)r.push(c),o.push(Ot);else if(s){const t=n.trimEnd();if(t.endsWith("=")){let e=t.length-2;for(;e>=0&&/[\w\-\.@\?\/]/.test(t[e]);)e--;c=t.substring(e+1,t.length-1).trim(),r.push(c),o.push(Ot)}else n.match(/<(if|case)\s*$/)?(c="value",r.push("value"),o.push(`value="${Ot}"`)):(r.push(""),o.push(Ot))}else r.push(""),o.push(Lt)}}const l=o.join(""),u=document.createElement("template");u.innerHTML=l;const h=new $t(t,u,r);return It.set(e,h),h}(t),this.strings=t.strings}isSameTemplate(t){return this.strings===t}renderFragment(){if(!this.fragment){this.fragment=this.template.element.content.cloneNode(!0);const t=document.createTreeWalker(this.template.element.content,NodeFilter.SHOW_ALL),e=document.createTreeWalker(this.fragment,NodeFilter.SHOW_ALL),n=new Map;let o=t.currentNode,r=e.currentNode;for(;o&&r;)n.set(o,r),o=t.nextNode(),r=e.nextNode();for(let t=0;t<this.template.parts.length;t++){const e=this.template.parts[t];let o;switch(e.type){case"node":const t=n.get(e.startNode),r=n.get(e.endNode);o=new Bt(t,r);break;case"attribute":const s=n.get(e.element);o=new jt(s,e.name,e.attrStrings);break;case"property":const i=n.get(e.element);o=new Vt(i,e.name);break;case"boolean-attribute":const a=n.get(e.element);o=new Ut(a,e.name);break;case"event":const c=n.get(e.element);o=new zt(c,e.name);break;case"conditional-if":const l=n.get(e.element);o=new Qt(l);break;case"conditional-case":const u=n.get(e.element);o=new Jt(u);break;default:throw new Error(`Unknown part type: ${e.type}`)}this.parts.push(o),o instanceof Qt||o instanceof Jt?this.conditionalParts.push({part:o,index:e.index}):this.regularParts.push({part:o,index:e.index})}}return this.fragment}render(t){const e=this.renderFragment();return this.update(t),e}update(t){for(const{part:e,index:n}of this.conditionalParts)e.commit(t[n]);for(const{part:e,index:n}of this.regularParts)e instanceof jt&&void 0!==e.strings?e.commit(t,n):e.commit(t[n])}clear(){for(const t of this.parts)t.clear()}}class qt{}class Bt extends qt{constructor(t,e){super(),this._committedValue=Rt,this.startNode=t,this.endNode=e}commit(t){if(t!==Pt)return t===xt||null==t||""===t?(this._committedValue!==xt&&this._clear(),void(this._committedValue=xt)):void(Dt(t)?t!==this._committedValue&&this._commitText(t):_t(t)?this._commitTemplateResult(t):!function(t){return t&&t._$litType$===Ct}(t)?void 0===t.nodeType?(t=>Array.isArray(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t):this._commitNode(t):this._commitUnsafeHTML(t))}_commitText(t){if(this._committedValue!==Rt&&this._committedValue!==xt&&Dt(this._committedValue)&&!Array.isArray(this._committedValue)){const e=this.startNode.nextSibling;if(e&&e.nodeType===Node.TEXT_NODE)return e.data=String(t),void(this._committedValue=t)}this._clear(),this._insertBefore(document.createTextNode(String(t))),this._committedValue=t}_commitTemplateResult(t){const e=this._committedValue;if(e instanceof Ft){const n=It.get(t.strings);if(n&&e.template===n)return void e.update(t.values)}this._clear();const n=new Ft(t),o=n.renderFragment();this._insertBefore(o),n.update(t.values),this._committedValue=n}_commitIterable(t){Array.isArray(this._committedValue)&&this._committedValue[0]instanceof Bt||(this._clear(),this._committedValue=[]);const e=this._committedValue;let n=0;for(const o of t){let t;if(n>=e.length){const n=document.createComment(""),o=document.createComment("");this._insertBefore(n),this._insertBefore(o),t=new Bt(n,o),e.push(t)}else t=e[n];t.commit(o),n++}if(n<e.length){for(let t=n;t<e.length;t++){const n=e[t];n._clear(),n.startNode.remove(),n.endNode.remove()}e.length=n}}_commitNode(t){this._committedValue!==t&&(this._clear(),this._insertBefore(t),this._committedValue=t)}_commitUnsafeHTML(t){this._clear();const e=document.createElement("template");e.innerHTML=t.html,this._insertBefore(e.content),this._committedValue=t}_insertBefore(t){this.endNode.parentNode?.insertBefore(t,this.endNode)}_clear(){const t=this.startNode.parentNode;if(!t)return;let e=this.startNode.nextSibling;for(;e&&e!==this.endNode;){const n=e.nextSibling;t.removeChild(e),e=n}this._committedValue=xt}clear(){this._clear()}}class jt extends qt{constructor(t,e,n){super(),this._committedValue=Rt,this.element=t,this.name=e,n&&(n.length>2||""!==n[0]||""!==n[1])?(this._committedValue=new Array(n.length-1).fill(Rt),this.strings=n):this._committedValue=Rt}commit(t,e=0){let n,o=!1;if(void 0===this.strings){if(t===Pt)return;if(o=!Dt(t)||t!==this._committedValue&&t!==Pt,!o)return;this._committedValue=t,n=t}else{const r=t,s=this._committedValue;n=this.strings[0];for(let t=0;t<this.strings.length-1;t++){let i=r[e+t];i===Pt&&(i=s[t]),o=o||!Dt(i)||i!==s[t],i===xt?n=xt:n!==xt&&(n=n+(i??"")+this.strings[t+1]),s[t]=i}if(!o)return}this._commitValue(n)}_commitValue(t){t===xt||null==t?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,String(t))}clear(){this.element.removeAttribute(this.name)}}class Vt extends qt{constructor(t,e){super(),this._committedValue=Rt,this.element=t,this.name=e}commit(t){t!==Pt&&t!==this._committedValue&&(this._committedValue=t,this.element[this.name]=t===xt?void 0:t)}clear(){this.element[this.name]=void 0,this._committedValue=Rt}}class Ut extends qt{constructor(t,e){super(),this._committedValue=Rt,this.element=t,this.name=e}commit(t){if(t===Pt)return;const e=!!t&&t!==xt;e!==this._committedValue&&(this._committedValue=e,e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name))}clear(){this.element.removeAttribute(this.name),this._committedValue=Rt}}class zt extends qt{constructor(t,e){super(),this.listener=null,this.value=void 0,this.keyFilter=null,this.host=null,this.element=t;const n=["keydown","keyup","keypress"].includes(e.split(".")[0].split(":")[0]),o=e.indexOf("."),r=n?e.indexOf(":"):-1,s=o>0&&r>0?Math.min(o,r):Math.max(o,r);if(s>0){const t=e.substring(0,s),n=e.substring(s+1);this.eventName=t,this.keyFilter=Ht(n)}else this.eventName=e}commit(t){if(t===Pt)return;if(t===xt&&(t=null),t===this.value&&null!=t)return;if(this.listener&&(this.element.removeEventListener(this.eventName,this.listener),this.listener=null),this.value=t,null==t)return;if("function"!=typeof t)return;if(!this.host){const t=this.element.getRootNode();this.host=t.host||null}const e=this.host||null,n=this.keyFilter;this.listener=o=>{n&&!Kt(o,n)||t.call(e,o)},this.element.addEventListener(this.eventName,this.listener)}clear(){this.listener&&(this.element.removeEventListener(this.eventName,this.listener),this.listener=null)}}function Ht(t){const e=t.startsWith("~");e&&(t=t.substring(1));const n=t.split("+"),o={key:"",anyModifiers:e};for(const t of n){const e=t.toLowerCase();"ctrl"===e||"control"===e?o.ctrl=!0:"alt"===e?o.alt=!0:"shift"===e?o.shift=!0:"meta"===e||"cmd"===e||"command"===e?o.meta=!0:o.key=Wt(t)}return o}function Wt(t){return{esc:"Escape",escape:"Escape",enter:"Enter",return:"Enter",space:" ",spacebar:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight",delete:"Delete",del:"Delete",backspace:"Backspace",tab:"Tab",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"}[t.toLowerCase()]||t}function Kt(t,e){if(t.key!==e.key)return!1;if(e.anyModifiers)return!0;const n=e.ctrl?t.ctrlKey:!t.ctrlKey,o=e.alt?t.altKey:!t.altKey,r=e.shift?t.shiftKey:!t.shiftKey,s=e.meta?t.metaKey:!t.metaKey;return n&&o&&r&&s}const Gt=Symbol("not-set");class Qt extends qt{constructor(t){super(),this.value=Gt,this.childFragment=null;const e=t.parentNode;for(this.startNode=document.createComment("if"),this.endNode=document.createComment("/if"),e.insertBefore(this.startNode,t),e.insertBefore(this.endNode,t.nextSibling);t.firstChild;)e.insertBefore(t.firstChild,this.endNode);e.removeChild(t)}commit(t){const e=Boolean(t);if(this.value!==t)if(this.value=t,e)this.childFragment&&this.childFragment.hasChildNodes()&&this.startNode.parentNode.insertBefore(this.childFragment,this.endNode);else{this.childFragment||(this.childFragment=document.createDocumentFragment());let t=this.startNode.nextSibling;for(;t&&t!==this.endNode;){const e=t.nextSibling;this.childFragment.appendChild(t),t=e}}}clear(){this.childFragment||(this.childFragment=document.createDocumentFragment());let t=this.startNode.nextSibling;for(;t&&t!==this.endNode;){const e=t.nextSibling;this.childFragment.appendChild(t),t=e}}}class Jt extends qt{constructor(t){super(),this.value=Gt,this.branches=new Map,this.defaultBranch=null,this.currentKey=null;const e=t.parentNode;this.startNode=document.createComment("case"),this.endNode=document.createComment("/case"),e.insertBefore(this.startNode,t),e.insertBefore(this.endNode,t.nextSibling);for(const e of Array.from(t.children)){const t=e.tagName.toLowerCase();if("when"===t){const t=e.getAttribute("value")||"",n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);this.branches.set(t,n)}else if("default"===t)for(this.defaultBranch=document.createDocumentFragment();e.firstChild;)this.defaultBranch.appendChild(e.firstChild)}e.removeChild(t)}commit(t){if(this.value===t)return;this.value=t;const e=String(t);this._collectCurrent();const n=this.branches.has(e),o=n?this.branches.get(e):this.defaultBranch;this.currentKey=n?e:this.defaultBranch?"__default__":null,o&&o.hasChildNodes()&&this.startNode.parentNode.insertBefore(o,this.endNode)}_collectCurrent(){if(null===this.currentKey)return;const t="__default__"===this.currentKey?this.defaultBranch:this.branches.get(this.currentKey);if(!t)return;let e=this.startNode.nextSibling;for(;e&&e!==this.endNode;){const n=e.nextSibling;t.appendChild(e),e=n}}clear(){this._collectCurrent(),this.currentKey=null}}const Xt=n("on-handlers");function Yt(t,e){let n=0;return function(...o){const r=Date.now();r-n>=e&&(n=r,t.apply(this,o))}}const Zt=new Set(["scroll","focus","blur","load","unload","error","resize","abort","mouseenter","mouseleave","pointerenter","pointerleave"]);function te(t,e){const n=t.constructor[Xt];if(n&&Array.isArray(n)&&0!==n.length){t[y]?t[y].events?t[y].events.length>0&&ee(t):t[y].events=[]:t[y]={events:[],channels:[],observers:[]};for(const o of n){const n=t[o.methodName];let r=n?n.bind(t):o.method.bind(t);const s=o.options||{},i=["keydown","keyup","keypress"].includes(o.eventName.split(".")[0].split(":")[0]),a=o.eventName.indexOf("."),c=i?o.eventName.indexOf(":"):-1,l=a>0&&c>0?Math.min(a,c):Math.max(a,c),u=l>0?o.eventName.substring(0,l):o.eventName,h=l>0?o.eventName.substring(l+1):null;s.debounce&&s.debounce>0?r=dt(r,s.debounce):s.throttle&&s.throttle>0&&(r=Yt(r,s.throttle));let d=null;h&&["keydown","keyup","keypress"].includes(u)&&(d=Ht(h));const m=(t=>d?e=>{Kt(e,d)&&t(e)}:t)(r);if(o.selector){const n=e.shadowRoot||e,r=t=>{const e=t.target;if(e.matches&&e.matches(o.selector)&&e||e.closest&&e.closest(o.selector)||null){s.preventDefault&&t.preventDefault(),s.stopPropagation&&(t.stopPropagation(),t.stopImmediatePropagation());try{m(t)}catch(t){console.error(`Error in event handler ${o.methodName}:`,t)}}},i=Zt.has(u),a={capture:void 0!==s.capture?s.capture:i,once:s.once||!1,passive:s.passive||!1};n.addEventListener(u,r,a),t[y].events.push({target:n,eventName:u,handler:r,options:a})}else{const n=e.shadowRoot,r=Symbol.for(`snice:event-handled:${o.methodName}`),i=t=>{if(!t[r]){t[r]=!0,s.preventDefault&&t.preventDefault(),s.stopPropagation&&t.stopPropagation();try{m(t)}catch(t){console.error(`Error in event handler ${o.methodName}:`,t)}}},a={capture:s.capture||!1,once:s.once||!1,passive:s.passive||!1};n&&(n.addEventListener(u,i,a),t[y].events.push({target:n,eventName:u,handler:i,options:a})),e.addEventListener(u,i,a),t[y].events.push({target:e,eventName:u,handler:i,options:a})}}}}function ee(t){if(t[y]?.events){for(const{target:e,eventName:n,handler:o,options:r}of t[y].events)e.removeEventListener(n,o,r);t[y].events=[]}}class ne{constructor(){this.cleanupFns=new Map,this.pendingOperations=new Set}register(t,e){this.cleanupFns.set(t,e)}unregister(t){this.cleanupFns.delete(t)}async cleanup(){await Promise.all(this.pendingOperations);for(const t of this.cleanupFns.values())try{await t()}catch(t){console.error("Error during cleanup:",t)}this.cleanupFns.clear()}async runOperation(t){const e=t(),n=e.then(()=>{},()=>{});this.pendingOperations.add(n);try{const t=await e;return this.pendingOperations.delete(n),t}catch(t){throw this.pendingOperations.delete(n),t}}}async function oe(t,n){const o=t[h],s=t[d],i=t[p];if(void 0!==i&&i!==n)return;if(s===n&&o)return;o&&await re(t);const a=globalThis.snice?.controllerRegistry;if(!a)throw new Error("Snice global registry not initialized");const c=a.get(n);if(!c)throw console.error(`Controller "${n}" not found. Available:`,Array.from(a.keys())),new Error(`Controller "${n}" not found in registry`);const l=new c;e.controllerIdCounter+=1;const u=e.controllerIdCounter,y=new ne;l[r]=!0,l[m]=u,l.element=t;const g=t[T];void 0!==g&&(l[T]=g),t[h]=l,t[d]=n,t[f]=y,await t.ready,await y.runOperation(async()=>{await l.attach(t)}),pt(l,t),Nt(l,t),te(l,t),t.dispatchEvent(new CustomEvent("controller-attached",{detail:{name:n,controller:l}}))}async function re(t){const e=t[h],n=t[d],o=t[f];e&&(o?await o.runOperation(async()=>{await e.detach(t)}):await e.detach(t),e.element=null,wt(e),St(e),ee(e),o&&await o.cleanup(),delete e[T],delete t[h],delete t[d],delete t[f],t.dispatchEvent(new CustomEvent("controller-detached",{detail:{name:n,controller:e}})))}function se(){if(globalThis.sniceNativeControllersInitialized)return;function t(t){if(!(t instanceof HTMLElement))return;if(t.tagName.includes("-"))return;if(t[s])return;const e=t.getAttribute("controller"),n=t[p];if(e!==n){if(!e)return delete t[p],delete t[d],void re(t).catch(t=>{console.error("Failed to detach controller from native element:",t)});t[p]=e,t.ready||(t.ready=Promise.resolve()),n&&re(t).catch(t=>{console.error("Failed to detach old controller from native element:",t)}),oe(t,e).catch(t=>{console.error(`Failed to attach controller "${e}" to native element:`,t)})}}globalThis.sniceNativeControllersInitialized=!0;const e=new MutationObserver(e=>{for(const n of e)"attributes"===n.type&&"controller"===n.attributeName?t(n.target):"childList"===n.type&&n.addedNodes.forEach(e=>{e instanceof HTMLElement&&(t(e),e.querySelectorAll('[controller]:not([class*="-"])').forEach(t))})});function n(){document.querySelectorAll('[controller]:not([class*="-"])').forEach(t),e.observe(document.body,{attributes:!0,attributeFilter:["controller"],childList:!0,subtree:!0})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n(),globalThis.sniceNativeControllerObserver=e}const ie=n("context-handlers");function ae(t){const e=t.constructor[ie];if(!e||!Array.isArray(e)||0===e.length)return;const n=t[U];if(n){t[z]=n;for(const o of e){const{methodName:e,method:r,options:s}=o,i=`__wrapped_${e}`;t[i]=function(e){if(s.once&&t[X])return;const n=()=>{if(r.call(t,e),s.once){t[X]=!0;const e=t[z];e&&"function"==typeof e[G]&&e[G](t)}};if(s.debounce)return clearTimeout(t[J]),void(t[J]=setTimeout(n,s.debounce));if(s.throttle){const e=Date.now();return void(e-(t[J]||0)>=s.throttle&&(t[J]=e,n()))}n()},"function"==typeof n[K]&&n[K](t,i)}}}const ce=new class{constructor(){this.pending=new Set,this.scheduled=!1}schedule(t,e){e.sync?ue(t,e):(this.pending.add(t),this.scheduled||(this.scheduled=!0,queueMicrotask(()=>this.flush())))}flush(){const t=Array.from(this.pending);this.pending.clear(),this.scheduled=!1;for(const e of t){ue(e,e[D]||{})}}};function le(t){const e=t[q];if(!e||0===e.length)return;const n=[...e];t[q]=[],n.forEach(t=>t())}function ue(t,e,n){const o=t[P];if(o&&(!e.once||!t[$]))try{const r=void 0!==n?n:o.call(t);if(t.shadowRoot||t.attachShadow({mode:"open"}),!1===e.differential)return"string"!=typeof r?void console.warn("Render method with differential: false must return a string"):(t.shadowRoot.innerHTML=r,void le(t));if(!_t(r))return void console.warn("Render method must return html`` template result");let s=t[$];if(s&&s.isSameTemplate(r.strings))return s.update(r.values),void le(t);s&&(t.shadowRoot.innerHTML=""),s=new Ft(r),t[$]=s,t.shadowRoot.appendChild(s.renderFragment()),s.update(r.values),le(t)}catch(t){console.error("Error rendering element:",t)}}function he(t,e=!1){const n=t[D]||{};if(!n.once||!t[$])if(e)ue(t,n);else{if(void 0!==n.debounce&&n.debounce>0)return t[F]||(t[F]={}),clearTimeout(t[F].debounce),void(t[F].debounce=setTimeout(()=>{ce.schedule(t,n)},n.debounce));if(void 0!==n.throttle&&n.throttle>0){t[F]||(t[F]={lastThrottle:0});const e=t[F],o=Date.now();if(0===e.lastThrottle||o-e.lastThrottle>=n.throttle)return e.lastThrottle=o,void ce.schedule(t,n);if(!e.throttleTimer){const r=n.throttle-(o-e.lastThrottle);e.throttleTimer=setTimeout(()=>{e.throttleTimer=null,e.lastThrottle=Date.now(),ce.schedule(t,n)},r)}return}ce.schedule(t,n)}}function de(t){t.prototype[s]=!0;const e=t.prototype.connectedCallback,n=t.prototype.disconnectedCallback,o=t.prototype.attributeChangedCallback,r=t.observedAttributes||[];r.includes("controller")||r.push("controller");const i=t[g];if(i)for(const[t,e]of i){if(!1===e.attribute)continue;const n=ct(e,t);r.includes(n)||r.push(n)}Object.defineProperty(t,"observedAttributes",{get:()=>r,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get(){return this[a]||(this[a]=new Promise(t=>{this[c]=t})),this[a]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controller",{get(){return this[l]},set(t){const e=this[l];this[l]=t,t!==e&&(t?oe(this,t).catch(e=>{console.error(`Failed to attach controller "${t}":`,e)}):e&&re(this).catch(t=>{console.error("Failed to detach controller:",t)}))},enumerable:!0,configurable:!0}),t.prototype.connectedCallback=async function(){if(this[a]||(this[a]=new Promise(t=>{this[c]=t})),this[u]){te(this,this),Nt(this,this),ae(this);try{pt(this,this)}catch(t){console.error(`Error setting up observers for ${this.tagName} on reconnection:`,t)}return void(e&&e.call(this))}this[w]=!0;const n=t[g];if(n)for(const[t,e]of n){if(!1===e.attribute)continue;const n=ct(e,t);if(!this.hasAttribute(n))continue;const o=this.getAttribute(n);lt(this,S).add(t),e.type===Boolean&&""===o&&this.setAttribute(n,"true"),this[t]=at(o,e)}if(this[v]){for(const[t,e]of Array.from(this[v].entries())){const o=n?.get(t),r=ct(o||{},t);this[v].delete(t),this.hasAttribute(r)||(this[t]=e)}delete this[v]}!function(t){const e=t[B];if(e&&!t[j]){t[j]=!0;try{const n=[],o=t[V];if(o)for(const e of o){const o=e.call(t);At(o)&&n.push(o)}const r=e.call(t);if(!At(r))return void console.warn("Styles method must return css`` template result");if(n.push(r),t.shadowRoot||t.attachShadow({mode:"open"}),!t.shadowRoot)return;if(n.every(t=>!!t.styleSheet)&&"adoptedStyleSheets"in t.shadowRoot)return void(t.shadowRoot.adoptedStyleSheets=n.map(t=>t.styleSheet));for(const e of n){const n=document.createElement("style");n.textContent=e.cssText,t.shadowRoot.appendChild(n)}}catch(t){console.error("Error applying styles:",t)}}}(this),te(this,this),Nt(this,this),ae(this),this[u]=!0,e&&e.call(this);const o=t[A];await new Promise(t=>queueMicrotask(t)),this[P]&&he(this,!0);try{pt(this,this)}catch(t){console.error(`Error setting up observers for ${this.tagName}:`,t)}if(o)for(const t of o)try{await t.method.call(this)}catch(e){console.error(`Error in @ready handler ${t.methodName}:`,e)}this[c]&&(this[c](),this[c]=null)},t.prototype.disconnectedCallback=async function(){const e=t[x];if(e)for(const t of e)try{await t.method.call(this)}catch(e){console.error(`Error in @dispose handler ${t.methodName}:`,e)}n&&n.call(this),this[l]&&re(this).catch(t=>{console.error("Failed to detach controller:",t)}),ee(this),St(this),function(t){const e=t.constructor[ie];if(!e||!Array.isArray(e)||0===e.length)return;for(const n of e)n.options.debounce&&t[J]&&(clearTimeout(t[J]),delete t[J]),delete t[`__wrapped_${n.methodName}`];const n=t[z];n&&"function"==typeof n[G]&&n[G](t),delete t[z],delete t[X]}(this),wt(this)},t.prototype.attributeChangedCallback=function(e,n,r){if(o?.call(this,e,n,r),"controller"===e)return void(this.controller=r);const s=t[g];if(s)for(const[n,o]of s){if(ct(o,n).toLowerCase()!==e.toLowerCase())continue;const s=this[b]?.[n],i=at(r,o,s,void 0);if(s===i)break;lt(this,S).add(n),ut(this,b)[n]=i,this[L]?.has(e.toLowerCase())||(ht(this,t,n,s,i),this[P]&&this[u]&&he(this));break}},t.prototype.connectedMoveCallback=async function(){const e=t[C];if(e)for(const t of e)try{await t.method.call(this)}catch(e){console.error(`Error in @moved handler ${t.methodName}:`,e)}},t.prototype.adoptedCallback=async function(){const e=t[O];if(e)for(const t of e)try{await t.method.call(this)}catch(e){console.error(`Error in @adopted handler ${t.methodName}:`,e)}}}function me(t,e,n,o){if(function(t){let e=Object.getPrototypeOf(t);const n=[];for(;e&&e!==HTMLElement&&e!==Function.prototype;)n.push(e),e=Object.getPrototypeOf(e);n.reverse();for(const e of n){if(e[g]){t[g]||(t[g]=new Map);for(const[n,o]of e[g])t[g].has(n)||t[g].set(n,o)}e.formAssociated&&!t.formAssociated&&(t.formAssociated=!0)}}(e),n.metadata&&n.metadata[g]){e[g]||(e[g]=new Map);for(const[t,o]of n.metadata[g])e[g].set(t,o)}return o?.formAssociated&&(e.formAssociated=!0),de(e),customElements.get(t)?(globalThis.SNICE_DEBUG&&console.warn(`[snice] "${t}" is already registered. Skipping.`),e):(customElements.define(t,e),e)}function fe(t){return!0===t[r]&&t.element?t.element:t}function pe(t,e,n,o,r){const s=o.name;o.addInitializer(function(){const o=this.constructor,i=`__${e}Methods`;o[i]||(o[i]=new Set),o[i].has(n)||(o[i].add(n),o[t]||(o[t]=[]),o[t].push({methodName:s,method:n,...r}))})}function ye(t,e,n){return function(o={}){return function(r,s){pe(t,n,r,s,{options:o});const i=s.name;return function(...t){this[e]||(this[e]=new Map),this[e].has(i)||this[e].set(i,{throttleTimer:null,debounceTimer:null,lastThrottleCall:0});const n=this[e].get(i),s=(...t)=>r.apply(this,t);if(o.debounce>0)return clearTimeout(n.debounceTimer),void(n.debounceTimer=setTimeout(()=>s(...t),o.debounce));if(o.throttle>0){const e=Date.now();if(0===n.lastThrottleCall||e-n.lastThrottleCall>=o.throttle)return n.lastThrottleCall=e,s(...t);if(!n.throttleTimer){const r=o.throttle-(e-n.lastThrottleCall);n.throttleTimer=setTimeout(()=>{n.throttleTimer=null,n.lastThrottleCall=Date.now(),s(...t)},r)}return}return s(...t)}}}}const ge=ye(C,k,"moved"),be=ye(O,I,"adopted");
|
|
13
|
+
*/globalThis.snice||(globalThis.snice={controllerRegistry:new Map,controllerIdCounter:0});const e=globalThis.snice;function n(t){return Symbol.for(`snice:${t}`)}const o=n("is-controller-class"),r=n("is-controller-instance"),s=n("is-element-class"),i=n("channel-handlers"),a=n("ready-promise"),c=n("ready-resolve"),l=n("controller"),u=n("initialized"),h=n("controller-key"),d=n("controller-name"),m=n("controller-id"),f=n("controller-operations"),p=n("native-controller"),y=n("cleanup"),g=n("properties"),b=n("property-values"),v=n("pre-init-property-values"),w=n("properties-initialized"),N=n("property-watchers"),S=n("explicitly-set-properties"),T=n("router-context"),E=n("page-transition"),_=n("created-at"),A=n("ready-handlers"),x=n("dispose-handlers"),C=n("moved-handlers"),O=n("adopted-handlers"),M=n("observers"),L=n("setting-from-property"),k=n("moved-timers"),I=n("adopted-timers"),R=n("dispatch-timers"),P=n("render-method"),D=n("render-options"),$=n("render-instance"),F=n("render-timers"),q=n("render-callbacks"),B=n("styles-method"),j=n("styles-applied"),V=n("parent-styles-methods"),U=n("context-handler"),z=n("navigation-context-instance"),H=n("registered-elements"),W=n("is-updating"),K=n("context-register"),G=n("context-unregister"),Q=n("context-notify-element"),J=n("context-timer"),X=n("context-called"),Y=n("context-update");class Z{static{this.SEPARATOR=","}static serialize(t){return Array.isArray(t)?t.map(t=>{if("string"==typeof t){if(t.includes(Z.SEPARATOR))throw new Error(`SimpleArray strings cannot contain the character "${Z.SEPARATOR}" (U+FF0C)`);return t}if("number"==typeof t||"boolean"==typeof t)return String(t);throw new Error("SimpleArray only supports string, number, and boolean types. Got: "+typeof t)}).join(Z.SEPARATOR):""}static parse(t){return null==t||""===t?[]:t.split(Z.SEPARATOR).map(t=>{if(/^-?\d+\.?\d*$/.test(t)){const e=Number(t);if(!isNaN(e))return e}return"true"===t||"false"!==t&&t})}}var tt,et,nt;const ot=Symbol.for("snice:registered-elements-set");let rt=0;class st{constructor(t={},e=[],n="",o={},r){if(this[tt]=new WeakMap,this[et]=new Set,this[nt]=!1,this.id=rt++,this.application=t,this.navigation={placards:e,route:n,params:o},r&&"function"==typeof r.create)this.fetch=r.create(this);else{if("function"!=typeof fetch)throw new Error("No fetch implementation available");this.fetch=fetch.bind(this)}}[(tt=H,et=ot,nt=W,K)](t,e){this[H].set(t,e),this[ot].add(t)}[G](t){this[H].delete(t),this[ot].delete(t)}[Y](t,e,n,o){this.application=t,this.navigation.placards=e,this.navigation.route=n,this.navigation.params=o,this.notify()}update(){this.notify()}notify(){if(this[W])return;this[W]=!0;const t=this[ot],e=this[H];for(const n of t){const t=e.get(n);if(t&&"function"==typeof n[t])try{n[t](this)}catch(e){console.error(`Error calling @context method ${t}:`,e)}}this[W]=!1}[Q](t){const e=this[H].get(t);e&&"function"==typeof t[e]&&t[e](this)}}function it(t){if(null!=t)return"string"==typeof t?String:"number"==typeof t?Number:"boolean"==typeof t?Boolean:t instanceof Date?Date:"bigint"==typeof t?BigInt:Array.isArray(t)?Array:void 0}function at(t,e,n,o){switch(e.type||it(o)){case Boolean:return null!==t&&"false"!==t;case Number:return null!==t?Number(t):null;case String:return t;case Date:return t?new Date(t):null;case BigInt:return t&&t.endsWith("n")?BigInt(t.slice(0,-1)):t?BigInt(t):null;case Z:return Z.parse(t);case Array:try{return t?JSON.parse(t):[]}catch{return[]}case Object:try{return t?JSON.parse(t):{}}catch{return{}}default:return"number"==typeof n&&null!==t?Number(t):t}}function ct(t,e){return"string"==typeof t.attribute?t.attribute:e.toLowerCase()}function lt(t,e){return t[e]||(t[e]=new Set),t[e]}function ut(t,e){return t[e]||(t[e]={}),t[e]}function ht(t,e,n,o,r){const s=e[N];if(s){if(s.has(n))for(const e of s.get(n))try{e.method.call(t,o,r,n)}catch(t){console.error(`Error in @watch('${n}') method ${e.methodName}:`,t)}if(s.has("*"))for(const e of s.get("*"))try{e.method.call(t,o,r,n)}catch(t){console.error(`Error in @watch('*') method ${e.methodName}:`,t)}}}function dt(t,e){let n=null;return function(...o){null!==n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,o),n=null},e)}}function mt(t,e){let n=0,o=null;return function(...r){const s=Date.now(),i=e-(s-n);if(i<=0)return o&&(clearTimeout(o),o=null),n=s,t.apply(this,r);o||(o=setTimeout(()=>{n=Date.now(),o=null,t.apply(this,r)},i))}}const ft=new Map;function pt(t,e){const n=t.constructor[M];if(n&&Array.isArray(n)&&0!==n.length){t[y]?t[y].observers||(t[y].observers=[]):t[y]={events:[],channels:[],observers:[]};for(const o of n){const n=o.method.bind(t),r=o.options?.throttle?mt(n,o.options.throttle):n;switch(o.type){case"intersection":yt(t,e,o,r);break;case"resize":gt(t,e,o,r);break;case"media":bt(t,e,o,r);break;case"mutation":vt(t,e,o,r);break;default:console.warn(`Unknown observer type: ${o.type}`)}}}}function yt(t,e,n,o){const r={threshold:n.options?.threshold??0,rootMargin:n.options?.rootMargin??"0px",root:n.options?.root??null};if("undefined"==typeof IntersectionObserver)return void console.warn("IntersectionObserver is not available in this environment");const s=new IntersectionObserver(t=>{for(const e of t)try{!1===o(e)&&s&&s.unobserve(e.target)}catch(t){console.error(`Error in intersection observer ${n.methodName}:`,t)}},r),i=n.selector?Array.from(e.shadowRoot?.querySelectorAll(n.selector)||[]):[e];i.forEach(t=>s.observe(t)),t[y].observers.push(()=>{i.forEach(t=>s.unobserve(t)),0===s.takeRecords().length&&s.disconnect()})}function gt(t,e,n,o){const r=n.options?.box||"content-box";if("undefined"==typeof ResizeObserver)return void console.warn("ResizeObserver is not available in this environment");const s=new ResizeObserver(t=>{for(const e of t)try{o(e)}catch(t){console.error(`Error in resize observer ${n.methodName}:`,t)}});(n.selector?Array.from(e.shadowRoot?.querySelectorAll(n.selector)||[]):[e]).forEach(t=>{s.observe(t,{box:r})}),t[y].observers.push(()=>{s.disconnect()})}function bt(t,e,n,o){const r=n.target;if(!r)return void console.warn("Media query observer requires a query string");let s=ft.get(r);if(!s)try{s=window.matchMedia(r),ft.set(r,s)}catch(t){return void console.error(`Invalid media query: ${r}`,t)}const i=t=>{try{o(t.matches)}catch(t){console.error(`Error in media query observer ${n.methodName}:`,t)}};i(s);const a=t=>i(t);s.addEventListener?(s.addEventListener("change",a),t[y].observers.push(()=>{s.removeEventListener("change",a)})):(s.addListener(a),t[y].observers.push(()=>{s.removeListener(a)}))}function vt(t,e,n,o){const s=n.target.split(":"),i=s[0]||"childList",a=s[1],c={};switch(i){case"childList":c.childList=!0;break;case"attributes":c.attributes=!0,a&&(c.attributeFilter=[a]);break;default:return void console.warn(`Unknown mutation type: ${i}`)}n.options?.subtree&&(c.subtree=!0,n.options.maxDepth&&console.warn("maxDepth is set but requires custom implementation"));const l=!(!n.options?.maxDepth||!n.options.subtree),u=new MutationObserver(t=>{try{if(!l)return void o(t);const r=n.options.maxDepth,s=e.shadowRoot||e,i=t.filter(t=>{let e=0,n=t.target;for(;n&&n!==s&&e<r;)n=n.parentNode,e++;return e<r});i.length>0&&o(i)}catch(t){console.error(`Error in mutation observer ${n.methodName}:`,t)}}),h=!0===t[r];(n.selector?Array.from(e.shadowRoot?.querySelectorAll(n.selector)||[]):h&&e.shadowRoot?[e.shadowRoot]:[e]).forEach(t=>{u.observe(t,c)}),t[y].observers.push(()=>{u.disconnect()})}function wt(t){if(t[y]?.observers){for(const e of t[y].observers)e();t[y].observers=[]}}function Nt(t,e){const n=t.constructor[i];if(n){t[y]||(t[y]={events:[],channels:[]});for(const o of n){const n=o.method.bind(t),r=`@request/${o.channelName}`;let s,i,a=0;const c=(t=>o.options?.debounce?(...e)=>new Promise((n,r)=>{clearTimeout(s),s=setTimeout(async()=>{try{n(await t(...e))}catch(t){r(t)}},o.options.debounce)}):o.options?.throttle?(...e)=>{const n=Date.now(),r=o.options.throttle-(n-a);return r<=0?(clearTimeout(i),a=n,t(...e)):i?Promise.resolve(void 0):new Promise((n,o)=>{i=setTimeout(async()=>{a=Date.now(),i=null;try{n(await t(...e))}catch(t){o(t)}},r)})}:t)(n),l=t=>{const{data:e,discovery:n,payload:r}=t.detail;t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation(),n.resolve(),Promise.resolve(c(r)).then(t=>{e.resolve(t)}).catch(t=>{e.reject(t),console.error(`Error in response handler ${o.methodName}:`,t)})};e.addEventListener(r,l),t[y].channels.push(()=>{e.removeEventListener(r,l)})}}}function St(t){if(t[y]?.channels){for(const e of t[y].channels)e();t[y].channels=[]}}const Tt=Symbol.for("snice:html-result"),Et=Symbol.for("snice:css-result");function _t(t){return t&&t._$litType$===Tt}function At(t){return t&&t._$litType$===Et}const xt=Symbol.for("snice:nothing"),Ct=Symbol.for("snice:unsafe-html");const Ot=`snice$${Math.random().toFixed(9).slice(2)}$`,Mt="?"+Ot,Lt=`<${Mt}>`,kt=new RegExp(Ot,"g"),It=new WeakMap,Rt=Symbol("not-committed"),Pt=Symbol.for("snice:no-change"),Dt=t=>null===t||"object"!=typeof t&&"function"!=typeof t;class $t{constructor(t,e,n){this.parts=[],this.element=e;const o=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let r=0;const s=[];let i;for(;null!==(i=o.nextNode());)if(i.nodeType===Node.ELEMENT_NODE){const t=i,e=t.tagName.toLowerCase();if("if"===e){const e=t.getAttribute("value");e&&e.includes(Ot)&&(t.removeAttribute("value"),this.parts.push({type:"conditional-if",index:r++,element:t}));continue}if("case"===e){const e=t.getAttribute("value");e&&e.includes(Ot)&&(t.removeAttribute("value"),this.parts.push({type:"conditional-case",index:r++,element:t}));continue}if(t.hasAttributes()){const e=t.attributes,o=[];for(let s=0;s<e.length;s++){const i=e[s],a=i.value;if(a.includes(Ot)){o.push(i);const e=n[r]||i.name,s=a.split(Ot),c=s.length-1;e.startsWith("@@")||e.startsWith("@")?(this.parts.push({type:"event",index:r,name:e.slice(1),element:t}),r+=1):e.startsWith(".")?(this.parts.push({type:"property",index:r,name:e.slice(1),element:t}),r+=1):e.startsWith("?")?(this.parts.push({type:"boolean-attribute",index:r,name:e.slice(1),element:t}),r+=1):(this.parts.push({type:"attribute",index:r,name:i.name,element:t,attrStrings:s}),r+=c)}}for(const e of o)t.removeAttribute(e.name)}}else if(i.nodeType===Node.COMMENT_NODE){const t=i;if(t.data===Mt){const e=t.parentNode,n=document.createComment("");e.insertBefore(n,t.nextSibling),this.parts.push({type:"node",index:r++,startNode:t,endNode:n})}}else if(i.nodeType===Node.TEXT_NODE){const t=i,e=t.data;if(e.includes(Ot)){const n=t.parentNode,o=e.split(kt),i=o.length-1;for(let e=0;e<i;e++){n.insertBefore(document.createTextNode(o[e]),t);const s=document.createComment(""),i=document.createComment("");n.insertBefore(s,t),n.insertBefore(i,t),this.parts.push({type:"node",index:r++,startNode:s,endNode:i})}""!==o[i]?t.data=o[i]:s.push(t)}}for(const t of s)t.parentNode?.removeChild(t)}}class Ft{constructor(t){this.parts=[],this.fragment=null,this.conditionalParts=[],this.regularParts=[],this.template=function(t){const{strings:e}=t,n=It.get(e);if(n)return n;const o=[],r=[];let s=!1,i=!1,a="",c="";for(let t=0;t<e.length;t++){const n=e[t];if(o.push(n),t<e.length-1){for(let t=0;t<n.length;t++){const e=n[t];if(s){if(i)e===a&&(i=!1,a="");else if(">"===e)s=!1;else if('"'===e||"'"===e)i=!0,a=e;else if("="===e){let e=t-1;for(;e>=0&&/[\w\-\.@\?]/.test(n[e]);)e--;c=n.substring(e+1,t).trim()}}else"<"===e&&(s=!0)}if(i)r.push(c),o.push(Ot);else if(s){const t=n.trimEnd();if(t.endsWith("=")){let e=t.length-2;for(;e>=0&&/[\w\-\.@\?\/]/.test(t[e]);)e--;c=t.substring(e+1,t.length-1).trim(),r.push(c),o.push(Ot)}else n.match(/<(if|case)\s*$/)?(c="value",r.push("value"),o.push(`value="${Ot}"`)):(r.push(""),o.push(Ot))}else r.push(""),o.push(Lt)}}const l=o.join(""),u=document.createElement("template");u.innerHTML=l;const h=new $t(t,u,r);return It.set(e,h),h}(t),this.strings=t.strings}isSameTemplate(t){return this.strings===t}renderFragment(){if(!this.fragment){this.fragment=this.template.element.content.cloneNode(!0);const t=document.createTreeWalker(this.template.element.content,NodeFilter.SHOW_ALL),e=document.createTreeWalker(this.fragment,NodeFilter.SHOW_ALL),n=new Map;let o=t.currentNode,r=e.currentNode;for(;o&&r;)n.set(o,r),o=t.nextNode(),r=e.nextNode();for(let t=0;t<this.template.parts.length;t++){const e=this.template.parts[t];let o;switch(e.type){case"node":const t=n.get(e.startNode),r=n.get(e.endNode);o=new Bt(t,r);break;case"attribute":const s=n.get(e.element);o=new jt(s,e.name,e.attrStrings);break;case"property":const i=n.get(e.element);o=new Vt(i,e.name);break;case"boolean-attribute":const a=n.get(e.element);o=new Ut(a,e.name);break;case"event":const c=n.get(e.element);o=new zt(c,e.name);break;case"conditional-if":const l=n.get(e.element);o=new Qt(l);break;case"conditional-case":const u=n.get(e.element);o=new Jt(u);break;default:throw new Error(`Unknown part type: ${e.type}`)}this.parts.push(o),o instanceof Qt||o instanceof Jt?this.conditionalParts.push({part:o,index:e.index}):this.regularParts.push({part:o,index:e.index})}}return this.fragment}render(t){const e=this.renderFragment();return this.update(t),e}update(t){for(const{part:e,index:n}of this.conditionalParts)e.commit(t[n]);for(const{part:e,index:n}of this.regularParts)e instanceof jt&&void 0!==e.strings?e.commit(t,n):e.commit(t[n])}clear(){for(const t of this.parts)t.clear()}}class qt{}class Bt extends qt{constructor(t,e){super(),this._committedValue=Rt,this.startNode=t,this.endNode=e}commit(t){if(t!==Pt)return t===xt||null==t||""===t?(this._committedValue!==xt&&this._clear(),void(this._committedValue=xt)):void(Dt(t)?t!==this._committedValue&&this._commitText(t):_t(t)?this._commitTemplateResult(t):!function(t){return t&&t._$litType$===Ct}(t)?void 0===t.nodeType?(t=>Array.isArray(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t):this._commitNode(t):this._commitUnsafeHTML(t))}_commitText(t){if(this._committedValue!==Rt&&this._committedValue!==xt&&Dt(this._committedValue)&&!Array.isArray(this._committedValue)){const e=this.startNode.nextSibling;if(e&&e.nodeType===Node.TEXT_NODE)return e.data=String(t),void(this._committedValue=t)}this._clear(),this._insertBefore(document.createTextNode(String(t))),this._committedValue=t}_commitTemplateResult(t){const e=this._committedValue;if(e instanceof Ft){const n=It.get(t.strings);if(n&&e.template===n)return void e.update(t.values)}this._clear();const n=new Ft(t),o=n.renderFragment();this._insertBefore(o),n.update(t.values),this._committedValue=n}_commitIterable(t){Array.isArray(this._committedValue)&&this._committedValue[0]instanceof Bt||(this._clear(),this._committedValue=[]);const e=this._committedValue;let n=0;for(const o of t){let t;if(n>=e.length){const n=document.createComment(""),o=document.createComment("");this._insertBefore(n),this._insertBefore(o),t=new Bt(n,o),e.push(t)}else t=e[n];t.commit(o),n++}if(n<e.length){for(let t=n;t<e.length;t++){const n=e[t];n._clear(),n.startNode.remove(),n.endNode.remove()}e.length=n}}_commitNode(t){this._committedValue!==t&&(this._clear(),this._insertBefore(t),this._committedValue=t)}_commitUnsafeHTML(t){this._clear();const e=document.createElement("template");e.innerHTML=t.html,this._insertBefore(e.content),this._committedValue=t}_insertBefore(t){this.endNode.parentNode?.insertBefore(t,this.endNode)}_clear(){const t=this.startNode.parentNode;if(!t)return;let e=this.startNode.nextSibling;for(;e&&e!==this.endNode;){const n=e.nextSibling;t.removeChild(e),e=n}this._committedValue=xt}clear(){this._clear()}}class jt extends qt{constructor(t,e,n){super(),this._committedValue=Rt,this.element=t,this.name=e,n&&(n.length>2||""!==n[0]||""!==n[1])?(this._committedValue=new Array(n.length-1).fill(Rt),this.strings=n):this._committedValue=Rt}commit(t,e=0){let n,o=!1;if(void 0===this.strings){if(t===Pt)return;if(o=!Dt(t)||t!==this._committedValue&&t!==Pt,!o)return;this._committedValue=t,n=t}else{const r=t,s=this._committedValue;n=this.strings[0];for(let t=0;t<this.strings.length-1;t++){let i=r[e+t];i===Pt&&(i=s[t]),o=o||!Dt(i)||i!==s[t],i===xt?n=xt:n!==xt&&(n=n+(i??"")+this.strings[t+1]),s[t]=i}if(!o)return}this._commitValue(n)}_commitValue(t){t===xt||null==t?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,String(t))}clear(){this.element.removeAttribute(this.name)}}class Vt extends qt{constructor(t,e){super(),this._committedValue=Rt,this.element=t,this.name=e}commit(t){t!==Pt&&t!==this._committedValue&&(this._committedValue=t,this.element[this.name]=t===xt?void 0:t)}clear(){this.element[this.name]=void 0,this._committedValue=Rt}}class Ut extends qt{constructor(t,e){super(),this._committedValue=Rt,this.element=t,this.name=e}commit(t){if(t===Pt)return;const e=!!t&&t!==xt;e!==this._committedValue&&(this._committedValue=e,e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name))}clear(){this.element.removeAttribute(this.name),this._committedValue=Rt}}class zt extends qt{constructor(t,e){super(),this.listener=null,this.value=void 0,this.keyFilter=null,this.host=null,this.element=t;const n=["keydown","keyup","keypress"].includes(e.split(".")[0].split(":")[0]),o=e.indexOf("."),r=n?e.indexOf(":"):-1,s=o>0&&r>0?Math.min(o,r):Math.max(o,r);if(s>0){const t=e.substring(0,s),n=e.substring(s+1);this.eventName=t,this.keyFilter=Ht(n)}else this.eventName=e}commit(t){if(t===Pt)return;if(t===xt&&(t=null),t===this.value&&null!=t)return;if(this.listener&&(this.element.removeEventListener(this.eventName,this.listener),this.listener=null),this.value=t,null==t)return;if("function"!=typeof t)return;if(!this.host){const t=this.element.getRootNode();this.host=t.host||null}const e=this.host||null,n=this.keyFilter;this.listener=o=>{n&&!Kt(o,n)||t.call(e,o)},this.element.addEventListener(this.eventName,this.listener)}clear(){this.listener&&(this.element.removeEventListener(this.eventName,this.listener),this.listener=null)}}function Ht(t){const e=t.startsWith("~");e&&(t=t.substring(1));const n=t.split("+"),o={key:"",anyModifiers:e};for(const t of n){const e=t.toLowerCase();"ctrl"===e||"control"===e?o.ctrl=!0:"alt"===e?o.alt=!0:"shift"===e?o.shift=!0:"meta"===e||"cmd"===e||"command"===e?o.meta=!0:o.key=Wt(t)}return o}function Wt(t){return{esc:"Escape",escape:"Escape",enter:"Enter",return:"Enter",space:" ",spacebar:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight",delete:"Delete",del:"Delete",backspace:"Backspace",tab:"Tab",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"}[t.toLowerCase()]||t}function Kt(t,e){if(t.key!==e.key)return!1;if(e.anyModifiers)return!0;const n=e.ctrl?t.ctrlKey:!t.ctrlKey,o=e.alt?t.altKey:!t.altKey,r=e.shift?t.shiftKey:!t.shiftKey,s=e.meta?t.metaKey:!t.metaKey;return n&&o&&r&&s}const Gt=Symbol("not-set");class Qt extends qt{constructor(t){super(),this.value=Gt,this.childFragment=null;const e=t.parentNode;for(this.startNode=document.createComment("if"),this.endNode=document.createComment("/if"),e.insertBefore(this.startNode,t),e.insertBefore(this.endNode,t.nextSibling);t.firstChild;)e.insertBefore(t.firstChild,this.endNode);e.removeChild(t)}commit(t){const e=Boolean(t);if(this.value!==t)if(this.value=t,e)this.childFragment&&this.childFragment.hasChildNodes()&&this.startNode.parentNode.insertBefore(this.childFragment,this.endNode);else{this.childFragment||(this.childFragment=document.createDocumentFragment());let t=this.startNode.nextSibling;for(;t&&t!==this.endNode;){const e=t.nextSibling;this.childFragment.appendChild(t),t=e}}}clear(){this.childFragment||(this.childFragment=document.createDocumentFragment());let t=this.startNode.nextSibling;for(;t&&t!==this.endNode;){const e=t.nextSibling;this.childFragment.appendChild(t),t=e}}}class Jt extends qt{constructor(t){super(),this.value=Gt,this.branches=new Map,this.defaultBranch=null,this.currentKey=null;const e=t.parentNode;this.startNode=document.createComment("case"),this.endNode=document.createComment("/case"),e.insertBefore(this.startNode,t),e.insertBefore(this.endNode,t.nextSibling);for(const e of Array.from(t.children)){const t=e.tagName.toLowerCase();if("when"===t){const t=e.getAttribute("value")||"",n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);this.branches.set(t,n)}else if("default"===t)for(this.defaultBranch=document.createDocumentFragment();e.firstChild;)this.defaultBranch.appendChild(e.firstChild)}e.removeChild(t)}commit(t){if(this.value===t)return;this.value=t;const e=String(t);this._collectCurrent();const n=this.branches.has(e),o=n?this.branches.get(e):this.defaultBranch;this.currentKey=n?e:this.defaultBranch?"__default__":null,o&&o.hasChildNodes()&&this.startNode.parentNode.insertBefore(o,this.endNode)}_collectCurrent(){if(null===this.currentKey)return;const t="__default__"===this.currentKey?this.defaultBranch:this.branches.get(this.currentKey);if(!t)return;let e=this.startNode.nextSibling;for(;e&&e!==this.endNode;){const n=e.nextSibling;t.appendChild(e),e=n}}clear(){this._collectCurrent(),this.currentKey=null}}const Xt=n("on-handlers");function Yt(t,e){let n=0;return function(...o){const r=Date.now();r-n>=e&&(n=r,t.apply(this,o))}}const Zt=new Set(["scroll","focus","blur","load","unload","error","resize","abort","mouseenter","mouseleave","pointerenter","pointerleave"]);function te(t,e){const n=t.constructor[Xt];if(n&&Array.isArray(n)&&0!==n.length){t[y]?t[y].events?t[y].events.length>0&&ee(t):t[y].events=[]:t[y]={events:[],channels:[],observers:[]};for(const o of n){const n=t[o.methodName];let r=n?n.bind(t):o.method.bind(t);const s=o.options||{},i=["keydown","keyup","keypress"].includes(o.eventName.split(".")[0].split(":")[0]),a=o.eventName.indexOf("."),c=i?o.eventName.indexOf(":"):-1,l=a>0&&c>0?Math.min(a,c):Math.max(a,c),u=l>0?o.eventName.substring(0,l):o.eventName,h=l>0?o.eventName.substring(l+1):null;s.debounce&&s.debounce>0?r=dt(r,s.debounce):s.throttle&&s.throttle>0&&(r=Yt(r,s.throttle));let d=null;h&&["keydown","keyup","keypress"].includes(u)&&(d=Ht(h));const m=(t=>d?e=>{Kt(e,d)&&t(e)}:t)(r);if(o.selector){const n=e.shadowRoot||e,r=t=>{const e=t.target;if(e.matches&&e.matches(o.selector)&&e||e.closest&&e.closest(o.selector)||null){s.preventDefault&&t.preventDefault(),s.stopPropagation&&(t.stopPropagation(),t.stopImmediatePropagation());try{m(t)}catch(t){console.error(`Error in event handler ${o.methodName}:`,t)}}},i=Zt.has(u),a={capture:void 0!==s.capture?s.capture:i,once:s.once||!1,passive:s.passive||!1};n.addEventListener(u,r,a),t[y].events.push({target:n,eventName:u,handler:r,options:a})}else{const n=e.shadowRoot,r=Symbol.for(`snice:event-handled:${o.methodName}`),i=t=>{if(!t[r]){t[r]=!0,s.preventDefault&&t.preventDefault(),s.stopPropagation&&t.stopPropagation();try{m(t)}catch(t){console.error(`Error in event handler ${o.methodName}:`,t)}}},a={capture:s.capture||!1,once:s.once||!1,passive:s.passive||!1};n&&(n.addEventListener(u,i,a),t[y].events.push({target:n,eventName:u,handler:i,options:a})),e.addEventListener(u,i,a),t[y].events.push({target:e,eventName:u,handler:i,options:a})}}}}function ee(t){if(t[y]?.events){for(const{target:e,eventName:n,handler:o,options:r}of t[y].events)e.removeEventListener(n,o,r);t[y].events=[]}}class ne{constructor(){this.cleanupFns=new Map,this.pendingOperations=new Set}register(t,e){this.cleanupFns.set(t,e)}unregister(t){this.cleanupFns.delete(t)}async cleanup(){await Promise.all(this.pendingOperations);for(const t of this.cleanupFns.values())try{await t()}catch(t){console.error("Error during cleanup:",t)}this.cleanupFns.clear()}async runOperation(t){const e=t(),n=e.then(()=>{},()=>{});this.pendingOperations.add(n);try{const t=await e;return this.pendingOperations.delete(n),t}catch(t){throw this.pendingOperations.delete(n),t}}}async function oe(t,n){const o=t[h],s=t[d],i=t[p];if(void 0!==i&&i!==n)return;if(s===n&&o)return;o&&await re(t);const a=globalThis.snice?.controllerRegistry;if(!a)throw new Error("Snice global registry not initialized");const c=a.get(n);if(!c)throw console.error(`Controller "${n}" not found. Available:`,Array.from(a.keys())),new Error(`Controller "${n}" not found in registry`);const l=new c;e.controllerIdCounter+=1;const u=e.controllerIdCounter,y=new ne;l[r]=!0,l[m]=u,l.element=t;const g=t[T];void 0!==g&&(l[T]=g),t[h]=l,t[d]=n,t[f]=y,await t.ready,await y.runOperation(async()=>{await l.attach(t)}),pt(l,t),Nt(l,t),te(l,t),t.dispatchEvent(new CustomEvent("controller-attached",{detail:{name:n,controller:l}}))}async function re(t){const e=t[h],n=t[d],o=t[f];e&&(o?await o.runOperation(async()=>{await e.detach(t)}):await e.detach(t),e.element=null,wt(e),St(e),ee(e),o&&await o.cleanup(),delete e[T],delete t[h],delete t[d],delete t[f],t.dispatchEvent(new CustomEvent("controller-detached",{detail:{name:n,controller:e}})))}function se(){if(globalThis.sniceNativeControllersInitialized)return;function t(t){if(!(t instanceof HTMLElement))return;if(t.tagName.includes("-"))return;if(t[s])return;const e=t.getAttribute("controller"),n=t[p];if(e!==n){if(!e)return delete t[p],delete t[d],void re(t).catch(t=>{console.error("Failed to detach controller from native element:",t)});t[p]=e,t.ready||(t.ready=Promise.resolve()),n&&re(t).catch(t=>{console.error("Failed to detach old controller from native element:",t)}),oe(t,e).catch(t=>{console.error(`Failed to attach controller "${e}" to native element:`,t)})}}globalThis.sniceNativeControllersInitialized=!0;const e=new MutationObserver(e=>{for(const n of e)"attributes"===n.type&&"controller"===n.attributeName?t(n.target):"childList"===n.type&&n.addedNodes.forEach(e=>{e instanceof HTMLElement&&(t(e),e.querySelectorAll('[controller]:not([class*="-"])').forEach(t))})});function n(){document.querySelectorAll('[controller]:not([class*="-"])').forEach(t),e.observe(document.body,{attributes:!0,attributeFilter:["controller"],childList:!0,subtree:!0})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n(),globalThis.sniceNativeControllerObserver=e}const ie=n("context-handlers");function ae(t){const e=t.constructor[ie];if(!e||!Array.isArray(e)||0===e.length)return;const n=t[U];if(n){t[z]=n;for(const o of e){const{methodName:e,method:r,options:s}=o,i=`__wrapped_${e}`;t[i]=function(e){if(s.once&&t[X])return;const n=()=>{if(r.call(t,e),s.once){t[X]=!0;const e=t[z];e&&"function"==typeof e[G]&&e[G](t)}};if(s.debounce)return clearTimeout(t[J]),void(t[J]=setTimeout(n,s.debounce));if(s.throttle){const e=Date.now();return void(e-(t[J]||0)>=s.throttle&&(t[J]=e,n()))}n()},"function"==typeof n[K]&&n[K](t,i)}}}const ce=new class{constructor(){this.pending=new Set,this.scheduled=!1}schedule(t,e){e.sync?ue(t,e):(this.pending.add(t),this.scheduled||(this.scheduled=!0,queueMicrotask(()=>this.flush())))}flush(){const t=Array.from(this.pending);this.pending.clear(),this.scheduled=!1;for(const e of t){ue(e,e[D]||{})}}};function le(t){const e=t[q];if(!e||0===e.length)return;const n=[...e];t[q]=[],n.forEach(t=>t())}function ue(t,e,n){const o=t[P];if(o&&(!e.once||!t[$]))try{const r=void 0!==n?n:o.call(t);if(t.shadowRoot||t.attachShadow({mode:"open"}),!1===e.differential)return"string"!=typeof r?void console.warn("Render method with differential: false must return a string"):(t.shadowRoot.innerHTML=r,void le(t));if(!_t(r))return void console.warn("Render method must return html`` template result");let s=t[$];if(s&&s.isSameTemplate(r.strings))return s.update(r.values),void le(t);s&&(t.shadowRoot.innerHTML=""),s=new Ft(r),t[$]=s,t.shadowRoot.appendChild(s.renderFragment()),s.update(r.values),le(t)}catch(t){console.error("Error rendering element:",t)}}function he(t,e=!1){const n=t[D]||{};if(!n.once||!t[$])if(e)ue(t,n);else{if(void 0!==n.debounce&&n.debounce>0)return t[F]||(t[F]={}),clearTimeout(t[F].debounce),void(t[F].debounce=setTimeout(()=>{ce.schedule(t,n)},n.debounce));if(void 0!==n.throttle&&n.throttle>0){t[F]||(t[F]={lastThrottle:0});const e=t[F],o=Date.now();if(0===e.lastThrottle||o-e.lastThrottle>=n.throttle)return e.lastThrottle=o,void ce.schedule(t,n);if(!e.throttleTimer){const r=n.throttle-(o-e.lastThrottle);e.throttleTimer=setTimeout(()=>{e.throttleTimer=null,e.lastThrottle=Date.now(),ce.schedule(t,n)},r)}return}ce.schedule(t,n)}}function de(t){t.prototype[s]=!0;const e=t.prototype.connectedCallback,n=t.prototype.disconnectedCallback,o=t.prototype.attributeChangedCallback,r=t.observedAttributes||[];r.includes("controller")||r.push("controller");const i=t[g];if(i)for(const[t,e]of i){if(!1===e.attribute)continue;const n=ct(e,t);r.includes(n)||r.push(n)}Object.defineProperty(t,"observedAttributes",{get:()=>r,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get(){return this[a]||(this[a]=new Promise(t=>{this[c]=t})),this[a]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controller",{get(){return this[l]},set(t){const e=this[l];this[l]=t,t!==e&&(t?oe(this,t).catch(e=>{console.error(`Failed to attach controller "${t}":`,e)}):e&&re(this).catch(t=>{console.error("Failed to detach controller:",t)}))},enumerable:!0,configurable:!0}),t.prototype.connectedCallback=async function(){if(this[a]||(this[a]=new Promise(t=>{this[c]=t})),this[u]){te(this,this),Nt(this,this),ae(this);try{pt(this,this)}catch(t){console.error(`Error setting up observers for ${this.tagName} on reconnection:`,t)}return void(e&&e.call(this))}this[w]=!0;const n=t[g];if(n)for(const[t,e]of n){if(!1===e.attribute)continue;const n=ct(e,t);if(!this.hasAttribute(n))continue;const o=this.getAttribute(n);lt(this,S).add(t),e.type===Boolean&&""===o&&this.setAttribute(n,"true"),this[t]=at(o,e)}if(this[v]){for(const[t,e]of Array.from(this[v].entries())){const o=n?.get(t),r=ct(o||{},t);this[v].delete(t),this.hasAttribute(r)||(this[t]=e)}delete this[v]}!function(t){const e=t[B];if(e&&!t[j]){t[j]=!0;try{const n=[],o=t[V];if(o)for(const e of o){const o=e.call(t);At(o)&&n.push(o)}const r=e.call(t);if(!At(r))return void console.warn("Styles method must return css`` template result");if(n.push(r),t.shadowRoot||t.attachShadow({mode:"open"}),!t.shadowRoot)return;if(n.every(t=>!!t.styleSheet)&&"adoptedStyleSheets"in t.shadowRoot)return void(t.shadowRoot.adoptedStyleSheets=n.map(t=>t.styleSheet));for(const e of n){const n=document.createElement("style");n.textContent=e.cssText,t.shadowRoot.appendChild(n)}}catch(t){console.error("Error applying styles:",t)}}}(this),te(this,this),Nt(this,this),ae(this),this[u]=!0,e&&e.call(this);const o=t[A];await new Promise(t=>queueMicrotask(t)),this[P]&&he(this,!0);try{pt(this,this)}catch(t){console.error(`Error setting up observers for ${this.tagName}:`,t)}if(await new Promise(t=>queueMicrotask(t)),o)for(const t of o)try{await t.method.call(this)}catch(e){console.error(`Error in @ready handler ${t.methodName}:`,e)}this[c]&&(this[c](),this[c]=null)},t.prototype.disconnectedCallback=async function(){const e=t[x];if(e)for(const t of e)try{await t.method.call(this)}catch(e){console.error(`Error in @dispose handler ${t.methodName}:`,e)}n&&n.call(this),this[l]&&re(this).catch(t=>{console.error("Failed to detach controller:",t)}),ee(this),St(this),function(t){const e=t.constructor[ie];if(!e||!Array.isArray(e)||0===e.length)return;for(const n of e)n.options.debounce&&t[J]&&(clearTimeout(t[J]),delete t[J]),delete t[`__wrapped_${n.methodName}`];const n=t[z];n&&"function"==typeof n[G]&&n[G](t),delete t[z],delete t[X]}(this),wt(this)},t.prototype.attributeChangedCallback=function(e,n,r){if(o?.call(this,e,n,r),"controller"===e)return void(this.controller=r);const s=t[g];if(s)for(const[n,o]of s){if(ct(o,n).toLowerCase()!==e.toLowerCase())continue;const s=this[b]?.[n],i=at(r,o,s,void 0);if(s===i)break;lt(this,S).add(n),ut(this,b)[n]=i,this[L]?.has(e.toLowerCase())||(ht(this,t,n,s,i),this[P]&&this[u]&&he(this));break}},t.prototype.connectedMoveCallback=async function(){const e=t[C];if(e)for(const t of e)try{await t.method.call(this)}catch(e){console.error(`Error in @moved handler ${t.methodName}:`,e)}},t.prototype.adoptedCallback=async function(){const e=t[O];if(e)for(const t of e)try{await t.method.call(this)}catch(e){console.error(`Error in @adopted handler ${t.methodName}:`,e)}}}function me(t,e,n,o){if(function(t){let e=Object.getPrototypeOf(t);const n=[];for(;e&&e!==HTMLElement&&e!==Function.prototype;)n.push(e),e=Object.getPrototypeOf(e);n.reverse();for(const e of n){if(e[g]){t[g]||(t[g]=new Map);for(const[n,o]of e[g])t[g].has(n)||t[g].set(n,o)}e.formAssociated&&!t.formAssociated&&(t.formAssociated=!0)}}(e),n.metadata&&n.metadata[g]){e[g]||(e[g]=new Map);for(const[t,o]of n.metadata[g])e[g].set(t,o)}return o?.formAssociated&&(e.formAssociated=!0),de(e),customElements.get(t)?(globalThis.SNICE_DEBUG&&console.warn(`[snice] "${t}" is already registered. Skipping.`),e):(customElements.define(t,e),e)}function fe(t){return!0===t[r]&&t.element?t.element:t}function pe(t,e,n,o,r){const s=o.name;o.addInitializer(function(){const o=this.constructor,i=`__${e}Methods`;o[i]||(o[i]=new Set),o[i].has(n)||(o[i].add(n),o[t]||(o[t]=[]),o[t].push({methodName:s,method:n,...r}))})}function ye(t,e,n){return function(o={}){return function(r,s){pe(t,n,r,s,{options:o});const i=s.name;return function(...t){this[e]||(this[e]=new Map),this[e].has(i)||this[e].set(i,{throttleTimer:null,debounceTimer:null,lastThrottleCall:0});const n=this[e].get(i),s=(...t)=>r.apply(this,t);if(o.debounce>0)return clearTimeout(n.debounceTimer),void(n.debounceTimer=setTimeout(()=>s(...t),o.debounce));if(o.throttle>0){const e=Date.now();if(0===n.lastThrottleCall||e-n.lastThrottleCall>=o.throttle)return n.lastThrottleCall=e,s(...t);if(!n.throttleTimer){const r=o.throttle-(e-n.lastThrottleCall);n.throttleTimer=setTimeout(()=>{n.throttleTimer=null,n.lastThrottleCall=Date.now(),s(...t)},r)}return}return s(...t)}}}}const ge=ye(C,k,"moved"),be=ye(O,I,"adopted");
|
|
14
14
|
/*!
|
|
15
15
|
* pica-route v1.1.2
|
|
16
16
|
* A pure URL pattern matching library compatible with route-parser API
|
|
@@ -19,14 +19,14 @@ var Snice=function(t){"use strict";
|
|
|
19
19
|
*/
|
|
20
20
|
class ve{constructor(t){this.parsed=this.parsePattern(t)}get spec(){return this.parsed.template}parsePattern(t){let e=t,n="",o=!1;const r=t.indexOf("?");return-1!==r&&(e=t.slice(0,r),n=t.slice(r+1),e.endsWith("(")&&n.endsWith(")")&&(o=!0,e=e.slice(0,-1),n=n.slice(0,-1))),{pathSegments:this.parseSegments(e),querySegments:n?this.parseQuerySegments(n):[],queryOptional:o,template:t}}parseSegments(t){const e=[];let n=0;for(;n<t.length;){switch(t[n]){case"(":const{segments:o,endIndex:r}=this.parseOptionalGroup(t,n);e.push({type:"optional",segments:o}),n=r+1;break;case":":const{name:s,endIndex:i}=this.parseIdentifier(t,n+1);e.push({type:"param",name:s}),n=i;break;case"*":const{name:a,endIndex:c}=this.parseIdentifier(t,n+1);e.push({type:"splat",name:a}),n=c;break;default:const{value:l,endIndex:u}=this.parseLiteral(t,n);l&&e.push({type:"literal",value:l}),n=u}}return e}parseOptionalGroup(t,e){let n=1,o=e+1;for(;o<t.length&&n>0;)"("===t[o]&&n++,")"===t[o]&&n--,o++;const r=t.slice(e+1,o-1);return{segments:this.parseSegments(r),endIndex:o-1}}parseIdentifier(t,e){let n=e;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;return{name:t.slice(e,n),endIndex:n}}parseLiteral(t,e){let n=e;for(;n<t.length&&!"(:*(".includes(t[n]);)n++;return{value:t.slice(e,n),endIndex:n}}parseQuerySegments(t){let e=t;e.startsWith("(")&&e.endsWith(")")&&(e=e.slice(1,-1));const n=[];let o=0;for(;o<e.length;)if(":"===e[o]){const{name:t,endIndex:r}=this.parseIdentifier(e,o+1);n.push({type:"param",name:t}),o=r}else{const{value:t,endIndex:r}=this.parseQueryLiteral(e,o);t&&n.push({type:"literal",value:t}),o=r}return n}parseQueryLiteral(t,e){let n=e;for(;n<t.length&&":"!==t[n];)n++;return{value:t.slice(e,n),endIndex:n}}getAllParamNames(){const t=new Set,e=n=>{for(const o of n)switch(o.type){case"param":case"splat":t.add(o.name);break;case"optional":e(o.segments)}};return e(this.parsed.pathSegments),e(this.parsed.querySegments),Array.from(t)}canMatchRemainingSegments(t,e,n){let o=e;for(const e of n)if("literal"===e.type){const n=t.indexOf(e.value,o);if(-1===n)return!1;o=n+e.value.length}return!0}match(t){const[e,n]=t.split("?"),o=this.matchPath(e,this.parsed.pathSegments);if(!1===o)return!1;const r=this.matchQuery(n||"",this.parsed.querySegments);if(!1===r)return!1;const s=this.getAllParamNames(),i={};for(const t of s)i[t]=void 0;return Object.assign(i,o,r),i}matchPath(t,e){const n={};let o=0;for(let r=0;r<e.length;r++){const s=e[r],i=e.slice(r+1),a=this.matchSegment(t,o,s,i);if(!1===a)return!1;Object.assign(n,a.params),o=a.nextIndex}return!(o<t.length)&&n}matchSegment(t,e,n,o=[]){switch(n.type){case"literal":return t.slice(e,e+n.value.length)===n.value&&{params:{},nextIndex:e+n.value.length};case"param":{let r=e;const s=o[0];let i,a=["/","?"];if(s&&"literal"===s.type){const n=s.value,o=t.indexOf(n,e);if(-1===o)return!1;r=o}else for(;r<t.length&&!a.includes(t[r]);)r++;if(r===e)return!1;try{i=decodeURIComponent(t.slice(e,r))}catch(n){i=t.slice(e,r)}return!(r<t.length&&"?"===t[r]&&o.length>0)&&{params:{[n.name]:i},nextIndex:r}}case"splat":{let r=t.length;const s=o[0];if(s)switch(s.type){case"literal":if("."===s.value){const n=t.indexOf(".",e);-1!==n&&(r=n)}else{const n=t.lastIndexOf(s.value);-1!==n&&n>=e&&(r=n)}break;case"param":let n=-1;for(let o=t.length-1;o>=e;o--)if("/"===t[o]){n=o;break}-1!==n&&(r=n);break;case"splat":let o=-1;for(let n=t.length-1;n>e;n--)if("/"===t[n]){o=n+1;break}if(-1!==o)r=o;else{const n=t.slice(e).split("/").filter(t=>t);r=n.length>1?e+n.slice(0,-1).join("/").length+1:e}break;case"optional":const i=t=>{for(const e of t){if("literal"===e.type)return e.value;if("optional"===e.type){const t=i(e.segments);if(t)return t}}return null},a=i(s.segments);if(a){const n=t.lastIndexOf(a);-1!==n&&n>=e&&(r=n)}}const i=t.indexOf("?",e);let a;-1!==i&&i<r&&(r=i);try{a=decodeURIComponent(t.slice(e,r))}catch(n){a=t.slice(e,r)}return{params:{[n.name]:a},nextIndex:r}}case"optional":{let r=e,s={},i=!0;for(let e=0;e<n.segments.length;e++){const o=n.segments[e],a=n.segments.slice(e+1),c=this.matchSegment(t,r,o,a);if(!1===c){i=!1;break}Object.assign(s,c.params),r=c.nextIndex}if(i){if(this.canMatchRemainingSegments(t,r,o))return{params:s,nextIndex:r}}return{params:{},nextIndex:e}}default:return!1}}findNextLiteral(t){for(const e of t){if("literal"===e.type)return e;if("optional"===e.type){const t=this.findNextLiteral(e.segments);if(t)return t}}return null}matchQuery(t,e){if(0===e.length)return{};const n={};let o=0;for(const r of e)switch(r.type){case"literal":if(t.slice(o,o+r.value.length)!==r.value)return!1;o+=r.value.length;break;case"param":{let e,s=o;for(;s<t.length&&"&"!==t[s];)s++;if(s===o)return!1;try{e=decodeURIComponent(t.slice(o,s))}catch(n){e=t.slice(o,s)}n[r.name]=e,o=s;break}}return n}reverse(t={}){const e=this.reverseSegments(this.parsed.pathSegments,t);if(!1===e)return!1;let n=e;if(this.parsed.querySegments.length>0){const e=this.reverseSegments(this.parsed.querySegments,t);if(!this.parsed.queryOptional&&!1===e)return!1;e&&""!==e&&(n+="?"+e)}return n}reverseSegments(t,e,n=!1){let o="";for(let r=0;r<t.length;r++){const s=t[r],i=t.slice(r+1);switch(s.type){case"literal":o+=s.value;break;case"param":case"splat":if(!(s.name in e))return!1;o+=String(e[s.name]);break;case"optional":if(this.hasAllParams(s.segments,e,n)||this.hasLaterOptionalGroupNeedingParams(i,e,s.segments)){const t=this.reverseSegments(s.segments,e,!0);if(!1===t)return!1;o+=t}}}return o}hasLaterOptionalGroupNeedingParams(t,e,n){for(const o of t)if("optional"===o.type&&this.hasAnyParamInSegments(o.segments,e))return this.hasOnlyLiteralsAndOptionals(n);return!1}hasOnlyLiteralsAndOptionals(t){for(const e of t)if("param"===e.type||"splat"===e.type)return!1;return!0}hasAllParams(t,e,n=!1){let o=!1,r=!1,s=!1,i=!0;for(const n of t)switch(n.type){case"param":case"splat":i=!1,n.name in e&&void 0!==e[n.name]?o=!0:s=!0}const a=n||o&&!s;for(const n of t)if("optional"===n.type){this.hasAllParams(n.segments,e,a)&&(r=!0)}return!(!o||s)||(!(!r||s)||!(!i||!n))}hasOnlyOptionalMissingParams(t,e){for(const n of t)switch(n.type){case"param":case"splat":if(!(n.name in e))return!1}return!0}hasAnyParamInSegments(t,e){for(const n of t)switch(n.type){case"param":case"splat":if(n.name in e)return!0;break;case"optional":if(this.hasAnyParamInSegments(n.segments,e))return!0}return!1}}function we(t){const e={};return t.split(";").forEach(t=>{const[n,o]=t.split(":").map(t=>t.trim());n&&o&&(e[n]=o)}),e}var Ne,Se;function Te(t,e,n,o){if(t.style.position="absolute",t.style.width="100%",e)return t.style.height="100%",void(t.style.transition=`opacity ${n}ms ease-in-out`);t.style.top="0",t.style.left="0",t.style.transition=`${o} ${n}ms ease-in-out`}!function(t){t.SEQUENTIAL="sequential",t.SIMULTANEOUS="simultaneous"}(Ne||(Ne={})),function(t){t.SUCCESS="success",t.GUARDS_FAILED="guards-failed",t.NOT_FOUND="not-found"}(Se||(Se={}));let Ee=!1;async function _e(t,e=500){if(customElements.get(t))return;let n=null;Ee||(n=setTimeout(()=>{console.warn(`Custom element <${t}> is taking longer than ${e}ms to register. This may indicate a missing import or circular dependency. Set DISABLE_ELEMENT_READY_WARNINGS=true to disable this warning.`)},e));try{await customElements.whenDefined(t)}finally{n&&clearTimeout(n)}}async function Ae(t,e=500){const n=t.tagName.toLowerCase();await _e(n,e),"ready"in t&&"function"==typeof t.ready?.then&&await t.ready}const xe=n("debounce-timers"),Ce=n("throttle-timers"),Oe=n("once-called"),Me=n("memoize-cache");
|
|
21
21
|
/*!
|
|
22
|
-
* snice v4.36.
|
|
22
|
+
* snice v4.36.1
|
|
23
23
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
24
24
|
* (c) 2024
|
|
25
25
|
* Released under the MIT License.
|
|
26
26
|
*/
|
|
27
27
|
var Le;return"undefined"!=typeof document&&se(),
|
|
28
28
|
/*!
|
|
29
|
-
* snice v4.36.
|
|
29
|
+
* snice v4.36.1
|
|
30
30
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
31
31
|
* (c) 2024
|
|
32
32
|
* Released under the MIT License.
|