qsharp-lang 1.26.2-dev → 1.26.3-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/dist/data-structures/circuit.d.ts +0 -15
  2. package/dist/data-structures/circuit.js +1 -19
  3. package/dist/katas-content.generated.js +1 -1
  4. package/dist/katas-content.generated.md.js +1 -1
  5. package/dist/samples.generated.js +4 -4
  6. package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +1 -1
  7. package/docs/Microsoft.Quantum.Core/Length.md +1 -1
  8. package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
  9. package/docs/Microsoft.Quantum.Core/RangeStart.md +1 -1
  10. package/docs/Microsoft.Quantum.Core/Repeated.md +1 -1
  11. package/docs/Microsoft.Quantum.Core/index.md +1 -1
  12. package/docs/Std.Arithmetic/AddLE.md +1 -1
  13. package/docs/Std.Arithmetic/ApplyIfEqualL.md +1 -1
  14. package/docs/Std.Arithmetic/ApplyIfEqualLE.md +1 -1
  15. package/docs/Std.Arithmetic/ApplyIfGreaterL.md +1 -1
  16. package/docs/Std.Arithmetic/ApplyIfGreaterLE.md +1 -1
  17. package/docs/Std.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
  18. package/docs/Std.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
  19. package/docs/Std.Arithmetic/ApplyIfLessL.md +1 -1
  20. package/docs/Std.Arithmetic/ApplyIfLessLE.md +1 -1
  21. package/docs/Std.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
  22. package/docs/Std.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
  23. package/docs/Std.Arithmetic/FourierTDIncByLE.md +1 -1
  24. package/docs/Std.Arithmetic/IncByI.md +1 -1
  25. package/docs/Std.Arithmetic/IncByIUsingIncByLE.md +1 -1
  26. package/docs/Std.Arithmetic/IncByL.md +1 -1
  27. package/docs/Std.Arithmetic/IncByLE.md +1 -1
  28. package/docs/Std.Arithmetic/IncByLEUsingAddLE.md +1 -1
  29. package/docs/Std.Arithmetic/IncByLUsingIncByLE.md +1 -1
  30. package/docs/Std.Arithmetic/LookAheadDKRSAddLE.md +1 -1
  31. package/docs/Std.Arithmetic/MAJ.md +1 -1
  32. package/docs/Std.Arithmetic/ReflectAboutInteger.md +1 -1
  33. package/docs/Std.Arithmetic/RippleCarryCGAddLE.md +1 -1
  34. package/docs/Std.Arithmetic/RippleCarryCGIncByLE.md +1 -1
  35. package/docs/Std.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
  36. package/docs/Std.Arithmetic/index.md +1 -1
  37. package/docs/Std.Arrays/All.md +1 -1
  38. package/docs/Std.Arrays/Any.md +1 -1
  39. package/docs/Std.Arrays/Chunks.md +1 -1
  40. package/docs/Std.Arrays/CircularlyShifted.md +1 -1
  41. package/docs/Std.Arrays/ColumnAt.md +1 -1
  42. package/docs/Std.Arrays/Count.md +1 -1
  43. package/docs/Std.Arrays/Diagonal.md +1 -1
  44. package/docs/Std.Arrays/DrawMany.md +1 -1
  45. package/docs/Std.Arrays/Enumerated.md +1 -1
  46. package/docs/Std.Arrays/Excluding.md +1 -1
  47. package/docs/Std.Arrays/Filtered.md +1 -1
  48. package/docs/Std.Arrays/FlatMapped.md +1 -1
  49. package/docs/Std.Arrays/Flattened.md +1 -1
  50. package/docs/Std.Arrays/Fold.md +1 -1
  51. package/docs/Std.Arrays/ForEach.md +1 -1
  52. package/docs/Std.Arrays/Head.md +1 -1
  53. package/docs/Std.Arrays/HeadAndRest.md +1 -1
  54. package/docs/Std.Arrays/IndexOf.md +1 -1
  55. package/docs/Std.Arrays/IndexRange.md +1 -1
  56. package/docs/Std.Arrays/Interleaved.md +1 -1
  57. package/docs/Std.Arrays/IsEmpty.md +1 -1
  58. package/docs/Std.Arrays/IsRectangularArray.md +1 -1
  59. package/docs/Std.Arrays/IsSorted.md +1 -1
  60. package/docs/Std.Arrays/IsSquareArray.md +1 -1
  61. package/docs/Std.Arrays/Mapped.md +1 -1
  62. package/docs/Std.Arrays/MappedByIndex.md +1 -1
  63. package/docs/Std.Arrays/MappedOverRange.md +1 -1
  64. package/docs/Std.Arrays/Most.md +1 -1
  65. package/docs/Std.Arrays/MostAndTail.md +1 -1
  66. package/docs/Std.Arrays/Padded.md +1 -1
  67. package/docs/Std.Arrays/Partitioned.md +1 -1
  68. package/docs/Std.Arrays/Rest.md +1 -1
  69. package/docs/Std.Arrays/Reversed.md +1 -1
  70. package/docs/Std.Arrays/SequenceI.md +1 -1
  71. package/docs/Std.Arrays/SequenceL.md +1 -1
  72. package/docs/Std.Arrays/Sorted.md +1 -1
  73. package/docs/Std.Arrays/Subarray.md +1 -1
  74. package/docs/Std.Arrays/Swapped.md +1 -1
  75. package/docs/Std.Arrays/Tail.md +1 -1
  76. package/docs/Std.Arrays/Transposed.md +1 -1
  77. package/docs/Std.Arrays/Unzipped.md +1 -1
  78. package/docs/Std.Arrays/Where.md +1 -1
  79. package/docs/Std.Arrays/Windows.md +1 -1
  80. package/docs/Std.Arrays/Zipped.md +1 -1
  81. package/docs/Std.Arrays/index.md +1 -1
  82. package/docs/Std.Canon/ApplyCNOTChain.md +1 -1
  83. package/docs/Std.Canon/ApplyControlledOnBitString.md +1 -1
  84. package/docs/Std.Canon/ApplyControlledOnInt.md +1 -1
  85. package/docs/Std.Canon/ApplyOperationPowerA.md +1 -1
  86. package/docs/Std.Canon/ApplyOperationPowerCA.md +1 -1
  87. package/docs/Std.Canon/ApplyP.md +1 -1
  88. package/docs/Std.Canon/ApplyPauli.md +1 -1
  89. package/docs/Std.Canon/ApplyPauliFromBitString.md +1 -1
  90. package/docs/Std.Canon/ApplyPauliFromInt.md +1 -1
  91. package/docs/Std.Canon/ApplyQFT.md +1 -1
  92. package/docs/Std.Canon/ApplyQPE.md +1 -1
  93. package/docs/Std.Canon/ApplyToEach.md +1 -1
  94. package/docs/Std.Canon/ApplyToEachA.md +1 -1
  95. package/docs/Std.Canon/ApplyToEachC.md +1 -1
  96. package/docs/Std.Canon/ApplyToEachCA.md +1 -1
  97. package/docs/Std.Canon/ApplyXorInPlace.md +1 -1
  98. package/docs/Std.Canon/ApplyXorInPlaceL.md +1 -1
  99. package/docs/Std.Canon/CX.md +1 -1
  100. package/docs/Std.Canon/CY.md +1 -1
  101. package/docs/Std.Canon/CZ.md +1 -1
  102. package/docs/Std.Canon/Fst.md +1 -1
  103. package/docs/Std.Canon/MapPauliAxis.md +1 -1
  104. package/docs/Std.Canon/Relabel.md +1 -1
  105. package/docs/Std.Canon/Snd.md +1 -1
  106. package/docs/Std.Canon/SwapReverseRegister.md +1 -1
  107. package/docs/Std.Canon/index.md +1 -1
  108. package/docs/Std.Convert/BigIntAsBoolArray.md +1 -1
  109. package/docs/Std.Convert/BigIntAsInt.md +1 -1
  110. package/docs/Std.Convert/BoolArrayAsBigInt.md +1 -1
  111. package/docs/Std.Convert/BoolArrayAsInt.md +1 -1
  112. package/docs/Std.Convert/BoolArrayAsResultArray.md +1 -1
  113. package/docs/Std.Convert/BoolAsResult.md +1 -1
  114. package/docs/Std.Convert/ComplexAsComplexPolar.md +1 -1
  115. package/docs/Std.Convert/ComplexPolarAsComplex.md +1 -1
  116. package/docs/Std.Convert/DoubleAsStringWithPrecision.md +1 -1
  117. package/docs/Std.Convert/IntAsBigInt.md +1 -1
  118. package/docs/Std.Convert/IntAsBoolArray.md +1 -1
  119. package/docs/Std.Convert/IntAsDouble.md +1 -1
  120. package/docs/Std.Convert/ResultArrayAsBoolArray.md +1 -1
  121. package/docs/Std.Convert/ResultArrayAsInt.md +1 -1
  122. package/docs/Std.Convert/ResultAsBool.md +1 -1
  123. package/docs/Std.Convert/index.md +1 -1
  124. package/docs/Std.Core/Complex.md +1 -1
  125. package/docs/Std.Core/Length.md +1 -1
  126. package/docs/Std.Core/Repeated.md +1 -1
  127. package/docs/Std.Core/index.md +1 -1
  128. package/docs/Std.Diagnostics/ApplyIdleNoise.md +1 -1
  129. package/docs/Std.Diagnostics/BitFlipNoise.md +1 -1
  130. package/docs/Std.Diagnostics/CheckAllZero.md +1 -1
  131. package/docs/Std.Diagnostics/CheckOperationsAreEqual.md +1 -1
  132. package/docs/Std.Diagnostics/CheckZero.md +1 -1
  133. package/docs/Std.Diagnostics/ConfigurePauliNoise.md +1 -1
  134. package/docs/Std.Diagnostics/ConfigureQubitLoss.md +1 -1
  135. package/docs/Std.Diagnostics/DepolarizingNoise.md +1 -1
  136. package/docs/Std.Diagnostics/DumpMachine.md +1 -1
  137. package/docs/Std.Diagnostics/DumpOperation.md +1 -1
  138. package/docs/Std.Diagnostics/DumpRegister.md +1 -1
  139. package/docs/Std.Diagnostics/Fact.md +1 -1
  140. package/docs/Std.Diagnostics/NoNoise.md +1 -1
  141. package/docs/Std.Diagnostics/PhaseFlipNoise.md +1 -1
  142. package/docs/Std.Diagnostics/PostSelectZ.md +40 -0
  143. package/docs/Std.Diagnostics/StartCountingFunction.md +1 -1
  144. package/docs/Std.Diagnostics/StartCountingOperation.md +1 -1
  145. package/docs/Std.Diagnostics/StartCountingQubits.md +1 -1
  146. package/docs/Std.Diagnostics/StopCountingFunction.md +1 -1
  147. package/docs/Std.Diagnostics/StopCountingOperation.md +1 -1
  148. package/docs/Std.Diagnostics/StopCountingQubits.md +1 -1
  149. package/docs/Std.Diagnostics/index.md +2 -1
  150. package/docs/Std.Intrinsic/AND.md +1 -1
  151. package/docs/Std.Intrinsic/ApplyUnitary.md +1 -1
  152. package/docs/Std.Intrinsic/CCNOT.md +1 -1
  153. package/docs/Std.Intrinsic/CNOT.md +1 -1
  154. package/docs/Std.Intrinsic/Exp.md +1 -1
  155. package/docs/Std.Intrinsic/H.md +1 -1
  156. package/docs/Std.Intrinsic/I.md +1 -1
  157. package/docs/Std.Intrinsic/M.md +1 -1
  158. package/docs/Std.Intrinsic/Measure.md +1 -1
  159. package/docs/Std.Intrinsic/Message.md +1 -1
  160. package/docs/Std.Intrinsic/R.md +1 -1
  161. package/docs/Std.Intrinsic/R1.md +1 -1
  162. package/docs/Std.Intrinsic/R1Frac.md +1 -1
  163. package/docs/Std.Intrinsic/RFrac.md +1 -1
  164. package/docs/Std.Intrinsic/Reset.md +1 -1
  165. package/docs/Std.Intrinsic/ResetAll.md +1 -1
  166. package/docs/Std.Intrinsic/Rx.md +1 -1
  167. package/docs/Std.Intrinsic/Rxx.md +1 -1
  168. package/docs/Std.Intrinsic/Ry.md +1 -1
  169. package/docs/Std.Intrinsic/Ryy.md +1 -1
  170. package/docs/Std.Intrinsic/Rz.md +1 -1
  171. package/docs/Std.Intrinsic/Rzz.md +1 -1
  172. package/docs/Std.Intrinsic/S.md +1 -1
  173. package/docs/Std.Intrinsic/SWAP.md +1 -1
  174. package/docs/Std.Intrinsic/SX.md +1 -1
  175. package/docs/Std.Intrinsic/T.md +1 -1
  176. package/docs/Std.Intrinsic/X.md +1 -1
  177. package/docs/Std.Intrinsic/Y.md +1 -1
  178. package/docs/Std.Intrinsic/Z.md +1 -1
  179. package/docs/Std.Intrinsic/index.md +1 -1
  180. package/docs/Std.Logical/Xor.md +1 -1
  181. package/docs/Std.Logical/index.md +1 -1
  182. package/docs/Std.Math/AbsComplex.md +1 -1
  183. package/docs/Std.Math/AbsComplexPolar.md +1 -1
  184. package/docs/Std.Math/AbsD.md +1 -1
  185. package/docs/Std.Math/AbsI.md +1 -1
  186. package/docs/Std.Math/AbsL.md +1 -1
  187. package/docs/Std.Math/AbsSquaredComplex.md +1 -1
  188. package/docs/Std.Math/AbsSquaredComplexPolar.md +1 -1
  189. package/docs/Std.Math/ApproximateFactorial.md +1 -1
  190. package/docs/Std.Math/ArcCos.md +1 -1
  191. package/docs/Std.Math/ArcCosh.md +1 -1
  192. package/docs/Std.Math/ArcSin.md +1 -1
  193. package/docs/Std.Math/ArcSinh.md +1 -1
  194. package/docs/Std.Math/ArcTan.md +1 -1
  195. package/docs/Std.Math/ArcTan2.md +1 -1
  196. package/docs/Std.Math/ArcTanh.md +1 -1
  197. package/docs/Std.Math/ArgComplex.md +1 -1
  198. package/docs/Std.Math/ArgComplexPolar.md +1 -1
  199. package/docs/Std.Math/Binom.md +1 -1
  200. package/docs/Std.Math/BitSizeI.md +1 -1
  201. package/docs/Std.Math/BitSizeL.md +1 -1
  202. package/docs/Std.Math/Ceiling.md +1 -1
  203. package/docs/Std.Math/Complex.md +1 -1
  204. package/docs/Std.Math/ComplexPolar.md +1 -1
  205. package/docs/Std.Math/ContinuedFractionConvergentI.md +1 -1
  206. package/docs/Std.Math/ContinuedFractionConvergentL.md +1 -1
  207. package/docs/Std.Math/Cos.md +1 -1
  208. package/docs/Std.Math/Cosh.md +1 -1
  209. package/docs/Std.Math/DivRemI.md +1 -1
  210. package/docs/Std.Math/DivRemL.md +1 -1
  211. package/docs/Std.Math/DividedByC.md +1 -1
  212. package/docs/Std.Math/DividedByCP.md +1 -1
  213. package/docs/Std.Math/E.md +1 -1
  214. package/docs/Std.Math/ExpModI.md +1 -1
  215. package/docs/Std.Math/ExpModL.md +1 -1
  216. package/docs/Std.Math/ExtendedGreatestCommonDivisorI.md +1 -1
  217. package/docs/Std.Math/ExtendedGreatestCommonDivisorL.md +1 -1
  218. package/docs/Std.Math/FactorialI.md +1 -1
  219. package/docs/Std.Math/FactorialL.md +1 -1
  220. package/docs/Std.Math/Floor.md +1 -1
  221. package/docs/Std.Math/GreatestCommonDivisorI.md +1 -1
  222. package/docs/Std.Math/GreatestCommonDivisorL.md +1 -1
  223. package/docs/Std.Math/HammingWeightI.md +1 -1
  224. package/docs/Std.Math/InverseModI.md +1 -1
  225. package/docs/Std.Math/InverseModL.md +1 -1
  226. package/docs/Std.Math/IsCoprimeI.md +1 -1
  227. package/docs/Std.Math/IsCoprimeL.md +1 -1
  228. package/docs/Std.Math/IsInfinite.md +1 -1
  229. package/docs/Std.Math/IsNaN.md +1 -1
  230. package/docs/Std.Math/LargestFixedPoint.md +1 -1
  231. package/docs/Std.Math/Lg.md +1 -1
  232. package/docs/Std.Math/Log.md +1 -1
  233. package/docs/Std.Math/Log10.md +1 -1
  234. package/docs/Std.Math/LogFactorialD.md +1 -1
  235. package/docs/Std.Math/LogGammaD.md +1 -1
  236. package/docs/Std.Math/LogOf2.md +1 -1
  237. package/docs/Std.Math/Max.md +1 -1
  238. package/docs/Std.Math/MaxD.md +1 -1
  239. package/docs/Std.Math/MaxI.md +1 -1
  240. package/docs/Std.Math/MaxL.md +1 -1
  241. package/docs/Std.Math/Min.md +1 -1
  242. package/docs/Std.Math/MinD.md +1 -1
  243. package/docs/Std.Math/MinI.md +1 -1
  244. package/docs/Std.Math/MinL.md +1 -1
  245. package/docs/Std.Math/MinusC.md +1 -1
  246. package/docs/Std.Math/MinusCP.md +1 -1
  247. package/docs/Std.Math/ModulusI.md +1 -1
  248. package/docs/Std.Math/ModulusL.md +1 -1
  249. package/docs/Std.Math/NegationC.md +1 -1
  250. package/docs/Std.Math/NegationCP.md +1 -1
  251. package/docs/Std.Math/PI.md +1 -1
  252. package/docs/Std.Math/PNorm.md +1 -1
  253. package/docs/Std.Math/PNormalized.md +1 -1
  254. package/docs/Std.Math/PlusC.md +1 -1
  255. package/docs/Std.Math/PlusCP.md +1 -1
  256. package/docs/Std.Math/PowC.md +1 -1
  257. package/docs/Std.Math/PowCP.md +1 -1
  258. package/docs/Std.Math/RealMod.md +1 -1
  259. package/docs/Std.Math/Round.md +1 -1
  260. package/docs/Std.Math/RoundHalfAwayFromZero.md +1 -1
  261. package/docs/Std.Math/SignD.md +1 -1
  262. package/docs/Std.Math/SignI.md +1 -1
  263. package/docs/Std.Math/SignL.md +1 -1
  264. package/docs/Std.Math/Sin.md +1 -1
  265. package/docs/Std.Math/Sinh.md +1 -1
  266. package/docs/Std.Math/SmallestFixedPoint.md +1 -1
  267. package/docs/Std.Math/Sqrt.md +1 -1
  268. package/docs/Std.Math/SquaredNorm.md +1 -1
  269. package/docs/Std.Math/Tan.md +1 -1
  270. package/docs/Std.Math/Tanh.md +1 -1
  271. package/docs/Std.Math/TimesC.md +1 -1
  272. package/docs/Std.Math/TimesCP.md +1 -1
  273. package/docs/Std.Math/TrailingZeroCountI.md +1 -1
  274. package/docs/Std.Math/TrailingZeroCountL.md +1 -1
  275. package/docs/Std.Math/Truncate.md +1 -1
  276. package/docs/Std.Math/index.md +1 -1
  277. package/docs/Std.Measurement/IsLossResult.md +1 -1
  278. package/docs/Std.Measurement/MResetEachZ.md +1 -1
  279. package/docs/Std.Measurement/MResetX.md +1 -1
  280. package/docs/Std.Measurement/MResetY.md +1 -1
  281. package/docs/Std.Measurement/MResetZ.md +1 -1
  282. package/docs/Std.Measurement/MResetZChecked.md +1 -1
  283. package/docs/Std.Measurement/MeasureAllZ.md +1 -1
  284. package/docs/Std.Measurement/MeasureEachZ.md +1 -1
  285. package/docs/Std.Measurement/MeasureInteger.md +1 -1
  286. package/docs/Std.Measurement/index.md +1 -1
  287. package/docs/Std.Random/DrawRandomBool.md +1 -1
  288. package/docs/Std.Random/DrawRandomDouble.md +1 -1
  289. package/docs/Std.Random/DrawRandomInt.md +1 -1
  290. package/docs/Std.Random/index.md +1 -1
  291. package/docs/Std.Range/IsRangeEmpty.md +1 -1
  292. package/docs/Std.Range/RangeEnd.md +1 -1
  293. package/docs/Std.Range/RangeReverse.md +1 -1
  294. package/docs/Std.Range/RangeStart.md +1 -1
  295. package/docs/Std.Range/RangeStep.md +1 -1
  296. package/docs/Std.Range/index.md +1 -1
  297. package/docs/Std.ResourceEstimation/AccountForEstimates.md +1 -1
  298. package/docs/Std.ResourceEstimation/AuxQubitCount.md +1 -1
  299. package/docs/Std.ResourceEstimation/BeginEstimateCaching.md +1 -1
  300. package/docs/Std.ResourceEstimation/BeginRepeatEstimates.md +1 -1
  301. package/docs/Std.ResourceEstimation/CczCount.md +1 -1
  302. package/docs/Std.ResourceEstimation/EnableMemoryComputeArchitecture.md +1 -1
  303. package/docs/Std.ResourceEstimation/EndEstimateCaching.md +1 -1
  304. package/docs/Std.ResourceEstimation/EndRepeatEstimates.md +1 -1
  305. package/docs/Std.ResourceEstimation/LeastFrequentlyUsed.md +1 -1
  306. package/docs/Std.ResourceEstimation/LeastRecentlyUsed.md +1 -1
  307. package/docs/Std.ResourceEstimation/MeasurementCount.md +1 -1
  308. package/docs/Std.ResourceEstimation/PSSPCLayout.md +1 -1
  309. package/docs/Std.ResourceEstimation/RepeatEstimates.md +1 -1
  310. package/docs/Std.ResourceEstimation/RotationCount.md +1 -1
  311. package/docs/Std.ResourceEstimation/RotationDepth.md +1 -1
  312. package/docs/Std.ResourceEstimation/SingleVariant.md +1 -1
  313. package/docs/Std.ResourceEstimation/TCount.md +1 -1
  314. package/docs/Std.ResourceEstimation/index.md +1 -1
  315. package/docs/Std.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
  316. package/docs/Std.StatePreparation/PreparePureStateD.md +1 -1
  317. package/docs/Std.StatePreparation/PrepareUniformSuperposition.md +1 -1
  318. package/docs/Std.StatePreparation/index.md +1 -1
  319. package/docs/Std.TableLookup/Select.md +1 -1
  320. package/docs/Std.TableLookup/index.md +1 -1
  321. package/docs/index.md +1 -1
  322. package/docs/toc.yml +1 -0
  323. package/lib/nodejs/qsc_wasm.cjs +1318 -1392
  324. package/lib/nodejs/qsc_wasm.d.cts +313 -290
  325. package/lib/nodejs/qsc_wasm_bg.wasm +0 -0
  326. package/lib/web/qsc_wasm.d.ts +388 -364
  327. package/lib/web/qsc_wasm.js +1346 -1346
  328. package/lib/web/qsc_wasm_bg.wasm +0 -0
  329. package/package.json +1 -1
  330. package/ux/circuit-vis/circuit.ts +0 -1
  331. package/ux/circuit-vis/formatters/gateFormatter.ts +111 -86
  332. package/ux/circuit-vis/formatters/registerFormatter.ts +2 -5
  333. package/ux/circuit-vis/gateRenderData.ts +10 -3
  334. package/ux/circuit-vis/panel.ts +1 -0
  335. package/ux/circuit-vis/process.ts +162 -57
  336. package/ux/circuit-vis/sqore.ts +34 -28
  337. package/ux/circuit-vis/utils.ts +2 -1
