snice 4.12.0 → 4.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/cdn/accordion/snice-accordion.js +1 -1
  2. package/dist/cdn/accordion/snice-accordion.min.js +1 -1
  3. package/dist/cdn/alert/snice-alert.js +1 -1
  4. package/dist/cdn/alert/snice-alert.min.js +1 -1
  5. package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
  6. package/dist/cdn/app-tiles/snice-app-tiles.min.js +1 -1
  7. package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
  8. package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
  9. package/dist/cdn/avatar/snice-avatar.js +1 -1
  10. package/dist/cdn/avatar/snice-avatar.min.js +1 -1
  11. package/dist/cdn/badge/snice-badge.js +1 -1
  12. package/dist/cdn/badge/snice-badge.min.js +1 -1
  13. package/dist/cdn/banner/snice-banner.js +1 -1
  14. package/dist/cdn/banner/snice-banner.min.js +1 -1
  15. package/dist/cdn/book/snice-book.js +1 -1
  16. package/dist/cdn/book/snice-book.min.js +1 -1
  17. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
  18. package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
  19. package/dist/cdn/button/snice-button.js +1 -1
  20. package/dist/cdn/button/snice-button.min.js +1 -1
  21. package/dist/cdn/calendar/snice-calendar.js +1 -1
  22. package/dist/cdn/calendar/snice-calendar.min.js +1 -1
  23. package/dist/cdn/camera/snice-camera.js +1 -1
  24. package/dist/cdn/camera/snice-camera.min.js +1 -1
  25. package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
  26. package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
  27. package/dist/cdn/candlestick/snice-candlestick.js +1 -1
  28. package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
  29. package/dist/cdn/card/snice-card.js +1 -1
  30. package/dist/cdn/card/snice-card.min.js +1 -1
  31. package/dist/cdn/carousel/snice-carousel.js +1 -1
  32. package/dist/cdn/carousel/snice-carousel.min.js +1 -1
  33. package/dist/cdn/chart/snice-chart.js +1 -1
  34. package/dist/cdn/chart/snice-chart.min.js +1 -1
  35. package/dist/cdn/chat/snice-chat.js +1 -1
  36. package/dist/cdn/chat/snice-chat.min.js +1 -1
  37. package/dist/cdn/checkbox/snice-checkbox.js +1 -1
  38. package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
  39. package/dist/cdn/chip/snice-chip.js +1 -1
  40. package/dist/cdn/chip/snice-chip.min.js +1 -1
  41. package/dist/cdn/code-block/snice-code-block.js +1 -1
  42. package/dist/cdn/code-block/snice-code-block.min.js +1 -1
  43. package/dist/cdn/color-display/snice-color-display.js +1 -1
  44. package/dist/cdn/color-display/snice-color-display.min.js +1 -1
  45. package/dist/cdn/color-picker/snice-color-picker.js +1 -1
  46. package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
  47. package/dist/cdn/command-palette/snice-command-palette.js +1 -1
  48. package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
  49. package/dist/cdn/comments/snice-comments.js +1 -1
  50. package/dist/cdn/comments/snice-comments.min.js +1 -1
  51. package/dist/cdn/countdown/snice-countdown.js +1 -1
  52. package/dist/cdn/countdown/snice-countdown.min.js +1 -1
  53. package/dist/cdn/cropper/snice-cropper.js +1 -1
  54. package/dist/cdn/cropper/snice-cropper.min.js +1 -1
  55. package/dist/cdn/date-picker/snice-date-picker.js +1 -1
  56. package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
  57. package/dist/cdn/diff/snice-diff.js +1 -1
  58. package/dist/cdn/diff/snice-diff.min.js +1 -1
  59. package/dist/cdn/divider/snice-divider.js +1 -1
  60. package/dist/cdn/divider/snice-divider.min.js +1 -1
  61. package/dist/cdn/doc/snice-doc.js +1 -1
  62. package/dist/cdn/doc/snice-doc.min.js +1 -1
  63. package/dist/cdn/draw/snice-draw.js +1 -1
  64. package/dist/cdn/draw/snice-draw.min.js +1 -1
  65. package/dist/cdn/drawer/snice-drawer.js +1 -1
  66. package/dist/cdn/drawer/snice-drawer.min.js +1 -1
  67. package/dist/cdn/empty-state/snice-empty-state.js +1 -1
  68. package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
  69. package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
  70. package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
  71. package/dist/cdn/file-upload/snice-file-upload.js +1 -1
  72. package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
  73. package/dist/cdn/flip-card/snice-flip-card.js +1 -1
  74. package/dist/cdn/flip-card/snice-flip-card.min.js +1 -1
  75. package/dist/cdn/flow/snice-flow.js +1 -1
  76. package/dist/cdn/flow/snice-flow.min.js +1 -1
  77. package/dist/cdn/funnel/snice-funnel.js +1 -1
  78. package/dist/cdn/funnel/snice-funnel.min.js +1 -1
  79. package/dist/cdn/gantt/snice-gantt.js +1 -1
  80. package/dist/cdn/gantt/snice-gantt.min.js +1 -1
  81. package/dist/cdn/gauge/snice-gauge.js +1 -1
  82. package/dist/cdn/gauge/snice-gauge.min.js +1 -1
  83. package/dist/cdn/heatmap/snice-heatmap.js +1 -1
  84. package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
  85. package/dist/cdn/image/snice-image.js +1 -1
  86. package/dist/cdn/image/snice-image.min.js +1 -1
  87. package/dist/cdn/input/snice-input.js +1 -1
  88. package/dist/cdn/input/snice-input.min.js +1 -1
  89. package/dist/cdn/kanban/snice-kanban.js +1 -1
  90. package/dist/cdn/kanban/snice-kanban.min.js +1 -1
  91. package/dist/cdn/kpi/snice-kpi.js +1 -1
  92. package/dist/cdn/kpi/snice-kpi.min.js +1 -1
  93. package/dist/cdn/layout/snice-layout.js +1 -1
  94. package/dist/cdn/layout/snice-layout.min.js +1 -1
  95. package/dist/cdn/link/snice-link.js +1 -1
  96. package/dist/cdn/link/snice-link.min.js +1 -1
  97. package/dist/cdn/link-preview/snice-link-preview.js +1 -1
  98. package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
  99. package/dist/cdn/list/snice-list.js +1 -1
  100. package/dist/cdn/list/snice-list.min.js +1 -1
  101. package/dist/cdn/location/snice-location.js +1 -1
  102. package/dist/cdn/location/snice-location.min.js +1 -1
  103. package/dist/cdn/login/snice-login.js +1 -1
  104. package/dist/cdn/login/snice-login.min.js +1 -1
  105. package/dist/cdn/map/snice-map.js +1 -1
  106. package/dist/cdn/map/snice-map.min.js +1 -1
  107. package/dist/cdn/markdown/snice-markdown.js +1 -1
  108. package/dist/cdn/markdown/snice-markdown.min.js +1 -1
  109. package/dist/cdn/masonry/snice-masonry.js +1 -1
  110. package/dist/cdn/masonry/snice-masonry.min.js +1 -1
  111. package/dist/cdn/menu/snice-menu.js +1 -1
  112. package/dist/cdn/menu/snice-menu.min.js +1 -1
  113. package/dist/cdn/modal/snice-modal.js +1 -1
  114. package/dist/cdn/modal/snice-modal.min.js +1 -1
  115. package/dist/cdn/music-player/snice-music-player.js +1 -1
  116. package/dist/cdn/music-player/snice-music-player.min.js +1 -1
  117. package/dist/cdn/nav/snice-nav.js +1 -1
  118. package/dist/cdn/nav/snice-nav.min.js +1 -1
  119. package/dist/cdn/network-graph/snice-network-graph.js +1 -1
  120. package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
  121. package/dist/cdn/notification-center/snice-notification-center.js +1 -1
  122. package/dist/cdn/notification-center/snice-notification-center.min.js +1 -1
  123. package/dist/cdn/org-chart/snice-org-chart.js +1 -1
  124. package/dist/cdn/org-chart/snice-org-chart.min.js +1 -1
  125. package/dist/cdn/pagination/snice-pagination.js +1 -1
  126. package/dist/cdn/pagination/snice-pagination.min.js +1 -1
  127. package/dist/cdn/paint/snice-paint.js +1 -1
  128. package/dist/cdn/paint/snice-paint.min.js +1 -1
  129. package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
  130. package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +1 -1
  131. package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
  132. package/dist/cdn/podcast-player/snice-podcast-player.min.js +1 -1
  133. package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
  134. package/dist/cdn/pricing-table/snice-pricing-table.min.js +1 -1
  135. package/dist/cdn/progress/snice-progress.js +1 -1
  136. package/dist/cdn/progress/snice-progress.min.js +1 -1
  137. package/dist/cdn/qr-code/snice-qr-code.js +1 -1
  138. package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
  139. package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
  140. package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
  141. package/dist/cdn/radio/snice-radio.js +1 -1
  142. package/dist/cdn/radio/snice-radio.min.js +1 -1
  143. package/dist/cdn/rating/snice-rating.js +1 -1
  144. package/dist/cdn/rating/snice-rating.min.js +1 -1
  145. package/dist/cdn/recipe/snice-recipe.js +1 -1
  146. package/dist/cdn/recipe/snice-recipe.min.js +1 -1
  147. package/dist/cdn/runtime/snice-runtime.esm.js +3 -3
  148. package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
  149. package/dist/cdn/runtime/snice-runtime.esm.min.js +3 -3
  150. package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
  151. package/dist/cdn/runtime/snice-runtime.js +3 -3
  152. package/dist/cdn/runtime/snice-runtime.js.map +1 -1
  153. package/dist/cdn/runtime/snice-runtime.min.js +3 -3
  154. package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
  155. package/dist/cdn/sankey/snice-sankey.js +1 -1
  156. package/dist/cdn/sankey/snice-sankey.min.js +1 -1
  157. package/dist/cdn/select/snice-select.js +1 -1
  158. package/dist/cdn/select/snice-select.min.js +1 -1
  159. package/dist/cdn/skeleton/snice-skeleton.js +1 -1
  160. package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
  161. package/dist/cdn/slider/snice-slider.js +1 -1
  162. package/dist/cdn/slider/snice-slider.min.js +1 -1
  163. package/dist/cdn/sortable/snice-sortable.js +1 -1
  164. package/dist/cdn/sortable/snice-sortable.min.js +1 -1
  165. package/dist/cdn/sparkline/snice-sparkline.js +1 -1
  166. package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
  167. package/dist/cdn/spinner/snice-spinner.js +1 -1
  168. package/dist/cdn/spinner/snice-spinner.min.js +1 -1
  169. package/dist/cdn/split-pane/snice-split-pane.js +1 -1
  170. package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
  171. package/dist/cdn/spotlight/snice-spotlight.js +1 -1
  172. package/dist/cdn/spotlight/snice-spotlight.min.js +1 -1
  173. package/dist/cdn/spreadsheet/snice-spreadsheet.js +1 -1
  174. package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +1 -1
  175. package/dist/cdn/stepper/snice-stepper.js +1 -1
  176. package/dist/cdn/stepper/snice-stepper.min.js +1 -1
  177. package/dist/cdn/switch/snice-switch.js +1 -1
  178. package/dist/cdn/switch/snice-switch.min.js +1 -1
  179. package/dist/cdn/table/snice-table.js +1 -1
  180. package/dist/cdn/table/snice-table.min.js +1 -1
  181. package/dist/cdn/tabs/snice-tabs.js +1 -1
  182. package/dist/cdn/tabs/snice-tabs.min.js +1 -1
  183. package/dist/cdn/tag-input/snice-tag-input.js +1 -1
  184. package/dist/cdn/tag-input/snice-tag-input.min.js +1 -1
  185. package/dist/cdn/terminal/snice-terminal.js +1 -1
  186. package/dist/cdn/terminal/snice-terminal.min.js +1 -1
  187. package/dist/cdn/testimonial/snice-testimonial.js +1 -1
  188. package/dist/cdn/testimonial/snice-testimonial.min.js +1 -1
  189. package/dist/cdn/textarea/snice-textarea.js +1 -1
  190. package/dist/cdn/textarea/snice-textarea.min.js +1 -1
  191. package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
  192. package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
  193. package/dist/cdn/timeline/snice-timeline.js +1 -1
  194. package/dist/cdn/timeline/snice-timeline.min.js +1 -1
  195. package/dist/cdn/timer/snice-timer.js +1 -1
  196. package/dist/cdn/timer/snice-timer.min.js +1 -1
  197. package/dist/cdn/toast/snice-toast.js +1 -1
  198. package/dist/cdn/toast/snice-toast.min.js +1 -1
  199. package/dist/cdn/tooltip/snice-tooltip.js +1 -1
  200. package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
  201. package/dist/cdn/tree/snice-tree.js +1 -1
  202. package/dist/cdn/tree/snice-tree.min.js +1 -1
  203. package/dist/cdn/treemap/snice-treemap.js +1 -1
  204. package/dist/cdn/treemap/snice-treemap.min.js +1 -1
  205. package/dist/cdn/video-player/snice-video-player.js +1 -1
  206. package/dist/cdn/video-player/snice-video-player.min.js +1 -1
  207. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
  208. package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
  209. package/dist/cdn/waterfall/snice-waterfall.js +1 -1
  210. package/dist/cdn/waterfall/snice-waterfall.min.js +1 -1
  211. package/dist/cdn/weather/snice-weather.js +1 -1
  212. package/dist/cdn/weather/snice-weather.min.js +1 -1
  213. package/dist/index.cjs +1 -1
  214. package/dist/index.esm.js +1 -1
  215. package/dist/index.iife.js +1 -1
  216. package/dist/symbols.cjs +1 -1
  217. package/dist/symbols.esm.js +1 -1
  218. package/dist/transitions.cjs +1 -1
  219. package/dist/transitions.esm.js +1 -1
  220. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * snice v4.11.0
