@ibgib/core-gib 0.0.4

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 (330) hide show
  1. package/.vscode/core-gib-snippets.code-snippets +189 -0
  2. package/.vscode/launch.json +24 -0
  3. package/.vscode/settings.json +56 -0
  4. package/.vscode/tasks.json +37 -0
  5. package/CHANGELOG.md +11 -0
  6. package/README.md +215 -0
  7. package/dist/common/aws-constants.d.mts +7 -0
  8. package/dist/common/aws-constants.d.mts.map +1 -0
  9. package/dist/common/aws-constants.mjs +7 -0
  10. package/dist/common/aws-constants.mjs.map +1 -0
  11. package/dist/common/bin/bin-types.d.mts +17 -0
  12. package/dist/common/bin/bin-types.d.mts.map +1 -0
  13. package/dist/common/bin/bin-types.mjs +3 -0
  14. package/dist/common/bin/bin-types.mjs.map +1 -0
  15. package/dist/common/cache/cache-types.d.mts +57 -0
  16. package/dist/common/cache/cache-types.d.mts.map +1 -0
  17. package/dist/common/cache/cache-types.mjs +2 -0
  18. package/dist/common/cache/cache-types.mjs.map +1 -0
  19. package/dist/common/comment/comment-constants.d.mts +11 -0
  20. package/dist/common/comment/comment-constants.d.mts.map +1 -0
  21. package/dist/common/comment/comment-constants.mjs +11 -0
  22. package/dist/common/comment/comment-constants.mjs.map +1 -0
  23. package/dist/common/comment/comment-helper.d.mts +59 -0
  24. package/dist/common/comment/comment-helper.d.mts.map +1 -0
  25. package/dist/common/comment/comment-helper.mjs +173 -0
  26. package/dist/common/comment/comment-helper.mjs.map +1 -0
  27. package/dist/common/comment/comment-types.d.mts +16 -0
  28. package/dist/common/comment/comment-types.d.mts.map +1 -0
  29. package/dist/common/comment/comment-types.mjs +2 -0
  30. package/dist/common/comment/comment-types.mjs.map +1 -0
  31. package/dist/common/display/display-helper.d.mts +19 -0
  32. package/dist/common/display/display-helper.d.mts.map +1 -0
  33. package/dist/common/display/display-helper.mjs +68 -0
  34. package/dist/common/display/display-helper.mjs.map +1 -0
  35. package/dist/common/display/display-types.d.mts +97 -0
  36. package/dist/common/display/display-types.d.mts.map +1 -0
  37. package/dist/common/display/display-types.mjs +37 -0
  38. package/dist/common/display/display-types.mjs.map +1 -0
  39. package/dist/common/encrypt/encrypt-constants.d.mts +27 -0
  40. package/dist/common/encrypt/encrypt-constants.d.mts.map +1 -0
  41. package/dist/common/encrypt/encrypt-constants.mjs +27 -0
  42. package/dist/common/encrypt/encrypt-constants.mjs.map +1 -0
  43. package/dist/common/encrypt/encrypt-types.d.mts +116 -0
  44. package/dist/common/encrypt/encrypt-types.d.mts.map +1 -0
  45. package/dist/common/encrypt/encrypt-types.mjs +9 -0
  46. package/dist/common/encrypt/encrypt-types.mjs.map +1 -0
  47. package/dist/common/error/error-constants.d.mts +9 -0
  48. package/dist/common/error/error-constants.d.mts.map +1 -0
  49. package/dist/common/error/error-constants.mjs +9 -0
  50. package/dist/common/error/error-constants.mjs.map +1 -0
  51. package/dist/common/error/error-helper.d.mts +43 -0
  52. package/dist/common/error/error-helper.d.mts.map +1 -0
  53. package/dist/common/error/error-helper.mjs +167 -0
  54. package/dist/common/error/error-helper.mjs.map +1 -0
  55. package/dist/common/error/error-types.d.mts +58 -0
  56. package/dist/common/error/error-types.d.mts.map +1 -0
  57. package/dist/common/error/error-types.mjs +2 -0
  58. package/dist/common/error/error-types.mjs.map +1 -0
  59. package/dist/common/form/form-helper.d.mts +97 -0
  60. package/dist/common/form/form-helper.d.mts.map +1 -0
  61. package/dist/common/form/form-helper.mjs +185 -0
  62. package/dist/common/form/form-helper.mjs.map +1 -0
  63. package/dist/common/form/form-items.d.mts +229 -0
  64. package/dist/common/form/form-items.d.mts.map +1 -0
  65. package/dist/common/form/form-items.mjs +63 -0
  66. package/dist/common/form/form-items.mjs.map +1 -0
  67. package/dist/common/import-export/import-export-types.d.mts +18 -0
  68. package/dist/common/import-export/import-export-types.d.mts.map +1 -0
  69. package/dist/common/import-export/import-export-types.mjs +2 -0
  70. package/dist/common/import-export/import-export-types.mjs.map +1 -0
  71. package/dist/common/legacy/legacy-types.d.mts +2 -0
  72. package/dist/common/legacy/legacy-types.d.mts.map +1 -0
  73. package/dist/common/legacy/legacy-types.mjs +2 -0
  74. package/dist/common/legacy/legacy-types.mjs.map +1 -0
  75. package/dist/common/link/link-constants.d.mts +2 -0
  76. package/dist/common/link/link-constants.d.mts.map +1 -0
  77. package/dist/common/link/link-constants.mjs +2 -0
  78. package/dist/common/link/link-constants.mjs.map +1 -0
  79. package/dist/common/link/link-helper.d.mts +37 -0
  80. package/dist/common/link/link-helper.d.mts.map +1 -0
  81. package/dist/common/link/link-helper.mjs +143 -0
  82. package/dist/common/link/link-helper.mjs.map +1 -0
  83. package/dist/common/link/link-types.d.mts +14 -0
  84. package/dist/common/link/link-types.d.mts.map +1 -0
  85. package/dist/common/link/link-types.mjs +2 -0
  86. package/dist/common/link/link-types.mjs.map +1 -0
  87. package/dist/common/other/graph-helper.d.mts +166 -0
  88. package/dist/common/other/graph-helper.d.mts.map +1 -0
  89. package/dist/common/other/graph-helper.mjs +710 -0
  90. package/dist/common/other/graph-helper.mjs.map +1 -0
  91. package/dist/common/other/ibgib-helper.d.mts +245 -0
  92. package/dist/common/other/ibgib-helper.d.mts.map +1 -0
  93. package/dist/common/other/ibgib-helper.mjs +641 -0
  94. package/dist/common/other/ibgib-helper.mjs.map +1 -0
  95. package/dist/common/other/other-constants.d.mts +53 -0
  96. package/dist/common/other/other-constants.d.mts.map +1 -0
  97. package/dist/common/other/other-constants.mjs +67 -0
  98. package/dist/common/other/other-constants.mjs.map +1 -0
  99. package/dist/common/other/other-types.d.mts +166 -0
  100. package/dist/common/other/other-types.d.mts.map +1 -0
  101. package/dist/common/other/other-types.mjs +30 -0
  102. package/dist/common/other/other-types.mjs.map +1 -0
  103. package/dist/common/other/svg-constants.d.mts +2 -0
  104. package/dist/common/other/svg-constants.d.mts.map +1 -0
  105. package/dist/common/other/svg-constants.mjs +2 -0
  106. package/dist/common/other/svg-constants.mjs.map +1 -0
  107. package/dist/common/other/svg-helper.d.mts +54 -0
  108. package/dist/common/other/svg-helper.d.mts.map +1 -0
  109. package/dist/common/other/svg-helper.mjs +170 -0
  110. package/dist/common/other/svg-helper.mjs.map +1 -0
  111. package/dist/common/pic/pic-constants.d.mts +13 -0
  112. package/dist/common/pic/pic-constants.d.mts.map +1 -0
  113. package/dist/common/pic/pic-constants.mjs +13 -0
  114. package/dist/common/pic/pic-constants.mjs.map +1 -0
  115. package/dist/common/pic/pic-helper.d.mts +70 -0
  116. package/dist/common/pic/pic-helper.d.mts.map +1 -0
  117. package/dist/common/pic/pic-helper.mjs +235 -0
  118. package/dist/common/pic/pic-helper.mjs.map +1 -0
  119. package/dist/common/pic/pic-types.d.mts +23 -0
  120. package/dist/common/pic/pic-types.d.mts.map +1 -0
  121. package/dist/common/pic/pic-types.mjs +2 -0
  122. package/dist/common/pic/pic-types.mjs.map +1 -0
  123. package/dist/common/root/root-constants.d.mts +40 -0
  124. package/dist/common/root/root-constants.d.mts.map +1 -0
  125. package/dist/common/root/root-constants.mjs +40 -0
  126. package/dist/common/root/root-constants.mjs.map +1 -0
  127. package/dist/common/root/root-types.d.mts +9 -0
  128. package/dist/common/root/root-types.d.mts.map +1 -0
  129. package/dist/common/root/root-types.mjs +2 -0
  130. package/dist/common/root/root-types.mjs.map +1 -0
  131. package/dist/common/tag/tag-constants.d.mts +21 -0
  132. package/dist/common/tag/tag-constants.d.mts.map +1 -0
  133. package/dist/common/tag/tag-constants.mjs +28 -0
  134. package/dist/common/tag/tag-constants.mjs.map +1 -0
  135. package/dist/common/tag/tag-types.d.mts +14 -0
  136. package/dist/common/tag/tag-types.d.mts.map +1 -0
  137. package/dist/common/tag/tag-types.mjs +2 -0
  138. package/dist/common/tag/tag-types.mjs.map +1 -0
  139. package/dist/core-constants.d.mts +89 -0
  140. package/dist/core-constants.d.mts.map +1 -0
  141. package/dist/core-constants.mjs +484 -0
  142. package/dist/core-constants.mjs.map +1 -0
  143. package/dist/core-helper.d.mts +6 -0
  144. package/dist/core-helper.d.mts.map +1 -0
  145. package/dist/core-helper.mjs +28 -0
  146. package/dist/core-helper.mjs.map +1 -0
  147. package/dist/core-types.d.mts +520 -0
  148. package/dist/core-types.d.mts.map +1 -0
  149. package/dist/core-types.mjs +2 -0
  150. package/dist/core-types.mjs.map +1 -0
  151. package/dist/index.d.mts +2 -0
  152. package/dist/index.d.mts.map +1 -0
  153. package/dist/index.mjs +3 -0
  154. package/dist/index.mjs.map +1 -0
  155. package/dist/witness/app/app-base-v1.d.mts +130 -0
  156. package/dist/witness/app/app-base-v1.d.mts.map +1 -0
  157. package/dist/witness/app/app-base-v1.mjs +462 -0
  158. package/dist/witness/app/app-base-v1.mjs.map +1 -0
  159. package/dist/witness/app/app-constants.d.mts +10 -0
  160. package/dist/witness/app/app-constants.d.mts.map +1 -0
  161. package/dist/witness/app/app-constants.mjs +13 -0
  162. package/dist/witness/app/app-constants.mjs.map +1 -0
  163. package/dist/witness/app/app-helper.d.mts +85 -0
  164. package/dist/witness/app/app-helper.d.mts.map +1 -0
  165. package/dist/witness/app/app-helper.mjs +258 -0
  166. package/dist/witness/app/app-helper.mjs.map +1 -0
  167. package/dist/witness/app/app-types.d.mts +211 -0
  168. package/dist/witness/app/app-types.d.mts.map +1 -0
  169. package/dist/witness/app/app-types.mjs +49 -0
  170. package/dist/witness/app/app-types.mjs.map +1 -0
  171. package/dist/witness/app/chat-app/chat-app-types.d.mts +18 -0
  172. package/dist/witness/app/chat-app/chat-app-types.d.mts.map +1 -0
  173. package/dist/witness/app/chat-app/chat-app-types.mjs +25 -0
  174. package/dist/witness/app/chat-app/chat-app-types.mjs.map +1 -0
  175. package/dist/witness/app/flash-app/flash-app-types.d.mts +16 -0
  176. package/dist/witness/app/flash-app/flash-app-types.d.mts.map +1 -0
  177. package/dist/witness/app/flash-app/flash-app-types.mjs +23 -0
  178. package/dist/witness/app/flash-app/flash-app-types.mjs.map +1 -0
  179. package/dist/witness/app/raw-app/raw-app-types.d.mts +18 -0
  180. package/dist/witness/app/raw-app/raw-app-types.d.mts.map +1 -0
  181. package/dist/witness/app/raw-app/raw-app-types.mjs +25 -0
  182. package/dist/witness/app/raw-app/raw-app-types.mjs.map +1 -0
  183. package/dist/witness/app/todo-app/todo-app-types.d.ts +33 -0
  184. package/dist/witness/app/todo-app/todo-app-types.d.ts.map +1 -0
  185. package/dist/witness/app/todo-app/todo-app-types.js +31 -0
  186. package/dist/witness/app/todo-app/todo-app-types.js.map +1 -0
  187. package/dist/witness/robbot/robbot-base-v1.d.ts +432 -0
  188. package/dist/witness/robbot/robbot-base-v1.d.ts.map +1 -0
  189. package/dist/witness/robbot/robbot-base-v1.js +1407 -0
  190. package/dist/witness/robbot/robbot-base-v1.js.map +1 -0
  191. package/dist/witness/robbot/robbot-constants.d.mts +24 -0
  192. package/dist/witness/robbot/robbot-constants.d.mts.map +1 -0
  193. package/dist/witness/robbot/robbot-constants.mjs +24 -0
  194. package/dist/witness/robbot/robbot-constants.mjs.map +1 -0
  195. package/dist/witness/robbot/robbot-helper.d.mts +152 -0
  196. package/dist/witness/robbot/robbot-helper.d.mts.map +1 -0
  197. package/dist/witness/robbot/robbot-helper.mjs +609 -0
  198. package/dist/witness/robbot/robbot-helper.mjs.map +1 -0
  199. package/dist/witness/robbot/robbot-types.d.mts +539 -0
  200. package/dist/witness/robbot/robbot-types.d.mts.map +1 -0
  201. package/dist/witness/robbot/robbot-types.mjs +294 -0
  202. package/dist/witness/robbot/robbot-types.mjs.map +1 -0
  203. package/dist/witness/space/bootstrap/bootstrap-constants.d.mts +14 -0
  204. package/dist/witness/space/bootstrap/bootstrap-constants.d.mts.map +1 -0
  205. package/dist/witness/space/bootstrap/bootstrap-constants.mjs +15 -0
  206. package/dist/witness/space/bootstrap/bootstrap-constants.mjs.map +1 -0
  207. package/dist/witness/space/inner-space-v1.d.ts +63 -0
  208. package/dist/witness/space/inner-space-v1.d.ts.map +1 -0
  209. package/dist/witness/space/inner-space-v1.js +356 -0
  210. package/dist/witness/space/inner-space-v1.js.map +1 -0
  211. package/dist/witness/space/outer-space/outer-space-constants.d.mts +2 -0
  212. package/dist/witness/space/outer-space/outer-space-constants.d.mts.map +1 -0
  213. package/dist/witness/space/outer-space/outer-space-constants.mjs +2 -0
  214. package/dist/witness/space/outer-space/outer-space-constants.mjs.map +1 -0
  215. package/dist/witness/space/outer-space/outer-space-helper.d.mts +28 -0
  216. package/dist/witness/space/outer-space/outer-space-helper.d.mts.map +1 -0
  217. package/dist/witness/space/outer-space/outer-space-helper.mjs +87 -0
  218. package/dist/witness/space/outer-space/outer-space-helper.mjs.map +1 -0
  219. package/dist/witness/space/outer-space/outer-space-types.d.mts +548 -0
  220. package/dist/witness/space/outer-space/outer-space-types.d.mts.map +1 -0
  221. package/dist/witness/space/outer-space/outer-space-types.mjs +118 -0
  222. package/dist/witness/space/outer-space/outer-space-types.mjs.map +1 -0
  223. package/dist/witness/space/space-base-v1.d.mts +147 -0
  224. package/dist/witness/space/space-base-v1.d.mts.map +1 -0
  225. package/dist/witness/space/space-base-v1.mjs +350 -0
  226. package/dist/witness/space/space-base-v1.mjs.map +1 -0
  227. package/dist/witness/space/space-constants.d.mts +181 -0
  228. package/dist/witness/space/space-constants.d.mts.map +1 -0
  229. package/dist/witness/space/space-constants.mjs +192 -0
  230. package/dist/witness/space/space-constants.mjs.map +1 -0
  231. package/dist/witness/space/space-helper.d.mts +666 -0
  232. package/dist/witness/space/space-helper.d.mts.map +1 -0
  233. package/dist/witness/space/space-helper.mjs +2830 -0
  234. package/dist/witness/space/space-helper.mjs.map +1 -0
  235. package/dist/witness/space/space-types.d.mts +422 -0
  236. package/dist/witness/space/space-types.d.mts.map +1 -0
  237. package/dist/witness/space/space-types.mjs +52 -0
  238. package/dist/witness/space/space-types.mjs.map +1 -0
  239. package/dist/witness/witness-base-v1.d.ts +144 -0
  240. package/dist/witness/witness-base-v1.d.ts.map +1 -0
  241. package/dist/witness/witness-base-v1.js +300 -0
  242. package/dist/witness/witness-base-v1.js.map +1 -0
  243. package/dist/witness/witness-constants.d.mts +3 -0
  244. package/dist/witness/witness-constants.d.mts.map +1 -0
  245. package/dist/witness/witness-constants.mjs +3 -0
  246. package/dist/witness/witness-constants.mjs.map +1 -0
  247. package/dist/witness/witness-form-builder.d.mts +45 -0
  248. package/dist/witness/witness-form-builder.d.mts.map +1 -0
  249. package/dist/witness/witness-form-builder.mjs +95 -0
  250. package/dist/witness/witness-form-builder.mjs.map +1 -0
  251. package/dist/witness/witness-helper.d.mts +89 -0
  252. package/dist/witness/witness-helper.d.mts.map +1 -0
  253. package/dist/witness/witness-helper.mjs +229 -0
  254. package/dist/witness/witness-helper.mjs.map +1 -0
  255. package/dist/witness/witness-types.d.mts +211 -0
  256. package/dist/witness/witness-types.d.mts.map +1 -0
  257. package/dist/witness/witness-types.mjs +2 -0
  258. package/dist/witness/witness-types.mjs.map +1 -0
  259. package/jasmine-browser.json +18 -0
  260. package/jasmine.json +6 -0
  261. package/package.json +67 -0
  262. package/src/assumptions.spec.mts +45 -0
  263. package/src/common/aws-constants.mts +5 -0
  264. package/src/common/bin/bin-types.mts +17 -0
  265. package/src/common/cache/cache-types.mts +53 -0
  266. package/src/common/comment/comment-constants.mts +10 -0
  267. package/src/common/comment/comment-helper.mts +211 -0
  268. package/src/common/comment/comment-types.mts +19 -0
  269. package/src/common/display/display-helper.mts +88 -0
  270. package/src/common/display/display-types.mts +108 -0
  271. package/src/common/encrypt/encrypt-constants.mts +28 -0
  272. package/src/common/encrypt/encrypt-types.mts +130 -0
  273. package/src/common/error/error-constants.mts +8 -0
  274. package/src/common/error/error-helper.mts +155 -0
  275. package/src/common/error/error-types.mts +62 -0
  276. package/src/common/form/form-helper.mts +253 -0
  277. package/src/common/form/form-items.mts +236 -0
  278. package/src/common/import-export/import-export-types.mts +18 -0
  279. package/src/common/legacy/about-legacy.md +0 -0
  280. package/src/common/legacy/legacy-types.mts +0 -0
  281. package/src/common/link/link-constants.mts +1 -0
  282. package/src/common/link/link-helper.mts +155 -0
  283. package/src/common/link/link-types.mts +16 -0
  284. package/src/common/other/graph-helper.mts +853 -0
  285. package/src/common/other/ibgib-helper.mts +671 -0
  286. package/src/common/other/other-constants.mts +76 -0
  287. package/src/common/other/other-types.mts +186 -0
  288. package/src/common/other/svg-constants.mts +1 -0
  289. package/src/common/other/svg-helper.mts +238 -0
  290. package/src/common/pic/pic-constants.mts +13 -0
  291. package/src/common/pic/pic-helper.mts +295 -0
  292. package/src/common/pic/pic-types.mts +29 -0
  293. package/src/common/root/root-constants.mts +41 -0
  294. package/src/common/root/root-types.mts +8 -0
  295. package/src/common/tag/tag-constants.mts +34 -0
  296. package/src/common/tag/tag-types.mts +19 -0
  297. package/src/core-constants.mts +506 -0
  298. package/src/core-helper.mts +33 -0
  299. package/src/core-types.mts +519 -0
  300. package/src/helper.spec.mts +64 -0
  301. package/src/index.mts +1 -0
  302. package/src/witness/app/app-base-v1.mts +584 -0
  303. package/src/witness/app/app-constants.mts +16 -0
  304. package/src/witness/app/app-helper.mts +322 -0
  305. package/src/witness/app/app-types.mts +252 -0
  306. package/src/witness/app/chat-app/chat-app-types.mts +40 -0
  307. package/src/witness/app/flash-app/flash-app-types.mts +38 -0
  308. package/src/witness/app/raw-app/raw-app-types.mts +40 -0
  309. package/src/witness/app/todo-app/todo-app-types.ts +59 -0
  310. package/src/witness/robbot/robbot-base-v1.ts +1531 -0
  311. package/src/witness/robbot/robbot-constants.mts +25 -0
  312. package/src/witness/robbot/robbot-helper.mts +676 -0
  313. package/src/witness/robbot/robbot-helper.spec.mts +135 -0
  314. package/src/witness/robbot/robbot-types.mts +797 -0
  315. package/src/witness/space/bootstrap/bootstrap-constants.mts +15 -0
  316. package/src/witness/space/inner-space-v1.ts +372 -0
  317. package/src/witness/space/outer-space/outer-space-constants.mts +1 -0
  318. package/src/witness/space/outer-space/outer-space-helper.mts +91 -0
  319. package/src/witness/space/outer-space/outer-space-types.mts +627 -0
  320. package/src/witness/space/space-base-v1.mts +414 -0
  321. package/src/witness/space/space-constants.mts +208 -0
  322. package/src/witness/space/space-helper.mts +3242 -0
  323. package/src/witness/space/space-types.mts +476 -0
  324. package/src/witness/witness-base-v1.ts +325 -0
  325. package/src/witness/witness-constants.mts +2 -0
  326. package/src/witness/witness-form-builder.mts +128 -0
  327. package/src/witness/witness-helper.mts +256 -0
  328. package/src/witness/witness-types.mts +249 -0
  329. package/tsconfig.json +15 -0
  330. package/tsconfig.test.json +10 -0
