@sparrowengg/integrations-templates-frontend 1.2.5 → 1.2.7

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 (366) hide show
  1. package/dist/cjs/_virtual/index10.js +2 -2
  2. package/dist/cjs/_virtual/index7.js +2 -2
  3. package/dist/cjs/authentication/constants/index.js +10 -0
  4. package/dist/cjs/authentication/constants/index.js.map +1 -0
  5. package/dist/cjs/authentication/index.js +40 -47
  6. package/dist/cjs/authentication/index.js.map +1 -1
  7. package/dist/cjs/commons/components/theme-wrapper.js +24 -0
  8. package/dist/cjs/commons/components/theme-wrapper.js.map +1 -0
  9. package/dist/cjs/contact-import/components/contact-import-mapping.js +6 -4
  10. package/dist/cjs/contact-import/components/contact-import-mapping.js.map +1 -1
  11. package/dist/cjs/contact-import/index.js +34 -52
  12. package/dist/cjs/contact-import/index.js.map +1 -1
  13. package/dist/cjs/integration-template/index.js +4 -4
  14. package/dist/cjs/integration-template/index.js.map +1 -1
  15. package/dist/cjs/mapping/components/custom-date-menu.js +2 -2
  16. package/dist/cjs/mapping/components/custom-date-menu.js.map +1 -1
  17. package/dist/cjs/node_modules/@internationalized/date/dist/CalendarDate.js +156 -0
  18. package/dist/cjs/node_modules/@internationalized/date/dist/CalendarDate.js.map +1 -0
  19. package/dist/cjs/node_modules/@internationalized/date/dist/GregorianCalendar.js +139 -0
  20. package/dist/cjs/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
  21. package/dist/cjs/node_modules/@internationalized/date/dist/conversion.js +159 -0
  22. package/dist/cjs/node_modules/@internationalized/date/dist/conversion.js.map +1 -0
  23. package/dist/cjs/node_modules/@internationalized/date/dist/manipulation.js +229 -0
  24. package/dist/cjs/node_modules/@internationalized/date/dist/manipulation.js.map +1 -0
  25. package/dist/cjs/node_modules/@internationalized/date/dist/queries.js +22 -0
  26. package/dist/cjs/node_modules/@internationalized/date/dist/queries.js.map +1 -0
  27. package/dist/cjs/node_modules/@internationalized/date/dist/string.js +36 -0
  28. package/dist/cjs/node_modules/@internationalized/date/dist/string.js.map +1 -0
  29. package/dist/cjs/node_modules/@internationalized/date/dist/utils.js +19 -0
  30. package/dist/cjs/node_modules/@internationalized/date/dist/utils.js.map +1 -0
  31. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-utils.js.map +1 -1
  32. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
  33. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
  34. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +18 -18
  35. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
  36. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +2 -2
  37. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
  38. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js +9 -6
  39. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
  40. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js +40 -15
  41. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
  42. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js +156 -138
  43. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -1
  44. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js +60 -85
  45. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
  46. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js +32 -21
  47. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
  48. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js +91 -92
  49. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  50. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js +326 -247
  51. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -1
  52. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js +26 -5
  53. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
  54. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +201 -207
  55. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
  56. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +303 -0
  57. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
  58. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js +40 -24
  59. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
  60. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js +205 -258
  61. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
  62. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js +23 -26
  63. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
  64. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js +47 -0
  65. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js.map +1 -0
  66. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js +847 -0
  67. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
  68. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js +298 -255
  69. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
  70. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js +279 -265
  71. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
  72. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js +31 -9
  73. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
  74. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js +125 -116
  75. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
  76. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js +54 -80
  77. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
  78. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js +273 -225
  79. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js.map +1 -1
  80. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js +211 -208
  81. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
  82. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js +88 -69
  83. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  84. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js +140 -111
  85. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -1
  86. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js +186 -137
  87. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
  88. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js +480 -526
  89. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -1
  90. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +27 -14
  91. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
  92. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +58 -40
  93. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
  94. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +32 -16
  95. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
  96. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +24 -9
  97. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
  98. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js +30 -17
  99. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -1
  100. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js +54 -46
  101. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
  102. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js +48 -20
  103. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -1
  104. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js +2 -2
  105. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
  106. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +15 -4
  107. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
  108. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js +2 -2
  109. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
  110. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +12 -4
  111. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
  112. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js +26 -4
  113. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
  114. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/popover/popover.js.map +1 -1
  115. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +25 -5
  116. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
  117. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
  118. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +14 -9
  119. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
  120. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js.map +1 -1
  121. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js +12 -4
  122. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js.map +1 -1
  123. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +2 -2
  124. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
  125. package/dist/cjs/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -1
  126. package/dist/cjs/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -1
  127. package/dist/cjs/node_modules/@swc/helpers/esm/_class_private_field_init.js +1 -2
  128. package/dist/cjs/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +1 -1
  129. package/dist/cjs/node_modules/domhandler/lib/index.js +176 -0
  130. package/dist/cjs/node_modules/domhandler/lib/index.js.map +1 -0
  131. package/dist/cjs/node_modules/domhandler/lib/node.js +485 -0
  132. package/dist/cjs/node_modules/domhandler/lib/node.js.map +1 -0
  133. package/dist/cjs/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
  134. package/dist/cjs/node_modules/html-dom-parser/lib/server/html-to-dom.js +3 -3
  135. package/dist/cjs/node_modules/html-react-parser/lib/index.js +1 -1
  136. package/dist/cjs/node_modules/htmlparser2/lib/Parser.js +531 -0
  137. package/dist/cjs/node_modules/htmlparser2/lib/Parser.js.map +1 -0
  138. package/dist/cjs/node_modules/htmlparser2/lib/Tokenizer.js +789 -0
  139. package/dist/cjs/node_modules/htmlparser2/lib/Tokenizer.js.map +1 -0
  140. package/dist/cjs/node_modules/htmlparser2/lib/index.js +131 -0
  141. package/dist/cjs/node_modules/htmlparser2/lib/index.js.map +1 -0
  142. package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +111 -0
  143. package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
  144. package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +240 -0
  145. package/dist/cjs/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +1 -0
  146. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +202 -0
  147. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +1 -0
  148. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +150 -0
  149. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +1 -0
  150. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/index.js +56 -0
  151. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +1 -0
  152. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +164 -0
  153. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +1 -0
  154. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +150 -0
  155. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +1 -0
  156. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +168 -0
  157. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +1 -0
  158. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +106 -0
  159. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +1 -0
  160. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +135 -0
  161. package/dist/cjs/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +1 -0
  162. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode.js +549 -0
  163. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode.js.map +1 -0
  164. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +82 -0
  165. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  166. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/encode.js +89 -0
  167. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/encode.js.map +1 -0
  168. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/escape.js +128 -0
  169. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/escape.js.map +1 -0
  170. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js +12 -0
  171. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  172. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js +12 -0
  173. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  174. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js +15 -0
  175. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  176. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/index.js +138 -0
  177. package/dist/cjs/node_modules/htmlparser2/node_modules/entities/lib/index.js.map +1 -0
  178. package/dist/cjs/node_modules/react-is/index.js +1 -1
  179. package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
  180. package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
  181. package/dist/es/_virtual/index10.js +2 -2
  182. package/dist/es/_virtual/index7.js +2 -2
  183. package/dist/es/authentication/constants/index.js +8 -0
  184. package/dist/es/authentication/constants/index.js.map +1 -0
  185. package/dist/es/authentication/index.js +40 -47
  186. package/dist/es/authentication/index.js.map +1 -1
  187. package/dist/es/commons/components/theme-wrapper.js +20 -0
  188. package/dist/es/commons/components/theme-wrapper.js.map +1 -0
  189. package/dist/es/contact-import/components/contact-import-mapping.js +6 -4
  190. package/dist/es/contact-import/components/contact-import-mapping.js.map +1 -1
  191. package/dist/es/contact-import/index.js +34 -52
  192. package/dist/es/contact-import/index.js.map +1 -1
  193. package/dist/es/integration-template/index.js +4 -4
  194. package/dist/es/integration-template/index.js.map +1 -1
  195. package/dist/es/mapping/components/custom-date-menu.js +1 -1
  196. package/dist/es/node_modules/@internationalized/date/dist/CalendarDate.js +153 -0
  197. package/dist/es/node_modules/@internationalized/date/dist/CalendarDate.js.map +1 -0
  198. package/dist/es/node_modules/@internationalized/date/dist/GregorianCalendar.js +133 -0
  199. package/dist/es/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
  200. package/dist/es/node_modules/@internationalized/date/dist/conversion.js +152 -0
  201. package/dist/es/node_modules/@internationalized/date/dist/conversion.js.map +1 -0
  202. package/dist/es/node_modules/@internationalized/date/dist/manipulation.js +219 -0
  203. package/dist/es/node_modules/@internationalized/date/dist/manipulation.js.map +1 -0
  204. package/dist/es/node_modules/@internationalized/date/dist/queries.js +18 -0
  205. package/dist/es/node_modules/@internationalized/date/dist/queries.js.map +1 -0
  206. package/dist/es/node_modules/@internationalized/date/dist/string.js +31 -0
  207. package/dist/es/node_modules/@internationalized/date/dist/string.js.map +1 -0
  208. package/dist/es/node_modules/@internationalized/date/dist/utils.js +17 -0
  209. package/dist/es/node_modules/@internationalized/date/dist/utils.js.map +1 -0
  210. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-utils.js.map +1 -1
  211. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +3 -3
  212. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
  213. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +7 -7
  214. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
  215. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +18 -18
  216. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
  217. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +2 -2
  218. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
  219. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js +9 -6
  220. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
  221. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js +22 -16
  222. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
  223. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js +143 -144
  224. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -1
  225. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js +63 -88
  226. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
  227. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js +13 -21
  228. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
  229. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js +72 -93
  230. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  231. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js +298 -241
  232. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -1
  233. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js +8 -6
  234. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
  235. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +189 -215
  236. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
  237. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +254 -0
  238. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
  239. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js +22 -25
  240. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
  241. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js +190 -262
  242. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
  243. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js +11 -14
  244. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
  245. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js +25 -0
  246. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-label/dist/index.js.map +1 -0
  247. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js +796 -0
  248. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
  249. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js +268 -244
  250. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
  251. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js +257 -262
  252. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
  253. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js +13 -10
  254. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
  255. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js +110 -121
  256. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
  257. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js +37 -83
  258. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
  259. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js +250 -221
  260. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-radio-group/dist/index.js.map +1 -1
  261. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js +200 -216
  262. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
  263. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js +71 -71
  264. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  265. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js +126 -116
  266. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -1
  267. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js +171 -141
  268. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
  269. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js +453 -518
  270. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -1
  271. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +9 -15
  272. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
  273. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +42 -43
  274. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
  275. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +15 -18
  276. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
  277. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +5 -9
  278. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
  279. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js +12 -18
  280. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -1
  281. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js +37 -48
  282. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
  283. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -21
  284. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -1
  285. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js +5 -5
  286. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
  287. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +15 -4
  288. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
  289. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js +2 -2
  290. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
  291. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +12 -4
  292. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
  293. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js +25 -5
  294. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
  295. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/popover/popover.js +5 -5
  296. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/popover/popover.js.map +1 -1
  297. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +29 -9
  298. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
  299. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +3 -3
  300. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
  301. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +14 -9
  302. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
  303. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js +5 -5
  304. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js.map +1 -1
  305. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js +13 -5
  306. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js.map +1 -1
  307. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +8 -8
  308. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
  309. package/dist/es/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +1 -1
  310. package/dist/es/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -1
  311. package/dist/es/node_modules/@swc/helpers/esm/_class_private_field_init.js +2 -2
  312. package/dist/es/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +1 -1
  313. package/dist/es/node_modules/domhandler/lib/index.js +174 -0
  314. package/dist/es/node_modules/domhandler/lib/index.js.map +1 -0
  315. package/dist/es/node_modules/domhandler/lib/node.js +481 -0
  316. package/dist/es/node_modules/domhandler/lib/node.js.map +1 -0
  317. package/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
  318. package/dist/es/node_modules/html-dom-parser/lib/server/html-to-dom.js +3 -3
  319. package/dist/es/node_modules/html-react-parser/lib/index.js +1 -1
  320. package/dist/es/node_modules/htmlparser2/lib/Parser.js +527 -0
  321. package/dist/es/node_modules/htmlparser2/lib/Parser.js.map +1 -0
  322. package/dist/es/node_modules/htmlparser2/lib/Tokenizer.js +787 -0
  323. package/dist/es/node_modules/htmlparser2/lib/Tokenizer.js.map +1 -0
  324. package/dist/es/node_modules/htmlparser2/lib/index.js +129 -0
  325. package/dist/es/node_modules/htmlparser2/lib/index.js.map +1 -0
  326. package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js +107 -0
  327. package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
  328. package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js +238 -0
  329. package/dist/es/node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js.map +1 -0
  330. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js +198 -0
  331. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/feeds.js.map +1 -0
  332. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +148 -0
  333. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js.map +1 -0
  334. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/index.js +54 -0
  335. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/index.js.map +1 -0
  336. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +160 -0
  337. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js.map +1 -0
  338. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +146 -0
  339. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js.map +1 -0
  340. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +164 -0
  341. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/querying.js.map +1 -0
  342. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +102 -0
  343. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js.map +1 -0
  344. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +131 -0
  345. package/dist/es/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js.map +1 -0
  346. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode.js +547 -0
  347. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode.js.map +1 -0
  348. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +80 -0
  349. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  350. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/encode.js +85 -0
  351. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/encode.js.map +1 -0
  352. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/escape.js +126 -0
  353. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/escape.js.map +1 -0
  354. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js +10 -0
  355. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  356. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js +10 -0
  357. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  358. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js +13 -0
  359. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  360. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/index.js +136 -0
  361. package/dist/es/node_modules/htmlparser2/node_modules/entities/lib/index.js.map +1 -0
  362. package/dist/es/node_modules/react-is/index.js +1 -1
  363. package/dist/es/node_modules/style-to-js/cjs/index.js +1 -1
  364. package/dist/es/node_modules/style-to-object/cjs/index.js +1 -1
  365. package/dist/index.d.ts +44 -12
  366. package/package.json +2 -2
