@sparrowengg/integrations-templates-frontend 1.2.5 → 1.2.6

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