@@ -0,0 +1,185 @@
1
+ import { getRegExp, UUID_REGEXP } from '@ibgib/helper-gib';
2
+ // import { DynamicForm, FormItemInfo } from '../../ibgib-forms/types/form-items';
3
+ import { GLOBAL_LOG_A_LOT, SAFE_SPECIAL_CHARS } from '../../core-constants.mjs';
4
+ // import { getRegExp } from './utils';
5
+ const logalot = GLOBAL_LOG_A_LOT || false;
6
+ /**
7
+ * Fluent-style builder helper class.
8
+ *
9
+ * I'm making this to share common fields' settings among witness classes.
10
+ *
11
+ * Descend from this class for sharing other commonalities.
12
+ */
13
+ export class DynamicFormBuilder {
14
+ constructor() {
15
+ this.lc = `[${DynamicFormBuilder.name}]`;
16
+ this.items = [];
17
+ this.what = '';
18
+ /**
19
+ * pool of uuids pre-calculated to be passed in to the builder. if this is
20
+ * falsy, then it will use a Math.random() based approach.
21
+ */
22
+ this.idPool = [];
23
+ }
24
+ /**
25
+ * hacky wrapper for this.idPool.pop()
26
+ */
27
+ getNewId() {
28
+ const lc = `${this.lc}[${this.getNewId.name}]`;
29
+ if (this.idPool?.length > 0) {
30
+ return this.idPool.pop() ?? '';
31
+ }
32
+ else {
33
+ // weak implementation...
34
+ let resultArray = [];
35
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
36
+ const charLength = chars.length;
37
+ for (let i = 0; i < 32; i++) {
38
+ let charIndex = Math.floor(Math.random() * charLength);
39
+ resultArray.push(chars[charIndex]);
40
+ }
41
+ let id = resultArray.join('');
42
+ if (logalot) {
43
+ console.log(`${lc} id: ${id} (I: c6591ffee6d5bbea79ed19cfa6630422)`);
44
+ }
45
+ return id;
46
+ }
47
+ }
48
+ /**
49
+ * Start fluent calls with this.
50
+ */
51
+ forA({ what, }) {
52
+ this.what = what || 'thingy';
53
+ return this;
54
+ }
55
+ addItem(item) {
56
+ if (!item.uuid) {
57
+ item.uuid = this.getNewId();
58
+ }
59
+ this.items.push(item);
60
+ }
61
+ /**
62
+ * Empty function simply for more natural looking fluent syntax.
63
+ *
64
+ * You can override this for custom form builders that descend from this
65
+ * class.
66
+ *
67
+ * @returns this
68
+ */
69
+ with({ idPool, }) {
70
+ if (idPool) {
71
+ this.idPool = idPool;
72
+ }
73
+ return this;
74
+ }
75
+ /**
76
+ * I'm not a great fluent builder writer for TypeScript,
77
+ * and this function acts as a caster for which members of
78
+ * which concrete classes to expose for the proceeding builder lines.
79
+ *
80
+ *
81
+ * Basically, you use this to typecast the builder, possibly redundantly since
82
+ * I don't have any ordering implemented atow.
83
+ *
84
+ * @returns typecasted fluent builder
85
+ */
86
+ and() { return this; }
87
+ name({ of: value, required = true, }) {
88
+ this.addItem({
89
+ // witness.data.name
90
+ name: "name",
91
+ description: `What to call this ${this.what}. Doesn't have to be unique, no spaces, up to 32 alphanumerics/underscores in length.`,
92
+ label: "Name",
93
+ placeholder: `e.g. "bob_the_cool"`,
94
+ regexp: getRegExp({ min: 1, max: 32, noSpaces: true }),
95
+ regexpErrorMsg: '1 to 32 characters, no spaces, underscores allowed.',
96
+ required,
97
+ dataType: 'text',
98
+ value,
99
+ });
100
+ return this;
101
+ }
102
+ description({ of: value, required, defaultValue, }) {
103
+ this.addItem({
104
+ // witness.data.description
105
+ name: "description",
106
+ description: `Description/notes for this ${this.what}.`,
107
+ label: "Description",
108
+ placeholder: `Describe these ${this.what} settings here...`,
109
+ regexp: getRegExp({ min: 0, max: 155, chars: SAFE_SPECIAL_CHARS }),
110
+ regexpErrorMsg: `0 to 155 alphanumerics or any of ${SAFE_SPECIAL_CHARS}`,
111
+ // regexpSource: getRegExp({min: 0, max: 155, chars: SAFE_SPECIAL_CHARS}).source,
112
+ dataType: 'textarea',
113
+ required,
114
+ defaultValue,
115
+ value,
116
+ });
117
+ return this;
118
+ }
119
+ classname({ of, required = true, }) {
120
+ this.addItem({
121
+ // witness.data.classname
122
+ name: "classname",
123
+ description: `Technical setting that is the name of the ${this.what}'s class in computer code.`,
124
+ label: "Classname",
125
+ regexp: getRegExp({ min: 1, max: 128, noSpaces: true }),
126
+ regexpErrorMsg: `1 to 128 alphanumerics or underscores without spaces`,
127
+ // regexpSource: getRegExp({min: 1, max: 128, noSpaces: true}).source,
128
+ dataType: 'text',
129
+ value: of,
130
+ readonly: true,
131
+ required,
132
+ });
133
+ return this;
134
+ }
135
+ uuid({ of, label, required, }) {
136
+ this.addItem({
137
+ // witness.data.uuid
138
+ name: "uuid",
139
+ description: `Unique(ish) id of the ${this.what}.`,
140
+ label: label ?? "ID",
141
+ dataType: 'text',
142
+ value: of,
143
+ regexp: UUID_REGEXP,
144
+ regexpErrorMsg: '1 to 256 alphanumerics, underscores, dots, hyphens allowed.',
145
+ readonly: true,
146
+ required,
147
+ });
148
+ return this;
149
+ }
150
+ version({ of, required, }) {
151
+ this.addItem({
152
+ // witness.data.version
153
+ name: "version",
154
+ description: `Technical setting indicating the version of the ${this.what}.`,
155
+ label: "Version",
156
+ dataType: 'text',
157
+ value: of || '',
158
+ readonly: true,
159
+ required,
160
+ });
161
+ return this;
162
+ }
163
+ /**
164
+ * To pass in a completely customized item info.
165
+ *
166
+ * @returns `this` for fluent builder
167
+ */
168
+ customItem(item) {
169
+ this.addItem(item);
170
+ return this;
171
+ }
172
+ outputItems() {
173
+ return this.items;
174
+ }
175
+ outputForm({ formName, label, }) {
176
+ return {
177
+ name: formName,
178
+ // description: this.description ?? `This is a form for a ${this.what}`,
179
+ description: `This is a form for a ${this.what}`,
180
+ label: label ?? this.what,
181
+ items: this.items,
182
+ };
183
+ }
184
+ }
185
+ //# sourceMappingURL=form-helper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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AAI;YACpB,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,WAAW;YACnB,cAAc,EAAE,6DAA6D;YAC7E,QAAQ,EAAE,IAAI;YACd,QAAQ;SACX,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,EACJ,EAAE,EACF,QAAQ,GAIX;QACG,IAAI,CAAC,OAAO,CAAC;YACT,uBAAuB;YACvB,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,mDAAmD,IAAI,CAAC,IAAI,GAAG;YAC5E,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,EAAE,IAAI,EAAE;YACf,QAAQ,EAAE,IAAI;YACd,QAAQ;SACX,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,IAAkB;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAGD,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,UAAU,CAAC,EACP,QAAQ,EACR,KAAK,GAIR;QACG,OAAO;YACH,IAAI,EAAE,QAAQ;YACd,wEAAwE;YACxE,WAAW,EAAE,wBAAwB,IAAI,CAAC,IAAI,EAAE;YAChD,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;SACL,CAAC;IACrB,CAAC;CACJ"}
@@ -0,0 +1,229 @@
1
+ /**
2
+ * @module
3
+ *
4
+ * Types used in bindings for forms/dynamic forms.
5
+ *
6
+ * ## transitioning development
7
+ *
8
+ * I am transitioning from a ad hoc field behavior with angular templated forms
9
+ * to a slightly more powerful dynamic form fields that leverages angular's
10
+ * reactive forms. So many of the later properties of {@link FormItemInfo} are
11
+ * optional for backwards compatibility. These may become required in the
12
+ * future, once I have dynamic forms more fleshed out.
13
+ */
14
+ /**
15
+ * For when you want options with both a label and icons.
16
+ */
17
+ export interface SelectOptionWithIcon {
18
+ label: string;
19
+ icon: string;
20
+ value: string;
21
+ }
22
+ /**
23
+ * Used in modal forms.
24
+ */
25
+ export interface FormItemInfo {
26
+ /**
27
+ * Property name
28
+ */
29
+ name: string;
30
+ /**
31
+ *
32
+ */
33
+ value?: string | number | boolean;
34
+ /**
35
+ * If set, the value will default to this.
36
+ */
37
+ defaultValue?: string | number | boolean;
38
+ /**
39
+ * Label for the property on a form
40
+ */
41
+ label?: string;
42
+ /**
43
+ * Optional description for the property. Can bind title/hover/tooltip to this.
44
+ */
45
+ description?: string;
46
+ /**
47
+ * Placeholder when entering the field's data.
48
+ */
49
+ placeholder?: string;
50
+ /**
51
+ * Validation regular expression
52
+ *
53
+ * If you change this on a field, you should always change
54
+ * the {@link regexpErrorMsg} !
55
+
56
+ * @see {@link regexpErrorMsg}
57
+ */
58
+ regexp?: RegExp;
59
+ /**
60
+ * If provided, this tries to give guidance on regexp failures.
61
+ *
62
+ * NOTE this can always get out of sync with the regexp!
63
+ * @see {@link regexp}
64
+ */
65
+ regexpErrorMsg?: string;
66
+ /**
67
+ * regexp.source
68
+ */
69
+ /**
70
+ * Only required if wanting to do validation beyond regexp/required.
71
+ */
72
+ fnValid?: (value: string | number) => boolean;
73
+ /**
74
+ * Default error message, often used with {@see fnValid}.
75
+ *
76
+ * @see {@link regexpErrorMsg}
77
+ *
78
+ * ## in the future, this may be changed to a
79
+ * `string | {[error: string]: string}` which would be a better
80
+ * solution probably.
81
+ */
82
+ defaultErrorMsg?: string;
83
+ /**
84
+ * If the field is required.
85
+ */
86
+ required?: boolean;
87
+ /**
88
+ * If true, will not log field and will use type='password', unless the field
89
+ * is {@link unmasked}.
90
+ */
91
+ private?: boolean;
92
+ /**
93
+ * If true, will reveal a private field.
94
+ */
95
+ unmasked?: boolean;
96
+ /**
97
+ * If true, then regardless of modal state (adding/editing/viewing), this
98
+ * field will always be readonly.
99
+ */
100
+ readonly?: boolean;
101
+ /**
102
+ * If truthy and non-zero, then this is a composite item which contains
103
+ * other items.
104
+ *
105
+ * Basically with angular, this translates to either a `FormGroup` or
106
+ * `FormArray`.
107
+ */
108
+ items?: FormItemInfo[];
109
+ /**
110
+ * @see {@link FormItemDataType}
111
+ *
112
+ * Only should be set if {@link items} is falsy.
113
+ */
114
+ dataType?: FormItemDataType;
115
+ /**
116
+ * Options to populate a select drop-down list (valid value list). I believe
117
+ * this can also be populated after the field info has been created but
118
+ * before/while the select list is shown to the user.
119
+ */
120
+ selectOptions?: string[];
121
+ /**
122
+ * If you want your select options to include icons, use this.
123
+ * @see {@link selectOptions}
124
+ */
125
+ selectOptionsWithIcons?: SelectOptionWithIcon[];
126
+ /**
127
+ * If set, this will trigger when the item is selected.
128
+ */
129
+ onSelect?: (event: any, info: FormItemInfo) => Promise<void>;
130
+ /**
131
+ * If given, should be the min of the field for validation.
132
+ *
133
+ * If the dataType is some kind of text, then this refers to the length of string.
134
+ * If the dataType is some kind of number, then this refers to the value of the number.
135
+ *
136
+ * ## notes
137
+ * * there can be the regex also that looks at this value
138
+ *
139
+ * @optional
140
+ */
141
+ min?: number;
142
+ /**
143
+ * If given, should be the max of the field for validation.
144
+ *
145
+ * If the dataType is some kind of text, then this refers to the length of string.
146
+ * If the dataType is some kind of number, then this refers to the value of the number.
147
+ *
148
+ * ## notes
149
+ * * there can be the regex also that looks at this value
150
+ *
151
+ * @optional
152
+ */
153
+ max?: number;
154
+ /**
155
+ * If true, select can select multiple items.
156
+ *
157
+ * If not a select, then not sure what's up.
158
+ */
159
+ multiple?: boolean;
160
+ /**
161
+ * If control is set, then this should be a randomly generated uuid
162
+ * that can be uniquely associated to the control.
163
+ */
164
+ uuid?: string;
165
+ /**
166
+ * If true, then the control is errored and contains error information.
167
+ */
168
+ errored?: boolean;
169
+ }
170
+ export type FormItemDataType = 'text' | 'textarea' | 'select' | 'toggle' | 'number' | 'form';
171
+ /**
172
+ * Type of the data, to drive what kind of control will be used for data.
173
+ *
174
+ * See individual members for more info.
175
+ *
176
+ * For fields that have auto-generated UI.
177
+ *
178
+ * ATOW Pretty much mirroring html5 input types.
179
+ *
180
+ * @see {@link FormItemDataType.text}
181
+ * @see {@link textarea}
182
+ * @see {@link select}
183
+ * @see {@link toggle}
184
+ * @see {@link number}
185
+ */
186
+ export declare const FormItemDataType: {
187
+ /**
188
+ * @example name
189
+ */
190
+ text: FormItemDataType;
191
+ /**
192
+ * @example description
193
+ */
194
+ textarea: FormItemDataType;
195
+ /**
196
+ * select string(s) from a list.
197
+ *
198
+ * @example States e.g. TX, TN, NY, etc.
199
+ *
200
+ * @see {@link FormItemInfo.multiple}
201
+ */
202
+ select: FormItemDataType;
203
+ /**
204
+ * Boolean true/false or on/off, etc.
205
+ */
206
+ toggle: FormItemDataType;
207
+ /**
208
+ * Number value
209
+ */
210
+ number: FormItemDataType;
211
+ /**
212
+ * The item is a collection of other items.
213
+ */
214
+ form: FormItemDataType;
215
+ };
216
+ /**
217
+ * syntactic sugar for `Object.values(FormItemDataType)`
218
+ */
219
+ export declare const FORM_ITEM_DATA_TYPES: FormItemDataType[];
220
+ /**
221
+ * A form is basically an array of form items.
222
+ */
223
+ export interface DynamicForm extends FormItemInfo {
224
+ /**
225
+ * redeclared here to require children items.
226
+ */
227
+ items: FormItemInfo[];
228
+ }
229
+ //# sourceMappingURL=form-items.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-items.d.mts","sourceRoot":"","sources":["../../../src/common/form/form-items.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,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O,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAGD,MAAM,MAAM,gBAAgB,GAC1B,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAChE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;;IAEH;;OAEG;;IAEH;;;;;;OAMG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEJ,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,oBAAkC,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C;;OAEG;IACH,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @module
3
+ *
4
+ * Types used in bindings for forms/dynamic forms.
5
+ *
6
+ * ## transitioning development
7
+ *
8
+ * I am transitioning from a ad hoc field behavior with angular templated forms
9
+ * to a slightly more powerful dynamic form fields that leverages angular's
10
+ * reactive forms. So many of the later properties of {@link FormItemInfo} are
11
+ * optional for backwards compatibility. These may become required in the
12
+ * future, once I have dynamic forms more fleshed out.
13
+ */
14
+ /**
15
+ * Type of the data, to drive what kind of control will be used for data.
16
+ *
17
+ * See individual members for more info.
18
+ *
19
+ * For fields that have auto-generated UI.
20
+ *
21
+ * ATOW Pretty much mirroring html5 input types.
22
+ *
23
+ * @see {@link FormItemDataType.text}
24
+ * @see {@link textarea}
25
+ * @see {@link select}
26
+ * @see {@link toggle}
27
+ * @see {@link number}
28
+ */
29
+ export const FormItemDataType = {
30
+ /**
31
+ * @example name
32
+ */
33
+ text: 'text',
34
+ /**
35
+ * @example description
36
+ */
37
+ textarea: 'textarea',
38
+ /**
39
+ * select string(s) from a list.
40
+ *
41
+ * @example States e.g. TX, TN, NY, etc.
42
+ *
43
+ * @see {@link FormItemInfo.multiple}
44
+ */
45
+ select: 'select',
46
+ /**
47
+ * Boolean true/false or on/off, etc.
48
+ */
49
+ toggle: 'toggle',
50
+ /**
51
+ * Number value
52
+ */
53
+ number: 'number',
54
+ /**
55
+ * The item is a collection of other items.
56
+ */
57
+ form: 'form',
58
+ };
59
+ /**
60
+ * syntactic sugar for `Object.values(FormItemDataType)`
61
+ */
62
+ export const FORM_ITEM_DATA_TYPES = Object.values(FormItemDataType);
63
+ //# sourceMappingURL=form-items.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-items.mjs","sourceRoot":"","sources":["../../../src/common/form/form-items.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoKH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAA0B;IAChC;;OAEG;IACH,QAAQ,EAAE,UAA8B;IACxC;;;;;;OAMG;IACH,MAAM,EAAE,QAA4B;IACpC;;OAEG;IACH,MAAM,EAAE,QAA4B;IACpC;;OAEG;IACH,MAAM,EAAE,QAA4B;IACpC;;OAEG;IACH,IAAI,EAAE,MAA0B;CACjC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { IbGibAddr, IbGibRel8ns } from '@ibgib/ts-gib/dist/types.mjs';
2
+ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
3
+ export interface RawExportData_V1 {
4
+ dependencyGraphAsString: string;
5
+ contextIbGibAddr: IbGibAddr;
6
+ tjpAddr?: IbGibAddr;
7
+ }
8
+ export interface RawExportRel8ns_V1 extends IbGibRel8ns {
9
+ }
10
+ /**
11
+ * Ibgib that contains an entire export of a given ibgib.
12
+ *
13
+ * This could potentially be huge, so I'm naming it "Raw" in hopes
14
+ * that in the future some type of sharding & compression might happen.
15
+ */
16
+ export interface RawExportIbGib_V1 extends IbGib_V1<RawExportData_V1, RawExportRel8ns_V1> {
17
+ }
18
+ //# sourceMappingURL=import-export-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-export-types.d.mts","sourceRoot":"","sources":["../../../src/common/import-export/import-export-types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC7B,uBAAuB,EAAE,MAAM,CAAC;IAChC,gBAAgB,EAAE,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;CAAI;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;CAAI"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=import-export-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-export-types.mjs","sourceRoot":"","sources":["../../../src/common/import-export/import-export-types.mts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=legacy-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-types.d.mts","sourceRoot":"","sources":["../../../src/common/legacy/legacy-types.mts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=legacy-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-types.mjs","sourceRoot":"","sources":["../../../src/common/legacy/legacy-types.mts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_LINK_TEXT_IB_SUBSTRING_LENGTH = 20;
2
+ //# sourceMappingURL=link-constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-constants.d.mts","sourceRoot":"","sources":["../../../src/common/link/link-constants.mts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const DEFAULT_LINK_TEXT_IB_SUBSTRING_LENGTH = 20;
2
+ //# sourceMappingURL=link-constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-constants.mjs","sourceRoot":"","sources":["../../../src/common/link/link-constants.mts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qCAAqC,GAAG,EAAE,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
2
+ import { TransformResult } from '@ibgib/ts-gib';
3
+ import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs';
4
+ import { LinkIbGib_V1 } from './link-types.mjs';
5
+ /**
6
+ * generates an ib based on the link text.
7
+ *
8
+ * Basically this gets a short substring of the link text and replaces
9
+ * any non alphanumeric characters.
10
+ *
11
+ * @param linkText link text
12
+ * @returns link ib for the given link text
13
+ */
14
+ export declare function getLinkIb(linkText: string): string;
15
+ /**
16
+ * creates a link ibgib, returning the transform result,
17
+ * optionally saving it in a given {@link space}.
18
+ */
19
+ export declare function createLinkIbGib({ text, saveInSpace, space, }: {
20
+ /**
21
+ * link text
22
+ */
23
+ text: string;
24
+ /**
25
+ * If true, will save the ibgibs created in the given {@link space}.
26
+ */
27
+ saveInSpace?: boolean;
28
+ /**
29
+ * If {@link saveInSpace}, all ibgibs created in this function will be stored in
30
+ * this space.
31
+ */
32
+ space?: IbGibSpaceAny;
33
+ }): Promise<TransformResult<LinkIbGib_V1>>;
34
+ export declare function isLink({ ibGib, }: {
35
+ ibGib: IbGib_V1;
36
+ }): boolean;
37
+ //# sourceMappingURL=link-helper.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-helper.d.mts","sourceRoot":"","sources":["../../../src/common/link/link-helper.mts"],"names":[],"mappings":"AACA,OAAO,EAAyB,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAMtE,OAAO,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAK7D;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAqBlD;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,WAAW,EACX,KAAK,GACN,EAAE;IACD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAuCzC;AAED,wBAAgB,MAAM,CAAC,EACrB,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,CAAC;CACjB,GAAG,OAAO,CAwCV"}