@arcgis/core 4.28.0-next.20230912 → 4.28.0-next.20230913

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/arcade/featureset/support/errorsupport.js +1 -1
  2. package/arcade.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{aa78ca83a4b582b6c2b6.js → 6d94b358e8d1cf79bba3.js} +1 -1
  5. package/assets/esri/core/workers/chunks/8aa7e994b74f66522c37.js +1 -0
  6. package/assets/esri/core/workers/chunks/a047fcf3c7307a69b63c.js +1 -0
  7. package/assets/esri/core/workers/chunks/c51233ad51823cb98c35.js +1 -0
  8. package/assets/esri/core/workers/chunks/dbf343d1fb746f99bb6e.js +1 -0
  9. package/assets/esri/core/workers/chunks/{271ec1d1666bf6dc3dda.js → dc74b4ec85e8e3de5b27.js} +1 -1
  10. package/assets/esri/themes/base/widgets/_Sketch.scss +0 -5
  11. package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +0 -5
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/core/promiseUtils.js +1 -1
  16. package/core/sql/DateOnly.js +1 -1
  17. package/core/sql/TimeOnly.js +1 -1
  18. package/interfaces.d.ts +190 -144
  19. package/layers/SceneLayer.js +1 -1
  20. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  21. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  22. package/layers/support/TilemapCache.js +1 -1
  23. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  24. package/layers/video/VideoController.js +1 -1
  25. package/package.json +1 -1
  26. package/support/revision.js +1 -1
  27. package/views/2d/engine/webgl/DisplayId.js +1 -1
  28. package/views/2d/engine/webgl/Utils.js +1 -1
  29. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  30. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  31. package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
  32. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  33. package/views/3d/analysis/Dimension/settings.js +1 -1
  34. package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
  35. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  36. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  37. package/views/animation/easing.js +1 -1
  38. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  39. package/widgets/Feature/FeatureMedia.js +1 -1
  40. package/widgets/Features.js +1 -1
  41. package/widgets/support/SketchTooltipControls/SketchTooltipControlsViewModel.js +1 -1
  42. package/widgets/support/SketchTooltipControls.js +1 -1
  43. package/widgets/support/SnappingControls.js +1 -1
  44. package/assets/esri/core/workers/chunks/15056f91d87f11b00bcc.js +0 -1
  45. package/assets/esri/core/workers/chunks/877302d6e39a0d530aab.js +0 -1
  46. package/assets/esri/core/workers/chunks/aedb1f944b332b098933.js +0 -1
  47. package/assets/esri/core/workers/chunks/c8dd21a332559c99815c.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8592],{48853:(e,t,r)=>{r.d(t,{Qn:()=>m,iG:()=>d});var n,s=r(27535),o=r(17126);class a{}a.instance=new o.vF("Etc/UTC"),(n||(n={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const i={[n.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class c extends Error{constructor(e,t){super((0,s.Hy)(i[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,c)}}function u(e,t,r){return e<t?e-t:e>r?e-r:0}function l(e,t,r){return e<t?t:e>r?r:e}class d{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,r=1,n=0,s=0,a=0,i=0,c){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(a)||isNaN(i))return null;const h=o.ou.local(e,t).daysInMonth;let f=o.ou.fromObject({day:l(r,1,h),year:e,month:l(t,1,12),hour:l(n,0,23),minute:l(s,0,59),second:l(a,0,59),millisecond:l(i,0,999)},{zone:m(c)});return f=f.plus({months:u(t,1,12),days:u(r,1,h),hours:u(n,0,23),minutes:u(s,0,59),seconds:u(a,0,59),milliseconds:u(i,0,999)}),new d(f)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const r=m(t);return e.isUnknownTimeZone||r===a.instance?d.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new d(e._date.setZone(t))}static dateJSToArcadeDate(e){return new d(o.ou.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){return new d(o.ou.fromJSDate(e,{zone:t}))}static unknownEpochToArcadeDate(e){return new d(o.ou.fromMillis(e,{zone:a.instance}))}static unknownDateJSToArcadeDate(e){return new d(o.ou.fromMillis(e.getTime(),{zone:a.instance}))}static epochToArcadeDate(e,t="system"){return new d(o.ou.fromMillis(e,{zone:t}))}static dateTimeToArcadeDate(e){return new d(e)}clone(){return new d(this._date)}changeTimeZone(e){const t=m(e);return d.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const r=m(t);return e.zone===a.instance||r===a.instance?d.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new d(e.setZone(r))}static nowToArcadeDate(e){return new d(o.ou.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new d(o.ou.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===d.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===a.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new d(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new d(this._date.toUTC())}toLocal(){return new d(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=o.ou.fromISO(e,{setZone:!0});return new d(t)}}function m(e,t=!0){if(e instanceof o.ld)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return a.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=o.Qf.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const r=o.vF.create(e);if(!r.isValid){if(t)throw new c(n.TimeZoneNotRecognized);return null}return r}},27535:(e,t,r)=>{var n;r.d(t,{Hy:()=>d,OF:()=>u,TD:()=>h,Tu:()=>p,VO:()=>m,aV:()=>i,kq:()=>l,rH:()=>n}),function(e){e.AsyncNotEnabled="AsyncNotEnabled",e.ModulesNotSupported="ModulesNotSupported",e.CircularModules="CircularModules",e.CannotCompareDateAndTime="CannotCompareDateAndTime",e.NeverReach="NeverReach",e.UnsupportedHashType="UnsupportedHashType",e.InvalidParameter="InvalidParameter",e.UnexpectedToken="UnexpectedToken",e.Unrecognized="Unrecognized",e.UnrecognizedType="UnrecognizedType",e.MaximumCallDepth="MaximumCallDepth",e.BooleanConditionRequired="BooleanConditionRequired",e.TypeNotAllowedInFeature="TypeNotAllowedInFeature",e.KeyMustBeString="KeyMustBeString",e.WrongNumberOfParameters="WrongNumberOfParameters",e.CallNonFunction="CallNonFunction",e.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",e.NoFunctionInDictionary="NoFunctionInDictionary",e.NoFunctionInArray="NoFunctionInArray",e.AssignModuleFunction="AssignModuleFunction",e.LogicExpressionOrAnd="LogicExpressionOrAnd",e.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",e.FunctionNotFound="FunctionNotFound",e.InvalidMemberAccessKey="InvalidMemberAccessKey",e.UnsupportedUnaryOperator="UnsupportUnaryOperator",e.InvalidIdentifier="InvalidIdentifier",e.MemberOfNull="MemberOfNull",e.UnsupportedOperator="UnsupportedOperator",e.Cancelled="Cancelled",e.ModuleAccessorMustBeString="ModuleAccessorMustBeString",e.ModuleExportNotFound="ModuleExportNotFound",e.Immutable="Immutable",e.OutOfBounds="OutOfBounds",e.IllegalResult="IllegalResult",e.FieldNotFound="FieldNotFound",e.PortalRequired="PortalRequired",e.LogicError="LogicError",e.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",e.KeyAccessorMustBeString="KeyAccessorMustBeString",e.WrongSpatialReference="WrongSpatialReference",e.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",e.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"}(n||(n={}));const s={[n.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[n.LogicError]:"Logic error - {reason}",[n.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[n.NeverReach]:"Encountered unreachable logic",[n.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[n.ModuleAccessorMustBeString]:"Module accessor must be a string",[n.ModuleExportNotFound]:"Module has no export with provided identifier",[n.ModulesNotSupported]:"Current profile does not support modules",[n.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[n.FunctionNotFound]:"Function not found",[n.FieldNotFound]:"Key not found - {key}",[n.CircularModules]:"Circular module dependencies are not allowed",[n.Cancelled]:"Execution cancelled",[n.UnsupportedHashType]:"Type not supported in hash function",[n.IllegalResult]:"Value is not a supported return type",[n.PortalRequired]:"Portal is required",[n.InvalidParameter]:"Invalid parameter",[n.WrongNumberOfParameters]:"Call with wrong number of parameters",[n.Unrecognized]:"Unrecognized code structure",[n.UnrecognizedType]:"Unrecognized type",[n.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[n.BooleanConditionRequired]:"Conditions must use booleans",[n.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[n.NoFunctionInArray]:"Arrays cannot contain functions.",[n.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[n.KeyAccessorMustBeString]:"Accessor must be a string",[n.KeyMustBeString]:"Object keys must be a string",[n.Immutable]:"Object is immutable",[n.UnexpectedToken]:"Unexpected token",[n.MemberOfNull]:"Cannot access property of null object",[n.MaximumCallDepth]:"Exceeded maximum function depth",[n.OutOfBounds]:"Out of bounds",[n.InvalidIdentifier]:"Identifier not recognized",[n.CallNonFunction]:"Expression is not a function",[n.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[n.AssignModuleFunction]:"Cannot assign function to module variable",[n.UnsupportedUnaryOperator]:"Unsupported unary operator",[n.UnsupportedOperator]:"Unsupported operator",[n.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[n.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[n.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[n.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly"};class o extends Error{constructor(...e){super(...e)}}class a extends o{constructor(e,t){super(c(t)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,a),t&&t.loc&&(this.loc=t.loc)}}class i extends Error{constructor(e,t,r,n){super("Execution error - "+c(r)+d(s[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,i),r&&r.loc&&(this.loc=r.loc)}}function c(e){return e&&e.loc?`Line : ${e.loc.start?.line}, ${e.loc.start?.column}: `:""}class u extends Error{constructor(e,t,r,n){super("Compilation error - "+c(r)+d(s[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,u),r&&r.loc&&(this.loc=r.loc)}}class l extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,l)}}function d(e,t){try{if(!t)return e;for(const r in t){let n=t[r];n||(n=""),e=e.replace("{"+r+"}",t[r])}}catch(e){}return e}function m(e,t,r){return"esri.arcade.arcadeexecutionerror"===r.declaredRootClass||"esri.arcade.arcadecompilationerror"===r.declaredRootClass?null===r.loc&&t&&t.loc?new a(r,{cause:r}):r:("esri.arcade.featureset.support.featureseterror"===r.declaredRootClass||"esri.arcade.featureset.support.sqlerror"===r.declaredRootClass||r.declaredRootClass,t&&t.loc?new a(r,{cause:r}):r)}var h;!function(e){e.UnrecognizedUri="UnrecognizedUri",e.UnsupportedUriProtocol="UnsupportedUriProtocol"}(h||(h={}));const f={[h.UnrecognizedUri]:"Unrecognized uri - {uri}",[h.UnsupportedUriProtocol]:"Unrecognized uri protocol"};class p extends Error{constructor(e,t){super(d(f[e],t)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,p)}}},77286:(e,t,r)=>{r.d(t,{EI:()=>s,Lz:()=>a,SV:()=>o,U:()=>c,r1:()=>i});var n=r(6570);function s(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function o(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new n.Z({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function a(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function i(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function c(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},22641:(e,t,r)=>{r.d(t,{u:()=>i});var n=r(48853),s=r(70171),o=r(17126);function a(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const n of e.match(r)||[])switch(n){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=n;break;default:n.length>=2&&"["===n.slice(0,1)&&"]"===n.slice(-1)?t+=`'${n.slice(1,-1)}'`:t+=`'${n}'`}return t}class i{constructor(e,t,r){this._year=e,this._month=t,this._day=r}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof i&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new i(this._year,this._month,this._day)}toDateTime(e){return o.ou.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,n.Qn)(e)})}toDateTimeLuxon(e){return o.ou.fromObject({day:this.day,month:this.month,year:this.year},{zone:e})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null){if(null===e||""===e)return this.toString();if(!(e=a(e)))return"";const t=this.toDateTime("unknown");return n.iG.dateTimeToArcadeDate(t).toFormat(e,{locale:(0,s.Kd)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.iG.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(e,t){switch(e){case"days":case"years":case"months":t=Math.trunc(t);break;case"hours":t=Math.trunc(t)/24,e="days";break;case"minutes":t=Math.trunc(t/1440),e="days";break;case"seconds":t=Math.trunc(t/86400),e="days";break;case"milliseconds":t=Math.trunc(t/864e5),e="days"}return i.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return o.ou.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=o.ou.fromMillis(e,{zone:o.Qf.utcInstance});return t.isValid?i.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=o.ou.fromSeconds(e,{zone:o.Qf.utcInstance});return t.isValid?i.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new i(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,r){const n=new i(e,t,r);return!1===n.isValid?null:n}static fromDateJS(e){return i.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return i.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const r=[];if(t)(t=a(t))&&r.push(t);else if(null===t||""===t){const t=o.ou.fromISO(e,{setZone:!0});return t.isValid?i.fromParts(t.year,t.month,t.day):null}for(const n of r){const r=o.ou.fromFormat(e,t??n);if(r.isValid)return new i(r.year,r.month,r.day)}return null}static fromNow(e="system"){const t=o.ou.fromJSDate(new Date).setZone(e);return new i(t.year,t.month,t.day)}}},53970:(e,t,r)=>{r.d(t,{n:()=>i});var n=r(77286),s=r(70171),o=r(17126);function a(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let r="";for(const n of e.match(t)||[])switch(n){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":r+=n;break;case"A":case"a":r+="a";break;default:r+=`'${n}'`}return r}class i{constructor(e,t,r,n){this._hour=e,this._minute=t,this._second=r,this._millisecond=n}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof i&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new i(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,n.U)(this.hour)&&(0,n.U)(this.minute)&&(0,n.U)(this.second)&&(0,n.U)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=a(e))?o.ou.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,s.Kd)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,r,n){const s=new i(e,t,r,n);return s.isValid()?s:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new i(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),r=Math.floor(e/6e4%60),n=Math.floor(e/36e5%24),s=Math.floor(e%1e3);return new i(n,r,t,s)}static fromDateJS(e){return new i(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new i(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const r=[];t?(t=a(t))&&r.push(t):null!==t&&""!==t||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const t of r){const r=o.ou.fromFormat(e,t);if(r.isValid)return new i(r.hour,r.minute,r.second,r.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return i.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return o.ou.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},70171:(e,t,r)=>{r.d(t,{G3:()=>c,Kd:()=>i,Ze:()=>m,qe:()=>l});var n=r(50758);let s;const o=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function a(){return o??globalThis.navigator?.language??"en"}function i(){return void 0===s&&(s=a()),s}function c(e=i()){const t=/^([a-zA-Z]{2,3})(?:[_\-]\w+)*$/.exec(e);return t?.[1].toLowerCase()}const u=[];function l(e){return u.push(e),(0,n.kB)((()=>u.splice(u.indexOf(e),1)))}const d=[];function m(e){return d.push(e),(0,n.kB)((()=>u.splice(d.indexOf(e),1)))}globalThis.addEventListener?.("languagechange",(function(){const e=a();s!==e&&(s=e,[...d].forEach((t=>{t.call(null,e)})),[...u].forEach((t=>{t.call(null,e)})))}))}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8592],{48853:(e,t,r)=>{r.d(t,{Qn:()=>m,iG:()=>d});var n,s=r(27535),o=r(17126);class a{}a.instance=new o.vF("Etc/UTC"),(n||(n={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const i={[n.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class c extends Error{constructor(e,t){super((0,s.Hy)(i[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,c)}}function u(e,t,r){return e<t?e-t:e>r?e-r:0}function l(e,t,r){return e<t?t:e>r?r:e}class d{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,r=1,n=0,s=0,a=0,i=0,c){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(a)||isNaN(i))return null;const h=o.ou.local(e,t).daysInMonth;let f=o.ou.fromObject({day:l(r,1,h),year:e,month:l(t,1,12),hour:l(n,0,23),minute:l(s,0,59),second:l(a,0,59),millisecond:l(i,0,999)},{zone:m(c)});return f=f.plus({months:u(t,1,12),days:u(r,1,h),hours:u(n,0,23),minutes:u(s,0,59),seconds:u(a,0,59),milliseconds:u(i,0,999)}),new d(f)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const r=m(t);return e.isUnknownTimeZone||r===a.instance?d.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new d(e._date.setZone(t))}static dateJSToArcadeDate(e){return new d(o.ou.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){return new d(o.ou.fromJSDate(e,{zone:t}))}static unknownEpochToArcadeDate(e){return new d(o.ou.fromMillis(e,{zone:a.instance}))}static unknownDateJSToArcadeDate(e){return new d(o.ou.fromMillis(e.getTime(),{zone:a.instance}))}static epochToArcadeDate(e,t="system"){return new d(o.ou.fromMillis(e,{zone:t}))}static dateTimeToArcadeDate(e){return new d(e)}clone(){return new d(this._date)}changeTimeZone(e){const t=m(e);return d.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const r=m(t);return e.zone===a.instance||r===a.instance?d.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new d(e.setZone(r))}static nowToArcadeDate(e){return new d(o.ou.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new d(o.ou.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===d.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===a.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new d(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new d(this._date.toUTC())}toLocal(){return new d(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=o.ou.fromISO(e,{setZone:!0});return new d(t)}}function m(e,t=!0){if(e instanceof o.ld)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return a.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=o.Qf.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const r=o.vF.create(e);if(!r.isValid){if(t)throw new c(n.TimeZoneNotRecognized);return null}return r}},27535:(e,t,r)=>{var n;r.d(t,{Hy:()=>d,OF:()=>u,TD:()=>h,Tu:()=>p,VO:()=>m,aV:()=>i,kq:()=>l,rH:()=>n}),function(e){e.AsyncNotEnabled="AsyncNotEnabled",e.ModulesNotSupported="ModulesNotSupported",e.CircularModules="CircularModules",e.CannotCompareDateAndTime="CannotCompareDateAndTime",e.NeverReach="NeverReach",e.UnsupportedHashType="UnsupportedHashType",e.InvalidParameter="InvalidParameter",e.UnexpectedToken="UnexpectedToken",e.Unrecognized="Unrecognized",e.UnrecognizedType="UnrecognizedType",e.MaximumCallDepth="MaximumCallDepth",e.BooleanConditionRequired="BooleanConditionRequired",e.TypeNotAllowedInFeature="TypeNotAllowedInFeature",e.KeyMustBeString="KeyMustBeString",e.WrongNumberOfParameters="WrongNumberOfParameters",e.CallNonFunction="CallNonFunction",e.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",e.NoFunctionInDictionary="NoFunctionInDictionary",e.NoFunctionInArray="NoFunctionInArray",e.AssignModuleFunction="AssignModuleFunction",e.LogicExpressionOrAnd="LogicExpressionOrAnd",e.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",e.FunctionNotFound="FunctionNotFound",e.InvalidMemberAccessKey="InvalidMemberAccessKey",e.UnsupportedUnaryOperator="UnsupportUnaryOperator",e.InvalidIdentifier="InvalidIdentifier",e.MemberOfNull="MemberOfNull",e.UnsupportedOperator="UnsupportedOperator",e.Cancelled="Cancelled",e.ModuleAccessorMustBeString="ModuleAccessorMustBeString",e.ModuleExportNotFound="ModuleExportNotFound",e.Immutable="Immutable",e.OutOfBounds="OutOfBounds",e.IllegalResult="IllegalResult",e.FieldNotFound="FieldNotFound",e.PortalRequired="PortalRequired",e.LogicError="LogicError",e.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",e.KeyAccessorMustBeString="KeyAccessorMustBeString",e.WrongSpatialReference="WrongSpatialReference",e.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",e.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"}(n||(n={}));const s={[n.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[n.LogicError]:"Logic error - {reason}",[n.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[n.NeverReach]:"Encountered unreachable logic",[n.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[n.ModuleAccessorMustBeString]:"Module accessor must be a string",[n.ModuleExportNotFound]:"Module has no export with provided identifier",[n.ModulesNotSupported]:"Current profile does not support modules",[n.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[n.FunctionNotFound]:"Function not found",[n.FieldNotFound]:"Key not found - {key}",[n.CircularModules]:"Circular module dependencies are not allowed",[n.Cancelled]:"Execution cancelled",[n.UnsupportedHashType]:"Type not supported in hash function",[n.IllegalResult]:"Value is not a supported return type",[n.PortalRequired]:"Portal is required",[n.InvalidParameter]:"Invalid parameter",[n.WrongNumberOfParameters]:"Call with wrong number of parameters",[n.Unrecognized]:"Unrecognized code structure",[n.UnrecognizedType]:"Unrecognized type",[n.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[n.BooleanConditionRequired]:"Conditions must use booleans",[n.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[n.NoFunctionInArray]:"Arrays cannot contain functions.",[n.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[n.KeyAccessorMustBeString]:"Accessor must be a string",[n.KeyMustBeString]:"Object keys must be a string",[n.Immutable]:"Object is immutable",[n.UnexpectedToken]:"Unexpected token",[n.MemberOfNull]:"Cannot access property of null object",[n.MaximumCallDepth]:"Exceeded maximum function depth",[n.OutOfBounds]:"Out of bounds",[n.InvalidIdentifier]:"Identifier not recognized",[n.CallNonFunction]:"Expression is not a function",[n.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[n.AssignModuleFunction]:"Cannot assign function to module variable",[n.UnsupportedUnaryOperator]:"Unsupported unary operator",[n.UnsupportedOperator]:"Unsupported operator",[n.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[n.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[n.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[n.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly"};class o extends Error{constructor(...e){super(...e)}}class a extends o{constructor(e,t){super(c(t)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,a),t&&t.loc&&(this.loc=t.loc)}}class i extends Error{constructor(e,t,r,n){super("Execution error - "+c(r)+d(s[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,i),r&&r.loc&&(this.loc=r.loc)}}function c(e){return e&&e.loc?`Line : ${e.loc.start?.line}, ${e.loc.start?.column}: `:""}class u extends Error{constructor(e,t,r,n){super("Compilation error - "+c(r)+d(s[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,u),r&&r.loc&&(this.loc=r.loc)}}class l extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,l)}}function d(e,t){try{if(!t)return e;for(const r in t){let n=t[r];n||(n=""),e=e.replace("{"+r+"}",t[r])}}catch(e){}return e}function m(e,t,r){return"esri.arcade.arcadeexecutionerror"===r.declaredRootClass||"esri.arcade.arcadecompilationerror"===r.declaredRootClass?null===r.loc&&t&&t.loc?new a(r,{cause:r}):r:("esri.arcade.featureset.support.featureseterror"===r.declaredRootClass||"esri.arcade.featureset.support.sqlerror"===r.declaredRootClass||r.declaredRootClass,t&&t.loc?new a(r,{cause:r}):r)}var h;!function(e){e.UnrecognizedUri="UnrecognizedUri",e.UnsupportedUriProtocol="UnsupportedUriProtocol"}(h||(h={}));const f={[h.UnrecognizedUri]:"Unrecognized uri - {uri}",[h.UnsupportedUriProtocol]:"Unrecognized uri protocol"};class p extends Error{constructor(e,t){super(d(f[e],t)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,p)}}},77286:(e,t,r)=>{r.d(t,{EI:()=>s,Lz:()=>a,SV:()=>o,U:()=>c,r1:()=>i});var n=r(6570);function s(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function o(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new n.Z({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function a(e){if(null==e)return null;if("number"==typeof e)return e;let t=e.toLowerCase();switch(t=t.replaceAll(/\s/g,""),t=t.replaceAll("-",""),t){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function i(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function c(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},22641:(e,t,r)=>{r.d(t,{u:()=>i});var n=r(48853),s=r(70171),o=r(17126);function a(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const n of e.match(r)||[])switch(n){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=n;break;default:n.length>=2&&"["===n.slice(0,1)&&"]"===n.slice(-1)?t+=`'${n.slice(1,-1)}'`:t+=`'${n}'`}return t}class i{constructor(e,t,r){this._year=e,this._month=t,this._day=r,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof i&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new i(this._year,this._month,this._day)}toDateTime(e){return o.ou.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,n.Qn)(e)})}toDateTimeLuxon(e){return o.ou.fromObject({day:this.day,month:this.month,year:this.year},{zone:e})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null){if(null===e||""===e)return this.toString();if(!(e=a(e)))return"";const t=this.toDateTime("unknown");return n.iG.dateTimeToArcadeDate(t).toFormat(e,{locale:(0,s.Kd)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.iG.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(e,t){switch(e){case"days":case"years":case"months":t=Math.trunc(t);break;case"hours":t=Math.trunc(t)/24,e="days";break;case"minutes":t=Math.trunc(t/1440),e="days";break;case"seconds":t=Math.trunc(t/86400),e="days";break;case"milliseconds":t=Math.trunc(t/864e5),e="days"}return i.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return o.ou.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=o.ou.fromMillis(e,{zone:o.Qf.utcInstance});return t.isValid?i.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=o.ou.fromSeconds(e,{zone:o.Qf.utcInstance});return t.isValid?i.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new i(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,r){const n=new i(e,t,r);return!1===n.isValid?null:n}static fromDateJS(e){return i.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return i.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const r=[];if(t)(t=a(t))&&r.push(t);else if(null===t||""===t){const t=o.ou.fromISO(e,{setZone:!0});return t.isValid?i.fromParts(t.year,t.month,t.day):null}for(const n of r){const r=o.ou.fromFormat(e,t??n);if(r.isValid)return new i(r.year,r.month,r.day)}return null}static fromNow(e="system"){const t=o.ou.fromJSDate(new Date).setZone(e);return new i(t.year,t.month,t.day)}}},53970:(e,t,r)=>{r.d(t,{n:()=>i});var n=r(77286),s=r(70171),o=r(17126);function a(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let r="";for(const n of e.match(t)||[])switch(n){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":r+=n;break;case"A":case"a":r+="a";break;default:r+=`'${n}'`}return r}class i{constructor(e,t,r,n){this._hour=e,this._minute=t,this._second=r,this._millisecond=n,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof i&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new i(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,n.U)(this.hour)&&(0,n.U)(this.minute)&&(0,n.U)(this.second)&&(0,n.U)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=a(e))?o.ou.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,s.Kd)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,r,n){const s=new i(e,t,r,n);return s.isValid()?s:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new i(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),r=Math.floor(e/6e4%60),n=Math.floor(e/36e5%24),s=Math.floor(e%1e3);return new i(n,r,t,s)}static fromDateJS(e){return new i(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new i(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const r=[];t?(t=a(t))&&r.push(t):null!==t&&""!==t||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const t of r){const r=o.ou.fromFormat(e,t);if(r.isValid)return new i(r.hour,r.minute,r.second,r.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return i.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return o.ou.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},70171:(e,t,r)=>{r.d(t,{G3:()=>c,Kd:()=>i,Ze:()=>m,qe:()=>l});var n=r(50758);let s;const o=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function a(){return o??globalThis.navigator?.language??"en"}function i(){return void 0===s&&(s=a()),s}function c(e=i()){const t=/^([a-zA-Z]{2,3})(?:[_\-]\w+)*$/.exec(e);return t?.[1].toLowerCase()}const u=[];function l(e){return u.push(e),(0,n.kB)((()=>u.splice(u.indexOf(e),1)))}const d=[];function m(e){return d.push(e),(0,n.kB)((()=>u.splice(d.indexOf(e),1)))}globalThis.addEventListener?.("languagechange",(function(){const e=a();s!==e&&(s=e,[...d].forEach((t=>{t.call(null,e)})),[...u].forEach((t=>{t.call(null,e)})))}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8968],{59987:(e,t,r)=>{r.d(t,{EN:()=>c,H9:()=>u,eS:()=>s,f:()=>n});var n,a,i=r(27535);(a=n||(n={})).InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters";const o={[n.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[n.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[n.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[n.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[n.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[n.UnsupportedOperator]:"Unsupported operator - {operator}",[n.UnsupportedSyntax]:"Unsupported syntax - {node}",[n.UnsupportedSqlFunction]:"Sql function not found = {function}",[n.InvalidDataType]:"Invalid sql data type",[n.InvalidDate]:"Invalid date encountered",[n.InvalidOperator]:"Invalid operator encountered",[n.InvalidTime]:"Invalid time encountered",[n.IllegalInterval]:"Illegal interval",[n.FunctionNotRecognized]:"Function not recognized",[n.InvalidTimeStamp]:"Invalid timestamp encountered",[n.InvalidParameterCount]:"Invalid parameter count for call to {name}",[n.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[n.YearMonthIntervals]:"Year-Month Intervals not supported",[n.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.Hy)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}var u;!function(e){e.NeverReach="NeverReach",e.NotImplemented="NotImplemented",e.Cancelled="Cancelled",e.InvalidStatResponse="InvalidStatResponse",e.InvalidRequest="InvalidRequest",e.RequestFailed="RequestFailed",e.MissingFeatures="MissingFeatures",e.AggregationFieldNotFound="AggregationFieldNotFound",e.DataElementsNotFound="DataElementsNotFound"}(u||(u={}));const l={[u.Cancelled]:"Cancelled",[u.InvalidStatResponse]:"Invalid statistics response from service",[u.InvalidRequest]:"Invalid request",[u.RequestFailed]:"Request failed - {reason}",[u.MissingFeatures]:"Missing features",[u.AggregationFieldNotFound]:"Aggregation field not found",[u.DataElementsNotFound]:"Data elements not found on service",[u.NeverReach]:"Encountered unreachable logic",[u.NotImplemented]:"Not implemented"};class c extends Error{constructor(e,t){super((0,i.Hy)(l[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,c)}}},41555:(e,t,r)=>{r.d(t,{H:()=>i});var n=r(17126);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}class i{constructor(e){this._timeStampOffset=e,this._date=null}toDateTime(){return this._date??=n.ou.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return a(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return a(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return i.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new i(n.ou.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new i(e.toISO({includeOffset:!0}))}static fromParts(e,t,r=0,n=0,a=0,o=0,s=0,u=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}`;let d="";o<10&&(d="0");let p=`${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+o.toString()}`;0!==s&&(p+="."+s.toString().padStart(3,"0"));const m=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new i(f+"T"+p+m)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return i.fromDateTime(t)}}},8968:(e,t,r)=>{r.r(t),r.d(t,{WhereClause:()=>ne,defaultAttributeAdapter:()=>me});var n=r(48853),a=r(59987),i=r(80442),o=r(22641),s=r(41555),u=r(53970),l=r(17126);function c(e,t){const r=f[e.toLowerCase()];return null!=r&&t>=r.minParams&&t<=r.maxParams}const f={min:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>m(e[0],"max")},avg:{minParams:1,maxParams:1,evaluate:e=>d(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let r=0;r<e.length;r++){const n=e[r];if(null!==n){if(!p(n))throw new a.eS(a.f.InvalidValueForAggregateFunction);t+=n}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=v(e);return null===t?null:Math.sqrt(t)}(e[0])},count:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].length},var:{minParams:1,maxParams:1,evaluate:e=>v(e[0])}};function d(e){if(null===e)return null;let t=0,r=0;for(let n=0;n<e.length;n++){const i=e[n];if(null!==i){if(!p(i))throw new a.eS(a.f.InvalidValueForAggregateFunction);r++,t+=i}}return 0===r?null:t/e.length}function p(e){return"number"==typeof e}function m(e,t){if(null===e)return null;let r=null,n=null;for(const a of e){let e=a;e=a instanceof o.u||a instanceof u.n?a.toNumber():a instanceof l.ou?a.toMillis():a instanceof s.H?a.toMilliseconds():a,(null===r||"max"===t&&null!==n&&null!==e&&n<=e||"min"===t&&null!==n&&null!==e&&n>=e)&&(r=a,n=e)}return r}function v(e){if(null===e)return null;if(0===(e=e.filter((e=>null!==e))).length)return null;const t=d(e);if(null===t)return null;let r=0;for(const n of e){if(!p(n))throw new a.eS(a.f.InvalidValueForAggregateFunction);r+=(t-n)**2}return r/(e.length-1)}class h{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(e){if(null!==e.precision||null!==e.secondary)throw new a.eS(a.f.PrimarySecondaryQualifiers)}static _parseSecondsComponent(e,t){if(t.includes(".")){const r=t.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(t)}static createFromMilliseconds(e){const t=new h;return t.second=e/1e3,t}static createFromValueAndQualifer(e,t,r){let n=null;const i=new h;if(i.op="-"===r?"-":"+","interval-period"===t.type){h._fixDefaults(t);const r=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new a.eS(a.f.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new a.eS(a.f.IllegalInterval);h._parseSecondsComponent(i,e)}else{if(!r.test(e))throw new a.eS(a.f.IllegalInterval);i[t.period]=parseFloat(e)}}else{if(h._fixDefaults(t.start),h._fixDefaults(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new a.eS(a.f.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(n=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);i[t.start.period]=parseFloat(e.split(" ")[0]),i[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{i[t.start.period]=parseFloat(e.split(" ")[0]);const r=e.split(" ")[1].split(":");i.hour=parseFloat(r[0]),i.minute=parseFloat(r[1])}break;case"second":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{i[t.start.period]=parseFloat(e.split(" ")[0]);const r=e.split(" ")[1].split(":");i.hour=parseFloat(r[0]),i.minute=parseFloat(r[1]),h._parseSecondsComponent(i,r[2])}break;default:throw new a.eS(a.f.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);i.hour=parseFloat(e.split(":")[0]),i.minute=parseFloat(e.split(":")[1]);break;case"second":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{const t=e.split(":");i.hour=parseFloat(t[0]),i.minute=parseFloat(t[1]),h._parseSecondsComponent(i,t[2])}break;default:throw new a.eS(a.f.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new a.eS(a.f.IllegalInterval);if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new a.eS(a.f.IllegalInterval);{const t=e.split(":");i.minute=parseFloat(t[0]),h._parseSecondsComponent(i,t[1])}break;default:throw new a.eS(a.f.IllegalInterval)}}return i}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const w=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,S=/^(\d{1,2}):(\d{1,2})$/,I=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,N=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,O=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function C(e,t){switch(t){case"system":case"local":case null:return l.ou.fromJSDate(e);default:return l.ou.fromJSDate(e).setZone(t)}}function x(e){return"number"==typeof e}function b(e){return"string"==typeof e||e instanceof String}function A(e){return e instanceof h}function E(e){return e instanceof Date}function M(e){return e instanceof l.ou}function F(e){return e instanceof o.u}function R(e){return e instanceof u.n}function _(e){return e instanceof s.H}function D(e){let t=w.exec(e);if(null!==t){const[,e,r,n]=t,i=u.n.fromParts(parseInt(e,10),parseInt(r,10),parseInt(n,10),0);if(null!==i)return i;throw new a.eS(a.f.InvalidTime)}if(t=S.exec(e),null!==t){const[,e,r]=t,n=u.n.fromParts(parseInt(e,10),parseInt(r,10),0,0);if(null!==n)return n;throw new a.eS(a.f.InvalidTime)}if(t=I.exec(e),null!==t){const[,e,r,n,i]=t,o=u.n.fromParts(parseInt(e,10),parseInt(r,10),parseInt(n,10),parseInt(i,10));if(null!==o)return o;throw new a.eS(a.f.InvalidTime)}throw new a.eS(a.f.InvalidTime)}function P(e,t,r=!1){let n=y.exec(e);if(null!==n){const[,e,r,i,o,s,u,c]=n,f=l.ou.fromObject({year:parseInt(e,10),month:parseInt(r,10),day:parseInt(i,10),hour:parseInt(o,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:c?parseInt(c.replace(".",""),10):0},{zone:t});if(!1===f.isValid)throw new a.eS(a.f.InvalidTimeStamp);return f}if(n=T.exec(e),null!==n){const[,e,t,r,i,o,u,l,c,f,d]=n,p=s.H.fromParts(parseInt(e,10),parseInt(t,10),parseInt(r,10),parseInt(i,10),parseInt(o,10),parseInt(u,10),l?parseInt(l.replace(".",""),10):0,"-"===c,parseInt(f,10),parseInt(d,10));if(!1===p.isValid)throw new a.eS(a.f.InvalidTimeStamp);return p}if(n=N.exec(e),null!==n){const[,e,t,r,i,o,u,l,c]=n,f=s.H.fromParts(parseInt(e,10),parseInt(t,10),parseInt(r,10),parseInt(i,10),parseInt(o,10),0,0,"-"===u,parseInt(l,10),parseInt(c,10));if(!1===f.isValid)throw new a.eS(a.f.InvalidTimeStamp);return f}if(n=O.exec(e),null!==n){const[,e,r,i,o,s]=n,u=l.ou.fromObject({year:parseInt(e,10),month:parseInt(r,10),day:parseInt(i,10),hour:parseInt(o,10),minute:parseInt(s,10),second:0},{zone:t});if(!1===u.isValid)throw new a.eS(a.f.InvalidTimeStamp);return u}if(n=g.exec(e),null!==n){const[,e,r,i]=n,o=l.ou.fromObject({year:parseInt(e,10),month:parseInt(r,10),day:parseInt(i,10),hour:0,minute:0,second:0},{zone:t});if(!1===o.isValid)throw new a.eS(a.f.InvalidTimeStamp);return o}throw new a.eS(a.f.InvalidTimeStamp)}function L(e,t){const r=g.exec(e);if(null===r)try{return P(e,t)}catch{throw new a.eS(a.f.InvalidDate)}const[,n,i,s]=r,u=o.u.fromParts(parseInt(n,10),parseInt(i,10),parseInt(s,10));if(null===u)throw new a.eS(a.f.InvalidDate);return u}var U=r(19153);function J(e){return!!M(e)||!!_(e)}function Z(e){if(M(e))return e.toMillis();if(F(e))return e.toNumber();if(_(e))return e.toMilliseconds();throw new a.eS(a.f.InvalidDataType)}function V(e,t,r,n){if(null==e||null==t)return null;if(x(e)){if(x(t))return $(e,t,r);if(b(t))return function(e,t,r){const n=parseFloat(t);if(!isNaN(n))return $(e,n,r);const a=e.toString();switch(r){case"<>":return a!==t;case"=":return a===t;case">":return a>t;case"<":return a<t;case">=":return a>=t;case"<=":return a<=t}}(e,t,r);if(M(i=t)||F(i)||_(i)||R(i))throw new a.eS(a.f.InvalidOperator);if(F(t))throw new a.eS(a.f.InvalidOperator)}else if(b(e)){if(x(t))return function(e,t,r){const n=parseFloat(e);if(!isNaN(n))return $(n,t,r);const a=t.toString();switch(r){case"<>":return e!==a;case"=":return e===a;case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a}}(e,t,r);if(b(t))return function(e,t,r){switch(r){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}(e,t,r);if(M(t))throw new a.eS(a.f.InvalidOperator);if(F(t))throw new a.eS(a.f.InvalidOperator);if(R(t))throw new a.eS(a.f.InvalidOperator);if(_(t))throw new a.eS(a.f.InvalidOperator)}else if(M(e)){if(J(t))return $(Z(e),Z(t),r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(F(t))return function(e,t,r){const n=t.toDateTimeLuxon(e.zone);return $((e=e.startOf("day")).toMillis(),n.toMillis(),r)}(e,t,r);if(R(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator)}else if(F(e)){if(_(t))return function(e,t,r){const n=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),$(n.toMillis(),t.toMilliseconds(),r)}(e,t,r);if(M(t))return function(e,t,r){const n=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),$(n.toMillis(),t.toMillis(),r)}(e,t,r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(F(t))return $(e.toNumber(),t.toNumber(),r);if(R(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator)}else if(R(e)){if(R(t))return $(e.toNumber(),t.toNumber(),r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator);if(F(t))throw new a.eS(a.f.InvalidOperator);if(J(t))throw new a.eS(a.f.InvalidOperator)}else if(_(e)){if(J(t))return $(Z(e),Z(t),r);if(b(t))throw new a.eS(a.f.InvalidOperator);if(F(t))return function(e,t,r){const n=t.toDateTimeLuxon(e.toDateTime().zone);return $((e=e.startOfDay()).toMilliseconds(),n.toMillis(),r)}(e,t,r);if(R(t))throw new a.eS(a.f.InvalidOperator);if(x(t))throw new a.eS(a.f.InvalidOperator)}var i;switch(r){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function $(e,t,r){switch(r){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function H(e,t,r){const n=Y[e.toLowerCase()];if(null==n)throw new a.eS(a.f.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.eS(a.f.InvalidParameterCount,{name:e.toUpperCase()});return n.evaluate(t,r)}function k(e){return"string"==typeof e||e instanceof String}function z(e){return!(E(e)||F(e)||M(e)||R(e)||_(e))}function q(e){return F(e)||R(e)?e.toString():_(e)?e.toSQLValue():M(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):E(e)?q(l.ou.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if(E(t))switch(e.toUpperCase()){case"SECOND":return t.getSeconds();case"MINUTE":return t.getMinutes();case"HOUR":return t.getHours();case"DAY":return t.getDate();case"MONTH":return t.getMonth()+1;case"YEAR":return t.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(M(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new a.eS(a.f.InvalidFunctionParameters,{function:"EXTRACT"})}else if(F(t))switch(e.toUpperCase()){case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new a.eS(a.f.InvalidFunctionParameters,{function:"EXTRACT"})}else if(R(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(_(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes}throw new a.eS(a.f.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,r]=e;return null==t||null==r?null:t.toString().substring(r-1)}if(3===e.length){const[t,r,n]=e;return null==t||null==r||null==n?null:n<=0?"":t.toString().substring(r-1,r+n-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,t])=>null==e||null==t?null:t.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const t=3===e.length,r=t?e[1]:" ",n=t?e[2]:e[1];if(null==r||null==n)return null;const i=`(${(0,U.Qs)(r)})`;switch(e[0]){case"BOTH":return n.replaceAll(new RegExp(`^${i}*|${i}*$`,"g"),"");case"LEADING":return n.replaceAll(new RegExp(`^${i}*`,"g"),"");case"TRAILING":return n.replaceAll(new RegExp(`${i}*$`,"g"),"")}throw new a.eS(a.f.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const t=e[0],r=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*r)/r}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length?parseInt(e[0].toFixed(0),10):parseFloat(e[0].toFixed(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>k(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let r=0;r<e.length;r++){if(null==e[r])return null;t+=e[r].toString()}return t}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const t of e)if(null!==t)return t;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:(e,t)=>V(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const r=e[0],n=e[1];if(null===r)return null;switch(n.type){case"integer":{if(!z(r))throw new a.eS(a.f.CannotCastValue);const e=parseInt(r,10);if(isNaN(e))throw new a.eS(a.f.CannotCastValue);return e}case"smallint":{if(!z(r))throw new a.eS(a.f.CannotCastValue);const e=parseInt(r,10);if(isNaN(e))throw new a.eS(a.f.CannotCastValue);if(e>32767||e<-32767)throw new a.eS(a.f.CannotCastValue);return e}case"float":case"real":{if(!z(r))throw new a.eS(a.f.CannotCastValue);const e=parseFloat(r);if(isNaN(e))throw new a.eS(a.f.CannotCastValue);return e}case"time":return function(e){if(E(e))return u.n.fromDateJS(e);if(M(e))return u.n.fromDateTime(e);if(F(e))throw new a.eS(a.f.CannotCastValue);if(R(e))return e;if(_(e))return u.n.fromSqlTimeStampOffset(e);if(k(e))return D(e);throw new a.eS(a.f.CannotCastValue)}(r);case"date":return function(e){if(E(e))return o.u.fromDateJS(e);if(M(e))return o.u.fromParts(e.year,e.month,e.day);if(F(e))return e;if(R(e))throw new a.eS(a.f.CannotCastValue);if(_(e)&&null===o.u.fromParts(e.year,e.month,e.day))throw new a.eS(a.f.CannotCastValue);if(k(e)){const t=o.u.fromReader(e);if(null!==t&&t.isValid)return t}throw new a.eS(a.f.CannotCastValue)}(r);case"timestamp":return function(e,t,r){if(E(e))return C(e,t);if(M(e))return e.setZone(t);if(F(e))return e.toDateTimeLuxon(t);if(R(e))throw new a.eS(a.f.CannotCastValue);if(_(e))return e;if(k(e))return P(e,t,r);throw new a.eS(a.f.CannotCastValue)}(r,t,!0===n.withtimezone);case"varchar":{const e=q(r);if(e.length>n.size)throw new a.eS(a.f.CannotCastValue);return e}default:throw new a.eS(a.f.InvalidDataType)}}}};function B(e,t,r,n){if("||"===e)return H("concat",[t,r],n);if(null===t||null===r)return null;if(x(t)){if(x(r))return j(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return h.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return h.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return h.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return h.createFromMilliseconds(e/t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(_(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(M(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(b(r))return function(e,t,r){const n=parseFloat(t);if(isNaN(n))throw new a.eS(a.f.InvalidOperator);return j(e,n,r)}(t,r,e);throw new a.eS(a.f.InvalidOperator)}if(F(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.plus("milliseconds",n);case"-":return e.plus("milliseconds",-1*n)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){if("-"===r)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("-"===r)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){if("-"===r)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(R(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.plus("milliseconds",n);case"-":return e.plus("milliseconds",-1*n)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(_(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(M(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(A(t)){if(x(r))return function(e,t,r){switch(r){case"+":return h.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return h.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return h.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return h.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return h.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return h.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return h.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return h.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){if("+"===r)return t.plus("milliseconds",e.valueInMilliseconds());throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(F(r))return function(e,t,r){if("+"===r)return t.plus("milliseconds",e.valueInMilliseconds());throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("+"===r)return t.addMilliseconds(e.valueInMilliseconds());throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){switch(r){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(M(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.plus({milliseconds:n});case"-":return e.minus({milliseconds:n})}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){if("-"===r)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("-"===r)return e.diff(t.toDateTime()).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){if("-"===r)return e.diff(t).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(_(t)){if(x(r))return function(e,t,r){const n=1e3*t*24*60*60;switch(r){case"+":return e.addMilliseconds(n);case"-":return e.addMilliseconds(-1*n)}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(A(r))return function(e,t,r){switch(r){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){if("-"===r)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(_(r))return function(e,t,r){if("-"===r)return e.toDateTime().diff(t.toDateTime()).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(M(r))return function(e,t,r){if("-"===r)return e.toDateTime().diff(t).as("days");throw new a.eS(a.f.InvalidOperator)}(t,r,e);if(b(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();throw new a.eS(a.f.InvalidOperator)}if(b(t)){if(x(r))return function(e,t,r){const n=parseFloat(e);if(isNaN(n))throw new a.eS(a.f.InvalidOperator);return j(n,t,r)}(t,r,e);if(A(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(R(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(F(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(_(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(M(r))return function(e,t,r){throw new a.eS(a.f.InvalidOperator)}();if(b(r))return function(e,t,r){if("+"===r)return e+t;throw new a.eS(a.f.InvalidOperator)}(t,r,e);throw new a.eS(a.f.InvalidOperator)}throw new a.eS(a.f.InvalidOperator)}function j(e,t,r){switch(r){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new a.eS(a.f.InvalidOperator)}r(5732);var Q,G,W={exports:{}};G=function(){function e(t,r,n,a){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,e.prototype),i.expected=r,i.found=n,i.location=a,i.name="SyntaxError",i}function t(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var n,a=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){a=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+o.line+":"+o.column;if(a){var u=this.location.end,l=t("",o.line.toString().length," "),c=a[i.line-1],f=(i.line===u.line?u.column:c.length+1)-i.column||1;r+="\n --\x3e "+s+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+t("",i.column-1," ")+t("",f,"^")}else r+="\n at "+s}return r},e.buildMessage=function(e,t){var r={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return r[e.type](e)}return"Expected "+function(e){var t,r,n=e.map(o);if(n.sort(),n.length>0){for(t=1,r=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){var n,a={},i=(r=void 0!==r?r:{}).grammarSource,o={start:$a},s=$a,u="!",l="=",c=">=",f=">",d="<=",p="<>",m="<",v="!=",h="+",w="-",S="||",I="*",g="/",y="@",T="'",N="N'",O="''",C=".",x="null",b="true",A="false",E="in",M="is",F="like",R="escape",_="not",D="and",P="or",L="between",U="from",J="for",Z="substring",V="extract",$="trim",H="position",k="timestamp",z="date",q="time",Y="leading",B="trailing",j="both",Q="cast",G="as",W="integer",K="smallint",X="float",ee="real",te="varchar",re="to",ne="interval",ae="year",ie="timezone_hour",oe="timezone_minute",se="month",ue="day",le="hour",ce="minute",fe="second",de="case",pe="end",me="when",ve="then",he="else",we=",",Se="(",Ie=")",ge="`",ye=/^[A-Za-z_\x80-\uFFFF]/,Te=/^[A-Za-z0-9_]/,Ne=/^[A-Za-z0-9_.\x80-\uFFFF]/,Oe=/^["]/,Ce=/^[^']/,xe=/^[0-9]/,be=/^[eE]/,Ae=/^[+\-]/,Ee=/^[ \t\n\r]/,Me=/^[^`]/,Fe=Pa("!",!1),Re=Pa("=",!1),_e=Pa(">=",!1),De=Pa(">",!1),Pe=Pa("<=",!1),Le=Pa("<>",!1),Ue=Pa("<",!1),Je=Pa("!=",!1),Ze=Pa("+",!1),Ve=Pa("-",!1),$e=Pa("||",!1),He=Pa("*",!1),ke=Pa("/",!1),ze=La([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),qe=La([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Ye=La([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Be=La(['"'],!1,!1),je=Pa("@",!1),Qe=Pa("'",!1),Ge=Pa("N'",!1),We=Pa("''",!1),Ke=La(["'"],!0,!1),Xe=Pa(".",!1),et=La([["0","9"]],!1,!1),tt=La(["e","E"],!1,!1),rt=La(["+","-"],!1,!1),nt=Pa("NULL",!0),at=Pa("TRUE",!0),it=Pa("FALSE",!0),ot=Pa("IN",!0),st=Pa("IS",!0),ut=Pa("LIKE",!0),lt=Pa("ESCAPE",!0),ct=Pa("NOT",!0),ft=Pa("AND",!0),dt=Pa("OR",!0),pt=Pa("BETWEEN",!0),mt=Pa("FROM",!0),vt=Pa("FOR",!0),ht=Pa("SUBSTRING",!0),wt=Pa("EXTRACT",!0),St=Pa("TRIM",!0),It=Pa("POSITION",!0),gt=Pa("TIMESTAMP",!0),yt=Pa("DATE",!0),Tt=Pa("TIME",!0),Nt=Pa("LEADING",!0),Ot=Pa("TRAILING",!0),Ct=Pa("BOTH",!0),xt=Pa("CAST",!0),bt=Pa("AS",!0),At=Pa("INTEGER",!0),Et=Pa("SMALLINT",!0),Mt=Pa("FLOAT",!0),Ft=Pa("REAL",!0),Rt=Pa("VARCHAR",!0),_t=Pa("TO",!0),Dt=Pa("INTERVAL",!0),Pt=Pa("YEAR",!0),Lt=Pa("TIMEZONE_HOUR",!0),Ut=Pa("TIMEZONE_MINUTE",!0),Jt=Pa("MONTH",!0),Zt=Pa("DAY",!0),Vt=Pa("HOUR",!0),$t=Pa("MINUTE",!0),Ht=Pa("SECOND",!0),kt=Pa("CASE",!0),zt=Pa("END",!0),qt=Pa("WHEN",!0),Yt=Pa("THEN",!0),Bt=Pa("ELSE",!0),jt=Pa(",",!1),Qt=Pa("(",!1),Gt=Pa(")",!1),Wt=La([" ","\t","\n","\r"],!1,!1),Kt=Pa("`",!1),Xt=La(["`"],!0,!1),er=function(e){return e},tr=function(e,t){var r={type:"expression-list"},n=function(e,t,r){return function(e,t){for(var r=[e],n=0;n<t.length;n++)r.push(t[n][3]);return r}(e,t)}(e,t);return r.value=n,r},rr=function(e,t){return Oo(e,t)},nr=function(e,t){return Oo(e,t)},ar=function(e){return function(e,t){return{type:"unary-expression",operator:"NOT",expr:t}}(0,e)},ir=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?Oo(e,t.tail):No(t.op,e,t.right,t.escape)},or=function(e){return{type:"arithmetic",tail:e}},sr=function(e,t){return{op:e+"NOT",right:t}},ur=function(e,t){return{op:e,right:t}},lr=function(e,t,r){return{op:"NOT"+e,right:{type:"expression-list",value:[t,r]}}},cr=function(e,t,r){return{op:e,right:{type:"expression-list",value:[t,r]}}},fr=function(e){return e[0]+" "+e[2]},dr=function(e){return e[0]+" "+e[2]},pr=function(e,t,r){return{op:e,right:t,escape:r.value}},mr=function(e,t){return{op:e,right:t,escape:""}},vr=function(e,t){return{op:e,right:t}},hr=function(e){return{op:e,right:{type:"expression-list",value:[]}}},wr=function(e,t){return{op:e,right:t}},Sr=function(e,t){return Oo(e,t)},Ir=function(e,t){return Oo(e,t)},gr=function(e){return e.paren=!0,e},yr=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:e}},Tr=function(e){return{type:"column-reference",table:"",column:e,delimited:!0}},Nr=function(e){return e},Or=function(e,t){return e+t.join("")},Cr=function(e,t){return e+t.join("")},xr=function(e){return e},br=function(e){return e.join("")},Ar=function(){return'"'},Er=function(e){return{type:"parameter",value:e[1]}},Mr=function(e,t){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:e},t]}}},Fr=function(e,t,r){return{type:"function",name:"substring",args:{type:"expression-list",value:r?[e,t,r[2]]:[e,t]}}},Rr=function(e,t){return{type:"function",name:"cast",args:{type:"expression-list",value:[e,t]}}},_r=function(){return{type:"data-type",value:{type:"integer"}}},Dr=function(){return{type:"data-type",value:{type:"smallint"}}},Pr=function(){return{type:"data-type",value:{type:"float"}}},Lr=function(){return{type:"data-type",value:{type:"real"}}},Ur=function(){return{type:"data-type",value:{type:"date"}}},Jr=function(){return{type:"data-type",value:{type:"timestamp"}}},Zr=function(){return{type:"data-type",value:{type:"time"}}},Vr=function(e){return{type:"data-type",value:{type:"varchar",size:parseInt(e)}}},$r=function(e,t,r){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:e??"BOTH"},t,r]}}},Hr=function(e,t){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:e??"BOTH"},t]}}},kr=function(e,t){return{type:"function",name:"position",args:{type:"expression-list",value:[e,t]}}},zr=function(e,t){return{type:"function",name:e,args:t||{type:"expression-list",value:[]}}},qr=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Da("Timestamp literal is invalid")}(e.value),{type:"timestamp",value:e.value}},Yr=function(e){return"string"===e.type&&function(e){!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)&&Da("Time literal is invalid")}(e.value),{type:"time",value:e.value}},Br=function(e,t,r){return{type:"interval",value:t,qualifier:r,op:e}},jr=function(e,t){return{type:"interval",value:e,qualifier:t,op:""}},Qr=function(e,t){return{type:"interval-qualifier",start:e,end:t}},Gr=function(e,t){return{type:"interval-period",period:e.value,precision:t,secondary:null}},Wr=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},Kr=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},Xr=function(e,t){return{type:"interval-period",period:"second",precision:e,secondary:t}},en=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null}},tn=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},rn=function(e,t){return{type:"interval-period",period:e.value,precision:t,secondary:null}},nn=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},an=function(e,t){return{type:"interval-period",period:"second",precision:e,secondary:t}},on=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null}},sn=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},un=function(){return{type:"string",value:"day"}},ln=function(){return{type:"string",value:"hour"}},cn=function(){return{type:"string",value:"minute"}},fn=function(){return{type:"string",value:"month"}},dn=function(){return{type:"string",value:"year"}},pn=function(e){return parseFloat(e)},mn=function(e){return parseFloat(e)},vn=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&Da("Date literal is invalid")}(e.value),{type:"date",value:e.value}},hn=function(){return{type:"null",value:null}},wn=function(){return{type:"boolean",value:!0}},Sn=function(){return{type:"boolean",value:!1}},In=function(){return"'"},gn=function(e){return{type:"string",value:e.join("")}},yn=function(e,t){return{type:"case-expression",format:"simple",operand:e,clauses:t,else:null}},Tn=function(e,t,r){return{type:"case-expression",format:"simple",operand:e,clauses:t,else:r.value}},Nn=function(e){return{type:"case-expression",format:"searched",clauses:e,else:null}},On=function(e,t){return{type:"case-expression",format:"searched",clauses:e,else:t.value}},Cn=function(e,t){return{type:"when-clause",operand:e,value:t}},xn=function(e,t){return{type:"when-clause",operand:e,value:t}},bn=function(e){return{type:"else-clause",value:e}},An=function(e){return{type:"number",value:e}},En=function(e,t,r){return parseFloat(e+t+r)},Mn=function(e,t){return parseFloat(e+t)},Fn=function(e,t){return parseFloat(e+t)},Rn=function(e){return parseFloat(e)},_n=function(e,t){return e[0]+t},Dn=function(e){return"."+(null!=e?e:"")},Pn=function(e,t){return e+t},Ln=function(e){return e.join("")},Un=function(e,t){return"e"+(null===t?"":t)},Jn=function(){return"IN"},Zn=function(){return"IS"},Vn=function(){return"LIKE"},$n=function(){return"ESCAPE"},Hn=function(){return"NOT"},kn=function(){return"AND"},zn=function(){return"OR"},qn=function(){return"BETWEEN"},Yn=function(){return"FROM"},Bn=function(){return"FOR"},jn=function(){return"SUBSTRING"},Qn=function(){return"EXTRACT"},Gn=function(){return"TRIM"},Wn=function(){return"POSITION"},Kn=function(){return"TIMESTAMP"},Xn=function(){return"DATE"},ea=function(){return"TIME"},ta=function(){return"LEADING"},ra=function(){return"TRAILING"},na=function(){return"BOTH"},aa=function(){return"CAST"},ia=function(){return"AS"},oa=function(){return"INTEGER"},sa=function(){return"SMALLINT"},ua=function(){return"FLOAT"},la=function(){return"REAL"},ca=function(){return"VARCHAR"},fa=function(){return"TO"},da=function(){return"INTERVAL"},pa=function(){return"YEAR"},ma=function(){return"TIMEZONE_HOUR"},va=function(){return"TIMEZONE_MINUTE"},ha=function(){return"MONTH"},wa=function(){return"DAY"},Sa=function(){return"HOUR"},Ia=function(){return"MINUTE"},ga=function(){return"SECOND"},ya=function(){return"CASE"},Ta=function(){return"END"},Na=function(){return"WHEN"},Oa=function(){return"THEN"},Ca=function(){return"ELSE"},xa=function(e){return e},ba=function(e){return e.join("")},Aa=0,Ea=0,Ma=[{line:1,column:1}],Fa=0,Ra=[],_a=0;if("startRule"in r){if(!(r.startRule in o))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=o[r.startRule]}function Da(e,t){throw Va(e,t=void 0!==t?t:Ja(Ea,Aa))}function Pa(e,t){return{type:"literal",text:e,ignoreCase:t}}function La(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ua(e){var r,n=Ma[e];if(n)return n;for(r=e-1;!Ma[r];)r--;for(n={line:(n=Ma[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Ma[e]=n,n}function Ja(e,t,r){var n=Ua(e),a=Ua(t),o={source:i,start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:a.line,column:a.column}};return r&&i&&"function"==typeof i.offset&&(o.start=i.offset(o.start),o.end=i.offset(o.end)),o}function Za(e){Aa<Fa||(Aa>Fa&&(Fa=Aa,Ra=[]),Ra.push(e))}function Va(t,r){return new e(t,null,null,r)}function $a(){var e,t;return e=Aa,go(),(t=ka())!==a?(go(),Ea=e,e=er(t)):(Aa=e,e=a),e}function Ha(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=ka())!==a){for(r=[],n=Aa,i=go(),(o=wo())!==a?(s=go(),(u=ka())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=wo())!==a?(s=go(),(u=ka())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=tr(t,r)}else Aa=e,e=a;return e}function ka(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=za())!==a){for(r=[],n=Aa,i=go(),(o=Di())!==a?(s=go(),(u=za())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=Di())!==a?(s=go(),(u=za())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=rr(t,r)}else Aa=e,e=a;return e}function za(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=qa())!==a){for(r=[],n=Aa,i=go(),(o=_i())!==a?(s=go(),(u=qa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=_i())!==a?(s=go(),(u=qa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=nr(t,r)}else Aa=e,e=a;return e}function qa(){var e,r,n,i,o;return e=Aa,(r=Ri())===a&&(r=Aa,33===t.charCodeAt(Aa)?(n=u,Aa++):(n=a,0===_a&&Za(Fe)),n!==a?(i=Aa,_a++,61===t.charCodeAt(Aa)?(o=l,Aa++):(o=a,0===_a&&Za(Re)),_a--,o===a?i=void 0:(Aa=i,i=a),i!==a?r=n=[n,i]:(Aa=r,r=a)):(Aa=r,r=a)),r!==a?(n=go(),(i=qa())!==a?(Ea=e,e=ar(i)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=function(){var e,t,r;return e=Aa,(t=Qa())!==a?(go(),(r=function(){var e;return(e=function(){var e,t,r,n,i,o,s;if(e=Aa,t=[],r=Aa,n=go(),(i=Ya())!==a?(o=go(),(s=Qa())!==a?r=n=[n,i,o,s]:(Aa=r,r=a)):(Aa=r,r=a),r!==a)for(;r!==a;)t.push(r),r=Aa,n=go(),(i=Ya())!==a?(o=go(),(s=Qa())!==a?r=n=[n,i,o,s]:(Aa=r,r=a)):(Aa=r,r=a);else t=a;return t!==a&&(Ea=e,t=or(t)),t}())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=ja())!==a?(go(),(r=So())!==a?(go(),(n=Ha())!==a?(go(),Io()!==a?(Ea=e,e=vr(t,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=ja())!==a?(go(),(r=So())!==a?(go(),(n=Io())!==a?(Ea=e,e=hr(t)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=ja())!==a?(go(),(r=si())!==a?(Ea=e,e=wr(t,r)):(Aa=e,e=a)):(Aa=e,e=a))),e}())===a&&(e=function(){var e,t,r,n,i,o;return e=Aa,(t=Ri())!==a?(go(),(r=Pi())!==a?(go(),(n=Qa())!==a?(go(),(i=_i())!==a?(go(),(o=Qa())!==a?(Ea=e,e=lr(r,n,o)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=Pi())!==a?(go(),(r=Qa())!==a?(go(),(n=_i())!==a?(go(),(i=Qa())!==a?(Ea=e,e=cr(t,r,i)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=Ei())!==a?(go(),(r=Ri())!==a?(go(),(n=Qa())!==a?(Ea=e,e=sr(t,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ei())!==a?(go(),(r=Qa())!==a?(Ea=e,e=ur(t,r)):(Aa=e,e=a)):(Aa=e,e=a)),e}())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=Ba())!==a?(go(),(r=mi())!==a?(go(),Fi()!==a?(go(),(n=vi())!==a?(Ea=e,e=pr(t,r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ba())!==a?(go(),(r=mi())!==a?(Ea=e,e=mr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)),e}()),e}())===a&&(r=null),Ea=e,e=ir(t,r)):(Aa=e,e=a),e}()),e}function Ya(){var e;return t.substr(Aa,2)===c?(e=c,Aa+=2):(e=a,0===_a&&Za(_e)),e===a&&(62===t.charCodeAt(Aa)?(e=f,Aa++):(e=a,0===_a&&Za(De)),e===a&&(t.substr(Aa,2)===d?(e=d,Aa+=2):(e=a,0===_a&&Za(Pe)),e===a&&(t.substr(Aa,2)===p?(e=p,Aa+=2):(e=a,0===_a&&Za(Le)),e===a&&(60===t.charCodeAt(Aa)?(e=m,Aa++):(e=a,0===_a&&Za(Ue)),e===a&&(61===t.charCodeAt(Aa)?(e=l,Aa++):(e=a,0===_a&&Za(Re)),e===a&&(t.substr(Aa,2)===v?(e=v,Aa+=2):(e=a,0===_a&&Za(Je)))))))),e}function Ba(){var e,t,r,n,i;return e=Aa,t=Aa,(r=Ri())!==a?(n=go(),(i=Mi())!==a?t=r=[r,n,i]:(Aa=t,t=a)):(Aa=t,t=a),t!==a&&(Ea=e,t=fr(t)),(e=t)===a&&(e=Mi()),e}function ja(){var e,t,r,n,i;return e=Aa,t=Aa,(r=Ri())!==a?(n=go(),(i=Ai())!==a?t=r=[r,n,i]:(Aa=t,t=a)):(Aa=t,t=a),t!==a&&(Ea=e,t=dr(t)),(e=t)===a&&(e=Ai()),e}function Qa(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=Wa())!==a){for(r=[],n=Aa,i=go(),(o=Ga())!==a?(s=go(),(u=Wa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=Ga())!==a?(s=go(),(u=Wa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=Sr(t,r)}else Aa=e,e=a;return e}function Ga(){var e;return 43===t.charCodeAt(Aa)?(e=h,Aa++):(e=a,0===_a&&Za(Ze)),e===a&&(45===t.charCodeAt(Aa)?(e=w,Aa++):(e=a,0===_a&&Za(Ve)),e===a&&(t.substr(Aa,2)===S?(e=S,Aa+=2):(e=a,0===_a&&Za($e)))),e}function Wa(){var e,t,r,n,i,o,s,u;if(e=Aa,(t=Xa())!==a){for(r=[],n=Aa,i=go(),(o=Ka())!==a?(s=go(),(u=Xa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);n!==a;)r.push(n),n=Aa,i=go(),(o=Ka())!==a?(s=go(),(u=Xa())!==a?n=i=[i,o,s,u]:(Aa=n,n=a)):(Aa=n,n=a);Ea=e,e=Ir(t,r)}else Aa=e,e=a;return e}function Ka(){var e;return 42===t.charCodeAt(Aa)?(e=I,Aa++):(e=a,0===_a&&Za(He)),e===a&&(47===t.charCodeAt(Aa)?(e=g,Aa++):(e=a,0===_a&&Za(ke))),e}function Xa(){var e,t;return(e=function(){var e;return(e=vi())===a&&(e=function(){var e,t,r,n;return e=Aa,(t=function(){var e,t,r,n;return e=Aa,(t=Ii())!==a&&(r=gi())!==a&&(n=yi())!==a?(Ea=e,e=En(t,r,n)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ii())!==a&&(r=gi())!==a?(Ea=e,e=Mn(t,r)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ii())!==a&&(r=yi())!==a?(Ea=e,e=Fn(t,r)):(Aa=e,e=a),e===a&&(e=Aa,(t=Ii())!==a&&(Ea=e,t=Rn(t)),e=t))),e}())!==a?(r=Aa,_a++,n=ti(),_a--,n===a?r=void 0:(Aa=r,r=a),r!==a?(Ea=e,e=An(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t;return e=Aa,(t=xi())!==a&&(Ea=e,t=wn()),(e=t)===a&&(e=Aa,(t=bi())!==a&&(Ea=e,t=Sn()),e=t),e}())===a&&(e=function(){var e,t;return e=Aa,(t=Ci())!==a&&(Ea=e,t=hn()),t}())===a&&(e=function(){var e,t;return e=Aa,ki()!==a?(go(),(t=mi())!==a?(Ea=e,e=vn(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t;return e=Aa,Hi()!==a?(go(),(t=mi())!==a?(Ea=e,e=qr(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=li())===a&&(e=function(){var e,t;return e=Aa,zi()!==a?(go(),(t=mi())!==a?(Ea=e,e=Yr(t)):(Aa=e,e=a)):(Aa=e,e=a),e}()),e}())===a&&(e=function(){var e,t,r;return e=Aa,Zi()!==a?(go(),So()!==a?(go(),(t=function(){var e;return(e=no())===a&&(e=oo())===a&&(e=so())===a&&(e=uo())===a&&(e=lo())===a&&(e=co())===a&&(e=ao())===a&&(e=io()),e}())!==a?(go(),Li()!==a?(go(),(r=ka())!==a?(go(),Io()!==a?(Ea=e,e=Mr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r,n,i,o,s;return e=Aa,Ji()!==a?(go(),So()!==a?(go(),(t=ka())!==a?(go(),Li()!==a?(go(),(r=ka())!==a?(go(),n=Aa,(i=Ui())!==a?(o=go(),(s=ka())!==a?n=i=[i,o,s,go()]:(Aa=n,n=a)):(Aa=n,n=a),n===a&&(n=null),(i=Io())!==a?(Ea=e,e=Fr(t,r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r,n;return e=Aa,Vi()!==a?(go(),So()!==a?(go(),(t=ui())===a&&(t=null),go(),(r=ka())!==a?(go(),Li()!==a?(go(),(n=ka())!==a?(go(),Io()!==a?(Ea=e,e=$r(t,r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,Vi()!==a?(go(),So()!==a?(go(),(t=ui())===a&&(t=null),go(),(r=ka())!==a?(go(),Io()!==a?(Ea=e,e=Hr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}())===a&&(e=function(){var e,t,r;return e=Aa,$i()!==a?(go(),So()!==a?(go(),(t=ka())!==a?(go(),Ai()!==a?(go(),(r=ka())!==a?(go(),Io()!==a?(Ea=e,e=kr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r;return e=Aa,ji()!==a?(go(),So()!==a?(go(),(t=ka())!==a?(go(),Qi()!==a?(go(),(r=function(){var e,t,r;return e=Aa,(t=Gi())!==a&&(Ea=e,t=_r()),(e=t)===a&&(e=Aa,(t=Wi())!==a&&(Ea=e,t=Dr()),(e=t)===a&&(e=Aa,(t=Ki())!==a&&(Ea=e,t=Pr()),(e=t)===a&&(e=Aa,(t=Xi())!==a&&(Ea=e,t=Lr()),(e=t)===a&&(e=Aa,(t=ki())!==a&&(Ea=e,t=Ur()),(e=t)===a&&(e=Aa,(t=Hi())!==a&&(Ea=e,t=Jr()),(e=t)===a&&(e=Aa,(t=zi())!==a&&(Ea=e,t=Zr()),(e=t)===a&&(e=Aa,(t=eo())!==a?(go(),So()!==a?(go(),(r=Ti())!==a?(go(),Io()!==a?(Ea=e,e=Vr(r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)))))))),e}())!==a?(go(),Io()!==a?(Ea=e,e=Rr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e,t,r;return e=Aa,(t=To())!==a?(go(),So()!==a?(go(),(r=Ha())===a&&(r=null),go(),Io()!==a?(Ea=e,e=zr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}())===a&&(e=function(){var e;return(e=function(){var e,t,r,n,i;if(e=Aa,fo()!==a)if(go(),(t=ka())!==a){for(go(),r=[],n=wi();n!==a;)r.push(n),n=wi();n=go(),(i=po())!==a?(Ea=e,e=yn(t,r)):(Aa=e,e=a)}else Aa=e,e=a;else Aa=e,e=a;if(e===a)if(e=Aa,fo()!==a)if(go(),(t=ka())!==a){for(go(),r=[],n=wi();n!==a;)r.push(n),n=wi();n=go(),(i=Si())!==a?(go(),po()!==a?(Ea=e,e=Tn(t,r,i)):(Aa=e,e=a)):(Aa=e,e=a)}else Aa=e,e=a;else Aa=e,e=a;return e}())===a&&(e=function(){var e,t,r,n;if(e=Aa,fo()!==a){for(go(),t=[],r=hi();r!==a;)t.push(r),r=hi();r=go(),(n=po())!==a?(Ea=e,e=Nn(t)):(Aa=e,e=a)}else Aa=e,e=a;if(e===a)if(e=Aa,fo()!==a){for(go(),t=[],r=hi();r!==a;)t.push(r),r=hi();r=go(),(n=Si())!==a?(go(),po()!==a?(Ea=e,e=On(t,n)):(Aa=e,e=a)):(Aa=e,e=a)}else Aa=e,e=a;return e}()),e}())===a&&(e=function(){var e,t;return e=Aa,(t=function(){var e,t;return e=Aa,(t=function(){var e,t,r,n;if(e=Aa,(t=ti())!==a){for(r=[],n=ni();n!==a;)r.push(n),n=ni();Ea=e,e=Or(t,r)}else Aa=e,e=a;return e}())!==a&&(Ea=e,t=Nr(t)),t}())!==a&&(Ea=e,t=yr(t)),(e=t)===a&&(e=Aa,(t=function(){var e,t;return e=Aa,oi()!==a?(t=function(){var e,t,r;for(e=Aa,t=[],r=ai();r!==a;)t.push(r),r=ai();return Ea=e,br(t)}(),oi()!==a?(Ea=e,e=xr(t)):(Aa=e,e=a)):(Aa=e,e=a),e}())!==a&&(Ea=e,t=Tr(t)),e=t),e}())===a&&(e=si())===a&&(e=Aa,So()!==a?(go(),(t=ka())!==a?(go(),Io()!==a?(Ea=e,e=gr(t)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}function ei(){var e,t,r,n;if(e=Aa,(t=ti())!==a){for(r=[],n=ri();n!==a;)r.push(n),n=ri();Ea=e,e=Cr(t,r)}else Aa=e,e=a;return e}function ti(){var e;return ye.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(ze)),e}function ri(){var e;return Te.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(qe)),e}function ni(){var e;return Ne.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Ye)),e}function ai(){var e;return(e=ii())===a&&(e=function(){var e;return e=Aa,oi()!==a&&oi()!==a?(Ea=e,e=Ar()):(Aa=e,e=a),e}()),e}function ii(){var e;return Ne.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Ye)),e}function oi(){var e;return Oe.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Be)),e}function si(){var e,r,n,i;return e=Aa,r=Aa,64===t.charCodeAt(Aa)?(n=y,Aa++):(n=a,0===_a&&Za(je)),n!==a&&(i=ei())!==a?r=n=[n,i]:(Aa=r,r=a),r!==a&&(Ea=e,r=Er(r)),r}function ui(){var e;return(e=qi())===a&&(e=Yi())===a&&(e=Bi()),e}function li(){var e,r,n,i;return e=Aa,ro()!==a?(go(),45===t.charCodeAt(Aa)?(r=w,Aa++):(r=a,0===_a&&Za(Ve)),r===a&&(43===t.charCodeAt(Aa)?(r=h,Aa++):(r=a,0===_a&&Za(Ze))),r!==a?(go(),(n=mi())!==a?(go(),(i=ci())!==a?(Ea=e,e=Br(r,n,i)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,ro()!==a?(go(),(r=mi())!==a?(go(),(n=ci())!==a?(Ea=e,e=jr(r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)),e}function ci(){var e,t,r;return e=Aa,(t=function(){var e,t,r;return e=Aa,(t=fi())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),Io()!==a?(Ea=e,e=Gr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=fi())!==a&&(Ea=e,t=Wr(t)),e=t),e}())!==a?(go(),to()!==a?(go(),(r=function(){var e,t,r,n;return e=Aa,(t=fi())!==a&&(Ea=e,t=Kr(t)),(e=t)===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),wo()!==a?(go(),(n=di())!==a?(go(),Io()!==a?(Ea=e,e=Xr(r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),Io()!==a?(Ea=e,e=en(r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a&&(Ea=e,t=tn()),e=t))),e}())!==a?(Ea=e,e=Qr(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=function(){var e,t,r,n;return e=Aa,(t=fi())!==a?(go(),So()!==a?(go(),(r=di())!==a?(go(),Io()!==a?(Ea=e,e=rn(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=fi())!==a&&(Ea=e,t=nn(t)),(e=t)===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=pi())!==a?(go(),wo()!==a?(go(),(n=di())!==a?(go(),Io()!==a?(Ea=e,e=an(r,n)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a?(go(),So()!==a?(go(),(r=di())!==a?(go(),Io()!==a?(Ea=e,e=on(r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e===a&&(e=Aa,(t=co())!==a&&(Ea=e,t=sn()),e=t)))),e}()),e}function fi(){var e,t;return e=Aa,(t=so())!==a&&(Ea=e,t=un()),(e=t)===a&&(e=Aa,(t=uo())!==a&&(Ea=e,t=ln()),(e=t)===a&&(e=Aa,(t=lo())!==a&&(Ea=e,t=cn()),(e=t)===a&&(e=Aa,(t=oo())!==a&&(Ea=e,t=fn()),(e=t)===a&&(e=Aa,(t=no())!==a&&(Ea=e,t=dn()),e=t)))),e}function di(){var e,t;return e=Aa,(t=Ti())!==a&&(Ea=e,t=pn(t)),t}function pi(){var e,t;return e=Aa,(t=Ti())!==a&&(Ea=e,t=mn(t)),t}function mi(){var e;return(e=vi())===a&&(e=si()),e}function vi(){var e,r,n,i,o;if(e=Aa,39===t.charCodeAt(Aa)?(r=T,Aa++):(r=a,0===_a&&Za(Qe)),r===a&&(t.substr(Aa,2)===N?(r=N,Aa+=2):(r=a,0===_a&&Za(Ge))),r!==a){for(n=[],i=Aa,t.substr(Aa,2)===O?(o=O,Aa+=2):(o=a,0===_a&&Za(We)),o!==a&&(Ea=i,o=In()),(i=o)===a&&(Ce.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Ke)));i!==a;)n.push(i),i=Aa,t.substr(Aa,2)===O?(o=O,Aa+=2):(o=a,0===_a&&Za(We)),o!==a&&(Ea=i,o=In()),(i=o)===a&&(Ce.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Ke)));39===t.charCodeAt(Aa)?(i=T,Aa++):(i=a,0===_a&&Za(Qe)),i!==a?(Ea=e,e=gn(n)):(Aa=e,e=a)}else Aa=e,e=a;return e}function hi(){var e,t,r;return e=Aa,mo()!==a?(go(),(t=ka())!==a?(go(),vo()!==a?(go(),(r=ka())!==a?(Ea=e,e=Cn(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}function wi(){var e,t,r;return e=Aa,mo()!==a?(go(),(t=ka())!==a?(go(),vo()!==a?(go(),(r=ka())!==a?(Ea=e,e=xn(t,r)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a)):(Aa=e,e=a),e}function Si(){var e,t;return e=Aa,ho()!==a?(go(),(t=ka())!==a?(Ea=e,e=bn(t)):(Aa=e,e=a)):(Aa=e,e=a),e}function Ii(){var e,r,n;return(e=Ti())===a&&(e=Aa,45===t.charCodeAt(Aa)?(r=w,Aa++):(r=a,0===_a&&Za(Ve)),r===a&&(43===t.charCodeAt(Aa)?(r=h,Aa++):(r=a,0===_a&&Za(Ze))),r!==a&&(n=Ti())!==a?(Ea=e,e=_n(r,n)):(Aa=e,e=a)),e}function gi(){var e,r,n;return e=Aa,46===t.charCodeAt(Aa)?(r=C,Aa++):(r=a,0===_a&&Za(Xe)),r!==a?((n=Ti())===a&&(n=null),Ea=e,e=Dn(n)):(Aa=e,e=a),e}function yi(){var e,t,r;return e=Aa,(t=Oi())!==a&&(r=Ti())!==a?(Ea=e,e=Pn(t,r)):(Aa=e,e=a),e}function Ti(){var e,t,r;if(e=Aa,t=[],(r=Ni())!==a)for(;r!==a;)t.push(r),r=Ni();else t=a;return t!==a&&(Ea=e,t=Ln(t)),t}function Ni(){var e;return xe.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(et)),e}function Oi(){var e,r,n;return e=Aa,be.test(t.charAt(Aa))?(r=t.charAt(Aa),Aa++):(r=a,0===_a&&Za(tt)),r!==a?(Ae.test(t.charAt(Aa))?(n=t.charAt(Aa),Aa++):(n=a,0===_a&&Za(rt)),n===a&&(n=null),Ea=e,e=Un(r,n)):(Aa=e,e=a),e}function Ci(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===x?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(nt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?e=r=[r,n]:(Aa=e,e=a)):(Aa=e,e=a),e}function xi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===b?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(at)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?e=r=[r,n]:(Aa=e,e=a)):(Aa=e,e=a),e}function bi(){var e,r,n,i;return e=Aa,t.substr(Aa,5).toLowerCase()===A?(r=t.substr(Aa,5),Aa+=5):(r=a,0===_a&&Za(it)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?e=r=[r,n]:(Aa=e,e=a)):(Aa=e,e=a),e}function Ai(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===E?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(ot)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Jn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ei(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===M?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(st)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Zn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Mi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===F?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(ut)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Vn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Fi(){var e,r,n,i;return e=Aa,t.substr(Aa,6).toLowerCase()===R?(r=t.substr(Aa,6),Aa+=6):(r=a,0===_a&&Za(lt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=$n()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ri(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===_?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(ct)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Hn()):(Aa=e,e=a)):(Aa=e,e=a),e}function _i(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===D?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(ft)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=kn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Di(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===P?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(dt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=zn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Pi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===L?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(pt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=qn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Li(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===U?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(mt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Yn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ui(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===J?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(vt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Bn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ji(){var e,r,n,i;return e=Aa,t.substr(Aa,9).toLowerCase()===Z?(r=t.substr(Aa,9),Aa+=9):(r=a,0===_a&&Za(ht)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=jn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Zi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===V?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(wt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Qn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Vi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===$?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(St)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Gn()):(Aa=e,e=a)):(Aa=e,e=a),e}function $i(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===H?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(It)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Wn()):(Aa=e,e=a)):(Aa=e,e=a),e}function Hi(){var e,r,n,i;return e=Aa,t.substr(Aa,9).toLowerCase()===k?(r=t.substr(Aa,9),Aa+=9):(r=a,0===_a&&Za(gt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Kn()):(Aa=e,e=a)):(Aa=e,e=a),e}function ki(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===z?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(yt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Xn()):(Aa=e,e=a)):(Aa=e,e=a),e}function zi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===q?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Tt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ea()):(Aa=e,e=a)):(Aa=e,e=a),e}function qi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===Y?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(Nt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ta()):(Aa=e,e=a)):(Aa=e,e=a),e}function Yi(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===B?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(Ot)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ra()):(Aa=e,e=a)):(Aa=e,e=a),e}function Bi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===j?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Ct)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=na()):(Aa=e,e=a)):(Aa=e,e=a),e}function ji(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===Q?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(xt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=aa()):(Aa=e,e=a)):(Aa=e,e=a),e}function Qi(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===G?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(bt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ia()):(Aa=e,e=a)):(Aa=e,e=a),e}function Gi(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===W?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(At)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=oa()):(Aa=e,e=a)):(Aa=e,e=a),e}function Wi(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===K?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(Et)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=sa()):(Aa=e,e=a)):(Aa=e,e=a),e}function Ki(){var e,r,n,i;return e=Aa,t.substr(Aa,5).toLowerCase()===X?(r=t.substr(Aa,5),Aa+=5):(r=a,0===_a&&Za(Mt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ua()):(Aa=e,e=a)):(Aa=e,e=a),e}function Xi(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===ee?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Ft)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=la()):(Aa=e,e=a)):(Aa=e,e=a),e}function eo(){var e,r,n,i;return e=Aa,t.substr(Aa,7).toLowerCase()===te?(r=t.substr(Aa,7),Aa+=7):(r=a,0===_a&&Za(Rt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ca()):(Aa=e,e=a)):(Aa=e,e=a),e}function to(){var e,r,n,i;return e=Aa,t.substr(Aa,2).toLowerCase()===re?(r=t.substr(Aa,2),Aa+=2):(r=a,0===_a&&Za(_t)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=fa()):(Aa=e,e=a)):(Aa=e,e=a),e}function ro(){var e,r,n,i;return e=Aa,t.substr(Aa,8).toLowerCase()===ne?(r=t.substr(Aa,8),Aa+=8):(r=a,0===_a&&Za(Dt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=da()):(Aa=e,e=a)):(Aa=e,e=a),e}function no(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===ae?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Pt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=pa()):(Aa=e,e=a)):(Aa=e,e=a),e}function ao(){var e,r,n,i;return e=Aa,t.substr(Aa,13).toLowerCase()===ie?(r=t.substr(Aa,13),Aa+=13):(r=a,0===_a&&Za(Lt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ma()):(Aa=e,e=a)):(Aa=e,e=a),e}function io(){var e,r,n,i;return e=Aa,t.substr(Aa,15).toLowerCase()===oe?(r=t.substr(Aa,15),Aa+=15):(r=a,0===_a&&Za(Ut)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=va()):(Aa=e,e=a)):(Aa=e,e=a),e}function oo(){var e,r,n,i;return e=Aa,t.substr(Aa,5).toLowerCase()===se?(r=t.substr(Aa,5),Aa+=5):(r=a,0===_a&&Za(Jt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ha()):(Aa=e,e=a)):(Aa=e,e=a),e}function so(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===ue?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(Zt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=wa()):(Aa=e,e=a)):(Aa=e,e=a),e}function uo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===le?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Vt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Sa()):(Aa=e,e=a)):(Aa=e,e=a),e}function lo(){var e,r,n,i;return e=Aa,t.substr(Aa,6).toLowerCase()===ce?(r=t.substr(Aa,6),Aa+=6):(r=a,0===_a&&Za($t)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Ia()):(Aa=e,e=a)):(Aa=e,e=a),e}function co(){var e,r,n,i;return e=Aa,t.substr(Aa,6).toLowerCase()===fe?(r=t.substr(Aa,6),Aa+=6):(r=a,0===_a&&Za(Ht)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ga()):(Aa=e,e=a)):(Aa=e,e=a),e}function fo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===de?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(kt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=ya()):(Aa=e,e=a)):(Aa=e,e=a),e}function po(){var e,r,n,i;return e=Aa,t.substr(Aa,3).toLowerCase()===pe?(r=t.substr(Aa,3),Aa+=3):(r=a,0===_a&&Za(zt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Ta()):(Aa=e,e=a)):(Aa=e,e=a),e}function mo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===me?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(qt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Na()):(Aa=e,e=a)):(Aa=e,e=a),e}function vo(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===ve?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Yt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Oa()):(Aa=e,e=a)):(Aa=e,e=a),e}function ho(){var e,r,n,i;return e=Aa,t.substr(Aa,4).toLowerCase()===he?(r=t.substr(Aa,4),Aa+=4):(r=a,0===_a&&Za(Bt)),r!==a?(n=Aa,_a++,i=ri(),_a--,i===a?n=void 0:(Aa=n,n=a),n!==a?(Ea=e,e=Ca()):(Aa=e,e=a)):(Aa=e,e=a),e}function wo(){var e;return 44===t.charCodeAt(Aa)?(e=we,Aa++):(e=a,0===_a&&Za(jt)),e}function So(){var e;return 40===t.charCodeAt(Aa)?(e=Se,Aa++):(e=a,0===_a&&Za(Qt)),e}function Io(){var e;return 41===t.charCodeAt(Aa)?(e=Ie,Aa++):(e=a,0===_a&&Za(Gt)),e}function go(){var e,t;for(e=[],t=yo();t!==a;)e.push(t),t=yo();return e}function yo(){var e;return Ee.test(t.charAt(Aa))?(e=t.charAt(Aa),Aa++):(e=a,0===_a&&Za(Wt)),e}function To(){var e,r,n,i;if(e=Aa,(r=ei())!==a&&(Ea=e,r=xa(r)),(e=r)===a)if(e=Aa,96===t.charCodeAt(Aa)?(r=ge,Aa++):(r=a,0===_a&&Za(Kt)),r!==a){if(n=[],Me.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Xt)),i!==a)for(;i!==a;)n.push(i),Me.test(t.charAt(Aa))?(i=t.charAt(Aa),Aa++):(i=a,0===_a&&Za(Xt));else n=a;n!==a?(96===t.charCodeAt(Aa)?(i=ge,Aa++):(i=a,0===_a&&Za(Kt)),i!==a?(Ea=e,e=ba(n)):(Aa=e,e=a)):(Aa=e,e=a)}else Aa=e,e=a;return e}function No(e,t,r,n){var a={type:"binary-expression",operator:e,left:t,right:r};return void 0!==n&&(a.escape=n),a}function Oo(e,t){for(var r=e,n=0;n<t.length;n++)r=No(t[n][1],r,t[n][3]);return r}if((n=s())!==a&&Aa===t.length)return n;throw n!==a&&Aa<t.length&&Za({type:"end"}),function(t,r,n){return new e(e.buildMessage(t,r),t,r,n)}(Ra,Fa<t.length?t.charAt(Fa):null,Fa<t.length?Ja(Fa,Fa+1):Ja(Fa,Fa))}}},(Q=W).exports&&(Q.exports=G());var K=W.exports;class X{static parse(e){return K.parse(e)}}const ee=new Set(["current_timestamp","current_date","current_time"]);var te;!function(e){e[e.Date=1]="Date",e[e.DateOnly=2]="DateOnly",e[e.TimeOnly=3]="TimeOnly",e[e.TimeStampOffset=4]="TimeStampOffset"}(te||(te={}));class re{static makeBool(e){return ae(e)}static featureValue(e,t,r,n,a){return pe(e,t,r,n,a)}static equalsNull(e){return null===e}static applyLike(e,t,r){return de(e,t,r)}static ensureArray(e){return ie(e)}static applyIn(e,t){return le(e,t)}static currentDate(e){return o.u.fromNow(e)}static makeSqlInterval(e,t,r){return h.createFromValueAndQualifer(e,t,r)}static convertInterval(e){return e instanceof h?e.valueInMilliseconds():e}static currentTimestamp(e){return C(new Date,e)}static compare(e,t,r,n){return V(t,r,e)}static calculate(e,t,r,n){return B(e,t,r,n)}static evaluateTime(e){return D(e)}static evaluateTimestamp(e,t,r){return P(e,t,r)}static evaluateDate(e,t){return L(e,t)}static evaluateFunction(e,t,r){return H(e,t,r)}static lookup(e,t){const r=t[e];return void 0===r?null:r}static between(e,t,r){return null==e||null==t[0]||null==t[1]?null:V(e,t[0],">=")&&V(e,t[1],"<=")}static notbetween(e,t,r){return null==e||null==t[0]||null==t[1]?null:V(e,t[0],"<")||V(e,t[1],">")}static ternaryNot(e){return oe(e)}static ternaryAnd(e,t){return se(e,t)}static ternaryOr(e,t){return ue(e,t)}}class ne{constructor(e,t,r={timeZone:"UTC"}){this.fieldsIndex=t,this._complextypefields={},this.parameters={},this.timeReferenceZone="UTC",this._hasDateFunctions=void 0,this.configureExpressionTimeZone(r),this.parseTree=X.parse(e);const{isStandardized:n,isAggregate:a,referencedFieldNames:i}=this._extractExpressionInfo(t);this._referencedFieldNames=i,this.isStandardized=n,this.isAggregate=a}configureExpressionTimeZone(e){this.timeReferenceZone=e.timeZone}static convertValueToStorageFormat(e,t=null){if(null===t)return E(e)?e.getTime():M(e)?e.toMillis():_(e)?e.toStorageFormat():R(e)?e.toStorageString():F(e)?e.toStorageFormat():e;switch(t){case"date":return E(e)?e.getTime():M(e)?e.toMillis():_(e)?e.toMilliseconds():F(e)?e.toNumber():e;case"date-only":return E(e)?o.u.fromDateJS(e).toString():_(e)?o.u.fromSqlTimeStampOffset(e).toString():M(e)?o.u.fromDateTime(e).toString():e;case"time-only":return E(e)?u.n.fromDateJS(e).toStorageString():M(e)?u.n.fromDateTime(e).toStorageString():_(e)?u.n.fromSqlTimeStampOffset(e).toStorageString():R(e)?e.toStorageString():e;case"timestamp-offset":if(E(e))return s.H.fromJSDate(e).toStorageFormat();if(M(e))return s.H.fromDateTime(e).toStorageFormat();if(_(e))return e.toStorageFormat()}return e}static create(e,t,r={timeZone:"UTC"}){return new ne(e,t,r)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=me){return!!this._evaluateNode(this.parseTree,null,t,e)}calculateValue(e,t=me){const r=this._evaluateNode(this.parseTree,e,t,null);return r instanceof h?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=me){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone):(0,i.Z)("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone))}testFeature(e,t=me){return!!this._evaluateNode(this.parseTree,e,t,null)}testFeatureCompiled(e,t=me){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone):(0,i.Z)("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this._complextypefields,this.timeReferenceZone))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||ee.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,(t=>{if("function"===t.type){const r=t.name.toLowerCase(),n=t.args.value[0];if("column-reference"===n.type){const t=n.column,a=`${r}-${t}`;e.has(a)||e.set(a,{aggregateType:r,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","complextypefields","timeReferenceZone",e).bind(re)}_extractExpressionInfo(e){const t=[],r=new Set;let n=!0,a=!1;return this._visitAll(this.parseTree,(i=>{switch(i.type){case"column-reference":{const n=e?.get(i.column);let a,o;n?a=o=n.name??"":(o=i.column,a=o.toLowerCase()),n&&n.name&&("date"===n.type||"esriFieldTypeDate"===n.type)&&(this._complextypefields[n.name]=te.Date),!n?.name||"date-only"!==n.type&&"esriFieldTypeDateOnly"!==n.type||(this._complextypefields[n.name]=te.DateOnly),n&&n.name&&("time-only"===n.type||"esriFieldTypeTimeOnly"===n.type)&&(this._complextypefields[n.name]=te.TimeOnly),n&&n.name&&("timestamp-offset"===n.type||"esriFieldTypeTimestampOffset"===n.type)&&(this._complextypefields[n.name]=te.TimeStampOffset),r.has(a)||(r.add(a),t.push(o)),i.column=o;break}case"function":{const{name:e,args:t}=i,r=t.value.length;n&&(n=function(e,t){const r=Y[e.toLowerCase()];return null!=r&&t>=r.minParams&&t<=r.maxParams}(e,r)),!1===a&&(a=c(e,r));break}}})),{referencedFieldNames:Array.from(t),isStandardized:n,isAggregate:a}}_visitAll(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const r of e.clauses)this._visitAll(r,t);"simple"===e.format&&this._visitAll(e.operand,t),null!==e.else&&this._visitAll(e.else,t);break;case"expression-list":for(const r of e.value)this._visitAll(r,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const r=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let n=0;n<e.clauses.length;n++)t+=" (this.compare('=',"+r+","+this.evaluateNodeToJavaScript(e.clauses[n].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[n].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let r=0;r<e.clauses.length;r++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[r].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const r of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(r);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"))";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+")))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeReferenceZone)"}throw new a.eS(a.f.UnsupportedOperator,{operator:e.operator});case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"time":return"this.evaluateTime(JSON.stringify(node.value))";case"date":return"this.evaluateDate(JSON.stringify(node.value), timeReferenceZone)";case"timestamp":return"this.evaluateTimestamp(JSON.stringify(node.value), timeReferenceZone)";case"current-time":return"date"===e.mode?"this.currentDate(timeReferenceZone)":"this.currentTimestamp(timeReferenceZone)";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",complextypefields,attributeAdapter, timeReferenceZone)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+", timeReferenceZone)"}throw new a.eS(a.f.UnsupportedSyntax,{node:e.type})}_evaluateNode(e,t,r,i){let s;switch(e.type){case"interval":{const n=this._evaluateNode(e.value,t,r,i);return h.createFromValueAndQualifer(n,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const n=this._evaluateNode(e.operand,t,r,i);for(let a=0;a<e.clauses.length;a++)if(V(n,this._evaluateNode(e.clauses[a].operand,t,r,i),"=",this.timeReferenceZone))return this._evaluateNode(e.clauses[a].value,t,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,r,i)}else{for(let n=0;n<e.clauses.length;n++)if(ae(this._evaluateNode(e.clauses[n].operand,t,r,i)))return this._evaluateNode(e.clauses[n].value,t,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],E(s)?l.ou.fromJSDate(s):s instanceof n.iG?s.toDateTime():s;case"expression-list":{const n=[];for(const a of e.value)n.push(this._evaluateNode(a,t,r,i));return n}case"unary-expression":return oe(this._evaluateNode(e.expr,t,r,i));case"binary-expression":switch(e.operator){case"AND":return se(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i));case"OR":return ue(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i));case"IS":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,r,i);case"ISNOT":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,r,i);case"IN":{const n=ie(this._evaluateNode(e.right,t,r,i));return le(this._evaluateNode(e.left,t,r,i),n)}case"NOT IN":{const n=ie(this._evaluateNode(e.right,t,r,i));return oe(le(this._evaluateNode(e.left,t,r,i),n))}case"BETWEEN":{const n=this._evaluateNode(e.left,t,r,i),a=this._evaluateNode(e.right,t,r,i);return null==n||null==a[0]||null==a[1]?null:V(n,a[0],">=",this.timeReferenceZone)&&V(n,a[1],"<=",this.timeReferenceZone)}case"NOTBETWEEN":{const n=this._evaluateNode(e.left,t,r,i),a=this._evaluateNode(e.right,t,r,i);return null==n||null==a[0]||null==a[1]?null:V(n,a[0],"<",this.timeReferenceZone)||V(n,a[1],">",this.timeReferenceZone)}case"LIKE":return de(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),e.escape);case"NOT LIKE":return oe(de(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return V(this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),e.operator,this.timeReferenceZone);case"-":case"+":case"*":case"/":case"||":return B(e.operator,this._evaluateNode(e.left,t,r,i),this._evaluateNode(e.right,t,r,i),this.timeReferenceZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return L(e.value,this.timeReferenceZone);case"timestamp":return P(e.value,this.timeReferenceZone);case"time":return D(e.value);case"current-time":return"date"===e.mode?o.u.fromNow(this.timeReferenceZone):C(new Date,this.timeReferenceZone);case"column-reference":return pe(t,e.column,this._complextypefields,r,this.timeReferenceZone);case"data-type":return e.value;case"function":{if(this.isAggregate&&c(e.name,e.args.value.length)){const t=[];for(const n of e.args?.value||[]){const e=[];for(const t of i||[])e.push(this._evaluateNode(n,t,r,null));t.push(e)}return function(e,t){const r=f[e.toLowerCase()];if(null==r)throw new a.eS(a.f.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new a.eS(a.f.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t)}(e.name,t)}const n=this._evaluateNode(e.args,t,r,i);return H(e.name,n,this.timeReferenceZone)}}throw new a.eS(a.f.UnsupportedSyntax,{node:e.type})}}function ae(e){return!0===e}function ie(e){return Array.isArray(e)?e:[e]}function oe(e){return null!==e?!0!==e:null}function se(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function ue(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function le(e,t){if(null==e)return null;let r=!1;for(const n of t)if(null==n)r=null;else if(e===n){r=!0;break}return r}const ce="-[]/{}()*+?.\\^$|";var fe;function de(e,t,r){return null==e?null:function(e,t){const r=t;let n="",a=fe.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case fe.Normal:i===r?a=fe.Escaped:ce.includes(i)?n+="\\"+i:n+="%"===i?".*":"_"===i?".":i;break;case fe.Escaped:ce.includes(i)?n+="\\"+i:n+=i,a=fe.Normal}}return new RegExp("^"+n+"$","m")}(t,r).test(e)}function pe(e,t,r,n,a){const i=n.getAttribute(e,t);return null!=i&&r[t]===te.Date?C(new Date(i),a):null!=i&&r[t]===te.DateOnly?o.u.fromReader(i):null!=i&&r[t]===te.TimeOnly?u.n.fromReader(i):null!=i&&r[t]===te.TimeStampOffset?new s.H(i):i}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(fe||(fe={}));const me={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}}}]);