jww-parser 2026.1.0 → 2026.1.1

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.
package/dist/index.cjs CHANGED
@@ -1,325 +1,5 @@
1
1
 
2
2
  //#region target/js/release/build/jww_parser.js
3
- const $1L = {
4
- hi: 0,
5
- lo: 1
6
- };
7
- const $2305843009213693952L = {
8
- hi: 536870912,
9
- lo: 0
10
- };
11
- const $5955668970331000884L = {
12
- hi: 1386662239,
13
- lo: -1067102156
14
- };
15
- const $1784059615882449851L = {
16
- hi: 415383748,
17
- lo: -1362422853
18
- };
19
- const $8982663654677661702L = {
20
- hi: 2091439360,
21
- lo: 1910491142
22
- };
23
- const $1380349269358112757L = {
24
- hi: 321387608,
25
- lo: -636522507
26
- };
27
- const $7286864317269821294L = {
28
- hi: 1696605309,
29
- lo: 894846830
30
- };
31
- const $2135987035920910082L = {
32
- hi: 497323236,
33
- lo: 1760020226
34
- };
35
- const $7005857020398200553L = {
36
- hi: 1631178199,
37
- lo: 1745020649
38
- };
39
- const $1652639921975621497L = {
40
- hi: 384785216,
41
- lo: -1023641735
42
- };
43
- const $_481418970354774919L = {
44
- hi: -112089089,
45
- lo: 1138658425
46
- };
47
- const $1278668206209430417L = {
48
- hi: 297713141,
49
- lo: 2024993681
50
- };
51
- const $8928596168509315048L = {
52
- hi: 2078850792,
53
- lo: -689350680
54
- };
55
- const $1978643211784836272L = {
56
- hi: 460688772,
57
- lo: -1884531536
58
- };
59
- const $_8371072500651252758L = {
60
- hi: -1949042199,
61
- lo: -1717296150
62
- };
63
- const $1530901034580419511L = {
64
- hi: 356440673,
65
- lo: 1081189303
66
- };
67
- const $597001226353042382L = {
68
- hi: 139000179,
69
- lo: -885070898
70
- };
71
- const $1184477304306571148L = {
72
- hi: 275782613,
73
- lo: 666146700
74
- };
75
- const $1527430471115325346L = {
76
- hi: 355632619,
77
- lo: -1175470174
78
- };
79
- const $1832889850782397517L = {
80
- hi: 426752923,
81
- lo: -1269975987
82
- };
83
- const $_5913534206540532074L = {
84
- hi: -1376851976,
85
- lo: 1812444822
86
- };
87
- const $1418129833677084982L = {
88
- hi: 330184081,
89
- lo: -172697290
90
- };
91
- const $5577825024675947042L = {
92
- hi: 1298688590,
93
- lo: -1357372894
94
- };
95
- const $2194449627517475473L = {
96
- hi: 510935119,
97
- lo: 1034607249
98
- };
99
- const $_7439769533505684065L = {
100
- hi: -1732206330,
101
- lo: -526467681
102
- };
103
- const $1697873161311732311L = {
104
- hi: 395316900,
105
- lo: -39337385
106
- };
107
- const $_8133250842069730034L = {
108
- hi: -1893670029,
109
- lo: 1900641550
110
- };
111
- const $1313665730009899186L = {
112
- hi: 305861637,
113
- lo: 1993875634
114
- };
115
- const $_5745727253942878843L = {
116
- hi: -1337781375,
117
- lo: 880033157
118
- };
119
- const $2032799256770390445L = {
120
- hi: 473297959,
121
- lo: 1601841581
122
- };
123
- const $0L = {
124
- hi: 0,
125
- lo: 0
126
- };
127
- const $1152921504606846976L = {
128
- hi: 268435456,
129
- lo: 0
130
- };
131
- const $1490116119384765625L = {
132
- hi: 346944695,
133
- lo: 839070905
134
- };
135
- const $1032610780636961552L = {
136
- hi: 240423432,
137
- lo: -1290085616
138
- };
139
- const $1925929944387235853L = {
140
- hi: 448415508,
141
- lo: -1786957811
142
- };
143
- const $7910200175544436838L = {
144
- hi: 1841736998,
145
- lo: 1301219430
146
- };
147
- const $1244603055572228341L = {
148
- hi: 289781730,
149
- lo: -2051041035
150
- };
151
- const $_1504838264676837686L = {
152
- hi: -350372462,
153
- lo: 1032165066
154
- };
155
- const $1608611746708759036L = {
156
- hi: 374534108,
157
- lo: 1612227068
158
- };
159
- const $_5421850118411349444L = {
160
- hi: -1262372853,
161
- lo: 581866044
162
- };
163
- const $2079081953128979843L = {
164
- hi: 484073989,
165
- lo: 1529716099
166
- };
167
- const $6607496772837067824L = {
168
- hi: 1538427726,
169
- lo: -1887548368
170
- };
171
- const $1343575221513417750L = {
172
- hi: 312825483,
173
- lo: -1621953514
174
- };
175
- const $_1113817083813899013L = {
176
- hi: -259330749,
177
- lo: 1988285691
178
- };
179
- const $1736530273035216783L = {
180
- hi: 404317461,
181
- lo: 838461327
182
- };
183
- const $_5409364890226003632L = {
184
- hi: -1259465910,
185
- lo: -644091568
186
- };
187
- const $2244412773384604712L = {
188
- hi: 522568070,
189
- lo: -1494201304
190
- };
191
- const $1605989338741628675L = {
192
- hi: 373923531,
193
- lo: 1891786499
194
- };
195
- const $1450417759929778918L = {
196
- hi: 337701700,
197
- lo: -1668791578
198
- };
199
- const $_8816519005292960336L = {
200
- hi: -2052755795,
201
- lo: 906519984
202
- };
203
- const $1874621017369538693L = {
204
- hi: 436469218,
205
- lo: 348844165
206
- };
207
- const $665883850346957067L = {
208
- hi: 155038165,
209
- lo: 2040105227
210
- };
211
- const $1211445438634777304L = {
212
- hi: 282061621,
213
- lo: 983030488
214
- };
215
- const $_3514853404985837908L = {
216
- hi: -818365581,
217
- lo: 1581201068
218
- };
219
- const $1565756531257009982L = {
220
- hi: 364556100,
221
- lo: -95262914
222
- };
223
- const $5L = {
224
- hi: 0,
225
- lo: 5
226
- };
227
- const $25L = {
228
- hi: 0,
229
- lo: 25
230
- };
231
- const $125L = {
232
- hi: 0,
233
- lo: 125
234
- };
235
- const $625L = {
236
- hi: 0,
237
- lo: 625
238
- };
239
- const $3125L = {
240
- hi: 0,
241
- lo: 3125
242
- };
243
- const $15625L = {
244
- hi: 0,
245
- lo: 15625
246
- };
247
- const $78125L = {
248
- hi: 0,
249
- lo: 78125
250
- };
251
- const $390625L = {
252
- hi: 0,
253
- lo: 390625
254
- };
255
- const $1953125L = {
256
- hi: 0,
257
- lo: 1953125
258
- };
259
- const $9765625L = {
260
- hi: 0,
261
- lo: 9765625
262
- };
263
- const $48828125L = {
264
- hi: 0,
265
- lo: 48828125
266
- };
267
- const $244140625L = {
268
- hi: 0,
269
- lo: 244140625
270
- };
271
- const $1220703125L = {
272
- hi: 0,
273
- lo: 1220703125
274
- };
275
- const $6103515625L = {
276
- hi: 1,
277
- lo: 1808548329
278
- };
279
- const $30517578125L = {
280
- hi: 7,
281
- lo: 452807053
282
- };
283
- const $152587890625L = {
284
- hi: 35,
285
- lo: -2030932031
286
- };
287
- const $762939453125L = {
288
- hi: 177,
289
- lo: -1564725563
290
- };
291
- const $3814697265625L = {
292
- hi: 888,
293
- lo: 766306777
294
- };
295
- const $19073486328125L = {
296
- hi: 4440,
297
- lo: -463433411
298
- };
299
- const $95367431640625L = {
300
- hi: 22204,
301
- lo: 1977800241
302
- };
303
- const $476837158203125L = {
304
- hi: 111022,
305
- lo: 1299066613
306
- };
307
- const $2384185791015625L = {
308
- hi: 555111,
309
- lo: -2094601527
310
- };
311
- const $11920928955078125L = {
312
- hi: 2775557,
313
- lo: -1883073043
314
- };
315
- const $59604644775390625L = {
316
- hi: 13877787,
317
- lo: -825430623
318
- };
319
- const $298023223876953125L = {
320
- hi: 69388939,
321
- lo: 167814181
322
- };
323
3
  const $_1L = {
324
4
  hi: -1,
325
5
  lo: -1
@@ -328,6 +8,14 @@ const $1000000000000000000L = {
328
8
  hi: 232830643,
329
9
  lo: -1486618624
330
10
  };
11
+ const $0L = {
12
+ hi: 0,
13
+ lo: 0
14
+ };
15
+ const $1L = {
16
+ hi: 0,
17
+ lo: 1
18
+ };
331
19
  const $10L = {
332
20
  hi: 0,
333
21
  lo: 10
@@ -428,9 +116,6 @@ function $make_array_len_and_init(a, b) {
428
116
  arr.fill(b);
429
117
  return arr;
430
118
  }
431
- function $compare_int(a, b) {
432
- return (a >= b) - (a <= b);
433
- }
434
119
  function Result$Err$0$(param0) {
435
120
  this._0 = param0;
436
121
  }
@@ -451,9 +136,6 @@ const moonbitlang$core$builtin$$int_to_string_js = (x, radix) => {
451
136
  const moonbitlang$core$builtin$$uint_to_string_js = (x, radix) => {
452
137
  return (x >>> 0).toString(radix);
453
138
  };
454
- const moonbitlang$core$builtin$$uint64_to_string_js = (num, radix) => {
455
- return (BigInt(num.hi >>> 0) << 32n | BigInt(num.lo >>> 0)).toString(radix);
456
- };
457
139
  function $makebytes(a, b) {
458
140
  const arr = new Uint8Array(a);
459
141
  if (b !== 0) arr.fill(b);
@@ -814,14 +496,6 @@ const moonbitlang$core$builtin$$MyInt64$div_u_bigint = (a, b) => {
814
496
  lo: lo | 0
815
497
  };
816
498
  };
817
- const moonbitlang$core$builtin$$MyInt64$mod_u_bigint = (a, b) => {
818
- const result = (BigInt(a.hi >>> 0) << 32n | BigInt(a.lo >>> 0)) % (BigInt(b.hi >>> 0) << 32n | BigInt(b.lo >>> 0));
819
- const lo = Number(result & 4294967295n);
820
- return {
821
- hi: Number(result >> 32n & 4294967295n) | 0,
822
- lo: lo | 0
823
- };
824
- };
825
499
  const moonbitlang$core$builtin$$MyInt64$compare = (a, b) => {
826
500
  const ahi = a.hi;
827
501
  const bhi = b.hi;
@@ -844,28 +518,7 @@ const moonbitlang$core$builtin$$MyInt64$compare_u = (a, b) => {
844
518
  if (alo > blo) return 1;
845
519
  return 0;
846
520
  };
847
- const moonbitlang$core$builtin$$MyInt64$reinterpret_double = function f(a) {
848
- let view = f._view;
849
- if (view === void 0) view = f._view = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
850
- view.setFloat64(0, a);
851
- return {
852
- hi: view.getInt32(0),
853
- lo: view.getInt32(4)
854
- };
855
- };
856
521
  const $bytes_literal$0 = new Uint8Array();
857
- const $4294967295L = {
858
- hi: 0,
859
- lo: -1
860
- };
861
- const $10000000000000000L = {
862
- hi: 2328306,
863
- lo: 1874919424
864
- };
865
- const $4L = {
866
- hi: 0,
867
- lo: 4
868
- };
869
522
  function Result$Err$3$(param0) {
870
523
  this._0 = param0;
871
524
  }
@@ -953,38 +606,6 @@ function $64$f4ah6o$47$jww_parser$47$core$46$Entity$Image(param0) {
953
606
  this._0 = param0;
954
607
  }
955
608
  $64$f4ah6o$47$jww_parser$47$core$46$Entity$Image.prototype.$tag = 6;
956
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Line(param0) {
957
- this._0 = param0;
958
- }
959
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Line.prototype.$tag = 0;
960
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Circle(param0) {
961
- this._0 = param0;
962
- }
963
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Circle.prototype.$tag = 1;
964
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Arc(param0) {
965
- this._0 = param0;
966
- }
967
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Arc.prototype.$tag = 2;
968
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Ellipse(param0) {
969
- this._0 = param0;
970
- }
971
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Ellipse.prototype.$tag = 3;
972
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Point(param0) {
973
- this._0 = param0;
974
- }
975
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Point.prototype.$tag = 4;
976
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Text(param0) {
977
- this._0 = param0;
978
- }
979
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Text.prototype.$tag = 5;
980
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Solid(param0) {
981
- this._0 = param0;
982
- }
983
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Solid.prototype.$tag = 6;
984
- function $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Insert(param0) {
985
- this._0 = param0;
986
- }
987
- $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Insert.prototype.$tag = 7;
988
609
  const $$$64$moonbitlang$47$core$47$builtin$46$StringBuilder$36$as$36$64$moonbitlang$47$core$47$builtin$46$Logger = {
989
610
  method_0: moonbitlang$core$builtin$$Logger$write_string$0$,
990
611
  method_1: moonbitlang$core$builtin$$Logger$write_substring$1$,
@@ -1002,144 +623,8 @@ const moonbitlang$core$builtin$$wasm_helper_cache = {
1002
623
  };
1003
624
  const moonbitlang$core$builtin$$output$46$42$bind$124$8198 = "/";
1004
625
  const moonbitlang$core$builtin$$output$46$42$bind$124$8192 = "/";
1005
- const moonbitlang$core$builtin$$boyer_moore_horspool_find$46$constr$47$65 = 0;
1006
- const moonbitlang$core$builtin$$brute_force_find$46$constr$47$79 = 0;
1007
- const moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_INV_SPLIT2 = [
1008
- $1L,
1009
- $2305843009213693952L,
1010
- $5955668970331000884L,
1011
- $1784059615882449851L,
1012
- $8982663654677661702L,
1013
- $1380349269358112757L,
1014
- $7286864317269821294L,
1015
- $2135987035920910082L,
1016
- $7005857020398200553L,
1017
- $1652639921975621497L,
1018
- $_481418970354774919L,
1019
- $1278668206209430417L,
1020
- $8928596168509315048L,
1021
- $1978643211784836272L,
1022
- $_8371072500651252758L,
1023
- $1530901034580419511L,
1024
- $597001226353042382L,
1025
- $1184477304306571148L,
1026
- $1527430471115325346L,
1027
- $1832889850782397517L,
1028
- $_5913534206540532074L,
1029
- $1418129833677084982L,
1030
- $5577825024675947042L,
1031
- $2194449627517475473L,
1032
- $_7439769533505684065L,
1033
- $1697873161311732311L,
1034
- $_8133250842069730034L,
1035
- $1313665730009899186L,
1036
- $_5745727253942878843L,
1037
- $2032799256770390445L
1038
- ];
1039
- const moonbitlang$core$double$internal$ryu$$gPOW5_INV_OFFSETS = [
1040
- 1414808916,
1041
- 67458373,
1042
- 268701696,
1043
- 4195348,
1044
- 1073807360,
1045
- 1091917141,
1046
- 1108,
1047
- 65604,
1048
- 1073741824,
1049
- 1140850753,
1050
- 1346716752,
1051
- 1431634004,
1052
- 1365595476,
1053
- 1073758208,
1054
- 16777217,
1055
- 66816,
1056
- 1364284433,
1057
- 89478484,
1058
- 0
1059
- ];
1060
- const moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_SPLIT2 = [
1061
- $0L,
1062
- $1152921504606846976L,
1063
- $0L,
1064
- $1490116119384765625L,
1065
- $1032610780636961552L,
1066
- $1925929944387235853L,
1067
- $7910200175544436838L,
1068
- $1244603055572228341L,
1069
- $_1504838264676837686L,
1070
- $1608611746708759036L,
1071
- $_5421850118411349444L,
1072
- $2079081953128979843L,
1073
- $6607496772837067824L,
1074
- $1343575221513417750L,
1075
- $_1113817083813899013L,
1076
- $1736530273035216783L,
1077
- $_5409364890226003632L,
1078
- $2244412773384604712L,
1079
- $1605989338741628675L,
1080
- $1450417759929778918L,
1081
- $_8816519005292960336L,
1082
- $1874621017369538693L,
1083
- $665883850346957067L,
1084
- $1211445438634777304L,
1085
- $_3514853404985837908L,
1086
- $1565756531257009982L
1087
- ];
1088
- const moonbitlang$core$double$internal$ryu$$gPOW5_OFFSETS = [
1089
- 0,
1090
- 0,
1091
- 0,
1092
- 0,
1093
- 1073741824,
1094
- 1500076437,
1095
- 1431590229,
1096
- 1448432917,
1097
- 1091896580,
1098
- 1079333904,
1099
- 1146442053,
1100
- 1146111296,
1101
- 1163220304,
1102
- 1073758208,
1103
- -1773927360,
1104
- 1431721317,
1105
- 1413824581,
1106
- 1075134801,
1107
- 1431671125,
1108
- 1363170645,
1109
- 261
1110
- ];
1111
- const moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_TABLE = [
1112
- $1L,
1113
- $5L,
1114
- $25L,
1115
- $125L,
1116
- $625L,
1117
- $3125L,
1118
- $15625L,
1119
- $78125L,
1120
- $390625L,
1121
- $1953125L,
1122
- $9765625L,
1123
- $48828125L,
1124
- $244140625L,
1125
- $1220703125L,
1126
- $6103515625L,
1127
- $30517578125L,
1128
- $152587890625L,
1129
- $762939453125L,
1130
- $3814697265625L,
1131
- $19073486328125L,
1132
- $95367431640625L,
1133
- $476837158203125L,
1134
- $2384185791015625L,
1135
- $11920928955078125L,
1136
- $59604644775390625L,
1137
- $298023223876953125L
1138
- ];
1139
- const moonbitlang$core$double$internal$ryu$$ryu_to_string$46$record$47$864 = {
1140
- mantissa: $0L,
1141
- exponent: 0
1142
- };
626
+ const moonbitlang$core$builtin$$boyer_moore_horspool_find$46$constr$47$60 = 0;
627
+ const moonbitlang$core$builtin$$brute_force_find$46$constr$47$74 = 0;
1143
628
  const moonbitlang$core$uint64$$max_value = $_1L;
1144
629
  const moonbitlang$core$strconv$$range_err_str = "value out of range";
1145
630
  const moonbitlang$core$strconv$$syntax_err_str = "invalid syntax";
@@ -1473,17 +958,17 @@ const moonbitlang$core$strconv$$table = [
1473
958
  ];
1474
959
  const moonbitlang$core$strconv$$max_exponent_disguised_fast_path = $37L;
1475
960
  const moonbitlang$core$strconv$$min_exponent_fast_path = $_22L;
1476
- const moonbitlang$core$strconv$$checked_mul$46$constr$47$1337 = $0L;
961
+ const moonbitlang$core$strconv$$checked_mul$46$constr$47$1066 = $0L;
1477
962
  const f4ah6o$jww_parser$core$$is_metadata_text$46$42$bind$124$940 = "Printer_";
1478
963
  const f4ah6o$jww_parser$core$$is_metadata_text$46$42$bind$124$941 = "Draw_";
1479
964
  const f4ah6o$jww_parser$core$$is_metadata_text$46$42$bind$124$942 = "View_";
1480
965
  const f4ah6o$jww_parser$core$$normalize_image_path$46$42$bind$124$945 = "%temp%";
1481
- const f4ah6o$jww_parser$core$$default$46$record$47$1387 = {
966
+ const f4ah6o$jww_parser$core$$default$46$record$47$1116 = {
1482
967
  state: 2,
1483
968
  protect: 0,
1484
969
  name: ""
1485
970
  };
1486
- const f4ah6o$jww_parser$core$$default$46$record$47$1391 = {
971
+ const f4ah6o$jww_parser$core$$default$46$record$47$1120 = {
1487
972
  printer_paper_size: "",
1488
973
  draw_bmp_touka: "",
1489
974
  view_direct2d: "",
@@ -1491,7 +976,7 @@ const f4ah6o$jww_parser$core$$default$46$record$47$1391 = {
1491
976
  printer_orientation: "",
1492
977
  printer_d2d_bmp: ""
1493
978
  };
1494
- const f4ah6o$jww_parser$core$$default$46$record$47$1392 = {
979
+ const f4ah6o$jww_parser$core$$default$46$record$47$1121 = {
1495
980
  sunpou1: 0,
1496
981
  sunpou2: 0,
1497
982
  sunpou3: 0,
@@ -1500,68 +985,13 @@ const f4ah6o$jww_parser$core$$default$46$record$47$1392 = {
1500
985
  dummy: 0,
1501
986
  max_line_width: 0
1502
987
  };
1503
- const f4ah6o$jww_parser$core$$default$46$record$47$1393 = {
988
+ const f4ah6o$jww_parser$core$$default$46$record$47$1122 = {
1504
989
  origin_x: 0,
1505
990
  origin_y: 0,
1506
991
  scale: 1,
1507
992
  rotation_setting: 0
1508
993
  };
1509
- const f4ah6o$jww_parser$core$$parse$46$constr$47$1778 = 8;
1510
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1820 = {
1511
- _0: "CONTINUOUS",
1512
- _1: "Solid line",
1513
- _2: ""
1514
- };
1515
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1821 = {
1516
- _0: "DASHED",
1517
- _1: "Dashed",
1518
- _2: ""
1519
- };
1520
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1822 = {
1521
- _0: "DOTTED",
1522
- _1: "Dotted",
1523
- _2: ""
1524
- };
1525
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1823 = {
1526
- _0: "DASHDOT",
1527
- _1: "Dash dot",
1528
- _2: ""
1529
- };
1530
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1824 = {
1531
- _0: "DOT2",
1532
- _1: "Dot (small)",
1533
- _2: ""
1534
- };
1535
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1825 = {
1536
- _0: "DASHDOT2",
1537
- _1: "Dash dot (small)",
1538
- _2: ""
1539
- };
1540
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1826 = {
1541
- _0: "DASHDOTDOT",
1542
- _1: "Dash dot dot",
1543
- _2: ""
1544
- };
1545
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1827 = {
1546
- _0: "DIVIDE",
1547
- _1: "Divide",
1548
- _2: ""
1549
- };
1550
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1828 = {
1551
- _0: "CENTER",
1552
- _1: "Center",
1553
- _2: ""
1554
- };
1555
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1829 = {
1556
- _0: "BORDER",
1557
- _1: "Border",
1558
- _2: ""
1559
- };
1560
- const f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1830 = {
1561
- _0: "HIDDEN",
1562
- _1: "Hidden",
1563
- _2: ""
1564
- };
994
+ const f4ah6o$jww_parser$core$$parse$46$constr$47$1492 = 8;
1565
995
  const moonbitlang$core$double$$neg_infinity = moonbitlang$core$int64$$Int64$reinterpret_as_double($_4503599627370496L);
1566
996
  const moonbitlang$core$double$$not_a_number = moonbitlang$core$int64$$Int64$reinterpret_as_double($9221120237041090561L);
1567
997
  const moonbitlang$core$double$$infinity = moonbitlang$core$int64$$Int64$reinterpret_as_double($9218868437227405312L);
@@ -1584,29 +1014,23 @@ function moonbitlang$core$abort$$abort$7$(msg) {
1584
1014
  function moonbitlang$core$abort$$abort$8$(msg) {
1585
1015
  return $panic();
1586
1016
  }
1587
- function moonbitlang$core$abort$$abort$9$(msg) {
1588
- return $panic();
1589
- }
1590
1017
  function moonbitlang$core$builtin$$abort$3$(string, loc) {
1591
- return moonbitlang$core$abort$$abort$3$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1018
+ return moonbitlang$core$abort$$abort$3$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$9$(loc)}\n`);
1592
1019
  }
1593
1020
  function moonbitlang$core$builtin$$abort$4$(string, loc) {
1594
- return moonbitlang$core$abort$$abort$4$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1021
+ return moonbitlang$core$abort$$abort$4$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$9$(loc)}\n`);
1595
1022
  }
1596
1023
  function moonbitlang$core$builtin$$abort$5$(string, loc) {
1597
- return moonbitlang$core$abort$$abort$5$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1024
+ return moonbitlang$core$abort$$abort$5$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$9$(loc)}\n`);
1598
1025
  }
1599
1026
  function moonbitlang$core$builtin$$abort$6$(string, loc) {
1600
- return moonbitlang$core$abort$$abort$6$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1027
+ return moonbitlang$core$abort$$abort$6$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$9$(loc)}\n`);
1601
1028
  }
1602
1029
  function moonbitlang$core$builtin$$abort$7$(string, loc) {
1603
- moonbitlang$core$abort$$abort$7$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1030
+ moonbitlang$core$abort$$abort$7$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$9$(loc)}\n`);
1604
1031
  }
1605
1032
  function moonbitlang$core$builtin$$abort$8$(string, loc) {
1606
- return moonbitlang$core$abort$$abort$8$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1607
- }
1608
- function moonbitlang$core$builtin$$abort$9$(string, loc) {
1609
- return moonbitlang$core$abort$$abort$9$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$10$(loc)}\n`);
1033
+ return moonbitlang$core$abort$$abort$8$(`${string}\n at ${moonbitlang$core$builtin$$Show$to_string$9$(loc)}\n`);
1610
1034
  }
1611
1035
  function moonbitlang$core$builtin$$StringBuilder$new$46$inner(size_hint) {
1612
1036
  return { val: "" };
@@ -1625,34 +1049,31 @@ function moonbitlang$core$string$$String$unsafe_char_at(self, index) {
1625
1049
  return moonbitlang$core$builtin$$code_point_of_surrogate_pair(c1, self.charCodeAt(_tmp));
1626
1050
  } else return c1;
1627
1051
  }
1628
- function moonbitlang$core$builtin$$op_notequal$11$(x, y) {
1629
- return !moonbitlang$core$builtin$$Eq$equal$11$(x, y);
1052
+ function moonbitlang$core$builtin$$op_notequal$10$(x, y) {
1053
+ return !moonbitlang$core$builtin$$Eq$equal$10$(x, y);
1630
1054
  }
1631
- function moonbitlang$core$builtin$$op_notequal$2$(x, y) {
1632
- return !moonbitlang$core$builtin$$Eq$equal$2$(x, y);
1633
- }
1634
- function moonbitlang$core$array$$Array$at$12$(self, index) {
1055
+ function moonbitlang$core$array$$Array$at$11$(self, index) {
1635
1056
  const len = self.length;
1636
1057
  if (index >= 0 && index < len) {
1637
1058
  $bound_check(self, index);
1638
1059
  return self[index];
1639
1060
  } else return $panic();
1640
1061
  }
1641
- function moonbitlang$core$array$$Array$at$13$(self, index) {
1062
+ function moonbitlang$core$array$$Array$at$12$(self, index) {
1642
1063
  const len = self.length;
1643
1064
  if (index >= 0 && index < len) {
1644
1065
  $bound_check(self, index);
1645
1066
  return self[index];
1646
1067
  } else return $panic();
1647
1068
  }
1648
- function moonbitlang$core$array$$Array$at$14$(self, index) {
1069
+ function moonbitlang$core$array$$Array$at$13$(self, index) {
1649
1070
  const len = self.length;
1650
1071
  if (index >= 0 && index < len) {
1651
1072
  $bound_check(self, index);
1652
1073
  return self[index];
1653
1074
  } else return $panic();
1654
1075
  }
1655
- function moonbitlang$core$array$$Array$at$15$(self, index) {
1076
+ function moonbitlang$core$array$$Array$at$14$(self, index) {
1656
1077
  const len = self.length;
1657
1078
  if (index >= 0 && index < len) {
1658
1079
  $bound_check(self, index);
@@ -1666,7 +1087,7 @@ function moonbitlang$core$array$$Array$at$4$(self, index) {
1666
1087
  return self[index];
1667
1088
  } else return $panic();
1668
1089
  }
1669
- function moonbitlang$core$array$$Array$at$16$(self, index) {
1090
+ function moonbitlang$core$array$$Array$at$15$(self, index) {
1670
1091
  const len = self.length;
1671
1092
  if (index >= 0 && index < len) {
1672
1093
  $bound_check(self, index);
@@ -1723,7 +1144,7 @@ function moonbitlang$core$builtin$$boyer_moore_horspool_find(haystack, needle) {
1723
1144
  }
1724
1145
  return;
1725
1146
  } else return;
1726
- else return moonbitlang$core$builtin$$boyer_moore_horspool_find$46$constr$47$65;
1147
+ else return moonbitlang$core$builtin$$boyer_moore_horspool_find$46$constr$47$60;
1727
1148
  }
1728
1149
  function moonbitlang$core$builtin$$brute_force_find(haystack, needle) {
1729
1150
  const haystack_len = haystack.end - haystack.start | 0;
@@ -1771,7 +1192,7 @@ function moonbitlang$core$builtin$$brute_force_find(haystack, needle) {
1771
1192
  } else break;
1772
1193
  return;
1773
1194
  } else return;
1774
- else return moonbitlang$core$builtin$$brute_force_find$46$constr$47$79;
1195
+ else return moonbitlang$core$builtin$$brute_force_find$46$constr$47$74;
1775
1196
  }
1776
1197
  function moonbitlang$core$string$$StringView$find(self, str) {
1777
1198
  return (str.end - str.start | 0) <= 4 ? moonbitlang$core$builtin$$brute_force_find(self, str) : moonbitlang$core$builtin$$boyer_moore_horspool_find(self, str);
@@ -1995,30 +1416,24 @@ function moonbitlang$core$builtin$$MyInt64$from_int(value) {
1995
1416
  function moonbitlang$core$int$$Int$to_int64(self) {
1996
1417
  return moonbitlang$core$builtin$$MyInt64$from_int(self);
1997
1418
  }
1998
- function moonbitlang$core$builtin$$Compare$op_lt$17$(x, y) {
1999
- return $compare_int(x, y) < 0;
1419
+ function moonbitlang$core$builtin$$Compare$op_lt$16$(x, y) {
1420
+ return moonbitlang$core$builtin$$Compare$compare$17$(x, y) < 0;
2000
1421
  }
2001
1422
  function moonbitlang$core$builtin$$Compare$op_lt$18$(x, y) {
2002
1423
  return moonbitlang$core$builtin$$Compare$compare$2$(x, y) < 0;
2003
1424
  }
2004
- function moonbitlang$core$builtin$$Compare$op_lt$19$(x, y) {
2005
- return moonbitlang$core$builtin$$Compare$compare$20$(x, y) < 0;
2006
- }
2007
1425
  function moonbitlang$core$builtin$$Compare$op_gt$18$(x, y) {
2008
1426
  return moonbitlang$core$builtin$$Compare$compare$2$(x, y) > 0;
2009
1427
  }
2010
- function moonbitlang$core$builtin$$Compare$op_gt$19$(x, y) {
2011
- return moonbitlang$core$builtin$$Compare$compare$20$(x, y) > 0;
1428
+ function moonbitlang$core$builtin$$Compare$op_gt$16$(x, y) {
1429
+ return moonbitlang$core$builtin$$Compare$compare$17$(x, y) > 0;
1430
+ }
1431
+ function moonbitlang$core$builtin$$Compare$op_le$16$(x, y) {
1432
+ return moonbitlang$core$builtin$$Compare$compare$17$(x, y) <= 0;
2012
1433
  }
2013
1434
  function moonbitlang$core$builtin$$Compare$op_le$18$(x, y) {
2014
1435
  return moonbitlang$core$builtin$$Compare$compare$2$(x, y) <= 0;
2015
1436
  }
2016
- function moonbitlang$core$builtin$$Compare$op_le$19$(x, y) {
2017
- return moonbitlang$core$builtin$$Compare$compare$20$(x, y) <= 0;
2018
- }
2019
- function moonbitlang$core$builtin$$Compare$op_ge$17$(x, y) {
2020
- return $compare_int(x, y) >= 0;
2021
- }
2022
1437
  function moonbitlang$core$builtin$$Compare$op_ge$18$(x, y) {
2023
1438
  return moonbitlang$core$builtin$$Compare$compare$2$(x, y) >= 0;
2024
1439
  }
@@ -2067,25 +1482,17 @@ function moonbitlang$core$builtin$$Logger$write_substring$1$(self, value, start,
2067
1482
  }
2068
1483
  moonbitlang$core$builtin$$Logger$write_view$0$(self, _tmp);
2069
1484
  }
2070
- function moonbitlang$core$builtin$$Show$to_string$21$(self) {
2071
- const logger = moonbitlang$core$builtin$$StringBuilder$new$46$inner(0);
2072
- moonbitlang$core$builtin$$Show$output$8$(self, {
2073
- self: logger,
2074
- method_table: $$$64$moonbitlang$47$core$47$builtin$46$StringBuilder$36$as$36$64$moonbitlang$47$core$47$builtin$46$Logger
2075
- });
2076
- return logger.val;
2077
- }
2078
- function moonbitlang$core$builtin$$Show$to_string$10$(self) {
1485
+ function moonbitlang$core$builtin$$Show$to_string$19$(self) {
2079
1486
  const logger = moonbitlang$core$builtin$$StringBuilder$new$46$inner(0);
2080
- moonbitlang$core$builtin$$Show$output$22$(self, {
1487
+ moonbitlang$core$builtin$$Show$output$20$(self, {
2081
1488
  self: logger,
2082
1489
  method_table: $$$64$moonbitlang$47$core$47$builtin$46$StringBuilder$36$as$36$64$moonbitlang$47$core$47$builtin$46$Logger
2083
1490
  });
2084
1491
  return logger.val;
2085
1492
  }
2086
- function moonbitlang$core$builtin$$Show$to_string$18$(self) {
1493
+ function moonbitlang$core$builtin$$Show$to_string$9$(self) {
2087
1494
  const logger = moonbitlang$core$builtin$$StringBuilder$new$46$inner(0);
2088
- moonbitlang$core$builtin$$Show$output$2$(self, {
1495
+ moonbitlang$core$builtin$$Show$output$21$(self, {
2089
1496
  self: logger,
2090
1497
  method_table: $$$64$moonbitlang$47$core$47$builtin$46$StringBuilder$36$as$36$64$moonbitlang$47$core$47$builtin$46$Logger
2091
1498
  });
@@ -2097,22 +1504,16 @@ function moonbitlang$core$int$$Int$to_string$46$inner(self, radix) {
2097
1504
  function moonbitlang$core$uint$$UInt$to_string$46$inner(self, radix) {
2098
1505
  return moonbitlang$core$builtin$$uint_to_string_js(self, radix);
2099
1506
  }
2100
- function moonbitlang$core$uint64$$UInt64$to_string$46$inner(self, radix) {
2101
- return moonbitlang$core$builtin$$uint64_to_string_js(self, radix);
2102
- }
2103
- function moonbitlang$core$uint16$$UInt16$to_string$46$inner(self, radix) {
2104
- return moonbitlang$core$int$$Int$to_string$46$inner(self, radix);
2105
- }
2106
1507
  function moonbitlang$core$builtin$$Show$to_string$6$(self) {
2107
1508
  return self.str.substring(self.start, self.end);
2108
1509
  }
2109
- function moonbitlang$core$builtin$$Iterator$next$16$(self) {
1510
+ function moonbitlang$core$builtin$$Iterator$next$15$(self) {
2110
1511
  return self();
2111
1512
  }
2112
- function moonbitlang$core$builtin$$Iterator$iter$16$(self) {
1513
+ function moonbitlang$core$builtin$$Iterator$iter$15$(self) {
2113
1514
  return (yield_) => {
2114
1515
  while (true) {
2115
- const _bind = moonbitlang$core$builtin$$Iterator$next$16$(self);
1516
+ const _bind = moonbitlang$core$builtin$$Iterator$next$15$(self);
2116
1517
  if (_bind === -1) return 1;
2117
1518
  else {
2118
1519
  if (yield_(_bind) === 1) {} else return 0;
@@ -2214,7 +1615,7 @@ function moonbitlang$core$string$$String$offset_of_nth_char_forward(self, n, sta
2214
1615
  continue;
2215
1616
  } else break;
2216
1617
  return char_count < n || utf16_offset >= end_offset ? void 0 : utf16_offset;
2217
- } else return moonbitlang$core$builtin$$abort$9$("Invalid start index", "@moonbitlang/core/builtin:string.mbt:366:5-366:33");
1618
+ } else return moonbitlang$core$builtin$$abort$8$("Invalid start index", "@moonbitlang/core/builtin:string.mbt:366:5-366:33");
2218
1619
  }
2219
1620
  function moonbitlang$core$string$$String$offset_of_nth_char$46$inner(self, i, start_offset, end_offset) {
2220
1621
  let end_offset$2;
@@ -2238,49 +1639,43 @@ function moonbitlang$core$string$$String$has_prefix(self, str) {
2238
1639
  end: self.length
2239
1640
  }, str);
2240
1641
  }
2241
- function moonbitlang$core$array$$Array$new$46$inner$12$(capacity) {
2242
- return [];
2243
- }
2244
- function moonbitlang$core$array$$Array$new$46$inner$14$(capacity) {
2245
- return [];
2246
- }
2247
- function moonbitlang$core$array$$Array$new$46$inner$23$(capacity) {
1642
+ function moonbitlang$core$array$$Array$new$46$inner$11$(capacity) {
2248
1643
  return [];
2249
1644
  }
2250
- function moonbitlang$core$array$$Array$new$46$inner$24$(capacity) {
1645
+ function moonbitlang$core$array$$Array$new$46$inner$13$(capacity) {
2251
1646
  return [];
2252
1647
  }
2253
- function moonbitlang$core$array$$Array$new$46$inner$25$(capacity) {
1648
+ function moonbitlang$core$array$$Array$new$46$inner$22$(capacity) {
2254
1649
  return [];
2255
1650
  }
2256
- function moonbitlang$core$array$$Array$new$46$inner$15$(capacity) {
1651
+ function moonbitlang$core$array$$Array$new$46$inner$23$(capacity) {
2257
1652
  return [];
2258
1653
  }
2259
- function moonbitlang$core$array$$Array$new$46$inner$13$(capacity) {
1654
+ function moonbitlang$core$array$$Array$new$46$inner$24$(capacity) {
2260
1655
  return [];
2261
1656
  }
2262
- function moonbitlang$core$array$$Array$new$46$inner$26$(capacity) {
1657
+ function moonbitlang$core$array$$Array$new$46$inner$14$(capacity) {
2263
1658
  return [];
2264
1659
  }
2265
- function moonbitlang$core$array$$Array$new$46$inner$27$(capacity) {
1660
+ function moonbitlang$core$array$$Array$new$46$inner$12$(capacity) {
2266
1661
  return [];
2267
1662
  }
2268
- function moonbitlang$core$array$$Array$new$46$inner$28$(capacity) {
1663
+ function moonbitlang$core$array$$Array$new$46$inner$15$(capacity) {
2269
1664
  return [];
2270
1665
  }
2271
- function moonbitlang$core$array$$Array$new$46$inner$16$(capacity) {
2272
- return [];
1666
+ function moonbitlang$core$array$$Array$push$13$(self, value) {
1667
+ moonbitlang$core$builtin$$JSArray$push(self, value);
2273
1668
  }
2274
- function moonbitlang$core$array$$Array$push$14$(self, value) {
1669
+ function moonbitlang$core$array$$Array$push$11$(self, value) {
2275
1670
  moonbitlang$core$builtin$$JSArray$push(self, value);
2276
1671
  }
2277
1672
  function moonbitlang$core$array$$Array$push$12$(self, value) {
2278
1673
  moonbitlang$core$builtin$$JSArray$push(self, value);
2279
1674
  }
2280
- function moonbitlang$core$array$$Array$push$13$(self, value) {
1675
+ function moonbitlang$core$array$$Array$push$14$(self, value) {
2281
1676
  moonbitlang$core$builtin$$JSArray$push(self, value);
2282
1677
  }
2283
- function moonbitlang$core$array$$Array$push$15$(self, value) {
1678
+ function moonbitlang$core$array$$Array$push$22$(self, value) {
2284
1679
  moonbitlang$core$builtin$$JSArray$push(self, value);
2285
1680
  }
2286
1681
  function moonbitlang$core$array$$Array$push$23$(self, value) {
@@ -2289,19 +1684,7 @@ function moonbitlang$core$array$$Array$push$23$(self, value) {
2289
1684
  function moonbitlang$core$array$$Array$push$24$(self, value) {
2290
1685
  moonbitlang$core$builtin$$JSArray$push(self, value);
2291
1686
  }
2292
- function moonbitlang$core$array$$Array$push$25$(self, value) {
2293
- moonbitlang$core$builtin$$JSArray$push(self, value);
2294
- }
2295
- function moonbitlang$core$array$$Array$push$26$(self, value) {
2296
- moonbitlang$core$builtin$$JSArray$push(self, value);
2297
- }
2298
- function moonbitlang$core$array$$Array$push$27$(self, value) {
2299
- moonbitlang$core$builtin$$JSArray$push(self, value);
2300
- }
2301
- function moonbitlang$core$array$$Array$push$28$(self, value) {
2302
- moonbitlang$core$builtin$$JSArray$push(self, value);
2303
- }
2304
- function moonbitlang$core$array$$Array$push$16$(self, value) {
1687
+ function moonbitlang$core$array$$Array$push$15$(self, value) {
2305
1688
  moonbitlang$core$builtin$$JSArray$push(self, value);
2306
1689
  }
2307
1690
  function moonbitlang$core$string$$StringView$is_empty(self) {
@@ -2330,12 +1713,12 @@ function moonbitlang$core$string$$String$iterator(self) {
2330
1713
  return _p;
2331
1714
  }
2332
1715
  function moonbitlang$core$string$$String$iter(self) {
2333
- return moonbitlang$core$builtin$$Iterator$iter$16$(moonbitlang$core$string$$String$iterator(self));
1716
+ return moonbitlang$core$builtin$$Iterator$iter$15$(moonbitlang$core$string$$String$iterator(self));
2334
1717
  }
2335
- function moonbitlang$core$builtin$$Show$to_string$16$(self) {
1718
+ function moonbitlang$core$builtin$$Show$to_string$15$(self) {
2336
1719
  return String.fromCodePoint(self);
2337
1720
  }
2338
- function moonbitlang$core$builtin$$Iter$each$29$(self, f) {
1721
+ function moonbitlang$core$builtin$$Iter$each$25$(self, f) {
2339
1722
  const _foreach_result = { val: $64$moonbitlang$47$core$47$builtin$46$ForeachResult$Continue$2$ };
2340
1723
  self((a) => {
2341
1724
  f(a);
@@ -2356,20 +1739,20 @@ function moonbitlang$core$builtin$$Iter$each$29$(self, f) {
2356
1739
  return;
2357
1740
  }
2358
1741
  }
2359
- function moonbitlang$core$builtin$$Iter$collect$16$(self) {
1742
+ function moonbitlang$core$builtin$$Iter$collect$15$(self) {
2360
1743
  const result = [];
2361
- moonbitlang$core$builtin$$Iter$each$29$(self, (e) => {
2362
- moonbitlang$core$array$$Array$push$16$(result, e);
1744
+ moonbitlang$core$builtin$$Iter$each$25$(self, (e) => {
1745
+ moonbitlang$core$array$$Array$push$15$(result, e);
2363
1746
  });
2364
1747
  return result;
2365
1748
  }
2366
1749
  function moonbitlang$core$string$$String$to_array(self) {
2367
1750
  const _p = moonbitlang$core$string$$String$iter(self);
2368
- const _p$3 = { val: moonbitlang$core$array$$Array$new$46$inner$16$(self.length) };
1751
+ const _p$3 = { val: moonbitlang$core$array$$Array$new$46$inner$15$(self.length) };
2369
1752
  const _p$4 = { val: $64$moonbitlang$47$core$47$builtin$46$ForeachResult$Continue$1$ };
2370
1753
  _p((_p$5) => {
2371
1754
  const _p$6 = _p$3.val;
2372
- moonbitlang$core$array$$Array$push$16$(_p$6, _p$5);
1755
+ moonbitlang$core$array$$Array$push$15$(_p$6, _p$5);
2373
1756
  _p$3.val = _p$6;
2374
1757
  return 1;
2375
1758
  });
@@ -2387,13 +1770,10 @@ function moonbitlang$core$string$$String$to_array(self) {
2387
1770
  }
2388
1771
  return _p$3.val;
2389
1772
  }
2390
- function moonbitlang$core$builtin$$Show$output$8$(self, logger) {
1773
+ function moonbitlang$core$builtin$$Show$output$20$(self, logger) {
2391
1774
  logger.method_table.method_0(logger.self, moonbitlang$core$int$$Int$to_string$46$inner(self, 10));
2392
1775
  }
2393
- function moonbitlang$core$builtin$$Show$output$2$(self, logger) {
2394
- logger.method_table.method_0(logger.self, moonbitlang$core$uint64$$UInt64$to_string$46$inner(self, 10));
2395
- }
2396
- function moonbitlang$core$array$$ArrayView$iterator$16$(self) {
1776
+ function moonbitlang$core$array$$ArrayView$iterator$15$(self) {
2397
1777
  const i = { val: 0 };
2398
1778
  const _p = () => {
2399
1779
  if (i.val < (self.end - self.start | 0)) {
@@ -2404,8 +1784,8 @@ function moonbitlang$core$array$$ArrayView$iterator$16$(self) {
2404
1784
  };
2405
1785
  return _p;
2406
1786
  }
2407
- function moonbitlang$core$array$$ArrayView$iter$16$(self) {
2408
- return moonbitlang$core$builtin$$Iterator$iter$16$(moonbitlang$core$array$$ArrayView$iterator$16$(self));
1787
+ function moonbitlang$core$array$$ArrayView$iter$15$(self) {
1788
+ return moonbitlang$core$builtin$$Iterator$iter$15$(moonbitlang$core$array$$ArrayView$iterator$15$(self));
2409
1789
  }
2410
1790
  function moonbitlang$core$array$$ArrayView$at$4$(self, index) {
2411
1791
  if (index >= 0 && index < (self.end - self.start | 0)) {
@@ -2413,7 +1793,7 @@ function moonbitlang$core$array$$ArrayView$at$4$(self, index) {
2413
1793
  const _tmp$2 = self.start + index | 0;
2414
1794
  $bound_check(_tmp, _tmp$2);
2415
1795
  return _tmp[_tmp$2];
2416
- } else return moonbitlang$core$builtin$$abort$4$(`index out of bounds: the len is from 0 to ${moonbitlang$core$builtin$$Show$to_string$21$(self.end - self.start | 0)} but the index is ${moonbitlang$core$builtin$$Show$to_string$21$(index)}`, "@moonbitlang/core/builtin:arrayview.mbt:101:5-103:6");
1796
+ } else return moonbitlang$core$builtin$$abort$4$(`index out of bounds: the len is from 0 to ${moonbitlang$core$builtin$$Show$to_string$19$(self.end - self.start | 0)} but the index is ${moonbitlang$core$builtin$$Show$to_string$19$(index)}`, "@moonbitlang/core/builtin:arrayview.mbt:101:5-103:6");
2417
1797
  }
2418
1798
  function moonbitlang$core$builtin$$MyInt64$extend_i32_u(value) {
2419
1799
  return {
@@ -2424,9 +1804,6 @@ function moonbitlang$core$builtin$$MyInt64$extend_i32_u(value) {
2424
1804
  function moonbitlang$core$uint64$$UInt64$extend_uint(value) {
2425
1805
  return moonbitlang$core$builtin$$MyInt64$extend_i32_u(value);
2426
1806
  }
2427
- function moonbitlang$core$uint$$UInt$to_uint64(self) {
2428
- return moonbitlang$core$uint64$$UInt64$extend_uint(self);
2429
- }
2430
1807
  function moonbitlang$core$double$$Double$convert_uint64(value) {
2431
1808
  return moonbitlang$core$builtin$$MyInt64$convert_to_double_u(value);
2432
1809
  }
@@ -2442,7 +1819,7 @@ function moonbitlang$core$uint64$$UInt64$to_byte(self) {
2442
1819
  function moonbitlang$core$byte$$Byte$to_int64(self) {
2443
1820
  return moonbitlang$core$int$$Int$to_int64(self);
2444
1821
  }
2445
- function moonbitlang$core$builtin$$Neg$neg$30$(self) {
1822
+ function moonbitlang$core$builtin$$Neg$neg$26$(self) {
2446
1823
  return self.lo === 0 ? {
2447
1824
  hi: ~self.hi + 1 | 0,
2448
1825
  lo: 0
@@ -2464,16 +1841,16 @@ function moonbitlang$core$builtin$$MyInt64$add_hi_lo(self, bhi, blo) {
2464
1841
  lo
2465
1842
  };
2466
1843
  }
2467
- function moonbitlang$core$builtin$$Add$add$30$(self, other) {
1844
+ function moonbitlang$core$builtin$$Add$add$26$(self, other) {
2468
1845
  return moonbitlang$core$builtin$$MyInt64$add_hi_lo(self, other.hi, other.lo);
2469
1846
  }
2470
- function moonbitlang$core$builtin$$Sub$sub$30$(self, other) {
1847
+ function moonbitlang$core$builtin$$Sub$sub$26$(self, other) {
2471
1848
  return other.lo === 0 ? {
2472
1849
  hi: self.hi - other.hi | 0,
2473
1850
  lo: self.lo
2474
1851
  } : moonbitlang$core$builtin$$MyInt64$add_hi_lo(self, ~other.hi, ~other.lo + 1 | 0);
2475
1852
  }
2476
- function moonbitlang$core$builtin$$Mul$mul$30$(self, other) {
1853
+ function moonbitlang$core$builtin$$Mul$mul$26$(self, other) {
2477
1854
  const _ahi = self.hi;
2478
1855
  const _alo = self.lo;
2479
1856
  const _bhi = other.hi;
@@ -2516,7 +1893,7 @@ function moonbitlang$core$builtin$$try_get_int64_wasm_helper() {
2516
1893
  moonbitlang$core$builtin$$wasm_helper_cache.exports = moonbitlang$core$builtin$$try_init_wasm_helper();
2517
1894
  return !(moonbitlang$core$builtin$$wasm_helper_cache.exports === void 0);
2518
1895
  }
2519
- function moonbitlang$core$builtin$$Div$div$30$(self, other) {
1896
+ function moonbitlang$core$builtin$$Div$div$26$(self, other) {
2520
1897
  if (!(other.hi === 0 && other.lo === 0)) {
2521
1898
  if (!moonbitlang$core$builtin$$try_get_int64_wasm_helper()) return moonbitlang$core$builtin$$MyInt64$div_bigint(self, other);
2522
1899
  const _bind = moonbitlang$core$builtin$$wasm_helper_cache.exports;
@@ -2558,27 +1935,6 @@ function moonbitlang$core$builtin$$MyInt64$div_u(self, other) {
2558
1935
  }
2559
1936
  } else return $panic();
2560
1937
  }
2561
- function moonbitlang$core$builtin$$MyInt64$mod_u(self, other) {
2562
- if (!(other.hi === 0 && other.lo === 0)) {
2563
- if (!moonbitlang$core$builtin$$try_get_int64_wasm_helper()) return moonbitlang$core$builtin$$MyInt64$mod_u_bigint(self, other);
2564
- const _bind = moonbitlang$core$builtin$$wasm_helper_cache.exports;
2565
- if (_bind === void 0) return $panic();
2566
- else {
2567
- const _exports = _bind;
2568
- const _ahi = self.hi;
2569
- const _alo = self.lo;
2570
- const _bhi = other.hi;
2571
- const _blo = other.lo;
2572
- const _func = _exports.rem_u;
2573
- const lo = _func(_alo, _ahi, _blo, _bhi);
2574
- const _func$2 = _exports.get_high;
2575
- return {
2576
- hi: _func$2(),
2577
- lo
2578
- };
2579
- }
2580
- } else return $panic();
2581
- }
2582
1938
  function moonbitlang$core$builtin$$MyInt64$land(self, other) {
2583
1939
  return {
2584
1940
  hi: self.hi & other.hi,
@@ -2628,62 +1984,56 @@ function moonbitlang$core$builtin$$MyInt64$asr(self, shift) {
2628
1984
  lo: self.hi >> (shift$2 - 32 | 0)
2629
1985
  };
2630
1986
  }
2631
- function moonbitlang$core$builtin$$Neg$neg$20$(self) {
2632
- return moonbitlang$core$builtin$$Neg$neg$30$(self);
1987
+ function moonbitlang$core$builtin$$Neg$neg$17$(self) {
1988
+ return moonbitlang$core$builtin$$Neg$neg$26$(self);
2633
1989
  }
2634
- function moonbitlang$core$builtin$$Add$add$20$(self, other) {
2635
- return moonbitlang$core$builtin$$Add$add$30$(self, other);
1990
+ function moonbitlang$core$builtin$$Add$add$17$(self, other) {
1991
+ return moonbitlang$core$builtin$$Add$add$26$(self, other);
2636
1992
  }
2637
- function moonbitlang$core$builtin$$Sub$sub$20$(self, other) {
2638
- return moonbitlang$core$builtin$$Sub$sub$30$(self, other);
1993
+ function moonbitlang$core$builtin$$Sub$sub$17$(self, other) {
1994
+ return moonbitlang$core$builtin$$Sub$sub$26$(self, other);
2639
1995
  }
2640
- function moonbitlang$core$builtin$$Mul$mul$20$(self, other) {
2641
- return moonbitlang$core$builtin$$Mul$mul$30$(self, other);
1996
+ function moonbitlang$core$builtin$$Mul$mul$17$(self, other) {
1997
+ return moonbitlang$core$builtin$$Mul$mul$26$(self, other);
2642
1998
  }
2643
- function moonbitlang$core$builtin$$Div$div$20$(self, other) {
2644
- return moonbitlang$core$builtin$$Div$div$30$(self, other);
1999
+ function moonbitlang$core$builtin$$Div$div$17$(self, other) {
2000
+ return moonbitlang$core$builtin$$Div$div$26$(self, other);
2645
2001
  }
2646
- function moonbitlang$core$builtin$$BitAnd$land$20$(self, other) {
2002
+ function moonbitlang$core$builtin$$BitAnd$land$17$(self, other) {
2647
2003
  return moonbitlang$core$builtin$$MyInt64$land(self, other);
2648
2004
  }
2649
- function moonbitlang$core$builtin$$BitOr$lor$20$(self, other) {
2005
+ function moonbitlang$core$builtin$$BitOr$lor$17$(self, other) {
2650
2006
  return moonbitlang$core$builtin$$MyInt64$lor(self, other);
2651
2007
  }
2652
- function moonbitlang$core$builtin$$Shr$shr$20$(self, other) {
2008
+ function moonbitlang$core$builtin$$Shr$shr$17$(self, other) {
2653
2009
  return moonbitlang$core$builtin$$MyInt64$asr(self, other);
2654
2010
  }
2655
- function moonbitlang$core$builtin$$Shl$shl$20$(self, other) {
2011
+ function moonbitlang$core$builtin$$Shl$shl$17$(self, other) {
2656
2012
  return moonbitlang$core$builtin$$MyInt64$lsl(self, other);
2657
2013
  }
2658
- function moonbitlang$core$builtin$$Eq$equal$20$(self, other) {
2014
+ function moonbitlang$core$builtin$$Eq$equal$17$(self, other) {
2659
2015
  const _p = self;
2660
2016
  const _p$2 = other;
2661
2017
  return _p.hi === _p$2.hi && _p.lo === _p$2.lo;
2662
2018
  }
2663
- function moonbitlang$core$builtin$$Compare$compare$20$(self, other) {
2019
+ function moonbitlang$core$builtin$$Compare$compare$17$(self, other) {
2664
2020
  return moonbitlang$core$builtin$$MyInt64$compare(self, other);
2665
2021
  }
2666
2022
  function moonbitlang$core$int64$$Int64$to_int(self) {
2667
2023
  return self.lo;
2668
2024
  }
2669
- function moonbitlang$core$double$$Double$reinterpret_as_uint64(self) {
2670
- return moonbitlang$core$builtin$$MyInt64$reinterpret_double(self);
2671
- }
2672
2025
  function moonbitlang$core$builtin$$Add$add$2$(self, other) {
2673
- return moonbitlang$core$builtin$$Add$add$30$(self, other);
2026
+ return moonbitlang$core$builtin$$Add$add$26$(self, other);
2674
2027
  }
2675
2028
  function moonbitlang$core$builtin$$Sub$sub$2$(self, other) {
2676
- return moonbitlang$core$builtin$$Sub$sub$30$(self, other);
2029
+ return moonbitlang$core$builtin$$Sub$sub$26$(self, other);
2677
2030
  }
2678
2031
  function moonbitlang$core$builtin$$Mul$mul$2$(self, other) {
2679
- return moonbitlang$core$builtin$$Mul$mul$30$(self, other);
2032
+ return moonbitlang$core$builtin$$Mul$mul$26$(self, other);
2680
2033
  }
2681
2034
  function moonbitlang$core$builtin$$Div$div$2$(self, other) {
2682
2035
  return moonbitlang$core$builtin$$MyInt64$div_u(self, other);
2683
2036
  }
2684
- function moonbitlang$core$builtin$$Mod$mod$2$(self, other) {
2685
- return moonbitlang$core$builtin$$MyInt64$mod_u(self, other);
2686
- }
2687
2037
  function moonbitlang$core$builtin$$Compare$compare$2$(self, other) {
2688
2038
  return moonbitlang$core$builtin$$MyInt64$compare_u(self, other);
2689
2039
  }
@@ -2695,9 +2045,6 @@ function moonbitlang$core$builtin$$Eq$equal$2$(self, other) {
2695
2045
  function moonbitlang$core$builtin$$BitAnd$land$2$(self, other) {
2696
2046
  return moonbitlang$core$builtin$$MyInt64$land(self, other);
2697
2047
  }
2698
- function moonbitlang$core$builtin$$BitOr$lor$2$(self, other) {
2699
- return moonbitlang$core$builtin$$MyInt64$lor(self, other);
2700
- }
2701
2048
  function moonbitlang$core$builtin$$Shl$shl$2$(self, shift) {
2702
2049
  return moonbitlang$core$builtin$$MyInt64$lsl(self, shift);
2703
2050
  }
@@ -2708,7 +2055,7 @@ function moonbitlang$core$uint64$$UInt64$clz(self) {
2708
2055
  const _p = self;
2709
2056
  return _p.hi !== 0 ? Math.clz32(_p.hi) : 32 + Math.clz32(_p.lo) | 0;
2710
2057
  }
2711
- function moonbitlang$core$bytes$$Bytes$makei$31$(length, value) {
2058
+ function moonbitlang$core$bytes$$Bytes$makei$27$(length, value) {
2712
2059
  if (length <= 0) return $bytes_literal$0;
2713
2060
  const arr = $makebytes(length, value(0));
2714
2061
  let _tmp = 1;
@@ -2723,7 +2070,7 @@ function moonbitlang$core$bytes$$Bytes$makei$31$(length, value) {
2723
2070
  }
2724
2071
  return arr;
2725
2072
  }
2726
- function moonbitlang$core$builtin$$Eq$equal$11$(self, other) {
2073
+ function moonbitlang$core$builtin$$Eq$equal$10$(self, other) {
2727
2074
  if (self.length !== other.length) return false;
2728
2075
  else {
2729
2076
  const len = self.length;
@@ -2742,7 +2089,7 @@ function moonbitlang$core$builtin$$Eq$equal$11$(self, other) {
2742
2089
  }
2743
2090
  }
2744
2091
  function moonbitlang$core$bytes$$Bytes$from_array(arr) {
2745
- return moonbitlang$core$bytes$$Bytes$makei$31$(arr.end - arr.start | 0, (i) => moonbitlang$core$array$$ArrayView$at$4$(arr, i));
2092
+ return moonbitlang$core$bytes$$Bytes$makei$27$(arr.end - arr.start | 0, (i) => moonbitlang$core$array$$ArrayView$at$4$(arr, i));
2746
2093
  }
2747
2094
  function moonbitlang$core$array$$Array$make$4$(len, elem) {
2748
2095
  const arr = new Array(len);
@@ -2768,7 +2115,7 @@ function moonbitlang$core$array$$Array$set$4$(self, index, value) {
2768
2115
  return;
2769
2116
  }
2770
2117
  }
2771
- function moonbitlang$core$array$$Array$set$13$(self, index, value) {
2118
+ function moonbitlang$core$array$$Array$set$12$(self, index, value) {
2772
2119
  const len = self.length;
2773
2120
  if (index >= 0 && index < len) {
2774
2121
  $bound_check(self, index);
@@ -2794,7 +2141,7 @@ function moonbitlang$core$bytes$$Bytes$to_array(self) {
2794
2141
  }
2795
2142
  return rv;
2796
2143
  }
2797
- function moonbitlang$core$builtin$$Show$output$32$(self, logger) {
2144
+ function moonbitlang$core$builtin$$Show$output$28$(self, logger) {
2798
2145
  const pkg = self.pkg;
2799
2146
  const _bind = moonbitlang$core$string$$StringView$find(pkg, {
2800
2147
  str: moonbitlang$core$builtin$$output$46$42$bind$124$8198,
@@ -2845,8 +2192,8 @@ function moonbitlang$core$builtin$$Show$output$32$(self, logger) {
2845
2192
  logger.method_table.method_3(logger.self, 64);
2846
2193
  logger.method_table.method_2(logger.self, _module_name);
2847
2194
  }
2848
- function moonbitlang$core$builtin$$Show$output$22$(self, logger) {
2849
- moonbitlang$core$builtin$$Show$output$32$(moonbitlang$core$builtin$$SourceLocRepr$parse(self), logger);
2195
+ function moonbitlang$core$builtin$$Show$output$21$(self, logger) {
2196
+ moonbitlang$core$builtin$$Show$output$28$(moonbitlang$core$builtin$$SourceLocRepr$parse(self), logger);
2850
2197
  }
2851
2198
  function moonbitlang$core$array$$Array$sub$46$inner$4$(self, start, end) {
2852
2199
  const len = self.length;
@@ -2863,7 +2210,7 @@ function moonbitlang$core$array$$Array$sub$46$inner$4$(self, start, end) {
2863
2210
  end: end$2
2864
2211
  } : moonbitlang$core$builtin$$abort$3$("View index out of bounds", "@moonbitlang/core/builtin:arrayview.mbt:200:5-200:38");
2865
2212
  }
2866
- function moonbitlang$core$array$$Array$sub$46$inner$16$(self, start, end) {
2213
+ function moonbitlang$core$array$$Array$sub$46$inner$15$(self, start, end) {
2867
2214
  const len = self.length;
2868
2215
  let end$2;
2869
2216
  if (end === void 0) end$2 = len;
@@ -2878,536 +2225,22 @@ function moonbitlang$core$array$$Array$sub$46$inner$16$(self, start, end) {
2878
2225
  end: end$2
2879
2226
  } : moonbitlang$core$builtin$$abort$5$("View index out of bounds", "@moonbitlang/core/builtin:arrayview.mbt:200:5-200:38");
2880
2227
  }
2881
- function moonbitlang$core$array$$Array$from_iter$16$(iter) {
2882
- return moonbitlang$core$builtin$$Iter$collect$16$(iter);
2883
- }
2884
- function moonbitlang$core$double$internal$ryu$$copy_special_str(sign, exponent, mantissa) {
2885
- if (mantissa) return "NaN";
2886
- const s = sign ? "-" : "";
2887
- if (exponent) return `${s}Infinity`;
2888
- return `${s}0.0`;
2889
- }
2890
- function moonbitlang$core$double$internal$ryu$$string_from_bytes(bytes, from, to) {
2891
- const buf = moonbitlang$core$builtin$$StringBuilder$new$46$inner(bytes.length);
2892
- let _tmp = from;
2893
- while (true) {
2894
- const i = _tmp;
2895
- if (i < to) {
2896
- $bound_check(bytes, i);
2897
- const _p = bytes[i];
2898
- moonbitlang$core$builtin$$Logger$write_char$0$(buf, _p);
2899
- _tmp = i + 1 | 0;
2900
- continue;
2901
- } else break;
2902
- }
2903
- return buf.val;
2904
- }
2905
- function moonbitlang$core$double$internal$ryu$$umul128(a, b) {
2906
- const aLo = moonbitlang$core$builtin$$BitAnd$land$2$(a, $4294967295L);
2907
- const aHi = moonbitlang$core$builtin$$Shr$shr$2$(a, 32);
2908
- const bLo = moonbitlang$core$builtin$$BitAnd$land$2$(b, $4294967295L);
2909
- const bHi = moonbitlang$core$builtin$$Shr$shr$2$(b, 32);
2910
- const x = moonbitlang$core$builtin$$Mul$mul$2$(aLo, bLo);
2911
- const y = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Mul$mul$2$(aHi, bLo), moonbitlang$core$builtin$$Shr$shr$2$(x, 32));
2912
- const z = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Mul$mul$2$(aLo, bHi), moonbitlang$core$builtin$$BitAnd$land$2$(y, $4294967295L));
2913
- const w = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Mul$mul$2$(aHi, bHi), moonbitlang$core$builtin$$Shr$shr$2$(y, 32)), moonbitlang$core$builtin$$Shr$shr$2$(z, 32));
2914
- return {
2915
- _0: moonbitlang$core$builtin$$Mul$mul$2$(a, b),
2916
- _1: w
2917
- };
2918
- }
2919
- function moonbitlang$core$double$internal$ryu$$shiftright128(lo, hi, dist) {
2920
- return moonbitlang$core$builtin$$BitOr$lor$2$(moonbitlang$core$builtin$$Shl$shl$2$(hi, 64 - dist | 0), moonbitlang$core$builtin$$Shr$shr$2$(lo, dist));
2921
- }
2922
- function moonbitlang$core$double$internal$ryu$$pow5Factor(value) {
2923
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$Mod$mod$2$(value, $5L), $0L)) return 0;
2924
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$Mod$mod$2$(value, $25L), $0L)) return 1;
2925
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$Mod$mod$2$(value, $125L), $0L)) return 2;
2926
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$Mod$mod$2$(value, $625L), $0L)) return 3;
2927
- let count = 4;
2928
- let value$2 = moonbitlang$core$builtin$$Div$div$2$(value, $625L);
2929
- while (true) if (moonbitlang$core$builtin$$Compare$op_gt$18$(value$2, $0L)) {
2930
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$Mod$mod$2$(value$2, $5L), $0L)) return count;
2931
- value$2 = moonbitlang$core$builtin$$Div$div$2$(value$2, $5L);
2932
- count = count + 1 | 0;
2933
- continue;
2934
- } else break;
2935
- return moonbitlang$core$builtin$$abort$8$(`IllegalArgumentException ${moonbitlang$core$builtin$$Show$to_string$18$(value$2)}`, "@moonbitlang/core/double/internal/ryu:ryu.mbt:116:3-116:45");
2936
- }
2937
- function moonbitlang$core$double$internal$ryu$$multipleOfPowerOf5(value, p) {
2938
- return moonbitlang$core$double$internal$ryu$$pow5Factor(value) >= p;
2939
- }
2940
- function moonbitlang$core$double$internal$ryu$$multipleOfPowerOf2(value, p) {
2941
- return moonbitlang$core$builtin$$Eq$equal$2$(moonbitlang$core$builtin$$BitAnd$land$2$(value, moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Shl$shl$2$($1L, p), $1L)), $0L);
2942
- }
2943
- function moonbitlang$core$double$internal$ryu$$mulShiftAll64(m, mul, j, mmShift) {
2944
- const _mul0 = mul._0;
2945
- const _mul1 = mul._1;
2946
- const m$2 = moonbitlang$core$builtin$$Shl$shl$2$(m, 1);
2947
- const _bind = moonbitlang$core$double$internal$ryu$$umul128(m$2, _mul0);
2948
- const _lo = _bind._0;
2949
- const _tmp = _bind._1;
2950
- const _bind$2 = moonbitlang$core$double$internal$ryu$$umul128(m$2, _mul1);
2951
- const _lo2 = _bind$2._0;
2952
- const _hi2 = _bind$2._1;
2953
- const mid = moonbitlang$core$builtin$$Add$add$2$(_tmp, _lo2);
2954
- const hi = moonbitlang$core$builtin$$Add$add$2$(_hi2, moonbitlang$core$builtin$$Compare$op_lt$18$(mid, _tmp) ? $1L : $0L);
2955
- const lo2 = moonbitlang$core$builtin$$Add$add$2$(_lo, _mul0);
2956
- const mid2 = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Add$add$2$(mid, _mul1), moonbitlang$core$builtin$$Compare$op_lt$18$(lo2, _lo) ? $1L : $0L);
2957
- const vp = moonbitlang$core$double$internal$ryu$$shiftright128(mid2, moonbitlang$core$builtin$$Add$add$2$(hi, moonbitlang$core$builtin$$Compare$op_lt$18$(mid2, mid) ? $1L : $0L), (j - 64 | 0) - 1 | 0);
2958
- let vm = $0L;
2959
- if (mmShift) {
2960
- const lo3 = moonbitlang$core$builtin$$Sub$sub$2$(_lo, _mul0);
2961
- const mid3 = moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Sub$sub$2$(mid, _mul1), moonbitlang$core$builtin$$Compare$op_lt$18$(_lo, lo3) ? $1L : $0L);
2962
- vm = moonbitlang$core$double$internal$ryu$$shiftright128(mid3, moonbitlang$core$builtin$$Sub$sub$2$(hi, moonbitlang$core$builtin$$Compare$op_lt$18$(mid, mid3) ? $1L : $0L), (j - 64 | 0) - 1 | 0);
2963
- } else {
2964
- const lo3 = moonbitlang$core$builtin$$Add$add$2$(_lo, _lo);
2965
- const mid3 = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Add$add$2$(mid, mid), moonbitlang$core$builtin$$Compare$op_lt$18$(lo3, _lo) ? $1L : $0L);
2966
- const hi3 = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$builtin$$Add$add$2$(hi, hi), moonbitlang$core$builtin$$Compare$op_lt$18$(mid3, mid) ? $1L : $0L);
2967
- const lo4 = moonbitlang$core$builtin$$Sub$sub$2$(lo3, _mul0);
2968
- const mid4 = moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Sub$sub$2$(mid3, _mul1), moonbitlang$core$builtin$$Compare$op_lt$18$(lo3, lo4) ? $1L : $0L);
2969
- vm = moonbitlang$core$double$internal$ryu$$shiftright128(mid4, moonbitlang$core$builtin$$Sub$sub$2$(hi3, moonbitlang$core$builtin$$Compare$op_lt$18$(mid3, mid4) ? $1L : $0L), j - 64 | 0);
2970
- }
2971
- return {
2972
- _0: moonbitlang$core$double$internal$ryu$$shiftright128(mid, hi, (j - 64 | 0) - 1 | 0),
2973
- _1: vp,
2974
- _2: vm
2975
- };
2976
- }
2977
- function moonbitlang$core$double$internal$ryu$$double_computePow5(i) {
2978
- const base = i / 26 | 0;
2979
- const base2 = Math.imul(base, 26) | 0;
2980
- const offset = i - base2 | 0;
2981
- const _p = Math.imul(base, 2) | 0;
2982
- $bound_check(moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_SPLIT2, _p);
2983
- const mul0 = moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_SPLIT2[_p];
2984
- const _p$2 = (Math.imul(base, 2) | 0) + 1 | 0;
2985
- $bound_check(moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_SPLIT2, _p$2);
2986
- const mul1 = moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_SPLIT2[_p$2];
2987
- if (offset === 0) return {
2988
- _0: mul0,
2989
- _1: mul1
2990
- };
2991
- $bound_check(moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_TABLE, offset);
2992
- const m = moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_TABLE[offset];
2993
- const _bind = moonbitlang$core$double$internal$ryu$$umul128(m, mul1);
2994
- const _low1 = _bind._0;
2995
- const _high1 = _bind._1;
2996
- const _bind$2 = moonbitlang$core$double$internal$ryu$$umul128(m, mul0);
2997
- const _low0 = _bind$2._0;
2998
- const _high0 = _bind$2._1;
2999
- const sum = moonbitlang$core$builtin$$Add$add$2$(_high0, _low1);
3000
- let high1 = _high1;
3001
- if (moonbitlang$core$builtin$$Compare$op_lt$18$(sum, _high0)) high1 = moonbitlang$core$builtin$$Add$add$2$(high1, $1L);
3002
- const delta = (((Math.imul(i, 1217359) | 0) >>> 19 | 0) + 1 | 0) - (((Math.imul(base2, 1217359) | 0) >>> 19 | 0) + 1 | 0) | 0;
3003
- const _tmp = moonbitlang$core$double$internal$ryu$$shiftright128(_low0, sum, delta);
3004
- const _p$3 = i / 16 | 0;
3005
- $bound_check(moonbitlang$core$double$internal$ryu$$gPOW5_OFFSETS, _p$3);
3006
- return {
3007
- _0: moonbitlang$core$builtin$$Add$add$2$(_tmp, moonbitlang$core$uint$$UInt$to_uint64(moonbitlang$core$double$internal$ryu$$gPOW5_OFFSETS[_p$3] >>> (i % 16 << 1) & 3)),
3008
- _1: moonbitlang$core$double$internal$ryu$$shiftright128(sum, high1, delta)
3009
- };
3010
- }
3011
- function moonbitlang$core$double$internal$ryu$$double_computeInvPow5(i) {
3012
- const base = ((i + 26 | 0) - 1 | 0) / 26 | 0;
3013
- const base2 = Math.imul(base, 26) | 0;
3014
- const offset = base2 - i | 0;
3015
- const _p = Math.imul(base, 2) | 0;
3016
- $bound_check(moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_INV_SPLIT2, _p);
3017
- const mul0 = moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_INV_SPLIT2[_p];
3018
- const _p$2 = (Math.imul(base, 2) | 0) + 1 | 0;
3019
- $bound_check(moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_INV_SPLIT2, _p$2);
3020
- const mul1 = moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_INV_SPLIT2[_p$2];
3021
- if (offset === 0) return {
3022
- _0: mul0,
3023
- _1: mul1
3024
- };
3025
- $bound_check(moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_TABLE, offset);
3026
- const m = moonbitlang$core$double$internal$ryu$$gDOUBLE_POW5_TABLE[offset];
3027
- const _bind = moonbitlang$core$double$internal$ryu$$umul128(m, mul1);
3028
- const _low1 = _bind._0;
3029
- const _high1 = _bind._1;
3030
- const _bind$2 = moonbitlang$core$double$internal$ryu$$umul128(m, mul0);
3031
- const _low0 = _bind$2._0;
3032
- const _high0 = _bind$2._1;
3033
- const sum = moonbitlang$core$builtin$$Add$add$2$(_high0, _low1);
3034
- let high1 = _high1;
3035
- if (moonbitlang$core$builtin$$Compare$op_lt$18$(sum, _high0)) high1 = moonbitlang$core$builtin$$Add$add$2$(high1, $1L);
3036
- const delta = (((Math.imul(base2, 1217359) | 0) >>> 19 | 0) + 1 | 0) - (((Math.imul(i, 1217359) | 0) >>> 19 | 0) + 1 | 0) | 0;
3037
- const _tmp = moonbitlang$core$builtin$$Add$add$2$(moonbitlang$core$double$internal$ryu$$shiftright128(_low0, sum, delta), $1L);
3038
- const _p$3 = i / 16 | 0;
3039
- $bound_check(moonbitlang$core$double$internal$ryu$$gPOW5_INV_OFFSETS, _p$3);
3040
- return {
3041
- _0: moonbitlang$core$builtin$$Add$add$2$(_tmp, moonbitlang$core$uint$$UInt$to_uint64(moonbitlang$core$double$internal$ryu$$gPOW5_INV_OFFSETS[_p$3] >>> (i % 16 << 1) & 3)),
3042
- _1: moonbitlang$core$double$internal$ryu$$shiftright128(sum, high1, delta)
3043
- };
3044
- }
3045
- function moonbitlang$core$double$internal$ryu$$decimal_length17(v) {
3046
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $10000000000000000L)) return 17;
3047
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $1000000000000000L)) return 16;
3048
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $100000000000000L)) return 15;
3049
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $10000000000000L)) return 14;
3050
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $1000000000000L)) return 13;
3051
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $100000000000L)) return 12;
3052
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $10000000000L)) return 11;
3053
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $1000000000L)) return 10;
3054
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $100000000L)) return 9;
3055
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $10000000L)) return 8;
3056
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $1000000L)) return 7;
3057
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $100000L)) return 6;
3058
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $10000L)) return 5;
3059
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $1000L)) return 4;
3060
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $100L)) return 3;
3061
- if (moonbitlang$core$builtin$$Compare$op_ge$18$(v, $10L)) return 2;
3062
- return 1;
3063
- }
3064
- function moonbitlang$core$double$internal$ryu$$d2d(ieeeMantissa, ieeeExponent) {
3065
- let e2 = 0;
3066
- let m2 = $0L;
3067
- if (ieeeExponent === 0) {
3068
- e2 = -1076;
3069
- m2 = ieeeMantissa;
3070
- } else {
3071
- e2 = ((ieeeExponent - 1023 | 0) - 52 | 0) - 2 | 0;
3072
- m2 = moonbitlang$core$builtin$$BitOr$lor$2$(moonbitlang$core$builtin$$Shl$shl$2$($1L, 52), ieeeMantissa);
3073
- }
3074
- const even = moonbitlang$core$builtin$$Eq$equal$2$(moonbitlang$core$builtin$$BitAnd$land$2$(m2, $1L), $0L);
3075
- const mv = moonbitlang$core$builtin$$Mul$mul$2$($4L, m2);
3076
- const mmShift = moonbitlang$core$builtin$$op_notequal$2$(ieeeMantissa, $0L) || ieeeExponent >>> 0 <= 1;
3077
- let vr = $0L;
3078
- let vp = $0L;
3079
- let vm = $0L;
3080
- let e10 = 0;
3081
- let vmIsTrailingZeros = false;
3082
- let vrIsTrailingZeros = false;
3083
- if (e2 >= 0) {
3084
- const _p = e2;
3085
- const q = ((Math.imul(_p, 78913) | 0) >>> 18 | 0) - (e2 > 3 ? 1 : 0) | 0;
3086
- e10 = q;
3087
- const k = (125 + (((Math.imul(q, 1217359) | 0) >>> 19 | 0) + 1 | 0) | 0) - 1 | 0;
3088
- const i = ((-e2 | 0) + q | 0) + k | 0;
3089
- const pow5 = moonbitlang$core$double$internal$ryu$$double_computeInvPow5(q);
3090
- const _bind = moonbitlang$core$double$internal$ryu$$mulShiftAll64(m2, pow5, i, mmShift);
3091
- const _vrOut = _bind._0;
3092
- const _vpOut = _bind._1;
3093
- const _vmOut = _bind._2;
3094
- vr = _vrOut;
3095
- vp = _vpOut;
3096
- vm = _vmOut;
3097
- if (q <= 21) if ((moonbitlang$core$uint64$$UInt64$to_int(mv) - (Math.imul(5, moonbitlang$core$uint64$$UInt64$to_int(moonbitlang$core$builtin$$Div$div$2$(mv, $5L))) | 0) | 0) === 0) vrIsTrailingZeros = moonbitlang$core$double$internal$ryu$$multipleOfPowerOf5(mv, q);
3098
- else if (even) vmIsTrailingZeros = moonbitlang$core$double$internal$ryu$$multipleOfPowerOf5(moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Sub$sub$2$(mv, $1L), mmShift ? $1L : $0L), q);
3099
- else vp = moonbitlang$core$builtin$$Sub$sub$2$(vp, moonbitlang$core$double$internal$ryu$$multipleOfPowerOf5(moonbitlang$core$builtin$$Add$add$2$(mv, $2L), q) ? $1L : $0L);
3100
- } else {
3101
- const _p = -e2 | 0;
3102
- const q = ((Math.imul(_p, 732923) | 0) >>> 20 | 0) - ((-e2 | 0) > 1 ? 1 : 0) | 0;
3103
- e10 = q + e2 | 0;
3104
- const i = (-e2 | 0) - q | 0;
3105
- const j = q - ((((Math.imul(i, 1217359) | 0) >>> 19 | 0) + 1 | 0) - 125 | 0) | 0;
3106
- const pow5 = moonbitlang$core$double$internal$ryu$$double_computePow5(i);
3107
- const _bind = moonbitlang$core$double$internal$ryu$$mulShiftAll64(m2, pow5, j, mmShift);
3108
- const _vrOut = _bind._0;
3109
- const _vpOut = _bind._1;
3110
- const _vmOut = _bind._2;
3111
- vr = _vrOut;
3112
- vp = _vpOut;
3113
- vm = _vmOut;
3114
- if (q <= 1) {
3115
- vrIsTrailingZeros = true;
3116
- if (even) vmIsTrailingZeros = (mmShift ? 1 : 0) === 1;
3117
- else vp = moonbitlang$core$builtin$$Sub$sub$2$(vp, $1L);
3118
- } else if (q < 63) vrIsTrailingZeros = moonbitlang$core$double$internal$ryu$$multipleOfPowerOf2(mv, q);
3119
- }
3120
- let removed = 0;
3121
- let lastRemovedDigit = 0;
3122
- let output = $0L;
3123
- if (vmIsTrailingZeros || vrIsTrailingZeros) {
3124
- while (true) {
3125
- const vpDiv10 = moonbitlang$core$builtin$$Div$div$2$(vp, $10L);
3126
- const vmDiv10 = moonbitlang$core$builtin$$Div$div$2$(vm, $10L);
3127
- if (moonbitlang$core$builtin$$Compare$op_le$18$(vpDiv10, vmDiv10)) break;
3128
- const vmMod10 = moonbitlang$core$uint64$$UInt64$to_int(vm) - (Math.imul(10, moonbitlang$core$uint64$$UInt64$to_int(vmDiv10)) | 0) | 0;
3129
- const vrDiv10 = moonbitlang$core$builtin$$Div$div$2$(vr, $10L);
3130
- const vrMod10 = moonbitlang$core$uint64$$UInt64$to_int(vr) - (Math.imul(10, moonbitlang$core$uint64$$UInt64$to_int(vrDiv10)) | 0) | 0;
3131
- vmIsTrailingZeros = vmIsTrailingZeros && vmMod10 === 0;
3132
- vrIsTrailingZeros = vrIsTrailingZeros && lastRemovedDigit === 0;
3133
- lastRemovedDigit = vrMod10;
3134
- vr = vrDiv10;
3135
- vp = vpDiv10;
3136
- vm = vmDiv10;
3137
- removed = removed + 1 | 0;
3138
- continue;
3139
- }
3140
- if (vmIsTrailingZeros) while (true) {
3141
- const vmDiv10 = moonbitlang$core$builtin$$Div$div$2$(vm, $10L);
3142
- if ((moonbitlang$core$uint64$$UInt64$to_int(vm) - (Math.imul(10, moonbitlang$core$uint64$$UInt64$to_int(vmDiv10)) | 0) | 0) !== 0) break;
3143
- const vpDiv10 = moonbitlang$core$builtin$$Div$div$2$(vp, $10L);
3144
- const vrDiv10 = moonbitlang$core$builtin$$Div$div$2$(vr, $10L);
3145
- const vrMod10 = moonbitlang$core$uint64$$UInt64$to_int(vr) - (Math.imul(10, moonbitlang$core$uint64$$UInt64$to_int(vrDiv10)) | 0) | 0;
3146
- vrIsTrailingZeros = vrIsTrailingZeros && lastRemovedDigit === 0;
3147
- lastRemovedDigit = vrMod10;
3148
- vr = vrDiv10;
3149
- vp = vpDiv10;
3150
- vm = vmDiv10;
3151
- removed = removed + 1 | 0;
3152
- continue;
3153
- }
3154
- if (vrIsTrailingZeros && lastRemovedDigit === 5 && moonbitlang$core$builtin$$Eq$equal$2$(moonbitlang$core$builtin$$Mod$mod$2$(vr, $2L), $0L)) lastRemovedDigit = 4;
3155
- output = moonbitlang$core$builtin$$Add$add$2$(vr, moonbitlang$core$builtin$$Eq$equal$2$(vr, vm) && (!even || !vmIsTrailingZeros) || lastRemovedDigit >= 5 ? $1L : $0L);
3156
- } else {
3157
- let roundUp = false;
3158
- const vpDiv100 = moonbitlang$core$builtin$$Div$div$2$(vp, $100L);
3159
- const vmDiv100 = moonbitlang$core$builtin$$Div$div$2$(vm, $100L);
3160
- if (moonbitlang$core$builtin$$Compare$op_gt$18$(vpDiv100, vmDiv100)) {
3161
- const vrDiv100 = moonbitlang$core$builtin$$Div$div$2$(vr, $100L);
3162
- roundUp = (moonbitlang$core$uint64$$UInt64$to_int(vr) - (Math.imul(100, moonbitlang$core$uint64$$UInt64$to_int(vrDiv100)) | 0) | 0) >= 50;
3163
- vr = vrDiv100;
3164
- vp = vpDiv100;
3165
- vm = vmDiv100;
3166
- removed = removed + 2 | 0;
3167
- }
3168
- while (true) {
3169
- const vpDiv10 = moonbitlang$core$builtin$$Div$div$2$(vp, $10L);
3170
- const vmDiv10 = moonbitlang$core$builtin$$Div$div$2$(vm, $10L);
3171
- if (moonbitlang$core$builtin$$Compare$op_le$18$(vpDiv10, vmDiv10)) break;
3172
- const vrDiv10 = moonbitlang$core$builtin$$Div$div$2$(vr, $10L);
3173
- roundUp = (moonbitlang$core$uint64$$UInt64$to_int(vr) - (Math.imul(10, moonbitlang$core$uint64$$UInt64$to_int(vrDiv10)) | 0) | 0) >= 5;
3174
- vr = vrDiv10;
3175
- vp = vpDiv10;
3176
- vm = vmDiv10;
3177
- removed = removed + 1 | 0;
3178
- continue;
3179
- }
3180
- output = moonbitlang$core$builtin$$Add$add$2$(vr, moonbitlang$core$builtin$$Eq$equal$2$(vr, vm) || roundUp ? $1L : $0L);
3181
- }
3182
- const exp = e10 + removed | 0;
3183
- return {
3184
- mantissa: output,
3185
- exponent: exp
3186
- };
3187
- }
3188
- function moonbitlang$core$double$internal$ryu$$to_chars(v, sign) {
3189
- const result = $makebytes(25, 0);
3190
- let index = 0;
3191
- if (sign) {
3192
- const _tmp = index;
3193
- $bound_check(result, _tmp);
3194
- result[_tmp] = 45;
3195
- index = index + 1 | 0;
3196
- }
3197
- let output = v.mantissa;
3198
- const olength = moonbitlang$core$double$internal$ryu$$decimal_length17(output);
3199
- let exp = (v.exponent + olength | 0) - 1 | 0;
3200
- if (!(exp >= -6 && exp < 21)) {
3201
- const _end41 = olength - 1 | 0;
3202
- let _tmp = 0;
3203
- while (true) {
3204
- const i = _tmp;
3205
- if (i < _end41) {
3206
- const c = moonbitlang$core$builtin$$Mod$mod$2$(output, $10L);
3207
- output = moonbitlang$core$builtin$$Div$div$2$(output, $10L);
3208
- const _tmp$2$1 = (index + olength | 0) - i | 0;
3209
- $bound_check(result, _tmp$2$1);
3210
- result[_tmp$2$1] = (48 + moonbitlang$core$uint64$$UInt64$to_int(c) | 0) & 255;
3211
- _tmp = i + 1 | 0;
3212
- continue;
3213
- } else break;
3214
- }
3215
- const _tmp$2 = index;
3216
- $bound_check(result, _tmp$2);
3217
- result[_tmp$2] = (48 + (moonbitlang$core$uint64$$UInt64$to_int(output) % 10 | 0) | 0) & 255;
3218
- if (olength > 1) {
3219
- const _tmp$3$1 = index + 1 | 0;
3220
- $bound_check(result, _tmp$3$1);
3221
- result[_tmp$3$1] = 46;
3222
- } else index = index - 1 | 0;
3223
- index = index + (olength + 1 | 0) | 0;
3224
- const _tmp$3 = index;
3225
- $bound_check(result, _tmp$3);
3226
- result[_tmp$3] = 101;
3227
- index = index + 1 | 0;
3228
- if (exp < 0) {
3229
- const _tmp$4 = index;
3230
- $bound_check(result, _tmp$4);
3231
- result[_tmp$4] = 45;
3232
- index = index + 1 | 0;
3233
- exp = -exp | 0;
3234
- } else {
3235
- const _tmp$4 = index;
3236
- $bound_check(result, _tmp$4);
3237
- result[_tmp$4] = 43;
3238
- index = index + 1 | 0;
3239
- }
3240
- if (exp >= 100) {
3241
- const a = exp / 100 | 0;
3242
- const b = (exp / 10 | 0) % 10 | 0;
3243
- const c = exp % 10 | 0;
3244
- const _tmp$4 = index;
3245
- $bound_check(result, _tmp$4);
3246
- result[_tmp$4] = (48 + a | 0) & 255;
3247
- const _tmp$5 = index + 1 | 0;
3248
- $bound_check(result, _tmp$5);
3249
- result[_tmp$5] = (48 + b | 0) & 255;
3250
- const _tmp$6 = index + 2 | 0;
3251
- $bound_check(result, _tmp$6);
3252
- result[_tmp$6] = (48 + c | 0) & 255;
3253
- index = index + 3 | 0;
3254
- } else if (exp >= 10) {
3255
- const a = exp / 10 | 0;
3256
- const b = exp % 10 | 0;
3257
- const _tmp$4 = index;
3258
- $bound_check(result, _tmp$4);
3259
- result[_tmp$4] = (48 + a | 0) & 255;
3260
- const _tmp$5 = index + 1 | 0;
3261
- $bound_check(result, _tmp$5);
3262
- result[_tmp$5] = (48 + b | 0) & 255;
3263
- index = index + 2 | 0;
3264
- } else {
3265
- const _tmp$4 = index;
3266
- $bound_check(result, _tmp$4);
3267
- result[_tmp$4] = (48 + exp | 0) & 255;
3268
- index = index + 1 | 0;
3269
- }
3270
- return moonbitlang$core$double$internal$ryu$$string_from_bytes(result, 0, index);
3271
- } else {
3272
- if (exp < 0) {
3273
- const _tmp = index;
3274
- $bound_check(result, _tmp);
3275
- result[_tmp] = 48;
3276
- index = index + 1 | 0;
3277
- const _tmp$2 = index;
3278
- $bound_check(result, _tmp$2);
3279
- result[_tmp$2] = 46;
3280
- index = index + 1 | 0;
3281
- let _tmp$3 = -1;
3282
- while (true) {
3283
- const i = _tmp$3;
3284
- if (i > exp) {
3285
- const _tmp$4$1 = index;
3286
- $bound_check(result, _tmp$4$1);
3287
- result[_tmp$4$1] = 48;
3288
- index = index + 1 | 0;
3289
- _tmp$3 = i - 1 | 0;
3290
- continue;
3291
- } else break;
3292
- }
3293
- const current = index;
3294
- let _tmp$4 = 0;
3295
- while (true) {
3296
- const i = _tmp$4;
3297
- if (i < olength) {
3298
- const _tmp$5 = ((current + olength | 0) - i | 0) - 1 | 0;
3299
- $bound_check(result, _tmp$5);
3300
- result[_tmp$5] = (48 + moonbitlang$core$uint64$$UInt64$to_int(moonbitlang$core$builtin$$Mod$mod$2$(output, $10L)) | 0) & 255;
3301
- output = moonbitlang$core$builtin$$Div$div$2$(output, $10L);
3302
- index = index + 1 | 0;
3303
- _tmp$4 = i + 1 | 0;
3304
- continue;
3305
- } else break;
3306
- }
3307
- } else if ((exp + 1 | 0) >= olength) {
3308
- let _tmp = 0;
3309
- while (true) {
3310
- const i = _tmp;
3311
- if (i < olength) {
3312
- const _tmp$2$1 = ((index + olength | 0) - i | 0) - 1 | 0;
3313
- $bound_check(result, _tmp$2$1);
3314
- result[_tmp$2$1] = (48 + moonbitlang$core$uint64$$UInt64$to_int(moonbitlang$core$builtin$$Mod$mod$2$(output, $10L)) | 0) & 255;
3315
- output = moonbitlang$core$builtin$$Div$div$2$(output, $10L);
3316
- _tmp = i + 1 | 0;
3317
- continue;
3318
- } else break;
3319
- }
3320
- index = index + olength | 0;
3321
- const _end64 = exp + 1 | 0;
3322
- let _tmp$2 = olength;
3323
- while (true) {
3324
- const i = _tmp$2;
3325
- if (i < _end64) {
3326
- const _tmp$3 = index;
3327
- $bound_check(result, _tmp$3);
3328
- result[_tmp$3] = 48;
3329
- index = index + 1 | 0;
3330
- _tmp$2 = i + 1 | 0;
3331
- continue;
3332
- } else break;
3333
- }
3334
- } else {
3335
- let current = index + 1 | 0;
3336
- let _tmp = 0;
3337
- while (true) {
3338
- const i = _tmp;
3339
- if (i < olength) {
3340
- if (((olength - i | 0) - 1 | 0) === exp) {
3341
- const _tmp$2$1 = ((current + olength | 0) - i | 0) - 1 | 0;
3342
- $bound_check(result, _tmp$2$1);
3343
- result[_tmp$2$1] = 46;
3344
- current = current - 1 | 0;
3345
- }
3346
- const _tmp$2 = ((current + olength | 0) - i | 0) - 1 | 0;
3347
- $bound_check(result, _tmp$2);
3348
- result[_tmp$2] = (48 + moonbitlang$core$uint64$$UInt64$to_int(moonbitlang$core$builtin$$Mod$mod$2$(output, $10L)) | 0) & 255;
3349
- output = moonbitlang$core$builtin$$Div$div$2$(output, $10L);
3350
- _tmp = i + 1 | 0;
3351
- continue;
3352
- } else break;
3353
- }
3354
- index = index + (olength + 1 | 0) | 0;
3355
- }
3356
- return moonbitlang$core$double$internal$ryu$$string_from_bytes(result, 0, index);
3357
- }
3358
- }
3359
- function moonbitlang$core$double$internal$ryu$$d2d_small_int(ieeeMantissa, ieeeExponent) {
3360
- const m2 = moonbitlang$core$builtin$$BitOr$lor$2$(moonbitlang$core$builtin$$Shl$shl$2$($1L, 52), ieeeMantissa);
3361
- const e2 = (ieeeExponent - 1023 | 0) - 52 | 0;
3362
- if (e2 > 0) return;
3363
- if (e2 < -52) return;
3364
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$BitAnd$land$2$(m2, moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Shl$shl$2$($1L, -e2 | 0), $1L)), $0L)) return;
3365
- return {
3366
- mantissa: moonbitlang$core$builtin$$Shr$shr$2$(m2, -e2 | 0),
3367
- exponent: 0
3368
- };
3369
- }
3370
- function moonbitlang$core$double$internal$ryu$$ryu_to_string(val) {
3371
- if (val === 0) return "0";
3372
- const bits = moonbitlang$core$double$$Double$reinterpret_as_uint64(val);
3373
- const ieeeSign = moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$BitAnd$land$2$(moonbitlang$core$builtin$$Shr$shr$2$(bits, 63), $1L), $0L);
3374
- const ieeeMantissa = moonbitlang$core$builtin$$BitAnd$land$2$(bits, moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Shl$shl$2$($1L, 52), $1L));
3375
- const ieeeExponent = moonbitlang$core$uint64$$UInt64$to_int(moonbitlang$core$builtin$$BitAnd$land$2$(moonbitlang$core$builtin$$Shr$shr$2$(bits, 52), moonbitlang$core$builtin$$Sub$sub$2$(moonbitlang$core$builtin$$Shl$shl$2$($1L, 11), $1L)));
3376
- if (ieeeExponent === 2047 || ieeeExponent === 0 && moonbitlang$core$builtin$$Eq$equal$2$(ieeeMantissa, $0L)) return moonbitlang$core$double$internal$ryu$$copy_special_str(ieeeSign, ieeeExponent !== 0, moonbitlang$core$builtin$$op_notequal$2$(ieeeMantissa, $0L));
3377
- let v = moonbitlang$core$double$internal$ryu$$ryu_to_string$46$record$47$864;
3378
- const small = moonbitlang$core$double$internal$ryu$$d2d_small_int(ieeeMantissa, ieeeExponent);
3379
- if (small === void 0) v = moonbitlang$core$double$internal$ryu$$d2d(ieeeMantissa, ieeeExponent);
3380
- else {
3381
- let x = small;
3382
- while (true) {
3383
- const q = moonbitlang$core$builtin$$Div$div$2$(x.mantissa, $10L);
3384
- if (moonbitlang$core$builtin$$op_notequal$2$(moonbitlang$core$builtin$$Sub$sub$2$(x.mantissa, moonbitlang$core$builtin$$Mul$mul$2$($10L, q)), $0L)) break;
3385
- x = {
3386
- mantissa: q,
3387
- exponent: x.exponent + 1 | 0
3388
- };
3389
- continue;
3390
- }
3391
- v = x;
3392
- }
3393
- return moonbitlang$core$double$internal$ryu$$to_chars(v, ieeeSign);
3394
- }
3395
- function moonbitlang$core$double$$Double$to_string(self) {
3396
- return moonbitlang$core$double$internal$ryu$$ryu_to_string(self);
2228
+ function moonbitlang$core$array$$Array$from_iter$15$(iter) {
2229
+ return moonbitlang$core$builtin$$Iter$collect$15$(iter);
3397
2230
  }
3398
2231
  function moonbitlang$core$strconv$$range_err$7$() {
3399
2232
  return new Result$Err$3$(new Error$moonbitlang$47$core$47$strconv$46$StrConvError$46$StrConvError(moonbitlang$core$strconv$$range_err_str));
3400
2233
  }
3401
- function moonbitlang$core$strconv$$syntax_err$33$() {
2234
+ function moonbitlang$core$strconv$$syntax_err$29$() {
3402
2235
  return new Result$Err$4$(new Error$moonbitlang$47$core$47$strconv$46$StrConvError$46$StrConvError(moonbitlang$core$strconv$$syntax_err_str));
3403
2236
  }
3404
- function moonbitlang$core$strconv$$syntax_err$34$() {
2237
+ function moonbitlang$core$strconv$$syntax_err$30$() {
3405
2238
  return new Result$Err$5$(new Error$moonbitlang$47$core$47$strconv$46$StrConvError$46$StrConvError(moonbitlang$core$strconv$$syntax_err_str));
3406
2239
  }
3407
2240
  function moonbitlang$core$strconv$$syntax_err$6$() {
3408
2241
  return new Result$Err$6$(new Error$moonbitlang$47$core$47$strconv$46$StrConvError$46$StrConvError(moonbitlang$core$strconv$$syntax_err_str));
3409
2242
  }
3410
- function moonbitlang$core$strconv$$syntax_err$35$() {
2243
+ function moonbitlang$core$strconv$$syntax_err$31$() {
3411
2244
  return new Result$Err$7$(new Error$moonbitlang$47$core$47$strconv$46$StrConvError$46$StrConvError(moonbitlang$core$strconv$$syntax_err_str));
3412
2245
  }
3413
2246
  function moonbitlang$core$strconv$$check_underscore(str) {
@@ -3933,8 +2766,8 @@ function moonbitlang$core$strconv$$parse_decimal_from_view(str) {
3933
2766
  if (moonbitlang$core$string$$String$char_length_eq$46$inner(rest$3.str, 0, rest$3.start, rest$3.end)) {
3934
2767
  moonbitlang$core$strconv$$Decimal$trim(d);
3935
2768
  return new Result$Ok$7$(d);
3936
- } else return moonbitlang$core$strconv$$syntax_err$35$();
3937
- } else return moonbitlang$core$strconv$$syntax_err$35$();
2769
+ } else return moonbitlang$core$strconv$$syntax_err$31$();
2770
+ } else return moonbitlang$core$strconv$$syntax_err$31$();
3938
2771
  }
3939
2772
  function moonbitlang$core$strconv$$parse_decimal_priv(str) {
3940
2773
  return moonbitlang$core$strconv$$parse_decimal_from_view(str);
@@ -4403,9 +3236,9 @@ function moonbitlang$core$strconv$$parse_inf_nan(rest) {
4403
3236
  else break _L$4;
4404
3237
  return _pos ? new Result$Ok$4$(moonbitlang$core$double$$infinity) : new Result$Ok$4$(moonbitlang$core$double$$neg_infinity);
4405
3238
  }
4406
- return moonbitlang$core$strconv$$syntax_err$33$();
3239
+ return moonbitlang$core$strconv$$syntax_err$29$();
4407
3240
  }
4408
- return moonbitlang$core$strconv$$syntax_err$33$();
3241
+ return moonbitlang$core$strconv$$syntax_err$29$();
4409
3242
  }
4410
3243
  function $moonbitlang$core$strconv$$moonbitlang$core$string$$StringView$fold_digits$2$(self, init, f) {
4411
3244
  let ret = init;
@@ -4439,7 +3272,7 @@ function $moonbitlang$core$strconv$$moonbitlang$core$string$$StringView$fold_dig
4439
3272
  _2: len
4440
3273
  };
4441
3274
  }
4442
- function $moonbitlang$core$strconv$$moonbitlang$core$string$$StringView$fold_digits$20$(self, init, f) {
3275
+ function $moonbitlang$core$strconv$$moonbitlang$core$string$$StringView$fold_digits$17$(self, init, f) {
4443
3276
  let ret = init;
4444
3277
  let len = 0;
4445
3278
  let str = self;
@@ -4525,12 +3358,12 @@ function moonbitlang$core$strconv$$parse_scientific(s) {
4525
3358
  if (moonbitlang$core$string$$String$char_length_ge$46$inner(_bind.str, 1, _bind.start, _bind.end)) {
4526
3359
  const _x = moonbitlang$core$string$$String$unsafe_char_at(_bind.str, moonbitlang$core$string$$String$offset_of_nth_char$46$inner(_bind.str, 0, _bind.start, _bind.end));
4527
3360
  if (_x >= 48 && _x <= 57) {
4528
- const _bind$2 = $moonbitlang$core$strconv$$moonbitlang$core$string$$StringView$fold_digits$20$(s$2, moonbitlang$core$strconv$$parse_scientific$46$exp_num$124$306, (digit, exp_num) => moonbitlang$core$builtin$$Compare$op_lt$19$(exp_num, $65536L) ? moonbitlang$core$builtin$$Add$add$20$(moonbitlang$core$builtin$$Mul$mul$20$($10L, exp_num), moonbitlang$core$int$$Int$to_int64(digit)) : exp_num);
3361
+ const _bind$2 = $moonbitlang$core$strconv$$moonbitlang$core$string$$StringView$fold_digits$17$(s$2, moonbitlang$core$strconv$$parse_scientific$46$exp_num$124$306, (digit, exp_num) => moonbitlang$core$builtin$$Compare$op_lt$16$(exp_num, $65536L) ? moonbitlang$core$builtin$$Add$add$17$(moonbitlang$core$builtin$$Mul$mul$17$($10L, exp_num), moonbitlang$core$int$$Int$to_int64(digit)) : exp_num);
4529
3362
  const _s = _bind$2._0;
4530
3363
  const _exp_num = _bind$2._1;
4531
3364
  return neg_exp ? {
4532
3365
  _0: _s,
4533
- _1: moonbitlang$core$builtin$$Neg$neg$20$(_exp_num)
3366
+ _1: moonbitlang$core$builtin$$Neg$neg$17$(_exp_num)
4534
3367
  } : {
4535
3368
  _0: _s,
4536
3369
  _1: _exp_num
@@ -4677,7 +3510,7 @@ function moonbitlang$core$strconv$$parse_number(s) {
4677
3510
  s$2 = _new_s;
4678
3511
  mantissa = _new_mantissa;
4679
3512
  n_after_dot = _consumed_digit;
4680
- exponent = moonbitlang$core$builtin$$Neg$neg$20$(moonbitlang$core$int$$Int$to_int64(n_after_dot));
3513
+ exponent = moonbitlang$core$builtin$$Neg$neg$17$(moonbitlang$core$int$$Int$to_int64(n_after_dot));
4681
3514
  }
4682
3515
  }
4683
3516
  n_digits = n_digits + n_after_dot | 0;
@@ -4723,7 +3556,7 @@ function moonbitlang$core$strconv$$parse_number(s) {
4723
3556
  const _new_s = _bind$5._0;
4724
3557
  const _exp_number = _bind$5._1;
4725
3558
  s$2 = _new_s;
4726
- exponent = moonbitlang$core$builtin$$Add$add$20$(exponent, _exp_number);
3559
+ exponent = moonbitlang$core$builtin$$Add$add$17$(exponent, _exp_number);
4727
3560
  }
4728
3561
  const _bind$4 = s$2;
4729
3562
  if (moonbitlang$core$string$$String$char_length_eq$46$inner(_bind$4.str, 0, _bind$4.start, _bind$4.end)) {
@@ -4810,7 +3643,7 @@ function moonbitlang$core$strconv$$parse_number(s) {
4810
3643
  _tmp$4 = _consumed_digit$2;
4811
3644
  } else return new Result$Ok$5$(void 0);
4812
3645
  exponent = moonbitlang$core$int$$Int$to_int64(_tmp$4);
4813
- exponent = moonbitlang$core$builtin$$Add$add$20$(exponent, moonbitlang$core$strconv$$parse_number$46$exp_number$124$287);
3646
+ exponent = moonbitlang$core$builtin$$Add$add$17$(exponent, moonbitlang$core$strconv$$parse_number$46$exp_number$124$287);
4814
3647
  }
4815
3648
  return new Result$Ok$5$({
4816
3649
  exponent,
@@ -4818,14 +3651,14 @@ function moonbitlang$core$strconv$$parse_number(s) {
4818
3651
  negative: _negative,
4819
3652
  many_digits
4820
3653
  });
4821
- } else return moonbitlang$core$strconv$$syntax_err$34$();
3654
+ } else return moonbitlang$core$strconv$$syntax_err$30$();
4822
3655
  }
4823
3656
  function moonbitlang$core$strconv$$assemble_bits(mantissa, exponent, negative) {
4824
3657
  const biased_exp = exponent - moonbitlang$core$strconv$$double_info.bias | 0;
4825
- let bits = moonbitlang$core$builtin$$BitAnd$land$20$(mantissa, moonbitlang$core$builtin$$Sub$sub$20$(moonbitlang$core$builtin$$Shl$shl$20$($1L, moonbitlang$core$strconv$$double_info.mantissa_bits), $1L));
3658
+ let bits = moonbitlang$core$builtin$$BitAnd$land$17$(mantissa, moonbitlang$core$builtin$$Sub$sub$17$(moonbitlang$core$builtin$$Shl$shl$17$($1L, moonbitlang$core$strconv$$double_info.mantissa_bits), $1L));
4826
3659
  const exp_bits = moonbitlang$core$int$$Int$to_int64(biased_exp & ((1 << moonbitlang$core$strconv$$double_info.exponent_bits) - 1 | 0));
4827
- bits = moonbitlang$core$builtin$$BitOr$lor$20$(bits, moonbitlang$core$builtin$$Shl$shl$20$(exp_bits, moonbitlang$core$strconv$$double_info.mantissa_bits));
4828
- if (negative) bits = moonbitlang$core$builtin$$BitOr$lor$20$(bits, moonbitlang$core$builtin$$Shl$shl$20$(moonbitlang$core$builtin$$Shl$shl$20$($1L, moonbitlang$core$strconv$$double_info.mantissa_bits), moonbitlang$core$strconv$$double_info.exponent_bits));
3660
+ bits = moonbitlang$core$builtin$$BitOr$lor$17$(bits, moonbitlang$core$builtin$$Shl$shl$17$(exp_bits, moonbitlang$core$strconv$$double_info.mantissa_bits));
3661
+ if (negative) bits = moonbitlang$core$builtin$$BitOr$lor$17$(bits, moonbitlang$core$builtin$$Shl$shl$17$(moonbitlang$core$builtin$$Shl$shl$17$($1L, moonbitlang$core$strconv$$double_info.mantissa_bits), moonbitlang$core$strconv$$double_info.exponent_bits));
4829
3662
  return bits;
4830
3663
  }
4831
3664
  function moonbitlang$core$strconv$$Decimal$should_round_up(self, d) {
@@ -4855,20 +3688,20 @@ function moonbitlang$core$strconv$$Decimal$rounded_integer(self) {
4855
3688
  let n = $0L;
4856
3689
  let i = 0;
4857
3690
  while (true) if (i < self.decimal_point && i < self.digits_num) {
4858
- const _tmp = moonbitlang$core$builtin$$Mul$mul$20$(n, $10L);
3691
+ const _tmp = moonbitlang$core$builtin$$Mul$mul$17$(n, $10L);
4859
3692
  const _tmp$2 = self.digits;
4860
3693
  const _tmp$3 = i;
4861
3694
  $bound_check(_tmp$2, _tmp$3);
4862
- n = moonbitlang$core$builtin$$Add$add$20$(_tmp, moonbitlang$core$byte$$Byte$to_int64(_tmp$2[_tmp$3]));
3695
+ n = moonbitlang$core$builtin$$Add$add$17$(_tmp, moonbitlang$core$byte$$Byte$to_int64(_tmp$2[_tmp$3]));
4863
3696
  i = i + 1 | 0;
4864
3697
  continue;
4865
3698
  } else break;
4866
3699
  while (true) if (i < self.decimal_point) {
4867
- n = moonbitlang$core$builtin$$Mul$mul$20$(n, $10L);
3700
+ n = moonbitlang$core$builtin$$Mul$mul$17$(n, $10L);
4868
3701
  i = i + 1 | 0;
4869
3702
  continue;
4870
3703
  } else break;
4871
- if (moonbitlang$core$strconv$$Decimal$should_round_up(self, self.decimal_point)) n = moonbitlang$core$builtin$$Add$add$20$(n, $1L);
3704
+ if (moonbitlang$core$strconv$$Decimal$should_round_up(self, self.decimal_point)) n = moonbitlang$core$builtin$$Add$add$17$(n, $1L);
4872
3705
  return n;
4873
3706
  }
4874
3707
  function moonbitlang$core$strconv$$Decimal$new_digits(self, s) {
@@ -4912,9 +3745,9 @@ function moonbitlang$core$strconv$$Decimal$left_shift(self, s) {
4912
3745
  const _tmp$2 = read_index;
4913
3746
  $bound_check(_tmp, _tmp$2);
4914
3747
  const d = moonbitlang$core$byte$$Byte$to_int64(_tmp[_tmp$2]);
4915
- acc = moonbitlang$core$builtin$$Add$add$20$(acc, moonbitlang$core$builtin$$Shl$shl$20$(d, s));
4916
- const quo = moonbitlang$core$builtin$$Div$div$20$(acc, $10L);
4917
- const rem = moonbitlang$core$int64$$Int64$to_int(moonbitlang$core$builtin$$Sub$sub$20$(acc, moonbitlang$core$builtin$$Mul$mul$20$(quo, $10L)));
3748
+ acc = moonbitlang$core$builtin$$Add$add$17$(acc, moonbitlang$core$builtin$$Shl$shl$17$(d, s));
3749
+ const quo = moonbitlang$core$builtin$$Div$div$17$(acc, $10L);
3750
+ const rem = moonbitlang$core$int64$$Int64$to_int(moonbitlang$core$builtin$$Sub$sub$17$(acc, moonbitlang$core$builtin$$Mul$mul$17$(quo, $10L)));
4918
3751
  write_index = write_index - 1 | 0;
4919
3752
  if (write_index < self.digits.length) {
4920
3753
  const _tmp$3 = self.digits;
@@ -4926,9 +3759,9 @@ function moonbitlang$core$strconv$$Decimal$left_shift(self, s) {
4926
3759
  read_index = read_index - 1 | 0;
4927
3760
  continue;
4928
3761
  } else break;
4929
- while (true) if (moonbitlang$core$builtin$$Compare$op_gt$19$(acc, $0L)) {
4930
- const quo = moonbitlang$core$builtin$$Div$div$20$(acc, $10L);
4931
- const rem = moonbitlang$core$int64$$Int64$to_int(moonbitlang$core$builtin$$Sub$sub$20$(acc, moonbitlang$core$builtin$$Mul$mul$20$($10L, quo)));
3762
+ while (true) if (moonbitlang$core$builtin$$Compare$op_gt$16$(acc, $0L)) {
3763
+ const quo = moonbitlang$core$builtin$$Div$div$17$(acc, $10L);
3764
+ const rem = moonbitlang$core$int64$$Int64$to_int(moonbitlang$core$builtin$$Sub$sub$17$(acc, moonbitlang$core$builtin$$Mul$mul$17$($10L, quo)));
4932
3765
  write_index = write_index - 1 | 0;
4933
3766
  if (write_index < self.digits.length) {
4934
3767
  const _tmp = self.digits;
@@ -5083,8 +3916,8 @@ function moonbitlang$core$strconv$$Decimal$to_double_priv(self) {
5083
3916
  }
5084
3917
  moonbitlang$core$strconv$$Decimal$shift_priv(self, moonbitlang$core$strconv$$double_info.mantissa_bits + 1 | 0);
5085
3918
  mantissa = moonbitlang$core$strconv$$Decimal$rounded_integer(self);
5086
- if (moonbitlang$core$builtin$$Eq$equal$20$(mantissa, moonbitlang$core$builtin$$Shl$shl$20$($2L, moonbitlang$core$strconv$$double_info.mantissa_bits))) {
5087
- mantissa = moonbitlang$core$builtin$$Shr$shr$20$(mantissa, 1);
3919
+ if (moonbitlang$core$builtin$$Eq$equal$17$(mantissa, moonbitlang$core$builtin$$Shl$shl$17$($2L, moonbitlang$core$strconv$$double_info.mantissa_bits))) {
3920
+ mantissa = moonbitlang$core$builtin$$Shr$shr$17$(mantissa, 1);
5088
3921
  exponent = exponent + 1 | 0;
5089
3922
  if ((exponent - moonbitlang$core$strconv$$double_info.bias | 0) >= ((1 << moonbitlang$core$strconv$$double_info.exponent_bits) - 1 | 0)) {
5090
3923
  const _bind = moonbitlang$core$strconv$$range_err$7$();
@@ -5092,11 +3925,11 @@ function moonbitlang$core$strconv$$Decimal$to_double_priv(self) {
5092
3925
  else return _bind;
5093
3926
  }
5094
3927
  }
5095
- if (moonbitlang$core$builtin$$Eq$equal$20$(moonbitlang$core$builtin$$BitAnd$land$20$(mantissa, moonbitlang$core$builtin$$Shl$shl$20$($1L, moonbitlang$core$strconv$$double_info.mantissa_bits)), $0L)) exponent = moonbitlang$core$strconv$$double_info.bias;
3928
+ if (moonbitlang$core$builtin$$Eq$equal$17$(moonbitlang$core$builtin$$BitAnd$land$17$(mantissa, moonbitlang$core$builtin$$Shl$shl$17$($1L, moonbitlang$core$strconv$$double_info.mantissa_bits)), $0L)) exponent = moonbitlang$core$strconv$$double_info.bias;
5096
3929
  return new Result$Ok$4$(moonbitlang$core$int64$$Int64$reinterpret_as_double(moonbitlang$core$strconv$$assemble_bits(mantissa, exponent, self.negative)));
5097
3930
  }
5098
3931
  function moonbitlang$core$strconv$$checked_mul(a, b) {
5099
- if (moonbitlang$core$builtin$$Eq$equal$2$(a, $0L) || moonbitlang$core$builtin$$Eq$equal$2$(b, $0L)) return moonbitlang$core$strconv$$checked_mul$46$constr$47$1337;
3932
+ if (moonbitlang$core$builtin$$Eq$equal$2$(a, $0L) || moonbitlang$core$builtin$$Eq$equal$2$(b, $0L)) return moonbitlang$core$strconv$$checked_mul$46$constr$47$1066;
5100
3933
  if (moonbitlang$core$builtin$$Eq$equal$2$(a, $1L)) return b;
5101
3934
  if (moonbitlang$core$builtin$$Eq$equal$2$(b, $1L)) return a;
5102
3935
  if (moonbitlang$core$uint64$$UInt64$clz(b) === 0 || moonbitlang$core$uint64$$UInt64$clz(a) === 0) return;
@@ -5109,16 +3942,16 @@ function moonbitlang$core$strconv$$pow10_fast_path(exponent) {
5109
3942
  return moonbitlang$core$strconv$$table[_p];
5110
3943
  }
5111
3944
  function moonbitlang$core$strconv$$Number$is_fast_path(self) {
5112
- return moonbitlang$core$builtin$$Compare$op_le$19$(moonbitlang$core$strconv$$min_exponent_fast_path, self.exponent) && moonbitlang$core$builtin$$Compare$op_le$19$(self.exponent, moonbitlang$core$strconv$$max_exponent_disguised_fast_path) && moonbitlang$core$builtin$$Compare$op_le$18$(self.mantissa, moonbitlang$core$strconv$$max_mantissa_fast_path) && !self.many_digits;
3945
+ return moonbitlang$core$builtin$$Compare$op_le$16$(moonbitlang$core$strconv$$min_exponent_fast_path, self.exponent) && moonbitlang$core$builtin$$Compare$op_le$16$(self.exponent, moonbitlang$core$strconv$$max_exponent_disguised_fast_path) && moonbitlang$core$builtin$$Compare$op_le$18$(self.mantissa, moonbitlang$core$strconv$$max_mantissa_fast_path) && !self.many_digits;
5113
3946
  }
5114
3947
  function moonbitlang$core$strconv$$Number$try_fast_path(self) {
5115
3948
  if (moonbitlang$core$strconv$$Number$is_fast_path(self)) {
5116
3949
  let value;
5117
- if (moonbitlang$core$builtin$$Compare$op_le$19$(self.exponent, moonbitlang$core$strconv$$max_exponent_fast_path)) {
3950
+ if (moonbitlang$core$builtin$$Compare$op_le$16$(self.exponent, moonbitlang$core$strconv$$max_exponent_fast_path)) {
5118
3951
  const value$2 = moonbitlang$core$double$$Double$convert_uint64(self.mantissa);
5119
- value = moonbitlang$core$builtin$$Compare$op_lt$19$(self.exponent, $0L) ? value$2 / moonbitlang$core$strconv$$pow10_fast_path(-moonbitlang$core$int64$$Int64$to_int(self.exponent) | 0) : value$2 * moonbitlang$core$strconv$$pow10_fast_path(moonbitlang$core$int64$$Int64$to_int(self.exponent));
3952
+ value = moonbitlang$core$builtin$$Compare$op_lt$16$(self.exponent, $0L) ? value$2 / moonbitlang$core$strconv$$pow10_fast_path(-moonbitlang$core$int64$$Int64$to_int(self.exponent) | 0) : value$2 * moonbitlang$core$strconv$$pow10_fast_path(moonbitlang$core$int64$$Int64$to_int(self.exponent));
5120
3953
  } else {
5121
- const shift = moonbitlang$core$builtin$$Sub$sub$20$(self.exponent, moonbitlang$core$strconv$$max_exponent_fast_path);
3954
+ const shift = moonbitlang$core$builtin$$Sub$sub$17$(self.exponent, moonbitlang$core$strconv$$max_exponent_fast_path);
5122
3955
  const _tmp = self.mantissa;
5123
3956
  const _p = moonbitlang$core$int64$$Int64$to_int(shift);
5124
3957
  $bound_check(moonbitlang$core$strconv$$int_pow10, _p);
@@ -5153,8 +3986,8 @@ function moonbitlang$core$strconv$$parse_double(str) {
5153
3986
  return moonbitlang$core$strconv$$Decimal$to_double_priv(_tmp);
5154
3987
  }
5155
3988
  }
5156
- } else return moonbitlang$core$strconv$$syntax_err$33$();
5157
- else return moonbitlang$core$strconv$$syntax_err$33$();
3989
+ } else return moonbitlang$core$strconv$$syntax_err$29$();
3990
+ else return moonbitlang$core$strconv$$syntax_err$29$();
5158
3991
  }
5159
3992
  function f4ah6o$encoding_sjis$$decode_jis_x_0208(code) {
5160
3993
  switch (code) {
@@ -12055,7 +10888,7 @@ function f4ah6o$encoding_sjis$$Decoder$decode_to_string(self, src, last) {
12055
10888
  const len = src.length;
12056
10889
  if (self.pending_first_byte !== 0) if (len === 0) {
12057
10890
  if (last) {
12058
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10891
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12059
10892
  self.had_replacements = true;
12060
10893
  self.pending_first_byte = 0;
12061
10894
  }
@@ -12066,12 +10899,12 @@ function f4ah6o$encoding_sjis$$Decoder$decode_to_string(self, src, last) {
12066
10899
  if (b2 >= 64 && b2 <= 252 && b2 !== 127) {
12067
10900
  const _bind = f4ah6o$encoding_sjis$$decode_jis_x_0208(b1 << 8 | b2);
12068
10901
  if (_bind === -1) {
12069
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10902
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12070
10903
  self.had_replacements = true;
12071
- } else result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(_bind)}`;
10904
+ } else result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(_bind)}`;
12072
10905
  i = 1;
12073
10906
  } else {
12074
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10907
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12075
10908
  self.had_replacements = true;
12076
10909
  i = 0;
12077
10910
  }
@@ -12082,11 +10915,11 @@ function f4ah6o$encoding_sjis$$Decoder$decode_to_string(self, src, last) {
12082
10915
  $bound_check(src, _tmp);
12083
10916
  const b1 = src[_tmp];
12084
10917
  if (b1 < 128) {
12085
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(b1)}`;
10918
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(b1)}`;
12086
10919
  i = i + 1 | 0;
12087
10920
  } else if (b1 >= 161 && b1 <= 223) {
12088
10921
  const ch = 65377 + (b1 - 161 | 0) | 0;
12089
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(ch)}`;
10922
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(ch)}`;
12090
10923
  i = i + 1 | 0;
12091
10924
  } else if (b1 >= 129 && b1 <= 159 || b1 >= 224 && b1 <= 239) if ((i + 1 | 0) < len) {
12092
10925
  const _tmp$2 = i + 1 | 0;
@@ -12095,17 +10928,17 @@ function f4ah6o$encoding_sjis$$Decoder$decode_to_string(self, src, last) {
12095
10928
  if (b2 >= 64 && b2 <= 252 && b2 !== 127) {
12096
10929
  const _bind = f4ah6o$encoding_sjis$$decode_jis_x_0208(b1 << 8 | b2);
12097
10930
  if (_bind === -1) {
12098
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10931
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12099
10932
  self.had_replacements = true;
12100
- } else result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(_bind)}`;
10933
+ } else result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(_bind)}`;
12101
10934
  i = i + 2 | 0;
12102
10935
  } else {
12103
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10936
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12104
10937
  self.had_replacements = true;
12105
10938
  i = i + 1 | 0;
12106
10939
  }
12107
10940
  } else if (last) {
12108
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10941
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12109
10942
  self.had_replacements = true;
12110
10943
  i = i + 1 | 0;
12111
10944
  } else {
@@ -12113,7 +10946,7 @@ function f4ah6o$encoding_sjis$$Decoder$decode_to_string(self, src, last) {
12113
10946
  i = i + 1 | 0;
12114
10947
  }
12115
10948
  else {
12116
- result = `${result}${moonbitlang$core$builtin$$Show$to_string$16$(65533)}`;
10949
+ result = `${result}${moonbitlang$core$builtin$$Show$to_string$15$(65533)}`;
12117
10950
  self.had_replacements = true;
12118
10951
  i = i + 1 | 0;
12119
10952
  }
@@ -12132,12 +10965,12 @@ function f4ah6o$encoding_sjis$$shift_jis_to_utf8(data) {
12132
10965
  return f4ah6o$encoding_sjis$$decode(data)._0;
12133
10966
  }
12134
10967
  function f4ah6o$jww_parser$core$$LayerGroup$default() {
12135
- const layers = moonbitlang$core$array$$Array$new$46$inner$14$(0);
10968
+ const layers = moonbitlang$core$array$$Array$new$46$inner$13$(0);
12136
10969
  let _tmp = 0;
12137
10970
  while (true) {
12138
10971
  const _ = _tmp;
12139
10972
  if (_ < 16) {
12140
- moonbitlang$core$array$$Array$push$14$(layers, f4ah6o$jww_parser$core$$default$46$record$47$1387);
10973
+ moonbitlang$core$array$$Array$push$13$(layers, f4ah6o$jww_parser$core$$default$46$record$47$1116);
12141
10974
  _tmp = _ + 1 | 0;
12142
10975
  continue;
12143
10976
  } else break;
@@ -12152,12 +10985,12 @@ function f4ah6o$jww_parser$core$$LayerGroup$default() {
12152
10985
  };
12153
10986
  }
12154
10987
  function f4ah6o$jww_parser$core$$Document$default() {
12155
- const layer_groups = moonbitlang$core$array$$Array$new$46$inner$12$(0);
10988
+ const layer_groups = moonbitlang$core$array$$Array$new$46$inner$11$(0);
12156
10989
  let _tmp = 0;
12157
10990
  while (true) {
12158
10991
  const _ = _tmp;
12159
10992
  if (_ < 16) {
12160
- moonbitlang$core$array$$Array$push$12$(layer_groups, f4ah6o$jww_parser$core$$LayerGroup$default());
10993
+ moonbitlang$core$array$$Array$push$11$(layer_groups, f4ah6o$jww_parser$core$$LayerGroup$default());
12161
10994
  _tmp = _ + 1 | 0;
12162
10995
  continue;
12163
10996
  } else break;
@@ -12168,25 +11001,14 @@ function f4ah6o$jww_parser$core$$Document$default() {
12168
11001
  paper_size: 0,
12169
11002
  write_layer_group: 0,
12170
11003
  layer_groups,
12171
- entities: moonbitlang$core$array$$Array$new$46$inner$23$(0),
12172
- block_defs: moonbitlang$core$array$$Array$new$46$inner$24$(0),
12173
- embedded_images: moonbitlang$core$array$$Array$new$46$inner$25$(0),
12174
- print_settings: f4ah6o$jww_parser$core$$default$46$record$47$1393,
12175
- sunpou_settings: f4ah6o$jww_parser$core$$default$46$record$47$1392,
12176
- metadata_settings: f4ah6o$jww_parser$core$$default$46$record$47$1391
11004
+ entities: moonbitlang$core$array$$Array$new$46$inner$22$(0),
11005
+ block_defs: moonbitlang$core$array$$Array$new$46$inner$23$(0),
11006
+ embedded_images: moonbitlang$core$array$$Array$new$46$inner$24$(0),
11007
+ print_settings: f4ah6o$jww_parser$core$$default$46$record$47$1122,
11008
+ sunpou_settings: f4ah6o$jww_parser$core$$default$46$record$47$1121,
11009
+ metadata_settings: f4ah6o$jww_parser$core$$default$46$record$47$1120
12177
11010
  };
12178
11011
  }
12179
- function f4ah6o$jww_parser$core$$Entity$base(self) {
12180
- switch (self.$tag) {
12181
- case 0: return self._0.base;
12182
- case 1: return self._0.base;
12183
- case 2: return self._0.base;
12184
- case 3: return self._0.base;
12185
- case 4: return self._0.base;
12186
- case 5: return self._0.base;
12187
- default: return self._0.base;
12188
- }
12189
- }
12190
11012
  function f4ah6o$jww_parser$core$$Reader$new(data) {
12191
11013
  return {
12192
11014
  data: moonbitlang$core$bytes$$Bytes$to_array(data),
@@ -12269,53 +11091,53 @@ function f4ah6o$jww_parser$core$$read_cstring(reader) {
12269
11091
  return f4ah6o$encoding_sjis$$shift_jis_to_utf8(f4ah6o$jww_parser$core$$Reader$read_bytes(reader, (reader.data.length - reader.pos | 0) < length ? reader.data.length - reader.pos | 0 : length));
12270
11092
  }
12271
11093
  function f4ah6o$jww_parser$core$$parse_layer_names(reader, layer_groups) {
12272
- const layer_names = moonbitlang$core$array$$Array$new$46$inner$15$(0);
11094
+ const layer_names = moonbitlang$core$array$$Array$new$46$inner$14$(0);
12273
11095
  let _tmp = 0;
12274
11096
  while (true) {
12275
11097
  const _g_idx = _tmp;
12276
11098
  if (_g_idx < 16) {
12277
- const group_layer_names = moonbitlang$core$array$$Array$new$46$inner$13$(0);
11099
+ const group_layer_names = moonbitlang$core$array$$Array$new$46$inner$12$(0);
12278
11100
  let _tmp$2$1 = 0;
12279
11101
  while (true) {
12280
11102
  const _l_idx = _tmp$2$1;
12281
11103
  if (_l_idx < 16) {
12282
- moonbitlang$core$array$$Array$push$13$(group_layer_names, f4ah6o$jww_parser$core$$read_cstring(reader));
11104
+ moonbitlang$core$array$$Array$push$12$(group_layer_names, f4ah6o$jww_parser$core$$read_cstring(reader));
12283
11105
  _tmp$2$1 = _l_idx + 1 | 0;
12284
11106
  continue;
12285
11107
  } else break;
12286
11108
  }
12287
- moonbitlang$core$array$$Array$push$15$(layer_names, group_layer_names);
11109
+ moonbitlang$core$array$$Array$push$14$(layer_names, group_layer_names);
12288
11110
  _tmp = _g_idx + 1 | 0;
12289
11111
  continue;
12290
11112
  } else break;
12291
11113
  }
12292
- const group_names = moonbitlang$core$array$$Array$new$46$inner$13$(0);
11114
+ const group_names = moonbitlang$core$array$$Array$new$46$inner$12$(0);
12293
11115
  let _tmp$2 = 0;
12294
11116
  while (true) {
12295
11117
  const _g_idx = _tmp$2;
12296
11118
  if (_g_idx < 16) {
12297
- moonbitlang$core$array$$Array$push$13$(group_names, f4ah6o$jww_parser$core$$read_cstring(reader));
11119
+ moonbitlang$core$array$$Array$push$12$(group_names, f4ah6o$jww_parser$core$$read_cstring(reader));
12298
11120
  _tmp$2 = _g_idx + 1 | 0;
12299
11121
  continue;
12300
11122
  } else break;
12301
11123
  }
12302
- const result = moonbitlang$core$array$$Array$new$46$inner$12$(0);
11124
+ const result = moonbitlang$core$array$$Array$new$46$inner$11$(0);
12303
11125
  const _end375 = layer_groups.length;
12304
11126
  let _tmp$3 = 0;
12305
11127
  while (true) {
12306
11128
  const g_idx = _tmp$3;
12307
11129
  if (g_idx < _end375) {
12308
- const lg = moonbitlang$core$array$$Array$at$12$(layer_groups, g_idx);
12309
- const group_name = moonbitlang$core$array$$Array$at$13$(group_names, g_idx);
12310
- const layers = moonbitlang$core$array$$Array$new$46$inner$14$(0);
11130
+ const lg = moonbitlang$core$array$$Array$at$11$(layer_groups, g_idx);
11131
+ const group_name = moonbitlang$core$array$$Array$at$12$(group_names, g_idx);
11132
+ const layers = moonbitlang$core$array$$Array$new$46$inner$13$(0);
12311
11133
  const _end383 = lg.layers.length;
12312
11134
  let _tmp$4 = 0;
12313
11135
  while (true) {
12314
11136
  const l_idx = _tmp$4;
12315
11137
  if (l_idx < _end383) {
12316
- const l = moonbitlang$core$array$$Array$at$14$(lg.layers, l_idx);
12317
- const layer_name = moonbitlang$core$array$$Array$at$13$(moonbitlang$core$array$$Array$at$15$(layer_names, g_idx), l_idx);
12318
- moonbitlang$core$array$$Array$push$14$(layers, {
11138
+ const l = moonbitlang$core$array$$Array$at$13$(lg.layers, l_idx);
11139
+ const layer_name = moonbitlang$core$array$$Array$at$12$(moonbitlang$core$array$$Array$at$14$(layer_names, g_idx), l_idx);
11140
+ moonbitlang$core$array$$Array$push$13$(layers, {
12319
11141
  state: l.state,
12320
11142
  protect: l.protect,
12321
11143
  name: layer_name
@@ -12324,7 +11146,7 @@ function f4ah6o$jww_parser$core$$parse_layer_names(reader, layer_groups) {
12324
11146
  continue;
12325
11147
  } else break;
12326
11148
  }
12327
- moonbitlang$core$array$$Array$push$12$(result, {
11149
+ moonbitlang$core$array$$Array$push$11$(result, {
12328
11150
  state: lg.state,
12329
11151
  write_layer: lg.write_layer,
12330
11152
  scale: lg.scale,
@@ -12405,7 +11227,7 @@ function f4ah6o$jww_parser$core$$find_bm_marker(content) {
12405
11227
  if (len < 4) return;
12406
11228
  let i = 0;
12407
11229
  while (true) if (i < (len - 3 | 0)) {
12408
- if (moonbitlang$core$array$$Array$at$16$(chars, i) === 94 && moonbitlang$core$array$$Array$at$16$(chars, i + 1 | 0) === 64 && moonbitlang$core$array$$Array$at$16$(chars, i + 2 | 0) === 66 && moonbitlang$core$array$$Array$at$16$(chars, i + 3 | 0) === 77) return i;
11230
+ if (moonbitlang$core$array$$Array$at$15$(chars, i) === 94 && moonbitlang$core$array$$Array$at$15$(chars, i + 1 | 0) === 64 && moonbitlang$core$array$$Array$at$15$(chars, i + 2 | 0) === 66 && moonbitlang$core$array$$Array$at$15$(chars, i + 3 | 0) === 77) return i;
12409
11231
  i = i + 1 | 0;
12410
11232
  continue;
12411
11233
  } else break;
@@ -12431,7 +11253,7 @@ function f4ah6o$jww_parser$core$$normalize_image_path(raw_path) {
12431
11253
  str: f4ah6o$jww_parser$core$$normalize_image_path$46$42$bind$124$945,
12432
11254
  start: 0,
12433
11255
  end: 6
12434
- }) && all_chars.length > 6 ? moonbitlang$core$array$$Array$from_iter$16$(moonbitlang$core$array$$ArrayView$iter$16$(moonbitlang$core$array$$Array$sub$46$inner$16$(all_chars, 6, void 0))) : all_chars;
11256
+ }) && all_chars.length > 6 ? moonbitlang$core$array$$Array$from_iter$15$(moonbitlang$core$array$$ArrayView$iter$15$(moonbitlang$core$array$$Array$sub$46$inner$15$(all_chars, 6, void 0))) : all_chars;
12435
11257
  let normalized = "";
12436
11258
  let prev_was_letter = false;
12437
11259
  const _len = chars.length;
@@ -12444,7 +11266,7 @@ function f4ah6o$jww_parser$core$$normalize_image_path(raw_path) {
12444
11266
  normalized = `${normalized}/`;
12445
11267
  prev_was_letter = false;
12446
11268
  } else {
12447
- normalized = `${normalized}${moonbitlang$core$builtin$$Show$to_string$16$(c)}`;
11269
+ normalized = `${normalized}${moonbitlang$core$builtin$$Show$to_string$15$(c)}`;
12448
11270
  prev_was_letter = c >= 65 && c <= 90 || c >= 97 && c <= 122;
12449
11271
  }
12450
11272
  _tmp = _i + 1 | 0;
@@ -12469,22 +11291,22 @@ function f4ah6o$jww_parser$core$$parse_double_or_default(s, default_) {
12469
11291
  return default_;
12470
11292
  }
12471
11293
  function f4ah6o$jww_parser$core$$split_by_comma(path_and_params) {
12472
- const result = moonbitlang$core$array$$Array$new$46$inner$13$(0);
11294
+ const result = moonbitlang$core$array$$Array$new$46$inner$12$(0);
12473
11295
  let current = "";
12474
11296
  const _it = moonbitlang$core$string$$String$iterator(path_and_params);
12475
11297
  while (true) {
12476
- const _bind = moonbitlang$core$builtin$$Iterator$next$16$(_it);
11298
+ const _bind = moonbitlang$core$builtin$$Iterator$next$15$(_it);
12477
11299
  if (_bind === -1) break;
12478
11300
  else {
12479
11301
  const _c = _bind;
12480
11302
  if (_c === 44) {
12481
- moonbitlang$core$array$$Array$push$13$(result, current);
11303
+ moonbitlang$core$array$$Array$push$12$(result, current);
12482
11304
  current = "";
12483
- } else current = `${current}${moonbitlang$core$builtin$$Show$to_string$16$(_c)}`;
11305
+ } else current = `${current}${moonbitlang$core$builtin$$Show$to_string$15$(_c)}`;
12484
11306
  continue;
12485
11307
  }
12486
11308
  }
12487
- if (!(current === "")) moonbitlang$core$array$$Array$push$13$(result, current);
11309
+ if (!(current === "")) moonbitlang$core$array$$Array$push$12$(result, current);
12488
11310
  return result;
12489
11311
  }
12490
11312
  function f4ah6o$jww_parser$core$$parse_image_from_bm_string(content, base, start_x, start_y, angle, size_x, size_y) {
@@ -12494,15 +11316,15 @@ function f4ah6o$jww_parser$core$$parse_image_from_bm_string(content, base, start
12494
11316
  else bm_offset = _bind;
12495
11317
  const chars = moonbitlang$core$string$$String$to_array(content);
12496
11318
  if (chars.length <= (bm_offset + 4 | 0)) return;
12497
- const parts = f4ah6o$jww_parser$core$$split_by_comma(moonbitlang$core$string$$String$from_array(moonbitlang$core$array$$Array$sub$46$inner$16$(chars, bm_offset + 4 | 0, void 0)));
11319
+ const parts = f4ah6o$jww_parser$core$$split_by_comma(moonbitlang$core$string$$String$from_array(moonbitlang$core$array$$Array$sub$46$inner$15$(chars, bm_offset + 4 | 0, void 0)));
12498
11320
  if (parts.length < 1) return;
12499
11321
  return {
12500
11322
  base,
12501
- image_path: f4ah6o$jww_parser$core$$normalize_image_path(moonbitlang$core$array$$Array$at$13$(parts, 0)),
11323
+ image_path: f4ah6o$jww_parser$core$$normalize_image_path(moonbitlang$core$array$$Array$at$12$(parts, 0)),
12502
11324
  x: start_x,
12503
11325
  y: start_y,
12504
- width: parts.length >= 2 ? f4ah6o$jww_parser$core$$parse_double_or_default(moonbitlang$core$array$$Array$at$13$(parts, 1), size_x) : size_x,
12505
- height: parts.length >= 3 ? f4ah6o$jww_parser$core$$parse_double_or_default(moonbitlang$core$array$$Array$at$13$(parts, 2), size_y) : size_y,
11326
+ width: parts.length >= 2 ? f4ah6o$jww_parser$core$$parse_double_or_default(moonbitlang$core$array$$Array$at$12$(parts, 1), size_x) : size_x,
11327
+ height: parts.length >= 3 ? f4ah6o$jww_parser$core$$parse_double_or_default(moonbitlang$core$array$$Array$at$12$(parts, 2), size_y) : size_y,
12506
11328
  rotation: angle
12507
11329
  };
12508
11330
  }
@@ -12698,14 +11520,14 @@ function f4ah6o$jww_parser$core$$parse_entity_with_pid_tracking(reader, version,
12698
11520
  const _tmp$2 = name_chars;
12699
11521
  $bound_check(name_bytes, i);
12700
11522
  const _p = name_bytes[i];
12701
- name_chars = `${_tmp$2}${moonbitlang$core$builtin$$Show$to_string$16$(_p)}`;
11523
+ name_chars = `${_tmp$2}${moonbitlang$core$builtin$$Show$to_string$15$(_p)}`;
12702
11524
  _tmp = i + 1 | 0;
12703
11525
  continue;
12704
11526
  } else break;
12705
11527
  }
12706
11528
  class_name = name_chars;
12707
11529
  const pid = updated_next_pid;
12708
- if (pid < 65536) moonbitlang$core$array$$Array$set$13$(pid_to_class, pid, class_name);
11530
+ if (pid < 65536) moonbitlang$core$array$$Array$set$12$(pid_to_class, pid, class_name);
12709
11531
  updated_next_pid = (pid >>> 0) + 1 | 0;
12710
11532
  } else if (class_id === 32768) return {
12711
11533
  entity: void 0,
@@ -12715,7 +11537,7 @@ function f4ah6o$jww_parser$core$$parse_entity_with_pid_tracking(reader, version,
12715
11537
  else {
12716
11538
  const class_pid = class_id & 32767;
12717
11539
  if (class_pid < 65536) {
12718
- const name = moonbitlang$core$array$$Array$at$13$(pid_to_class, class_pid);
11540
+ const name = moonbitlang$core$array$$Array$at$12$(pid_to_class, class_pid);
12719
11541
  if (name === "") {
12720
11542
  f4ah6o$jww_parser$core$$parse_entity_base(reader, version);
12721
11543
  f4ah6o$jww_parser$core$Reader$read_double(reader);
@@ -12752,13 +11574,13 @@ function f4ah6o$jww_parser$core$$parse_entity_list(data, offset, version) {
12752
11574
  const reader = f4ah6o$jww_parser$core$$Reader$new(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$4$(moonbitlang$core$bytes$$Bytes$to_array(data), offset, data.length)));
12753
11575
  const start_pos = reader.pos;
12754
11576
  const count = f4ah6o$jww_parser$core$$Reader$read_word(reader);
12755
- const entities = moonbitlang$core$array$$Array$new$46$inner$23$(0);
12756
- let pid_to_class = moonbitlang$core$array$$Array$new$46$inner$13$(0);
11577
+ const entities = moonbitlang$core$array$$Array$new$46$inner$22$(0);
11578
+ let pid_to_class = moonbitlang$core$array$$Array$new$46$inner$12$(0);
12757
11579
  let _tmp = 0;
12758
11580
  while (true) {
12759
11581
  const _ = _tmp;
12760
11582
  if (_ < 65536) {
12761
- moonbitlang$core$array$$Array$push$13$(pid_to_class, "");
11583
+ moonbitlang$core$array$$Array$push$12$(pid_to_class, "");
12762
11584
  _tmp = _ + 1 | 0;
12763
11585
  continue;
12764
11586
  } else break;
@@ -12780,7 +11602,7 @@ function f4ah6o$jww_parser$core$$parse_entity_list(data, offset, version) {
12780
11602
  const _ent = _x;
12781
11603
  const _p2c = result.pid_to_class;
12782
11604
  const _npid = result.next_pid;
12783
- moonbitlang$core$array$$Array$push$23$(entities, _ent);
11605
+ moonbitlang$core$array$$Array$push$22$(entities, _ent);
12784
11606
  pid_to_class = _p2c;
12785
11607
  next_pid = _npid;
12786
11608
  }
@@ -12808,14 +11630,14 @@ function f4ah6o$jww_parser$core$$parse_block_def_with_tracking(reader, version,
12808
11630
  const _tmp$2 = name_chars;
12809
11631
  $bound_check(name_bytes, i);
12810
11632
  const _p = name_bytes[i];
12811
- name_chars = `${_tmp$2}${moonbitlang$core$builtin$$Show$to_string$16$(_p)}`;
11633
+ name_chars = `${_tmp$2}${moonbitlang$core$builtin$$Show$to_string$15$(_p)}`;
12812
11634
  _tmp = i + 1 | 0;
12813
11635
  continue;
12814
11636
  } else break;
12815
11637
  }
12816
11638
  const class_name = name_chars;
12817
11639
  const id_int = next_id;
12818
- if (id_int < 256) moonbitlang$core$array$$Array$set$13$(class_map, id_int, class_name);
11640
+ if (id_int < 256) moonbitlang$core$array$$Array$set$12$(class_map, id_int, class_name);
12819
11641
  _bind = {
12820
11642
  _0: class_map,
12821
11643
  _1: (next_id + 1 | 0) & 65535
@@ -12828,7 +11650,7 @@ function f4ah6o$jww_parser$core$$parse_block_def_with_tracking(reader, version,
12828
11650
  else {
12829
11651
  const class_pid = class_id & 32767;
12830
11652
  if (class_pid < 256) {
12831
- moonbitlang$core$array$$Array$at$13$(class_map, class_pid);
11653
+ moonbitlang$core$array$$Array$at$12$(class_map, class_pid);
12832
11654
  _bind = {
12833
11655
  _0: class_map,
12834
11656
  _1: next_id
@@ -12866,27 +11688,27 @@ function f4ah6o$jww_parser$core$$parse_block_def_with_tracking(reader, version,
12866
11688
  }
12867
11689
  function f4ah6o$jww_parser$core$$parse_block_def_list(data, offset, version) {
12868
11690
  if (offset >= data.length) return {
12869
- block_defs: moonbitlang$core$array$$Array$new$46$inner$24$(0),
11691
+ block_defs: moonbitlang$core$array$$Array$new$46$inner$23$(0),
12870
11692
  end_offset: offset
12871
11693
  };
12872
11694
  const reader = f4ah6o$jww_parser$core$$Reader$new(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$4$(moonbitlang$core$bytes$$Bytes$to_array(data), offset, data.length)));
12873
11695
  const start_pos = reader.pos;
12874
11696
  if ((reader.data.length - reader.pos | 0) < 4) return {
12875
- block_defs: moonbitlang$core$array$$Array$new$46$inner$24$(0),
11697
+ block_defs: moonbitlang$core$array$$Array$new$46$inner$23$(0),
12876
11698
  end_offset: offset
12877
11699
  };
12878
11700
  const count = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
12879
11701
  if (count >>> 0 > 1e4) return {
12880
- block_defs: moonbitlang$core$array$$Array$new$46$inner$24$(0),
11702
+ block_defs: moonbitlang$core$array$$Array$new$46$inner$23$(0),
12881
11703
  end_offset: offset
12882
11704
  };
12883
- const block_defs = moonbitlang$core$array$$Array$new$46$inner$24$(0);
12884
- let class_map = moonbitlang$core$array$$Array$new$46$inner$13$(0);
11705
+ const block_defs = moonbitlang$core$array$$Array$new$46$inner$23$(0);
11706
+ let class_map = moonbitlang$core$array$$Array$new$46$inner$12$(0);
12885
11707
  let _tmp = 0;
12886
11708
  while (true) {
12887
11709
  const _ = _tmp;
12888
11710
  if (_ < 256) {
12889
- moonbitlang$core$array$$Array$push$13$(class_map, "");
11711
+ moonbitlang$core$array$$Array$push$12$(class_map, "");
12890
11712
  _tmp = _ + 1 | 0;
12891
11713
  continue;
12892
11714
  } else break;
@@ -12900,7 +11722,7 @@ function f4ah6o$jww_parser$core$$parse_block_def_list(data, offset, version) {
12900
11722
  if ((reader.data.length - reader.pos | 0) < 8) break;
12901
11723
  const result = f4ah6o$jww_parser$core$$parse_block_def_with_tracking(reader, version, class_map, next_id);
12902
11724
  const _bind = result.block_def;
12903
- if (_bind === void 0) {} else moonbitlang$core$array$$Array$push$24$(block_defs, _bind);
11725
+ if (_bind === void 0) {} else moonbitlang$core$array$$Array$push$23$(block_defs, _bind);
12904
11726
  class_map = result.class_map;
12905
11727
  next_id = result.next_id;
12906
11728
  _tmp$2 = _ + 1 | 0;
@@ -12944,20 +11766,20 @@ function f4ah6o$jww_parser$core$$parse_single_embedded_image(reader, index) {
12944
11766
  };
12945
11767
  }
12946
11768
  function f4ah6o$jww_parser$core$$parse_embedded_images(data, offset, version) {
12947
- if (version >>> 0 < 700) return moonbitlang$core$array$$Array$new$46$inner$25$(0);
12948
- if (offset >= data.length) return moonbitlang$core$array$$Array$new$46$inner$25$(0);
11769
+ if (version >>> 0 < 700) return moonbitlang$core$array$$Array$new$46$inner$24$(0);
11770
+ if (offset >= data.length) return moonbitlang$core$array$$Array$new$46$inner$24$(0);
12949
11771
  const reader = f4ah6o$jww_parser$core$$Reader$new(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$4$(moonbitlang$core$bytes$$Bytes$to_array(data), offset, data.length)));
12950
- if ((reader.data.length - reader.pos | 0) < 4) return moonbitlang$core$array$$Array$new$46$inner$25$(0);
11772
+ if ((reader.data.length - reader.pos | 0) < 4) return moonbitlang$core$array$$Array$new$46$inner$24$(0);
12951
11773
  const count = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
12952
- if (count >>> 0 > 1e3) return moonbitlang$core$array$$Array$new$46$inner$25$(0);
12953
- const embedded_images = moonbitlang$core$array$$Array$new$46$inner$25$(0);
11774
+ if (count >>> 0 > 1e3) return moonbitlang$core$array$$Array$new$46$inner$24$(0);
11775
+ const embedded_images = moonbitlang$core$array$$Array$new$46$inner$24$(0);
12954
11776
  const _end15 = count;
12955
11777
  let _tmp = 0;
12956
11778
  while (true) {
12957
11779
  const i = _tmp;
12958
11780
  if (i < _end15) {
12959
11781
  const result = f4ah6o$jww_parser$core$$parse_single_embedded_image(reader, i);
12960
- if (result === void 0) {} else moonbitlang$core$array$$Array$push$25$(embedded_images, result);
11782
+ if (result === void 0) {} else moonbitlang$core$array$$Array$push$24$(embedded_images, result);
12961
11783
  _tmp = i + 1 | 0;
12962
11784
  continue;
12963
11785
  } else break;
@@ -12965,23 +11787,23 @@ function f4ah6o$jww_parser$core$$parse_embedded_images(data, offset, version) {
12965
11787
  return embedded_images;
12966
11788
  }
12967
11789
  function f4ah6o$jww_parser$core$$set_layer_names(layer_groups) {
12968
- const result = moonbitlang$core$array$$Array$new$46$inner$12$(0);
11790
+ const result = moonbitlang$core$array$$Array$new$46$inner$11$(0);
12969
11791
  const _end290 = layer_groups.length;
12970
11792
  let _tmp = 0;
12971
11793
  while (true) {
12972
11794
  const g_idx = _tmp;
12973
11795
  if (g_idx < _end290) {
12974
- const lg = moonbitlang$core$array$$Array$at$12$(layer_groups, g_idx);
11796
+ const lg = moonbitlang$core$array$$Array$at$11$(layer_groups, g_idx);
12975
11797
  const group_name = lg.name === "" ? `Group${moonbitlang$core$int$$Int$to_string$46$inner(g_idx, 10)}` : lg.name;
12976
- const layers = moonbitlang$core$array$$Array$new$46$inner$14$(0);
11798
+ const layers = moonbitlang$core$array$$Array$new$46$inner$13$(0);
12977
11799
  const _end298 = lg.layers.length;
12978
11800
  let _tmp$2 = 0;
12979
11801
  while (true) {
12980
11802
  const l_idx = _tmp$2;
12981
11803
  if (l_idx < _end298) {
12982
- const l = moonbitlang$core$array$$Array$at$14$(lg.layers, l_idx);
11804
+ const l = moonbitlang$core$array$$Array$at$13$(lg.layers, l_idx);
12983
11805
  const layer_name = l.name === "" ? `${moonbitlang$core$int$$Int$to_string$46$inner(g_idx, 10)}-${moonbitlang$core$int$$Int$to_string$46$inner(l_idx, 10)}` : l.name;
12984
- moonbitlang$core$array$$Array$push$14$(layers, {
11806
+ moonbitlang$core$array$$Array$push$13$(layers, {
12985
11807
  state: l.state,
12986
11808
  protect: l.protect,
12987
11809
  name: layer_name
@@ -12990,7 +11812,7 @@ function f4ah6o$jww_parser$core$$set_layer_names(layer_groups) {
12990
11812
  continue;
12991
11813
  } else break;
12992
11814
  }
12993
- moonbitlang$core$array$$Array$push$12$(result, {
11815
+ moonbitlang$core$array$$Array$push$11$(result, {
12994
11816
  state: lg.state,
12995
11817
  write_layer: lg.write_layer,
12996
11818
  scale: lg.scale,
@@ -13006,13 +11828,13 @@ function f4ah6o$jww_parser$core$$set_layer_names(layer_groups) {
13006
11828
  }
13007
11829
  function f4ah6o$jww_parser$core$$parse(data) {
13008
11830
  if (data.length < 8) return f4ah6o$jww_parser$core$$Document$default();
13009
- if (moonbitlang$core$builtin$$op_notequal$11$(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$4$(moonbitlang$core$bytes$$Bytes$to_array(data), 0, f4ah6o$jww_parser$core$$parse$46$constr$47$1778)), $bytes_literal$1)) return f4ah6o$jww_parser$core$$Document$default();
11831
+ if (moonbitlang$core$builtin$$op_notequal$10$(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$4$(moonbitlang$core$bytes$$Bytes$to_array(data), 0, f4ah6o$jww_parser$core$$parse$46$constr$47$1492)), $bytes_literal$1)) return f4ah6o$jww_parser$core$$Document$default();
13010
11832
  const reader = f4ah6o$jww_parser$core$$Reader$new(moonbitlang$core$bytes$$Bytes$from_array(moonbitlang$core$array$$Array$sub$46$inner$4$(moonbitlang$core$bytes$$Bytes$to_array(data), 8, data.length)));
13011
11833
  const version = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
13012
11834
  const memo = f4ah6o$jww_parser$core$$read_cstring(reader);
13013
11835
  const paper_size = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
13014
11836
  const write_layer_group = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
13015
- const layer_groups = moonbitlang$core$array$$Array$new$46$inner$12$(0);
11837
+ const layer_groups = moonbitlang$core$array$$Array$new$46$inner$11$(0);
13016
11838
  let _tmp = 0;
13017
11839
  while (true) {
13018
11840
  const _g_idx = _tmp;
@@ -13021,12 +11843,12 @@ function f4ah6o$jww_parser$core$$parse(data) {
13021
11843
  const write_layer = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
13022
11844
  const scale = f4ah6o$jww_parser$core$Reader$read_double(reader);
13023
11845
  const protect = f4ah6o$jww_parser$core$$Reader$read_dword(reader);
13024
- const layers = moonbitlang$core$array$$Array$new$46$inner$14$(0);
11846
+ const layers = moonbitlang$core$array$$Array$new$46$inner$13$(0);
13025
11847
  let _tmp$2 = 0;
13026
11848
  while (true) {
13027
11849
  const _l_idx = _tmp$2;
13028
11850
  if (_l_idx < 16) {
13029
- moonbitlang$core$array$$Array$push$14$(layers, {
11851
+ moonbitlang$core$array$$Array$push$13$(layers, {
13030
11852
  state: f4ah6o$jww_parser$core$$Reader$read_dword(reader),
13031
11853
  protect: f4ah6o$jww_parser$core$$Reader$read_dword(reader),
13032
11854
  name: ""
@@ -13035,7 +11857,7 @@ function f4ah6o$jww_parser$core$$parse(data) {
13035
11857
  continue;
13036
11858
  } else break;
13037
11859
  }
13038
- moonbitlang$core$array$$Array$push$12$(layer_groups, {
11860
+ moonbitlang$core$array$$Array$push$11$(layer_groups, {
13039
11861
  state,
13040
11862
  write_layer,
13041
11863
  scale,
@@ -13053,8 +11875,8 @@ function f4ah6o$jww_parser$core$$parse(data) {
13053
11875
  const entity_offset = f4ah6o$jww_parser$core$$find_entity_list_offset(data, version);
13054
11876
  let _bind;
13055
11877
  if (entity_offset === void 0) _bind = {
13056
- _0: moonbitlang$core$array$$Array$new$46$inner$23$(0),
13057
- _1: moonbitlang$core$array$$Array$new$46$inner$24$(0),
11878
+ _0: moonbitlang$core$array$$Array$new$46$inner$22$(0),
11879
+ _1: moonbitlang$core$array$$Array$new$46$inner$23$(0),
13058
11880
  _2: 0
13059
11881
  };
13060
11882
  else {
@@ -13070,7 +11892,7 @@ function f4ah6o$jww_parser$core$$parse(data) {
13070
11892
  const _entities = _bind._0;
13071
11893
  const _block_defs = _bind._1;
13072
11894
  const _block_end_offset = _bind._2;
13073
- const embedded_images = version >>> 0 >= 700 ? f4ah6o$jww_parser$core$$parse_embedded_images(data, _block_end_offset, version) : moonbitlang$core$array$$Array$new$46$inner$25$(0);
11895
+ const embedded_images = version >>> 0 >= 700 ? f4ah6o$jww_parser$core$$parse_embedded_images(data, _block_end_offset, version) : moonbitlang$core$array$$Array$new$46$inner$24$(0);
13074
11896
  return {
13075
11897
  version,
13076
11898
  memo,
@@ -13082,668 +11904,17 @@ function f4ah6o$jww_parser$core$$parse(data) {
13082
11904
  embedded_images,
13083
11905
  print_settings,
13084
11906
  sunpou_settings,
13085
- metadata_settings: f4ah6o$jww_parser$core$$default$46$record$47$1391
13086
- };
13087
- }
13088
- function f4ah6o$jww_parser$dxf$$layer_table(doc) {
13089
- let output = "";
13090
- output = `${output}0\nTABLE\n2\nLAYER\n70\n`;
13091
- output = `${output}${moonbitlang$core$int$$Int$to_string$46$inner(doc.layers.length + 1 | 0, 10)}`;
13092
- output = `${output}\n`;
13093
- output = `${output}0\nLAYER\n2\n0\n70\n0\n62\n7\n6\nCONTINUOUS\n`;
13094
- const _arr = doc.layers;
13095
- const _len = _arr.length;
13096
- let _tmp = 0;
13097
- while (true) {
13098
- const _i = _tmp;
13099
- if (_i < _len) {
13100
- const layer = _arr[_i];
13101
- output = `${output}0\nLAYER\n2\n`;
13102
- output = `${output}${layer.name}`;
13103
- output = `${output}\n70\n0\n62\n`;
13104
- output = `${output}${moonbitlang$core$int$$Int$to_string$46$inner(layer.color, 10)}`;
13105
- output = `${output}\n6\n`;
13106
- output = `${output}${layer.line_type}`;
13107
- if (layer.frozen) output = `${output}\n70\n1`;
13108
- if (layer.locked) output = `${output}\n70\n4`;
13109
- output = `${output}\n`;
13110
- _tmp = _i + 1 | 0;
13111
- continue;
13112
- } else break;
13113
- }
13114
- output = `${output}0\nENDTAB\n`;
13115
- return output;
13116
- }
13117
- function f4ah6o$jww_parser$dxf$$ltype_table() {
13118
- let output = "";
13119
- output = `${output}0\nTABLE\n`;
13120
- output = `${output}2\nLTYPE\n`;
13121
- output = `${output}70\n11\n`;
13122
- const ltypes = [
13123
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1820,
13124
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1821,
13125
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1822,
13126
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1823,
13127
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1824,
13128
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1825,
13129
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1826,
13130
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1827,
13131
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1828,
13132
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1829,
13133
- f4ah6o$jww_parser$dxf$$ltype_table$46$tuple$47$1830
13134
- ];
13135
- const _len = ltypes.length;
13136
- let _tmp = 0;
13137
- while (true) {
13138
- const _i = _tmp;
13139
- if (_i < _len) {
13140
- const lt = ltypes[_i];
13141
- const _name = lt._0;
13142
- const _desc = lt._1;
13143
- output = `${output}0\nLTYPE\n`;
13144
- output = `${output}2\n${_name}\n`;
13145
- output = `${output}70\n0\n`;
13146
- output = `${output}3\n${_desc}\n`;
13147
- output = `${output}72\n65\n`;
13148
- output = `${output}73\n0\n`;
13149
- output = `${output}40\n0.0\n`;
13150
- _tmp = _i + 1 | 0;
13151
- continue;
13152
- } else break;
13153
- }
13154
- output = `${output}0\nENDTAB\n`;
13155
- return output;
13156
- }
13157
- function f4ah6o$jww_parser$dxf$$style_table() {
13158
- let output = "";
13159
- output = `${output}0\nTABLE\n`;
13160
- output = `${output}2\nSTYLE\n`;
13161
- output = `${output}70\n1\n`;
13162
- output = `${output}0\nSTYLE\n`;
13163
- output = `${output}2\nSTANDARD\n`;
13164
- output = `${output}70\n0\n`;
13165
- output = `${output}40\n0.0\n`;
13166
- output = `${output}41\n1.0\n`;
13167
- output = `${output}50\n0.0\n`;
13168
- output = `${output}71\n0\n`;
13169
- output = `${output}42\n0.2\n`;
13170
- output = `${output}3\ntxt\n`;
13171
- output = `${output}4\n\n`;
13172
- output = `${output}0\nENDTAB\n`;
13173
- return output;
13174
- }
13175
- function f4ah6o$jww_parser$dxf$$write_entity(entity) {
13176
- switch (entity.$tag) {
13177
- case 0: {
13178
- const _line = entity._0;
13179
- let output = "0\nLINE\n8\n";
13180
- output = `${output}${_line.layer}`;
13181
- output = `${output}\n62\n`;
13182
- output = `${output}${moonbitlang$core$int$$Int$to_string$46$inner(_line.color, 10)}`;
13183
- output = `${output}\n6\n`;
13184
- output = `${output}${_line.line_type}`;
13185
- output = `${output}\n10\n`;
13186
- output = `${output}${moonbitlang$core$double$$Double$to_string(_line.x1)}`;
13187
- output = `${output}\n20\n`;
13188
- output = `${output}${moonbitlang$core$double$$Double$to_string(_line.y1)}`;
13189
- output = `${output}\n11\n`;
13190
- output = `${output}${moonbitlang$core$double$$Double$to_string(_line.x2)}`;
13191
- output = `${output}\n21\n`;
13192
- output = `${output}${moonbitlang$core$double$$Double$to_string(_line.y2)}`;
13193
- output = `${output}\n`;
13194
- return output;
13195
- }
13196
- case 1: {
13197
- const _circle = entity._0;
13198
- let output$2 = "0\nCIRCLE\n8\n";
13199
- output$2 = `${output$2}${_circle.layer}`;
13200
- output$2 = `${output$2}\n62\n`;
13201
- output$2 = `${output$2}${moonbitlang$core$int$$Int$to_string$46$inner(_circle.color, 10)}`;
13202
- output$2 = `${output$2}\n6\n`;
13203
- output$2 = `${output$2}${_circle.line_type}`;
13204
- output$2 = `${output$2}\n10\n`;
13205
- output$2 = `${output$2}${moonbitlang$core$double$$Double$to_string(_circle.center_x)}`;
13206
- output$2 = `${output$2}\n20\n`;
13207
- output$2 = `${output$2}${moonbitlang$core$double$$Double$to_string(_circle.center_y)}`;
13208
- output$2 = `${output$2}\n40\n`;
13209
- output$2 = `${output$2}${moonbitlang$core$double$$Double$to_string(_circle.radius)}`;
13210
- output$2 = `${output$2}\n`;
13211
- return output$2;
13212
- }
13213
- case 2: {
13214
- const _arc = entity._0;
13215
- let output$3 = "0\nARC\n8\n";
13216
- output$3 = `${output$3}${_arc.layer}`;
13217
- output$3 = `${output$3}\n62\n`;
13218
- output$3 = `${output$3}${moonbitlang$core$int$$Int$to_string$46$inner(_arc.color, 10)}`;
13219
- output$3 = `${output$3}\n6\n`;
13220
- output$3 = `${output$3}${_arc.line_type}`;
13221
- output$3 = `${output$3}\n10\n`;
13222
- output$3 = `${output$3}${moonbitlang$core$double$$Double$to_string(_arc.center_x)}`;
13223
- output$3 = `${output$3}\n20\n`;
13224
- output$3 = `${output$3}${moonbitlang$core$double$$Double$to_string(_arc.center_y)}`;
13225
- output$3 = `${output$3}\n40\n`;
13226
- output$3 = `${output$3}${moonbitlang$core$double$$Double$to_string(_arc.radius)}`;
13227
- output$3 = `${output$3}\n50\n`;
13228
- output$3 = `${output$3}${moonbitlang$core$double$$Double$to_string(_arc.start_angle)}`;
13229
- output$3 = `${output$3}\n51\n`;
13230
- output$3 = `${output$3}${moonbitlang$core$double$$Double$to_string(_arc.end_angle)}`;
13231
- output$3 = `${output$3}\n`;
13232
- return output$3;
13233
- }
13234
- case 3: {
13235
- const _ellipse = entity._0;
13236
- let output$4 = "0\nELLIPSE\n8\n";
13237
- output$4 = `${output$4}${_ellipse.layer}`;
13238
- output$4 = `${output$4}\n62\n`;
13239
- output$4 = `${output$4}${moonbitlang$core$int$$Int$to_string$46$inner(_ellipse.color, 10)}`;
13240
- output$4 = `${output$4}\n6\n`;
13241
- output$4 = `${output$4}${_ellipse.line_type}`;
13242
- output$4 = `${output$4}\n10\n`;
13243
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.center_x)}`;
13244
- output$4 = `${output$4}\n20\n`;
13245
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.center_y)}`;
13246
- output$4 = `${output$4}\n11\n`;
13247
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.major_axis_x)}`;
13248
- output$4 = `${output$4}\n21\n`;
13249
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.major_axis_y)}`;
13250
- output$4 = `${output$4}\n40\n`;
13251
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.minor_ratio)}`;
13252
- output$4 = `${output$4}\n41\n`;
13253
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.start_param)}`;
13254
- output$4 = `${output$4}\n42\n`;
13255
- output$4 = `${output$4}${moonbitlang$core$double$$Double$to_string(_ellipse.end_param)}`;
13256
- output$4 = `${output$4}\n`;
13257
- return output$4;
13258
- }
13259
- case 4: {
13260
- const _point = entity._0;
13261
- let output$5 = "0\nPOINT\n8\n";
13262
- output$5 = `${output$5}${_point.layer}`;
13263
- output$5 = `${output$5}\n62\n`;
13264
- output$5 = `${output$5}${moonbitlang$core$int$$Int$to_string$46$inner(_point.color, 10)}`;
13265
- output$5 = `${output$5}\n6\n`;
13266
- output$5 = `${output$5}${_point.line_type}`;
13267
- output$5 = `${output$5}\n10\n`;
13268
- output$5 = `${output$5}${moonbitlang$core$double$$Double$to_string(_point.x)}`;
13269
- output$5 = `${output$5}\n20\n`;
13270
- output$5 = `${output$5}${moonbitlang$core$double$$Double$to_string(_point.y)}`;
13271
- output$5 = `${output$5}\n`;
13272
- return output$5;
13273
- }
13274
- case 5: {
13275
- const _text = entity._0;
13276
- let output$6 = "0\nTEXT\n8\n";
13277
- output$6 = `${output$6}${_text.layer}`;
13278
- output$6 = `${output$6}\n62\n`;
13279
- output$6 = `${output$6}${moonbitlang$core$int$$Int$to_string$46$inner(_text.color, 10)}`;
13280
- output$6 = `${output$6}\n6\n`;
13281
- output$6 = `${output$6}${_text.line_type}`;
13282
- output$6 = `${output$6}\n10\n`;
13283
- output$6 = `${output$6}${moonbitlang$core$double$$Double$to_string(_text.x)}`;
13284
- output$6 = `${output$6}\n20\n`;
13285
- output$6 = `${output$6}${moonbitlang$core$double$$Double$to_string(_text.y)}`;
13286
- output$6 = `${output$6}\n40\n`;
13287
- output$6 = `${output$6}${moonbitlang$core$double$$Double$to_string(_text.height)}`;
13288
- output$6 = `${output$6}\n50\n`;
13289
- output$6 = `${output$6}${moonbitlang$core$double$$Double$to_string(_text.rotation)}`;
13290
- output$6 = `${output$6}\n1\n`;
13291
- output$6 = `${output$6}${_text.content}`;
13292
- output$6 = `${output$6}\n7\n`;
13293
- output$6 = `${output$6}${_text.style}`;
13294
- output$6 = `${output$6}\n`;
13295
- return output$6;
13296
- }
13297
- case 6: {
13298
- const _solid = entity._0;
13299
- let output$7 = "0\nSOLID\n8\n";
13300
- output$7 = `${output$7}${_solid.layer}`;
13301
- output$7 = `${output$7}\n62\n`;
13302
- output$7 = `${output$7}${moonbitlang$core$int$$Int$to_string$46$inner(_solid.color, 10)}`;
13303
- output$7 = `${output$7}\n6\n`;
13304
- output$7 = `${output$7}${_solid.line_type}`;
13305
- output$7 = `${output$7}\n10\n`;
13306
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.x1)}`;
13307
- output$7 = `${output$7}\n20\n`;
13308
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.y1)}`;
13309
- output$7 = `${output$7}\n11\n`;
13310
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.x2)}`;
13311
- output$7 = `${output$7}\n21\n`;
13312
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.y2)}`;
13313
- output$7 = `${output$7}\n12\n`;
13314
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.x3)}`;
13315
- output$7 = `${output$7}\n22\n`;
13316
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.y3)}`;
13317
- output$7 = `${output$7}\n13\n`;
13318
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.x4)}`;
13319
- output$7 = `${output$7}\n23\n`;
13320
- output$7 = `${output$7}${moonbitlang$core$double$$Double$to_string(_solid.y4)}`;
13321
- output$7 = `${output$7}\n`;
13322
- return output$7;
13323
- }
13324
- default: {
13325
- const _insert = entity._0;
13326
- let output$8 = "0\nINSERT\n8\n";
13327
- output$8 = `${output$8}${_insert.layer}`;
13328
- output$8 = `${output$8}\n62\n`;
13329
- output$8 = `${output$8}${moonbitlang$core$int$$Int$to_string$46$inner(_insert.color, 10)}`;
13330
- output$8 = `${output$8}\n6\n`;
13331
- output$8 = `${output$8}${_insert.line_type}`;
13332
- output$8 = `${output$8}\n2\n`;
13333
- output$8 = `${output$8}${_insert.block_name}`;
13334
- output$8 = `${output$8}\n10\n`;
13335
- output$8 = `${output$8}${moonbitlang$core$double$$Double$to_string(_insert.x)}`;
13336
- output$8 = `${output$8}\n20\n`;
13337
- output$8 = `${output$8}${moonbitlang$core$double$$Double$to_string(_insert.y)}`;
13338
- output$8 = `${output$8}\n41\n`;
13339
- output$8 = `${output$8}${moonbitlang$core$double$$Double$to_string(_insert.scale_x)}`;
13340
- output$8 = `${output$8}\n42\n`;
13341
- output$8 = `${output$8}${moonbitlang$core$double$$Double$to_string(_insert.scale_y)}`;
13342
- output$8 = `${output$8}\n50\n`;
13343
- output$8 = `${output$8}${moonbitlang$core$double$$Double$to_string(_insert.rotation)}`;
13344
- output$8 = `${output$8}\n`;
13345
- return output$8;
13346
- }
13347
- }
13348
- }
13349
- function f4ah6o$jww_parser$dxf$$write_block(block) {
13350
- let output = "";
13351
- output = `${output}0\nBLOCK\n8\n0\n2\n`;
13352
- output = `${output}${block.name}`;
13353
- output = `${output}\n70\n0\n10\n`;
13354
- output = `${output}${moonbitlang$core$double$$Double$to_string(block.base_x)}`;
13355
- output = `${output}\n20\n`;
13356
- output = `${output}${moonbitlang$core$double$$Double$to_string(block.base_y)}`;
13357
- output = `${output}\n`;
13358
- const _arr = block.entities;
13359
- const _len = _arr.length;
13360
- let _tmp = 0;
13361
- while (true) {
13362
- const _i = _tmp;
13363
- if (_i < _len) {
13364
- const entity = _arr[_i];
13365
- output = `${output}${f4ah6o$jww_parser$dxf$$write_entity(entity)}`;
13366
- _tmp = _i + 1 | 0;
13367
- continue;
13368
- } else break;
13369
- }
13370
- output = `${output}0\nENDBLK\n`;
13371
- return output;
13372
- }
13373
- function f4ah6o$jww_parser$dxf$$to_string(doc) {
13374
- let output = "";
13375
- output = `${output}0\nSECTION\n2\nHEADER\n`;
13376
- output = `${output}9\n$ACADVER\n1\nAC1015\n`;
13377
- output = `${output}9\n$INSBASE\n10\n0.0\n20\n0.0\n30\n0.0\n`;
13378
- output = `${output}9\n$EXTMIN\n10\n0.0\n20\n0.0\n30\n0.0\n`;
13379
- output = `${output}9\n$EXTMAX\n10\n1000.0\n20\n1000.0\n30\n0.0\n`;
13380
- output = `${output}9\n$LIMMIN\n10\n0.0\n20\n0.0\n`;
13381
- output = `${output}9\n$LIMMAX\n10\n1000.0\n20\n1000.0\n`;
13382
- output = `${output}0\nENDSEC\n`;
13383
- output = `${output}0\nSECTION\n2\nTABLES\n`;
13384
- output = `${output}${f4ah6o$jww_parser$dxf$$ltype_table()}`;
13385
- output = `${output}${f4ah6o$jww_parser$dxf$$layer_table(doc)}`;
13386
- output = `${output}${f4ah6o$jww_parser$dxf$$style_table()}`;
13387
- output = `${output}0\nENDSEC\n`;
13388
- if (doc.blocks.length > 0) {
13389
- output = `${output}0\nSECTION\n2\nBLOCKS\n`;
13390
- const _arr$1 = doc.blocks;
13391
- const _len$1 = _arr$1.length;
13392
- let _tmp$1 = 0;
13393
- while (true) {
13394
- const _i = _tmp$1;
13395
- if (_i < _len$1) {
13396
- const block = _arr$1[_i];
13397
- output = `${output}${f4ah6o$jww_parser$dxf$$write_block(block)}`;
13398
- _tmp$1 = _i + 1 | 0;
13399
- continue;
13400
- } else break;
13401
- }
13402
- output = `${output}0\nENDSEC\n`;
13403
- }
13404
- output = `${output}0\nSECTION\n2\nENTITIES\n`;
13405
- const _arr = doc.entities;
13406
- const _len = _arr.length;
13407
- let _tmp = 0;
13408
- while (true) {
13409
- const _i = _tmp;
13410
- if (_i < _len) {
13411
- const entity = _arr[_i];
13412
- output = `${output}${f4ah6o$jww_parser$dxf$$write_entity(entity)}`;
13413
- _tmp = _i + 1 | 0;
13414
- continue;
13415
- } else break;
13416
- }
13417
- output = `${output}0\nENDSEC\n`;
13418
- output = `${output}0\nEOF\n`;
13419
- return output;
13420
- }
13421
- function f4ah6o$jww_parser$dxf$$feq(a, b) {
13422
- const _p = a - b;
13423
- return (_p < 0 ? -_p : _p) < 1e-9;
13424
- }
13425
- function f4ah6o$jww_parser$dxf$$cos(_tmp) {
13426
- return Math.cos(_tmp);
13427
- }
13428
- function f4ah6o$jww_parser$dxf$$get_block_name(jww_doc, def_number) {
13429
- const _arr = jww_doc.block_defs;
13430
- const _len = _arr.length;
13431
- let _tmp = 0;
13432
- while (true) {
13433
- const _i = _tmp;
13434
- if (_i < _len) {
13435
- const bd = _arr[_i];
13436
- if (bd.number === def_number) {
13437
- if (!(bd.name === "")) return bd.name;
13438
- }
13439
- _tmp = _i + 1 | 0;
13440
- continue;
13441
- } else break;
13442
- }
13443
- return `BLOCK_${moonbitlang$core$uint$$UInt$to_string$46$inner(def_number, 10)}`;
13444
- }
13445
- function f4ah6o$jww_parser$dxf$$get_layer_name(jww_doc, layer_group, layer) {
13446
- if (moonbitlang$core$builtin$$Compare$op_lt$17$(layer_group, 16) && moonbitlang$core$builtin$$Compare$op_lt$17$(layer, 16)) {
13447
- const layer_data = moonbitlang$core$array$$Array$at$14$(moonbitlang$core$array$$Array$at$12$(jww_doc.layer_groups, layer_group).layers, layer);
13448
- if (!(layer_data.name === "")) return layer_data.name;
13449
- }
13450
- return `${moonbitlang$core$uint16$$UInt16$to_string$46$inner(layer_group, 10)}-${moonbitlang$core$uint16$$UInt16$to_string$46$inner(layer, 10)}`;
13451
- }
13452
- function f4ah6o$jww_parser$dxf$$map_color(jww_color) {
13453
- switch (jww_color) {
13454
- case 0: return 0;
13455
- case 1: return 4;
13456
- case 2: return 7;
13457
- case 3: return 3;
13458
- case 4: return 2;
13459
- case 5: return 6;
13460
- case 6: return 5;
13461
- case 7: return 7;
13462
- case 8: return 1;
13463
- case 9: return 8;
13464
- default: return moonbitlang$core$builtin$$Compare$op_ge$17$(jww_color, 100) ? (jww_color - 100 | 0) + 10 | 0 : jww_color;
13465
- }
13466
- }
13467
- function f4ah6o$jww_parser$dxf$$map_line_type(pen_style) {
13468
- switch (pen_style) {
13469
- case 0: return "CONTINUOUS";
13470
- case 1: return "CONTINUOUS";
13471
- case 2: return "DASHED";
13472
- case 3: return "DASHDOT";
13473
- case 4: return "CENTER";
13474
- case 5: return "DOT";
13475
- case 6: return "DASHEDX2";
13476
- case 7: return "DASHDOTX2";
13477
- case 8: return "CENTERX2";
13478
- case 9: return "DOTX2";
13479
- default: return "CONTINUOUS";
13480
- }
13481
- }
13482
- function f4ah6o$jww_parser$dxf$$rad_to_deg(rad) {
13483
- return rad * 180 / 3.141592653589793;
13484
- }
13485
- function f4ah6o$jww_parser$dxf$$sin(_tmp) {
13486
- return Math.sin(_tmp);
13487
- }
13488
- function f4ah6o$jww_parser$dxf$$convert_entity(entity, jww_doc) {
13489
- const base = f4ah6o$jww_parser$core$$Entity$base(entity);
13490
- const layer_name = f4ah6o$jww_parser$dxf$$get_layer_name(jww_doc, base.layer_group, base.layer);
13491
- const color = f4ah6o$jww_parser$dxf$$map_color(base.pen_color);
13492
- const line_type = f4ah6o$jww_parser$dxf$$map_line_type(base.pen_style);
13493
- switch (entity.$tag) {
13494
- case 0: {
13495
- const _line = entity._0;
13496
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Line({
13497
- layer: layer_name,
13498
- color,
13499
- line_type,
13500
- x1: _line.start_x,
13501
- y1: _line.start_y,
13502
- x2: _line.end_x,
13503
- y2: _line.end_y
13504
- });
13505
- }
13506
- case 1: {
13507
- const _arc = entity._0;
13508
- if (_arc.is_full_circle && f4ah6o$jww_parser$dxf$$feq(_arc.flatness, 1)) return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Circle({
13509
- layer: layer_name,
13510
- color,
13511
- line_type,
13512
- center_x: _arc.center_x,
13513
- center_y: _arc.center_y,
13514
- radius: _arc.radius
13515
- });
13516
- else if (!f4ah6o$jww_parser$dxf$$feq(_arc.flatness, 1)) {
13517
- let major_radius = _arc.radius;
13518
- let minor_ratio = _arc.flatness;
13519
- let tilt_angle = _arc.tilt_angle;
13520
- if (minor_ratio > 1) {
13521
- major_radius = _arc.radius * _arc.flatness;
13522
- minor_ratio = 1 / _arc.flatness;
13523
- tilt_angle = _arc.tilt_angle + 1.5707963267948966;
13524
- }
13525
- const major_axis_x = major_radius * f4ah6o$jww_parser$dxf$$cos(tilt_angle);
13526
- const major_axis_y = major_radius * f4ah6o$jww_parser$dxf$$sin(tilt_angle);
13527
- let start_param;
13528
- let end_param;
13529
- _L: if (_arc.is_full_circle) {
13530
- start_param = 0;
13531
- end_param = 6.283185307179586;
13532
- break _L;
13533
- } else {
13534
- const _tmp = _arc.start_angle;
13535
- const _tmp$2 = _arc.start_angle + _arc.arc_angle;
13536
- start_param = _tmp;
13537
- end_param = _tmp$2;
13538
- break _L;
13539
- }
13540
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Ellipse({
13541
- layer: layer_name,
13542
- color,
13543
- line_type,
13544
- center_x: _arc.center_x,
13545
- center_y: _arc.center_y,
13546
- major_axis_x,
13547
- major_axis_y,
13548
- minor_ratio,
13549
- start_param,
13550
- end_param
13551
- });
13552
- } else {
13553
- const start_angle = f4ah6o$jww_parser$dxf$$rad_to_deg(_arc.start_angle);
13554
- const end_angle = f4ah6o$jww_parser$dxf$$rad_to_deg(_arc.start_angle + _arc.arc_angle);
13555
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Arc({
13556
- layer: layer_name,
13557
- color,
13558
- line_type,
13559
- center_x: _arc.center_x,
13560
- center_y: _arc.center_y,
13561
- radius: _arc.radius,
13562
- start_angle,
13563
- end_angle
13564
- });
13565
- }
13566
- }
13567
- case 2: {
13568
- const _point = entity._0;
13569
- return _point.is_temporary ? void 0 : new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Point({
13570
- layer: layer_name,
13571
- color,
13572
- line_type,
13573
- x: _point.x,
13574
- y: _point.y
13575
- });
13576
- }
13577
- case 3: {
13578
- const _text = entity._0;
13579
- const height = _text.size_y <= 0 ? 2.5 : _text.size_y;
13580
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Text({
13581
- layer: layer_name,
13582
- color,
13583
- line_type,
13584
- x: _text.start_x,
13585
- y: _text.start_y,
13586
- height,
13587
- rotation: _text.angle,
13588
- content: _text.content,
13589
- style: "STANDARD"
13590
- });
13591
- }
13592
- case 4: {
13593
- const _solid = entity._0;
13594
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Solid({
13595
- layer: layer_name,
13596
- color,
13597
- line_type,
13598
- x1: _solid.point1_x,
13599
- y1: _solid.point1_y,
13600
- x2: _solid.point2_x,
13601
- y2: _solid.point2_y,
13602
- x3: _solid.point3_x,
13603
- y3: _solid.point3_y,
13604
- x4: _solid.point4_x,
13605
- y4: _solid.point4_y
13606
- });
13607
- }
13608
- case 5: {
13609
- const _block = entity._0;
13610
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Insert({
13611
- layer: layer_name,
13612
- color,
13613
- line_type,
13614
- block_name: f4ah6o$jww_parser$dxf$$get_block_name(jww_doc, _block.def_number),
13615
- x: _block.ref_x,
13616
- y: _block.ref_y,
13617
- scale_x: _block.scale_x,
13618
- scale_y: _block.scale_y,
13619
- rotation: f4ah6o$jww_parser$dxf$$rad_to_deg(_block.rotation)
13620
- });
13621
- }
13622
- default: {
13623
- const _image = entity._0;
13624
- const height$2 = _image.height <= 0 ? 2.5 : _image.height / 10;
13625
- return new $64$f4ah6o$47$jww_parser$47$dxf$46$DxfEntity$Text({
13626
- layer: layer_name,
13627
- color,
13628
- line_type,
13629
- x: _image.x,
13630
- y: _image.y,
13631
- height: height$2,
13632
- rotation: _image.rotation,
13633
- content: `[IMAGE: ${_image.image_path}]`,
13634
- style: "STANDARD"
13635
- });
13636
- }
13637
- }
13638
- }
13639
- function f4ah6o$jww_parser$dxf$$convert_blocks(jww_doc) {
13640
- const blocks = moonbitlang$core$array$$Array$new$46$inner$28$(0);
13641
- const _arr = jww_doc.block_defs;
13642
- const _len = _arr.length;
13643
- let _tmp = 0;
13644
- while (true) {
13645
- const _i = _tmp;
13646
- if (_i < _len) {
13647
- const bd = _arr[_i];
13648
- const block_entities = moonbitlang$core$array$$Array$new$46$inner$27$(0);
13649
- const _arr$2 = bd.entities;
13650
- const _len$2 = _arr$2.length;
13651
- let _tmp$2 = 0;
13652
- while (true) {
13653
- const _i$2 = _tmp$2;
13654
- if (_i$2 < _len$2) {
13655
- const e = _arr$2[_i$2];
13656
- const _bind = f4ah6o$jww_parser$dxf$$convert_entity(e, jww_doc);
13657
- if (_bind === void 0) {} else moonbitlang$core$array$$Array$push$27$(block_entities, _bind);
13658
- _tmp$2 = _i$2 + 1 | 0;
13659
- continue;
13660
- } else break;
13661
- }
13662
- moonbitlang$core$array$$Array$push$28$(blocks, {
13663
- name: bd.name,
13664
- base_x: 0,
13665
- base_y: 0,
13666
- entities: block_entities
13667
- });
13668
- _tmp = _i + 1 | 0;
13669
- continue;
13670
- } else break;
13671
- }
13672
- return blocks;
13673
- }
13674
- function f4ah6o$jww_parser$dxf$$convert_entities(jww_doc) {
13675
- const entities = moonbitlang$core$array$$Array$new$46$inner$27$(0);
13676
- const _arr = jww_doc.entities;
13677
- const _len = _arr.length;
13678
- let _tmp = 0;
13679
- while (true) {
13680
- const _i = _tmp;
13681
- if (_i < _len) {
13682
- const jww_entity = _arr[_i];
13683
- const _bind = f4ah6o$jww_parser$dxf$$convert_entity(jww_entity, jww_doc);
13684
- if (_bind === void 0) {} else moonbitlang$core$array$$Array$push$27$(entities, _bind);
13685
- _tmp = _i + 1 | 0;
13686
- continue;
13687
- } else break;
13688
- }
13689
- return entities;
13690
- }
13691
- function f4ah6o$jww_parser$dxf$$convert_layers(jww_doc) {
13692
- const layers = moonbitlang$core$array$$Array$new$46$inner$26$(0);
13693
- let _tmp = 0;
13694
- while (true) {
13695
- const g_idx = _tmp;
13696
- if (g_idx < 16) {
13697
- const lg = moonbitlang$core$array$$Array$at$12$(jww_doc.layer_groups, g_idx);
13698
- let _tmp$2 = 0;
13699
- while (true) {
13700
- const l_idx = _tmp$2;
13701
- if (l_idx < 16) {
13702
- const l = moonbitlang$core$array$$Array$at$14$(lg.layers, l_idx);
13703
- moonbitlang$core$array$$Array$push$26$(layers, {
13704
- name: l.name === "" ? `${moonbitlang$core$int$$Int$to_string$46$inner(g_idx, 10)}-${moonbitlang$core$int$$Int$to_string$46$inner(l_idx, 10)}` : l.name,
13705
- color: (((Math.imul(g_idx, 16) | 0) + l_idx | 0) % 255 | 0) + 1 | 0,
13706
- line_type: "CONTINUOUS",
13707
- frozen: l.state === 0,
13708
- locked: l.protect !== 0
13709
- });
13710
- _tmp$2 = l_idx + 1 | 0;
13711
- continue;
13712
- } else break;
13713
- }
13714
- _tmp = g_idx + 1 | 0;
13715
- continue;
13716
- } else break;
13717
- }
13718
- return layers;
13719
- }
13720
- function f4ah6o$jww_parser$dxf$$convert_document(jww_doc) {
13721
- return {
13722
- layers: f4ah6o$jww_parser$dxf$$convert_layers(jww_doc),
13723
- entities: f4ah6o$jww_parser$dxf$$convert_entities(jww_doc),
13724
- blocks: f4ah6o$jww_parser$dxf$$convert_blocks(jww_doc)
11907
+ metadata_settings: f4ah6o$jww_parser$core$$default$46$record$47$1120
13725
11908
  };
13726
11909
  }
13727
11910
  function f4ah6o$jww_parser$$parse(data) {
13728
11911
  return f4ah6o$jww_parser$core$$parse(data);
13729
11912
  }
13730
- function f4ah6o$jww_parser$$to_dxf_document(jww_doc) {
13731
- return f4ah6o$jww_parser$dxf$$convert_document(jww_doc);
13732
- }
13733
- function f4ah6o$jww_parser$$to_dxf_string(jww_doc) {
13734
- return f4ah6o$jww_parser$dxf$$to_string(f4ah6o$jww_parser$dxf$$convert_document(jww_doc));
13735
- }
13736
- function f4ah6o$jww_parser$$jww_to_dxf(data) {
13737
- return f4ah6o$jww_parser$dxf$$to_string(f4ah6o$jww_parser$dxf$$convert_document(f4ah6o$jww_parser$core$$parse(data)));
13738
- }
13739
11913
  function f4ah6o$jww_parser$$to_json_string(jww_doc) {
13740
11914
  return `{\"version\":${moonbitlang$core$uint$$UInt$to_string$46$inner(jww_doc.version, 10)}}`;
13741
11915
  }
13742
11916
 
13743
11917
  //#endregion
13744
- exports.jww_to_dxf = f4ah6o$jww_parser$$jww_to_dxf;
13745
11918
  exports.parse = f4ah6o$jww_parser$$parse;
13746
- exports.to_dxf_document = f4ah6o$jww_parser$$to_dxf_document;
13747
- exports.to_dxf_string = f4ah6o$jww_parser$$to_dxf_string;
13748
11919
  exports.to_json_string = f4ah6o$jww_parser$$to_json_string;
13749
11920
  //# sourceMappingURL=index.cjs.map