chunk-IT2TKXNZ.js 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108
  1. import {
  2. d as d3,
  3. s
  4. } from "./chunk-YYN5W6FL.js";
  5. import {
  6. e
  7. } from "./chunk-L5OAV75Q.js";
  8. import {
  9. l as l2
  10. } from "./chunk-YQQTFR2M.js";
  11. import {
  12. d as d2
  13. } from "./chunk-R5LRKX5A.js";
  14. import {
  15. M as M3,
  16. P as P3,
  17. Z as Z2,
  18. d as d4,
  19. p as p3
  20. } from "./chunk-HEFAWVPH.js";
  21. import {
  22. $,
  23. Ae,
  24. C,
  25. DateTime,
  26. E,
  27. F2 as F,
  28. Fe,
  29. G,
  30. H,
  31. I,
  32. J,
  33. L,
  34. M as M2,
  35. N,
  36. O,
  37. P,
  38. P2,
  39. Q,
  40. Re,
  41. V,
  42. X,
  43. Y,
  44. Z,
  45. _,
  46. ee,
  47. he,
  48. i,
  49. ie,
  50. j as j2,
  51. je,
  52. ne,
  53. oe,
  54. re,
  55. se,
  56. t,
  57. t2,
  58. ue,
  59. v2,
  60. ve,
  61. w,
  62. ye,
  63. z
  64. } from "./chunk-25BNEBXZ.js";
  65. import {
  66. p as p2
  67. } from "./chunk-3ZFH4KQV.js";
  68. import {
  69. d
  70. } from "./chunk-2Z6LERTI.js";
  71. import {
  72. f,
  73. m,
  74. m2,
  75. v2 as v
  76. } from "./chunk-OWVBLVP3.js";
  77. import {
  78. l
  79. } from "./chunk-XH7RUGVZ.js";
  80. import {
  81. M2 as M,
  82. j2 as j,
  83. p
  84. } from "./chunk-ECW2QABR.js";
  85. import {
  86. k2
  87. } from "./chunk-MRJEICT6.js";
  88. import {
  89. k
  90. } from "./chunk-ULGDPLM2.js";
  91. // node_modules/@arcgis/core/arcade/treeAnalysis.js
  92. var e2 = { all: { min: "2", max: "2" }, none: { min: "2", max: "2" }, any: { min: "2", max: "2" }, reduce: { min: "2", max: "3" }, map: { min: "2", max: "2" }, filter: { min: "2", max: "2" }, fromcodepoint: { min: "1", max: "*" }, fromcharcode: { min: "1", max: "*" }, tocodepoint: { min: "1", max: "2" }, tocharcode: { min: "1", max: "2" }, concatenate: { min: "0", max: "*" }, expects: { min: "1", max: "*" }, getfeatureset: { min: "1", max: "2" }, week: { min: "1", max: "2" }, fromjson: { min: "1", max: "1" }, length3d: { min: "1", max: "2" }, tohex: { min: "1", max: "1" }, hash: { min: "1", max: "1" }, isoweek: { min: "1", max: "1" }, isoweekday: { min: "1", max: "1" }, isomonth: { min: "1", max: "1" }, isoyear: { min: "1", max: "1" }, resize: { min: "2", max: "3" }, slice: { min: "0", max: "*" }, splice: { min: "0", max: "*" }, push: { min: "2", max: "2" }, pop: { min: "1", max: "1" }, includes: { min: "2", max: "2" }, array: { min: "1", max: "2" }, front: { min: "1", max: "1" }, back: { min: "1", max: "1" }, insert: { min: "3", max: "3" }, erase: { min: "2", max: "2" }, split: { min: "2", max: "4" }, guid: { min: "0", max: "1" }, today: { min: "0", max: "0" }, angle: { min: "2", max: "3" }, bearing: { min: "2", max: "3" }, urlencode: { min: "1", max: "1" }, now: { min: "0", max: "0" }, timestamp: { min: "0", max: "0" }, day: { min: "1", max: "1" }, month: { min: "1", max: "1" }, year: { min: "1", max: "1" }, hour: { min: "1", max: "1" }, second: { min: "1", max: "1" }, millisecond: { min: "1", max: "1" }, minute: { min: "1", max: "1" }, weekday: { min: "1", max: "1" }, toutc: { min: "1", max: "1" }, tolocal: { min: "1", max: "1" }, date: { min: "0", max: "7" }, datediff: { min: "2", max: "3" }, dateadd: { min: "2", max: "3" }, trim: { min: "1", max: "1" }, text: { min: "1", max: "2" }, left: { min: "2", max: "2" }, right: { min: "2", max: "2" }, mid: { min: "2", max: "3" }, upper: { min: "1", max: "1" }, proper: { min: "1", max: "2" }, lower: { min: "1", max: "1" }, find: { min: "2", max: "3" }, iif: { min: "3", max: "3" }, decode: { min: "2", max: "*" }, when: { min: "2", max: "*" }, defaultvalue: { min: "2", max: "2" }, isempty: { min: "1", max: "1" }, domaincode: { min: "2", max: "4" }, domainname: { min: "2", max: "4" }, polygon: { min: "1", max: "1" }, point: { min: "1", max: "1" }, polyline: { min: "1", max: "1" }, extent: { min: "1", max: "1" }, multipoint: { min: "1", max: "1" }, ringisclockwise: { min: "1", max: "1" }, geometry: { min: "1", max: "1" }, count: { min: "0", max: "*" }, number: { min: "1", max: "2" }, acos: { min: "1", max: "1" }, asin: { min: "1", max: "1" }, atan: { min: "1", max: "1" }, atan2: { min: "2", max: "2" }, ceil: { min: "1", max: "2" }, floor: { min: "1", max: "2" }, round: { min: "1", max: "2" }, cos: { min: "1", max: "1" }, exp: { min: "1", max: "1" }, log: { min: "1", max: "1" }, min: { min: "0", max: "*" }, constrain: { min: "3", max: "3" }, console: { min: "0", max: "*" }, max: { min: "0", max: "*" }, pow: { min: "2", max: "2" }, random: { min: "0", max: "0" }, sqrt: { min: "1", max: "1" }, sin: { min: "1", max: "1" }, tan: { min: "1", max: "1" }, abs: { min: "1", max: "1" }, isnan: { min: "1", max: "1" }, stdev: { min: "0", max: "*" }, average: { min: "0", max: "*" }, mean: { min: "0", max: "*" }, sum: { min: "0", max: "*" }, variance: { min: "0", max: "*" }, distinct: { min: "0", max: "*" }, first: { min: "1", max: "1" }, top: { min: "2", max: "2" }, boolean: { min: "1", max: "1" }, dictionary: { min: "0", max: "*" }, typeof: { min: "1", max: "1" }, reverse: { min: "1", max: "1" }, replace: { min: "3", max: "4" }, sort: { min: "1", max: "2" }, feature: { min: "1", max: "*" }, haskey: { min: "2", max: "2" }, indexof: { min: "2", max: "2" }, disjoint: { min: "2", max: "2" }, intersects: { min: "2", max: "2" }, touches: { min: "2", max: "2" }, crosses: { min: "2", max: "2" }, within: { min: "2", max: "2" }, contains: { min: "2", max: "2" }, overlaps: { min: "2", max: "2" }, equals: { min: "2", max: "2" }, relate: { min: "3", max: "3" }, intersection: { min: "2", max: "2" }, union: { min: "1", max: "2" }, difference: { min: "2", max: "2" }, symmetricdifference: { min: "2", max: "2" }, clip: { min: "2", max: "2" }, cut: { min: "2", max: "2" }, area: { min: "1", max: "2" }, areageodetic: { min: "1", max: "2" }, length: { min: "1", max: "2" }, lengthgeodetic: { min: "1", max: "2" }, distancegeodetic: { min: "2", max: "3" }, distance: { min: "2", max: "3" }, densify: { min: "2", max: "3" }, densifygeodetic: { min: "2", max: "3" }, generalize: { min: "2", max: "4" }, buffer: { min: "2", max: "3" }, buffergeodetic: { min: "2", max: "3" }, offset: { min: "2", max: "6" }, rotate: { min: "2", max: "3" }, issimple: { min: "1", max: "1" }, simplify: { min: "1", max: "1" }, centroid: { min: "1", max: "1" }, isselfintersecting: { min: "1", max: "1" }, multiparttosinglepart: { min: "1", max: "1" }, setgeometry: { min: "2", max: "2" }, portal: { min: "1", max: "1" }, getuser: { min: "1", max: "2" }, subtypes: { min: "1", max: "1" }, subtypecode: { min: "1", max: "1" }, subtypename: { min: "1", max: "1" }, domain: { min: "2", max: "3" }, convertdirection: { min: "3", max: "3" }, schema: { min: "1", max: "1" } };
  93. for (const k4 in e2)
  94. e2[k4].fmin = e2[k4].min, e2[k4].fmax = e2[k4].max;
  95. var t3 = ["featureset", "getuser", "featuresetbyid", "featuresetbyname", "featuresetbyassociation", "featuresetbyrelationshipname", "featuresetbyurl", "getfeatureset", "attachments", "featuresetbyportalitem"];
  96. var n = ["disjoint", "intersects", "touches", "crosses", "within", "contains", "overlaps", "equals", "relate", "intersection", "union", "difference", "symmetricdifference", "clip", "cut", "area", "areageodetic", "length", "length3d", "lengthgeodetic", "distance", "distancegeodetic", "densify", "densifygeodetic", "generalize", "buffer", "buffergeodetic", "offset", "rotate", "issimple", "simplify", "multiparttosinglepart"];
  97. function a(e4) {
  98. return typeof e4 == "string" || e4 instanceof String;
  99. }
  100. function r(t5, n3) {
  101. const a2 = e2[t5.name.toLowerCase()];
  102. a2 === void 0 ? e2[t5.name.toLowerCase()] = n3 === "sync" ? { min: t5.min, max: t5.max } : { fmin: t5.min, fmax: t5.max } : n3 === "sync" ? (a2.min = t5.min, a2.max = t5.max) : (a2.fmin = t5.min, a2.fmax = t5.max);
  103. }
  104. function i2(e4, t5) {
  105. return e4.min !== "0" && t5.length < Number(e4.min) || e4.max !== "*" && t5.length > Number(e4.max) ? -2 : 1;
  106. }
  107. function s2(e4, t5, n3) {
  108. if (n3.localScope !== null && n3.localScope[e4.toLowerCase()] !== void 0) {
  109. const a2 = n3.localScope[e4.toLowerCase()];
  110. if (a2.type === "FormulaFunction")
  111. return a2.signature === void 0 && (a2.signature = { min: "0", max: "*" }), i2(a2.signature, t5);
  112. if (a2.type === "any")
  113. return a2.signature === void 0 && (a2.signature = { min: "0", max: "*" }), i2(a2.signature, t5);
  114. }
  115. if (n3.globalScope[e4.toLowerCase()] !== void 0) {
  116. const a2 = n3.globalScope[e4.toLowerCase()];
  117. if (a2.type === "FormulaFunction")
  118. return a2.signature === void 0 && (a2.signature = { min: "0", max: "*" }), i2(a2.signature, t5);
  119. if (a2.type === "any")
  120. return a2.signature === void 0 && (a2.signature = { min: "0", max: "*" }), i2(a2.signature, t5);
  121. }
  122. return -1;
  123. }
  124. function o(e4, t5) {
  125. if (e4)
  126. for (const n3 of e4)
  127. l3(n3, t5);
  128. }
  129. function l3(e4, t5) {
  130. if (e4 && t5(e4) !== false)
  131. switch (e4.type) {
  132. case "ArrayExpression":
  133. o(e4.elements, t5);
  134. break;
  135. case "AssignmentExpression":
  136. case "BinaryExpression":
  137. case "LogicalExpression":
  138. l3(e4.left, t5), l3(e4.right, t5);
  139. break;
  140. case "BlockStatement":
  141. case "Program":
  142. o(e4.body, t5);
  143. break;
  144. case "BreakStatement":
  145. case "ContinueStatement":
  146. case "EmptyStatement":
  147. case "Identifier":
  148. case "Literal":
  149. break;
  150. case "CallExpression":
  151. l3(e4.callee, t5), o(e4.arguments, t5);
  152. break;
  153. case "ExpressionStatement":
  154. l3(e4.expression, t5);
  155. break;
  156. case "ForInStatement":
  157. l3(e4.left, t5), l3(e4.right, t5), l3(e4.body, t5);
  158. break;
  159. case "ForStatement":
  160. l3(e4.init, t5), l3(e4.test, t5), l3(e4.update, t5), l3(e4.body, t5);
  161. break;
  162. case "FunctionDeclaration":
  163. l3(e4.id, t5), o(e4.params, t5), l3(e4.body, t5);
  164. break;
  165. case "IfStatement":
  166. l3(e4.test, t5), l3(e4.consequent, t5), l3(e4.alternate, t5);
  167. break;
  168. case "MemberExpression":
  169. l3(e4.object, t5), l3(e4.property, t5);
  170. break;
  171. case "ObjectExpression":
  172. o(e4.properties, t5);
  173. break;
  174. case "Property":
  175. l3(e4.key, t5), l3(e4.value, t5);
  176. break;
  177. case "ReturnStatement":
  178. case "UnaryExpression":
  179. case "UpdateExpression":
  180. l3(e4.argument, t5);
  181. break;
  182. case "VariableDeclaration":
  183. o(e4.declarations, t5);
  184. break;
  185. case "VariableDeclarator":
  186. l3(e4.id, t5), l3(e4.init, t5);
  187. break;
  188. case "TemplateLiteral":
  189. o(e4.expressions, t5), o(e4.quasis, t5);
  190. }
  191. }
  192. function m3(e4, t5 = true) {
  193. let n3 = b(e4, "SYNTAX", "UNREOGNISED");
  194. try {
  195. switch (e4.type) {
  196. case "VariableDeclarator":
  197. return e4.id.type !== "Identifier" ? b(e4, "SYNTAX", "VARIABLEMUSTHAVEIDENTIFIER") : e4.init !== null ? m3(e4.init, false) : "";
  198. case "VariableDeclaration":
  199. for (let a2 = 0; a2 < e4.declarations.length; a2++)
  200. if (n3 = m3(e4.declarations[a2], t5), n3 !== "")
  201. return n3;
  202. return "";
  203. case "ForInStatement":
  204. if (n3 = m3(e4.left, t5), n3 !== "")
  205. return n3;
  206. if (e4.left.type === "VariableDeclaration") {
  207. if (e4.left.declarations.length > 1)
  208. return b(e4, "SYNTAX", "ONLY1VAR");
  209. if (e4.left.declarations[0].init !== null)
  210. return b(e4, "SYNTAX", "CANNOTDECLAREVAL");
  211. } else if (e4.left.type !== "Identifier")
  212. return b(e4, "SYNTAX", "LEFTNOTVAR");
  213. return n3 = m3(e4.right, t5), n3 !== "" ? n3 : (n3 = m3(e4.body, t5), n3 !== "" ? n3 : "");
  214. case "ForStatement":
  215. return e4.test !== null && (n3 = m3(e4.test, t5), n3 !== "") || (e4.init !== null && (n3 = m3(e4.init, t5), n3 !== "") || e4.update !== null && (n3 = m3(e4.update, t5), n3 !== "") || e4.body !== null && (n3 = m3(e4.body, t5), n3 !== "")) ? n3 : "";
  216. case "ContinueStatement":
  217. case "EmptyStatement":
  218. case "BreakStatement":
  219. case "Literal":
  220. case "TemplateElement":
  221. return "";
  222. case "IfStatement":
  223. return n3 = m3(e4.test, t5), n3 !== "" || e4.consequent !== null && (n3 = m3(e4.consequent, false), n3 !== "") || e4.alternate !== null && (n3 = m3(e4.alternate, false), n3 !== "") ? n3 : "";
  224. case "BlockStatement": {
  225. const a2 = [];
  226. for (let t6 = 0; t6 < e4.body.length; t6++)
  227. e4.body[t6].type !== "EmptyStatement" && a2.push(e4.body[t6]);
  228. e4.body = a2;
  229. for (let r3 = 0; r3 < e4.body.length; r3++)
  230. if (n3 = m3(e4.body[r3], t5), n3 !== "")
  231. return n3;
  232. return "";
  233. }
  234. case "FunctionDeclaration":
  235. return t5 === false ? b(e4, "SYNTAX", "GLOBALFUNCTIONSONLY") : e4.id.type !== "Identifier" ? b(e4, "SYNTAX", "FUNCTIONMUSTHAVEIDENTIFIER") : m3(e4.body, false);
  236. case "ReturnStatement":
  237. return e4.argument !== null ? m3(e4.argument, t5) : "";
  238. case "UpdateExpression":
  239. return e4.argument.type !== "Identifier" && e4.argument.type !== "MemberExpression" ? b(e4, "SYNTAX", "ASSIGNMENTTOVARSONLY") : m3(e4.argument, t5);
  240. case "AssignmentExpression":
  241. if (e4.left.type !== "Identifier" && e4.left.type !== "MemberExpression")
  242. return b(e4, "SYNTAX", "ASSIGNMENTTOVARSONLY");
  243. if (n3 = m3(e4.left, t5), n3 !== "")
  244. return n3;
  245. switch (e4.operator) {
  246. case "=":
  247. case "/=":
  248. case "*=":
  249. case "%=":
  250. case "+=":
  251. case "-=":
  252. break;
  253. default:
  254. return b(e4, "SYNTAX", "OPERATORNOTRECOGNISED");
  255. }
  256. return m3(e4.right, false);
  257. case "ExpressionStatement":
  258. return e4.expression.type === "AssignmentExpression" || e4.expression.type, m3(e4.expression, false);
  259. case "Identifier":
  260. n3 = "";
  261. break;
  262. case "MemberExpression":
  263. return n3 = m3(e4.object, t5), n3 !== "" ? n3 : e4.computed === true ? m3(e4.property, t5) : "";
  264. case "CallExpression":
  265. if (e4.callee.type !== "Identifier")
  266. return b(e4, "SYNTAX", "ONLYNODESSUPPORTED");
  267. n3 = "";
  268. for (let a2 = 0; a2 < e4.arguments.length; a2++)
  269. if (n3 = m3(e4.arguments[a2], t5), n3 !== "")
  270. return n3;
  271. return "";
  272. case "UnaryExpression":
  273. n3 = m3(e4.argument, t5);
  274. break;
  275. case "BinaryExpression":
  276. if (n3 = m3(e4.left, t5), n3 !== "")
  277. return n3;
  278. if (n3 = m3(e4.right, t5), n3 !== "")
  279. return n3;
  280. switch (e4.operator) {
  281. case "|":
  282. case "&":
  283. case ">>":
  284. case "<<":
  285. case ">>>":
  286. case "^":
  287. case "==":
  288. case "!=":
  289. case "<":
  290. case "<=":
  291. case ">":
  292. case ">=":
  293. case "+":
  294. case "-":
  295. case "*":
  296. case "/":
  297. case "%":
  298. break;
  299. default:
  300. return b(e4, "SYNTAX", "OPERATORNOTRECOGNISED");
  301. }
  302. return "";
  303. case "LogicalExpression":
  304. if (n3 = m3(e4.left, t5), n3 !== "")
  305. return n3;
  306. if (n3 = m3(e4.right), n3 !== "")
  307. return n3;
  308. switch (e4.operator) {
  309. case "&&":
  310. case "||":
  311. break;
  312. default:
  313. return b(e4, "SYNTAX", "OPERATORNOTRECOGNISED");
  314. }
  315. return "";
  316. case "ArrayExpression":
  317. n3 = "";
  318. for (let a2 = 0; a2 < e4.elements.length; a2++)
  319. if (n3 = m3(e4.elements[a2], t5), n3 !== "")
  320. return n3;
  321. return n3;
  322. case "TemplateLiteral":
  323. n3 = "";
  324. for (let a2 = 0; a2 < e4.quasis.length; a2++)
  325. if (n3 = m3(e4.quasis[a2], t5), n3 !== "")
  326. return n3;
  327. for (let a2 = 0; a2 < e4.expressions.length; a2++)
  328. if (n3 = m3(e4.expressions[a2], t5), n3 !== "")
  329. return n3;
  330. return n3;
  331. case "ObjectExpression":
  332. n3 = "";
  333. for (let a2 = 0; a2 < e4.properties.length; a2++) {
  334. if (n3 = "", e4.properties[a2].key !== null && (e4.properties[a2].key.type !== "Literal" && e4.properties[a2].key.type !== "Identifier" && (n3 = b(e4, "SYNTAX", "OBJECTPROPERTYMUSTBESTRING")), e4.properties[a2].key.type === "Literal")) {
  335. const t6 = e4.properties[a2].key, r3 = "value" in t6 ? t6.value : null;
  336. typeof r3 == "string" || r3 instanceof String || (n3 = b(e4, "SYNTAX", "OBJECTPROPERTYMUSTBESTRING"));
  337. }
  338. if (n3 === "" && (n3 = m3(e4.properties[a2], t5)), n3 !== "")
  339. return n3;
  340. }
  341. return n3;
  342. case "Property":
  343. return e4.key.type !== "Literal" && e4.key.type !== "Identifier" ? b(e4, "SYNTAX", "ONLYLITERAL") : (e4.key.type !== "Identifier" && (n3 = m3(e4.key, t5), n3 !== "") || (n3 = m3(e4.value, t5)), n3);
  344. default:
  345. return n3;
  346. }
  347. return n3;
  348. } catch (a2) {
  349. throw a2;
  350. }
  351. }
  352. function c(e4, t5) {
  353. let n3 = b(e4, "SYNTAX", "UNREOGNISED"), a2 = null, r3 = "";
  354. try {
  355. switch (e4.type) {
  356. case "VariableDeclarator": {
  357. const n4 = e4.init === null ? "" : c(e4.init, t5);
  358. return n4 !== "" ? n4 : (e4.id.type === "Identifier" && (t5.localScope === null ? t5.globalScope[e4.id.name.toLowerCase()] = { type: "any" } : t5.localScope[e4.id.name.toLowerCase()] = { type: "any" }), "");
  359. }
  360. case "FunctionDeclaration":
  361. return a2 = y(e4.id.name.toLowerCase(), e4), r3 = x(e4, t5), r3 !== "" ? r3 : t5.localScope !== null ? b(e4, "SYNTAX", "GLOBALFUNCTIONSONLY") : (a2.isnative = false, t5.globalScope[e4.id.name.toLowerCase()] = { type: "FormulaFunction", signature: [a2] }, "");
  362. case "VariableDeclaration":
  363. n3 = "";
  364. for (let a3 = 0; a3 < e4.declarations.length; a3++)
  365. if (n3 = c(e4.declarations[a3], t5), n3 !== "")
  366. return n3;
  367. return n3;
  368. case "IfStatement":
  369. return n3 = c(e4.test, t5), n3 !== "" ? n3 : e4.test.type === "AssignmentExpression" || e4.test.type === "UpdateExpression" ? b(e4.test, "SYNTAX", "CANNOT_USE_ASSIGNMENT_IN_CONDITION") : e4.consequent !== null && (n3 = c(e4.consequent, t5), n3 !== "") || e4.alternate !== null && (n3 = c(e4.alternate, t5), n3 !== "") ? n3 : "";
  370. case "EmptyStatement":
  371. case "BreakStatement":
  372. case "ContinueStatement":
  373. case "Literal":
  374. case "TemplateElement":
  375. return "";
  376. case "BlockStatement":
  377. for (let a3 = 0; a3 < e4.body.length; a3++)
  378. if (n3 = c(e4.body[a3], t5), n3 !== "")
  379. return n3;
  380. return "";
  381. case "ReturnStatement":
  382. return e4.argument !== null ? c(e4.argument, t5) : "";
  383. case "ForInStatement":
  384. if (e4.left.type === "VariableDeclaration") {
  385. if (e4.left.declarations.length > 1)
  386. return b(e4, "SYNTAX", "ONLY1VAR");
  387. if (e4.left.declarations[0].init !== null)
  388. return b(e4, "SYNTAX", "CANNOTDECLAREVAL");
  389. } else if (e4.left.type !== "Identifier")
  390. return b(e4, "SYNTAX", "LEFTNOTVAR");
  391. return n3 = c(e4.left, t5), n3 !== "" ? n3 : (n3 = c(e4.right, t5), n3 !== "" ? n3 : (n3 = c(e4.body, t5), n3 !== "" ? n3 : ""));
  392. case "ForStatement":
  393. return e4.init !== null && (n3 = c(e4.init, t5), n3 !== "") || (e4.test !== null && (n3 = c(e4.test, t5), n3 !== "") || e4.body !== null && (n3 = c(e4.body, t5), n3 !== "") || e4.update !== null && (n3 = c(e4.update, t5), n3 !== "")) ? n3 : "";
  394. case "UpdateExpression": {
  395. if (e4.argument.type !== "Identifier" && e4.argument.type !== "MemberExpression")
  396. return b(e4, "SYNTAX", "ASSIGNMENTTOVARSONLY");
  397. let n4 = false;
  398. return e4.argument.type === "MemberExpression" ? c(e4.argument, t5) : (t5.localScope !== null && t5.localScope[e4.argument.name.toLowerCase()] !== void 0 && (n4 = true), t5.globalScope[e4.argument.name.toLowerCase()] !== void 0 && (n4 = true), n4 === false ? "Identifier " + e4.argument.name + " has not been declared." : "");
  399. }
  400. case "AssignmentExpression": {
  401. if (e4.left.type !== "Identifier" && e4.left.type !== "MemberExpression")
  402. return b(e4, "SYNTAX", "ASSIGNMENTTOVARSONLY");
  403. let n4 = c(e4.right, t5);
  404. if (n4 !== "")
  405. return n4;
  406. let a3 = false;
  407. return e4.left.type === "MemberExpression" ? (n4 = c(e4.left, t5), n4 !== "" ? n4 : "") : (t5.localScope !== null && t5.localScope[e4.left.name.toLowerCase()] !== void 0 && (a3 = true), t5.globalScope[e4.left.name.toLowerCase()] !== void 0 && (a3 = true), a3 === false ? "Identifier " + e4.left.name + " has not been declared." : "");
  408. }
  409. case "ExpressionStatement":
  410. return e4.expression.type === "AssignmentExpression" || e4.expression.type, c(e4.expression, t5);
  411. case "Identifier": {
  412. const a3 = e4.name.toLowerCase();
  413. if (t5.localScope !== null && t5.localScope[a3] !== void 0)
  414. return "";
  415. n3 = t5.globalScope[a3] !== void 0 ? "" : b(e4, "SYNTAX", "VARIABLENOTFOUND");
  416. break;
  417. }
  418. case "MemberExpression":
  419. return n3 = c(e4.object, t5), n3 !== "" ? n3 : e4.computed === true ? c(e4.property, t5) : "";
  420. case "CallExpression": {
  421. if (e4.callee.type !== "Identifier")
  422. return b(e4, "SYNTAX", "ONLYNODESSUPPORTED");
  423. n3 = "";
  424. for (let r4 = 0; r4 < e4.arguments.length; r4++)
  425. if (n3 = c(e4.arguments[r4], t5), n3 !== "")
  426. return n3;
  427. const a3 = s2(e4.callee.name, e4.arguments, t5);
  428. a3 === -1 && (n3 = b(e4, "SYNTAX", "NOTFOUND")), a3 === -2 && (n3 = b(e4, "SYNTAX", "WRONGSIGNATURE"));
  429. break;
  430. }
  431. case "UnaryExpression":
  432. n3 = c(e4.argument, t5);
  433. break;
  434. case "BinaryExpression":
  435. return n3 = c(e4.left, t5), n3 !== "" ? n3 : (n3 = c(e4.right, t5), n3 !== "" ? n3 : "");
  436. case "LogicalExpression":
  437. return n3 = c(e4.left, t5), n3 !== "" ? n3 : e4.left.type === "AssignmentExpression" || e4.left.type === "UpdateExpression" ? b(e4.left, "SYNTAX", "CANNOT_USE_ASSIGNMENT_IN_CONDITION") : (n3 = c(e4.right, t5), n3 !== "" ? n3 : e4.right.type === "AssignmentExpression" || e4.right.type === "UpdateExpression" ? b(e4.right, "SYNTAX", "CANNOT_USE_ASSIGNMENT_IN_CONDITION") : "");
  438. case "ArrayExpression":
  439. n3 = "";
  440. for (let a3 = 0; a3 < e4.elements.length; a3++)
  441. if (n3 = c(e4.elements[a3], t5), n3 !== "")
  442. return n3;
  443. return n3;
  444. case "TemplateLiteral":
  445. n3 = "";
  446. for (let a3 = 0; a3 < e4.quasis.length; a3++)
  447. if (n3 = c(e4.quasis[a3], t5), n3 !== "")
  448. return n3;
  449. for (let a3 = 0; a3 < e4.expressions.length; a3++)
  450. if (n3 = c(e4.expressions[a3], t5), n3 !== "")
  451. return n3;
  452. return n3;
  453. case "ObjectExpression":
  454. n3 = "";
  455. for (let a3 = 0; a3 < e4.properties.length; a3++) {
  456. if (n3 = "", e4.properties[a3].key !== null && (e4.properties[a3].key.type !== "Literal" && e4.properties[a3].key.type !== "Identifier" && (n3 = b(e4, "SYNTAX", "OBJECTPROPERTYMUSTBESTRING")), e4.properties[a3].key.type === "Literal")) {
  457. const t6 = e4.properties[a3].key, r4 = "value" in t6 ? t6.value : null;
  458. typeof r4 == "string" || r4 instanceof String || (n3 = b(e4, "SYNTAX", "OBJECTPROPERTYMUSTBESTRING"));
  459. }
  460. if (n3 === "" && (n3 = c(e4.properties[a3], t5)), n3 !== "")
  461. return n3;
  462. }
  463. return n3;
  464. case "Property":
  465. return e4.key.type !== "Literal" && e4.key.type !== "Identifier" ? b(e4, "SYNTAX", "ONLYLITERAL") : (e4.key.type !== "Identifier" && (n3 = c(e4.key, t5), n3 !== "") || (n3 = c(e4.value, t5)), n3);
  466. default:
  467. return C2(e4), n3;
  468. }
  469. return n3;
  470. } catch (i5) {
  471. throw i5;
  472. }
  473. }
  474. function p4(e4, t5) {
  475. let n3 = false;
  476. const a2 = t5.toLowerCase();
  477. return l3(e4, (e5) => !n3 && (e5.type === "Identifier" && e5.name && e5.name.toLowerCase() === a2 && (n3 = true), true)), n3;
  478. }
  479. function u(e4, t5) {
  480. let n3 = false;
  481. const a2 = t5.toLowerCase();
  482. return l3(e4, (e5) => !n3 && (e5.type !== "CallExpression" || e5.callee.type !== "Identifier" || !e5.callee.name || e5.callee.name.toLowerCase() !== a2 || (n3 = true, false))), n3;
  483. }
  484. function f2(e4) {
  485. const t5 = [];
  486. return l3(e4, (e5) => e5.type !== "MemberExpression" || e5.object.type !== "Identifier" || (e5.computed === false && e5.object && e5.object.name && e5.property && e5.property.type === "Identifier" && e5.property.name ? t5.push(e5.object.name.toLowerCase() + "." + e5.property.name.toLowerCase()) : e5.object && e5.object.name && e5.property && e5.property.type === "Literal" && typeof e5.property.value == "string" && t5.push(e5.object.name.toLowerCase() + "." + e5.property.value.toString().toLowerCase()), false)), t5;
  487. }
  488. function d5(e4) {
  489. const t5 = [];
  490. return l3(e4, (e5) => {
  491. if (e5.type === "CallExpression") {
  492. if (e5.callee.type === "Identifier" && e5.callee.name.toLowerCase() === "expects") {
  493. let n3 = "";
  494. for (let r3 = 0; r3 < (e5.arguments || []).length; r3++)
  495. r3 === 0 ? e5.arguments[r3].type === "Identifier" && (n3 = e5.arguments[r3].name.toLowerCase()) : n3 && e5.arguments[r3].type === "Literal" && a(e5.arguments[r3].value) && t5.push(n3 + "." + e5.arguments[r3].value.toLowerCase());
  496. return false;
  497. }
  498. if (e5.callee.type === "Identifier" && ["domainname", "domaincode", "domain", "haskey"].includes(e5.callee.name.toLowerCase()) && e5.arguments.length >= 2) {
  499. let n3 = "";
  500. return e5.arguments[0].type === "Identifier" && (n3 = e5.arguments[0].name.toLowerCase()), n3 && e5.arguments[1].type === "Literal" && a(e5.arguments[1].value) && t5.push(n3 + "." + e5.arguments[1].value.toLowerCase()), false;
  501. }
  502. }
  503. return e5.type !== "MemberExpression" || e5.object.type !== "Identifier" || (e5.computed === false && e5.object && e5.object.name && e5.property && e5.property.type === "Identifier" && e5.property.name ? t5.push(e5.object.name.toLowerCase() + "." + e5.property.name.toLowerCase()) : e5.object && e5.object.name && e5.property && e5.property.type === "Literal" && typeof e5.property.value == "string" && t5.push(e5.object.name.toLowerCase() + "." + e5.property.value.toString().toLowerCase()), false);
  504. }), t5;
  505. }
  506. function y(e4, t5) {
  507. const n3 = [];
  508. if (t5.params !== void 0 && t5.params !== null)
  509. for (let a2 = 0; a2 < t5.params.length; a2++)
  510. n3.push("any");
  511. return { name: e4, return: "any", params: n3 };
  512. }
  513. function x(e4, t5) {
  514. const n3 = { globalScope: t5.globalScope, localScope: {} };
  515. for (let a2 = 0; a2 < e4.params.length; a2++) {
  516. const t6 = e4.params[a2].name;
  517. n3.localScope[t6.toLowerCase()] = { type: "any" };
  518. }
  519. return c(e4.body, n3);
  520. }
  521. function N2(e4, t5, n3, a2) {
  522. const r3 = {};
  523. e4 == null && (e4 = {}), n3 == null && (n3 = {}), r3.infinity = { type: "any" }, r3.textformatting = { type: "any" }, r3.pi = { type: "any" };
  524. for (const i5 in t5)
  525. a2 === "sync" && t5[i5].min !== void 0 ? r3[i5] = { type: "FormulaFunction", signature: { min: t5[i5].min, max: t5[i5].max } } : a2 !== "sync" && t5[i5].fmin !== void 0 && (r3[i5] = { type: "FormulaFunction", signature: { min: t5[i5].fmin, max: t5[i5].fmax } });
  526. for (let i5 = 0; i5 < n3.length; i5++) {
  527. const e5 = n3[i5];
  528. r3[e5.name] = { type: "FormulaFunction", signature: e5 };
  529. }
  530. for (const i5 in e4)
  531. r3[i5] = e4[i5], r3[i5].type = "any";
  532. return r3;
  533. }
  534. function S(t5, n3, a2 = "async", r3 = e2) {
  535. const i5 = { globalScope: N2(n3.vars, r3, n3.customFunctions, a2), localScope: null };
  536. return c(t5.body[0].body, i5);
  537. }
  538. function E2(e4) {
  539. return e4.body[0].body.type !== "BlockStatement" ? "Invalid formula content." : m3(e4.body[0].body);
  540. }
  541. function b(e4, t5, n3) {
  542. let a2 = "";
  543. switch (t5) {
  544. case "SYNTAX":
  545. default:
  546. a2 = "Syntax Error: ";
  547. break;
  548. case "RUNTIME":
  549. a2 = "Runtime Error: ";
  550. }
  551. try {
  552. switch (e4.type) {
  553. case "IfStatement":
  554. switch (n3) {
  555. case "CANNOT_USE_ASSIGNMENT_IN_CONDITION":
  556. a2 += " Assignments not be made in logical tests";
  557. break;
  558. case "CANNOT_USE_NONBOOLEAN_IN_CONDITION":
  559. a2 += " Non Boolean used as Condition";
  560. }
  561. break;
  562. case "UpdateExpression":
  563. case "AssignmentExpression":
  564. switch (n3) {
  565. case "CANNOT_USE_ASSIGNMENT_IN_CONDITION":
  566. a2 += " Assignments not be made in logical tests";
  567. break;
  568. case "ASSIGNMENTTOVARSONLY":
  569. a2 += " Assignments can only be made to identifiers";
  570. }
  571. break;
  572. case "ExpressionStatement":
  573. a2 += " Assignments can only be made to identifiers";
  574. break;
  575. case "FunctionDeclaration":
  576. switch (n3) {
  577. case "GLOBALFUNCTIONSONLY":
  578. a2 += " Functions cannot be declared as variables";
  579. break;
  580. case "FUNCTIONMUSTHAVEIDENTIFIER":
  581. a2 += " Function Definition must have an identifier";
  582. }
  583. break;
  584. case "VariableDeclaration":
  585. a2 += " Only 1 variable can be declared at a time";
  586. break;
  587. case "VariableDeclarator":
  588. switch (n3) {
  589. case "FUNCTIONVARIABLEDECLARATOR":
  590. a2 += " Functions cannot be declared as variables";
  591. break;
  592. case "VARIABLEMUSTHAVEIDENTIFIER":
  593. a2 += " Variable Definition must have an identifier";
  594. }
  595. break;
  596. case "Identifier":
  597. a2 += " Identifier Not Found. ", a2 += e4.name;
  598. break;
  599. case "ObjectExpression":
  600. if (n3 === "OBJECTPROPERTYMUSTBESTRING")
  601. a2 += " Property name must be a string";
  602. break;
  603. case "ForStatement":
  604. if (n3 === "CANNOT_USE_NONBOOLEAN_IN_CONDITION")
  605. a2 += " Non Boolean used as Condition";
  606. break;
  607. case "ForInStatement":
  608. switch (n3) {
  609. case "ONLY1VAR":
  610. a2 += " Can only declare 1 var for use with IN";
  611. break;
  612. case "CANNOTDECLAREVAL":
  613. a2 += " Can only declare value for use with IN";
  614. break;
  615. case "LEFTNOVAR":
  616. a2 += "Must provide a variable to iterate with.";
  617. break;
  618. case "VARIABLENOTDECLARED":
  619. a2 += "Variable must be declared before it is used..";
  620. break;
  621. case "CANNOTITERATETHISTYPE":
  622. a2 += "This type cannot be used in an IN loop";
  623. }
  624. break;
  625. case "MemberExpression":
  626. switch (n3) {
  627. case "PROPERTYNOTFOUND":
  628. a2 += "Cannot find member property. ", a2 += e4.computed === false && e4.property.type === "Identifier" ? e4.property.name : "";
  629. break;
  630. case "OUTOFBOUNDS":
  631. a2 += "Out of Bounds. ", a2 += e4.computed === false && e4.property.type === "Identifier" ? e4.property.name : "";
  632. break;
  633. case "NOTFOUND":
  634. a2 += "Cannot call member method on null. ", a2 += e4.computed === false && e4.property.type === "Identifier" ? e4.property.name : "";
  635. break;
  636. case "INVALIDTYPE":
  637. a2 += "Cannot call member property on object of this type. ", a2 += e4.computed === false && e4.property.type === "Identifier" ? e4.property.name : "";
  638. }
  639. break;
  640. case "Property":
  641. if (n3 === "ONLYLITERAL")
  642. a2 += "Property names must be literals or identifiers";
  643. break;
  644. case "Literal":
  645. break;
  646. case "CallExpression":
  647. switch (n3) {
  648. case "WRONGSIGNATURE":
  649. a2 += "Function signature does not match: ", a2 += e4.callee.type === "Identifier" ? e4.callee.name : "";
  650. break;
  651. case "ONLYNODESUPPORTED":
  652. a2 += "Functions must be declared.", a2 += e4.callee.type === "Identifier" ? e4.callee.name : "";
  653. break;
  654. case "NOTAFUNCTION":
  655. a2 += "Not a Function: ", a2 += e4.callee.type === "Identifier" ? e4.callee.name : "";
  656. break;
  657. case "NOTFOUND":
  658. a2 += "Function Not Found: " + (e4.callee.type === "Identifier" ? e4.callee.name : "");
  659. }
  660. break;
  661. case "UnaryExpression":
  662. switch (n3) {
  663. case "NOTSUPPORTEDUNARYOPERATOR":
  664. a2 += "Operator " + e4.operator + " not allowed in this context. Only ! can be used with boolean, and - with a number";
  665. break;
  666. case "NOTSUPPORTEDTYPE":
  667. a2 += "Unary operator " + e4.operator + " cannot be used with this argument.";
  668. }
  669. case "BinaryExpression":
  670. if (n3 === "OPERATORNOTRECOGNISED")
  671. a2 += "Binary Operator not recognised " + e4.operator;
  672. break;
  673. case "LogicalExpression":
  674. switch (n3) {
  675. case "ONLYBOOLEAN":
  676. a2 += "Operator " + e4.operator + " cannot be used. Only || or && are allowed values";
  677. break;
  678. case "ONLYORORAND":
  679. a2 += "Logical Expression " + e4.operator + " being applied to parameters that are not boolean.";
  680. }
  681. break;
  682. case "ArrayExpression":
  683. if (n3 === "FUNCTIONCONTEXTILLEGAL")
  684. a2 += " Cannot Put Function inside Array.";
  685. break;
  686. default:
  687. a2 += "Expression contains unrecognised code structures.";
  688. }
  689. } catch (r3) {
  690. throw r3;
  691. }
  692. return a2;
  693. }
  694. function g(e4, t5, n3) {
  695. return { line: e4.loc.start.line, character: e4.loc.start.column, reason: b(e4, t5, n3) };
  696. }
  697. function T(e4, t5, n3, a2) {
  698. const r3 = { globalScope: t5.globalScope, localScope: {} };
  699. for (let i5 = 0; i5 < e4.params.length; i5++) {
  700. const t6 = e4.params[i5].name;
  701. r3.localScope[t6.toLowerCase()] = { type: "any" };
  702. }
  703. O2(e4.body, r3, n3, a2, false);
  704. }
  705. function O2(e4, t5, n3, a2, r3 = true) {
  706. if (e4 === null)
  707. throw new Error("Unnexpexted Expression Syntax");
  708. let i5 = null;
  709. try {
  710. switch (e4.type) {
  711. case "VariableDeclarator":
  712. return e4.id.type !== "Identifier" ? a2.push(g(e4, "SYNTAX", "VARIABLEMUSTHAVEIDENTIFIER")) : (t5.localScope !== null ? t5.localScope[e4.id.name.toLowerCase()] : t5.globalScope[e4.id.name.toLowerCase()], t5.localScope === null ? t5.globalScope[e4.id.name.toLowerCase()] = { type: "any" } : t5.localScope[e4.id.name.toLowerCase()] = { type: "any" }), void (e4.init !== null && O2(e4.init, t5, n3, a2, r3));
  713. case "FunctionDeclaration":
  714. return r3 === false && a2.push(g(e4, "SYNTAX", "GLOBALFUNCTIONSONLY")), e4.id.type !== "Identifier" && a2.push(g(e4, "SYNTAX", "FUNCTIONMUSTHAVEIDENTIFIER")), i5 = y("", e4), T(e4, t5, n3, a2), t5.localScope !== null && a2.push(g(e4, "SYNTAX", "GLOBALFUNCTIONSONLY")), i5.isnative = false, void (e4.id.type === "Identifier" && (t5.globalScope[e4.id.name.toLowerCase()] = { type: "FormulaFunction", signature: [i5] }));
  715. case "VariableDeclaration":
  716. for (let i6 = 0; i6 < e4.declarations.length; i6++)
  717. O2(e4.declarations[i6], t5, n3, a2, r3);
  718. return;
  719. case "IfStatement":
  720. return e4.test !== null && (O2(e4.test, t5, n3, a2, r3), e4.test.type !== "AssignmentExpression" && e4.test.type !== "UpdateExpression" || a2.push(g(e4.test, "SYNTAX", "CANNOT_USE_ASSIGNMENT_IN_CONDITION"))), e4.consequent !== null && O2(e4.consequent, t5, n3, a2, r3), void (e4.alternate !== null && O2(e4.alternate, t5, n3, a2, r3));
  721. case "EmptyStatement":
  722. case "BreakStatement":
  723. case "ContinueStatement":
  724. case "Literal":
  725. case "TemplateElement":
  726. return;
  727. case "BlockStatement":
  728. if (e4.body !== null)
  729. for (let i6 = 0; i6 < e4.body.length; i6++)
  730. O2(e4.body[i6], t5, n3, a2, r3);
  731. return;
  732. case "ReturnStatement":
  733. return void (e4.argument !== null && O2(e4.argument, t5, n3, a2, r3));
  734. case "ForInStatement":
  735. return e4.left.type === "VariableDeclaration" ? (e4.left.declarations.length > 1 && a2.push(g(e4, "SYNTAX", "ONLY1VAR")), e4.left.declarations[0].init !== null && a2.push(g(e4, "SYNTAX", "CANNOTDECLAREVAL"))) : e4.left.type !== "Identifier" && a2.push(g(e4, "SYNTAX", "LEFTNOTVAR")), O2(e4.left, t5, n3, a2, r3), O2(e4.right, t5, n3, a2, r3), void O2(e4.body, t5, n3, a2, r3);
  736. case "ForStatement":
  737. return e4.init !== null && O2(e4.init, t5, n3, a2, r3), e4.test !== null && O2(e4.test, t5, n3, a2, r3), e4.body !== null && O2(e4.body, t5, n3, a2, r3), void (e4.update !== null && O2(e4.update, t5, n3, a2, r3));
  738. case "UpdateExpression":
  739. if (e4.argument.type !== "Identifier" && e4.argument.type !== "MemberExpression")
  740. a2.push(g(e4, "SYNTAX", "ASSIGNMENTTOVARSONLY"));
  741. else {
  742. if (e4.argument.type === "Identifier") {
  743. let r4 = false;
  744. n3 === false && (t5.localScope !== null && t5.localScope[e4.argument.name.toLowerCase()] !== void 0 && (r4 = true), t5.globalScope[e4.argument.name.toLowerCase()] !== void 0 && (r4 = true), r4 === false && a2.push({ line: e4 === null ? 0 : e4.loc.start.line, character: e4 === null ? 0 : e4.loc.start.column, reason: "Identifier " + e4.argument.name + " has not been declared." }));
  745. }
  746. e4.argument.type === "MemberExpression" && O2(e4.argument, t5, n3, a2, r3);
  747. }
  748. return;
  749. case "AssignmentExpression": {
  750. switch (e4.left.type !== "Identifier" && e4.left.type !== "MemberExpression" && a2.push(g(e4, "SYNTAX", "ASSIGNMENTTOVARSONLY")), e4.operator) {
  751. case "=":
  752. case "/=":
  753. case "*=":
  754. case "%=":
  755. case "+=":
  756. case "-=":
  757. break;
  758. default:
  759. a2.push(g(e4, "SYNTAX", "OPERATORNOTRECOGNISED"));
  760. }
  761. O2(e4.right, t5, n3, a2, r3);
  762. let i6 = false;
  763. return e4.left.type === "Identifier" && (t5.localScope !== null && t5.localScope[e4.left.name.toLowerCase()] !== void 0 && (i6 = true), t5.globalScope[e4.left.name.toLowerCase()] !== void 0 && (i6 = true), n3 === false && i6 === false && a2.push({ line: e4 === null ? 0 : e4.loc.start.line, character: e4 === null ? 0 : e4.loc.start.column, reason: "Identifier " + e4.left.name + " has not been declared." })), void (e4.left.type === "MemberExpression" && O2(e4.left, t5, n3, a2, r3));
  764. }
  765. case "ExpressionStatement":
  766. return e4.expression.type === "AssignmentExpression" || e4.expression.type, void O2(e4.expression, t5, n3, a2, r3);
  767. case "Identifier": {
  768. const r4 = e4.name.toLowerCase();
  769. if (t5.localScope !== null && t5.localScope[r4] !== void 0)
  770. return;
  771. if (t5.globalScope[r4] !== void 0)
  772. return;
  773. n3 === false && a2.push(g(e4, "SYNTAX", "VARIABLENOTFOUND"));
  774. break;
  775. }
  776. case "MemberExpression":
  777. return O2(e4.object, t5, n3, a2, r3), void (e4.computed === true && O2(e4.property, t5, n3, a2, r3));
  778. case "CallExpression":
  779. e4.callee.type !== "Identifier" && a2.push(g(e4, "SYNTAX", "ONLYNODESSUPPORTED"));
  780. for (let i6 = 0; i6 < e4.arguments.length; i6++)
  781. O2(e4.arguments[i6], t5, n3, a2, r3);
  782. if (e4.callee.type === "Identifier") {
  783. const r4 = s2(e4.callee.name, e4.arguments, t5);
  784. n3 === false && r4 === -1 && a2.push(g(e4, "SYNTAX", "NOTFOUND")), r4 === -2 && a2.push(g(e4, "SYNTAX", "WRONGSIGNATURE"));
  785. }
  786. return;
  787. case "UnaryExpression":
  788. return void O2(e4.argument, t5, n3, a2, r3);
  789. case "BinaryExpression":
  790. switch (O2(e4.left, t5, n3, a2, r3), O2(e4.right, t5, n3, a2, r3), e4.operator) {
  791. case "==":
  792. case "!=":
  793. case "<":
  794. case "<=":
  795. case ">":
  796. case ">=":
  797. case "+":
  798. case "-":
  799. case "*":
  800. case "/":
  801. case "%":
  802. case "&":
  803. case "|":
  804. case "^":
  805. case "<<":
  806. case ">>":
  807. case ">>>":
  808. break;
  809. default:
  810. a2.push(g(e4, "SYNTAX", "OPERATORNOTRECOGNISED"));
  811. }
  812. return;
  813. case "LogicalExpression":
  814. switch (e4.operator) {
  815. case "&&":
  816. case "||":
  817. break;
  818. default:
  819. a2.push(g(e4, "SYNTAX", "OPERATORNOTRECOGNISED"));
  820. }
  821. return O2(e4.left, t5, n3, a2, r3), e4.left.type !== "AssignmentExpression" && e4.left.type !== "UpdateExpression" || a2.push(g(e4, "SYNTAX", "CANNOT_USE_ASSIGNMENT_IN_CONDITION")), O2(e4.right, t5, n3, a2, r3), void (e4.right.type !== "AssignmentExpression" && e4.right.type !== "UpdateExpression" || a2.push(g(e4, "SYNTAX", "CANNOT_USE_ASSIGNMENT_IN_CONDITION")));
  822. case "ArrayExpression":
  823. for (let i6 = 0; i6 < e4.elements.length; i6++)
  824. O2(e4.elements[i6], t5, n3, a2, r3);
  825. return;
  826. case "TemplateLiteral":
  827. for (let i6 = 0; i6 < e4.quasis.length; i6++)
  828. O2(e4.quasis[i6], t5, n3, a2, r3);
  829. for (let i6 = 0; i6 < e4.expressions.length; i6++)
  830. O2(e4.expressions[i6], t5, n3, a2, r3);
  831. return;
  832. case "ObjectExpression":
  833. for (let i6 = 0; i6 < e4.properties.length; i6++)
  834. O2(e4.properties[i6], t5, n3, a2, r3);
  835. return;
  836. case "Property":
  837. return e4.key.type !== "Literal" && e4.key.type !== "Identifier" && a2.push(g(e4, "SYNTAX", "ONLYLITERAL")), e4.key.type === "Literal" && O2(e4.key, t5, n3, a2, r3), void O2(e4.value, t5, n3, a2, r3);
  838. default:
  839. a2.push(g(e4, "SYNTAX", "UNRECOGNISED"));
  840. }
  841. return;
  842. } catch (o4) {
  843. a2.push({ line: e4 === null ? 0 : e4.loc.start.line, character: e4 === null ? 0 : e4.loc.start.column, reason: "Unnexpected Syntax" });
  844. }
  845. }
  846. function A(t5, n3, a2, r3 = "async", i5 = e2) {
  847. const s4 = [];
  848. if (t5.body[0].body.type !== "BlockStatement")
  849. return [{ line: 0, character: 0, reason: "Invalid Body" }];
  850. n3 == null && (n3 = { vars: {}, customFunctions: [] });
  851. const o4 = { globalScope: N2(n3.vars, i5, n3.customFunctions, r3), localScope: null };
  852. try {
  853. O2(t5.body[0].body, o4, a2, s4);
  854. } catch (l6) {
  855. }
  856. return s4;
  857. }
  858. function I2(e4) {
  859. const t5 = [];
  860. return l3(e4, (e5) => (e5.type === "CallExpression" && e5.callee.type === "Identifier" && t5.push(e5.callee.name.toLowerCase()), true)), t5;
  861. }
  862. function h(e4, a2 = []) {
  863. let r3 = null;
  864. if (e4.usesFeatureSet === void 0) {
  865. r3 === null && (r3 = I2(e4)), e4.usesFeatureSet = false;
  866. for (let n3 = 0; n3 < r3.length; n3++)
  867. t3.includes(r3[n3]) && (e4.usesFeatureSet = true, e4.isAsync = true);
  868. if (e4.usesFeatureSet === false && a2 && a2.length > 0) {
  869. for (const t5 of a2)
  870. if (p4(e4, t5)) {
  871. e4.usesFeatureSet = true, e4.isAsync = true;
  872. break;
  873. }
  874. }
  875. }
  876. if (e4.usesGeometry === void 0) {
  877. e4.usesGeometry = false, r3 === null && (r3 = I2(e4));
  878. for (let t5 = 0; t5 < r3.length; t5++)
  879. n.includes(r3[t5]) && (e4.usesGeometry = true);
  880. }
  881. }
  882. function C2(e4) {
  883. }
  884. // node_modules/@arcgis/core/chunks/array.js
  885. function w2(w5) {
  886. function m7(r3, t5) {
  887. if (t5 instanceof t2)
  888. return w5.arcadeCustomFunctionHandler(t5);
  889. if (t5 instanceof N)
  890. return (...n3) => t5.fn(r3, { preparsed: true, arguments: n3 });
  891. if (t5 instanceof M2)
  892. return (...n3) => {
  893. if (n3.length !== t5.paramCount)
  894. throw new Error("Invalid parameters");
  895. return t5.fn(...n3);
  896. };
  897. throw new Error("Invalid Parameter");
  898. }
  899. function g4(n3) {
  900. if (n3 instanceof t)
  901. return n3.toArray();
  902. if (L(n3))
  903. return n3;
  904. throw new Error("Invalid Parameter");
  905. }
  906. w5.functions.array = function(n3, r3) {
  907. return w5.standardFunction(n3, r3, function(n4, r4, a2) {
  908. G(a2, 1, 2);
  909. const u3 = ne(a2[0]);
  910. if (isNaN(u3) || Z(u3) === false)
  911. throw new Error("Invalid Parameter");
  912. const c3 = I(a2[1], null), s4 = new Array(u3);
  913. return s4.fill(c3), s4;
  914. });
  915. }, w5.functions.front = function(n3, r3) {
  916. return w5.standardFunction(n3, r3, function(n4, r4, o4) {
  917. if (G(o4, 1, 1), E(o4[0])) {
  918. if (o4[0].length() <= 0)
  919. throw new Error("Array is empty");
  920. return o4[0].get(0);
  921. }
  922. if (L(o4[0])) {
  923. if (o4[0].length <= 0)
  924. throw new Error("Array is empty");
  925. return o4[0][0];
  926. }
  927. throw new Error("Invalid Parameter");
  928. });
  929. }, w5.functions.back = function(n3, r3) {
  930. return w5.standardFunction(n3, r3, function(n4, r4, o4) {
  931. if (G(o4, 1, 1), E(o4[0])) {
  932. if (o4[0].length() <= 0)
  933. throw new Error("Array is empty");
  934. return o4[0].get(o4[0].length() - 1);
  935. }
  936. if (L(o4[0])) {
  937. if (o4[0].length <= 0)
  938. throw new Error("Array is empty");
  939. return o4[0][o4[0].length - 1];
  940. }
  941. throw new Error("Invalid Parameter");
  942. });
  943. }, w5.functions.push = function(n3, r3) {
  944. return w5.standardFunction(n3, r3, function(n4, r4, o4) {
  945. if (G(o4, 1, 2), L(o4[0]))
  946. return o4[0][o4[0].length] = o4[1], o4[0].length;
  947. throw new Error("Invalid Parameter");
  948. });
  949. }, w5.functions.pop = function(n3, r3) {
  950. return w5.standardFunction(n3, r3, function(n4, r4, o4) {
  951. if (G(o4, 1, 1), L(o4[0])) {
  952. if (o4[0].length <= 0)
  953. throw new Error("Array is empty");
  954. const n5 = o4[0][o4[0].length - 1];
  955. return o4[0].length = o4[0].length - 1, n5;
  956. }
  957. throw new Error("Invalid Parameter");
  958. });
  959. }, w5.functions.erase = function(n3, r3) {
  960. return w5.standardFunction(n3, r3, function(n4, r4, i5) {
  961. if (G(i5, 2, 2), L(i5[0])) {
  962. let n5 = ne(i5[1]);
  963. if (isNaN(n5) || Z(n5) === false)
  964. throw new Error("Invalid Parameter");
  965. const r5 = i5[0];
  966. if (r5.length <= 0)
  967. throw new Error("Array is empty");
  968. if (n5 < 0 && (n5 = r5.length + n5), n5 < 0)
  969. throw new Error("Element not found");
  970. if (n5 >= r5.length)
  971. throw new Error("Index is greater than array");
  972. return r5.splice(n5, 1), j2;
  973. }
  974. throw new Error("Invalid Parameter");
  975. });
  976. }, w5.functions.insert = function(n3, r3) {
  977. return w5.standardFunction(n3, r3, function(n4, r4, i5) {
  978. if (G(i5, 3, 3), L(i5[0])) {
  979. const n5 = ne(i5[1]);
  980. if (isNaN(n5) || Z(n5) === false)
  981. throw new Error("Invalid Parameter");
  982. const r5 = i5[2], t5 = i5[0];
  983. if (n5 > t5.length)
  984. throw new Error("Index is greater than array");
  985. if (n5 < 0 && n5 < -1 * t5.length)
  986. throw new Error("Index is greater than array");
  987. return n5 === t5.length ? (t5[n5] = r5, j2) : (t5.splice(n5, 0, r5), j2);
  988. }
  989. throw new Error("Invalid Parameter");
  990. });
  991. }, w5.functions.resize = function(n3, r3) {
  992. return w5.standardFunction(n3, r3, function(n4, r4, a2) {
  993. if (G(a2, 2, 3), L(a2[0])) {
  994. const n5 = ne(a2[1]);
  995. if (isNaN(n5) || Z(n5) === false)
  996. throw new Error("Invalid Parameter");
  997. if (n5 < 0)
  998. throw new Error("Size cannot be negative");
  999. const r5 = I(a2[2], null), t5 = a2[0];
  1000. if (t5.length >= n5)
  1001. return t5.length = n5, j2;
  1002. const u3 = t5.length;
  1003. t5.length = n5;
  1004. for (let o4 = u3; o4 < t5.length; o4++)
  1005. t5[o4] = r5;
  1006. return j2;
  1007. }
  1008. throw new Error("Invalid Parameter");
  1009. });
  1010. }, w5.functions.includes = function(n3, r3) {
  1011. return w5.standardFunction(n3, r3, function(n4, r4, o4) {
  1012. if (G(o4, 2, 2), L(o4[0])) {
  1013. const n5 = o4[1];
  1014. return o4[0].findIndex((r5) => Q(r5, n5)) > -1;
  1015. }
  1016. if (E(o4[0])) {
  1017. const n5 = o4[1];
  1018. return o4[0].toArray().findIndex((r5) => Q(r5, n5)) > -1;
  1019. }
  1020. throw new Error("Invalid Parameter");
  1021. });
  1022. }, w5.functions.slice = function(n3, r3) {
  1023. return w5.standardFunction(n3, r3, function(n4, r4, c3) {
  1024. if (G(c3, 1, 3), L(c3[0])) {
  1025. const n5 = ne(I(c3[1], 0)), r5 = ne(I(c3[2], c3[0].length));
  1026. if (isNaN(n5) || Z(n5) === false)
  1027. throw new Error("Invalid Parameter");
  1028. if (isNaN(r5) || Z(r5) === false)
  1029. throw new Error("Invalid Parameter");
  1030. return c3[0].slice(n5, r5);
  1031. }
  1032. if (E(c3[0])) {
  1033. const n5 = c3[0], r5 = ne(I(c3[1], 0)), t5 = ne(I(c3[2], n5.length()));
  1034. if (isNaN(r5) || Z(r5) === false)
  1035. throw new Error("Invalid Parameter");
  1036. if (isNaN(t5) || Z(t5) === false)
  1037. throw new Error("Invalid Parameter");
  1038. return n5.toArray().slice(r5, t5);
  1039. }
  1040. throw new Error("Invalid Parameter");
  1041. });
  1042. }, w5.functions.splice = function(n3, r3) {
  1043. return w5.standardFunction(n3, r3, function(n4, r4, t5) {
  1044. const o4 = [];
  1045. for (let e4 = 0; e4 < t5.length; e4++)
  1046. L(t5[e4]) ? o4.push(...t5[e4]) : E(t5[e4]) ? o4.push(...t5[e4].toArray()) : o4.push(t5[e4]);
  1047. return o4;
  1048. });
  1049. }, w5.mode === "sync" && (w5.functions.any = function(n3, r3) {
  1050. return w5.standardFunction(n3, r3, function(r4, o4, e4) {
  1051. G(e4, 2, 2);
  1052. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1053. for (const n4 of a2) {
  1054. const r5 = i5(n4);
  1055. if (_(r5) && r5 === true)
  1056. return true;
  1057. }
  1058. return false;
  1059. });
  1060. }, w5.functions.all = function(n3, r3) {
  1061. return w5.standardFunction(n3, r3, function(r4, o4, e4) {
  1062. G(e4, 2, 2);
  1063. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1064. for (const n4 of a2) {
  1065. if (i5(n4) !== true)
  1066. return false;
  1067. }
  1068. return true;
  1069. });
  1070. }, w5.functions.none = function(n3, r3) {
  1071. return w5.standardFunction(n3, r3, function(r4, o4, e4) {
  1072. G(e4, 2, 2);
  1073. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1074. for (const n4 of a2) {
  1075. if (i5(n4) === true)
  1076. return false;
  1077. }
  1078. return true;
  1079. });
  1080. }, w5.functions.reduce = function(n3, r3) {
  1081. return w5.standardFunction(n3, r3, function(r4, o4, e4) {
  1082. G(e4, 2, 3);
  1083. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1084. return e4.length === 2 ? a2.length === 0 ? null : a2.reduce((n4, r5) => {
  1085. const t5 = i5(n4, r5);
  1086. return n4 = t5 !== void 0 && t5 !== j2 ? t5 : null;
  1087. }) : a2.reduce((n4, r5) => {
  1088. const t5 = i5(n4, r5);
  1089. return n4 = t5 !== void 0 && t5 !== j2 ? t5 : null;
  1090. }, e4[2]);
  1091. });
  1092. }, w5.functions.map = function(n3, r3) {
  1093. return w5.standardFunction(n3, r3, function(r4, o4, e4) {
  1094. G(e4, 2, 2);
  1095. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]), u3 = [];
  1096. for (const n4 of a2) {
  1097. const r5 = i5(n4);
  1098. r5 !== void 0 && r5 !== j2 ? u3.push(r5) : u3.push(null);
  1099. }
  1100. return u3;
  1101. });
  1102. }, w5.functions.filter = function(n3, r3) {
  1103. return w5.standardFunction(n3, r3, function(r4, o4, e4) {
  1104. G(e4, 2, 2);
  1105. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]), u3 = [];
  1106. for (const n4 of a2) {
  1107. i5(n4) === true && u3.push(n4);
  1108. }
  1109. return u3;
  1110. });
  1111. }), w5.mode === "async" && (w5.functions.any = function(n3, r3) {
  1112. return w5.standardFunctionAsync(n3, r3, async function(r4, o4, e4) {
  1113. G(e4, 2, 2);
  1114. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1115. for (const n4 of a2) {
  1116. const r5 = await i5(n4);
  1117. let t5 = null;
  1118. if (t5 = k(t5) ? await r5 : r5, _(t5) && t5 === true)
  1119. return true;
  1120. }
  1121. return false;
  1122. });
  1123. }, w5.functions.all = function(n3, r3) {
  1124. return w5.standardFunctionAsync(n3, r3, async function(r4, o4, e4) {
  1125. G(e4, 2, 2);
  1126. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1127. for (const n4 of a2) {
  1128. const r5 = await i5(n4);
  1129. let t5 = null;
  1130. if (t5 = k(t5) ? await r5 : r5, t5 !== true)
  1131. return false;
  1132. }
  1133. return true;
  1134. });
  1135. }, w5.functions.none = function(n3, r3) {
  1136. return w5.standardFunctionAsync(n3, r3, async function(r4, o4, e4) {
  1137. G(e4, 2, 2);
  1138. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]);
  1139. for (const n4 of a2) {
  1140. const r5 = await i5(n4);
  1141. let t5 = null;
  1142. if (t5 = k(t5) ? await r5 : r5, t5 === true)
  1143. return false;
  1144. }
  1145. return true;
  1146. });
  1147. }, w5.functions.filter = function(n3, r3) {
  1148. return w5.standardFunctionAsync(n3, r3, async function(r4, o4, e4) {
  1149. G(e4, 2, 2);
  1150. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]), u3 = [];
  1151. for (const n4 of a2) {
  1152. const r5 = await i5(n4);
  1153. let t5 = null;
  1154. t5 = k(t5) ? await r5 : r5, t5 === true && u3.push(n4);
  1155. }
  1156. return u3;
  1157. });
  1158. }, w5.functions.reduce = function(n3, r3) {
  1159. return w5.standardFunctionAsync(n3, r3, function(r4, o4, e4) {
  1160. G(e4, 2, 3);
  1161. const a2 = m7(n3, e4[1]), u3 = g4(e4[0]);
  1162. let s4 = null;
  1163. if (e4.length > 2) {
  1164. const n4 = I(e4[2], null);
  1165. s4 = u3.reduce(async (n5, r5) => {
  1166. let t5 = await n5;
  1167. return t5 !== void 0 && t5 !== j2 || (t5 = null), a2(t5, r5);
  1168. }, Promise.resolve(n4));
  1169. } else {
  1170. if (u3.length === 0)
  1171. return null;
  1172. s4 = u3.reduce(async (n4, r5, t5) => {
  1173. if (t5 <= 1)
  1174. return a2(n4, r5);
  1175. let o5 = await n4;
  1176. return o5 !== void 0 && o5 !== j2 || (o5 = null), a2(o5, r5);
  1177. });
  1178. }
  1179. return s4.then((n4) => n4 !== void 0 && n4 !== j2 ? n4 : null);
  1180. });
  1181. }, w5.functions.map = function(n3, r3) {
  1182. return w5.standardFunctionAsync(n3, r3, async function(r4, o4, e4) {
  1183. G(e4, 2, 2);
  1184. const i5 = m7(n3, e4[1]), a2 = g4(e4[0]), u3 = [];
  1185. for (const n4 of a2) {
  1186. const r5 = await i5(n4);
  1187. let t5 = null;
  1188. t5 = k(t5) ? await r5 : r5, t5 !== void 0 && t5 !== j2 ? u3.push(t5) : u3.push(null);
  1189. }
  1190. return u3;
  1191. });
  1192. });
  1193. }
  1194. var m4 = Object.freeze(Object.defineProperty({ __proto__: null, registerFunctions: w2 }, Symbol.toStringTag, { value: "Module" }));
  1195. // node_modules/@arcgis/core/arcade/functions/date.js
  1196. function f3(e4) {
  1197. const n3 = new Date(e4.getTime()), t5 = n3.getFullYear(), r3 = new Date(0);
  1198. r3.setFullYear(t5 + 1, 0, 4), r3.setHours(0, 0, 0, 0);
  1199. const u3 = g2(r3), s4 = new Date(0);
  1200. s4.setFullYear(t5, 0, 4), s4.setHours(0, 0, 0, 0);
  1201. const o4 = g2(s4);
  1202. return n3.getTime() >= u3.getTime() ? t5 + 1 : n3.getTime() >= o4.getTime() ? t5 : t5 - 1;
  1203. }
  1204. function g2(e4) {
  1205. const n3 = 1, t5 = new Date(e4.getTime()), r3 = t5.getDay(), u3 = (r3 < n3 ? 7 : 0) + r3 - n3;
  1206. return t5.setDate(t5.getDate() - u3), t5.setHours(0, 0, 0, 0), t5;
  1207. }
  1208. function d6(e4) {
  1209. const n3 = f3(e4), t5 = new Date(0);
  1210. t5.setFullYear(n3, 0, 4), t5.setHours(0, 0, 0, 0);
  1211. return g2(t5);
  1212. }
  1213. function m5(e4, n3, t5) {
  1214. return e4 + (h2(t5) ? D : N3)[n3];
  1215. }
  1216. function h2(e4) {
  1217. return e4 % 4 == 0 && (e4 % 100 != 0 || e4 % 400 == 0);
  1218. }
  1219. var N3 = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
  1220. var D = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
  1221. function w3(e4) {
  1222. return e4 === null ? e4 : isNaN(e4.getTime()) ? null : e4;
  1223. }
  1224. function y2(h4, N6) {
  1225. h4.today = function(n3, t5) {
  1226. return N6(n3, t5, function(n4, t6, r3) {
  1227. G(r3, 0, 0);
  1228. const u3 = new Date();
  1229. return u3.setHours(0, 0, 0, 0), u3;
  1230. });
  1231. }, h4.now = function(n3, t5) {
  1232. return N6(n3, t5, function(n4, t6, r3) {
  1233. G(r3, 0, 0);
  1234. return new Date();
  1235. });
  1236. }, h4.timestamp = function(n3, t5) {
  1237. return N6(n3, t5, function(n4, t6, r3) {
  1238. G(r3, 0, 0);
  1239. let u3 = new Date();
  1240. return u3 = new Date(u3.getUTCFullYear(), u3.getUTCMonth(), u3.getUTCDate(), u3.getUTCHours(), u3.getUTCMinutes(), u3.getUTCSeconds(), u3.getUTCMilliseconds()), u3;
  1241. });
  1242. }, h4.toutc = function(t5, r3) {
  1243. return N6(t5, r3, function(t6, r4, u3) {
  1244. G(u3, 1, 1);
  1245. const s4 = re(u3[0]);
  1246. return s4 === null ? null : new Date(s4.getUTCFullYear(), s4.getUTCMonth(), s4.getUTCDate(), s4.getUTCHours(), s4.getUTCMinutes(), s4.getUTCSeconds(), s4.getUTCMilliseconds());
  1247. });
  1248. }, h4.tolocal = function(t5, r3) {
  1249. return N6(t5, r3, function(t6, r4, u3) {
  1250. G(u3, 1, 1);
  1251. const s4 = re(u3[0]);
  1252. return s4 === null ? null : DateTime.utc(s4.getFullYear(), s4.getMonth() + 1, s4.getDate(), s4.getHours(), s4.getMinutes(), s4.getSeconds(), s4.getMilliseconds()).toJSDate();
  1253. });
  1254. }, h4.day = function(t5, r3) {
  1255. return N6(t5, r3, function(t6, r4, u3) {
  1256. G(u3, 1, 1);
  1257. const s4 = re(u3[0]);
  1258. return s4 === null ? NaN : s4.getDate();
  1259. });
  1260. }, h4.month = function(t5, r3) {
  1261. return N6(t5, r3, function(t6, r4, u3) {
  1262. G(u3, 1, 1);
  1263. const s4 = re(u3[0]);
  1264. return s4 === null ? NaN : s4.getMonth();
  1265. });
  1266. }, h4.year = function(t5, r3) {
  1267. return N6(t5, r3, function(t6, r4, u3) {
  1268. G(u3, 1, 1);
  1269. const s4 = re(u3[0]);
  1270. return s4 === null ? NaN : s4.getFullYear();
  1271. });
  1272. }, h4.hour = function(t5, r3) {
  1273. return N6(t5, r3, function(t6, r4, u3) {
  1274. G(u3, 1, 1);
  1275. const s4 = re(u3[0]);
  1276. return s4 === null ? NaN : s4.getHours();
  1277. });
  1278. }, h4.second = function(t5, r3) {
  1279. return N6(t5, r3, function(t6, r4, u3) {
  1280. G(u3, 1, 1);
  1281. const s4 = re(u3[0]);
  1282. return s4 === null ? NaN : s4.getSeconds();
  1283. });
  1284. }, h4.millisecond = function(t5, r3) {
  1285. return N6(t5, r3, function(t6, r4, u3) {
  1286. G(u3, 1, 1);
  1287. const s4 = re(u3[0]);
  1288. return s4 === null ? NaN : s4.getMilliseconds();
  1289. });
  1290. }, h4.minute = function(t5, r3) {
  1291. return N6(t5, r3, function(t6, r4, u3) {
  1292. G(u3, 1, 1);
  1293. const s4 = re(u3[0]);
  1294. return s4 === null ? NaN : s4.getMinutes();
  1295. });
  1296. }, h4.week = function(u3, s4) {
  1297. return N6(u3, s4, function(u4, s5, o4) {
  1298. G(o4, 1, 2);
  1299. const a2 = re(o4[0]);
  1300. if (a2 === null)
  1301. return NaN;
  1302. const c3 = ne(I(o4[1], 0));
  1303. if (c3 < 0 || c3 > 6)
  1304. throw new Error("Invalid Parameter");
  1305. const i5 = a2.getDate(), l6 = a2.getMonth(), f5 = a2.getFullYear(), g4 = a2.getDay(), d7 = m5(i5, l6, f5) - 1, h5 = Math.floor(d7 / 7);
  1306. return g4 - c3 + (g4 - c3 < 0 ? 7 : 0) < d7 - 7 * h5 ? h5 + 1 : h5;
  1307. });
  1308. }, h4.weekday = function(t5, r3) {
  1309. return N6(t5, r3, function(t6, r4, u3) {
  1310. G(u3, 1, 1);
  1311. const s4 = re(u3[0]);
  1312. return s4 === null ? NaN : s4.getDay();
  1313. });
  1314. }, h4.isoweekday = function(t5, r3) {
  1315. return N6(t5, r3, function(t6, r4, u3) {
  1316. G(u3, 1, 1);
  1317. const s4 = re(u3[0]);
  1318. if (s4 === null)
  1319. return NaN;
  1320. let o4 = s4.getDay();
  1321. return o4 === 0 && (o4 = 7), o4;
  1322. });
  1323. }, h4.isomonth = function(t5, r3) {
  1324. return N6(t5, r3, function(t6, r4, u3) {
  1325. G(u3, 1, 1);
  1326. const s4 = re(u3[0]);
  1327. return s4 === null ? NaN : s4.getMonth() + 1;
  1328. });
  1329. }, h4.isoweek = function(t5, r3) {
  1330. return N6(t5, r3, function(t6, r4, u3) {
  1331. G(u3, 1, 1);
  1332. const s4 = re(u3[0]);
  1333. if (s4 === null)
  1334. return NaN;
  1335. const o4 = g2(s4).getTime() - d6(s4).getTime();
  1336. return Math.round(o4 / 6048e5) + 1;
  1337. });
  1338. }, h4.isoyear = function(t5, r3) {
  1339. return N6(t5, r3, function(t6, r4, u3) {
  1340. G(u3, 1, 1);
  1341. const s4 = re(u3[0]);
  1342. return s4 === null ? NaN : f3(s4);
  1343. });
  1344. }, h4.date = function(r3, a2) {
  1345. return N6(r3, a2, function(r4, a3, c3) {
  1346. if (G(c3, 0, 7), c3.length === 3)
  1347. return w3(new Date(ne(c3[0]), ne(c3[1]), ne(c3[2]), 0, 0, 0, 0));
  1348. if (c3.length === 4)
  1349. return w3(new Date(ne(c3[0]), ne(c3[1]), ne(c3[2]), ne(c3[3]), 0, 0, 0));
  1350. if (c3.length === 5)
  1351. return w3(new Date(ne(c3[0]), ne(c3[1]), ne(c3[2]), ne(c3[3]), ne(c3[4]), 0, 0));
  1352. if (c3.length === 6)
  1353. return w3(new Date(ne(c3[0]), ne(c3[1]), ne(c3[2]), ne(c3[3]), ne(c3[4]), ne(c3[5]), 0));
  1354. if (c3.length === 7)
  1355. return w3(new Date(ne(c3[0]), ne(c3[1]), ne(c3[2]), ne(c3[3]), ne(c3[4]), ne(c3[5]), ne(c3[6])));
  1356. if (c3.length === 2) {
  1357. let e4, n3 = X(c3[1]);
  1358. return n3 === "" ? null : (n3 = $(n3), e4 = n3 === "X" ? DateTime.fromSeconds(ne(c3[0])) : n3 === "x" ? DateTime.fromMillis(ne(c3[0])) : DateTime.fromFormat(X(c3[0]), n3, { locale: l(), numberingSystem: "latn" }), e4.isValid ? e4.toJSDate() : null);
  1359. }
  1360. if (c3.length === 1) {
  1361. if (w(c3[0])) {
  1362. if (c3[0].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "") === "")
  1363. return null;
  1364. if (/^[0-9][0-9][0-9][0-9]$/.test(c3[0]) === true)
  1365. return re(c3[0] + "-01-01");
  1366. }
  1367. const e4 = ne(c3[0]);
  1368. if (isNaN(e4) === false)
  1369. return w3(new Date(e4));
  1370. return re(c3[0]);
  1371. }
  1372. return c3.length === 0 ? new Date() : void 0;
  1373. });
  1374. }, h4.datediff = function(n3, t5) {
  1375. return N6(n3, t5, function(n4, t6, r3) {
  1376. G(r3, 2, 3);
  1377. const s4 = ie(r3[0]), o4 = ie(r3[1]);
  1378. if (s4 === null || o4 === null)
  1379. return NaN;
  1380. switch (X(r3[2]).toLowerCase()) {
  1381. case "days":
  1382. case "day":
  1383. case "d":
  1384. return s4.diff(o4, "days").days;
  1385. case "months":
  1386. case "month":
  1387. return s4.diff(o4, "months").months;
  1388. case "minutes":
  1389. case "minute":
  1390. case "m":
  1391. return r3[2] === "M" ? s4.diff(o4, "months").months : s4.diff(o4, "minutes").minutes;
  1392. case "seconds":
  1393. case "second":
  1394. case "s":
  1395. return s4.diff(o4, "seconds").seconds;
  1396. case "milliseconds":
  1397. case "millisecond":
  1398. case "ms":
  1399. default:
  1400. return s4.diff(o4).milliseconds;
  1401. case "hours":
  1402. case "hour":
  1403. case "h":
  1404. return s4.diff(o4, "hours").hours;
  1405. case "years":
  1406. case "year":
  1407. case "y":
  1408. return s4.diff(o4, "years").years;
  1409. }
  1410. });
  1411. }, h4.dateadd = function(n3, r3) {
  1412. return N6(n3, r3, function(n4, r4, s4) {
  1413. G(s4, 2, 3);
  1414. const o4 = ie(s4[0]);
  1415. if (o4 === null)
  1416. return null;
  1417. let i5 = ne(s4[1]);
  1418. if (isNaN(i5))
  1419. return o4.toJSDate();
  1420. let l6 = "milliseconds";
  1421. switch (X(s4[2]).toLowerCase()) {
  1422. case "days":
  1423. case "day":
  1424. case "d":
  1425. l6 = "days", i5 = V(i5);
  1426. break;
  1427. case "months":
  1428. case "month":
  1429. l6 = "months", i5 = V(i5);
  1430. break;
  1431. case "minutes":
  1432. case "minute":
  1433. case "m":
  1434. l6 = s4[2] === "M" ? "months" : "minutes";
  1435. break;
  1436. case "seconds":
  1437. case "second":
  1438. case "s":
  1439. l6 = "seconds";
  1440. break;
  1441. case "milliseconds":
  1442. case "millisecond":
  1443. case "ms":
  1444. l6 = "milliseconds";
  1445. break;
  1446. case "hours":
  1447. case "hour":
  1448. case "h":
  1449. l6 = "hours";
  1450. break;
  1451. case "years":
  1452. case "year":
  1453. case "y":
  1454. l6 = "years";
  1455. }
  1456. return o4.plus({ [l6]: i5 }).toJSDate();
  1457. });
  1458. };
  1459. }
  1460. // node_modules/@arcgis/core/arcade/functions/geometry.js
  1461. function D2(e4) {
  1462. return e4 && e4.arcadeDeclaredClass === "esri.arcade.Feature";
  1463. }
  1464. function P4(P6, M5) {
  1465. P6.ringisclockwise = function(e4, r3) {
  1466. return M5(e4, r3, function(e5, r4, o4) {
  1467. G(o4, 1, 1);
  1468. let l6 = [], s4 = false, f5 = false;
  1469. if (o4[0] === null)
  1470. return false;
  1471. if (L(o4[0])) {
  1472. for (const e6 of o4[0]) {
  1473. if (!(e6 instanceof j))
  1474. throw new Error("Invalid Argument");
  1475. l6.push(e6.hasZ ? e6.hasM ? [e6.x, e6.y, e6.z, e6.m] : [e6.x, e6.y, e6.z] : [e6.x, e6.y]);
  1476. }
  1477. l6.length > 0 && (s4 = o4[0][0].hasZ, f5 = o4[0][0].hasM);
  1478. } else if (o4[0] instanceof i)
  1479. l6 = o4[0]._elements, l6.length > 0 && (s4 = o4[0]._hasZ, f5 = o4[0]._hasM);
  1480. else {
  1481. if (!E(o4[0]))
  1482. throw new Error("Invalid Argument");
  1483. for (const e6 of o4[0].toArray()) {
  1484. if (!(e6 instanceof j))
  1485. throw new Error("Invalid Argument");
  1486. l6.push(e6.hasZ ? e6.hasM ? [e6.x, e6.y, e6.z, e6.m] : [e6.x, e6.y, e6.z] : [e6.x, e6.y]);
  1487. }
  1488. l6.length > 0 && (s4 = o4[0].get(0).hasZ, f5 = o4[0].get(0).hasM);
  1489. }
  1490. return !(l6.length < 3) && f(l6, f5, s4);
  1491. });
  1492. }, P6.polygon = function(n3, i5) {
  1493. return M5(n3, i5, function(i6, a2, s4) {
  1494. G(s4, 1, 1);
  1495. let f5 = null;
  1496. if (s4[0] instanceof d2) {
  1497. if (f5 = se(d3.parseGeometryFromDictionary(s4[0]), n3.spatialReference), f5 instanceof v == false)
  1498. throw new Error("Illegal Parameter");
  1499. } else
  1500. f5 = s4[0] instanceof v ? d(s4[0].toJSON()) : se(new v(JSON.parse(s4[0])), n3.spatialReference);
  1501. if (f5 !== null && f5.spatialReference.equals(n3.spatialReference) === false)
  1502. throw new Error("Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.");
  1503. return ue(f5);
  1504. });
  1505. }, P6.polyline = function(n3, i5) {
  1506. return M5(n3, i5, function(i6, a2, s4) {
  1507. G(s4, 1, 1);
  1508. let f5 = null;
  1509. if (s4[0] instanceof d2) {
  1510. if (f5 = se(d3.parseGeometryFromDictionary(s4[0]), n3.spatialReference), f5 instanceof m2 == false)
  1511. throw new Error("Illegal Parameter");
  1512. } else
  1513. f5 = s4[0] instanceof m2 ? d(s4[0].toJSON()) : se(new m2(JSON.parse(s4[0])), n3.spatialReference);
  1514. if (f5 !== null && f5.spatialReference.equals(n3.spatialReference) === false)
  1515. throw new Error("Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.");
  1516. return ue(f5);
  1517. });
  1518. }, P6.point = function(n3, i5) {
  1519. return M5(n3, i5, function(i6, a2, s4) {
  1520. G(s4, 1, 1);
  1521. let f5 = null;
  1522. if (s4[0] instanceof d2) {
  1523. if (f5 = se(d3.parseGeometryFromDictionary(s4[0]), n3.spatialReference), f5 instanceof j == false)
  1524. throw new Error("Illegal Parameter");
  1525. } else
  1526. f5 = s4[0] instanceof j ? d(s4[0].toJSON()) : se(new j(JSON.parse(s4[0])), n3.spatialReference);
  1527. if (f5 !== null && f5.spatialReference.equals(n3.spatialReference) === false)
  1528. throw new Error("Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.");
  1529. return ue(f5);
  1530. });
  1531. }, P6.multipoint = function(n3, i5) {
  1532. return M5(n3, i5, function(i6, a2, s4) {
  1533. G(s4, 1, 1);
  1534. let f5 = null;
  1535. if (s4[0] instanceof d2) {
  1536. if (f5 = se(d3.parseGeometryFromDictionary(s4[0]), n3.spatialReference), f5 instanceof m == false)
  1537. throw new Error("Illegal Parameter");
  1538. } else
  1539. f5 = s4[0] instanceof m ? d(s4[0].toJSON()) : se(new m(JSON.parse(s4[0])), n3.spatialReference);
  1540. if (f5 !== null && f5.spatialReference.equals(n3.spatialReference) === false)
  1541. throw new Error("Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.");
  1542. return ue(f5);
  1543. });
  1544. }, P6.extent = function(n3, i5) {
  1545. return M5(n3, i5, function(i6, a2, f5) {
  1546. f5 = ye(f5), G(f5, 1, 1);
  1547. let c3 = null;
  1548. if (f5[0] instanceof d2)
  1549. c3 = se(d3.parseGeometryFromDictionary(f5[0]), n3.spatialReference);
  1550. else if (f5[0] instanceof j) {
  1551. const e4 = { xmin: f5[0].x, ymin: f5[0].y, xmax: f5[0].x, ymax: f5[0].y, spatialReference: f5[0].spatialReference.toJSON() }, r3 = f5[0];
  1552. r3.hasZ ? (e4.zmin = r3.z, e4.zmax = r3.z) : r3.hasM && (e4.mmin = r3.m, e4.mmax = r3.m), c3 = d(e4);
  1553. } else
  1554. c3 = f5[0] instanceof v || f5[0] instanceof m2 || f5[0] instanceof m ? d(f5[0].extent.toJSON()) : f5[0] instanceof M ? d(f5[0].toJSON()) : se(new M(JSON.parse(f5[0])), n3.spatialReference);
  1555. if (c3 !== null && c3.spatialReference.equals(n3.spatialReference) === false)
  1556. throw new Error("Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.");
  1557. return ue(c3);
  1558. });
  1559. }, P6.geometry = function(n3, i5) {
  1560. return M5(n3, i5, function(i6, a2, s4) {
  1561. G(s4, 1, 1);
  1562. let f5 = null;
  1563. if (s4[0] === null)
  1564. return null;
  1565. if (f5 = D2(s4[0]) ? se(s4[0].geometry(), n3.spatialReference) : s4[0] instanceof d2 ? se(d3.parseGeometryFromDictionary(s4[0]), n3.spatialReference) : se(d(JSON.parse(s4[0])), n3.spatialReference), f5 !== null && f5.spatialReference.equals(n3.spatialReference) === false)
  1566. throw new Error("Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.");
  1567. return ue(f5);
  1568. });
  1569. }, P6.setgeometry = function(e4, r3) {
  1570. return M5(e4, r3, function(e5, r4, n3) {
  1571. if (G(n3, 2, 2), !D2(n3[0]))
  1572. throw new Error("Illegal Argument");
  1573. if (n3[0].immutable === true)
  1574. throw new Error("Feature is Immutable");
  1575. if (!(n3[1] instanceof p || n3[1] === null))
  1576. throw new Error("Illegal Argument");
  1577. return n3[0]._geometry = n3[1], j2;
  1578. });
  1579. }, P6.feature = function(n3, t5) {
  1580. return M5(n3, t5, function(t6, i5, a2) {
  1581. if (a2.length === 0)
  1582. throw new Error("Missing Parameters");
  1583. let l6 = null;
  1584. if (a2.length === 1)
  1585. if (w(a2[0]))
  1586. l6 = d3.fromJson(JSON.parse(a2[0]));
  1587. else if (D2(a2[0]))
  1588. l6 = d3.createFromArcadeFeature(a2[0]);
  1589. else if (a2[0] instanceof p)
  1590. l6 = d3.createFromGraphicLikeObject(a2[0], null, null);
  1591. else {
  1592. if (!(a2[0] instanceof d2))
  1593. throw new Error("Illegal Argument");
  1594. {
  1595. let n4 = a2[0].hasField("geometry") ? a2[0].field("geometry") : null, t7 = a2[0].hasField("attributes") ? a2[0].field("attributes") : null;
  1596. n4 !== null && n4 instanceof d2 && (n4 = d3.parseGeometryFromDictionary(n4)), t7 !== null && (t7 = d3.parseAttributesFromDictionary(t7)), l6 = d3.createFromGraphicLikeObject(n4, t7, null);
  1597. }
  1598. }
  1599. else if (a2.length === 2) {
  1600. let n4 = null, t7 = null;
  1601. if (a2[0] !== null)
  1602. if (a2[0] instanceof p)
  1603. n4 = a2[0];
  1604. else {
  1605. if (!(n4 instanceof d2))
  1606. throw new Error("Illegal Argument");
  1607. n4 = d3.parseGeometryFromDictionary(a2[0]);
  1608. }
  1609. if (a2[1] !== null) {
  1610. if (!(a2[1] instanceof d2))
  1611. throw new Error("Illegal Argument");
  1612. t7 = d3.parseAttributesFromDictionary(a2[1]);
  1613. }
  1614. l6 = d3.createFromGraphicLikeObject(n4, t7, null);
  1615. } else {
  1616. let n4 = null;
  1617. const t7 = {};
  1618. if (a2[0] !== null)
  1619. if (a2[0] instanceof p)
  1620. n4 = a2[0];
  1621. else {
  1622. if (!(n4 instanceof d2))
  1623. throw new Error("Illegal Argument");
  1624. n4 = d3.parseGeometryFromDictionary(a2[0]);
  1625. }
  1626. for (let e4 = 1; e4 < a2.length; e4 += 2) {
  1627. const r3 = X(a2[e4]), n5 = a2[e4 + 1];
  1628. if (!(n5 == null || w(n5) || isNaN(n5) || z(n5) || O(n5) || _(n5)))
  1629. throw new Error("Illegal Argument");
  1630. if (v2(n5) || C(n5) === false)
  1631. throw new Error("Illegal Argument");
  1632. t7[r3] = n5 === j2 ? null : n5;
  1633. }
  1634. l6 = d3.createFromGraphicLikeObject(n4, t7, null);
  1635. }
  1636. return l6._geometry = se(l6.geometry(), n3.spatialReference), l6.immutable = false, l6;
  1637. });
  1638. }, P6.dictionary = function(r3, n3) {
  1639. return M5(r3, n3, function(r4, n4, t5) {
  1640. if (t5.length === 0) {
  1641. const r5 = new d2();
  1642. return r5.immutable = false, r5;
  1643. }
  1644. if (t5.length === 1 && w(t5[0]))
  1645. try {
  1646. const r5 = JSON.parse(t5[0]), n5 = d2.convertObjectToArcadeDictionary(r5, false);
  1647. return n5.immutable = false, n5;
  1648. } catch (s4) {
  1649. throw new Error("Missing Parameters or Illegal Json");
  1650. }
  1651. if (t5.length % 2 != 0)
  1652. throw new Error("Missing Parameters");
  1653. const o4 = {};
  1654. for (let e4 = 0; e4 < t5.length; e4 += 2) {
  1655. const r5 = X(t5[e4]), n5 = t5[e4 + 1];
  1656. if (!(n5 == null || w(n5) || isNaN(n5) || z(n5) || O(n5) || _(n5) || L(n5) || E(n5)))
  1657. throw new Error("Illegal Argument");
  1658. if (v2(n5))
  1659. throw new Error("Illegal Argument");
  1660. o4[r5] = n5 === j2 ? null : n5;
  1661. }
  1662. const l6 = new d2(o4);
  1663. return l6.immutable = false, l6;
  1664. });
  1665. }, P6.haskey = function(r3, n3) {
  1666. return M5(r3, n3, function(r4, n4, i5) {
  1667. G(i5, 2, 2);
  1668. const a2 = X(i5[1]);
  1669. if (D2(i5[0]))
  1670. return i5[0].hasField(a2);
  1671. if (i5[0] instanceof d2)
  1672. return i5[0].hasField(a2);
  1673. throw new Error("Illegal Argument");
  1674. });
  1675. }, P6.indexof = function(e4, r3) {
  1676. return M5(e4, r3, function(e5, r4, n3) {
  1677. G(n3, 2, 2);
  1678. const o4 = n3[1];
  1679. if (L(n3[0])) {
  1680. for (let e6 = 0; e6 < n3[0].length; e6++)
  1681. if (Q(o4, n3[0][e6]))
  1682. return e6;
  1683. return -1;
  1684. }
  1685. if (E(n3[0])) {
  1686. const e6 = n3[0].length();
  1687. for (let r5 = 0; r5 < e6; r5++)
  1688. if (Q(o4, n3[0].get(r5)))
  1689. return r5;
  1690. return -1;
  1691. }
  1692. throw new Error("Illegal Argument");
  1693. });
  1694. }, P6.angle = function(e4, r3) {
  1695. return M5(e4, r3, function(e5, r4, n3) {
  1696. if (n3 = ye(n3), G(n3, 2, 3), !(n3[0] instanceof j))
  1697. throw new Error("Illegal Argument");
  1698. if (!(n3[1] instanceof j))
  1699. throw new Error("Illegal Argument");
  1700. if (n3.length > 2 && !(n3[2] instanceof j))
  1701. throw new Error("Illegal Argument");
  1702. return n3.length === 2 ? p3(n3[0], n3[1]) : P3(n3[0], n3[1], n3[2]);
  1703. });
  1704. }, P6.bearing = function(e4, r3) {
  1705. return M5(e4, r3, function(e5, r4, n3) {
  1706. if (n3 = ye(n3), G(n3, 2, 3), !(n3[0] instanceof j))
  1707. throw new Error("Illegal Argument");
  1708. if (!(n3[1] instanceof j))
  1709. throw new Error("Illegal Argument");
  1710. if (n3.length > 2 && !(n3[2] instanceof j))
  1711. throw new Error("Illegal Argument");
  1712. return n3.length === 2 ? M3(n3[0], n3[1]) : d4(n3[0], n3[1], n3[2]);
  1713. });
  1714. }, P6.isselfintersecting = function(e4, r3) {
  1715. return M5(e4, r3, function(r4, n3, o4) {
  1716. o4 = ye(o4), G(o4, 1, 1);
  1717. let l6 = o4[0];
  1718. if (l6 instanceof v)
  1719. return l6.isSelfIntersecting;
  1720. if (l6 instanceof m2)
  1721. return l6 = l6.paths, Z2(l6);
  1722. if (l6 instanceof m) {
  1723. const e5 = l6.points;
  1724. for (let r5 = 0; r5 < e5.length; r5++)
  1725. for (let n4 = 0; n4 < e5.length; n4++)
  1726. if (n4 !== r5) {
  1727. let t5 = true;
  1728. for (let i5 = 0; i5 < e5[r5].length; i5++)
  1729. if (e5[r5][i5] !== e5[n4][i5]) {
  1730. t5 = false;
  1731. break;
  1732. }
  1733. if (t5 === true)
  1734. return true;
  1735. }
  1736. }
  1737. return !(!L(l6) && !E(l6)) && (l6 = he(l6, e4.spatialReference), l6 !== null && (l6 = l6.paths), Z2(l6));
  1738. });
  1739. };
  1740. }
  1741. // node_modules/@arcgis/core/arcade/functions/maths.js
  1742. function l4(n3, t5, r3) {
  1743. return r3 === void 0 || +r3 == 0 ? Math[n3](t5) : (t5 = +t5, r3 = +r3, isNaN(t5) || typeof r3 != "number" || r3 % 1 != 0 ? NaN : (t5 = t5.toString().split("e"), +((t5 = (t5 = Math[n3](+(t5[0] + "e" + (t5[1] ? +t5[1] - r3 : -r3)))).toString().split("e"))[0] + "e" + (t5[1] ? +t5[1] + r3 : r3))));
  1744. }
  1745. function N4(N6, h4) {
  1746. function m7(n3, t5, r3) {
  1747. const u3 = ne(n3);
  1748. return isNaN(u3) ? u3 : isNaN(t5) || isNaN(r3) || t5 > r3 ? NaN : u3 < t5 ? t5 : u3 > r3 ? r3 : u3;
  1749. }
  1750. N6.number = function(f5, a2) {
  1751. return h4(f5, a2, function(f6, a3, c3) {
  1752. G(c3, 1, 2);
  1753. const l6 = c3[0];
  1754. if (O(l6))
  1755. return l6;
  1756. if (l6 === null)
  1757. return 0;
  1758. if (z(l6))
  1759. return Number(l6);
  1760. if (_(l6))
  1761. return Number(l6);
  1762. if (L(l6))
  1763. return NaN;
  1764. if (l6 === "")
  1765. return Number(l6);
  1766. if (l6 === void 0)
  1767. return Number(l6);
  1768. if (w(l6)) {
  1769. if (c3[1] !== void 0) {
  1770. let n3 = F(c3[1], "\u2030", "");
  1771. return n3 = F(n3, "\xA4", ""), p2(l6, { pattern: n3 });
  1772. }
  1773. return Number(l6.trim());
  1774. }
  1775. return Number(l6);
  1776. });
  1777. }, N6.abs = function(t5, r3) {
  1778. return h4(t5, r3, function(t6, r4, u3) {
  1779. return G(u3, 1, 1), Math.abs(ne(u3[0]));
  1780. });
  1781. }, N6.acos = function(t5, r3) {
  1782. return h4(t5, r3, function(t6, r4, u3) {
  1783. return G(u3, 1, 1), Math.acos(ne(u3[0]));
  1784. });
  1785. }, N6.asin = function(t5, r3) {
  1786. return h4(t5, r3, function(t6, r4, u3) {
  1787. return G(u3, 1, 1), Math.asin(ne(u3[0]));
  1788. });
  1789. }, N6.atan = function(t5, r3) {
  1790. return h4(t5, r3, function(t6, r4, u3) {
  1791. return G(u3, 1, 1), Math.atan(ne(u3[0]));
  1792. });
  1793. }, N6.atan2 = function(t5, r3) {
  1794. return h4(t5, r3, function(t6, r4, u3) {
  1795. return G(u3, 2, 2), Math.atan2(ne(u3[0]), ne(u3[1]));
  1796. });
  1797. }, N6.ceil = function(t5, r3) {
  1798. return h4(t5, r3, function(t6, r4, u3) {
  1799. if (G(u3, 1, 2), u3.length === 2) {
  1800. let n3 = ne(u3[1]);
  1801. return isNaN(n3) && (n3 = 0), l4("ceil", ne(u3[0]), -1 * n3);
  1802. }
  1803. return Math.ceil(ne(u3[0]));
  1804. });
  1805. }, N6.round = function(t5, r3) {
  1806. return h4(t5, r3, function(t6, r4, u3) {
  1807. if (G(u3, 1, 2), u3.length === 2) {
  1808. let n3 = ne(u3[1]);
  1809. return isNaN(n3) && (n3 = 0), l4("round", ne(u3[0]), -1 * n3);
  1810. }
  1811. return Math.round(ne(u3[0]));
  1812. });
  1813. }, N6.floor = function(t5, r3) {
  1814. return h4(t5, r3, function(t6, r4, u3) {
  1815. if (G(u3, 1, 2), u3.length === 2) {
  1816. let n3 = ne(u3[1]);
  1817. return isNaN(n3) && (n3 = 0), l4("floor", ne(u3[0]), -1 * n3);
  1818. }
  1819. return Math.floor(ne(u3[0]));
  1820. });
  1821. }, N6.cos = function(t5, r3) {
  1822. return h4(t5, r3, function(t6, r4, u3) {
  1823. return G(u3, 1, 1), Math.cos(ne(u3[0]));
  1824. });
  1825. }, N6.isnan = function(t5, r3) {
  1826. return h4(t5, r3, function(t6, r4, u3) {
  1827. return G(u3, 1, 1), typeof u3[0] == "number" && isNaN(u3[0]);
  1828. });
  1829. }, N6.exp = function(t5, r3) {
  1830. return h4(t5, r3, function(t6, r4, u3) {
  1831. return G(u3, 1, 1), Math.exp(ne(u3[0]));
  1832. });
  1833. }, N6.log = function(t5, r3) {
  1834. return h4(t5, r3, function(t6, r4, u3) {
  1835. return G(u3, 1, 1), Math.log(ne(u3[0]));
  1836. });
  1837. }, N6.pow = function(t5, r3) {
  1838. return h4(t5, r3, function(t6, r4, u3) {
  1839. return G(u3, 2, 2), ne(u3[0]) ** ne(u3[1]);
  1840. });
  1841. }, N6.random = function(t5, r3) {
  1842. return h4(t5, r3, function(t6, r4, u3) {
  1843. return G(u3, 0, 0), Math.random();
  1844. });
  1845. }, N6.sin = function(t5, r3) {
  1846. return h4(t5, r3, function(t6, r4, u3) {
  1847. return G(u3, 1, 1), Math.sin(ne(u3[0]));
  1848. });
  1849. }, N6.sqrt = function(t5, r3) {
  1850. return h4(t5, r3, function(t6, r4, u3) {
  1851. return G(u3, 1, 1), Math.sqrt(ne(u3[0]));
  1852. });
  1853. }, N6.tan = function(t5, r3) {
  1854. return h4(t5, r3, function(t6, r4, u3) {
  1855. return G(u3, 1, 1), Math.tan(ne(u3[0]));
  1856. });
  1857. }, N6.defaultvalue = function(t5, r3) {
  1858. return h4(t5, r3, function(t6, r4, u3) {
  1859. return G(u3, 2, 2), u3[0] === null || u3[0] === "" || u3[0] === void 0 ? u3[1] : u3[0];
  1860. });
  1861. }, N6.isempty = function(t5, r3) {
  1862. return h4(t5, r3, function(t6, r4, u3) {
  1863. return G(u3, 1, 1), u3[0] === null || (u3[0] === "" || u3[0] === void 0);
  1864. });
  1865. }, N6.boolean = function(t5, r3) {
  1866. return h4(t5, r3, function(t6, r4, u3) {
  1867. G(u3, 1, 1);
  1868. const e4 = u3[0];
  1869. return oe(e4);
  1870. });
  1871. }, N6.constrain = function(t5, r3) {
  1872. return h4(t5, r3, function(t6, r4, u3) {
  1873. G(u3, 3, 3);
  1874. const i5 = ne(u3[1]), o4 = ne(u3[2]);
  1875. if (L(u3[0])) {
  1876. const n3 = [];
  1877. for (const t7 of u3[0])
  1878. n3.push(m7(t7, i5, o4));
  1879. return n3;
  1880. }
  1881. if (E(u3[0])) {
  1882. const n3 = [];
  1883. for (let t7 = 0; t7 < u3[0].length(); t7++)
  1884. n3.push(m7(u3[0].get(t7), i5, o4));
  1885. return n3;
  1886. }
  1887. return m7(u3[0], i5, o4);
  1888. });
  1889. };
  1890. }
  1891. // node_modules/@arcgis/core/arcade/functions/stats.js
  1892. function i3(n3, r3, i5, o4) {
  1893. if (o4.length === 1) {
  1894. if (L(o4[0]))
  1895. return l2(n3, o4[0], -1);
  1896. if (E(o4[0]))
  1897. return l2(n3, o4[0].toArray(), -1);
  1898. }
  1899. return l2(n3, o4, -1);
  1900. }
  1901. function o2(e4, o4) {
  1902. e4.stdev = function(n3, t5) {
  1903. return o4(n3, t5, function(n4, t6, r3) {
  1904. return i3("stdev", n4, t6, r3);
  1905. });
  1906. }, e4.variance = function(n3, t5) {
  1907. return o4(n3, t5, function(n4, t6, r3) {
  1908. return i3("variance", n4, t6, r3);
  1909. });
  1910. }, e4.average = function(n3, t5) {
  1911. return o4(n3, t5, function(n4, t6, r3) {
  1912. return i3("mean", n4, t6, r3);
  1913. });
  1914. }, e4.mean = function(n3, t5) {
  1915. return o4(n3, t5, function(n4, t6, r3) {
  1916. return i3("mean", n4, t6, r3);
  1917. });
  1918. }, e4.sum = function(n3, t5) {
  1919. return o4(n3, t5, function(n4, t6, r3) {
  1920. return i3("sum", n4, t6, r3);
  1921. });
  1922. }, e4.min = function(n3, t5) {
  1923. return o4(n3, t5, function(n4, t6, r3) {
  1924. return i3("min", n4, t6, r3);
  1925. });
  1926. }, e4.max = function(n3, t5) {
  1927. return o4(n3, t5, function(n4, t6, r3) {
  1928. return i3("max", n4, t6, r3);
  1929. });
  1930. }, e4.distinct = function(n3, t5) {
  1931. return o4(n3, t5, function(n4, t6, r3) {
  1932. return i3("distinct", n4, t6, r3);
  1933. });
  1934. }, e4.count = function(e5, i5) {
  1935. return o4(e5, i5, function(e6, i6, o5) {
  1936. if (G(o5, 1, 1), L(o5[0]) || w(o5[0]))
  1937. return o5[0].length;
  1938. if (E(o5[0]))
  1939. return o5[0].length();
  1940. throw new Error("Invalid Parameters for Count");
  1941. });
  1942. };
  1943. }
  1944. // node_modules/@arcgis/core/arcade/functions/convertdirection.js
  1945. var c2 = (e4) => (t5, r3, n3) => (n3 = n3 || 14, +e4(t5, r3).toFixed(n3));
  1946. var o3 = (e4, t5) => e4 + t5;
  1947. var u2 = (e4, t5) => e4 * t5;
  1948. var m6 = (e4, t5) => e4 / t5;
  1949. var l5 = (e4, t5, r3) => c2(o3)(e4, t5, r3);
  1950. var g3 = (e4, t5, r3) => c2(u2)(e4, t5, r3);
  1951. var _2 = (e4, t5, r3) => c2(m6)(e4, t5, r3);
  1952. var f4 = 360;
  1953. var w4 = 400;
  1954. var A2 = 2 * Math.PI;
  1955. var D3 = 3600;
  1956. var E3 = 3240;
  1957. var p5 = 60;
  1958. var T2 = 60;
  1959. var S2 = 180 * D3 / Math.PI;
  1960. var R = f4 * p5 * T2;
  1961. var M4 = 90 * D3;
  1962. var U = 180 * D3;
  1963. var v3 = 270 * D3;
  1964. var F2 = String.fromCharCode(7501);
  1965. var I3 = "\xB0";
  1966. function N5(e4) {
  1967. if (w(e4) === false)
  1968. throw new Error("Invalid Parameter");
  1969. return e4;
  1970. }
  1971. function x2(e4, t5) {
  1972. const r3 = 10 ** t5;
  1973. return Math.round(e4 * r3) / r3;
  1974. }
  1975. function z2(e4, t5) {
  1976. return e4 % t5;
  1977. }
  1978. function O3(e4) {
  1979. const t5 = parseFloat(e4.toString().replace(Math.trunc(e4).toString(), "0")) * Math.sign(e4);
  1980. if (e4 < 0) {
  1981. return { fraction: t5, integer: Math.ceil(e4) };
  1982. }
  1983. return { fraction: t5, integer: Math.floor(e4) };
  1984. }
  1985. var G2;
  1986. var b2;
  1987. var H2;
  1988. var C3;
  1989. function y3(e4, t5) {
  1990. switch (e4) {
  1991. case G2.north:
  1992. return t5 === "SHORT" ? "N" : "North";
  1993. case G2.east:
  1994. return t5 === "SHORT" ? "E" : "East";
  1995. case G2.south:
  1996. return t5 === "SHORT" ? "S" : "South";
  1997. case G2.west:
  1998. return t5 === "SHORT" ? "W" : "West";
  1999. }
  2000. }
  2001. function q(e4, t5, r3) {
  2002. for (; e4.length < r3; )
  2003. e4 = t5 + e4;
  2004. return e4;
  2005. }
  2006. function P5(e4, t5) {
  2007. return e4 - Math.floor(e4 / t5) * t5;
  2008. }
  2009. function k3(e4) {
  2010. switch (e4) {
  2011. case b2.truncated_degrees:
  2012. case b2.decimal_degrees:
  2013. return f4;
  2014. case b2.radians:
  2015. return A2;
  2016. case b2.gradians:
  2017. return w4;
  2018. case b2.seconds:
  2019. return R;
  2020. case b2.fractional_degree_minutes:
  2021. return p5;
  2022. case b2.fractional_minute_seconds:
  2023. return T2;
  2024. default:
  2025. throw new Error("Unnexpected evaluations");
  2026. }
  2027. }
  2028. function L2(e4) {
  2029. switch (e4.toUpperCase().trim()) {
  2030. case "NORTH":
  2031. case "NORTHAZIMUTH":
  2032. case "NORTH AZIMUTH":
  2033. return H2.north_azimuth;
  2034. case "POLAR":
  2035. return H2.polar;
  2036. case "QUADRANT":
  2037. return H2.quadrant;
  2038. case "SOUTH":
  2039. case "SOUTHAZIMUTH":
  2040. case "SOUTH AZIMUTH":
  2041. return H2.south_azimuth;
  2042. }
  2043. throw new Error("Unsupported direction type");
  2044. }
  2045. function Q2(e4) {
  2046. switch (e4.toUpperCase().trim()) {
  2047. case "D":
  2048. case "DD":
  2049. case "DECIMALDEGREE":
  2050. case "DECIMAL DEGREE":
  2051. case "DEGREE":
  2052. case "DECIMALDEGREES":
  2053. case "DECIMAL DEGREES":
  2054. case "DEGREES":
  2055. return b2.decimal_degrees;
  2056. case "DMS":
  2057. case "DEGREESMINUTESSECONDS":
  2058. case "DEGREES MINUTES SECONDS":
  2059. return b2.degrees_minutes_seconds;
  2060. case "R":
  2061. case "RAD":
  2062. case "RADS":
  2063. case "RADIAN":
  2064. case "RADIANS":
  2065. return b2.radians;
  2066. case "G":
  2067. case "GON":
  2068. case "GONS":
  2069. case "GRAD":
  2070. case "GRADS":
  2071. case "GRADIAN":
  2072. case "GRADIANS":
  2073. return b2.gradians;
  2074. }
  2075. throw new Error("Unsupported units");
  2076. }
  2077. !function(e4) {
  2078. e4[e4.north = 0] = "north", e4[e4.east = 1] = "east", e4[e4.south = 2] = "south", e4[e4.west = 3] = "west";
  2079. }(G2 || (G2 = {})), function(e4) {
  2080. e4[e4.decimal_degrees = 1] = "decimal_degrees", e4[e4.seconds = 2] = "seconds", e4[e4.degrees_minutes_seconds = 3] = "degrees_minutes_seconds", e4[e4.radians = 4] = "radians", e4[e4.gradians = 5] = "gradians", e4[e4.truncated_degrees = 6] = "truncated_degrees", e4[e4.fractional_degree_minutes = 7] = "fractional_degree_minutes", e4[e4.fractional_minute_seconds = 8] = "fractional_minute_seconds";
  2081. }(b2 || (b2 = {})), function(e4) {
  2082. e4[e4.north_azimuth = 1] = "north_azimuth", e4[e4.polar = 2] = "polar", e4[e4.quadrant = 3] = "quadrant", e4[e4.south_azimuth = 4] = "south_azimuth";
  2083. }(H2 || (H2 = {})), function(e4) {
  2084. e4[e4.meridian = 0] = "meridian", e4[e4.direction = 1] = "direction";
  2085. }(C3 || (C3 = {}));
  2086. var W = class {
  2087. constructor(e4, t5, r3) {
  2088. this.m_degrees = e4, this.m_minutes = t5, this.m_seconds = r3;
  2089. }
  2090. getField(e4) {
  2091. switch (e4) {
  2092. case b2.decimal_degrees:
  2093. case b2.truncated_degrees:
  2094. return this.m_degrees;
  2095. case b2.fractional_degree_minutes:
  2096. return this.m_minutes;
  2097. case b2.seconds:
  2098. case b2.fractional_minute_seconds:
  2099. return this.m_seconds;
  2100. default:
  2101. throw new Error("Unnexpected evaluation");
  2102. }
  2103. }
  2104. static secondsToDMS(e4) {
  2105. const t5 = O3(e4).fraction;
  2106. let r3 = O3(e4).integer;
  2107. const n3 = Math.floor(r3 / D3);
  2108. r3 -= n3 * D3;
  2109. const s4 = Math.floor(r3 / T2);
  2110. return r3 -= s4 * T2, new W(n3, s4, r3 + t5);
  2111. }
  2112. static numberToDms(e4) {
  2113. const t5 = O3(e4).fraction, r3 = O3(e4).integer, n3 = g3(O3(100 * t5).fraction, 100), s4 = O3(100 * t5).integer;
  2114. return new W(r3, s4, n3);
  2115. }
  2116. format(e4, t5) {
  2117. let r3 = x2(this.m_seconds, t5), n3 = this.m_minutes, s4 = this.m_degrees;
  2118. if (e4 === b2.seconds || e4 === b2.fractional_minute_seconds)
  2119. T2 <= r3 && (r3 -= T2, ++n3), p5 <= n3 && (n3 = 0, ++s4), f4 <= s4 && (s4 = 0);
  2120. else if (e4 === b2.fractional_degree_minutes)
  2121. r3 = 0, n3 = 30 <= this.m_seconds ? this.m_minutes + 1 : this.m_minutes, s4 = this.m_degrees, p5 <= n3 && (n3 = 0, ++s4), f4 <= s4 && (s4 = 0);
  2122. else if (e4 === b2.decimal_degrees || e4 === b2.truncated_degrees) {
  2123. const e5 = _2(this.m_seconds, D3), t6 = _2(this.m_minutes, p5);
  2124. s4 = Math.round(this.m_degrees + t6 + e5), n3 = 0, r3 = 0;
  2125. }
  2126. return new W(s4, n3, r3);
  2127. }
  2128. static dmsToSeconds(e4, t5, r3) {
  2129. return e4 * D3 + t5 * T2 + r3;
  2130. }
  2131. };
  2132. var Z3 = class {
  2133. constructor(e4, t5, r3) {
  2134. this.meridian = e4, this.angle = t5, this.direction = r3;
  2135. }
  2136. fetchAzimuth(e4) {
  2137. return e4 === C3.meridian ? this.meridian : this.direction;
  2138. }
  2139. };
  2140. var B = class {
  2141. constructor(e4) {
  2142. this.m_angle = e4;
  2143. }
  2144. static createFromAngleAndDirection(e4, t5) {
  2145. return new B(new V2(B._convertDirectionFormat(e4.extractAngularUnits(b2.seconds), t5, H2.north_azimuth)));
  2146. }
  2147. getAngle(e4) {
  2148. const t5 = this.m_angle.extractAngularUnits(b2.seconds);
  2149. switch (e4) {
  2150. case H2.north_azimuth:
  2151. case H2.south_azimuth:
  2152. case H2.polar:
  2153. return new V2(B._convertDirectionFormat(t5, H2.north_azimuth, e4));
  2154. case H2.quadrant: {
  2155. const e5 = B.secondsNorthAzimuthToQuadrant(t5);
  2156. return new V2(e5.angle);
  2157. }
  2158. }
  2159. }
  2160. getMeridian(e4) {
  2161. const t5 = this.m_angle.extractAngularUnits(b2.seconds);
  2162. switch (e4) {
  2163. case H2.north_azimuth:
  2164. return G2.north;
  2165. case H2.south_azimuth:
  2166. return G2.south;
  2167. case H2.polar:
  2168. return G2.east;
  2169. case H2.quadrant:
  2170. return B.secondsNorthAzimuthToQuadrant(t5).meridian;
  2171. }
  2172. }
  2173. getDirection(e4) {
  2174. const t5 = this.m_angle.extractAngularUnits(b2.seconds);
  2175. switch (e4) {
  2176. case H2.north_azimuth:
  2177. return G2.east;
  2178. case H2.south_azimuth:
  2179. return G2.west;
  2180. case H2.polar:
  2181. return G2.north;
  2182. case H2.quadrant:
  2183. return B.secondsNorthAzimuthToQuadrant(t5).direction;
  2184. }
  2185. }
  2186. static secondsNorthAzimuthToQuadrant(e4) {
  2187. const t5 = e4 <= M4 || e4 >= v3 ? G2.north : G2.south, r3 = t5 === G2.north ? Math.min(R - e4, e4) : Math.abs(e4 - U), n3 = e4 > U ? G2.west : G2.east;
  2188. return new Z3(t5, r3, n3);
  2189. }
  2190. static createFromAngleMeridianAndDirection(e4, t5, r3) {
  2191. return new B(new V2(B.secondsQuadrantToNorthAzimuth(e4.extractAngularUnits(b2.seconds), t5, r3)));
  2192. }
  2193. static secondsQuadrantToNorthAzimuth(e4, t5, r3) {
  2194. return t5 === G2.north ? r3 === G2.east ? e4 : R - e4 : r3 === G2.east ? U - e4 : U + e4;
  2195. }
  2196. static _convertDirectionFormat(e4, t5, r3) {
  2197. let n3 = 0;
  2198. switch (t5) {
  2199. case H2.north_azimuth:
  2200. n3 = e4;
  2201. break;
  2202. case H2.polar:
  2203. n3 = M4 - e4;
  2204. break;
  2205. case H2.quadrant:
  2206. throw new Error("Unnexpected evaluation");
  2207. case H2.south_azimuth:
  2208. n3 = e4 + U;
  2209. }
  2210. let s4 = 0;
  2211. switch (r3) {
  2212. case H2.north_azimuth:
  2213. s4 = n3;
  2214. break;
  2215. case H2.polar:
  2216. s4 = M4 - n3;
  2217. break;
  2218. case H2.quadrant:
  2219. throw new Error("Unnexpected evaluation");
  2220. case H2.south_azimuth:
  2221. s4 = n3 - U;
  2222. }
  2223. return s4 = z2(s4, R), s4 < 0 ? R + s4 : s4;
  2224. }
  2225. };
  2226. function j3(e4, t5, r3) {
  2227. let n3 = null;
  2228. switch (t5) {
  2229. case b2.decimal_degrees:
  2230. n3 = g3(e4, D3);
  2231. break;
  2232. case b2.seconds:
  2233. n3 = e4;
  2234. break;
  2235. case b2.gradians:
  2236. n3 = g3(e4, E3);
  2237. break;
  2238. case b2.radians:
  2239. n3 = g3(e4, S2);
  2240. break;
  2241. default:
  2242. throw new Error("Unnexpected evaluation");
  2243. }
  2244. switch (r3) {
  2245. case b2.decimal_degrees:
  2246. return _2(n3, D3);
  2247. case b2.seconds:
  2248. return n3;
  2249. case b2.gradians:
  2250. return _2(n3, E3);
  2251. case b2.radians:
  2252. return n3 / S2;
  2253. default:
  2254. throw new Error("Unnexpected evaluation");
  2255. }
  2256. }
  2257. var V2 = class {
  2258. constructor(e4) {
  2259. this.m_seconds = e4;
  2260. }
  2261. static createFromAngleAndUnits(e4, t5) {
  2262. return new V2(j3(e4, t5, b2.seconds));
  2263. }
  2264. extractAngularUnits(e4) {
  2265. return j3(this.m_seconds, b2.seconds, X2(e4));
  2266. }
  2267. static createFromDegreesMinutesSeconds(e4, t5, r3) {
  2268. return new V2(l5(l5(g3(e4, D3), g3(t5, T2)), r3));
  2269. }
  2270. };
  2271. function X2(e4) {
  2272. switch (e4) {
  2273. case b2.decimal_degrees:
  2274. case b2.truncated_degrees:
  2275. case b2.degrees_minutes_seconds:
  2276. return b2.decimal_degrees;
  2277. case b2.gradians:
  2278. return b2.gradians;
  2279. case b2.fractional_degree_minutes:
  2280. return b2.fractional_degree_minutes;
  2281. case b2.radians:
  2282. return b2.radians;
  2283. case b2.seconds:
  2284. case b2.fractional_minute_seconds:
  2285. return b2.seconds;
  2286. }
  2287. }
  2288. var J2 = class {
  2289. constructor(e4, t5, r3, n3) {
  2290. this.m_view = e4, this.m_angle = t5, this.m_merdian = r3, this.m_direction = n3, this.m_dms = null, this.m_formatted_dms = null;
  2291. }
  2292. static createFromStringAndBearing(e4, t5, r3) {
  2293. return new J2(e4, t5.getAngle(r3), t5.getMeridian(r3), t5.getDirection(r3));
  2294. }
  2295. fetchAngle() {
  2296. return this.m_angle;
  2297. }
  2298. fetchMeridian() {
  2299. return this.m_merdian;
  2300. }
  2301. fetchDirection() {
  2302. return this.m_direction;
  2303. }
  2304. fetchView() {
  2305. return this.m_view;
  2306. }
  2307. fetchDms() {
  2308. return this.m_dms === null && this._calculateDms(), this.m_dms;
  2309. }
  2310. fetchFormattedDms() {
  2311. return this.m_formatted_dms === null && this._calculateDms(), this.m_formatted_dms;
  2312. }
  2313. _calculateDms() {
  2314. let e4 = null, t5 = b2.truncated_degrees, r3 = 0;
  2315. for (let n3 = 0; n3 < this.m_view.length; n3++) {
  2316. const s4 = this.m_view[n3];
  2317. switch (s4) {
  2318. case "m":
  2319. e4 = oe2(this.m_view, n3, s4), t5 = t5 === b2.truncated_degrees ? b2.fractional_degree_minutes : t5, n3 = e4.newpos;
  2320. continue;
  2321. case "s":
  2322. e4 = oe2(this.m_view, n3, s4), t5 = b2.fractional_minute_seconds, r3 = r3 < e4.rounding ? e4.rounding : r3, n3 = e4.newpos;
  2323. continue;
  2324. default:
  2325. continue;
  2326. }
  2327. }
  2328. this.m_dms = W.secondsToDMS(this.m_angle.extractAngularUnits(b2.seconds)), this.m_formatted_dms = W.secondsToDMS(this.m_angle.extractAngularUnits(b2.seconds)).format(t5, r3);
  2329. }
  2330. };
  2331. function K(e4, t5, r3, n3, s4) {
  2332. let a2 = null;
  2333. switch (t5) {
  2334. case b2.decimal_degrees:
  2335. case b2.radians:
  2336. case b2.gradians:
  2337. return a2 = P5(x2(e4.extractAngularUnits(t5), n3), k3(t5)), q(a2.toFixed(n3), "0", r3 + n3 + (n3 > 0 ? 1 : 0));
  2338. case b2.truncated_degrees:
  2339. case b2.fractional_degree_minutes:
  2340. return a2 = P5(s4.fetchFormattedDms().getField(t5), k3(t5)), q(a2.toFixed(n3), "0", r3 + n3 + (n3 > 0 ? 1 : 0));
  2341. case b2.fractional_minute_seconds:
  2342. return a2 = P5(x2(s4.fetchDms().getField(t5), n3), k3(t5)), q(a2.toFixed(n3), "0", r3 + n3 + (n3 > 0 ? 1 : 0));
  2343. default:
  2344. throw new Error("Unnexepected evaluation");
  2345. }
  2346. }
  2347. function Y2(e4, t5, r3) {
  2348. if (r3 === H2.quadrant)
  2349. throw new Error("Conversion error");
  2350. if (t5 === b2.degrees_minutes_seconds) {
  2351. const t6 = W.numberToDms(e4);
  2352. return B.createFromAngleAndDirection(V2.createFromDegreesMinutesSeconds(t6.m_degrees, t6.m_minutes, t6.m_seconds), r3);
  2353. }
  2354. return B.createFromAngleAndDirection(V2.createFromAngleAndUnits(e4, X2(t5)), r3);
  2355. }
  2356. function $2(e4) {
  2357. switch (ne(e4)) {
  2358. case 1:
  2359. return { first: G2.north, second: G2.east };
  2360. case 2:
  2361. return { first: G2.south, second: G2.east };
  2362. case 3:
  2363. return { first: G2.south, second: G2.west };
  2364. case 4:
  2365. return { first: G2.north, second: G2.west };
  2366. }
  2367. return null;
  2368. }
  2369. function ee2(e4) {
  2370. switch (e4.toUpperCase().trim()) {
  2371. case "N":
  2372. case "NORTH":
  2373. return G2.north;
  2374. case "E":
  2375. case "EAST":
  2376. return G2.east;
  2377. case "S":
  2378. case "SOUTH":
  2379. return G2.south;
  2380. case "W":
  2381. case "WEST":
  2382. return G2.west;
  2383. }
  2384. return null;
  2385. }
  2386. function te(e4) {
  2387. const t5 = parseFloat(e4);
  2388. if (O(t5)) {
  2389. if (isNaN(t5))
  2390. throw new Error("Invalid conversion");
  2391. return t5;
  2392. }
  2393. throw new Error("Invalid conversion");
  2394. }
  2395. function re2(e4, r3, n3) {
  2396. const s4 = n3 === H2.quadrant;
  2397. let a2 = null, i5 = null, c3 = 0, o4 = 0, d7 = 0;
  2398. if (s4) {
  2399. if (e4.length < 2)
  2400. throw new Error("Conversion Error");
  2401. d7 = 1;
  2402. const r4 = $2(X(e4[e4.length - 1]));
  2403. if (r4 ? (a2 = r4.first, i5 = r4.second) : (c3 = 1, a2 = ee2(X(e4[0])), i5 = ee2(X(e4[e4.length - 1]))), a2 === null || i5 === null)
  2404. throw new Error("Invalid Conversion");
  2405. }
  2406. switch (r3) {
  2407. case b2.decimal_degrees:
  2408. case b2.radians:
  2409. case b2.gradians:
  2410. if (e4.length === 0)
  2411. throw new Error("Invalid Conversion");
  2412. return s4 ? B.createFromAngleMeridianAndDirection(V2.createFromAngleAndUnits(te(e4[c3]), X2(r3)), a2, i5) : B.createFromAngleAndDirection(V2.createFromAngleAndUnits(te(e4[c3]), X2(r3)), n3);
  2413. case b2.degrees_minutes_seconds:
  2414. if (o4 = e4.length - d7 - c3, o4 === 3) {
  2415. const t5 = V2.createFromDegreesMinutesSeconds(te(e4[c3]), te(e4[c3 + 1]), te(e4[c3 + 2]));
  2416. return s4 ? B.createFromAngleMeridianAndDirection(t5, a2, i5) : B.createFromAngleAndDirection(t5, n3);
  2417. }
  2418. if (o4 === 1) {
  2419. const t5 = te(e4[c3]), r4 = W.numberToDms(t5), o5 = V2.createFromDegreesMinutesSeconds(r4.m_degrees, r4.m_minutes, r4.m_seconds);
  2420. return s4 ? B.createFromAngleMeridianAndDirection(o5, a2, i5) : B.createFromAngleAndDirection(o5, n3);
  2421. }
  2422. }
  2423. throw new Error("Conversion Error");
  2424. }
  2425. function ne2(e4) {
  2426. const t5 = [" ", "-", "/", "'", '"', "\\", "^", I3, F2, " ", "\r", "\n", "*"];
  2427. let r3 = "";
  2428. for (let n3 = 0; n3 < e4.length; n3++) {
  2429. const s4 = e4.charAt(n3);
  2430. t5.includes(s4) ? r3 += "RRSPLITRRSPLITRR" : r3 += s4;
  2431. }
  2432. return r3.split("RRSPLITRRSPLITRR").filter((e5) => e5 !== "");
  2433. }
  2434. function se2(e4, t5, c3) {
  2435. if (O(e4))
  2436. return Y2(ne(e4), t5, c3);
  2437. if (w(e4))
  2438. return re2(ne2(e4), t5, c3);
  2439. if (L(e4))
  2440. return re2(e4, t5, c3);
  2441. if (E(e4))
  2442. return re2(e4.toArray(), t5, c3);
  2443. throw new Error("Conversion Error");
  2444. }
  2445. function ae(e4, t5, r3) {
  2446. const n3 = X2(r3);
  2447. if (n3 && r3 !== b2.degrees_minutes_seconds) {
  2448. return e4.getAngle(t5).extractAngularUnits(n3);
  2449. }
  2450. throw new Error("Conversion Error");
  2451. }
  2452. function ie2(e4, t5, r3) {
  2453. const n3 = e4.getAngle(t5);
  2454. if (t5 === H2.quadrant && r3 === b2.degrees_minutes_seconds) {
  2455. const r4 = W.secondsToDMS(n3.extractAngularUnits(b2.seconds));
  2456. return [y3(e4.getMeridian(t5), "SHORT"), r4.m_degrees, r4.m_minutes, r4.m_seconds, y3(e4.getDirection(t5), "SHORT")];
  2457. }
  2458. if (r3 === b2.degrees_minutes_seconds) {
  2459. const e5 = W.secondsToDMS(n3.extractAngularUnits(b2.seconds));
  2460. return [e5.m_degrees, e5.m_minutes, e5.m_seconds];
  2461. }
  2462. return t5 === H2.quadrant ? [y3(e4.getMeridian(t5), "SHORT"), n3.extractAngularUnits(r3), y3(e4.getDirection(t5), "SHORT")] : [n3.extractAngularUnits(r3)];
  2463. }
  2464. function ce(e4, t5) {
  2465. let r3 = "";
  2466. switch (e4) {
  2467. case b2.decimal_degrees:
  2468. r3 = t5 === H2.quadrant ? "DD.DD" + I3 : "DDD.DD" + I3;
  2469. break;
  2470. case b2.degrees_minutes_seconds:
  2471. r3 = t5 === H2.quadrant ? "dd" + I3 + ` mm' ss"` : "ddd" + I3 + ` mm' ss.ss"`;
  2472. break;
  2473. case b2.radians:
  2474. r3 = "R.RR";
  2475. break;
  2476. case b2.gradians:
  2477. r3 = "GGG.GG" + F2;
  2478. break;
  2479. default:
  2480. throw new Error("Conversion error");
  2481. }
  2482. return t5 === H2.quadrant && (r3 = "p " + r3 + " b"), r3;
  2483. }
  2484. function oe2(e4, t5, r3) {
  2485. const n3 = { padding: 0, rounding: 0, newpos: t5 };
  2486. let s4 = false;
  2487. for (; t5 < e4.length; ) {
  2488. const a2 = e4[t5];
  2489. if (a2 === r3)
  2490. s4 ? n3.rounding++ : n3.padding++, t5++;
  2491. else {
  2492. if (a2 !== ".")
  2493. break;
  2494. s4 = true, t5++;
  2495. }
  2496. }
  2497. return n3.newpos = t5 - 1, n3;
  2498. }
  2499. function de(e4, t5, r3) {
  2500. const n3 = { escaped: "", newpos: t5 };
  2501. for (t5++; t5 < e4.length; ) {
  2502. const r4 = e4[t5];
  2503. if (t5++, r4 === "]")
  2504. break;
  2505. n3.escaped += r4;
  2506. }
  2507. return n3.newpos = t5 - 1, n3;
  2508. }
  2509. function ue2(e4, t5, r3) {
  2510. let n3 = "", s4 = null, a2 = null;
  2511. const i5 = J2.createFromStringAndBearing(t5, e4, r3), c3 = { D: b2.decimal_degrees, d: b2.truncated_degrees, m: b2.fractional_degree_minutes, s: b2.fractional_minute_seconds, R: b2.radians, G: b2.gradians };
  2512. for (let o4 = 0; o4 < t5.length; o4++) {
  2513. const d7 = t5[o4];
  2514. switch (d7) {
  2515. case "[":
  2516. s4 = de(t5, o4), n3 += s4.escaped, o4 = s4.newpos;
  2517. continue;
  2518. case "D":
  2519. case "d":
  2520. case "m":
  2521. case "s":
  2522. case "R":
  2523. case "G":
  2524. s4 = oe2(t5, o4, d7), a2 = e4.getAngle(r3), n3 += K(a2, c3[d7], s4.padding, s4.rounding, i5), o4 = s4.newpos;
  2525. continue;
  2526. case "P":
  2527. case "p":
  2528. n3 += y3(i5.fetchMeridian(), d7 === "p" ? "SHORT" : "LONG");
  2529. continue;
  2530. case "B":
  2531. case "b":
  2532. n3 += y3(i5.fetchDirection(), d7 === "b" ? "SHORT" : "LONG");
  2533. continue;
  2534. default:
  2535. n3 += d7;
  2536. }
  2537. }
  2538. return n3;
  2539. }
  2540. function me(r3, n3, s4) {
  2541. if (!(n3 instanceof d2))
  2542. throw new Error("Invalid Parameter");
  2543. if (n3.hasField("directionType") === false)
  2544. throw new Error("Invalid Parameter - Missing directionType");
  2545. if (n3.hasField("angleType") === false)
  2546. throw new Error("Invalid Parameter - Missing directionType");
  2547. const a2 = L2(N5(n3.field("directiontype"))), i5 = se2(r3, Q2(N5(n3.field("angletype"))), a2);
  2548. if (!(s4 instanceof d2))
  2549. throw new Error("Invalid Parameter");
  2550. if (s4.hasField("directionType") === false)
  2551. throw new Error("Invalid Parameter - Missing directionType");
  2552. if (s4.hasField("outputType") === false)
  2553. throw new Error("Invalid Parameter - Missing directionType");
  2554. const c3 = L2(N5(s4.field("directiontype"))), o4 = s4.hasField("angleType") ? Q2(N5(s4.field("angletype"))) : null, d7 = N5(s4.field("outputType")).toUpperCase().trim();
  2555. if (!c3 || !d7)
  2556. throw new Error("Conversion error");
  2557. if (!(o4 || d7 === "TEXT" && s4.hasField("format")))
  2558. throw new Error("Invalid unit");
  2559. switch (d7) {
  2560. case "VALUE":
  2561. return c3 === H2.quadrant || o4 === b2.degrees_minutes_seconds ? ie2(i5, c3, o4) : ae(i5, c3, o4);
  2562. case "TEXT": {
  2563. let e4 = "";
  2564. return s4.hasField("format") && (e4 = X(s4.field("format"))), e4 !== null && e4 !== "" || (e4 = ce(o4, c3)), ue2(i5, e4, c3);
  2565. }
  2566. default:
  2567. throw new Error("Invalid Parameter");
  2568. }
  2569. }
  2570. // node_modules/@arcgis/core/arcade/functions/hash.js
  2571. var t4 = 2654435761;
  2572. var s3 = 2246822519;
  2573. var n2 = 3266489917;
  2574. var e3 = 668265263;
  2575. var r2 = 374761393;
  2576. function h3(t5) {
  2577. const s4 = [];
  2578. for (let n3 = 0, e4 = t5.length; n3 < e4; n3++) {
  2579. let e5 = t5.charCodeAt(n3);
  2580. e5 < 128 ? s4.push(e5) : e5 < 2048 ? s4.push(192 | e5 >> 6, 128 | 63 & e5) : e5 < 55296 || e5 >= 57344 ? s4.push(224 | e5 >> 12, 128 | e5 >> 6 & 63, 128 | 63 & e5) : (n3++, e5 = 65536 + ((1023 & e5) << 10 | 1023 & t5.charCodeAt(n3)), s4.push(240 | e5 >> 18, 128 | e5 >> 12 & 63, 128 | e5 >> 6 & 63, 128 | 63 & e5));
  2581. }
  2582. return new Uint8Array(s4);
  2583. }
  2584. var i4 = class {
  2585. constructor(t5) {
  2586. this.seed = t5, this.totallen = 0, this.bufs = [], this.init();
  2587. }
  2588. init() {
  2589. return this.bufs = [], this.totallen = 0, this;
  2590. }
  2591. updateFloatArray(t5) {
  2592. const s4 = [];
  2593. for (const n3 of t5)
  2594. isNaN(n3) ? s4.push("NaN") : n3 === 1 / 0 ? s4.push("Infinity") : n3 === -1 / 0 ? s4.push("-Infinity") : n3 === 0 ? s4.push("0") : s4.push(n3.toString(16));
  2595. this.update(h3(s4.join("")));
  2596. }
  2597. updateIntArray(t5) {
  2598. const s4 = Int32Array.from(t5);
  2599. this.update(new Uint8Array(s4.buffer));
  2600. }
  2601. updateUint8Array(t5) {
  2602. this.update(Uint8Array.from(t5));
  2603. }
  2604. updateWithString(t5) {
  2605. return this.update(h3(t5));
  2606. }
  2607. update(t5) {
  2608. return this.bufs.push(t5), this.totallen += t5.length, this;
  2609. }
  2610. digest() {
  2611. const t5 = new Uint8Array(this.totallen);
  2612. let s4 = 0;
  2613. for (const n3 of this.bufs)
  2614. t5.set(n3, s4), s4 += n3.length;
  2615. return this.init(), this._xxHash32(t5, this.seed);
  2616. }
  2617. _xxHash32(h4, i5 = 0) {
  2618. const o4 = h4;
  2619. let u3 = i5 + r2 & 4294967295, a2 = 0;
  2620. if (o4.length >= 16) {
  2621. const n3 = [i5 + t4 + s3 & 4294967295, i5 + s3 & 4294967295, i5 + 0 & 4294967295, i5 - t4 & 4294967295], e4 = h4, r3 = e4.length - 16;
  2622. let o5 = 0;
  2623. for (a2 = 0; (4294967280 & a2) <= r3; a2 += 4) {
  2624. const r4 = a2, h5 = e4[r4 + 0] + (e4[r4 + 1] << 8), i6 = e4[r4 + 2] + (e4[r4 + 3] << 8), u4 = h5 * s3 + (i6 * s3 << 16);
  2625. let l7 = n3[o5] + u4 & 4294967295;
  2626. l7 = l7 << 13 | l7 >>> 19;
  2627. const f5 = 65535 & l7, p6 = l7 >>> 16;
  2628. n3[o5] = f5 * t4 + (p6 * t4 << 16) & 4294967295, o5 = o5 + 1 & 3;
  2629. }
  2630. u3 = (n3[0] << 1 | n3[0] >>> 31) + (n3[1] << 7 | n3[1] >>> 25) + (n3[2] << 12 | n3[2] >>> 20) + (n3[3] << 18 | n3[3] >>> 14) & 4294967295;
  2631. }
  2632. u3 = u3 + h4.length & 4294967295;
  2633. const l6 = h4.length - 4;
  2634. for (; a2 <= l6; a2 += 4) {
  2635. const t5 = a2, s4 = o4[t5 + 0] + (o4[t5 + 1] << 8), r3 = o4[t5 + 2] + (o4[t5 + 3] << 8);
  2636. u3 = u3 + (s4 * n2 + (r3 * n2 << 16)) & 4294967295, u3 = u3 << 17 | u3 >>> 15, u3 = (65535 & u3) * e3 + ((u3 >>> 16) * e3 << 16) & 4294967295;
  2637. }
  2638. for (; a2 < o4.length; ++a2) {
  2639. u3 += o4[a2] * r2, u3 = u3 << 11 | u3 >>> 21, u3 = (65535 & u3) * t4 + ((u3 >>> 16) * t4 << 16) & 4294967295;
  2640. }
  2641. return u3 ^= u3 >>> 15, u3 = ((65535 & u3) * s3 & 4294967295) + ((u3 >>> 16) * s3 << 16), u3 ^= u3 >>> 13, u3 = ((65535 & u3) * n2 & 4294967295) + ((u3 >>> 16) * n2 << 16), u3 ^= u3 >>> 16, u3 < 0 ? u3 + 4294967296 : u3;
  2642. }
  2643. };
  2644. // node_modules/@arcgis/core/arcade/functions/string.js
  2645. function H3(t5, r3) {
  2646. if (t5.x === r3.x && t5.y === r3.y) {
  2647. if (t5.hasZ) {
  2648. if (t5.z !== r3.z)
  2649. return false;
  2650. } else if (r3.hasZ)
  2651. return false;
  2652. if (t5.hasM) {
  2653. if (t5.m !== r3.m)
  2654. return false;
  2655. } else if (r3.hasM)
  2656. return false;
  2657. return true;
  2658. }
  2659. return false;
  2660. }
  2661. function S3(e4, o4, a2) {
  2662. if (e4 !== null)
  2663. if (L(e4)) {
  2664. if (o4.updateUint8Array([61]), a2.map.has(e4)) {
  2665. const t5 = a2.map.get(e4);
  2666. o4.updateIntArray([61237541 ^ t5]);
  2667. } else {
  2668. a2.map.set(e4, a2.currentLength++);
  2669. for (const t5 of e4)
  2670. S3(t5, o4, a2);
  2671. a2.map.delete(e4), a2.currentLength--;
  2672. }
  2673. o4.updateUint8Array([199]);
  2674. } else if (E(e4)) {
  2675. if (o4.updateUint8Array([61]), a2.map.has(e4)) {
  2676. const t5 = a2.map.get(e4);
  2677. o4.updateIntArray([61237541 ^ t5]);
  2678. } else {
  2679. a2.map.set(e4, a2.currentLength++);
  2680. for (const t5 of e4.toArray())
  2681. S3(t5, o4, a2);
  2682. a2.map.delete(e4), a2.currentLength--;
  2683. }
  2684. o4.updateUint8Array([199]);
  2685. } else {
  2686. if (z(e4))
  2687. return o4.updateIntArray([e4.getTime()]), void o4.updateUint8Array([241]);
  2688. if (w(e4))
  2689. return o4.updateIntArray([e4.length]), o4.updateWithString(e4), void o4.updateUint8Array([41]);
  2690. if (_(e4))
  2691. o4.updateUint8Array([e4 === true ? 1 : 0, 113]);
  2692. else {
  2693. if (O(e4))
  2694. return o4.updateFloatArray([e4]), void o4.updateUint8Array([173]);
  2695. if (e4 instanceof e)
  2696. throw new Error("Type not supported in Hash");
  2697. if (e4 instanceof s)
  2698. throw new Error("Type not supported in Hash");
  2699. if (!(e4 instanceof d2)) {
  2700. if (Y(e4))
  2701. throw new Error("Type not supported in Hash");
  2702. if (e4 instanceof j)
  2703. return o4.updateIntArray([3833836621]), o4.updateIntArray([0]), o4.updateFloatArray([e4.x]), o4.updateIntArray([1]), o4.updateFloatArray([e4.y]), e4.hasZ && (o4.updateIntArray([2]), o4.updateFloatArray([e4.z])), e4.hasM && (o4.updateIntArray([3]), o4.updateFloatArray([e4.m])), o4.updateIntArray([3765347959]), void S3(e4.spatialReference.wkid, o4, a2);
  2704. if (e4 instanceof v) {
  2705. o4.updateIntArray([1266616829]);
  2706. for (let t5 = 0; t5 < e4.rings.length; t5++) {
  2707. const r3 = e4.rings[t5], n3 = [];
  2708. let i5 = null, u3 = null;
  2709. for (let o5 = 0; o5 < r3.length; o5++) {
  2710. const a3 = e4.getPoint(t5, o5);
  2711. if (o5 === 0)
  2712. i5 = a3;
  2713. else if (H3(u3, a3))
  2714. continue;
  2715. u3 = a3, o5 === r3.length - 1 && H3(i5, a3) || n3.push(a3);
  2716. }
  2717. o4.updateIntArray([1397116793, n3.length]);
  2718. for (let t6 = 0; t6 < n3.length; t6++) {
  2719. const r4 = n3[t6];
  2720. o4.updateIntArray([3962308117, t6]), S3(r4, o4, a2), o4.updateIntArray([2716288009]);
  2721. }
  2722. o4.updateIntArray([2278822459]);
  2723. }
  2724. return o4.updateIntArray([3878477243]), void S3(e4.spatialReference.wkid, o4, a2);
  2725. }
  2726. if (e4 instanceof m2) {
  2727. o4.updateIntArray([4106883559]);
  2728. for (let t5 = 0; t5 < e4.paths.length; t5++) {
  2729. const r3 = e4.paths[t5];
  2730. o4.updateIntArray([1397116793, r3.length]);
  2731. for (let n3 = 0; n3 < r3.length; n3++)
  2732. o4.updateIntArray([3962308117, n3]), S3(e4.getPoint(t5, n3), o4, a2), o4.updateIntArray([2716288009]);
  2733. o4.updateIntArray([2278822459]);
  2734. }
  2735. return o4.updateIntArray([2568784753]), void S3(e4.spatialReference.wkid, o4, a2);
  2736. }
  2737. if (e4 instanceof m) {
  2738. o4.updateIntArray([588535921, e4.points.length]);
  2739. for (let t5 = 0; t5 < e4.points.length; t5++) {
  2740. const r3 = e4.getPoint(t5);
  2741. o4.updateIntArray([t5]), S3(r3, o4, a2);
  2742. }
  2743. return o4.updateIntArray([1700171621]), void S3(e4.spatialReference.wkid, o4, a2);
  2744. }
  2745. if (e4 instanceof M)
  2746. return o4.updateIntArray([3483648373]), o4.updateIntArray([0]), o4.updateFloatArray([e4.xmax]), o4.updateIntArray([1]), o4.updateFloatArray([e4.xmin]), o4.updateIntArray([2]), o4.updateFloatArray([e4.ymax]), o4.updateIntArray([3]), o4.updateFloatArray([e4.ymin]), e4.hasZ && (o4.updateIntArray([4]), o4.updateFloatArray([e4.zmax]), o4.updateIntArray([5]), o4.updateFloatArray([e4.zmin])), e4.hasM && (o4.updateIntArray([6]), o4.updateFloatArray([e4.mmax]), o4.updateIntArray([7]), o4.updateFloatArray([e4.mmin])), o4.updateIntArray([3622027469]), void S3(e4.spatialReference.wkid, o4, a2);
  2747. if (e4 instanceof k2)
  2748. return o4.updateIntArray([14]), e4.wkid !== void 0 && e4.wkid !== null && o4.updateIntArray([e4.wkid]), void (e4.wkt && o4.updateWithString(e4.wkt));
  2749. if (v2(e4))
  2750. throw new Error("Type not supported in Hash");
  2751. if (J(e4))
  2752. throw new Error("Type not supported in Hash");
  2753. if (P2(e4))
  2754. throw new Error("Type not supported in Hash");
  2755. if (e4 === j2)
  2756. throw new Error("Type not supported in Hash");
  2757. throw new Error("Type not supported in Hash");
  2758. }
  2759. if (o4.updateUint8Array([223]), a2.map.has(e4)) {
  2760. const t5 = a2.map.get(e4);
  2761. o4.updateIntArray([61237541 ^ t5]);
  2762. } else {
  2763. a2.map.set(e4, a2.currentLength++);
  2764. for (const t5 of e4.keys()) {
  2765. o4.updateIntArray([t5.length]), o4.updateWithString(t5), o4.updateUint8Array([251]);
  2766. S3(e4.field(t5), o4, a2), o4.updateUint8Array([239]);
  2767. }
  2768. a2.map.delete(e4), a2.currentLength--;
  2769. }
  2770. o4.updateUint8Array([73]);
  2771. }
  2772. }
  2773. else
  2774. o4.updateUint8Array([0, 139]);
  2775. }
  2776. function O4(r3, v4) {
  2777. r3.portal = function(r4, n3) {
  2778. return v4(r4, n3, function(r5, n4, a2) {
  2779. return G(a2, 1, 1), new s(X(a2[0]));
  2780. });
  2781. }, r3.trim = function(t5, r4) {
  2782. return v4(t5, r4, function(t6, r5, n3) {
  2783. return G(n3, 1, 1), X(n3[0]).trim();
  2784. });
  2785. }, r3.tohex = function(t5, r4) {
  2786. return v4(t5, r4, function(t6, r5, n3) {
  2787. G(n3, 1, 1);
  2788. const o4 = ne(n3[0]);
  2789. return isNaN(o4) ? o4 : o4.toString(16);
  2790. });
  2791. }, r3.upper = function(t5, r4) {
  2792. return v4(t5, r4, function(t6, r5, n3) {
  2793. return G(n3, 1, 1), X(n3[0]).toUpperCase();
  2794. });
  2795. }, r3.proper = function(t5, r4) {
  2796. return v4(t5, r4, function(t6, r5, n3) {
  2797. G(n3, 1, 2);
  2798. let a2 = 1;
  2799. n3.length === 2 && X(n3[1]).toLowerCase() === "firstword" && (a2 = 2);
  2800. const i5 = /\s/, u3 = X(n3[0]);
  2801. let s4 = "", f5 = true;
  2802. for (let e4 = 0; e4 < u3.length; e4++) {
  2803. let t7 = u3[e4];
  2804. if (i5.test(t7))
  2805. a2 === 1 && (f5 = true);
  2806. else {
  2807. t7.toUpperCase() !== t7.toLowerCase() && (f5 ? (t7 = t7.toUpperCase(), f5 = false) : t7 = t7.toLowerCase());
  2808. }
  2809. s4 += t7;
  2810. }
  2811. return s4;
  2812. });
  2813. }, r3.lower = function(t5, r4) {
  2814. return v4(t5, r4, function(t6, r5, n3) {
  2815. return G(n3, 1, 1), X(n3[0]).toLowerCase();
  2816. });
  2817. }, r3.guid = function(t5, r4) {
  2818. return v4(t5, r4, function(t6, r5, n3) {
  2819. if (G(n3, 0, 1), n3.length > 0)
  2820. switch (X(n3[0]).toLowerCase()) {
  2821. case "digits":
  2822. return H().replace("-", "").replace("-", "").replace("-", "").replace("-", "");
  2823. case "digits-hyphen":
  2824. return H();
  2825. case "digits-hyphen-braces":
  2826. return "{" + H() + "}";
  2827. case "digits-hyphen-parentheses":
  2828. return "(" + H() + ")";
  2829. }
  2830. return "{" + H() + "}";
  2831. });
  2832. }, r3.console = function(t5, r4) {
  2833. return v4(t5, r4, function(r5, n3, e4) {
  2834. return e4.length === 0 || (e4.length === 1 ? t5.console(X(e4[0])) : t5.console(X(e4))), j2;
  2835. });
  2836. }, r3.mid = function(t5, r4) {
  2837. return v4(t5, r4, function(t6, r5, n3) {
  2838. G(n3, 2, 3);
  2839. let i5 = ne(n3[1]);
  2840. if (isNaN(i5))
  2841. return "";
  2842. if (i5 < 0 && (i5 = 0), n3.length === 2)
  2843. return X(n3[0]).substr(i5);
  2844. let u3 = ne(n3[2]);
  2845. return isNaN(u3) ? "" : (u3 < 0 && (u3 = 0), X(n3[0]).substr(i5, u3));
  2846. });
  2847. }, r3.find = function(t5, r4) {
  2848. return v4(t5, r4, function(t6, r5, n3) {
  2849. G(n3, 2, 3);
  2850. let i5 = 0;
  2851. if (n3.length > 2) {
  2852. if (i5 = ne(I(n3[2], 0)), isNaN(i5))
  2853. return -1;
  2854. i5 < 0 && (i5 = 0);
  2855. }
  2856. return X(n3[1]).indexOf(X(n3[0]), i5);
  2857. });
  2858. }, r3.left = function(t5, r4) {
  2859. return v4(t5, r4, function(t6, r5, n3) {
  2860. G(n3, 2, 2);
  2861. let i5 = ne(n3[1]);
  2862. return isNaN(i5) ? "" : (i5 < 0 && (i5 = 0), X(n3[0]).substr(0, i5));
  2863. });
  2864. }, r3.right = function(t5, r4) {
  2865. return v4(t5, r4, function(t6, r5, n3) {
  2866. G(n3, 2, 2);
  2867. let i5 = ne(n3[1]);
  2868. return isNaN(i5) ? "" : (i5 < 0 && (i5 = 0), X(n3[0]).substr(-1 * i5, i5));
  2869. });
  2870. }, r3.split = function(t5, r4) {
  2871. return v4(t5, r4, function(t6, r5, n3) {
  2872. let i5;
  2873. G(n3, 2, 4);
  2874. let u3 = ne(I(n3[2], -1));
  2875. const c3 = oe(I(n3[3], false));
  2876. if (u3 === -1 || u3 === null || c3 === true ? i5 = X(n3[0]).split(X(n3[1])) : (isNaN(u3) && (u3 = -1), u3 < -1 && (u3 = -1), i5 = X(n3[0]).split(X(n3[1]), u3)), c3 === false)
  2877. return i5;
  2878. const l6 = [];
  2879. for (let e4 = 0; e4 < i5.length && !(u3 !== -1 && l6.length >= u3); e4++)
  2880. i5[e4] !== "" && i5[e4] !== void 0 && l6.push(i5[e4]);
  2881. return l6;
  2882. });
  2883. }, r3.text = function(t5, r4) {
  2884. return v4(t5, r4, function(t6, r5, n3) {
  2885. return G(n3, 1, 2), ee(n3[0], n3[1]);
  2886. });
  2887. }, r3.concatenate = function(t5, r4) {
  2888. return v4(t5, r4, function(t6, r5, n3) {
  2889. const e4 = [];
  2890. if (n3.length < 1)
  2891. return "";
  2892. if (L(n3[0])) {
  2893. const t7 = I(n3[2], "");
  2894. for (let r6 = 0; r6 < n3[0].length; r6++)
  2895. e4[r6] = ee(n3[0][r6], t7);
  2896. return n3.length > 1 ? e4.join(n3[1]) : e4.join("");
  2897. }
  2898. if (E(n3[0])) {
  2899. const t7 = I(n3[2], "");
  2900. for (let r6 = 0; r6 < n3[0].length(); r6++)
  2901. e4[r6] = ee(n3[0].get(r6), t7);
  2902. return n3.length > 1 ? e4.join(n3[1]) : e4.join("");
  2903. }
  2904. for (let o4 = 0; o4 < n3.length; o4++)
  2905. e4[o4] = ee(n3[o4]);
  2906. return e4.join("");
  2907. });
  2908. }, r3.reverse = function(t5, r4) {
  2909. return v4(t5, r4, function(t6, r5, n3) {
  2910. if (G(n3, 1, 1), L(n3[0])) {
  2911. const t7 = n3[0].slice(0);
  2912. return t7.reverse(), t7;
  2913. }
  2914. if (E(n3[0])) {
  2915. const t7 = n3[0].toArray().slice(0);
  2916. return t7.reverse(), t7;
  2917. }
  2918. throw new Error("Invalid Parameter");
  2919. });
  2920. }, r3.replace = function(t5, r4) {
  2921. return v4(t5, r4, function(t6, r5, n3) {
  2922. G(n3, 3, 4);
  2923. const a2 = X(n3[0]), i5 = X(n3[1]), u3 = X(n3[2]);
  2924. return n3.length !== 4 || oe(n3[3]) ? F(a2, i5, u3) : a2.replace(i5, u3);
  2925. });
  2926. }, r3.schema = function(t5, r4) {
  2927. return v4(t5, r4, function(t6, r5, e4) {
  2928. if (Y(e4[0])) {
  2929. const t7 = ve(e4[0]);
  2930. return t7 ? d2.convertObjectToArcadeDictionary(t7) : null;
  2931. }
  2932. throw new Error("Invalid Parameter");
  2933. });
  2934. }, r3.subtypes = function(t5, r4) {
  2935. return v4(t5, r4, function(t6, r5, o4) {
  2936. if (G(o4, 1, 1), Y(o4[0])) {
  2937. const t7 = Ae(o4[0]);
  2938. return t7 ? d2.convertObjectToArcadeDictionary(t7) : null;
  2939. }
  2940. throw new Error("Invalid Parameter");
  2941. });
  2942. }, r3.subtypecode = function(t5, r4) {
  2943. return v4(t5, r4, function(t6, r5, n3) {
  2944. if (G(n3, 1, 1), Y(n3[0])) {
  2945. const t7 = Ae(n3[0]);
  2946. if (!t7)
  2947. return null;
  2948. if (t7.subtypeField && n3[0].hasField(t7.subtypeField)) {
  2949. const r6 = n3[0].field(t7.subtypeField);
  2950. for (const n4 of t7.subtypes)
  2951. if (n4.code === r6)
  2952. return n4.code;
  2953. return null;
  2954. }
  2955. return null;
  2956. }
  2957. throw new Error("Invalid Parameter");
  2958. });
  2959. }, r3.subtypename = function(t5, r4) {
  2960. return v4(t5, r4, function(t6, r5, n3) {
  2961. if (G(n3, 1, 1), Y(n3[0])) {
  2962. const t7 = Ae(n3[0]);
  2963. if (!t7)
  2964. return "";
  2965. if (t7.subtypeField && n3[0].hasField(t7.subtypeField)) {
  2966. const r6 = n3[0].field(t7.subtypeField);
  2967. for (const n4 of t7.subtypes)
  2968. if (n4.code === r6)
  2969. return n4.name;
  2970. return "";
  2971. }
  2972. return "";
  2973. }
  2974. throw new Error("Invalid Parameter");
  2975. });
  2976. }, r3.gdbversion = function(t5, r4) {
  2977. return v4(t5, r4, function(t6, r5, n3) {
  2978. if (G(n3, 1, 1), Y(n3[0]))
  2979. return n3[0].gdbVersion();
  2980. throw new Error("Invalid Parameter");
  2981. });
  2982. }, r3.domain = function(t5, r4) {
  2983. return v4(t5, r4, function(t6, r5, i5) {
  2984. if (G(i5, 2, 3), Y(i5[0])) {
  2985. const t7 = je(i5[0], X(i5[1]), i5[2] === void 0 ? void 0 : ne(i5[2]));
  2986. return t7 && t7.domain ? t7.domain.type === "coded-value" || t7.domain.type === "codedValue" ? d2.convertObjectToArcadeDictionary({ type: "codedValue", name: t7.domain.name, dataType: P[t7.field.type], codedValues: t7.domain.codedValues.map((t8) => ({ name: t8.name, code: t8.code })) }) : d2.convertObjectToArcadeDictionary({ type: "range", name: t7.domain.name, dataType: P[t7.field.type], min: t7.domain.min, max: t7.domain.max }) : null;
  2987. }
  2988. throw new Error("Invalid Parameter");
  2989. });
  2990. }, r3.domainname = function(t5, r4) {
  2991. return v4(t5, r4, function(t6, r5, n3) {
  2992. if (G(n3, 2, 4), Y(n3[0]))
  2993. return Re(n3[0], X(n3[1]), n3[2], n3[3] === void 0 ? void 0 : ne(n3[3]));
  2994. throw new Error("Invalid Parameter");
  2995. });
  2996. }, r3.domaincode = function(t5, r4) {
  2997. return v4(t5, r4, function(t6, r5, n3) {
  2998. if (G(n3, 2, 4), Y(n3[0]))
  2999. return Fe(n3[0], X(n3[1]), n3[2], n3[3] === void 0 ? void 0 : ne(n3[3]));
  3000. throw new Error("Invalid Parameter");
  3001. });
  3002. }, r3.urlencode = function(t5, r4) {
  3003. return v4(t5, r4, function(t6, r5, a2) {
  3004. if (G(a2, 1, 1), a2[0] === null)
  3005. return "";
  3006. if (a2[0] instanceof d2) {
  3007. let t7 = "";
  3008. for (const r6 of a2[0].keys()) {
  3009. const n3 = a2[0].field(r6);
  3010. t7 !== "" && (t7 += "&"), t7 += n3 === null ? encodeURIComponent(r6) + "=" : encodeURIComponent(r6) + "=" + encodeURIComponent(n3);
  3011. }
  3012. return t7;
  3013. }
  3014. return encodeURIComponent(X(a2[0]));
  3015. });
  3016. }, r3.hash = function(t5, r4) {
  3017. return v4(t5, r4, function(t6, r5, n3) {
  3018. G(n3, 1, 1);
  3019. const o4 = new i4(0);
  3020. return S3(n3[0], o4, { map: new Map(), currentLength: 0 }), o4.digest();
  3021. });
  3022. }, r3.convertdirection = function(t5, r4) {
  3023. return v4(t5, r4, function(t6, r5, n3) {
  3024. return G(n3, 3, 3), me(n3[0], n3[1], n3[2]);
  3025. });
  3026. }, r3.fromjson = function(t5, r4) {
  3027. return v4(t5, r4, function(t6, r5, a2) {
  3028. if (G(a2, 1, 1), w(a2[0]) === false)
  3029. throw new Error("Invalid Parameter");
  3030. return d2.convertJsonToArcade(JSON.parse(X(a2[0])));
  3031. });
  3032. }, r3.expects = function(t5, r4) {
  3033. return v4(t5, r4, function(t6, r5, n3) {
  3034. if (n3.length < 1)
  3035. throw new Error("Function called with wrong number of Parameters");
  3036. return j2;
  3037. });
  3038. }, r3.tocharcode = function(t5, r4) {
  3039. return v4(t5, r4, function(t6, r5, n3) {
  3040. G(n3, 1, 2);
  3041. const i5 = ne(I(n3[1], 0)), u3 = X(n3[0]);
  3042. if (u3.length === 0 && n3.length === 1)
  3043. return null;
  3044. if (u3.length <= i5 || i5 < 0)
  3045. throw new Error("Illegal argument");
  3046. return u3.charCodeAt(i5);
  3047. });
  3048. }, r3.tocodepoint = function(t5, r4) {
  3049. return v4(t5, r4, function(t6, r5, n3) {
  3050. G(n3, 1, 2);
  3051. const i5 = ne(I(n3[1], 0)), u3 = X(n3[0]);
  3052. if (u3.length === 0 && n3.length === 1)
  3053. return null;
  3054. if (u3.length <= i5 || i5 < 0)
  3055. throw new Error("Illegal argument");
  3056. return u3.codePointAt(i5);
  3057. });
  3058. }, r3.fromcharcode = function(t5, r4) {
  3059. return v4(t5, r4, function(t6, r5, n3) {
  3060. if (n3.length < 1)
  3061. throw new Error("Function called with wrong number of Parameters");
  3062. const e4 = n3.map((t7) => Math.trunc(ne(t7))).filter((t7) => t7 >= 0 && t7 <= 65535);
  3063. return e4.length === 0 ? null : String.fromCharCode.apply(null, e4);
  3064. });
  3065. }, r3.fromcodepoint = function(t5, r4) {
  3066. return v4(t5, r4, function(t6, r5, n3) {
  3067. if (n3.length < 1)
  3068. throw new Error("Function called with wrong number of Parameters");
  3069. let e4;
  3070. try {
  3071. e4 = n3.map((t7) => Math.trunc(ne(t7))).filter((t7) => t7 <= 1114111 && t7 >>> 0 === t7);
  3072. } catch (o4) {
  3073. return null;
  3074. }
  3075. return e4.length === 0 ? null : String.fromCodePoint.apply(null, e4);
  3076. });
  3077. };
  3078. }
  3079. export {
  3080. r,
  3081. p4 as p,
  3082. u,
  3083. f2 as f,
  3084. d5 as d,
  3085. S,
  3086. E2 as E,
  3087. b,
  3088. A,
  3089. I2 as I,
  3090. h,
  3091. m4 as m,
  3092. y2 as y,
  3093. P4 as P,
  3094. N4 as N,
  3095. o2 as o,
  3096. O4 as O
  3097. };
  3098. //# sourceMappingURL=chunk-IT2TKXNZ.js.map