@@ -1,339 +1,578 @@
1
- let wasm;
1
+ /* @ts-self-types="./qsc_wasm.d.ts" */
2
2
 
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let WASM_VECTOR_LEN = 0;
10
-
11
- let cachedUint8ArrayMemory0 = null;
12
-
13
- function getUint8ArrayMemory0() {
14
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
16
- }
17
- return cachedUint8ArrayMemory0;
18
- }
19
-
20
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
21
-
22
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
23
- ? function (arg, view) {
24
- return cachedTextEncoder.encodeInto(arg, view);
25
- }
26
- : function (arg, view) {
27
- const buf = cachedTextEncoder.encode(arg);
28
- view.set(buf);
29
- return {
30
- read: arg.length,
31
- written: buf.length
32
- };
33
- });
34
-
35
- function passStringToWasm0(arg, malloc, realloc) {
36
-
37
- if (realloc === undefined) {
38
- const buf = cachedTextEncoder.encode(arg);
39
- const ptr = malloc(buf.length, 1) >>> 0;
40
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
41
- WASM_VECTOR_LEN = buf.length;
3
+ export class DebugService {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ DebugServiceFinalization.unregister(this);
42
8
  return ptr;
43
9
  }
44
-
45
- let len = arg.length;
46
- let ptr = malloc(len, 1) >>> 0;
47
-
48
- const mem = getUint8ArrayMemory0();
49
-
50
- let offset = 0;
51
-
52
- for (; offset < len; offset++) {
53
- const code = arg.charCodeAt(offset);
54
- if (code > 0x7F) break;
55
- mem[ptr + offset] = code;
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_debugservice_free(ptr, 0);
56
13
  }
57
-
58
- if (offset !== len) {
59
- if (offset !== 0) {
60
- arg = arg.slice(offset);
14
+ /**
15
+ * @returns {IQuantumStateList}
16
+ */
17
+ capture_quantum_state() {
18
+ const ret = wasm.debugservice_capture_quantum_state(this.__wbg_ptr);
19
+ return takeObject(ret);
20
+ }
21
+ /**
22
+ * @param {Function} event_cb
23
+ * @param {Uint32Array} ids
24
+ * @returns {IStructStepResult}
25
+ */
26
+ eval_continue(event_cb, ids) {
27
+ try {
28
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
29
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
30
+ const len0 = WASM_VECTOR_LEN;
31
+ wasm.debugservice_eval_continue(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
32
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
33
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
34
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
35
+ if (r2) {
36
+ throw takeObject(r1);
37
+ }
38
+ return takeObject(r0);
39
+ } finally {
40
+ wasm.__wbindgen_add_to_stack_pointer(16);
41
+ heap[stack_pointer++] = undefined;
61
42
  }
62
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
63
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
64
- const ret = encodeString(arg, view);
65
-
66
- offset += ret.written;
67
- ptr = realloc(ptr, len, offset, 1) >>> 0;
68
43
  }
69
-
70
- WASM_VECTOR_LEN = offset;
71
- return ptr;
72
- }
73
-
74
- let cachedDataViewMemory0 = null;
75
-
76
- function getDataViewMemory0() {
77
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
78
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
44
+ /**
45
+ * @param {Function} event_cb
46
+ * @param {Uint32Array} ids
47
+ * @returns {IStructStepResult}
48
+ */
49
+ eval_next(event_cb, ids) {
50
+ try {
51
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
52
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
53
+ const len0 = WASM_VECTOR_LEN;
54
+ wasm.debugservice_eval_next(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
55
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
56
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
57
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
58
+ if (r2) {
59
+ throw takeObject(r1);
60
+ }
61
+ return takeObject(r0);
62
+ } finally {
63
+ wasm.__wbindgen_add_to_stack_pointer(16);
64
+ heap[stack_pointer++] = undefined;
65
+ }
79
66
  }
80
- return cachedDataViewMemory0;
81
- }
82
-
83
- let heap_next = heap.length;
84
-
85
- function addHeapObject(obj) {
86
- if (heap_next === heap.length) heap.push(heap.length + 1);
87
- const idx = heap_next;
88
- heap_next = heap[idx];
89
-
90
- heap[idx] = obj;
91
- return idx;
92
- }
93
-
94
- function handleError(f, args) {
95
- try {
96
- return f.apply(this, args);
97
- } catch (e) {
98
- wasm.__wbindgen_export_2(addHeapObject(e));
67
+ /**
68
+ * @param {Function} event_cb
69
+ * @param {Uint32Array} ids
70
+ * @returns {IStructStepResult}
71
+ */
72
+ eval_step_in(event_cb, ids) {
73
+ try {
74
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
75
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
76
+ const len0 = WASM_VECTOR_LEN;
77
+ wasm.debugservice_eval_step_in(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
78
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
79
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
80
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
81
+ if (r2) {
82
+ throw takeObject(r1);
83
+ }
84
+ return takeObject(r0);
85
+ } finally {
86
+ wasm.__wbindgen_add_to_stack_pointer(16);
87
+ heap[stack_pointer++] = undefined;
88
+ }
99
89
  }
100
- }
101
-
102
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
103
-
104
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
105
-
106
- function getStringFromWasm0(ptr, len) {
107
- ptr = ptr >>> 0;
108
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
109
- }
110
-
111
- function isLikeNone(x) {
112
- return x === undefined || x === null;
113
- }
114
-
115
- function dropObject(idx) {
116
- if (idx < 132) return;
117
- heap[idx] = heap_next;
118
- heap_next = idx;
119
- }
120
-
121
- function takeObject(idx) {
122
- const ret = getObject(idx);
123
- dropObject(idx);
124
- return ret;
125
- }
126
-
127
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
128
- ? { register: () => {}, unregister: () => {} }
129
- : new FinalizationRegistry(state => {
130
- wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b)
131
- });
132
-
133
- function makeMutClosure(arg0, arg1, dtor, f) {
134
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
135
- const real = (...args) => {
136
- // First up with a closure we increment the internal reference
137
- // count. This ensures that the Rust closure environment won't
138
- // be deallocated while we're invoking it.
139
- state.cnt++;
140
- const a = state.a;
141
- state.a = 0;
90
+ /**
91
+ * @param {Function} event_cb
92
+ * @param {Uint32Array} ids
93
+ * @returns {IStructStepResult}
94
+ */
95
+ eval_step_out(event_cb, ids) {
142
96
  try {
143
- return f(a, state.b, ...args);
97
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
98
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
99
+ const len0 = WASM_VECTOR_LEN;
100
+ wasm.debugservice_eval_step_out(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
101
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
102
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
103
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
104
+ if (r2) {
105
+ throw takeObject(r1);
106
+ }
107
+ return takeObject(r0);
144
108
  } finally {
145
- if (--state.cnt === 0) {
146
- wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
147
- CLOSURE_DTORS.unregister(state);
148
- } else {
149
- state.a = a;
109
+ wasm.__wbindgen_add_to_stack_pointer(16);
110
+ heap[stack_pointer++] = undefined;
111
+ }
112
+ }
113
+ /**
114
+ * @param {string} path
115
+ * @returns {IBreakpointSpanList}
116
+ */
117
+ get_breakpoints(path) {
118
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
119
+ const len0 = WASM_VECTOR_LEN;
120
+ const ret = wasm.debugservice_get_breakpoints(this.__wbg_ptr, ptr0, len0);
121
+ return takeObject(ret);
122
+ }
123
+ /**
124
+ * @returns {any}
125
+ */
126
+ get_circuit() {
127
+ try {
128
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
129
+ wasm.debugservice_get_circuit(retptr, this.__wbg_ptr);
130
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
131
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
132
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
133
+ if (r2) {
134
+ throw takeObject(r1);
150
135
  }
136
+ return takeObject(r0);
137
+ } finally {
138
+ wasm.__wbindgen_add_to_stack_pointer(16);
151
139
  }
152
- };
153
- real.original = state;
154
- CLOSURE_DTORS.register(real, state, state);
155
- return real;
140
+ }
141
+ /**
142
+ * @param {number} frame_id
143
+ * @returns {IVariableList}
144
+ */
145
+ get_locals(frame_id) {
146
+ const ret = wasm.debugservice_get_locals(this.__wbg_ptr, frame_id);
147
+ return takeObject(ret);
148
+ }
149
+ /**
150
+ * @returns {IStackFrameList}
151
+ */
152
+ get_stack_frames() {
153
+ const ret = wasm.debugservice_get_stack_frames(this.__wbg_ptr);
154
+ return takeObject(ret);
155
+ }
156
+ /**
157
+ * @param {IProgramConfig} program
158
+ * @param {string | null} [entry]
159
+ * @returns {string}
160
+ */
161
+ load_program(program, entry) {
162
+ let deferred2_0;
163
+ let deferred2_1;
164
+ try {
165
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
166
+ var ptr0 = isLikeNone(entry) ? 0 : passStringToWasm0(entry, wasm.__wbindgen_export, wasm.__wbindgen_export2);
167
+ var len0 = WASM_VECTOR_LEN;
168
+ wasm.debugservice_load_program(retptr, this.__wbg_ptr, addHeapObject(program), ptr0, len0);
169
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
170
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
171
+ deferred2_0 = r0;
172
+ deferred2_1 = r1;
173
+ return getStringFromWasm0(r0, r1);
174
+ } finally {
175
+ wasm.__wbindgen_add_to_stack_pointer(16);
176
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
177
+ }
178
+ }
179
+ constructor() {
180
+ const ret = wasm.debugservice_new();
181
+ this.__wbg_ptr = ret >>> 0;
182
+ DebugServiceFinalization.register(this, this.__wbg_ptr, this);
183
+ return this;
184
+ }
156
185
  }
186
+ if (Symbol.dispose) DebugService.prototype[Symbol.dispose] = DebugService.prototype.free;
157
187
 
158
- function debugString(val) {
159
- // primitive types
160
- const type = typeof val;
161
- if (type == 'number' || type == 'boolean' || val == null) {
162
- return `${val}`;
188
+ export class LanguageService {
189
+ __destroy_into_raw() {
190
+ const ptr = this.__wbg_ptr;
191
+ this.__wbg_ptr = 0;
192
+ LanguageServiceFinalization.unregister(this);
193
+ return ptr;
163
194
  }
164
- if (type == 'string') {
165
- return `"${val}"`;
195
+ free() {
196
+ const ptr = this.__destroy_into_raw();
197
+ wasm.__wbg_languageservice_free(ptr, 0);
166
198
  }
167
- if (type == 'symbol') {
168
- const description = val.description;
169
- if (description == null) {
170
- return 'Symbol';
171
- } else {
172
- return `Symbol(${description})`;
199
+ /**
200
+ * @param {string} uri
201
+ * @param {string} language_id
202
+ */
203
+ close_document(uri, language_id) {
204
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
205
+ const len0 = WASM_VECTOR_LEN;
206
+ const ptr1 = passStringToWasm0(language_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
207
+ const len1 = WASM_VECTOR_LEN;
208
+ wasm.languageservice_close_document(this.__wbg_ptr, ptr0, len0, ptr1, len1);
209
+ }
210
+ /**
211
+ * @param {string} notebook_uri
212
+ */
213
+ close_notebook_document(notebook_uri) {
214
+ const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
215
+ const len0 = WASM_VECTOR_LEN;
216
+ wasm.languageservice_close_notebook_document(this.__wbg_ptr, ptr0, len0);
217
+ }
218
+ /**
219
+ * @param {string} uri
220
+ * @param {IRange} range
221
+ * @returns {ICodeAction[]}
222
+ */
223
+ get_code_actions(uri, range) {
224
+ try {
225
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
226
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
227
+ const len0 = WASM_VECTOR_LEN;
228
+ wasm.languageservice_get_code_actions(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(range));
229
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
230
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
231
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
232
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
233
+ return v2;
234
+ } finally {
235
+ wasm.__wbindgen_add_to_stack_pointer(16);
173
236
  }
174
237
  }
175
- if (type == 'function') {
176
- const name = val.name;
177
- if (typeof name == 'string' && name.length > 0) {
178
- return `Function(${name})`;
179
- } else {
180
- return 'Function';
238
+ /**
239
+ * @param {string} uri
240
+ * @returns {ICodeLens[]}
241
+ */
242
+ get_code_lenses(uri) {
243
+ try {
244
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
245
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
246
+ const len0 = WASM_VECTOR_LEN;
247
+ wasm.languageservice_get_code_lenses(retptr, this.__wbg_ptr, ptr0, len0);
248
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
249
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
250
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
251
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
252
+ return v2;
253
+ } finally {
254
+ wasm.__wbindgen_add_to_stack_pointer(16);
181
255
  }
182
256
  }
183
- // objects
184
- if (Array.isArray(val)) {
185
- const length = val.length;
186
- let debug = '[';
187
- if (length > 0) {
188
- debug += debugString(val[0]);
257
+ /**
258
+ * @param {string} uri
259
+ * @param {IPosition} position
260
+ * @returns {ICompletionList}
261
+ */
262
+ get_completions(uri, position) {
263
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
264
+ const len0 = WASM_VECTOR_LEN;
265
+ const ret = wasm.languageservice_get_completions(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
266
+ return takeObject(ret);
267
+ }
268
+ /**
269
+ * @param {string} uri
270
+ * @param {IPosition} position
271
+ * @returns {ILocation | undefined}
272
+ */
273
+ get_definition(uri, position) {
274
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
275
+ const len0 = WASM_VECTOR_LEN;
276
+ const ret = wasm.languageservice_get_definition(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
277
+ return takeObject(ret);
278
+ }
279
+ /**
280
+ * @param {string} uri
281
+ * @returns {ITextEdit[]}
282
+ */
283
+ get_format_changes(uri) {
284
+ try {
285
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
286
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
287
+ const len0 = WASM_VECTOR_LEN;
288
+ wasm.languageservice_get_format_changes(retptr, this.__wbg_ptr, ptr0, len0);
289
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
290
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
291
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
292
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
293
+ return v2;
294
+ } finally {
295
+ wasm.__wbindgen_add_to_stack_pointer(16);
189
296
  }
190
- for(let i = 1; i < length; i++) {
191
- debug += ', ' + debugString(val[i]);
297
+ }
298
+ /**
299
+ * @param {string} uri
300
+ * @param {IPosition} position
301
+ * @returns {IHover | undefined}
302
+ */
303
+ get_hover(uri, position) {
304
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
305
+ const len0 = WASM_VECTOR_LEN;
306
+ const ret = wasm.languageservice_get_hover(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
307
+ return takeObject(ret);
308
+ }
309
+ /**
310
+ * @param {string} uri
311
+ * @param {IPosition} position
312
+ * @param {boolean} include_declaration
313
+ * @returns {ILocation[]}
314
+ */
315
+ get_references(uri, position, include_declaration) {
316
+ try {
317
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
318
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
319
+ const len0 = WASM_VECTOR_LEN;
320
+ wasm.languageservice_get_references(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(position), include_declaration);
321
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
322
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
323
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
324
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
325
+ return v2;
326
+ } finally {
327
+ wasm.__wbindgen_add_to_stack_pointer(16);
192
328
  }
193
- debug += ']';
194
- return debug;
195
329
  }
196
- // Test for built-in
197
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
198
- let className;
199
- if (builtInMatches && builtInMatches.length > 1) {
200
- className = builtInMatches[1];
201
- } else {
202
- // Failed to match the standard '[object ClassName]'
203
- return toString.call(val);
330
+ /**
331
+ * @param {string} uri
332
+ * @param {IPosition} position
333
+ * @param {string} new_name
334
+ * @returns {IWorkspaceEdit}
335
+ */
336
+ get_rename(uri, position, new_name) {
337
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
338
+ const len0 = WASM_VECTOR_LEN;
339
+ const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
340
+ const len1 = WASM_VECTOR_LEN;
341
+ const ret = wasm.languageservice_get_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position), ptr1, len1);
342
+ return takeObject(ret);
204
343
  }
205
- if (className == 'Object') {
206
- // we're a user defined class or Object
207
- // JSON.stringify avoids problems with cycles, and is generally much
208
- // easier than looping through ownProperties of `val`.
344
+ /**
345
+ * @param {string} uri
346
+ * @param {IPosition} position
347
+ * @returns {ISignatureHelp | undefined}
348
+ */
349
+ get_signature_help(uri, position) {
350
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
351
+ const len0 = WASM_VECTOR_LEN;
352
+ const ret = wasm.languageservice_get_signature_help(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
353
+ return takeObject(ret);
354
+ }
355
+ constructor() {
356
+ const ret = wasm.languageservice_new();
357
+ this.__wbg_ptr = ret >>> 0;
358
+ LanguageServiceFinalization.register(this, this.__wbg_ptr, this);
359
+ return this;
360
+ }
361
+ /**
362
+ * @param {string} uri
363
+ * @param {IPosition} position
364
+ * @returns {ITextEdit | undefined}
365
+ */
366
+ prepare_rename(uri, position) {
367
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
368
+ const len0 = WASM_VECTOR_LEN;
369
+ const ret = wasm.languageservice_prepare_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
370
+ return takeObject(ret);
371
+ }
372
+ /**
373
+ * @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
374
+ * @param {(callables: ITestDescriptor[]) => void} test_callables_callback
375
+ * @param {IProjectHost} host
376
+ * @returns {Promise<any>}
377
+ */
378
+ start_background_work(diagnostics_callback, test_callables_callback, host) {
209
379
  try {
210
- return 'Object(' + JSON.stringify(val) + ')';
211
- } catch (_) {
212
- return 'Object';
380
+ const ret = wasm.languageservice_start_background_work(this.__wbg_ptr, addBorrowedObject(diagnostics_callback), addBorrowedObject(test_callables_callback), addHeapObject(host));
381
+ return takeObject(ret);
382
+ } finally {
383
+ heap[stack_pointer++] = undefined;
384
+ heap[stack_pointer++] = undefined;
213
385
  }
214
386
  }
215
- // errors
216
- if (val instanceof Error) {
217
- return `${val.name}: ${val.message}\n${val.stack}`;
387
+ stop_background_work() {
388
+ wasm.languageservice_stop_background_work(this.__wbg_ptr);
389
+ }
390
+ /**
391
+ * @param {IWorkspaceConfiguration} config
392
+ */
393
+ update_configuration(config) {
394
+ wasm.languageservice_update_configuration(this.__wbg_ptr, addHeapObject(config));
395
+ }
396
+ /**
397
+ * @param {string} uri
398
+ * @param {number} version
399
+ * @param {string} text
400
+ * @param {string} language_id
401
+ */
402
+ update_document(uri, version, text, language_id) {
403
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
404
+ const len0 = WASM_VECTOR_LEN;
405
+ const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
406
+ const len1 = WASM_VECTOR_LEN;
407
+ const ptr2 = passStringToWasm0(language_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
408
+ const len2 = WASM_VECTOR_LEN;
409
+ wasm.languageservice_update_document(this.__wbg_ptr, ptr0, len0, version, ptr1, len1, ptr2, len2);
410
+ }
411
+ /**
412
+ * @param {string} notebook_uri
413
+ * @param {INotebookMetadata} notebook_metadata
414
+ * @param {ICell[]} cells
415
+ */
416
+ update_notebook_document(notebook_uri, notebook_metadata, cells) {
417
+ const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
418
+ const len0 = WASM_VECTOR_LEN;
419
+ const ptr1 = passArrayJsValueToWasm0(cells, wasm.__wbindgen_export);
420
+ const len1 = WASM_VECTOR_LEN;
421
+ wasm.languageservice_update_notebook_document(this.__wbg_ptr, ptr0, len0, addHeapObject(notebook_metadata), ptr1, len1);
218
422
  }
219
- // TODO we could test for more things here, like `Set`s and `Map`s.
220
- return className;
221
- }
222
-
223
- let stack_pointer = 128;
224
-
225
- function addBorrowedObject(obj) {
226
- if (stack_pointer == 1) throw new Error('out of js stack');
227
- heap[--stack_pointer] = obj;
228
- return stack_pointer;
229
423
  }
424
+ if (Symbol.dispose) LanguageService.prototype[Symbol.dispose] = LanguageService.prototype.free;
230
425
 
231
- let cachedUint32ArrayMemory0 = null;
232
-
233
- function getUint32ArrayMemory0() {
234
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
235
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
426
+ /**
427
+ * a minimal implementation for interacting with async JS filesystem callbacks to
428
+ * load project files
429
+ */
430
+ export class ProjectLoader {
431
+ __destroy_into_raw() {
432
+ const ptr = this.__wbg_ptr;
433
+ this.__wbg_ptr = 0;
434
+ ProjectLoaderFinalization.unregister(this);
435
+ return ptr;
436
+ }
437
+ free() {
438
+ const ptr = this.__destroy_into_raw();
439
+ wasm.__wbg_projectloader_free(ptr, 0);
440
+ }
441
+ /**
442
+ * @param {string} file_path
443
+ * @param {string | null} [source]
444
+ * @returns {Promise<IProjectConfig>}
445
+ */
446
+ load_openqasm_project(file_path, source) {
447
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
448
+ const len0 = WASM_VECTOR_LEN;
449
+ var ptr1 = isLikeNone(source) ? 0 : passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
450
+ var len1 = WASM_VECTOR_LEN;
451
+ const ret = wasm.projectloader_load_openqasm_project(this.__wbg_ptr, ptr0, len0, ptr1, len1);
452
+ return takeObject(ret);
453
+ }
454
+ /**
455
+ * @param {string} directory
456
+ * @returns {Promise<IProjectConfig>}
457
+ */
458
+ load_project_with_deps(directory) {
459
+ const ptr0 = passStringToWasm0(directory, wasm.__wbindgen_export, wasm.__wbindgen_export2);
460
+ const len0 = WASM_VECTOR_LEN;
461
+ const ret = wasm.projectloader_load_project_with_deps(this.__wbg_ptr, ptr0, len0);
462
+ return takeObject(ret);
463
+ }
464
+ /**
465
+ * @param {IProjectHost} project_host
466
+ */
467
+ constructor(project_host) {
468
+ const ret = wasm.projectloader_new(addHeapObject(project_host));
469
+ this.__wbg_ptr = ret >>> 0;
470
+ ProjectLoaderFinalization.register(this, this.__wbg_ptr, this);
471
+ return this;
236
472
  }
237
- return cachedUint32ArrayMemory0;
238
473
  }
474
+ if (Symbol.dispose) ProjectLoader.prototype[Symbol.dispose] = ProjectLoader.prototype.free;
239
475
 
240
- function passArray32ToWasm0(arg, malloc) {
241
- const ptr = malloc(arg.length * 4, 4) >>> 0;
242
- getUint32ArrayMemory0().set(arg, ptr / 4);
243
- WASM_VECTOR_LEN = arg.length;
244
- return ptr;
245
- }
476
+ /**
477
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
478
+ */
479
+ export const StepResultId = Object.freeze({
480
+ BreakpointHit: 0, "0": "BreakpointHit",
481
+ Next: 1, "1": "Next",
482
+ StepIn: 2, "2": "StepIn",
483
+ StepOut: 3, "3": "StepOut",
484
+ Return: 4, "4": "Return",
485
+ Fail: 5, "5": "Fail",
486
+ });
246
487
 
247
- function passArrayJsValueToWasm0(array, malloc) {
248
- const ptr = malloc(array.length * 4, 4) >>> 0;
249
- const mem = getDataViewMemory0();
250
- for (let i = 0; i < array.length; i++) {
251
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
488
+ /**
489
+ * @param {string} solution_code
490
+ * @param {any} exercise_sources_js
491
+ * @param {Function} event_cb
492
+ * @returns {boolean}
493
+ */
494
+ export function check_exercise_solution(solution_code, exercise_sources_js, event_cb) {
495
+ try {
496
+ const ptr0 = passStringToWasm0(solution_code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
497
+ const len0 = WASM_VECTOR_LEN;
498
+ const ret = wasm.check_exercise_solution(ptr0, len0, addHeapObject(exercise_sources_js), addBorrowedObject(event_cb));
499
+ return ret !== 0;
500
+ } finally {
501
+ heap[stack_pointer++] = undefined;
252
502
  }
253
- WASM_VECTOR_LEN = array.length;
254
- return ptr;
255
503
  }
256
504
 
257
- function getArrayJsValueFromWasm0(ptr, len) {
258
- ptr = ptr >>> 0;
259
- const mem = getDataViewMemory0();
260
- const result = [];
261
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
262
- result.push(takeObject(mem.getUint32(i, true)));
263
- }
264
- return result;
265
- }
266
505
  /**
267
- * @param {any} callback
268
- * @param {number} level
506
+ * @param {IProgramConfig | null} [additional_program]
507
+ * @returns {IDocFile[]}
269
508
  */
270
- export function initLogging(callback, level) {
509
+ export function generate_docs(additional_program) {
271
510
  try {
272
511
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
273
- wasm.initLogging(retptr, addHeapObject(callback), level);
512
+ wasm.generate_docs(retptr, isLikeNone(additional_program) ? 0 : addHeapObject(additional_program));
274
513
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
275
514
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
276
- if (r1) {
277
- throw takeObject(r0);
278
- }
515
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
516
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
517
+ return v1;
279
518
  } finally {
280
519
  wasm.__wbindgen_add_to_stack_pointer(16);
281
520
  }
282
521
  }
283
522
 
284
523
  /**
285
- * @param {number} level
286
- */
287
- export function setLogLevel(level) {
288
- wasm.setLogLevel(level);
289
- }
290
-
291
- /**
524
+ * @param {string} code
525
+ * @param {string[]} language_features
292
526
  * @returns {string}
293
527
  */
294
- export function git_hash() {
295
- let deferred1_0;
296
- let deferred1_1;
528
+ export function get_ast(code, language_features) {
529
+ let deferred4_0;
530
+ let deferred4_1;
297
531
  try {
298
532
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
299
- wasm.git_hash(retptr);
533
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
534
+ const len0 = WASM_VECTOR_LEN;
535
+ const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export);
536
+ const len1 = WASM_VECTOR_LEN;
537
+ wasm.get_ast(retptr, ptr0, len0, ptr1, len1);
300
538
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
301
539
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
302
- deferred1_0 = r0;
303
- deferred1_1 = r1;
304
- return getStringFromWasm0(r0, r1);
540
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
541
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
542
+ var ptr3 = r0;
543
+ var len3 = r1;
544
+ if (r3) {
545
+ ptr3 = 0; len3 = 0;
546
+ throw takeObject(r2);
547
+ }
548
+ deferred4_0 = ptr3;
549
+ deferred4_1 = len3;
550
+ return getStringFromWasm0(ptr3, len3);
305
551
  } finally {
306
552
  wasm.__wbindgen_add_to_stack_pointer(16);
307
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
553
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
308
554
  }
309
555
  }
310
556
 
311
557
  /**
312
558
  * @param {IProgramConfig} program
313
- * @returns {string}
559
+ * @param {IOperationInfo | null | undefined} operation
560
+ * @param {ICircuitConfig} config
561
+ * @returns {any}
314
562
  */
315
- export function get_qir(program) {
316
- let deferred2_0;
317
- let deferred2_1;
563
+ export function get_circuit(program, operation, config) {
318
564
  try {
319
565
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
320
- wasm.get_qir(retptr, addHeapObject(program));
566
+ wasm.get_circuit(retptr, addHeapObject(program), isLikeNone(operation) ? 0 : addHeapObject(operation), addHeapObject(config));
321
567
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
322
568
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
323
569
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
324
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
325
- var ptr1 = r0;
326
- var len1 = r1;
327
- if (r3) {
328
- ptr1 = 0; len1 = 0;
329
- throw takeObject(r2);
570
+ if (r2) {
571
+ throw takeObject(r1);
330
572
  }
331
- deferred2_0 = ptr1;
332
- deferred2_1 = len1;
333
- return getStringFromWasm0(ptr1, len1);
573
+ return takeObject(r0);
334
574
  } finally {
335
575
  wasm.__wbindgen_add_to_stack_pointer(16);
336
- wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
337
576
  }
338
577
  }
339
578
 
@@ -348,9 +587,9 @@ export function get_estimates(program, expr, params) {
348
587
  let deferred4_1;
349
588
  try {
350
589
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
351
- const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
590
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
352
591
  const len0 = WASM_VECTOR_LEN;
353
- const ptr1 = passStringToWasm0(params, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
592
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_export, wasm.__wbindgen_export2);
354
593
  const len1 = WASM_VECTOR_LEN;
355
594
  wasm.get_estimates(retptr, addHeapObject(program), ptr0, len0, ptr1, len1);
356
595
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -368,29 +607,41 @@ export function get_estimates(program, expr, params) {
368
607
  return getStringFromWasm0(ptr3, len3);
369
608
  } finally {
370
609
  wasm.__wbindgen_add_to_stack_pointer(16);
371
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
610
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
372
611
  }
373
612
  }
374
613
 
375
614
  /**
376
- * @param {IProgramConfig} program
377
- * @param {IOperationInfo | null | undefined} operation
378
- * @param {ICircuitConfig} config
379
- * @returns {any}
615
+ * @param {string} code
616
+ * @param {string[]} language_features
617
+ * @returns {string}
380
618
  */
381
- export function get_circuit(program, operation, config) {
619
+ export function get_hir(code, language_features) {
620
+ let deferred4_0;
621
+ let deferred4_1;
382
622
  try {
383
623
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
384
- wasm.get_circuit(retptr, addHeapObject(program), isLikeNone(operation) ? 0 : addHeapObject(operation), addHeapObject(config));
624
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
625
+ const len0 = WASM_VECTOR_LEN;
626
+ const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export);
627
+ const len1 = WASM_VECTOR_LEN;
628
+ wasm.get_hir(retptr, ptr0, len0, ptr1, len1);
385
629
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
386
630
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
387
631
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
388
- if (r2) {
389
- throw takeObject(r1);
632
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
633
+ var ptr3 = r0;
634
+ var len3 = r1;
635
+ if (r3) {
636
+ ptr3 = 0; len3 = 0;
637
+ throw takeObject(r2);
390
638
  }
391
- return takeObject(r0);
639
+ deferred4_0 = ptr3;
640
+ deferred4_1 = len3;
641
+ return getStringFromWasm0(ptr3, len3);
392
642
  } finally {
393
643
  wasm.__wbindgen_add_to_stack_pointer(16);
644
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
394
645
  }
395
646
  }
396
647
 
@@ -401,7 +652,7 @@ export function get_circuit(program, operation, config) {
401
652
  export function get_library_source_content(name) {
402
653
  try {
403
654
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
404
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
655
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
405
656
  const len0 = WASM_VECTOR_LEN;
406
657
  wasm.get_library_source_content(retptr, ptr0, len0);
407
658
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -409,7 +660,7 @@ export function get_library_source_content(name) {
409
660
  let v2;
410
661
  if (r0 !== 0) {
411
662
  v2 = getStringFromWasm0(r0, r1).slice();
412
- wasm.__wbindgen_export_4(r0, r1 * 1, 1);
663
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
413
664
  }
414
665
  return v2;
415
666
  } finally {
@@ -418,70 +669,51 @@ export function get_library_source_content(name) {
418
669
  }
419
670
 
420
671
  /**
421
- * @param {string} code
422
- * @param {string[]} language_features
423
672
  * @returns {string}
424
673
  */
425
- export function get_ast(code, language_features) {
426
- let deferred4_0;
427
- let deferred4_1;
674
+ export function get_library_summaries() {
675
+ let deferred1_0;
676
+ let deferred1_1;
428
677
  try {
429
678
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
430
- const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
431
- const len0 = WASM_VECTOR_LEN;
432
- const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
433
- const len1 = WASM_VECTOR_LEN;
434
- wasm.get_ast(retptr, ptr0, len0, ptr1, len1);
679
+ wasm.get_library_summaries(retptr);
435
680
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
436
681
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
437
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
438
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
439
- var ptr3 = r0;
440
- var len3 = r1;
441
- if (r3) {
442
- ptr3 = 0; len3 = 0;
443
- throw takeObject(r2);
444
- }
445
- deferred4_0 = ptr3;
446
- deferred4_1 = len3;
447
- return getStringFromWasm0(ptr3, len3);
682
+ deferred1_0 = r0;
683
+ deferred1_1 = r1;
684
+ return getStringFromWasm0(r0, r1);
448
685
  } finally {
449
686
  wasm.__wbindgen_add_to_stack_pointer(16);
450
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
687
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
451
688
  }
452
689
  }
453
690
 
454
691
  /**
455
- * @param {string} code
456
- * @param {string[]} language_features
692
+ * @param {IProgramConfig} program
457
693
  * @returns {string}
458
694
  */
459
- export function get_hir(code, language_features) {
460
- let deferred4_0;
461
- let deferred4_1;
695
+ export function get_qir(program) {
696
+ let deferred2_0;
697
+ let deferred2_1;
462
698
  try {
463
699
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
464
- const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
465
- const len0 = WASM_VECTOR_LEN;
466
- const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
467
- const len1 = WASM_VECTOR_LEN;
468
- wasm.get_hir(retptr, ptr0, len0, ptr1, len1);
700
+ wasm.get_qir(retptr, addHeapObject(program));
469
701
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
470
702
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
471
703
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
472
704
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
473
- var ptr3 = r0;
474
- var len3 = r1;
705
+ var ptr1 = r0;
706
+ var len1 = r1;
475
707
  if (r3) {
476
- ptr3 = 0; len3 = 0;
708
+ ptr1 = 0; len1 = 0;
477
709
  throw takeObject(r2);
478
710
  }
479
- deferred4_0 = ptr3;
480
- deferred4_1 = len3;
481
- return getStringFromWasm0(ptr3, len3);
711
+ deferred2_0 = ptr1;
712
+ deferred2_1 = len1;
713
+ return getStringFromWasm0(ptr1, len1);
482
714
  } finally {
483
715
  wasm.__wbindgen_add_to_stack_pointer(16);
484
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
716
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
485
717
  }
486
718
  }
487
719
 
@@ -501,7 +733,7 @@ export function get_rir(program) {
501
733
  throw takeObject(r2);
502
734
  }
503
735
  var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
504
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
736
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
505
737
  return v1;
506
738
  } finally {
507
739
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -516,9 +748,9 @@ export function get_rir(program) {
516
748
  export function get_target_profile_from_entry_point(file_name, source) {
517
749
  try {
518
750
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
519
- const ptr0 = passStringToWasm0(file_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
751
+ const ptr0 = passStringToWasm0(file_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
520
752
  const len0 = WASM_VECTOR_LEN;
521
- const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
753
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
522
754
  const len1 = WASM_VECTOR_LEN;
523
755
  wasm.get_target_profile_from_entry_point(retptr, ptr0, len0, ptr1, len1);
524
756
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -526,7 +758,7 @@ export function get_target_profile_from_entry_point(file_name, source) {
526
758
  let v3;
527
759
  if (r0 !== 0) {
528
760
  v3 = getStringFromWasm0(r0, r1).slice();
529
- wasm.__wbindgen_export_4(r0, r1 * 1, 1);
761
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
530
762
  }
531
763
  return v3;
532
764
  } finally {
@@ -534,106 +766,15 @@ export function get_target_profile_from_entry_point(file_name, source) {
534
766
  }
535
767
  }
536
768
 
537
- /**
538
- * @param {IProgramConfig} program
539
- * @param {string} expr
540
- * @param {Function} event_cb
541
- * @param {number} shots
542
- * @returns {boolean}
543
- */
544
- export function run(program, expr, event_cb, shots) {
545
- try {
546
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
547
- const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
548
- const len0 = WASM_VECTOR_LEN;
549
- wasm.run(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots);
550
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
551
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
552
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
553
- if (r2) {
554
- throw takeObject(r1);
555
- }
556
- return r0 !== 0;
557
- } finally {
558
- wasm.__wbindgen_add_to_stack_pointer(16);
559
- heap[stack_pointer++] = undefined;
560
- }
561
- }
562
-
563
- /**
564
- * @param {IProgramConfig} program
565
- * @param {string} expr
566
- * @param {Function} event_cb
567
- * @param {number} shots
568
- * @param {any} pauliNoise
569
- * @param {any} qubitLoss
570
- * @returns {boolean}
571
- */
572
- export function runWithNoise(program, expr, event_cb, shots, pauliNoise, qubitLoss) {
573
- try {
574
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
575
- const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
576
- const len0 = WASM_VECTOR_LEN;
577
- wasm.runWithNoise(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots, addBorrowedObject(pauliNoise), addBorrowedObject(qubitLoss));
578
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
579
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
580
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
581
- if (r2) {
582
- throw takeObject(r1);
583
- }
584
- return r0 !== 0;
585
- } finally {
586
- wasm.__wbindgen_add_to_stack_pointer(16);
587
- heap[stack_pointer++] = undefined;
588
- heap[stack_pointer++] = undefined;
589
- heap[stack_pointer++] = undefined;
590
- }
591
- }
592
-
593
- /**
594
- * @param {string} solution_code
595
- * @param {any} exercise_sources_js
596
- * @param {Function} event_cb
597
- * @returns {boolean}
598
- */
599
- export function check_exercise_solution(solution_code, exercise_sources_js, event_cb) {
600
- try {
601
- const ptr0 = passStringToWasm0(solution_code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
602
- const len0 = WASM_VECTOR_LEN;
603
- const ret = wasm.check_exercise_solution(ptr0, len0, addHeapObject(exercise_sources_js), addBorrowedObject(event_cb));
604
- return ret !== 0;
605
- } finally {
606
- heap[stack_pointer++] = undefined;
607
- }
608
- }
609
-
610
- /**
611
- * @param {IProgramConfig | null} [additional_program]
612
- * @returns {IDocFile[]}
613
- */
614
- export function generate_docs(additional_program) {
615
- try {
616
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
617
- wasm.generate_docs(retptr, isLikeNone(additional_program) ? 0 : addHeapObject(additional_program));
618
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
619
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
620
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
621
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
622
- return v1;
623
- } finally {
624
- wasm.__wbindgen_add_to_stack_pointer(16);
625
- }
626
- }
627
-
628
769
  /**
629
770
  * @returns {string}
630
771
  */
631
- export function get_library_summaries() {
772
+ export function git_hash() {
632
773
  let deferred1_0;
633
774
  let deferred1_1;
634
775
  try {
635
776
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
636
- wasm.get_library_summaries(retptr);
777
+ wasm.git_hash(retptr);
637
778
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
638
779
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
639
780
  deferred1_0 = r0;
@@ -641,515 +782,828 @@ export function get_library_summaries() {
641
782
  return getStringFromWasm0(r0, r1);
642
783
  } finally {
643
784
  wasm.__wbindgen_add_to_stack_pointer(16);
644
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
785
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
645
786
  }
646
787
  }
647
788
 
648
- function __wbg_adapter_52(arg0, arg1, arg2) {
649
- wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
650
- }
651
-
652
- function __wbg_adapter_203(arg0, arg1, arg2, arg3) {
653
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
654
- }
655
-
656
789
  /**
657
- * @enum {0 | 1 | 2 | 3 | 4 | 5}
658
- */
659
- export const StepResultId = Object.freeze({
660
- BreakpointHit: 0, "0": "BreakpointHit",
661
- Next: 1, "1": "Next",
662
- StepIn: 2, "2": "StepIn",
663
- StepOut: 3, "3": "StepOut",
664
- Return: 4, "4": "Return",
665
- Fail: 5, "5": "Fail",
666
- });
667
-
668
- const DebugServiceFinalization = (typeof FinalizationRegistry === 'undefined')
669
- ? { register: () => {}, unregister: () => {} }
670
- : new FinalizationRegistry(ptr => wasm.__wbg_debugservice_free(ptr >>> 0, 1));
671
-
672
- export class DebugService {
673
-
674
- __destroy_into_raw() {
675
- const ptr = this.__wbg_ptr;
676
- this.__wbg_ptr = 0;
677
- DebugServiceFinalization.unregister(this);
678
- return ptr;
679
- }
680
-
681
- free() {
682
- const ptr = this.__destroy_into_raw();
683
- wasm.__wbg_debugservice_free(ptr, 0);
684
- }
685
- constructor() {
686
- const ret = wasm.debugservice_new();
687
- this.__wbg_ptr = ret >>> 0;
688
- DebugServiceFinalization.register(this, this.__wbg_ptr, this);
689
- return this;
690
- }
691
- /**
692
- * @param {IProgramConfig} program
693
- * @param {string | null} [entry]
694
- * @returns {string}
695
- */
696
- load_program(program, entry) {
697
- let deferred2_0;
698
- let deferred2_1;
699
- try {
700
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
701
- var ptr0 = isLikeNone(entry) ? 0 : passStringToWasm0(entry, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
702
- var len0 = WASM_VECTOR_LEN;
703
- wasm.debugservice_load_program(retptr, this.__wbg_ptr, addHeapObject(program), ptr0, len0);
704
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
705
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
706
- deferred2_0 = r0;
707
- deferred2_1 = r1;
708
- return getStringFromWasm0(r0, r1);
709
- } finally {
710
- wasm.__wbindgen_add_to_stack_pointer(16);
711
- wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
712
- }
713
- }
714
- /**
715
- * @returns {IQuantumStateList}
716
- */
717
- capture_quantum_state() {
718
- const ret = wasm.debugservice_capture_quantum_state(this.__wbg_ptr);
719
- return takeObject(ret);
720
- }
721
- /**
722
- * @returns {any}
723
- */
724
- get_circuit() {
725
- try {
726
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
727
- wasm.debugservice_get_circuit(retptr, this.__wbg_ptr);
728
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
729
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
730
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
731
- if (r2) {
732
- throw takeObject(r1);
733
- }
734
- return takeObject(r0);
735
- } finally {
736
- wasm.__wbindgen_add_to_stack_pointer(16);
737
- }
738
- }
739
- /**
740
- * @returns {IStackFrameList}
741
- */
742
- get_stack_frames() {
743
- const ret = wasm.debugservice_get_stack_frames(this.__wbg_ptr);
744
- return takeObject(ret);
745
- }
746
- /**
747
- * @param {Function} event_cb
748
- * @param {Uint32Array} ids
749
- * @returns {IStructStepResult}
750
- */
751
- eval_next(event_cb, ids) {
752
- try {
753
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
754
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
755
- const len0 = WASM_VECTOR_LEN;
756
- wasm.debugservice_eval_next(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
757
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
758
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
759
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
760
- if (r2) {
761
- throw takeObject(r1);
762
- }
763
- return takeObject(r0);
764
- } finally {
765
- wasm.__wbindgen_add_to_stack_pointer(16);
766
- heap[stack_pointer++] = undefined;
767
- }
768
- }
769
- /**
770
- * @param {Function} event_cb
771
- * @param {Uint32Array} ids
772
- * @returns {IStructStepResult}
773
- */
774
- eval_continue(event_cb, ids) {
775
- try {
776
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
777
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
778
- const len0 = WASM_VECTOR_LEN;
779
- wasm.debugservice_eval_continue(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
780
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
781
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
782
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
783
- if (r2) {
784
- throw takeObject(r1);
785
- }
786
- return takeObject(r0);
787
- } finally {
788
- wasm.__wbindgen_add_to_stack_pointer(16);
789
- heap[stack_pointer++] = undefined;
790
- }
791
- }
792
- /**
793
- * @param {Function} event_cb
794
- * @param {Uint32Array} ids
795
- * @returns {IStructStepResult}
796
- */
797
- eval_step_in(event_cb, ids) {
798
- try {
799
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
800
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
801
- const len0 = WASM_VECTOR_LEN;
802
- wasm.debugservice_eval_step_in(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
803
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
804
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
805
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
806
- if (r2) {
807
- throw takeObject(r1);
808
- }
809
- return takeObject(r0);
810
- } finally {
811
- wasm.__wbindgen_add_to_stack_pointer(16);
812
- heap[stack_pointer++] = undefined;
790
+ * @param {any} callback
791
+ * @param {number} level
792
+ */
793
+ export function initLogging(callback, level) {
794
+ try {
795
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
796
+ wasm.initLogging(retptr, addHeapObject(callback), level);
797
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
798
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
799
+ if (r1) {
800
+ throw takeObject(r0);
813
801
  }
802
+ } finally {
803
+ wasm.__wbindgen_add_to_stack_pointer(16);
814
804
  }
815
- /**
816
- * @param {Function} event_cb
817
- * @param {Uint32Array} ids
818
- * @returns {IStructStepResult}
819
- */
820
- eval_step_out(event_cb, ids) {
821
- try {
822
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
823
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
824
- const len0 = WASM_VECTOR_LEN;
825
- wasm.debugservice_eval_step_out(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
826
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
827
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
828
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
829
- if (r2) {
830
- throw takeObject(r1);
831
- }
832
- return takeObject(r0);
833
- } finally {
834
- wasm.__wbindgen_add_to_stack_pointer(16);
835
- heap[stack_pointer++] = undefined;
805
+ }
806
+
807
+ /**
808
+ * @param {IProgramConfig} program
809
+ * @param {string} expr
810
+ * @param {Function} event_cb
811
+ * @param {number} shots
812
+ * @returns {boolean}
813
+ */
814
+ export function run(program, expr, event_cb, shots) {
815
+ try {
816
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
817
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
818
+ const len0 = WASM_VECTOR_LEN;
819
+ wasm.run(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots);
820
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
821
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
822
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
823
+ if (r2) {
824
+ throw takeObject(r1);
836
825
  }
826
+ return r0 !== 0;
827
+ } finally {
828
+ wasm.__wbindgen_add_to_stack_pointer(16);
829
+ heap[stack_pointer++] = undefined;
837
830
  }
838
- /**
839
- * @param {string} path
840
- * @returns {IBreakpointSpanList}
841
- */
842
- get_breakpoints(path) {
843
- const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
831
+ }
832
+
833
+ /**
834
+ * @param {IProgramConfig} program
835
+ * @param {string} expr
836
+ * @param {Function} event_cb
837
+ * @param {number} shots
838
+ * @param {any} pauliNoise
839
+ * @param {any} qubitLoss
840
+ * @returns {boolean}
841
+ */
842
+ export function runWithNoise(program, expr, event_cb, shots, pauliNoise, qubitLoss) {
843
+ try {
844
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
845
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
844
846
  const len0 = WASM_VECTOR_LEN;
845
- const ret = wasm.debugservice_get_breakpoints(this.__wbg_ptr, ptr0, len0);
846
- return takeObject(ret);
847
+ wasm.runWithNoise(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots, addBorrowedObject(pauliNoise), addBorrowedObject(qubitLoss));
848
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
849
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
850
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
851
+ if (r2) {
852
+ throw takeObject(r1);
853
+ }
854
+ return r0 !== 0;
855
+ } finally {
856
+ wasm.__wbindgen_add_to_stack_pointer(16);
857
+ heap[stack_pointer++] = undefined;
858
+ heap[stack_pointer++] = undefined;
859
+ heap[stack_pointer++] = undefined;
847
860
  }
848
- /**
849
- * @param {number} frame_id
850
- * @returns {IVariableList}
851
- */
852
- get_locals(frame_id) {
853
- const ret = wasm.debugservice_get_locals(this.__wbg_ptr, frame_id);
854
- return takeObject(ret);
861
+ }
862
+
863
+ /**
864
+ * @param {number} level
865
+ */
866
+ export function setLogLevel(level) {
867
+ wasm.setLogLevel(level);
868
+ }
869
+
870
+ function __wbg_get_imports() {
871
+ const import0 = {
872
+ __proto__: null,
873
+ __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
874
+ const ret = Error(getStringFromWasm0(arg0, arg1));
875
+ return addHeapObject(ret);
876
+ },
877
+ __wbg_Number_a5a435bd7bbec835: function(arg0) {
878
+ const ret = Number(getObject(arg0));
879
+ return ret;
880
+ },
881
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
882
+ const ret = String(getObject(arg1));
883
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
884
+ const len1 = WASM_VECTOR_LEN;
885
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
886
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
887
+ },
888
+ __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
889
+ const v = getObject(arg1);
890
+ const ret = typeof(v) === 'bigint' ? v : undefined;
891
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
892
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
893
+ },
894
+ __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
895
+ const v = getObject(arg0);
896
+ const ret = typeof(v) === 'boolean' ? v : undefined;
897
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
898
+ },
899
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
900
+ const ret = debugString(getObject(arg1));
901
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
902
+ const len1 = WASM_VECTOR_LEN;
903
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
904
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
905
+ },
906
+ __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
907
+ const ret = getObject(arg0) in getObject(arg1);
908
+ return ret;
909
+ },
910
+ __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
911
+ const ret = typeof(getObject(arg0)) === 'bigint';
912
+ return ret;
913
+ },
914
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
915
+ const ret = typeof(getObject(arg0)) === 'function';
916
+ return ret;
917
+ },
918
+ __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
919
+ const val = getObject(arg0);
920
+ const ret = typeof(val) === 'object' && val !== null;
921
+ return ret;
922
+ },
923
+ __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
924
+ const ret = typeof(getObject(arg0)) === 'string';
925
+ return ret;
926
+ },
927
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
928
+ const ret = getObject(arg0) === undefined;
929
+ return ret;
930
+ },
931
+ __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
932
+ const ret = getObject(arg0) === getObject(arg1);
933
+ return ret;
934
+ },
935
+ __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
936
+ const ret = getObject(arg0) == getObject(arg1);
937
+ return ret;
938
+ },
939
+ __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
940
+ const obj = getObject(arg1);
941
+ const ret = typeof(obj) === 'number' ? obj : undefined;
942
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
943
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
944
+ },
945
+ __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
946
+ const obj = getObject(arg1);
947
+ const ret = typeof(obj) === 'string' ? obj : undefined;
948
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
949
+ var len1 = WASM_VECTOR_LEN;
950
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
951
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
952
+ },
953
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
954
+ throw new Error(getStringFromWasm0(arg0, arg1));
955
+ },
956
+ __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
957
+ getObject(arg0)._wbg_cb_unref();
958
+ },
959
+ __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
960
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
961
+ return addHeapObject(ret);
962
+ }, arguments); },
963
+ __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
964
+ const ret = getObject(arg0).call(getObject(arg1));
965
+ return addHeapObject(ret);
966
+ }, arguments); },
967
+ __wbg_call_f858478a02f9600f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
968
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
969
+ return addHeapObject(ret);
970
+ }, arguments); },
971
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
972
+ const ret = getObject(arg0).crypto;
973
+ return addHeapObject(ret);
974
+ },
975
+ __wbg_done_08ce71ee07e3bd17: function(arg0) {
976
+ const ret = getObject(arg0).done;
977
+ return ret;
978
+ },
979
+ __wbg_entries_e8a20ff8c9757101: function(arg0) {
980
+ const ret = Object.entries(getObject(arg0));
981
+ return addHeapObject(ret);
982
+ },
983
+ __wbg_fetchGithub_07b18f4c1d353ded: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
984
+ const ret = getObject(arg0).fetchGithub(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6), getStringFromWasm0(arg7, arg8));
985
+ return addHeapObject(ret);
986
+ }, arguments); },
987
+ __wbg_findManifestDirectory_033c7b5017798748: function(arg0, arg1, arg2) {
988
+ const ret = getObject(arg0).findManifestDirectory(getStringFromWasm0(arg1, arg2));
989
+ return addHeapObject(ret);
990
+ },
991
+ __wbg_from_4bdf88943703fd48: function(arg0) {
992
+ const ret = Array.from(getObject(arg0));
993
+ return addHeapObject(ret);
994
+ },
995
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
996
+ getObject(arg0).getRandomValues(getObject(arg1));
997
+ }, arguments); },
998
+ __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
999
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1000
+ return addHeapObject(ret);
1001
+ }, arguments); },
1002
+ __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
1003
+ const ret = getObject(arg0)[arg1 >>> 0];
1004
+ return addHeapObject(ret);
1005
+ },
1006
+ __wbg_get_stack_trace_limit_19dd44bb32fdd0bb: function() {
1007
+ const ret = Error.stackTraceLimit;
1008
+ return isLikeNone(ret) ? 0x100000001 : (ret) >>> 0;
1009
+ },
1010
+ __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
1011
+ const ret = getObject(arg0)[arg1 >>> 0];
1012
+ return addHeapObject(ret);
1013
+ },
1014
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1015
+ const ret = getObject(arg0)[getObject(arg1)];
1016
+ return addHeapObject(ret);
1017
+ },
1018
+ __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
1019
+ let result;
1020
+ try {
1021
+ result = getObject(arg0) instanceof ArrayBuffer;
1022
+ } catch (_) {
1023
+ result = false;
1024
+ }
1025
+ const ret = result;
1026
+ return ret;
1027
+ },
1028
+ __wbg_instanceof_Error_4691a5b466e32a80: function(arg0) {
1029
+ let result;
1030
+ try {
1031
+ result = getObject(arg0) instanceof Error;
1032
+ } catch (_) {
1033
+ result = false;
1034
+ }
1035
+ const ret = result;
1036
+ return ret;
1037
+ },
1038
+ __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
1039
+ let result;
1040
+ try {
1041
+ result = getObject(arg0) instanceof Map;
1042
+ } catch (_) {
1043
+ result = false;
1044
+ }
1045
+ const ret = result;
1046
+ return ret;
1047
+ },
1048
+ __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
1049
+ let result;
1050
+ try {
1051
+ result = getObject(arg0) instanceof Uint8Array;
1052
+ } catch (_) {
1053
+ result = false;
1054
+ }
1055
+ const ret = result;
1056
+ return ret;
1057
+ },
1058
+ __wbg_isArray_33b91feb269ff46e: function(arg0) {
1059
+ const ret = Array.isArray(getObject(arg0));
1060
+ return ret;
1061
+ },
1062
+ __wbg_isArray_42f3245bcac28e65: function(arg0) {
1063
+ const ret = Array.isArray(getObject(arg0));
1064
+ return ret;
1065
+ },
1066
+ __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
1067
+ const ret = Number.isSafeInteger(getObject(arg0));
1068
+ return ret;
1069
+ },
1070
+ __wbg_iterator_d8f549ec8fb061b1: function() {
1071
+ const ret = Symbol.iterator;
1072
+ return addHeapObject(ret);
1073
+ },
1074
+ __wbg_length_b3416cf66a5452c8: function(arg0) {
1075
+ const ret = getObject(arg0).length;
1076
+ return ret;
1077
+ },
1078
+ __wbg_length_ea16607d7b61445b: function(arg0) {
1079
+ const ret = getObject(arg0).length;
1080
+ return ret;
1081
+ },
1082
+ __wbg_listDirectory_3abb3a7342129e7c: function(arg0, arg1, arg2) {
1083
+ const ret = getObject(arg0).listDirectory(getStringFromWasm0(arg1, arg2));
1084
+ return addHeapObject(ret);
1085
+ },
1086
+ __wbg_message_00d63f20c41713dd: function(arg0) {
1087
+ const ret = getObject(arg0).message;
1088
+ return addHeapObject(ret);
1089
+ },
1090
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1091
+ const ret = getObject(arg0).msCrypto;
1092
+ return addHeapObject(ret);
1093
+ },
1094
+ __wbg_new_49af1fa01cd4d19b: function() {
1095
+ const ret = new Error();
1096
+ return addHeapObject(ret);
1097
+ },
1098
+ __wbg_new_49d5571bd3f0c4d4: function() {
1099
+ const ret = new Map();
1100
+ return addHeapObject(ret);
1101
+ },
1102
+ __wbg_new_5f486cdf45a04d78: function(arg0) {
1103
+ const ret = new Uint8Array(getObject(arg0));
1104
+ return addHeapObject(ret);
1105
+ },
1106
+ __wbg_new_a70fbab9066b301f: function() {
1107
+ const ret = new Array();
1108
+ return addHeapObject(ret);
1109
+ },
1110
+ __wbg_new_ab79df5bd7c26067: function() {
1111
+ const ret = new Object();
1112
+ return addHeapObject(ret);
1113
+ },
1114
+ __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
1115
+ try {
1116
+ var state0 = {a: arg0, b: arg1};
1117
+ var cb0 = (arg0, arg1) => {
1118
+ const a = state0.a;
1119
+ state0.a = 0;
1120
+ try {
1121
+ return __wasm_bindgen_func_elem_7513(a, state0.b, arg0, arg1);
1122
+ } finally {
1123
+ state0.a = a;
1124
+ }
1125
+ };
1126
+ const ret = new Promise(cb0);
1127
+ return addHeapObject(ret);
1128
+ } finally {
1129
+ state0.a = state0.b = 0;
1130
+ }
1131
+ },
1132
+ __wbg_new_with_length_825018a1616e9e55: function(arg0) {
1133
+ const ret = new Uint8Array(arg0 >>> 0);
1134
+ return addHeapObject(ret);
1135
+ },
1136
+ __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
1137
+ const ret = getObject(arg0).next();
1138
+ return addHeapObject(ret);
1139
+ }, arguments); },
1140
+ __wbg_next_e01a967809d1aa68: function(arg0) {
1141
+ const ret = getObject(arg0).next;
1142
+ return addHeapObject(ret);
1143
+ },
1144
+ __wbg_node_84ea875411254db1: function(arg0) {
1145
+ const ret = getObject(arg0).node;
1146
+ return addHeapObject(ret);
1147
+ },
1148
+ __wbg_packageGraphSources_41adf6632e94af6f: function(arg0) {
1149
+ const ret = getObject(arg0).packageGraphSources;
1150
+ return addHeapObject(ret);
1151
+ },
1152
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1153
+ const ret = getObject(arg0).process;
1154
+ return addHeapObject(ret);
1155
+ },
1156
+ __wbg_profile_edbf563ae3d57e6d: function(arg0, arg1) {
1157
+ const ret = getObject(arg1).profile;
1158
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1159
+ const len1 = WASM_VECTOR_LEN;
1160
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1161
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1162
+ },
1163
+ __wbg_projectType_3d7f26604be90e3c: function(arg0, arg1) {
1164
+ const ret = getObject(arg1).projectType;
1165
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1166
+ const len1 = WASM_VECTOR_LEN;
1167
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1168
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1169
+ },
1170
+ __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
1171
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1172
+ },
1173
+ __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
1174
+ const ret = getObject(arg0).queueMicrotask;
1175
+ return addHeapObject(ret);
1176
+ },
1177
+ __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
1178
+ queueMicrotask(getObject(arg0));
1179
+ },
1180
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1181
+ getObject(arg0).randomFillSync(takeObject(arg1));
1182
+ }, arguments); },
1183
+ __wbg_readFile_5cf1797fcdea6a2c: function() { return handleError(function (arg0, arg1, arg2) {
1184
+ const ret = getObject(arg0).readFile(getStringFromWasm0(arg1, arg2));
1185
+ return addHeapObject(ret);
1186
+ }, arguments); },
1187
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1188
+ const ret = module.require;
1189
+ return addHeapObject(ret);
1190
+ }, arguments); },
1191
+ __wbg_resolvePath_6e40d08df0c5e326: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1192
+ const ret = getObject(arg0).resolvePath(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1193
+ return addHeapObject(ret);
1194
+ }, arguments); },
1195
+ __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
1196
+ const ret = Promise.resolve(getObject(arg0));
1197
+ return addHeapObject(ret);
1198
+ },
1199
+ __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
1200
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1201
+ },
1202
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1203
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1204
+ },
1205
+ __wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
1206
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1207
+ return addHeapObject(ret);
1208
+ },
1209
+ __wbg_set_stack_trace_limit_a6b4f5c23511a229: function(arg0) {
1210
+ Error.stackTraceLimit = arg0 >>> 0;
1211
+ },
1212
+ __wbg_stack_948d41d68c41fac5: function(arg0, arg1) {
1213
+ const ret = getObject(arg1).stack;
1214
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1215
+ const len1 = WASM_VECTOR_LEN;
1216
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1217
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1218
+ },
1219
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
1220
+ const ret = typeof global === 'undefined' ? null : global;
1221
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1222
+ },
1223
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
1224
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1225
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1226
+ },
1227
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
1228
+ const ret = typeof self === 'undefined' ? null : self;
1229
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1230
+ },
1231
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
1232
+ const ret = typeof window === 'undefined' ? null : window;
1233
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1234
+ },
1235
+ __wbg_subarray_a068d24e39478a8a: function(arg0, arg1, arg2) {
1236
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1237
+ return addHeapObject(ret);
1238
+ },
1239
+ __wbg_then_098abe61755d12f6: function(arg0, arg1) {
1240
+ const ret = getObject(arg0).then(getObject(arg1));
1241
+ return addHeapObject(ret);
1242
+ },
1243
+ __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
1244
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1245
+ return addHeapObject(ret);
1246
+ },
1247
+ __wbg_value_21fc78aab0322612: function(arg0) {
1248
+ const ret = getObject(arg0).value;
1249
+ return addHeapObject(ret);
1250
+ },
1251
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1252
+ const ret = getObject(arg0).versions;
1253
+ return addHeapObject(ret);
1254
+ },
1255
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1256
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2102, function: Function { arguments: [Externref], shim_idx: 2103, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1257
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7033, __wasm_bindgen_func_elem_7035);
1258
+ return addHeapObject(ret);
1259
+ },
1260
+ __wbindgen_cast_0000000000000002: function(arg0) {
1261
+ // Cast intrinsic for `F64 -> Externref`.
1262
+ const ret = arg0;
1263
+ return addHeapObject(ret);
1264
+ },
1265
+ __wbindgen_cast_0000000000000003: function(arg0) {
1266
+ // Cast intrinsic for `I64 -> Externref`.
1267
+ const ret = arg0;
1268
+ return addHeapObject(ret);
1269
+ },
1270
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1271
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1272
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1273
+ return addHeapObject(ret);
1274
+ },
1275
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1276
+ // Cast intrinsic for `Ref(String) -> Externref`.
1277
+ const ret = getStringFromWasm0(arg0, arg1);
1278
+ return addHeapObject(ret);
1279
+ },
1280
+ __wbindgen_cast_0000000000000006: function(arg0) {
1281
+ // Cast intrinsic for `U64 -> Externref`.
1282
+ const ret = BigInt.asUintN(64, arg0);
1283
+ return addHeapObject(ret);
1284
+ },
1285
+ __wbindgen_object_clone_ref: function(arg0) {
1286
+ const ret = getObject(arg0);
1287
+ return addHeapObject(ret);
1288
+ },
1289
+ __wbindgen_object_drop_ref: function(arg0) {
1290
+ takeObject(arg0);
1291
+ },
1292
+ };
1293
+ return {
1294
+ __proto__: null,
1295
+ "./qsc_wasm_bg.js": import0,
1296
+ };
1297
+ }
1298
+
1299
+ function __wasm_bindgen_func_elem_7035(arg0, arg1, arg2) {
1300
+ try {
1301
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1302
+ wasm.__wasm_bindgen_func_elem_7035(retptr, arg0, arg1, addHeapObject(arg2));
1303
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1304
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1305
+ if (r1) {
1306
+ throw takeObject(r0);
1307
+ }
1308
+ } finally {
1309
+ wasm.__wbindgen_add_to_stack_pointer(16);
855
1310
  }
856
1311
  }
