@arcgis/core 4.32.0-next.20250102 → 4.32.0-next.20250103

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 (261) hide show
  1. package/Color.js +1 -1
  2. package/PopupTemplate.js +1 -1
  3. package/arcade/functions/date.js +1 -1
  4. package/arcade/functions/featuresetbase.js +1 -1
  5. package/arcade/functions/featuresetstats.js +1 -1
  6. package/arcade/functions/featuresetstring.js +1 -1
  7. package/arcade/functions/geomasync.js +1 -1
  8. package/arcade/functions/geometry.js +1 -1
  9. package/arcade/functions/geomsync.js +1 -1
  10. package/arcade/functions/knowledgegraph.js +1 -1
  11. package/arcade/functions/string.js +1 -1
  12. package/arcade/geometry/extendedUnitData.js +5 -0
  13. package/arcade/geometry/functions.js +5 -0
  14. package/arcade/geometry/operators.js +5 -0
  15. package/arcade/geometry/unitConversion.js +5 -0
  16. package/arcade/geometry/wkt.js +5 -0
  17. package/arcade/languageUtils.js +1 -1
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js → 005727711cca0614c2ab.js} +2 -2
  20. package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js.LICENSE.txt → 005727711cca0614c2ab.js.LICENSE.txt} +1 -1
  21. package/assets/esri/core/workers/chunks/{2d908c115ea18e813b95.js → 00c0fbe19c12691cf2c3.js} +1 -1
  22. package/assets/esri/core/workers/chunks/08e28328385066c519c2.js +1 -0
  23. package/assets/esri/core/workers/chunks/{0e735d01296d340b393e.js → 0b95ec12218f3c04df18.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{59bf879b4802a5ba431e.js → 0ee669947c23f469e357.js} +1 -1
  25. package/assets/esri/core/workers/chunks/116103ecec27cce47a2f.js +1 -0
  26. package/assets/esri/core/workers/chunks/11f00218905f0db447ff.js +1 -0
  27. package/assets/esri/core/workers/chunks/14b87f3dd9942e6b19d0.js +1 -0
  28. package/assets/esri/core/workers/chunks/16d7c07e1c11b88dae84.js +1 -0
  29. package/assets/esri/core/workers/chunks/1d04fe800cb98e4d6bc4.js +1 -0
  30. package/assets/esri/core/workers/chunks/{71f6e5742cf0c482066b.js → 1dc6b5b177022b80c473.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{59455e2dd44b4c01cc76.js → 2586741c359057b3f626.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{250a810dd4e1ff293564.js → 318a39b56851e707edad.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js → 370b230fd2d7703d0698.js} +2 -2
  34. package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js.LICENSE.txt → 370b230fd2d7703d0698.js.LICENSE.txt} +1 -1
  35. package/assets/esri/core/workers/chunks/38d03fe352057fb375b5.js +1 -0
  36. package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js → 42aa697b4718b75b8cb2.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js.LICENSE.txt → 42aa697b4718b75b8cb2.js.LICENSE.txt} +1 -1
  38. package/assets/esri/core/workers/chunks/{801dbea20966806db1c9.js → 53cd990b2c988518de6d.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5a1eb0d1e25ff5574c43.js +1 -0
  40. package/assets/esri/core/workers/chunks/6157c49e7431f5868c77.js +1 -0
  41. package/assets/esri/core/workers/chunks/{eef2d94a73064f9bc085.js → 61d64f163840563017d5.js} +1 -1
  42. package/assets/esri/core/workers/chunks/6d218fb5e0f0a04d72c5.js +2 -0
  43. package/assets/esri/core/workers/chunks/{d82b3e2905cab511ff3a.js.LICENSE.txt → 6d218fb5e0f0a04d72c5.js.LICENSE.txt} +1 -1
  44. package/assets/esri/core/workers/chunks/6ed57d01be6bc054c7cd.js +1 -0
  45. package/assets/esri/core/workers/chunks/7254956381e823219db0.js +1 -0
  46. package/assets/esri/core/workers/chunks/740e6bdb3b76f2ea6d61.js +1 -0
  47. package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
  48. package/assets/esri/core/workers/chunks/{56fc353421252f2d0a99.js → 75e8ba7e02647b7216ae.js} +1 -1
  49. package/assets/esri/core/workers/chunks/89d7eec47e5b29935d92.js +1 -0
  50. package/assets/esri/core/workers/chunks/8cd2c9ec1e541836b81c.js +1 -0
  51. package/assets/esri/core/workers/chunks/{0b3e1e903120da297641.js → 932375de79e3d33bc4d7.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{263adfd1c2641ef5c0f5.js → 95f23bd17ce9e07fc8ef.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{7de9c01849c4aa1940e7.js → 986889cea53c4a470347.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{cc6160e8ab3cea4040c2.js → 9e9b2fd958e816b1b5f6.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a57cead317eb2fc9afd8.js +1 -0
  56. package/assets/esri/core/workers/chunks/acec58a7f23b2cc938ee.js +1 -0
  57. package/assets/esri/core/workers/chunks/b0f4254d8a32dd713009.js +1 -0
  58. package/assets/esri/core/workers/chunks/b277b8c2f556918e4f9a.js +1 -0
  59. package/assets/esri/core/workers/chunks/{deffd56e39ce725ce377.js → b30046a40bcfbec8abe4.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{5c11e2e65b97565e5003.js → b7db64b07edb0b37ece1.js} +1 -1
  61. package/assets/esri/core/workers/chunks/bd1fb82e8bac439d05ea.js +1 -0
  62. package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
  63. package/assets/esri/core/workers/chunks/c44ce0302dc82fb66ada.js +1 -0
  64. package/assets/esri/core/workers/chunks/c52872a50a5989121388.js +1 -0
  65. package/assets/esri/core/workers/chunks/c8cd6ba5600d8ff8db0b.js +2 -0
  66. package/assets/esri/core/workers/chunks/{a100fb789d72410f8d4f.js.LICENSE.txt → c8cd6ba5600d8ff8db0b.js.LICENSE.txt} +1 -1
  67. package/assets/esri/core/workers/chunks/{57c1370b310768c0790a.js → ca1e186f136abb23ae4b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{d14e4fc82ad772899336.js → ca4a37bdc0f7fb705146.js} +1 -1
  69. package/assets/esri/core/workers/chunks/cb94fc9b0f613ad50b3f.js +1 -0
  70. package/assets/esri/core/workers/chunks/d20764cc99fcabcb7cbf.js +1 -0
  71. package/assets/esri/core/workers/chunks/df18a72e3625cbe31935.js +1 -0
  72. package/assets/esri/core/workers/chunks/eff8fcb6393cd1193cbc.js +1 -0
  73. package/assets/esri/core/workers/chunks/f19d3c855f6e93544918.js +1 -0
  74. package/assets/esri/core/workers/chunks/{60b40b2319d1651dd150.js → f7e50a8284d12da21355.js} +1 -1
  75. package/assets/esri/core/workers/chunks/f9c0d571f62e611ffe2b.js +1 -0
  76. package/assets/esri/core/workers/chunks/fdfe8e0d942b78f08191.js +1 -0
  77. package/assets/esri/core/workers/chunks/ff21207f46a354786eed.js +1 -0
  78. package/chunks/Bufferer-BiY2mtjI.js +1 -1
  79. package/chunks/Centroid-DZi-eb9F.js +1 -1
  80. package/chunks/Clipper-a9xfvRaw.js +1 -1
  81. package/chunks/CrackAndCluster-CfzXpEle.js +1 -1
  82. package/chunks/Distance2DCalculator-eS0piaux.js +1 -1
  83. package/chunks/GeodeticDistanceCalculator-bNilDneE.js +1 -1
  84. package/chunks/Geometry.js +1 -1
  85. package/chunks/GeometryCleaner-DVgW95-D.js +1 -1
  86. package/chunks/Intersector-K1VmdfQW.js +1 -1
  87. package/chunks/LineSeries.js +1 -1
  88. package/chunks/OperatorClip.js +1 -1
  89. package/chunks/OperatorCrosses.js +1 -1
  90. package/chunks/OperatorCut.js +1 -1
  91. package/chunks/OperatorDensify.js +1 -1
  92. package/chunks/OperatorDifference.js +1 -1
  93. package/chunks/OperatorGeneralize.js +1 -1
  94. package/chunks/OperatorGeodesicBuffer.js +1 -1
  95. package/chunks/OperatorGeodeticArea.js +1 -1
  96. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  97. package/chunks/OperatorGeodeticDistance.js +1 -1
  98. package/chunks/OperatorGeodeticLength.js +1 -1
  99. package/chunks/OperatorIntersection.js +1 -1
  100. package/chunks/OperatorIntersects.js +1 -1
  101. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  102. package/chunks/OperatorOverlaps.js +1 -1
  103. package/chunks/OperatorProject.js +1 -1
  104. package/chunks/OperatorProximity.js +1 -1
  105. package/chunks/OperatorProximityGeodesic.js +1 -1
  106. package/chunks/OperatorShapePreservingDensify.js +1 -1
  107. package/chunks/OperatorShapePreservingLength.js +1 -1
  108. package/chunks/OperatorSimplify.js +1 -1
  109. package/chunks/OperatorTouches.js +1 -1
  110. package/chunks/OperatorUnion.js +1 -1
  111. package/chunks/OperatorWithin.js +1 -1
  112. package/chunks/QuadraticBezier.js +1 -1
  113. package/chunks/SideCalculator2D-Bf4QCxCR.js +1 -1
  114. package/chunks/Theme.js +1 -1
  115. package/chunks/Tick.js +1 -1
  116. package/chunks/Transformation2D.js +1 -1
  117. package/chunks/arcade.js +1 -1
  118. package/chunks/areaOperator.js +5 -0
  119. package/chunks/array.js +1 -1
  120. package/chunks/bufferOperator.js +5 -0
  121. package/chunks/centroidOperator.js +5 -0
  122. package/chunks/chartUtilsAm5.js +1 -1
  123. package/chunks/clipOperator.js +5 -0
  124. package/chunks/containsOperator.js +5 -0
  125. package/chunks/convexHullOperator.js +5 -0
  126. package/chunks/crossesOperator.js +5 -0
  127. package/chunks/cutOperator.js +5 -0
  128. package/chunks/densifyOperator.js +5 -0
  129. package/chunks/differenceOperator.js +5 -0
  130. package/chunks/disjointOperator.js +5 -0
  131. package/chunks/distanceOperator.js +5 -0
  132. package/chunks/equalsOperator.js +5 -0
  133. package/chunks/generalizeOperator.js +5 -0
  134. package/chunks/geodesicBufferOperator.js +5 -0
  135. package/chunks/geodeticAreaOperator.js +5 -0
  136. package/chunks/geodeticDensifyOperator.js +5 -0
  137. package/chunks/geodeticLengthOperator.js +5 -0
  138. package/chunks/i3s.js +1 -1
  139. package/chunks/intersectionOperator.js +5 -0
  140. package/chunks/intersectsOperator.js +5 -0
  141. package/chunks/languageUtils.js +1 -1
  142. package/chunks/lclayout.js +1 -1
  143. package/chunks/lengthOperator.js +5 -0
  144. package/chunks/lyr3DMain.js +1 -1
  145. package/chunks/lyr3DWorker.js +1 -1
  146. package/chunks/offsetOperator.js +5 -0
  147. package/chunks/overlapsOperator.js +5 -0
  148. package/chunks/pe-wasm.js +1 -1
  149. package/chunks/proximityOperator.js +5 -0
  150. package/chunks/relateOperator.js +5 -0
  151. package/chunks/simplifyOperator.js +5 -0
  152. package/chunks/symmetricDifferenceOperator.js +5 -0
  153. package/chunks/touchesOperator.js +5 -0
  154. package/chunks/unionOperator.js +5 -0
  155. package/chunks/vxlLayer.js +1 -1
  156. package/chunks/withinOperator.js +5 -0
  157. package/copyright.txt +2 -2
  158. package/core/Evented.js +1 -1
  159. package/geometry/operators/areaOperator.js +1 -1
  160. package/geometry/operators/bufferOperator.js +1 -1
  161. package/geometry/operators/centroidOperator.js +1 -1
  162. package/geometry/operators/clipOperator.js +1 -1
  163. package/geometry/operators/containsOperator.js +1 -1
  164. package/geometry/operators/convexHullOperator.js +1 -1
  165. package/geometry/operators/crossesOperator.js +1 -1
  166. package/geometry/operators/cutOperator.js +1 -1
  167. package/geometry/operators/densifyOperator.js +1 -1
  168. package/geometry/operators/differenceOperator.js +1 -1
  169. package/geometry/operators/disjointOperator.js +1 -1
  170. package/geometry/operators/distanceOperator.js +1 -1
  171. package/geometry/operators/equalsOperator.js +1 -1
  172. package/geometry/operators/extendOperator.js +1 -1
  173. package/geometry/operators/generalizeOperator.js +1 -1
  174. package/geometry/operators/geodesicBufferOperator.js +1 -1
  175. package/geometry/operators/geodeticAreaOperator.js +1 -1
  176. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  177. package/geometry/operators/geodeticLengthOperator.js +1 -1
  178. package/geometry/operators/gx/operatorAffineTransform.js +1 -1
  179. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  180. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  181. package/geometry/operators/gx/operatorBoundary.js +1 -1
  182. package/geometry/operators/gx/operatorBuffer.js +1 -1
  183. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  184. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  185. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  186. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  187. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  188. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  189. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  190. package/geometry/operators/gx/operatorOffset.js +1 -1
  191. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  192. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  193. package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
  194. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  195. package/geometry/operators/intersectionOperator.js +1 -1
  196. package/geometry/operators/intersectsOperator.js +1 -1
  197. package/geometry/operators/isNearOperator.js +1 -1
  198. package/geometry/operators/json/disjointOperator.js +1 -1
  199. package/geometry/operators/lengthOperator.js +1 -1
  200. package/geometry/operators/offsetOperator.js +1 -1
  201. package/geometry/operators/overlapsOperator.js +1 -1
  202. package/geometry/operators/proximityOperator.js +1 -1
  203. package/geometry/operators/relateOperator.js +1 -1
  204. package/geometry/operators/reshapeOperator.js +1 -1
  205. package/geometry/operators/simplifyOperator.js +1 -1
  206. package/geometry/operators/support/apiConverter.js +1 -1
  207. package/geometry/operators/support/jsonConverter.js +1 -1
  208. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  209. package/geometry/operators/touchesOperator.js +1 -1
  210. package/geometry/operators/unionOperator.js +1 -1
  211. package/geometry/operators/withinOperator.js +1 -1
  212. package/geometry/support/contains.js +1 -1
  213. package/kernel.js +1 -1
  214. package/layers/KMLLayer.js +1 -1
  215. package/layers/WCSLayer.js +1 -1
  216. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  217. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  218. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  219. package/layers/support/wmtsUtils.js +1 -1
  220. package/package.json +3 -3
  221. package/smartMapping/renderers/support/utils.js +1 -1
  222. package/smartMapping/symbology/support/Theme.js +1 -1
  223. package/support/revision.js +1 -1
  224. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  225. package/views/3d/support/DisplayQualityProfile.js +1 -1
  226. package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
  227. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  228. package/views/SelectionManager.js +1 -1
  229. package/widgets/BatchAttributeForm.js +1 -1
  230. package/widgets/Feature/support/featureUtils.js +1 -1
  231. package/widgets/Legend/support/heatmapRampUtils.js +1 -1
  232. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  233. package/widgets/OrientedImageryViewer.js +1 -1
  234. package/assets/esri/core/workers/chunks/015285436ca965f94e17.js +0 -1
  235. package/assets/esri/core/workers/chunks/048d296efa26ccd79056.js +0 -1
  236. package/assets/esri/core/workers/chunks/0e0b978459d70b15acb5.js +0 -1
  237. package/assets/esri/core/workers/chunks/10fa211987b16fd71a1a.js +0 -1
  238. package/assets/esri/core/workers/chunks/200a5f1864c2c2f7536c.js +0 -1
  239. package/assets/esri/core/workers/chunks/23a697d48f6e45cc033e.js +0 -1
  240. package/assets/esri/core/workers/chunks/29b610ff44708e044cbd.js +0 -1
  241. package/assets/esri/core/workers/chunks/3600125c58d5d04c515a.js +0 -1
  242. package/assets/esri/core/workers/chunks/457d4abc938d14f28e31.js +0 -1
  243. package/assets/esri/core/workers/chunks/4b5dbdcad438cb2dd4bf.js +0 -1
  244. package/assets/esri/core/workers/chunks/69efc716991a407c3d23.js +0 -1
  245. package/assets/esri/core/workers/chunks/6e254e846e284223ef63.js +0 -1
  246. package/assets/esri/core/workers/chunks/785610aa615198fd3815.js +0 -1
  247. package/assets/esri/core/workers/chunks/7bf7aace72f81f5de4e4.js +0 -1
  248. package/assets/esri/core/workers/chunks/7ea3d652536e1d79dfc6.js +0 -1
  249. package/assets/esri/core/workers/chunks/816c9c81352cd0ca8ce8.js +0 -1
  250. package/assets/esri/core/workers/chunks/9291508232b23f030178.js +0 -1
  251. package/assets/esri/core/workers/chunks/9fc49968dea8e2b64f3e.js +0 -1
  252. package/assets/esri/core/workers/chunks/a0b3d70a1b0360084593.js +0 -1
  253. package/assets/esri/core/workers/chunks/a100fb789d72410f8d4f.js +0 -2
  254. package/assets/esri/core/workers/chunks/b4d76d46661aba356ea3.js +0 -1
  255. package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +0 -1
  256. package/assets/esri/core/workers/chunks/cbf57abb537e86c1dd7f.js +0 -1
  257. package/assets/esri/core/workers/chunks/cebdf2f88c4d2ad8baab.js +0 -1
  258. package/assets/esri/core/workers/chunks/d56d77125798beb7e493.js +0 -1
  259. package/assets/esri/core/workers/chunks/d82b3e2905cab511ff3a.js +0 -2
  260. package/assets/esri/core/workers/chunks/e2f91098793b8742fae6.js +0 -1
  261. package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1053,2343],{11053:(e,r,t)=>{t.d(r,{c:()=>n,g:()=>o});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},2343:(e,r,t)=>{t.r(r),t.d(r,{l:()=>s});var n,o=t(11053),a={exports:{}};const i=(0,o.g)(function(){return n||(n=1,e=a,r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,t=function(e={}){var t,n,a=e;a.ready=new Promise(((e,r)=>{t=e,n=r}));var i,s,u=Object.assign({},a),l="./this.program",d=(e,r)=>{throw r},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},s=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)};var f,h,m=a.print||console.log.bind(console),p=a.printErr||console.error.bind(console);Object.assign(a,u),u=null,a.arguments&&a.arguments,a.thisProgram&&(l=a.thisProgram),a.quit&&(d=a.quit),a.wasmBinary&&(f=a.wasmBinary),"object"!=typeof WebAssembly&&x("no native wasm support detected");var v,y,w,g,E,_,b,k,F=!1;function A(e,r){e||x(r)}function S(){var e=h.buffer;a.HEAP8=v=new Int8Array(e),a.HEAP16=w=new Int16Array(e),a.HEAPU8=y=new Uint8Array(e),a.HEAPU16=g=new Uint16Array(e),a.HEAP32=E=new Int32Array(e),a.HEAPU32=_=new Uint32Array(e),a.HEAPF32=b=new Float32Array(e),a.HEAPF64=k=new Float64Array(e)}var D=[],P=[],T=[],$=0,C=null;function M(e){$++,a.monitorRunDependencies&&a.monitorRunDependencies($)}function j(e){if($--,a.monitorRunDependencies&&a.monitorRunDependencies($),0==$&&C){var r=C;C=null,r()}}function x(e){a.onAbort&&a.onAbort(e),p(e="Aborted("+e+")"),F=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var R,O,z,W,N=e=>e.startsWith("data:application/octet-stream;base64,");function L(e){if(e==R&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}function B(e,r,t){return function(e){return f||"function"!=typeof fetch?Promise.resolve().then((()=>L(e))):fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>L(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{p(`failed to asynchronously prepare wasm: ${e}`),x(e)}))}function U(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}N(R="lyr3DWorker.wasm")||(W=R,R=a.locateFile?a.locateFile(W,c):c+W);var I=e=>{for(;e.length>0;)e.shift()(a)},H=a.noExitRuntime||!0;function Y(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,v[this.ptr+12|0]=e},this.get_caught=function(){return 0!=v[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,v[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=v[this.ptr+13|0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){if(br(this.get_type()))return _[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=q.isAbs(e),t="/"===e.substr(-1);return(e=q.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=q.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return q.normalize(e.join("/"))},join2:(e,r)=>q.normalize(e+"/"+r)},V=e=>(V=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);x("initRandomDevice")})())(e),X={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:se.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=q.isAbs(n)}return(r?"/":"")+(e=q.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=X.resolve(e).substr(1),r=X.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},G="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,J=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&G)return G.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var u=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var l=i-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},K=[],Z=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Q=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function ee(e,r,t){var n=Z(e)+1,o=new Array(n),a=Q(e,o,0,o.length);return r&&(o.length=a),o}var re={ttys:[],init(){},shutdown(){},register(e,r){re.ttys[e]={input:[],output:[],ops:r},se.registerDevice(e,re.stream_ops)},stream_ops:{open(e){var r=re.ttys[e.node.rdev];if(!r)throw new se.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new se.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new se.ErrnoError(29)}if(void 0===s&&0===a)throw new se.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new se.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new se.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!K.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;K=ee(e,!0)}return K.shift()})(),put_char(e,r){null===r||10===r?(m(J(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(m(J(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(p(J(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(p(J(e.output,0)),e.output=[])}}},te=e=>{x()},ne={ops_table:null,mount:e=>ne.createNode(null,"/",16895,0),createNode(e,r,t,n){if(se.isBlkdev(t)||se.isFIFO(t))throw new se.ErrnoError(63);ne.ops_table||(ne.ops_table={dir:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr,lookup:ne.node_ops.lookup,mknod:ne.node_ops.mknod,rename:ne.node_ops.rename,unlink:ne.node_ops.unlink,rmdir:ne.node_ops.rmdir,readdir:ne.node_ops.readdir,symlink:ne.node_ops.symlink},stream:{llseek:ne.stream_ops.llseek}},file:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr},stream:{llseek:ne.stream_ops.llseek,read:ne.stream_ops.read,write:ne.stream_ops.write,allocate:ne.stream_ops.allocate,mmap:ne.stream_ops.mmap,msync:ne.stream_ops.msync}},link:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr,readlink:ne.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr},stream:se.chrdev_stream_ops}});var o=se.createNode(e,r,t,n);return se.isDir(o.mode)?(o.node_ops=ne.ops_table.dir.node,o.stream_ops=ne.ops_table.dir.stream,o.contents={}):se.isFile(o.mode)?(o.node_ops=ne.ops_table.file.node,o.stream_ops=ne.ops_table.file.stream,o.usedBytes=0,o.contents=null):se.isLink(o.mode)?(o.node_ops=ne.ops_table.link.node,o.stream_ops=ne.ops_table.link.stream):se.isChrdev(o.mode)&&(o.node_ops=ne.ops_table.chrdev.node,o.stream_ops=ne.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=se.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,se.isDir(e.mode)?r.size=4096:se.isFile(e.mode)?r.size=e.usedBytes:se.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&ne.resizeFileStorage(e,r.size)},lookup(e,r){throw se.genericErrors[44]},mknod:(e,r,t,n)=>ne.createNode(e,r,t,n),rename(e,r,t){if(se.isDir(e.mode)){var n;try{n=se.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new se.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=se.lookupNode(e,r);for(var n in t.contents)throw new se.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=ne.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!se.isLink(e.mode))throw new se.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===v.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(ne.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&se.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new se.ErrnoError(28);return n},allocate(e,r,t){ne.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!se.isFile(e.node.mode))throw new se.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||s.buffer!==v.buffer){if((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),i=!0,!(a=te()))throw new se.ErrnoError(48);v.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(ne.stream_ops.write(e,r,0,n,t,!1),0)}},oe=(e,r,t,n)=>{var o=`al ${e}`;s(e,(t=>{A(t,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(t)),o&&j()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&M()},ae=a.preloadPlugins||[],ie=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},se={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=X.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new se.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=se.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=se.lookupNode(n,t[a]),o=q.join2(o,t[a]),se.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;se.isLink(n.mode);){var u=se.readlink(o);if(o=X.resolve(q.dirname(o),u),n=se.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new se.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(se.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%se.nameTable.length},hashAddNode(e){var r=se.hashName(e.parent.id,e.name);e.name_next=se.nameTable[r],se.nameTable[r]=e},hashRemoveNode(e){var r=se.hashName(e.parent.id,e.name);if(se.nameTable[r]===e)se.nameTable[r]=e.name_next;else for(var t=se.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=se.mayLookup(e);if(t)throw new se.ErrnoError(t,e);for(var n=se.hashName(e.id,r),o=se.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return se.lookup(e,r)},createNode(e,r,t,n){var o=new se.FSNode(e,r,t,n);return se.hashAddNode(o),o},destroyNode(e){se.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>se.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>se.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return se.lookupNode(e,r),20}catch(e){}return se.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=se.lookupNode(e,r)}catch(e){return e.errno}var o=se.nodePermissions(e,"wx");if(o)return o;if(t){if(!se.isDir(n.mode))return 54;if(se.isRoot(n)||se.getPath(n)===se.cwd())return 10}else if(se.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?se.isLink(e.mode)?32:se.isDir(e.mode)&&("r"!==se.flagsToPermissionString(r)||512&r)?31:se.nodePermissions(e,se.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=se.MAX_OPEN_FDS;e++)if(!se.streams[e])return e;throw new se.ErrnoError(33)},getStreamChecked(e){var r=se.getStream(e);if(!r)throw new se.ErrnoError(8);return r},getStream:e=>se.streams[e],createStream:(e,r=-1)=>(se.FSStream||(se.FSStream=function(){this.shared={}},se.FSStream.prototype={},Object.defineProperties(se.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new se.FSStream,e),-1==r&&(r=se.nextfd()),e.fd=r,se.streams[r]=e,e),closeStream(e){se.streams[e]=null},chrdev_stream_ops:{open(e){var r=se.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new se.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){se.devices[e]={stream_ops:r}},getDevice:e=>se.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),se.syncFSRequests++,se.syncFSRequests>1&&p(`warning: ${se.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=se.getMounts(se.root.mount),n=0;function o(e){return se.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&se.root)throw new se.ErrnoError(10);if(!o&&!a){var i=se.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,se.isMountpoint(n))throw new se.ErrnoError(10);if(!se.isDir(n.mode))throw new se.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?se.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=se.lookupPath(e,{follow_mount:!1});if(!se.isMountpoint(r.node))throw new se.ErrnoError(28);var t=r.node,n=t.mounted,o=se.getMounts(n);Object.keys(se.nameTable).forEach((e=>{for(var r=se.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&se.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=se.lookupPath(e,{parent:!0}).node,o=q.basename(e);if(!o||"."===o||".."===o)throw new se.ErrnoError(28);var a=se.mayCreate(n,o);if(a)throw new se.ErrnoError(a);if(!n.node_ops.mknod)throw new se.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,se.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,se.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{se.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,se.mknod(e,r,t)),symlink(e,r){if(!X.resolve(e))throw new se.ErrnoError(44);var t=se.lookupPath(r,{parent:!0}).node;if(!t)throw new se.ErrnoError(44);var n=q.basename(r),o=se.mayCreate(t,n);if(o)throw new se.ErrnoError(o);if(!t.node_ops.symlink)throw new se.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=q.dirname(e),a=q.dirname(r),i=q.basename(e),s=q.basename(r);if(t=se.lookupPath(e,{parent:!0}).node,n=se.lookupPath(r,{parent:!0}).node,!t||!n)throw new se.ErrnoError(44);if(t.mount!==n.mount)throw new se.ErrnoError(75);var u,l=se.lookupNode(t,i),d=X.relative(e,a);if("."!==d.charAt(0))throw new se.ErrnoError(28);if("."!==(d=X.relative(r,o)).charAt(0))throw new se.ErrnoError(55);try{u=se.lookupNode(n,s)}catch(e){}if(l!==u){var c=se.isDir(l.mode),f=se.mayDelete(t,i,c);if(f)throw new se.ErrnoError(f);if(f=u?se.mayDelete(n,s,c):se.mayCreate(n,s))throw new se.ErrnoError(f);if(!t.node_ops.rename)throw new se.ErrnoError(63);if(se.isMountpoint(l)||u&&se.isMountpoint(u))throw new se.ErrnoError(10);if(n!==t&&(f=se.nodePermissions(t,"w")))throw new se.ErrnoError(f);se.hashRemoveNode(l);try{t.node_ops.rename(l,n,s)}catch(e){throw e}finally{se.hashAddNode(l)}}},rmdir(e){var r=se.lookupPath(e,{parent:!0}).node,t=q.basename(e),n=se.lookupNode(r,t),o=se.mayDelete(r,t,!0);if(o)throw new se.ErrnoError(o);if(!r.node_ops.rmdir)throw new se.ErrnoError(63);if(se.isMountpoint(n))throw new se.ErrnoError(10);r.node_ops.rmdir(r,t),se.destroyNode(n)},readdir(e){var r=se.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new se.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=se.lookupPath(e,{parent:!0}).node;if(!r)throw new se.ErrnoError(44);var t=q.basename(e),n=se.lookupNode(r,t),o=se.mayDelete(r,t,!1);if(o)throw new se.ErrnoError(o);if(!r.node_ops.unlink)throw new se.ErrnoError(63);if(se.isMountpoint(n))throw new se.ErrnoError(10);r.node_ops.unlink(r,t),se.destroyNode(n)},readlink(e){var r=se.lookupPath(e).node;if(!r)throw new se.ErrnoError(44);if(!r.node_ops.readlink)throw new se.ErrnoError(28);return X.resolve(se.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=se.lookupPath(e,{follow:!r}).node;if(!t)throw new se.ErrnoError(44);if(!t.node_ops.getattr)throw new se.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>se.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?se.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new se.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){se.chmod(e,r,!0)},fchmod(e,r){var t=se.getStreamChecked(e);se.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?se.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new se.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){se.chown(e,r,t,!0)},fchown(e,r,t){var n=se.getStreamChecked(e);se.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new se.ErrnoError(28);var t;if(!(t="string"==typeof e?se.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new se.ErrnoError(63);if(se.isDir(t.mode))throw new se.ErrnoError(31);if(!se.isFile(t.mode))throw new se.ErrnoError(28);var n=se.nodePermissions(t,"w");if(n)throw new se.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=se.getStreamChecked(e);if(!(2097155&t.flags))throw new se.ErrnoError(28);se.truncate(t.node,r)},utime(e,r,t){var n=se.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new se.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=q.normalize(e);try{n=se.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new se.ErrnoError(20)}else n=se.mknod(e,t,0),o=!0;if(!n)throw new se.ErrnoError(44);if(se.isChrdev(n.mode)&&(r&=-513),65536&r&&!se.isDir(n.mode))throw new se.ErrnoError(54);if(!o){var i=se.mayOpen(n,r);if(i)throw new se.ErrnoError(i)}512&r&&!o&&se.truncate(n,0),r&=-131713;var s=se.createStream({node:n,path:se.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!a.logReadFiles||1&r||(se.readFiles||(se.readFiles={}),e in se.readFiles||(se.readFiles[e]=1)),s},close(e){if(se.isClosed(e))throw new se.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{se.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(se.isClosed(e))throw new se.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new se.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new se.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new se.ErrnoError(28);if(se.isClosed(e))throw new se.ErrnoError(8);if(1==(2097155&e.flags))throw new se.ErrnoError(8);if(se.isDir(e.node.mode))throw new se.ErrnoError(31);if(!e.stream_ops.read)throw new se.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new se.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new se.ErrnoError(28);if(se.isClosed(e))throw new se.ErrnoError(8);if(!(2097155&e.flags))throw new se.ErrnoError(8);if(se.isDir(e.node.mode))throw new se.ErrnoError(31);if(!e.stream_ops.write)throw new se.ErrnoError(28);e.seekable&&1024&e.flags&&se.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new se.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(se.isClosed(e))throw new se.ErrnoError(8);if(r<0||t<=0)throw new se.ErrnoError(28);if(!(2097155&e.flags))throw new se.ErrnoError(8);if(!se.isFile(e.node.mode)&&!se.isDir(e.node.mode))throw new se.ErrnoError(43);if(!e.stream_ops.allocate)throw new se.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new se.ErrnoError(2);if(1==(2097155&e.flags))throw new se.ErrnoError(2);if(!e.stream_ops.mmap)throw new se.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new se.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=se.open(e,r.flags),o=se.stat(e).size,a=new Uint8Array(o);return se.read(n,a,0,o,0),"utf8"===r.encoding?t=J(a,0):"binary"===r.encoding&&(t=a),se.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=se.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(Z(r)+1),a=Q(r,o,0,o.length);se.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");se.write(n,r,0,r.byteLength,void 0,t.canOwn)}se.close(n)},cwd:()=>se.currentPath,chdir(e){var r=se.lookupPath(e,{follow:!0});if(null===r.node)throw new se.ErrnoError(44);if(!se.isDir(r.node.mode))throw new se.ErrnoError(54);var t=se.nodePermissions(r.node,"x");if(t)throw new se.ErrnoError(t);se.currentPath=r.path},createDefaultDirectories(){se.mkdir("/tmp"),se.mkdir("/home"),se.mkdir("/home/web_user")},createDefaultDevices(){se.mkdir("/dev"),se.registerDevice(se.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),se.mkdev("/dev/null",se.makedev(1,3)),re.register(se.makedev(5,0),re.default_tty_ops),re.register(se.makedev(6,0),re.default_tty1_ops),se.mkdev("/dev/tty",se.makedev(5,0)),se.mkdev("/dev/tty1",se.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=V(e).byteLength),e[--r]);se.createDevice("/dev","random",t),se.createDevice("/dev","urandom",t),se.mkdir("/dev/shm"),se.mkdir("/dev/shm/tmp")},createSpecialDirectories(){se.mkdir("/proc");var e=se.mkdir("/proc/self");se.mkdir("/proc/self/fd"),se.mount({mount(){var r=se.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=se.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){a.stdin?se.createDevice("/dev","stdin",a.stdin):se.symlink("/dev/tty","/dev/stdin"),a.stdout?se.createDevice("/dev","stdout",null,a.stdout):se.symlink("/dev/tty","/dev/stdout"),a.stderr?se.createDevice("/dev","stderr",null,a.stderr):se.symlink("/dev/tty1","/dev/stderr"),se.open("/dev/stdin",0),se.open("/dev/stdout",1),se.open("/dev/stderr",1)},ensureErrnoError(){se.ErrnoError||(se.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},se.ErrnoError.prototype=new Error,se.ErrnoError.prototype.constructor=se.ErrnoError,[44].forEach((e=>{se.genericErrors[e]=new se.ErrnoError(e),se.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){se.ensureErrnoError(),se.nameTable=new Array(4096),se.mount(ne,{},"/"),se.createDefaultDirectories(),se.createDefaultDevices(),se.createSpecialDirectories(),se.filesystems={MEMFS:ne}},init(e,r,t){se.init.initialized=!0,se.ensureErrnoError(),a.stdin=e||a.stdin,a.stdout=r||a.stdout,a.stderr=t||a.stderr,se.createStandardStreams()},quit(){se.init.initialized=!1;for(var e=0;e<se.streams.length;e++){var r=se.streams[e];r&&se.close(r)}},findObject(e,r){var t=se.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=se.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=se.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=q.basename(e),n=se.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:se.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=q.join2(e,a);try{se.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=q.join2("string"==typeof e?e:se.getPath(e),r),i=ie(n,o);return se.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:se.getPath(e),i=r?q.join2(e,r):e);var s=ie(n,o),u=se.create(i,s);if(t){if("string"==typeof t){for(var l=new Array(t.length),d=0,c=t.length;d<c;++d)l[d]=t.charCodeAt(d);t=l}se.chmod(u,146|s);var f=se.open(u,577);se.write(f,t,0,t.length,0,a),se.close(f),se.chmod(u,s)}return u},createDevice(e,r,t,n){var o=q.join2("string"==typeof e?e:se.getPath(e),r),a=ie(!!t,!!n);se.createDevice.major||(se.createDevice.major=64);var i=se.makedev(se.createDevice.major++,0);return se.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new se.ErrnoError(29)}if(void 0===u&&0===i)throw new se.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new se.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),se.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!i)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ee(i(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new se.ErrnoError(29)}},createLazyFile(e,r,t,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ee(o.responseText||"",!0)},u=this;u.setDataGetter((e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw new Error("doXHR failed!");return u.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:t},s=se.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach((e=>{var r=s.stream_ops[e];u[e]=function(){return se.forceLoadFile(s),r.apply(null,arguments)}})),u.read=(e,r,t,n,o)=>(se.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{se.forceLoadFile(s);var a=te();if(!a)throw new se.ErrnoError(48);return l(e,v,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s}},ue=(e,r)=>e?J(y,e,r):"",le={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(q.isAbs(r))return r;var n;if(n=-100===e?se.cwd():le.getStreamFromFD(e).path,0==r.length){if(!t)throw new se.ErrnoError(44);return n}return q.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&q.normalize(r)!==q.normalize(se.getPath(e.node)))return-54;throw e}E[t>>2]=n.dev,E[t+4>>2]=n.mode,_[t+8>>2]=n.nlink,E[t+12>>2]=n.uid,E[t+16>>2]=n.gid,E[t+20>>2]=n.rdev,z=[n.size>>>0,(O=n.size,+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+24>>2]=z[0],E[t+28>>2]=z[1],E[t+32>>2]=4096,E[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return z=[Math.floor(o/1e3)>>>0,(O=Math.floor(o/1e3),+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+40>>2]=z[0],E[t+44>>2]=z[1],_[t+48>>2]=o%1e3*1e3,z=[Math.floor(a/1e3)>>>0,(O=Math.floor(a/1e3),+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+56>>2]=z[0],E[t+60>>2]=z[1],_[t+64>>2]=a%1e3*1e3,z=[Math.floor(i/1e3)>>>0,(O=Math.floor(i/1e3),+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+72>>2]=z[0],E[t+76>>2]=z[1],_[t+80>>2]=i%1e3*1e3,z=[n.ino>>>0,(O=n.ino,+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+88>>2]=z[0],E[t+92>>2]=z[1],0},doMsync(e,r,t,n,o){if(!se.isFile(r.node.mode))throw new se.ErrnoError(43);if(2&n)return 0;var a=y.slice(e,e+t);se.msync(r,a,o,t,n)},varargs:void 0,get(){var e=E[+le.varargs>>2];return le.varargs+=4,e},getp:()=>le.get(),getStr:e=>ue(e),getStreamFromFD:e=>se.getStreamChecked(e)},de={},ce=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function fe(e){return this.fromWireType(E[e>>2])}var he,me,pe,ve={},ye={},we={},ge=e=>{throw new he(e)},Ee=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&ge("Mismatched type converter count");for(var o=0;o<e.length;++o)ke(e[o],n[o])}e.forEach((function(e){we[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{ye.hasOwnProperty(e)?o[r]=ye[e]:(a.push(e),ve.hasOwnProperty(e)||(ve[e]=[]),ve[e].push((()=>{o[r]=ye[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},_e=e=>{for(var r="",t=e;y[t];)r+=me[y[t++]];return r},be=e=>{throw new pe(e)};function ke(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||be(`type "${n}" must have a positive integer typeid pointer`),ye.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;be(`Cannot register type '${n}' twice`)}if(ye[e]=r,delete we[e],ve.hasOwnProperty(e)){var o=ve[e];delete ve[e],o.forEach((e=>e()))}}(e,r,t)}function Fe(){this.allocated=[void 0],this.freelist=[]}var Ae,Se,De=new Fe,Pe=e=>{e>=De.reserved&&0==--De.get(e).refcount&&De.free(e)},Te=e=>(e||be("Cannot use deleted val. handle = "+e),De.get(e).value),$e=e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return De.allocate({refcount:1,value:e})}},Ce=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(b[e>>2])};case 8:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Me=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||be(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},je=(e,r,t)=>{a.hasOwnProperty(e)?((void 0===t||void 0!==a[e].overloadTable&&void 0!==a[e].overloadTable[t])&&be(`Cannot register public name '${e}' twice`),Me(a,e,e),a.hasOwnProperty(t)&&be(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),a[e].overloadTable[t]=r):(a[e]=r,void 0!==t&&(a[e].numArguments=t))},xe=(e,r,t)=>{a.hasOwnProperty(e)||ge("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==t?a[e].overloadTable[t]=r:(a[e]=r,a[e].argCount=t)},Re=[],Oe=e=>{var r=Re[e];return r||(e>=Re.length&&(Re.length=e+1),Re[e]=r=Ae.get(e)),r},ze=(e,r)=>{var t=(e=_e(e)).includes("j")?((e,r)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{var n=a["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):Oe(r).apply(null,t))(e,r,t)}})(e,r):Oe(r);return"function"!=typeof t&&be(`unknown function pointer with signature ${e}: ${r}`),t},We=e=>{var r=yr(e),t=_e(r);return mr(r),t},Ne=(e,r,t)=>{switch(r){case 1:return t?e=>v[0|e]:e=>y[0|e];case 2:return t?e=>w[e>>1]:e=>g[e>>1];case 4:return t?e=>E[e>>2]:e=>_[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function Le(e){return this.fromWireType(_[e>>2])}var Be,Ue="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ie=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&g[n];)++n;if((t=n<<1)-e>32&&Ue)return Ue.decode(y.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=w[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},He=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);w[r>>1]=i,r+=2}return w[r>>1]=0,r-n},Ye=e=>2*e.length,qe=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=E[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ve=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),E[r>>2]=i,(r+=4)+4>o)break}return E[r>>2]=0,r-n},Xe=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Ge=(e,r)=>{var t=ye[e];return void 0===t&&be(r+" has unknown type "+We(e)),t},Je={},Ke=e=>{var r=Je[e];return void 0===r?_e(e):r},Ze=[],Qe=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var r="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof o.c&&e(o.c)?$$$embind_global$$$=o.c:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},er=e=>{var r=(e-h.buffer.byteLength+65535)/65536;try{return h.grow(r),S(),1}catch(e){}},rr={},tr=()=>{if(!tr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:l||"./this.program"};for(var r in rr)void 0===rr[r]?delete e[r]:e[r]=rr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);tr.strings=t}return tr.strings},nr=e=>e%4==0&&(e%100!=0||e%400==0),or=[31,29,31,30,31,30,31,31,30,31,30,31],ar=[31,28,31,30,31,30,31,31,30,31,30,31],ir=(e,r)=>{e<128?r.push(e):r.push(e%128|128,e>>7)},sr=[],ur=(e,r)=>{Ae.set(e,r),Re[e]=Ae.get(e)},lr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=se.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},dr=365,cr=146;Object.defineProperties(lr.prototype,{read:{get:function(){return(this.mode&dr)===dr},set:function(e){e?this.mode|=dr:this.mode&=~dr}},write:{get:function(){return(this.mode&cr)===cr},set:function(e){e?this.mode|=cr:this.mode&=~cr}},isFolder:{get:function(){return se.isDir(this.mode)}},isDevice:{get:function(){return se.isChrdev(this.mode)}}}),se.FSNode=lr,se.createPreloadedFile=(e,r,t,n,o,a,i,s,u,l)=>{var d=r?X.resolve(q.join2(e,r)):e;function c(t){function c(t){l&&l(),s||((e,r,t,n,o,a)=>{se.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,u),a&&a(),j()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return ae.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,c,(()=>{i&&i(),j()}))||c(t)}M(),"string"==typeof t?oe(t,(e=>c(e)),i):c(t)},se.staticInit(),a.FS_createPath=se.createPath,a.FS_createDataFile=se.createDataFile,a.FS_createPreloadedFile=se.createPreloadedFile,a.FS_unlink=se.unlink,a.FS_createLazyFile=se.createLazyFile,a.FS_createDevice=se.createDevice,he=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);me=e})(),pe=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(Fe.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),De.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),De.reserved=De.allocated.length,a.count_emval_handles=()=>{for(var e=0,r=De.reserved;r<De.allocated.length;++r)void 0!==De.allocated[r]&&++e;return e},Se=a.UnboundTypeError=((e,r)=>{var t=function(e,r){return e=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(e),{[e]:function(){return r.apply(this,arguments)}}[e]}(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t})(Error,"UnboundTypeError");var fr={i:(e,r,t)=>{throw new Y(e).init(r,t),e},x:function(e,r,t){le.varargs=t;try{var n=le.getStreamFromFD(e);switch(r){case 0:if((o=le.get())<0)return-28;for(;se.streams[o];)o++;return se.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=le.get();return n.flags|=o,0;case 5:return o=le.getp(),w[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return E[vr()>>2]=28,-1}}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return-e.errno}},N:function(e,r,t){le.varargs=t;try{var n=le.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=le.getp();E[a>>2]=o.c_iflag||0,E[a+4>>2]=o.c_oflag||0,E[a+8>>2]=o.c_cflag||0,E[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)v[a+i+17|0]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=le.getp();var s=E[a>>2],u=E[a+4>>2],l=E[a+8>>2],d=E[a+12>>2],c=[];for(i=0;i<32;i++)c.push(v[a+i+17|0]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:d,c_cc:c})}return 0;case 21519:return n.tty?(a=le.getp(),E[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=le.getp(),se.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=le.getp(),w[a>>1]=f[0],w[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return-e.errno}},O:function(e,r,t,n){le.varargs=n;try{r=le.getStr(r),r=le.calculateAt(e,r);var o=n?le.get():0;return se.open(r,t,o).fd}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return-e.errno}},V:e=>{var r=de[e];delete de[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));Ee([e],a,(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,u=r.getterContext,l=e[t+o.length],d=r.setter,c=r.setterContext;a[n]={read:e=>i.fromWireType(s(u,e)),write:(e,r)=>{var t=[];d(c,e,l.toWireType(t,r)),ce(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:fe,destructorFunction:n}]}))},G:(e,r,t,n,o)=>{},R:(e,r,t,n)=>{ke(e,{name:r=_e(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(y[e])},destructorFunction:null})},Q:(e,r)=>{ke(e,{name:r=_e(r),fromWireType:e=>{var r=Te(e);return Pe(e),r},toWireType:(e,r)=>$e(r),argPackAdvance:8,readValueFromPointer:fe,destructorFunction:null})},z:(e,r,t)=>{ke(e,{name:r=_e(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:Ce(r,t),destructorFunction:null})},r:(e,r,t,n,o,a,i)=>{var s=((e,r)=>{for(var t=[],n=0;n<e;n++)t.push(_[r+4*n>>2]);return t})(r,t);e=(e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?(A(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,r)):e})(e=_e(e)),o=ze(n,o),je(e,(function(){((e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||ye[r]||(we[r]?we[r].forEach(e):(t.push(r),n[r]=!0))})),new Se(`${e}: `+t.map(We).join([", "]))})(`Cannot call ${e} due to unbound types`,s)}),r-1),Ee([],s,(function(t){var n=[t[0],null].concat(t.slice(1));return xe(e,function(e,r,t,n,o){var a=r.length;a<2&&be("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==r[1]&&!1,s=!1,u=1;u<r.length;++u)if(null!==r[u]&&void 0===r[u].destructorFunction){s=!0;break}var l="void"!==r[0].name,d=a-2,c=new Array(d),f=[],h=[];return function(){var t;arguments.length!==d&&be(`function ${e} called with ${arguments.length} arguments, expected ${d}`),h.length=0,f.length=i?2:1,f[0]=o,i&&(t=r[1].toWireType(h,this),f[1]=t);for(var a=0;a<d;++a)c[a]=r[a+2].toWireType(h,arguments[a]),f.push(c[a]);return function(e){if(s)ce(h);else for(var n=i?1:2;n<r.length;n++){var o=1===n?t:c[n-2];null!==r[n].destructorFunction&&r[n].destructorFunction(o)}if(l)return r[0].fromWireType(e)}(n.apply(null,f))}}(e,n,0,o,a),r-1),[]}))},c:(e,r,t,n,o)=>{r=_e(r);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned");ke(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:Ne(r,t,0!==n),destructorFunction:null})},b:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=_[e>>2],t=_[e+4>>2];return new n(v.buffer,t,r)}ke(e,{name:t=_e(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},y:(e,r)=>{var t="std::string"===(r=_e(r));ke(e,{name:r,fromWireType(e){var r,n=_[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==y[s]){var u=ue(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var l=new Array(n);for(i=0;i<n;++i)l[i]=String.fromCharCode(y[o+i]);r=l.join("")}return mr(e),r},toWireType(e,r){var n;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var o="string"==typeof r;o||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||be("Cannot pass non-string to std::string"),n=t&&o?Z(r):r.length;var a=pr(4+n+1),i=a+4;if(_[a>>2]=n,t&&o)((e,r,t)=>{Q(e,y,r,t)})(r,i,n+1);else if(o)for(var s=0;s<n;++s){var u=r.charCodeAt(s);u>255&&(mr(i),be("String has UTF-16 code units that do not fit in 8 bits")),y[i+s]=u}else for(s=0;s<n;++s)y[i+s]=r[s];return null!==e&&e.push(mr,a),a},argPackAdvance:8,readValueFromPointer:Le,destructorFunction(e){mr(e)}})},p:(e,r,t)=>{var n,o,a,i,s;t=_e(t),2===r?(n=Ie,o=He,i=Ye,a=()=>g,s=1):4===r&&(n=qe,o=Ve,i=Xe,a=()=>_,s=2),ke(e,{name:t,fromWireType:e=>{for(var t,o=_[e>>2],i=a(),u=e+4,l=0;l<=o;++l){var d=e+4+l*r;if(l==o||0==i[d>>s]){var c=n(u,d-u);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),u=d+r}}return mr(e),t},toWireType:(e,n)=>{"string"!=typeof n&&be(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),u=pr(4+a+r);return _[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push(mr,u),u},argPackAdvance:8,readValueFromPointer:fe,destructorFunction(e){mr(e)}})},W:(e,r,t,n,o,a)=>{de[e]={name:_e(r),rawConstructor:ze(t,n),rawDestructor:ze(o,a),fields:[]}},k:(e,r,t,n,o,a,i,s,u,l)=>{de[e].fields.push({fieldName:_e(r),getterReturnType:t,getter:ze(n,o),getterContext:a,setterArgumentType:i,setter:ze(s,u),setterContext:l})},S:(e,r)=>{ke(e,{isVoid:!0,name:r=_e(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},U:e=>{do{var r=_[e>>2],t=_[(e+=4)>>2],n=_[(e+=4)>>2];e+=4;var o=ue(r);se.createPath("/",q.dirname(o),!0,!0),se.createDataFile(o,null,v.subarray(n,n+t),!0,!0,!0)}while(_[e>>2])},I:()=>{throw 1/0},Y:(e,r,t)=>{e=Te(e),r=Ge(r,"emval::as");var n=[],o=$e(n);return _[t>>2]=o,r.toWireType(n,e)},A:(e,r,t,n,o)=>{var a=[],i=(e=Ze[e])(r=Te(r),t=Ke(t),a,o);return a.length&&(_[n>>2]=$e(a)),i},a:Pe,Z:e=>0===e?$e(Qe()):(e=Ke(e),$e(Qe()[e])),B:(e,r)=>{var t=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=Ge(_[r+4*n>>2],"parameter "+n);return t})(e,r),n=t.shift();e--;var o=new Array(e);return(e=>{var r=Ze.length;return Ze.push(e),r})(((r,a,i,s)=>{for(var u=0,l=0;l<e;++l)o[l]=t[l].readValueFromPointer(s+u),u+=t[l].argPackAdvance;var d=r[a].apply(r,o);for(l=0;l<e;++l)t[l].deleteObject&&t[l].deleteObject(o[l]);return n.toWireType(i,d)}))},m:(e,r)=>(e=Te(e),r=Te(r),$e(e[r])),g:e=>{e>4&&(De.get(e).refcount+=1)},C:()=>$e([]),h:e=>$e(Ke(e)),s:e=>{var r=Te(e);ce(r),Pe(e)},X:(e,r,t)=>{e=Te(e),r=Te(r),t=Te(t),e[r]=t},l:(e,r)=>{var t=(e=Ge(e,"_emval_take_value")).readValueFromPointer(r);return $e(t)},q:()=>{x("")},P:(e,r,t)=>y.copyWithin(e,r,r+t),J:e=>{var r=y.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n=(e,r)=>e+(r-e%r)%r,o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,n(Math.max(e,a),65536));if(er(i))return!0}return!1},K:(e,r)=>{var t=0;return tr().forEach(((n,o)=>{var a=r+t;_[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)v[0|r++]=e.charCodeAt(t);v[0|r]=0})(n,a),t+=n.length+1})),0},L:(e,r)=>{var t=tr();_[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),_[r>>2]=n,0},T:(e,r)=>{(e=>{H||(a.onExit&&a.onExit(e),F=!0),d(e,new U(e))})(e)},v:function(e){try{var r=le.getStreamFromFD(e);return se.close(r),0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},M:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=_[r>>2],i=_[r+4>>2];r+=8;var s=se.read(e,v,a,i,undefined);if(s<0)return-1;if(n+=s,s<i)break}return n})(le.getStreamFromFD(e),r,t);return _[n>>2]=o,0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},F:function(e,r,t,n,o){var a=((e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN)(r,t);try{if(isNaN(a))return 61;var i=le.getStreamFromFD(e);return se.llseek(i,a,n),z=[i.position>>>0,(O=i.position,+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[o>>2]=z[0],E[o+4>>2]=z[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},w:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=_[r>>2],i=_[r+4>>2];r+=8;var s=se.write(e,v,a,i,undefined);if(s<0)return-1;n+=s}return n})(le.getStreamFromFD(e),r,t);return _[n>>2]=o,0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},n:function(e,r){var t=Er();try{return Oe(e)(r)}catch(e){if(_r(t),e!==e+0)throw e;gr(1,0)}},j:function(e,r,t){var n=Er();try{return Oe(e)(r,t)}catch(e){if(_r(n),e!==e+0)throw e;gr(1,0)}},o:function(e,r,t,n){var o=Er();try{return Oe(e)(r,t,n)}catch(e){if(_r(o),e!==e+0)throw e;gr(1,0)}},t:function(e,r,t,n,o){var a=Er();try{return Oe(e)(r,t,n,o)}catch(e){if(_r(a),e!==e+0)throw e;gr(1,0)}},E:function(e,r,t,n,o,a,i,s,u,l){var d=Er();try{return Oe(e)(r,t,n,o,a,i,s,u,l)}catch(e){if(_r(d),e!==e+0)throw e;gr(1,0)}},u:function(e){var r=Er();try{Oe(e)()}catch(e){if(_r(r),e!==e+0)throw e;gr(1,0)}},d:function(e,r){var t=Er();try{Oe(e)(r)}catch(e){if(_r(t),e!==e+0)throw e;gr(1,0)}},D:function(e,r,t,n){var o=Er();try{Oe(e)(r,t,n)}catch(e){if(_r(o),e!==e+0)throw e;gr(1,0)}},e:function(e,r,t){var n=Er();try{Oe(e)(r,t)}catch(e){if(_r(n),e!==e+0)throw e;gr(1,0)}},f:function(e,r,t,n){var o=Er();try{Oe(e)(r,t,n)}catch(e){if(_r(o),e!==e+0)throw e;gr(1,0)}},H:(e,r,t,n,o)=>((e,r,t,n)=>{var o=_[n+40>>2],a={tm_sec:E[n>>2],tm_min:E[n+4>>2],tm_hour:E[n+8>>2],tm_mday:E[n+12>>2],tm_mon:E[n+16>>2],tm_year:E[n+20>>2],tm_wday:E[n+24>>2],tm_yday:E[n+28>>2],tm_isdst:E[n+32>>2],tm_gmtoff:E[n+36>>2],tm_zone:o?ue(o):""},i=ue(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"];function c(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function f(e,r){return c(e,r,"0")}function h(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function m(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=nr(t.getFullYear()),o=t.getMonth(),a=(n?or:ar)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=m(t),a=m(n);return h(o,r)<=0?h(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var y={"%a":e=>l[e.tm_wday].substring(0,3),"%A":e=>l[e.tm_wday],"%b":e=>d[e.tm_mon].substring(0,3),"%B":e=>d[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>c(e.tm_mday,2," "),"%g":e=>p(e).toString().substring(2),"%G":e=>p(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),f(r,2)},"%j":e=>f(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(nr(e.tm_year+1900)?or:ar,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return f(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&nr(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&nr(e.tm_year%400-1))&&r++}return f(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in i=i.replace(/%%/g,"\0\0"),y)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),y[u](a)));var w=ee(i=i.replace(/\0\0/g,"%"),!1);return w.length>r?0:(((e,r)=>{v.set(e,r)})(w,e),w.length-1)})(e,r,t,n)},hr=function(){var e={a:fr};function r(e,r){return hr=e.exports,h=hr._,S(),Ae=hr.aa,function(e){P.unshift(e)}(hr.$),j(),hr}if(M(),a.instantiateWasm)try{return a.instantiateWasm(e,r)}catch(e){p(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return function(e,r,t,n){return e||"function"!=typeof WebAssembly.instantiateStreaming||N(r)||"function"!=typeof fetch?B(r,t,n):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(n,(function(e){return p(`wasm streaming compile failed: ${e}`),p("falling back to ArrayBuffer instantiation"),B(r,t,n)}))))}(f,R,e,(function(e){r(e.instance)})).catch(n),{}}(),mr=a._free=e=>(mr=a._free=hr.ba)(e),pr=a._malloc=e=>(pr=a._malloc=hr.ca)(e),vr=()=>(vr=hr.da)(),yr=e=>(yr=hr.ea)(e);a.__embind_initialize_bindings=()=>(a.__embind_initialize_bindings=hr.fa)();var wr,gr=(e,r)=>(gr=hr.ga)(e,r),Er=()=>(Er=hr.ha)(),_r=e=>(_r=hr.ia)(e),br=e=>(br=hr.ja)(e);function kr(){function e(){wr||(wr=!0,a.calledRun=!0,F||(a.noFSInit||se.init.initialized||se.init(),se.ignorePermissions=!1,I(P),t(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),T.unshift(e);var e;I(T)}()))}$>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),D.unshift(e);var e;I(D)}(),$>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),e()}),1)):e()))}if(a.dynCall_viji=(e,r,t,n,o)=>(a.dynCall_viji=hr.ka)(e,r,t,n,o),a.dynCall_ji=(e,r)=>(a.dynCall_ji=hr.la)(e,r),a.dynCall_jiji=(e,r,t,n,o)=>(a.dynCall_jiji=hr.ma)(e,r,t,n,o),a.dynCall_viijii=(e,r,t,n,o,i,s)=>(a.dynCall_viijii=hr.na)(e,r,t,n,o,i,s),a.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(a.dynCall_iiiiij=hr.oa)(e,r,t,n,o,i,s),a.dynCall_iiiiijj=(e,r,t,n,o,i,s,u,l)=>(a.dynCall_iiiiijj=hr.pa)(e,r,t,n,o,i,s,u,l),a.dynCall_iiiiiijj=(e,r,t,n,o,i,s,u,l,d)=>(a.dynCall_iiiiiijj=hr.qa)(e,r,t,n,o,i,s,u,l,d),a.___emscripten_embedded_file_data=1275400,a.addRunDependency=M,a.removeRunDependency=j,a.FS_createPath=se.createPath,a.FS_createLazyFile=se.createLazyFile,a.FS_createDevice=se.createDevice,a.addFunction=(e,r)=>{var t=(e=>(Be||(Be=new WeakMap,((e,r)=>{if(Be)for(var t=0;t<0+r;t++){var n=Oe(t);n&&Be.set(n,t)}})(0,Ae.length)),Be.get(e)||0))(e);if(t)return t;var n=(()=>{if(sr.length)return sr.pop();try{Ae.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Ae.length-1})();try{ur(n,e)}catch(t){if(!(t instanceof TypeError))throw t;var o=((e,r)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function((e=>{for(var r={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==e[0]?[]:[r[e[0]]]},n=1;n<e.length;++n)t.parameters.push(r[e[n]]);return t})(r),e);var t=[1];((e,r)=>{var t=e.slice(0,1),n=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};r.push(96),ir(n.length,r);for(var a=0;a<n.length;++a)r.push(o[n[a]]);"v"==t?r.push(0):r.push(1,o[t])})(r,t);var n=[0,97,115,109,1,0,0,0,1];ir(t.length,n),n.push.apply(n,t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(o,{e:{f:e}}).exports.f})(e,r);ur(n,o)}return Be.set(e,n),n},a.UTF8ToString=ue,a.FS_createPreloadedFile=se.createPreloadedFile,a.FS_createDataFile=se.createDataFile,a.FS_unlink=se.unlink,C=function e(){wr||kr(),wr||(C=e)},a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return kr(),e.ready},e.exports=t),a.exports;var e,r,t}()),s=Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"}))}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1053,2343],{11053:(e,r,t)=>{t.d(r,{c:()=>n,g:()=>o});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},2343:(e,r,t)=>{t.r(r),t.d(r,{l:()=>s});var n,o=t(11053),a={exports:{}};const i=(0,o.g)(function(){return n||(n=1,e=a,r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,t=function(e={}){var t,n,a=e;a.ready=new Promise(((e,r)=>{t=e,n=r}));var i,s,u=Object.assign({},a),l="./this.program",d=(e,r)=>{throw r},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},s=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)};var f,h,m=a.print||console.log.bind(console),p=a.printErr||console.error.bind(console);Object.assign(a,u),u=null,a.arguments&&a.arguments,a.thisProgram&&(l=a.thisProgram),a.quit&&(d=a.quit),a.wasmBinary&&(f=a.wasmBinary),"object"!=typeof WebAssembly&&x("no native wasm support detected");var v,y,w,g,E,_,b,k,F=!1;function A(e,r){e||x(r)}function S(){var e=h.buffer;a.HEAP8=v=new Int8Array(e),a.HEAP16=w=new Int16Array(e),a.HEAPU8=y=new Uint8Array(e),a.HEAPU16=g=new Uint16Array(e),a.HEAP32=E=new Int32Array(e),a.HEAPU32=_=new Uint32Array(e),a.HEAPF32=b=new Float32Array(e),a.HEAPF64=k=new Float64Array(e)}var D=[],P=[],T=[],$=0,C=null;function M(e){$++,a.monitorRunDependencies&&a.monitorRunDependencies($)}function j(e){if($--,a.monitorRunDependencies&&a.monitorRunDependencies($),0==$&&C){var r=C;C=null,r()}}function x(e){a.onAbort&&a.onAbort(e),p(e="Aborted("+e+")"),F=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var R,O,z,W,N=e=>e.startsWith("data:application/octet-stream;base64,");function L(e){if(e==R&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}function B(e,r,t){return function(e){return f||"function"!=typeof fetch?Promise.resolve().then((()=>L(e))):fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>L(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{p(`failed to asynchronously prepare wasm: ${e}`),x(e)}))}function U(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}N(R="lyr3DWorker.wasm")||(W=R,R=a.locateFile?a.locateFile(W,c):c+W);var I=e=>{for(;e.length>0;)e.shift()(a)},H=a.noExitRuntime||!0;function Y(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,v[this.ptr+12|0]=e},this.get_caught=function(){return 0!=v[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,v[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=v[this.ptr+13|0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){if(br(this.get_type()))return _[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=q.isAbs(e),t="/"===e.substr(-1);return(e=q.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=q.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return q.normalize(e.join("/"))},join2:(e,r)=>q.normalize(e+"/"+r)},V=e=>(V=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);x("initRandomDevice")})())(e),X={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:se.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=q.isAbs(n)}return(r?"/":"")+(e=q.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=X.resolve(e).substr(1),r=X.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},G="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,J=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&G)return G.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var u=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var l=i-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},K=[],Z=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},Q=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function ee(e,r,t){var n=Z(e)+1,o=new Array(n),a=Q(e,o,0,o.length);return r&&(o.length=a),o}var re={ttys:[],init(){},shutdown(){},register(e,r){re.ttys[e]={input:[],output:[],ops:r},se.registerDevice(e,re.stream_ops)},stream_ops:{open(e){var r=re.ttys[e.node.rdev];if(!r)throw new se.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new se.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new se.ErrnoError(29)}if(void 0===s&&0===a)throw new se.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new se.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new se.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!K.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;K=ee(e,!0)}return K.shift()})(),put_char(e,r){null===r||10===r?(m(J(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(m(J(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(p(J(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(p(J(e.output,0)),e.output=[])}}},te=e=>{x()},ne={ops_table:null,mount:e=>ne.createNode(null,"/",16895,0),createNode(e,r,t,n){if(se.isBlkdev(t)||se.isFIFO(t))throw new se.ErrnoError(63);ne.ops_table||(ne.ops_table={dir:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr,lookup:ne.node_ops.lookup,mknod:ne.node_ops.mknod,rename:ne.node_ops.rename,unlink:ne.node_ops.unlink,rmdir:ne.node_ops.rmdir,readdir:ne.node_ops.readdir,symlink:ne.node_ops.symlink},stream:{llseek:ne.stream_ops.llseek}},file:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr},stream:{llseek:ne.stream_ops.llseek,read:ne.stream_ops.read,write:ne.stream_ops.write,allocate:ne.stream_ops.allocate,mmap:ne.stream_ops.mmap,msync:ne.stream_ops.msync}},link:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr,readlink:ne.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ne.node_ops.getattr,setattr:ne.node_ops.setattr},stream:se.chrdev_stream_ops}});var o=se.createNode(e,r,t,n);return se.isDir(o.mode)?(o.node_ops=ne.ops_table.dir.node,o.stream_ops=ne.ops_table.dir.stream,o.contents={}):se.isFile(o.mode)?(o.node_ops=ne.ops_table.file.node,o.stream_ops=ne.ops_table.file.stream,o.usedBytes=0,o.contents=null):se.isLink(o.mode)?(o.node_ops=ne.ops_table.link.node,o.stream_ops=ne.ops_table.link.stream):se.isChrdev(o.mode)&&(o.node_ops=ne.ops_table.chrdev.node,o.stream_ops=ne.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=se.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,se.isDir(e.mode)?r.size=4096:se.isFile(e.mode)?r.size=e.usedBytes:se.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&ne.resizeFileStorage(e,r.size)},lookup(e,r){throw se.genericErrors[44]},mknod:(e,r,t,n)=>ne.createNode(e,r,t,n),rename(e,r,t){if(se.isDir(e.mode)){var n;try{n=se.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new se.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=se.lookupNode(e,r);for(var n in t.contents)throw new se.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=ne.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!se.isLink(e.mode))throw new se.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===v.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(ne.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&se.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new se.ErrnoError(28);return n},allocate(e,r,t){ne.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!se.isFile(e.node.mode))throw new se.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||s.buffer!==v.buffer){if((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),i=!0,!(a=te()))throw new se.ErrnoError(48);v.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(ne.stream_ops.write(e,r,0,n,t,!1),0)}},oe=(e,r,t,n)=>{var o=`al ${e}`;s(e,(t=>{A(t,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(t)),o&&j()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&M()},ae=a.preloadPlugins||[],ie=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},se={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=X.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new se.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=se.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=se.lookupNode(n,t[a]),o=q.join2(o,t[a]),se.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;se.isLink(n.mode);){var u=se.readlink(o);if(o=X.resolve(q.dirname(o),u),n=se.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new se.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(se.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%se.nameTable.length},hashAddNode(e){var r=se.hashName(e.parent.id,e.name);e.name_next=se.nameTable[r],se.nameTable[r]=e},hashRemoveNode(e){var r=se.hashName(e.parent.id,e.name);if(se.nameTable[r]===e)se.nameTable[r]=e.name_next;else for(var t=se.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=se.mayLookup(e);if(t)throw new se.ErrnoError(t,e);for(var n=se.hashName(e.id,r),o=se.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return se.lookup(e,r)},createNode(e,r,t,n){var o=new se.FSNode(e,r,t,n);return se.hashAddNode(o),o},destroyNode(e){se.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>se.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>se.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return se.lookupNode(e,r),20}catch(e){}return se.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=se.lookupNode(e,r)}catch(e){return e.errno}var o=se.nodePermissions(e,"wx");if(o)return o;if(t){if(!se.isDir(n.mode))return 54;if(se.isRoot(n)||se.getPath(n)===se.cwd())return 10}else if(se.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?se.isLink(e.mode)?32:se.isDir(e.mode)&&("r"!==se.flagsToPermissionString(r)||512&r)?31:se.nodePermissions(e,se.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=se.MAX_OPEN_FDS;e++)if(!se.streams[e])return e;throw new se.ErrnoError(33)},getStreamChecked(e){var r=se.getStream(e);if(!r)throw new se.ErrnoError(8);return r},getStream:e=>se.streams[e],createStream:(e,r=-1)=>(se.FSStream||(se.FSStream=function(){this.shared={}},se.FSStream.prototype={},Object.defineProperties(se.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new se.FSStream,e),-1==r&&(r=se.nextfd()),e.fd=r,se.streams[r]=e,e),closeStream(e){se.streams[e]=null},chrdev_stream_ops:{open(e){var r=se.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new se.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){se.devices[e]={stream_ops:r}},getDevice:e=>se.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),se.syncFSRequests++,se.syncFSRequests>1&&p(`warning: ${se.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=se.getMounts(se.root.mount),n=0;function o(e){return se.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&se.root)throw new se.ErrnoError(10);if(!o&&!a){var i=se.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,se.isMountpoint(n))throw new se.ErrnoError(10);if(!se.isDir(n.mode))throw new se.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?se.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=se.lookupPath(e,{follow_mount:!1});if(!se.isMountpoint(r.node))throw new se.ErrnoError(28);var t=r.node,n=t.mounted,o=se.getMounts(n);Object.keys(se.nameTable).forEach((e=>{for(var r=se.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&se.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=se.lookupPath(e,{parent:!0}).node,o=q.basename(e);if(!o||"."===o||".."===o)throw new se.ErrnoError(28);var a=se.mayCreate(n,o);if(a)throw new se.ErrnoError(a);if(!n.node_ops.mknod)throw new se.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,se.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,se.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{se.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,se.mknod(e,r,t)),symlink(e,r){if(!X.resolve(e))throw new se.ErrnoError(44);var t=se.lookupPath(r,{parent:!0}).node;if(!t)throw new se.ErrnoError(44);var n=q.basename(r),o=se.mayCreate(t,n);if(o)throw new se.ErrnoError(o);if(!t.node_ops.symlink)throw new se.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=q.dirname(e),a=q.dirname(r),i=q.basename(e),s=q.basename(r);if(t=se.lookupPath(e,{parent:!0}).node,n=se.lookupPath(r,{parent:!0}).node,!t||!n)throw new se.ErrnoError(44);if(t.mount!==n.mount)throw new se.ErrnoError(75);var u,l=se.lookupNode(t,i),d=X.relative(e,a);if("."!==d.charAt(0))throw new se.ErrnoError(28);if("."!==(d=X.relative(r,o)).charAt(0))throw new se.ErrnoError(55);try{u=se.lookupNode(n,s)}catch(e){}if(l!==u){var c=se.isDir(l.mode),f=se.mayDelete(t,i,c);if(f)throw new se.ErrnoError(f);if(f=u?se.mayDelete(n,s,c):se.mayCreate(n,s))throw new se.ErrnoError(f);if(!t.node_ops.rename)throw new se.ErrnoError(63);if(se.isMountpoint(l)||u&&se.isMountpoint(u))throw new se.ErrnoError(10);if(n!==t&&(f=se.nodePermissions(t,"w")))throw new se.ErrnoError(f);se.hashRemoveNode(l);try{t.node_ops.rename(l,n,s)}catch(e){throw e}finally{se.hashAddNode(l)}}},rmdir(e){var r=se.lookupPath(e,{parent:!0}).node,t=q.basename(e),n=se.lookupNode(r,t),o=se.mayDelete(r,t,!0);if(o)throw new se.ErrnoError(o);if(!r.node_ops.rmdir)throw new se.ErrnoError(63);if(se.isMountpoint(n))throw new se.ErrnoError(10);r.node_ops.rmdir(r,t),se.destroyNode(n)},readdir(e){var r=se.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new se.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=se.lookupPath(e,{parent:!0}).node;if(!r)throw new se.ErrnoError(44);var t=q.basename(e),n=se.lookupNode(r,t),o=se.mayDelete(r,t,!1);if(o)throw new se.ErrnoError(o);if(!r.node_ops.unlink)throw new se.ErrnoError(63);if(se.isMountpoint(n))throw new se.ErrnoError(10);r.node_ops.unlink(r,t),se.destroyNode(n)},readlink(e){var r=se.lookupPath(e).node;if(!r)throw new se.ErrnoError(44);if(!r.node_ops.readlink)throw new se.ErrnoError(28);return X.resolve(se.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=se.lookupPath(e,{follow:!r}).node;if(!t)throw new se.ErrnoError(44);if(!t.node_ops.getattr)throw new se.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>se.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?se.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new se.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){se.chmod(e,r,!0)},fchmod(e,r){var t=se.getStreamChecked(e);se.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?se.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new se.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){se.chown(e,r,t,!0)},fchown(e,r,t){var n=se.getStreamChecked(e);se.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new se.ErrnoError(28);var t;if(!(t="string"==typeof e?se.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new se.ErrnoError(63);if(se.isDir(t.mode))throw new se.ErrnoError(31);if(!se.isFile(t.mode))throw new se.ErrnoError(28);var n=se.nodePermissions(t,"w");if(n)throw new se.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=se.getStreamChecked(e);if(!(2097155&t.flags))throw new se.ErrnoError(28);se.truncate(t.node,r)},utime(e,r,t){var n=se.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new se.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=q.normalize(e);try{n=se.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new se.ErrnoError(20)}else n=se.mknod(e,t,0),o=!0;if(!n)throw new se.ErrnoError(44);if(se.isChrdev(n.mode)&&(r&=-513),65536&r&&!se.isDir(n.mode))throw new se.ErrnoError(54);if(!o){var i=se.mayOpen(n,r);if(i)throw new se.ErrnoError(i)}512&r&&!o&&se.truncate(n,0),r&=-131713;var s=se.createStream({node:n,path:se.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!a.logReadFiles||1&r||(se.readFiles||(se.readFiles={}),e in se.readFiles||(se.readFiles[e]=1)),s},close(e){if(se.isClosed(e))throw new se.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{se.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(se.isClosed(e))throw new se.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new se.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new se.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new se.ErrnoError(28);if(se.isClosed(e))throw new se.ErrnoError(8);if(1==(2097155&e.flags))throw new se.ErrnoError(8);if(se.isDir(e.node.mode))throw new se.ErrnoError(31);if(!e.stream_ops.read)throw new se.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new se.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new se.ErrnoError(28);if(se.isClosed(e))throw new se.ErrnoError(8);if(!(2097155&e.flags))throw new se.ErrnoError(8);if(se.isDir(e.node.mode))throw new se.ErrnoError(31);if(!e.stream_ops.write)throw new se.ErrnoError(28);e.seekable&&1024&e.flags&&se.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new se.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(se.isClosed(e))throw new se.ErrnoError(8);if(r<0||t<=0)throw new se.ErrnoError(28);if(!(2097155&e.flags))throw new se.ErrnoError(8);if(!se.isFile(e.node.mode)&&!se.isDir(e.node.mode))throw new se.ErrnoError(43);if(!e.stream_ops.allocate)throw new se.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new se.ErrnoError(2);if(1==(2097155&e.flags))throw new se.ErrnoError(2);if(!e.stream_ops.mmap)throw new se.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new se.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=se.open(e,r.flags),o=se.stat(e).size,a=new Uint8Array(o);return se.read(n,a,0,o,0),"utf8"===r.encoding?t=J(a,0):"binary"===r.encoding&&(t=a),se.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=se.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(Z(r)+1),a=Q(r,o,0,o.length);se.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");se.write(n,r,0,r.byteLength,void 0,t.canOwn)}se.close(n)},cwd:()=>se.currentPath,chdir(e){var r=se.lookupPath(e,{follow:!0});if(null===r.node)throw new se.ErrnoError(44);if(!se.isDir(r.node.mode))throw new se.ErrnoError(54);var t=se.nodePermissions(r.node,"x");if(t)throw new se.ErrnoError(t);se.currentPath=r.path},createDefaultDirectories(){se.mkdir("/tmp"),se.mkdir("/home"),se.mkdir("/home/web_user")},createDefaultDevices(){se.mkdir("/dev"),se.registerDevice(se.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),se.mkdev("/dev/null",se.makedev(1,3)),re.register(se.makedev(5,0),re.default_tty_ops),re.register(se.makedev(6,0),re.default_tty1_ops),se.mkdev("/dev/tty",se.makedev(5,0)),se.mkdev("/dev/tty1",se.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=V(e).byteLength),e[--r]);se.createDevice("/dev","random",t),se.createDevice("/dev","urandom",t),se.mkdir("/dev/shm"),se.mkdir("/dev/shm/tmp")},createSpecialDirectories(){se.mkdir("/proc");var e=se.mkdir("/proc/self");se.mkdir("/proc/self/fd"),se.mount({mount(){var r=se.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=se.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){a.stdin?se.createDevice("/dev","stdin",a.stdin):se.symlink("/dev/tty","/dev/stdin"),a.stdout?se.createDevice("/dev","stdout",null,a.stdout):se.symlink("/dev/tty","/dev/stdout"),a.stderr?se.createDevice("/dev","stderr",null,a.stderr):se.symlink("/dev/tty1","/dev/stderr"),se.open("/dev/stdin",0),se.open("/dev/stdout",1),se.open("/dev/stderr",1)},ensureErrnoError(){se.ErrnoError||(se.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},se.ErrnoError.prototype=new Error,se.ErrnoError.prototype.constructor=se.ErrnoError,[44].forEach((e=>{se.genericErrors[e]=new se.ErrnoError(e),se.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){se.ensureErrnoError(),se.nameTable=new Array(4096),se.mount(ne,{},"/"),se.createDefaultDirectories(),se.createDefaultDevices(),se.createSpecialDirectories(),se.filesystems={MEMFS:ne}},init(e,r,t){se.init.initialized=!0,se.ensureErrnoError(),a.stdin=e||a.stdin,a.stdout=r||a.stdout,a.stderr=t||a.stderr,se.createStandardStreams()},quit(){se.init.initialized=!1;for(var e=0;e<se.streams.length;e++){var r=se.streams[e];r&&se.close(r)}},findObject(e,r){var t=se.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=se.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=se.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=q.basename(e),n=se.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:se.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=q.join2(e,a);try{se.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=q.join2("string"==typeof e?e:se.getPath(e),r),i=ie(n,o);return se.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:se.getPath(e),i=r?q.join2(e,r):e);var s=ie(n,o),u=se.create(i,s);if(t){if("string"==typeof t){for(var l=new Array(t.length),d=0,c=t.length;d<c;++d)l[d]=t.charCodeAt(d);t=l}se.chmod(u,146|s);var f=se.open(u,577);se.write(f,t,0,t.length,0,a),se.close(f),se.chmod(u,s)}return u},createDevice(e,r,t,n){var o=q.join2("string"==typeof e?e:se.getPath(e),r),a=ie(!!t,!!n);se.createDevice.major||(se.createDevice.major=64);var i=se.makedev(se.createDevice.major++,0);return se.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new se.ErrnoError(29)}if(void 0===u&&0===i)throw new se.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new se.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),se.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!i)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ee(i(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new se.ErrnoError(29)}},createLazyFile(e,r,t,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=(e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ee(o.responseText||"",!0)},u=this;u.setDataGetter((e=>{var r=e*i,t=(e+1)*i-1;if(t=Math.min(t,n-1),void 0===u.chunks[e]&&(u.chunks[e]=s(r,t)),void 0===u.chunks[e])throw new Error("doXHR failed!");return u.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:t},s=se.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach((e=>{var r=s.stream_ops[e];u[e]=function(){return se.forceLoadFile(s),r.apply(null,arguments)}})),u.read=(e,r,t,n,o)=>(se.forceLoadFile(s),l(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{se.forceLoadFile(s);var a=te();if(!a)throw new se.ErrnoError(48);return l(e,v,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=u,s}},ue=(e,r)=>e?J(y,e,r):"",le={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(q.isAbs(r))return r;var n;if(n=-100===e?se.cwd():le.getStreamFromFD(e).path,0==r.length){if(!t)throw new se.ErrnoError(44);return n}return q.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&q.normalize(r)!==q.normalize(se.getPath(e.node)))return-54;throw e}E[t>>2]=n.dev,E[t+4>>2]=n.mode,_[t+8>>2]=n.nlink,E[t+12>>2]=n.uid,E[t+16>>2]=n.gid,E[t+20>>2]=n.rdev,z=[n.size>>>0,(O=n.size,+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+24>>2]=z[0],E[t+28>>2]=z[1],E[t+32>>2]=4096,E[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return z=[Math.floor(o/1e3)>>>0,(O=Math.floor(o/1e3),+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+40>>2]=z[0],E[t+44>>2]=z[1],_[t+48>>2]=o%1e3*1e3,z=[Math.floor(a/1e3)>>>0,(O=Math.floor(a/1e3),+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+56>>2]=z[0],E[t+60>>2]=z[1],_[t+64>>2]=a%1e3*1e3,z=[Math.floor(i/1e3)>>>0,(O=Math.floor(i/1e3),+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+72>>2]=z[0],E[t+76>>2]=z[1],_[t+80>>2]=i%1e3*1e3,z=[n.ino>>>0,(O=n.ino,+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[t+88>>2]=z[0],E[t+92>>2]=z[1],0},doMsync(e,r,t,n,o){if(!se.isFile(r.node.mode))throw new se.ErrnoError(43);if(2&n)return 0;var a=y.slice(e,e+t);se.msync(r,a,o,t,n)},varargs:void 0,get(){var e=E[+le.varargs>>2];return le.varargs+=4,e},getp:()=>le.get(),getStr:e=>ue(e),getStreamFromFD:e=>se.getStreamChecked(e)},de={},ce=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function fe(e){return this.fromWireType(E[e>>2])}var he,me,pe,ve={},ye={},we={},ge=e=>{throw new he(e)},Ee=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&ge("Mismatched type converter count");for(var o=0;o<e.length;++o)ke(e[o],n[o])}e.forEach((function(e){we[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{ye.hasOwnProperty(e)?o[r]=ye[e]:(a.push(e),ve.hasOwnProperty(e)||(ve[e]=[]),ve[e].push((()=>{o[r]=ye[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},_e=e=>{for(var r="",t=e;y[t];)r+=me[y[t++]];return r},be=e=>{throw new pe(e)};function ke(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||be(`type "${n}" must have a positive integer typeid pointer`),ye.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;be(`Cannot register type '${n}' twice`)}if(ye[e]=r,delete we[e],ve.hasOwnProperty(e)){var o=ve[e];delete ve[e],o.forEach((e=>e()))}}(e,r,t)}function Fe(){this.allocated=[void 0],this.freelist=[]}var Ae,Se,De=new Fe,Pe=e=>{e>=De.reserved&&0==--De.get(e).refcount&&De.free(e)},Te=e=>(e||be("Cannot use deleted val. handle = "+e),De.get(e).value),$e=e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return De.allocate({refcount:1,value:e})}},Ce=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(b[e>>2])};case 8:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Me=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||be(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},je=(e,r,t)=>{a.hasOwnProperty(e)?((void 0===t||void 0!==a[e].overloadTable&&void 0!==a[e].overloadTable[t])&&be(`Cannot register public name '${e}' twice`),Me(a,e,e),a.hasOwnProperty(t)&&be(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),a[e].overloadTable[t]=r):(a[e]=r,void 0!==t&&(a[e].numArguments=t))},xe=(e,r,t)=>{a.hasOwnProperty(e)||ge("Replacing nonexistant public symbol"),void 0!==a[e].overloadTable&&void 0!==t?a[e].overloadTable[t]=r:(a[e]=r,a[e].argCount=t)},Re=[],Oe=e=>{var r=Re[e];return r||(e>=Re.length&&(Re.length=e+1),Re[e]=r=Ae.get(e)),r},ze=(e,r)=>{var t=(e=_e(e)).includes("j")?((e,r)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),((e,r,t)=>e.includes("j")?((e,r,t)=>{var n=a["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)})(e,r,t):Oe(r).apply(null,t))(e,r,t)}})(e,r):Oe(r);return"function"!=typeof t&&be(`unknown function pointer with signature ${e}: ${r}`),t},We=e=>{var r=yr(e),t=_e(r);return mr(r),t},Ne=(e,r,t)=>{switch(r){case 1:return t?e=>v[0|e]:e=>y[0|e];case 2:return t?e=>w[e>>1]:e=>g[e>>1];case 4:return t?e=>E[e>>2]:e=>_[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function Le(e){return this.fromWireType(_[e>>2])}var Be,Ue="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Ie=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&g[n];)++n;if((t=n<<1)-e>32&&Ue)return Ue.decode(y.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=w[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},He=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);w[r>>1]=i,r+=2}return w[r>>1]=0,r-n},Ye=e=>2*e.length,qe=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=E[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ve=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),E[r>>2]=i,(r+=4)+4>o)break}return E[r>>2]=0,r-n},Xe=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Ge=(e,r)=>{var t=ye[e];return void 0===t&&be(r+" has unknown type "+We(e)),t},Je={},Ke=e=>{var r=Je[e];return void 0===r?_e(e):r},Ze=[],Qe=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var r="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof o.c&&e(o.c)?$$$embind_global$$$=o.c:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},er=e=>{var r=(e-h.buffer.byteLength+65535)/65536;try{return h.grow(r),S(),1}catch(e){}},rr={},tr=()=>{if(!tr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:l||"./this.program"};for(var r in rr)void 0===rr[r]?delete e[r]:e[r]=rr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);tr.strings=t}return tr.strings},nr=e=>e%4==0&&(e%100!=0||e%400==0),or=[31,29,31,30,31,30,31,31,30,31,30,31],ar=[31,28,31,30,31,30,31,31,30,31,30,31],ir=(e,r)=>{e<128?r.push(e):r.push(e%128|128,e>>7)},sr=[],ur=(e,r)=>{Ae.set(e,r),Re[e]=Ae.get(e)},lr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=se.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},dr=365,cr=146;Object.defineProperties(lr.prototype,{read:{get:function(){return(this.mode&dr)===dr},set:function(e){e?this.mode|=dr:this.mode&=~dr}},write:{get:function(){return(this.mode&cr)===cr},set:function(e){e?this.mode|=cr:this.mode&=~cr}},isFolder:{get:function(){return se.isDir(this.mode)}},isDevice:{get:function(){return se.isChrdev(this.mode)}}}),se.FSNode=lr,se.createPreloadedFile=(e,r,t,n,o,a,i,s,u,l)=>{var d=r?X.resolve(q.join2(e,r)):e;function c(t){function c(t){l&&l(),s||((e,r,t,n,o,a)=>{se.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,u),a&&a(),j()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return ae.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,c,(()=>{i&&i(),j()}))||c(t)}M(),"string"==typeof t?oe(t,(e=>c(e)),i):c(t)},se.staticInit(),a.FS_createPath=se.createPath,a.FS_createDataFile=se.createDataFile,a.FS_createPreloadedFile=se.createPreloadedFile,a.FS_unlink=se.unlink,a.FS_createLazyFile=se.createLazyFile,a.FS_createDevice=se.createDevice,he=a.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);me=e})(),pe=a.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(Fe.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),De.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),De.reserved=De.allocated.length,a.count_emval_handles=()=>{for(var e=0,r=De.reserved;r<De.allocated.length;++r)void 0!==De.allocated[r]&&++e;return e},Se=a.UnboundTypeError=((e,r)=>{var t=function(e,r){return e=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(e),{[e]:function(){return r.apply(this,arguments)}}[e]}(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t})(Error,"UnboundTypeError");var fr={i:(e,r,t)=>{throw new Y(e).init(r,t),e},x:function(e,r,t){le.varargs=t;try{var n=le.getStreamFromFD(e);switch(r){case 0:if((o=le.get())<0)return-28;for(;se.streams[o];)o++;return se.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=le.get();return n.flags|=o,0;case 5:return o=le.getp(),w[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return E[vr()>>2]=28,-1}}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return-e.errno}},N:function(e,r,t){le.varargs=t;try{var n=le.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=le.getp();E[a>>2]=o.c_iflag||0,E[a+4>>2]=o.c_oflag||0,E[a+8>>2]=o.c_cflag||0,E[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)v[a+i+17|0]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=le.getp();var s=E[a>>2],u=E[a+4>>2],l=E[a+8>>2],d=E[a+12>>2],c=[];for(i=0;i<32;i++)c.push(v[a+i+17|0]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:l,c_lflag:d,c_cc:c})}return 0;case 21519:return n.tty?(a=le.getp(),E[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=le.getp(),se.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=le.getp(),w[a>>1]=f[0],w[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return-e.errno}},O:function(e,r,t,n){le.varargs=n;try{r=le.getStr(r),r=le.calculateAt(e,r);var o=n?le.get():0;return se.open(r,t,o).fd}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return-e.errno}},V:e=>{var r=de[e];delete de[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));Ee([e],a,(e=>{var a={};return o.forEach(((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,u=r.getterContext,l=e[t+o.length],d=r.setter,c=r.setterContext;a[n]={read:e=>i.fromWireType(s(u,e)),write:(e,r)=>{var t=[];d(c,e,l.toWireType(t,r)),ce(t)}}})),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:8,readValueFromPointer:fe,destructorFunction:n}]}))},G:(e,r,t,n,o)=>{},R:(e,r,t,n)=>{ke(e,{name:r=_e(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(y[e])},destructorFunction:null})},Q:(e,r)=>{ke(e,{name:r=_e(r),fromWireType:e=>{var r=Te(e);return Pe(e),r},toWireType:(e,r)=>$e(r),argPackAdvance:8,readValueFromPointer:fe,destructorFunction:null})},z:(e,r,t)=>{ke(e,{name:r=_e(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:Ce(r,t),destructorFunction:null})},r:(e,r,t,n,o,a,i)=>{var s=((e,r)=>{for(var t=[],n=0;n<e;n++)t.push(_[r+4*n>>2]);return t})(r,t);e=(e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?(A(")"==e[e.length-1],"Parentheses for argument names should match."),e.substr(0,r)):e})(e=_e(e)),o=ze(n,o),je(e,(function(){((e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||ye[r]||(we[r]?we[r].forEach(e):(t.push(r),n[r]=!0))})),new Se(`${e}: `+t.map(We).join([", "]))})(`Cannot call ${e} due to unbound types`,s)}),r-1),Ee([],s,(function(t){var n=[t[0],null].concat(t.slice(1));return xe(e,function(e,r,t,n,o){var a=r.length;a<2&&be("argTypes array size mismatch! Must at least get return value and 'this' types!"),r[1];for(var i=!1,s=1;s<r.length;++s)if(null!==r[s]&&void 0===r[s].destructorFunction){i=!0;break}var u="void"!==r[0].name,l=a-2,d=new Array(l),c=[],f=[];return function(){arguments.length!==l&&be(`function ${e} called with ${arguments.length} arguments, expected ${l}`),f.length=0,c.length=1,c[0]=o;for(var t=0;t<l;++t)d[t]=r[t+2].toWireType(f,arguments[t]),c.push(d[t]);return function(e){if(i)ce(f);else for(var t=2;t<r.length;t++){var n=1===t?void 0:d[t-2];null!==r[t].destructorFunction&&r[t].destructorFunction(n)}if(u)return r[0].fromWireType(e)}(n.apply(null,c))}}(e,n,0,o,a),r-1),[]}))},c:(e,r,t,n,o)=>{r=_e(r);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned");ke(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:Ne(r,t,0!==n),destructorFunction:null})},b:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=_[e>>2],t=_[e+4>>2];return new n(v.buffer,t,r)}ke(e,{name:t=_e(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},y:(e,r)=>{var t="std::string"===(r=_e(r));ke(e,{name:r,fromWireType(e){var r,n=_[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==y[s]){var u=ue(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var l=new Array(n);for(i=0;i<n;++i)l[i]=String.fromCharCode(y[o+i]);r=l.join("")}return mr(e),r},toWireType(e,r){var n;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var o="string"==typeof r;o||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||be("Cannot pass non-string to std::string"),n=t&&o?Z(r):r.length;var a=pr(4+n+1),i=a+4;if(_[a>>2]=n,t&&o)((e,r,t)=>{Q(e,y,r,t)})(r,i,n+1);else if(o)for(var s=0;s<n;++s){var u=r.charCodeAt(s);u>255&&(mr(i),be("String has UTF-16 code units that do not fit in 8 bits")),y[i+s]=u}else for(s=0;s<n;++s)y[i+s]=r[s];return null!==e&&e.push(mr,a),a},argPackAdvance:8,readValueFromPointer:Le,destructorFunction(e){mr(e)}})},p:(e,r,t)=>{var n,o,a,i,s;t=_e(t),2===r?(n=Ie,o=He,i=Ye,a=()=>g,s=1):4===r&&(n=qe,o=Ve,i=Xe,a=()=>_,s=2),ke(e,{name:t,fromWireType:e=>{for(var t,o=_[e>>2],i=a(),u=e+4,l=0;l<=o;++l){var d=e+4+l*r;if(l==o||0==i[d>>s]){var c=n(u,d-u);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),u=d+r}}return mr(e),t},toWireType:(e,n)=>{"string"!=typeof n&&be(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),u=pr(4+a+r);return _[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push(mr,u),u},argPackAdvance:8,readValueFromPointer:fe,destructorFunction(e){mr(e)}})},W:(e,r,t,n,o,a)=>{de[e]={name:_e(r),rawConstructor:ze(t,n),rawDestructor:ze(o,a),fields:[]}},k:(e,r,t,n,o,a,i,s,u,l)=>{de[e].fields.push({fieldName:_e(r),getterReturnType:t,getter:ze(n,o),getterContext:a,setterArgumentType:i,setter:ze(s,u),setterContext:l})},S:(e,r)=>{ke(e,{isVoid:!0,name:r=_e(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},U:e=>{do{var r=_[e>>2],t=_[(e+=4)>>2],n=_[(e+=4)>>2];e+=4;var o=ue(r);se.createPath("/",q.dirname(o),!0,!0),se.createDataFile(o,null,v.subarray(n,n+t),!0,!0,!0)}while(_[e>>2])},I:()=>{throw 1/0},Y:(e,r,t)=>{e=Te(e),r=Ge(r,"emval::as");var n=[],o=$e(n);return _[t>>2]=o,r.toWireType(n,e)},A:(e,r,t,n,o)=>{var a=[],i=(e=Ze[e])(r=Te(r),t=Ke(t),a,o);return a.length&&(_[n>>2]=$e(a)),i},a:Pe,Z:e=>0===e?$e(Qe()):(e=Ke(e),$e(Qe()[e])),B:(e,r)=>{var t=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=Ge(_[r+4*n>>2],"parameter "+n);return t})(e,r),n=t.shift();e--;var o=new Array(e);return(e=>{var r=Ze.length;return Ze.push(e),r})(((r,a,i,s)=>{for(var u=0,l=0;l<e;++l)o[l]=t[l].readValueFromPointer(s+u),u+=t[l].argPackAdvance;var d=r[a].apply(r,o);for(l=0;l<e;++l)t[l].deleteObject&&t[l].deleteObject(o[l]);return n.toWireType(i,d)}))},m:(e,r)=>(e=Te(e),r=Te(r),$e(e[r])),g:e=>{e>4&&(De.get(e).refcount+=1)},C:()=>$e([]),h:e=>$e(Ke(e)),s:e=>{var r=Te(e);ce(r),Pe(e)},X:(e,r,t)=>{e=Te(e),r=Te(r),t=Te(t),e[r]=t},l:(e,r)=>{var t=(e=Ge(e,"_emval_take_value")).readValueFromPointer(r);return $e(t)},q:()=>{x("")},P:(e,r,t)=>y.copyWithin(e,r,r+t),J:e=>{var r=y.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n=(e,r)=>e+(r-e%r)%r,o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,n(Math.max(e,a),65536));if(er(i))return!0}return!1},K:(e,r)=>{var t=0;return tr().forEach(((n,o)=>{var a=r+t;_[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)v[0|r++]=e.charCodeAt(t);v[0|r]=0})(n,a),t+=n.length+1})),0},L:(e,r)=>{var t=tr();_[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),_[r>>2]=n,0},T:(e,r)=>{(e=>{H||(a.onExit&&a.onExit(e),F=!0),d(e,new U(e))})(e)},v:function(e){try{var r=le.getStreamFromFD(e);return se.close(r),0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},M:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=_[r>>2],i=_[r+4>>2];r+=8;var s=se.read(e,v,a,i,undefined);if(s<0)return-1;if(n+=s,s<i)break}return n})(le.getStreamFromFD(e),r,t);return _[n>>2]=o,0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},F:function(e,r,t,n,o){var a=((e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN)(r,t);try{if(isNaN(a))return 61;var i=le.getStreamFromFD(e);return se.llseek(i,a,n),z=[i.position>>>0,(O=i.position,+Math.abs(O)>=1?O>0?+Math.floor(O/4294967296)>>>0:~~+Math.ceil((O-+(~~O>>>0))/4294967296)>>>0:0)],E[o>>2]=z[0],E[o+4>>2]=z[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},w:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=_[r>>2],i=_[r+4>>2];r+=8;var s=se.write(e,v,a,i,undefined);if(s<0)return-1;n+=s}return n})(le.getStreamFromFD(e),r,t);return _[n>>2]=o,0}catch(e){if(void 0===se||"ErrnoError"!==e.name)throw e;return e.errno}},n:function(e,r){var t=Er();try{return Oe(e)(r)}catch(e){if(_r(t),e!==e+0)throw e;gr(1,0)}},j:function(e,r,t){var n=Er();try{return Oe(e)(r,t)}catch(e){if(_r(n),e!==e+0)throw e;gr(1,0)}},o:function(e,r,t,n){var o=Er();try{return Oe(e)(r,t,n)}catch(e){if(_r(o),e!==e+0)throw e;gr(1,0)}},t:function(e,r,t,n,o){var a=Er();try{return Oe(e)(r,t,n,o)}catch(e){if(_r(a),e!==e+0)throw e;gr(1,0)}},E:function(e,r,t,n,o,a,i,s,u,l){var d=Er();try{return Oe(e)(r,t,n,o,a,i,s,u,l)}catch(e){if(_r(d),e!==e+0)throw e;gr(1,0)}},u:function(e){var r=Er();try{Oe(e)()}catch(e){if(_r(r),e!==e+0)throw e;gr(1,0)}},d:function(e,r){var t=Er();try{Oe(e)(r)}catch(e){if(_r(t),e!==e+0)throw e;gr(1,0)}},D:function(e,r,t,n){var o=Er();try{Oe(e)(r,t,n)}catch(e){if(_r(o),e!==e+0)throw e;gr(1,0)}},e:function(e,r,t){var n=Er();try{Oe(e)(r,t)}catch(e){if(_r(n),e!==e+0)throw e;gr(1,0)}},f:function(e,r,t,n){var o=Er();try{Oe(e)(r,t,n)}catch(e){if(_r(o),e!==e+0)throw e;gr(1,0)}},H:(e,r,t,n,o)=>((e,r,t,n)=>{var o=_[n+40>>2],a={tm_sec:E[n>>2],tm_min:E[n+4>>2],tm_hour:E[n+8>>2],tm_mday:E[n+12>>2],tm_mon:E[n+16>>2],tm_year:E[n+20>>2],tm_wday:E[n+24>>2],tm_yday:E[n+28>>2],tm_isdst:E[n+32>>2],tm_gmtoff:E[n+36>>2],tm_zone:o?ue(o):""},i=ue(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"];function c(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length<r;)n=t[0]+n;return n}function f(e,r){return c(e,r,"0")}function h(e,r){function t(e){return e<0?-1:e>0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function m(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=nr(t.getFullYear()),o=t.getMonth(),a=(n?or:ar)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=m(t),a=m(n);return h(o,r)<=0?h(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var y={"%a":e=>l[e.tm_wday].substring(0,3),"%A":e=>l[e.tm_wday],"%b":e=>d[e.tm_mon].substring(0,3),"%B":e=>d[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>c(e.tm_mday,2," "),"%g":e=>p(e).toString().substring(2),"%G":e=>p(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),f(r,2)},"%j":e=>f(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(nr(e.tm_year+1900)?or:ar,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return f(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&nr(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&nr(e.tm_year%400-1))&&r++}return f(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in i=i.replace(/%%/g,"\0\0"),y)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),y[u](a)));var w=ee(i=i.replace(/\0\0/g,"%"),!1);return w.length>r?0:(((e,r)=>{v.set(e,r)})(w,e),w.length-1)})(e,r,t,n)},hr=function(){var e={a:fr};function r(e,r){return hr=e.exports,h=hr._,S(),Ae=hr.aa,function(e){P.unshift(e)}(hr.$),j(),hr}if(M(),a.instantiateWasm)try{return a.instantiateWasm(e,r)}catch(e){p(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return function(e,r,t,n){return e||"function"!=typeof WebAssembly.instantiateStreaming||N(r)||"function"!=typeof fetch?B(r,t,n):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(n,(function(e){return p(`wasm streaming compile failed: ${e}`),p("falling back to ArrayBuffer instantiation"),B(r,t,n)}))))}(f,R,e,(function(e){r(e.instance)})).catch(n),{}}(),mr=a._free=e=>(mr=a._free=hr.ba)(e),pr=a._malloc=e=>(pr=a._malloc=hr.ca)(e),vr=()=>(vr=hr.da)(),yr=e=>(yr=hr.ea)(e);a.__embind_initialize_bindings=()=>(a.__embind_initialize_bindings=hr.fa)();var wr,gr=(e,r)=>(gr=hr.ga)(e,r),Er=()=>(Er=hr.ha)(),_r=e=>(_r=hr.ia)(e),br=e=>(br=hr.ja)(e);function kr(){function e(){wr||(wr=!0,a.calledRun=!0,F||(a.noFSInit||se.init.initialized||se.init(),se.ignorePermissions=!1,I(P),t(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),T.unshift(e);var e;I(T)}()))}$>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),D.unshift(e);var e;I(D)}(),$>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),e()}),1)):e()))}if(a.dynCall_viji=(e,r,t,n,o)=>(a.dynCall_viji=hr.ka)(e,r,t,n,o),a.dynCall_ji=(e,r)=>(a.dynCall_ji=hr.la)(e,r),a.dynCall_jiji=(e,r,t,n,o)=>(a.dynCall_jiji=hr.ma)(e,r,t,n,o),a.dynCall_viijii=(e,r,t,n,o,i,s)=>(a.dynCall_viijii=hr.na)(e,r,t,n,o,i,s),a.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(a.dynCall_iiiiij=hr.oa)(e,r,t,n,o,i,s),a.dynCall_iiiiijj=(e,r,t,n,o,i,s,u,l)=>(a.dynCall_iiiiijj=hr.pa)(e,r,t,n,o,i,s,u,l),a.dynCall_iiiiiijj=(e,r,t,n,o,i,s,u,l,d)=>(a.dynCall_iiiiiijj=hr.qa)(e,r,t,n,o,i,s,u,l,d),a.___emscripten_embedded_file_data=1275400,a.addRunDependency=M,a.removeRunDependency=j,a.FS_createPath=se.createPath,a.FS_createLazyFile=se.createLazyFile,a.FS_createDevice=se.createDevice,a.addFunction=(e,r)=>{var t=(e=>(Be||(Be=new WeakMap,((e,r)=>{if(Be)for(var t=0;t<0+r;t++){var n=Oe(t);n&&Be.set(n,t)}})(0,Ae.length)),Be.get(e)||0))(e);if(t)return t;var n=(()=>{if(sr.length)return sr.pop();try{Ae.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Ae.length-1})();try{ur(n,e)}catch(t){if(!(t instanceof TypeError))throw t;var o=((e,r)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function((e=>{for(var r={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==e[0]?[]:[r[e[0]]]},n=1;n<e.length;++n)t.parameters.push(r[e[n]]);return t})(r),e);var t=[1];((e,r)=>{var t=e.slice(0,1),n=e.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};r.push(96),ir(n.length,r);for(var a=0;a<n.length;++a)r.push(o[n[a]]);"v"==t?r.push(0):r.push(1,o[t])})(r,t);var n=[0,97,115,109,1,0,0,0,1];ir(t.length,n),n.push.apply(n,t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(o,{e:{f:e}}).exports.f})(e,r);ur(n,o)}return Be.set(e,n),n},a.UTF8ToString=ue,a.FS_createPreloadedFile=se.createPreloadedFile,a.FS_createDataFile=se.createDataFile,a.FS_unlink=se.unlink,C=function e(){wr||kr(),wr||(C=e)},a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return kr(),e.ready},e.exports=t),a.exports;var e,r,t}()),s=Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1346],{61346:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>P});var i=n(66131),a=n(47609),r=n(66395),s=n(85935),l=n(93833),o=n(40334),f=n(93818),d=n(78878),u=n(80672),c=n(68423),m=n(35704),y=n(86691),p=n(54461),w=n(85978),h=n(30235),I=n(87594),g=n(33325),F=n(80609),D=n(334),T=n(74887),A=n(88368),$=n(13600),E=n(20437),x=n(20655),b=n(54218);function N(e,t,n){const i=e.getVariables();if(i.length>0){const a={};for(const e of i)a[e]=t.evaluateIdentifier(n,{name:e});e.parameters=a}return e}function S(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function L(e){if(null===e)return null;const t={type:S(e,"type",""),name:S(e,"name","")};if("range"===t.type)t.range=S(e,"range",[]);else{t.codedValues=[];for(const n of S(e,"codedValues",[]))t.codedValues.push({name:S(n,"name",""),code:S(n,"code",null)})}return t}function C(e){if(null===e)return null;const t={},n=S(e,"wkt");null!==n&&(t.wkt=n);const i=S(e,"wkid");return null!==i&&(t.wkid=i),t}function Z(e){if(null===e)return null;const t={hasZ:S(e,"hasz",!1),hasM:S(e,"hasm",!1)},n=S(e,"spatialreference");null!=n&&(t.spatialReference=C(n));const i=S(e,"x",null);if(null!==i)return t.x=i,t.y=S(e,"y",null),t.hasZ&&(t.z=S(e,"z",null)),t.hasM&&(t.m=S(e,"m",null)),t;const a=S(e,"rings",null);if(null!==a)return t.rings=a,t;const r=S(e,"paths",null);if(null!==r)return t.paths=r,t;const s=S(e,"points",null);if(null!==s)return t.points=s,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const i=S(e,n,null);null!==i&&(t[n]=i)}return t}function v(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function P(e){"async"===e.mode&&(e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,(async(e,a,l)=>{if((0,d.B)(l,1,2,t,n),(0,d.k)(l[0]))return"Unknown";if((0,d.j)(l[0]))return"Unknown";if((0,d.p)(l[0])){if(await l[0].load(),1===l.length||null===l[1])return l[0].datesInUnknownTimezone?v("unknown"):v(l[0].dateFieldsTimeZone);if(!(l[1]instanceof r.A)||!1===l[1].hasField("type"))throw new s.D$(t,s.TX.InvalidParameter,n);const e=l[1].field("type");if(!1===(0,b.Kg)(e))throw new s.D$(t,s.TX.InvalidParameter,n);switch((0,d.f)(e).toLowerCase()){case"preferredtimezone":return v(l[0].preferredTimeZone);case"editfieldsinfo":return v(l[0].editFieldsInfo?.timeZone??null);case"timeinfo":return v(l[0].timeInfo?.timeZone??null);case"field":if(l[1].hasField("fieldname")&&(0,b.Kg)(l[1].field("fieldname")))return v(l[0].fieldTimeZone((0,d.f)(l[1].field("fieldname"))))}throw new s.D$(t,s.TX.InvalidParameter,n)}const o=(0,d.h)(l[0],(0,d.H)(t));if(null===o)return null;const f=o.timeZone;return"system"===f?i.lY.systemTimeZoneCanonicalName:"utc"===f.toLowerCase()?"UTC":"unknown"===f.toLowerCase()?"Unknown":f}))},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,1,3,t,n);const r=a[0];if((0,d.g)(r)){if(1===a.length)return r.toSQLWithKeyword();if(2===a.length)return r.changeTimeZone((0,d.f)(a[1])).toSQLWithKeyword();throw new s.D$(t,s.TX.InvalidParameter,n)}if((0,d.j)(r))return r.toSQLWithKeyword();if((0,d.p)(r)){if(3!==a.length)throw new s.D$(t,s.TX.InvalidParameter,n);await r.load();const e=(0,d.f)(a[1]);if((0,d.j)(a[2]))return a[2].toSQLWithKeyword();if(!1===(0,d.g)(a[2]))throw new s.D$(t,s.TX.InvalidParameter,n);const i=r.fieldTimeZone(e);return null===i?a[2].toSQLWithKeyword():a[2].changeTimeZone(i).toSQLWithKeyword()}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,((e,i,a)=>{if((0,d.B)(a,2,4,t,n),(0,d.o)(a[0])){const e=(0,d.f)(a[1]);let i=(0,d.E)(a[2],null);const r=(0,d.e)((0,d.E)(a[3],!0));if(null===i&&(i=["*"]),!1===(0,b.cy)(i))throw new s.D$(t,s.TX.InvalidParameter,n);return a[0].featureSetById(e,r,i)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"featuresetbyid",min:2,max:4}),e.functions.getfeatureset=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,1,2,t,n),(0,d.n)(a[0])){let e=(0,d.E)(a[1],"datasource");return null===e&&(e="datasource"),e=(0,d.f)(e).toLowerCase(),(0,o.convertToFeatureSet)(a[0].fullSchema(),e,t.lrucache,t.interceptor,t.spatialReference??null)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,((e,i,r)=>{if((0,d.B)(r,2,5,t,n),null===r[0])throw new s.D$(t,s.TX.PortalRequired,n);if(r[0]instanceof a.A){const e=(0,d.f)(r[1]),i=(0,d.f)(r[2]);let a=(0,d.E)(r[3],null);const l=(0,d.e)((0,d.E)(r[4],!0));if(null===a&&(a=["*"]),!1===(0,b.cy)(a))throw new s.D$(t,s.TX.InvalidParameter,n);let f;return f=t.services?.portal?t.services.portal:x.A.getDefault(),f=(0,u.R)(r[0],f),(0,o.constructFeatureSetFromPortalItem)(e,i,t.spatialReference??null,a,l,f,t.lrucache,t.interceptor)}if(!1===(0,b.Kg)(r[0]))throw new s.D$(t,s.TX.PortalRequired,n);const l=(0,d.f)(r[0]),f=(0,d.f)(r[1]);let c=(0,d.E)(r[2],null);const m=(0,d.e)((0,d.E)(r[3],!0));if(null===c&&(c=["*"]),!1===(0,b.cy)(c))throw new s.D$(t,s.TX.InvalidParameter,n);return(0,o.constructFeatureSetFromPortalItem)(l,f,t.spatialReference??null,c,m,t.services?.portal??x.A.getDefault(),t.lrucache,t.interceptor)}))},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,((e,i,a)=>{if((0,d.B)(a,2,4,t,n),(0,d.o)(a[0])){const e=(0,d.f)(a[1]);let i=(0,d.E)(a[2],null);const r=(0,d.e)((0,d.E)(a[3],!0));if(null===i&&(i=["*"]),!1===(0,b.cy)(i))throw new s.D$(t,s.TX.InvalidParameter,n);return a[0].featureSetByName(e,r,i)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,((e,i,a)=>{(0,d.B)(a,1,1,t,n);const l={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,b.Kg)(a[0])){const e=JSON.parse(a[0]);void 0!==e.layerDefinition?(l.layerDefinition=e.layerDefinition,l.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(l.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(l.featureSet.features=e.features,l.featureSet.geometryType=e.geometryType,l.layerDefinition.geometryType=l.featureSet.geometryType,l.layerDefinition.objectIdField=e.objectIdFieldName??"",l.layerDefinition.typeIdField=e.typeIdFieldName,l.layerDefinition.globalIdField=e.globalIdFieldName,l.layerDefinition.fields=e.fields,e.spatialReference&&(l.layerDefinition.spatialReference=e.spatialReference))}else{if(!(a[0]instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const e=JSON.parse(a[0].castToText(!0)),i=S(e,"layerdefinition");if(null!==i){l.layerDefinition.geometryType=S(i,"geometrytype",""),l.featureSet.geometryType=l.layerDefinition.geometryType,l.layerDefinition.globalIdField=S(i,"globalidfield",""),l.layerDefinition.objectIdField=S(i,"objectidfield",""),l.layerDefinition.typeIdField=S(i,"typeidfield",""),l.layerDefinition.hasZ=!0===S(i,"hasz",!1),l.layerDefinition.hasM=!0===S(i,"hasm",!1);const t=S(i,"spatialreference");t&&(l.layerDefinition.spatialReference=C(t));const n=[];for(const e of S(i,"fields",[])){const t={name:S(e,"name",""),alias:S(e,"alias",""),type:S(e,"type",""),nullable:S(e,"nullable",!0),editable:S(e,"editable",!0),length:S(e,"length",null),domain:L(S(e,"domain"))};n.push(t)}l.layerDefinition.fields=n;const a=S(e,"featureset");if(a){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of S(a,"features",[])){const n={},i=S(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];l.featureSet.features.push({attributes:n,geometry:Z(S(t,"geometry"))})}}}else{l.layerDefinition.hasZ=!0===S(e,"hasz",!1),l.layerDefinition.hasM=!0===S(e,"hasm",!1),l.layerDefinition.geometryType=S(e,"geometrytype",""),l.featureSet.geometryType=l.layerDefinition.geometryType,l.layerDefinition.objectIdField=S(e,"objectidfieldname",""),l.layerDefinition.typeIdField=S(e,"typeidfieldname","");const i=S(e,"spatialreference");i&&(l.layerDefinition.spatialReference=C(i));const a=[],r=S(e,"fields",null);if(!(0,b.cy)(r))throw new s.D$(t,s.TX.InvalidParameter,n);for(const e of r){const t={name:S(e,"name",""),alias:S(e,"alias",""),type:S(e,"type",""),nullable:S(e,"nullable",!0),editable:S(e,"editable",!0),length:S(e,"length",null),domain:L(S(e,"domain"))};a.push(t)}l.layerDefinition.fields=a;const o={};for(const e of a)o[e.name.toLowerCase()]=e.name;let f=S(e,"features",null);if((0,b.cy)(f))for(const e of f){const t={},n=S(e,"attributes",{});for(const e in n)t[o[e.toLowerCase()]]=n[e];l.featureSet.features.push({attributes:t,geometry:Z(S(e,"geometry",null))})}else f=null,l.featureSet.features=f}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,b.cy)(e.layerDefinition.fields)&&!1!==(0,b.cy)(e.featureSet.features)}(l))throw new s.D$(t,s.TX.InvalidParameter,n);return l.layerDefinition.geometryType||(l.layerDefinition.geometryType="esriGeometryNull"),h.A.create(l,t.spatialReference)}))},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,r)=>{if((0,d.B)(r,2,2,t,n),(0,b.cy)(r[0])||(0,d.m)(r[0])){const e=[];let i,a=r[0];if(a instanceof f.A&&(a=a.toArray()),!(0,d.i)(r[1]))throw new s.D$(t,s.TX.InvalidParameter,n);i=r[1].createFunction(t);for(const t of a){const n=i(t);(0,T.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,d.p)(r[0])){const n=await r[0].load(),i=A.default.create(r[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),a=i.getVariables();if(a.length>0){const n={};for(const i of a)n[i]=e.evaluateIdentifier(t,{name:i});i.parameters=n}return new m.A({parentfeatureset:r[0],whereclause:i})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,2,2,t,n),(0,d.p)(a[0])){const e=new I.A(a[1]);return new y.A({parentfeatureset:a[0],orderbyclause:e})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,2,2,t,n),(0,d.p)(a[0]))return new p.A({parentfeatureset:a[0],topnum:a[1]});if((0,b.cy)(a[0]))return(0,d.d)(a[1])>=a[0].length?a[0].slice():a[0].slice(0,(0,d.d)(a[1]));if((0,d.m)(a[0]))return(0,d.d)(a[1])>=a[0].length()?a[0].slice():a[0].slice(0,(0,d.d)(a[1]));throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,1,1,t,n),(0,d.p)(a[0])){const n=await a[0].first(e.abortSignal);if(null!==n){const e=l.A.createFromGraphicLikeObject(n.geometry,n.attributes,a[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,b.cy)(a[0])?0===a[0].length?null:a[0][0]:(0,d.m)(a[0])?0===a[0].length()?null:a[0].get(0):null}))},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,1,2,t,n);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(a.length>1)if(a[1]instanceof r.A){if(a[1].hasField("minsize")&&(l.minsize=(0,d.d)(a[1].field("minsize"))),a[1].hasField("metadata")&&(l.returnMetadata=(0,d.e)(a[1].field("metadata"))),a[1].hasField("maxsize")&&(l.maxsize=(0,d.d)(a[1].field("maxsize"))),a[1].hasField("types")){const e=(0,d.Y)(a[1].field("types"),!1);e.length>0&&(l.types=e)}}else if(null!==a[1])throw new s.D$(t,s.TX.InvalidParameter,n);if((0,d.n)(a[0])){let e=a[0]._layer;return e instanceof $.default&&(e=(0,o.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===e||!1===(0,d.p)(e)?[]:(await e.load(),e.queryAttachments(a[0].field(e.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===a[0])return[];throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,2,4,t,n);const r=a[0],l=(0,d.f)(a[1]);let f=(0,d.E)(a[2],null);const u=(0,d.e)((0,d.E)(a[3],!0));if(null===f&&(f=["*"]),!1===(0,b.cy)(f))throw new s.D$(t,s.TX.InvalidParameter,n);if(null===a[0])return null;if(!(0,d.n)(a[0]))throw new s.D$(t,s.TX.InvalidParameter,n);let c=r._layer;if(c instanceof $.default&&(c=(0,o.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===c)return null;if(!1===(0,d.p)(c))return null;c=await c.load();const m=c.relationshipMetaData().filter((e=>e.name===l));if(0===m.length)return null;if(void 0!==m[0].relationshipTableId&&null!==m[0].relationshipTableId&&m[0].relationshipTableId>-1)return(0,o.constructFeatureSetFromRelationship)(c,m[0],r.field(c.objectIdField),c.spatialReference,f,u,t.lrucache,t.interceptor);let y=c.serviceUrl();if(!y)return null;y="/"===y.charAt(y.length-1)?y+m[0].relatedTableId.toString():y+"/"+m[0].relatedTableId.toString();const p=await(0,o.constructFeatureSetFromUrl)(y,c.spatialReference,f,u,t.lrucache,t.interceptor);await p.load();let h=p.relationshipMetaData();if(h=h.filter((e=>e.id===m[0].id)),!1===r.hasField(m[0].keyField)||null===r.field(m[0].keyField)){const e=await c.getFeatureByObjectId(r.field(c.objectIdField),[m[0].keyField]);if(e){const t=A.default.create(h[0].keyField+"= @id",{fieldsIndex:p.getFieldsIndex(),timeZone:p.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[m[0].keyField]},p.filter(t)}return new w.A({parentfeatureset:p})}const I=A.default.create(h[0].keyField+"= @id",{fieldsIndex:p.getFieldsIndex(),timeZone:p.dateFieldsTimeZoneDefaultUTC});return I.parameters={id:r.field(m[0].keyField)},p.filter(I)}))},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,2,3,t,n);const r=a[0],l=(0,d.f)((0,d.E)(a[1],"")).toLowerCase(),f=(0,b.Kg)(a[2])?(0,d.f)(a[2]):null;if(null===a[0])return null;if(!(0,d.n)(a[0]))throw new s.D$(t,s.TX.InvalidParameter,n);let u=r._layer;if(u instanceof $.default&&(u=(0,o.constructFeatureSet)(u,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===u)return null;if(!1===(0,d.p)(u))return null;await u.load();const m=u.serviceUrl(),y=await(0,o.constructAssociationMetaDataFeatureSetFromUrl)(m,t.spatialReference);let p=null,w=null,h=!1;if(null!==f&&""!==f&&void 0!==f){for(const e of y.terminals)e.terminalName===f&&(w=e.terminalId);null===w&&(h=!0)}const I=y.associations.getFieldsIndex(),F=I.get("TOGLOBALID").name,D=I.get("FROMGLOBALID").name,T=I.get("TOTERMINALID").name,x=I.get("FROMTERMINALID").name,N=I.get("FROMNETWORKSOURCEID").name,S=I.get("TONETWORKSOURCEID").name,L=I.get("ASSOCIATIONTYPE").name,C=I.get("ISCONTENTVISIBLE").name,Z=I.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){p=r.field(e.name);break}let v=null,P=new c.Gr(new E.A({name:"percentalong",alias:"percentalong",type:"double"}),A.default.create("0",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),X=new c.Gr(new E.A({name:"side",alias:"side",type:"string"}),A.default.create("''",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));const R="globalid",k="globalId",U={};for(const e in y.lkp)U[e]=y.lkp[e].sourceId;const M=new c.bV(new E.A({name:"classname",alias:"classname",type:"string"}),null,U);let O="";switch(l){case"midspan":{O=`((${F}='${p}') OR ( ${D}='${p}')) AND (${L} IN (5))`,M.codefield=A.default.create(`CASE WHEN (${F}='${p}') THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const e=(0,g.ke)(c.a.findField(y.associations.fields,D));e.name=R,e.alias=R,v=new c.Gr(e,A.default.create(`CASE WHEN (${D}='${p}') THEN ${F} ELSE ${D} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),P=y.unVersion>=4?new c.IO(c.a.findField(y.associations.fields,I.get("PERCENTALONG").name)):new c.Gr(new E.A({name:"percentalong",alias:"percentalong",type:"double"}),A.default.create("0",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{O=`((${F}='${p}') OR ( ${D}='${p}')) AND (${L} IN (4,6))`,M.codefield=A.default.create(`CASE WHEN (${F}='${p}') THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const e=(0,g.ke)(c.a.findField(y.associations.fields,D));e.name=R,e.alias=R,v=new c.Gr(e,A.default.create(`CASE WHEN (${D}='${p}') THEN ${F} ELSE ${D} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),X=new c.Gr(new E.A({name:"side",alias:"side",type:"string"}),A.default.create(`CASE WHEN (${L}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${F}='@T'`,t=`${D}='@T'`;null!==w&&(e+=` AND ${T}=@A`,t+=` AND ${x}=@A`),O="(("+e+") OR ("+t+"))",O=(0,d.N)(O,"@T",p??""),e=(0,d.N)(e,"@T",p??""),null!==w&&(e=(0,d.N)(e,"@A",w.toString()),O=(0,d.N)(O,"@A",w.toString())),M.codefield=A.default.create("CASE WHEN "+e+` THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const n=(0,g.ke)(c.a.findField(y.associations.fields,D));n.name=R,n.alias=R,v=new c.Gr(n,A.default.create("CASE WHEN "+e+` THEN ${D} ELSE ${F} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":O=`${F}='${p}' AND ${L} = 2`,null!==w&&(O+=` AND ${T} = `+w.toString()),M.codefield=N,O="( "+O+" )",v=new c.p8(c.a.findField(y.associations.fields,D),R,R);break;case"content":O=`(${D}='${p}' AND ${L} = 2)`,null!==w&&(O+=` AND ${x} = `+w.toString()),M.codefield=S,O="( "+O+" )",v=new c.p8(c.a.findField(y.associations.fields,F),R,R);break;case"structure":O=`(${F}='${p}' AND ${L} = 3)`,null!==w&&(O+=` AND ${T} = `+w.toString()),M.codefield=N,O="( "+O+" )",v=new c.p8(c.a.findField(y.associations.fields,D),R,k);break;case"attached":O=`(${D}='${p}' AND ${L} = 3)`,null!==w&&(O+=` AND ${x} = `+w.toString()),M.codefield=S,O="( "+O+" )",v=new c.p8(c.a.findField(y.associations.fields,F),R,k);break;default:throw new s.D$(t,s.TX.InvalidParameter,n)}return h&&(O="1 <> 1"),new c.a({parentfeatureset:y.associations,adaptedFields:[new c.IO(c.a.findField(y.associations.fields,Z)),new c.IO(c.a.findField(y.associations.fields,C)),v,X,M,P],extraFilter:O?A.default.create(O,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}):null})}))},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,l)=>{if((0,d.B)(l,3,3,t,n),!(0,d.p)(l[0]))throw new s.D$(t,s.TX.InvalidParameter,n);const o=await l[0].load(),f=[],u=[];let c=!1,m=[];if((0,b.Kg)(l[1]))m.push(l[1]);else if(l[1]instanceof r.A)m.push(l[1]);else if((0,b.cy)(l[1]))m=l[1];else{if(!(0,d.m)(l[1]))throw new s.D$(t,s.TX.InvalidParameter,n);m=l[1].toArray()}for(const e of m)if((0,b.Kg)(e)){const t=A.default.create((0,d.f)(e),{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,F.DA)(t)?(0,d.f)(e):"%%%%FIELDNAME";f.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const i=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",a=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===i&&(c=!0),!i)throw new s.D$(t,s.TX.InvalidParameter,n);f.push({name:i,expression:A.default.create(a||i,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(m=[],(0,b.Kg)(l[2]))m.push(l[2]);else if((0,b.cy)(l[2]))m=l[2];else if((0,d.m)(l[2]))m=l[2].toArray();else{if(!(l[2]instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);m.push(l[2])}for(const e of m){if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const i=e.hasField("name")?e.field("name"):"",a=e.hasField("statistic")?e.field("statistic"):"",r=e.hasField("expression")?e.field("expression"):"";if(!i||!a||!r)throw new s.D$(t,s.TX.InvalidParameter,n);u.push({name:i,statistic:a.toLowerCase(),expression:A.default.create(r,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of o.fields)e[t.name.toLowerCase()]=1;for(const t of f)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of f)N(n.expression,e,t);for(const n of u)N(n.expression,e,t);return l[0].groupby(f,u)}))},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,l)=>{if((0,d.p)(l[0])){(0,d.B)(l,2,2,t,n);const i=await l[0].load(),a=[];let o=[];if((0,b.Kg)(l[1]))o.push(l[1]);else if(l[1]instanceof r.A)o.push(l[1]);else if((0,b.cy)(l[1]))o=l[1];else{if(!(0,d.m)(l[1]))throw new s.D$(t,s.TX.InvalidParameter,n);o=l[1].toArray()}let f=!1;for(const e of o)if((0,b.Kg)(e)){const t=A.default.create((0,d.f)(e),{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,F.DA)(t)?(0,d.f)(e):"%%%%FIELDNAME";a.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(f=!0)}else{if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const r=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",l=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===r&&(f=!0),!r)throw new s.D$(t,s.TX.InvalidParameter,n);a.push({name:r,expression:A.default.create(l||r,{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})})}}if(f){const e={};for(const t of i.fields)e[t.name.toLowerCase()]=1;for(const t of a)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of a)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of a)N(n.expression,e,t);return l[0].groupby(a,[])}return function(e){if(1===e.length){if((0,b.cy)(e[0]))return(0,D.t)("distinct",e[0],-1);if((0,d.m)(e[0]))return(0,D.t)("distinct",e[0].toArray(),-1)}return(0,D.t)("distinct",e,-1)}(l)}))},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,1,1,t,n),!(0,d.p)(a[0]))return null;const s=await a[0].getFeatureSetInfo();return s?r.A.convertObjectToArcadeDictionary({layerId:s.layerId,layerName:s.layerName,itemId:s.itemId,serviceLayerUrl:s.serviceLayerUrl,webMapLayerId:s.webMapLayerId??null,webMapLayerTitle:s.webMapLayerTitle??null,className:null,objectClassId:null},(0,d.H)(t),!1,!1):null}))},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,2,2,t,n),(0,d.p)(a[0])){const e=await a[0].load(),i=a[1];if(!(0,b.Fq)(i))throw new s.D$(t,s.TX.InvalidParameter,n);if(e.subtypeField){const t=A.default.create(`${e.subtypeField}= ${a[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new m.A({parentfeatureset:a[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new s.D$(t,s.TX.FeatureSetDoesNotHaveSubtypes,n);const r=A.default.create(`${e.typeIdField}= ${a[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new m.A({parentfeatureset:a[0],whereclause:r})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}},80672:(e,t,n)=>{n.d(t,{R:()=>a});var i=n(20655);function a(e,t){return null===e?t:new i.A({url:e.field("url")})}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1346],{61346:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>P});var i=n(66131),a=n(47609),r=n(66395),s=n(85935),l=n(93833),o=n(40334),f=n(93818),d=n(78878),u=n(80672),c=n(68423),m=n(35704),y=n(86691),p=n(54461),w=n(85978),h=n(30235),I=n(87594),g=n(33325),F=n(80609),D=n(334),T=n(74887),A=n(88368),$=n(13600),x=n(20437),b=n(20655),E=n(54218);function N(e,t,n){const i=e.getVariables();if(i.length>0){const a={};for(const e of i)a[e]=t.evaluateIdentifier(n,{name:e});e.parameters=a}return e}function S(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function L(e){if(null===e)return null;const t={type:S(e,"type",""),name:S(e,"name","")};if("range"===t.type)t.range=S(e,"range",[]);else{t.codedValues=[];for(const n of S(e,"codedValues",[]))t.codedValues.push({name:S(n,"name",""),code:S(n,"code",null)})}return t}function C(e){if(null===e)return null;const t={},n=S(e,"wkt");null!==n&&(t.wkt=n);const i=S(e,"wkid");return null!==i&&(t.wkid=i),t}function Z(e){if(null===e)return null;const t={hasZ:S(e,"hasz",!1),hasM:S(e,"hasm",!1)},n=S(e,"spatialreference");null!=n&&(t.spatialReference=C(n));const i=S(e,"x",null);if(null!==i)return t.x=i,t.y=S(e,"y",null),t.hasZ&&(t.z=S(e,"z",null)),t.hasM&&(t.m=S(e,"m",null)),t;const a=S(e,"rings",null);if(null!==a)return t.rings=a,t;const r=S(e,"paths",null);if(null!==r)return t.paths=r,t;const s=S(e,"points",null);if(null!==s)return t.points=s,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const i=S(e,n,null);null!==i&&(t[n]=i)}return t}function v(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function P(e){"async"===e.mode&&(e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,(async(e,a,l)=>{if((0,d.B)(l,1,2,t,n),(0,d.k)(l[0]))return"Unknown";if((0,d.j)(l[0]))return"Unknown";if((0,d.p)(l[0])){if(await l[0].load(),1===l.length||null===l[1])return l[0].datesInUnknownTimezone?v("unknown"):v(l[0].dateFieldsTimeZone);if(!(l[1]instanceof r.A)||!1===l[1].hasField("type"))throw new s.D$(t,s.TX.InvalidParameter,n);const e=l[1].field("type");if(!1===(0,E.Kg)(e))throw new s.D$(t,s.TX.InvalidParameter,n);switch((0,d.f)(e).toLowerCase()){case"preferredtimezone":return v(l[0].preferredTimeZone);case"editfieldsinfo":return v(l[0].editFieldsInfo?.timeZone??null);case"timeinfo":return v(l[0].timeInfo?.timeZone??null);case"field":if(l[1].hasField("fieldname")&&(0,E.Kg)(l[1].field("fieldname")))return v(l[0].fieldTimeZone((0,d.f)(l[1].field("fieldname"))))}throw new s.D$(t,s.TX.InvalidParameter,n)}const o=(0,d.h)(l[0],(0,d.H)(t));if(null===o)return null;const f=o.timeZone;return"system"===f?i.lY.systemTimeZoneCanonicalName:"utc"===f.toLowerCase()?"UTC":"unknown"===f.toLowerCase()?"Unknown":f}))},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,1,3,t,n);const r=a[0];if((0,d.g)(r)){if(1===a.length)return r.toSQLWithKeyword();if(2===a.length)return r.changeTimeZone((0,d.f)(a[1])).toSQLWithKeyword();throw new s.D$(t,s.TX.InvalidParameter,n)}if((0,d.j)(r))return r.toSQLWithKeyword();if((0,d.p)(r)){if(3!==a.length)throw new s.D$(t,s.TX.InvalidParameter,n);await r.load();const e=(0,d.f)(a[1]);if((0,d.j)(a[2]))return a[2].toSQLWithKeyword();if(!1===(0,d.g)(a[2]))throw new s.D$(t,s.TX.InvalidParameter,n);const i=r.fieldTimeZone(e);return null===i?a[2].toSQLWithKeyword():a[2].changeTimeZone(i).toSQLWithKeyword()}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,((e,i,a)=>{if((0,d.B)(a,2,4,t,n),(0,d.o)(a[0])){const e=(0,d.f)(a[1]);let i=(0,d.G)(a[2],null);const r=(0,d.e)((0,d.G)(a[3],!0));if(null===i&&(i=["*"]),!1===(0,E.cy)(i))throw new s.D$(t,s.TX.InvalidParameter,n);return a[0].featureSetById(e,r,i)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"featuresetbyid",min:2,max:4}),e.functions.getfeatureset=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,1,2,t,n),(0,d.n)(a[0])){let e=(0,d.G)(a[1],"datasource");return null===e&&(e="datasource"),e=(0,d.f)(e).toLowerCase(),(0,o.convertToFeatureSet)(a[0].fullSchema(),e,t.lrucache,t.interceptor,t.spatialReference??null)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,((e,i,r)=>{if((0,d.B)(r,2,5,t,n),null===r[0])throw new s.D$(t,s.TX.PortalRequired,n);if(r[0]instanceof a.A){const e=(0,d.f)(r[1]),i=(0,d.f)(r[2]);let a=(0,d.G)(r[3],null);const l=(0,d.e)((0,d.G)(r[4],!0));if(null===a&&(a=["*"]),!1===(0,E.cy)(a))throw new s.D$(t,s.TX.InvalidParameter,n);let f;return f=t.services?.portal?t.services.portal:b.A.getDefault(),f=(0,u.R)(r[0],f),(0,o.constructFeatureSetFromPortalItem)(e,i,t.spatialReference??null,a,l,f,t.lrucache,t.interceptor)}if(!1===(0,E.Kg)(r[0]))throw new s.D$(t,s.TX.PortalRequired,n);const l=(0,d.f)(r[0]),f=(0,d.f)(r[1]);let c=(0,d.G)(r[2],null);const m=(0,d.e)((0,d.G)(r[3],!0));if(null===c&&(c=["*"]),!1===(0,E.cy)(c))throw new s.D$(t,s.TX.InvalidParameter,n);return(0,o.constructFeatureSetFromPortalItem)(l,f,t.spatialReference??null,c,m,t.services?.portal??b.A.getDefault(),t.lrucache,t.interceptor)}))},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,((e,i,a)=>{if((0,d.B)(a,2,4,t,n),(0,d.o)(a[0])){const e=(0,d.f)(a[1]);let i=(0,d.G)(a[2],null);const r=(0,d.e)((0,d.G)(a[3],!0));if(null===i&&(i=["*"]),!1===(0,E.cy)(i))throw new s.D$(t,s.TX.InvalidParameter,n);return a[0].featureSetByName(e,r,i)}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,((e,i,a)=>{(0,d.B)(a,1,1,t,n);const l={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,E.Kg)(a[0])){const e=JSON.parse(a[0]);void 0!==e.layerDefinition?(l.layerDefinition=e.layerDefinition,l.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(l.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(l.featureSet.features=e.features,l.featureSet.geometryType=e.geometryType,l.layerDefinition.geometryType=l.featureSet.geometryType,l.layerDefinition.objectIdField=e.objectIdFieldName??"",l.layerDefinition.typeIdField=e.typeIdFieldName,l.layerDefinition.globalIdField=e.globalIdFieldName,l.layerDefinition.fields=e.fields,e.spatialReference&&(l.layerDefinition.spatialReference=e.spatialReference))}else{if(!(a[0]instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const e=JSON.parse(a[0].castToText(!0)),i=S(e,"layerdefinition");if(null!==i){l.layerDefinition.geometryType=S(i,"geometrytype",""),l.featureSet.geometryType=l.layerDefinition.geometryType,l.layerDefinition.globalIdField=S(i,"globalidfield",""),l.layerDefinition.objectIdField=S(i,"objectidfield",""),l.layerDefinition.typeIdField=S(i,"typeidfield",""),l.layerDefinition.hasZ=!0===S(i,"hasz",!1),l.layerDefinition.hasM=!0===S(i,"hasm",!1);const t=S(i,"spatialreference");t&&(l.layerDefinition.spatialReference=C(t));const n=[];for(const e of S(i,"fields",[])){const t={name:S(e,"name",""),alias:S(e,"alias",""),type:S(e,"type",""),nullable:S(e,"nullable",!0),editable:S(e,"editable",!0),length:S(e,"length",null),domain:L(S(e,"domain"))};n.push(t)}l.layerDefinition.fields=n;const a=S(e,"featureset");if(a){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of S(a,"features",[])){const n={},i=S(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];l.featureSet.features.push({attributes:n,geometry:Z(S(t,"geometry"))})}}}else{l.layerDefinition.hasZ=!0===S(e,"hasz",!1),l.layerDefinition.hasM=!0===S(e,"hasm",!1),l.layerDefinition.geometryType=S(e,"geometrytype",""),l.featureSet.geometryType=l.layerDefinition.geometryType,l.layerDefinition.objectIdField=S(e,"objectidfieldname",""),l.layerDefinition.typeIdField=S(e,"typeidfieldname","");const i=S(e,"spatialreference");i&&(l.layerDefinition.spatialReference=C(i));const a=[],r=S(e,"fields",null);if(!(0,E.cy)(r))throw new s.D$(t,s.TX.InvalidParameter,n);for(const e of r){const t={name:S(e,"name",""),alias:S(e,"alias",""),type:S(e,"type",""),nullable:S(e,"nullable",!0),editable:S(e,"editable",!0),length:S(e,"length",null),domain:L(S(e,"domain"))};a.push(t)}l.layerDefinition.fields=a;const o={};for(const e of a)o[e.name.toLowerCase()]=e.name;let f=S(e,"features",null);if((0,E.cy)(f))for(const e of f){const t={},n=S(e,"attributes",{});for(const e in n)t[o[e.toLowerCase()]]=n[e];l.featureSet.features.push({attributes:t,geometry:Z(S(e,"geometry",null))})}else f=null,l.featureSet.features=f}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,E.cy)(e.layerDefinition.fields)&&!1!==(0,E.cy)(e.featureSet.features)}(l))throw new s.D$(t,s.TX.InvalidParameter,n);return l.layerDefinition.geometryType||(l.layerDefinition.geometryType="esriGeometryNull"),h.A.create(l,t.spatialReference)}))},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,r)=>{if((0,d.B)(r,2,2,t,n),(0,E.cy)(r[0])||(0,d.m)(r[0])){const e=[];let i,a=r[0];if(a instanceof f.A&&(a=a.toArray()),!(0,d.i)(r[1]))throw new s.D$(t,s.TX.InvalidParameter,n);i=r[1].createFunction(t);for(const t of a){const n=i(t);(0,T.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,d.p)(r[0])){const n=await r[0].load(),i=A.default.create(r[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),a=i.getVariables();if(a.length>0){const n={};for(const i of a)n[i]=e.evaluateIdentifier(t,{name:i});i.parameters=n}return new m.A({parentfeatureset:r[0],whereclause:i})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,2,2,t,n),(0,d.p)(a[0])){const e=new I.A(a[1]);return new y.A({parentfeatureset:a[0],orderbyclause:e})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,2,2,t,n),(0,d.p)(a[0]))return new p.A({parentfeatureset:a[0],topnum:a[1]});if((0,E.cy)(a[0]))return(0,d.d)(a[1])>=a[0].length?a[0].slice():a[0].slice(0,(0,d.d)(a[1]));if((0,d.m)(a[0]))return(0,d.d)(a[1])>=a[0].length()?a[0].slice():a[0].slice(0,(0,d.d)(a[1]));throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,1,1,t,n),(0,d.p)(a[0])){const n=await a[0].first(e.abortSignal);if(null!==n){const e=l.A.createFromGraphicLikeObject(n.geometry,n.attributes,a[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,E.cy)(a[0])?0===a[0].length?null:a[0][0]:(0,d.m)(a[0])?0===a[0].length()?null:a[0].get(0):null}))},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,1,2,t,n);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(a.length>1)if(a[1]instanceof r.A){if(a[1].hasField("minsize")&&(l.minsize=(0,d.d)(a[1].field("minsize"))),a[1].hasField("metadata")&&(l.returnMetadata=(0,d.e)(a[1].field("metadata"))),a[1].hasField("maxsize")&&(l.maxsize=(0,d.d)(a[1].field("maxsize"))),a[1].hasField("types")){const e=(0,d.Y)(a[1].field("types"),!1);e.length>0&&(l.types=e)}}else if(null!==a[1])throw new s.D$(t,s.TX.InvalidParameter,n);if((0,d.n)(a[0])){let e=a[0]._layer;return e instanceof $.default&&(e=(0,o.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===e||!1===(0,d.p)(e)?[]:(await e.load(),e.queryAttachments(a[0].field(e.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===a[0])return[];throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,2,4,t,n);const r=a[0],l=(0,d.f)(a[1]);let f=(0,d.G)(a[2],null);const u=(0,d.e)((0,d.G)(a[3],!0));if(null===f&&(f=["*"]),!1===(0,E.cy)(f))throw new s.D$(t,s.TX.InvalidParameter,n);if(null===a[0])return null;if(!(0,d.n)(a[0]))throw new s.D$(t,s.TX.InvalidParameter,n);let c=r._layer;if(c instanceof $.default&&(c=(0,o.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===c)return null;if(!1===(0,d.p)(c))return null;c=await c.load();const m=c.relationshipMetaData().filter((e=>e.name===l));if(0===m.length)return null;if(void 0!==m[0].relationshipTableId&&null!==m[0].relationshipTableId&&m[0].relationshipTableId>-1)return(0,o.constructFeatureSetFromRelationship)(c,m[0],r.field(c.objectIdField),c.spatialReference,f,u,t.lrucache,t.interceptor);let y=c.serviceUrl();if(!y)return null;y="/"===y.charAt(y.length-1)?y+m[0].relatedTableId.toString():y+"/"+m[0].relatedTableId.toString();const p=await(0,o.constructFeatureSetFromUrl)(y,c.spatialReference,f,u,t.lrucache,t.interceptor);await p.load();let h=p.relationshipMetaData();if(h=h.filter((e=>e.id===m[0].id)),!1===r.hasField(m[0].keyField)||null===r.field(m[0].keyField)){const e=await c.getFeatureByObjectId(r.field(c.objectIdField),[m[0].keyField]);if(e){const t=A.default.create(h[0].keyField+"= @id",{fieldsIndex:p.getFieldsIndex(),timeZone:p.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[m[0].keyField]},p.filter(t)}return new w.A({parentfeatureset:p})}const I=A.default.create(h[0].keyField+"= @id",{fieldsIndex:p.getFieldsIndex(),timeZone:p.dateFieldsTimeZoneDefaultUTC});return I.parameters={id:r.field(m[0].keyField)},p.filter(I)}))},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{(0,d.B)(a,2,3,t,n);const r=a[0],l=(0,d.f)((0,d.G)(a[1],"")).toLowerCase(),f=(0,E.Kg)(a[2])?(0,d.f)(a[2]):null;if(null===a[0])return null;if(!(0,d.n)(a[0]))throw new s.D$(t,s.TX.InvalidParameter,n);let u=r._layer;if(u instanceof $.default&&(u=(0,o.constructFeatureSet)(u,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===u)return null;if(!1===(0,d.p)(u))return null;await u.load();const m=u.serviceUrl(),y=await(0,o.constructAssociationMetaDataFeatureSetFromUrl)(m,t.spatialReference);let p=null,w=null,h=!1;if(null!==f&&""!==f&&void 0!==f){for(const e of y.terminals)e.terminalName===f&&(w=e.terminalId);null===w&&(h=!0)}const I=y.associations.getFieldsIndex(),F=I.get("TOGLOBALID").name,D=I.get("FROMGLOBALID").name,T=I.get("TOTERMINALID").name,b=I.get("FROMTERMINALID").name,N=I.get("FROMNETWORKSOURCEID").name,S=I.get("TONETWORKSOURCEID").name,L=I.get("ASSOCIATIONTYPE").name,C=I.get("ISCONTENTVISIBLE").name,Z=I.get("OBJECTID").name;for(const e of u.fields)if("global-id"===e.type){p=r.field(e.name);break}let v=null,P=new c.Gr(new x.A({name:"percentalong",alias:"percentalong",type:"double"}),A.default.create("0",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),X=new c.Gr(new x.A({name:"side",alias:"side",type:"string"}),A.default.create("''",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));const R="globalid",k="globalId",U={};for(const e in y.lkp)U[e]=y.lkp[e].sourceId;const M=new c.bV(new x.A({name:"classname",alias:"classname",type:"string"}),null,U);let G="";switch(l){case"midspan":{G=`((${F}='${p}') OR ( ${D}='${p}')) AND (${L} IN (5))`,M.codefield=A.default.create(`CASE WHEN (${F}='${p}') THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const e=(0,g.ke)(c.a.findField(y.associations.fields,D));e.name=R,e.alias=R,v=new c.Gr(e,A.default.create(`CASE WHEN (${D}='${p}') THEN ${F} ELSE ${D} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),P=y.unVersion>=4?new c.IO(c.a.findField(y.associations.fields,I.get("PERCENTALONG").name)):new c.Gr(new x.A({name:"percentalong",alias:"percentalong",type:"double"}),A.default.create("0",{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{G=`((${F}='${p}') OR ( ${D}='${p}')) AND (${L} IN (4,6))`,M.codefield=A.default.create(`CASE WHEN (${F}='${p}') THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const e=(0,g.ke)(c.a.findField(y.associations.fields,D));e.name=R,e.alias=R,v=new c.Gr(e,A.default.create(`CASE WHEN (${D}='${p}') THEN ${F} ELSE ${D} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC})),X=new c.Gr(new x.A({name:"side",alias:"side",type:"string"}),A.default.create(`CASE WHEN (${L}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${F}='@T'`,t=`${D}='@T'`;null!==w&&(e+=` AND ${T}=@A`,t+=` AND ${b}=@A`),G="(("+e+") OR ("+t+"))",G=(0,d.N)(G,"@T",p??""),e=(0,d.N)(e,"@T",p??""),null!==w&&(e=(0,d.N)(e,"@A",w.toString()),G=(0,d.N)(G,"@A",w.toString())),M.codefield=A.default.create("CASE WHEN "+e+` THEN ${N} ELSE ${S} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC});const n=(0,g.ke)(c.a.findField(y.associations.fields,D));n.name=R,n.alias=R,v=new c.Gr(n,A.default.create("CASE WHEN "+e+` THEN ${D} ELSE ${F} END`,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":G=`${F}='${p}' AND ${L} = 2`,null!==w&&(G+=` AND ${T} = `+w.toString()),M.codefield=N,G="( "+G+" )",v=new c.p8(c.a.findField(y.associations.fields,D),R,R);break;case"content":G=`(${D}='${p}' AND ${L} = 2)`,null!==w&&(G+=` AND ${b} = `+w.toString()),M.codefield=S,G="( "+G+" )",v=new c.p8(c.a.findField(y.associations.fields,F),R,R);break;case"structure":G=`(${F}='${p}' AND ${L} = 3)`,null!==w&&(G+=` AND ${T} = `+w.toString()),M.codefield=N,G="( "+G+" )",v=new c.p8(c.a.findField(y.associations.fields,D),R,k);break;case"attached":G=`(${D}='${p}' AND ${L} = 3)`,null!==w&&(G+=` AND ${b} = `+w.toString()),M.codefield=S,G="( "+G+" )",v=new c.p8(c.a.findField(y.associations.fields,F),R,k);break;default:throw new s.D$(t,s.TX.InvalidParameter,n)}return h&&(G="1 <> 1"),new c.a({parentfeatureset:y.associations,adaptedFields:[new c.IO(c.a.findField(y.associations.fields,Z)),new c.IO(c.a.findField(y.associations.fields,C)),v,X,M,P],extraFilter:G?A.default.create(G,{fieldsIndex:y.associations.getFieldsIndex(),timeZone:y.associations.dateFieldsTimeZoneDefaultUTC}):null})}))},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,l)=>{if((0,d.B)(l,3,3,t,n),!(0,d.p)(l[0]))throw new s.D$(t,s.TX.InvalidParameter,n);const o=await l[0].load(),f=[],u=[];let c=!1,m=[];if((0,E.Kg)(l[1]))m.push(l[1]);else if(l[1]instanceof r.A)m.push(l[1]);else if((0,E.cy)(l[1]))m=l[1];else{if(!(0,d.m)(l[1]))throw new s.D$(t,s.TX.InvalidParameter,n);m=l[1].toArray()}for(const e of m)if((0,E.Kg)(e)){const t=A.default.create((0,d.f)(e),{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,F.DA)(t)?(0,d.f)(e):"%%%%FIELDNAME";f.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const i=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",a=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===i&&(c=!0),!i)throw new s.D$(t,s.TX.InvalidParameter,n);f.push({name:i,expression:A.default.create(a||i,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(m=[],(0,E.Kg)(l[2]))m.push(l[2]);else if((0,E.cy)(l[2]))m=l[2];else if((0,d.m)(l[2]))m=l[2].toArray();else{if(!(l[2]instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);m.push(l[2])}for(const e of m){if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const i=e.hasField("name")?e.field("name"):"",a=e.hasField("statistic")?e.field("statistic"):"",r=e.hasField("expression")?e.field("expression"):"";if(!i||!a||!r)throw new s.D$(t,s.TX.InvalidParameter,n);u.push({name:i,statistic:a.toLowerCase(),expression:A.default.create(r,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of o.fields)e[t.name.toLowerCase()]=1;for(const t of f)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of f)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of f)N(n.expression,e,t);for(const n of u)N(n.expression,e,t);return l[0].groupby(f,u)}))},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,(async(i,a,l)=>{if((0,d.p)(l[0])){(0,d.B)(l,2,2,t,n);const i=await l[0].load(),a=[];let o=[];if((0,E.Kg)(l[1]))o.push(l[1]);else if(l[1]instanceof r.A)o.push(l[1]);else if((0,E.cy)(l[1]))o=l[1];else{if(!(0,d.m)(l[1]))throw new s.D$(t,s.TX.InvalidParameter,n);o=l[1].toArray()}let f=!1;for(const e of o)if((0,E.Kg)(e)){const t=A.default.create((0,d.f)(e),{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,F.DA)(t)?(0,d.f)(e):"%%%%FIELDNAME";a.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(f=!0)}else{if(!(e instanceof r.A))throw new s.D$(t,s.TX.InvalidParameter,n);{const r=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",l=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===r&&(f=!0),!r)throw new s.D$(t,s.TX.InvalidParameter,n);a.push({name:r,expression:A.default.create(l||r,{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})})}}if(f){const e={};for(const t of i.fields)e[t.name.toLowerCase()]=1;for(const t of a)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of a)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of a)N(n.expression,e,t);return l[0].groupby(a,[])}return function(e){if(1===e.length){if((0,E.cy)(e[0]))return(0,D.t)("distinct",e[0],-1);if((0,d.m)(e[0]))return(0,D.t)("distinct",e[0].toArray(),-1)}return(0,D.t)("distinct",e,-1)}(l)}))},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,1,1,t,n),!(0,d.p)(a[0]))return null;const s=await a[0].getFeatureSetInfo();return s?r.A.convertObjectToArcadeDictionary({layerId:s.layerId,layerName:s.layerName,itemId:s.itemId,serviceLayerUrl:s.serviceLayerUrl,webMapLayerId:s.webMapLayerId??null,webMapLayerTitle:s.webMapLayerTitle??null,className:null,objectClassId:null},(0,d.H)(t),!1,!1):null}))},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,(async(e,i,a)=>{if((0,d.B)(a,2,2,t,n),(0,d.p)(a[0])){const e=await a[0].load(),i=a[1];if(!(0,E.Fq)(i))throw new s.D$(t,s.TX.InvalidParameter,n);if(e.subtypeField){const t=A.default.create(`${e.subtypeField}= ${a[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new m.A({parentfeatureset:a[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new s.D$(t,s.TX.FeatureSetDoesNotHaveSubtypes,n);const r=A.default.create(`${e.typeIdField}= ${a[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new m.A({parentfeatureset:a[0],whereclause:r})}throw new s.D$(t,s.TX.InvalidParameter,n)}))},e.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}},80672:(e,t,n)=>{n.d(t,{R:()=>a});var i=n(20655);function a(e,t){return null===e?t:new i.A({url:e.field("url")})}}}]);