2
+ * snice v4.12.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
6
6
  */
7
7
  /*!
8
- * snice v4.11.0
8
+ * snice v4.12.0
9
9
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
10
10
  * (c) 2024
11
11
  * Released under the MIT License.
@@ -18,7 +18,7 @@ globalThis.snice||(globalThis.snice={controllerRegistry:new Map,controllerIdCoun
18
18
  * Released under the MIT License.
19
19
  */class Oe{constructor(t){this.parsed=this.parsePattern(t)}get spec(){return this.parsed.template}parsePattern(t){let e=t,n="",o=!1;const s=t.indexOf("?");return-1!==s&&(e=t.slice(0,s),n=t.slice(s+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:s}=this.parseOptionalGroup(t,n);e.push({type:"optional",segments:o}),n=s+1;break;case":":const{name:r,endIndex:i}=this.parseIdentifier(t,n+1);e.push({type:"param",name:r}),n=i;break;case"*":const{name:a,endIndex:l}=this.parseIdentifier(t,n+1);e.push({type:"splat",name:a}),n=l;break;default:const{value:c,endIndex:u}=this.parseLiteral(t,n);c&&e.push({type:"literal",value:c}),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 s=t.slice(e+1,o-1);return{segments:this.parseSegments(s),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:s}=this.parseIdentifier(e,o+1);n.push({type:"param",name:t}),o=s}else{const{value:t,endIndex:s}=this.parseQueryLiteral(e,o);t&&n.push({type:"literal",value:t}),o=s}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 s=this.matchQuery(n||"",this.parsed.querySegments);if(!1===s)return!1;const r=this.getAllParamNames(),i={};for(const t of r)i[t]=void 0;return Object.assign(i,o,s),i}matchPath(t,e){const n={};let o=0;for(let s=0;s<e.length;s++){const r=e[s],i=e.slice(s+1),a=this.matchSegment(t,o,r,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 s=e;const r=o[0];let i,a=["/","?"];if(r&&"literal"===r.type){const n=r.value,o=t.indexOf(n,e);if(-1===o)return!1;s=o}else for(;s<t.length&&!a.includes(t[s]);)s++;if(s===e)return!1;try{i=decodeURIComponent(t.slice(e,s))}catch(n){i=t.slice(e,s)}return!(s<t.length&&"?"===t[s]&&o.length>0)&&{params:{[n.name]:i},nextIndex:s}}case"splat":{let s=t.length;const r=o[0];if(r)switch(r.type){case"literal":if("."===r.value){const n=t.indexOf(".",e);-1!==n&&(s=n)}else{const n=t.lastIndexOf(r.value);-1!==n&&n>=e&&(s=n)}break;case"param":let n=-1;for(let o=t.length-1;o>=e;o--)if("/"===t[o]){n=o;break}-1!==n&&(s=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)s=o;else{const n=t.slice(e).split("/").filter(t=>t);s=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(r.segments);if(a){const n=t.lastIndexOf(a);-1!==n&&n>=e&&(s=n)}}const i=t.indexOf("?",e);let a;-1!==i&&i<s&&(s=i);try{a=decodeURIComponent(t.slice(e,s))}catch(n){a=t.slice(e,s)}return{params:{[n.name]:a},nextIndex:s}}case"optional":{let s=e,r={},i=!0;for(let e=0;e<n.segments.length;e++){const o=n.segments[e],a=n.segments.slice(e+1),l=this.matchSegment(t,s,o,a);if(!1===l){i=!1;break}Object.assign(r,l.params),s=l.nextIndex}if(i){if(this.canMatchRemainingSegments(t,s,o))return{params:r,nextIndex:s}}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 s of e)switch(s.type){case"literal":if(t.slice(o,o+s.value.length)!==s.value)return!1;o+=s.value.length;break;case"param":{let e,r=o;for(;r<t.length&&"&"!==t[r];)r++;if(r===o)return!1;try{e=decodeURIComponent(t.slice(o,r))}catch(n){e=t.slice(o,r)}n[s.name]=e,o=r;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 s=0;s<t.length;s++){const r=t[s],i=t.slice(s+1);switch(r.type){case"literal":o+=r.value;break;case"param":case"splat":if(!(r.name in e))return!1;o+=String(e[r.name]);break;case"optional":if(this.hasAllParams(r.segments,e,n)||this.hasLaterOptionalGroupNeedingParams(i,e,r.segments)){const t=this.reverseSegments(r.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,s=!1,r=!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:r=!0}const a=n||o&&!r;for(const n of t)if("optional"===n.type){this.hasAllParams(n.segments,e,a)&&(s=!0)}return!(!o||r)||(!(!s||r)||!(!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 ke(t){const e={};return t.split(";").forEach(t=>{const[n,o]=t.split(":").map(t=>t.trim());n&&o&&(e[n]=o)}),e}var Le;function $e(t){const e=[];let n,o,s,r=!1,i=[],a=null,l=null;const c=t.context||{},u=new le(c,[],"",{},t.fetcher);function h(t){if(!a||!l)return null;const e=t.querySelectorAll(a);for(const t of e){if(t[E]===l)return t}return null}function d(t,i,a,l,c,u){e.push({route:new Oe(t),tag:i,transition:a,guards:l,layout:c,placard:u}),r=!1,"/404"===t&&(n=i),"/403"===t&&(o=i),"/"===t&&(s=i)}function m(){const t=new Set;i=e.filter(t=>t.placard).map(t=>{const e=t.placard;return"function"==typeof e?e(c):e}).filter(e=>!t.has(e.name)&&(t.add(e.name),!0))}function f(t,e,n){u[Q](c,i,e,n)}function p(){switch(t.type){case"hash":return window.location.hash.slice(1);case"pushstate":return window.location.pathname}}function g(t){let e;const n=!!o;if(n&&(e=document.createElement(o),e[S]=c),!n){const t=document.createElement("div");t.className="default-403",t.innerHTML="<h1>403</h1><p>Unauthorized</p>",e=t}t.innerHTML="",t.appendChild(e),a=null,l=null}function b(t,e,n){if(!!!t)return!0;const o=Array.isArray(t)?t:[t];for(const t of o){if(!t(c,e))return g(n),!1}return!0}function w(e){if(!1===e)return null;if(!!e)return e;return!!t.layout?t.layout:null}function v(t){if(!(t!==a))return{element:null,needsNewLayout:!1};a=t;if(!!t){const e=Date.now();l=e;const n=document.createElement(t);return n[S]=c,n[E]=e,{element:n,needsNewLayout:!0}}return l=null,{element:null,needsNewLayout:!0}}async function T(t,e,n,o,s,r,a){const l=o||h(t);if(!l)return;!function(t,e,n){"function"==typeof t.update&&t.update(c,i,e,n)}(l,r,a);const u=l.querySelector('[slot="page"]');if(!(!n||!u))return e.setAttribute("slot","page"),await x(l,u,e,n),void(s&&(t.innerHTML="",t.appendChild(l)));l.querySelectorAll('[slot="page"]').forEach(t=>t.remove()),e.setAttribute("slot","page"),l.appendChild(e),s&&(t.innerHTML="",t.appendChild(l))}async function A(t,e,n){const o=t.children[0];!n||!o?(t.innerHTML="",t.appendChild(e)):await x(t,o,e,n)}async function _(o){const r=document.querySelector(t.target);if(!r)throw new Error(`Target element not found: ${t.target}`);m(),window.scrollTo(0,0);if((""===o?.trim()||"/"===o)&&!!s){const n=e.find(t=>t.route.match("/"));if(!b(n?.guards,{},r))return;const{element:i,transition:a,layout:l}=function(){const t=document.createElement(s);t[S]=c;const n=customElements.get(s),o=n?.[N],r=e.find(t=>t.route.match("/"));return{element:t,transition:o,layout:r?.layout}}(),u=w(l),{element:d,needsNewLayout:m}=v(u),p=a||t.transition;return null!==d||null!==h(r)?(await T(r,i,p,d,m,o,{}),void f(0,o,{})):(await A(r,i,p),void f(0,o,{}))}if(!o)return;const i=function(t,n){for(const o of e){const e=o.route.match(t);if(!1===e)continue;if(!b(o.guards,e,n))return{result:Le.GUARDS_FAILED};const s=document.createElement(o.tag);s[S]=c,s[j]=u;const r=e;return Object.keys(r).forEach(t=>s.setAttribute(t,r[t])),{result:Le.SUCCESS,element:s,transition:o.transition,layout:o.layout,routeParams:r}}return{result:Le.NOT_FOUND}}(o,r);if(i.result===Le.GUARDS_FAILED)return;if(i.result===Le.SUCCESS){const{element:e,transition:n,layout:s,routeParams:a={}}=i,l=w(s),{element:c,needsNewLayout:u}=v(l),d=n||t.transition;return null!==c||null!==h(r)?(await T(r,e,d,c,u,o,a),void f(0,o,a)):(await A(r,e,d),void f(0,o,a))}const{element:a,transition:l,layout:d}=function(){if(n){const t=document.createElement(n);t[S]=c;const e=customElements.get(n),o=e?.[N];return{element:t,transition:o,layout:void 0}}const t=document.createElement("div");return t.className="default-404",t.innerHTML="<h1>404</h1><p>Page not found</p>",{element:t,transition:void 0,layout:void 0}}(),p=w(d),{element:y,needsNewLayout:g}=v(p),E=l||t.transition;if(null!==y||null!==h(r))return await T(r,a,E,y,g,o,{}),void f(0,o,{});await A(r,a,E),f(0,o,{})}async function x(t,e,n,o){return async function(t,e,n,o={}){const s=o.outDuration||300,r=o.inDuration||300,i=o.mode||"sequential",a=o.out?ke(o.out):{opacity:"0"},l={opacity:"0"},c=o.in?ke(o.in):{opacity:"1"},u=t.style,h=u.position,d=t.tagName.includes("-")&&t.shadowRoot;d||(u.position="relative");const m=e.hasAttribute("slot")||n.hasAttribute("slot");m?(e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.transition=`opacity ${s}ms ease-in-out`,n.style.position="absolute",n.style.width="100%",n.style.height="100%",n.style.transition=`opacity ${r}ms ease-in-out`):(e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.transition=`all ${s}ms ease-in-out`,n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%"),Object.assign(n.style,l),n.style.transition=`all ${r}ms ease-in-out`,t.appendChild(n),n.offsetHeight,"simultaneous"===i?(Object.assign(e.style,a),Object.assign(n.style,c),await new Promise(t=>setTimeout(t,Math.max(s,r)))):(Object.assign(e.style,a),await new Promise(t=>setTimeout(t,s)),Object.assign(n.style,c),await new Promise(t=>setTimeout(t,r))),e.remove(),m?(n.style.position="",n.style.width="",n.style.height="",n.style.transition=""):(n.style.position="",n.style.top="",n.style.left="",n.style.width="",n.style.transition=""),Object.keys({...l,...c}).forEach(t=>{n.style[t]=""}),d||(u.position=h)}(t,e,n,o)}return{page:function(t){return function(e,n){if(n?.metadata&&n.metadata[y]){e[y]||(e[y]=new Map);for(const[t,o]of n.metadata[y])e[y].set(t,o)}ge(e),e[N]=t.transition;const o=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){this[j]=u,o?.call(this)};const s=e.prototype.disconnectedCallback;return e.prototype.disconnectedCallback=function(){s?.call(this),delete this[S],delete this[j]},customElements.get(t.tag)?console.warn(`[snice] Page "${t.tag}" is already registered. Skipping duplicate registration.`):customElements.define(t.tag,e),t.routes.forEach(e=>d(e,t.tag,t.transition,t.guards,t.layout,t.placard)),e}},initialize:function(){if(!document.querySelector(t.target))throw new Error(`Target element not found: ${t.target}`);!r&&(e.sort((t,e)=>e.route.spec.length-t.route.spec.length),r=!0),m(),function(){const e="hash"===t.type,n="pushstate"===t.type;e&&window.addEventListener("hashchange",()=>{document.querySelector(t.target)&&_(p())}),n&&window.addEventListener("popstate",()=>{document.querySelector(t.target)&&_(p())})}(),_(p())},navigate:_,register:d}}function Pe(t,e){return function(n,o){return function(...s){this[$]||(this[$]=new Map);const r=`${t}_${o.name}`;this[$].has(r)||this[$].set(r,{debounceTimeout:null,throttleLastCall:0,throttleTimeout:null});const i=this[$].get(r),a=n.apply(this,s),l=n=>{if(void 0===n&&!1===e?.dispatchOnUndefined)return;const o=new CustomEvent(t,{bubbles:!0,composed:!0,...e,detail:n});this.dispatchEvent(o)},c=t=>{if(e?.debounce)clearTimeout(i.debounceTimeout),i.debounceTimeout=setTimeout(()=>l(t),e.debounce);else if(e?.throttle){const n=Date.now(),o=e.throttle-(n-i.throttleLastCall);o<=0?(clearTimeout(i.throttleTimeout),i.throttleLastCall=n,l(t)):i.throttleTimeout||(i.throttleTimeout=setTimeout(()=>{i.throttleLastCall=Date.now(),i.throttleTimeout=null,l(t)},o))}else l(t)};return a instanceof Promise?a.then(t=>(c(t),t)):(c(a),a)}}}!function(t){t.SUCCESS="success",t.GUARDS_FAILED="guards-failed",t.NOT_FOUND="not-found"}(Le||(Le={}));let Me=!1;function Ie(t){Me=t}async function Re(t,e=500){if(customElements.get(t))return;let n=null;Me||(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 De(t,e=500){const n=t.tagName.toLowerCase();await Re(n,e),"ready"in t&&"function"==typeof t.ready?.then&&await t.ready}async function qe(t,e=500){const n=[];if(t instanceof Element&&(t.tagName.includes("-")&&n.push(t),t.shadowRoot)){t.shadowRoot.querySelectorAll("*").forEach(t=>{t.tagName.includes("-")&&n.push(t)})}if(t instanceof DocumentFragment){t.querySelectorAll("*").forEach(t=>{t.tagName.includes("-")&&n.push(t)})}await Promise.all(n.map(t=>De(t,e)))}async function*Fe(t){for(;;)await new Promise(e=>{t[q]||(t[q]=[]),t[q].push(e)}),yield}const Ve=e("debounce-timers"),je=e("throttle-timers"),ze=e("once-called"),Be=e("memoize-cache");function We(t=300,e={}){const{leading:n=!1,trailing:o=!0,maxWait:s}=e;return function(e,r){const i=r.name;return function(...r){this[Ve]||(this[Ve]={});const a=this[Ve],l=i;a[l]&&clearTimeout(a[l].timeout);const c=Date.now(),u=!a[l],h=u?c:a[l].startTime,d=void 0!==s&&c-h>=s;if(n&&u){const t=e.apply(this,r);return a[l]={timeout:null,startTime:h,lastArgs:r},t}const m=setTimeout(()=>{(o||d)&&e.apply(this,a[l].lastArgs),delete a[l]},d?0:t);a[l]={timeout:m,startTime:h,lastArgs:r}}}}function Ue(t=300,e={}){const{leading:n=!0,trailing:o=!0}=e;return function(e,s){const r=s.name;return function(...s){this[je]||(this[je]={});const i=this[je],a=r,l=Date.now();if(i[a]){const n=l-i[a].lastInvoke;if(i[a].lastArgs=s,i[a].timeout&&clearTimeout(i[a].timeout),n>=t)e.apply(this,s),i[a].lastInvoke=l;else if(o){const o=t-n;i[a].timeout=setTimeout(()=>{e.apply(this,i[a].lastArgs),i[a].lastInvoke=Date.now(),i[a].timeout=null},o)}}else n&&e.apply(this,s),i[a]={lastInvoke:l,timeout:null,lastArgs:s},o&&!n&&(i[a].timeout=setTimeout(()=>{e.apply(this,i[a].lastArgs),delete i[a]},t))}}}function He(t=!0){let e,n=!1;return function(o,s){const r=s.name;return function(...s){return t?(this[ze]||(this[ze]={}),this[ze][r]||(this[ze][r]={called:!0,result:o.apply(this,s)}),this[ze][r].result):(n||(n=!0,e=o.apply(this,s)),e)}}}function Ge(t={}){const{keyGenerator:e=(...t)=>JSON.stringify(t),maxSize:n=100,ttl:o}=t;return function(t,s){const r=s.name;return function(...s){this[Be]||(this[Be]={}),this[Be][r]||(this[Be][r]=new Map);const i=this[Be][r],a=e(...s);if(i.has(a)){const t=i.get(a);if(void 0===o)return t.value;if(!(Date.now()-t.timestamp>o))return t.value;i.delete(a)}const l=t.apply(this,s);if(i.set(a,{value:l,timestamp:Date.now()}),i.size>n){const t=i.keys().next().value;i.delete(t)}return l}}}function Ke(t){if(t[Ve]){for(const e in t[Ve])t[Ve][e]?.timeout&&clearTimeout(t[Ve][e].timeout);t[Ve]={}}}function Je(t){if(t[je]){for(const e in t[je])t[je][e]?.timeout&&clearTimeout(t[je][e].timeout);t[je]={}}}function Qe(t,e){t[Be]&&(e?delete t[Be][e]:t[Be]={})}function Xe(t,e){t[ze]&&(e?delete t[ze][e]:t[ze]={})}class Ye{constructor(){this.requestMiddlewares=[],this.responseMiddlewares=[]}use(t,e){"request"===t?this.requestMiddlewares.push(e):this.responseMiddlewares.push(e)}create(t){const e=this.requestMiddlewares,n=this.responseMiddlewares;return async function(t,o){const s=new Request(t,o);let r=0;const i=async()=>{if(r<e.length){return e[r++].call(this,s,i)}const t=await fetch(s);let o=0;const a=async()=>{if(o<n.length){return n[o++].call(this,t,a)}return t};return a()};return i()}.bind(t)}}
20
20
  /*!
21
- * snice v4.11.0
21
+ * snice v4.12.0
22
22
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
23
23
  * (c) 2024
24
24
  * Released under the MIT License.