857
1312
 
1313
+ function __wasm_bindgen_func_elem_7513(arg0, arg1, arg2, arg3) {
1314
+ wasm.__wasm_bindgen_func_elem_7513(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1315
+ }
1316
+
1317
+ const DebugServiceFinalization = (typeof FinalizationRegistry === 'undefined')
1318
+ ? { register: () => {}, unregister: () => {} }
1319
+ : new FinalizationRegistry(ptr => wasm.__wbg_debugservice_free(ptr >>> 0, 1));
858
1320
  const LanguageServiceFinalization = (typeof FinalizationRegistry === 'undefined')
859
1321
  ? { register: () => {}, unregister: () => {} }
860
1322
  : new FinalizationRegistry(ptr => wasm.__wbg_languageservice_free(ptr >>> 0, 1));
1323
+ const ProjectLoaderFinalization = (typeof FinalizationRegistry === 'undefined')
1324
+ ? { register: () => {}, unregister: () => {} }
1325
+ : new FinalizationRegistry(ptr => wasm.__wbg_projectloader_free(ptr >>> 0, 1));
861
1326
 
862
- export class LanguageService {
1327
+ function addHeapObject(obj) {
1328
+ if (heap_next === heap.length) heap.push(heap.length + 1);
1329
+ const idx = heap_next;
1330
+ heap_next = heap[idx];
863
1331
 
864
- __destroy_into_raw() {
865
- const ptr = this.__wbg_ptr;
866
- this.__wbg_ptr = 0;
867
- LanguageServiceFinalization.unregister(this);
868
- return ptr;
869
- }
1332
+ heap[idx] = obj;
1333
+ return idx;
1334
+ }
870
1335
 
871
- free() {
872
- const ptr = this.__destroy_into_raw();
873
- wasm.__wbg_languageservice_free(ptr, 0);
874
- }
875
- constructor() {
876
- const ret = wasm.languageservice_new();
877
- this.__wbg_ptr = ret >>> 0;
878
- LanguageServiceFinalization.register(this, this.__wbg_ptr, this);
879
- return this;
880
- }
881
- /**
882
- * @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
883
- * @param {(callables: ITestDescriptor[]) => void} test_callables_callback
884
- * @param {IProjectHost} host
885
- * @returns {Promise<any>}
886
- */
887
- start_background_work(diagnostics_callback, test_callables_callback, host) {
888
- try {
889
- const ret = wasm.languageservice_start_background_work(this.__wbg_ptr, addBorrowedObject(diagnostics_callback), addBorrowedObject(test_callables_callback), addHeapObject(host));
890
- return takeObject(ret);
891
- } finally {
892
- heap[stack_pointer++] = undefined;
893
- heap[stack_pointer++] = undefined;
894
- }
895
- }
896
- stop_background_work() {
897
- wasm.languageservice_stop_background_work(this.__wbg_ptr);
898
- }
899
- /**
900
- * @param {IWorkspaceConfiguration} config
901
- */
902
- update_configuration(config) {
903
- wasm.languageservice_update_configuration(this.__wbg_ptr, addHeapObject(config));
904
- }
905
- /**
906
- * @param {string} uri
907
- * @param {number} version
908
- * @param {string} text
909
- * @param {string} language_id
910
- */
911
- update_document(uri, version, text, language_id) {
912
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
913
- const len0 = WASM_VECTOR_LEN;
914
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
915
- const len1 = WASM_VECTOR_LEN;
916
- const ptr2 = passStringToWasm0(language_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
917
- const len2 = WASM_VECTOR_LEN;
918
- wasm.languageservice_update_document(this.__wbg_ptr, ptr0, len0, version, ptr1, len1, ptr2, len2);
919
- }
920
- /**
921
- * @param {string} uri
922
- * @param {string} language_id
923
- */
924
- close_document(uri, language_id) {
925
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
926
- const len0 = WASM_VECTOR_LEN;
927
- const ptr1 = passStringToWasm0(language_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
928
- const len1 = WASM_VECTOR_LEN;
929
- wasm.languageservice_close_document(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1336
+ function addBorrowedObject(obj) {
1337
+ if (stack_pointer == 1) throw new Error('out of js stack');
1338
+ heap[--stack_pointer] = obj;
1339
+ return stack_pointer;
1340
+ }
1341
+
1342
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1343
+ ? { register: () => {}, unregister: () => {} }
1344
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
1345
+
1346
+ function debugString(val) {
1347
+ // primitive types
1348
+ const type = typeof val;
1349
+ if (type == 'number' || type == 'boolean' || val == null) {
1350
+ return `${val}`;
930
1351
  }
931
- /**
932
- * @param {string} notebook_uri
933
- * @param {INotebookMetadata} notebook_metadata
934
- * @param {ICell[]} cells
935
- */
936
- update_notebook_document(notebook_uri, notebook_metadata, cells) {
937
- const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
938
- const len0 = WASM_VECTOR_LEN;
939
- const ptr1 = passArrayJsValueToWasm0(cells, wasm.__wbindgen_export_0);
940
- const len1 = WASM_VECTOR_LEN;
941
- wasm.languageservice_update_notebook_document(this.__wbg_ptr, ptr0, len0, addHeapObject(notebook_metadata), ptr1, len1);
1352
+ if (type == 'string') {
1353
+ return `"${val}"`;
942
1354
  }
943
- /**
944
- * @param {string} notebook_uri
945
- */
946
- close_notebook_document(notebook_uri) {
947
- const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
948
- const len0 = WASM_VECTOR_LEN;
949
- wasm.languageservice_close_notebook_document(this.__wbg_ptr, ptr0, len0);
1355
+ if (type == 'symbol') {
1356
+ const description = val.description;
1357
+ if (description == null) {
1358
+ return 'Symbol';
1359
+ } else {
1360
+ return `Symbol(${description})`;
1361
+ }
950
1362
  }
951
- /**
952
- * @param {string} uri
953
- * @param {IRange} range
954
- * @returns {ICodeAction[]}
955
- */
956
- get_code_actions(uri, range) {
957
- try {
958
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
959
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
960
- const len0 = WASM_VECTOR_LEN;
961
- wasm.languageservice_get_code_actions(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(range));
962
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
963
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
964
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
965
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
966
- return v2;
967
- } finally {
968
- wasm.__wbindgen_add_to_stack_pointer(16);
1363
+ if (type == 'function') {
1364
+ const name = val.name;
1365
+ if (typeof name == 'string' && name.length > 0) {
1366
+ return `Function(${name})`;
1367
+ } else {
1368
+ return 'Function';
969
1369
  }
970
1370
  }
971
- /**
972
- * @param {string} uri
973
- * @param {IPosition} position
974
- * @returns {ICompletionList}
975
- */
976
- get_completions(uri, position) {
977
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
978
- const len0 = WASM_VECTOR_LEN;
979
- const ret = wasm.languageservice_get_completions(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
980
- return takeObject(ret);
1371
+ // objects
1372
+ if (Array.isArray(val)) {
1373
+ const length = val.length;
1374
+ let debug = '[';
1375
+ if (length > 0) {
1376
+ debug += debugString(val[0]);
1377
+ }
1378
+ for(let i = 1; i < length; i++) {
1379
+ debug += ', ' + debugString(val[i]);
1380
+ }
1381
+ debug += ']';
1382
+ return debug;
981
1383
  }
982
- /**
983
- * @param {string} uri
984
- * @param {IPosition} position
985
- * @returns {ILocation | undefined}
986
- */
987
- get_definition(uri, position) {
988
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
989
- const len0 = WASM_VECTOR_LEN;
990
- const ret = wasm.languageservice_get_definition(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
991
- return takeObject(ret);
1384
+ // Test for built-in
1385
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1386
+ let className;
1387
+ if (builtInMatches && builtInMatches.length > 1) {
1388
+ className = builtInMatches[1];
1389
+ } else {
1390
+ // Failed to match the standard '[object ClassName]'
1391
+ return toString.call(val);
992
1392
  }
993
- /**
994
- * @param {string} uri
995
- * @param {IPosition} position
996
- * @param {boolean} include_declaration
997
- * @returns {ILocation[]}
998
- */
999
- get_references(uri, position, include_declaration) {
1393
+ if (className == 'Object') {
1394
+ // we're a user defined class or Object
1395
+ // JSON.stringify avoids problems with cycles, and is generally much
1396
+ // easier than looping through ownProperties of `val`.
1000
1397
  try {
1001
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1002
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1003
- const len0 = WASM_VECTOR_LEN;
1004
- wasm.languageservice_get_references(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(position), include_declaration);
1005
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1006
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1007
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1008
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
1009
- return v2;
1010
- } finally {
1011
- wasm.__wbindgen_add_to_stack_pointer(16);
1398
+ return 'Object(' + JSON.stringify(val) + ')';
1399
+ } catch (_) {
1400
+ return 'Object';
1012
1401
  }
1013
1402
  }
1014
- /**
1015
- * @param {string} uri
1016
- * @returns {ITextEdit[]}
1017
- */
1018
- get_format_changes(uri) {
1019
- try {
1020
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1021
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1022
- const len0 = WASM_VECTOR_LEN;
1023
- wasm.languageservice_get_format_changes(retptr, this.__wbg_ptr, ptr0, len0);
1024
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1025
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1026
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1027
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
1028
- return v2;
1029
- } finally {
1030
- wasm.__wbindgen_add_to_stack_pointer(16);
1031
- }
1403
+ // errors
1404
+ if (val instanceof Error) {
1405
+ return `${val.name}: ${val.message}\n${val.stack}`;
1032
1406
  }
1033
- /**
1034
- * @param {string} uri
1035
- * @param {IPosition} position
1036
- * @returns {IHover | undefined}
1037
- */
1038
- get_hover(uri, position) {
1039
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1040
- const len0 = WASM_VECTOR_LEN;
1041
- const ret = wasm.languageservice_get_hover(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
1042
- return takeObject(ret);
1407
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1408
+ return className;
1409
+ }
1410
+
1411
+ function dropObject(idx) {
1412
+ if (idx < 1028) return;
1413
+ heap[idx] = heap_next;
1414
+ heap_next = idx;
1415
+ }
1416
+
1417
+ function getArrayJsValueFromWasm0(ptr, len) {
1418
+ ptr = ptr >>> 0;
1419
+ const mem = getDataViewMemory0();
1420
+ const result = [];
1421
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1422
+ result.push(takeObject(mem.getUint32(i, true)));
1043
1423
  }
1044
- /**
1045
- * @param {string} uri
1046
- * @param {IPosition} position
1047
- * @returns {ISignatureHelp | undefined}
1048
- */
1049
- get_signature_help(uri, position) {
1050
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1051
- const len0 = WASM_VECTOR_LEN;
1052
- const ret = wasm.languageservice_get_signature_help(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
1053
- return takeObject(ret);
1424
+ return result;
1425
+ }
1426
+
1427
+ function getArrayU8FromWasm0(ptr, len) {
1428
+ ptr = ptr >>> 0;
1429
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1430
+ }
1431
+
1432
+ let cachedDataViewMemory0 = null;
1433
+ function getDataViewMemory0() {
1434
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1435
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1054
1436
  }
1055
- /**
1056
- * @param {string} uri
1057
- * @param {IPosition} position
1058
- * @param {string} new_name
1059
- * @returns {IWorkspaceEdit}
1060
- */
1061
- get_rename(uri, position, new_name) {
1062
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1063
- const len0 = WASM_VECTOR_LEN;
1064
- const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1065
- const len1 = WASM_VECTOR_LEN;
1066
- const ret = wasm.languageservice_get_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position), ptr1, len1);
1067
- return takeObject(ret);
1437
+ return cachedDataViewMemory0;
1438
+ }
1439
+
1440
+ function getStringFromWasm0(ptr, len) {
1441
+ ptr = ptr >>> 0;
1442
+ return decodeText(ptr, len);
1443
+ }
1444
+
1445
+ let cachedUint32ArrayMemory0 = null;
1446
+ function getUint32ArrayMemory0() {
1447
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1448
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1068
1449
  }
1069
- /**
1070
- * @param {string} uri
1071
- * @param {IPosition} position
1072
- * @returns {ITextEdit | undefined}
1073
- */
1074
- prepare_rename(uri, position) {
1075
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1076
- const len0 = WASM_VECTOR_LEN;
1077
- const ret = wasm.languageservice_prepare_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
1078
- return takeObject(ret);
1450
+ return cachedUint32ArrayMemory0;
1451
+ }
1452
+
1453
+ let cachedUint8ArrayMemory0 = null;
1454
+ function getUint8ArrayMemory0() {
1455
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1456
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1079
1457
  }
1080
- /**
1081
- * @param {string} uri
1082
- * @returns {ICodeLens[]}
1083
- */
1084
- get_code_lenses(uri) {
1085
- try {
1086
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1087
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1088
- const len0 = WASM_VECTOR_LEN;
1089
- wasm.languageservice_get_code_lenses(retptr, this.__wbg_ptr, ptr0, len0);
1090
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1091
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1092
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1093
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
1094
- return v2;
1458
+ return cachedUint8ArrayMemory0;
1459
+ }
1460
+
1461
+ function getObject(idx) { return heap[idx]; }
1462
+
1463
+ function handleError(f, args) {
1464
+ try {
1465
+ return f.apply(this, args);
1466
+ } catch (e) {
1467
+ wasm.__wbindgen_export3(addHeapObject(e));
1468
+ }
1469
+ }
1470
+
1471
+ let heap = new Array(1024).fill(undefined);
1472
+ heap.push(undefined, null, true, false);
1473
+
1474
+ let heap_next = heap.length;
1475
+
1476
+ function isLikeNone(x) {
1477
+ return x === undefined || x === null;
1478
+ }
1479
+
1480
+ function makeMutClosure(arg0, arg1, dtor, f) {
1481
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1482
+ const real = (...args) => {
1483
+
1484
+ // First up with a closure we increment the internal reference
1485
+ // count. This ensures that the Rust closure environment won't
1486
+ // be deallocated while we're invoking it.
1487
+ state.cnt++;
1488
+ const a = state.a;
1489
+ state.a = 0;
1490
+ try {
1491
+ return f(a, state.b, ...args);
1095
1492
  } finally {
1096
- wasm.__wbindgen_add_to_stack_pointer(16);
1493
+ state.a = a;
1494
+ real._wbg_cb_unref();
1097
1495
  }
1098
- }
1496
+ };
1497
+ real._wbg_cb_unref = () => {
1498
+ if (--state.cnt === 0) {
1499
+ state.dtor(state.a, state.b);
1500
+ state.a = 0;
1501
+ CLOSURE_DTORS.unregister(state);
1502
+ }
1503
+ };
1504
+ CLOSURE_DTORS.register(real, state, state);
1505
+ return real;
1099
1506
  }
1100
1507
 
1101
- const ProjectLoaderFinalization = (typeof FinalizationRegistry === 'undefined')
1102
- ? { register: () => {}, unregister: () => {} }
1103
- : new FinalizationRegistry(ptr => wasm.__wbg_projectloader_free(ptr >>> 0, 1));
1104
- /**
1105
- * a minimal implementation for interacting with async JS filesystem callbacks to
1106
- * load project files
1107
- */
1108
- export class ProjectLoader {
1508
+ function passArray32ToWasm0(arg, malloc) {
1509
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
1510
+ getUint32ArrayMemory0().set(arg, ptr / 4);
1511
+ WASM_VECTOR_LEN = arg.length;
1512
+ return ptr;
1513
+ }
1109
1514
 
1110
- __destroy_into_raw() {
1111
- const ptr = this.__wbg_ptr;
1112
- this.__wbg_ptr = 0;
1113
- ProjectLoaderFinalization.unregister(this);
1114
- return ptr;
1515
+ function passArrayJsValueToWasm0(array, malloc) {
1516
+ const ptr = malloc(array.length * 4, 4) >>> 0;
1517
+ const mem = getDataViewMemory0();
1518
+ for (let i = 0; i < array.length; i++) {
1519
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
1115
1520
  }
1521
+ WASM_VECTOR_LEN = array.length;
1522
+ return ptr;
1523
+ }
1116
1524
 
1117
- free() {
1118
- const ptr = this.__destroy_into_raw();
1119
- wasm.__wbg_projectloader_free(ptr, 0);
1525
+ function passStringToWasm0(arg, malloc, realloc) {
1526
+ if (realloc === undefined) {
1527
+ const buf = cachedTextEncoder.encode(arg);
1528
+ const ptr = malloc(buf.length, 1) >>> 0;
1529
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1530
+ WASM_VECTOR_LEN = buf.length;
1531
+ return ptr;
1120
1532
  }
1121
- /**
1122
- * @param {IProjectHost} project_host
1123
- */
1124
- constructor(project_host) {
1125
- const ret = wasm.projectloader_new(addHeapObject(project_host));
1126
- this.__wbg_ptr = ret >>> 0;
1127
- ProjectLoaderFinalization.register(this, this.__wbg_ptr, this);
1128
- return this;
1533
+
1534
+ let len = arg.length;
1535
+ let ptr = malloc(len, 1) >>> 0;
1536
+
1537
+ const mem = getUint8ArrayMemory0();
1538
+
1539
+ let offset = 0;
1540
+
1541
+ for (; offset < len; offset++) {
1542
+ const code = arg.charCodeAt(offset);
1543
+ if (code > 0x7F) break;
1544
+ mem[ptr + offset] = code;
1129
1545
  }
1130
- /**
1131
- * @param {string} directory
1132
- * @returns {Promise<IProjectConfig>}
1133
- */
1134
- load_project_with_deps(directory) {
1135
- const ptr0 = passStringToWasm0(directory, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1136
- const len0 = WASM_VECTOR_LEN;
1137
- const ret = wasm.projectloader_load_project_with_deps(this.__wbg_ptr, ptr0, len0);
1138
- return takeObject(ret);
1546
+ if (offset !== len) {
1547
+ if (offset !== 0) {
1548
+ arg = arg.slice(offset);
1549
+ }
1550
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1551
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1552
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1553
+
1554
+ offset += ret.written;
1555
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1139
1556
  }
1140
- /**
1141
- * @param {string} file_path
1142
- * @param {string | null} [source]
1143
- * @returns {Promise<IProjectConfig>}
1144
- */
1145
- load_openqasm_project(file_path, source) {
1146
- const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1147
- const len0 = WASM_VECTOR_LEN;
1148
- var ptr1 = isLikeNone(source) ? 0 : passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1149
- var len1 = WASM_VECTOR_LEN;
1150
- const ret = wasm.projectloader_load_openqasm_project(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1151
- return takeObject(ret);
1557
+
1558
+ WASM_VECTOR_LEN = offset;
1559
+ return ptr;
1560
+ }
1561
+
1562
+ let stack_pointer = 1024;
1563
+
1564
+ function takeObject(idx) {
1565
+ const ret = getObject(idx);
1566
+ dropObject(idx);
1567
+ return ret;
1568
+ }
1569
+
1570
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1571
+ cachedTextDecoder.decode();
1572
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1573
+ let numBytesDecoded = 0;
1574
+ function decodeText(ptr, len) {
1575
+ numBytesDecoded += len;
1576
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1577
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1578
+ cachedTextDecoder.decode();
1579
+ numBytesDecoded = len;
1152
1580
  }
1581
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1582
+ }
1583
+
1584
+ const cachedTextEncoder = new TextEncoder();
1585
+
1586
+ if (!('encodeInto' in cachedTextEncoder)) {
1587
+ cachedTextEncoder.encodeInto = function (arg, view) {
1588
+ const buf = cachedTextEncoder.encode(arg);
1589
+ view.set(buf);
1590
+ return {
1591
+ read: arg.length,
1592
+ written: buf.length
1593
+ };
1594
+ };
1595
+ }
1596
+
1597
+ let WASM_VECTOR_LEN = 0;
1598
+
1599
+ let wasmModule, wasm;
1600
+ function __wbg_finalize_init(instance, module) {
1601
+ wasm = instance.exports;
1602
+ wasmModule = module;
1603
+ cachedDataViewMemory0 = null;
1604
+ cachedUint32ArrayMemory0 = null;
1605
+ cachedUint8ArrayMemory0 = null;
1606
+ return wasm;
1153
1607
  }
1154
1608
 
1155
1609
  async function __wbg_load(module, imports) {
@@ -1157,487 +1611,41 @@ async function __wbg_load(module, imports) {
1157
1611
  if (typeof WebAssembly.instantiateStreaming === 'function') {
1158
1612
  try {
1159
1613
  return await WebAssembly.instantiateStreaming(module, imports);
1160
-
1161
1614
  } catch (e) {
1162
- if (module.headers.get('Content-Type') != 'application/wasm') {
1615
+ const validResponse = module.ok && expectedResponseType(module.type);
1616
+
1617
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1163
1618
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1164
1619
 
1165
- } else {
1166
- throw e;
1167
- }
1620
+ } else { throw e; }
1168
1621
  }
1169
1622
  }
1170
1623
 
1171
1624
  const bytes = await module.arrayBuffer();
1172
1625
  return await WebAssembly.instantiate(bytes, imports);
1173
-
1174
1626
  } else {
1175
1627
  const instance = await WebAssembly.instantiate(module, imports);
1176
1628
 
1177
1629
  if (instance instanceof WebAssembly.Instance) {
1178
1630
  return { instance, module };
1179
-
1180
1631
  } else {
1181
1632
  return instance;
1182
1633
  }
1183
1634
  }
1184
- }
1185
1635
 
1186
- function __wbg_get_imports() {
1187
- const imports = {};
1188
- imports.wbg = {};
1189
- imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1190
- const ret = String(getObject(arg1));
1191
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1192
- const len1 = WASM_VECTOR_LEN;
1193
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1194
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1195
- };
1196
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1197
- const ret = getObject(arg0).buffer;
1198
- return addHeapObject(ret);
1199
- };
1200
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1201
- const ret = getObject(arg0).call(getObject(arg1));
1202
- return addHeapObject(ret);
1203
- }, arguments) };
1204
- imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1205
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1206
- return addHeapObject(ret);
1207
- }, arguments) };
1208
- imports.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1209
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
1210
- return addHeapObject(ret);
1211
- }, arguments) };
1212
- imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1213
- const ret = getObject(arg0).crypto;
1214
- return addHeapObject(ret);
1215
- };
1216
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
1217
- const ret = getObject(arg0).done;
1218
- return ret;
1219
- };
1220
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
1221
- const ret = Object.entries(getObject(arg0));
1222
- return addHeapObject(ret);
1223
- };
1224
- imports.wbg.__wbg_fetchGithub_8d40e9b8dedfdb81 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
1225
- const ret = getObject(arg0).fetchGithub(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6), getStringFromWasm0(arg7, arg8));
1226
- return addHeapObject(ret);
1227
- }, arguments) };
1228
- imports.wbg.__wbg_findManifestDirectory_91ae20bc11401cd7 = function(arg0, arg1, arg2) {
1229
- const ret = getObject(arg0).findManifestDirectory(getStringFromWasm0(arg1, arg2));
1230
- return addHeapObject(ret);
1231
- };
1232
- imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
1233
- const ret = Array.from(getObject(arg0));
1234
- return addHeapObject(ret);
1235
- };
1236
- imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1237
- getObject(arg0).getRandomValues(getObject(arg1));
1238
- }, arguments) };
1239
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1240
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1241
- return addHeapObject(ret);
1242
- }, arguments) };
1243
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1244
- const ret = getObject(arg0)[arg1 >>> 0];
1245
- return addHeapObject(ret);
1246
- };
1247
- imports.wbg.__wbg_getstacktracelimit_af8b40007957b07f = function() {
1248
- const ret = Error.stackTraceLimit;
1249
- return isLikeNone(ret) ? 0x100000001 : (ret) >>> 0;
1250
- };
1251
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1252
- const ret = getObject(arg0)[getObject(arg1)];
1253
- return addHeapObject(ret);
1254
- };
1255
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1256
- let result;
1257
- try {
1258
- result = getObject(arg0) instanceof ArrayBuffer;
1259
- } catch (_) {
1260
- result = false;
1261
- }
1262
- const ret = result;
1263
- return ret;
1264
- };
1265
- imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1266
- let result;
1267
- try {
1268
- result = getObject(arg0) instanceof Error;
1269
- } catch (_) {
1270
- result = false;
1271
- }
1272
- const ret = result;
1273
- return ret;
1274
- };
1275
- imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
1276
- let result;
1277
- try {
1278
- result = getObject(arg0) instanceof Map;
1279
- } catch (_) {
1280
- result = false;
1281
- }
1282
- const ret = result;
1283
- return ret;
1284
- };
1285
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1286
- let result;
1287
- try {
1288
- result = getObject(arg0) instanceof Uint8Array;
1289
- } catch (_) {
1290
- result = false;
1291
- }
1292
- const ret = result;
1293
- return ret;
1294
- };
1295
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1296
- const ret = Array.isArray(getObject(arg0));
1297
- return ret;
1298
- };
1299
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1300
- const ret = Number.isSafeInteger(getObject(arg0));
1301
- return ret;
1302
- };
1303
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1304
- const ret = Symbol.iterator;
1305
- return addHeapObject(ret);
1306
- };
1307
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1308
- const ret = getObject(arg0).length;
1309
- return ret;
1310
- };
1311
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1312
- const ret = getObject(arg0).length;
1313
- return ret;
1314
- };
1315
- imports.wbg.__wbg_listDirectory_827a3459b52ecade = function(arg0, arg1, arg2) {
1316
- const ret = getObject(arg0).listDirectory(getStringFromWasm0(arg1, arg2));
1317
- return addHeapObject(ret);
1318
- };
1319
- imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1320
- const ret = getObject(arg0).message;
1321
- return addHeapObject(ret);
1322
- };
1323
- imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1324
- const ret = getObject(arg0).msCrypto;
1325
- return addHeapObject(ret);
1326
- };
1327
- imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1328
- try {
1329
- var state0 = {a: arg0, b: arg1};
1330
- var cb0 = (arg0, arg1) => {
1331
- const a = state0.a;
1332
- state0.a = 0;
1333
- try {
1334
- return __wbg_adapter_203(a, state0.b, arg0, arg1);
1335
- } finally {
1336
- state0.a = a;
1337
- }
1338
- };
1339
- const ret = new Promise(cb0);
1340
- return addHeapObject(ret);
1341
- } finally {
1342
- state0.a = state0.b = 0;
1343
- }
1344
- };
1345
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1346
- const ret = new Object();
1347
- return addHeapObject(ret);
1348
- };
1349
- imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1350
- const ret = new Map();
1351
- return addHeapObject(ret);
1352
- };
1353
- imports.wbg.__wbg_new_78feb108b6472713 = function() {
1354
- const ret = new Array();
1355
- return addHeapObject(ret);
1356
- };
1357
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1358
- const ret = new Uint8Array(getObject(arg0));
1359
- return addHeapObject(ret);
1360
- };
1361
- imports.wbg.__wbg_new_a774eb7503f03596 = function() {
1362
- const ret = new Error();
1363
- return addHeapObject(ret);
1364
- };
1365
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1366
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1367
- return addHeapObject(ret);
1368
- };
1369
- imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1370
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1371
- return addHeapObject(ret);
1372
- };
1373
- imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1374
- const ret = new Uint8Array(arg0 >>> 0);
1375
- return addHeapObject(ret);
1376
- };
1377
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1378
- const ret = getObject(arg0).next;
1379
- return addHeapObject(ret);
1380
- };
1381
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1382
- const ret = getObject(arg0).next();
1383
- return addHeapObject(ret);
1384
- }, arguments) };
1385
- imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
1386
- const ret = getObject(arg0).node;
1387
- return addHeapObject(ret);
1388
- };
1389
- imports.wbg.__wbg_packageGraphSources_a4ff6a84f5812e15 = function(arg0) {
1390
- const ret = getObject(arg0).packageGraphSources;
1391
- return addHeapObject(ret);
1392
- };
1393
- imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
1394
- const ret = getObject(arg0).process;
1395
- return addHeapObject(ret);
1396
- };
1397
- imports.wbg.__wbg_profile_35b65d3ebe7ebbee = function(arg0, arg1) {
1398
- const ret = getObject(arg1).profile;
1399
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1400
- const len1 = WASM_VECTOR_LEN;
1401
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1402
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1403
- };
1404
- imports.wbg.__wbg_projectType_2bf93409ae72a803 = function(arg0, arg1) {
1405
- const ret = getObject(arg1).projectType;
1406
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1407
- const len1 = WASM_VECTOR_LEN;
1408
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1409
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1410
- };
1411
- imports.wbg.__wbg_queueMicrotask_98e746b9f850fe3d = function(arg0) {
1412
- queueMicrotask(getObject(arg0));
1413
- };
1414
- imports.wbg.__wbg_queueMicrotask_c847cc8372bec908 = function(arg0) {
1415
- const ret = getObject(arg0).queueMicrotask;
1416
- return addHeapObject(ret);
1417
- };
1418
- imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1419
- getObject(arg0).randomFillSync(takeObject(arg1));
1420
- }, arguments) };
1421
- imports.wbg.__wbg_readFile_69715ec88ba8893d = function() { return handleError(function (arg0, arg1, arg2) {
1422
- const ret = getObject(arg0).readFile(getStringFromWasm0(arg1, arg2));
1423
- return addHeapObject(ret);
1424
- }, arguments) };
1425
- imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1426
- const ret = module.require;
1427
- return addHeapObject(ret);
1428
- }, arguments) };
1429
- imports.wbg.__wbg_resolvePath_b4556f7b4689ad4a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1430
- const ret = getObject(arg0).resolvePath(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1431
- return addHeapObject(ret);
1432
- }, arguments) };
1433
- imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1434
- const ret = Promise.resolve(getObject(arg0));
1435
- return addHeapObject(ret);
1436
- };
1437
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1438
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1439
- };
1440
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1441
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1442
- };
1443
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1444
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1445
- };
1446
- imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
1447
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1448
- return addHeapObject(ret);
1449
- };
1450
- imports.wbg.__wbg_setstacktracelimit_1055f99289ff0c7b = function(arg0) {
1451
- Error.stackTraceLimit = arg0 >>> 0;
1452
- };
1453
- imports.wbg.__wbg_stack_ab46af82f81848ee = function(arg0, arg1) {
1454
- const ret = getObject(arg1).stack;
1455
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1456
- const len1 = WASM_VECTOR_LEN;
1457
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1458
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1459
- };
1460
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1461
- const ret = typeof global === 'undefined' ? null : global;
1462
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1463
- };
1464
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1465
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1466
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1467
- };
1468
- imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1469
- const ret = typeof self === 'undefined' ? null : self;
1470
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1471
- };
1472
- imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1473
- const ret = typeof window === 'undefined' ? null : window;
1474
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1475
- };
1476
- imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1477
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1478
- return addHeapObject(ret);
1479
- };
1480
- imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1481
- const ret = getObject(arg0).then(getObject(arg1));
1482
- return addHeapObject(ret);
1483
- };
1484
- imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1485
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1486
- return addHeapObject(ret);
1487
- };
1488
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1489
- const ret = getObject(arg0).value;
1490
- return addHeapObject(ret);
1491
- };
1492
- imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1493
- const ret = getObject(arg0).versions;
1494
- return addHeapObject(ret);
1495
- };
1496
- imports.wbg.__wbindgen_as_number = function(arg0) {
1497
- const ret = +getObject(arg0);
1498
- return ret;
1499
- };
1500
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
1501
- const ret = arg0;
1502
- return addHeapObject(ret);
1503
- };
1504
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1505
- const ret = BigInt.asUintN(64, arg0);
1506
- return addHeapObject(ret);
1507
- };
1508
- imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
1509
- const v = getObject(arg1);
1510
- const ret = typeof(v) === 'bigint' ? v : undefined;
1511
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1512
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1513
- };
1514
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
1515
- const v = getObject(arg0);
1516
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1517
- return ret;
1518
- };
1519
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
1520
- const obj = takeObject(arg0).original;
1521
- if (obj.cnt-- == 1) {
1522
- obj.a = 0;
1523
- return true;
1636
+ function expectedResponseType(type) {
1637
+ switch (type) {
1638
+ case 'basic': case 'cors': case 'default': return true;
1524
1639
  }
1525
- const ret = false;
1526
- return ret;
1527
- };
1528
- imports.wbg.__wbindgen_closure_wrapper6738 = function(arg0, arg1, arg2) {
1529
- const ret = makeMutClosure(arg0, arg1, 2131, __wbg_adapter_52);
1530
- return addHeapObject(ret);
1531
- };
1532
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1533
- const ret = debugString(getObject(arg1));
1534
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1535
- const len1 = WASM_VECTOR_LEN;
1536
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1537
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1538
- };
1539
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1540
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1541
- return addHeapObject(ret);
1542
- };
1543
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
1544
- const ret = getObject(arg0) in getObject(arg1);
1545
- return ret;
1546
- };
1547
- imports.wbg.__wbindgen_is_array = function(arg0) {
1548
- const ret = Array.isArray(getObject(arg0));
1549
- return ret;
1550
- };
1551
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
1552
- const ret = typeof(getObject(arg0)) === 'bigint';
1553
- return ret;
1554
- };
1555
- imports.wbg.__wbindgen_is_function = function(arg0) {
1556
- const ret = typeof(getObject(arg0)) === 'function';
1557
- return ret;
1558
- };
1559
- imports.wbg.__wbindgen_is_object = function(arg0) {
1560
- const val = getObject(arg0);
1561
- const ret = typeof(val) === 'object' && val !== null;
1562
- return ret;
1563
- };
1564
- imports.wbg.__wbindgen_is_string = function(arg0) {
1565
- const ret = typeof(getObject(arg0)) === 'string';
1566
- return ret;
1567
- };
1568
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
1569
- const ret = getObject(arg0) === undefined;
1570
- return ret;
1571
- };
1572
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
1573
- const ret = getObject(arg0) === getObject(arg1);
1574
- return ret;
1575
- };
1576
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1577
- const ret = getObject(arg0) == getObject(arg1);
1578
- return ret;
1579
- };
1580
- imports.wbg.__wbindgen_memory = function() {
1581
- const ret = wasm.memory;
1582
- return addHeapObject(ret);
1583
- };
1584
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
1585
- const obj = getObject(arg1);
1586
- const ret = typeof(obj) === 'number' ? obj : undefined;
1587
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1588
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1589
- };
1590
- imports.wbg.__wbindgen_number_new = function(arg0) {
1591
- const ret = arg0;
1592
- return addHeapObject(ret);
1593
- };
1594
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1595
- const ret = getObject(arg0);
1596
- return addHeapObject(ret);
1597
- };
1598
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1599
- takeObject(arg0);
1600
- };
1601
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1602
- const obj = getObject(arg1);
1603
- const ret = typeof(obj) === 'string' ? obj : undefined;
1604
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1605
- var len1 = WASM_VECTOR_LEN;
1606
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1607
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1608
- };
1609
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1610
- const ret = getStringFromWasm0(arg0, arg1);
1611
- return addHeapObject(ret);
1612
- };
1613
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1614
- throw new Error(getStringFromWasm0(arg0, arg1));
1615
- };
1616
-
1617
- return imports;
1618
- }
1619
-
1620
- function __wbg_init_memory(imports, memory) {
1621
-
1622
- }
1623
-
1624
- function __wbg_finalize_init(instance, module) {
1625
- wasm = instance.exports;
1626
- __wbg_init.__wbindgen_wasm_module = module;
1627
- cachedDataViewMemory0 = null;
1628
- cachedUint32ArrayMemory0 = null;
1629
- cachedUint8ArrayMemory0 = null;
1630
-
1631
-
1632
-
1633
- return wasm;
1640
+ return false;
1641
+ }
1634
1642
  }
