@nstudio/nativescript-compiler 0.0.0-stage → 9.2.0-alpha.9

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 (1610) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +72 -2
  3. package/bin/build-dist.mjs +145 -0
  4. package/bin/ns-compiled-adapter.js +46 -0
  5. package/bin/ns-compiled-doctor.js +15 -0
  6. package/bin/ns-compiled-retrace.js +16 -0
  7. package/bin/ns-compiled-verify.js +15 -0
  8. package/bin/ns-compiled.js +26 -0
  9. package/bin/strip-types.js +18 -0
  10. package/config.d.ts +41 -0
  11. package/dist/adapters/active.js +59 -0
  12. package/dist/adapters/first-party.js +12 -0
  13. package/dist/adapters/framework.js +135 -0
  14. package/dist/adapters/hooks.js +115 -0
  15. package/dist/adapters/load.js +188 -0
  16. package/dist/api/adapter-api.js +2 -0
  17. package/dist/api/binding-api.js +11 -0
  18. package/dist/api/elements.js +21 -0
  19. package/dist/api/ir.js +29 -0
  20. package/dist/api/listview.js +27 -0
  21. package/dist/api/rewrite.js +98 -0
  22. package/dist/api/typescript-internal.d.ts +35 -0
  23. package/dist/cli/commands/compile-android.cjs +79 -0
  24. package/dist/cli/commands/compile-doctor.cjs +45 -0
  25. package/dist/cli/commands/compile-ios.cjs +77 -0
  26. package/dist/cli/commands/compile-retrace.cjs +40 -0
  27. package/dist/cli/commands/compile-verify.cjs +73 -0
  28. package/dist/cli/contracts.cjs +36 -0
  29. package/dist/cli/runtime.cjs +166 -0
  30. package/dist/css/css.js +118 -0
  31. package/dist/css/worker.js +242 -0
  32. package/dist/driver/cli.js +95 -0
  33. package/dist/driver/compile.js +571 -0
  34. package/dist/driver/contract.js +136 -0
  35. package/dist/driver/mirror.js +71 -0
  36. package/dist/driver/paths.js +19 -0
  37. package/dist/driver/preflight.js +206 -0
  38. package/dist/driver/toolchain.js +46 -0
  39. package/dist/driver/unimplemented.js +326 -0
  40. package/dist/kit/core-source.js +107 -0
  41. package/dist/kit/kit-index.js +105 -0
  42. package/dist/kit/manifest.js +468 -0
  43. package/dist/kit/overlay.js +56 -0
  44. package/dist/kit/swift-declarations.js +643 -0
  45. package/dist/kotlin/access.js +624 -0
  46. package/dist/kotlin/app-modules.js +111 -0
  47. package/dist/kotlin/arguments.js +397 -0
  48. package/dist/kotlin/assignment.js +226 -0
  49. package/dist/kotlin/builtins.js +575 -0
  50. package/dist/kotlin/calls.js +516 -0
  51. package/dist/kotlin/checked.js +61 -0
  52. package/dist/kotlin/class-accessors.js +129 -0
  53. package/dist/kotlin/class-constructor.js +117 -0
  54. package/dist/kotlin/class-declaration.js +308 -0
  55. package/dist/kotlin/class-fields.js +361 -0
  56. package/dist/kotlin/class-methods.js +213 -0
  57. package/dist/kotlin/classes.js +333 -0
  58. package/dist/kotlin/components.js +445 -0
  59. package/dist/kotlin/construction.js +228 -0
  60. package/dist/kotlin/control-flow.js +188 -0
  61. package/dist/kotlin/conversion.js +513 -0
  62. package/dist/kotlin/core-api.js +762 -0
  63. package/dist/kotlin/core-index.js +228 -0
  64. package/dist/kotlin/declarations.js +461 -0
  65. package/dist/kotlin/diagnostics.js +28 -0
  66. package/dist/kotlin/expression-statements.js +227 -0
  67. package/dist/kotlin/expressions.js +461 -0
  68. package/dist/kotlin/functions.js +474 -0
  69. package/dist/kotlin/global-calls.js +307 -0
  70. package/dist/kotlin/install.js +89 -0
  71. package/dist/kotlin/key-plans.js +117 -0
  72. package/dist/kotlin/kit-gen.js +581 -0
  73. package/dist/kotlin/ktfmt.js +60 -0
  74. package/dist/kotlin/library.js +62 -0
  75. package/dist/kotlin/literals.js +593 -0
  76. package/dist/kotlin/loops.js +184 -0
  77. package/dist/kotlin/mixins.js +103 -0
  78. package/dist/kotlin/modules.js +769 -0
  79. package/dist/kotlin/names.js +274 -0
  80. package/dist/kotlin/narrowing.js +180 -0
  81. package/dist/kotlin/native/api.js +117 -0
  82. package/dist/kotlin/native/bridging.js +254 -0
  83. package/dist/kotlin/native/calls.js +408 -0
  84. package/dist/kotlin/native/classfiles.js +524 -0
  85. package/dist/kotlin/native/classpath.js +32 -0
  86. package/dist/kotlin/native/conversions.js +280 -0
  87. package/dist/kotlin/native/extend.js +302 -0
  88. package/dist/kotlin/native/members.js +240 -0
  89. package/dist/kotlin/native/overloads.js +253 -0
  90. package/dist/kotlin/native/subclasses.js +378 -0
  91. package/dist/kotlin/native/types.js +421 -0
  92. package/dist/kotlin/operators.js +445 -0
  93. package/dist/kotlin/optional-chains.js +279 -0
  94. package/dist/kotlin/overrides.js +825 -0
  95. package/dist/kotlin/placement.js +746 -0
  96. package/dist/kotlin/prototype-calls.js +154 -0
  97. package/dist/kotlin/render.js +363 -0
  98. package/dist/kotlin/state-backend.js +123 -0
  99. package/dist/kotlin/statements.js +426 -0
  100. package/dist/kotlin/static-calls.js +296 -0
  101. package/dist/kotlin/syntax.js +689 -0
  102. package/dist/kotlin/translator-types.js +1 -0
  103. package/dist/kotlin/translator.js +806 -0
  104. package/dist/kotlin/type-facts.js +414 -0
  105. package/dist/kotlin/type-tests.js +250 -0
  106. package/dist/kotlin/types.js +655 -0
  107. package/dist/kotlin/untyped-values.js +354 -0
  108. package/dist/plugins/bindings-android.js +69 -0
  109. package/dist/plugins/bindings.js +93 -0
  110. package/dist/plugins/native-android.js +582 -0
  111. package/dist/plugins/native-ios.js +632 -0
  112. package/dist/plugins/resolve.js +108 -0
  113. package/dist/plugins/source.js +1040 -0
  114. package/dist/program/app-modules.js +52 -0
  115. package/dist/program/app-paths.js +60 -0
  116. package/dist/program/build-caches.js +14 -0
  117. package/dist/program/build-context.js +48 -0
  118. package/dist/program/constructor-factories.js +134 -0
  119. package/dist/program/core-facts.js +151 -0
  120. package/dist/program/core-patches.js +59 -0
  121. package/dist/program/env.js +4 -0
  122. package/dist/program/module-order.js +123 -0
  123. package/dist/program/order.js +23 -0
  124. package/dist/program/patterns.js +99 -0
  125. package/dist/program/platform.js +401 -0
  126. package/dist/program/program.js +726 -0
  127. package/dist/program/properties.js +61 -0
  128. package/dist/program/reach.js +444 -0
  129. package/dist/program/source-lines.js +268 -0
  130. package/dist/program/stable-names.js +112 -0
  131. package/dist/semantics/apis/api.js +31 -0
  132. package/dist/semantics/apis/array.js +69 -0
  133. package/dist/semantics/apis/bigint.js +53 -0
  134. package/dist/semantics/apis/console.js +29 -0
  135. package/dist/semantics/apis/date.js +7 -0
  136. package/dist/semantics/apis/globals.js +40 -0
  137. package/dist/semantics/apis/json.js +6 -0
  138. package/dist/semantics/apis/mapset.js +21 -0
  139. package/dist/semantics/apis/math.js +48 -0
  140. package/dist/semantics/apis/number.js +33 -0
  141. package/dist/semantics/apis/object.js +25 -0
  142. package/dist/semantics/apis/operators.js +316 -0
  143. package/dist/semantics/apis/promise.js +22 -0
  144. package/dist/semantics/apis/regexp.js +15 -0
  145. package/dist/semantics/apis/statics.js +61 -0
  146. package/dist/semantics/apis/string.js +45 -0
  147. package/dist/semantics/ast.js +315 -0
  148. package/dist/semantics/async.js +582 -0
  149. package/dist/semantics/class-plan.js +168 -0
  150. package/dist/semantics/classes.js +425 -0
  151. package/dist/semantics/config.js +29 -0
  152. package/dist/semantics/constant-init.js +107 -0
  153. package/dist/semantics/conversion.js +255 -0
  154. package/dist/semantics/decision-trace.js +304 -0
  155. package/dist/semantics/facts.js +433 -0
  156. package/dist/semantics/forms/by-name.js +338 -0
  157. package/dist/semantics/forms/flow.js +336 -0
  158. package/dist/semantics/forms/forms.js +311 -0
  159. package/dist/semantics/forms/observers.js +513 -0
  160. package/dist/semantics/forms/open.js +218 -0
  161. package/dist/semantics/forms/place-calls.js +387 -0
  162. package/dist/semantics/forms/placements.js +296 -0
  163. package/dist/semantics/forms/results.js +307 -0
  164. package/dist/semantics/forms/union-find.js +157 -0
  165. package/dist/semantics/globals.js +46 -0
  166. package/dist/semantics/lang/arrays.js +238 -0
  167. package/dist/semantics/lang/fields.js +211 -0
  168. package/dist/semantics/lang/members.js +277 -0
  169. package/dist/semantics/lang/prototypes.js +180 -0
  170. package/dist/semantics/lang/this-args.js +189 -0
  171. package/dist/semantics/lang.js +232 -0
  172. package/dist/semantics/ledger.js +157 -0
  173. package/dist/semantics/limits.js +11 -0
  174. package/dist/semantics/losses.js +201 -0
  175. package/dist/semantics/lowering-methods.js +42 -0
  176. package/dist/semantics/marks.js +39 -0
  177. package/dist/semantics/nullish.js +918 -0
  178. package/dist/semantics/observers.js +1 -0
  179. package/dist/semantics/placement.js +698 -0
  180. package/dist/semantics/platform-globals.js +20 -0
  181. package/dist/semantics/read-sites.js +29 -0
  182. package/dist/semantics/refusals.js +206 -0
  183. package/dist/semantics/refuse-construction.js +64 -0
  184. package/dist/semantics/refuse-receivers.js +189 -0
  185. package/dist/semantics/refuse-scope.js +82 -0
  186. package/dist/semantics/regexp.js +219 -0
  187. package/dist/semantics/result-shapes.js +203 -0
  188. package/dist/semantics/runtime.js +482 -0
  189. package/dist/semantics/shape-defined-keys.js +146 -0
  190. package/dist/semantics/shape-instance-keys.js +230 -0
  191. package/dist/semantics/shape-map.js +72 -0
  192. package/dist/semantics/shapes.js +660 -0
  193. package/dist/semantics/sharing.js +406 -0
  194. package/dist/semantics/signals.js +166 -0
  195. package/dist/semantics/spelled.js +45 -0
  196. package/dist/semantics/states/by-name.js +46 -0
  197. package/dist/semantics/states/elements.js +310 -0
  198. package/dist/semantics/states/fields.js +308 -0
  199. package/dist/semantics/states/foreign.js +208 -0
  200. package/dist/semantics/states/lenient.js +246 -0
  201. package/dist/semantics/states/missing.js +289 -0
  202. package/dist/semantics/states/nil.js +223 -0
  203. package/dist/semantics/states/parameters.js +191 -0
  204. package/dist/semantics/states/predicates.js +232 -0
  205. package/dist/semantics/states/reads.js +247 -0
  206. package/dist/semantics/states/results.js +113 -0
  207. package/dist/semantics/states/untrusted.js +141 -0
  208. package/dist/semantics/states/untyped.js +194 -0
  209. package/dist/semantics/states/value-states.js +422 -0
  210. package/dist/semantics/tdz.js +106 -0
  211. package/dist/semantics/threading.js +77 -0
  212. package/dist/semantics/throws.js +878 -0
  213. package/dist/semantics/top-names.js +59 -0
  214. package/dist/semantics/translator-methods.js +597 -0
  215. package/dist/semantics/trust.js +321 -0
  216. package/dist/semantics/type-methods.js +168 -0
  217. package/dist/semantics/type-step.js +116 -0
  218. package/dist/semantics/types.js +456 -0
  219. package/dist/semantics/worker-state.js +198 -0
  220. package/dist/swift/access.js +749 -0
  221. package/dist/swift/app-modules.js +41 -0
  222. package/dist/swift/arguments.js +236 -0
  223. package/dist/swift/assignment.js +270 -0
  224. package/dist/swift/availability.js +146 -0
  225. package/dist/swift/builtins.js +822 -0
  226. package/dist/swift/calls.js +493 -0
  227. package/dist/swift/casts.js +218 -0
  228. package/dist/swift/checked.js +433 -0
  229. package/dist/swift/class-accessors.js +139 -0
  230. package/dist/swift/class-constructor.js +139 -0
  231. package/dist/swift/class-declaration.js +282 -0
  232. package/dist/swift/class-fields.js +360 -0
  233. package/dist/swift/class-methods.js +229 -0
  234. package/dist/swift/classes.js +522 -0
  235. package/dist/swift/components.js +386 -0
  236. package/dist/swift/construction.js +287 -0
  237. package/dist/swift/control-flow.js +210 -0
  238. package/dist/swift/conversion.js +425 -0
  239. package/dist/swift/core-api.js +1068 -0
  240. package/dist/swift/declarations.js +389 -0
  241. package/dist/swift/enums.js +58 -0
  242. package/dist/swift/expression-statements.js +312 -0
  243. package/dist/swift/expressions.js +568 -0
  244. package/dist/swift/from-any.js +316 -0
  245. package/dist/swift/functions.js +487 -0
  246. package/dist/swift/generics.js +124 -0
  247. package/dist/swift/global-calls.js +217 -0
  248. package/dist/swift/install.js +109 -0
  249. package/dist/swift/key-plans.js +136 -0
  250. package/dist/swift/kit-gen.js +605 -0
  251. package/dist/swift/lenient.js +468 -0
  252. package/dist/swift/library.js +109 -0
  253. package/dist/swift/literals.js +509 -0
  254. package/dist/swift/loops.js +244 -0
  255. package/dist/swift/marks.js +212 -0
  256. package/dist/swift/members.js +253 -0
  257. package/dist/swift/method-values.js +177 -0
  258. package/dist/swift/mixins.js +113 -0
  259. package/dist/swift/modules.js +969 -0
  260. package/dist/swift/names.js +371 -0
  261. package/dist/swift/narrowing.js +170 -0
  262. package/dist/swift/native/api.js +269 -0
  263. package/dist/swift/native/bridging.js +240 -0
  264. package/dist/swift/native/calls.js +586 -0
  265. package/dist/swift/native/conversions.js +532 -0
  266. package/dist/swift/native/dispatch.js +218 -0
  267. package/dist/swift/native/members.js +416 -0
  268. package/dist/swift/native/sdk-tables.js +772 -0
  269. package/dist/swift/native/sdk-types.js +1 -0
  270. package/dist/swift/native/sdk.js +409 -0
  271. package/dist/swift/native/subclasses.js +533 -0
  272. package/dist/swift/object-classes.js +396 -0
  273. package/dist/swift/operators.js +571 -0
  274. package/dist/swift/optional-chains.js +405 -0
  275. package/dist/swift/parameters.js +210 -0
  276. package/dist/swift/placement.js +896 -0
  277. package/dist/swift/protocols.js +164 -0
  278. package/dist/swift/prototype-calls.js +227 -0
  279. package/dist/swift/render.js +385 -0
  280. package/dist/swift/results.js +370 -0
  281. package/dist/swift/state-backend.js +243 -0
  282. package/dist/swift/statements.js +505 -0
  283. package/dist/swift/static-calls.js +320 -0
  284. package/dist/swift/syntax.js +916 -0
  285. package/dist/swift/translator-types.js +1 -0
  286. package/dist/swift/translator.js +886 -0
  287. package/dist/swift/type-facts.js +539 -0
  288. package/dist/swift/type-tests.js +211 -0
  289. package/dist/swift/types.js +659 -0
  290. package/dist/targets/android/build.js +598 -0
  291. package/dist/targets/android/compose-mapping.js +218 -0
  292. package/dist/targets/android/deprecations.js +81 -0
  293. package/dist/targets/android/resources.js +80 -0
  294. package/dist/targets/ios/build.js +583 -0
  295. package/dist/targets/ios/core-native.js +149 -0
  296. package/dist/targets/ios/dependencies.js +464 -0
  297. package/dist/targets/ios/plist.js +127 -0
  298. package/dist/targets/ios/resources.js +285 -0
  299. package/dist/targets/ios/retrace.js +196 -0
  300. package/dist/targets/ios/signing.js +84 -0
  301. package/dist/targets/ios/xcodegen.js +39 -0
  302. package/dist/targets/resources.js +180 -0
  303. package/dist/template/model.js +38 -0
  304. package/dist/template/plan.js +576 -0
  305. package/dist/tools/doctor.js +172 -0
  306. package/dist/tools/retrace.js +116 -0
  307. package/dist/tools/verify.js +330 -0
  308. package/dist/types/adapter-api.d.ts +683 -0
  309. package/dist/types/binding-api.d.ts +48 -0
  310. package/dist/types/elements.d.ts +10 -0
  311. package/dist/types/ir.d.ts +245 -0
  312. package/dist/types/listview.d.ts +15 -0
  313. package/dist/types/rewrite.d.ts +18 -0
  314. package/dist/types/typescript-internal.d.ts +35 -0
  315. package/dist/xml/app.js +65 -0
  316. package/dist/xml/bindings.js +308 -0
  317. package/dist/xml/contexts.js +296 -0
  318. package/dist/xml/fold.js +170 -0
  319. package/dist/xml/keys.js +146 -0
  320. package/dist/xml/pages.js +550 -0
  321. package/dist/xml/plan.js +650 -0
  322. package/docs/CLI.md +131 -0
  323. package/docs/cli/compile-android.md +30 -0
  324. package/docs/cli/compile-doctor.md +18 -0
  325. package/docs/cli/compile-ios.md +30 -0
  326. package/docs/cli/compile-retrace.md +18 -0
  327. package/docs/cli/compile-verify.md +18 -0
  328. package/docs/cli/compile.md +15 -0
  329. package/kit-android/build.gradle.kts +65 -0
  330. package/kit-android/consumer-rules.pro +7 -0
  331. package/kit-android/generated/kotlin/org/nativescript/kit/__Exports.kt +966 -0
  332. package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +125 -0
  333. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +39497 -0
  334. package/kit-android/generated/kotlin/org/nativescript/kit/abortcontroller_abortsignal.kt +101 -0
  335. package/kit-android/generated/kotlin/org/nativescript/kit/abortcontroller_index.kt +109 -0
  336. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +547 -0
  337. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_properties.kt +263 -0
  338. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_index.kt +6 -0
  339. package/kit-android/generated/kotlin/org/nativescript/kit/application_application.kt +2656 -0
  340. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +1932 -0
  341. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_interfaces.kt +6 -0
  342. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_shims.kt +111 -0
  343. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers.kt +198 -0
  344. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +270 -0
  345. package/kit-android/generated/kotlin/org/nativescript/kit/application_index.kt +6 -0
  346. package/kit-android/generated/kotlin/org/nativescript/kit/application_scene_delegate_bridge.kt +233 -0
  347. package/kit-android/generated/kotlin/org/nativescript/kit/application_settings_application_settings_common.kt +28 -0
  348. package/kit-android/generated/kotlin/org/nativescript/kit/application_settings_index.kt +188 -0
  349. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_common.kt +707 -0
  350. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_types.kt +6 -0
  351. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +368 -0
  352. package/kit-android/generated/kotlin/org/nativescript/kit/color_index.kt +37 -0
  353. package/kit-android/generated/kotlin/org/nativescript/kit/color_known_colors.kt +418 -0
  354. package/kit-android/generated/kotlin/org/nativescript/kit/com.tns.FragmentClass.kt +287 -0
  355. package/kit-android/generated/kotlin/org/nativescript/kit/com.tns.NativeScriptActivity.kt +263 -0
  356. package/kit-android/generated/kotlin/org/nativescript/kit/com.tns.OnBackPressedCallback.kt +116 -0
  357. package/kit-android/generated/kotlin/org/nativescript/kit/connectivity_index.kt +289 -0
  358. package/kit-android/generated/kotlin/org/nativescript/kit/core_types_animation_types.kt +56 -0
  359. package/kit-android/generated/kotlin/org/nativescript/kit/core_types_index.kt +427 -0
  360. package/kit-android/generated/kotlin/org/nativescript/kit/core_types_validators.kt +34 -0
  361. package/kit-android/generated/kotlin/org/nativescript/kit/css_CSS3Parser.kt +954 -0
  362. package/kit-android/generated/kotlin/org/nativescript/kit/css_CSSNativeScript.kt +205 -0
  363. package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +270 -0
  364. package/kit-android/generated/kotlin/org/nativescript/kit/css_parser.kt +885 -0
  365. package/kit-android/generated/kotlin/org/nativescript/kit/css_system_classes.kt +98 -0
  366. package/kit-android/generated/kotlin/org/nativescript/kit/css_value_reworkcss_value.kt +214 -0
  367. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +798 -0
  368. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +1175 -0
  369. package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +271 -0
  370. package/kit-android/generated/kotlin/org/nativescript/kit/file_system_file_system_access.kt +3828 -0
  371. package/kit-android/generated/kotlin/org/nativescript/kit/file_system_index.kt +1669 -0
  372. package/kit-android/generated/kotlin/org/nativescript/kit/fps_meter_fps_native.kt +177 -0
  373. package/kit-android/generated/kotlin/org/nativescript/kit/fps_meter_index.kt +93 -0
  374. package/kit-android/generated/kotlin/org/nativescript/kit/globals_global_utils.kt +185 -0
  375. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_interfaces.kt +14 -0
  376. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_http_request_common.kt +41 -0
  377. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +119 -0
  378. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +61 -0
  379. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +237 -0
  380. package/kit-android/generated/kotlin/org/nativescript/kit/http_index.kt +155 -0
  381. package/kit-android/generated/kotlin/org/nativescript/kit/image_asset_image_asset_common.kt +201 -0
  382. package/kit-android/generated/kotlin/org/nativescript/kit/image_asset_index.kt +119 -0
  383. package/kit-android/generated/kotlin/org/nativescript/kit/image_source_image_source_common.kt +26 -0
  384. package/kit-android/generated/kotlin/org/nativescript/kit/image_source_index.kt +846 -0
  385. package/kit-android/generated/kotlin/org/nativescript/kit/js_libs_easysax_easysax.kt +1045 -0
  386. package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +166 -0
  387. package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +391 -0
  388. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_helpers.kt +45 -0
  389. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_index.kt +185 -0
  390. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_non_bundle_workflow_compat.kt +262 -0
  391. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_qualifier_matcher_index.kt +305 -0
  392. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_index.kt +6 -0
  393. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_native_window.kt +397 -0
  394. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_native_window_common.kt +685 -0
  395. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_native_window_interfaces.kt +51 -0
  396. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_window_base.kt +223 -0
  397. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_index.kt +4 -0
  398. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +755 -0
  399. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_stringify.kt +212 -0
  400. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_types.kt +65 -0
  401. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptComponentCallbacks.kt +57 -0
  402. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +579 -0
  403. package/kit-android/generated/kotlin/org/nativescript/kit/platform_common.kt +20 -0
  404. package/kit-android/generated/kotlin/org/nativescript/kit/platform_device_index.kt +251 -0
  405. package/kit-android/generated/kotlin/org/nativescript/kit/platform_index.kt +6 -0
  406. package/kit-android/generated/kotlin/org/nativescript/kit/platform_screen_index.kt +183 -0
  407. package/kit-android/generated/kotlin/org/nativescript/kit/profiling_index.kt +485 -0
  408. package/kit-android/generated/kotlin/org/nativescript/kit/text_formatted_string.kt +6 -0
  409. package/kit-android/generated/kotlin/org/nativescript/kit/text_index.kt +15 -0
  410. package/kit-android/generated/kotlin/org/nativescript/kit/text_span.kt +6 -0
  411. package/kit-android/generated/kotlin/org/nativescript/kit/text_text_common.kt +277 -0
  412. package/kit-android/generated/kotlin/org/nativescript/kit/trace_index.kt +480 -0
  413. package/kit-android/generated/kotlin/org/nativescript/kit/ui_action_bar_action_bar_common.kt +1081 -0
  414. package/kit-android/generated/kotlin/org/nativescript/kit/ui_action_bar_index.kt +1207 -0
  415. package/kit-android/generated/kotlin/org/nativescript/kit/ui_activity_indicator_activity_indicator_common.kt +89 -0
  416. package/kit-android/generated/kotlin/org/nativescript/kit/ui_activity_indicator_index.kt +171 -0
  417. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_common.kt +518 -0
  418. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_shared.kt +6 -0
  419. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_types.kt +6 -0
  420. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_index.kt +1539 -0
  421. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_keyframe_animation.kt +1081 -0
  422. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_binding_builder.kt +369 -0
  423. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_component_builder_index.kt +487 -0
  424. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +1938 -0
  425. package/kit-android/generated/kotlin/org/nativescript/kit/ui_button_button_common.kt +70 -0
  426. package/kit-android/generated/kotlin/org/nativescript/kit/ui_button_index.kt +367 -0
  427. package/kit-android/generated/kotlin/org/nativescript/kit/ui_content_view_index.kt +220 -0
  428. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_bindable_expressions.kt +735 -0
  429. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_bindable_resources.kt +17 -0
  430. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_bindable_types.kt +6 -0
  431. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +4970 -0
  432. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_index.kt +1342 -0
  433. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_control_state_change_index.kt +52 -0
  434. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +3578 -0
  435. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_property_shared.kt +44 -0
  436. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +3261 -0
  437. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_utils.kt +16 -0
  438. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_index.kt +4716 -0
  439. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_overflow_edges.kt +82 -0
  440. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_common.kt +3597 -0
  441. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_helper_index.kt +134 -0
  442. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_helper_view_helper_common.kt +360 -0
  443. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_helper_view_helper_shared.kt +6 -0
  444. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_interfaces.kt +349 -0
  445. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +266 -0
  446. package/kit-android/generated/kotlin/org/nativescript/kit/ui_date_picker_date_picker_common.kt +369 -0
  447. package/kit-android/generated/kotlin/org/nativescript/kit/ui_date_picker_index.kt +427 -0
  448. package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_dialogs_common.kt +428 -0
  449. package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_index.kt +689 -0
  450. package/kit-android/generated/kotlin/org/nativescript/kit/ui_editable_text_base_editable_text_base_common.kt +421 -0
  451. package/kit-android/generated/kotlin/org/nativescript/kit/ui_editable_text_base_index.kt +1140 -0
  452. package/kit-android/generated/kotlin/org/nativescript/kit/ui_embedding_index.kt +34 -0
  453. package/kit-android/generated/kotlin/org/nativescript/kit/ui_enums_enums.kt +6 -0
  454. package/kit-android/generated/kotlin/org/nativescript/kit/ui_enums_index.kt +6 -0
  455. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_activity.kt +210 -0
  456. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment.kt +88 -0
  457. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions.kt +1544 -0
  458. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions_types.kt +25 -0
  459. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_common.kt +1350 -0
  460. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_constants.kt +10 -0
  461. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helper_for_android.kt +615 -0
  462. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helpers.kt +42 -0
  463. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_interfaces.kt +22 -0
  464. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_stack.kt +112 -0
  465. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_index.kt +1890 -0
  466. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_gestures_common.kt +208 -0
  467. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_gestures_types.kt +348 -0
  468. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_index.kt +1785 -0
  469. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_touch_manager.kt +288 -0
  470. package/kit-android/generated/kotlin/org/nativescript/kit/ui_html_view_html_view_common.kt +121 -0
  471. package/kit-android/generated/kotlin/org/nativescript/kit/ui_html_view_index.kt +283 -0
  472. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_cache_image_cache_common.kt +450 -0
  473. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_cache_index.kt +225 -0
  474. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_image_common.kt +574 -0
  475. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_index.kt +493 -0
  476. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_symbol_effects.kt +31 -0
  477. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_symbol_effects_common.kt +138 -0
  478. package/kit-android/generated/kotlin/org/nativescript/kit/ui_label_index.kt +108 -0
  479. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_absolute_layout_absolute_layout_common.kt +167 -0
  480. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_absolute_layout_index.kt +94 -0
  481. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_dock_layout_dock_layout_common.kt +157 -0
  482. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_dock_layout_index.kt +124 -0
  483. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_flexbox_layout_common.kt +1004 -0
  484. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_index.kt +675 -0
  485. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_grid_layout_grid_layout_common.kt +1011 -0
  486. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_grid_layout_index.kt +450 -0
  487. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_index.kt +6 -0
  488. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_layout_base.kt +123 -0
  489. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_layout_base_common.kt +442 -0
  490. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_container_index.kt +25 -0
  491. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_container_liquid_glass_container_common.kt +38 -0
  492. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_index.kt +30 -0
  493. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_liquid_glass_common.kt +25 -0
  494. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_root_layout_index.kt +556 -0
  495. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_root_layout_root_layout_common.kt +930 -0
  496. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_root_layout_root_layout_stack.kt +49 -0
  497. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_stack_layout_index.kt +63 -0
  498. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_stack_layout_stack_layout_common.kt +83 -0
  499. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_wrap_layout_index.kt +106 -0
  500. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_wrap_layout_wrap_layout_common.kt +185 -0
  501. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_picker_index.kt +400 -0
  502. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_picker_list_picker_common.kt +260 -0
  503. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_view_index.kt +2406 -0
  504. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_view_list_view_common.kt +912 -0
  505. package/kit-android/generated/kotlin/org/nativescript/kit/ui_page_events.kt +17 -0
  506. package/kit-android/generated/kotlin/org/nativescript/kit/ui_page_index.kt +241 -0
  507. package/kit-android/generated/kotlin/org/nativescript/kit/ui_page_page_common.kt +449 -0
  508. package/kit-android/generated/kotlin/org/nativescript/kit/ui_placeholder_index.kt +61 -0
  509. package/kit-android/generated/kotlin/org/nativescript/kit/ui_placeholder_placeholder_common.kt +6 -0
  510. package/kit-android/generated/kotlin/org/nativescript/kit/ui_progress_index.kt +204 -0
  511. package/kit-android/generated/kotlin/org/nativescript/kit/ui_progress_progress_common.kt +129 -0
  512. package/kit-android/generated/kotlin/org/nativescript/kit/ui_proxy_view_container_index.kt +457 -0
  513. package/kit-android/generated/kotlin/org/nativescript/kit/ui_repeater_index.kt +523 -0
  514. package/kit-android/generated/kotlin/org/nativescript/kit/ui_scroll_view_index.kt +400 -0
  515. package/kit-android/generated/kotlin/org/nativescript/kit/ui_scroll_view_scroll_view_common.kt +402 -0
  516. package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_index.kt +711 -0
  517. package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_search_bar_common.kt +186 -0
  518. package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_index.kt +774 -0
  519. package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_segmented_bar_common.kt +409 -0
  520. package/kit-android/generated/kotlin/org/nativescript/kit/ui_slider_index.kt +477 -0
  521. package/kit-android/generated/kotlin/org/nativescript/kit/ui_slider_slider_common.kt +234 -0
  522. package/kit-android/generated/kotlin/org/nativescript/kit/ui_split_view_index.kt +25 -0
  523. package/kit-android/generated/kotlin/org/nativescript/kit/ui_split_view_split_view_common.kt +446 -0
  524. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_background.kt +268 -0
  525. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_background_common.kt +771 -0
  526. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_box_shadow.kt +108 -0
  527. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_clip_path_function.kt +129 -0
  528. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_converters.kt +92 -0
  529. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_animation_parser.kt +416 -0
  530. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_selector.kt +3532 -0
  531. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_shadow.kt +38 -0
  532. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_stroke.kt +30 -0
  533. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_transform.kt +366 -0
  534. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_utils.kt +249 -0
  535. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_font.kt +488 -0
  536. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_font_common.kt +446 -0
  537. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_font_interfaces.kt +6 -0
  538. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_length_shared.kt +264 -0
  539. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_linear_gradient.kt +136 -0
  540. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +1345 -0
  541. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +2907 -0
  542. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +3031 -0
  543. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_styling_profile.kt +6 -0
  544. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_styling_shared.kt +6 -0
  545. package/kit-android/generated/kotlin/org/nativescript/kit/ui_switch_index.kt +295 -0
  546. package/kit-android/generated/kotlin/org/nativescript/kit/ui_switch_switch_common.kt +139 -0
  547. package/kit-android/generated/kotlin/org/nativescript/kit/ui_tab_view_index.kt +1977 -0
  548. package/kit-android/generated/kotlin/org/nativescript/kit/ui_tab_view_tab_view_common.kt +902 -0
  549. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_formatted_string.kt +471 -0
  550. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_index.kt +1662 -0
  551. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_span.kt +284 -0
  552. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_text_base_common.kt +792 -0
  553. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_field_index.kt +211 -0
  554. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_field_text_field_common.kt +115 -0
  555. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_index.kt +94 -0
  556. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +140 -0
  557. package/kit-android/generated/kotlin/org/nativescript/kit/ui_time_picker_index.kt +225 -0
  558. package/kit-android/generated/kotlin/org/nativescript/kit/ui_time_picker_time_picker_common.kt +699 -0
  559. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_fade_transition.kt +68 -0
  560. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_flip_transition.kt +209 -0
  561. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_index.kt +160 -0
  562. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_modal_transition.kt +49 -0
  563. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_page_transition.kt +416 -0
  564. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_shared_transition.kt +457 -0
  565. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_shared_transition_helper.kt +46 -0
  566. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_slide_transition.kt +294 -0
  567. package/kit-android/generated/kotlin/org/nativescript/kit/ui_utils.kt +20 -0
  568. package/kit-android/generated/kotlin/org/nativescript/kit/ui_web_view_index.kt +595 -0
  569. package/kit-android/generated/kotlin/org/nativescript/kit/ui_web_view_web_view_common.kt +209 -0
  570. package/kit-android/generated/kotlin/org/nativescript/kit/ui_web_view_web_view_interfaces.kt +6 -0
  571. package/kit-android/generated/kotlin/org/nativescript/kit/utils_animation_helpers.kt +76 -0
  572. package/kit-android/generated/kotlin/org/nativescript/kit/utils_common.kt +224 -0
  573. package/kit-android/generated/kotlin/org/nativescript/kit/utils_constants.kt +22 -0
  574. package/kit-android/generated/kotlin/org/nativescript/kit/utils_debug.kt +9 -0
  575. package/kit-android/generated/kotlin/org/nativescript/kit/utils_debug_source.kt +246 -0
  576. package/kit-android/generated/kotlin/org/nativescript/kit/utils_index.kt +296 -0
  577. package/kit-android/generated/kotlin/org/nativescript/kit/utils_layout_helper_index.kt +139 -0
  578. package/kit-android/generated/kotlin/org/nativescript/kit/utils_layout_helper_layout_helper_common.kt +61 -0
  579. package/kit-android/generated/kotlin/org/nativescript/kit/utils_layout_helper_layout_helper_shared.kt +23 -0
  580. package/kit-android/generated/kotlin/org/nativescript/kit/utils_lazy.kt +20 -0
  581. package/kit-android/generated/kotlin/org/nativescript/kit/utils_macrotask_scheduler.kt +45 -0
  582. package/kit-android/generated/kotlin/org/nativescript/kit/utils_mainthread_helper.kt +64 -0
  583. package/kit-android/generated/kotlin/org/nativescript/kit/utils_module_merge.kt +13 -0
  584. package/kit-android/generated/kotlin/org/nativescript/kit/utils_native_helper.kt +79 -0
  585. package/kit-android/generated/kotlin/org/nativescript/kit/utils_native_helper_for_android.kt +805 -0
  586. package/kit-android/generated/kotlin/org/nativescript/kit/utils_number_utils.kt +66 -0
  587. package/kit-android/generated/kotlin/org/nativescript/kit/utils_platform_check.kt +15 -0
  588. package/kit-android/generated/kotlin/org/nativescript/kit/utils_shared.kt +65 -0
  589. package/kit-android/generated/kotlin/org/nativescript/kit/utils_types.kt +229 -0
  590. package/kit-android/generated/kotlin/org/nativescript/kit/utils_utils_shared.kt +16 -0
  591. package/kit-android/generated/kotlin/org/nativescript/kit/xml_index.kt +869 -0
  592. package/kit-android/generated/manifest.json +860 -0
  593. package/kit-android/generated/source-lines.json +1 -0
  594. package/kit-android/gradle/wrapper/gradle-wrapper.jar +0 -0
  595. package/kit-android/gradle/wrapper/gradle-wrapper.properties +6 -0
  596. package/kit-android/gradlew +240 -0
  597. package/kit-android/overlays/xml-free/kotlin/org/nativescript/kit/ui_builder_index.kt +524 -0
  598. package/kit-android/overlays/xml-free/kotlin/org/nativescript/kit/ui_core_bindable_index.kt +1335 -0
  599. package/kit-android/overlays/xml-free/overlay.json +20 -0
  600. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/AnimationFrame.kt +68 -0
  601. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/CoreBridge.kt +302 -0
  602. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/Modal.kt +61 -0
  603. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/NativeScriptApplication.kt +230 -0
  604. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/Regions.kt +289 -0
  605. package/kit-android/src/main/kotlin/org/nativescript/kit/ChangeDetection.kt +28 -0
  606. package/kit-android/src/main/kotlin/org/nativescript/kit/ColorMix.kt +643 -0
  607. package/kit-android/src/main/kotlin/org/nativescript/kit/JS.kt +10 -0
  608. package/kit-android/src/main/kotlin/org/nativescript/kit/MainThread.kt +10 -0
  609. package/kit-android/src/main/kotlin/org/nativescript/kit/Signals.kt +866 -0
  610. package/kit-android/src/main/kotlin/org/nativescript/kit/UncaughtErrors.kt +51 -0
  611. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +731 -0
  612. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ArrayLike.kt +781 -0
  613. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/BigInt.kt +136 -0
  614. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/CSSCalc.kt +109 -0
  615. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Collections.kt +426 -0
  616. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/CorePackages.kt +13 -0
  617. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Date.kt +573 -0
  618. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Dynamic.kt +668 -0
  619. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ES2023.kt +93 -0
  620. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ErrorOrigin.kt +17 -0
  621. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Errors.kt +270 -0
  622. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/HostObjects.kt +72 -0
  623. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Inspect.kt +814 -0
  624. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +651 -0
  625. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Iterators.kt +746 -0
  626. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +587 -0
  627. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Language.kt +518 -0
  628. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Lowering.kt +70 -0
  629. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Number.kt +367 -0
  630. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Promise.kt +680 -0
  631. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +292 -0
  632. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Reactive.kt +36 -0
  633. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Realm.kt +85 -0
  634. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/RegExp.kt +2245 -0
  635. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ShortestDouble.kt +157 -0
  636. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +398 -0
  637. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ThrownValue.kt +34 -0
  638. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Timers.kt +182 -0
  639. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/TypedArrays.kt +993 -0
  640. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/URI.kt +74 -0
  641. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Values.kt +1237 -0
  642. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Views.kt +52 -0
  643. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Weak.kt +110 -0
  644. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/WinterTC.kt +356 -0
  645. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Workers.kt +312 -0
  646. package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +536 -0
  647. package/kit-apple/Overlays/xml-free/Core/ui.core.bindable.index.swift +1375 -0
  648. package/kit-apple/Overlays/xml-free/overlay.json +34 -0
  649. package/kit-apple/Package.swift +17 -0
  650. package/kit-apple/Sources/NativeScriptKit/AnimationFrame.swift +41 -0
  651. package/kit-apple/Sources/NativeScriptKit/AppModules.swift +88 -0
  652. package/kit-apple/Sources/NativeScriptKit/ApplicationDelegateClass.swift +273 -0
  653. package/kit-apple/Sources/NativeScriptKit/CSSCalc.swift +111 -0
  654. package/kit-apple/Sources/NativeScriptKit/ChangeDetection.swift +31 -0
  655. package/kit-apple/Sources/NativeScriptKit/ColorMix.swift +577 -0
  656. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity0.swift +1413 -0
  657. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +6525 -0
  658. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +4713 -0
  659. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +5428 -0
  660. package/kit-apple/Sources/NativeScriptKit/Core/Object_Accuracy_AndroidActionBarIconVisibility_AndroidActionItemPosition_AnimationCurve_AutocapitalizationType_BackgroundRepeat_and_26_more_630c32.swift +472 -0
  661. package/kit-apple/Sources/NativeScriptKit/Core/Object_ArrayExpression_BinaryExpression_CallExpression_ChainExpression_ConditionalExpression_Identifier_and_10_more_f883bf.swift +359 -0
  662. package/kit-apple/Sources/NativeScriptKit/Core/Object_Tab_NewLine_excl_quot_QUOT_num_and_287_more_88aef2.swift +2190 -0
  663. package/kit-apple/Sources/NativeScriptKit/Core/Object_Unknown_QuirksMode_IgnoreCase_CaseSensitive.swift +122 -0
  664. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_b_c_d_tx_ty.swift +123 -0
  665. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_h_s_l.swift +85 -0
  666. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_h_s_v.swift +85 -0
  667. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_r_g_b.swift +85 -0
  668. package/kit-apple/Sources/NativeScriptKit/Core/Object_activate_deactivate_background_foreground_close_attached_and_26_more_127a37.swift +448 -0
  669. package/kit-apple/Sources/NativeScriptKit/Core/Object_activeType.swift +65 -0
  670. package/kit-apple/Sources/NativeScriptKit/Core/Object_alert_confirm_prompt_login_action.swift +118 -0
  671. package/kit-apple/Sources/NativeScriptKit/Core/Object_align_offset.swift +94 -0
  672. package/kit-apple/Sources/NativeScriptKit/Core/Object_android_ios_visionos_apple.swift +109 -0
  673. package/kit-apple/Sources/NativeScriptKit/Core/Object_angle_colors.swift +81 -0
  674. package/kit-apple/Sources/NativeScriptKit/Core/Object_animations.swift +66 -0
  675. package/kit-apple/Sources/NativeScriptKit/Core/Object_animations_completion.swift +73 -0
  676. package/kit-apple/Sources/NativeScriptKit/Core/Object_axis_value.swift +80 -0
  677. package/kit-apple/Sources/NativeScriptKit/Core/Object_backgroundColor_scale_translate_rotate_opacity_width_height_valueSource_duration_curve_forceLayer.swift +257 -0
  678. package/kit-apple/Sources/NativeScriptKit/Core/Object_body.swift +78 -0
  679. package/kit-apple/Sources/NativeScriptKit/Core/Object_boundsChanged_sizeChanged.swift +80 -0
  680. package/kit-apple/Sources/NativeScriptKit/Core/Object_callback_thisArg_once.swift +112 -0
  681. package/kit-apple/Sources/NativeScriptKit/Core/Object_collections_createUIDocumentInteractionControllerDelegate_getCurrentAppPath_getRootViewController_getVisibleViewController_getWindow_and_10_more_6713a9.swift +281 -0
  682. package/kit-apple/Sources/NativeScriptKit/Core/Object_color.swift +64 -0
  683. package/kit-apple/Sources/NativeScriptKit/Core/Object_color_backgroundColor.swift +81 -0
  684. package/kit-apple/Sources/NativeScriptKit/Core/Object_color_offset.swift +94 -0
  685. package/kit-apple/Sources/NativeScriptKit/Core/Object_component_exports.swift +95 -0
  686. package/kit-apple/Sources/NativeScriptKit/Core/Object_component_exports_.swift +94 -0
  687. package/kit-apple/Sources/NativeScriptKit/Core/Object_connectionOptions.swift +66 -0
  688. package/kit-apple/Sources/NativeScriptKit/Core/Object_constructor_hasOwnProperty_isPrototypeOf_propertyIsEnumerable_toLocaleString_toString_and_21_more_e9ed9b.swift +331 -0
  689. package/kit-apple/Sources/NativeScriptKit/Core/Object_content_statusCode_headers.swift +106 -0
  690. package/kit-apple/Sources/NativeScriptKit/Core/Object_context_closeCallback_fullscreen_animated_stretched.swift +149 -0
  691. package/kit-apple/Sources/NativeScriptKit/Core/Object_context_parent_name_elementName_templateItems_errorFormat_sourceTracker_xmlModule.swift +185 -0
  692. package/kit-apple/Sources/NativeScriptKit/Core/Object_counters_timeline.swift +95 -0
  693. package/kit-apple/Sources/NativeScriptKit/Core/Object_create.swift +78 -0
  694. package/kit-apple/Sources/NativeScriptKit/Core/Object_createSelector_SelectorCore_SimpleSelector_InvalidSelector_UniversalSelector_TypeSelector_and_12_more_71e044.swift +315 -0
  695. package/kit-apple/Sources/NativeScriptKit/Core/Object_curve.swift +78 -0
  696. package/kit-apple/Sources/NativeScriptKit/Core/Object_defaultValue_name_cssName_affectsLayout.swift +131 -0
  697. package/kit-apple/Sources/NativeScriptKit/Core/Object_defaultValue_name_cssName_valueConverter.swift +113 -0
  698. package/kit-apple/Sources/NativeScriptKit/Core/Object_defaultValue_name_cssName_valueConverter_.swift +113 -0
  699. package/kit-apple/Sources/NativeScriptKit/Core/Object_deg_rad_grad_turn.swift +105 -0
  700. package/kit-apple/Sources/NativeScriptKit/Core/Object_duration_damping.swift +80 -0
  701. package/kit-apple/Sources/NativeScriptKit/Core/Object_duration_repeatCount_delay_curve_propertyNameToAnimate_subPropertiesToAnimate_fromValue_toValue.swift +211 -0
  702. package/kit-apple/Sources/NativeScriptKit/Core/Object_duration_spring.swift +90 -0
  703. package/kit-apple/Sources/NativeScriptKit/Core/Object_edge_interaction.swift +94 -0
  704. package/kit-apple/Sources/NativeScriptKit/Core/Object_effectType_onCreate.swift +86 -0
  705. package/kit-apple/Sources/NativeScriptKit/Core/Object_effectType_targetView.swift +73 -0
  706. package/kit-apple/Sources/NativeScriptKit/Core/Object_effectType_targetView_toGlassStyleFn.swift +110 -0
  707. package/kit-apple/Sources/NativeScriptKit/Core/Object_empty_text_json_blob_arraybuffer.swift +108 -0
  708. package/kit-apple/Sources/NativeScriptKit/Core/Object_enterFrom_exitTo.swift +95 -0
  709. package/kit-apple/Sources/NativeScriptKit/Core/Object_entry_isBackNavigation_navigationType.swift +115 -0
  710. package/kit-apple/Sources/NativeScriptKit/Core/Object_entry_resolvedPage_navDepth_fragmentTag.swift +133 -0
  711. package/kit-apple/Sources/NativeScriptKit/Core/Object_entry_resolvedPage_navDepth_fragmentTag_frameId.swift +162 -0
  712. package/kit-apple/Sources/NativeScriptKit/Core/Object_enumerable_configurable_get_set.swift +123 -0
  713. package/kit-apple/Sources/NativeScriptKit/Core/Object_enumerable_configurable_get_set_.swift +122 -0
  714. package/kit-apple/Sources/NativeScriptKit/Core/Object_enumerable_configurable_get_set__.swift +122 -0
  715. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_android_ios_newValue_object.swift +147 -0
  716. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_data.swift +94 -0
  717. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_action_index_removed_addedCount.swift +153 -0
  718. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_action_index_removed_addedCount_.swift +154 -0
  719. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_action_index_removed_addedCount__.swift +152 -0
  720. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_android_ios_error.swift +148 -0
  721. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_context_closeCallback.swift +133 -0
  722. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_context_isBackNavigation.swift +132 -0
  723. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_cssFile.swift +110 -0
  724. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_cssFile_.swift +95 -0
  725. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_cssText.swift +110 -0
  726. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_data.swift +112 -0
  727. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_data_.swift +114 -0
  728. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_error.swift +111 -0
  729. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_count.swift +120 -0
  730. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +168 -0
  731. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios.swift +97 -0
  732. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_.swift +111 -0
  733. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android.swift +129 -0
  734. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_cssFile.swift +138 -0
  735. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_isBack_entry_fromEntry.swift +130 -0
  736. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_key_error.swift +128 -0
  737. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_key_image.swift +129 -0
  738. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_matches_media.swift +111 -0
  739. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_newValue.swift +95 -0
  740. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +104 -0
  741. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex_.swift +121 -0
  742. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_propertyName_value_oldValue.swift +147 -0
  743. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_text_ios.swift +113 -0
  744. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_type_view_ios.swift +117 -0
  745. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_url_navigationType_error.swift +158 -0
  746. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_url_navigationType_error_.swift +160 -0
  747. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_viewController.swift +114 -0
  748. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_view_context.swift +130 -0
  749. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window.swift +103 -0
  750. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_newValue.swift +123 -0
  751. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene.swift +105 -0
  752. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_.swift +105 -0
  753. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_shortcutItem_completionHandler.swift +157 -0
  754. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_shortcutItem_completionHandler_.swift +158 -0
  755. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_uiWindow_connectionOptions.swift +137 -0
  756. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_uiWindow_connectionOptions_.swift +137 -0
  757. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_urlContexts.swift +120 -0
  758. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_urlContexts_.swift +120 -0
  759. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_userActivity.swift +121 -0
  760. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_userActivity_.swift +121 -0
  761. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_rootView.swift +80 -0
  762. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_type.swift +80 -0
  763. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_type_object.swift +111 -0
  764. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_window_object.swift +103 -0
  765. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventType_position_prefix_namespace_elementName_attributes_data.swift +169 -0
  766. package/kit-apple/Sources/NativeScriptKit/Core/Object_exists_isDirectory.swift +80 -0
  767. package/kit-apple/Sources/NativeScriptKit/Core/Object_f_s_t_a.swift +85 -0
  768. package/kit-apple/Sources/NativeScriptKit/Core/Object_folder_path.swift +94 -0
  769. package/kit-apple/Sources/NativeScriptKit/Core/Object_fontFamily_fontSize_fontWeight_fontVariationSettings_isBold_isItalic.swift +130 -0
  770. package/kit-apple/Sources/NativeScriptKit/Core/Object_fontStyle_fontVariant_fontWeight.swift +95 -0
  771. package/kit-apple/Sources/NativeScriptKit/Core/Object_h_s_l.swift +78 -0
  772. package/kit-apple/Sources/NativeScriptKit/Core/Object_h_s_v.swift +78 -0
  773. package/kit-apple/Sources/NativeScriptKit/Core/Object_headers_timestamp_headersSize_method_postData_url.swift +173 -0
  774. package/kit-apple/Sources/NativeScriptKit/Core/Object_highlighted.swift +66 -0
  775. package/kit-apple/Sources/NativeScriptKit/Core/Object_horizontal_vertical.swift +80 -0
  776. package/kit-apple/Sources/NativeScriptKit/Core/Object_hour_minute.swift +80 -0
  777. package/kit-apple/Sources/NativeScriptKit/Core/Object_id_type.swift +94 -0
  778. package/kit-apple/Sources/NativeScriptKit/Core/Object_id_type_action.swift +108 -0
  779. package/kit-apple/Sources/NativeScriptKit/Core/Object_id_type_percent.swift +108 -0
  780. package/kit-apple/Sources/NativeScriptKit/Core/Object_import_type.swift +80 -0
  781. package/kit-apple/Sources/NativeScriptKit/Core/Object_inset_color_values.swift +87 -0
  782. package/kit-apple/Sources/NativeScriptKit/Core/Object_inset_offsetX_offsetY_blurRadius_spreadRadius_color.swift +147 -0
  783. package/kit-apple/Sources/NativeScriptKit/Core/Object_inset_offsetX_offsetY_blurRadius_spreadRadius_color_.swift +126 -0
  784. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance.swift +64 -0
  785. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance_instanceModule.swift +97 -0
  786. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance_property.swift +86 -0
  787. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance_property_.swift +72 -0
  788. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactiveBegan.swift +66 -0
  789. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactiveBegan_interactiveCancelled.swift +81 -0
  790. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactiveCancelled.swift +66 -0
  791. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactive_pageStart_pageEnd_pageOut_pageReturn_instance_activeType.swift +165 -0
  792. package/kit-apple/Sources/NativeScriptKit/Core/Object_inverse_type_features.swift +95 -0
  793. package/kit-apple/Sources/NativeScriptKit/Core/Object_ios.swift +78 -0
  794. package/kit-apple/Sources/NativeScriptKit/Core/Object_iosNotificationType.swift +66 -0
  795. package/kit-apple/Sources/NativeScriptKit/Core/Object_iosNotificationType_message.swift +80 -0
  796. package/kit-apple/Sources/NativeScriptKit/Core/Object_ios_.swift +64 -0
  797. package/kit-apple/Sources/NativeScriptKit/Core/Object_ios_scene.swift +80 -0
  798. package/kit-apple/Sources/NativeScriptKit/Core/Object_isMatch_getMatchOccurences_getMatchValue.swift +101 -0
  799. package/kit-apple/Sources/NativeScriptKit/Core/Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_91b5f3.swift +413 -0
  800. package/kit-apple/Sources/NativeScriptKit/Core/Object_keepAspectRatio_autoScaleFactor.swift +73 -0
  801. package/kit-apple/Sources/NativeScriptKit/Core/Object_key_createView.swift +95 -0
  802. package/kit-apple/Sources/NativeScriptKit/Core/Object_key_createView_.swift +97 -0
  803. package/kit-apple/Sources/NativeScriptKit/Core/Object_launchData.swift +68 -0
  804. package/kit-apple/Sources/NativeScriptKit/Core/Object_left_right.swift +95 -0
  805. package/kit-apple/Sources/NativeScriptKit/Core/Object_left_right_center_top_bottom.swift +115 -0
  806. package/kit-apple/Sources/NativeScriptKit/Core/Object_lifecycle_timeline.swift +80 -0
  807. package/kit-apple/Sources/NativeScriptKit/Core/Object_line_column.swift +80 -0
  808. package/kit-apple/Sources/NativeScriptKit/Core/Object_location.swift +64 -0
  809. package/kit-apple/Sources/NativeScriptKit/Core/Object_location_length.swift +80 -0
  810. package/kit-apple/Sources/NativeScriptKit/Core/Object_m.swift +64 -0
  811. package/kit-apple/Sources/NativeScriptKit/Core/Object_maskPath_shadowPath.swift +95 -0
  812. package/kit-apple/Sources/NativeScriptKit/Core/Object_matches_media.swift +80 -0
  813. package/kit-apple/Sources/NativeScriptKit/Core/Object_measuredWidth_measuredHeight.swift +81 -0
  814. package/kit-apple/Sources/NativeScriptKit/Core/Object_message.swift +64 -0
  815. package/kit-apple/Sources/NativeScriptKit/Core/Object_method.swift +64 -0
  816. package/kit-apple/Sources/NativeScriptKit/Core/Object_method_postData.swift +80 -0
  817. package/kit-apple/Sources/NativeScriptKit/Core/Object_modifier_property_value.swift +87 -0
  818. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName.swift +65 -0
  819. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName_.swift +78 -0
  820. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName_create_transition.swift +93 -0
  821. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName_transition.swift +76 -0
  822. package/kit-apple/Sources/NativeScriptKit/Core/Object_name.swift +64 -0
  823. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged.swift +103 -0
  824. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged_.swift +98 -0
  825. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged__.swift +100 -0
  826. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged___.swift +102 -0
  827. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueConverter.swift +96 -0
  828. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueConverter_valueChanged.swift +115 -0
  829. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName.swift +80 -0
  830. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_defaultValue_valueConverter_valueChanged.swift +139 -0
  831. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_defaultValue_valueConverter_valueChanged_.swift +159 -0
  832. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueChanged.swift +114 -0
  833. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueChanged_valueConverter.swift +130 -0
  834. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueChanged_valueConverter_.swift +134 -0
  835. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueConverter.swift +133 -0
  836. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueConverter_.swift +113 -0
  837. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue.swift +94 -0
  838. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueChanged_valueConverter.swift +183 -0
  839. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueConverter.swift +168 -0
  840. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueConverter_.swift +169 -0
  841. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueConverter_valueChanged.swift +181 -0
  842. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter.swift +128 -0
  843. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter_.swift +128 -0
  844. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter__.swift +128 -0
  845. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter_valueChanged.swift +139 -0
  846. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_equalityComparer_valueChanged_valueConverter.swift +162 -0
  847. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_equalityComparer_valueConverter.swift +150 -0
  848. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter.swift +113 -0
  849. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter_.swift +113 -0
  850. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter__.swift +114 -0
  851. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter___.swift +113 -0
  852. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter_valueChanged.swift +121 -0
  853. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_equalityComparer_defaultValue_valueConverter.swift +129 -0
  854. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_equalityComparer_valueConverter.swift +114 -0
  855. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter.swift +130 -0
  856. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter_.swift +133 -0
  857. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter__.swift +130 -0
  858. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter___.swift +131 -0
  859. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter____.swift +133 -0
  860. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter_____.swift +131 -0
  861. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged.swift +99 -0
  862. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged_equalityComparer_valueConverter.swift +153 -0
  863. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged_equalityComparer_valueConverter_.swift +132 -0
  864. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged_valueConverter.swift +118 -0
  865. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter.swift +95 -0
  866. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter_.swift +95 -0
  867. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter__.swift +95 -0
  868. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter_valueChanged.swift +114 -0
  869. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue.swift +80 -0
  870. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_.swift +94 -0
  871. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue__.swift +80 -0
  872. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue___.swift +81 -0
  873. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout.swift +95 -0
  874. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_equalityComparer_valueConverter_valueChanged.swift +163 -0
  875. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueChanged_coerceValue_valueConverter.swift +144 -0
  876. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueChanged_valueConverter.swift +124 -0
  877. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter.swift +135 -0
  878. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter_.swift +114 -0
  879. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter__.swift +114 -0
  880. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter___.swift +135 -0
  881. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter____.swift +114 -0
  882. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter_valueChanged.swift +122 -0
  883. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_coerceValue_valueChanged_valueConverter.swift +125 -0
  884. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_coerceValue_valueConverter.swift +116 -0
  885. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_coerceValue_valueConverter_.swift +115 -0
  886. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_coerceValue_valueChanged_valueConverter.swift +170 -0
  887. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueChanged.swift +111 -0
  888. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueConverter.swift +116 -0
  889. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueConverter_.swift +139 -0
  890. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueConverter__.swift +136 -0
  891. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged.swift +92 -0
  892. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_.swift +92 -0
  893. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_coerceValue_valueConverter.swift +126 -0
  894. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_equalityComparer_valueConverter.swift +146 -0
  895. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter.swift +107 -0
  896. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter_.swift +107 -0
  897. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter__.swift +108 -0
  898. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter___.swift +108 -0
  899. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter____.swift +128 -0
  900. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter_____.swift +108 -0
  901. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter______.swift +126 -0
  902. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter.swift +98 -0
  903. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_.swift +96 -0
  904. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter__.swift +97 -0
  905. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter___.swift +98 -0
  906. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter____.swift +100 -0
  907. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_coerceValue.swift +115 -0
  908. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_valueChanged.swift +107 -0
  909. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_valueChanged_.swift +107 -0
  910. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_duration.swift +80 -0
  911. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_equalityComparer_valueConverter.swift +101 -0
  912. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_equalityComparer_valueConverter_.swift +100 -0
  913. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_equalityComparer_valueConverter__.swift +119 -0
  914. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_keyframes_mediaQueryString.swift +117 -0
  915. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged.swift +82 -0
  916. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_.swift +82 -0
  917. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged__.swift +84 -0
  918. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged___.swift +84 -0
  919. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged____.swift +82 -0
  920. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_____.swift +82 -0
  921. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged______.swift +82 -0
  922. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_______.swift +81 -0
  923. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged________.swift +86 -0
  924. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_________.swift +92 -0
  925. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged__________.swift +90 -0
  926. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_valueConverter.swift +101 -0
  927. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_valueConverter_.swift +119 -0
  928. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_valueConverter__.swift +101 -0
  929. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueConverter.swift +81 -0
  930. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueConverter_.swift +81 -0
  931. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueConverter__.swift +82 -0
  932. package/kit-apple/Sources/NativeScriptKit/Core/Object_navigatingToEvent_navigatedToEvent_navigatingFromEvent_navigatedFromEvent.swift +116 -0
  933. package/kit-apple/Sources/NativeScriptKit/Core/Object_normalState_selectedState.swift +81 -0
  934. package/kit-apple/Sources/NativeScriptKit/Core/Object_num_regexp_string_name_privateId_eof_and_71_more_93cbae.swift +688 -0
  935. package/kit-apple/Sources/NativeScriptKit/Core/Object_object_eventName_propertyName_value_oldValue_origin.swift +154 -0
  936. package/kit-apple/Sources/NativeScriptKit/Core/Object_object_eventName_scrollX_scrollY.swift +105 -0
  937. package/kit-apple/Sources/NativeScriptKit/Core/Object_object_eventName_scrollX_scrollY_.swift +121 -0
  938. package/kit-apple/Sources/NativeScriptKit/Core/Object_opacity_color_tapToClose_animation_ignoreShadeRestore.swift +131 -0
  939. package/kit-apple/Sources/NativeScriptKit/Core/Object_orientation_systemAppearance.swift +100 -0
  940. package/kit-apple/Sources/NativeScriptKit/Core/Object_orientation_systemAppearance_.swift +81 -0
  941. package/kit-apple/Sources/NativeScriptKit/Core/Object_page_toPage.swift +94 -0
  942. package/kit-apple/Sources/NativeScriptKit/Core/Object_page_toPage_.swift +95 -0
  943. package/kit-apple/Sources/NativeScriptKit/Core/Object_parent_name_items.swift +111 -0
  944. package/kit-apple/Sources/NativeScriptKit/Core/Object_path_name.swift +72 -0
  945. package/kit-apple/Sources/NativeScriptKit/Core/Object_path_name_extension.swift +86 -0
  946. package/kit-apple/Sources/NativeScriptKit/Core/Object_pattern_flags.swift +80 -0
  947. package/kit-apple/Sources/NativeScriptKit/Core/Object_position_systemIcon.swift +94 -0
  948. package/kit-apple/Sources/NativeScriptKit/Core/Object_prefix_namespace_name.swift +113 -0
  949. package/kit-apple/Sources/NativeScriptKit/Core/Object_presented_presenting_independent.swift +98 -0
  950. package/kit-apple/Sources/NativeScriptKit/Core/Object_propName_propValue.swift +80 -0
  951. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value.swift +95 -0
  952. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value_.swift +95 -0
  953. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value__.swift +96 -0
  954. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value___.swift +94 -0
  955. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value____.swift +80 -0
  956. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value_____.swift +80 -0
  957. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value______.swift +80 -0
  958. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value_______.swift +83 -0
  959. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value________.swift +83 -0
  960. package/kit-apple/Sources/NativeScriptKit/Core/Object_r_g_b.swift +78 -0
  961. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_cooked.swift +94 -0
  962. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_cooked_.swift +80 -0
  963. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_requestURL_toNativeImage_toNativeString.swift +114 -0
  964. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_requestURL_toNativeImage_toNativeString_.swift +135 -0
  965. package/kit-apple/Sources/NativeScriptKit/Core/Object_recognizer_target.swift +96 -0
  966. package/kit-apple/Sources/NativeScriptKit/Core/Object_repeatX_repeatY_posX_posY.swift +93 -0
  967. package/kit-apple/Sources/NativeScriptKit/Core/Object_requestTime_proxyStart_proxyEnd_dnsStart_dnsEnd_connectStart_and_9_more_3e958e.swift +248 -0
  968. package/kit-apple/Sources/NativeScriptKit/Core/Object_result_text.swift +94 -0
  969. package/kit-apple/Sources/NativeScriptKit/Core/Object_result_userName_password.swift +102 -0
  970. package/kit-apple/Sources/NativeScriptKit/Core/Object_right_left.swift +80 -0
  971. package/kit-apple/Sources/NativeScriptKit/Core/Object_row_col.swift +72 -0
  972. package/kit-apple/Sources/NativeScriptKit/Core/Object_rules.swift +66 -0
  973. package/kit-apple/Sources/NativeScriptKit/Core/Object_rules_.swift +78 -0
  974. package/kit-apple/Sources/NativeScriptKit/Core/Object_safeArea_fullscreen_inWindow.swift +107 -0
  975. package/kit-apple/Sources/NativeScriptKit/Core/Object_scale_translate_rotate.swift +100 -0
  976. package/kit-apple/Sources/NativeScriptKit/Core/Object_scale_tx_ty.swift +86 -0
  977. package/kit-apple/Sources/NativeScriptKit/Core/Object_sceneWillConnect_sceneDidActivate_sceneWillResignActive_sceneWillEnterForeground_sceneDidEnterBackground_sceneDidDisconnect_and_1_more_1be9d4.swift +159 -0
  978. package/kit-apple/Sources/NativeScriptKit/Core/Object_scene_uiWindow.swift +80 -0
  979. package/kit-apple/Sources/NativeScriptKit/Core/Object_shape_rule.swift +80 -0
  980. package/kit-apple/Sources/NativeScriptKit/Core/Object_sharedElements_presented_presenting.swift +115 -0
  981. package/kit-apple/Sources/NativeScriptKit/Core/Object_sharedTransitionTag_zIndex.swift +100 -0
  982. package/kit-apple/Sources/NativeScriptKit/Core/Object_showing.swift +64 -0
  983. package/kit-apple/Sources/NativeScriptKit/Core/Object_snap_endFrame_endCornerRadius_srcSharedView.swift +112 -0
  984. package/kit-apple/Sources/NativeScriptKit/Core/Object_sourceProperty_expression_twoWay_source_defaultProperty.swift +120 -0
  985. package/kit-apple/Sources/NativeScriptKit/Core/Object_sourceProperty_targetProperty_expression.swift +111 -0
  986. package/kit-apple/Sources/NativeScriptKit/Core/Object_sourceProperty_targetProperty_expression_twoWay_compiled.swift +145 -0
  987. package/kit-apple/Sources/NativeScriptKit/Core/Object_spans.swift +66 -0
  988. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value.swift +86 -0
  989. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_.swift +86 -0
  990. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value__.swift +89 -0
  991. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value___.swift +100 -0
  992. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value____.swift +86 -0
  993. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_____.swift +88 -0
  994. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value______.swift +89 -0
  995. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_______.swift +89 -0
  996. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value________.swift +89 -0
  997. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_________.swift +89 -0
  998. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value__________.swift +89 -0
  999. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value___________.swift +87 -0
  1000. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value____________.swift +90 -0
  1001. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_____________.swift +89 -0
  1002. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value______________.swift +90 -0
  1003. package/kit-apple/Sources/NativeScriptKit/Core/Object_status_headers.swift +83 -0
  1004. package/kit-apple/Sources/NativeScriptKit/Core/Object_status_statusText.swift +80 -0
  1005. package/kit-apple/Sources/NativeScriptKit/Core/Object_status_statusText_headers_url.swift +110 -0
  1006. package/kit-apple/Sources/NativeScriptKit/Core/Object_targetProperty.swift +66 -0
  1007. package/kit-apple/Sources/NativeScriptKit/Core/Object_targetProperty_sourceProperty.swift +73 -0
  1008. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_backgroundColor_scale_translate_rotate_opacity_width_height_valueSource_duration_curve_forceLayer.swift +264 -0
  1009. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_opacity_backgroundColor_translate_scale_height_width_rotate_duration_delay_iterations_curve.swift +252 -0
  1010. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve.swift +152 -0
  1011. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve_.swift +152 -0
  1012. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve__.swift +153 -0
  1013. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve___.swift +151 -0
  1014. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_translate_scale_rotate_opacity_duration_curve.swift +165 -0
  1015. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_delay_velocity_animateOptions_animations_completion.swift +165 -0
  1016. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_velocity.swift +101 -0
  1017. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_velocity_delay.swift +118 -0
  1018. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_velocity_delay_animations_completion.swift +142 -0
  1019. package/kit-apple/Sources/NativeScriptKit/Core/Object_textColor_tintColor.swift +72 -0
  1020. package/kit-apple/Sources/NativeScriptKit/Core/Object_text_iosFont_color_backgroundColor_textDecoration_baselineOffset_index.swift +144 -0
  1021. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_cancelButtonText.swift +94 -0
  1022. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_cancelButtonText.swift +96 -0
  1023. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_cancelButtonText_inputType.swift +112 -0
  1024. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_cancelButtonText_message.swift +112 -0
  1025. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_message.swift +95 -0
  1026. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_section.swift +80 -0
  1027. package/kit-apple/Sources/NativeScriptKit/Core/Object_toArrayBuffer_toString_toJSON_toImage_toFile.swift +142 -0
  1028. package/kit-apple/Sources/NativeScriptKit/Core/Object_toString_charAt_charCodeAt_concat_indexOf_lastIndexOf_and_44_more_fc25df.swift +481 -0
  1029. package/kit-apple/Sources/NativeScriptKit/Core/Object_topLeft_topRight_bottomLeft_bottomRight.swift +110 -0
  1030. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_bottom.swift +80 -0
  1031. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_left_bottom_right.swift +109 -0
  1032. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_right_bottom_left.swift +122 -0
  1033. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_right_bottom_left_.swift +109 -0
  1034. package/kit-apple/Sources/NativeScriptKit/Core/Object_totalTime_count_currentStart_runCount.swift +110 -0
  1035. package/kit-apple/Sources/NativeScriptKit/Core/Object_touches_event.swift +80 -0
  1036. package/kit-apple/Sources/NativeScriptKit/Core/Object_transitionContext.swift +66 -0
  1037. package/kit-apple/Sources/NativeScriptKit/Core/Object_translateX_translateY_scaleX_scaleY_rotate_opacity.swift +118 -0
  1038. package/kit-apple/Sources/NativeScriptKit/Core/Object_translateX_translateY_scaleX_scaleY_rotate_opacity_duration_curve.swift +151 -0
  1039. package/kit-apple/Sources/NativeScriptKit/Core/Object_translate_rotate_scale.swift +102 -0
  1040. package/kit-apple/Sources/NativeScriptKit/Core/Object_type.swift +64 -0
  1041. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_action_value_namespace_ignoreCase.swift +152 -0
  1042. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_action_value_namespace_ignoreCase_.swift +133 -0
  1043. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_data.swift +78 -0
  1044. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_data_.swift +92 -0
  1045. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_namespace.swift +102 -0
  1046. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_prelude_block.swift +120 -0
  1047. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_text.swift +104 -0
  1048. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_text_components.swift +113 -0
  1049. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_namespace.swift +94 -0
  1050. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_path.swift +72 -0
  1051. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_prelude_block.swift +111 -0
  1052. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_property_value.swift +94 -0
  1053. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_quote_string_value.swift +101 -0
  1054. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_selectors_declarations.swift +96 -0
  1055. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_start_end.swift +94 -0
  1056. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_start_end_left_right.swift +127 -0
  1057. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_start_end_name.swift +118 -0
  1058. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_string.swift +80 -0
  1059. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_string_unit_value.swift +101 -0
  1060. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_stylesheet.swift +83 -0
  1061. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text.swift +72 -0
  1062. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text_.swift +97 -0
  1063. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text__.swift +86 -0
  1064. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text_associatedToken_values.swift +125 -0
  1065. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_direction_object_eventName.swift +159 -0
  1066. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_eventName_object_getPointerCount_getX_getY.swift +187 -0
  1067. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_object_eventName.swift +152 -0
  1068. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_object_eventName_state.swift +167 -0
  1069. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_rotation_object_eventName_state.swift +182 -0
  1070. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_scale_getFocusX_getFocusY_object_eventName_state.swift +194 -0
  1071. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_startX_startY_deltaX_deltaY_object_eventName_state.swift +201 -0
  1072. package/kit-apple/Sources/NativeScriptKit/Core/Object_uri_message_time.swift +108 -0
  1073. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_method.swift +80 -0
  1074. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_source.swift +95 -0
  1075. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_source_.swift +94 -0
  1076. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_status_statusText_headers_mimeType_fromDiskCache_timing_headersSize.swift +201 -0
  1077. package/kit-apple/Sources/NativeScriptKit/Core/Object_value_unit.swift +80 -0
  1078. package/kit-apple/Sources/NativeScriptKit/Core/Object_value_unit_.swift +94 -0
  1079. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_index.swift +95 -0
  1080. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_index_.swift +94 -0
  1081. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_isPresented_startFrame_snapshot_endFrame_startTransform_and_5_more_20e753.swift +234 -0
  1082. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_options.swift +94 -0
  1083. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_options_.swift +94 -0
  1084. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_startFrame_endFrame_snapshot_startOpacity_endOpacity_propertiesToMatch_zIndex.swift +186 -0
  1085. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_startFrame_endFrame_startOpacity_endOpacity_propertiesToMatch_imageSourceChangeListener.swift +181 -0
  1086. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_type_animation.swift +86 -0
  1087. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_color.swift +86 -0
  1088. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_height.swift +80 -0
  1089. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_height_.swift +95 -0
  1090. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_height_os_deviceType.swift +109 -0
  1091. package/kit-apple/Sources/NativeScriptKit/Core/Object_windowOpen_windowClose_primaryWindowChanged.swift +96 -0
  1092. package/kit-apple/Sources/NativeScriptKit/Core/Object_window_isPrimary.swift +80 -0
  1093. package/kit-apple/Sources/NativeScriptKit/Core/Object_window_isPrimary_data_ios.swift +118 -0
  1094. package/kit-apple/Sources/NativeScriptKit/Core/Object_xRadius_yRadius_maxRadius.swift +87 -0
  1095. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y.swift +85 -0
  1096. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_.swift +72 -0
  1097. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y__.swift +86 -0
  1098. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y___.swift +72 -0
  1099. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y____.swift +86 -0
  1100. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_____.swift +77 -0
  1101. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y______.swift +74 -0
  1102. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_______.swift +89 -0
  1103. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y________.swift +88 -0
  1104. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_________.swift +77 -0
  1105. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_width_height.swift +101 -0
  1106. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_z.swift +94 -0
  1107. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_z_.swift +78 -0
  1108. package/kit-apple/Sources/NativeScriptKit/Core/Object_xmlns.swift +64 -0
  1109. package/kit-apple/Sources/NativeScriptKit/Core/Object_xs_ys_xt_yt_rx_ry_rz.swift +106 -0
  1110. package/kit-apple/Sources/NativeScriptKit/Core/__Export.AndroidApplication.swift +18 -0
  1111. package/kit-apple/Sources/NativeScriptKit/Core/__Export.AndroidHelper.swift +18 -0
  1112. package/kit-apple/Sources/NativeScriptKit/Core/__Export.AnimationCurve.swift +18 -0
  1113. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Application.swift +18 -0
  1114. package/kit-apple/Sources/NativeScriptKit/Core/__Export.CSSHelper.swift +20 -0
  1115. package/kit-apple/Sources/NativeScriptKit/Core/__Export.CSSType.swift +20 -0
  1116. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Device.swift +18 -0
  1117. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Dialogs.swift +18 -0
  1118. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Enums.swift +20 -0
  1119. package/kit-apple/Sources/NativeScriptKit/Core/__Export.NativeWindowEvents.swift +20 -0
  1120. package/kit-apple/Sources/NativeScriptKit/Core/__Export.PseudoClassHandler.swift +20 -0
  1121. package/kit-apple/Sources/NativeScriptKit/Core/__Export.SceneEvents.swift +20 -0
  1122. package/kit-apple/Sources/NativeScriptKit/Core/__Export.WindowEvents.swift +20 -0
  1123. package/kit-apple/Sources/NativeScriptKit/Core/__Export._resetRootView.swift +18 -0
  1124. package/kit-apple/Sources/NativeScriptKit/Core/__Export._resolveAnimationCurve.swift +20 -0
  1125. package/kit-apple/Sources/NativeScriptKit/Core/__Export._setResolver.swift +20 -0
  1126. package/kit-apple/Sources/NativeScriptKit/Core/__Export._updateCharactersInRangeReplacementString.swift +23 -0
  1127. package/kit-apple/Sources/NativeScriptKit/Core/__Export.action.swift +20 -0
  1128. package/kit-apple/Sources/NativeScriptKit/Core/__Export.addCss.swift +18 -0
  1129. package/kit-apple/Sources/NativeScriptKit/Core/__Export.addTaggedAdditionalCSS.swift +20 -0
  1130. package/kit-apple/Sources/NativeScriptKit/Core/__Export.addWeakEventListener.swift +22 -0
  1131. package/kit-apple/Sources/NativeScriptKit/Core/__Export.alert.swift +20 -0
  1132. package/kit-apple/Sources/NativeScriptKit/Core/__Export.android.swift +18 -0
  1133. package/kit-apple/Sources/NativeScriptKit/Core/__Export.androidDynamicElevationOffsetProperty.swift +20 -0
  1134. package/kit-apple/Sources/NativeScriptKit/Core/__Export.androidElevationProperty.swift +18 -0
  1135. package/kit-apple/Sources/NativeScriptKit/Core/__Export.animationTimingFunctionConverter.swift +20 -0
  1136. package/kit-apple/Sources/NativeScriptKit/Core/__Export.autocapitalizationTypeProperty.swift +20 -0
  1137. package/kit-apple/Sources/NativeScriptKit/Core/__Export.autocorrectProperty.swift +18 -0
  1138. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundColorProperty.swift +18 -0
  1139. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundEvent.swift +18 -0
  1140. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundImageProperty.swift +18 -0
  1141. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundInternalProperty.swift +18 -0
  1142. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundPositionProperty.swift +18 -0
  1143. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundRepeatProperty.swift +18 -0
  1144. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundSizeProperty.swift +18 -0
  1145. package/kit-apple/Sources/NativeScriptKit/Core/__Export.booleanConverter.swift +20 -0
  1146. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomColorProperty.swift +18 -0
  1147. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomLeftRadiusProperty.swift +20 -0
  1148. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomRightRadiusProperty.swift +20 -0
  1149. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomWidthProperty.swift +18 -0
  1150. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderLeftColorProperty.swift +18 -0
  1151. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderLeftWidthProperty.swift +18 -0
  1152. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderRightColorProperty.swift +18 -0
  1153. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderRightWidthProperty.swift +18 -0
  1154. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopColorProperty.swift +18 -0
  1155. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopLeftRadiusProperty.swift +18 -0
  1156. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopRightRadiusProperty.swift +18 -0
  1157. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopWidthProperty.swift +18 -0
  1158. package/kit-apple/Sources/NativeScriptKit/Core/__Export.clipPathProperty.swift +18 -0
  1159. package/kit-apple/Sources/NativeScriptKit/Core/__Export.colorProperty.swift +18 -0
  1160. package/kit-apple/Sources/NativeScriptKit/Core/__Export.columnGapProperty.swift +18 -0
  1161. package/kit-apple/Sources/NativeScriptKit/Core/__Export.confirm.swift +20 -0
  1162. package/kit-apple/Sources/NativeScriptKit/Core/__Export.cornerShapeProperty.swift +18 -0
  1163. package/kit-apple/Sources/NativeScriptKit/Core/__Export.directionProperty.swift +18 -0
  1164. package/kit-apple/Sources/NativeScriptKit/Core/__Export.discardedErrorEvent.swift +18 -0
  1165. package/kit-apple/Sources/NativeScriptKit/Core/__Export.displayedEvent.swift +18 -0
  1166. package/kit-apple/Sources/NativeScriptKit/Core/__Export.eachDescendant.swift +20 -0
  1167. package/kit-apple/Sources/NativeScriptKit/Core/__Export.editableProperty.swift +18 -0
  1168. package/kit-apple/Sources/NativeScriptKit/Core/__Export.ensureA11yClasses.swift +20 -0
  1169. package/kit-apple/Sources/NativeScriptKit/Core/__Export.exitEvent.swift +18 -0
  1170. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontFamilyProperty.swift +18 -0
  1171. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontInternalProperty.swift +18 -0
  1172. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontScaleChangedEvent.swift +18 -0
  1173. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontScaleInternalProperty.swift +20 -0
  1174. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontSizeProperty.swift +18 -0
  1175. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontStyleProperty.swift +18 -0
  1176. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontVariationSettingsProperty.swift +20 -0
  1177. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontWeightProperty.swift +18 -0
  1178. package/kit-apple/Sources/NativeScriptKit/Core/__Export.foregroundEvent.swift +18 -0
  1179. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fromObject.swift +20 -0
  1180. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fromObjectRecursive.swift +20 -0
  1181. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getAncestor.swift +20 -0
  1182. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getAndroidAccessibilityManager.swift +20 -0
  1183. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getCssFileName.swift +18 -0
  1184. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getCurrentFontScale.swift +20 -0
  1185. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getCurrentPage.swift +20 -0
  1186. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getFileAccess.swift +20 -0
  1187. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getMainEntry.swift +18 -0
  1188. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getNativeApp.swift +20 -0
  1189. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getNativeApplication.swift +18 -0
  1190. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getResources.swift +18 -0
  1191. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getRootLayout.swift +20 -0
  1192. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getRootLayoutById.swift +20 -0
  1193. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getRootView.swift +18 -0
  1194. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getTransformedText.swift +20 -0
  1195. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getViewById.swift +20 -0
  1196. package/kit-apple/Sources/NativeScriptKit/Core/__Export.hasLaunched.swift +18 -0
  1197. package/kit-apple/Sources/NativeScriptKit/Core/__Export.hasListeners.swift +18 -0
  1198. package/kit-apple/Sources/NativeScriptKit/Core/__Export.heightProperty.swift +18 -0
  1199. package/kit-apple/Sources/NativeScriptKit/Core/__Export.hintProperty.swift +18 -0
  1200. package/kit-apple/Sources/NativeScriptKit/Core/__Export.horizontalAlignmentProperty.swift +18 -0
  1201. package/kit-apple/Sources/NativeScriptKit/Core/__Export.inBackground.swift +18 -0
  1202. package/kit-apple/Sources/NativeScriptKit/Core/__Export.initAccessibilityCssHelper.swift +20 -0
  1203. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isAccessibilityServiceEnabled.swift +20 -0
  1204. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isAndroid.swift +18 -0
  1205. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isApple.swift +18 -0
  1206. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isEmbedded.swift +20 -0
  1207. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isIOS.swift +18 -0
  1208. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isUserInteractionEnabledProperty.swift +20 -0
  1209. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isVisionOS.swift +18 -0
  1210. package/kit-apple/Sources/NativeScriptKit/Core/__Export.keyboardTypeProperty.swift +18 -0
  1211. package/kit-apple/Sources/NativeScriptKit/Core/__Export.launchEvent.swift +18 -0
  1212. package/kit-apple/Sources/NativeScriptKit/Core/__Export.layoutDirection.swift +18 -0
  1213. package/kit-apple/Sources/NativeScriptKit/Core/__Export.layoutDirectionChanged.swift +18 -0
  1214. package/kit-apple/Sources/NativeScriptKit/Core/__Export.layoutDirectionChangedEvent.swift +18 -0
  1215. package/kit-apple/Sources/NativeScriptKit/Core/__Export.letterSpacingProperty.swift +18 -0
  1216. package/kit-apple/Sources/NativeScriptKit/Core/__Export.lineHeightProperty.swift +18 -0
  1217. package/kit-apple/Sources/NativeScriptKit/Core/__Export.loadAppCss.swift +18 -0
  1218. package/kit-apple/Sources/NativeScriptKit/Core/__Export.login.swift +20 -0
  1219. package/kit-apple/Sources/NativeScriptKit/Core/__Export.lowMemoryEvent.swift +18 -0
  1220. package/kit-apple/Sources/NativeScriptKit/Core/__Export.makeParser.swift +22 -0
  1221. package/kit-apple/Sources/NativeScriptKit/Core/__Export.makeValidator.swift +20 -0
  1222. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginBottomProperty.swift +18 -0
  1223. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginLeftProperty.swift +18 -0
  1224. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginRightProperty.swift +18 -0
  1225. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginTopProperty.swift +18 -0
  1226. package/kit-apple/Sources/NativeScriptKit/Core/__Export.maxHeightProperty.swift +18 -0
  1227. package/kit-apple/Sources/NativeScriptKit/Core/__Export.maxLengthProperty.swift +18 -0
  1228. package/kit-apple/Sources/NativeScriptKit/Core/__Export.maxWidthProperty.swift +18 -0
  1229. package/kit-apple/Sources/NativeScriptKit/Core/__Export.minHeightProperty.swift +18 -0
  1230. package/kit-apple/Sources/NativeScriptKit/Core/__Export.minWidthProperty.swift +18 -0
  1231. package/kit-apple/Sources/NativeScriptKit/Core/__Export.notify.swift +18 -0
  1232. package/kit-apple/Sources/NativeScriptKit/Core/__Export.off.swift +18 -0
  1233. package/kit-apple/Sources/NativeScriptKit/Core/__Export.on.swift +18 -0
  1234. package/kit-apple/Sources/NativeScriptKit/Core/__Export.opacityProperty.swift +18 -0
  1235. package/kit-apple/Sources/NativeScriptKit/Core/__Export.orientation.swift +18 -0
  1236. package/kit-apple/Sources/NativeScriptKit/Core/__Export.orientationChangedEvent.swift +18 -0
  1237. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingBottomProperty.swift +18 -0
  1238. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingInternalProperty.swift +18 -0
  1239. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingLeftProperty.swift +18 -0
  1240. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingRightProperty.swift +18 -0
  1241. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingTopProperty.swift +18 -0
  1242. package/kit-apple/Sources/NativeScriptKit/Core/__Export.parseCSSShadow.swift +20 -0
  1243. package/kit-apple/Sources/NativeScriptKit/Core/__Export.parseCSSStroke.swift +20 -0
  1244. package/kit-apple/Sources/NativeScriptKit/Core/__Export.parseKeyframeDeclarations.swift +22 -0
  1245. package/kit-apple/Sources/NativeScriptKit/Core/__Export.perspectiveProperty.swift +18 -0
  1246. package/kit-apple/Sources/NativeScriptKit/Core/__Export.placeholderColorProperty.swift +20 -0
  1247. package/kit-apple/Sources/NativeScriptKit/Core/__Export.platformNames.swift +18 -0
  1248. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profile.swift +22 -0
  1249. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingDisable.swift +20 -0
  1250. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingDumpProfiles.swift +20 -0
  1251. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingEnable.swift +20 -0
  1252. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingIsRunning.swift +20 -0
  1253. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingResetProfiles.swift +20 -0
  1254. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStart.swift +20 -0
  1255. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStartCPU.swift +20 -0
  1256. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStop.swift +20 -0
  1257. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStopCPU.swift +20 -0
  1258. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingUptime.swift +20 -0
  1259. package/kit-apple/Sources/NativeScriptKit/Core/__Export.prompt.swift +20 -0
  1260. package/kit-apple/Sources/NativeScriptKit/Core/__Export.querySelectorAll.swift +20 -0
  1261. package/kit-apple/Sources/NativeScriptKit/Core/__Export.removeTaggedAdditionalCSS.swift +20 -0
  1262. package/kit-apple/Sources/NativeScriptKit/Core/__Export.removeWeakEventListener.swift +22 -0
  1263. package/kit-apple/Sources/NativeScriptKit/Core/__Export.resetRootView.swift +18 -0
  1264. package/kit-apple/Sources/NativeScriptKit/Core/__Export.resolveFileNameFromUrl.swift +23 -0
  1265. package/kit-apple/Sources/NativeScriptKit/Core/__Export.resumeEvent.swift +18 -0
  1266. package/kit-apple/Sources/NativeScriptKit/Core/__Export.returnKeyTypeProperty.swift +20 -0
  1267. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rotateProperty.swift +18 -0
  1268. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rotateXProperty.swift +18 -0
  1269. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rotateYProperty.swift +18 -0
  1270. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rowGapProperty.swift +18 -0
  1271. package/kit-apple/Sources/NativeScriptKit/Core/__Export.run.swift +18 -0
  1272. package/kit-apple/Sources/NativeScriptKit/Core/__Export.sanitizeModuleName.swift +20 -0
  1273. package/kit-apple/Sources/NativeScriptKit/Core/__Export.scaleXProperty.swift +18 -0
  1274. package/kit-apple/Sources/NativeScriptKit/Core/__Export.scaleYProperty.swift +18 -0
  1275. package/kit-apple/Sources/NativeScriptKit/Core/__Export.sendAccessibilityEvent.swift +18 -0
  1276. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setActivityCallbacks.swift +20 -0
  1277. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setAutoSystemAppearanceChanged.swift +18 -0
  1278. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setCssFileName.swift +18 -0
  1279. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setMaxRefreshRate.swift +18 -0
  1280. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setNativeApp.swift +20 -0
  1281. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setResources.swift +18 -0
  1282. package/kit-apple/Sources/NativeScriptKit/Core/__Export.suspendEvent.swift +18 -0
  1283. package/kit-apple/Sources/NativeScriptKit/Core/__Export.suspended.swift +18 -0
  1284. package/kit-apple/Sources/NativeScriptKit/Core/__Export.systemAppearance.swift +18 -0
  1285. package/kit-apple/Sources/NativeScriptKit/Core/__Export.systemAppearanceChanged.swift +18 -0
  1286. package/kit-apple/Sources/NativeScriptKit/Core/__Export.systemAppearanceChangedEvent.swift +18 -0
  1287. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textAlignmentProperty.swift +18 -0
  1288. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textDecorationProperty.swift +18 -0
  1289. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textOverflowProperty.swift +18 -0
  1290. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textShadowProperty.swift +18 -0
  1291. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textStrokeProperty.swift +18 -0
  1292. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textTransformProperty.swift +18 -0
  1293. package/kit-apple/Sources/NativeScriptKit/Core/__Export.timeConverter.swift +20 -0
  1294. package/kit-apple/Sources/NativeScriptKit/Core/__Export.translateXProperty.swift +18 -0
  1295. package/kit-apple/Sources/NativeScriptKit/Core/__Export.translateYProperty.swift +18 -0
  1296. package/kit-apple/Sources/NativeScriptKit/Core/__Export.uncaughtErrorEvent.swift +18 -0
  1297. package/kit-apple/Sources/NativeScriptKit/Core/__Export.unsetValue.swift +18 -0
  1298. package/kit-apple/Sources/NativeScriptKit/Core/__Export.updateAccessibilityProperties.swift +20 -0
  1299. package/kit-apple/Sources/NativeScriptKit/Core/__Export.updateCurrentHelperClasses.swift +21 -0
  1300. package/kit-apple/Sources/NativeScriptKit/Core/__Export.updateTextTriggerProperty.swift +20 -0
  1301. package/kit-apple/Sources/NativeScriptKit/Core/__Export.verticalAlignmentProperty.swift +18 -0
  1302. package/kit-apple/Sources/NativeScriptKit/Core/__Export.visibilityProperty.swift +18 -0
  1303. package/kit-apple/Sources/NativeScriptKit/Core/__Export.whiteSpaceProperty.swift +18 -0
  1304. package/kit-apple/Sources/NativeScriptKit/Core/__Export.widthProperty.swift +18 -0
  1305. package/kit-apple/Sources/NativeScriptKit/Core/__Export.zIndexProperty.swift +18 -0
  1306. package/kit-apple/Sources/NativeScriptKit/Core/__Modules.swift +17 -0
  1307. package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Http.swift +23 -0
  1308. package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Utils.swift +201 -0
  1309. package/kit-apple/Sources/NativeScriptKit/Core/abortcontroller.abortsignal.swift +109 -0
  1310. package/kit-apple/Sources/NativeScriptKit/Core/abortcontroller.index.swift +118 -0
  1311. package/kit-apple/Sources/NativeScriptKit/Core/accessibility.accessibility-common.swift +572 -0
  1312. package/kit-apple/Sources/NativeScriptKit/Core/accessibility.accessibility-properties.swift +258 -0
  1313. package/kit-apple/Sources/NativeScriptKit/Core/accessibility.index.swift +16 -0
  1314. package/kit-apple/Sources/NativeScriptKit/Core/application-settings.application-settings-common.swift +36 -0
  1315. package/kit-apple/Sources/NativeScriptKit/Core/application-settings.index.ios.swift +157 -0
  1316. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +2095 -0
  1317. package/kit-apple/Sources/NativeScriptKit/Core/application.application-interfaces.swift +16 -0
  1318. package/kit-apple/Sources/NativeScriptKit/Core/application.application-shims.swift +212 -0
  1319. package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +3854 -0
  1320. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +224 -0
  1321. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers.ios.swift +57 -0
  1322. package/kit-apple/Sources/NativeScriptKit/Core/application.index.ios.swift +16 -0
  1323. package/kit-apple/Sources/NativeScriptKit/Core/application.scene-delegate-bridge.swift +234 -0
  1324. package/kit-apple/Sources/NativeScriptKit/Core/color.color-common.swift +756 -0
  1325. package/kit-apple/Sources/NativeScriptKit/Core/color.color-types.swift +16 -0
  1326. package/kit-apple/Sources/NativeScriptKit/Core/color.color-utils.swift +388 -0
  1327. package/kit-apple/Sources/NativeScriptKit/Core/color.index.ios.swift +100 -0
  1328. package/kit-apple/Sources/NativeScriptKit/Core/color.known-colors.swift +520 -0
  1329. package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +190 -0
  1330. package/kit-apple/Sources/NativeScriptKit/Core/core-types.animation-types.swift +87 -0
  1331. package/kit-apple/Sources/NativeScriptKit/Core/core-types.index.swift +361 -0
  1332. package/kit-apple/Sources/NativeScriptKit/Core/core-types.validators.swift +62 -0
  1333. package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +220 -0
  1334. package/kit-apple/Sources/NativeScriptKit/Core/css-value.reworkcss-value.swift +280 -0
  1335. package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1012 -0
  1336. package/kit-apple/Sources/NativeScriptKit/Core/css.CSSNativeScript.swift +264 -0
  1337. package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +971 -0
  1338. package/kit-apple/Sources/NativeScriptKit/Core/css.system-classes.swift +120 -0
  1339. package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +700 -0
  1340. package/kit-apple/Sources/NativeScriptKit/Core/data.observable.index.swift +1166 -0
  1341. package/kit-apple/Sources/NativeScriptKit/Core/data.virtual-array.index.swift +326 -0
  1342. package/kit-apple/Sources/NativeScriptKit/Core/fetch.index.swift +1201 -0
  1343. package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +1450 -0
  1344. package/kit-apple/Sources/NativeScriptKit/Core/file-system.index.swift +1756 -0
  1345. package/kit-apple/Sources/NativeScriptKit/Core/fps-meter.fps-native.ios.swift +227 -0
  1346. package/kit-apple/Sources/NativeScriptKit/Core/fps-meter.index.swift +141 -0
  1347. package/kit-apple/Sources/NativeScriptKit/Core/globals.global-utils.swift +252 -0
  1348. package/kit-apple/Sources/NativeScriptKit/Core/http.http-interfaces.swift +24 -0
  1349. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +59 -0
  1350. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +413 -0
  1351. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request.http-request-common.swift +57 -0
  1352. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request.index.ios.swift +101 -0
  1353. package/kit-apple/Sources/NativeScriptKit/Core/http.index.swift +175 -0
  1354. package/kit-apple/Sources/NativeScriptKit/Core/image-asset.image-asset-common.swift +285 -0
  1355. package/kit-apple/Sources/NativeScriptKit/Core/image-asset.index.ios.swift +205 -0
  1356. package/kit-apple/Sources/NativeScriptKit/Core/image-source.image-source-common.swift +40 -0
  1357. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +1130 -0
  1358. package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +1388 -0
  1359. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +30789 -0
  1360. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +3383 -0
  1361. package/kit-apple/Sources/NativeScriptKit/Core/matrix.index.swift +151 -0
  1362. package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +468 -0
  1363. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.helpers.swift +57 -0
  1364. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.index.swift +220 -0
  1365. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.non-bundle-workflow-compat.swift +262 -0
  1366. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.qualifier-matcher.index.swift +330 -0
  1367. package/kit-apple/Sources/NativeScriptKit/Core/native-window.index.swift +16 -0
  1368. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window-common.swift +730 -0
  1369. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window-interfaces.swift +46 -0
  1370. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +521 -0
  1371. package/kit-apple/Sources/NativeScriptKit/Core/native-window.window-base.swift +298 -0
  1372. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.index.swift +16 -0
  1373. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +668 -0
  1374. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +221 -0
  1375. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +62 -0
  1376. package/kit-apple/Sources/NativeScriptKit/Core/platform.common.swift +25 -0
  1377. package/kit-apple/Sources/NativeScriptKit/Core/platform.device.index.ios.swift +289 -0
  1378. package/kit-apple/Sources/NativeScriptKit/Core/platform.index.swift +16 -0
  1379. package/kit-apple/Sources/NativeScriptKit/Core/platform.screen.index.ios.swift +217 -0
  1380. package/kit-apple/Sources/NativeScriptKit/Core/profiling.index.swift +528 -0
  1381. package/kit-apple/Sources/NativeScriptKit/Core/text.formatted-string.swift +16 -0
  1382. package/kit-apple/Sources/NativeScriptKit/Core/text.index.ios.swift +25 -0
  1383. package/kit-apple/Sources/NativeScriptKit/Core/text.span.swift +16 -0
  1384. package/kit-apple/Sources/NativeScriptKit/Core/text.text-common.swift +309 -0
  1385. package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +513 -0
  1386. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.action-bar-common.swift +1270 -0
  1387. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +1480 -0
  1388. package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.activity-indicator-common.swift +81 -0
  1389. package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.index.ios.swift +175 -0
  1390. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.animation-common.swift +581 -0
  1391. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.animation-shared.swift +16 -0
  1392. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.animation-types.swift +16 -0
  1393. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +2204 -0
  1394. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.keyframe-animation.swift +1213 -0
  1395. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.binding-builder.swift +318 -0
  1396. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.component-builder.index.swift +387 -0
  1397. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +2026 -0
  1398. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.button-common.swift +75 -0
  1399. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +614 -0
  1400. package/kit-apple/Sources/NativeScriptKit/Core/ui.content-view.index.swift +291 -0
  1401. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.bindable-expressions.swift +770 -0
  1402. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.bindable-resources.swift +30 -0
  1403. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.bindable-types.swift +16 -0
  1404. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.expression-parser.swift +5297 -0
  1405. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.index.swift +1376 -0
  1406. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.control-state-change.index.ios.swift +197 -0
  1407. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +3899 -0
  1408. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.property-shared.swift +53 -0
  1409. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +3522 -0
  1410. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.utils.swift +32 -0
  1411. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +3318 -0
  1412. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +4347 -0
  1413. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.index.ios.swift +1417 -0
  1414. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-common.swift +337 -0
  1415. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-shared.swift +16 -0
  1416. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-interfaces.swift +272 -0
  1417. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.weak-event-listener.index.swift +323 -0
  1418. package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.date-picker-common.swift +335 -0
  1419. package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.index.ios.swift +609 -0
  1420. package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.dialogs-common.swift +486 -0
  1421. package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.index.ios.swift +677 -0
  1422. package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.editable-text-base-common.swift +378 -0
  1423. package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.index.ios.swift +512 -0
  1424. package/kit-apple/Sources/NativeScriptKit/Core/ui.embedding.index.ios.swift +25 -0
  1425. package/kit-apple/Sources/NativeScriptKit/Core/ui.enums.enums.swift +16 -0
  1426. package/kit-apple/Sources/NativeScriptKit/Core/ui.enums.index.swift +16 -0
  1427. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.fragment.ios.swift +26 -0
  1428. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.fragment.transitions.types.swift +23 -0
  1429. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +1526 -0
  1430. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-constants.swift +21 -0
  1431. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-helpers.swift +40 -0
  1432. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-interfaces.swift +26 -0
  1433. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-stack.swift +138 -0
  1434. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +1794 -0
  1435. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.gestures-common.swift +269 -0
  1436. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.gestures-types.swift +77 -0
  1437. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.index.ios.swift +1453 -0
  1438. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.touch-manager.swift +451 -0
  1439. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.html-view-common.swift +106 -0
  1440. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +301 -0
  1441. package/kit-apple/Sources/NativeScriptKit/Core/ui.image-cache.image-cache-common.swift +479 -0
  1442. package/kit-apple/Sources/NativeScriptKit/Core/ui.image-cache.index.ios.swift +232 -0
  1443. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.image-common.swift +399 -0
  1444. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +499 -0
  1445. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.symbol-effects-common.swift +150 -0
  1446. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.symbol-effects.ios.swift +148 -0
  1447. package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +483 -0
  1448. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.absolute-layout-common.swift +172 -0
  1449. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.index.ios.swift +189 -0
  1450. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.dock-layout-common.swift +157 -0
  1451. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.index.ios.swift +264 -0
  1452. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.flexbox-layout-common.swift +1028 -0
  1453. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +3238 -0
  1454. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.grid-layout-common.swift +1014 -0
  1455. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.index.ios.swift +2435 -0
  1456. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.index.swift +16 -0
  1457. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base-common.swift +591 -0
  1458. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base.ios.swift +135 -0
  1459. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.index.ios.swift +364 -0
  1460. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.liquid-glass-container-common.swift +49 -0
  1461. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.index.ios.swift +238 -0
  1462. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.liquid-glass-common.swift +34 -0
  1463. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.index.ios.swift +347 -0
  1464. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-common.swift +964 -0
  1465. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-stack.swift +59 -0
  1466. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.index.ios.swift +350 -0
  1467. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.stack-layout-common.swift +72 -0
  1468. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.index.ios.swift +357 -0
  1469. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.wrap-layout-common.swift +188 -0
  1470. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.index.ios.swift +374 -0
  1471. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.list-picker-common.swift +252 -0
  1472. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +2611 -0
  1473. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.list-view-common.swift +950 -0
  1474. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.events.swift +23 -0
  1475. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +1340 -0
  1476. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.page-common.swift +520 -0
  1477. package/kit-apple/Sources/NativeScriptKit/Core/ui.placeholder.index.swift +63 -0
  1478. package/kit-apple/Sources/NativeScriptKit/Core/ui.placeholder.placeholder-common.swift +16 -0
  1479. package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.index.ios.swift +173 -0
  1480. package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.progress-common.swift +111 -0
  1481. package/kit-apple/Sources/NativeScriptKit/Core/ui.proxy-view-container.index.swift +497 -0
  1482. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +535 -0
  1483. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +699 -0
  1484. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.scroll-view-common.swift +414 -0
  1485. package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.index.ios.swift +609 -0
  1486. package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.search-bar-common.swift +162 -0
  1487. package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.index.ios.swift +470 -0
  1488. package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.segmented-bar-common.swift +448 -0
  1489. package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.index.ios.swift +593 -0
  1490. package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.slider-common.swift +211 -0
  1491. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +1459 -0
  1492. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.split-view-common.swift +410 -0
  1493. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background-common.swift +809 -0
  1494. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2290 -0
  1495. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.box-shadow.swift +138 -0
  1496. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +198 -0
  1497. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.converters.swift +105 -0
  1498. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +493 -0
  1499. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +4016 -0
  1500. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-shadow.swift +48 -0
  1501. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-stroke.swift +41 -0
  1502. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-transform.swift +406 -0
  1503. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-utils.swift +297 -0
  1504. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +477 -0
  1505. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-interfaces.swift +16 -0
  1506. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font.ios.swift +416 -0
  1507. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.length-shared.swift +343 -0
  1508. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.linear-gradient.swift +162 -0
  1509. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-properties.swift +2524 -0
  1510. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +3330 -0
  1511. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +905 -0
  1512. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.styling-profile.swift +16 -0
  1513. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.styling-shared.swift +16 -0
  1514. package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.index.ios.swift +508 -0
  1515. package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.switch-common.swift +143 -0
  1516. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +2284 -0
  1517. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.tab-view-common.swift +985 -0
  1518. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +801 -0
  1519. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.index.ios.swift +1264 -0
  1520. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.span.swift +476 -0
  1521. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.text-base-common.swift +1046 -0
  1522. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.index.ios.swift +912 -0
  1523. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.text-field-common.swift +121 -0
  1524. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.index.ios.swift +1030 -0
  1525. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +138 -0
  1526. package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.index.ios.swift +473 -0
  1527. package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.time-picker-common.swift +536 -0
  1528. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.fade-transition.ios.swift +265 -0
  1529. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +159 -0
  1530. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +635 -0
  1531. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +1167 -0
  1532. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +3673 -0
  1533. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition.swift +492 -0
  1534. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.slide-transition.ios.swift +328 -0
  1535. package/kit-apple/Sources/NativeScriptKit/Core/ui.utils.ios.swift +132 -0
  1536. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.index.ios.swift +827 -0
  1537. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-common.swift +206 -0
  1538. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-interfaces.swift +16 -0
  1539. package/kit-apple/Sources/NativeScriptKit/Core/utils.animation-helpers.swift +84 -0
  1540. package/kit-apple/Sources/NativeScriptKit/Core/utils.common.swift +278 -0
  1541. package/kit-apple/Sources/NativeScriptKit/Core/utils.constants.ios.swift +33 -0
  1542. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +271 -0
  1543. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug.swift +20 -0
  1544. package/kit-apple/Sources/NativeScriptKit/Core/utils.index.ios.swift +205 -0
  1545. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.index.ios.swift +131 -0
  1546. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.layout-helper-common.swift +87 -0
  1547. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.layout-helper-shared.swift +28 -0
  1548. package/kit-apple/Sources/NativeScriptKit/Core/utils.lazy.swift +39 -0
  1549. package/kit-apple/Sources/NativeScriptKit/Core/utils.macrotask-scheduler.swift +71 -0
  1550. package/kit-apple/Sources/NativeScriptKit/Core/utils.mainthread-helper.ios.swift +52 -0
  1551. package/kit-apple/Sources/NativeScriptKit/Core/utils.module-merge.swift +27 -0
  1552. package/kit-apple/Sources/NativeScriptKit/Core/utils.native-helper.ios.swift +734 -0
  1553. package/kit-apple/Sources/NativeScriptKit/Core/utils.number-utils.swift +79 -0
  1554. package/kit-apple/Sources/NativeScriptKit/Core/utils.platform-check.swift +25 -0
  1555. package/kit-apple/Sources/NativeScriptKit/Core/utils.shared.swift +84 -0
  1556. package/kit-apple/Sources/NativeScriptKit/Core/utils.types.swift +308 -0
  1557. package/kit-apple/Sources/NativeScriptKit/Core/utils.utils-shared.swift +31 -0
  1558. package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +1726 -0
  1559. package/kit-apple/Sources/NativeScriptKit/Core/xml.index.swift +775 -0
  1560. package/kit-apple/Sources/NativeScriptKit/CoreBridge.swift +388 -0
  1561. package/kit-apple/Sources/NativeScriptKit/CoreConnectivity.swift +46 -0
  1562. package/kit-apple/Sources/NativeScriptKit/CoreLifetimes.swift +15 -0
  1563. package/kit-apple/Sources/NativeScriptKit/CorePackages.swift +59 -0
  1564. package/kit-apple/Sources/NativeScriptKit/JS.swift +94 -0
  1565. package/kit-apple/Sources/NativeScriptKit/Modal.swift +65 -0
  1566. package/kit-apple/Sources/NativeScriptKit/Probe.swift +97 -0
  1567. package/kit-apple/Sources/NativeScriptKit/Regions.swift +291 -0
  1568. package/kit-apple/Sources/NativeScriptKit/Runtime/AbsentModules.swift +64 -0
  1569. package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +1640 -0
  1570. package/kit-apple/Sources/NativeScriptKit/Runtime/ArrayLike.swift +859 -0
  1571. package/kit-apple/Sources/NativeScriptKit/Runtime/BigInt.swift +338 -0
  1572. package/kit-apple/Sources/NativeScriptKit/Runtime/BuiltinValues.swift +45 -0
  1573. package/kit-apple/Sources/NativeScriptKit/Runtime/Collections.swift +609 -0
  1574. package/kit-apple/Sources/NativeScriptKit/Runtime/Date.swift +269 -0
  1575. package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +470 -0
  1576. package/kit-apple/Sources/NativeScriptKit/Runtime/ES2023.swift +105 -0
  1577. package/kit-apple/Sources/NativeScriptKit/Runtime/Errors.swift +402 -0
  1578. package/kit-apple/Sources/NativeScriptKit/Runtime/Functions.swift +340 -0
  1579. package/kit-apple/Sources/NativeScriptKit/Runtime/Inspect.swift +758 -0
  1580. package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +42 -0
  1581. package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +728 -0
  1582. package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +898 -0
  1583. package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +874 -0
  1584. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +588 -0
  1585. package/kit-apple/Sources/NativeScriptKit/Runtime/Native.swift +819 -0
  1586. package/kit-apple/Sources/NativeScriptKit/Runtime/NativeStack.swift +66 -0
  1587. package/kit-apple/Sources/NativeScriptKit/Runtime/Number.swift +599 -0
  1588. package/kit-apple/Sources/NativeScriptKit/Runtime/Promise.swift +810 -0
  1589. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +471 -0
  1590. package/kit-apple/Sources/NativeScriptKit/Runtime/Reactive.swift +34 -0
  1591. package/kit-apple/Sources/NativeScriptKit/Runtime/Record.swift +59 -0
  1592. package/kit-apple/Sources/NativeScriptKit/Runtime/RegExp.swift +576 -0
  1593. package/kit-apple/Sources/NativeScriptKit/Runtime/RegExpEngine.swift +1918 -0
  1594. package/kit-apple/Sources/NativeScriptKit/Runtime/Stack.swift +20 -0
  1595. package/kit-apple/Sources/NativeScriptKit/Runtime/StringUTF16.swift +179 -0
  1596. package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +142 -0
  1597. package/kit-apple/Sources/NativeScriptKit/Runtime/Threads.swift +275 -0
  1598. package/kit-apple/Sources/NativeScriptKit/Runtime/Timers.swift +240 -0
  1599. package/kit-apple/Sources/NativeScriptKit/Runtime/TypedArrays.swift +996 -0
  1600. package/kit-apple/Sources/NativeScriptKit/Runtime/URI.swift +94 -0
  1601. package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +2061 -0
  1602. package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +97 -0
  1603. package/kit-apple/Sources/NativeScriptKit/Runtime/Weak.swift +135 -0
  1604. package/kit-apple/Sources/NativeScriptKit/Runtime/WinterTC.swift +484 -0
  1605. package/kit-apple/Sources/NativeScriptKit/Signals.swift +952 -0
  1606. package/kit-apple/Sources/NativeScriptKit/UncaughtErrors.swift +37 -0
  1607. package/package.json +94 -4
  1608. package/verify/ui-driver/Host/App.swift +7 -0
  1609. package/verify/ui-driver/Tests/Driver.swift +54 -0
  1610. package/verify/ui-driver/project.yml +35 -0
