@arcgis/core 4.33.0-next.20250225 → 4.33.0-next.20250227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/4253438dd3045566892d.js +1 -0
- package/assets/esri/core/workers/chunks/823bf95f42cc42f20e22.js +1 -0
- package/assets/esri/core/workers/chunks/ae25c6108918d37e61bf.js +1 -0
- package/assets/esri/core/workers/chunks/{feb656f172ec9fe64752.js → af005704f23088db3ded.js} +1 -1
- package/assets/esri/core/workers/chunks/{dea40706ca4e37d5c6e2.js → d4d011eea16a89a5aad9.js} +1 -1
- package/core/sql/StandardizedFunctions.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/sqlCompareUtils.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/package.json +1 -1
- package/support/popupUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/views/2d/engine/webgl/animations/utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TestShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BandArithmeticShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CompositeBandShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ComputeChangeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ContrastBrightnessShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ExtractBandShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/GrayscaleShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/LocalShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/NDVIShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/StretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
- package/views/3d/webgl-engine/lib/ComponentUtils.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/View.js +1 -1
- package/views/support/TileTreeDebugger.js +1 -1
- package/views/webgl/capabilities/Capabilities.js +1 -1
- package/views/webgl/capabilities/DebugRendererInfo.js +1 -1
- package/views/webgl/capabilities.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/assets/esri/core/workers/chunks/66338f008ff0992ffca2.js +0 -1
- package/assets/esri/core/workers/chunks/69c13ca7b572ad2ca3ce.js +0 -1
- package/assets/esri/core/workers/chunks/d5ebe6b7cd9c8e40b386.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{generateGlobalId as t}from"../../../editing/sharedTemplates/executor/support/createServiceEdit.js";import{formatNumber as e}from"../../../intl/number.js";import{isSubtypeSublayer as n}from"../../../layers/support/layerUtils.js";import o from"../../../rest/networks/support/Association.js";import i from"../../../rest/networks/support/NetworkElement.js";function r(t){const{percentAlong:n}=t;return null==n?"":e(n,{style:"percent",maximumFractionDigits:2})}function c(t){const{associationType:e}=t;return"connectivity"===e||"junction-junction-connectivity"===e||"junction-edge-from-connectivity"===e||"junction-edge-midspan-connectivity"===e||"junction-edge-to-connectivity"===e}function a(t){return"junction-edge-midspan-connectivity"===t.associationType}function s(t){const{attributes:e,sourceLayer:n}=t??{},o=n&&"displayField"in n?n.displayField:null,i=o?e?.[o]:null,r=t?.getObjectId()?.toString();return
|
|
5
|
+
import{generateGlobalId as t}from"../../../editing/sharedTemplates/executor/support/createServiceEdit.js";import{formatNumber as e}from"../../../intl/number.js";import{isSubtypeSublayer as n}from"../../../layers/support/layerUtils.js";import o from"../../../rest/networks/support/Association.js";import i from"../../../rest/networks/support/NetworkElement.js";function r(t){const{percentAlong:n}=t;return null==n?"":e(n,{style:"percent",maximumFractionDigits:2})}function c(t){const{associationType:e}=t;return"connectivity"===e||"junction-junction-connectivity"===e||"junction-edge-from-connectivity"===e||"junction-edge-midspan-connectivity"===e||"junction-edge-to-connectivity"===e}function a(t){return"junction-edge-midspan-connectivity"===t.associationType}function s(t){const{attributes:e,sourceLayer:n}=t??{},o=n&&"displayField"in n?n.displayField:null,i=o?e?.[o]:null,r=null!=i?JSON.stringify(i):null,c=t?.getObjectId()?.toString();return r||c||""}function l(t,e,n){const{associationType:o}=t;switch(o){case"attachment":return"to"===e?n.attachment:n.structure;case"containment":return"to"===e?n.content:n.container;case"junction-edge-from-connectivity":case"junction-edge-to-connectivity":case"junction-edge-midspan-connectivity":case"junction-junction-connectivity":case"connectivity":return n.connectivity}}function u(t,e){return!!(t.layer&&"globalIdField"in t.layer&&t.layer.globalIdField&&e.fromNetworkElement)&&t.attributes[t.layer.globalIdField]===e.fromNetworkElement.globalId}function d(t,e){const o=n(t.sourceLayer)?t.sourceLayer.parent:t.sourceLayer;if(o&&"globalIdField"in o&&"layerId"in o&&o.globalIdField){const n=e.getSourceIdByLayerId(o.layerId),r="junction"===e.getSourceTypeById(n)?e.getTerminalConfiguration(t):void 0,c=r?.terminals.at(0)?.id,a=o.fieldsIndex.get("assetGroup").name,s=o.fieldsIndex.get("assetType").name,l=t.attributes[a],u=t.attributes[s],d=t.attributes[o.globalIdField];if(d&&null!=n)return new i({globalId:d,networkSourceId:n,assetGroupCode:l,assetTypeCode:u,terminalId:c})}}function y(e){return new o({fromNetworkElement:d(e.fromFeature,e.utilityNetwork),toNetworkElement:d(e.toFeature,e.utilityNetwork),associationType:e.associationType,globalId:t()})}export{y as createAssociation,r as formatPercentAlong,l as getAssociationTitle,s as getFeatureTitle,c as isConnectivity,a as isConnectivityMidspan,u as isFromElement};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5455],{1262:(e,t,n)=>{n.d(t,{L8:()=>s,Z7:()=>r});var r,a,i=n(799);(a=r||(r={})).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={[r.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[r.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[r.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[r.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[r.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[r.UnsupportedOperator]:"Unsupported operator - {operator}",[r.UnsupportedSyntax]:"Unsupported syntax - {node}",[r.UnsupportedSqlFunction]:"Sql function not found = {function}",[r.InvalidDataType]:"Invalid sql data type",[r.InvalidDate]:"Invalid date encountered",[r.InvalidOperator]:"Invalid operator encountered",[r.InvalidTime]:"Invalid time encountered",[r.IllegalInterval]:"Illegal interval",[r.FunctionNotRecognized]:"Function not recognized",[r.InvalidTimeStamp]:"Invalid timestamp encountered",[r.InvalidParameterCount]:"Invalid parameter count for call to {name}",[r.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[r.YearMonthIntervals]:"Year-Month Intervals not supported",[r.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.HC)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}},15032:(e,t,n)=>{n.d(t,{k:()=>u});var r=n(78502),a=n(73444),i=n(96285);function o(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let n="";for(const r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":n+=r;break;case"A":case"a":n+="a";break;default:n+=`'${r}'`}return n}const s="esri.core.sql.timeonly";class u{constructor(e,t,n,r){this._hour=e,this._minute=t,this._second=n,this._millisecond=r,this.declaredRootClass=s}static isTimeOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return u.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,r.Fq)(this.hour)&&(0,r.Fq)(this.minute)&&(0,r.Fq)(this.second)&&(0,r.Fq)(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=o(e))?i.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,n,r){const a=new u(e,t,n,r);return a.isValid()?a:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new u(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),n=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),a=Math.floor(e%1e3);return new u(r,n,t,a)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(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 n=[];t?(t=o(t))&&n.push(t):null!==t&&""!==t||(n.push("HH:mm:ss"),n.push("HH:mm:ss.SSS"),n.push("hh:mm:ss a"),n.push("hh:mm:ss.SSS a"),n.push("HH:mm"),n.push("hh:mm a"),n.push("H:mm"),n.push("h:mm a"),n.push("H:mm:ss"),n.push("h:mm:ss a"),n.push("H:mm:ss.SSS"),n.push("h:mm:ss.SSS a"));for(const t of n){const n=i.c9.fromFormat(e,t);if(n.isValid)return new u(n.hour,n.minute,n.second,n.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 u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.c9.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}}}},44729:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(66131),a=n(73444),i=n(96285);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|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 r of e.match(n)||[])switch(r){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+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?t+=`'${r.slice(1,-1)}'`:t+=`'${r}'`}return t}const s="esri.core.sql.dateonly";class u{constructor(e,t,n){this._year=e,this._month=t,this._day=n,this.declaredRootClass=s}static isDateOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}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 u.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new u(this._year,this._month,this._day)}toDateTime(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";const n=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(n).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.c9.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=i.c9.fromMillis(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.c9.fromSeconds(e,{zone:i.mQ.utcInstance});return t.isValid?u.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 u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,n){const r=new u(e,t,n);return!1===r.isValid?null:r}static fromDateJS(e){return u.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return u.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 n=[];if(t)(t=o(t))&&n.push(t);else if(null===t||""===t){const t=i.c9.fromISO(e,{setZone:!0});return t.isValid?u.fromParts(t.year,t.month,t.day):null}for(const r of n){const n=i.c9.fromFormat(e,t??r);if(n.isValid)return new u(n.year,n.month,n.day)}return null}static fromNow(e="system"){const t=i.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new u(t.year,t.month,t.day)}}},55612:(e,t,n)=>{n.d(t,{g:()=>o});var r=n(96285);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const i="esri.core.sql.SqlTimeStampOffset";class o{constructor(e){this._timeStampOffset=e,this.declaredRootClass=i,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===i}toDateTime(){return this._date??=r.c9.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 o.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new o(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new o(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,i=0,s=0,u=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let d="";i<10&&(d="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+i.toString()}`;0!==s&&(m+="."+s.toString().padStart(3,"0"));const h=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new o(f+"T"+m+h)}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 o.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>u});var r=n(44729),a=n(1262),i=n(55612),o=n(15032),s=n(96285);function u(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L8(a.Z7.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.L8(a.Z7.InvalidParameterCount,{name:e.toUpperCase()});return n.evaluate(t)}function l(e,t){const n=c[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}const c={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=>f(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(null!==r){if(!d(r))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=h(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=>h(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const i=e[r];if(null!==i){if(!d(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function m(e,t){if(null===e)return null;let n=null,a=null;for(const u of e){let e=u;e=r.n.isDateOnly(u)||o.k.isTimeOnly(u)?u.toNumber():s.c9.isDateTime(u)?u.toMillis():i.g.isTimestampOffset(u)?u.toMilliseconds():u,(null===n||"max"===t&&null!==a&&null!==e&&a<=e||"min"===t&&null!==a&&null!==e&&a>=e)&&(n=u,a=e)}return n}function h(e){if(null===e)return null;if(0===(e=e.filter((e=>null!==e))).length)return null;const t=f(e);if(null===t)return null;let n=0;for(const r of e){if(!d(r))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n+=(t-r)**2}return n/(e.length-1)}},78502:(e,t,n)=>{n.d(t,{Fq:()=>o,Yc:()=>a,Yq:()=>i});var r=n(5443);function a(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new r.A({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}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 o(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},88368:(e,t,n)=>{n.d(t,{A:()=>ee});var r=n(44208),a=n(74639),i=n(44729),o=n(1262);function s(e){if(null!==e.precision||null!==e.secondary)throw new o.L8(o.Z7.PrimarySecondaryQualifiers)}function u(e,t){if(t.includes(".")){const n=t.split(".");e.second=parseFloat(n[0]),e.millis=parseInt(n[1],10)}else e.second=parseFloat(t)}const l="esri.core.sql.SqlInterval";class c{constructor(){this.declaredRootClass=l,this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static isInterval(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===l}static createFromMilliseconds(e){const t=new c;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,n){let r=null;const a=new c;if(a.op="-"===n?"-":"+","interval-period"===t.type){s(t);const n=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new o.L8(o.Z7.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new o.L8(o.Z7.IllegalInterval);u(a,e)}else{if(!n.test(e))throw new o.L8(o.Z7.IllegalInterval);a[t.period]=parseFloat(e)}}else{if(s(t.start),s(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new o.L8(o.Z7.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(r=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);a[t.start.period]=parseFloat(e.split(" ")[0]),a[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1])}break;case"second":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1]),u(a,n[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);a.hour=parseFloat(e.split(":")[0]),a.minute=parseFloat(e.split(":")[1]);break;case"second":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),u(a,t[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new o.L8(o.Z7.IllegalInterval);if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.minute=parseFloat(t[0]),u(a,t[1])}break;default:throw new o.L8(o.Z7.IllegalInterval)}}return a}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)}}var f=n(55612),d=n(15032),m=n(3330),h=n(96285);const p=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2})$/,w=/^(\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})$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,S=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function L(e,t){if(t instanceof h.bo)return t===m.GB.instance?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return h.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t})}}function N(e){return c.isInterval(e)}function O(e){return h.c9.isDateTime(e)}function C(e){return i.n.isDateOnly(e)}function Z(e){return d.k.isTimeOnly(e)}function D(e){return f.g.isTimestampOffset(e)}function F(e){let t=p.exec(e);if(null!==t){const[,e,n,r]=t,a=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),0);if(null!==a)return a;throw new o.L8(o.Z7.InvalidTime)}if(t=v.exec(e),null!==t){const[,e,n]=t,r=d.k.fromParts(parseInt(e,10),parseInt(n,10),0,0);if(null!==r)return r;throw new o.L8(o.Z7.InvalidTime)}if(t=w.exec(e),null!==t){const[,e,n,r,a]=t,i=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==i)return i;throw new o.L8(o.Z7.InvalidTime)}throw new o.L8(o.Z7.InvalidTime)}function M(e,t,n=!1){let r=y.exec(e);if(null!==r){const[,e,n,a,i,s,u,l]=r,c=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,m.Qo)(t)});if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,d]=r,m=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),parseInt(s,10),u?parseInt(u.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),0,0,"-"===s,parseInt(u,10),parseInt(l,10));if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=S.exec(e),null!==r){const[,e,n,a,i,s]=r,u=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:0},{zone:(0,m.Qo)(t)});if(!1===u.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return u}if(r=g.exec(e),null!==r){const[,e,n,a]=r,i=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,m.Qo)(t)});if(!1===i.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return i}throw new o.L8(o.Z7.InvalidTimeStamp)}function x(e,t){const n=g.exec(e);if(null===n)try{return M(e,t)}catch{throw new o.L8(o.Z7.InvalidDate)}const[,r,a,s]=n,u=i.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(s,10));if(null===u)throw new o.L8(o.Z7.InvalidDate);return u}var b=n(34727),E=n(799),A=n(54218);function _(e){return!!O(e)||!!D(e)}function P(e){return!!(O(e)||C(e)||D(e)||Z(e))}function U(e){if(O(e))return e.toMillis();if(C(e))return e.toNumber();if(D(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function R(e,t,n,r){if(null==e||null==t)return null;if((0,A.Et)(e)){if((0,A.Et)(t))return $(e,t,n);if((0,A.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return $(e,r,n);const a=e.toString();switch(n){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,n);if(P(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator)}else if((0,A.Kg)(e)){if((0,A.Et)(t))return function(e,t,n){const r=parseFloat(e);if(!isNaN(r))return $(r,t,n);const a=t.toString();switch(n){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,n);if((0,A.Kg)(t))return function(e,t,n){switch(n){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,n);if(O(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))throw new o.L8(o.Z7.InvalidOperator)}else if(O(e)){if(_(t)){if((0,m.Y4)(e.zone)){if(h.c9.isDateTime(t)&&!(0,m.Y4)(t.zone))return k(e,t,n);if(f.g.isTimestampOffset(t))return k(e,t,n)}else if(h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)){if(!(0,m.Y4)(e.zone))return k(e,t,n);if(f.g.isTimestampOffset(e))return k(e,t,n)}return $(U(e),U(t),n)}if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return $((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(D(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),$(r.toMillis(),t.toMilliseconds(),n)}(e,t,n);if(O(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),$(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return $(e.toNumber(),t.toNumber(),n);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(Z(e)){if(Z(t))return $(e.toNumber(),t.toNumber(),n);if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator)}else if(D(e)){if(_(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):$(U(e),U(t),n);if((0,A.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return $((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(Z(t))throw new o.L8(o.Z7.InvalidOperator);if((0,A.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}switch(n){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,n){switch(n){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 k(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=V(e),a=V(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function V(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function J(e,t,n){const r=Y[e.toLowerCase()];if(null==r)throw new o.L8(o.Z7.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new o.L8(o.Z7.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t,n)}function z(e){return!((0,A.$P)(e)||C(e)||O(e)||Z(e)||D(e))}function H(e){return C(e)||Z(e)?e.toString():D(e)?e.toSQLValue():O(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,A.$P)(e)?H(h.c9.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,A.$P)(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(O(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(C(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(Z(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(D(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,n]=e;return null==t||null==n?null:t.toString().substring(n-1)}if(3===e.length){const[t,n,r]=e;return null==t||null==n||null==r?null:r<=0?"":t.toString().substring(n-1,n+r-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,n=t?e[1]:" ",r=t?e[2]:e[1];if(null==n||null==r)return null;const a=`(${(0,E.Cj)(n)})`;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${a}*|${a}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${a}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${a}*$`,"g"),"")}throw new o.L8(o.Z7.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[0]<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],n=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*n)/n}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length||0===e[1]?Math.trunc(e[0]):(0,b.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,A.Kg)(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let n=0;n<e.length;n++){if(null==e[n])return null;t+=e[n].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)=>R(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const n=e[0],r=e[1];if(null===n)return null;switch(r.type){case"integer":{if(!z(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"smallint":{if(!z(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);if(e>32767||e<-32767)throw new o.L8(o.Z7.CannotCastValue);return e}case"float":case"real":{if(!z(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseFloat(n);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"time":return function(e){if((0,A.$P)(e))return d.k.fromDateJS(e);if(O(e))return d.k.fromDateTime(e);if(C(e))throw new o.L8(o.Z7.CannotCastValue);if(Z(e))return e;if(D(e))return d.k.fromSqlTimeStampOffset(e);if((0,A.Kg)(e))return F(e);throw new o.L8(o.Z7.CannotCastValue)}(n);case"date":return function(e){if((0,A.$P)(e))return i.n.fromDateJS(e);if(O(e))return i.n.fromParts(e.year,e.month,e.day);if(C(e))return e;if(Z(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e)&&null===i.n.fromParts(e.year,e.month,e.day))throw new o.L8(o.Z7.CannotCastValue);if((0,A.Kg)(e)){const t=i.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new o.L8(o.Z7.CannotCastValue)}(n);case"timestamp":return function(e,t,n){if((0,A.$P)(e))return L(e,t);if(O(e))return e;if(C(e))return e.toDateTimeLuxon("unknown");if(Z(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e))return e;if((0,A.Kg)(e))return M(e,"unknown",n);throw new o.L8(o.Z7.CannotCastValue)}(n,t,!0===r.withtimezone);case"varchar":{const e=H(n);if(e.length>r.size)throw new o.L8(o.Z7.CannotCastValue);return e}default:throw new o.L8(o.Z7.InvalidDataType)}}}};function q(e,t,n,r){if("||"===e)return J("concat",[t,n],r);if(null===t||null===n)return null;if((0,A.Et)(t)){if((0,A.Et)(n))return K(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e/t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,A.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return K(e,r,n)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}if(C(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(Z(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(N(t)){if((0,A.Et)(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(O(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus({milliseconds:r});case"-":return e.minus({milliseconds:r})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(D(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.addMilliseconds(r);case"-":return e.addMilliseconds(-1*r)}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,A.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if((0,A.Kg)(t)){if((0,A.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return K(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(Z(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,A.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}throw new o.L8(o.Z7.InvalidOperator)}function K(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new o.L8(o.Z7.InvalidOperator)}function Q(e,t,n,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=t,a.found=n,a.location=r,a.name="SyntaxError",a}function B(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(Q,Error),Q.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n,r=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,u=B("",i.line.toString().length," "),l=r[a.line-1],c=(a.line===s.line?s.column:l.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+l+"\n"+u+" | "+B("",a.column-1," ")+B("",c,"^")}else t+="\n at "+o}return t},Q.buildMessage=function(e,t){var n={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 r(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"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(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"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return n[e.type](e)}return"Expected "+function(e){var t,n,r=e.map(o);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."};class j{static parse(e){return function(e,t){var n,r={},a=(t=void 0!==t?t:{}).grammarSource,i={start:ni},o=ni,s="!",u="=",l=">=",c=">",f="<=",d="<>",m="!=",h="||",p="@",v="'",w="N'",g="''",y=".",T="null",I="true",S="false",L="in",N="is",O="like",C="escape",Z="not",D="and",F="or",M="between",x="from",b="for",E="substring",A="extract",_="trim",P="position",U="timestamp",R="date",$="time",k="leading",V="trailing",J="both",z="cast",H="as",Y="integer",q="int",K="smallint",B="float",j="real",G="varchar",W="to",X="interval",ee="year",te="timezone_hour",ne="timezone_minute",re="month",ae="day",ie="hour",oe="minute",se="second",ue="case",le="end",ce="when",fe="then",de="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ge=/^[+\-]/,ye=/^[*\/]/,Te=/^[A-Za-z_\x80-\uFFFF]/,Ie=/^[A-Za-z0-9_]/,Se=/^[A-Za-z0-9_.\x80-\uFFFF]/,Le=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,Ce=/^[eE]/,Ze=/^[ \t\n\r]/,De=/^[^`]/,Fe=ja("!",!1),Me=ja("=",!1),xe=ja(">=",!1),be=ja(">",!1),Ee=ja("<=",!1),Ae=ja("<>",!1),_e=Ga([["<","="]],!1,!1),Pe=ja("!=",!1),Ue=Ga(["+","-"],!1,!1),Re=ja("||",!1),$e=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["",""]],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Je=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),ze=Ga(['"'],!1,!1),He=ja("@",!1),Ye=ja("'",!1),qe=ja("N'",!1),Ke=ja("''",!1),Qe=Ga(["'"],!0,!1),Be=ja(".",!1),je=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=ja("NULL",!0),Xe=ja("TRUE",!0),et=ja("FALSE",!0),tt=ja("IN",!0),nt=ja("IS",!0),rt=ja("LIKE",!0),at=ja("ESCAPE",!0),it=ja("NOT",!0),ot=ja("AND",!0),st=ja("OR",!0),ut=ja("BETWEEN",!0),lt=ja("FROM",!0),ct=ja("FOR",!0),ft=ja("SUBSTRING",!0),dt=ja("EXTRACT",!0),mt=ja("TRIM",!0),ht=ja("POSITION",!0),pt=ja("TIMESTAMP",!0),vt=ja("DATE",!0),wt=ja("TIME",!0),gt=ja("LEADING",!0),yt=ja("TRAILING",!0),Tt=ja("BOTH",!0),It=ja("CAST",!0),St=ja("AS",!0),Lt=ja("INTEGER",!0),Nt=ja("INT",!0),Ot=ja("SMALLINT",!0),Ct=ja("FLOAT",!0),Zt=ja("REAL",!0),Dt=ja("VARCHAR",!0),Ft=ja("TO",!0),Mt=ja("INTERVAL",!0),xt=ja("YEAR",!0),bt=ja("TIMEZONE_HOUR",!0),Et=ja("TIMEZONE_MINUTE",!0),At=ja("MONTH",!0),_t=ja("DAY",!0),Pt=ja("HOUR",!0),Ut=ja("MINUTE",!0),Rt=ja("SECOND",!0),$t=ja("CASE",!0),kt=ja("END",!0),Vt=ja("WHEN",!0),Jt=ja("THEN",!0),zt=ja("ELSE",!0),Ht=ja(",",!1),Yt=ja("(",!1),qt=ja(")",!1),Kt=Ga([" ","\t","\n","\r"],!1,!1),Qt=ja("`",!1),Bt=Ga(["`"],!0,!1),jt=function(e){return e},Gt=function(e){return{type:"expression-list",location:Qa(),value:e}},Wt=function(e,t,n){return{op:t,expr:n,location:Qa()}},Xt=function(e,t){return zo(e,t)},en=function(e,t,n){return{op:t,expr:n,location:Qa()}},tn=function(e,t){return zo(e,t)},nn=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,Qa())},rn=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?zo(e,t.tail):Vo(t.op,e,t.right,t.escape,Qa())},an=function(e,t){return{op:e,expr:t,location:Qa()}},on=function(e){return{type:"arithmetic",tail:e}},sn=function(e,t){return{op:e+"NOT",right:t}},un=function(e,t){return{op:e,right:t}},ln=function(e,t,n){return Jo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},fn=function(e,t,n){return Jo(Qa(),t,n)},dn=function(e,t){return{op:e,right:t}},mn=function(e){return e[0]+" "+e[2]},hn=function(e){return e[0]+" "+e[2]},pn=function(e,t,n){return{op:e,right:t,escape:n.value}},vn=function(e,t){return{op:e,right:t,escape:""}},wn=function(e,t){return{op:e,right:t}},gn=function(e,t){return{op:e,right:t}},yn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Tn=function(e,t){return zo(e,t)},In=function(e,t,n){return{op:t,expr:n,location:Qa()}},Sn=function(e,t){return zo(e,t)},Ln=function(e){return e.paren=!0,e},Nn=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:Qa(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:Qa(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:Qa(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:Qa()}:{type:"column-reference",location:Qa(),table:"",column:e}},On=function(e){return{type:"column-reference",location:Qa(),table:"",column:e,delimited:!0}},Cn=function(e){return e},Zn=function(e,t){return e+t.join("")},Dn=function(e,t){return e+t.join("")},Fn=function(e){return e},Mn=function(e){return e.join("")},xn=function(){return'"'},bn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return Jo(Qa(),e,t)},An=function(e,t){return Jo(Qa(),e,t)},_n=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return Jo(Qa(),e,t,...n?[n]:[])},Un=function(e,t,n){return Jo(Qa(),e,t,n)},Rn=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},$n=function(e,t){return Jo(Qa(),e,t)},kn=function(e,t){return Jo(Qa(),e,t)},Vn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},Jn=function(){return{type:"data-type",location:Qa(),value:{type:"integer"}}},zn=function(){return{type:"data-type",location:Qa(),value:{type:"smallint"}}},Hn=function(){return{type:"data-type",location:Qa(),value:{type:"float"}}},Yn=function(){return{type:"data-type",location:Qa(),value:{type:"real"}}},qn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},Kn=function(){return{type:"data-type",location:Qa(),value:{type:"timestamp"}}},Qn=function(){return{type:"data-type",location:Qa(),value:{type:"time"}}},Bn=function(e){return{type:"data-type",location:Qa(),value:{type:"varchar",size:parseInt(e)}}},jn=function(e,t,n){return Jo(Qa(),e,t,n)},Gn=function(e,t){return Jo(Qa(),e,t)},Wn=function(e){return{type:"function",location:Qa(),name:"trim",args:e}},Xn=function(e){return{type:"string",location:Qa(),value:e??"BOTH"}},er=function(e,t){return Jo(Qa(),e,t)},tr=function(e,t){return Jo(Qa(),e,t)},nr=function(e){return{type:"function",location:Qa(),name:"position",args:e}},rr=function(e,t){return{type:"function",location:Qa(),name:e,args:t}},ar=function(e){return{type:"string",location:Qa(),value:e}},ir=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)&&Ba("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:Qa(),value:e.value}},or=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)&&Ba("Time literal is invalid")}(e.value),{type:"time",location:Qa(),value:e.value}},sr=function(e,t,n){return{type:"interval",location:Qa(),value:t,qualifier:n,op:e}},ur=function(e,t){return{type:"interval",location:Qa(),value:e,qualifier:t,op:""}},lr=function(e,t){return{type:"interval-qualifier",location:Qa(),start:e,end:t}},cr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},fr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},mr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},hr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},pr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},vr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},wr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},gr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},yr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Tr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Ir=function(){return{type:"string",location:Qa(),value:"day"}},Sr=function(){return{type:"string",location:Qa(),value:"hour"}},Lr=function(){return{type:"string",location:Qa(),value:"minute"}},Nr=function(){return{type:"string",location:Qa(),value:"month"}},Or=function(){return{type:"string",location:Qa(),value:"year"}},Cr=function(e){return parseFloat(e)},Zr=function(e){return parseFloat(e)},Dr=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)&&Ba("Date literal is invalid")}(e.value),{type:"date",location:Qa(),value:e.value}},Fr=function(){return{type:"null",location:Qa(),value:null}},Mr=function(){return{type:"boolean",location:Qa(),value:!0}},xr=function(){return{type:"boolean",location:Qa(),value:!1}},br=function(){return"'"},Er=function(e){return{type:"string",location:Qa(),value:e.join("")}},Ar=function(e,t){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}},_r=function(e,t,n){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}},Pr=function(e){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:null,elseLocation:null}},Ur=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},$r=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},Vr=function(e){return{type:"number",location:Qa(),value:e}},Jr=function(e,t,n){return parseFloat(e+t+n)},zr=function(e,t){return parseFloat(e+t)},Hr=function(e,t){return parseFloat(e+t)},Yr=function(e){return parseFloat(e)},qr=function(e,t){return e[0]+t},Kr=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},Br=function(e){return e.join("")},jr=function(e,t){return"e"+(null===t?"":t)},Gr=function(){return"IN"},Wr=function(){return"IS"},Xr=function(){return"LIKE"},ea=function(){return"ESCAPE"},ta=function(){return"NOT"},na=function(){return"AND"},ra=function(){return"OR"},aa=function(){return"BETWEEN"},ia=function(){return"FROM"},oa=function(){return"FOR"},sa=function(){return"SUBSTRING"},ua=function(){return"EXTRACT"},la=function(){return"TRIM"},ca=function(){return"POSITION"},fa=function(){return"TIMESTAMP"},da=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ga=function(){return"AS"},ya=function(){return"INTEGER"},Ta=function(){return"INT"},Ia=function(){return"SMALLINT"},Sa=function(){return"FLOAT"},La=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Ca=function(){return"INTERVAL"},Za=function(){return"YEAR"},Da=function(){return"TIMEZONE_HOUR"},Fa=function(){return"TIMEZONE_MINUTE"},Ma=function(){return"MONTH"},xa=function(){return"DAY"},ba=function(){return"HOUR"},Ea=function(){return"MINUTE"},Aa=function(){return"SECOND"},_a=function(){return"CASE"},Pa=function(){return"END"},Ua=function(){return"WHEN"},Ra=function(){return"THEN"},$a=function(){return"ELSE"},ka=function(e){return e},Va=function(e){return e.join("")},Ja=0|t.peg$currPos,za=Ja,Ha=[{line:1,column:1}],Ya=Ja,qa=t.peg$maxFailExpected||[],Ka=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=i[t.startRule]}function Qa(){return Xa(za,Ja)}function Ba(e,t){throw ti(e,t=void 0!==t?t:Xa(za,Ja))}function ja(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ga(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Wa(t){var n,r=Ha[t];if(r)return r;if(t>=Ha.length)n=Ha.length-1;else for(n=t;!Ha[--n];);for(r={line:(r=Ha[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return Ha[t]=r,r}function Xa(e,t,n){var r=Wa(e),i=Wa(t);return{source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}}}function ei(e){Ja<Ya||(Ja>Ya&&(Ya=Ja,qa=[]),qa.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=Ja,Ro(),(t=ai())!==r?(Ro(),za=e,e=jt(t)):(Ja=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=Ja,Po()!==r){for(Ro(),t=[],n=ai();n!==r;)t.push(n),n=Ja,a=Ja,i=Ro(),(o=_o())!==r?a=i=[i,o,Ro()]:(Ja=a,a=r),a!==r&&(a=ai())===r?(Ja=n,n=r):n=a;n=Ro(),(a=Uo())!==r?(za=e,e=Gt(t)):(Ja=e,e=r)}else Ja=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=Ja,(t=ii())!==r){for(n=[],a=Ja,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(za=a,a=Wt(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(za=a,a=Wt(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=Xt(t,n)}else Ja=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=Ja,(t=oi())!==r){for(n=[],a=Ja,Ro(),(i=ji())!==r?(Ro(),(o=oi())!==r?(za=a,a=en(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=ji())!==r?(Ro(),(o=oi())!==r?(za=a,a=en(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=tn(t,n)}else Ja=e,e=r;return e}function oi(){var t,n,a,i,o;return t=Ja,(n=Bi())===r&&(n=Ja,33===e.charCodeAt(Ja)?(a=s,Ja++):(a=r,0===Ka&&ei(Fe)),a!==r?(i=Ja,Ka++,61===e.charCodeAt(Ja)?(o=u,Ja++):(o=r,0===Ka&&ei(Me)),Ka--,o===r?i=void 0:(Ja=i,i=r),i!==r?n=a=[a,i]:(Ja=n,n=r)):(Ja=n,n=r)),n!==r?(a=Ro(),(i=oi())!==r?(za=t,t=nn(i)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=Ja,(t=ci())!==r?(n=Ja,Ro(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Ja,t=[],n=Ja,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(za=n,n=an(a,i)):(Ja=n,n=r)):(Ja=n,n=r),n!==r)for(;n!==r;)t.push(n),n=Ja,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(za=n,n=an(a,i)):(Ja=n,n=r)):(Ja=n,n=r);else t=r;return t!==r&&(za=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=Ja,(t=li())!==r?(Ro(),(n=ri())!==r?(za=e,e=wn(t,n)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=li())!==r?(Ro(),(n=Si())!==r?(za=e,e=gn(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=Ja,(t=Bi())!==r?(Ro(),(n=Wi())!==r?(a=Ro(),i=Ja,(o=ci())!==r?(Ro(),(s=ji())!==r?(Ro(),(u=ci())!==r?(za=i,i=ln(n,o,u)):(Ja=i,i=r)):(Ja=i,i=r)):(Ja=i,i=r),i!==r?(za=e,e=cn(n,i)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Wi())!==r?(Ro(),n=Ja,(a=ci())!==r?(i=Ro(),(o=ji())!==r?(Ro(),(s=ci())!==r?(za=n,n=fn(t,a,s)):(Ja=n,n=r)):(Ja=n,n=r)):(Ja=n,n=r),n!==r?(za=e,e=dn(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,(t=qi())!==r?(Ro(),(n=Bi())!==r?(Ro(),(a=ci())!==r?(za=e,e=sn(t,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=qi())!==r?(Ro(),(n=ci())!==r?(za=e,e=un(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,(t=ui())!==r?(Ro(),(n=xi())!==r?(Ro(),Qi()!==r?(Ro(),(a=bi())!==r?(za=e,e=pn(t,n,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=ui())!==r?(Ro(),(n=xi())!==r?(za=e,e=vn(t,n)):(Ja=e,e=r)):(Ja=e,e=r)),e}()),e}())!==r?n=a:(Ja=n,n=r),n===r&&(n=null),za=e,e=rn(t,n)):(Ja=e,e=r),e}()),t}function si(){var t;return e.substr(Ja,2)===l?(t=l,Ja+=2):(t=r,0===Ka&&ei(xe)),t===r&&(62===e.charCodeAt(Ja)?(t=c,Ja++):(t=r,0===Ka&&ei(be)),t===r&&(e.substr(Ja,2)===f?(t=f,Ja+=2):(t=r,0===Ka&&ei(Ee)),t===r&&(e.substr(Ja,2)===d?(t=d,Ja+=2):(t=r,0===Ka&&ei(Ae)),t===r&&(t=e.charAt(Ja),we.test(t)?Ja++:(t=r,0===Ka&&ei(_e)),t===r&&(e.substr(Ja,2)===m?(t=m,Ja+=2):(t=r,0===Ka&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=Ja,t=Ja,(n=Bi())!==r?(a=Ro(),(i=Ki())!==r?t=n=[n,a,i]:(Ja=t,t=r)):(Ja=t,t=r),t!==r&&(za=e,t=mn(t)),(e=t)===r&&(e=Ki()),e}function li(){var e,t,n,a,i;return e=Ja,t=Ja,(n=Bi())!==r?(a=Ro(),(i=Yi())!==r?t=n=[n,a,i]:(Ja=t,t=r)):(Ja=t,t=r),t!==r&&(za=e,t=hn(t)),(e=t)===r&&(e=Yi()),e}function ci(){var e,t,n,a,i,o;if(e=Ja,(t=di())!==r){for(n=[],a=Ja,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(za=a,a=yn(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(za=a,a=yn(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=Tn(t,n)}else Ja=e,e=r;return e}function fi(){var t;return t=e.charAt(Ja),ge.test(t)?Ja++:(t=r,0===Ka&&ei(Ue)),t===r&&(e.substr(Ja,2)===h?(t=h,Ja+=2):(t=r,0===Ka&&ei(Re))),t}function di(){var e,t,n,a,i,o;if(e=Ja,(t=hi())!==r){for(n=[],a=Ja,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(za=a,a=In(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(za=a,a=In(t,i,o)):(Ja=a,a=r)):(Ja=a,a=r);za=e,e=Sn(t,n)}else Ja=e,e=r;return e}function mi(){var t;return t=e.charAt(Ja),ye.test(t)?Ja++:(t=r,0===Ka&&ei($e)),t}function hi(){var e,t;return(e=function(){var e;return(e=bi())===r&&(e=function(){var e,t,n,a;return e=Ja,(t=function(){var e,t,n,a;return e=Ja,(t=Pi())!==r&&(n=Ui())!==r&&(a=Ri())!==r?(za=e,e=Jr(t,n,a)):(Ja=e,e=r),e===r&&(e=Ja,(t=Pi())!==r&&(n=Ui())!==r?(za=e,e=zr(t,n)):(Ja=e,e=r),e===r&&(e=Ja,(t=Pi())!==r&&(n=Ri())!==r?(za=e,e=Hr(t,n)):(Ja=e,e=r),e===r&&(e=Ja,(t=Pi())!==r&&(za=e,t=Yr(t)),e=t))),e}())!==r?(n=Ja,Ka++,a=vi(),Ka--,a===r?n=void 0:(Ja=n,n=r),n!==r?(za=e,e=Vr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t;return e=Ja,(t=zi())!==r&&(za=e,t=Mr()),(e=t)===r&&(e=Ja,(t=Hi())!==r&&(za=e,t=xr()),e=t),e}())===r&&(e=function(){var e,t;return e=Ja,(t=Ji())!==r&&(za=e,t=Fr()),t}())===r&&(e=function(){var e,t;return e=Ja,oo()!==r?(Ro(),(t=xi())!==r?(za=e,e=Dr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t;return e=Ja,io()!==r?(Ro(),(t=xi())!==r?(za=e,e=ir(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=Ci())===r&&(e=function(){var e,t;return e=Ja,so()!==r?(Ro(),(t=xi())!==r?(za=e,e=or(t)):(Ja=e,e=r)):(Ja=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,no()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=En(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),_o()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=An(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=_n(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=Ja,to()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),i=Ja,eo()!==r?(o=Ro(),(s=ai())!==r?(Ro(),i=s):(Ja=i,i=r)):(Ja=i,i=r),i===r&&(i=null),Uo()!==r?(za=t,t=Pn(n,a,i)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),_o()!==r?(Ro(),(a=ai())!==r?(Ro(),(i=_o())!==r?(Ro(),(o=ai())!==r&&(s=Uo())!==r?(za=t,t=Un(n,a,o)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=Rn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=Ja,ro()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Xi()!==r?(Ro(),(i=ai())!==r?(Ro(),Uo()!==r?(za=t,t=jn(n,a,i)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=Gn(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=Wn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,ao()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Yi()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=er(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),_o()!==r?(Ro(),(a=ai())!==r?(Ro(),Uo()!==r?(za=t,t=tr(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=nr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,fo()!==r?(Ro(),t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),mo()!==r?(Ro(),(a=Li())!==r?(Ro(),Uo()!==r?(za=t,t=$n(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),_o()!==r?(Ro(),(a=Li())!==r?(Ro(),Uo()!==r?(za=t,t=kn(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t!==r?(za=e,e=Vn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Ja,t=Ja,Ka++,n=no(),Ka--,n===r?t=void 0:(Ja=t,t=r),t!==r&&(n=ko())!==r?(Ro(),(a=ri())!==r?(za=e,e=rr(n,a)):(Ja=e,e=r)):(Ja=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Ja,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);(a=xo())!==r?(za=e,e=Ar(t,n)):(Ja=e,e=r)}else Ja=e,e=r;else Ja=e,e=r;if(e===r)if(e=Ja,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);a!==r;)n.push(a),a=Ja,(i=Ai())!==r?(Ro(),a=i):(Ja=a,a=r);(a=_i())!==r?(i=Ro(),xo()!==r?(za=e,e=_r(t,n,a)):(Ja=e,e=r)):(Ja=e,e=r)}else Ja=e,e=r;else Ja=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=Ja,Mo()!==r){for(Ro(),t=[],n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);n!==r;)t.push(n),n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);(n=xo())!==r?(za=e,e=Pr(t)):(Ja=e,e=r)}else Ja=e,e=r;if(e===r)if(e=Ja,Mo()!==r){for(Ro(),t=[],n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);n!==r;)t.push(n),n=Ja,(a=Ei())!==r?(Ro(),n=a):(Ja=n,n=r);(n=_i())!==r?(a=Ro(),xo()!==r?(za=e,e=Ur(t,n)):(Ja=e,e=r)):(Ja=e,e=r)}else Ja=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=Ja,(t=function(){var e,t;return e=Ja,(t=function(){var e,t,n,a;if(e=Ja,(t=vi())!==r){for(n=[],a=gi();a!==r;)n.push(a),a=gi();za=e,e=Zn(t,n)}else Ja=e,e=r;return e}())!==r&&(za=e,t=Cn(t)),t}())!==r&&(za=e,t=Nn(t)),(e=t)===r&&(e=Ja,(t=function(){var e,t;return e=Ja,Ii()!==r?(t=function(){var e,t,n;for(e=Ja,t=[],n=yi();n!==r;)t.push(n),n=yi();return za=e,Mn(t)}(),Ii()!==r?(za=e,e=Fn(t)):(Ja=e,e=r)):(Ja=e,e=r),e}())!==r&&(za=e,t=On(t)),e=t),e}())===r&&(e=Si())===r&&(e=Ja,Po()!==r?(Ro(),(t=ai())!==r?(Ro(),Uo()!==r?(za=e,e=Ln(t)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)),e}function pi(){var e,t,n,a;if(e=Ja,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();za=e,e=Dn(t,n)}else Ja=e,e=r;return e}function vi(){var t;return t=e.charAt(Ja),Te.test(t)?Ja++:(t=r,0===Ka&&ei(ke)),t}function wi(){var t;return t=e.charAt(Ja),Ie.test(t)?Ja++:(t=r,0===Ka&&ei(Ve)),t}function gi(){var t;return t=e.charAt(Ja),Se.test(t)?Ja++:(t=r,0===Ka&&ei(Je)),t}function yi(){var e;return(e=Ti())===r&&(e=function(){var e;return e=Ja,Ii()!==r&&Ii()!==r?(za=e,e=xn()):(Ja=e,e=r),e}()),e}function Ti(){var t;return t=e.charAt(Ja),Se.test(t)?Ja++:(t=r,0===Ka&&ei(Je)),t}function Ii(){var t;return t=e.charAt(Ja),Le.test(t)?Ja++:(t=r,0===Ka&&ei(ze)),t}function Si(){var t,n,a,i;return t=Ja,n=Ja,64===e.charCodeAt(Ja)?(a=p,Ja++):(a=r,0===Ka&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(Ja=n,n=r),n!==r&&(za=t,n=bn(n)),n}function Li(){var e,t,n;return e=Ja,(t=ho())===r&&(t=po()),t!==r&&(za=e,t=Jn()),(e=t)===r&&(e=Ja,(t=vo())!==r&&(za=e,t=zn()),(e=t)===r&&(e=Ja,(t=wo())!==r&&(za=e,t=Hn()),(e=t)===r&&(e=Ja,(t=go())!==r&&(za=e,t=Yn()),(e=t)===r&&(e=Ja,(t=oo())!==r&&(za=e,t=qn()),(e=t)===r&&(e=Ja,(t=io())!==r&&(za=e,t=Kn()),(e=t)===r&&(e=Ja,(t=so())!==r&&(za=e,t=Qn()),(e=t)===r&&(e=Ja,(t=yo())!==r?(Ro(),Po()!==r?(Ro(),(n=$i())!==r?(Ro(),Uo()!==r?(za=e,e=Bn(n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)))))))),e}function Ni(){var e,t;return e=Ja,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),za=e,Xn(t)}function Oi(){var e,t;return e=Ja,(t=So())===r&&(t=Oo())===r&&(t=Co())===r&&(t=Zo())===r&&(t=Do())===r&&(t=Fo())===r&&(t=Lo())===r&&(t=No()),t!==r&&(za=e,t=ar(t)),t}function Ci(){var t,n,a,i;return t=Ja,Io()!==r?(Ro(),n=e.charAt(Ja),ge.test(n)?Ja++:(n=r,0===Ka&&ei(Ue)),n!==r?(Ro(),(a=xi())!==r?(Ro(),(i=Zi())!==r?(za=t,t=sr(n,a,i)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r),t===r&&(t=Ja,Io()!==r?(Ro(),(n=xi())!==r?(Ro(),(a=Zi())!==r?(za=t,t=ur(n,a)):(Ja=t,t=r)):(Ja=t,t=r)):(Ja=t,t=r)),t}function Zi(){var e,t,n;return e=Ja,(t=function(){var e,t,n;return e=Ja,(t=Di())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Uo()!==r?(za=e,e=cr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Di())!==r&&(za=e,t=fr(t)),e=t),e}())!==r?(Ro(),To()!==r?(Ro(),(n=function(){var e,t,n,a;return e=Ja,(t=Di())!==r&&(za=e,t=dr(t)),(e=t)===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),_o()!==r?(Ro(),(a=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=mr(n,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Uo()!==r?(za=e,e=hr(n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r&&(za=e,t=pr()),e=t))),e}())!==r?(za=e,e=lr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=Ja,(t=Di())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=vr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Di())!==r&&(za=e,t=wr(t)),(e=t)===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),_o()!==r?(Ro(),(a=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=gr(n,a)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),Uo()!==r?(za=e,e=yr(n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e===r&&(e=Ja,(t=Fo())!==r&&(za=e,t=Tr()),e=t)))),e}()),e}function Di(){var e,t;return e=Ja,(t=Co())!==r&&(za=e,t=Ir()),(e=t)===r&&(e=Ja,(t=Zo())!==r&&(za=e,t=Sr()),(e=t)===r&&(e=Ja,(t=Do())!==r&&(za=e,t=Lr()),(e=t)===r&&(e=Ja,(t=Oo())!==r&&(za=e,t=Nr()),(e=t)===r&&(e=Ja,(t=So())!==r&&(za=e,t=Or()),e=t)))),e}function Fi(){var e,t;return e=Ja,(t=$i())!==r&&(za=e,t=Cr(t)),t}function Mi(){var e,t;return e=Ja,(t=$i())!==r&&(za=e,t=Zr(t)),t}function xi(){var e;return(e=bi())===r&&(e=Si()),e}function bi(){var t,n,a,i,o;if(t=Ja,39===e.charCodeAt(Ja)?(n=v,Ja++):(n=r,0===Ka&&ei(Ye)),n===r&&(e.substr(Ja,2)===w?(n=w,Ja+=2):(n=r,0===Ka&&ei(qe))),n!==r){for(a=[],i=Ja,e.substr(Ja,2)===g?(o=g,Ja+=2):(o=r,0===Ka&&ei(Ke)),o!==r&&(za=i,o=br()),(i=o)===r&&(i=e.charAt(Ja),Ne.test(i)?Ja++:(i=r,0===Ka&&ei(Qe)));i!==r;)a.push(i),i=Ja,e.substr(Ja,2)===g?(o=g,Ja+=2):(o=r,0===Ka&&ei(Ke)),o!==r&&(za=i,o=br()),(i=o)===r&&(i=e.charAt(Ja),Ne.test(i)?Ja++:(i=r,0===Ka&&ei(Qe)));39===e.charCodeAt(Ja)?(i=v,Ja++):(i=r,0===Ka&&ei(Ye)),i!==r?(za=t,t=Er(a)):(Ja=t,t=r)}else Ja=t,t=r;return t}function Ei(){var e,t,n;return e=Ja,bo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(za=e,e=Rr(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e}function Ai(){var e,t,n;return e=Ja,bo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(za=e,e=$r(t,n)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r)):(Ja=e,e=r),e}function _i(){var e,t;return e=Ja,Ao()!==r?(Ro(),(t=ai())!==r?(za=e,e=kr(t)):(Ja=e,e=r)):(Ja=e,e=r),e}function Pi(){var t,n,a;return(t=$i())===r&&(t=Ja,n=e.charAt(Ja),ge.test(n)?Ja++:(n=r,0===Ka&&ei(Ue)),n!==r&&(a=$i())!==r?(za=t,t=qr(n,a)):(Ja=t,t=r)),t}function Ui(){var t,n,a;return t=Ja,46===e.charCodeAt(Ja)?(n=y,Ja++):(n=r,0===Ka&&ei(Be)),n!==r?((a=$i())===r&&(a=null),za=t,t=Kr(a)):(Ja=t,t=r),t}function Ri(){var e,t,n;return e=Ja,(t=Vi())!==r&&(n=$i())!==r?(za=e,e=Qr(t,n)):(Ja=e,e=r),e}function $i(){var e,t,n;if(e=Ja,t=[],(n=ki())!==r)for(;n!==r;)t.push(n),n=ki();else t=r;return t!==r&&(za=e,t=Br(t)),t}function ki(){var t;return t=e.charAt(Ja),Oe.test(t)?Ja++:(t=r,0===Ka&&ei(je)),t}function Vi(){var t,n,a;return t=Ja,n=e.charAt(Ja),Ce.test(n)?Ja++:(n=r,0===Ka&&ei(Ge)),n!==r?(a=e.charAt(Ja),ge.test(a)?Ja++:(a=r,0===Ka&&ei(Ue)),a===r&&(a=null),za=t,t=jr(n,a)):(Ja=t,t=r),t}function Ji(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===T?Ja+=4:(n=r,0===Ka&&ei(We)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?t=n=[n,a]:(Ja=t,t=r)):(Ja=t,t=r),t}function zi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===I?Ja+=4:(n=r,0===Ka&&ei(Xe)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?t=n=[n,a]:(Ja=t,t=r)):(Ja=t,t=r),t}function Hi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,5)).toLowerCase()===S?Ja+=5:(n=r,0===Ka&&ei(et)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?t=n=[n,a]:(Ja=t,t=r)):(Ja=t,t=r),t}function Yi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===L?Ja+=2:(n=r,0===Ka&&ei(tt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Gr()):(Ja=t,t=r)):(Ja=t,t=r),t}function qi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===N?Ja+=2:(n=r,0===Ka&&ei(nt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Wr()):(Ja=t,t=r)):(Ja=t,t=r),t}function Ki(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===O?Ja+=4:(n=r,0===Ka&&ei(rt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Xr()):(Ja=t,t=r)):(Ja=t,t=r),t}function Qi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,6)).toLowerCase()===C?Ja+=6:(n=r,0===Ka&&ei(at)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ea()):(Ja=t,t=r)):(Ja=t,t=r),t}function Bi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===Z?Ja+=3:(n=r,0===Ka&&ei(it)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ta()):(Ja=t,t=r)):(Ja=t,t=r),t}function ji(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===D?Ja+=3:(n=r,0===Ka&&ei(ot)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=na()):(Ja=t,t=r)):(Ja=t,t=r),t}function Gi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===F?Ja+=2:(n=r,0===Ka&&ei(st)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ra()):(Ja=t,t=r)):(Ja=t,t=r),t}function Wi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===M?Ja+=7:(n=r,0===Ka&&ei(ut)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=aa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Xi(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===x?Ja+=4:(n=r,0===Ka&&ei(lt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ia()):(Ja=t,t=r)):(Ja=t,t=r),t}function eo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===b?Ja+=3:(n=r,0===Ka&&ei(ct)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=oa()):(Ja=t,t=r)):(Ja=t,t=r),t}function to(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,9)).toLowerCase()===E?Ja+=9:(n=r,0===Ka&&ei(ft)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=sa()):(Ja=t,t=r)):(Ja=t,t=r),t}function no(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===A?Ja+=7:(n=r,0===Ka&&ei(dt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ua()):(Ja=t,t=r)):(Ja=t,t=r),t}function ro(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===_?Ja+=4:(n=r,0===Ka&&ei(mt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=la()):(Ja=t,t=r)):(Ja=t,t=r),t}function ao(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===P?Ja+=8:(n=r,0===Ka&&ei(ht)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ca()):(Ja=t,t=r)):(Ja=t,t=r),t}function io(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,9)).toLowerCase()===U?Ja+=9:(n=r,0===Ka&&ei(pt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=fa()):(Ja=t,t=r)):(Ja=t,t=r),t}function oo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===R?Ja+=4:(n=r,0===Ka&&ei(vt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=da()):(Ja=t,t=r)):(Ja=t,t=r),t}function so(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===$?Ja+=4:(n=r,0===Ka&&ei(wt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ma()):(Ja=t,t=r)):(Ja=t,t=r),t}function uo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===k?Ja+=7:(n=r,0===Ka&&ei(gt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ha()):(Ja=t,t=r)):(Ja=t,t=r),t}function lo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===V?Ja+=8:(n=r,0===Ka&&ei(yt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=pa()):(Ja=t,t=r)):(Ja=t,t=r),t}function co(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===J?Ja+=4:(n=r,0===Ka&&ei(Tt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=va()):(Ja=t,t=r)):(Ja=t,t=r),t}function fo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===z?Ja+=4:(n=r,0===Ka&&ei(It)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=wa()):(Ja=t,t=r)):(Ja=t,t=r),t}function mo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===H?Ja+=2:(n=r,0===Ka&&ei(St)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ga()):(Ja=t,t=r)):(Ja=t,t=r),t}function ho(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===Y?Ja+=7:(n=r,0===Ka&&ei(Lt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ya()):(Ja=t,t=r)):(Ja=t,t=r),t}function po(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===q?Ja+=3:(n=r,0===Ka&&ei(Nt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ta()):(Ja=t,t=r)):(Ja=t,t=r),t}function vo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===K?Ja+=8:(n=r,0===Ka&&ei(Ot)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ia()):(Ja=t,t=r)):(Ja=t,t=r),t}function wo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,5)).toLowerCase()===B?Ja+=5:(n=r,0===Ka&&ei(Ct)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Sa()):(Ja=t,t=r)):(Ja=t,t=r),t}function go(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===j?Ja+=4:(n=r,0===Ka&&ei(Zt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=La()):(Ja=t,t=r)):(Ja=t,t=r),t}function yo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,7)).toLowerCase()===G?Ja+=7:(n=r,0===Ka&&ei(Dt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Na()):(Ja=t,t=r)):(Ja=t,t=r),t}function To(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,2)).toLowerCase()===W?Ja+=2:(n=r,0===Ka&&ei(Ft)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Oa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Io(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,8)).toLowerCase()===X?Ja+=8:(n=r,0===Ka&&ei(Mt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ca()):(Ja=t,t=r)):(Ja=t,t=r),t}function So(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ee?Ja+=4:(n=r,0===Ka&&ei(xt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Za()):(Ja=t,t=r)):(Ja=t,t=r),t}function Lo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,13)).toLowerCase()===te?Ja+=13:(n=r,0===Ka&&ei(bt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Da()):(Ja=t,t=r)):(Ja=t,t=r),t}function No(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,15)).toLowerCase()===ne?Ja+=15:(n=r,0===Ka&&ei(Et)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Fa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Oo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,5)).toLowerCase()===re?Ja+=5:(n=r,0===Ka&&ei(At)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ma()):(Ja=t,t=r)):(Ja=t,t=r),t}function Co(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===ae?Ja+=3:(n=r,0===Ka&&ei(_t)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=xa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Zo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ie?Ja+=4:(n=r,0===Ka&&ei(Pt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=ba()):(Ja=t,t=r)):(Ja=t,t=r),t}function Do(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,6)).toLowerCase()===oe?Ja+=6:(n=r,0===Ka&&ei(Ut)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ea()):(Ja=t,t=r)):(Ja=t,t=r),t}function Fo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,6)).toLowerCase()===se?Ja+=6:(n=r,0===Ka&&ei(Rt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Aa()):(Ja=t,t=r)):(Ja=t,t=r),t}function Mo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ue?Ja+=4:(n=r,0===Ka&&ei($t)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=_a()):(Ja=t,t=r)):(Ja=t,t=r),t}function xo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,3)).toLowerCase()===le?Ja+=3:(n=r,0===Ka&&ei(kt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Pa()):(Ja=t,t=r)):(Ja=t,t=r),t}function bo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===ce?Ja+=4:(n=r,0===Ka&&ei(Vt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ua()):(Ja=t,t=r)):(Ja=t,t=r),t}function Eo(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===fe?Ja+=4:(n=r,0===Ka&&ei(Jt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=Ra()):(Ja=t,t=r)):(Ja=t,t=r),t}function Ao(){var t,n,a,i;return t=Ja,(n=e.substr(Ja,4)).toLowerCase()===de?Ja+=4:(n=r,0===Ka&&ei(zt)),n!==r?(a=Ja,Ka++,i=wi(),Ka--,i===r?a=void 0:(Ja=a,a=r),a!==r?(za=t,t=$a()):(Ja=t,t=r)):(Ja=t,t=r),t}function _o(){var t;return 44===e.charCodeAt(Ja)?(t=me,Ja++):(t=r,0===Ka&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(Ja)?(t=he,Ja++):(t=r,0===Ka&&ei(Yt)),t}function Uo(){var t;return 41===e.charCodeAt(Ja)?(t=pe,Ja++):(t=r,0===Ka&&ei(qt)),t}function Ro(){var e,t;for(e=[],t=$o();t!==r;)e.push(t),t=$o();return e}function $o(){var t;return t=e.charAt(Ja),Ze.test(t)?Ja++:(t=r,0===Ka&&ei(Kt)),t}function ko(){var t,n,a,i;if(t=Ja,(n=pi())!==r&&(za=t,n=ka(n)),(t=n)===r)if(t=Ja,96===e.charCodeAt(Ja)?(n=ve,Ja++):(n=r,0===Ka&&ei(Qt)),n!==r){if(a=[],i=e.charAt(Ja),De.test(i)?Ja++:(i=r,0===Ka&&ei(Bt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(Ja),De.test(i)?Ja++:(i=r,0===Ka&&ei(Bt));else a=r;a!==r?(96===e.charCodeAt(Ja)?(i=ve,Ja++):(i=r,0===Ka&&ei(Qt)),i!==r?(za=t,t=Va(a)):(Ja=t,t=r)):(Ja=t,t=r)}else Ja=t,t=r;return t}function Vo(e,t,n,r,a){const i={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(i.escape=r),i}function Jo(e,...t){return{type:"expression-list",location:e,value:t}}function zo(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=Vo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:Ja,peg$FAILED:r,peg$maxFailExpected:qa,peg$maxFailPos:Ya};if(n!==r&&Ja===e.length)return n;throw n!==r&&Ja<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(qa,Ya<e.length?e.charAt(Ya):null,Ya<e.length?Xa(Ya,Ya+1):Xa(Ya,Ya))}(e)}}function G(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":G(e.operand,t),G(e.value,t);break;case"case-expression":for(const n of e.clauses)G(n,t);"simple"===e.format&&G(e.operand,t),null!==e.else&&G(e.else,t);break;case"expression-list":for(const n of e.value)G(n,t);break;case"unary-expression":G(e.expr,t);break;case"binary-expression":G(e.left,t),G(e.right,t);break;case"function":G(e.args,t);break;case"interval":G(e.value,t),G(e.qualifier,t);break;case"interval-qualifier":G(e.start,t),G(e.end,t)}}const W=new Set(["current_timestamp","current_date","current_time"]);class X{static makeBool(e){return te(e)}static featureValue(e,t,n,r){return ce(e,t,n,r)}static equalsNull(e){return null===e}static applyLike(e,t,n){return le(e,t,n)}static ensureArray(e){return ne(e)}static applyIn(e,t,n){return oe(e,t)}static currentTimestamp(e){return L(new Date,e)}static currentDate(e){return i.n.fromNow(e)}static currentTime(e){const t=L(new Date,e);return d.k.fromDateTime(t)}static makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}static convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}static compare(e,t,n,r){return R(t,n,e)}static calculate(e,t,n,r){return q(e,t,n,r)}static evaluateTime(e){return F(e)}static evaluateTimestamp(e,t,n){return M(e,t,n)}static evaluateDate(e,t){return x(e,t)}static evaluateFunction(e,t,n){return J(e,t,n)}static lookup(e,t){const n=t[e];return void 0===n?null:n}static between(e,t,n){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],">=")&&R(e,t[1],"<=")}static notbetween(e,t,n){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],"<")||R(e,t[1],">")}static ternaryNot(e){return re(e)}static ternaryAnd(e,t){return ae(e,t)}static ternaryOr(e,t){return ie(e,t)}}class ee{constructor(e,t,n="UTC",r=null){this.fieldsIndex=t,this.timeZone=n,this.currentUser=r,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=j.parse(e);const{isStandardized:a,isAggregate:i,currentUserRequired:o,referencedFieldNames:s}=this._extractExpressionInfo(t);this._referencedFieldNames=s,this.isStandardized=a,this.isAggregate=i,this.currentUserRequired=o}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,A.$P)(e)?e.getTime():O(e)?e.toMillis():D(e)?e.toStorageFormat():Z(e)?e.toStorageString():C(e)?e.toStorageFormat():e;switch(t){case"date":return(0,A.$P)(e)?e.getTime():O(e)?e.toMillis():D(e)?e.toMilliseconds():C(e)?e.toNumber():e;case"date-only":return(0,A.$P)(e)?i.n.fromDateJS(e).toString():D(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,A.$P)(e)?d.k.fromDateJS(e).toStorageString():O(e)?d.k.fromDateTime(e).toStorageString():D(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():Z(e)?e.toStorageString():e;case"timestamp-offset":if((0,A.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(O(e))return f.g.fromDateTime(e).toStorageFormat();if(D(e))return e.toStorageFormat()}return e}static create(e,t={}){return new ee(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=fe,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=fe,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=fe,n=this.currentUser){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null):(0,r.A)("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null))}testFeature(e,t=fe,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=fe,n=this.currentUser){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null):(0,r.A)("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,G(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||W.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return G(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return G(this.parseTree,(t=>{if("function"===t.type){const n=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,a=`${n}-${t}`;e.has(a)||e.set(a,{aggregateType:n,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return G(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","fieldsIndex","timeZone","currentUser",e).bind(X)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,i=!1,o=!1;return G(this.parseTree,(s=>{switch(s.type){case"column-reference":{const r=e?.get(s.column);let a,i;r?a=i=r.name??"":(i=s.column,a=i.toLowerCase()),n.has(a)||(n.add(a),t.push(i)),s.column=i;break}case"current-user":o=!0;break;case"function":{const{name:e,args:t}=s,n=t.value.length;r&&(r=function(e,t){const n=Y[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===i&&(i=(0,a.M)(e,n));break}}})),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:i,currentUserRequired:o}}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 n=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let r=0;r<e.clauses.length;r++)t+=" (this.compare('=',"+n+","+this.evaluateNodeToJavaScript(e.clauses[r].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let n=0;n<e.clauses.length;n++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[n].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[n].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 n of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(n);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 o.L8(o.Z7.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"), timeZone)";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"), timeZone))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";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)+", timeZone)";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";default:throw new o.L8(o.Z7.UnsupportedOperator,{operator:e.operator})}case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"time":return"this.evaluateTime("+JSON.stringify(e.value)+")";case"date":return"this.evaluateDate("+JSON.stringify(e.value)+", 'unknown')";case"timestamp":return"this.evaluateTimestamp("+JSON.stringify(e.value)+", 'unknown')";case"current-time":return"date"===e.mode?"this.currentDate(timeZone)":"time"===e.mode?"this.currentTime(timeZone)":"this.currentTimestamp(timeZone)";case"current-user":return"currentUser";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",fieldsIndex,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+", timeZone)"}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}_evaluateNode(e,t,n,r,i){let s;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,i);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,i);for(let o=0;o<e.clauses.length;o++)if(R(a,this._evaluateNode(e.clauses[o].operand,t,n,r,i),"=",this.timeZone))return this._evaluateNode(e.clauses[o].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}else{for(let a=0;a<e.clauses.length;a++)if(te(this._evaluateNode(e.clauses[a].operand,t,n,r,i)))return this._evaluateNode(e.clauses[a].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],(0,A.$P)(s)?h.c9.fromJSDate(s):null!=s&&"object"==typeof s&&"toDateTime"in s?s.toDateTime():s;case"expression-list":{const a=[];for(const o of e.value)a.push(this._evaluateNode(o,t,n,r,i));return a}case"unary-expression":return re(this._evaluateNode(e.expr,t,n,r,i));case"binary-expression":switch(e.operator){case"AND":return ae(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"OR":return ie(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,n,r,i);case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,n,r,i);case"IN":{const a=ne(this._evaluateNode(e.right,t,n,r,i));return oe(this._evaluateNode(e.left,t,n,r,i),a,this.timeZone)}case"NOT IN":{const a=ne(this._evaluateNode(e.right,t,n,r,i));return re(oe(this._evaluateNode(e.left,t,n,r,i),a,this.timeZone))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],">=",this.timeZone)&&R(a,o[1],"<=",this.timeZone)}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],"<",this.timeZone)||R(a,o[1],">",this.timeZone)}case"LIKE":return le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return re(le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return R(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return q(e.operator,this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=x(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"time":return F(e.value);case"current-time":return"date"===e.mode?X.currentDate(this.timeZone):"time"===e.mode?X.currentTime(this.timeZone):X.currentTimestamp(this.timeZone);case"current-user":return i??null;case"column-reference":return ce(t,e.column,this.fieldsIndex,n);case"data-type":return e.value;case"function":{if(this.isAggregate&&(0,a.M)(e.name,e.args.value.length)){const t=[];for(const a of e.args?.value||[]){const e=[];for(const t of r||[])e.push(this._evaluateNode(a,t,n,null,i));t.push(e)}return(0,a.s)(e.name,t)}const o=this._evaluateNode(e.args,t,n,r,i);return J(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function te(e){return!0===e}function ne(e){return Array.isArray(e)?e:[e]}function re(e){return null!==e?!0!==e:null}function ae(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function ie(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function oe(e,t,n){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}if(P(e)&&P(n)&&(r=R(e,n,"="),r))break}return r}const se="-[]/{}()*+?.\\^$|";var ue;function le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=ue.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case ue.Normal:i===n?a=ue.Escaped:se.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case ue.Escaped:se.includes(i)?r+="\\"+i:r+=i,a=ue.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function ce(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t),o=n?.get(t);return null==a||"esriFieldTypeDate"!==o?.type&&"date"!==o?.type?null==a||"esriFieldTypeDateOnly"!==o?.type&&"date-only"!==o?.type?null==a||"esriFieldTypeTimeOnly"!==o?.type&&"time-only"!==o?.type?null==a||"esriFieldTypeTimestampOffset"!==o?.type&&"timestamp-offset"!==o?.type?a:new f.g(a):d.k.fromReader(a):i.n.fromReader(a):L(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(ue||(ue={}));const fe={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}},95466:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(49186),a=n(25482),i=n(53966),o=n(91869),s=n(3330),u=n(30524),l=n(56400),c=n(96285);const f=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],v(e))}static fromLayerJSON(e){return new d(e.fields??[],v(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const e of this.fields){const t=e?.name,r=h(t);if(t&&r){const a=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(a,e),this._normalizedFieldsMap.set(r,e),n.push(`${a}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,u.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,u.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,u.te)(e)||(0,u.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,u.te)(e)||(0,u.Xz)(e)||e.nullable||void 0!==(0,u.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(i.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),l.n$):p.has(t.type)?l.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===l.L5?s.GB.instance:t===l.n$?c.mQ.utcInstance:(0,o.tE)(f,t,(()=>c.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,u.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>a.A.isSerializable(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,u.rS)(e)?.toLowerCase()??""}const p=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function v(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:a}=e,i=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",s=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,u=a?function(e){return"timeZone"in e}(a)?a.timeZone??s:a.dateFieldsTimeReference?(0,l.ZS)(a.dateFieldsTimeReference):s??l.n$:null,c=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,l.ZS)(r.timeReference):s:null,f=new Map([[m(a?.creationDateField??""),u],[m(a?.editDateField??""),u],[m(i),c],[m(o),c]]);for(const{name:r,type:a}of e.fields)if(p.has(a))t.set(r,l.L5);else if("date"!==a&&"esriFieldTypeDate"!==a)t.set(r,null);else if(n)t.set(r,l.L5);else{const e=f.get(m(r??""))??s;t.set(r,e)}return t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9434],{4902:(e,t,r)=>{r.d(t,{A:()=>u});var i=r(90237),s=r(40608);let l=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+l++})}};return t=(0,i._)([(0,s.$)("esri.core.Identifiable")],t),t};let n=class extends(o(class{})){};var a;n=(0,i._)([(0,s.$)("esri.core.Identifiable")],n),(a=n||(n={})).IdentifiableMixin=o,a.NumericIdentifiableMixin=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:l++})}};return t=(0,i._)([(0,s.$)("esri.core.Identifiable.NumericIdentifiable")],t),t};const u=n},8303:(e,t,r)=>{r.d(t,{A:()=>S});var i=r(90237),s=r(92602),l=r(70333),o=r(78888),n=r(60999),a=r(49186),u=r(53966),h=r(97768),c=r(74887),p=r(84952),d=r(10107),y=(r(44208),r(87811),r(36005)),f=r(40608),m=r(43937),g=r(83531),_=r(20655),A=r(80812),v=r(41318),w=r(10407);const S=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new A.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,c.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.QP)(e),!0))))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!l.id?.findCredential(this.url),s=e===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let o,n;if(s)o=r.portal.url;else try{o=await(0,g.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!o||!(0,p.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;n=await(l.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const a=!0,u=!1,h=!1;if(!n)return{features:{edit:a,fullEdit:u},content:{updateItem:h}};try{if(s?await r.reload():(r=new A.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,c.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:h}}}_getUserPrivileges(e,t){const r=(0,w.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?l.id?.findCredential(this.url):null;if(!t)return!0;const r=x.credential===t?x.user:await this._fetchEditingUser(e);return x.credential=t,x.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=l.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=_.A.getDefault();if(s&&s.loaded&&(0,p.S8)(s.restUrl)===(0,p.S8)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,h=await(0,n.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?v.A.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||_.A.getDefault());return r&&i&&!(0,p.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,d.MZ)({type:A.default})],t.prototype,"portalItem",null),(0,i._)([(0,y.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,d.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},x={credential:null,user:null}},18768:(e,t,r)=>{r.d(t,{b:()=>a});var i=r(90237),s=r(53966),l=r(10107),o=(r(44208),r(87811),r(40608)),n=r(60694);const a=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,s.A.getLogger(this)))}};return(0,i._)([(0,l.MZ)()],t.prototype,"title",null),(0,i._)([(0,l.MZ)({type:String})],t.prototype,"url",null),t=(0,i._)([(0,o.$)("esri.layers.mixins.ArcGISService")],t),t}},36708:(e,t,r)=>{r.d(t,{C_:()=>p,OH:()=>f,Vh:()=>m,on:()=>c,pc:()=>g,wB:()=>a,z7:()=>u});var i=r(37955),s=r(36563),l=r(97768),o=r(74887),n=r(14012);function a(e,t,r={}){return h(e,t,r,d)}function u(e,t,r={}){return h(e,t,r,y)}function h(e,t,r={},i){let s=null;const o=r.once?(e,r)=>{i(e)&&((0,l.xt)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,n.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return s}function c(e,t,r,o={}){let n=null,u=null,h=null;function c(){n&&u&&(u.remove(),o.onListenerRemove?.(n),n=null,u=null)}function p(e){o.once&&o.once&&(0,l.xt)(h),r(e)}const d=a(e,((e,r)=>{c(),(0,i.wb)(e)&&(n=e,u=(0,i.on)(e,t,p),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,s.hA)((()=>{d.remove(),c()})),h}function p(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let n=null;function a(){n=(0,l.xt)(n)}return new Promise(((i,l)=>{n=(0,s.vE)([(0,o.u7)(r,(()=>{a(),l((0,o.NK)())})),h(e,(e=>{a(),i(e)}),{sync:!1,once:!0},t??d)])}))}(e,y,t)}function d(e){return!0}function y(e){return!!e}r(80559);const f={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},44159:(e,t,r)=>{r.d(t,{A:()=>s});var i=r(93687);class s{static{this.pool=new i.A(s,null,null,25,50)}static getId(e,t,r,i){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${i}`}constructor(e,t,r,i){this.set(e,t,r,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,i){this.set(e,t,r,i)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,i){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,r,i,s]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(r),this.col=parseFloat(i),this.world=parseFloat(s)}else this.level=+e,this.row=+t,this.col=+r,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,t,r){const i=this.clone();return i.col+=e,i.row+=t,r.normalizeKey(i),i}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,i=this.world;return[new s(e,t,r,i),new s(e,t,r+1,i),new s(e,t+1,r,i),new s(e,t+1,r+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}},48757:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ue});var i=r(90237),s=r(78888),l=r(60999),o=r(49186),n=r(4718),a=r(92071),u=r(74887),h=r(84952),c=r(10107),p=(r(44208),r(53966)),d=r(36005),y=r(40608),f=r(43937),m=r(5443),g=r(16930),_=r(4146),A=r(52136),v=r(89186),w=r(18768),S=r(63074),x=r(69208),b=r(16131),I=r(8303),R=r(54310),P=r(25036);let U=null;var M=r(34275);class z{constructor(e,t){this._spriteSource=e,this._maxTextureSize=t,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===e.type&&e.spriteFormat&&(this._spriteImageFormat=e.spriteFormat),e.pixelRatio&&(this.devicePixelRatio=e.pixelRatio),this.baseURL=e.spriteUrl}get spriteNames(){const e=[];for(const t in this._spritesData)e.push(t);return e.sort(),e}getSpriteInfo(e){return this._spritesData?this._spritesData[e]:null}async load(e){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(e),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(e){this._isRetina=this.devicePixelRatio>1.15;const{width:t,height:r,data:i,json:s}=await this._getSpriteData(this._spriteSource,e),l=Object.keys(s);if(!l||0===l.length||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=s,this.width=t,this.height=r;const n=Math.max(this._maxTextureSize,4096);if(t>n||r>n){const e=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw p.A.getLogger("esri.layers.support.SpriteSource").error(e),new o.A("SpriteSource",e)}let a;for(let e=0;e<i.length;e+=4)a=i[e+3]/255,i[e]=i[e]*a,i[e+1]=i[e+1]*a,i[e+2]=i[e+2]*a;this.image=i}async _getSpriteData(e,t){if("image"===e.type){let t,r;if(this.devicePixelRatio<1.15){if(!e.spriteSource1x)throw new o.A("SpriteSource","no image data provided for low resolution sprites!");t=e.spriteSource1x.image,r=e.spriteSource1x.json}else{if(!e.spriteSource2x)throw new o.A("SpriteSource","no image data provided for high resolution sprites!");t=e.spriteSource2x.image,r=e.spriteSource2x.json}return"width"in t&&"height"in t&&"data"in t&&((0,M.mw)(t.data)||(0,M.UR)(t.data))?{width:t.width,height:t.height,data:new Uint8Array(t.data),json:r}:{...E(t),json:r}}const r=(0,h.An)(this.baseURL),i=r.query?"?"+(0,h.x0)(r.query):"",l=this._isRetina?"@2x":"",n=`${r.path}${l}.${this._spriteImageFormat}${i}`,a=`${r.path}${l}.json${i}`,[u,c]=await Promise.all([(0,s.A)(a,t),(0,s.A)(n,{responseType:"image",...t})]);return{...E(c.data),json:u.data}}}function E(e){const t=document.createElement("canvas"),r=t.getContext("2d");t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height);return{width:e.width,height:e.height,data:new Uint8Array(i.data)}}var T=r(87045),L=r(25943),O=r(21325),C=r(28735),j=r(44159);class k{constructor(e){this.url=e}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.A)(this.url).then((e=>e.data.index))),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return(0,u.Te)(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;0!==i.level;)i=new j.A(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,n=r.pop();if(1===o)return n;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(0===o[l]){n=null;break}if(1===o[l]){n=s;break}n=s,o=o[l]}return n}}var F=r(97768);class ${constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=(0,F.pR)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.A)(this._tileIndexUrl,{query:{...e?.query}}).then((e=>e.data.index))),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new j.A(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then((()=>(l.world=e.world,l))).catch((e=>{if((0,u.zf)(e))throw e;return null}))}}var B=r(91869);class D{constructor(e){this._tileUrl=e,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(e){(null==this._promise||(0,u.G4)(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const t=this._abortOptions;return t.push(e),(0,u.u7)(e,(()=>{t.every((e=>(0,u.G4)(e)))&&this._abortController.abort()})),this._promise.then((e=>(0,n.o8)(e)))}async _makeRequest(e){this._abortController=new AbortController;const{data:t}=await(0,s.A)(e,{responseType:"array-buffer",signal:this._abortController.signal});return t}}const N=new Map;function K(e,t){return(0,B.tE)(N,e,(()=>new D(e))).getData(t).finally((()=>N.delete(e)))}class Z{constructor(e,t,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=e,this.sourceUrl=t;const i=(0,h.An)(this.sourceUrl),s=(0,n.o8)(r),l=s.tiles;if(i)for(let e=0;e<l.length;e++){const t=(0,h.An)(l[e]);t&&((0,h.oP)(t.path)||(t.path=(0,h.fj)(i.path,t.path)),l[e]=(0,h.a6)(t.path,{...i.query,...t.query}))}this.tileServers=l;const o=r.capabilities&&r.capabilities.split(",").map((e=>e.toLowerCase().trim())),a=!0===r?.exportTilesAllowed,u=!0===o?.includes("tilemap"),c=a&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+c}:null},this.tileInfo=T.A.fromJSON(s.tileInfo);const p=r.tileMap?(0,h.a6)((0,h.fj)(i.path,r.tileMap),i.query??{}):null;u?(this.type="vector-tile",this.tilemap=new $(new L.d({layer:{parsedUrl:i,tileInfo:this.tileInfo},minLOD:s.minLOD??this.tileInfo.lods[0].level,maxLOD:s.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),p)):p&&(this.tilemap=new k(p)),this.fullExtent=m.A.fromJSON(r.fullExtent),this.initialExtent=m.A.fromJSON(r.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(e,t){return this.tilemap?this.tilemap.dataKey(e,t):e}requestTile(e,t,r,i){return function(e,t,r,i,s){const l=(0,h.An)(e),o=l.query;if(o)for(const[e,s]of Object.entries(o))switch(s){case"{x}":o[e]=i.toString();break;case"{y}":o[e]=r.toString();break;case"{z}":o[e]=t.toString()}const n=l.path;return K((0,h.a6)(n.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}(this.tileServers[t%this.tileServers.length],e,t,r,i)}isCompatibleWith(e){const t=this.tileInfo,r=e.tileInfo;if(!t.spatialReference.equals(r.spatialReference))return!1;if(!t.origin.equals(r.origin))return!1;if(Math.round(t.dpi)!==Math.round(r.dpi))return!1;const i=t.lods,s=r.lods,l=Math.min(i.length,s.length);for(let e=0;e<l;e++){const t=i[e],r=s[e];if(t.level!==r.level||Math.round(t.scale)!==Math.round(r.scale))return!1}return!0}}function Q(...e){let t;for(const r of e)if(null!=r)if((0,h.BQ)(r)){if(t){const e=t.split("://")[0];t=e+":"+r.trim()}}else t=(0,h.oP)(r)?r:(0,h.fj)(t,r);return t?(0,h.UC)(t):void 0}async function q(e,t,r,i,l){let o,n,a;if((0,u.Te)(l),"string"==typeof r){const e=(0,h.S8)(r);a=await(0,s.A)(e,{...l,responseType:"json",query:{f:"json",...l?.query}}),a.ssl&&(o&&(o=o.replace(/^http:/i,"https:")),n&&(n=n.replace(/^http:/i,"https:"))),o=e,n=e}else null!=r&&(a={data:r},o=r.jsonUrl||null,n=i);const c=a?.data;if(H(c))return e.styleUrl=o||null,async function(e,t,r,i){const s=r?(0,h.nM)(r):(0,h.gd)();e.styleBase=s,e.style=t,t["sprite-format"]&&"webp"===t["sprite-format"].toLowerCase()&&(e.spriteFormat="webp");const l=[];if(t.sources&&t.sources.esri){const r=t.sources.esri;r.url?await q(e,"esri",Q(s,r.url),void 0,i):l.push(q(e,"esri",r,s,i))}for(const r of Object.keys(t.sources))"esri"!==r&&"vector"===t.sources[r].type&&(t.sources[r].url?l.push(q(e,r,Q(s,t.sources[r].url),void 0,i)):t.sources[r].tiles&&l.push(q(e,r,t.sources[r],s,i)));await Promise.all(l)}(e,c,n,l);if(!H(c))return e.sourceUrl?W(e,c,n,!1,t,l):(e.sourceUrl=o||null,W(e,c,n,!0,t,l));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function G(e){return"object"==typeof e&&!!e&&"tilejson"in e&&null!=e.tilejson}function H(e){return!!e&&"sources"in e&&!!e.sources}async function W(e,t,r,i,s,l){const o=r?(0,h.UC)(r)+"/":(0,h.gd)(),a=function(e){const t=512;if(function(e){return e.hasOwnProperty("tileInfo")}(e)){const r=e?.tileInfo;return null!=r&&(null==r.rows&&(r.rows=t),null==r.cols&&(r.cols=t)),e}const r={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}};let i=null;if(G(e)){const{bounds:t}=e;if(t){const e=(0,C.Gh)({x:t[0],y:t[1],spatialReference:(0,n.o8)(O.KK)}),r=(0,C.Gh)({x:t[2],y:t[3],spatialReference:(0,n.o8)(O.KK)});i={xmin:e.x,ymin:e.y,xmax:r.x,ymax:r.y,spatialReference:(0,n.o8)(O.ch)}}}null===i&&(i=r);let s=78271.51696400007,l=295828763.7957775;const o=[],a=e.hasOwnProperty("maxzoom")&&null!=e.maxzoom?+e.maxzoom:22;for(let e=0;e<=a;e++)o.push({level:e,scale:l,resolution:s}),s/=2,l/=2;return{capabilities:"TilesOnly",initialExtent:i,fullExtent:r,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:t,cols:t,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:o,spatialReference:(0,n.o8)(O.ch)}}}(t),u=new Z(s,(0,h.a6)(o,l?.query??{}),a);if(!i&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(u))return;null!=u.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(u.fullExtent):t.fullExtent=u.fullExtent.clone()),t.tileInfo&&u.tileInfo&&t.tileInfo.lods.length<u.tileInfo.lods.length&&(t.tileInfo=u.tileInfo)}if(i&&(e.sourceBase=o,e.source=t,e.validatedSource=a,e.primarySourceName=s),e.sourceNameToSource[s]=u,!G(e)&&"defaultStyles"in t&&!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?q(e,"",Q(o,t.defaultStyles,"root.json"),void 0,l):q(e,"",t.defaultStyles,Q(o,"root.json"),l)}}var V=r(88788),J=r(39131),X=r(97159),Y=r(86738),ee=r(91806);const te=1e-6;function re(e,t){if(e===t)return!0;if(null==e&&null!=t)return!1;if(null!=e&&null==t)return!1;if(null==e||null==t)return!1;if(!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,i=t.origin;if(Math.abs(r.x-i.x)>=te||Math.abs(r.y-i.y)>=te)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let e=s.lods[0].scale;e>=l.lods[l.lods.length-1].scale-te;e/=2)if(Math.abs(e-l.lods[0].scale)<te)return!0;return!1}function ie(e,t){if(e===t)return e;if(null==e&&null!=t)return t;if(null!=e&&null==t)return e;if(null==e||null==t)return null;const r=e.size[0],i=e.format,s=e.dpi,l=new Y.A({x:e.origin.x,y:e.origin.y}),o=e.spatialReference,n=e.lods[0].scale>t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=n.scale,h=n.resolution,c=a.scale,p=[];let d=u,y=h,f=0;for(;d>=c;)p.push(new ee.A({level:f,resolution:y,scale:d})),f++,d/=2,y/=2;return new T.A({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:p,spatialReference:o})}var se=r(45013);let le;function oe(){return le??=function(){const e=new ne,t=function(e){if("undefined"==typeof WebGL2RenderingContext)return null;const t=document.createElement("canvas");if(!t)return null;let r=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0});if(null==r&&(r=t.getContext("webgl2"),null!=r&&(e.majorPerformanceCaveat=!0)),null==r)return r;e.available=!0,e.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const i=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);return i&&(e.supportsHighPrecisionFragment=i.precision>0),r}(e);return null==t||(e.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float"),e.unmaskedRenderer=function(e){const t=e.getExtension("WEBGL_debug_renderer_info");return t?{getUnmaskedRendererWebGL:()=>e.getParameter(t.UNMASKED_RENDERER_WEBGL)}:null}(t)?.getUnmaskedRendererWebGL()??"unknown"),e}(),le}class ne{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1,this.unmaskedRenderer="unloaded"}}let ae=class extends((0,S.dM)((0,P.j)((0,R.J)((0,v.f)((0,w.b)((0,b.q)((0,I.A)((0,x.d)((0,A.p)((0,a.P)(_.A))))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(u.QP).then((async()=>{if(!this.portalItem?.id)return;const t=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,s.A)(t,{...e,query:{f:"json",...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:t},(0,V.v)(this.portalItem,"portal-item"))})).catch(u.QP).then((()=>this._loadStyle(e)));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&(0,h.An)(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?(0,h.a6)(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?(0,h.An)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&(0,h.BQ)(e)&&(e=`https:${e}`);const r=(0,J.py)(e);t.styleUrl=(0,X.e)(e,r)}get tileInfo(){const e=[];for(const t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new T.A;if(e.length>1)for(let r=0;r<e.length;r++)re(t,e[r].tileInfo)&&(t=ie(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new L.d({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=oe().maxTextureSize,i=this.currentStyleInfo?.spriteUrl?(0,h.a6)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,s=new z({type:"url",spriteUrl:i,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await s.load(t),this._spriteSourceMap.set(e,s)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=oe().maxTextureSize,i=e.spriteUrl,s=i?(0,h.a6)(i,{...this.customParameters,token:this.apiKey}):null;if(!s&&"url"===e.type)return null;const l=new z(e,r);try{await l.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,l),s&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=s),this.emit("spriteSource-change",{spriteSource:l}),l}catch(e){(0,u.QP)(e)}return null}async loadStyle(e,t){const r=e||this.style||this.url;return this._loadingTask&&"string"==typeof r&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=(0,l.UT)((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return(0,n.o8)(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return(0,n.o8)(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return(0,n.o8)(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new o.A("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await async function(e,t){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[i,s]="string"==typeof e?[e,null]:[null,e.jsonUrl];return await q(r,"esri",e,s,t),{layerDefinition:r.validatedSource,url:i,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&Q(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&Q(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}(e,{...t,query:{...this.customParameters,token:this.apiKey}});"webp"===r.spriteFormat&&(await function(){if(U)return U;const e={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return U=new Promise((t=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,t(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,t(!1)},r.src="data:image/webp;base64,"+e.lossy})),U}()||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new se.A(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),r=["OpenBasemap_v2","OpenBasemap_GCS_v2","OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const e of r)if(e.toLowerCase().includes(i))return(0,h.S8)(`//static.arcgis.com/attribution/Vector${s}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"attributionDataUrl",null),(0,i._)([(0,c.MZ)({type:["show","hide"]})],ae.prototype,"listMode",void 0),(0,i._)([(0,c.MZ)({json:{read:!0,write:!0}})],ae.prototype,"blendMode",void 0),(0,i._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],ae.prototype,"capabilities",null),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"currentStyleInfo",void 0),(0,i._)([(0,c.MZ)({json:{read:!1},readOnly:!0,type:m.A})],ae.prototype,"fullExtent",null),(0,i._)([(0,c.MZ)({json:{read:!1},readOnly:!0,type:m.A})],ae.prototype,"initialExtent",null),(0,i._)([(0,c.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ae.prototype,"isReference",void 0),(0,i._)([(0,c.MZ)({type:["VectorTileLayer"]})],ae.prototype,"operationalLayerType",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"parsedUrl",null),(0,i._)([(0,c.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ae.prototype,"path",void 0),(0,i._)([(0,c.MZ)({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],ae.prototype,"refreshInterval",void 0),(0,i._)([(0,c.MZ)()],ae.prototype,"style",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"serviceUrl",null),(0,i._)([(0,c.MZ)({type:g.A,readOnly:!0})],ae.prototype,"spatialReference",null),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"styleRepository",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"sourceNameToSource",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"primarySource",void 0),(0,i._)([(0,c.MZ)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],ae.prototype,"styleUrl",null),(0,i._)([(0,f.K)(["portal-item","web-document"],"styleUrl")],ae.prototype,"writeStyleUrl",null),(0,i._)([(0,c.MZ)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:T.A})],ae.prototype,"tileInfo",null),(0,i._)([(0,c.MZ)()],ae.prototype,"tilemapCache",void 0),(0,i._)([(0,d.w)("service","tilemapCache",["capabilities","tileInfo"])],ae.prototype,"readTilemapCache",null),(0,i._)([(0,c.MZ)({json:{read:!1},readOnly:!0,value:"vector-tile"})],ae.prototype,"type",void 0),(0,i._)([(0,c.MZ)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],ae.prototype,"url",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],ae.prototype,"version",void 0),(0,i._)([(0,d.w)("version",["version","currentVersion"])],ae.prototype,"readVersion",null),ae=(0,i._)([(0,y.$)("esri.layers.VectorTileLayer")],ae);const ue=ae},52136:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(90237),s=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.MZ)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,l.$)("esri.layers.mixins.APIKeyMixin")],t),t}},66344:(e,t,r)=>{r.d(t,{q:()=>a});var i,s,l=r(3694);(s=i||(i={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new l.A,this._users=new l.A}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear()}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const r=this._db.get(e.id+t);return r?.size??0}put(e,t,r,s,l){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,i.ALL)),s>this._maxSize)return void this._notifyRemove(t,r,s,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,r,0,i.ALL);const a=1+Math.max(l,-4)- -3;this._db.set(t,new n(r,s,a)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t,r,s){t=e.id+t;const l=this._db.get(t);if(l&&l.entry===r){for(this._size-=l.size,e.size-=l.size;s>this._maxSize;){const e=this._notifyRemove(t,r,s,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}l.size=s,this._size+=s,e.size+=s,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach(((e,i)=>{const s=e.lifetime;r[s]=(r[s]||0)+e.size,this._users.forAll((r=>{const{id:s,name:l}=r;if(i.startsWith(s)){const r=t[l]||0;t[l]=r+e.size}}))}));const i={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[r]||0;t[r]=s,i[r]=Math.round(100*e.hitRate)+"%"}else i[r]="0%"}));const s=Object.keys(t);s.sort(((e,r)=>t[r]-t[e])),s.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+i[r]));for(let t=r.length-1;t>=0;--t){const i=r[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,i){let s;return this._removeFuncs.some((l=>{if(e.startsWith(l[0])){const e=l[1](t,i,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let i=!0;for(;i;){i=!1;for(const[s,l]of this._db)if(0===l.lifetime&&(!r||s.startsWith(r))){if(this._purgeItem(s,l,e),t.size<=.9*t.maxSize)return;i||=this._db.has(s)}}for(const[i,s]of this._db)if((!r||i.startsWith(r))&&(this._purgeItem(i,s,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=s&&s>0&&(this._size+=s,r&&(r.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}class n{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}}class a{constructor(e,t){this._storage=new o,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69208:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(90237),s=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,i._)([(0,l.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},78553:(e,t,r)=>{r.d(t,{D:()=>l,p:()=>s});var i=r(56507);function s(e){const t=(0,i.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function l(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}},88788:(e,t,r)=>{r.d(t,{m:()=>o,v:()=>l});var i=r(84952),s=r(20655);function l(e,t){return{...n(e,t),readResourcePaths:[]}}function o(e,t,r){const s=(0,i.An)(e.itemUrl);return{...n(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function n(e,t){return{origin:t,url:(0,i.An)(e.itemUrl),portal:e.portal||s.A.getDefault(),portalItem:e}}}}]);
|