@arcgis/core 4.32.0-next.20250219 → 4.32.0-next.20250221
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/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
- package/applications/ExperienceBuilder/sketchUtils.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0c3930e40fc9f8a84599.js +2 -0
- package/assets/esri/core/workers/chunks/{ccee343fb8c415b59ce3.js.LICENSE.txt → 0c3930e40fc9f8a84599.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/37323e58dbec303f5054.js +1 -0
- package/assets/esri/core/workers/chunks/486df1e042204b90b0dd.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{c2d539359f321bba3432.js → 52c13b3c074c9f6dadde.js} +2 -2
- package/assets/esri/core/workers/chunks/{c2d539359f321bba3432.js.LICENSE.txt → 52c13b3c074c9f6dadde.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{f1c9595096c047e93145.js → 5341b86c2fb5347393c5.js} +1 -1
- package/assets/esri/core/workers/chunks/5693d9ce4472a4c5959f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/5b56b271afb0fadf48b4.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/60d5cbfa9e1c6b3c98df.js +1 -0
- package/assets/esri/core/workers/chunks/{a5acbdb8347a809a26c0.js → 610c3249fe81e370af8c.js} +1 -1
- package/assets/esri/core/workers/chunks/6518954889df2e781c47.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{d98c78e89d70ad0b8628.js → 6ab476f696290d190c6c.js} +1 -1
- package/assets/esri/core/workers/chunks/7292bb19b73f601d891b.js +1 -0
- package/assets/esri/core/workers/chunks/78c066e8fe167d4ab817.js +1 -0
- package/assets/esri/core/workers/chunks/80744ad7f7656ef918db.js +1 -0
- package/assets/esri/core/workers/chunks/8bbe8df40df2b8e54562.js +1 -0
- package/assets/esri/core/workers/chunks/b0952b81d5be214262dd.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/caf410ed75c40b3703eb.js +1 -0
- package/assets/esri/core/workers/chunks/df506c4f81affce248c4.js +1 -0
- package/assets/esri/core/workers/chunks/{4be39bc2d2edd94bdb75.js → e481e7d508274bc83c70.js} +1 -1
- package/assets/esri/core/workers/chunks/eefa1dfeb63ce965bb40.js +1 -0
- package/assets/esri/core/workers/chunks/fd8790291348fb7ead55.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +7 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +14 -0
- package/assets/esri/themes/base/widgets/_ResponsiveToolbar.scss +9 -3
- package/assets/esri/themes/base/widgets/_Sketch.scss +32 -24
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/copyright.txt +1 -1
- package/core/sql/AggregateFunctions.js +1 -1
- package/core/sql/DateOnly.js +1 -1
- package/core/sql/SqlInterval.js +1 -1
- package/core/sql/SqlTimestampOffset.js +1 -1
- package/core/sql/TimeOnly.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/sql/WhereGrammar.js +1 -1
- package/core/sql/sqlCompareUtils.js +1 -1
- package/core/sql/sqlDateParsingUtils.js +1 -1
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
- package/editing/sharedTemplates/support/sharedTemplateErrors.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/GroupTemplatePart.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/TemplatePartBase.js +1 -1
- package/interfaces.d.ts +480 -65
- package/layers/RouteLayer.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/Relationship.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +2 -2
- package/rest/route.js +1 -1
- package/rest/support/PointBarrier.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/RouteSolveResult.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/fitVectorMarker.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/AnimationManager.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/sources/FeatureCache.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/snapshotUtils.js +5 -0
- package/views/2d/layers/features/support/whereUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/View.js +1 -1
- package/views/animation/easing.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/VisibleElements.js +5 -0
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureForm/VisibleElements.js +5 -0
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Legend/styles/support/utils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +5 -0
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OverlayLayersListViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +5 -0
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/symbols.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/GoTo.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/widgets/support/goToUtils.js +1 -1
- package/widgets/support/symbolPreviewUtils.js +1 -1
- package/assets/esri/core/workers/chunks/10ca2107c99fab6bcc3b.js +0 -1
- package/assets/esri/core/workers/chunks/122ed10cac9f192e1eec.js +0 -1
- package/assets/esri/core/workers/chunks/1b3a52ce3e8e5be4d196.js +0 -1
- package/assets/esri/core/workers/chunks/1bf646c9fc352f98d1ca.js +0 -1
- package/assets/esri/core/workers/chunks/35e4af82a08b4eadbfab.js +0 -1
- package/assets/esri/core/workers/chunks/6f007703662e714b2f0a.js +0 -1
- package/assets/esri/core/workers/chunks/8232a2c4bdc3011bb9e3.js +0 -1
- package/assets/esri/core/workers/chunks/8b8579d81728cb35bb29.js +0 -1
- package/assets/esri/core/workers/chunks/934857de20f6f5c15188.js +0 -1
- package/assets/esri/core/workers/chunks/b8fae500c69ca2cff62a.js +0 -1
- package/assets/esri/core/workers/chunks/ccee343fb8c415b59ce3.js +0 -2
- package/widgets/OrientedImageryViewer/adapters/sketch/DigitizationAdapter.js +0 -5
- package/widgets/OrientedImageryViewer/digitizationUtils.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"formFailedToLoad":"Не вдалося завантажити форму.","differentValues":"(Різні значення)","empty":"Без значення","showAllOptions":"Показати всі опції","valueExpressionError":"Не вдалося обчислити значення","failedToCalculateValues":"Не вдалося обчислити значення","expressionEvaluationFailed":"Не вдалося виконати обчислення форми.","formComplexityThresholdExceeded":"Не вдалося завантажити форму. Спробуйте з меншою кількістю обʼєктів","validationErrors":{"cannotBeNull":"Введіть значення","outsideRange":"Значення має знаходитися в діапазоні від {min} до {max}","outsideRangeMax":"Значення має бути менше або дорівнювати {max}","outsideRangeMin":"Значення має бути більше або дорівнювати {min}","invalidCodedValue":"Значення має бути одним з перелічених значень.","invalidType":"Неприпустиме значення","invalidBatchFormType":"Деякі обʼєкти містять неприпустимі значення. Перевірте окремі обʼєкти.","tooShort":"Це поле потребує щонайменше {min} символів","featuresInError":"Деякі обʼєкти мають помилки. Перевірте окремі обʼєкти.","nonVisibleError_checkIndividualFeatures":"Деякі обʼєкти мають приховані поля з неприпустимими значеннями. Перевірте окремі обʼєкти та усуньте проблеми.","featuresWithInvalidValues":"Деякі обʼєкти мають неприпустимі значення","nonVisibleError_changeValues":"Вибраний обʼєкт має приховані поля з неприпустимими значеннями. Змініть значення, щоб поля стали видимими."},"noVisibleFields":{"noElementsInCommon":"У вибраних обʼєктів немає спільних полів","noElements":"У вибраного обʼєкту немає полів для відображення","elementsHiddenInSome":"У вибраних обʼєктів є спільні поля, які не відображаються через вирази видимості","allElementsHidden":"У вибраних обʼєктів немає полів для відображення"},"requiredFieldBatchMode":"Для цього поля потрібен один або кілька обʼєктів.","requiredFieldLabel":"{name} - обов’язкове поле"}
|
|
1
|
+
{"formFailedToLoad":"Не вдалося завантажити форму.","differentValues":"(Різні значення)","empty":"Без значення","showAllOptions":"Показати всі опції","valueExpressionError":"Не вдалося обчислити значення","failedToCalculateValues":"Не вдалося обчислити значення","expressionEvaluationFailed":"Не вдалося виконати обчислення форми.","formComplexityThresholdExceeded":"Не вдалося завантажити форму. Спробуйте з меншою кількістю обʼєктів","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Введіть значення","outsideRange":"Значення має знаходитися в діапазоні від {min} до {max}","outsideRangeMax":"Значення має бути менше або дорівнювати {max}","outsideRangeMin":"Значення має бути більше або дорівнювати {min}","invalidCodedValue":"Значення має бути одним з перелічених значень.","invalidType":"Неприпустиме значення","invalidBatchFormType":"Деякі обʼєкти містять неприпустимі значення. Перевірте окремі обʼєкти.","tooShort":"Це поле потребує щонайменше {min} символів","featuresInError":"Деякі обʼєкти мають помилки. Перевірте окремі обʼєкти.","nonVisibleError_checkIndividualFeatures":"Деякі обʼєкти мають приховані поля з неприпустимими значеннями. Перевірте окремі обʼєкти та усуньте проблеми.","featuresWithInvalidValues":"Деякі обʼєкти мають неприпустимі значення","nonVisibleError_changeValues":"Вибраний обʼєкт має приховані поля з неприпустимими значеннями. Змініть значення, щоб поля стали видимими."},"noVisibleFields":{"noElementsInCommon":"У вибраних обʼєктів немає спільних полів","noElements":"У вибраного обʼєкту немає полів для відображення","elementsHiddenInSome":"У вибраних обʼєктів є спільні поля, які не відображаються через вирази видимості","allElementsHidden":"У вибраних обʼєктів немає полів для відображення"},"requiredFieldBatchMode":"Для цього поля потрібен один або кілька обʼєктів.","requiredFieldLabel":"{name} - обов’язкове поле"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"formFailedToLoad":"Không thể tải biểu mẫu.","differentValues":"(Các giá trị khác nhau)","empty":"Không có giá trị","showAllOptions":"Hiển thị tất cả tùy chọn","valueExpressionError":"Không thể tính toán giá trị","failedToCalculateValues":"Không thể tính toán giá trị","expressionEvaluationFailed":"Không thể chạy tính toán biểu mẫu","formComplexityThresholdExceeded":"Không thể tải biểu mẫu. Vui lòng thử với ít đối tượng hơn","validationErrors":{"cannotBeNull":"Vui lòng nhập giá trị","outsideRange":"Giá trị phải nằm trong khoảng từ {min} đến {max}","outsideRangeMax":"Giá trị phải nhỏ hơn hoặc bằng {max}","outsideRangeMin":"Giá trị phải lớn hơn hoặc bằng {min}","invalidCodedValue":"Giá trị phải là một trong các giá trị được liệt kê.","invalidType":"Không phải là giá trị hợp lệ","invalidBatchFormType":"Một hoặc nhiều đối tượng chứa giá trị không hợp lệ. Kiểm tra từng đối tượng.","tooShort":"Trường này yêu cầu nhập tối thiểu {min} ký tự","featuresInError":"Một hoặc nhiều đối tượng có lỗi. Kiểm tra từng đối tượng.","nonVisibleError_checkIndividualFeatures":"Một hoặc nhiều đối tượng có trường bị ẩn với giá trị không hợp lệ. Kiểm tra từng đối tượng và khắc phục sự cố.","featuresWithInvalidValues":"Một hoặc nhiều đối tượng có giá trị không hợp lệ","nonVisibleError_changeValues":"Đối tượng được chọn có trường bị ẩn với giá trị không hợp lệ. Thay đổi giá trị để các trường có thể nhìn thấy được."},"noVisibleFields":{"noElementsInCommon":"Đối tượng được chọn không có trường được chia sẻ","noElements":"Đối tượng được chọn không có trường để hiển thị","elementsHiddenInSome":"Đối tượng được chọn có trường được chia sẻ không được hiển thị vì biểu thức tùy chọn","allElementsHidden":"Đối tượng được chọn không có trường để hiển thị"},"requiredFieldBatchMode":"Cần có trường này cho một hoặc nhiều đối tượng.","requiredFieldLabel":"{name} - trường bắt buộc"}
|
|
1
|
+
{"formFailedToLoad":"Không thể tải biểu mẫu.","differentValues":"(Các giá trị khác nhau)","empty":"Không có giá trị","showAllOptions":"Hiển thị tất cả tùy chọn","valueExpressionError":"Không thể tính toán giá trị","failedToCalculateValues":"Không thể tính toán giá trị","expressionEvaluationFailed":"Không thể chạy tính toán biểu mẫu","formComplexityThresholdExceeded":"Không thể tải biểu mẫu. Vui lòng thử với ít đối tượng hơn","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Vui lòng nhập giá trị","outsideRange":"Giá trị phải nằm trong khoảng từ {min} đến {max}","outsideRangeMax":"Giá trị phải nhỏ hơn hoặc bằng {max}","outsideRangeMin":"Giá trị phải lớn hơn hoặc bằng {min}","invalidCodedValue":"Giá trị phải là một trong các giá trị được liệt kê.","invalidType":"Không phải là giá trị hợp lệ","invalidBatchFormType":"Một hoặc nhiều đối tượng chứa giá trị không hợp lệ. Kiểm tra từng đối tượng.","tooShort":"Trường này yêu cầu nhập tối thiểu {min} ký tự","featuresInError":"Một hoặc nhiều đối tượng có lỗi. Kiểm tra từng đối tượng.","nonVisibleError_checkIndividualFeatures":"Một hoặc nhiều đối tượng có trường bị ẩn với giá trị không hợp lệ. Kiểm tra từng đối tượng và khắc phục sự cố.","featuresWithInvalidValues":"Một hoặc nhiều đối tượng có giá trị không hợp lệ","nonVisibleError_changeValues":"Đối tượng được chọn có trường bị ẩn với giá trị không hợp lệ. Thay đổi giá trị để các trường có thể nhìn thấy được."},"noVisibleFields":{"noElementsInCommon":"Đối tượng được chọn không có trường được chia sẻ","noElements":"Đối tượng được chọn không có trường để hiển thị","elementsHiddenInSome":"Đối tượng được chọn có trường được chia sẻ không được hiển thị vì biểu thức tùy chọn","allElementsHidden":"Đối tượng được chọn không có trường để hiển thị"},"requiredFieldBatchMode":"Cần có trường này cho một hoặc nhiều đối tượng.","requiredFieldLabel":"{name} - trường bắt buộc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"formFailedToLoad":"表单加载失败。","differentValues":"(不同值)","empty":"没有值","showAllOptions":"显示所有选项","valueExpressionError":"计算值失败","failedToCalculateValues":"无法计算值","expressionEvaluationFailed":"表单计算失败","formComplexityThresholdExceeded":"表单加载失败。 请尝试减少处理的要素数量","validationErrors":{"cannotBeNull":"请输入一个值","outsideRange":"值应该介于 {min} 到 {max} 之间","outsideRangeMax":"值应小于或等于 {max}","outsideRangeMin":"值应大于或等于 {min}","invalidCodedValue":"值应为下列某个值。","invalidType":"不是有效值","invalidBatchFormType":"一个或多个要素包含无效值。 检查各个要素。","tooShort":"此字段至少需要 {min} 个字符。","featuresInError":"一个或多个要素具有错误。 检查各个要素。","nonVisibleError_checkIndividualFeatures":"一个或多个要素的隐藏字段具有无效值。 请检查单个要素并解决该问题。","featuresWithInvalidValues":"一个或多个要素具有无效值","nonVisibleError_changeValues":"所选要素的隐藏字段具有无效值。 修改这些值,使其可见。"},"noVisibleFields":{"noElementsInCommon":"所选要素没有共享字段","noElements":"所选要素没有可显示的字段","elementsHiddenInSome":"所选要素的共享字段因可见性表达式未显示","allElementsHidden":"所选要素没有任何可显示的字段"},"requiredFieldBatchMode":"此字段为一个或多个要素的必填项。","requiredFieldLabel":"{name} - 为必填字段"}
|
|
1
|
+
{"formFailedToLoad":"表单加载失败。","differentValues":"(不同值)","empty":"没有值","showAllOptions":"显示所有选项","valueExpressionError":"计算值失败","failedToCalculateValues":"无法计算值","expressionEvaluationFailed":"表单计算失败","formComplexityThresholdExceeded":"表单加载失败。 请尝试减少处理的要素数量","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"请输入一个值","outsideRange":"值应该介于 {min} 到 {max} 之间","outsideRangeMax":"值应小于或等于 {max}","outsideRangeMin":"值应大于或等于 {min}","invalidCodedValue":"值应为下列某个值。","invalidType":"不是有效值","invalidBatchFormType":"一个或多个要素包含无效值。 检查各个要素。","tooShort":"此字段至少需要 {min} 个字符。","featuresInError":"一个或多个要素具有错误。 检查各个要素。","nonVisibleError_checkIndividualFeatures":"一个或多个要素的隐藏字段具有无效值。 请检查单个要素并解决该问题。","featuresWithInvalidValues":"一个或多个要素具有无效值","nonVisibleError_changeValues":"所选要素的隐藏字段具有无效值。 修改这些值,使其可见。"},"noVisibleFields":{"noElementsInCommon":"所选要素没有共享字段","noElements":"所选要素没有可显示的字段","elementsHiddenInSome":"所选要素的共享字段因可见性表达式未显示","allElementsHidden":"所选要素没有任何可显示的字段"},"requiredFieldBatchMode":"此字段为一个或多个要素的必填项。","requiredFieldLabel":"{name} - 为必填字段"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
|
|
1
|
+
{"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
|
|
1
|
+
{"formFailedToLoad":"無法載入表格。","differentValues":"(不同值)","empty":"沒有值","showAllOptions":"顯示所有選項","valueExpressionError":"無法計算值。","failedToCalculateValues":"無法計算值","expressionEvaluationFailed":"表格無法執行計算","formComplexityThresholdExceeded":"無法載入表格。 請試著使用較少的圖徵","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"請輸入一個值","outsideRange":"值應該介於 {min} 到 {max}","outsideRangeMax":"值必須小於或等於 {max}","outsideRangeMin":"值必須大於或等於 {min}","invalidCodedValue":"值必須是其中一個列出值。","invalidType":"非有效值","invalidBatchFormType":"一或多個圖徵包含無效值。 檢查個別圖徵。","tooShort":"此欄位至少需要 {min} 個字元","featuresInError":"一或多個圖徵發生錯誤。 檢查個別圖徵。","nonVisibleError_checkIndividualFeatures":"一或多個圖徵具有包含無效值的隱藏欄位。 檢查個別圖徵並更正問題。","featuresWithInvalidValues":"一或多個圖徵具有無效值","nonVisibleError_changeValues":"所選圖徵具有包含無效值的隱藏欄位。 變更值以使欄位可見。"},"noVisibleFields":{"noElementsInCommon":"所選圖徵沒有分享的欄位","noElements":"所選圖徵沒有要顯示的欄位","elementsHiddenInSome":"所選圖徵具有分享的欄位,由於可見性表達式而未顯示","allElementsHidden":"所選圖徵沒有要顯示的欄位"},"requiredFieldBatchMode":"此欄位對於一或多個圖徵是必要的。","requiredFieldLabel":"{name} - 必要欄位"}
|
package/copyright.txt
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{DateOnly as n}from"./DateOnly.js";import{SqlError as l,SqlErrorCodes as t}from"./errorSupport.js";import{SqlTimeStampOffset as
|
|
5
|
+
import{DateOnly as n}from"./DateOnly.js";import{SqlError as l,SqlErrorCodes as t}from"./errorSupport.js";import{SqlTimeStampOffset as e}from"./SqlTimestampOffset.js";import{TimeOnly as a}from"./TimeOnly.js";import{DateTime as r}from"luxon";function u(n,e){const a=o[n.toLowerCase()];if(null==a)throw new l(t.FunctionNotRecognized);if(e.length<a.minParams||e.length>a.maxParams)throw new l(t.InvalidParameterCount,{name:n.toUpperCase()});return a.evaluate(e)}function m(n,l){const t=o[n.toLowerCase()];return null!=t&&l>=t.minParams&&l<=t.maxParams}const o={min:{minParams:1,maxParams:1,evaluate:n=>f(n[0],"min")},max:{minParams:1,maxParams:1,evaluate:n=>f(n[0],"max")},avg:{minParams:1,maxParams:1,evaluate:n=>i(n[0])},sum:{minParams:1,maxParams:1,evaluate:n=>c(n[0])},stddev:{minParams:1,maxParams:1,evaluate:n=>g(n[0])},count:{minParams:1,maxParams:1,evaluate:n=>null==n[0]?null:n[0].length},var:{minParams:1,maxParams:1,evaluate:n=>P(n[0])}};function i(n){if(null===n)return null;let e=0,a=0;for(let r=0;r<n.length;r++){const u=n[r];if(null!==u){if(!s(u))throw new l(t.InvalidValueForAggregateFunction);a++,e+=u}}return 0===a?null:e/n.length}function s(n){return"number"==typeof n}function f(l,t){if(null===l)return null;let u=null,m=null;for(const o of l){let l=o;l=n.isDateOnly(o)||a.isTimeOnly(o)?o.toNumber():r.isDateTime(o)?o.toMillis():e.isTimestampOffset(o)?o.toMilliseconds():o,(null===u||"max"===t&&null!==m&&null!==l&&m<=l||"min"===t&&null!==m&&null!==l&&m>=l)&&(u=o,m=l)}return u}function c(n){if(null===n)return null;let e=0;for(let a=0;a<n.length;a++){const r=n[a];if(null!==r){if(!s(r))throw new l(t.InvalidValueForAggregateFunction);e+=r}}return e}function g(n){if(null===n)return null;const l=P(n);return null===l?null:Math.sqrt(l)}function P(n){if(null===n)return null;if(0===(n=n.filter((n=>null!==n))).length)return null;const e=i(n);if(null===e)return null;let a=0;for(const r of n){if(!s(r))throw new l(t.InvalidValueForAggregateFunction);a+=(e-r)**2}return a/(n.length-1)}export{u as aggregateFunction,m as isAggregate};
|
package/core/sql/DateOnly.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{createDateTimeZone as t,ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{getLocale as a}from"../../intl/locale.js";import{DateTime as r,FixedOffsetZone as s}from"luxon";function o(t){t=t.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const a=/(\[[^[]*\])|(\\)?([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 t.match(a)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}class
|
|
5
|
+
import{createDateTimeZone as t,ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{getLocale as a}from"../../intl/locale.js";import{DateTime as r,FixedOffsetZone as s}from"luxon";function o(t){t=t.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const a=/(\[[^[]*\])|(\\)?([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 t.match(a)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}const n="esri.core.sql.dateonly";class i{constructor(t,e,a){this._year=t,this._month=e,this._day=a,this.declaredRootClass=n}static isDateOnly(t){return"object"==typeof t&&null!=t&&"declaredRootClass"in t&&t.declaredRootClass===n}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(t){return i.isDateOnly(t)&&t.day===this.day&&t.month===this.month&&t.year===this.year}clone(){return new i(this._year,this._month,this._day)}toDateTime(e){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t(e)})}toDateTimeLuxon(e){return r.fromObject({day:this.day,month:this.month,year:this.year},{zone:t(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(t=null,r=!0){if(null===t||""===t)return this.toString();if(r&&(t=o(t)),!t)return"";const s=this.toDateTime("unknown");return e.dateTimeToArcadeDate(s).toFormat(t,{locale:a(),numberingSystem:"latn"})}toArcadeDate(){const t=this.toDateTime("unknown");return e.dateTimeToArcadeDate(t)}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(t,e){return i.fromDateTime(this.toUTCDateTime().plus({[t]:e}))}toUTCDateTime(){return r.utc(this.year,this.month,this.day,0,0,0,0)}difference(t,e){switch(e.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===e?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}static fromMilliseconds(t){const e=r.fromMillis(t,{zone:s.utcInstance});return e.isValid?i.fromParts(e.year,e.month,e.day):null}static fromSeconds(t){const e=r.fromSeconds(t,{zone:s.utcInstance});return e.isValid?i.fromParts(e.year,e.month,e.day):null}static fromReader(t){if(!t)return null;const e=t.split("-");return 3!==e.length?null:new i(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10))}static fromParts(t,e,a){const r=new i(t,e,a);return!1===r.isValid?null:r}static fromDateJS(t){return i.fromParts(t.getFullYear(),t.getMonth()+1,t.getDay())}static fromDateTime(t){return i.fromParts(t.year,t.month,t.day)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,e=null){if(""===t)return null;if(null===t)return null;const a=[];if(e)(e=o(e))&&a.push(e);else if(null===e||""===e){const e=r.fromISO(t,{setZone:!0});return e.isValid?i.fromParts(e.year,e.month,e.day):null}for(const s of a){const a=r.fromFormat(t,e??s);if(a.isValid)return new i(a.year,a.month,a.day)}return null}static fromNow(e="system"){const a=r.fromJSDate(new Date).setZone(t(e));return new i(a.year,a.month,a.day)}}export{i as DateOnly,o as standardizeDateOnlyFormat};
|
package/core/sql/SqlInterval.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{SqlError as e,SqlErrorCodes as t}from"./errorSupport.js";
|
|
5
|
+
import{SqlError as e,SqlErrorCodes as t}from"./errorSupport.js";function r(r){if(null!==r.precision||null!==r.secondary)throw new e(t.PrimarySecondaryQualifiers)}function s(e,t){if(t.includes(".")){const r=t.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(t)}const l="esri.core.sql.SqlInterval";class a{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 a;return t.second=e/1e3,t}static createFromValueAndQualifier(l,o,n){let i=null;const p=new a;if(p.op="-"===n?"-":"+","interval-period"===o.type){r(o);const a=new RegExp("^[0-9]{1,}$");if("year"===o.period||"month"===o.period)throw new e(t.YearMonthIntervals);if("second"===o.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(l))throw new e(t.IllegalInterval);s(p,l)}else{if(!a.test(l))throw new e(t.IllegalInterval);p[o.period]=parseFloat(l)}}else{if(r(o.start),r(o.end),"year"===o.start.period||"month"===o.start.period||"year"===o.end.period||"month"===o.end.period)throw new e(t.YearMonthIntervals);switch(o.start.period){case"day":switch(o.end.period){case"hour":if(i=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!i.test(l))throw new e(t.IllegalInterval);p[o.start.period]=parseFloat(l.split(" ")[0]),p[o.end.period]=parseFloat(l.split(" ")[1]);break;case"minute":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!i.test(l))throw new e(t.IllegalInterval);{p[o.start.period]=parseFloat(l.split(" ")[0]);const e=l.split(" ")[1].split(":");p.hour=parseFloat(e[0]),p.minute=parseFloat(e[1])}break;case"second":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(l))throw new e(t.IllegalInterval);{p[o.start.period]=parseFloat(l.split(" ")[0]);const e=l.split(" ")[1].split(":");p.hour=parseFloat(e[0]),p.minute=parseFloat(e[1]),s(p,e[2])}break;default:throw new e(t.IllegalInterval)}break;case"hour":switch(o.end.period){case"minute":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!i.test(l))throw new e(t.IllegalInterval);p.hour=parseFloat(l.split(":")[0]),p.minute=parseFloat(l.split(":")[1]);break;case"second":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(l))throw new e(t.IllegalInterval);{const e=l.split(":");p.hour=parseFloat(e[0]),p.minute=parseFloat(e[1]),s(p,e[2])}break;default:throw new e(t.IllegalInterval)}break;case"minute":if("second"!==o.end.period)throw new e(t.IllegalInterval);if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(l))throw new e(t.IllegalInterval);{const e=l.split(":");p.minute=parseFloat(e[0]),s(p,e[1])}break;default:throw new e(t.IllegalInterval)}}return p}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)}}export{a as SqlInterval};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{DateTime as t}from"luxon";function e(t){return Number.isNaN(t)||0===t?t:Math.trunc(t)}class
|
|
5
|
+
import{DateTime as t}from"luxon";function e(t){return Number.isNaN(t)||0===t?t:Math.trunc(t)}const r="esri.core.sql.SqlTimeStampOffset";class i{constructor(t){this._timeStampOffset=t,this.declaredRootClass=r,this._date=null}static isTimestampOffset(t){return"object"==typeof t&&null!=t&&"declaredRootClass"in t&&t.declaredRootClass===r}toDateTime(){return this._date??=t.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return e(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return e(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return i.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new i(t.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(t){return new i(t.toISO({includeOffset:!0}))}static fromParts(t,e,r=0,o=0,a=0,s=0,n=0,m=!1,u=0,f=0){const S=`${t.toString().padStart(4,"0")}-${e.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}`;let d="";s<10&&(d="0");let l=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+s.toString()}`;0!==n&&(l+="."+n.toString().padStart(3,"0"));const c=`${m?"-":"+"}${u.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`;return new i(S+"T"+l+c)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let t=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return t&&(t=t.replace(".000","")),t}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(t){const e=this.toDateTime().plus(t);return i.fromDateTime(e)}}export{i as SqlTimeStampOffset};
|
package/core/sql/TimeOnly.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isInteger as t}from"../../arcade/kernel.js";import{getLocale as s}from"../../intl/locale.js";import{DateTime as e}from"luxon";function i(t){if(!t)return"";const s=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let e="";for(const i of t.match(s)||[])switch(i){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":e+=i;break;case"A":case"a":e+="a";break;default:e+=`'${i}'`}return e}class
|
|
5
|
+
import{isInteger as t}from"../../arcade/kernel.js";import{getLocale as s}from"../../intl/locale.js";import{DateTime as e}from"luxon";function i(t){if(!t)return"";const s=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let e="";for(const i of t.match(s)||[])switch(i){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":e+=i;break;case"A":case"a":e+="a";break;default:e+=`'${i}'`}return e}const n="esri.core.sql.timeonly";class r{constructor(t,s,e,i){this._hour=t,this._minute=s,this._second=e,this._millisecond=i,this.declaredRootClass=n}static isTimeOnly(t){return"object"==typeof t&&null!=t&&"declaredRootClass"in t&&t.declaredRootClass===n}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(t){return r.isTimeOnly(t)&&t.hour===this.hour&&t.minute===this.minute&&t.second===this.second&&t.millisecond===this.millisecond}clone(){return new r(this.hour,this.minute,this.second,this.millisecond)}isValid(){return t(this.hour)&&t(this.minute)&&t(this.second)&&t(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(t=null){if(null===t||""===t)return this.toString();if(!(t=i(t)))return"";return e.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(t,{locale:s(),numberingSystem:"latn"})}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(t,s,e,i){const n=new r(t,s,e,i);return n.isValid()?n:null}static fromReader(t){if(!t)return null;const s=t.split(":");return 3!==s.length?null:new r(parseInt(s[0],10),parseInt(s[1],10),parseInt(s[2],10),0)}static fromMilliseconds(t){if(t>864e5||t<0)return null;const s=Math.floor(t/1e3%60),e=Math.floor(t/6e4%60),i=Math.floor(t/36e5%24),n=Math.floor(t%1e3);return new r(i,e,s,n)}static fromDateJS(t){return new r(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}static fromDateTime(t){return new r(t.hour,t.minute,t.second,t.millisecond)}static fromSqlTimeStampOffset(t){return this.fromDateTime(t.toDateTime())}static fromString(t,s=null){if(""===t)return null;if(null===t)return null;const n=[];s?(s=i(s))&&n.push(s):null!==s&&""!==s||(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 i of n){const s=e.fromFormat(t,i);if(s.isValid)return new r(s.hour,s.minute,s.second,s.millisecond)}return null}plus(t,s){switch(t){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return r.fromDateTime(this.toUTCDateTime().plus({[t]:s}))}return null}toUTCDateTime(){return e.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(t,s){switch(s.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(t.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===s?this.toUTCDateTime().diff(t.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(t.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(t.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(t.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(t.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(t.toUTCDateTime(),"years").years}}}export{r as TimeOnly,i as standardizeTimeFormat};
|
package/core/sql/WhereClause.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../has.js";import{isAggregate as e,aggregateFunction as t}from"./AggregateFunctions.js";import{DateOnly as r}from"./DateOnly.js";import{SqlError as a,SqlErrorCodes as s}from"./errorSupport.js";import{sqlCalculateFunction as i}from"./sqlArithmeticUtils.js";import{sqlCompare as n,isDateOrTimeValue as o}from"./sqlCompareUtils.js";import{isDateTime as u,isTimestampOffset as l,isTimeOnly as c,isDateOnly as h,parseTime as p,parseTimestamp as m,parseDate as d,convertToExecutingTimeZone as f}from"./sqlDateParsingUtils.js";import{SqlInterval as v}from"./SqlInterval.js";import{SqlTimeStampOffset as N}from"./SqlTimestampOffset.js";import{evaluateFunction as g,isStandardized as S}from"./StandardizedFunctions.js";import{TimeOnly as T}from"./TimeOnly.js";import{WhereGrammar as y,visitAll as _}from"./WhereGrammar.js";import{isDate as J}from"../../support/guards.js";import{DateTime as w,FixedOffsetZone as I}from"luxon";const O=new Set(["current_timestamp","current_date","current_time"]);class F{static makeBool(e){return Z(e)}static featureValue(e,t,r,a){return R(e,t,r,a)}static equalsNull(e){return null===e}static applyLike(e,t,r){return L(e,t,r)}static ensureArray(e){return x(e)}static applyIn(e,t,r){return U(e,t)}static currentTimestamp(e){return f(new Date,e)}static currentDate(e){return r.fromNow(e)}static currentTime(e){const t=f(new Date,e);return T.fromDateTime(t)}static makeSqlInterval(e,t,r){return v.createFromValueAndQualifier(e,t,r)}static convertInterval(e){return e instanceof v?e.valueInMilliseconds():e}static compare(e,t,r,a){return n(t,r,e)}static calculate(e,t,r,a){return i(e,t,r,a)}static evaluateTime(e){return p(e)}static evaluateTimestamp(e,t,r){return m(e,t,r)}static evaluateDate(e,t){return d(e,t)}static evaluateFunction(e,t,r){return g(e,t,r)}static lookup(e,t){const r=t[e];return void 0===r?null:r}static between(e,t,r){return null==e||null==t[0]||null==t[1]?null:n(e,t[0],">=")&&n(e,t[1],"<=")}static notbetween(e,t,r){return null==e||null==t[0]||null==t[1]?null:n(e,t[0],"<")||n(e,t[1],">")}static ternaryNot(e){return b(e)}static ternaryAnd(e,t){return A(e,t)}static ternaryOr(e,t){return E(e,t)}}class D{constructor(e,t,r="UTC",a=null){this.fieldsIndex=t,this.timeZone=r,this.currentUser=a,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=y.parse(e);const{isStandardized:s,isAggregate:i,currentUserRequired:n,referencedFieldNames:o}=this._extractExpressionInfo(t);this._referencedFieldNames=o,this.isStandardized=s,this.isAggregate=i,this.currentUserRequired=n}static convertValueToStorageFormat(e,t=null){if(null===t)return J(e)?e.getTime():u(e)?e.toMillis():l(e)?e.toStorageFormat():c(e)?e.toStorageString():h(e)?e.toStorageFormat():e;switch(t){case"date":return J(e)?e.getTime():u(e)?e.toMillis():l(e)?e.toMilliseconds():h(e)?e.toNumber():e;case"date-only":return J(e)?r.fromDateJS(e).toString():l(e)?r.fromSqlTimeStampOffset(e).toString():u(e)?r.fromDateTime(e).toString():e;case"time-only":return J(e)?T.fromDateJS(e).toStorageString():u(e)?T.fromDateTime(e).toStorageString():l(e)?T.fromSqlTimeStampOffset(e).toStorageString():c(e)?e.toStorageString():e;case"timestamp-offset":if(J(e))return N.fromJSDate(e).toStorageFormat();if(u(e))return N.fromDateTime(e).toStorageFormat();if(l(e))return e.toStorageFormat()}return e}static create(e,t={}){return new D(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=C,r=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,r)}calculateValue(e,t=C,r=this.currentUser){const a=this._evaluateNode(this.parseTree,e,t,null,r);return a instanceof v?a.valueInMilliseconds()/864e5:a}calculateValueCompiled(e,t=C,r=this.currentUser){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null):has("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null))}testFeature(e,t=C,r=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,r)}testFeatureCompiled(e,t=C,r=this.currentUser){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null):has("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,_(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||O.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return _(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return _(this.parseTree,(t=>{if("function"===t.type){const r=t.name.toLowerCase(),a=t.args.value[0];if("column-reference"===a.type){const t=a.column,s=`${r}-${t}`;e.has(s)||e.set(s,{aggregateType:r,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return _(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(F)}_extractExpressionInfo(t){const r=[],a=new Set;let s=!0,i=!1,n=!1;return _(this.parseTree,(o=>{switch(o.type){case"column-reference":{const e=t?.get(o.column);let s,i;e?s=i=e.name??"":(i=o.column,s=i.toLowerCase()),a.has(s)||(a.add(s),r.push(i)),o.column=i;break}case"current-user":n=!0;break;case"function":{const{name:t,args:r}=o,a=r.value.length;s&&(s=S(t,a)),!1===i&&(i=e(t,a));break}}})),{referencedFieldNames:Array.from(r),isStandardized:s,isAggregate:i,currentUserRequired:n}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const r=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let a=0;a<e.clauses.length;a++)t+=" (this.compare('=',"+r+","+this.evaluateNodeToJavaScript(e.clauses[a].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[a].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let r=0;r<e.clauses.length;r++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[r].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const r of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(r);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new a(s.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new a(s.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 a(s.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 a(s.UnsupportedSyntax,{node:e.type})}_evaluateNode(r,o,u,l,c){let h;switch(r.type){case"interval":{const e=this._evaluateNode(r.value,o,u,l,c);return v.createFromValueAndQualifier(e,r.qualifier,r.op)}case"case-expression":if("simple"===r.format){const e=this._evaluateNode(r.operand,o,u,l,c);for(let t=0;t<r.clauses.length;t++)if(n(e,this._evaluateNode(r.clauses[t].operand,o,u,l,c),"=",this.timeZone))return this._evaluateNode(r.clauses[t].value,o,u,l,c);if(null!==r.else)return this._evaluateNode(r.else,o,u,l,c)}else{for(let e=0;e<r.clauses.length;e++)if(Z(this._evaluateNode(r.clauses[e].operand,o,u,l,c)))return this._evaluateNode(r.clauses[e].value,o,u,l,c);if(null!==r.else)return this._evaluateNode(r.else,o,u,l,c)}return null;case"parameter":return h=this.parameters[r.value.toLowerCase()],J(h)?w.fromJSDate(h):null!=h&&"object"==typeof h&&"toDateTime"in h?h.toDateTime():h;case"expression-list":{const e=[];for(const t of r.value)e.push(this._evaluateNode(t,o,u,l,c));return e}case"unary-expression":return b(this._evaluateNode(r.expr,o,u,l,c));case"binary-expression":switch(r.operator){case"AND":return A(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c));case"OR":return E(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c));case"IS":if("null"!==r.right.type)throw new a(s.UnsupportedIsRhs);return null===this._evaluateNode(r.left,o,u,l,c);case"ISNOT":if("null"!==r.right.type)throw new a(s.UnsupportedIsRhs);return null!==this._evaluateNode(r.left,o,u,l,c);case"IN":{const e=x(this._evaluateNode(r.right,o,u,l,c));return U(this._evaluateNode(r.left,o,u,l,c),e,this.timeZone)}case"NOT IN":{const e=x(this._evaluateNode(r.right,o,u,l,c));return b(U(this._evaluateNode(r.left,o,u,l,c),e,this.timeZone))}case"BETWEEN":{const e=this._evaluateNode(r.left,o,u,l,c),t=this._evaluateNode(r.right,o,u,l,c);return null==e||null==t[0]||null==t[1]?null:n(e,t[0],">=",this.timeZone)&&n(e,t[1],"<=",this.timeZone)}case"NOTBETWEEN":{const e=this._evaluateNode(r.left,o,u,l,c),t=this._evaluateNode(r.right,o,u,l,c);return null==e||null==t[0]||null==t[1]?null:n(e,t[0],"<",this.timeZone)||n(e,t[1],">",this.timeZone)}case"LIKE":return L(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),r.escape);case"NOT LIKE":return b(L(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),r.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return n(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),r.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return i(r.operator,this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),this.timeZone)}case"null":case"boolean":case"string":case"number":return r.value;case"date":return r.parsedValue??=d(r.value,"unknown"),r.parsedValue;case"timestamp":return r.parsedValue??=m(r.value,"unknown"),r.parsedValue;case"time":return p(r.value);case"current-time":return"date"===r.mode?F.currentDate(this.timeZone):"time"===r.mode?F.currentTime(this.timeZone):F.currentTimestamp(this.timeZone);case"current-user":return c??null;case"column-reference":return R(o,r.column,this.fieldsIndex,u);case"data-type":return r.value;case"function":{if(this.isAggregate&&e(r.name,r.args.value.length)){const e=[];for(const t of r.args?.value||[]){const r=[];for(const e of l||[])r.push(this._evaluateNode(t,e,u,null,c));e.push(r)}return t(r.name,e)}const a=this._evaluateNode(r.args,o,u,l,c);return g(r.name,a,this.timeZone)}}throw new a(s.UnsupportedSyntax,{node:r.type})}}function Z(e){return!0===e}function x(e){return Array.isArray(e)?e:[e]}function b(e){return null!==e?!0!==e:null}function A(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function E(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function U(e,t,r){if(null==e)return null;let a=!1;for(const s of t)if(null==s)a=null;else{if(e===s){a=!0;break}if(o(e)&&o(s)&&(a=n(e,s,"="),a))break}return a}const k="-[]/{}()*+?.\\^$|";var V;function q(e,t){const r=t;let a="",s=V.Normal;for(let i=0;i<e.length;i++){const t=e.charAt(i);switch(s){case V.Normal:t===r?s=V.Escaped:k.includes(t)?a+="\\"+t:a+="%"===t?".*":"_"===t?".":t;break;case V.Escaped:k.includes(t)?a+="\\"+t:a+=t,s=V.Normal}}return new RegExp("^"+a+"$","m")}function L(e,t,r){if(null==e)return null;return q(t,r).test(e)}function j(e){return e&&"object"==typeof e.attributes}function R(e,t,a,s){if("getAttributeSQL"in s)return s.getAttributeSQL(e,t);const i=s.getAttribute(e,t),n=a?.get(t);return null==i||"esriFieldTypeDate"!==n?.type&&"date"!==n?.type?null==i||"esriFieldTypeDateOnly"!==n?.type&&"date-only"!==n?.type?null==i||"esriFieldTypeTimeOnly"!==n?.type&&"time-only"!==n?.type?null==i||"esriFieldTypeTimestampOffset"!==n?.type&&"timestamp-offset"!==n?.type?i:new N(i):T.fromReader(i):r.fromReader(i):f(new Date(i),a?.getLuxonTimeZone(n.name)??I.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(V||(V={}));const C={getAttribute:(e,t)=>(j(e)?e.attributes:e)[t]};export{D as default};
|
|
5
|
+
import has from"../has.js";import{isAggregate as e,aggregateFunction as t}from"./AggregateFunctions.js";import{DateOnly as r}from"./DateOnly.js";import{SqlError as a,SqlErrorCodes as s}from"./errorSupport.js";import{sqlCalculateFunction as i}from"./sqlArithmeticUtils.js";import{sqlCompare as n,isDateOrTimeValue as o}from"./sqlCompareUtils.js";import{isDateTime as u,isTimestampOffset as l,isTimeOnly as c,isDateOnly as h,parseTime as p,parseTimestamp as m,parseDate as d,convertToExecutingTimeZone as f}from"./sqlDateParsingUtils.js";import{SqlInterval as v}from"./SqlInterval.js";import{SqlTimeStampOffset as N}from"./SqlTimestampOffset.js";import{evaluateFunction as g,isStandardized as S}from"./StandardizedFunctions.js";import{TimeOnly as T}from"./TimeOnly.js";import{WhereGrammar as y,visitAll as _}from"./WhereGrammar.js";import{isDate as J}from"../../support/guards.js";import{DateTime as w,FixedOffsetZone as I}from"luxon";const O=new Set(["current_timestamp","current_date","current_time"]);class F{static makeBool(e){return Z(e)}static featureValue(e,t,r,a){return R(e,t,r,a)}static equalsNull(e){return null===e}static applyLike(e,t,r){return L(e,t,r)}static ensureArray(e){return x(e)}static applyIn(e,t,r){return U(e,t)}static currentTimestamp(e){return f(new Date,e)}static currentDate(e){return r.fromNow(e)}static currentTime(e){const t=f(new Date,e);return T.fromDateTime(t)}static makeSqlInterval(e,t,r){return v.createFromValueAndQualifier(e,t,r)}static convertInterval(e){return v.isInterval(e)?e.valueInMilliseconds():e}static compare(e,t,r,a){return n(t,r,e)}static calculate(e,t,r,a){return i(e,t,r,a)}static evaluateTime(e){return p(e)}static evaluateTimestamp(e,t,r){return m(e,t,r)}static evaluateDate(e,t){return d(e,t)}static evaluateFunction(e,t,r){return g(e,t,r)}static lookup(e,t){const r=t[e];return void 0===r?null:r}static between(e,t,r){return null==e||null==t[0]||null==t[1]?null:n(e,t[0],">=")&&n(e,t[1],"<=")}static notbetween(e,t,r){return null==e||null==t[0]||null==t[1]?null:n(e,t[0],"<")||n(e,t[1],">")}static ternaryNot(e){return b(e)}static ternaryAnd(e,t){return A(e,t)}static ternaryOr(e,t){return E(e,t)}}class D{constructor(e,t,r="UTC",a=null){this.fieldsIndex=t,this.timeZone=r,this.currentUser=a,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=y.parse(e);const{isStandardized:s,isAggregate:i,currentUserRequired:n,referencedFieldNames:o}=this._extractExpressionInfo(t);this._referencedFieldNames=o,this.isStandardized=s,this.isAggregate=i,this.currentUserRequired=n}static convertValueToStorageFormat(e,t=null){if(null===t)return J(e)?e.getTime():u(e)?e.toMillis():l(e)?e.toStorageFormat():c(e)?e.toStorageString():h(e)?e.toStorageFormat():e;switch(t){case"date":return J(e)?e.getTime():u(e)?e.toMillis():l(e)?e.toMilliseconds():h(e)?e.toNumber():e;case"date-only":return J(e)?r.fromDateJS(e).toString():l(e)?r.fromSqlTimeStampOffset(e).toString():u(e)?r.fromDateTime(e).toString():e;case"time-only":return J(e)?T.fromDateJS(e).toStorageString():u(e)?T.fromDateTime(e).toStorageString():l(e)?T.fromSqlTimeStampOffset(e).toStorageString():c(e)?e.toStorageString():e;case"timestamp-offset":if(J(e))return N.fromJSDate(e).toStorageFormat();if(u(e))return N.fromDateTime(e).toStorageFormat();if(l(e))return e.toStorageFormat()}return e}static create(e,t={}){return new D(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=C,r=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,r)}calculateValue(e,t=C,r=this.currentUser){const a=this._evaluateNode(this.parseTree,e,t,null,r);return v.isInterval(a)?a.valueInMilliseconds()/864e5:a}calculateValueCompiled(e,t=C,r=this.currentUser){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null):has("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null))}testFeature(e,t=C,r=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,r)}testFeatureCompiled(e,t=C,r=this.currentUser){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null):has("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone,r??null))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,_(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||O.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return _(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return _(this.parseTree,(t=>{if("function"===t.type){const r=t.name.toLowerCase(),a=t.args.value[0];if("column-reference"===a.type){const t=a.column,s=`${r}-${t}`;e.has(s)||e.set(s,{aggregateType:r,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return _(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(F)}_extractExpressionInfo(t){const r=[],a=new Set;let s=!0,i=!1,n=!1;return _(this.parseTree,(o=>{switch(o.type){case"column-reference":{const e=t?.get(o.column);let s,i;e?s=i=e.name??"":(i=o.column,s=i.toLowerCase()),a.has(s)||(a.add(s),r.push(i)),o.column=i;break}case"current-user":n=!0;break;case"function":{const{name:t,args:r}=o,a=r.value.length;s&&(s=S(t,a)),!1===i&&(i=e(t,a));break}}})),{referencedFieldNames:Array.from(r),isStandardized:s,isAggregate:i,currentUserRequired:n}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const r=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let a=0;a<e.clauses.length;a++)t+=" (this.compare('=',"+r+","+this.evaluateNodeToJavaScript(e.clauses[a].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[a].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let r=0;r<e.clauses.length;r++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[r].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const r of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(r);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new a(s.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new a(s.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 a(s.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 a(s.UnsupportedSyntax,{node:e.type})}_evaluateNode(r,o,u,l,c){let h;switch(r.type){case"interval":{const e=this._evaluateNode(r.value,o,u,l,c);return v.createFromValueAndQualifier(e,r.qualifier,r.op)}case"case-expression":if("simple"===r.format){const e=this._evaluateNode(r.operand,o,u,l,c);for(let t=0;t<r.clauses.length;t++)if(n(e,this._evaluateNode(r.clauses[t].operand,o,u,l,c),"=",this.timeZone))return this._evaluateNode(r.clauses[t].value,o,u,l,c);if(null!==r.else)return this._evaluateNode(r.else,o,u,l,c)}else{for(let e=0;e<r.clauses.length;e++)if(Z(this._evaluateNode(r.clauses[e].operand,o,u,l,c)))return this._evaluateNode(r.clauses[e].value,o,u,l,c);if(null!==r.else)return this._evaluateNode(r.else,o,u,l,c)}return null;case"parameter":return h=this.parameters[r.value.toLowerCase()],J(h)?w.fromJSDate(h):null!=h&&"object"==typeof h&&"toDateTime"in h?h.toDateTime():h;case"expression-list":{const e=[];for(const t of r.value)e.push(this._evaluateNode(t,o,u,l,c));return e}case"unary-expression":return b(this._evaluateNode(r.expr,o,u,l,c));case"binary-expression":switch(r.operator){case"AND":return A(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c));case"OR":return E(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c));case"IS":if("null"!==r.right.type)throw new a(s.UnsupportedIsRhs);return null===this._evaluateNode(r.left,o,u,l,c);case"ISNOT":if("null"!==r.right.type)throw new a(s.UnsupportedIsRhs);return null!==this._evaluateNode(r.left,o,u,l,c);case"IN":{const e=x(this._evaluateNode(r.right,o,u,l,c));return U(this._evaluateNode(r.left,o,u,l,c),e,this.timeZone)}case"NOT IN":{const e=x(this._evaluateNode(r.right,o,u,l,c));return b(U(this._evaluateNode(r.left,o,u,l,c),e,this.timeZone))}case"BETWEEN":{const e=this._evaluateNode(r.left,o,u,l,c),t=this._evaluateNode(r.right,o,u,l,c);return null==e||null==t[0]||null==t[1]?null:n(e,t[0],">=",this.timeZone)&&n(e,t[1],"<=",this.timeZone)}case"NOTBETWEEN":{const e=this._evaluateNode(r.left,o,u,l,c),t=this._evaluateNode(r.right,o,u,l,c);return null==e||null==t[0]||null==t[1]?null:n(e,t[0],"<",this.timeZone)||n(e,t[1],">",this.timeZone)}case"LIKE":return L(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),r.escape);case"NOT LIKE":return b(L(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),r.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return n(this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),r.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return i(r.operator,this._evaluateNode(r.left,o,u,l,c),this._evaluateNode(r.right,o,u,l,c),this.timeZone)}case"null":case"boolean":case"string":case"number":return r.value;case"date":return r.parsedValue??=d(r.value,"unknown"),r.parsedValue;case"timestamp":return r.parsedValue??=m(r.value,"unknown"),r.parsedValue;case"time":return p(r.value);case"current-time":return"date"===r.mode?F.currentDate(this.timeZone):"time"===r.mode?F.currentTime(this.timeZone):F.currentTimestamp(this.timeZone);case"current-user":return c??null;case"column-reference":return R(o,r.column,this.fieldsIndex,u);case"data-type":return r.value;case"function":{if(this.isAggregate&&e(r.name,r.args.value.length)){const e=[];for(const t of r.args?.value||[]){const r=[];for(const e of l||[])r.push(this._evaluateNode(t,e,u,null,c));e.push(r)}return t(r.name,e)}const a=this._evaluateNode(r.args,o,u,l,c);return g(r.name,a,this.timeZone)}}throw new a(s.UnsupportedSyntax,{node:r.type})}}function Z(e){return!0===e}function x(e){return Array.isArray(e)?e:[e]}function b(e){return null!==e?!0!==e:null}function A(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function E(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function U(e,t,r){if(null==e)return null;let a=!1;for(const s of t)if(null==s)a=null;else{if(e===s){a=!0;break}if(o(e)&&o(s)&&(a=n(e,s,"="),a))break}return a}const k="-[]/{}()*+?.\\^$|";var V;function q(e,t){const r=t;let a="",s=V.Normal;for(let i=0;i<e.length;i++){const t=e.charAt(i);switch(s){case V.Normal:t===r?s=V.Escaped:k.includes(t)?a+="\\"+t:a+="%"===t?".*":"_"===t?".":t;break;case V.Escaped:k.includes(t)?a+="\\"+t:a+=t,s=V.Normal}}return new RegExp("^"+a+"$","m")}function L(e,t,r){if(null==e)return null;return q(t,r).test(e)}function j(e){return e&&"object"==typeof e.attributes}function R(e,t,a,s){if("getAttributeSQL"in s)return s.getAttributeSQL(e,t);const i=s.getAttribute(e,t),n=a?.get(t);return null==i||"esriFieldTypeDate"!==n?.type&&"date"!==n?.type?null==i||"esriFieldTypeDateOnly"!==n?.type&&"date-only"!==n?.type?null==i||"esriFieldTypeTimeOnly"!==n?.type&&"time-only"!==n?.type?null==i||"esriFieldTypeTimestampOffset"!==n?.type&&"timestamp-offset"!==n?.type?i:new N(i):T.fromReader(i):r.fromReader(i):f(new Date(i),a?.getLuxonTimeZone(n.name)??I.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(V||(V={}));const C={getAttribute:(e,t)=>(j(e)?e.attributes:e)[t]};export{D as default};
|
package/core/sql/WhereGrammar.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function n(n,t){function r(){this.constructor=n}r.prototype=t.prototype,n.prototype=new r}function t(n,r,e,o){var u=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(u,t.prototype),u.expected=r,u.found=e,u.location=o,u.name="SyntaxError",u}function r(n,t,r){return r=r||" ",n.length>t?n:(t-=n.length,n+(r+=r.repeat(t)).slice(0,t))}function e(n,r){var e,o={},u=(r=void 0!==r?r:{}).grammarSource,i={start:uu},a=uu,c="!",s="=",f=">=",l=">",p="<=",v="<>",d="!=",y="||",h="@",g="'",A="N'",m="''",C=".",b="null",E="true",L="false",T="in",w="is",x="like",N="escape",I="not",R="and",O="or",F="between",S="from",M="for",$="substring",U="extract",_="trim",D="position",H="timestamp",P="date",j="time",Z="leading",k="trailing",z="both",G="cast",B="as",q="integer",V="int",W="smallint",Y="float",K="real",X="varchar",J="to",Q="interval",nn="year",tn="timezone_hour",rn="timezone_minute",en="month",on="day",un="hour",an="minute",cn="second",sn="case",fn="end",ln="when",pn="then",vn="else",dn=",",yn="(",hn=")",gn="`",An=/^[<-=]/,mn=/^[+\-]/,Cn=/^[*\/]/,bn=/^[A-Za-z_\x80-\uFFFF]/,En=/^[A-Za-z0-9_]/,Ln=/^[A-Za-z0-9_.\x80-\uFFFF]/,Tn=/^["]/,wn=/^[^']/,xn=/^[0-9]/,Nn=/^[eE]/,In=/^[ \t\n\r]/,Rn=/^[^`]/,On=Xo("!",!1),Fn=Xo("=",!1),Sn=Xo(">=",!1),Mn=Xo(">",!1),$n=Xo("<=",!1),Un=Xo("<>",!1),_n=Jo([["<","="]],!1,!1),Dn=Xo("!=",!1),Hn=Jo(["+","-"],!1,!1),Pn=Xo("||",!1),jn=Jo(["*","/"],!1,!1),Zn=Jo([["A","Z"],["a","z"],"_",["",""]],!1,!1),kn=Jo([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),zn=Jo([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),Gn=Jo(['"'],!1,!1),Bn=Xo("@",!1),qn=Xo("'",!1),Vn=Xo("N'",!1),Wn=Xo("''",!1),Yn=Jo(["'"],!0,!1),Kn=Xo(".",!1),Xn=Jo([["0","9"]],!1,!1),Jn=Jo(["e","E"],!1,!1),Qn=Xo("NULL",!0),nt=Xo("TRUE",!0),tt=Xo("FALSE",!0),rt=Xo("IN",!0),et=Xo("IS",!0),ot=Xo("LIKE",!0),ut=Xo("ESCAPE",!0),it=Xo("NOT",!0),at=Xo("AND",!0),ct=Xo("OR",!0),st=Xo("BETWEEN",!0),ft=Xo("FROM",!0),lt=Xo("FOR",!0),pt=Xo("SUBSTRING",!0),vt=Xo("EXTRACT",!0),dt=Xo("TRIM",!0),yt=Xo("POSITION",!0),ht=Xo("TIMESTAMP",!0),gt=Xo("DATE",!0),At=Xo("TIME",!0),mt=Xo("LEADING",!0),Ct=Xo("TRAILING",!0),bt=Xo("BOTH",!0),Et=Xo("CAST",!0),Lt=Xo("AS",!0),Tt=Xo("INTEGER",!0),wt=Xo("INT",!0),xt=Xo("SMALLINT",!0),Nt=Xo("FLOAT",!0),It=Xo("REAL",!0),Rt=Xo("VARCHAR",!0),Ot=Xo("TO",!0),Ft=Xo("INTERVAL",!0),St=Xo("YEAR",!0),Mt=Xo("TIMEZONE_HOUR",!0),$t=Xo("TIMEZONE_MINUTE",!0),Ut=Xo("MONTH",!0),_t=Xo("DAY",!0),Dt=Xo("HOUR",!0),Ht=Xo("MINUTE",!0),Pt=Xo("SECOND",!0),jt=Xo("CASE",!0),Zt=Xo("END",!0),kt=Xo("WHEN",!0),zt=Xo("THEN",!0),Gt=Xo("ELSE",!0),Bt=Xo(",",!1),qt=Xo("(",!1),Vt=Xo(")",!1),Wt=Jo([" ","\t","\n","\r"],!1,!1),Yt=Xo("`",!1),Kt=Jo(["`"],!0,!1),Xt=function(n){return n},Jt=function(n){return Ta(Yo(),...n)},Qt=function(n,t,r){return{op:t,expr:r,location:Yo()}},nr=function(n,t){return wa(n,t)},tr=function(n,t,r){return{op:t,expr:r,location:Yo()}},rr=function(n,t){return wa(n,t)},er=function(n){return Ea("NOT",n,Yo())},or=function(n,t){if(""==t||null==t||null==t)return n;return"arithmetic"==t.type?wa(n,t.tail):La(t.op,n,t.right,t.escape,Yo())},ur=function(n,t){return{op:n,expr:t,location:Yo()}},ir=function(n){return{type:"arithmetic",tail:n}},ar=function(n,t){return{op:n+"NOT",right:t}},cr=function(n,t){return{op:n,right:t}},sr=function(n,t,r){return Ta(Yo(),t,r)},fr=function(n,t){return{op:"NOT"+n,right:t}},lr=function(n,t,r){return Ta(Yo(),t,r)},pr=function(n,t){return{op:n,right:t}},vr=function(n){return n[0]+" "+n[2]},dr=function(n){return n[0]+" "+n[2]},yr=function(n,t,r){return{op:n,right:t,escape:r.value}},hr=function(n,t){return{op:n,right:t,escape:""}},gr=function(n,t){return{op:n,right:t}},Ar=function(n,t){return{op:n,right:t}},mr=function(n,t,r){return{op:t,expr:r,location:Yo()}},Cr=function(n,t){return wa(n,t)},br=function(n,t,r){return{op:t,expr:r,location:Yo()}},Er=function(n,t){return wa(n,t)},Lr=function(n){return n.paren=!0,n},Tr=function(n){return/^CURRENT_DATE$/i.test(n)?{type:"current-time",location:Yo(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(n)?{type:"current-time",location:Yo(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(n)?{type:"current-time",location:Yo(),mode:"time"}:/^CURRENT_USER$/i.test(n)?{type:"current-user",location:Yo()}:{type:"column-reference",location:Yo(),table:"",column:n}},wr=function(n){return{type:"column-reference",location:Yo(),table:"",column:n,delimited:!0}},xr=function(n){return n},Nr=function(n,t){return n+t.join("")},Ir=function(n,t){return n+t.join("")},Rr=function(n){return n},Or=function(n){return n.join("")},Fr=function(){return'"'},Sr=function(n){return{type:"parameter",location:Yo(),value:n[1]}},Mr=function(n,t){return Ta(Yo(),n,t)},$r=function(n,t){return Ta(Yo(),n,t)},Ur=function(n){return{type:"function",location:Yo(),name:"extract",args:n}},_r=function(n,t,r){return Ta(Yo(),n,t,...r?[r]:[])},Dr=function(n,t,r){return Ta(Yo(),n,t,r)},Hr=function(n){return{type:"function",location:Yo(),name:"substring",args:n}},Pr=function(n,t){return Ta(Yo(),n,t)},jr=function(n,t){return Ta(Yo(),n,t)},Zr=function(n){return{type:"function",location:Yo(),name:"cast",args:n}},kr=function(){return{type:"data-type",location:Yo(),value:{type:"integer"}}},zr=function(){return{type:"data-type",location:Yo(),value:{type:"smallint"}}},Gr=function(){return{type:"data-type",location:Yo(),value:{type:"float"}}},Br=function(){return{type:"data-type",location:Yo(),value:{type:"real"}}},qr=function(){return{type:"data-type",location:Yo(),value:{type:"date"}}},Vr=function(){return{type:"data-type",location:Yo(),value:{type:"timestamp"}}},Wr=function(){return{type:"data-type",location:Yo(),value:{type:"time"}}},Yr=function(n){return{type:"data-type",location:Yo(),value:{type:"varchar",size:parseInt(n)}}},Kr=function(n,t,r){return Ta(Yo(),n,t,r)},Xr=function(n,t){return Ta(Yo(),n,t)},Jr=function(n){return{type:"function",location:Yo(),name:"trim",args:n}},Qr=function(n){return{type:"string",location:Yo(),value:n??"BOTH"}},ne=function(n,t){return Ta(Yo(),n,t)},te=function(n,t){return Ta(Yo(),n,t)},re=function(n){return{type:"function",location:Yo(),name:"position",args:n}},ee=function(n,t){return{type:"function",location:Yo(),name:n,args:t}},oe=function(n){return{type:"string",location:Yo(),value:n}},ue=function(n){return"string"===n.type&&xa(n.value),{type:"timestamp",location:Yo(),value:n.value}},ie=function(n){return"string"===n.type&&Na(n.value),{type:"time",location:Yo(),value:n.value}},ae=function(n,t,r){return{type:"interval",location:Yo(),value:t,qualifier:r,op:n}},ce=function(n,t){return{type:"interval",location:Yo(),value:n,qualifier:t,op:""}},se=function(n,t){return{type:"interval-qualifier",location:Yo(),start:n,end:t}},fe=function(n,t){return{type:"interval-period",location:Yo(),period:n.value,precision:t,secondary:null}},le=function(n){return{type:"interval-period",location:Yo(),period:n.value,precision:null,secondary:null}},pe=function(n){return{type:"interval-period",location:Yo(),period:n.value,precision:null,secondary:null}},ve=function(n,t){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:t}},de=function(n){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:null}},ye=function(){return{type:"interval-period",location:Yo(),period:"second",precision:null,secondary:null}},he=function(n,t){return{type:"interval-period",location:Yo(),period:n.value,precision:t,secondary:null}},ge=function(n){return{type:"interval-period",location:Yo(),period:n.value,precision:null,secondary:null}},Ae=function(n,t){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:t}},me=function(n){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:null}},Ce=function(){return{type:"interval-period",location:Yo(),period:"second",precision:null,secondary:null}},be=function(){return{type:"string",location:Yo(),value:"day"}},Ee=function(){return{type:"string",location:Yo(),value:"hour"}},Le=function(){return{type:"string",location:Yo(),value:"minute"}},Te=function(){return{type:"string",location:Yo(),value:"month"}},we=function(){return{type:"string",location:Yo(),value:"year"}},xe=function(n){return parseFloat(n)},Ne=function(n){return parseFloat(n)},Ie=function(n){return"string"===n.type&&Ia(n.value),{type:"date",location:Yo(),value:n.value}},Re=function(){return{type:"null",location:Yo(),value:null}},Oe=function(){return{type:"boolean",location:Yo(),value:!0}},Fe=function(){return{type:"boolean",location:Yo(),value:!1}},Se=function(){return"'"},Me=function(n){return{type:"string",location:Yo(),value:n.join("")}},$e=function(n,t){return{type:"case-expression",location:Yo(),format:"simple",operand:n,clauses:t,else:null,elseLocation:null}},Ue=function(n,t,r){return{type:"case-expression",location:Yo(),format:"simple",operand:n,clauses:t,else:r.value,elseLocation:r.location}},_e=function(n){return{type:"case-expression",location:Yo(),format:"searched",clauses:n,else:null,elseLocation:null}},De=function(n,t){return{type:"case-expression",location:Yo(),format:"searched",clauses:n,else:t.value,elseLocation:t.location}},He=function(n,t){return{type:"when-clause",location:Yo(),operand:n,value:t}},Pe=function(n,t){return{type:"when-clause",location:Yo(),operand:n,value:t}},je=function(n){return{type:"else-clause",location:Yo(),value:n}},Ze=function(n){return{type:"number",location:Yo(),value:n}},ke=function(n,t,r){return parseFloat(n+t+r)},ze=function(n,t){return parseFloat(n+t)},Ge=function(n,t){return parseFloat(n+t)},Be=function(n){return parseFloat(n)},qe=function(n,t){return n[0]+t},Ve=function(n){return"."+(null!=n?n:"")},We=function(n,t){return n+t},Ye=function(n){return n.join("")},Ke=function(n,t){return"e"+(null===t?"":t)},Xe=function(){return"IN"},Je=function(){return"IS"},Qe=function(){return"LIKE"},no=function(){return"ESCAPE"},to=function(){return"NOT"},ro=function(){return"AND"},eo=function(){return"OR"},oo=function(){return"BETWEEN"},uo=function(){return"FROM"},io=function(){return"FOR"},ao=function(){return"SUBSTRING"},co=function(){return"EXTRACT"},so=function(){return"TRIM"},fo=function(){return"POSITION"},lo=function(){return"TIMESTAMP"},po=function(){return"DATE"},vo=function(){return"TIME"},yo=function(){return"LEADING"},ho=function(){return"TRAILING"},go=function(){return"BOTH"},Ao=function(){return"CAST"},mo=function(){return"AS"},Co=function(){return"INTEGER"},bo=function(){return"INT"},Eo=function(){return"SMALLINT"},Lo=function(){return"FLOAT"},To=function(){return"REAL"},wo=function(){return"VARCHAR"},xo=function(){return"TO"},No=function(){return"INTERVAL"},Io=function(){return"YEAR"},Ro=function(){return"TIMEZONE_HOUR"},Oo=function(){return"TIMEZONE_MINUTE"},Fo=function(){return"MONTH"},So=function(){return"DAY"},Mo=function(){return"HOUR"},$o=function(){return"MINUTE"},Uo=function(){return"SECOND"},_o=function(){return"CASE"},Do=function(){return"END"},Ho=function(){return"WHEN"},Po=function(){return"THEN"},jo=function(){return"ELSE"},Zo=function(n){return n},ko=function(n){return n.join("")},zo=0|r.peg$currPos,Go=zo,Bo=[{line:1,column:1}],qo=zo,Vo=r.peg$maxFailExpected||[],Wo=0|r.peg$silentFails;if(r.startRule){if(!(r.startRule in i))throw new Error("Can't start parsing from rule \""+r.startRule+'".');a=i[r.startRule]}function Yo(){return tu(Go,zo)}function Ko(n,t){throw eu(n,t=void 0!==t?t:tu(Go,zo))}function Xo(n,t){return{type:"literal",text:n,ignoreCase:t}}function Jo(n,t,r){return{type:"class",parts:n,inverted:t,ignoreCase:r}}function Qo(){return{type:"end"}}function nu(t){var r,e=Bo[t];if(e)return e;if(t>=Bo.length)r=Bo.length-1;else for(r=t;!Bo[--r];);for(e={line:(e=Bo[r]).line,column:e.column};r<t;)10===n.charCodeAt(r)?(e.line++,e.column=1):e.column++,r++;return Bo[t]=e,e}function tu(n,t,r){var e=nu(n),o=nu(t);return{source:u,start:{offset:n,line:e.line,column:e.column},end:{offset:t,line:o.line,column:o.column}}}function ru(n){zo<qo||(zo>qo&&(qo=zo,Vo=[]),Vo.push(n))}function eu(n,r){return new t(n,null,null,r)}function ou(n,r,e){return new t(t.buildMessage(n,r),n,r,e)}function uu(){var n,t;return n=zo,ma(),(t=au())!==o?(ma(),Go=n,n=Xt(t)):(zo=n,n=o),n}function iu(){var n,t,r,e,u,i;if(n=zo,ga()!==o){for(ma(),t=[],r=au();r!==o;)t.push(r),r=zo,e=zo,u=ma(),(i=ha())!==o?e=u=[u,i,ma()]:(zo=e,e=o),e!==o&&(e=au())===o?(zo=r,r=o):r=e;r=ma(),(e=Aa())!==o?(Go=n,n=Jt(t)):(zo=n,n=o)}else zo=n,n=o;return n}function au(){var n,t,r,e,u,i;if(n=zo,(t=cu())!==o){for(r=[],e=zo,ma(),(u=Mi())!==o?(ma(),(i=cu())!==o?(Go=e,e=Qt(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=Mi())!==o?(ma(),(i=cu())!==o?(Go=e,e=Qt(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=nr(t,r)}else zo=n,n=o;return n}function cu(){var n,t,r,e,u,i;if(n=zo,(t=su())!==o){for(r=[],e=zo,ma(),(u=Si())!==o?(ma(),(i=su())!==o?(Go=e,e=tr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=Si())!==o?(ma(),(i=su())!==o?(Go=e,e=tr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=rr(t,r)}else zo=n,n=o;return n}function su(){var t,r,e,u,i;return t=zo,(r=Fi())===o&&(r=zo,33===n.charCodeAt(zo)?(e=c,zo++):(e=o,0===Wo&&ru(On)),e!==o?(u=zo,Wo++,61===n.charCodeAt(zo)?(i=s,zo++):(i=o,0===Wo&&ru(Fn)),Wo--,i===o?u=void 0:(zo=u,u=o),u!==o?r=e=[e,u]:(zo=r,r=o)):(zo=r,r=o)),r!==o?(e=ma(),(u=su())!==o?(Go=t,t=er(u)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=fu()),t}function fu(){var n,t,r,e;return n=zo,(t=Cu())!==o?(r=zo,ma(),(e=lu())!==o?r=e:(zo=r,r=o),r===o&&(r=null),Go=n,n=or(t,r)):(zo=n,n=o),n}function lu(){var n;return(n=pu())===o&&(n=mu())===o&&(n=yu())===o&&(n=du())===o&&(n=Au()),n}function pu(){var n,t,r,e,u;if(n=zo,t=[],r=zo,ma(),(e=vu())!==o?(ma(),(u=Cu())!==o?(Go=r,r=ur(e,u)):(zo=r,r=o)):(zo=r,r=o),r!==o)for(;r!==o;)t.push(r),r=zo,ma(),(e=vu())!==o?(ma(),(u=Cu())!==o?(Go=r,r=ur(e,u)):(zo=r,r=o)):(zo=r,r=o);else t=o;return t!==o&&(Go=n,t=ir(t)),n=t}function vu(){var t;return n.substr(zo,2)===f?(t=f,zo+=2):(t=o,0===Wo&&ru(Sn)),t===o&&(62===n.charCodeAt(zo)?(t=l,zo++):(t=o,0===Wo&&ru(Mn)),t===o&&(n.substr(zo,2)===p?(t=p,zo+=2):(t=o,0===Wo&&ru($n)),t===o&&(n.substr(zo,2)===v?(t=v,zo+=2):(t=o,0===Wo&&ru(Un)),t===o&&(t=n.charAt(zo),An.test(t)?zo++:(t=o,0===Wo&&ru(_n)),t===o&&(n.substr(zo,2)===d?(t=d,zo+=2):(t=o,0===Wo&&ru(Dn))))))),t}function du(){var n,t,r,e;return n=zo,(t=Ii())!==o?(ma(),(r=Fi())!==o?(ma(),(e=Cu())!==o?(Go=n,n=ar(t,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=Ii())!==o?(ma(),(r=Cu())!==o?(Go=n,n=cr(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function yu(){var n,t,r,e,u,i,a,c;return n=zo,(t=Fi())!==o?(ma(),(r=$i())!==o?(e=ma(),u=zo,(i=Cu())!==o?(ma(),(a=Si())!==o?(ma(),(c=Cu())!==o?(Go=u,u=sr(r,i,c)):(zo=u,u=o)):(zo=u,u=o)):(zo=u,u=o),u!==o?(Go=n,n=fr(r,u)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=$i())!==o?(ma(),r=zo,(e=Cu())!==o?(u=ma(),(i=Si())!==o?(ma(),(a=Cu())!==o?(Go=r,r=lr(t,e,a)):(zo=r,r=o)):(zo=r,r=o)):(zo=r,r=o),r!==o?(Go=n,n=pr(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function hu(){var n,t,r,e,u;return n=zo,t=zo,(r=Fi())!==o?(e=ma(),(u=Ri())!==o?t=r=[r,e,u]:(zo=t,t=o)):(zo=t,t=o),t!==o&&(Go=n,t=vr(t)),(n=t)===o&&(n=Ri()),n}function gu(){var n,t,r,e,u;return n=zo,t=zo,(r=Fi())!==o?(e=ma(),(u=Ni())!==o?t=r=[r,e,u]:(zo=t,t=o)):(zo=t,t=o),t!==o&&(Go=n,t=dr(t)),(n=t)===o&&(n=Ni()),n}function Au(){var n,t,r,e;return n=zo,(t=hu())!==o?(ma(),(r=ci())!==o?(ma(),Oi()!==o?(ma(),(e=si())!==o?(Go=n,n=yr(t,r,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=hu())!==o?(ma(),(r=ci())!==o?(Go=n,n=hr(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function mu(){var n,t,r;return n=zo,(t=gu())!==o?(ma(),(r=iu())!==o?(Go=n,n=gr(t,r)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=gu())!==o?(ma(),(r=Hu())!==o?(Go=n,n=Ar(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function Cu(){var n,t,r,e,u,i;if(n=zo,(t=Eu())!==o){for(r=[],e=zo,ma(),(u=bu())!==o?(ma(),(i=Eu())!==o?(Go=e,e=mr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=bu())!==o?(ma(),(i=Eu())!==o?(Go=e,e=mr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=Cr(t,r)}else zo=n,n=o;return n}function bu(){var t;return t=n.charAt(zo),mn.test(t)?zo++:(t=o,0===Wo&&ru(Hn)),t===o&&(n.substr(zo,2)===y?(t=y,zo+=2):(t=o,0===Wo&&ru(Pn))),t}function Eu(){var n,t,r,e,u,i;if(n=zo,(t=Tu())!==o){for(r=[],e=zo,ma(),(u=Lu())!==o?(ma(),(i=Tu())!==o?(Go=e,e=br(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=Lu())!==o?(ma(),(i=Tu())!==o?(Go=e,e=br(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=Er(t,r)}else zo=n,n=o;return n}function Lu(){var t;return t=n.charAt(zo),Cn.test(t)?zo++:(t=o,0===Wo&&ru(jn)),t}function Tu(){var n,t;return(n=Wu())===o&&(n=Pu())===o&&(n=ju())===o&&(n=zu())===o&&(n=Bu())===o&&(n=Zu())===o&&(n=qu())===o&&(n=fi())===o&&(n=wu())===o&&(n=Hu())===o&&(n=zo,ga()!==o?(ma(),(t=au())!==o?(ma(),Aa()!==o?(Go=n,n=Lr(t)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)),n}function wu(){var n,t;return n=zo,(t=xu())!==o&&(Go=n,t=Tr(t)),(n=t)===o&&(n=zo,(t=Su())!==o&&(Go=n,t=wr(t)),n=t),n}function xu(){var n,t;return n=zo,(t=Nu())!==o&&(Go=n,t=xr(t)),n=t}function Nu(){var n,t,r,e;if(n=zo,(t=Ru())!==o){for(r=[],e=Fu();e!==o;)r.push(e),e=Fu();Go=n,n=Nr(t,r)}else zo=n,n=o;return n}function Iu(){var n,t,r,e;if(n=zo,(t=Ru())!==o){for(r=[],e=Ou();e!==o;)r.push(e),e=Ou();Go=n,n=Ir(t,r)}else zo=n,n=o;return n}function Ru(){var t;return t=n.charAt(zo),bn.test(t)?zo++:(t=o,0===Wo&&ru(Zn)),t}function Ou(){var t;return t=n.charAt(zo),En.test(t)?zo++:(t=o,0===Wo&&ru(kn)),t}function Fu(){var t;return t=n.charAt(zo),Ln.test(t)?zo++:(t=o,0===Wo&&ru(zn)),t}function Su(){var n,t;return n=zo,Du()!==o?(t=Mu(),Du()!==o?(Go=n,n=Rr(t)):(zo=n,n=o)):(zo=n,n=o),n}function Mu(){var n,t,r;for(n=zo,t=[],r=$u();r!==o;)t.push(r),r=$u();return Go=n,n=t=Or(t)}function $u(){var n;return(n=_u())===o&&(n=Uu()),n}function Uu(){var n;return n=zo,Du()!==o&&Du()!==o?(Go=n,n=Fr()):(zo=n,n=o),n}function _u(){var t;return t=n.charAt(zo),Ln.test(t)?zo++:(t=o,0===Wo&&ru(zn)),t}function Du(){var t;return t=n.charAt(zo),Tn.test(t)?zo++:(t=o,0===Wo&&ru(Gn)),t}function Hu(){var t,r,e,u;return t=zo,r=zo,64===n.charCodeAt(zo)?(e=h,zo++):(e=o,0===Wo&&ru(Bn)),e!==o&&(u=Iu())!==o?r=e=[e,u]:(zo=r,r=o),r!==o&&(Go=t,r=Sr(r)),t=r}function Pu(){var n,t,r,e;return n=zo,Hi()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=Vu())!==o?(ma(),Ui()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=Mr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=Vu())!==o?(ma(),ha()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=$r(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Ur(t)):(zo=n,n=o)):(zo=n,n=o),n}function ju(){var n,t,r,e,u,i,a;return n=zo,Di()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),Ui()!==o?(ma(),(e=au())!==o?(ma(),u=zo,_i()!==o?(i=ma(),(a=au())!==o?(ma(),u=a):(zo=u,u=o)):(zo=u,u=o),u===o&&(u=null),Aa()!==o?(Go=t,t=_r(r,e,u)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),ha()!==o?(ma(),(e=au())!==o?(ma(),(u=ha())!==o?(ma(),(i=au())!==o&&(a=Aa())!==o?(Go=t,t=Dr(r,e,i)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Hr(t)):(zo=n,n=o)):(zo=n,n=o),n}function Zu(){var n,t,r,e;return n=zo,Vi()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),Wi()!==o?(ma(),(e=ku())!==o?(ma(),Aa()!==o?(Go=t,t=Pr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),ha()!==o?(ma(),(e=ku())!==o?(ma(),Aa()!==o?(Go=t,t=jr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Zr(t)):(zo=n,n=o)):(zo=n,n=o),n}function ku(){var n,t,r;return n=zo,(t=Yi())===o&&(t=Ki()),t!==o&&(Go=n,t=kr()),(n=t)===o&&(n=zo,(t=Xi())!==o&&(Go=n,t=zr()),(n=t)===o&&(n=zo,(t=Ji())!==o&&(Go=n,t=Gr()),(n=t)===o&&(n=zo,(t=Qi())!==o&&(Go=n,t=Br()),(n=t)===o&&(n=zo,(t=ki())!==o&&(Go=n,t=qr()),(n=t)===o&&(n=zo,(t=Zi())!==o&&(Go=n,t=Vr()),(n=t)===o&&(n=zo,(t=zi())!==o&&(Go=n,t=Wr()),(n=t)===o&&(n=zo,(t=na())!==o?(ma(),ga()!==o?(ma(),(r=bi())!==o?(ma(),Aa()!==o?(Go=n,n=Yr(r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)))))))),n}function zu(){var n,t,r,e,u;return n=zo,Pi()!==o?(ma(),t=zo,ga()!==o?(ma(),r=Gu(),ma(),(e=au())!==o?(ma(),Ui()!==o?(ma(),(u=au())!==o?(ma(),Aa()!==o?(Go=t,t=Kr(r,e,u)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),r=Gu(),ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=Xr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Jr(t)):(zo=n,n=o)):(zo=n,n=o),n}function Gu(){var n,t;return n=zo,(t=Gi())===o&&(t=Bi())===o&&(t=qi()),t===o&&(t=null),Go=n,n=t=Qr(t)}function Bu(){var n,t,r,e;return n=zo,ji()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),Ni()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=ne(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),ha()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=te(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=re(t)):(zo=n,n=o)):(zo=n,n=o),n}function qu(){var n,t,r,e;return n=zo,t=zo,Wo++,r=Hi(),Wo--,r===o?t=void 0:(zo=t,t=o),t!==o&&(r=ba())!==o?(ma(),(e=iu())!==o?(Go=n,n=ee(r,e)):(zo=n,n=o)):(zo=n,n=o),n}function Vu(){var n,t;return n=zo,(t=ea())===o&&(t=ia())===o&&(t=aa())===o&&(t=ca())===o&&(t=sa())===o&&(t=fa())===o&&(t=oa())===o&&(t=ua()),t!==o&&(Go=n,t=oe(t)),n=t}function Wu(){var n;return(n=si())===o&&(n=hi())===o&&(n=ai())===o&&(n=ii())===o&&(n=ui())===o&&(n=Yu())===o&&(n=Xu())===o&&(n=Ku()),n}function Yu(){var n,t;return n=zo,Zi()!==o?(ma(),(t=ci())!==o?(Go=n,n=ue(t)):(zo=n,n=o)):(zo=n,n=o),n}function Ku(){var n,t;return n=zo,zi()!==o?(ma(),(t=ci())!==o?(Go=n,n=ie(t)):(zo=n,n=o)):(zo=n,n=o),n}function Xu(){var t,r,e,u;return t=zo,ra()!==o?(ma(),r=n.charAt(zo),mn.test(r)?zo++:(r=o,0===Wo&&ru(Hn)),r!==o?(ma(),(e=ci())!==o?(ma(),(u=Ju())!==o?(Go=t,t=ae(r,e,u)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ra()!==o?(ma(),(r=ci())!==o?(ma(),(e=Ju())!==o?(Go=t,t=ce(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t}function Ju(){var n,t,r;return n=zo,(t=Qu())!==o?(ma(),ta()!==o?(ma(),(r=ni())!==o?(Go=n,n=se(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=ti()),n}function Qu(){var n,t,r;return n=zo,(t=ri())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),Aa()!==o?(Go=n,n=fe(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=ri())!==o&&(Go=n,t=le(t)),n=t),n}function ni(){var n,t,r,e;return n=zo,(t=ri())!==o&&(Go=n,t=pe(t)),(n=t)===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),ha()!==o?(ma(),(e=ei())!==o?(ma(),Aa()!==o?(Go=n,n=ve(r,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),Aa()!==o?(Go=n,n=de(r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o&&(Go=n,t=ye()),n=t))),n}function ti(){var n,t,r,e;return n=zo,(t=ri())!==o?(ma(),ga()!==o?(ma(),(r=ei())!==o?(ma(),Aa()!==o?(Go=n,n=he(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=ri())!==o&&(Go=n,t=ge(t)),(n=t)===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),ha()!==o?(ma(),(e=ei())!==o?(ma(),Aa()!==o?(Go=n,n=Ae(r,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=ei())!==o?(ma(),Aa()!==o?(Go=n,n=me(r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o&&(Go=n,t=Ce()),n=t)))),n}function ri(){var n,t;return n=zo,(t=aa())!==o&&(Go=n,t=be()),(n=t)===o&&(n=zo,(t=ca())!==o&&(Go=n,t=Ee()),(n=t)===o&&(n=zo,(t=sa())!==o&&(Go=n,t=Le()),(n=t)===o&&(n=zo,(t=ia())!==o&&(Go=n,t=Te()),(n=t)===o&&(n=zo,(t=ea())!==o&&(Go=n,t=we()),n=t)))),n}function ei(){var n,t;return n=zo,(t=bi())!==o&&(Go=n,t=xe(t)),n=t}function oi(){var n,t;return n=zo,(t=bi())!==o&&(Go=n,t=Ne(t)),n=t}function ui(){var n,t;return n=zo,ki()!==o?(ma(),(t=ci())!==o?(Go=n,n=Ie(t)):(zo=n,n=o)):(zo=n,n=o),n}function ii(){var n,t;return n=zo,(t=Ti())!==o&&(Go=n,t=Re()),n=t}function ai(){var n,t;return n=zo,(t=wi())!==o&&(Go=n,t=Oe()),(n=t)===o&&(n=zo,(t=xi())!==o&&(Go=n,t=Fe()),n=t),n}function ci(){var n;return(n=si())===o&&(n=Hu()),n}function si(){var t,r,e,u,i;if(t=zo,39===n.charCodeAt(zo)?(r=g,zo++):(r=o,0===Wo&&ru(qn)),r===o&&(n.substr(zo,2)===A?(r=A,zo+=2):(r=o,0===Wo&&ru(Vn))),r!==o){for(e=[],u=zo,n.substr(zo,2)===m?(i=m,zo+=2):(i=o,0===Wo&&ru(Wn)),i!==o&&(Go=u,i=Se()),(u=i)===o&&(u=n.charAt(zo),wn.test(u)?zo++:(u=o,0===Wo&&ru(Yn)));u!==o;)e.push(u),u=zo,n.substr(zo,2)===m?(i=m,zo+=2):(i=o,0===Wo&&ru(Wn)),i!==o&&(Go=u,i=Se()),(u=i)===o&&(u=n.charAt(zo),wn.test(u)?zo++:(u=o,0===Wo&&ru(Yn)));39===n.charCodeAt(zo)?(u=g,zo++):(u=o,0===Wo&&ru(qn)),u!==o?(Go=t,t=Me(e)):(zo=t,t=o)}else zo=t,t=o;return t}function fi(){var n;return(n=li())===o&&(n=pi()),n}function li(){var n,t,r,e,u;if(n=zo,la()!==o)if(ma(),(t=au())!==o){for(ma(),r=[],e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);e!==o;)r.push(e),e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);(e=pa())!==o?(Go=n,n=$e(t,r)):(zo=n,n=o)}else zo=n,n=o;else zo=n,n=o;if(n===o)if(n=zo,la()!==o)if(ma(),(t=au())!==o){for(ma(),r=[],e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);e!==o;)r.push(e),e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);(e=yi())!==o?(u=ma(),pa()!==o?(Go=n,n=Ue(t,r,e)):(zo=n,n=o)):(zo=n,n=o)}else zo=n,n=o;else zo=n,n=o;return n}function pi(){var n,t,r,e;if(n=zo,la()!==o){for(ma(),t=[],r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);r!==o;)t.push(r),r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);(r=pa())!==o?(Go=n,n=_e(t)):(zo=n,n=o)}else zo=n,n=o;if(n===o)if(n=zo,la()!==o){for(ma(),t=[],r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);r!==o;)t.push(r),r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);(r=yi())!==o?(e=ma(),pa()!==o?(Go=n,n=De(t,r)):(zo=n,n=o)):(zo=n,n=o)}else zo=n,n=o;return n}function vi(){var n,t,r;return n=zo,va()!==o?(ma(),(t=au())!==o?(ma(),da()!==o?(ma(),(r=au())!==o?(Go=n,n=He(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n}function di(){var n,t,r;return n=zo,va()!==o?(ma(),(t=au())!==o?(ma(),da()!==o?(ma(),(r=au())!==o?(Go=n,n=Pe(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n}function yi(){var n,t;return n=zo,ya()!==o?(ma(),(t=au())!==o?(Go=n,n=je(t)):(zo=n,n=o)):(zo=n,n=o),n}function hi(){var n,t,r,e;return n=zo,(t=gi())!==o?(r=zo,Wo++,e=Ru(),Wo--,e===o?r=void 0:(zo=r,r=o),r!==o?(Go=n,n=Ze(t)):(zo=n,n=o)):(zo=n,n=o),n}function gi(){var n,t,r,e;return n=zo,(t=Ai())!==o&&(r=mi())!==o&&(e=Ci())!==o?(Go=n,n=ke(t,r,e)):(zo=n,n=o),n===o&&(n=zo,(t=Ai())!==o&&(r=mi())!==o?(Go=n,n=ze(t,r)):(zo=n,n=o),n===o&&(n=zo,(t=Ai())!==o&&(r=Ci())!==o?(Go=n,n=Ge(t,r)):(zo=n,n=o),n===o&&(n=zo,(t=Ai())!==o&&(Go=n,t=Be(t)),n=t))),n}function Ai(){var t,r,e;return(t=bi())===o&&(t=zo,r=n.charAt(zo),mn.test(r)?zo++:(r=o,0===Wo&&ru(Hn)),r!==o&&(e=bi())!==o?(Go=t,t=qe(r,e)):(zo=t,t=o)),t}function mi(){var t,r,e;return t=zo,46===n.charCodeAt(zo)?(r=C,zo++):(r=o,0===Wo&&ru(Kn)),r!==o?((e=bi())===o&&(e=null),Go=t,t=Ve(e)):(zo=t,t=o),t}function Ci(){var n,t,r;return n=zo,(t=Li())!==o&&(r=bi())!==o?(Go=n,n=We(t,r)):(zo=n,n=o),n}function bi(){var n,t,r;if(n=zo,t=[],(r=Ei())!==o)for(;r!==o;)t.push(r),r=Ei();else t=o;return t!==o&&(Go=n,t=Ye(t)),n=t}function Ei(){var t;return t=n.charAt(zo),xn.test(t)?zo++:(t=o,0===Wo&&ru(Xn)),t}function Li(){var t,r,e;return t=zo,r=n.charAt(zo),Nn.test(r)?zo++:(r=o,0===Wo&&ru(Jn)),r!==o?(e=n.charAt(zo),mn.test(e)?zo++:(e=o,0===Wo&&ru(Hn)),e===o&&(e=null),Go=t,t=Ke(r,e)):(zo=t,t=o),t}function Ti(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===b?zo+=4:(r=o,0===Wo&&ru(Qn)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?t=r=[r,e]:(zo=t,t=o)):(zo=t,t=o),t}function wi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===E?zo+=4:(r=o,0===Wo&&ru(nt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?t=r=[r,e]:(zo=t,t=o)):(zo=t,t=o),t}function xi(){var t,r,e,u;return t=zo,(r=n.substr(zo,5)).toLowerCase()===L?zo+=5:(r=o,0===Wo&&ru(tt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?t=r=[r,e]:(zo=t,t=o)):(zo=t,t=o),t}function Ni(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===T?zo+=2:(r=o,0===Wo&&ru(rt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Xe()):(zo=t,t=o)):(zo=t,t=o),t}function Ii(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===w?zo+=2:(r=o,0===Wo&&ru(et)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Je()):(zo=t,t=o)):(zo=t,t=o),t}function Ri(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===x?zo+=4:(r=o,0===Wo&&ru(ot)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Qe()):(zo=t,t=o)):(zo=t,t=o),t}function Oi(){var t,r,e,u;return t=zo,(r=n.substr(zo,6)).toLowerCase()===N?zo+=6:(r=o,0===Wo&&ru(ut)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=no()):(zo=t,t=o)):(zo=t,t=o),t}function Fi(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===I?zo+=3:(r=o,0===Wo&&ru(it)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=to()):(zo=t,t=o)):(zo=t,t=o),t}function Si(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===R?zo+=3:(r=o,0===Wo&&ru(at)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=ro()):(zo=t,t=o)):(zo=t,t=o),t}function Mi(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===O?zo+=2:(r=o,0===Wo&&ru(ct)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=eo()):(zo=t,t=o)):(zo=t,t=o),t}function $i(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===F?zo+=7:(r=o,0===Wo&&ru(st)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=oo()):(zo=t,t=o)):(zo=t,t=o),t}function Ui(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===S?zo+=4:(r=o,0===Wo&&ru(ft)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=uo()):(zo=t,t=o)):(zo=t,t=o),t}function _i(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===M?zo+=3:(r=o,0===Wo&&ru(lt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=io()):(zo=t,t=o)):(zo=t,t=o),t}function Di(){var t,r,e,u;return t=zo,(r=n.substr(zo,9)).toLowerCase()===$?zo+=9:(r=o,0===Wo&&ru(pt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=ao()):(zo=t,t=o)):(zo=t,t=o),t}function Hi(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===U?zo+=7:(r=o,0===Wo&&ru(vt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=co()):(zo=t,t=o)):(zo=t,t=o),t}function Pi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===_?zo+=4:(r=o,0===Wo&&ru(dt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=so()):(zo=t,t=o)):(zo=t,t=o),t}function ji(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===D?zo+=8:(r=o,0===Wo&&ru(yt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=fo()):(zo=t,t=o)):(zo=t,t=o),t}function Zi(){var t,r,e,u;return t=zo,(r=n.substr(zo,9)).toLowerCase()===H?zo+=9:(r=o,0===Wo&&ru(ht)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=lo()):(zo=t,t=o)):(zo=t,t=o),t}function ki(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===P?zo+=4:(r=o,0===Wo&&ru(gt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=po()):(zo=t,t=o)):(zo=t,t=o),t}function zi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===j?zo+=4:(r=o,0===Wo&&ru(At)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=vo()):(zo=t,t=o)):(zo=t,t=o),t}function Gi(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===Z?zo+=7:(r=o,0===Wo&&ru(mt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=yo()):(zo=t,t=o)):(zo=t,t=o),t}function Bi(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===k?zo+=8:(r=o,0===Wo&&ru(Ct)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=ho()):(zo=t,t=o)):(zo=t,t=o),t}function qi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===z?zo+=4:(r=o,0===Wo&&ru(bt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=go()):(zo=t,t=o)):(zo=t,t=o),t}function Vi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===G?zo+=4:(r=o,0===Wo&&ru(Et)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Ao()):(zo=t,t=o)):(zo=t,t=o),t}function Wi(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===B?zo+=2:(r=o,0===Wo&&ru(Lt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=mo()):(zo=t,t=o)):(zo=t,t=o),t}function Yi(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===q?zo+=7:(r=o,0===Wo&&ru(Tt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Co()):(zo=t,t=o)):(zo=t,t=o),t}function Ki(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===V?zo+=3:(r=o,0===Wo&&ru(wt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=bo()):(zo=t,t=o)):(zo=t,t=o),t}function Xi(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===W?zo+=8:(r=o,0===Wo&&ru(xt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Eo()):(zo=t,t=o)):(zo=t,t=o),t}function Ji(){var t,r,e,u;return t=zo,(r=n.substr(zo,5)).toLowerCase()===Y?zo+=5:(r=o,0===Wo&&ru(Nt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Lo()):(zo=t,t=o)):(zo=t,t=o),t}function Qi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===K?zo+=4:(r=o,0===Wo&&ru(It)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=To()):(zo=t,t=o)):(zo=t,t=o),t}function na(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===X?zo+=7:(r=o,0===Wo&&ru(Rt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=wo()):(zo=t,t=o)):(zo=t,t=o),t}function ta(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===J?zo+=2:(r=o,0===Wo&&ru(Ot)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=xo()):(zo=t,t=o)):(zo=t,t=o),t}function ra(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===Q?zo+=8:(r=o,0===Wo&&ru(Ft)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=No()):(zo=t,t=o)):(zo=t,t=o),t}function ea(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===nn?zo+=4:(r=o,0===Wo&&ru(St)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Io()):(zo=t,t=o)):(zo=t,t=o),t}function oa(){var t,r,e,u;return t=zo,(r=n.substr(zo,13)).toLowerCase()===tn?zo+=13:(r=o,0===Wo&&ru(Mt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Ro()):(zo=t,t=o)):(zo=t,t=o),t}function ua(){var t,r,e,u;return t=zo,(r=n.substr(zo,15)).toLowerCase()===rn?zo+=15:(r=o,0===Wo&&ru($t)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Oo()):(zo=t,t=o)):(zo=t,t=o),t}function ia(){var t,r,e,u;return t=zo,(r=n.substr(zo,5)).toLowerCase()===en?zo+=5:(r=o,0===Wo&&ru(Ut)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Fo()):(zo=t,t=o)):(zo=t,t=o),t}function aa(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===on?zo+=3:(r=o,0===Wo&&ru(_t)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=So()):(zo=t,t=o)):(zo=t,t=o),t}function ca(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===un?zo+=4:(r=o,0===Wo&&ru(Dt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Mo()):(zo=t,t=o)):(zo=t,t=o),t}function sa(){var t,r,e,u;return t=zo,(r=n.substr(zo,6)).toLowerCase()===an?zo+=6:(r=o,0===Wo&&ru(Ht)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=$o()):(zo=t,t=o)):(zo=t,t=o),t}function fa(){var t,r,e,u;return t=zo,(r=n.substr(zo,6)).toLowerCase()===cn?zo+=6:(r=o,0===Wo&&ru(Pt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Uo()):(zo=t,t=o)):(zo=t,t=o),t}function la(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===sn?zo+=4:(r=o,0===Wo&&ru(jt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=_o()):(zo=t,t=o)):(zo=t,t=o),t}function pa(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===fn?zo+=3:(r=o,0===Wo&&ru(Zt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Do()):(zo=t,t=o)):(zo=t,t=o),t}function va(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===ln?zo+=4:(r=o,0===Wo&&ru(kt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Ho()):(zo=t,t=o)):(zo=t,t=o),t}function da(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===pn?zo+=4:(r=o,0===Wo&&ru(zt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Po()):(zo=t,t=o)):(zo=t,t=o),t}function ya(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===vn?zo+=4:(r=o,0===Wo&&ru(Gt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=jo()):(zo=t,t=o)):(zo=t,t=o),t}function ha(){var t;return 44===n.charCodeAt(zo)?(t=dn,zo++):(t=o,0===Wo&&ru(Bt)),t}function ga(){var t;return 40===n.charCodeAt(zo)?(t=yn,zo++):(t=o,0===Wo&&ru(qt)),t}function Aa(){var t;return 41===n.charCodeAt(zo)?(t=hn,zo++):(t=o,0===Wo&&ru(Vt)),t}function ma(){var n,t;for(n=[],t=Ca();t!==o;)n.push(t),t=Ca();return n}function Ca(){var t;return t=n.charAt(zo),In.test(t)?zo++:(t=o,0===Wo&&ru(Wt)),t}function ba(){var t,r,e,u;if(t=zo,(r=Iu())!==o&&(Go=t,r=Zo(r)),(t=r)===o)if(t=zo,96===n.charCodeAt(zo)?(r=gn,zo++):(r=o,0===Wo&&ru(Yt)),r!==o){if(e=[],u=n.charAt(zo),Rn.test(u)?zo++:(u=o,0===Wo&&ru(Kt)),u!==o)for(;u!==o;)e.push(u),u=n.charAt(zo),Rn.test(u)?zo++:(u=o,0===Wo&&ru(Kt));else e=o;e!==o?(96===n.charCodeAt(zo)?(u=gn,zo++):(u=o,0===Wo&&ru(Yt)),u!==o?(Go=t,t=ko(e)):(zo=t,t=o)):(zo=t,t=o)}else zo=t,t=o;return t}function Ea(n,t,r){return{type:"unary-expression",location:r,operator:n,expr:t}}function La(n,t,r,e,o){const u={type:"binary-expression",location:o,operator:n,left:t,right:r};return void 0!==e&&(u.escape=e),u}function Ta(n,...t){return{type:"expression-list",location:n,value:t}}function wa(n,t){let r=n;for(const{op:e,expr:o,location:{end:u}}of t)r=La(e,r,o,void 0,{...r.location,end:u});return r}function xa(n){!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(n)&&Ko("Timestamp literal is invalid")}function Na(n){!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(n)&&Ko("Time literal is invalid")}function Ia(n){!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(n)&&Ko("Date literal is invalid")}if(e=a(),r.peg$library)return{peg$result:e,peg$currPos:zo,peg$FAILED:o,peg$maxFailExpected:Vo,peg$maxFailPos:qo};if(e!==o&&zo===n.length)return e;throw e!==o&&zo<n.length&&ru(Qo()),ou(Vo,qo<n.length?n.charAt(qo):null,qo<n.length?tu(qo,qo+1):tu(qo,qo))}n(t,Error),t.prototype.format=function(n){var t="Error: "+this.message;if(this.location){var e,o=null;for(e=0;e<n.length;e++)if(n[e].source===this.location.source){o=n[e].text.split(/\r\n|\n|\r/g);break}var u=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(u):u,a=this.location.source+":"+i.line+":"+i.column;if(o){var c=this.location.end,s=r("",i.line.toString().length," "),f=o[u.line-1],l=(u.line===c.line?c.column:f.length+1)-u.column||1;t+="\n --\x3e "+a+"\n"+s+" |\n"+i.line+" | "+f+"\n"+s+" | "+r("",u.column-1," ")+r("",l,"^")}else t+="\n at "+a}return t},t.buildMessage=function(n,t){var r={literal:function(n){return'"'+o(n.text)+'"'},class:function(n){var t=n.parts.map((function(n){return Array.isArray(n)?u(n[0])+"-"+u(n[1]):u(n)}));return"["+(n.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(n){return n.description}};function e(n){return n.charCodeAt(0).toString(16).toUpperCase()}function o(n){return n.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(n){return"\\x0"+e(n)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(n){return"\\x"+e(n)}))}function u(n){return n.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(n){return"\\x0"+e(n)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(n){return"\\x"+e(n)}))}function i(n){return r[n.type](n)}function a(n){var t,r,e=n.map(i);if(e.sort(),e.length>0){for(t=1,r=1;t<e.length;t++)e[t-1]!==e[t]&&(e[r]=e[t],r++);e.length=r}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}function c(n){return n?'"'+o(n)+'"':"end of input"}return"Expected "+a(n)+" but "+c(t)+" found."};class o{static parse(n){return e(n)}}function u(n,t){if(null!=n)switch(t(n),n.type){case"when-clause":u(n.operand,t),u(n.value,t);break;case"case-expression":for(const r of n.clauses)u(r,t);"simple"===n.format&&u(n.operand,t),null!==n.else&&u(n.else,t);break;case"expression-list":for(const r of n.value)u(r,t);break;case"unary-expression":u(n.expr,t);break;case"binary-expression":u(n.left,t),u(n.right,t);break;case"function":u(n.args,t);break;case"interval":u(n.value,t),u(n.qualifier,t);break;case"interval-qualifier":u(n.start,t),u(n.end,t)}}export{o as WhereGrammar,u as visitAll};
|
|
5
|
+
function n(n,t){function r(){this.constructor=n}r.prototype=t.prototype,n.prototype=new r}function t(n,r,e,o){var u=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(u,t.prototype),u.expected=r,u.found=e,u.location=o,u.name="SyntaxError",u}function r(n,t,r){return r=r||" ",n.length>t?n:(t-=n.length,n+(r+=r.repeat(t)).slice(0,t))}function e(n,r){var e,o={},u=(r=void 0!==r?r:{}).grammarSource,i={start:uu},a=uu,c="!",s="=",f=">=",l=">",p="<=",v="<>",d="!=",y="||",h="@",g="'",A="N'",m="''",C=".",b="null",E="true",L="false",T="in",w="is",x="like",N="escape",I="not",R="and",O="or",F="between",S="from",M="for",$="substring",U="extract",_="trim",D="position",H="timestamp",P="date",j="time",Z="leading",k="trailing",z="both",G="cast",B="as",q="integer",V="int",W="smallint",Y="float",K="real",X="varchar",J="to",Q="interval",nn="year",tn="timezone_hour",rn="timezone_minute",en="month",on="day",un="hour",an="minute",cn="second",sn="case",fn="end",ln="when",pn="then",vn="else",dn=",",yn="(",hn=")",gn="`",An=/^[<-=]/,mn=/^[+\-]/,Cn=/^[*\/]/,bn=/^[A-Za-z_\x80-\uFFFF]/,En=/^[A-Za-z0-9_]/,Ln=/^[A-Za-z0-9_.\x80-\uFFFF]/,Tn=/^["]/,wn=/^[^']/,xn=/^[0-9]/,Nn=/^[eE]/,In=/^[ \t\n\r]/,Rn=/^[^`]/,On=Xo("!",!1),Fn=Xo("=",!1),Sn=Xo(">=",!1),Mn=Xo(">",!1),$n=Xo("<=",!1),Un=Xo("<>",!1),_n=Jo([["<","="]],!1,!1),Dn=Xo("!=",!1),Hn=Jo(["+","-"],!1,!1),Pn=Xo("||",!1),jn=Jo(["*","/"],!1,!1),Zn=Jo([["A","Z"],["a","z"],"_",["",""]],!1,!1),kn=Jo([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),zn=Jo([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),Gn=Jo(['"'],!1,!1),Bn=Xo("@",!1),qn=Xo("'",!1),Vn=Xo("N'",!1),Wn=Xo("''",!1),Yn=Jo(["'"],!0,!1),Kn=Xo(".",!1),Xn=Jo([["0","9"]],!1,!1),Jn=Jo(["e","E"],!1,!1),Qn=Xo("NULL",!0),nt=Xo("TRUE",!0),tt=Xo("FALSE",!0),rt=Xo("IN",!0),et=Xo("IS",!0),ot=Xo("LIKE",!0),ut=Xo("ESCAPE",!0),it=Xo("NOT",!0),at=Xo("AND",!0),ct=Xo("OR",!0),st=Xo("BETWEEN",!0),ft=Xo("FROM",!0),lt=Xo("FOR",!0),pt=Xo("SUBSTRING",!0),vt=Xo("EXTRACT",!0),dt=Xo("TRIM",!0),yt=Xo("POSITION",!0),ht=Xo("TIMESTAMP",!0),gt=Xo("DATE",!0),At=Xo("TIME",!0),mt=Xo("LEADING",!0),Ct=Xo("TRAILING",!0),bt=Xo("BOTH",!0),Et=Xo("CAST",!0),Lt=Xo("AS",!0),Tt=Xo("INTEGER",!0),wt=Xo("INT",!0),xt=Xo("SMALLINT",!0),Nt=Xo("FLOAT",!0),It=Xo("REAL",!0),Rt=Xo("VARCHAR",!0),Ot=Xo("TO",!0),Ft=Xo("INTERVAL",!0),St=Xo("YEAR",!0),Mt=Xo("TIMEZONE_HOUR",!0),$t=Xo("TIMEZONE_MINUTE",!0),Ut=Xo("MONTH",!0),_t=Xo("DAY",!0),Dt=Xo("HOUR",!0),Ht=Xo("MINUTE",!0),Pt=Xo("SECOND",!0),jt=Xo("CASE",!0),Zt=Xo("END",!0),kt=Xo("WHEN",!0),zt=Xo("THEN",!0),Gt=Xo("ELSE",!0),Bt=Xo(",",!1),qt=Xo("(",!1),Vt=Xo(")",!1),Wt=Jo([" ","\t","\n","\r"],!1,!1),Yt=Xo("`",!1),Kt=Jo(["`"],!0,!1),Xt=function(n){return n},Jt=function(n){return{type:"expression-list",location:Yo(),value:n}},Qt=function(n,t,r){return{op:t,expr:r,location:Yo()}},nr=function(n,t){return wa(n,t)},tr=function(n,t,r){return{op:t,expr:r,location:Yo()}},rr=function(n,t){return wa(n,t)},er=function(n){return Ea("NOT",n,Yo())},or=function(n,t){if(""==t||null==t||null==t)return n;return"arithmetic"==t.type?wa(n,t.tail):La(t.op,n,t.right,t.escape,Yo())},ur=function(n,t){return{op:n,expr:t,location:Yo()}},ir=function(n){return{type:"arithmetic",tail:n}},ar=function(n,t){return{op:n+"NOT",right:t}},cr=function(n,t){return{op:n,right:t}},sr=function(n,t,r){return Ta(Yo(),t,r)},fr=function(n,t){return{op:"NOT"+n,right:t}},lr=function(n,t,r){return Ta(Yo(),t,r)},pr=function(n,t){return{op:n,right:t}},vr=function(n){return n[0]+" "+n[2]},dr=function(n){return n[0]+" "+n[2]},yr=function(n,t,r){return{op:n,right:t,escape:r.value}},hr=function(n,t){return{op:n,right:t,escape:""}},gr=function(n,t){return{op:n,right:t}},Ar=function(n,t){return{op:n,right:t}},mr=function(n,t,r){return{op:t,expr:r,location:Yo()}},Cr=function(n,t){return wa(n,t)},br=function(n,t,r){return{op:t,expr:r,location:Yo()}},Er=function(n,t){return wa(n,t)},Lr=function(n){return n.paren=!0,n},Tr=function(n){return/^CURRENT_DATE$/i.test(n)?{type:"current-time",location:Yo(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(n)?{type:"current-time",location:Yo(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(n)?{type:"current-time",location:Yo(),mode:"time"}:/^CURRENT_USER$/i.test(n)?{type:"current-user",location:Yo()}:{type:"column-reference",location:Yo(),table:"",column:n}},wr=function(n){return{type:"column-reference",location:Yo(),table:"",column:n,delimited:!0}},xr=function(n){return n},Nr=function(n,t){return n+t.join("")},Ir=function(n,t){return n+t.join("")},Rr=function(n){return n},Or=function(n){return n.join("")},Fr=function(){return'"'},Sr=function(n){return{type:"parameter",location:Yo(),value:n[1]}},Mr=function(n,t){return Ta(Yo(),n,t)},$r=function(n,t){return Ta(Yo(),n,t)},Ur=function(n){return{type:"function",location:Yo(),name:"extract",args:n}},_r=function(n,t,r){return Ta(Yo(),n,t,...r?[r]:[])},Dr=function(n,t,r){return Ta(Yo(),n,t,r)},Hr=function(n){return{type:"function",location:Yo(),name:"substring",args:n}},Pr=function(n,t){return Ta(Yo(),n,t)},jr=function(n,t){return Ta(Yo(),n,t)},Zr=function(n){return{type:"function",location:Yo(),name:"cast",args:n}},kr=function(){return{type:"data-type",location:Yo(),value:{type:"integer"}}},zr=function(){return{type:"data-type",location:Yo(),value:{type:"smallint"}}},Gr=function(){return{type:"data-type",location:Yo(),value:{type:"float"}}},Br=function(){return{type:"data-type",location:Yo(),value:{type:"real"}}},qr=function(){return{type:"data-type",location:Yo(),value:{type:"date"}}},Vr=function(){return{type:"data-type",location:Yo(),value:{type:"timestamp"}}},Wr=function(){return{type:"data-type",location:Yo(),value:{type:"time"}}},Yr=function(n){return{type:"data-type",location:Yo(),value:{type:"varchar",size:parseInt(n)}}},Kr=function(n,t,r){return Ta(Yo(),n,t,r)},Xr=function(n,t){return Ta(Yo(),n,t)},Jr=function(n){return{type:"function",location:Yo(),name:"trim",args:n}},Qr=function(n){return{type:"string",location:Yo(),value:n??"BOTH"}},ne=function(n,t){return Ta(Yo(),n,t)},te=function(n,t){return Ta(Yo(),n,t)},re=function(n){return{type:"function",location:Yo(),name:"position",args:n}},ee=function(n,t){return{type:"function",location:Yo(),name:n,args:t}},oe=function(n){return{type:"string",location:Yo(),value:n}},ue=function(n){return"string"===n.type&&xa(n.value),{type:"timestamp",location:Yo(),value:n.value}},ie=function(n){return"string"===n.type&&Na(n.value),{type:"time",location:Yo(),value:n.value}},ae=function(n,t,r){return{type:"interval",location:Yo(),value:t,qualifier:r,op:n}},ce=function(n,t){return{type:"interval",location:Yo(),value:n,qualifier:t,op:""}},se=function(n,t){return{type:"interval-qualifier",location:Yo(),start:n,end:t}},fe=function(n,t){return{type:"interval-period",location:Yo(),period:n.value,precision:t,secondary:null}},le=function(n){return{type:"interval-period",location:Yo(),period:n.value,precision:null,secondary:null}},pe=function(n){return{type:"interval-period",location:Yo(),period:n.value,precision:null,secondary:null}},ve=function(n,t){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:t}},de=function(n){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:null}},ye=function(){return{type:"interval-period",location:Yo(),period:"second",precision:null,secondary:null}},he=function(n,t){return{type:"interval-period",location:Yo(),period:n.value,precision:t,secondary:null}},ge=function(n){return{type:"interval-period",location:Yo(),period:n.value,precision:null,secondary:null}},Ae=function(n,t){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:t}},me=function(n){return{type:"interval-period",location:Yo(),period:"second",precision:n,secondary:null}},Ce=function(){return{type:"interval-period",location:Yo(),period:"second",precision:null,secondary:null}},be=function(){return{type:"string",location:Yo(),value:"day"}},Ee=function(){return{type:"string",location:Yo(),value:"hour"}},Le=function(){return{type:"string",location:Yo(),value:"minute"}},Te=function(){return{type:"string",location:Yo(),value:"month"}},we=function(){return{type:"string",location:Yo(),value:"year"}},xe=function(n){return parseFloat(n)},Ne=function(n){return parseFloat(n)},Ie=function(n){return"string"===n.type&&Ia(n.value),{type:"date",location:Yo(),value:n.value}},Re=function(){return{type:"null",location:Yo(),value:null}},Oe=function(){return{type:"boolean",location:Yo(),value:!0}},Fe=function(){return{type:"boolean",location:Yo(),value:!1}},Se=function(){return"'"},Me=function(n){return{type:"string",location:Yo(),value:n.join("")}},$e=function(n,t){return{type:"case-expression",location:Yo(),format:"simple",operand:n,clauses:t,else:null,elseLocation:null}},Ue=function(n,t,r){return{type:"case-expression",location:Yo(),format:"simple",operand:n,clauses:t,else:r.value,elseLocation:r.location}},_e=function(n){return{type:"case-expression",location:Yo(),format:"searched",clauses:n,else:null,elseLocation:null}},De=function(n,t){return{type:"case-expression",location:Yo(),format:"searched",clauses:n,else:t.value,elseLocation:t.location}},He=function(n,t){return{type:"when-clause",location:Yo(),operand:n,value:t}},Pe=function(n,t){return{type:"when-clause",location:Yo(),operand:n,value:t}},je=function(n){return{type:"else-clause",location:Yo(),value:n}},Ze=function(n){return{type:"number",location:Yo(),value:n}},ke=function(n,t,r){return parseFloat(n+t+r)},ze=function(n,t){return parseFloat(n+t)},Ge=function(n,t){return parseFloat(n+t)},Be=function(n){return parseFloat(n)},qe=function(n,t){return n[0]+t},Ve=function(n){return"."+(null!=n?n:"")},We=function(n,t){return n+t},Ye=function(n){return n.join("")},Ke=function(n,t){return"e"+(null===t?"":t)},Xe=function(){return"IN"},Je=function(){return"IS"},Qe=function(){return"LIKE"},no=function(){return"ESCAPE"},to=function(){return"NOT"},ro=function(){return"AND"},eo=function(){return"OR"},oo=function(){return"BETWEEN"},uo=function(){return"FROM"},io=function(){return"FOR"},ao=function(){return"SUBSTRING"},co=function(){return"EXTRACT"},so=function(){return"TRIM"},fo=function(){return"POSITION"},lo=function(){return"TIMESTAMP"},po=function(){return"DATE"},vo=function(){return"TIME"},yo=function(){return"LEADING"},ho=function(){return"TRAILING"},go=function(){return"BOTH"},Ao=function(){return"CAST"},mo=function(){return"AS"},Co=function(){return"INTEGER"},bo=function(){return"INT"},Eo=function(){return"SMALLINT"},Lo=function(){return"FLOAT"},To=function(){return"REAL"},wo=function(){return"VARCHAR"},xo=function(){return"TO"},No=function(){return"INTERVAL"},Io=function(){return"YEAR"},Ro=function(){return"TIMEZONE_HOUR"},Oo=function(){return"TIMEZONE_MINUTE"},Fo=function(){return"MONTH"},So=function(){return"DAY"},Mo=function(){return"HOUR"},$o=function(){return"MINUTE"},Uo=function(){return"SECOND"},_o=function(){return"CASE"},Do=function(){return"END"},Ho=function(){return"WHEN"},Po=function(){return"THEN"},jo=function(){return"ELSE"},Zo=function(n){return n},ko=function(n){return n.join("")},zo=0|r.peg$currPos,Go=zo,Bo=[{line:1,column:1}],qo=zo,Vo=r.peg$maxFailExpected||[],Wo=0|r.peg$silentFails;if(r.startRule){if(!(r.startRule in i))throw new Error("Can't start parsing from rule \""+r.startRule+'".');a=i[r.startRule]}function Yo(){return tu(Go,zo)}function Ko(n,t){throw eu(n,t=void 0!==t?t:tu(Go,zo))}function Xo(n,t){return{type:"literal",text:n,ignoreCase:t}}function Jo(n,t,r){return{type:"class",parts:n,inverted:t,ignoreCase:r}}function Qo(){return{type:"end"}}function nu(t){var r,e=Bo[t];if(e)return e;if(t>=Bo.length)r=Bo.length-1;else for(r=t;!Bo[--r];);for(e={line:(e=Bo[r]).line,column:e.column};r<t;)10===n.charCodeAt(r)?(e.line++,e.column=1):e.column++,r++;return Bo[t]=e,e}function tu(n,t,r){var e=nu(n),o=nu(t);return{source:u,start:{offset:n,line:e.line,column:e.column},end:{offset:t,line:o.line,column:o.column}}}function ru(n){zo<qo||(zo>qo&&(qo=zo,Vo=[]),Vo.push(n))}function eu(n,r){return new t(n,null,null,r)}function ou(n,r,e){return new t(t.buildMessage(n,r),n,r,e)}function uu(){var n,t;return n=zo,ma(),(t=au())!==o?(ma(),Go=n,n=Xt(t)):(zo=n,n=o),n}function iu(){var n,t,r,e,u,i;if(n=zo,ga()!==o){for(ma(),t=[],r=au();r!==o;)t.push(r),r=zo,e=zo,u=ma(),(i=ha())!==o?e=u=[u,i,ma()]:(zo=e,e=o),e!==o&&(e=au())===o?(zo=r,r=o):r=e;r=ma(),(e=Aa())!==o?(Go=n,n=Jt(t)):(zo=n,n=o)}else zo=n,n=o;return n}function au(){var n,t,r,e,u,i;if(n=zo,(t=cu())!==o){for(r=[],e=zo,ma(),(u=Mi())!==o?(ma(),(i=cu())!==o?(Go=e,e=Qt(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=Mi())!==o?(ma(),(i=cu())!==o?(Go=e,e=Qt(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=nr(t,r)}else zo=n,n=o;return n}function cu(){var n,t,r,e,u,i;if(n=zo,(t=su())!==o){for(r=[],e=zo,ma(),(u=Si())!==o?(ma(),(i=su())!==o?(Go=e,e=tr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=Si())!==o?(ma(),(i=su())!==o?(Go=e,e=tr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=rr(t,r)}else zo=n,n=o;return n}function su(){var t,r,e,u,i;return t=zo,(r=Fi())===o&&(r=zo,33===n.charCodeAt(zo)?(e=c,zo++):(e=o,0===Wo&&ru(On)),e!==o?(u=zo,Wo++,61===n.charCodeAt(zo)?(i=s,zo++):(i=o,0===Wo&&ru(Fn)),Wo--,i===o?u=void 0:(zo=u,u=o),u!==o?r=e=[e,u]:(zo=r,r=o)):(zo=r,r=o)),r!==o?(e=ma(),(u=su())!==o?(Go=t,t=er(u)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=fu()),t}function fu(){var n,t,r,e;return n=zo,(t=Cu())!==o?(r=zo,ma(),(e=lu())!==o?r=e:(zo=r,r=o),r===o&&(r=null),Go=n,n=or(t,r)):(zo=n,n=o),n}function lu(){var n;return(n=pu())===o&&(n=mu())===o&&(n=yu())===o&&(n=du())===o&&(n=Au()),n}function pu(){var n,t,r,e,u;if(n=zo,t=[],r=zo,ma(),(e=vu())!==o?(ma(),(u=Cu())!==o?(Go=r,r=ur(e,u)):(zo=r,r=o)):(zo=r,r=o),r!==o)for(;r!==o;)t.push(r),r=zo,ma(),(e=vu())!==o?(ma(),(u=Cu())!==o?(Go=r,r=ur(e,u)):(zo=r,r=o)):(zo=r,r=o);else t=o;return t!==o&&(Go=n,t=ir(t)),n=t}function vu(){var t;return n.substr(zo,2)===f?(t=f,zo+=2):(t=o,0===Wo&&ru(Sn)),t===o&&(62===n.charCodeAt(zo)?(t=l,zo++):(t=o,0===Wo&&ru(Mn)),t===o&&(n.substr(zo,2)===p?(t=p,zo+=2):(t=o,0===Wo&&ru($n)),t===o&&(n.substr(zo,2)===v?(t=v,zo+=2):(t=o,0===Wo&&ru(Un)),t===o&&(t=n.charAt(zo),An.test(t)?zo++:(t=o,0===Wo&&ru(_n)),t===o&&(n.substr(zo,2)===d?(t=d,zo+=2):(t=o,0===Wo&&ru(Dn))))))),t}function du(){var n,t,r,e;return n=zo,(t=Ii())!==o?(ma(),(r=Fi())!==o?(ma(),(e=Cu())!==o?(Go=n,n=ar(t,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=Ii())!==o?(ma(),(r=Cu())!==o?(Go=n,n=cr(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function yu(){var n,t,r,e,u,i,a,c;return n=zo,(t=Fi())!==o?(ma(),(r=$i())!==o?(e=ma(),u=zo,(i=Cu())!==o?(ma(),(a=Si())!==o?(ma(),(c=Cu())!==o?(Go=u,u=sr(r,i,c)):(zo=u,u=o)):(zo=u,u=o)):(zo=u,u=o),u!==o?(Go=n,n=fr(r,u)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=$i())!==o?(ma(),r=zo,(e=Cu())!==o?(u=ma(),(i=Si())!==o?(ma(),(a=Cu())!==o?(Go=r,r=lr(t,e,a)):(zo=r,r=o)):(zo=r,r=o)):(zo=r,r=o),r!==o?(Go=n,n=pr(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function hu(){var n,t,r,e,u;return n=zo,t=zo,(r=Fi())!==o?(e=ma(),(u=Ri())!==o?t=r=[r,e,u]:(zo=t,t=o)):(zo=t,t=o),t!==o&&(Go=n,t=vr(t)),(n=t)===o&&(n=Ri()),n}function gu(){var n,t,r,e,u;return n=zo,t=zo,(r=Fi())!==o?(e=ma(),(u=Ni())!==o?t=r=[r,e,u]:(zo=t,t=o)):(zo=t,t=o),t!==o&&(Go=n,t=dr(t)),(n=t)===o&&(n=Ni()),n}function Au(){var n,t,r,e;return n=zo,(t=hu())!==o?(ma(),(r=ci())!==o?(ma(),Oi()!==o?(ma(),(e=si())!==o?(Go=n,n=yr(t,r,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=hu())!==o?(ma(),(r=ci())!==o?(Go=n,n=hr(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function mu(){var n,t,r;return n=zo,(t=gu())!==o?(ma(),(r=iu())!==o?(Go=n,n=gr(t,r)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=gu())!==o?(ma(),(r=Hu())!==o?(Go=n,n=Ar(t,r)):(zo=n,n=o)):(zo=n,n=o)),n}function Cu(){var n,t,r,e,u,i;if(n=zo,(t=Eu())!==o){for(r=[],e=zo,ma(),(u=bu())!==o?(ma(),(i=Eu())!==o?(Go=e,e=mr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=bu())!==o?(ma(),(i=Eu())!==o?(Go=e,e=mr(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=Cr(t,r)}else zo=n,n=o;return n}function bu(){var t;return t=n.charAt(zo),mn.test(t)?zo++:(t=o,0===Wo&&ru(Hn)),t===o&&(n.substr(zo,2)===y?(t=y,zo+=2):(t=o,0===Wo&&ru(Pn))),t}function Eu(){var n,t,r,e,u,i;if(n=zo,(t=Tu())!==o){for(r=[],e=zo,ma(),(u=Lu())!==o?(ma(),(i=Tu())!==o?(Go=e,e=br(t,u,i)):(zo=e,e=o)):(zo=e,e=o);e!==o;)r.push(e),e=zo,ma(),(u=Lu())!==o?(ma(),(i=Tu())!==o?(Go=e,e=br(t,u,i)):(zo=e,e=o)):(zo=e,e=o);Go=n,n=Er(t,r)}else zo=n,n=o;return n}function Lu(){var t;return t=n.charAt(zo),Cn.test(t)?zo++:(t=o,0===Wo&&ru(jn)),t}function Tu(){var n,t;return(n=Wu())===o&&(n=Pu())===o&&(n=ju())===o&&(n=zu())===o&&(n=Bu())===o&&(n=Zu())===o&&(n=qu())===o&&(n=fi())===o&&(n=wu())===o&&(n=Hu())===o&&(n=zo,ga()!==o?(ma(),(t=au())!==o?(ma(),Aa()!==o?(Go=n,n=Lr(t)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)),n}function wu(){var n,t;return n=zo,(t=xu())!==o&&(Go=n,t=Tr(t)),(n=t)===o&&(n=zo,(t=Su())!==o&&(Go=n,t=wr(t)),n=t),n}function xu(){var n,t;return n=zo,(t=Nu())!==o&&(Go=n,t=xr(t)),n=t}function Nu(){var n,t,r,e;if(n=zo,(t=Ru())!==o){for(r=[],e=Fu();e!==o;)r.push(e),e=Fu();Go=n,n=Nr(t,r)}else zo=n,n=o;return n}function Iu(){var n,t,r,e;if(n=zo,(t=Ru())!==o){for(r=[],e=Ou();e!==o;)r.push(e),e=Ou();Go=n,n=Ir(t,r)}else zo=n,n=o;return n}function Ru(){var t;return t=n.charAt(zo),bn.test(t)?zo++:(t=o,0===Wo&&ru(Zn)),t}function Ou(){var t;return t=n.charAt(zo),En.test(t)?zo++:(t=o,0===Wo&&ru(kn)),t}function Fu(){var t;return t=n.charAt(zo),Ln.test(t)?zo++:(t=o,0===Wo&&ru(zn)),t}function Su(){var n,t;return n=zo,Du()!==o?(t=Mu(),Du()!==o?(Go=n,n=Rr(t)):(zo=n,n=o)):(zo=n,n=o),n}function Mu(){var n,t,r;for(n=zo,t=[],r=$u();r!==o;)t.push(r),r=$u();return Go=n,n=t=Or(t)}function $u(){var n;return(n=_u())===o&&(n=Uu()),n}function Uu(){var n;return n=zo,Du()!==o&&Du()!==o?(Go=n,n=Fr()):(zo=n,n=o),n}function _u(){var t;return t=n.charAt(zo),Ln.test(t)?zo++:(t=o,0===Wo&&ru(zn)),t}function Du(){var t;return t=n.charAt(zo),Tn.test(t)?zo++:(t=o,0===Wo&&ru(Gn)),t}function Hu(){var t,r,e,u;return t=zo,r=zo,64===n.charCodeAt(zo)?(e=h,zo++):(e=o,0===Wo&&ru(Bn)),e!==o&&(u=Iu())!==o?r=e=[e,u]:(zo=r,r=o),r!==o&&(Go=t,r=Sr(r)),t=r}function Pu(){var n,t,r,e;return n=zo,Hi()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=Vu())!==o?(ma(),Ui()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=Mr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=Vu())!==o?(ma(),ha()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=$r(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Ur(t)):(zo=n,n=o)):(zo=n,n=o),n}function ju(){var n,t,r,e,u,i,a;return n=zo,Di()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),Ui()!==o?(ma(),(e=au())!==o?(ma(),u=zo,_i()!==o?(i=ma(),(a=au())!==o?(ma(),u=a):(zo=u,u=o)):(zo=u,u=o),u===o&&(u=null),Aa()!==o?(Go=t,t=_r(r,e,u)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),ha()!==o?(ma(),(e=au())!==o?(ma(),(u=ha())!==o?(ma(),(i=au())!==o&&(a=Aa())!==o?(Go=t,t=Dr(r,e,i)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Hr(t)):(zo=n,n=o)):(zo=n,n=o),n}function Zu(){var n,t,r,e;return n=zo,Vi()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),Wi()!==o?(ma(),(e=ku())!==o?(ma(),Aa()!==o?(Go=t,t=Pr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),ha()!==o?(ma(),(e=ku())!==o?(ma(),Aa()!==o?(Go=t,t=jr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Zr(t)):(zo=n,n=o)):(zo=n,n=o),n}function ku(){var n,t,r;return n=zo,(t=Yi())===o&&(t=Ki()),t!==o&&(Go=n,t=kr()),(n=t)===o&&(n=zo,(t=Xi())!==o&&(Go=n,t=zr()),(n=t)===o&&(n=zo,(t=Ji())!==o&&(Go=n,t=Gr()),(n=t)===o&&(n=zo,(t=Qi())!==o&&(Go=n,t=Br()),(n=t)===o&&(n=zo,(t=ki())!==o&&(Go=n,t=qr()),(n=t)===o&&(n=zo,(t=Zi())!==o&&(Go=n,t=Vr()),(n=t)===o&&(n=zo,(t=zi())!==o&&(Go=n,t=Wr()),(n=t)===o&&(n=zo,(t=na())!==o?(ma(),ga()!==o?(ma(),(r=bi())!==o?(ma(),Aa()!==o?(Go=n,n=Yr(r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)))))))),n}function zu(){var n,t,r,e,u;return n=zo,Pi()!==o?(ma(),t=zo,ga()!==o?(ma(),r=Gu(),ma(),(e=au())!==o?(ma(),Ui()!==o?(ma(),(u=au())!==o?(ma(),Aa()!==o?(Go=t,t=Kr(r,e,u)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),r=Gu(),ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=Xr(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=Jr(t)):(zo=n,n=o)):(zo=n,n=o),n}function Gu(){var n,t;return n=zo,(t=Gi())===o&&(t=Bi())===o&&(t=qi()),t===o&&(t=null),Go=n,n=t=Qr(t)}function Bu(){var n,t,r,e;return n=zo,ji()!==o?(ma(),t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),Ni()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=ne(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ga()!==o?(ma(),(r=au())!==o?(ma(),ha()!==o?(ma(),(e=au())!==o?(ma(),Aa()!==o?(Go=t,t=te(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t!==o?(Go=n,n=re(t)):(zo=n,n=o)):(zo=n,n=o),n}function qu(){var n,t,r,e;return n=zo,t=zo,Wo++,r=Hi(),Wo--,r===o?t=void 0:(zo=t,t=o),t!==o&&(r=ba())!==o?(ma(),(e=iu())!==o?(Go=n,n=ee(r,e)):(zo=n,n=o)):(zo=n,n=o),n}function Vu(){var n,t;return n=zo,(t=ea())===o&&(t=ia())===o&&(t=aa())===o&&(t=ca())===o&&(t=sa())===o&&(t=fa())===o&&(t=oa())===o&&(t=ua()),t!==o&&(Go=n,t=oe(t)),n=t}function Wu(){var n;return(n=si())===o&&(n=hi())===o&&(n=ai())===o&&(n=ii())===o&&(n=ui())===o&&(n=Yu())===o&&(n=Xu())===o&&(n=Ku()),n}function Yu(){var n,t;return n=zo,Zi()!==o?(ma(),(t=ci())!==o?(Go=n,n=ue(t)):(zo=n,n=o)):(zo=n,n=o),n}function Ku(){var n,t;return n=zo,zi()!==o?(ma(),(t=ci())!==o?(Go=n,n=ie(t)):(zo=n,n=o)):(zo=n,n=o),n}function Xu(){var t,r,e,u;return t=zo,ra()!==o?(ma(),r=n.charAt(zo),mn.test(r)?zo++:(r=o,0===Wo&&ru(Hn)),r!==o?(ma(),(e=ci())!==o?(ma(),(u=Ju())!==o?(Go=t,t=ae(r,e,u)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o),t===o&&(t=zo,ra()!==o?(ma(),(r=ci())!==o?(ma(),(e=Ju())!==o?(Go=t,t=ce(r,e)):(zo=t,t=o)):(zo=t,t=o)):(zo=t,t=o)),t}function Ju(){var n,t,r;return n=zo,(t=Qu())!==o?(ma(),ta()!==o?(ma(),(r=ni())!==o?(Go=n,n=se(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=ti()),n}function Qu(){var n,t,r;return n=zo,(t=ri())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),Aa()!==o?(Go=n,n=fe(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=ri())!==o&&(Go=n,t=le(t)),n=t),n}function ni(){var n,t,r,e;return n=zo,(t=ri())!==o&&(Go=n,t=pe(t)),(n=t)===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),ha()!==o?(ma(),(e=ei())!==o?(ma(),Aa()!==o?(Go=n,n=ve(r,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),Aa()!==o?(Go=n,n=de(r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o&&(Go=n,t=ye()),n=t))),n}function ti(){var n,t,r,e;return n=zo,(t=ri())!==o?(ma(),ga()!==o?(ma(),(r=ei())!==o?(ma(),Aa()!==o?(Go=n,n=he(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=ri())!==o&&(Go=n,t=ge(t)),(n=t)===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=oi())!==o?(ma(),ha()!==o?(ma(),(e=ei())!==o?(ma(),Aa()!==o?(Go=n,n=Ae(r,e)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o?(ma(),ga()!==o?(ma(),(r=ei())!==o?(ma(),Aa()!==o?(Go=n,n=me(r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n===o&&(n=zo,(t=fa())!==o&&(Go=n,t=Ce()),n=t)))),n}function ri(){var n,t;return n=zo,(t=aa())!==o&&(Go=n,t=be()),(n=t)===o&&(n=zo,(t=ca())!==o&&(Go=n,t=Ee()),(n=t)===o&&(n=zo,(t=sa())!==o&&(Go=n,t=Le()),(n=t)===o&&(n=zo,(t=ia())!==o&&(Go=n,t=Te()),(n=t)===o&&(n=zo,(t=ea())!==o&&(Go=n,t=we()),n=t)))),n}function ei(){var n,t;return n=zo,(t=bi())!==o&&(Go=n,t=xe(t)),n=t}function oi(){var n,t;return n=zo,(t=bi())!==o&&(Go=n,t=Ne(t)),n=t}function ui(){var n,t;return n=zo,ki()!==o?(ma(),(t=ci())!==o?(Go=n,n=Ie(t)):(zo=n,n=o)):(zo=n,n=o),n}function ii(){var n,t;return n=zo,(t=Ti())!==o&&(Go=n,t=Re()),n=t}function ai(){var n,t;return n=zo,(t=wi())!==o&&(Go=n,t=Oe()),(n=t)===o&&(n=zo,(t=xi())!==o&&(Go=n,t=Fe()),n=t),n}function ci(){var n;return(n=si())===o&&(n=Hu()),n}function si(){var t,r,e,u,i;if(t=zo,39===n.charCodeAt(zo)?(r=g,zo++):(r=o,0===Wo&&ru(qn)),r===o&&(n.substr(zo,2)===A?(r=A,zo+=2):(r=o,0===Wo&&ru(Vn))),r!==o){for(e=[],u=zo,n.substr(zo,2)===m?(i=m,zo+=2):(i=o,0===Wo&&ru(Wn)),i!==o&&(Go=u,i=Se()),(u=i)===o&&(u=n.charAt(zo),wn.test(u)?zo++:(u=o,0===Wo&&ru(Yn)));u!==o;)e.push(u),u=zo,n.substr(zo,2)===m?(i=m,zo+=2):(i=o,0===Wo&&ru(Wn)),i!==o&&(Go=u,i=Se()),(u=i)===o&&(u=n.charAt(zo),wn.test(u)?zo++:(u=o,0===Wo&&ru(Yn)));39===n.charCodeAt(zo)?(u=g,zo++):(u=o,0===Wo&&ru(qn)),u!==o?(Go=t,t=Me(e)):(zo=t,t=o)}else zo=t,t=o;return t}function fi(){var n;return(n=li())===o&&(n=pi()),n}function li(){var n,t,r,e,u;if(n=zo,la()!==o)if(ma(),(t=au())!==o){for(ma(),r=[],e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);e!==o;)r.push(e),e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);(e=pa())!==o?(Go=n,n=$e(t,r)):(zo=n,n=o)}else zo=n,n=o;else zo=n,n=o;if(n===o)if(n=zo,la()!==o)if(ma(),(t=au())!==o){for(ma(),r=[],e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);e!==o;)r.push(e),e=zo,(u=di())!==o?(ma(),e=u):(zo=e,e=o);(e=yi())!==o?(u=ma(),pa()!==o?(Go=n,n=Ue(t,r,e)):(zo=n,n=o)):(zo=n,n=o)}else zo=n,n=o;else zo=n,n=o;return n}function pi(){var n,t,r,e;if(n=zo,la()!==o){for(ma(),t=[],r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);r!==o;)t.push(r),r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);(r=pa())!==o?(Go=n,n=_e(t)):(zo=n,n=o)}else zo=n,n=o;if(n===o)if(n=zo,la()!==o){for(ma(),t=[],r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);r!==o;)t.push(r),r=zo,(e=vi())!==o?(ma(),r=e):(zo=r,r=o);(r=yi())!==o?(e=ma(),pa()!==o?(Go=n,n=De(t,r)):(zo=n,n=o)):(zo=n,n=o)}else zo=n,n=o;return n}function vi(){var n,t,r;return n=zo,va()!==o?(ma(),(t=au())!==o?(ma(),da()!==o?(ma(),(r=au())!==o?(Go=n,n=He(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n}function di(){var n,t,r;return n=zo,va()!==o?(ma(),(t=au())!==o?(ma(),da()!==o?(ma(),(r=au())!==o?(Go=n,n=Pe(t,r)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o)):(zo=n,n=o),n}function yi(){var n,t;return n=zo,ya()!==o?(ma(),(t=au())!==o?(Go=n,n=je(t)):(zo=n,n=o)):(zo=n,n=o),n}function hi(){var n,t,r,e;return n=zo,(t=gi())!==o?(r=zo,Wo++,e=Ru(),Wo--,e===o?r=void 0:(zo=r,r=o),r!==o?(Go=n,n=Ze(t)):(zo=n,n=o)):(zo=n,n=o),n}function gi(){var n,t,r,e;return n=zo,(t=Ai())!==o&&(r=mi())!==o&&(e=Ci())!==o?(Go=n,n=ke(t,r,e)):(zo=n,n=o),n===o&&(n=zo,(t=Ai())!==o&&(r=mi())!==o?(Go=n,n=ze(t,r)):(zo=n,n=o),n===o&&(n=zo,(t=Ai())!==o&&(r=Ci())!==o?(Go=n,n=Ge(t,r)):(zo=n,n=o),n===o&&(n=zo,(t=Ai())!==o&&(Go=n,t=Be(t)),n=t))),n}function Ai(){var t,r,e;return(t=bi())===o&&(t=zo,r=n.charAt(zo),mn.test(r)?zo++:(r=o,0===Wo&&ru(Hn)),r!==o&&(e=bi())!==o?(Go=t,t=qe(r,e)):(zo=t,t=o)),t}function mi(){var t,r,e;return t=zo,46===n.charCodeAt(zo)?(r=C,zo++):(r=o,0===Wo&&ru(Kn)),r!==o?((e=bi())===o&&(e=null),Go=t,t=Ve(e)):(zo=t,t=o),t}function Ci(){var n,t,r;return n=zo,(t=Li())!==o&&(r=bi())!==o?(Go=n,n=We(t,r)):(zo=n,n=o),n}function bi(){var n,t,r;if(n=zo,t=[],(r=Ei())!==o)for(;r!==o;)t.push(r),r=Ei();else t=o;return t!==o&&(Go=n,t=Ye(t)),n=t}function Ei(){var t;return t=n.charAt(zo),xn.test(t)?zo++:(t=o,0===Wo&&ru(Xn)),t}function Li(){var t,r,e;return t=zo,r=n.charAt(zo),Nn.test(r)?zo++:(r=o,0===Wo&&ru(Jn)),r!==o?(e=n.charAt(zo),mn.test(e)?zo++:(e=o,0===Wo&&ru(Hn)),e===o&&(e=null),Go=t,t=Ke(r,e)):(zo=t,t=o),t}function Ti(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===b?zo+=4:(r=o,0===Wo&&ru(Qn)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?t=r=[r,e]:(zo=t,t=o)):(zo=t,t=o),t}function wi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===E?zo+=4:(r=o,0===Wo&&ru(nt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?t=r=[r,e]:(zo=t,t=o)):(zo=t,t=o),t}function xi(){var t,r,e,u;return t=zo,(r=n.substr(zo,5)).toLowerCase()===L?zo+=5:(r=o,0===Wo&&ru(tt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?t=r=[r,e]:(zo=t,t=o)):(zo=t,t=o),t}function Ni(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===T?zo+=2:(r=o,0===Wo&&ru(rt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Xe()):(zo=t,t=o)):(zo=t,t=o),t}function Ii(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===w?zo+=2:(r=o,0===Wo&&ru(et)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Je()):(zo=t,t=o)):(zo=t,t=o),t}function Ri(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===x?zo+=4:(r=o,0===Wo&&ru(ot)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Qe()):(zo=t,t=o)):(zo=t,t=o),t}function Oi(){var t,r,e,u;return t=zo,(r=n.substr(zo,6)).toLowerCase()===N?zo+=6:(r=o,0===Wo&&ru(ut)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=no()):(zo=t,t=o)):(zo=t,t=o),t}function Fi(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===I?zo+=3:(r=o,0===Wo&&ru(it)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=to()):(zo=t,t=o)):(zo=t,t=o),t}function Si(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===R?zo+=3:(r=o,0===Wo&&ru(at)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=ro()):(zo=t,t=o)):(zo=t,t=o),t}function Mi(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===O?zo+=2:(r=o,0===Wo&&ru(ct)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=eo()):(zo=t,t=o)):(zo=t,t=o),t}function $i(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===F?zo+=7:(r=o,0===Wo&&ru(st)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=oo()):(zo=t,t=o)):(zo=t,t=o),t}function Ui(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===S?zo+=4:(r=o,0===Wo&&ru(ft)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=uo()):(zo=t,t=o)):(zo=t,t=o),t}function _i(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===M?zo+=3:(r=o,0===Wo&&ru(lt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=io()):(zo=t,t=o)):(zo=t,t=o),t}function Di(){var t,r,e,u;return t=zo,(r=n.substr(zo,9)).toLowerCase()===$?zo+=9:(r=o,0===Wo&&ru(pt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=ao()):(zo=t,t=o)):(zo=t,t=o),t}function Hi(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===U?zo+=7:(r=o,0===Wo&&ru(vt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=co()):(zo=t,t=o)):(zo=t,t=o),t}function Pi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===_?zo+=4:(r=o,0===Wo&&ru(dt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=so()):(zo=t,t=o)):(zo=t,t=o),t}function ji(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===D?zo+=8:(r=o,0===Wo&&ru(yt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=fo()):(zo=t,t=o)):(zo=t,t=o),t}function Zi(){var t,r,e,u;return t=zo,(r=n.substr(zo,9)).toLowerCase()===H?zo+=9:(r=o,0===Wo&&ru(ht)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=lo()):(zo=t,t=o)):(zo=t,t=o),t}function ki(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===P?zo+=4:(r=o,0===Wo&&ru(gt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=po()):(zo=t,t=o)):(zo=t,t=o),t}function zi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===j?zo+=4:(r=o,0===Wo&&ru(At)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=vo()):(zo=t,t=o)):(zo=t,t=o),t}function Gi(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===Z?zo+=7:(r=o,0===Wo&&ru(mt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=yo()):(zo=t,t=o)):(zo=t,t=o),t}function Bi(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===k?zo+=8:(r=o,0===Wo&&ru(Ct)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=ho()):(zo=t,t=o)):(zo=t,t=o),t}function qi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===z?zo+=4:(r=o,0===Wo&&ru(bt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=go()):(zo=t,t=o)):(zo=t,t=o),t}function Vi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===G?zo+=4:(r=o,0===Wo&&ru(Et)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Ao()):(zo=t,t=o)):(zo=t,t=o),t}function Wi(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===B?zo+=2:(r=o,0===Wo&&ru(Lt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=mo()):(zo=t,t=o)):(zo=t,t=o),t}function Yi(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===q?zo+=7:(r=o,0===Wo&&ru(Tt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Co()):(zo=t,t=o)):(zo=t,t=o),t}function Ki(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===V?zo+=3:(r=o,0===Wo&&ru(wt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=bo()):(zo=t,t=o)):(zo=t,t=o),t}function Xi(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===W?zo+=8:(r=o,0===Wo&&ru(xt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Eo()):(zo=t,t=o)):(zo=t,t=o),t}function Ji(){var t,r,e,u;return t=zo,(r=n.substr(zo,5)).toLowerCase()===Y?zo+=5:(r=o,0===Wo&&ru(Nt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Lo()):(zo=t,t=o)):(zo=t,t=o),t}function Qi(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===K?zo+=4:(r=o,0===Wo&&ru(It)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=To()):(zo=t,t=o)):(zo=t,t=o),t}function na(){var t,r,e,u;return t=zo,(r=n.substr(zo,7)).toLowerCase()===X?zo+=7:(r=o,0===Wo&&ru(Rt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=wo()):(zo=t,t=o)):(zo=t,t=o),t}function ta(){var t,r,e,u;return t=zo,(r=n.substr(zo,2)).toLowerCase()===J?zo+=2:(r=o,0===Wo&&ru(Ot)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=xo()):(zo=t,t=o)):(zo=t,t=o),t}function ra(){var t,r,e,u;return t=zo,(r=n.substr(zo,8)).toLowerCase()===Q?zo+=8:(r=o,0===Wo&&ru(Ft)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=No()):(zo=t,t=o)):(zo=t,t=o),t}function ea(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===nn?zo+=4:(r=o,0===Wo&&ru(St)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Io()):(zo=t,t=o)):(zo=t,t=o),t}function oa(){var t,r,e,u;return t=zo,(r=n.substr(zo,13)).toLowerCase()===tn?zo+=13:(r=o,0===Wo&&ru(Mt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Ro()):(zo=t,t=o)):(zo=t,t=o),t}function ua(){var t,r,e,u;return t=zo,(r=n.substr(zo,15)).toLowerCase()===rn?zo+=15:(r=o,0===Wo&&ru($t)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Oo()):(zo=t,t=o)):(zo=t,t=o),t}function ia(){var t,r,e,u;return t=zo,(r=n.substr(zo,5)).toLowerCase()===en?zo+=5:(r=o,0===Wo&&ru(Ut)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Fo()):(zo=t,t=o)):(zo=t,t=o),t}function aa(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===on?zo+=3:(r=o,0===Wo&&ru(_t)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=So()):(zo=t,t=o)):(zo=t,t=o),t}function ca(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===un?zo+=4:(r=o,0===Wo&&ru(Dt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Mo()):(zo=t,t=o)):(zo=t,t=o),t}function sa(){var t,r,e,u;return t=zo,(r=n.substr(zo,6)).toLowerCase()===an?zo+=6:(r=o,0===Wo&&ru(Ht)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=$o()):(zo=t,t=o)):(zo=t,t=o),t}function fa(){var t,r,e,u;return t=zo,(r=n.substr(zo,6)).toLowerCase()===cn?zo+=6:(r=o,0===Wo&&ru(Pt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Uo()):(zo=t,t=o)):(zo=t,t=o),t}function la(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===sn?zo+=4:(r=o,0===Wo&&ru(jt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=_o()):(zo=t,t=o)):(zo=t,t=o),t}function pa(){var t,r,e,u;return t=zo,(r=n.substr(zo,3)).toLowerCase()===fn?zo+=3:(r=o,0===Wo&&ru(Zt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Do()):(zo=t,t=o)):(zo=t,t=o),t}function va(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===ln?zo+=4:(r=o,0===Wo&&ru(kt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Ho()):(zo=t,t=o)):(zo=t,t=o),t}function da(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===pn?zo+=4:(r=o,0===Wo&&ru(zt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=Po()):(zo=t,t=o)):(zo=t,t=o),t}function ya(){var t,r,e,u;return t=zo,(r=n.substr(zo,4)).toLowerCase()===vn?zo+=4:(r=o,0===Wo&&ru(Gt)),r!==o?(e=zo,Wo++,u=Ou(),Wo--,u===o?e=void 0:(zo=e,e=o),e!==o?(Go=t,t=jo()):(zo=t,t=o)):(zo=t,t=o),t}function ha(){var t;return 44===n.charCodeAt(zo)?(t=dn,zo++):(t=o,0===Wo&&ru(Bt)),t}function ga(){var t;return 40===n.charCodeAt(zo)?(t=yn,zo++):(t=o,0===Wo&&ru(qt)),t}function Aa(){var t;return 41===n.charCodeAt(zo)?(t=hn,zo++):(t=o,0===Wo&&ru(Vt)),t}function ma(){var n,t;for(n=[],t=Ca();t!==o;)n.push(t),t=Ca();return n}function Ca(){var t;return t=n.charAt(zo),In.test(t)?zo++:(t=o,0===Wo&&ru(Wt)),t}function ba(){var t,r,e,u;if(t=zo,(r=Iu())!==o&&(Go=t,r=Zo(r)),(t=r)===o)if(t=zo,96===n.charCodeAt(zo)?(r=gn,zo++):(r=o,0===Wo&&ru(Yt)),r!==o){if(e=[],u=n.charAt(zo),Rn.test(u)?zo++:(u=o,0===Wo&&ru(Kt)),u!==o)for(;u!==o;)e.push(u),u=n.charAt(zo),Rn.test(u)?zo++:(u=o,0===Wo&&ru(Kt));else e=o;e!==o?(96===n.charCodeAt(zo)?(u=gn,zo++):(u=o,0===Wo&&ru(Yt)),u!==o?(Go=t,t=ko(e)):(zo=t,t=o)):(zo=t,t=o)}else zo=t,t=o;return t}function Ea(n,t,r){return{type:"unary-expression",location:r,operator:n,expr:t}}function La(n,t,r,e,o){const u={type:"binary-expression",location:o,operator:n,left:t,right:r};return void 0!==e&&(u.escape=e),u}function Ta(n,...t){return{type:"expression-list",location:n,value:t}}function wa(n,t){let r=n;for(const{op:e,expr:o,location:{end:u}}of t)r=La(e,r,o,void 0,{...r.location,end:u});return r}function xa(n){!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(n)&&Ko("Timestamp literal is invalid")}function Na(n){!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(n)&&Ko("Time literal is invalid")}function Ia(n){!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(n)&&Ko("Date literal is invalid")}if(e=a(),r.peg$library)return{peg$result:e,peg$currPos:zo,peg$FAILED:o,peg$maxFailExpected:Vo,peg$maxFailPos:qo};if(e!==o&&zo===n.length)return e;throw e!==o&&zo<n.length&&ru(Qo()),ou(Vo,qo<n.length?n.charAt(qo):null,qo<n.length?tu(qo,qo+1):tu(qo,qo))}n(t,Error),t.prototype.format=function(n){var t="Error: "+this.message;if(this.location){var e,o=null;for(e=0;e<n.length;e++)if(n[e].source===this.location.source){o=n[e].text.split(/\r\n|\n|\r/g);break}var u=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(u):u,a=this.location.source+":"+i.line+":"+i.column;if(o){var c=this.location.end,s=r("",i.line.toString().length," "),f=o[u.line-1],l=(u.line===c.line?c.column:f.length+1)-u.column||1;t+="\n --\x3e "+a+"\n"+s+" |\n"+i.line+" | "+f+"\n"+s+" | "+r("",u.column-1," ")+r("",l,"^")}else t+="\n at "+a}return t},t.buildMessage=function(n,t){var r={literal:function(n){return'"'+o(n.text)+'"'},class:function(n){var t=n.parts.map((function(n){return Array.isArray(n)?u(n[0])+"-"+u(n[1]):u(n)}));return"["+(n.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(n){return n.description}};function e(n){return n.charCodeAt(0).toString(16).toUpperCase()}function o(n){return n.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(n){return"\\x0"+e(n)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(n){return"\\x"+e(n)}))}function u(n){return n.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(n){return"\\x0"+e(n)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(n){return"\\x"+e(n)}))}function i(n){return r[n.type](n)}function a(n){var t,r,e=n.map(i);if(e.sort(),e.length>0){for(t=1,r=1;t<e.length;t++)e[t-1]!==e[t]&&(e[r]=e[t],r++);e.length=r}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}function c(n){return n?'"'+o(n)+'"':"end of input"}return"Expected "+a(n)+" but "+c(t)+" found."};class o{static parse(n){return e(n)}}function u(n,t){if(null!=n)switch(t(n),n.type){case"when-clause":u(n.operand,t),u(n.value,t);break;case"case-expression":for(const r of n.clauses)u(r,t);"simple"===n.format&&u(n.operand,t),null!==n.else&&u(n.else,t);break;case"expression-list":for(const r of n.value)u(r,t);break;case"unary-expression":u(n.expr,t);break;case"binary-expression":u(n.left,t),u(n.right,t);break;case"function":u(n.args,t);break;case"interval":u(n.value,t),u(n.qualifier,t);break;case"interval-qualifier":u(n.start,t),u(n.end,t)}}export{o as WhereGrammar,u as visitAll};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{SqlError as r,SqlErrorCodes as e}from"./errorSupport.js";import{isDateTime as t,isTimestampOffset as n,isDateOnly as i,isTimeOnly as o}from"./sqlDateParsingUtils.js";import{SqlTimeStampOffset as a}from"./SqlTimestampOffset.js";import{isUnknownTimeZone as s}from"./UnknownTimeZone.js";import{isNumber as u,isString as f}from"../../support/guards.js";import{DateTime as c}from"luxon";const l=321408e5,w=26784e5,
|
|
5
|
+
import{SqlError as r,SqlErrorCodes as e}from"./errorSupport.js";import{isDateTime as t,isTimestampOffset as n,isDateOnly as i,isTimeOnly as o}from"./sqlDateParsingUtils.js";import{SqlTimeStampOffset as a}from"./SqlTimestampOffset.js";import{isUnknownTimeZone as s}from"./UnknownTimeZone.js";import{isNumber as u,isString as f}from"../../support/guards.js";import{DateTime as c}from"luxon";const l=321408e5,w=26784e5,m=864e5,p=36e5,d=6e4;function h(r){return!!t(r)||!!n(r)}function O(r){return!!t(r)||(!!i(r)||(!!n(r)||!!o(r)))}function v(o){if(t(o))return o.toMillis();if(i(o))return o.toNumber();if(n(o))return o.toMilliseconds();throw new r(e.InvalidDataType)}function I(l,w,m,p){if(null==l||null==w)return null;if(u(l)){if(u(w))return T(l,w,m);if(f(w))return D(l,w,m);if(O(w))throw new r(e.InvalidOperator);if(i(w))throw new r(e.InvalidOperator)}else if(f(l)){if(u(w))return M(l,w,m);if(f(w))return z(l,w,m);if(t(w))throw new r(e.InvalidOperator);if(i(w))throw new r(e.InvalidOperator);if(o(w))throw new r(e.InvalidOperator);if(n(w))throw new r(e.InvalidOperator)}else if(t(l)){if(h(w)){if(s(l.zone)){if(c.isDateTime(w)&&!s(w.zone))return j(l,w,m);if(a.isTimestampOffset(w))return j(l,w,m)}else if(c.isDateTime(w)&&s(w.zone)){if(!s(l.zone))return j(l,w,m);if(a.isTimestampOffset(l))return j(l,w,m)}return T(v(l),v(w),m)}if(f(w))throw new r(e.InvalidOperator);if(i(w))return N(l,w,m);if(o(w))throw new r(e.InvalidOperator);if(u(w))throw new r(e.InvalidOperator)}else if(i(l)){if(n(w))return b(l,w,m);if(t(w))return x(l,w,m);if(f(w))throw new r(e.InvalidOperator);if(i(w))return T(l.toNumber(),w.toNumber(),m);if(o(w))throw new r(e.InvalidOperator);if(u(w))throw new r(e.InvalidOperator)}else if(o(l)){if(o(w))return T(l.toNumber(),w.toNumber(),m);if(f(w))throw new r(e.InvalidOperator);if(u(w))throw new r(e.InvalidOperator);if(i(w))throw new r(e.InvalidOperator);if(h(w))throw new r(e.InvalidOperator)}else if(n(l)){if(h(w))return c.isDateTime(w)&&s(w.zone)?j(l,w,m):T(v(l),v(w),m);if(f(w))throw new r(e.InvalidOperator);if(i(w))return y(l,w,m);if(o(w))throw new r(e.InvalidOperator);if(u(w))throw new r(e.InvalidOperator)}switch(m){case"<>":return l!==w;case"=":return l===w;case">":return l>w;case"<":return l<w;case">=":return l>=w;case"<=":return l<=w}}function T(r,e,t){switch(t){case"<>":return r!==e;case"=":return r===e;case">":return r>e;case"<":return r<e;case">=":return r>=e;case"<=":return r<=e}}function D(r,e,t){const n=parseFloat(e);if(!isNaN(n))return T(r,n,t);const i=r.toString();switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i<e;case">=":return i>=e;case"<=":return i<=e}}function M(r,e,t){const n=parseFloat(r);if(!isNaN(n))return T(n,e,t);const i=e.toString();switch(t){case"<>":return r!==i;case"=":return r===i;case">":return r>i;case"<":return r<i;case">=":return r>=i;case"<=":return r<=i}}function z(r,e,t){switch(t){case"<>":return r!==e;case"=":return r===e;case">":return r>e;case"<":return r<e;case">=":return r>=e;case"<=":return r<=e}}function N(r,e,t){const n=e.toDateTimeLuxon(r.zone);return T((r=r.startOf("day")).toMillis(),n.toMillis(),t)}function y(r,e,t){const n=e.toDateTimeLuxon(r.toDateTime().zone);return T((r=r.startOfDay()).toMilliseconds(),n.toMillis(),t)}function x(r,e,t){const n=r.toDateTimeLuxon(e.zone);return e=e.startOf("day"),T(n.toMillis(),e.toMillis(),t)}function b(r,e,t){const n=r.toDateTimeLuxon(e.toDateTime().zone);return e=e.startOfDay(),T(n.toMillis(),e.toMilliseconds(),t)}function j(r,e,t){a.isTimestampOffset(r)&&(r=r.toDateTime()),a.isTimestampOffset(e)&&(e=e.toDateTime());const n=g(r),i=g(e);switch(t){case"<>":return n!==i;case"=":return n===i;case">":return n>i;case"<":return n<i;case">=":return n>=i;case"<=":return n<=i}}function g(r){return r.year*l+r.month*w+r.day*m+r.hour*p+r.minute*d+1e3*r.second+r.millisecond}export{v as dateValueInMilliseconds,O as isDateOrTimeValue,h as isDateTimeComparableValue,I as sqlCompare};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{DateOnly as n}from"./DateOnly.js";import{SqlError as e,SqlErrorCodes as t}from"./errorSupport.js";import{SqlInterval as r}from"./SqlInterval.js";import{SqlTimeStampOffset as a}from"./SqlTimestampOffset.js";import{TimeOnly as s}from"./TimeOnly.js";import{UnknownTimeZone as
|
|
5
|
+
import{DateOnly as n}from"./DateOnly.js";import{SqlError as e,SqlErrorCodes as t}from"./errorSupport.js";import{SqlInterval as r}from"./SqlInterval.js";import{SqlTimeStampOffset as a}from"./SqlTimestampOffset.js";import{TimeOnly as s}from"./TimeOnly.js";import{UnknownTimeZone as i,substituteUnknownTimezone as o}from"./UnknownTimeZone.js";import{Zone as l,DateTime as p}from"luxon";const d=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,m=/^(\d{1,2}):(\d{1,2})$/,I=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,f=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,u=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,c=/^(\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})$/,w=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,h=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function T(n,e){if(e instanceof l)return e===i.instance?p.fromMillis(n.getTime(),{zone:i.instance}):p.fromJSDate(n,{zone:e});switch(e){case"system":case"local":case null:return p.fromJSDate(n);default:return"unknown"===e?.toLowerCase()?p.fromMillis(n.getTime(),{zone:i.instance}):p.fromJSDate(n,{zone:e})}}function v(n){return r.isInterval(n)}function y(n){return p.isDateTime(n)}function S(e){return n.isDateOnly(e)}function x(n){return s.isTimeOnly(n)}function j(n){return a.isTimestampOffset(n)}function O(n){let r=d.exec(n);if(null!==r){const[,n,a,i]=r,o=s.fromParts(parseInt(n,10),parseInt(a,10),parseInt(i,10),0);if(null!==o)return o;throw new e(t.InvalidTime)}if(r=m.exec(n),null!==r){const[,n,a]=r,i=s.fromParts(parseInt(n,10),parseInt(a,10),0,0);if(null!==i)return i;throw new e(t.InvalidTime)}if(r=I.exec(n),null!==r){const[,n,a,i,o]=r,l=s.fromParts(parseInt(n,10),parseInt(a,10),parseInt(i,10),parseInt(o,10));if(null!==l)return l;throw new e(t.InvalidTime)}throw new e(t.InvalidTime)}function D(n,r,s=!1){let i=u.exec(n);if(null!==i){const[,n,a,s,l,d,m,I]=i,f=p.fromObject({year:parseInt(n,10),month:parseInt(a,10),day:parseInt(s,10),hour:parseInt(l,10),minute:parseInt(d,10),second:parseInt(m,10),millisecond:I?parseInt(I.replace(".",""),10):0},{zone:o(r)});if(!1===f.isValid)throw new e(t.InvalidTimeStamp);return f}if(i=c.exec(n),null!==i){const[,n,r,s,o,l,p,d,m,I,f]=i,u=a.fromParts(parseInt(n,10),parseInt(r,10),parseInt(s,10),parseInt(o,10),parseInt(l,10),parseInt(p,10),d?parseInt(d.replace(".",""),10):0,"-"===m,parseInt(I,10),parseInt(f,10));if(!1===u.isValid)throw new e(t.InvalidTimeStamp);return u}if(i=w.exec(n),null!==i){const[,n,r,s,o,l,p,d,m]=i,I=a.fromParts(parseInt(n,10),parseInt(r,10),parseInt(s,10),parseInt(o,10),parseInt(l,10),0,0,"-"===p,parseInt(d,10),parseInt(m,10));if(!1===I.isValid)throw new e(t.InvalidTimeStamp);return I}if(i=h.exec(n),null!==i){const[,n,a,s,l,d]=i,m=p.fromObject({year:parseInt(n,10),month:parseInt(a,10),day:parseInt(s,10),hour:parseInt(l,10),minute:parseInt(d,10),second:0},{zone:o(r)});if(!1===m.isValid)throw new e(t.InvalidTimeStamp);return m}if(i=f.exec(n),null!==i){const[,n,a,s]=i,l=p.fromObject({year:parseInt(n,10),month:parseInt(a,10),day:parseInt(s,10),hour:0,minute:0,second:0},{zone:o(r)});if(!1===l.isValid)throw new e(t.InvalidTimeStamp);return l}throw new e(t.InvalidTimeStamp)}function $(r,a){const s=f.exec(r);if(null===s)try{return D(r,a)}catch{throw new e(t.InvalidDate)}const[,i,o,l]=s,p=n.fromParts(parseInt(i,10),parseInt(o,10),parseInt(l,10));if(null===p)throw new e(t.InvalidDate);return p}export{T as convertToExecutingTimeZone,S as isDateOnly,y as isDateTime,v as isSqlInterval,x as isTimeOnly,j as isTimestampOffset,$ as parseDate,O as parseTime,D as parseTimestamp};
|