@@ -0,0 +1,2245 @@
1
+ package org.nativescript.kit
2
+
3
+ // Regular expressions with ECMA-262 §22.2 semantics: a parser for the pattern grammar (with
4
+ // Annex B's web-compatible forms outside `u`/`v` mode) and a backtracking matcher over UTF-16
5
+ // code units, or code points in `u`/`v` mode. Errors carry V8's messages.
6
+ //
7
+ // The matcher is this engine's, not java.util.regex: on Android that is ICU, whose `\d`, `\w`,
8
+ // `$`, `.` and case folding differ from JavaScript's, and which the host tests do not run.
9
+
10
+ /** A JavaScript `RegExp`. Constructing an invalid pattern or flags throws a SyntaxError. */
11
+ class JSRegExp(source: String, flags: String = "") : JSDynamic, JSStringConvertible {
12
+ private val compiled: CompiledRegExp = compile(source, flags)
13
+
14
+ /** `re.source`: the pattern as a literal would spell it. */
15
+ val source: String get() = compiled.source
16
+
17
+ /** `re.flags`, in the canonical order `dgimsuvy`. */
18
+ val flags: String get() = compiled.flags
19
+ val hasIndices: Boolean get() = compiled.hasIndices
20
+ val global: Boolean get() = compiled.global
21
+ val ignoreCase: Boolean get() = compiled.ignoreCase
22
+ val multiline: Boolean get() = compiled.multiline
23
+ val dotAll: Boolean get() = compiled.dotAll
24
+ val unicode: Boolean get() = compiled.unicode
25
+ val unicodeSets: Boolean get() = compiled.unicodeSets
26
+ val sticky: Boolean get() = compiled.sticky
27
+ var lastIndex: Double = 0.0
28
+
29
+ private val fullUnicode: Boolean get() = unicode || unicodeSets
30
+
31
+ /**
32
+ * RegExpBuiltinExec without the result array: the capture slots (start and end per group, -1 when unset) of a match
33
+ * at or after `lastIndex` (exactly there when sticky), updating `lastIndex` for global and sticky expressions.
34
+ */
35
+ internal fun execCaptures(s: String): IntArray? {
36
+ val useLastIndex = global || sticky
37
+ val start = if (useLastIndex) toLength(lastIndex) else 0L
38
+ if (start > s.length) {
39
+ if (useLastIndex) lastIndex = 0.0
40
+ return null
41
+ }
42
+ var from = start.toInt()
43
+ // As V8 does: a search that lastIndex puts inside a surrogate pair starts at the pair.
44
+ if (useLastIndex && fullUnicode && from > 0 && from < s.length && Character.isLowSurrogate(s[from]) && Character.isHighSurrogate(s[from - 1])) from--
45
+ val captures = compiled.program.search(s, from, sticky)
46
+ if (useLastIndex) lastIndex = if (captures == null) 0.0 else captures[1].toDouble()
47
+ return captures
48
+ }
49
+
50
+ /** RegExpBuiltinExec: a match at or after `lastIndex` (exactly there when sticky), updating `lastIndex` for global and sticky expressions. */
51
+ fun exec(s: String): JSMatch? = execCaptures(s)?.let { makeMatch(s, it) }
52
+
53
+ /** `re.test(s)`. */
54
+ fun test(s: String): Boolean = execCaptures(s) != null
55
+
56
+ internal fun makeMatch(s: String, captures: IntArray): JSMatch {
57
+ val n = captures.size / 2
58
+ val values = ArrayList<String?>(n)
59
+ for (g in 0 until n) values.add(if (captures[2 * g] < 0) null else s.substring(captures[2 * g], captures[2 * g + 1]))
60
+ val names = compiled.program.groupNames
61
+ val groups = namedObject(names) { g -> values[g] }
62
+ var indices: JSMatchIndices? = null
63
+ if (hasIndices) {
64
+ val pairs = ArrayList<Any?>(n)
65
+ for (g in 0 until n) pairs.add(if (captures[2 * g] < 0) null else JSArray(arrayListOf(captures[2 * g].toDouble(), captures[2 * g + 1].toDouble())))
66
+ indices = JSMatchIndices(JSArray(pairs), namedObject(names) { g -> pairs[g] })
67
+ }
68
+ return JSMatch(JSArray(values), captures[0].toDouble(), s, groups, true, indices)
69
+ }
70
+
71
+ private fun namedObject(names: List<Pair<String, Int>>, value: (Int) -> Any?): JSObject? {
72
+ if (names.isEmpty()) return null
73
+ val obj = JSObject()
74
+ obj.jsNullPrototype = true
75
+ for ((name, g) in names) {
76
+ val v = value(g)
77
+ if (!obj.has(name) || (obj[name] == null && v != null)) obj[name] = v
78
+ }
79
+ return obj
80
+ }
81
+
82
+ override fun jsGet(key: String): Any? = when (key) {
83
+ "lastIndex" -> lastIndex
84
+ "source" -> source
85
+ "flags" -> flags
86
+ "global" -> global
87
+ "ignoreCase" -> ignoreCase
88
+ "multiline" -> multiline
89
+ "dotAll" -> dotAll
90
+ "unicode" -> unicode
91
+ "unicodeSets" -> unicodeSets
92
+ "sticky" -> sticky
93
+ "hasIndices" -> hasIndices
94
+ else -> null
95
+ }
96
+
97
+ override fun jsSet(key: String, value: Any?) {
98
+ if (key == "lastIndex") lastIndex = jsToNumber(value)
99
+ }
100
+
101
+ override val jsKeys: List<String> get() = emptyList()
102
+ override val jsClassName: String? get() = "RegExp"
103
+
104
+ override fun toString(): String = "/$source/$flags"
105
+
106
+ /**
107
+ * A pattern parsed and compiled, with its source escaped and its flags in canonical order; `next` is the same
108
+ * pattern's entry for other flags in the cache.
109
+ */
110
+ private class CompiledRegExp(val source: String, val flags: String, val program: RegexProgram, val givenFlags: String, val next: CompiledRegExp?) {
111
+ val hasIndices = 'd' in flags
112
+ val global = 'g' in flags
113
+ val ignoreCase = 'i' in flags
114
+ val multiline = 'm' in flags
115
+ val dotAll = 's' in flags
116
+ val unicode = 'u' in flags
117
+ val unicodeSets = 'v' in flags
118
+ val sticky = 'y' in flags
119
+ }
120
+
121
+ internal companion object {
122
+ /**
123
+ * Compiled patterns by source, then flags: a literal evaluated in a loop makes a new RegExp each time, as
124
+ * JavaScript's does, without parsing it again. Bounded by emptying it when full.
125
+ */
126
+ private val cache = java.util.concurrent.ConcurrentHashMap<String, CompiledRegExp>()
127
+ private const val CACHE_LIMIT = 256
128
+
129
+ private fun compile(source: String, flags: String): CompiledRegExp {
130
+ val known = cache[source]
131
+ var entry = known
132
+ while (entry != null) {
133
+ if (entry.givenFlags == flags) return entry
134
+ entry = entry.next
135
+ }
136
+ var seen = 0
137
+ for (c in flags) {
138
+ val bit = "dgimsuvy".indexOf(c)
139
+ if (bit < 0 || seen and (1 shl bit) != 0) throw JSException(JSSyntaxError("Invalid flags supplied to RegExp constructor '$flags'"))
140
+ seen = seen or (1 shl bit)
141
+ }
142
+ val canonical = "dgimsuvy".filter { it in flags }
143
+ val unicode = 'u' in flags
144
+ val unicodeSets = 'v' in flags
145
+ if (unicode && unicodeSets) throw JSException(JSSyntaxError("Invalid flags supplied to RegExp constructor '$flags'"))
146
+ val program = try {
147
+ RegexParser(source, 'i' in flags, 'm' in flags, 's' in flags, unicode || unicodeSets, unicodeSets).parse()
148
+ } catch (e: RegexSyntaxError) {
149
+ throw JSException(JSSyntaxError("Invalid regular expression: /$source/$canonical: ${e.message}"))
150
+ }
151
+ val compiled = CompiledRegExp(escapePattern(source), canonical, program, flags, known)
152
+ if (cache.size >= CACHE_LIMIT) cache.clear()
153
+ cache[source] = compiled
154
+ return compiled
155
+ }
156
+
157
+ fun toLength(v: Double): Long {
158
+ if (v.isNaN() || v <= 0) return 0
159
+ return minOf(Math.floor(v), 9007199254740991.0).toLong()
160
+ }
161
+
162
+ /** AdvanceStringIndex. */
163
+ fun advance(s: String, index: Long, unicode: Boolean): Long {
164
+ if (!unicode || index + 1 >= s.length) return index + 1
165
+ val i = index.toInt()
166
+ return if (Character.isHighSurrogate(s[i]) && Character.isLowSurrogate(s[i + 1])) index + 2 else index + 1
167
+ }
168
+
169
+ /** EscapeRegExpPattern as V8 does it: `/` outside classes and line terminators escaped, "" as `(?:)`. */
170
+ fun escapePattern(p: String): String {
171
+ if (p.isEmpty()) return "(?:)"
172
+ val out = StringBuilder(p.length)
173
+ var inClass = false
174
+ var i = 0
175
+ while (i < p.length) {
176
+ val c = p[i]
177
+ when {
178
+ c == '\\' && i + 1 < p.length -> {
179
+ out.append(c)
180
+ i++
181
+ out.append(lineTerminatorEscape(p[i])?.substring(1) ?: p[i].toString())
182
+ }
183
+ c == '/' && !inClass -> out.append("\\/")
184
+ c == '[' -> { inClass = true; out.append(c) }
185
+ c == ']' -> { inClass = false; out.append(c) }
186
+ else -> out.append(lineTerminatorEscape(c) ?: c.toString())
187
+ }
188
+ i++
189
+ }
190
+ return out.toString()
191
+ }
192
+
193
+ private fun lineTerminatorEscape(c: Char): String? = when (c) {
194
+ '\n' -> "\\n"
195
+ '\r' -> "\\r"
196
+ '\u2028' -> "\\u2028"
197
+ '\u2029' -> "\\u2029"
198
+ else -> null
199
+ }
200
+ }
201
+ }
202
+
203
+ /**
204
+ * The array `exec` and `match` return: the matched text, then each group (undefined when it
205
+ * did not take part), with `index`, `input`, `groups` (and `indices` for the `d` flag). The
206
+ * array `match` returns for a global expression is a plain array of matched texts.
207
+ */
208
+ class JSMatch internal constructor(
209
+ val values: JSArray<String?>,
210
+ val index: Double,
211
+ val input: String,
212
+ val groups: JSObject?,
213
+ internal val isExecResult: Boolean,
214
+ val indices: JSMatchIndices? = null,
215
+ ) : JSDynamic, JSStringConvertible {
216
+ internal val hasIndices: Boolean get() = indices != null
217
+
218
+ operator fun get(i: Int): String? = if (i >= 0 && i < values.storage.size) values.storage[i] else null
219
+
220
+ operator fun get(i: Double): String? = if (i == Math.floor(i)) get(i.toInt()) else null
221
+
222
+ fun element(i: Double): String? = get(i)
223
+
224
+ val length: Double get() = values.storage.size.toDouble()
225
+
226
+ /** What a replace callback is given: the match, each group, the index, the input, then `groups` where the pattern names any. */
227
+ val replacerArguments: List<Any?> get() = values.storage + listOf<Any?>(index, input) + listOfNotNull(groups)
228
+
229
+ override fun jsGet(key: String): Any? = when (key) {
230
+ "length" -> length
231
+ "index" -> if (isExecResult) index else null
232
+ "input" -> if (isExecResult) input else null
233
+ "groups" -> if (isExecResult) groups else null
234
+ "indices" -> indices
235
+ else -> jsArrayIndex(key)?.let { if (it < values.storage.size) values.storage[it.toInt()] else null }
236
+ }
237
+
238
+ override fun jsSet(key: String, value: Any?) {
239
+ jsArrayIndex(key)?.let { if (it < values.storage.size) values.storage[it.toInt()] = value as? String }
240
+ }
241
+
242
+ override val jsKeys: List<String>
243
+ get() = values.storage.indices.map { it.toString() } +
244
+ (if (isExecResult) listOf("index", "input", "groups") else emptyList()) +
245
+ (if (indices != null) listOf("indices") else emptyList())
246
+
247
+ override val jsClassName: String? get() = "Array"
248
+
249
+ override fun toString(): String = jsJoin(values.storage, ",", this)
250
+
251
+ companion object {
252
+ /** `[]` where code holds a match (`text.match(re) || []`): no values. */
253
+ fun empty(): JSMatch = JSMatch(JSArray(), 0.0, "", null, false)
254
+ }
255
+ }
256
+
257
+ /** A match's `indices` (the `d` flag): `[start, end]` per group, with `groups`. */
258
+ class JSMatchIndices internal constructor(val values: JSArray<Any?>, val groups: JSObject?) : JSDynamic {
259
+ override fun jsGet(key: String): Any? = when (key) {
260
+ "length" -> values.storage.size.toDouble()
261
+ "groups" -> groups
262
+ else -> jsArrayIndex(key)?.let { if (it < values.storage.size) values.storage[it.toInt()] else null }
263
+ }
264
+
265
+ override fun jsSet(key: String, value: Any?) {}
266
+ override val jsKeys: List<String> get() = values.storage.indices.map { it.toString() } + "groups"
267
+ override val jsClassName: String? get() = "Array"
268
+ }
269
+
270
+ /** What `s.match(x)` searches with: a RegExp as it is, anything else as `new RegExp(x)`. */
271
+ fun jsRegExpFrom(value: Any?): JSRegExp = value as? JSRegExp ?: JSRegExp(if (value == null || value === Unit) "(?:)" else jsToString(value))
272
+
273
+ /**
274
+ * `new RegExp(pattern, flags)` of a pattern that may be a RegExp: its source, and its flags unless others are given.
275
+ * `RegExp(re)` called without `new` and given no flags is `re` itself.
276
+ */
277
+ fun jsRegExpConstruct(pattern: Any?, flags: Any? = null, call: Boolean = false): JSRegExp {
278
+ val given = if (flags == null || flags === Unit) null else jsToString(flags)
279
+ if (pattern is JSRegExp) return if (call && given == null) pattern else JSRegExp(pattern.source, given ?: pattern.flags)
280
+ return JSRegExp(if (pattern == null || pattern === Unit) "(?:)" else jsToString(pattern), given ?: "")
281
+ }
282
+
283
+ /** A regular expression literal. */
284
+ fun jsRegExpLiteral(source: String, flags: String): JSRegExp = JSRegExp(source, flags)
285
+
286
+ /** `s.match(re)`: the first match (with groups) or, for a global expression, every matched text; null when nothing matches. */
287
+ fun jsMatch(s: String, re: JSRegExp): JSMatch? {
288
+ if (!re.global) return re.exec(s)
289
+ re.lastIndex = 0.0
290
+ val out = ArrayList<String?>()
291
+ while (true) {
292
+ val c = re.execCaptures(s) ?: break
293
+ out.add(s.substring(c[0], c[1]))
294
+ if (c[0] == c[1]) re.lastIndex = JSRegExp.advance(s, JSRegExp.toLength(re.lastIndex), re.unicode || re.unicodeSets).toDouble()
295
+ }
296
+ return if (out.isEmpty()) null else JSMatch(JSArray(out), Double.NaN, s, null, false)
297
+ }
298
+
299
+ /** `s.matchAll(re)`: every match of a global expression, from its `lastIndex`. */
300
+ fun jsMatchAll(s: String, re: JSRegExp): JSArray<JSMatch> {
301
+ if (!re.global) throw JSException(JSTypeError("String.prototype.matchAll called with a non-global RegExp argument"))
302
+ val copy = JSRegExp(re.source, re.flags)
303
+ copy.lastIndex = JSRegExp.toLength(re.lastIndex).toDouble()
304
+ val out = ArrayList<JSMatch>()
305
+ while (true) {
306
+ val m = copy.exec(s) ?: break
307
+ out.add(m)
308
+ if ((m[0] ?: "").isEmpty()) copy.lastIndex = JSRegExp.advance(s, JSRegExp.toLength(copy.lastIndex), copy.unicode || copy.unicodeSets).toDouble()
309
+ }
310
+ return JSArray(out)
311
+ }
312
+
313
+ /** `s.search(re)`: the index of the first match, -1 when none; `lastIndex` is left as it was. */
314
+ fun jsSearch(s: String, re: JSRegExp): Double {
315
+ val previous = re.lastIndex
316
+ re.lastIndex = 0.0
317
+ val c = re.execCaptures(s)
318
+ re.lastIndex = previous
319
+ return if (c == null) -1.0 else c[0].toDouble()
320
+ }
321
+
322
+ /** `s.replace(re, replacement)` with GetSubstitution's `$$ $& $` $' $n $nn $<name>`. */
323
+ fun jsReplace(s: String, re: JSRegExp, replacement: String): String =
324
+ if (replacement.indexOf('$') < 0) replaceMatches(s, re) { replacement }
325
+ else replaceMatches(s, re) { c -> substitute(replacement, re.makeMatch(s, c), s) }
326
+
327
+ /** `s.replace(re, (match, ...groups) => …)`. */
328
+ fun jsReplace(s: String, re: JSRegExp, replacer: (JSMatch) -> String): String = replaceMatches(s, re) { c -> replacer(re.makeMatch(s, c)) }
329
+
330
+ /** `s.replaceAll(re, replacement)`: the expression must be global. */
331
+ fun jsReplaceAll(s: String, re: JSRegExp, replacement: String): String {
332
+ if (!re.global) throw JSException(JSTypeError("String.prototype.replaceAll called with a non-global RegExp argument"))
333
+ return jsReplace(s, re, replacement)
334
+ }
335
+
336
+ /** `s.replaceAll(re, replacer)`: the expression must be global. */
337
+ fun jsReplaceAll(s: String, re: JSRegExp, replacer: (JSMatch) -> String): String {
338
+ if (!re.global) throw JSException(JSTypeError("String.prototype.replaceAll called with a non-global RegExp argument"))
339
+ return jsReplace(s, re, replacer)
340
+ }
341
+
342
+ /** `s.replace(pattern, replacement)` with an untyped pattern: a RegExp replaces as one, any other value by its string. */
343
+ fun jsReplaceUntyped(s: String, pattern: Any?, replacement: String): String =
344
+ if (pattern is JSRegExp) jsReplace(s, pattern, replacement) else jsReplace(s, jsToString(pattern), replacement)
345
+
346
+ /** `s.replaceAll(pattern, replacement)` with an untyped pattern: a RegExp replaces as one (it must be global), any other value by its string. */
347
+ fun jsReplaceAllUntyped(s: String, pattern: Any?, replacement: String): String =
348
+ if (pattern is JSRegExp) jsReplaceAll(s, pattern, replacement) else jsReplaceAll(s, jsToString(pattern), replacement)
349
+
350
+ /**
351
+ * `s.replace(pattern, replacement)` with a replacement known only when it runs: a function is called per match with the
352
+ * match, each group, the offset and the string (and the groups object); any other value replaces by its string.
353
+ */
354
+ fun jsReplaceBoxed(s: String, pattern: Any?, replacement: Any?): String = jsReplaceBoxed(s, pattern, replacement, false)
355
+
356
+ /** `s.replaceAll(pattern, replacement)` with a replacement known only when it runs; a RegExp must be global. */
357
+ fun jsReplaceAllBoxed(s: String, pattern: Any?, replacement: Any?): String = jsReplaceBoxed(s, pattern, replacement, true)
358
+
359
+ private fun jsReplaceBoxed(s: String, pattern: Any?, replacement: Any?, all: Boolean): String {
360
+ val function = jsTypeof(replacement) == "function"
361
+ if (pattern is JSRegExp) {
362
+ if (all && !pattern.global) throw JSException(JSTypeError("String.prototype.replaceAll called with a non-global RegExp argument"))
363
+ if (!function) return jsReplace(s, pattern, jsToString(replacement))
364
+ return jsReplace(s, pattern) { m -> jsToString(jsCall(replacement, *m.replacerArguments.toTypedArray())) }
365
+ }
366
+ val search = jsToString(pattern)
367
+ if (!function) return if (all) jsReplaceAll(s, search, jsToString(replacement)) else jsReplace(s, search, jsToString(replacement))
368
+ val positions = ArrayList<Int>()
369
+ var i = s.indexOf(search)
370
+ while (i >= 0) {
371
+ positions.add(i)
372
+ if (!all) break
373
+ i = if (search.isEmpty()) (if (i < s.length) i + 1 else -1) else s.indexOf(search, i + search.length)
374
+ }
375
+ if (positions.isEmpty()) return s
376
+ val out = StringBuilder()
377
+ var end = 0
378
+ for (p in positions) {
379
+ out.append(s, end, p)
380
+ out.append(jsToString(jsCall(replacement, search, p.toDouble(), s)))
381
+ end = p + search.length
382
+ }
383
+ out.append(s, minOf(end, s.length), s.length)
384
+ return out.toString()
385
+ }
386
+
387
+ /** RegExp.prototype[@@replace]: every match is found before the first replacement is computed. */
388
+ private inline fun replaceMatches(s: String, re: JSRegExp, replacement: (IntArray) -> String): String {
389
+ val results = ArrayList<IntArray>()
390
+ if (re.global) re.lastIndex = 0.0
391
+ while (true) {
392
+ val c = re.execCaptures(s) ?: break
393
+ results.add(c)
394
+ if (!re.global) break
395
+ if (c[0] == c[1]) re.lastIndex = JSRegExp.advance(s, JSRegExp.toLength(re.lastIndex), re.unicode || re.unicodeSets).toDouble()
396
+ }
397
+ if (results.isEmpty()) return s
398
+ val out = StringBuilder(s.length)
399
+ var next = 0
400
+ for (c in results) {
401
+ val position = maxOf(0, minOf(c[0], s.length))
402
+ val text = replacement(c)
403
+ if (position >= next) {
404
+ out.append(s, next, position).append(text)
405
+ next = position + (c[1] - c[0])
406
+ }
407
+ }
408
+ if (next < s.length) out.append(s, next, s.length)
409
+ return out.toString()
410
+ }
411
+
412
+ /** GetSubstitution. */
413
+ private fun substitute(template: String, m: JSMatch, s: String): String {
414
+ if (template.indexOf('$') < 0) return template
415
+ val matched = m[0] ?: ""
416
+ val position = m.index.toInt()
417
+ val captureCount = m.values.storage.size - 1
418
+ val out = StringBuilder()
419
+ var i = 0
420
+ while (i < template.length) {
421
+ val c = template[i]
422
+ if (c != '$' || i + 1 >= template.length) { out.append(c); i++; continue }
423
+ val n = template[i + 1]
424
+ when {
425
+ n == '$' -> { out.append('$'); i += 2 }
426
+ n == '&' -> { out.append(matched); i += 2 }
427
+ n == '`' -> { out.append(s, 0, position); i += 2 }
428
+ n == '\'' -> { out.append(s, minOf(position + matched.length, s.length), s.length); i += 2 }
429
+ n in '0'..'9' -> {
430
+ var digits = if (i + 2 < template.length && template[i + 2] in '0'..'9') 2 else 1
431
+ var index = if (digits == 2) (n - '0') * 10 + (template[i + 2] - '0') else n - '0'
432
+ if (index > captureCount && digits == 2) { digits = 1; index = n - '0' }
433
+ if (index in 1..captureCount) out.append(m[index] ?: "") else out.append(template, i, i + 1 + digits)
434
+ i += 1 + digits
435
+ }
436
+ n == '<' -> {
437
+ val groups = m.groups
438
+ val close = template.indexOf('>', i + 2)
439
+ if (groups == null || close < 0) { out.append("$<"); i += 2 }
440
+ else {
441
+ val v = groups[template.substring(i + 2, close)]
442
+ if (v != null) out.append(jsToString(v))
443
+ i = close + 1
444
+ }
445
+ }
446
+ else -> { out.append('$'); i++ }
447
+ }
448
+ }
449
+ return out.toString()
450
+ }
451
+
452
+ /** `s.split(re, limit)` (RegExp.prototype[@@split]): captures are spliced in, an unmatched one as undefined. */
453
+ @Suppress("UNCHECKED_CAST")
454
+ fun jsSplit(s: String, re: JSRegExp, limit: Double? = null): JSArray<String> {
455
+ val out = ArrayList<String?>()
456
+ val lim = if (limit == null) 4294967295L else jsToUint32(limit)
457
+ if (lim == 0L) return JSArray(out as ArrayList<String>)
458
+ val splitter = JSRegExp(re.source, if (re.sticky) re.flags else re.flags + "y")
459
+ val unicode = re.unicode || re.unicodeSets
460
+ if (s.isEmpty()) {
461
+ if (splitter.execCaptures(s) == null) out.add(s)
462
+ return JSArray(out as ArrayList<String>)
463
+ }
464
+ var p = 0
465
+ var q = 0L
466
+ while (q < s.length) {
467
+ splitter.lastIndex = q.toDouble()
468
+ val z = splitter.execCaptures(s)
469
+ if (z == null) { q = JSRegExp.advance(s, q, unicode); continue }
470
+ val e = minOf(JSRegExp.toLength(splitter.lastIndex), s.length.toLong()).toInt()
471
+ if (e == p) { q = JSRegExp.advance(s, q, unicode); continue }
472
+ out.add(s.substring(p, q.toInt()))
473
+ if (out.size.toLong() == lim) return JSArray(out as ArrayList<String>)
474
+ p = e
475
+ for (g in 1 until z.size / 2) {
476
+ out.add(if (z[2 * g] < 0) null else s.substring(z[2 * g], z[2 * g + 1]))
477
+ if (out.size.toLong() == lim) return JSArray(out as ArrayList<String>)
478
+ }
479
+ q = p.toLong()
480
+ }
481
+ out.add(s.substring(p))
482
+ return JSArray(out as ArrayList<String>)
483
+ }
484
+
485
+ /** `s.split(separator, limit)` with an untyped separator: a RegExp splits by its pattern, undefined not at all, anything else by its string. */
486
+ fun jsSplitUntyped(s: String, separator: Any?, limit: Double? = null): JSArray<String> = when {
487
+ separator is JSRegExp -> jsSplit(s, separator, limit)
488
+ separator == null || separator === Unit -> jsSplit(s, null as String?, limit)
489
+ else -> jsSplit(s, jsToString(separator), limit)
490
+ }
491
+
492
+ /** `array.join(separator)` with an untyped separator: undefined joins with a comma, null with "null". */
493
+ fun jsJoinSeparator(separator: Any?): String = if (separator == null || separator === Unit) "," else jsToString(separator)
494
+
495
+ // Pattern syntax
496
+
497
+ private class RegexSyntaxError(message: String) : Exception(message)
498
+
499
+ private const val INFINITE = Int.MAX_VALUE
500
+
501
+ private sealed class RNode
502
+ private class RSeq(val items: List<RNode>) : RNode()
503
+ private class RAlt(val alternatives: List<RNode>) : RNode()
504
+ private class RChar(val cp: Int, val ignoreCase: Boolean) : RNode()
505
+ private class RClass(val set: RSet, val negated: Boolean, val ignoreCase: Boolean) : RNode()
506
+ private class RAssertion(val kind: Char, val multiline: Boolean, val wordExtras: Boolean) : RNode()
507
+ private class RGroup(val index: Int, val body: RNode) : RNode()
508
+ private class RLook(val ahead: Boolean, val negative: Boolean, val body: RNode) : RNode()
509
+ private class RBackReference(var groups: IntArray, val ignoreCase: Boolean) : RNode()
510
+ private class RRepeat(val body: RNode, val min: Int, val max: Int, val greedy: Boolean, val firstGroup: Int, val groupCount: Int) : RNode()
511
+
512
+ /** A class's members: code point ranges and predicates (class escapes, property escapes). */
513
+ private class RSet {
514
+ val ranges = ArrayList<IntArray>()
515
+ val predicates = ArrayList<(Int) -> Boolean>()
516
+
517
+ fun add(lo: Int, hi: Int = lo): RSet { ranges.add(intArrayOf(lo, hi)); return this }
518
+ fun add(test: (Int) -> Boolean): RSet { predicates.add(test); return this }
519
+ fun addAll(other: RSet) { ranges.addAll(other.ranges); predicates.addAll(other.predicates) }
520
+
521
+ fun contains(cp: Int): Boolean {
522
+ for (r in ranges) if (cp >= r[0] && cp <= r[1]) return true
523
+ for (p in predicates) if (p(cp)) return true
524
+ return false
525
+ }
526
+ }
527
+
528
+ private fun isLineTerminator(c: Int) = c == 0x0A || c == 0x0D || c == 0x2028 || c == 0x2029
529
+ private fun isDecimalDigit(c: Int) = c in 0x30..0x39
530
+ private fun isBasicWordChar(c: Int) = c in 0x61..0x7A || c in 0x41..0x5A || c in 0x30..0x39 || c == 0x5F
531
+ private fun isJSWhitespace(c: Int) = c <= 0xFFFF && jsIsWhitespace(c.toChar())
532
+ private fun isHexDigit(c: Char) = c in '0'..'9' || c in 'a'..'f' || c in 'A'..'F'
533
+
534
+ /** Canonicalize (§22.2.2.7.3) and the inverse classes it induces, built on first use of the `i` flag. */
535
+ private object CaseFolding {
536
+ private val upper: CharArray by lazy {
537
+ CharArray(0x10000) { c ->
538
+ val ch = c.toChar()
539
+ if (Character.isSurrogate(ch)) ch
540
+ else {
541
+ val u = ch.toString().uppercase(java.util.Locale.ROOT)
542
+ if (u.length != 1 || (c >= 128 && u[0].code < 128)) ch else u[0]
543
+ }
544
+ }
545
+ }
546
+
547
+ private val unitClasses: Map<Int, IntArray> by lazy { classes(0xFFFF) { canonicalize(it, false) } }
548
+ private val pointClasses: Map<Int, IntArray> by lazy { classes(0x10FFFF) { canonicalize(it, true) } }
549
+
550
+ private fun classes(last: Int, canon: (Int) -> Int): Map<Int, IntArray> {
551
+ val members = HashMap<Int, ArrayList<Int>>()
552
+ for (c in 0..last) {
553
+ val k = canon(c)
554
+ if (k != c) members.getOrPut(k) { arrayListOf(k) }.add(c)
555
+ }
556
+ return members.mapValues { it.value.toIntArray() }
557
+ }
558
+
559
+ /**
560
+ * Simple case folding as lower(upper(c)), with the exceptions CaseFolding.txt makes: the
561
+ * dotted and dotless i fold only to themselves, and three characters without case mappings fold.
562
+ */
563
+ fun canonicalize(c: Int, unicode: Boolean): Int {
564
+ if (!unicode) return if (c <= 0xFFFF) upper[c].code else c
565
+ return when (c) {
566
+ 0x130, 0x131 -> c
567
+ 0x1FD3 -> 0x390
568
+ 0x1FE3 -> 0x3B0
569
+ 0xFB05 -> 0xFB06
570
+ else -> Character.toLowerCase(Character.toUpperCase(c))
571
+ }
572
+ }
573
+
574
+ /** Every character whose canonical form is `canon`'s. */
575
+ fun equivalents(canon: Int, unicode: Boolean): IntArray? = (if (unicode) pointClasses else unitClasses)[canon]
576
+ }
577
+
578
+ /** Whether `set` holds `c` or a character with the same canonical form (CharacterSetMatcher under `i`). */
579
+ private fun caseClosedContains(set: RSet, c: Int, unicode: Boolean): Boolean {
580
+ if (set.contains(c)) return true
581
+ val members = CaseFolding.equivalents(CaseFolding.canonicalize(c, unicode), unicode) ?: return false
582
+ for (m in members) if (m != c && set.contains(m)) return true
583
+ return false
584
+ }
585
+
586
+ /** A `v`-mode class: its single characters as a test, and its strings of other lengths. */
587
+ private class SetClass(val test: (Int) -> Boolean, val strings: Set<String>)
588
+
589
+ private class SetOperand(val cp: Int, val set: SetClass?)
590
+
591
+ private class NamedGroup(val name: String, val index: Int, val path: List<IntArray>)
592
+
593
+ /** The pattern grammar of §22.2.1, with Annex B §B.1.2 outside unicode mode. */
594
+ private class RegexParser(val p: String, var ignoreCase: Boolean, var multiline: Boolean, var dotAll: Boolean, val unicodeMode: Boolean, val setsMode: Boolean) {
595
+ private var pos = 0
596
+ private var groupCount = 0
597
+ private val totalGroups: Int
598
+ private val hasNamedGroups: Boolean
599
+ private val names = ArrayList<NamedGroup>()
600
+ private val namedReferences = ArrayList<Pair<String, RBackReference>>()
601
+ private val path = ArrayList<IntArray>()
602
+ private var disjunctions = 0
603
+
604
+ init {
605
+ var count = 0
606
+ var named = false
607
+ var i = 0
608
+ var inClass = false
609
+ while (i < p.length) {
610
+ val c = p[i]
611
+ when {
612
+ c == '\\' -> i++
613
+ inClass -> if (c == ']') inClass = false
614
+ c == '[' -> inClass = true
615
+ c == '(' -> if (i + 1 < p.length && p[i + 1] == '?') {
616
+ if (i + 3 < p.length && p[i + 2] == '<' && p[i + 3] != '=' && p[i + 3] != '!') { count++; named = true }
617
+ } else count++
618
+ }
619
+ i++
620
+ }
621
+ totalGroups = count
622
+ hasNamedGroups = named
623
+ }
624
+
625
+ private fun error(message: String): Nothing = throw RegexSyntaxError(message)
626
+
627
+ fun parse(): RegexProgram {
628
+ val root = parseDisjunction()
629
+ if (pos < p.length) error("Unmatched ')'")
630
+ for ((name, ref) in namedReferences) {
631
+ val groups = names.filter { it.name == name }.map { it.index }
632
+ if (groups.isEmpty()) error("Invalid named capture referenced")
633
+ ref.groups = groups.toIntArray()
634
+ }
635
+ return RegexProgram(root, groupCount, names.map { Pair(it.name, it.index) }, unicodeMode)
636
+ }
637
+
638
+ private fun peekCodePoint(): Int = if (unicodeMode) p.codePointAt(pos) else p[pos].code
639
+
640
+ private fun parseDisjunction(): RNode {
641
+ val marker = intArrayOf(disjunctions++, 0)
642
+ path.add(marker)
643
+ val alternatives = arrayListOf(parseAlternative())
644
+ while (pos < p.length && p[pos] == '|') {
645
+ pos++
646
+ marker[1]++
647
+ alternatives.add(parseAlternative())
648
+ }
649
+ path.removeAt(path.size - 1)
650
+ return if (alternatives.size == 1) alternatives[0] else RAlt(alternatives)
651
+ }
652
+
653
+ private fun parseAlternative(): RNode {
654
+ val items = ArrayList<RNode>()
655
+ while (pos < p.length && p[pos] != '|' && p[pos] != ')') items.add(parseTerm())
656
+ return if (items.size == 1) items[0] else RSeq(items)
657
+ }
658
+
659
+ private fun atQuantifier(): Boolean {
660
+ if (pos >= p.length) return false
661
+ val c = p[pos]
662
+ return c == '*' || c == '+' || c == '?' || (c == '{' && braced(pos) != null)
663
+ }
664
+
665
+ private fun assertion(node: RNode): RNode {
666
+ if (atQuantifier()) error("Nothing to repeat")
667
+ return node
668
+ }
669
+
670
+ private fun parseTerm(): RNode {
671
+ val c = p[pos]
672
+ when {
673
+ c == '^' -> { pos++; return assertion(RAssertion('^', multiline, false)) }
674
+ c == '$' -> { pos++; return assertion(RAssertion('$', multiline, false)) }
675
+ c == '\\' && pos + 1 < p.length && (p[pos + 1] == 'b' || p[pos + 1] == 'B') -> {
676
+ pos += 2
677
+ return assertion(RAssertion(p[pos - 1], false, unicodeMode && ignoreCase))
678
+ }
679
+ p.startsWith("(?=", pos) || p.startsWith("(?!", pos) || p.startsWith("(?<=", pos) || p.startsWith("(?<!", pos) -> {
680
+ val ahead = p[pos + 2] != '<'
681
+ val negative = p[pos + (if (ahead) 2 else 3)] == '!'
682
+ pos += if (ahead) 3 else 4
683
+ val before = groupCount
684
+ val body = parseDisjunction()
685
+ if (pos >= p.length) error("Unterminated group")
686
+ pos++
687
+ val node = RLook(ahead, negative, body)
688
+ if (ahead && !unicodeMode) return parseQuantifier(node, before)
689
+ if (atQuantifier()) error("Invalid quantifier")
690
+ return node
691
+ }
692
+ }
693
+ val before = groupCount
694
+ return parseQuantifier(parseAtom(), before)
695
+ }
696
+
697
+ /** `{n}`, `{n,}` or `{n,m}` at `at`: min, max and the position after it. */
698
+ private fun braced(at: Int): IntArray? {
699
+ var i = at + 1
700
+ fun number(): Int? {
701
+ val start = i
702
+ var v = 0L
703
+ while (i < p.length && p[i] in '0'..'9') { v = minOf(v * 10 + (p[i] - '0'), INFINITE.toLong()); i++ }
704
+ return if (i == start) null else v.toInt()
705
+ }
706
+ val min = number() ?: return null
707
+ var max = min
708
+ if (i < p.length && p[i] == ',') {
709
+ i++
710
+ max = number() ?: INFINITE
711
+ }
712
+ if (i >= p.length || p[i] != '}') return null
713
+ return intArrayOf(min, max, i + 1)
714
+ }
715
+
716
+ private fun parseQuantifier(atom: RNode, groupsBefore: Int): RNode {
717
+ if (pos >= p.length) return atom
718
+ val min: Int
719
+ val max: Int
720
+ when (p[pos]) {
721
+ '*' -> { min = 0; max = INFINITE; pos++ }
722
+ '+' -> { min = 1; max = INFINITE; pos++ }
723
+ '?' -> { min = 0; max = 1; pos++ }
724
+ '{' -> {
725
+ val q = braced(pos)
726
+ if (q == null) {
727
+ if (unicodeMode) error("Incomplete quantifier")
728
+ return atom
729
+ }
730
+ min = q[0]; max = q[1]; pos = q[2]
731
+ if (min > max) error("numbers out of order in {} quantifier")
732
+ }
733
+ else -> return atom
734
+ }
735
+ var greedy = true
736
+ if (pos < p.length && p[pos] == '?') { pos++; greedy = false }
737
+ return RRepeat(atom, min, max, greedy, groupsBefore, groupCount - groupsBefore)
738
+ }
739
+
740
+ private fun parseAtom(): RNode {
741
+ val c = p[pos]
742
+ when (c) {
743
+ '.' -> {
744
+ pos++
745
+ val all = dotAll
746
+ return RClass(RSet().add { all || !isLineTerminator(it) }, false, false)
747
+ }
748
+ '(' -> return parseGroup()
749
+ '[' -> return if (setsMode) parseSetClass() else parseClass()
750
+ '\\' -> return parseAtomEscape()
751
+ '*', '+', '?' -> error("Nothing to repeat")
752
+ '{' -> {
753
+ if (braced(pos) != null) error("Nothing to repeat")
754
+ if (unicodeMode) error("Lone quantifier brackets")
755
+ }
756
+ '}', ']' -> if (unicodeMode) error("Lone quantifier brackets")
757
+ }
758
+ val cp = peekCodePoint()
759
+ pos += Character.charCount(cp)
760
+ return RChar(cp, ignoreCase)
761
+ }
762
+
763
+ private fun closeGroup() {
764
+ if (pos >= p.length || p[pos] != ')') error("Unterminated group")
765
+ pos++
766
+ }
767
+
768
+ private fun parseGroup(): RNode {
769
+ if (p.startsWith("(?:", pos)) {
770
+ pos += 3
771
+ val body = parseDisjunction()
772
+ closeGroup()
773
+ return body
774
+ }
775
+ if (p.startsWith("(?<", pos)) {
776
+ pos += 3
777
+ val name = parseGroupName()
778
+ val index = ++groupCount
779
+ for (other in names) if (other.name == name && !differentAlternatives(other.path, path)) error("Duplicate capture group name")
780
+ names.add(NamedGroup(name, index, path.map { it.copyOf() }))
781
+ val body = parseDisjunction()
782
+ closeGroup()
783
+ return RGroup(index, body)
784
+ }
785
+ if (p.startsWith("(?", pos)) return parseModifiers()
786
+ pos++
787
+ val index = ++groupCount
788
+ val body = parseDisjunction()
789
+ closeGroup()
790
+ return RGroup(index, body)
791
+ }
792
+
793
+ private fun differentAlternatives(a: List<IntArray>, b: List<IntArray>): Boolean {
794
+ var k = 0
795
+ while (k < a.size && k < b.size && a[k][0] == b[k][0]) {
796
+ if (a[k][1] != b[k][1]) return true
797
+ k++
798
+ }
799
+ return false
800
+ }
801
+
802
+ /** `(?ims-ims:…)`. */
803
+ private fun parseModifiers(): RNode {
804
+ pos += 2
805
+ val add = StringBuilder()
806
+ val remove = StringBuilder()
807
+ var dash = false
808
+ while (true) {
809
+ if (pos >= p.length) error("Invalid group")
810
+ val c = p[pos]
811
+ when {
812
+ c == 'i' || c == 'm' || c == 's' -> {
813
+ if (c in add || c in remove) error("Repeated flag in flag group")
814
+ (if (dash) remove else add).append(c)
815
+ pos++
816
+ }
817
+ c == '-' -> {
818
+ if (dash) error("Multiple dashes in flag group")
819
+ dash = true
820
+ pos++
821
+ }
822
+ c == ':' -> { pos++; break }
823
+ else -> error("Invalid group")
824
+ }
825
+ }
826
+ if (dash && add.isEmpty() && remove.isEmpty()) error("Invalid flag group")
827
+ val saved = booleanArrayOf(ignoreCase, multiline, dotAll)
828
+ if ('i' in add) ignoreCase = true
829
+ if ('m' in add) multiline = true
830
+ if ('s' in add) dotAll = true
831
+ if ('i' in remove) ignoreCase = false
832
+ if ('m' in remove) multiline = false
833
+ if ('s' in remove) dotAll = false
834
+ val body = parseDisjunction()
835
+ closeGroup()
836
+ ignoreCase = saved[0]; multiline = saved[1]; dotAll = saved[2]
837
+ return body
838
+ }
839
+
840
+ /** A RegExpIdentifierName and its closing `>`. */
841
+ private fun parseGroupName(): String {
842
+ val out = StringBuilder()
843
+ while (true) {
844
+ if (pos >= p.length) error("Invalid capture group name")
845
+ var cp = p.codePointAt(pos)
846
+ if (cp == '>'.code) {
847
+ pos++
848
+ break
849
+ }
850
+ if (cp == '\\'.code) {
851
+ pos++
852
+ if (pos >= p.length || p[pos] != 'u') error("Invalid capture group name")
853
+ pos++
854
+ cp = parseUnicodeEscapeBody(true) ?: error("Invalid capture group name")
855
+ } else pos += Character.charCount(cp)
856
+ val valid = if (out.isEmpty()) cp == '$'.code || cp == '_'.code || Character.isUnicodeIdentifierStart(cp)
857
+ else cp == '$'.code || cp == 0x200C || cp == 0x200D || (Character.isUnicodeIdentifierPart(cp) && !Character.isIdentifierIgnorable(cp))
858
+ if (!valid) error("Invalid capture group name")
859
+ out.appendCodePoint(cp)
860
+ }
861
+ if (out.isEmpty()) error("Invalid capture group name")
862
+ return out.toString()
863
+ }
864
+
865
+ /** After `\u`: `XXXX` (a surrogate pair `\uXXXX\uXXXX` in unicode mode) or `{X…}` in unicode mode; null if malformed. */
866
+ private fun parseUnicodeEscapeBody(unicode: Boolean): Int? {
867
+ if (unicode && pos < p.length && p[pos] == '{') {
868
+ var i = pos + 1
869
+ var v = 0L
870
+ while (i < p.length && isHexDigit(p[i])) {
871
+ v = v * 16 + Character.digit(p[i], 16)
872
+ if (v > 0x10FFFF) return null
873
+ i++
874
+ }
875
+ if (i == pos + 1 || i >= p.length || p[i] != '}') return null
876
+ pos = i + 1
877
+ return v.toInt()
878
+ }
879
+ val lead = hex4(pos) ?: return null
880
+ pos += 4
881
+ if (unicode && lead in 0xD800..0xDBFF && p.startsWith("\\u", pos)) {
882
+ val trail = hex4(pos + 2)
883
+ if (trail != null && trail in 0xDC00..0xDFFF) {
884
+ pos += 6
885
+ return Character.toCodePoint(lead.toChar(), trail.toChar())
886
+ }
887
+ }
888
+ return lead
889
+ }
890
+
891
+ private fun hex4(at: Int): Int? {
892
+ if (at + 4 > p.length) return null
893
+ var v = 0
894
+ for (i in at until at + 4) {
895
+ if (!isHexDigit(p[i])) return null
896
+ v = v * 16 + Character.digit(p[i], 16)
897
+ }
898
+ return v
899
+ }
900
+
901
+ /** `\0`…`\377` outside unicode mode. */
902
+ private fun parseLegacyOctal(): Int {
903
+ var v = p[pos] - '0'
904
+ pos++
905
+ if (pos < p.length && p[pos] in '0'..'7') {
906
+ v = v * 8 + (p[pos] - '0')
907
+ pos++
908
+ if (v < 32 && pos < p.length && p[pos] in '0'..'7') {
909
+ v = v * 8 + (p[pos] - '0')
910
+ pos++
911
+ }
912
+ }
913
+ return v
914
+ }
915
+
916
+ private fun classEscapeSet(c: Char): RSet? {
917
+ val extras = unicodeMode && ignoreCase
918
+ return when (c) {
919
+ 'd' -> RSet().add(0x30, 0x39)
920
+ 'D' -> RSet().add { !isDecimalDigit(it) }
921
+ 's' -> RSet().add { isJSWhitespace(it) }
922
+ 'S' -> RSet().add { !isJSWhitespace(it) }
923
+ 'w' -> RSet().add { isBasicWordChar(it) || (extras && (it == 0x17F || it == 0x212A)) }
924
+ 'W' -> RSet().add { !(isBasicWordChar(it) || (extras && (it == 0x17F || it == 0x212A))) }
925
+ else -> null
926
+ }
927
+ }
928
+
929
+ /** `\p{…}` / `\P{…}` after the `p` or `P`. */
930
+ private fun parseProperty(negated: Boolean): RSet {
931
+ pos++
932
+ if (pos >= p.length || p[pos] != '{') error("Invalid property name")
933
+ val close = p.indexOf('}', pos)
934
+ if (close < 0) error("Invalid property name")
935
+ val text = p.substring(pos + 1, close)
936
+ pos = close + 1
937
+ val test = UnicodeProperties.lookup(text) ?: error("Invalid property name")
938
+ return RSet().add(if (negated) { cp -> !test(cp) } else test)
939
+ }
940
+
941
+ private fun parseAtomEscape(): RNode {
942
+ pos++
943
+ if (pos >= p.length) error("\\ at end of pattern")
944
+ val c = p[pos]
945
+ classEscapeSet(c)?.let { pos++; return RClass(it, false, ignoreCase) }
946
+ when (c) {
947
+ in '1'..'9' -> {
948
+ val start = pos
949
+ var n = 0L
950
+ while (pos < p.length && p[pos] in '0'..'9') { n = minOf(n * 10 + (p[pos] - '0'), INFINITE.toLong()); pos++ }
951
+ if (n <= totalGroups) return RBackReference(intArrayOf(n.toInt()), ignoreCase)
952
+ if (unicodeMode) error("Invalid escape")
953
+ pos = start
954
+ if (c >= '8') { pos++; return RChar(c.code, ignoreCase) }
955
+ return RChar(parseLegacyOctal(), ignoreCase)
956
+ }
957
+ '0' -> {
958
+ if (pos + 1 < p.length && p[pos + 1] in '0'..'9') {
959
+ if (unicodeMode) error("Invalid decimal escape")
960
+ return RChar(parseLegacyOctal(), ignoreCase)
961
+ }
962
+ pos++
963
+ return RChar(0, ignoreCase)
964
+ }
965
+ 'k' -> if (unicodeMode || hasNamedGroups) {
966
+ pos++
967
+ if (pos >= p.length || p[pos] != '<') error("Invalid named reference")
968
+ pos++
969
+ val ref = RBackReference(IntArray(0), ignoreCase)
970
+ namedReferences.add(Pair(parseGroupName(), ref))
971
+ return ref
972
+ }
973
+ 'p', 'P' -> if (unicodeMode) return RClass(parseProperty(c == 'P'), false, ignoreCase)
974
+ }
975
+ return RChar(parseCharacterEscape(false), ignoreCase)
976
+ }
977
+
978
+ /**
979
+ * CharacterEscape at `pos` (just after the backslash): control escapes, `\cX`, `\xHH`, `\u…`,
980
+ * and identity escapes. Outside unicode mode a malformed `\c` leaves the backslash as a
981
+ * literal and `c` to be read next.
982
+ */
983
+ private fun parseCharacterEscape(inClass: Boolean): Int {
984
+ val c = p[pos]
985
+ when (c) {
986
+ 'f' -> { pos++; return 0x0C }
987
+ 'n' -> { pos++; return 0x0A }
988
+ 'r' -> { pos++; return 0x0D }
989
+ 't' -> { pos++; return 0x09 }
990
+ 'v' -> { pos++; return 0x0B }
991
+ 'c' -> {
992
+ if (pos + 1 < p.length && (p[pos + 1] in 'a'..'z' || p[pos + 1] in 'A'..'Z' || (inClass && !unicodeMode && (p[pos + 1] in '0'..'9' || p[pos + 1] == '_')))) {
993
+ pos += 2
994
+ return p[pos - 1].code % 32
995
+ }
996
+ if (unicodeMode) error("Invalid Unicode escape")
997
+ return '\\'.code
998
+ }
999
+ 'x' -> {
1000
+ if (pos + 2 < p.length && isHexDigit(p[pos + 1]) && isHexDigit(p[pos + 2])) {
1001
+ pos += 3
1002
+ return Character.digit(p[pos - 2], 16) * 16 + Character.digit(p[pos - 1], 16)
1003
+ }
1004
+ if (unicodeMode) error("Invalid escape")
1005
+ pos++
1006
+ return 'x'.code
1007
+ }
1008
+ 'u' -> {
1009
+ pos++
1010
+ val start = pos
1011
+ parseUnicodeEscapeBody(unicodeMode)?.let { return it }
1012
+ if (unicodeMode) error("Invalid Unicode escape")
1013
+ pos = start
1014
+ return 'u'.code
1015
+ }
1016
+ }
1017
+ if (unicodeMode) {
1018
+ if ("^$\\.*+?()[]{}|/".indexOf(c) >= 0 || (inClass && c == '-')) { pos++; return c.code }
1019
+ error("Invalid escape")
1020
+ }
1021
+ val cp = peekCodePoint()
1022
+ pos += Character.charCount(cp)
1023
+ return cp
1024
+ }
1025
+
1026
+ private class ClassAtom(val cp: Int, val set: RSet?)
1027
+
1028
+ private fun parseClassAtom(): ClassAtom {
1029
+ val c = p[pos]
1030
+ if (c != '\\') {
1031
+ val cp = peekCodePoint()
1032
+ pos += Character.charCount(cp)
1033
+ return ClassAtom(cp, null)
1034
+ }
1035
+ pos++
1036
+ if (pos >= p.length) error("\\ at end of pattern")
1037
+ val e = p[pos]
1038
+ classEscapeSet(e)?.let { pos++; return ClassAtom(-1, it) }
1039
+ when (e) {
1040
+ 'b' -> { pos++; return ClassAtom(8, null) }
1041
+ '-' -> { pos++; return ClassAtom('-'.code, null) }
1042
+ 'p', 'P' -> if (unicodeMode) return ClassAtom(-1, parseProperty(e == 'P'))
1043
+ in '0'..'9' -> {
1044
+ if (unicodeMode) {
1045
+ if (e == '0' && !(pos + 1 < p.length && p[pos + 1] in '0'..'9')) { pos++; return ClassAtom(0, null) }
1046
+ error("Invalid decimal escape")
1047
+ }
1048
+ if (e >= '8') { pos++; return ClassAtom(e.code, null) }
1049
+ return ClassAtom(parseLegacyOctal(), null)
1050
+ }
1051
+ 'k', 'B' -> if (unicodeMode) error("Invalid escape")
1052
+ }
1053
+ return ClassAtom(parseCharacterEscape(true), null)
1054
+ }
1055
+
1056
+ private fun parseClass(): RNode {
1057
+ pos++
1058
+ var negated = false
1059
+ if (pos < p.length && p[pos] == '^') { negated = true; pos++ }
1060
+ val set = RSet()
1061
+ while (true) {
1062
+ if (pos >= p.length) error("Unterminated character class")
1063
+ if (p[pos] == ']') { pos++; break }
1064
+ val a = parseClassAtom()
1065
+ if (pos + 1 < p.length && p[pos] == '-' && p[pos + 1] != ']') {
1066
+ pos++
1067
+ val b = parseClassAtom()
1068
+ if (a.set != null || b.set != null) {
1069
+ if (unicodeMode) error("Invalid character class")
1070
+ addAtom(set, a)
1071
+ set.add('-'.code)
1072
+ addAtom(set, b)
1073
+ } else {
1074
+ if (a.cp > b.cp) error("Range out of order in character class")
1075
+ set.add(a.cp, b.cp)
1076
+ }
1077
+ } else addAtom(set, a)
1078
+ }
1079
+ return RClass(set, negated, ignoreCase)
1080
+ }
1081
+
1082
+ private fun addAtom(set: RSet, a: ClassAtom) {
1083
+ if (a.set != null) set.addAll(a.set) else set.add(a.cp)
1084
+ }
1085
+
1086
+ // `v` mode classes (ClassSetExpression): nesting, `&&`, `--` and `\q{…}` strings. Under `i`
1087
+ // every leaf set is closed over case equivalents before the set operations combine them.
1088
+
1089
+ private fun leaf(set: RSet): (Int) -> Boolean {
1090
+ if (!ignoreCase) return set::contains
1091
+ return { c -> caseClosedContains(set, c, true) }
1092
+ }
1093
+
1094
+ private fun at(text: String): Boolean = p.startsWith(text, pos)
1095
+
1096
+ private fun parseSetClass(): RNode {
1097
+ pos++
1098
+ val set = parseSetContents()
1099
+ val chars = RClass(RSet().add(set.test), false, false)
1100
+ if (set.strings.isEmpty()) return chars
1101
+ val alternatives = ArrayList<RNode>()
1102
+ for (s in set.strings.filter { it.isNotEmpty() }.sortedByDescending { it.codePointCount(0, it.length) }) {
1103
+ alternatives.add(RSeq(s.codePoints().toArray().map { RChar(it, ignoreCase) }))
1104
+ }
1105
+ alternatives.add(chars)
1106
+ if ("" in set.strings) alternatives.add(RSeq(emptyList()))
1107
+ return RAlt(alternatives)
1108
+ }
1109
+
1110
+ /** After `[`: the contents, the closing `]`, and the complement for `[^…]`. */
1111
+ private fun parseSetContents(): SetClass {
1112
+ val negated = pos < p.length && p[pos] == '^'
1113
+ if (negated) pos++
1114
+ val set = parseSetExpression()
1115
+ if (!negated) return set
1116
+ if (set.strings.isNotEmpty()) error("Negated character class may contain strings")
1117
+ val test = set.test
1118
+ return SetClass({ c -> !test(c) }, emptySet())
1119
+ }
1120
+
1121
+ private fun operandSet(o: SetOperand): SetClass = o.set ?: SetClass(leaf(RSet().add(o.cp)), emptySet())
1122
+
1123
+ private fun parseSetExpression(): SetClass {
1124
+ if (pos >= p.length) error("Unterminated character class")
1125
+ if (p[pos] == ']') { pos++; return SetClass({ false }, emptySet()) }
1126
+ val first = parseSetOperand()
1127
+ if (at("&&") || at("--")) {
1128
+ val intersect = at("&&")
1129
+ var test = operandSet(first).test
1130
+ var strings = operandSet(first).strings
1131
+ while (true) {
1132
+ if (pos >= p.length) error("Unterminated character class")
1133
+ if (p[pos] == ']') { pos++; break }
1134
+ if (!at(if (intersect) "&&" else "--")) error("Invalid set operation in character class")
1135
+ pos += 2
1136
+ if (intersect && pos < p.length && p[pos] == '&') error("Invalid character in character class")
1137
+ val next = operandSet(parseSetOperand())
1138
+ val a = test
1139
+ val b = next.test
1140
+ if (intersect) {
1141
+ test = { c -> a(c) && b(c) }
1142
+ strings = strings.intersect(next.strings)
1143
+ } else {
1144
+ test = { c -> a(c) && !b(c) }
1145
+ strings = strings - next.strings
1146
+ }
1147
+ }
1148
+ return SetClass(test, strings)
1149
+ }
1150
+ val singles = RSet()
1151
+ val tests = ArrayList<(Int) -> Boolean>()
1152
+ val strings = HashSet<String>()
1153
+ var operand = first
1154
+ while (true) {
1155
+ if (pos < p.length && p[pos] == '-' && !at("--")) {
1156
+ pos++
1157
+ val end = parseSetOperand()
1158
+ if (operand.set != null || end.set != null) error("Invalid character class")
1159
+ if (operand.cp > end.cp) error("Range out of order in character class")
1160
+ singles.add(operand.cp, end.cp)
1161
+ } else if (operand.set != null) {
1162
+ tests.add(operand.set.test)
1163
+ strings.addAll(operand.set.strings)
1164
+ } else singles.add(operand.cp)
1165
+ if (pos >= p.length) error("Unterminated character class")
1166
+ if (p[pos] == ']') { pos++; break }
1167
+ if (at("&&") || at("--")) error("Invalid set operation in character class")
1168
+ operand = parseSetOperand()
1169
+ }
1170
+ val single = leaf(singles)
1171
+ return SetClass({ c -> single(c) || tests.any { it(c) } }, strings)
1172
+ }
1173
+
1174
+ private fun parseSetOperand(): SetOperand {
1175
+ if (pos >= p.length) error("Unterminated character class")
1176
+ val c = p[pos]
1177
+ if (c == '[') {
1178
+ pos++
1179
+ return SetOperand(-1, parseSetContents())
1180
+ }
1181
+ if (c == '\\') {
1182
+ pos++
1183
+ if (pos >= p.length) error("\\ at end of pattern")
1184
+ val e = p[pos]
1185
+ classEscapeSet(e)?.let { pos++; return SetOperand(-1, SetClass(leaf(it), emptySet())) }
1186
+ if (e == 'p' || e == 'P') return SetOperand(-1, SetClass(leaf(parseProperty(e == 'P')), emptySet()))
1187
+ if (e == 'q') return SetOperand(-1, parseStringDisjunction())
1188
+ return SetOperand(parseSetCharacterEscape(), null)
1189
+ }
1190
+ return SetOperand(parseSetCharacter(), null)
1191
+ }
1192
+
1193
+ /** A ClassSetCharacter that is not an escape. */
1194
+ private fun parseSetCharacter(): Int {
1195
+ val c = p[pos]
1196
+ if ("()[]{}/-|".indexOf(c) >= 0) error("Invalid character in character class")
1197
+ if ("&!#$%*+,.:;<=>?@^`~".indexOf(c) >= 0 && pos + 1 < p.length && p[pos + 1] == c) error("Invalid set operation in character class")
1198
+ val cp = p.codePointAt(pos)
1199
+ pos += Character.charCount(cp)
1200
+ return cp
1201
+ }
1202
+
1203
+ /** After the backslash of an escaped ClassSetCharacter. */
1204
+ private fun parseSetCharacterEscape(): Int {
1205
+ val e = p[pos]
1206
+ if (e == 'b') { pos++; return 8 }
1207
+ if ("&-!#%,:;<=>@`~".indexOf(e) >= 0) { pos++; return e.code }
1208
+ if (e in '0'..'9') {
1209
+ if (e == '0' && !(pos + 1 < p.length && p[pos + 1] in '0'..'9')) { pos++; return 0 }
1210
+ error("Invalid decimal escape")
1211
+ }
1212
+ return parseCharacterEscape(true)
1213
+ }
1214
+
1215
+ /** `\q{a|bc|…}` after the backslash. */
1216
+ private fun parseStringDisjunction(): SetClass {
1217
+ pos++
1218
+ if (pos >= p.length || p[pos] != '{') error("Invalid escape")
1219
+ pos++
1220
+ val singles = RSet()
1221
+ val strings = HashSet<String>()
1222
+ val current = StringBuilder()
1223
+ fun finish() {
1224
+ val s = current.toString()
1225
+ if (s.isNotEmpty() && s.codePointCount(0, s.length) == 1) singles.add(s.codePointAt(0)) else strings.add(s)
1226
+ current.setLength(0)
1227
+ }
1228
+ while (true) {
1229
+ if (pos >= p.length) error("Unterminated character class")
1230
+ when (p[pos]) {
1231
+ '}' -> { pos++; finish(); break }
1232
+ '|' -> { pos++; finish() }
1233
+ '\\' -> {
1234
+ pos++
1235
+ if (pos >= p.length) error("\\ at end of pattern")
1236
+ current.appendCodePoint(parseSetCharacterEscape())
1237
+ }
1238
+ else -> current.appendCodePoint(parseSetCharacter())
1239
+ }
1240
+ }
1241
+ return SetClass(leaf(singles), strings)
1242
+ }
1243
+ }
1244
+
1245
+ /** `\p{…}` names: General_Category values, binary properties, and Script / Script_Extensions values. */
1246
+ private object UnicodeProperties {
1247
+ private fun types(vararg t: Int): (Int) -> Boolean = { cp -> Character.getType(cp) in t }
1248
+
1249
+ private val categories: Map<String, (Int) -> Boolean> = HashMap<String, (Int) -> Boolean>().apply {
1250
+ fun def(test: (Int) -> Boolean, vararg names: String) { for (n in names) put(n, test) }
1251
+ val lu = Character.UPPERCASE_LETTER.toInt(); val ll = Character.LOWERCASE_LETTER.toInt(); val lt = Character.TITLECASE_LETTER.toInt()
1252
+ val lm = Character.MODIFIER_LETTER.toInt(); val lo = Character.OTHER_LETTER.toInt()
1253
+ val mn = Character.NON_SPACING_MARK.toInt(); val mc = Character.COMBINING_SPACING_MARK.toInt(); val me = Character.ENCLOSING_MARK.toInt()
1254
+ val nd = Character.DECIMAL_DIGIT_NUMBER.toInt(); val nl = Character.LETTER_NUMBER.toInt(); val no = Character.OTHER_NUMBER.toInt()
1255
+ val pc = Character.CONNECTOR_PUNCTUATION.toInt(); val pd = Character.DASH_PUNCTUATION.toInt(); val ps = Character.START_PUNCTUATION.toInt()
1256
+ val pe = Character.END_PUNCTUATION.toInt(); val pi = Character.INITIAL_QUOTE_PUNCTUATION.toInt(); val pf = Character.FINAL_QUOTE_PUNCTUATION.toInt()
1257
+ val po = Character.OTHER_PUNCTUATION.toInt()
1258
+ val sm = Character.MATH_SYMBOL.toInt(); val sc = Character.CURRENCY_SYMBOL.toInt(); val sk = Character.MODIFIER_SYMBOL.toInt(); val so = Character.OTHER_SYMBOL.toInt()
1259
+ val zs = Character.SPACE_SEPARATOR.toInt(); val zl = Character.LINE_SEPARATOR.toInt(); val zp = Character.PARAGRAPH_SEPARATOR.toInt()
1260
+ val cc = Character.CONTROL.toInt(); val cf = Character.FORMAT.toInt(); val cs = Character.SURROGATE.toInt()
1261
+ val co = Character.PRIVATE_USE.toInt(); val cn = Character.UNASSIGNED.toInt()
1262
+ def(types(lu, ll, lt, lm, lo), "L", "Letter")
1263
+ def(types(lu, ll, lt), "LC", "Cased_Letter")
1264
+ def(types(lu), "Lu", "Uppercase_Letter")
1265
+ def(types(ll), "Ll", "Lowercase_Letter")
1266
+ def(types(lt), "Lt", "Titlecase_Letter")
1267
+ def(types(lm), "Lm", "Modifier_Letter")
1268
+ def(types(lo), "Lo", "Other_Letter")
1269
+ def(types(mn, mc, me), "M", "Mark", "Combining_Mark")
1270
+ def(types(mn), "Mn", "Nonspacing_Mark")
1271
+ def(types(mc), "Mc", "Spacing_Mark")
1272
+ def(types(me), "Me", "Enclosing_Mark")
1273
+ def(types(nd, nl, no), "N", "Number")
1274
+ def(types(nd), "Nd", "Decimal_Number", "digit")
1275
+ def(types(nl), "Nl", "Letter_Number")
1276
+ def(types(no), "No", "Other_Number")
1277
+ def(types(pc, pd, ps, pe, pi, pf, po), "P", "Punctuation", "punct")
1278
+ def(types(pc), "Pc", "Connector_Punctuation")
1279
+ def(types(pd), "Pd", "Dash_Punctuation")
1280
+ def(types(ps), "Ps", "Open_Punctuation")
1281
+ def(types(pe), "Pe", "Close_Punctuation")
1282
+ def(types(pi), "Pi", "Initial_Punctuation")
1283
+ def(types(pf), "Pf", "Final_Punctuation")
1284
+ def(types(po), "Po", "Other_Punctuation")
1285
+ def(types(sm, sc, sk, so), "S", "Symbol")
1286
+ def(types(sm), "Sm", "Math_Symbol")
1287
+ def(types(sc), "Sc", "Currency_Symbol")
1288
+ def(types(sk), "Sk", "Modifier_Symbol")
1289
+ def(types(so), "So", "Other_Symbol")
1290
+ def(types(zs, zl, zp), "Z", "Separator")
1291
+ def(types(zs), "Zs", "Space_Separator")
1292
+ def(types(zl), "Zl", "Line_Separator")
1293
+ def(types(zp), "Zp", "Paragraph_Separator")
1294
+ def(types(cc, cf, cs, co, cn), "C", "Other")
1295
+ def(types(cc), "Cc", "Control", "cntrl")
1296
+ def(types(cf), "Cf", "Format")
1297
+ def(types(cs), "Cs", "Surrogate")
1298
+ def(types(co), "Co", "Private_Use")
1299
+ def(types(cn), "Cn", "Unassigned")
1300
+ }
1301
+
1302
+ /** Extended_Pictographic as of Unicode 15. */
1303
+ private val pictographic = intArrayOf(
1304
+ 0xA9, 0xA9, 0xAE, 0xAE, 0x203C, 0x203C, 0x2049, 0x2049, 0x2122, 0x2122, 0x2139, 0x2139, 0x2194, 0x2199, 0x21A9, 0x21AA,
1305
+ 0x231A, 0x231B, 0x2328, 0x2328, 0x2388, 0x2388, 0x23CF, 0x23CF, 0x23E9, 0x23F3, 0x23F8, 0x23FA, 0x24C2, 0x24C2,
1306
+ 0x25AA, 0x25AB, 0x25B6, 0x25B6, 0x25C0, 0x25C0, 0x25FB, 0x25FE, 0x2600, 0x2605, 0x2607, 0x2612, 0x2614, 0x2685,
1307
+ 0x2690, 0x2705, 0x2708, 0x2712, 0x2714, 0x2714, 0x2716, 0x2716, 0x271D, 0x271D, 0x2721, 0x2721, 0x2728, 0x2728,
1308
+ 0x2733, 0x2734, 0x2744, 0x2744, 0x2747, 0x2747, 0x274C, 0x274C, 0x274E, 0x274E, 0x2753, 0x2755, 0x2757, 0x2757,
1309
+ 0x2763, 0x2767, 0x2795, 0x2797, 0x27A1, 0x27A1, 0x27B0, 0x27B0, 0x27BF, 0x27BF, 0x2934, 0x2935, 0x2B05, 0x2B07,
1310
+ 0x2B1B, 0x2B1C, 0x2B50, 0x2B50, 0x2B55, 0x2B55, 0x3030, 0x3030, 0x303D, 0x303D, 0x3297, 0x3297, 0x3299, 0x3299,
1311
+ 0x1F000, 0x1F0FF, 0x1F10D, 0x1F10F, 0x1F12F, 0x1F12F, 0x1F16C, 0x1F171, 0x1F17E, 0x1F17F, 0x1F18E, 0x1F18E,
1312
+ 0x1F191, 0x1F19A, 0x1F1AD, 0x1F1E5, 0x1F201, 0x1F20F, 0x1F21A, 0x1F21A, 0x1F22F, 0x1F22F, 0x1F232, 0x1F23A,
1313
+ 0x1F23C, 0x1F23F, 0x1F249, 0x1F3FA, 0x1F400, 0x1F53D, 0x1F546, 0x1F64F, 0x1F680, 0x1F6FF, 0x1F774, 0x1F77F,
1314
+ 0x1F7D5, 0x1F7FF, 0x1F80C, 0x1F80F, 0x1F848, 0x1F84F, 0x1F85A, 0x1F85F, 0x1F888, 0x1F88F, 0x1F8AE, 0x1F8FF,
1315
+ 0x1F90C, 0x1F93A, 0x1F93C, 0x1F945, 0x1F947, 0x1FAFF, 0x1FC00, 0x1FFFD,
1316
+ )
1317
+
1318
+ /** Emoji_Presentation as of Unicode 15. */
1319
+ private val emojiPresentation = intArrayOf(
1320
+ 0x231A, 0x231B, 0x23E9, 0x23EC, 0x23F0, 0x23F0, 0x23F3, 0x23F3, 0x25FD, 0x25FE, 0x2614, 0x2615, 0x2648, 0x2653,
1321
+ 0x267F, 0x267F, 0x2693, 0x2693, 0x26A1, 0x26A1, 0x26AA, 0x26AB, 0x26BD, 0x26BE, 0x26C4, 0x26C5, 0x26CE, 0x26CE,
1322
+ 0x26D4, 0x26D4, 0x26EA, 0x26EA, 0x26F2, 0x26F3, 0x26F5, 0x26F5, 0x26FA, 0x26FA, 0x26FD, 0x26FD, 0x2705, 0x2705,
1323
+ 0x270A, 0x270B, 0x2728, 0x2728, 0x274C, 0x274C, 0x274E, 0x274E, 0x2753, 0x2755, 0x2757, 0x2757, 0x2795, 0x2797,
1324
+ 0x27B0, 0x27B0, 0x27BF, 0x27BF, 0x2B1B, 0x2B1C, 0x2B50, 0x2B50, 0x2B55, 0x2B55, 0x1F004, 0x1F004, 0x1F0CF, 0x1F0CF,
1325
+ 0x1F18E, 0x1F18E, 0x1F191, 0x1F19A, 0x1F1E6, 0x1F1FF, 0x1F201, 0x1F201, 0x1F21A, 0x1F21A, 0x1F22F, 0x1F22F,
1326
+ 0x1F232, 0x1F236, 0x1F238, 0x1F23A, 0x1F250, 0x1F251, 0x1F300, 0x1F320, 0x1F32D, 0x1F335, 0x1F337, 0x1F37C,
1327
+ 0x1F37E, 0x1F393, 0x1F3A0, 0x1F3CA, 0x1F3CF, 0x1F3D3, 0x1F3E0, 0x1F3F0, 0x1F3F4, 0x1F3F4, 0x1F3F8, 0x1F43E,
1328
+ 0x1F440, 0x1F440, 0x1F442, 0x1F4FC, 0x1F4FF, 0x1F53D, 0x1F54B, 0x1F54E, 0x1F550, 0x1F567, 0x1F57A, 0x1F57A,
1329
+ 0x1F595, 0x1F596, 0x1F5A4, 0x1F5A4, 0x1F5FB, 0x1F64F, 0x1F680, 0x1F6C5, 0x1F6CC, 0x1F6CC, 0x1F6D0, 0x1F6D2,
1330
+ 0x1F6D5, 0x1F6D7, 0x1F6DC, 0x1F6DF, 0x1F6EB, 0x1F6EC, 0x1F6F4, 0x1F6FC, 0x1F7E0, 0x1F7EB, 0x1F7F0, 0x1F7F0,
1331
+ 0x1F90C, 0x1F93A, 0x1F93C, 0x1F945, 0x1F947, 0x1F9FF, 0x1FA70, 0x1FA7C, 0x1FA80, 0x1FA89, 0x1FA8F, 0x1FAC6,
1332
+ 0x1FACE, 0x1FADC, 0x1FADF, 0x1FAE9, 0x1FAF0, 0x1FAF8,
1333
+ )
1334
+
1335
+ private fun inRanges(ranges: IntArray, cp: Int): Boolean {
1336
+ var i = 0
1337
+ while (i < ranges.size) {
1338
+ if (cp < ranges[i]) return false
1339
+ if (cp <= ranges[i + 1]) return true
1340
+ i += 2
1341
+ }
1342
+ return false
1343
+ }
1344
+
1345
+ private fun isPictographic(cp: Int) = inRanges(pictographic, cp)
1346
+
1347
+ private val binary: Map<String, (Int) -> Boolean> = HashMap<String, (Int) -> Boolean>().apply {
1348
+ fun def(test: (Int) -> Boolean, vararg names: String) { for (n in names) put(n, test) }
1349
+ def({ true }, "Any")
1350
+ def({ it < 0x80 }, "ASCII")
1351
+ def({ Character.getType(it) != Character.UNASSIGNED.toInt() }, "Assigned")
1352
+ def({ Character.isAlphabetic(it) }, "Alphabetic", "Alpha")
1353
+ def({ Character.isLowerCase(it) }, "Lowercase", "Lower")
1354
+ def({ Character.isUpperCase(it) }, "Uppercase", "Upper")
1355
+ def({ it in 0x9..0xD || it == 0x20 || it == 0x85 || it == 0xA0 || it == 0x1680 || it in 0x2000..0x200A || it == 0x2028 || it == 0x2029 || it == 0x202F || it == 0x205F || it == 0x3000 }, "White_Space", "space")
1356
+ def({ Character.isUnicodeIdentifierStart(it) }, "ID_Start", "IDS")
1357
+ def({ Character.isUnicodeIdentifierPart(it) && !Character.isIdentifierIgnorable(it) }, "ID_Continue", "IDC")
1358
+ def({ Character.isIdeographic(it) }, "Ideographic", "Ideo")
1359
+ def({ it in 0x30..0x39 || it in 0x41..0x46 || it in 0x61..0x66 }, "ASCII_Hex_Digit", "AHex")
1360
+ def({ it in 0x30..0x39 || it in 0x41..0x46 || it in 0x61..0x66 || it in 0xFF10..0xFF19 || it in 0xFF21..0xFF26 || it in 0xFF41..0xFF46 }, "Hex_Digit", "Hex")
1361
+ def({ Character.isMirrored(it) }, "Bidi_Mirrored", "Bidi_M")
1362
+ def(::isPictographic, "Extended_Pictographic", "ExtPict")
1363
+ def({ (isPictographic(it) && Character.getType(it) != Character.UNASSIGNED.toInt()) || it == 0x23 || it == 0x2A || it in 0x30..0x39 || it in 0x1F1E6..0x1F1FF || it in 0x1F3FB..0x1F3FF }, "Emoji")
1364
+ def({ inRanges(emojiPresentation, it) }, "Emoji_Presentation", "EPres")
1365
+ def({ it in 0x1F3FB..0x1F3FF }, "Emoji_Modifier", "EMod")
1366
+ def({ it in 0x1F1E6..0x1F1FF }, "Regional_Indicator", "RI")
1367
+ def({ Character.getType(it) == Character.NON_SPACING_MARK.toInt() || Character.getType(it) == Character.ENCLOSING_MARK.toInt() || Character.getType(it) == Character.FORMAT.toInt() || it == 0xAD }, "Case_Ignorable", "CI")
1368
+ def({ Character.isLowerCase(it) || Character.isUpperCase(it) || Character.isTitleCase(it) }, "Cased")
1369
+ def({ Character.getType(it) == Character.CONTROL.toInt() || (Character.getType(it) == Character.FORMAT.toInt()) || Character.isIdentifierIgnorable(it) && it > 0x7F }, "Default_Ignorable_Code_Point", "DI")
1370
+ }
1371
+
1372
+ private fun script(name: String): ((Int) -> Boolean)? {
1373
+ if (name.isEmpty() || !name[0].isUpperCase()) return null
1374
+ val script = try { Character.UnicodeScript.forName(name) } catch (e: IllegalArgumentException) { return null }
1375
+ val canonical = script.name.split('_').joinToString("_") { part -> part.lowercase().replaceFirstChar { it.uppercase() } }
1376
+ if (name != canonical && name.length != 4) return null
1377
+ return { cp -> Character.UnicodeScript.of(cp) == script }
1378
+ }
1379
+
1380
+ fun lookup(text: String): ((Int) -> Boolean)? {
1381
+ val eq = text.indexOf('=')
1382
+ if (eq < 0) return categories[text] ?: binary[text]
1383
+ val key = text.substring(0, eq)
1384
+ val value = text.substring(eq + 1)
1385
+ return when (key) {
1386
+ "General_Category", "gc" -> categories[value]
1387
+ "Script", "sc", "Script_Extensions", "scx" -> script(value)
1388
+ else -> null
1389
+ }
1390
+ }
1391
+ }
1392
+
1393
+ // Matching
1394
+ //
1395
+ // A pattern compiles to a bytecode program run by a backtracking VM. Choice points, and the undo records that put
1396
+ // captures and loop registers back, live on one IntArray stack: a step allocates nothing, and a match's depth is
1397
+ // bounded by MAX_STACK, not by the thread's stack. The semantics are §22.2.2's: RepeatMatcher's capture resets and
1398
+ // empty-iteration check, a group set when its body completes, atomic lookarounds, lookbehind read right to left.
1399
+
1400
+ /** The VM's instructions; each is its opcode and the operands listed. */
1401
+ private object Op {
1402
+ /** code point, forward */
1403
+ const val CHAR = 0
1404
+ /** class, forward */
1405
+ const val CLASS = 1
1406
+ /** literal (a run of BMP code units compared case-sensitively, forward) */
1407
+ const val LITERAL = 2
1408
+ /** kind (^ $ \b \B), multiline, word extras */
1409
+ const val ASSERT = 3
1410
+ /** preferred, other: goes on at `preferred`, backtracking to `other` */
1411
+ const val SPLIT = 4
1412
+ /** target */
1413
+ const val JUMP = 5
1414
+ /** group: notes where its text starts */
1415
+ const val GROUP_OPEN = 6
1416
+ /** group, forward: sets its capture */
1417
+ const val GROUP_CLOSE = 7
1418
+ /** register */
1419
+ const val LOOP_INIT = 8
1420
+ /** register, min, max, greedy, exit; LOOP_BODY follows */
1421
+ const val LOOP_HEAD = 9
1422
+ /** register, first capture slot reset, end of them */
1423
+ const val LOOP_BODY = 10
1424
+ /** register, head, min */
1425
+ const val LOOP_TAIL = 11
1426
+ /** class, min, max, greedy, forward: a quantified single character, without a loop */
1427
+ const val REPEAT = 12
1428
+ /** groups, ignore case, forward */
1429
+ const val BACKREF = 13
1430
+ /** negative, continuation; the body follows, ending in SUCCEED */
1431
+ const val LOOK = 14
1432
+ const val SUCCEED = 15
1433
+ }
1434
+
1435
+ private const val ASSERT_START = 0
1436
+ private const val ASSERT_END = 1
1437
+ private const val ASSERT_BOUNDARY = 2
1438
+ private const val ASSERT_NOT_BOUNDARY = 3
1439
+
1440
+ // Backtrack stack entries: their values, then the tag on top.
1441
+ /** pc, position: where to go on when what follows fails */
1442
+ private const val T_CHOICE = 0
1443
+ /** slot, old value */
1444
+ private const val T_UNDO = 1
1445
+ /** REPEAT op, least position, position: a greedy run giving back one character at a time */
1446
+ private const val T_GREEDY = 2
1447
+ /** REPEAT op, position, count: a lazy run taking one more character at a time */
1448
+ private const val T_LAZY = 3
1449
+
1450
+ private val ANY_CHARACTER: (Int) -> Boolean = { true }
1451
+
1452
+ /** How many of a match's first code units the search checks before an attempt. */
1453
+ private const val LEAD_LIMIT = 8
1454
+
1455
+ /** A greedy REPEAT whose run is never given back (RegexCompiler.followers). */
1456
+ private const val POSSESSIVE = -2
1457
+
1458
+ /** A character test with the answers for ASCII in a bitmap; `rest` answers for the others, none when null. */
1459
+ private class CharClass(private val low: Long, private val high: Long, private val rest: ((Int) -> Boolean)?) {
1460
+ fun has(c: Int): Boolean = if (c < 128) ((if (c < 64) low ushr c else high ushr (c - 64)) and 1L) != 0L else hasBeyondAscii(c)
1461
+
1462
+ private fun hasBeyondAscii(c: Int): Boolean {
1463
+ val test = rest ?: return false
1464
+ return test(c)
1465
+ }
1466
+
1467
+ fun union(other: CharClass): CharClass {
1468
+ val a = rest
1469
+ val b = other.rest
1470
+ return CharClass(low or other.low, high or other.high, if (a == null) b else if (b == null) a else { c -> a(c) || b(c) })
1471
+ }
1472
+
1473
+ companion object {
1474
+ /** `test` as a class; `rest` must answer as `test` does from 128 on. */
1475
+ fun of(test: (Int) -> Boolean, rest: ((Int) -> Boolean)?): CharClass {
1476
+ var low = 0L
1477
+ var high = 0L
1478
+ for (c in 0 until 64) if (test(c)) low = low or (1L shl c)
1479
+ for (c in 64 until 128) if (test(c)) high = high or (1L shl (c - 64))
1480
+ return CharClass(low, high, rest)
1481
+ }
1482
+ }
1483
+ }
1484
+
1485
+ /** Where the character read forward at `x` (before the end) ends: past a surrogate pair in unicode mode. */
1486
+ @Suppress("NOTHING_TO_INLINE")
1487
+ private inline fun endAfter(s: String, x: Int, unicode: Boolean): Int =
1488
+ if (unicode && Character.isHighSurrogate(s[x]) && x + 1 < s.length && Character.isLowSurrogate(s[x + 1])) x + 2 else x + 1
1489
+
1490
+ /** Where the character read backward from `x` (after the start) starts. */
1491
+ @Suppress("NOTHING_TO_INLINE")
1492
+ private inline fun startBefore(s: String, x: Int, unicode: Boolean): Int =
1493
+ if (unicode && Character.isLowSurrogate(s[x - 1]) && x >= 2 && Character.isHighSurrogate(s[x - 2])) x - 2 else x - 1
1494
+
1495
+ /**
1496
+ * Whether `x` falls between the halves of a surrogate pair. As V8 reads `u`-mode patterns, a character read there
1497
+ * fails (it desugars a lone surrogate to one not paired), so only what reads no character matches at such a position.
1498
+ */
1499
+ @Suppress("NOTHING_TO_INLINE")
1500
+ private inline fun splitsPair(s: String, x: Int): Boolean = x > 0 && x < s.length && Character.isLowSurrogate(s[x]) && Character.isHighSurrogate(s[x - 1])
1501
+
1502
+ /** The character from `a` to `b`: one code unit or a surrogate pair. */
1503
+ @Suppress("NOTHING_TO_INLINE")
1504
+ private inline fun pointIn(s: String, a: Int, b: Int): Int = if (b - a == 2) Character.toCodePoint(s[a], s[a + 1]) else s[a].code
1505
+
1506
+ @Suppress("NOTHING_TO_INLINE")
1507
+ private inline fun isWordAt(s: String, i: Int, extras: Boolean): Boolean {
1508
+ if (i < 0 || i >= s.length) return false
1509
+ val c = s[i].code
1510
+ return isBasicWordChar(c) || (extras && (c == 0x17F || c == 0x212A))
1511
+ }
1512
+
1513
+ /** A compiled pattern: immutable, so expressions with the same source and flags share it, across threads too. */
1514
+ private class RegexProgram(root: RNode, val groupCount: Int, val groupNames: List<Pair<String, Int>>, val unicode: Boolean) {
1515
+ val code: IntArray
1516
+ val classes: Array<CharClass>
1517
+ val literals: Array<String>
1518
+ val references: Array<IntArray>
1519
+ /** Per REPEAT instruction, the code unit what follows it reads first (see RegexCompiler.followers). */
1520
+ val followers: IntArray
1521
+ /** Captures (start and end per group), then where each open group started, then two registers per loop. */
1522
+ val slotCount: Int
1523
+
1524
+ /** Text every match starts with, else "". */
1525
+ private val prefix: String
1526
+ /** What the first character of every match satisfies, when the pattern cannot match empty. */
1527
+ private val first: CharClass?
1528
+
1529
+ /** Outside unicode mode, what each of the first code units of every match satisfies, when more than one is known. */
1530
+ private val lead: Array<CharClass>?
1531
+
1532
+ /**
1533
+ * The class of an unbounded greedy run every match starts with (`\w+@…`), where no backreference reads where a
1534
+ * match started. An attempt from inside the run of a failed one explores a subset of its continuations, so the
1535
+ * search goes on where that run ends.
1536
+ */
1537
+ private val leadingRun: CharClass?
1538
+
1539
+ init {
1540
+ val c = RegexCompiler(groupCount, unicode)
1541
+ c.compile(root, true)
1542
+ c.emit(Op.SUCCEED)
1543
+ code = c.code.copyOf(c.size)
1544
+ classes = c.classes.toTypedArray()
1545
+ literals = c.literals.toTypedArray()
1546
+ references = c.references.toTypedArray()
1547
+ followers = c.followers()
1548
+ slotCount = c.slotCount
1549
+ prefix = prefixOf(root)
1550
+ first = if (prefix.isEmpty()) c.firstOf(root) else null
1551
+ lead = if (prefix.isEmpty() && !unicode) c.leadOf(root).first.takeIf { it.size > 1 }?.toTypedArray() else null
1552
+ leadingRun = if (c.references.isEmpty()) leadingRunOf(root)?.let { c.firstOf(it.body) } else null
1553
+ }
1554
+
1555
+ private fun leadingRunOf(n: RNode): RRepeat? = when (n) {
1556
+ is RRepeat -> n.takeIf { (it.body is RChar || it.body is RClass) && it.groupCount == 0 && it.greedy && it.min >= 1 && it.max == INFINITE }
1557
+ is RGroup -> leadingRunOf(n.body)
1558
+ is RSeq -> n.items.firstOrNull()?.let { leadingRunOf(it) }
1559
+ else -> null
1560
+ }
1561
+
1562
+ /** Where to try after a failed attempt at `start`. */
1563
+ fun nextStart(s: String, start: Int): Int {
1564
+ val run = leadingRun ?: return start + 1
1565
+ var x = start
1566
+ while (x < s.length && !(unicode && splitsPair(s, x))) {
1567
+ val e = endAfter(s, x, unicode)
1568
+ if (!run.has(pointIn(s, x, e))) break
1569
+ x = e
1570
+ }
1571
+ return if (x > start) x else start + 1
1572
+ }
1573
+
1574
+ private fun literal(n: RNode): Char? =
1575
+ if (n is RChar && !n.ignoreCase && n.cp <= 0xFFFF && !Character.isSurrogate(n.cp.toChar())) n.cp.toChar() else null
1576
+
1577
+ private fun prefixOf(n: RNode): String = when (n) {
1578
+ is RChar -> literal(n)?.toString() ?: ""
1579
+ is RGroup -> prefixOf(n.body)
1580
+ is RRepeat -> if (n.min > 0) prefixOf(n.body) else ""
1581
+ is RSeq -> {
1582
+ val out = StringBuilder()
1583
+ for (item in n.items) {
1584
+ val c = literal(item)
1585
+ if (c != null) out.append(c) else {
1586
+ if (out.isEmpty()) out.append(prefixOf(item))
1587
+ break
1588
+ }
1589
+ }
1590
+ out.toString()
1591
+ }
1592
+ else -> ""
1593
+ }
1594
+
1595
+ /** The first position at or after `from` where a match may start, among those the search visits; -1 when none. */
1596
+ fun candidate(s: String, from: Int): Int {
1597
+ if (prefix.length == 1) return s.indexOf(prefix[0], from)
1598
+ if (prefix.isNotEmpty()) return s.indexOf(prefix, from)
1599
+ val lead = lead
1600
+ if (lead != null) {
1601
+ val f = lead[0]
1602
+ var x = from
1603
+ while (x < s.length) {
1604
+ if (f.has(s[x].code)) {
1605
+ var j = 1
1606
+ while (j < lead.size && x + j < s.length && lead[j].has(s[x + j].code)) j++
1607
+ if (j == lead.size) return x
1608
+ // No later position leaves room for the lead either.
1609
+ if (x + j >= s.length) return -1
1610
+ }
1611
+ x++
1612
+ }
1613
+ return -1
1614
+ }
1615
+ val f = first ?: return from
1616
+ var x = from
1617
+ if (!unicode) {
1618
+ while (x < s.length) {
1619
+ if (f.has(s[x].code)) return x
1620
+ x++
1621
+ }
1622
+ return -1
1623
+ }
1624
+ while (x < s.length) {
1625
+ val e = endAfter(s, x, true)
1626
+ if (f.has(pointIn(s, x, e))) return x
1627
+ x = e
1628
+ }
1629
+ return -1
1630
+ }
1631
+
1632
+ /** The capture slots of the first match at or after `from` (exactly there when `sticky`), or null. */
1633
+ fun search(s: String, from: Int, sticky: Boolean): IntArray? = regexMachines.get()!!.search(this, s, from, sticky)
1634
+ }
1635
+
1636
+ private val regexMachines = object : ThreadLocal<RegexVM>() {
1637
+ override fun initialValue() = RegexVM()
1638
+ }
1639
+
1640
+ private class RegexCompiler(groupCount: Int, val unicode: Boolean) {
1641
+ var code = IntArray(64)
1642
+ var size = 0
1643
+ val classes = ArrayList<CharClass>()
1644
+ val literals = ArrayList<String>()
1645
+ val references = ArrayList<IntArray>()
1646
+ private val groupStarts = 2 * (groupCount + 1)
1647
+ var slotCount = 3 * (groupCount + 1)
1648
+
1649
+ fun emit(vararg words: Int): Int {
1650
+ val at = size
1651
+ if (size + words.size > code.size) code = code.copyOf(maxOf(code.size * 2, size + words.size))
1652
+ for (w in words) code[size++] = w
1653
+ return at
1654
+ }
1655
+
1656
+ private fun charTest(n: RNode): (Int) -> Boolean = when (n) {
1657
+ is RChar -> {
1658
+ val cp = n.cp
1659
+ if (!n.ignoreCase) { c -> c == cp }
1660
+ else {
1661
+ val canon = CaseFolding.canonicalize(cp, unicode)
1662
+ val u = unicode
1663
+ ({ c -> c == cp || CaseFolding.canonicalize(c, u) == canon })
1664
+ }
1665
+ }
1666
+ is RClass -> {
1667
+ val set = n.set
1668
+ val negated = n.negated
1669
+ if (!n.ignoreCase) { c -> set.contains(c) != negated }
1670
+ else {
1671
+ val u = unicode
1672
+ ({ c -> caseClosedContains(set, c, u) != negated })
1673
+ }
1674
+ }
1675
+ else -> throw IllegalArgumentException()
1676
+ }
1677
+
1678
+ /** `n` (a character or class) as a class, deciding characters past ASCII without `test` where the set allows. */
1679
+ private fun classOf(n: RNode): CharClass {
1680
+ val test = charTest(n)
1681
+ val rest = when {
1682
+ n is RChar && !n.ignoreCase -> if (n.cp < 128) null else test
1683
+ n is RClass && !n.ignoreCase && n.set.predicates.isEmpty() && n.set.ranges.all { it[1] < 128 } -> if (n.negated) ANY_CHARACTER else null
1684
+ else -> test
1685
+ }
1686
+ return CharClass.of(test, rest)
1687
+ }
1688
+
1689
+ private fun classIndex(n: RNode): Int {
1690
+ classes.add(classOf(n))
1691
+ return classes.size - 1
1692
+ }
1693
+
1694
+ /** What the first character of any match of `n` satisfies; null when `n` can match empty or that is not known. */
1695
+ fun firstOf(n: RNode): CharClass? = when (n) {
1696
+ is RChar, is RClass -> classOf(n)
1697
+ is RGroup -> firstOf(n.body)
1698
+ is RRepeat -> if (n.min > 0) firstOf(n.body) else null
1699
+ is RAlt -> n.alternatives.fold<RNode, CharClass?>(null) { acc, a -> val f = firstOf(a) ?: return null; acc?.union(f) ?: f }
1700
+ // Assertions and lookarounds consume nothing: the first character is the next item's.
1701
+ is RSeq -> n.items.firstOrNull { it !is RAssertion && it !is RLook }?.let { firstOf(it) }
1702
+ else -> null
1703
+ }
1704
+
1705
+ /**
1706
+ * For each forward greedy REPEAT, the BMP code unit the instruction after it must read first, else -1: giving
1707
+ * characters back stops only where that unit is, since anywhere else that instruction fails at once (a group's
1708
+ * opening or closing between them only writes what that failure undoes). Where the
1709
+ * repeated class excludes that unit, no character given back can be it, and the value is POSSESSIVE.
1710
+ */
1711
+ fun followers(): IntArray {
1712
+ val out = IntArray(size) { -1 }
1713
+ var pc = 0
1714
+ while (pc < size) {
1715
+ val op = code[pc]
1716
+ if (op == Op.REPEAT && code[pc + 4] != 0 && code[pc + 5] != 0) {
1717
+ var next = pc + 6
1718
+ while (next < size && (code[next] == Op.GROUP_CLOSE || code[next] == Op.GROUP_OPEN)) next += width(code[next])
1719
+ val unit = if (next >= size) -1 else when (code[next]) {
1720
+ Op.CHAR -> if (code[next + 2] != 0 && code[next + 1] <= 0xFFFF && !Character.isSurrogate(code[next + 1].toChar())) code[next + 1] else -1
1721
+ Op.LITERAL -> literals[code[next + 1]][0].code
1722
+ else -> -1
1723
+ }
1724
+ out[pc] = if (unit >= 0 && !classes[code[pc + 1]].has(unit)) POSSESSIVE else unit
1725
+ }
1726
+ pc += width(op)
1727
+ }
1728
+ return out
1729
+ }
1730
+
1731
+ private fun width(op: Int): Int = when (op) {
1732
+ Op.SUCCEED -> 1
1733
+ Op.LITERAL, Op.JUMP, Op.GROUP_OPEN, Op.LOOP_INIT -> 2
1734
+ Op.CHAR, Op.CLASS, Op.SPLIT, Op.GROUP_CLOSE, Op.LOOK -> 3
1735
+ Op.ASSERT, Op.LOOP_BODY, Op.LOOP_TAIL, Op.BACKREF -> 4
1736
+ else -> 6
1737
+ }
1738
+
1739
+ /**
1740
+ * Outside unicode mode, the classes of the first code units of every match of `n` (at most LEAD_LIMIT), and
1741
+ * whether they are all of it: then what follows `n` goes on after them.
1742
+ */
1743
+ fun leadOf(n: RNode): Pair<List<CharClass>, Boolean> = when (n) {
1744
+ is RChar, is RClass -> Pair(listOf(classOf(n)), true)
1745
+ is RGroup -> leadOf(n.body)
1746
+ is RAssertion, is RLook -> Pair(emptyList(), true)
1747
+ is RRepeat -> {
1748
+ val body = n.body
1749
+ if ((body is RChar || body is RClass) && n.min > 0) {
1750
+ val cls = classOf(body)
1751
+ Pair(List(minOf(n.min, LEAD_LIMIT)) { cls }, n.min == n.max && n.min <= LEAD_LIMIT)
1752
+ } else if (n.min > 0) Pair(leadOf(body).first, false) else Pair(emptyList(), false)
1753
+ }
1754
+ is RSeq -> {
1755
+ val out = ArrayList<CharClass>()
1756
+ var whole = true
1757
+ for (item in n.items) {
1758
+ val (classes, complete) = leadOf(item)
1759
+ out.addAll(classes)
1760
+ if (!complete || out.size >= LEAD_LIMIT) {
1761
+ whole = complete
1762
+ break
1763
+ }
1764
+ }
1765
+ Pair(out.take(LEAD_LIMIT), whole && out.size <= LEAD_LIMIT)
1766
+ }
1767
+ else -> Pair(emptyList(), false)
1768
+ }
1769
+
1770
+ private fun isLiteral(n: RNode) = n is RChar && !n.ignoreCase && n.cp <= 0xFFFF && !Character.isSurrogate(n.cp.toChar())
1771
+
1772
+ fun compile(n: RNode, forward: Boolean) {
1773
+ val f = if (forward) 1 else 0
1774
+ when (n) {
1775
+ is RChar -> if (n.ignoreCase) emit(Op.CLASS, classIndex(n), f) else emit(Op.CHAR, n.cp, f)
1776
+ is RClass -> emit(Op.CLASS, classIndex(n), f)
1777
+ is RSeq -> {
1778
+ if (!forward) {
1779
+ for (item in n.items.asReversed()) compile(item, false)
1780
+ return
1781
+ }
1782
+ var i = 0
1783
+ while (i < n.items.size) {
1784
+ var j = i
1785
+ while (j < n.items.size && isLiteral(n.items[j])) j++
1786
+ if (j - i >= 2) {
1787
+ val text = StringBuilder(j - i)
1788
+ for (k in i until j) text.append((n.items[k] as RChar).cp.toChar())
1789
+ literals.add(text.toString())
1790
+ emit(Op.LITERAL, literals.size - 1)
1791
+ i = j
1792
+ } else {
1793
+ compile(n.items[i], true)
1794
+ i++
1795
+ }
1796
+ }
1797
+ }
1798
+ is RAlt -> {
1799
+ val ends = ArrayList<Int>()
1800
+ for (k in 0 until n.alternatives.size - 1) {
1801
+ val split = emit(Op.SPLIT, 0, 0)
1802
+ code[split + 1] = size
1803
+ compile(n.alternatives[k], forward)
1804
+ ends.add(emit(Op.JUMP, 0))
1805
+ code[split + 2] = size
1806
+ }
1807
+ compile(n.alternatives.last(), forward)
1808
+ for (e in ends) code[e + 1] = size
1809
+ }
1810
+ is RAssertion -> {
1811
+ val kind = when (n.kind) { '^' -> ASSERT_START; '$' -> ASSERT_END; 'b' -> ASSERT_BOUNDARY; else -> ASSERT_NOT_BOUNDARY }
1812
+ emit(Op.ASSERT, kind, if (n.multiline) 1 else 0, if (n.wordExtras) 1 else 0)
1813
+ }
1814
+ is RGroup -> {
1815
+ emit(Op.GROUP_OPEN, groupStarts + n.index)
1816
+ compile(n.body, forward)
1817
+ emit(Op.GROUP_CLOSE, n.index, f)
1818
+ }
1819
+ is RLook -> {
1820
+ val look = emit(Op.LOOK, if (n.negative) 1 else 0, 0)
1821
+ compile(n.body, n.ahead)
1822
+ emit(Op.SUCCEED)
1823
+ code[look + 2] = size
1824
+ }
1825
+ is RBackReference -> {
1826
+ references.add(n.groups)
1827
+ emit(Op.BACKREF, references.size - 1, if (n.ignoreCase) 1 else 0, f)
1828
+ }
1829
+ is RRepeat -> {
1830
+ if (n.max == 0) return
1831
+ val body = n.body
1832
+ if ((body is RChar || body is RClass) && n.groupCount == 0) {
1833
+ emit(Op.REPEAT, classIndex(body), n.min, n.max, if (n.greedy) 1 else 0, f)
1834
+ return
1835
+ }
1836
+ val register = slotCount
1837
+ slotCount += 2
1838
+ emit(Op.LOOP_INIT, register)
1839
+ val head = emit(Op.LOOP_HEAD, register, n.min, n.max, if (n.greedy) 1 else 0, 0)
1840
+ emit(Op.LOOP_BODY, register, 2 * (n.firstGroup + 1), 2 * (n.firstGroup + n.groupCount + 1))
1841
+ compile(body, forward)
1842
+ emit(Op.LOOP_TAIL, register, head, n.min)
1843
+ code[head + 5] = size
1844
+ }
1845
+ }
1846
+ }
1847
+ }
1848
+
1849
+ /** The VM's state, one per thread: it runs no script, so a match never re-enters it from outside. */
1850
+ private class RegexVM {
1851
+ private var slots = IntArray(16)
1852
+ private var stack = IntArray(INITIAL_STACK)
1853
+ private var top = 0
1854
+ private var kept = IntArray(32)
1855
+ private var program: RegexProgram? = null
1856
+ private var input = ""
1857
+
1858
+ fun search(p: RegexProgram, s: String, from: Int, sticky: Boolean): IntArray? {
1859
+ if (slots.size < p.slotCount) slots = IntArray(p.slotCount)
1860
+ java.util.Arrays.fill(slots, 0, p.slotCount, -1)
1861
+ program = p
1862
+ input = s
1863
+ top = 0
1864
+ try {
1865
+ var start = from
1866
+ while (start <= s.length) {
1867
+ if (!sticky) {
1868
+ start = p.candidate(s, start)
1869
+ if (start < 0) return null
1870
+ }
1871
+ // A failed attempt unwinds every write it made, so the slots are all unset again for the next.
1872
+ val end = run(0, start, 0)
1873
+ if (end >= 0) {
1874
+ val captures = slots.copyOf(2 * (p.groupCount + 1))
1875
+ captures[0] = start
1876
+ captures[1] = end
1877
+ return captures
1878
+ }
1879
+ if (sticky) return null
1880
+ // Past a leading run, else one code unit on: in `u` mode too, as V8 tries the positions inside a pair (see splitsPair).
1881
+ start = p.nextStart(s, start)
1882
+ }
1883
+ return null
1884
+ } finally {
1885
+ if (stack.size > RETAINED_STACK) stack = IntArray(INITIAL_STACK)
1886
+ program = null
1887
+ input = ""
1888
+ }
1889
+ }
1890
+
1891
+ private fun grow(needed: Int) {
1892
+ if (needed > MAX_STACK) throw JSException(JSRangeError("Maximum call stack size exceeded"))
1893
+ var size = stack.size * 2
1894
+ while (size < needed) size *= 2
1895
+ stack = stack.copyOf(size)
1896
+ }
1897
+
1898
+ private fun push(a: Int, b: Int, tag: Int) {
1899
+ if (top + 3 > stack.size) grow(top + 3)
1900
+ stack[top] = a
1901
+ stack[top + 1] = b
1902
+ stack[top + 2] = tag
1903
+ top += 3
1904
+ }
1905
+
1906
+ private fun push(a: Int, b: Int, c: Int, tag: Int) {
1907
+ if (top + 4 > stack.size) grow(top + 4)
1908
+ stack[top] = a
1909
+ stack[top + 1] = b
1910
+ stack[top + 2] = c
1911
+ stack[top + 3] = tag
1912
+ top += 4
1913
+ }
1914
+
1915
+ /** Writes a slot, recording the old value for backtracking; a write that changes nothing records nothing. */
1916
+ private fun set(slot: Int, value: Int) {
1917
+ val old = slots[slot]
1918
+ if (old == value) return
1919
+ push(slot, old, T_UNDO)
1920
+ slots[slot] = value
1921
+ }
1922
+
1923
+ private fun entrySize(tag: Int) = if (tag >= T_GREEDY) 4 else 3
1924
+
1925
+ /** Drops the entries above `floor`, undoing their writes. */
1926
+ private fun unwind(floor: Int) {
1927
+ while (top > floor) {
1928
+ val tag = stack[top - 1]
1929
+ if (tag == T_UNDO) slots[stack[top - 3]] = stack[top - 2]
1930
+ top -= entrySize(tag)
1931
+ }
1932
+ }
1933
+
1934
+ /** Drops the choice points above `floor` and keeps the undo records, in order: a lookaround's body is atomic. */
1935
+ private fun keepUndos(floor: Int) {
1936
+ var k = 0
1937
+ var t = top
1938
+ while (t > floor) {
1939
+ val tag = stack[t - 1]
1940
+ if (tag == T_UNDO) {
1941
+ if (k + 2 > kept.size) kept = kept.copyOf(kept.size * 2)
1942
+ kept[k] = stack[t - 3]
1943
+ kept[k + 1] = stack[t - 2]
1944
+ k += 2
1945
+ }
1946
+ t -= entrySize(tag)
1947
+ }
1948
+ top = floor
1949
+ var i = k - 2
1950
+ while (i >= 0) {
1951
+ push(kept[i], kept[i + 1], T_UNDO)
1952
+ i -= 2
1953
+ }
1954
+ }
1955
+
1956
+ /** Runs from `startPc` at `startPos`: the position at SUCCEED, or -1 once backtracking has emptied the stack to `floor`. */
1957
+ private fun run(startPc: Int, startPos: Int, floor: Int): Int {
1958
+ val p = program!!
1959
+ val code = p.code
1960
+ val s = input
1961
+ val n = s.length
1962
+ val unicode = p.unicode
1963
+ var pc = startPc
1964
+ var pos = startPos
1965
+ while (true) {
1966
+ val ok = when (code[pc]) {
1967
+ Op.CHAR -> {
1968
+ val c = code[pc + 1]
1969
+ if (code[pc + 2] != 0) {
1970
+ if (pos < n && s[pos].code == c && (!unicode || c < 0xD800 || c > 0xDFFF)) {
1971
+ pos++
1972
+ pc += 3
1973
+ true
1974
+ } else if (pos < n && unicode && !splitsPair(s, pos)) {
1975
+ val e = endAfter(s, pos, true)
1976
+ if (pointIn(s, pos, e) == c) { pos = e; pc += 3; true } else false
1977
+ } else false
1978
+ } else if (pos > 0 && !(unicode && splitsPair(s, pos))) {
1979
+ val b = startBefore(s, pos, unicode)
1980
+ if (pointIn(s, b, pos) == c) { pos = b; pc += 3; true } else false
1981
+ } else false
1982
+ }
1983
+ Op.CLASS -> {
1984
+ val cls = p.classes[code[pc + 1]]
1985
+ if (unicode && splitsPair(s, pos)) false
1986
+ else if (code[pc + 2] != 0) {
1987
+ if (pos < n) {
1988
+ val e = endAfter(s, pos, unicode)
1989
+ if (cls.has(pointIn(s, pos, e))) { pos = e; pc += 3; true } else false
1990
+ } else false
1991
+ } else if (pos > 0) {
1992
+ val b = startBefore(s, pos, unicode)
1993
+ if (cls.has(pointIn(s, b, pos))) { pos = b; pc += 3; true } else false
1994
+ } else false
1995
+ }
1996
+ Op.LITERAL -> {
1997
+ val text = p.literals[code[pc + 1]]
1998
+ if (s.startsWith(text, pos)) { pos += text.length; pc += 2; true } else false
1999
+ }
2000
+ Op.ASSERT -> {
2001
+ val multiline = code[pc + 2] != 0
2002
+ val holds = when (code[pc + 1]) {
2003
+ ASSERT_START -> pos == 0 || (multiline && isLineTerminator(s[pos - 1].code))
2004
+ ASSERT_END -> pos == n || (multiline && isLineTerminator(s[pos].code))
2005
+ ASSERT_BOUNDARY -> isWordAt(s, pos - 1, code[pc + 3] != 0) != isWordAt(s, pos, code[pc + 3] != 0)
2006
+ else -> isWordAt(s, pos - 1, code[pc + 3] != 0) == isWordAt(s, pos, code[pc + 3] != 0)
2007
+ }
2008
+ if (holds) pc += 4
2009
+ holds
2010
+ }
2011
+ Op.SPLIT -> {
2012
+ push(code[pc + 2], pos, T_CHOICE)
2013
+ pc = code[pc + 1]
2014
+ true
2015
+ }
2016
+ Op.JUMP -> {
2017
+ pc = code[pc + 1]
2018
+ true
2019
+ }
2020
+ Op.GROUP_OPEN -> {
2021
+ set(code[pc + 1], pos)
2022
+ pc += 2
2023
+ true
2024
+ }
2025
+ Op.GROUP_CLOSE -> {
2026
+ val g = code[pc + 1]
2027
+ val opened = slots[2 * (p.groupCount + 1) + g]
2028
+ if (code[pc + 2] != 0) { set(2 * g, opened); set(2 * g + 1, pos) } else { set(2 * g, pos); set(2 * g + 1, opened) }
2029
+ pc += 3
2030
+ true
2031
+ }
2032
+ Op.LOOP_INIT -> {
2033
+ set(code[pc + 1], 0)
2034
+ pc += 2
2035
+ true
2036
+ }
2037
+ Op.LOOP_HEAD -> {
2038
+ // RepeatMatcher with min and max less the iterations done: past max, only the continuation;
2039
+ // past min, the body and the continuation in the quantifier's order.
2040
+ val count = slots[code[pc + 1]]
2041
+ if (count >= code[pc + 3]) pc = code[pc + 5]
2042
+ else if (count >= code[pc + 2]) {
2043
+ if (code[pc + 4] != 0) {
2044
+ push(code[pc + 5], pos, T_CHOICE)
2045
+ pc += 6
2046
+ } else {
2047
+ push(pc + 6, pos, T_CHOICE)
2048
+ pc = code[pc + 5]
2049
+ }
2050
+ } else pc += 6
2051
+ true
2052
+ }
2053
+ Op.LOOP_BODY -> {
2054
+ set(code[pc + 1] + 1, pos)
2055
+ for (slot in code[pc + 2] until code[pc + 3]) set(slot, -1)
2056
+ pc += 4
2057
+ true
2058
+ }
2059
+ Op.LOOP_TAIL -> {
2060
+ val register = code[pc + 1]
2061
+ val count = slots[register]
2062
+ // An iteration past the minimum that matched empty fails.
2063
+ if (count >= code[pc + 3] && pos == slots[register + 1]) false
2064
+ else {
2065
+ set(register, count + 1)
2066
+ pc = code[pc + 2]
2067
+ true
2068
+ }
2069
+ }
2070
+ Op.REPEAT -> {
2071
+ val cls = p.classes[code[pc + 1]]
2072
+ val min = code[pc + 2]
2073
+ val max = code[pc + 3]
2074
+ val forward = code[pc + 5] != 0
2075
+ if (unicode && splitsPair(s, pos)) {
2076
+ if (min > 0) false else { pc += 6; true }
2077
+ } else if (code[pc + 4] != 0) {
2078
+ var at = pos
2079
+ var count = 0
2080
+ var least = if (min == 0) pos else -1
2081
+ while (count < max) {
2082
+ val next = if (forward) {
2083
+ if (at >= n) break
2084
+ val e = endAfter(s, at, unicode)
2085
+ if (!cls.has(pointIn(s, at, e))) break
2086
+ e
2087
+ } else {
2088
+ if (at <= 0) break
2089
+ val b = startBefore(s, at, unicode)
2090
+ if (!cls.has(pointIn(s, b, at))) break
2091
+ b
2092
+ }
2093
+ at = next
2094
+ count++
2095
+ if (count == min) least = at
2096
+ }
2097
+ if (count < min) false
2098
+ else {
2099
+ if (count > min && p.followers[pc] != POSSESSIVE) push(pc, least, at, T_GREEDY)
2100
+ pos = at
2101
+ pc += 6
2102
+ true
2103
+ }
2104
+ } else {
2105
+ var at = pos
2106
+ var count = 0
2107
+ while (count < min) {
2108
+ at = step(cls, s, at, forward, unicode)
2109
+ if (at < 0) break
2110
+ count++
2111
+ }
2112
+ if (at < 0) false
2113
+ else {
2114
+ if (max > min) push(pc, at, min, T_LAZY)
2115
+ pos = at
2116
+ pc += 6
2117
+ true
2118
+ }
2119
+ }
2120
+ }
2121
+ Op.BACKREF -> {
2122
+ val next = backReference(p.references[code[pc + 1]], code[pc + 2] != 0, code[pc + 3] != 0, s, pos, unicode)
2123
+ if (next >= 0) { pos = next; pc += 4; true } else false
2124
+ }
2125
+ Op.LOOK -> {
2126
+ val mark = top
2127
+ val found = run(pc + 3, pos, mark) >= 0
2128
+ if (code[pc + 1] != 0) {
2129
+ if (found) { unwind(mark); false } else { pc = code[pc + 2]; true }
2130
+ } else if (found) {
2131
+ keepUndos(mark)
2132
+ pc = code[pc + 2]
2133
+ true
2134
+ } else false
2135
+ }
2136
+ else -> return pos
2137
+ }
2138
+ if (ok) continue
2139
+ backtrack@ while (true) {
2140
+ if (top <= floor) return -1
2141
+ when (stack[top - 1]) {
2142
+ T_CHOICE -> {
2143
+ pc = stack[top - 3]
2144
+ pos = stack[top - 2]
2145
+ top -= 3
2146
+ break@backtrack
2147
+ }
2148
+ T_UNDO -> {
2149
+ slots[stack[top - 3]] = stack[top - 2]
2150
+ top -= 3
2151
+ }
2152
+ T_GREEDY -> {
2153
+ val op = stack[top - 4]
2154
+ val least = stack[top - 3]
2155
+ val at = stack[top - 2]
2156
+ // One character back, as the run read it: a pair straddling where it started is not one.
2157
+ val follower = p.followers[op]
2158
+ val next = if (follower >= 0) {
2159
+ val unit = follower.toChar()
2160
+ var found = at - 1
2161
+ while (found >= least && s[found] != unit) found--
2162
+ if (found < least) {
2163
+ top -= 4
2164
+ continue@backtrack
2165
+ }
2166
+ found
2167
+ } else if (code[op + 5] != 0) {
2168
+ if (unicode && at - 2 >= least && Character.isLowSurrogate(s[at - 1]) && Character.isHighSurrogate(s[at - 2])) at - 2 else at - 1
2169
+ } else {
2170
+ if (unicode && at + 2 <= least && Character.isHighSurrogate(s[at]) && Character.isLowSurrogate(s[at + 1])) at + 2 else at + 1
2171
+ }
2172
+ if (next == least) top -= 4 else stack[top - 2] = next
2173
+ pc = op + 6
2174
+ pos = next
2175
+ break@backtrack
2176
+ }
2177
+ else -> {
2178
+ val op = stack[top - 4]
2179
+ val count = stack[top - 2]
2180
+ val next = step(p.classes[code[op + 1]], s, stack[top - 3], code[op + 5] != 0, unicode)
2181
+ if (next < 0) {
2182
+ top -= 4
2183
+ continue@backtrack
2184
+ }
2185
+ if (count + 1 >= code[op + 3]) top -= 4 else {
2186
+ stack[top - 3] = next
2187
+ stack[top - 2] = count + 1
2188
+ }
2189
+ pc = op + 6
2190
+ pos = next
2191
+ break@backtrack
2192
+ }
2193
+ }
2194
+ }
2195
+ }
2196
+ }
2197
+
2198
+ /** One character of `cls` at `x`, read forward or backward: where it ends, or -1. */
2199
+ private fun step(cls: CharClass, s: String, x: Int, forward: Boolean, unicode: Boolean): Int {
2200
+ if (unicode && splitsPair(s, x)) return -1
2201
+ if (forward) {
2202
+ if (x >= s.length) return -1
2203
+ val e = endAfter(s, x, unicode)
2204
+ return if (cls.has(pointIn(s, x, e))) e else -1
2205
+ }
2206
+ if (x <= 0) return -1
2207
+ val b = startBefore(s, x, unicode)
2208
+ return if (cls.has(pointIn(s, b, x))) b else -1
2209
+ }
2210
+
2211
+ /** The text the first of `groups` that took part captured, matched at `x`: where it ends, or -1; an unset group matches empty. */
2212
+ private fun backReference(groups: IntArray, ignoreCase: Boolean, forward: Boolean, s: String, x: Int, unicode: Boolean): Int {
2213
+ var start = -1
2214
+ var end = -1
2215
+ for (g in groups) if (slots[2 * g] >= 0) { start = slots[2 * g]; end = slots[2 * g + 1]; break }
2216
+ if (start < 0) return x
2217
+ val length = end - start
2218
+ val from = if (forward) x else x - length
2219
+ if (from < 0 || from + length > s.length) return -1
2220
+ if (!ignoreCase) {
2221
+ if (!s.regionMatches(start, s, from, length)) return -1
2222
+ } else {
2223
+ var i = 0
2224
+ while (i < length) {
2225
+ val a = if (unicode) s.codePointAt(start + i) else s[start + i].code
2226
+ val b = if (unicode) s.codePointAt(from + i) else s[from + i].code
2227
+ if (CaseFolding.canonicalize(a, unicode) != CaseFolding.canonicalize(b, unicode)) return -1
2228
+ if (Character.charCount(a) != Character.charCount(b)) return -1
2229
+ i += Character.charCount(a)
2230
+ }
2231
+ }
2232
+ return if (forward) x + length else from
2233
+ }
2234
+
2235
+ private companion object {
2236
+ const val INITIAL_STACK = 256
2237
+ /** A stack grown past this by one long match is let go after it rather than kept for the thread. */
2238
+ const val RETAINED_STACK = 1 shl 16
2239
+ /**
2240
+ * The most entries a match may hold: one that needs more is a RangeError, as in V8, whose backtrack stack
2241
+ * stops at 64 MB. Kept equal to kit-apple's, so a pattern overflows at the same depth on both.
2242
+ */
2243
+ const val MAX_STACK = 1 shl 24
2244
+ }
2245
+ }