1635
1643
 
1636
1644
  function initSync(module) {
1637
1645
  if (wasm !== undefined) return wasm;
1638
1646
 
1639
1647
 
1640
- if (typeof module !== 'undefined') {
1648
+ if (module !== undefined) {
1641
1649
  if (Object.getPrototypeOf(module) === Object.prototype) {
1642
1650
  ({module} = module)
1643
1651
  } else {
@@ -1646,15 +1654,10 @@ function initSync(module) {
1646
1654
  }
1647
1655
 
1648
1656
  const imports = __wbg_get_imports();
1649
-
1650
- __wbg_init_memory(imports);
1651
-
1652
1657
  if (!(module instanceof WebAssembly.Module)) {
1653
1658
  module = new WebAssembly.Module(module);
1654
1659
  }
1655
-
1656
1660
  const instance = new WebAssembly.Instance(module, imports);
1657
-
1658
1661
  return __wbg_finalize_init(instance, module);
1659
1662
  }
1660
1663
 
@@ -1662,7 +1665,7 @@ async function __wbg_init(module_or_path) {
1662
1665
  if (wasm !== undefined) return wasm;
1663
1666
 
1664
1667
 
1665
- if (typeof module_or_path !== 'undefined') {
1668
+ if (module_or_path !== undefined) {
1666
1669
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1667
1670
  ({module_or_path} = module_or_path)
1668
1671
  } else {
@@ -1670,7 +1673,7 @@ async function __wbg_init(module_or_path) {
1670
1673
  }
1671
1674
  }
1672
1675
 
1673
- if (typeof module_or_path === 'undefined') {
1676
+ if (module_or_path === undefined) {
1674
1677
  module_or_path = new URL('qsc_wasm_bg.wasm', import.meta.url);
1675
1678
  }
1676
1679
  const imports = __wbg_get_imports();
@@ -1679,12 +1682,9 @@ async function __wbg_init(module_or_path) {
1679
1682
  module_or_path = fetch(module_or_path);
1680
1683
  }
1681
1684
 
1682
- __wbg_init_memory(imports);
1683
-
1684
1685
  const { instance, module } = await __wbg_load(await module_or_path, imports);
1685
1686
 
1686
1687
  return __wbg_finalize_init(instance, module);
1687
1688
  }
1688
1689
 
1689
- export { initSync };
1690
- export default __wbg_init;
1690
+ export { initSync, __wbg_init as default };