@@ -0,0 +1,787 @@
1
+ import { __exports as Tokenizer$1 } from '../../../_virtual/Tokenizer.js';
2
+ import '../node_modules/entities/lib/decode.js';
3
+ import { __exports as decode } from '../../../_virtual/decode.js';
4
+
5
+ Object.defineProperty(Tokenizer$1, "__esModule", { value: true });
6
+ Tokenizer$1.QuoteType = void 0;
7
+ var decode_js_1 = decode;
8
+ var CharCodes;
9
+ (function (CharCodes) {
10
+ CharCodes[CharCodes["Tab"] = 9] = "Tab";
11
+ CharCodes[CharCodes["NewLine"] = 10] = "NewLine";
12
+ CharCodes[CharCodes["FormFeed"] = 12] = "FormFeed";
13
+ CharCodes[CharCodes["CarriageReturn"] = 13] = "CarriageReturn";
14
+ CharCodes[CharCodes["Space"] = 32] = "Space";
15
+ CharCodes[CharCodes["ExclamationMark"] = 33] = "ExclamationMark";
16
+ CharCodes[CharCodes["Number"] = 35] = "Number";
17
+ CharCodes[CharCodes["Amp"] = 38] = "Amp";
18
+ CharCodes[CharCodes["SingleQuote"] = 39] = "SingleQuote";
19
+ CharCodes[CharCodes["DoubleQuote"] = 34] = "DoubleQuote";
20
+ CharCodes[CharCodes["Dash"] = 45] = "Dash";
21
+ CharCodes[CharCodes["Slash"] = 47] = "Slash";
22
+ CharCodes[CharCodes["Zero"] = 48] = "Zero";
23
+ CharCodes[CharCodes["Nine"] = 57] = "Nine";
24
+ CharCodes[CharCodes["Semi"] = 59] = "Semi";
25
+ CharCodes[CharCodes["Lt"] = 60] = "Lt";
26
+ CharCodes[CharCodes["Eq"] = 61] = "Eq";
27
+ CharCodes[CharCodes["Gt"] = 62] = "Gt";
28
+ CharCodes[CharCodes["Questionmark"] = 63] = "Questionmark";
29
+ CharCodes[CharCodes["UpperA"] = 65] = "UpperA";
30
+ CharCodes[CharCodes["LowerA"] = 97] = "LowerA";
31
+ CharCodes[CharCodes["UpperF"] = 70] = "UpperF";
32
+ CharCodes[CharCodes["LowerF"] = 102] = "LowerF";
33
+ CharCodes[CharCodes["UpperZ"] = 90] = "UpperZ";
34
+ CharCodes[CharCodes["LowerZ"] = 122] = "LowerZ";
35
+ CharCodes[CharCodes["LowerX"] = 120] = "LowerX";
36
+ CharCodes[CharCodes["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
37
+ })(CharCodes || (CharCodes = {}));
38
+ /** All the states the tokenizer can be in. */
39
+ var State;
40
+ (function (State) {
41
+ State[State["Text"] = 1] = "Text";
42
+ State[State["BeforeTagName"] = 2] = "BeforeTagName";
43
+ State[State["InTagName"] = 3] = "InTagName";
44
+ State[State["InSelfClosingTag"] = 4] = "InSelfClosingTag";
45
+ State[State["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
46
+ State[State["InClosingTagName"] = 6] = "InClosingTagName";
47
+ State[State["AfterClosingTagName"] = 7] = "AfterClosingTagName";
48
+ // Attributes
49
+ State[State["BeforeAttributeName"] = 8] = "BeforeAttributeName";
50
+ State[State["InAttributeName"] = 9] = "InAttributeName";
51
+ State[State["AfterAttributeName"] = 10] = "AfterAttributeName";
52
+ State[State["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
53
+ State[State["InAttributeValueDq"] = 12] = "InAttributeValueDq";
54
+ State[State["InAttributeValueSq"] = 13] = "InAttributeValueSq";
55
+ State[State["InAttributeValueNq"] = 14] = "InAttributeValueNq";
56
+ // Declarations
57
+ State[State["BeforeDeclaration"] = 15] = "BeforeDeclaration";
58
+ State[State["InDeclaration"] = 16] = "InDeclaration";
59
+ // Processing instructions
60
+ State[State["InProcessingInstruction"] = 17] = "InProcessingInstruction";
61
+ // Comments & CDATA
62
+ State[State["BeforeComment"] = 18] = "BeforeComment";
63
+ State[State["CDATASequence"] = 19] = "CDATASequence";
64
+ State[State["InSpecialComment"] = 20] = "InSpecialComment";
65
+ State[State["InCommentLike"] = 21] = "InCommentLike";
66
+ // Special tags
67
+ State[State["BeforeSpecialS"] = 22] = "BeforeSpecialS";
68
+ State[State["BeforeSpecialT"] = 23] = "BeforeSpecialT";
69
+ State[State["SpecialStartSequence"] = 24] = "SpecialStartSequence";
70
+ State[State["InSpecialTag"] = 25] = "InSpecialTag";
71
+ State[State["InEntity"] = 26] = "InEntity";
72
+ })(State || (State = {}));
73
+ function isWhitespace(c) {
74
+ return (c === CharCodes.Space ||
75
+ c === CharCodes.NewLine ||
76
+ c === CharCodes.Tab ||
77
+ c === CharCodes.FormFeed ||
78
+ c === CharCodes.CarriageReturn);
79
+ }
80
+ function isEndOfTagSection(c) {
81
+ return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);
82
+ }
83
+ function isASCIIAlpha(c) {
84
+ return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||
85
+ (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));
86
+ }
87
+ var QuoteType;
88
+ (function (QuoteType) {
89
+ QuoteType[QuoteType["NoValue"] = 0] = "NoValue";
90
+ QuoteType[QuoteType["Unquoted"] = 1] = "Unquoted";
91
+ QuoteType[QuoteType["Single"] = 2] = "Single";
92
+ QuoteType[QuoteType["Double"] = 3] = "Double";
93
+ })(QuoteType || (Tokenizer$1.QuoteType = QuoteType = {}));
94
+ /**
95
+ * Sequences used to match longer strings.
96
+ *
97
+ * We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End
98
+ * sequences with an increased offset.
99
+ */
100
+ var Sequences = {
101
+ Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]), // CDATA[
102
+ CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]), // ]]>
103
+ CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]), // `-->`
104
+ ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]), // `</script`
105
+ StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]), // `</style`
106
+ TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`
107
+ TextareaEnd: new Uint8Array([
108
+ 0x3c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61,
109
+ ]), // `</textarea`
110
+ };
111
+ var Tokenizer = /** @class */ (function () {
112
+ function Tokenizer(_a, cbs) {
113
+ var _b = _a.xmlMode, xmlMode = _b === void 0 ? false : _b, _c = _a.decodeEntities, decodeEntities = _c === void 0 ? true : _c;
114
+ var _this = this;
115
+ this.cbs = cbs;
116
+ /** The current state the tokenizer is in. */
117
+ this.state = State.Text;
118
+ /** The read buffer. */
119
+ this.buffer = "";
120
+ /** The beginning of the section that is currently being read. */
121
+ this.sectionStart = 0;
122
+ /** The index within the buffer that we are currently looking at. */
123
+ this.index = 0;
124
+ /** The start of the last entity. */
125
+ this.entityStart = 0;
126
+ /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
127
+ this.baseState = State.Text;
128
+ /** For special parsing behavior inside of script and style tags. */
129
+ this.isSpecial = false;
130
+ /** Indicates whether the tokenizer has been paused. */
131
+ this.running = true;
132
+ /** The offset of the current buffer. */
133
+ this.offset = 0;
134
+ this.currentSequence = undefined;
135
+ this.sequenceIndex = 0;
136
+ this.xmlMode = xmlMode;
137
+ this.decodeEntities = decodeEntities;
138
+ this.entityDecoder = new decode_js_1.EntityDecoder(xmlMode ? decode_js_1.xmlDecodeTree : decode_js_1.htmlDecodeTree, function (cp, consumed) { return _this.emitCodePoint(cp, consumed); });
139
+ }
140
+ Tokenizer.prototype.reset = function () {
141
+ this.state = State.Text;
142
+ this.buffer = "";
143
+ this.sectionStart = 0;
144
+ this.index = 0;
145
+ this.baseState = State.Text;
146
+ this.currentSequence = undefined;
147
+ this.running = true;
148
+ this.offset = 0;
149
+ };
150
+ Tokenizer.prototype.write = function (chunk) {
151
+ this.offset += this.buffer.length;
152
+ this.buffer = chunk;
153
+ this.parse();
154
+ };
155
+ Tokenizer.prototype.end = function () {
156
+ if (this.running)
157
+ this.finish();
158
+ };
159
+ Tokenizer.prototype.pause = function () {
160
+ this.running = false;
161
+ };
162
+ Tokenizer.prototype.resume = function () {
163
+ this.running = true;
164
+ if (this.index < this.buffer.length + this.offset) {
165
+ this.parse();
166
+ }
167
+ };
168
+ Tokenizer.prototype.stateText = function (c) {
169
+ if (c === CharCodes.Lt ||
170
+ (!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {
171
+ if (this.index > this.sectionStart) {
172
+ this.cbs.ontext(this.sectionStart, this.index);
173
+ }
174
+ this.state = State.BeforeTagName;
175
+ this.sectionStart = this.index;
176
+ }
177
+ else if (this.decodeEntities && c === CharCodes.Amp) {
178
+ this.startEntity();
179
+ }
180
+ };
181
+ Tokenizer.prototype.stateSpecialStartSequence = function (c) {
182
+ var isEnd = this.sequenceIndex === this.currentSequence.length;
183
+ var isMatch = isEnd
184
+ ? // If we are at the end of the sequence, make sure the tag name has ended
185
+ isEndOfTagSection(c)
186
+ : // Otherwise, do a case-insensitive comparison
187
+ (c | 0x20) === this.currentSequence[this.sequenceIndex];
188
+ if (!isMatch) {
189
+ this.isSpecial = false;
190
+ }
191
+ else if (!isEnd) {
192
+ this.sequenceIndex++;
193
+ return;
194
+ }
195
+ this.sequenceIndex = 0;
196
+ this.state = State.InTagName;
197
+ this.stateInTagName(c);
198
+ };
199
+ /** Look for an end tag. For <title> tags, also decode entities. */
200
+ Tokenizer.prototype.stateInSpecialTag = function (c) {
201
+ if (this.sequenceIndex === this.currentSequence.length) {
202
+ if (c === CharCodes.Gt || isWhitespace(c)) {
203
+ var endOfText = this.index - this.currentSequence.length;
204
+ if (this.sectionStart < endOfText) {
205
+ // Spoof the index so that reported locations match up.
206
+ var actualIndex = this.index;
207
+ this.index = endOfText;
208
+ this.cbs.ontext(this.sectionStart, endOfText);
209
+ this.index = actualIndex;
210
+ }
211
+ this.isSpecial = false;
212
+ this.sectionStart = endOfText + 2; // Skip over the `</`
213
+ this.stateInClosingTagName(c);
214
+ return; // We are done; skip the rest of the function.
215
+ }
216
+ this.sequenceIndex = 0;
217
+ }
218
+ if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {
219
+ this.sequenceIndex += 1;
220
+ }
221
+ else if (this.sequenceIndex === 0) {
222
+ if (this.currentSequence === Sequences.TitleEnd) {
223
+ // We have to parse entities in <title> tags.
224
+ if (this.decodeEntities && c === CharCodes.Amp) {
225
+ this.startEntity();
226
+ }
227
+ }
228
+ else if (this.fastForwardTo(CharCodes.Lt)) {
229
+ // Outside of <title> tags, we can fast-forward.
230
+ this.sequenceIndex = 1;
231
+ }
232
+ }
233
+ else {
234
+ // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.
235
+ this.sequenceIndex = Number(c === CharCodes.Lt);
236
+ }
237
+ };
238
+ Tokenizer.prototype.stateCDATASequence = function (c) {
239
+ if (c === Sequences.Cdata[this.sequenceIndex]) {
240
+ if (++this.sequenceIndex === Sequences.Cdata.length) {
241
+ this.state = State.InCommentLike;
242
+ this.currentSequence = Sequences.CdataEnd;
243
+ this.sequenceIndex = 0;
244
+ this.sectionStart = this.index + 1;
245
+ }
246
+ }
247
+ else {
248
+ this.sequenceIndex = 0;
249
+ this.state = State.InDeclaration;
250
+ this.stateInDeclaration(c); // Reconsume the character
251
+ }
252
+ };
253
+ /**
254
+ * When we wait for one specific character, we can speed things up
255
+ * by skipping through the buffer until we find it.
256
+ *
257
+ * @returns Whether the character was found.
258
+ */
259
+ Tokenizer.prototype.fastForwardTo = function (c) {
260
+ while (++this.index < this.buffer.length + this.offset) {
261
+ if (this.buffer.charCodeAt(this.index - this.offset) === c) {
262
+ return true;
263
+ }
264
+ }
265
+ /*
266
+ * We increment the index at the end of the `parse` loop,
267
+ * so set it to `buffer.length - 1` here.
268
+ *
269
+ * TODO: Refactor `parse` to increment index before calling states.
270
+ */
271
+ this.index = this.buffer.length + this.offset - 1;
272
+ return false;
273
+ };
274
+ /**
275
+ * Comments and CDATA end with `-->` and `]]>`.
276
+ *
277
+ * Their common qualities are:
278
+ * - Their end sequences have a distinct character they start with.
279
+ * - That character is then repeated, so we have to check multiple repeats.
280
+ * - All characters but the start character of the sequence can be skipped.
281
+ */
282
+ Tokenizer.prototype.stateInCommentLike = function (c) {
283
+ if (c === this.currentSequence[this.sequenceIndex]) {
284
+ if (++this.sequenceIndex === this.currentSequence.length) {
285
+ if (this.currentSequence === Sequences.CdataEnd) {
286
+ this.cbs.oncdata(this.sectionStart, this.index, 2);
287
+ }
288
+ else {
289
+ this.cbs.oncomment(this.sectionStart, this.index, 2);
290
+ }
291
+ this.sequenceIndex = 0;
292
+ this.sectionStart = this.index + 1;
293
+ this.state = State.Text;
294
+ }
295
+ }
296
+ else if (this.sequenceIndex === 0) {
297
+ // Fast-forward to the first character of the sequence
298
+ if (this.fastForwardTo(this.currentSequence[0])) {
299
+ this.sequenceIndex = 1;
300
+ }
301
+ }
302
+ else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
303
+ // Allow long sequences, eg. --->, ]]]>
304
+ this.sequenceIndex = 0;
305
+ }
306
+ };
307
+ /**
308
+ * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
309
+ *
310
+ * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
311
+ * We allow anything that wouldn't end the tag.
312
+ */
313
+ Tokenizer.prototype.isTagStartChar = function (c) {
314
+ return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
315
+ };
316
+ Tokenizer.prototype.startSpecial = function (sequence, offset) {
317
+ this.isSpecial = true;
318
+ this.currentSequence = sequence;
319
+ this.sequenceIndex = offset;
320
+ this.state = State.SpecialStartSequence;
321
+ };
322
+ Tokenizer.prototype.stateBeforeTagName = function (c) {
323
+ if (c === CharCodes.ExclamationMark) {
324
+ this.state = State.BeforeDeclaration;
325
+ this.sectionStart = this.index + 1;
326
+ }
327
+ else if (c === CharCodes.Questionmark) {
328
+ this.state = State.InProcessingInstruction;
329
+ this.sectionStart = this.index + 1;
330
+ }
331
+ else if (this.isTagStartChar(c)) {
332
+ var lower = c | 0x20;
333
+ this.sectionStart = this.index;
334
+ if (this.xmlMode) {
335
+ this.state = State.InTagName;
336
+ }
337
+ else if (lower === Sequences.ScriptEnd[2]) {
338
+ this.state = State.BeforeSpecialS;
339
+ }
340
+ else if (lower === Sequences.TitleEnd[2]) {
341
+ this.state = State.BeforeSpecialT;
342
+ }
343
+ else {
344
+ this.state = State.InTagName;
345
+ }
346
+ }
347
+ else if (c === CharCodes.Slash) {
348
+ this.state = State.BeforeClosingTagName;
349
+ }
350
+ else {
351
+ this.state = State.Text;
352
+ this.stateText(c);
353
+ }
354
+ };
355
+ Tokenizer.prototype.stateInTagName = function (c) {
356
+ if (isEndOfTagSection(c)) {
357
+ this.cbs.onopentagname(this.sectionStart, this.index);
358
+ this.sectionStart = -1;
359
+ this.state = State.BeforeAttributeName;
360
+ this.stateBeforeAttributeName(c);
361
+ }
362
+ };
363
+ Tokenizer.prototype.stateBeforeClosingTagName = function (c) {
364
+ if (isWhitespace(c)) ;
365
+ else if (c === CharCodes.Gt) {
366
+ this.state = State.Text;
367
+ }
368
+ else {
369
+ this.state = this.isTagStartChar(c)
370
+ ? State.InClosingTagName
371
+ : State.InSpecialComment;
372
+ this.sectionStart = this.index;
373
+ }
374
+ };
375
+ Tokenizer.prototype.stateInClosingTagName = function (c) {
376
+ if (c === CharCodes.Gt || isWhitespace(c)) {
377
+ this.cbs.onclosetag(this.sectionStart, this.index);
378
+ this.sectionStart = -1;
379
+ this.state = State.AfterClosingTagName;
380
+ this.stateAfterClosingTagName(c);
381
+ }
382
+ };
383
+ Tokenizer.prototype.stateAfterClosingTagName = function (c) {
384
+ // Skip everything until ">"
385
+ if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
386
+ this.state = State.Text;
387
+ this.sectionStart = this.index + 1;
388
+ }
389
+ };
390
+ Tokenizer.prototype.stateBeforeAttributeName = function (c) {
391
+ if (c === CharCodes.Gt) {
392
+ this.cbs.onopentagend(this.index);
393
+ if (this.isSpecial) {
394
+ this.state = State.InSpecialTag;
395
+ this.sequenceIndex = 0;
396
+ }
397
+ else {
398
+ this.state = State.Text;
399
+ }
400
+ this.sectionStart = this.index + 1;
401
+ }
402
+ else if (c === CharCodes.Slash) {
403
+ this.state = State.InSelfClosingTag;
404
+ }
405
+ else if (!isWhitespace(c)) {
406
+ this.state = State.InAttributeName;
407
+ this.sectionStart = this.index;
408
+ }
409
+ };
410
+ Tokenizer.prototype.stateInSelfClosingTag = function (c) {
411
+ if (c === CharCodes.Gt) {
412
+ this.cbs.onselfclosingtag(this.index);
413
+ this.state = State.Text;
414
+ this.sectionStart = this.index + 1;
415
+ this.isSpecial = false; // Reset special state, in case of self-closing special tags
416
+ }
417
+ else if (!isWhitespace(c)) {
418
+ this.state = State.BeforeAttributeName;
419
+ this.stateBeforeAttributeName(c);
420
+ }
421
+ };
422
+ Tokenizer.prototype.stateInAttributeName = function (c) {
423
+ if (c === CharCodes.Eq || isEndOfTagSection(c)) {
424
+ this.cbs.onattribname(this.sectionStart, this.index);
425
+ this.sectionStart = this.index;
426
+ this.state = State.AfterAttributeName;
427
+ this.stateAfterAttributeName(c);
428
+ }
429
+ };
430
+ Tokenizer.prototype.stateAfterAttributeName = function (c) {
431
+ if (c === CharCodes.Eq) {
432
+ this.state = State.BeforeAttributeValue;
433
+ }
434
+ else if (c === CharCodes.Slash || c === CharCodes.Gt) {
435
+ this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
436
+ this.sectionStart = -1;
437
+ this.state = State.BeforeAttributeName;
438
+ this.stateBeforeAttributeName(c);
439
+ }
440
+ else if (!isWhitespace(c)) {
441
+ this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
442
+ this.state = State.InAttributeName;
443
+ this.sectionStart = this.index;
444
+ }
445
+ };
446
+ Tokenizer.prototype.stateBeforeAttributeValue = function (c) {
447
+ if (c === CharCodes.DoubleQuote) {
448
+ this.state = State.InAttributeValueDq;
449
+ this.sectionStart = this.index + 1;
450
+ }
451
+ else if (c === CharCodes.SingleQuote) {
452
+ this.state = State.InAttributeValueSq;
453
+ this.sectionStart = this.index + 1;
454
+ }
455
+ else if (!isWhitespace(c)) {
456
+ this.sectionStart = this.index;
457
+ this.state = State.InAttributeValueNq;
458
+ this.stateInAttributeValueNoQuotes(c); // Reconsume token
459
+ }
460
+ };
461
+ Tokenizer.prototype.handleInAttributeValue = function (c, quote) {
462
+ if (c === quote ||
463
+ (!this.decodeEntities && this.fastForwardTo(quote))) {
464
+ this.cbs.onattribdata(this.sectionStart, this.index);
465
+ this.sectionStart = -1;
466
+ this.cbs.onattribend(quote === CharCodes.DoubleQuote
467
+ ? QuoteType.Double
468
+ : QuoteType.Single, this.index + 1);
469
+ this.state = State.BeforeAttributeName;
470
+ }
471
+ else if (this.decodeEntities && c === CharCodes.Amp) {
472
+ this.startEntity();
473
+ }
474
+ };
475
+ Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) {
476
+ this.handleInAttributeValue(c, CharCodes.DoubleQuote);
477
+ };
478
+ Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) {
479
+ this.handleInAttributeValue(c, CharCodes.SingleQuote);
480
+ };
481
+ Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) {
482
+ if (isWhitespace(c) || c === CharCodes.Gt) {
483
+ this.cbs.onattribdata(this.sectionStart, this.index);
484
+ this.sectionStart = -1;
485
+ this.cbs.onattribend(QuoteType.Unquoted, this.index);
486
+ this.state = State.BeforeAttributeName;
487
+ this.stateBeforeAttributeName(c);
488
+ }
489
+ else if (this.decodeEntities && c === CharCodes.Amp) {
490
+ this.startEntity();
491
+ }
492
+ };
493
+ Tokenizer.prototype.stateBeforeDeclaration = function (c) {
494
+ if (c === CharCodes.OpeningSquareBracket) {
495
+ this.state = State.CDATASequence;
496
+ this.sequenceIndex = 0;
497
+ }
498
+ else {
499
+ this.state =
500
+ c === CharCodes.Dash
501
+ ? State.BeforeComment
502
+ : State.InDeclaration;
503
+ }
504
+ };
505
+ Tokenizer.prototype.stateInDeclaration = function (c) {
506
+ if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
507
+ this.cbs.ondeclaration(this.sectionStart, this.index);
508
+ this.state = State.Text;
509
+ this.sectionStart = this.index + 1;
510
+ }
511
+ };
512
+ Tokenizer.prototype.stateInProcessingInstruction = function (c) {
513
+ if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
514
+ this.cbs.onprocessinginstruction(this.sectionStart, this.index);
515
+ this.state = State.Text;
516
+ this.sectionStart = this.index + 1;
517
+ }
518
+ };
519
+ Tokenizer.prototype.stateBeforeComment = function (c) {
520
+ if (c === CharCodes.Dash) {
521
+ this.state = State.InCommentLike;
522
+ this.currentSequence = Sequences.CommentEnd;
523
+ // Allow short comments (eg. <!-->)
524
+ this.sequenceIndex = 2;
525
+ this.sectionStart = this.index + 1;
526
+ }
527
+ else {
528
+ this.state = State.InDeclaration;
529
+ }
530
+ };
531
+ Tokenizer.prototype.stateInSpecialComment = function (c) {
532
+ if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {
533
+ this.cbs.oncomment(this.sectionStart, this.index, 0);
534
+ this.state = State.Text;
535
+ this.sectionStart = this.index + 1;
536
+ }
537
+ };
538
+ Tokenizer.prototype.stateBeforeSpecialS = function (c) {
539
+ var lower = c | 0x20;
540
+ if (lower === Sequences.ScriptEnd[3]) {
541
+ this.startSpecial(Sequences.ScriptEnd, 4);
542
+ }
543
+ else if (lower === Sequences.StyleEnd[3]) {
544
+ this.startSpecial(Sequences.StyleEnd, 4);
545
+ }
546
+ else {
547
+ this.state = State.InTagName;
548
+ this.stateInTagName(c); // Consume the token again
549
+ }
550
+ };
551
+ Tokenizer.prototype.stateBeforeSpecialT = function (c) {
552
+ var lower = c | 0x20;
553
+ if (lower === Sequences.TitleEnd[3]) {
554
+ this.startSpecial(Sequences.TitleEnd, 4);
555
+ }
556
+ else if (lower === Sequences.TextareaEnd[3]) {
557
+ this.startSpecial(Sequences.TextareaEnd, 4);
558
+ }
559
+ else {
560
+ this.state = State.InTagName;
561
+ this.stateInTagName(c); // Consume the token again
562
+ }
563
+ };
564
+ Tokenizer.prototype.startEntity = function () {
565
+ this.baseState = this.state;
566
+ this.state = State.InEntity;
567
+ this.entityStart = this.index;
568
+ this.entityDecoder.startEntity(this.xmlMode
569
+ ? decode_js_1.DecodingMode.Strict
570
+ : this.baseState === State.Text ||
571
+ this.baseState === State.InSpecialTag
572
+ ? decode_js_1.DecodingMode.Legacy
573
+ : decode_js_1.DecodingMode.Attribute);
574
+ };
575
+ Tokenizer.prototype.stateInEntity = function () {
576
+ var length = this.entityDecoder.write(this.buffer, this.index - this.offset);
577
+ // If `length` is positive, we are done with the entity.
578
+ if (length >= 0) {
579
+ this.state = this.baseState;
580
+ if (length === 0) {
581
+ this.index = this.entityStart;
582
+ }
583
+ }
584
+ else {
585
+ // Mark buffer as consumed.
586
+ this.index = this.offset + this.buffer.length - 1;
587
+ }
588
+ };
589
+ /**
590
+ * Remove data that has already been consumed from the buffer.
591
+ */
592
+ Tokenizer.prototype.cleanup = function () {
593
+ // If we are inside of text or attributes, emit what we already have.
594
+ if (this.running && this.sectionStart !== this.index) {
595
+ if (this.state === State.Text ||
596
+ (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {
597
+ this.cbs.ontext(this.sectionStart, this.index);
598
+ this.sectionStart = this.index;
599
+ }
600
+ else if (this.state === State.InAttributeValueDq ||
601
+ this.state === State.InAttributeValueSq ||
602
+ this.state === State.InAttributeValueNq) {
603
+ this.cbs.onattribdata(this.sectionStart, this.index);
604
+ this.sectionStart = this.index;
605
+ }
606
+ }
607
+ };
608
+ Tokenizer.prototype.shouldContinue = function () {
609
+ return this.index < this.buffer.length + this.offset && this.running;
610
+ };
611
+ /**
612
+ * Iterates through the buffer, calling the function corresponding to the current state.
613
+ *
614
+ * States that are more likely to be hit are higher up, as a performance improvement.
615
+ */
616
+ Tokenizer.prototype.parse = function () {
617
+ while (this.shouldContinue()) {
618
+ var c = this.buffer.charCodeAt(this.index - this.offset);
619
+ switch (this.state) {
620
+ case State.Text: {
621
+ this.stateText(c);
622
+ break;
623
+ }
624
+ case State.SpecialStartSequence: {
625
+ this.stateSpecialStartSequence(c);
626
+ break;
627
+ }
628
+ case State.InSpecialTag: {
629
+ this.stateInSpecialTag(c);
630
+ break;
631
+ }
632
+ case State.CDATASequence: {
633
+ this.stateCDATASequence(c);
634
+ break;
635
+ }
636
+ case State.InAttributeValueDq: {
637
+ this.stateInAttributeValueDoubleQuotes(c);
638
+ break;
639
+ }
640
+ case State.InAttributeName: {
641
+ this.stateInAttributeName(c);
642
+ break;
643
+ }
644
+ case State.InCommentLike: {
645
+ this.stateInCommentLike(c);
646
+ break;
647
+ }
648
+ case State.InSpecialComment: {
649
+ this.stateInSpecialComment(c);
650
+ break;
651
+ }
652
+ case State.BeforeAttributeName: {
653
+ this.stateBeforeAttributeName(c);
654
+ break;
655
+ }
656
+ case State.InTagName: {
657
+ this.stateInTagName(c);
658
+ break;
659
+ }
660
+ case State.InClosingTagName: {
661
+ this.stateInClosingTagName(c);
662
+ break;
663
+ }
664
+ case State.BeforeTagName: {
665
+ this.stateBeforeTagName(c);
666
+ break;
667
+ }
668
+ case State.AfterAttributeName: {
669
+ this.stateAfterAttributeName(c);
670
+ break;
671
+ }
672
+ case State.InAttributeValueSq: {
673
+ this.stateInAttributeValueSingleQuotes(c);
674
+ break;
675
+ }
676
+ case State.BeforeAttributeValue: {
677
+ this.stateBeforeAttributeValue(c);
678
+ break;
679
+ }
680
+ case State.BeforeClosingTagName: {
681
+ this.stateBeforeClosingTagName(c);
682
+ break;
683
+ }
684
+ case State.AfterClosingTagName: {
685
+ this.stateAfterClosingTagName(c);
686
+ break;
687
+ }
688
+ case State.BeforeSpecialS: {
689
+ this.stateBeforeSpecialS(c);
690
+ break;
691
+ }
692
+ case State.BeforeSpecialT: {
693
+ this.stateBeforeSpecialT(c);
694
+ break;
695
+ }
696
+ case State.InAttributeValueNq: {
697
+ this.stateInAttributeValueNoQuotes(c);
698
+ break;
699
+ }
700
+ case State.InSelfClosingTag: {
701
+ this.stateInSelfClosingTag(c);
702
+ break;
703
+ }
704
+ case State.InDeclaration: {
705
+ this.stateInDeclaration(c);
706
+ break;
707
+ }
708
+ case State.BeforeDeclaration: {
709
+ this.stateBeforeDeclaration(c);
710
+ break;
711
+ }
712
+ case State.BeforeComment: {
713
+ this.stateBeforeComment(c);
714
+ break;
715
+ }
716
+ case State.InProcessingInstruction: {
717
+ this.stateInProcessingInstruction(c);
718
+ break;
719
+ }
720
+ case State.InEntity: {
721
+ this.stateInEntity();
722
+ break;
723
+ }
724
+ }
725
+ this.index++;
726
+ }
727
+ this.cleanup();
728
+ };
729
+ Tokenizer.prototype.finish = function () {
730
+ if (this.state === State.InEntity) {
731
+ this.entityDecoder.end();
732
+ this.state = this.baseState;
733
+ }
734
+ this.handleTrailingData();
735
+ this.cbs.onend();
736
+ };
737
+ /** Handle any trailing data. */
738
+ Tokenizer.prototype.handleTrailingData = function () {
739
+ var endIndex = this.buffer.length + this.offset;
740
+ // If there is no remaining data, we are done.
741
+ if (this.sectionStart >= endIndex) {
742
+ return;
743
+ }
744
+ if (this.state === State.InCommentLike) {
745
+ if (this.currentSequence === Sequences.CdataEnd) {
746
+ this.cbs.oncdata(this.sectionStart, endIndex, 0);
747
+ }
748
+ else {
749
+ this.cbs.oncomment(this.sectionStart, endIndex, 0);
750
+ }
751
+ }
752
+ else if (this.state === State.InTagName ||
753
+ this.state === State.BeforeAttributeName ||
754
+ this.state === State.BeforeAttributeValue ||
755
+ this.state === State.AfterAttributeName ||
756
+ this.state === State.InAttributeName ||
757
+ this.state === State.InAttributeValueSq ||
758
+ this.state === State.InAttributeValueDq ||
759
+ this.state === State.InAttributeValueNq ||
760
+ this.state === State.InClosingTagName) ;
761
+ else {
762
+ this.cbs.ontext(this.sectionStart, endIndex);
763
+ }
764
+ };
765
+ Tokenizer.prototype.emitCodePoint = function (cp, consumed) {
766
+ if (this.baseState !== State.Text &&
767
+ this.baseState !== State.InSpecialTag) {
768
+ if (this.sectionStart < this.entityStart) {
769
+ this.cbs.onattribdata(this.sectionStart, this.entityStart);
770
+ }
771
+ this.sectionStart = this.entityStart + consumed;
772
+ this.index = this.sectionStart - 1;
773
+ this.cbs.onattribentity(cp);
774
+ }
775
+ else {
776
+ if (this.sectionStart < this.entityStart) {
777
+ this.cbs.ontext(this.sectionStart, this.entityStart);
778
+ }
779
+ this.sectionStart = this.entityStart + consumed;
780
+ this.index = this.sectionStart - 1;
781
+ this.cbs.ontextentity(cp, this.sectionStart);
782
+ }
783
+ };
784
+ return Tokenizer;
785
+ }());
786
+ Tokenizer$1.default = Tokenizer;
787
+ //# sourceMappingURL=Tokenizer.js.map