@arcgis/coding-components 4.31.0-next.4 → 4.31.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  2. package/dist/arcgis-coding-components/index.esm.js +2 -2
  3. package/dist/arcgis-coding-components/{p-4e56f8ae.js → p-022df536.js} +1 -1
  4. package/dist/arcgis-coding-components/{p-8e93417c.js → p-10cab8d9.js} +2 -2
  5. package/dist/arcgis-coding-components/{p-5da03560.js → p-14ab3ed5.js} +1 -1
  6. package/dist/arcgis-coding-components/{p-26c67f7c.js → p-19b4f0e9.js} +2 -2
  7. package/dist/arcgis-coding-components/{p-e6cac921.entry.js → p-1baf3624.entry.js} +2 -2
  8. package/dist/arcgis-coding-components/{p-86625411.js → p-2a7ef2fd.js} +2 -2
  9. package/dist/arcgis-coding-components/{p-8d67b196.js → p-38534c31.js} +2 -2
  10. package/dist/arcgis-coding-components/{p-ab0f6db7.js → p-41c932b5.js} +2 -2
  11. package/dist/arcgis-coding-components/{p-736d890c.js → p-8c6a6176.js} +2 -2
  12. package/dist/arcgis-coding-components/{p-a256ee9c.js → p-8e61744c.js} +10 -10
  13. package/dist/arcgis-coding-components/{p-b23a3f4e.entry.js → p-933de2b5.entry.js} +2 -2
  14. package/dist/arcgis-coding-components/{p-103bdac3.js → p-9dfc06ea.js} +2 -2
  15. package/dist/arcgis-coding-components/{p-a36c357f.js → p-a536144e.js} +2 -2
  16. package/dist/arcgis-coding-components/p-cd67026d.js +6 -0
  17. package/dist/arcgis-coding-components/{p-5e173b51.entry.js → p-d7e83ea1.entry.js} +2 -2
  18. package/dist/arcgis-coding-components/{p-374b59c1.js → p-e055c041.js} +2 -2
  19. package/dist/arcgis-coding-components/{p-b570d7af.js → p-e11999af.js} +2 -2
  20. package/dist/arcgis-coding-components/{p-2d14950e.js → p-f1fab45e.js} +1 -1
  21. package/dist/cjs/{app-globals-209c2310.js → app-globals-8991f48d.js} +1 -1
  22. package/dist/cjs/{arcade-defaults-ee308e3a.js → arcade-defaults-2d36c400.js} +4 -4
  23. package/dist/cjs/{arcade-mode-f2c3951e.js → arcade-mode-ee5f5a57.js} +3 -3
  24. package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +6 -6
  25. package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
  26. package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
  27. package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
  28. package/dist/cjs/{css-bbd000cd.js → css-c0ad88d7.js} +1 -1
  29. package/dist/cjs/{cssMode-ad163e66.js → cssMode-deeb6f90.js} +3 -3
  30. package/dist/cjs/{html-5c67b9d0.js → html-be08d94a.js} +3 -3
  31. package/dist/cjs/{htmlMode-e32a97bd.js → htmlMode-f5b8239a.js} +3 -3
  32. package/dist/cjs/{index-8b891c40.js → index-358de60d.js} +1 -1
  33. package/dist/cjs/index.cjs.js +4 -4
  34. package/dist/cjs/{javascript-e159fa2f.js → javascript-37d3d13f.js} +4 -4
  35. package/dist/cjs/{jsonMode-5c107443.js → jsonMode-12a2a091.js} +3 -3
  36. package/dist/cjs/{language-defaults-base-4300e691.js → language-defaults-base-1f082ad7.js} +30 -46
  37. package/dist/cjs/loader.cjs.js +3 -3
  38. package/dist/cjs/{sql-expr-defaults-783d9c24.js → sql-expr-defaults-dca57c68.js} +13 -18
  39. package/dist/cjs/{sql-expr-mode-6cac37ed.js → sql-expr-mode-c644220d.js} +4 -4
  40. package/dist/cjs/{tsMode-83c4587f.js → tsMode-d33a7021.js} +3 -3
  41. package/dist/cjs/{typescript-f6ca5d84.js → typescript-f3be2ce7.js} +3 -3
  42. package/dist/components/arcade-defaults.js +1 -1
  43. package/dist/components/arcade-mode.js +1 -1
  44. package/dist/components/arcade-results.js +2 -2
  45. package/dist/components/arcade-suggestions.js +2 -2
  46. package/dist/components/arcade-variables.js +2 -2
  47. package/dist/components/arcgis-arcade-editor.js +2 -2
  48. package/dist/components/arcgis-arcade-results.js +1 -1
  49. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  50. package/dist/components/arcgis-arcade-variables.js +1 -1
  51. package/dist/components/arcgis-assets.d.ts +1 -1
  52. package/dist/components/arcgis-assets.js +1 -1
  53. package/dist/components/arcgis-code-editor.js +1 -1
  54. package/dist/components/arcgis-language-api-panel.js +1 -1
  55. package/dist/components/arcgis-sql-expression-editor.js +2 -2
  56. package/dist/components/arcgis-sql-expression-fields.js +1 -1
  57. package/dist/components/{chunk-6TARY3NN.js → chunk-3IUJHIAA.js} +11 -16
  58. package/dist/components/code-editor.js +2 -2
  59. package/dist/components/fields.js +1 -1
  60. package/dist/components/index.js +1 -1
  61. package/dist/components/index2.js +1 -1
  62. package/dist/components/language-api-panel.js +2 -2
  63. package/dist/components/language-defaults-base.js +21 -37
  64. package/dist/components/markdown.js +1 -1
  65. package/dist/components/sql-expr-defaults.js +1 -1
  66. package/dist/components/sql-expr-mode.js +1 -1
  67. package/dist/components/sql-expression-fields.js +2 -2
  68. package/dist/components/useT9n.js +2 -2
  69. package/dist/components/utilities.js +1 -1
  70. package/dist/esm/{app-globals-60a61d0d.js → app-globals-3e4e0353.js} +1 -1
  71. package/dist/esm/{arcade-defaults-b1a5f013.js → arcade-defaults-1adb5004.js} +4 -4
  72. package/dist/esm/{arcade-mode-7e6764ac.js → arcade-mode-4a83348d.js} +3 -3
  73. package/dist/esm/arcgis-arcade-editor_6.entry.js +6 -6
  74. package/dist/esm/arcgis-coding-components.js +4 -4
  75. package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
  76. package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
  77. package/dist/esm/{css-7d75b7ca.js → css-bad8d1c3.js} +1 -1
  78. package/dist/esm/{cssMode-95305ae2.js → cssMode-68a5f601.js} +3 -3
  79. package/dist/esm/{html-84fc596c.js → html-9b27df1a.js} +3 -3
  80. package/dist/esm/{htmlMode-c961f619.js → htmlMode-361ad282.js} +3 -3
  81. package/dist/esm/{index-1c1754c0.js → index-8a552796.js} +1 -1
  82. package/dist/esm/index.js +4 -4
  83. package/dist/esm/{javascript-0aa4505f.js → javascript-8004e14f.js} +4 -4
  84. package/dist/esm/{jsonMode-86b234eb.js → jsonMode-91a0be74.js} +3 -3
  85. package/dist/esm/{language-defaults-base-949fa7fb.js → language-defaults-base-df906b3d.js} +30 -46
  86. package/dist/esm/loader.js +4 -4
  87. package/dist/esm/{sql-expr-defaults-f2f50289.js → sql-expr-defaults-ae0be602.js} +13 -18
  88. package/dist/esm/{sql-expr-mode-14c94be3.js → sql-expr-mode-1821b2b9.js} +4 -4
  89. package/dist/esm/{tsMode-ee945c40.js → tsMode-2756c213.js} +3 -3
  90. package/dist/esm/{typescript-8bd2bb48.js → typescript-1aaf3ddd.js} +3 -3
  91. package/dist/loader/cdn.js +1 -1
  92. package/dist/loader/index.cjs.js +1 -1
  93. package/dist/loader/index.es2017.js +1 -1
  94. package/dist/loader/index.js +1 -1
  95. package/dist/types/components/arcade-editor/arcade-editor.d.ts +1 -1
  96. package/dist/types/components/arcade-results/arcade-results.d.ts +1 -1
  97. package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +1 -1
  98. package/dist/types/components/arcade-variables/arcade-variables.d.ts +1 -1
  99. package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -1
  100. package/dist/types/utils/profile/types.d.ts +29 -69
  101. package/dist/types/utils/profile/utils.d.ts +4 -7
  102. package/package.json +10 -10
  103. package/dist/arcgis-coding-components/p-de5cabbb.js +0 -6
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
- * v4.31.0-next.4
4
+ * v4.31.0-next.6
5
5
  */
6
- import{e,u as n,M as t}from"./p-a256ee9c.js";import{s as r}from"./p-de5cabbb.js";import"./p-2d14950e.js";class i{constructor(e){this._defaults=e,this._worker=null,this._client=null}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _getClientProxy(){if(!this._client){const{languageId:n}=this._defaults;this._worker=e.createWebWorker({moduleId:"SqlExprWorker",label:n,createData:{languageId:n}}),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const n=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),n}}const u={current_date:{description:"Returns the current date in UTC.",parameters:[],returnValue:"Datetime",examples:[{description:"Returns the current date in UTC.",code:"CURRENT_DATE()"}],snippet:["CURRENT_DATE()","CURRENT_DATE"],name:"CURRENT_DATE()",bundle:"Date"},current_time:{description:"Returns the current UTC date and time in hours, minutes, and seconds.",parameters:[],returnValue:"Datetime",examples:[{description:"Returns the current UTC date and time in hours, minutes, and seconds.",code:"CURRENT_TIME()"}],snippet:["CURRENT_TIME()","CURRENT_TIME"],name:"CURRENT_TIME()",bundle:"Date"},current_timestamp:{description:"Returns the current UTC date and time in hours, minutes, seconds, and milliseconds.",parameters:[],returnValue:"Datetime",examples:[{description:"Returns the current UTC date and time in hours, minutes, seconds, and milliseconds.",code:"CURRENT_TIMESTAMP()"}],snippet:["CURRENT_TIMESTAMP()","CURRENT_TIMESTAMP"],name:"CURRENT_TIMESTAMP()",bundle:"Date"},extract:{description:"Returns a single part of a datetime, such as year, month, day, hour, minute, or second.",parameters:[{name:"part",type:["YEAR","MONTH","DAY","HOUR","MINUTE","SECOND"],description:"The part to extract from the date."},{name:"datetime",type:"Datetime",description:"The date to extract a part from."}],returnValue:"Number",examples:[{description:"Returns 12",code:"EXTRACT(MONTH FROM '12/21/2016')"},{description:"Returns 21",code:"EXTRACT(DAY FROM '12/21/2016 12:00')"},{description:"Returns 30",code:"EXTRACT(MINUTE FROM '12/21/2016 15:30')"}],snippet:"EXTRACT(${1} FROM ${2})",name:"EXTRACT()",bundle:"Date"}},s={description:"Returns the absolute value of the number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 2",code:"ABS(-2)"}],snippet:"ABS(${1})",name:"ABS()",bundle:"Numeric"},o={abs:s,acos:{description:"Returns the arc cosine of a number. If the number is not between -1 and 1 the function will return `NULL`.",parameters:[{name:"number",type:"Number",description:"A number between -1 and 1 on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 1.266104",code:"ACOS(0.3)"}],snippet:"ACOS(${1})",name:"ACOS()",bundle:"Numeric"},asin:s,atan:{description:"Returns the arc tangent of a number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 0.785398",code:"ATAN(1)"}],snippet:"ATAN(${1})",name:"ATAN()",bundle:"Numeric"},cast:{description:"Converts a value from one data type to another. The dataType parameter will determine what type the value is converted to. FLOAT converts the value to a double, INTEGER converts the value to an integer, etc.",parameters:[{name:"value",type:"Number",description:"The value to convert to another data type."},{name:"dataType",type:["DATE","FLOAT","INTEGER","REAL","SMALLINT","TIME","TIMESTAMP","VARCHAR"],description:"The data type to convert the value to."}],returnValue:["Number","Datetime","String"],examples:[{description:"Returns 2",code:"CAST(2.34 AS INT)"},{description:"Returns '1:00 PM'",code:"CAST('13:00' AS TIME)"},{description:"Returns 50",code:"CAST(50 AS VARCHAR(20))"}],snippet:"CAST(${1} AS ${2})",name:"CAST()",bundle:"Numeric"},ceiling:{description:"Returns the smallest integer greater than or equal to the number.",parameters:[{name:"number",type:"Number",description:"The number to round upward."}],returnValue:"Number",examples:[{description:"Returns 235",code:"CEILING(234.042)"}],snippet:"CEILING(${1})",name:"CEILING()",bundle:"Numeric"},cos:{description:"Returns the trigonometric cosine of the number, which is assumed to be an angle in radians.",parameters:[{name:"number",type:"Number",description:"An angle in radians on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns -0.416147",code:"COS(2)"}],snippet:"COS(${1})",name:"COS()",bundle:"Numeric"},floor:{description:"Returns the largest integer that is less than or equal to the number.",parameters:[{name:"number",type:"Number",description:"The number to round downward."}],returnValue:"Number",examples:[{description:"Returns 12",code:"FLOOR(12.9942)"}],snippet:"FLOOR(${1})",name:"FLOOR()",bundle:"Numeric"},log:{description:"Returns the natural logarithm (base e) of the number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 2.302585",code:"LOG(10)"}],snippet:"LOG(${1})",name:"LOG()",bundle:"Numeric"},log10:{description:"Returns the base-10 logarithm of the number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation that is greater than 0."}],returnValue:"Number",examples:[{description:"Returns 0.301030",code:"LOG10(2)"}],snippet:"LOG10(${1})",name:"LOG10()",bundle:"Numeric"},mod:{description:"Returns the remainder after dividing a dividend by a divisor. Both the divindend and divisor must be integers.",parameters:[{name:"x",type:"Number",description:"The number representing the dividend."},{name:"y",type:"Number",description:"The number representing the divisor."}],returnValue:"Number",examples:[{description:"Returns 2",code:"MOD(18, 4)"}],snippet:"MOD(${1}, ${2})",name:"MOD()",bundle:"Numeric"},nullif:{description:"Returns `NULL` if expression1 is equal to expression2. NULLIF is commonly used to prevent divide-by-zero errors by setting expression2 to 0.",parameters:[{name:"expression1",type:["Number","String","Datetime"],description:"A value on which to perform the operation."},{name:"expression2",type:["Number","String","Datetime"],description:"A value on which to perform the operation."}],returnValue:["Number","String","Datetime"],examples:[{description:"Returns `null`",code:"NULLIF(25, 25)"},{description:"Returns 32",code:"NULLIF(32, 0)"},{description:"Returns `null` if POP18 is equal to 0, otherwise, returns the value of TOTALPOP / POP18.",code:"TOTALPOP / NULLIF(POP18, 0)"}],snippet:"NULLIF(${1}, ${2})",name:"NULLIF()",bundle:"Numeric"},power:{description:"Returns the value of the number raised to the specified power.",parameters:[{name:"x",type:"Number",description:"The number on which to perform the operation."},{name:"y",type:"Number",description:"The exponent indicating the number of times to multiply the number by itself."}],returnValue:"Number",examples:[{description:"Returns 8",code:"POWER(2, 3)"}],snippet:"POWER(${1}, ${2})",name:"POWER()",bundle:"Numeric"},round:{description:"Rounds the number to the specified length.",parameters:[{name:"number",type:"Number",description:"The number to round."},{name:"length",type:"Number",description:"The number of decimal places to round the number to. A positive length rounds the number to the specified decimal place. A negative length will round the number to the left of the decimal point."}],returnValue:"Number",examples:[{description:"Returns 3.98",code:"ROUND(3.98024, 2)"},{description:"Returns 200",code:"ROUND(192.1, -2)"}],snippet:"ROUND(${1}, ${2})",name:"ROUND()",bundle:"Numeric"},sign:{description:"Returns the sign of a given number. A negative number will return -1. A positive number will return 1.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns -1",code:"SIGN(-132)"},{description:"Returns 0",code:"SIGN(0)"},{description:"Returns 1",code:"SIGN(42)"}],snippet:"SIGN(${1})",name:"SIGN()",bundle:"Numeric"},sin:{description:"Returns the trigonometric sine of the number, which is assumed to be an angle in radians.",parameters:[{name:"number",type:"Number",description:"An angle in radians on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 0.841471",code:"SIN(1)"}],snippet:"SIN(${1})",name:"SIN()",bundle:"Numeric"},tan:{description:"Returns the tangent of a number, which is assumed to be an angle in radians.",parameters:[{name:"number",type:"Number",description:"An angle in radians on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 2.572152",code:"TAN(1.2)"}],snippet:"TAN(${1})",name:"TAN()",bundle:"Numeric"},truncate:{description:"Returns a truncated number.",parameters:[{name:"number",type:"Number",description:"A number to truncate."},{name:"decimals",type:"Number",description:"A positive value truncates the number to the specified decimal place. A negative value truncates the number to the left of the decimal point."}],returnValue:"Number",examples:[{description:"Returns 91.3",code:"TRUNCATE(91.367, 1)"},{description:"Returns 124",code:"TRUNCATE(124.45, 0)"},{description:"Returns 1900",code:"TRUNCATE(1982.83,-2)"}],snippet:"TRUNCATE(${1}, ${2})",name:"TRUNCATE()",bundle:"Numeric"}};var a={};function c(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(i=function(e){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?i:String(i)),r)}var i}function l(e,n,t){return n&&c(e.prototype,n),t&&c(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)}function d(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,m(e,n)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function m(e,n){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},m(e,n)}function E(e,n,t){return E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,n,t){var r=[null];r.push.apply(r,n);var i=new(Function.bind.apply(e,r));return t&&m(i,t.prototype),i},E.apply(null,arguments)}function T(e){var n="function"==typeof Map?new Map:void 0;return T=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return E(e,arguments,h(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),m(t,e)},T(e)}function v(e,n){if(null==e)return{};var t,r,i={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(i[t]=e[t]);return i}function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function N(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?p(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(a,"__esModule",{value:!0});var y=function(e){function n(){return e.apply(this,arguments)||this}return d(n,e),n}(T(Error)),R=function(e){function n(n){return e.call(this,"Invalid DateTime: "+n.toMessage())||this}return d(n,e),n}(y),S=function(e){function n(n){return e.call(this,"Invalid Interval: "+n.toMessage())||this}return d(n,e),n}(y),I=function(e){function n(n){return e.call(this,"Invalid Duration: "+n.toMessage())||this}return d(n,e),n}(y),g=function(e){function n(){return e.apply(this,arguments)||this}return d(n,e),n}(y),A=function(e){function n(n){return e.call(this,"Invalid unit "+n)||this}return d(n,e),n}(y),O=function(e){function n(){return e.apply(this,arguments)||this}return d(n,e),n}(y),w=function(e){function n(){return e.call(this,"Zone is an abstract class")||this}return d(n,e),n}(y),b="numeric",C="short",L="long",M={year:b,month:b,day:b},D={year:b,month:C,day:b},k={year:b,month:C,day:b,weekday:C},P={year:b,month:L,day:b},U={year:b,month:L,day:b,weekday:L},x={hour:b,minute:b},_={hour:b,minute:b,second:b},F={hour:b,minute:b,second:b,timeZoneName:C},H={hour:b,minute:b,second:b,timeZoneName:L},Y={hour:b,minute:b,hourCycle:"h23"},G={hour:b,minute:b,second:b,hourCycle:"h23"},$={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:C},B={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:L},W={year:b,month:b,day:b,hour:b,minute:b},V={year:b,month:b,day:b,hour:b,minute:b,second:b},Z={year:b,month:C,day:b,hour:b,minute:b},q={year:b,month:C,day:b,hour:b,minute:b,second:b},X={year:b,month:C,day:b,weekday:C,hour:b,minute:b},z={year:b,month:L,day:b,hour:b,minute:b,timeZoneName:C},K={year:b,month:L,day:b,hour:b,minute:b,second:b,timeZoneName:C},j={year:b,month:L,day:b,weekday:L,hour:b,minute:b,timeZoneName:L},J={year:b,month:L,day:b,weekday:L,hour:b,minute:b,second:b,timeZoneName:L},Q=function(){function e(){}var n=e.prototype;return n.offsetName=function(){throw new w},n.formatOffset=function(){throw new w},n.offset=function(){throw new w},n.equals=function(){throw new w},l(e,[{key:"type",get:function(){throw new w}},{key:"name",get:function(){throw new w}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new w}},{key:"isValid",get:function(){throw new w}}]),e}(),ee=null,ne=function(e){function n(){return e.apply(this,arguments)||this}d(n,e);var t=n.prototype;return t.offsetName=function(e,n){return vn(e,n.format,n.locale)},t.formatOffset=function(e,n){return Rn(this.offset(e),n)},t.offset=function(e){return-new Date(e).getTimezoneOffset()},t.equals=function(e){return"system"===e.type},l(n,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===ee&&(ee=new n),ee}}]),n}(Q),te={},re={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},ie={},ue=function(e){function n(t){var r;return(r=e.call(this)||this).zoneName=t,r.valid=n.isValidZone(t),r}d(n,e),n.create=function(e){return ie[e]||(ie[e]=new n(e)),ie[e]},n.resetCache=function(){ie={},te={}},n.isValidSpecifier=function(e){return this.isValidZone(e)},n.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var t=n.prototype;return t.offsetName=function(e,n){return vn(e,n.format,n.locale,this.name)},t.formatOffset=function(e,n){return Rn(this.offset(e),n)},t.offset=function(e){var n=new Date(e);if(isNaN(n))return NaN;var t,r=(te[t=this.name]||(te[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),te[t]),i=r.formatToParts?function(e,n){for(var t=e.formatToParts(n),r=[],i=0;i<t.length;i++){var u=t[i],s=u.type,o=u.value,a=re[s];"era"===s?r[a]=o:ze(a)||(r[a]=parseInt(o,10))}return r}(r,n):function(e,n){var t=e.format(n).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t);return[r[3],r[1],r[2],r[4],r[5],r[6],r[7]]}(r,n),u=i[0],s=i[1],o=i[2],a=i[4],c=i[5],l=i[6];"BC"===i[3]&&(u=1-Math.abs(u));var f=+n,d=f%1e3;return(hn({year:u,month:s,day:o,hour:24===a?0:a,minute:c,second:l,millisecond:0})-(f-=d>=0?d:1e3+d))/6e4},t.equals=function(e){return"iana"===e.type&&e.name===this.name},l(n,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),n}(Q),se=["base"],oe=["padTo","floor"],ae={},ce={};function le(e,n){void 0===n&&(n={});var t=JSON.stringify([e,n]),r=ce[t];return r||(r=new Intl.DateTimeFormat(e,n),ce[t]=r),r}var fe={},de={},he=null,me={};function Ee(e,n,t,r){var i=e.listingMode();return"error"===i?null:"en"===i?t(n):r(n)}var Te=function(){function e(e,n,t){this.padTo=t.padTo||0,this.floor=t.floor||!1;var r=v(t,oe);if(!n||Object.keys(r).length>0){var i=f({useGrouping:!1},t);t.padTo>0&&(i.minimumIntegerDigits=t.padTo),this.inf=function(e,n){void 0===n&&(n={});var t=JSON.stringify([e,n]),r=fe[t];return r||(r=new Intl.NumberFormat(e,n),fe[t]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var n=this.floor?Math.floor(e):e;return this.inf.format(n)}return un(this.floor?Math.floor(e):cn(e,3),this.padTo)},e}(),ve=function(){function e(e,n,t){this.opts=t,this.originalZone=void 0;var r=void 0;if(this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){var i=e.offset/60*-1,u=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&ue.create(u).valid?(r=u,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);var s=f({},this.opts);s.timeZone=s.timeZone||r,this.dtf=le(n,s)}var n=e.prototype;return n.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},n.formatToParts=function(){var e=this,n=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?n.map((function(n){return"timeZoneName"===n.type?f({},n,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):n})):n},n.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),pe=function(){function e(e,n,t){this.opts=f({style:"long"},t),!n&&Je()&&(this.rtf=function(e,n){void 0===n&&(n={});var t=v(n,se),r=JSON.stringify([e,t]),i=de[r];return i||(i=new Intl.RelativeTimeFormat(e,n),de[r]=i),i}(e,t))}var n=e.prototype;return n.format=function(e,n){return this.rtf?this.rtf.format(e,n):function(e,n,t,r){void 0===t&&(t="always"),void 0===r&&(r=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},u=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===t&&u){var s="days"===e;switch(n){case 1:return s?"tomorrow":"next "+i[e][0];case-1:return s?"yesterday":"last "+i[e][0];case 0:return s?"today":"this "+i[e][0]}}var o=Object.is(n,-0)||n<0,a=Math.abs(n),c=1===a,l=i[e],f=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?a+" "+f+" ago":"in "+a+" "+f}(n,e,this.opts.numeric,"long"!==this.opts.style)},n.formatToParts=function(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]},e}(),Ne={firstDay:1,minimalDays:4,weekend:[6,7]},ye=function(){function e(e,n,t,r,i){var u=function(e){var n=e.indexOf("-x-");-1!==n&&(e=e.substring(0,n));var t,r,i=e.indexOf("-u-");if(-1===i)return[e];try{t=le(e).resolvedOptions(),r=e}catch(n){var u=e.substring(0,i);t=le(u).resolvedOptions(),r=u}return[r,t.numberingSystem,t.calendar]}(e),s=u[1],o=u[2];this.locale=u[0],this.numberingSystem=n||s||null,this.outputCalendar=t||o||null,this.weekSettings=r,this.intl=function(e,n,t){return t||n?(e.includes("-u-")||(e+="-u"),t&&(e+="-ca-"+t),n&&(e+="-nu-"+n),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(n){return e.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)},e.create=function(n,t,r,i,u){void 0===u&&(u=!1);var s=n||ke.defaultLocale;return new e(s||(u?"en-US":he||(he=(new Intl.DateTimeFormat).resolvedOptions().locale)),t||ke.defaultNumberingSystem,r||ke.defaultOutputCalendar,tn(i)||ke.defaultWeekSettings,s)},e.resetCache=function(){he=null,ce={},fe={},de={}},e.fromObject=function(n){var t=void 0===n?{}:n;return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings)};var n=e.prototype;return n.listingMode=function(){return this.isEnglish()&&!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar)?"en":"intl"},n.clone=function(n){return n&&0!==Object.getOwnPropertyNames(n).length?e.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,tn(n.weekSettings)||this.weekSettings,n.defaultToEN||!1):this},n.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(f({},e,{defaultToEN:!0}))},n.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(f({},e,{defaultToEN:!1}))},n.months=function(e,n){var t=this;return void 0===n&&(n=!1),Ee(this,e,On,(function(){var r=n?{month:e,day:"numeric"}:{month:e},i=n?"format":"standalone";return t.monthsCache[i][e]||(t.monthsCache[i][e]=function(e){for(var n=[],t=1;t<=12;t++){var r=br.utc(2009,t,1);n.push(e(r))}return n}((function(e){return t.extract(e,r,"month")}))),t.monthsCache[i][e]}))},n.weekdays=function(e,n){var t=this;return void 0===n&&(n=!1),Ee(this,e,Ln,(function(){var r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return t.weekdaysCache[i][e]||(t.weekdaysCache[i][e]=function(e){for(var n=[],t=1;t<=7;t++){var r=br.utc(2016,11,13+t);n.push(e(r))}return n}((function(e){return t.extract(e,r,"weekday")}))),t.weekdaysCache[i][e]}))},n.meridiems=function(){var e=this;return Ee(this,void 0,(function(){return Mn}),(function(){if(!e.meridiemCache){var n={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[br.utc(2016,11,13,9),br.utc(2016,11,13,19)].map((function(t){return e.extract(t,n,"dayperiod")}))}return e.meridiemCache}))},n.eras=function(e){var n=this;return Ee(this,e,Un,(function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[br.utc(-40,1,1),br.utc(2017,1,1)].map((function(e){return n.extract(e,t,"era")}))),n.eraCache[e]}))},n.extract=function(e,n,t){var r=this.dtFormatter(e,n).formatToParts().find((function(e){return e.type.toLowerCase()===t}));return r?r.value:null},n.numberFormatter=function(e){return void 0===e&&(e={}),new Te(this.intl,e.forceSimple||this.fastNumbers,e)},n.dtFormatter=function(e,n){return void 0===n&&(n={}),new ve(e,this.intl,n)},n.relFormatter=function(e){return void 0===e&&(e={}),new pe(this.intl,this.isEnglish(),e)},n.listFormatter=function(e){return void 0===e&&(e={}),function(e,n){void 0===n&&(n={});var t=JSON.stringify([e,n]),r=ae[t];return r||(r=new Intl.ListFormat(e,n),ae[t]=r),r}(this.intl,e)},n.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},n.getWeekSettings=function(){return this.weekSettings?this.weekSettings:Qe()?function(e){var n=me[e];if(!n){var t=new Intl.Locale(e);n="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,me[e]=n}return n}(this.locale):Ne},n.getStartOfWeek=function(){return this.getWeekSettings().firstDay},n.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},n.getWeekendDays=function(){return this.getWeekSettings().weekend},n.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},l(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),Re=null,Se=function(e){function n(n){var t;return(t=e.call(this)||this).fixed=n,t}d(n,e),n.instance=function(e){return 0===e?n.utcInstance:new n(e)},n.parseSpecifier=function(e){if(e){var t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new n(pn(t[1],t[2]))}return null};var t=n.prototype;return t.offsetName=function(){return this.name},t.formatOffset=function(e,n){return Rn(this.fixed,n)},t.offset=function(){return this.fixed},t.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},l(n,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+Rn(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+Rn(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===Re&&(Re=new n(0)),Re}}]),n}(Q),Ie=function(e){function n(n){var t;return(t=e.call(this)||this).zoneName=n,t}d(n,e);var t=n.prototype;return t.offsetName=function(){return null},t.formatOffset=function(){return""},t.offset=function(){return NaN},t.equals=function(){return!1},l(n,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),n}(Q);function ge(e,n){if(ze(e)||null===e)return n;if(e instanceof Q)return e;if("string"==typeof e){var t=e.toLowerCase();return"default"===t?n:"local"===t||"system"===t?ne.instance:"utc"===t||"gmt"===t?Se.utcInstance:Se.parseSpecifier(t)||ue.create(e)}return Ke(e)?Se.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Ie(e)}var Ae,Oe=function(){return Date.now()},we="system",be=null,Ce=null,Le=null,Me=60,De=null,ke=function(){function e(){}return e.resetCaches=function(){ye.resetCache(),ue.resetCache()},l(e,null,[{key:"now",get:function(){return Oe},set:function(e){Oe=e}},{key:"defaultZone",get:function(){return ge(we,ne.instance)},set:function(e){we=e}},{key:"defaultLocale",get:function(){return be},set:function(e){be=e}},{key:"defaultNumberingSystem",get:function(){return Ce},set:function(e){Ce=e}},{key:"defaultOutputCalendar",get:function(){return Le},set:function(e){Le=e}},{key:"defaultWeekSettings",get:function(){return De},set:function(e){De=tn(e)}},{key:"twoDigitCutoffYear",get:function(){return Me},set:function(e){Me=e%100}},{key:"throwOnInvalid",get:function(){return Ae},set:function(e){Ae=e}}]),e}(),Pe=function(){function e(e,n){this.reason=e,this.explanation=n}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),Ue=[0,31,59,90,120,151,181,212,243,273,304,334],xe=[0,31,60,91,121,152,182,213,244,274,305,335];function _e(e,n){return new Pe("unit out of range","you specified "+n+" (of type "+typeof n+") as a "+e+", which is invalid")}function Fe(e,n,t){var r=new Date(Date.UTC(e,n-1,t));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var i=r.getUTCDay();return 0===i?7:i}function He(e,n,t){return t+(ln(e)?xe:Ue)[n-1]}function Ye(e,n){var t=ln(e)?xe:Ue,r=t.findIndex((function(e){return e<n}));return{month:r+1,day:n-t[r]}}function Ge(e,n){return(e-n+7)%7+1}function $e(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r,i=e.year,u=e.month,s=e.day,o=He(i,u,s),a=Ge(Fe(i,u,s),t),c=Math.floor((o-a+14-n)/7);return c<1?c=En(r=i-1,n,t):c>En(i,n,t)?(r=i+1,c=1):r=i,f({weekYear:r,weekNumber:c,weekday:a},Sn(e))}function Be(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r,i=e.weekYear,u=e.weekNumber,s=e.weekday,o=Ge(Fe(i,1,n),t),a=fn(i),c=7*u+s-o-7+n;c<1?c+=fn(r=i-1):c>a?(r=i+1,c-=fn(i)):r=i;var l=Ye(r,c);return f({year:r,month:l.month,day:l.day},Sn(e))}function We(e){var n=e.year;return f({year:n,ordinal:He(n,e.month,e.day)},Sn(e))}function Ve(e){var n=e.year,t=Ye(n,e.ordinal);return f({year:n,month:t.month,day:t.day},Sn(e))}function Ze(e,n){if(!ze(e.localWeekday)||!ze(e.localWeekNumber)||!ze(e.localWeekYear)){if(!ze(e.weekday)||!ze(e.weekNumber)||!ze(e.weekYear))throw new g("Cannot mix locale-based week fields with ISO-based week fields");return ze(e.localWeekday)||(e.weekday=e.localWeekday),ze(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ze(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:n.getMinDaysInFirstWeek(),startOfWeek:n.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function qe(e){var n=je(e.year),t=rn(e.month,1,12),r=rn(e.day,1,dn(e.year,e.month));return n?t?!r&&_e("day",e.day):_e("month",e.month):_e("year",e.year)}function Xe(e){var n=e.hour,t=e.minute,r=e.second,i=e.millisecond,u=rn(n,0,23)||24===n&&0===t&&0===r&&0===i,s=rn(t,0,59),o=rn(r,0,59),a=rn(i,0,999);return u?s?o?!a&&_e("millisecond",i):_e("second",r):_e("minute",t):_e("hour",n)}function ze(e){return void 0===e}function Ke(e){return"number"==typeof e}function je(e){return"number"==typeof e&&e%1==0}function Je(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Qe(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function en(e,n,t){if(0!==e.length)return e.reduce((function(e,r){var i=[n(r),r];return e&&t(e[0],i[0])===e[0]?e:i}),null)[1]}function nn(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function tn(e){if(null==e)return null;if("object"!=typeof e)throw new O("Week settings must be an object");if(!rn(e.firstDay,1,7)||!rn(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!rn(e,1,7)})))throw new O("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function rn(e,n,t){return je(e)&&e>=n&&e<=t}function un(e,n){return void 0===n&&(n=2),e<0?"-"+(""+-e).padStart(n,"0"):(""+e).padStart(n,"0")}function sn(e){return ze(e)||null===e||""===e?void 0:parseInt(e,10)}function on(e){return ze(e)||null===e||""===e?void 0:parseFloat(e)}function an(e){if(!ze(e)&&null!==e&&""!==e){var n=1e3*parseFloat("0."+e);return Math.floor(n)}}function cn(e,n,t){void 0===t&&(t=!1);var r=Math.pow(10,n);return(t?Math.trunc:Math.round)(e*r)/r}function ln(e){return e%4==0&&(e%100!=0||e%400==0)}function fn(e){return ln(e)?366:365}function dn(e,n){var t,r=(t=n-1)-12*Math.floor(t/12)+1;return 2===r?ln(e+(n-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function hn(e){var n=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(n=new Date(n)).setUTCFullYear(e.year,e.month-1,e.day),+n}function mn(e,n,t){return-Ge(Fe(e,1,n),t)+n-1}function En(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r=mn(e,n,t),i=mn(e+1,n,t);return(fn(e)-r+i)/7}function Tn(e){return e>99?e:e>ke.twoDigitCutoffYear?1900+e:2e3+e}function vn(e,n,t,r){void 0===r&&(r=null);var i=new Date(e),u={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(u.timeZone=r);var s=f({timeZoneName:n},u),o=new Intl.DateTimeFormat(t,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return o?o.value:null}function pn(e,n){var t=parseInt(e,10);Number.isNaN(t)&&(t=0);var r=parseInt(n,10)||0;return 60*t+(t<0||Object.is(t,-0)?-r:r)}function Nn(e){var n=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(n))throw new O("Invalid unit value "+e);return n}function yn(e,n){var t={};for(var r in e)if(nn(e,r)){var i=e[r];if(null==i)continue;t[n(r)]=Nn(i)}return t}function Rn(e,n){var t=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(n){case"short":return""+i+un(t,2)+":"+un(r,2);case"narrow":return""+i+t+(r>0?":"+r:"");case"techie":return""+i+un(t,2)+un(r,2);default:throw new RangeError("Value format "+n+" is out of range for property format")}}function Sn(e){return function(e){return["hour","minute","second","millisecond"].reduce((function(n,t){return n[t]=e[t],n}),{})}(e)}var In=["January","February","March","April","May","June","July","August","September","October","November","December"],gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],An=["J","F","M","A","M","J","J","A","S","O","N","D"];function On(e){switch(e){case"narrow":return[].concat(An);case"short":return[].concat(gn);case"long":return[].concat(In);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var wn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Cn=["M","T","W","T","F","S","S"];function Ln(e){switch(e){case"narrow":return[].concat(Cn);case"short":return[].concat(bn);case"long":return[].concat(wn);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Mn=["AM","PM"],Dn=["Before Christ","Anno Domini"],kn=["BC","AD"],Pn=["B","A"];function Un(e){switch(e){case"narrow":return[].concat(Pn);case"short":return[].concat(kn);case"long":return[].concat(Dn);default:return null}}function xn(e,n){for(var t,r="",i=N(e);!(t=i()).done;){var u=t.value;r+=u.literal?u.val:n(u.val)}return r}var _n={D:M,DD:D,DDD:P,DDDD:U,t:x,tt:_,ttt:F,tttt:H,T:Y,TT:G,TTT:$,TTTT:B,f:W,ff:Z,fff:z,ffff:j,F:V,FF:q,FFF:K,FFFF:J},Fn=function(){function e(e,n){this.opts=n,this.loc=e,this.systemLoc=null}e.create=function(n,t){return void 0===t&&(t={}),new e(n,t)},e.parseFormat=function(e){for(var n=null,t="",r=!1,i=[],u=0;u<e.length;u++){var s=e.charAt(u);"'"===s?(t.length>0&&i.push({literal:r||/^\s+$/.test(t),val:t}),n=null,t="",r=!r):r||s===n?t+=s:(t.length>0&&i.push({literal:/^\s+$/.test(t),val:t}),t=s,n=s)}return t.length>0&&i.push({literal:r||/^\s+$/.test(t),val:t}),i},e.macroTokenToFormatOpts=function(e){return _n[e]};var n=e.prototype;return n.formatWithSystemDefault=function(e,n){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,f({},this.opts,n)).format()},n.dtFormatter=function(e,n){return void 0===n&&(n={}),this.loc.dtFormatter(e,f({},this.opts,n))},n.formatDateTime=function(e,n){return this.dtFormatter(e,n).format()},n.formatDateTimeParts=function(e,n){return this.dtFormatter(e,n).formatToParts()},n.formatInterval=function(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},n.resolvedOptions=function(e,n){return this.dtFormatter(e,n).resolvedOptions()},n.num=function(e,n){if(void 0===n&&(n=0),this.opts.forceSimple)return un(e,n);var t=f({},this.opts);return n>0&&(t.padTo=n),this.loc.numberFormatter(t).format(e)},n.formatDateTimeFromString=function(n,t){var r=this,i="en"===this.loc.listingMode(),u=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,t){return r.loc.extract(n,e,t)},o=function(e){return n.isOffsetFixed&&0===n.offset&&e.allowZ?"Z":n.isValid?n.zone.formatOffset(n.ts,e.format):""},a=function(e,t){return i?function(e,n){return On(n)[e.month-1]}(n,e):s(t?{month:e}:{month:e,day:"numeric"},"month")},c=function(e,t){return i?function(e,n){return Ln(n)[e.weekday-1]}(n,e):s(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},l=function(e){return i?function(e,n){return Un(n)[e.year<0?0:1]}(n,e):s({era:e},"era")};return xn(e.parseFormat(t),(function(t){switch(t){case"S":return r.num(n.millisecond);case"u":case"SSS":return r.num(n.millisecond,3);case"s":return r.num(n.second);case"ss":return r.num(n.second,2);case"uu":return r.num(Math.floor(n.millisecond/10),2);case"uuu":return r.num(Math.floor(n.millisecond/100));case"m":return r.num(n.minute);case"mm":return r.num(n.minute,2);case"h":return r.num(n.hour%12==0?12:n.hour%12);case"hh":return r.num(n.hour%12==0?12:n.hour%12,2);case"H":return r.num(n.hour);case"HH":return r.num(n.hour,2);case"Z":return o({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return o({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:r.loc.locale});case"z":return n.zoneName;case"a":return i?function(e){return Mn[e.hour<12?0:1]}(n):s({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return u?s({day:"numeric"},"day"):r.num(n.day);case"dd":return u?s({day:"2-digit"},"day"):r.num(n.day,2);case"c":case"E":return r.num(n.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return u?s({month:"numeric",day:"numeric"},"month"):r.num(n.month);case"LL":return u?s({month:"2-digit",day:"numeric"},"month"):r.num(n.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return u?s({month:"numeric"},"month"):r.num(n.month);case"MM":return u?s({month:"2-digit"},"month"):r.num(n.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return u?s({year:"numeric"},"year"):r.num(n.year);case"yy":return u?s({year:"2-digit"},"year"):r.num(n.year.toString().slice(-2),2);case"yyyy":return u?s({year:"numeric"},"year"):r.num(n.year,4);case"yyyyyy":return u?s({year:"numeric"},"year"):r.num(n.year,6);case"G":return l("short");case"GG":return l("long");case"GGGGG":return l("narrow");case"kk":return r.num(n.weekYear.toString().slice(-2),2);case"kkkk":return r.num(n.weekYear,4);case"W":return r.num(n.weekNumber);case"WW":return r.num(n.weekNumber,2);case"n":return r.num(n.localWeekNumber);case"nn":return r.num(n.localWeekNumber,2);case"ii":return r.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(n.localWeekYear,4);case"o":return r.num(n.ordinal);case"ooo":return r.num(n.ordinal,3);case"q":return r.num(n.quarter);case"qq":return r.num(n.quarter,2);case"X":return r.num(Math.floor(n.ts/1e3));case"x":return r.num(n.ts);default:return function(t){var i=e.macroTokenToFormatOpts(t);return i?r.formatWithSystemDefault(n,i):t}(t)}}))},n.formatDurationFromString=function(n,t){var r,i=this,u=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(t),o=s.reduce((function(e,n){return n.literal?e:e.concat(n.val)}),[]),a=n.shiftTo.apply(n,o.map(u).filter((function(e){return e})));return xn(s,(r=a,function(e){var n=u(e);return n?i.num(r.get(n),e.length):e}))},e}(),Hn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Yn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=n.reduce((function(e,n){return e+n.source}),"");return RegExp("^"+r+"$")}function Gn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e){return n.reduce((function(n,t){var r=n[0],i=n[1],u=t(e,n[2]),s=u[1],o=u[2];return[f({},r,u[0]),s||i,o]}),[{},null,1]).slice(0,2)}}function $n(e){if(null==e)return[null,null];for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];for(var i=0,u=t;i<u.length;i++){var s=u[i],o=s[1],a=s[0].exec(e);if(a)return o(a)}return[null,null]}function Bn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e,t){var r,i={};for(r=0;r<n.length;r++)i[n[r]]=sn(e[t+r]);return[i,null,t+r]}}var Wn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Vn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zn=RegExp(Vn.source+("(?:"+Wn.source+"?(?:\\[("+Hn.source+")\\])?)?")),qn=RegExp("(?:T"+Zn.source+")?"),Xn=Bn("weekYear","weekNumber","weekDay"),zn=Bn("year","ordinal"),Kn=RegExp(Vn.source+" ?(?:"+Wn.source+"|("+Hn.source+"))?"),jn=RegExp("(?: "+Kn.source+")?");function Jn(e,n,t){var r=e[n];return ze(r)?t:sn(r)}function Qn(e,n){return[{hours:Jn(e,n,0),minutes:Jn(e,n+1,0),seconds:Jn(e,n+2,0),milliseconds:an(e[n+3])},null,n+4]}function et(e,n){var t=!e[n]&&!e[n+1],r=pn(e[n+1],e[n+2]);return[{},t?null:Se.instance(r),n+3]}function nt(e,n){return[{},e[n]?ue.create(e[n]):null,n+1]}var tt=RegExp("^T?"+Vn.source+"$"),rt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function it(e){var n=e[2],t=e[3],r=e[4],i=e[5],u=e[6],s=e[7],o=e[8],a="-"===e[0][0],c=s&&"-"===s[0],l=function(e,n){return void 0===n&&(n=!1),void 0!==e&&(n||e&&a)?-e:e};return[{years:l(on(e[1])),months:l(on(n)),weeks:l(on(t)),days:l(on(r)),hours:l(on(i)),minutes:l(on(u)),seconds:l(on(s),"-0"===s),milliseconds:l(an(o),c)}]}var ut={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function st(e,n,t,r,i,u,s){var o={year:2===n.length?Tn(sn(n)):sn(n),month:gn.indexOf(t)+1,day:sn(r),hour:sn(i),minute:sn(u)};return s&&(o.second=sn(s)),e&&(o.weekday=e.length>3?wn.indexOf(e)+1:bn.indexOf(e)+1),o}var ot=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function at(e){var n,t=e[8],r=e[9],i=e[10],u=e[11],s=st(e[1],e[4],e[3],e[2],e[5],e[6],e[7]);return n=t?ut[t]:r?0:pn(i,u),[s,new Se(n)]}var ct=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,lt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ft=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function dt(e){return[st(e[1],e[4],e[3],e[2],e[5],e[6],e[7]),Se.utcInstance]}function ht(e){return[st(e[1],e[7],e[2],e[3],e[4],e[5],e[6]),Se.utcInstance]}var mt=Yn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,qn),Et=Yn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,qn),Tt=Yn(/(\d{4})-?(\d{3})/,qn),vt=Yn(Zn),pt=Gn((function(e,n){return[{year:Jn(e,n),month:Jn(e,n+1,1),day:Jn(e,n+2,1)},null,n+3]}),Qn,et,nt),Nt=Gn(Xn,Qn,et,nt),yt=Gn(zn,Qn,et,nt),Rt=Gn(Qn,et,nt),St=Gn(Qn),It=Yn(/(\d{4})-(\d\d)-(\d\d)/,jn),gt=Yn(Kn),At=Gn(Qn,et,nt),Ot="Invalid Duration",wt={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},bt=f({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},wt),Ct=f({years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},wt),Lt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Mt=Lt.slice(0).reverse();function Dt(e,n,t){void 0===t&&(t=!1);var r={values:t?n.values:f({},e.values,n.values||{}),loc:e.loc.clone(n.loc),conversionAccuracy:n.conversionAccuracy||e.conversionAccuracy,matrix:n.matrix||e.matrix};return new Ut(r)}function kt(e,n){for(var t,r,i=null!=(t=n.milliseconds)?t:0,u=N(Mt.slice(1));!(r=u()).done;){var s=r.value;n[s]&&(i+=n[s]*e[s].milliseconds)}return i}function Pt(e,n){var t=kt(e,n)<0?-1:1;Lt.reduceRight((function(r,i){if(ze(n[i]))return r;if(r){var u=e[i][r],s=Math.floor(n[r]*t/u);n[i]+=s*t,n[r]-=s*u*t}return i}),null),Lt.reduce((function(t,r){if(ze(n[r]))return t;if(t){var i=n[t]%1;n[t]-=i,n[r]+=i*e[t][r]}return r}),null)}var Ut=function(e){function n(e){var n="longterm"===e.conversionAccuracy||!1,t=n?Ct:bt;e.matrix&&(t=e.matrix),this.values=e.values,this.loc=e.loc||ye.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t,this.isLuxonDuration=!0}n.fromMillis=function(e,t){return n.fromObject({milliseconds:e},t)},n.fromObject=function(e,t){if(void 0===t&&(t={}),null==e||"object"!=typeof e)throw new O("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new n({values:yn(e,n.normalizeUnit),loc:ye.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})},n.fromDurationLike=function(e){if(Ke(e))return n.fromMillis(e);if(n.isDuration(e))return e;if("object"==typeof e)return n.fromObject(e);throw new O("Unknown duration argument "+e+" of type "+typeof e)},n.fromISO=function(e,t){var r=function(e){return $n(e,[rt,it])}(e),i=r[0];return i?n.fromObject(i,t):n.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},n.fromISOTime=function(e,t){var r=function(e){return $n(e,[tt,St])}(e),i=r[0];return i?n.fromObject(i,t):n.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},n.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new O("need to specify a reason the Duration is invalid");var r=e instanceof Pe?e:new Pe(e,t);if(ke.throwOnInvalid)throw new I(r);return new n({invalid:r})},n.normalizeUnit=function(e){var n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!n)throw new A(e);return n},n.isDuration=function(e){return e&&e.isLuxonDuration||!1};var t=n.prototype;return t.toFormat=function(e,n){void 0===n&&(n={});var t=f({},n,{floor:!1!==n.round&&!1!==n.floor});return this.isValid?Fn.create(this.loc,t).formatDurationFromString(this,e):Ot},t.toHuman=function(e){var n=this;if(void 0===e&&(e={}),!this.isValid)return Ot;var t=Lt.map((function(t){var r=n.values[t];return ze(r)?null:n.loc.numberFormatter(f({style:"unit",unitDisplay:"long"},e,{unit:t.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(f({type:"conjunction",style:e.listStyle||"narrow"},e)).format(t)},t.toObject=function(){return this.isValid?f({},this.values):{}},t.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=cn(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},t.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=this.toMillis();return n<0||n>=864e5?null:(e=f({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),br.fromMillis(n,{zone:"UTC"}).toISOTime(e))},t.toJSON=function(){return this.toISO()},t.toString=function(){return this.toISO()},t[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},t.toMillis=function(){return this.isValid?kt(this.matrix,this.values):NaN},t.valueOf=function(){return this.toMillis()},t.plus=function(e){if(!this.isValid)return this;for(var t=n.fromDurationLike(e),r={},i=0,u=Lt;i<u.length;i++){var s=u[i];(nn(t.values,s)||nn(this.values,s))&&(r[s]=t.get(s)+this.get(s))}return Dt(this,{values:r},!0)},t.minus=function(e){if(!this.isValid)return this;var t=n.fromDurationLike(e);return this.plus(t.negate())},t.mapUnits=function(e){if(!this.isValid)return this;for(var n={},t=0,r=Object.keys(this.values);t<r.length;t++){var i=r[t];n[i]=Nn(e(this.values[i],i))}return Dt(this,{values:n},!0)},t.get=function(e){return this[n.normalizeUnit(e)]},t.set=function(e){return this.isValid?Dt(this,{values:f({},this.values,yn(e,n.normalizeUnit))}):this},t.reconfigure=function(e){var n=void 0===e?{}:e,t=n.conversionAccuracy,r=n.matrix;return Dt(this,{loc:this.loc.clone({locale:n.locale,numberingSystem:n.numberingSystem}),matrix:r,conversionAccuracy:t})},t.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},t.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return Pt(this.matrix,e),Dt(this,{values:e},!0)},t.rescale=function(){return this.isValid?Dt(this,{values:function(e){for(var n={},t=0,r=Object.entries(e);t<r.length;t++){var i=r[t],u=i[1];0!==u&&(n[i[0]]=u)}return n}(this.normalize().shiftToAll().toObject())},!0):this},t.shiftTo=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!this.isValid)return this;if(0===t.length)return this;t=t.map((function(e){return n.normalizeUnit(e)}));for(var i,u={},s={},o=this.toObject(),a=0,c=Lt;a<c.length;a++){var l=c[a];if(t.indexOf(l)>=0){i=l;var f=0;for(var d in s)f+=this.matrix[d][l]*s[d],s[d]=0;Ke(o[l])&&(f+=o[l]);var h=Math.trunc(f);u[l]=h,s[l]=(1e3*f-1e3*h)/1e3}else Ke(o[l])&&(s[l]=o[l])}for(var m in s)0!==s[m]&&(u[i]+=m===i?s[m]:s[m]/this.matrix[i][m]);return Pt(this.matrix,u),Dt(this,{values:u},!0)},t.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},t.negate=function(){if(!this.isValid)return this;for(var e={},n=0,t=Object.keys(this.values);n<t.length;n++){var r=t[n];e[r]=0===this.values[r]?0:-this.values[r]}return Dt(this,{values:e},!0)},t.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var n=0,t=Lt;n<t.length;n++){var r=t[n];if(u=e.values[r],!(void 0===(i=this.values[r])||0===i?void 0===u||0===u:i===u))return!1}var i,u;return!0},l(n,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),n}(Symbol.for("nodejs.util.inspect.custom")),xt="Invalid Interval";function _t(e,n){return e&&e.isValid?n&&n.isValid?n<e?Ft.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+n.toISO()):null:Ft.invalid("missing or invalid end"):Ft.invalid("missing or invalid start")}var Ft=function(e){function n(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}n.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new O("need to specify a reason the Interval is invalid");var r=e instanceof Pe?e:new Pe(e,t);if(ke.throwOnInvalid)throw new S(r);return new n({invalid:r})},n.fromDateTimes=function(e,t){var r=Cr(e),i=Cr(t),u=_t(r,i);return null==u?new n({start:r,end:i}):u},n.after=function(e,t){var r=Ut.fromDurationLike(t),i=Cr(e);return n.fromDateTimes(i,i.plus(r))},n.before=function(e,t){var r=Ut.fromDurationLike(t),i=Cr(e);return n.fromDateTimes(i.minus(r),i)},n.fromISO=function(e,t){var r=(e||"").split("/",2),i=r[0],u=r[1];if(i&&u){var s,o,a,c;try{o=(s=br.fromISO(i,t)).isValid}catch(u){o=!1}try{c=(a=br.fromISO(u,t)).isValid}catch(u){c=!1}if(o&&c)return n.fromDateTimes(s,a);if(o){var l=Ut.fromISO(u,t);if(l.isValid)return n.after(s,l)}else if(c){var f=Ut.fromISO(i,t);if(f.isValid)return n.before(a,f)}}return n.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},n.isInterval=function(e){return e&&e.isLuxonInterval||!1};var t=n.prototype;return t.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},t.count=function(e,n){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var t,r=this.start.startOf(e,n);return t=(t=null!=n&&n.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,n),Math.floor(t.diff(r,e).get(e))+(t.valueOf()!==this.end.valueOf())},t.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},t.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},t.isAfter=function(e){return!!this.isValid&&this.s>e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&this.s<=e&&this.e>e},t.set=function(e){var t=void 0===e?{}:e;return this.isValid?n.fromDateTimes(t.start||this.s,t.end||this.e):this},t.splitAt=function(){var e=this;if(!this.isValid)return[];for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];for(var u=r.map(Cr).filter((function(n){return e.contains(n)})).sort((function(e,n){return e.toMillis()-n.toMillis()})),s=[],o=this.s,a=0;o<this.e;){var c=u[a]||this.e,l=+c>+this.e?this.e:c;s.push(n.fromDateTimes(o,l)),o=l,a+=1}return s},t.splitBy=function(e){var t=Ut.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var r,i=this.s,u=1,s=[];i<this.e;){var o=this.start.plus(t.mapUnits((function(e){return e*u})));s.push(n.fromDateTimes(i,r=+o>+this.e?this.e:o)),i=r,u+=1}return s},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s<e.e},t.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},t.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},t.engulfs=function(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e},t.equals=function(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)},t.intersection=function(e){if(!this.isValid)return this;var t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:n.fromDateTimes(t,r)},t.union=function(e){return this.isValid?n.fromDateTimes(this.s<e.s?this.s:e.s,this.e>e.e?this.e:e.e):this},n.merge=function(e){var n=e.sort((function(e,n){return e.s-n.s})).reduce((function(e,n){var t=e[0],r=e[1];return r?r.overlaps(n)||r.abutsStart(n)?[t,r.union(n)]:[t.concat([r]),n]:[t,n]}),[[],null]),t=n[0],r=n[1];return r&&t.push(r),t},n.xor=function(e){for(var t,r,i=null,u=0,s=[],o=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),a=N((t=Array.prototype).concat.apply(t,o).sort((function(e,n){return e.time-n.time})));!(r=a()).done;){var c=r.value;1===(u+="s"===c.type?1:-1)?i=c.time:(i&&+i!=+c.time&&s.push(n.fromDateTimes(i,c.time)),i=null)}return n.merge(s)},t.difference=function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.xor([this].concat(r)).map((function(n){return e.intersection(n)})).filter((function(e){return e&&!e.isEmpty()}))},t.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":xt},t[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},t.toLocaleString=function(e,n){return void 0===e&&(e=M),void 0===n&&(n={}),this.isValid?Fn.create(this.s.loc.clone(n),e).formatInterval(this):xt},t.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):xt},t.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():xt},t.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):xt},t.toFormat=function(e,n){var t=(void 0===n?{}:n).separator,r=void 0===t?" – ":t;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):xt},t.toDuration=function(e,n){return this.isValid?this.e.diff(this.s,e,n):Ut.invalid(this.invalidReason)},t.mapEndpoints=function(e){return n.fromDateTimes(e(this.s),e(this.e))},l(n,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),n}(Symbol.for("nodejs.util.inspect.custom")),Ht=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=ke.defaultZone);var n=br.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset},e.isValidIANAZone=function(e){return ue.isValidZone(e)},e.normalizeZone=function(e){return ge(e,ke.defaultZone)},e.getStartOfWeek=function(e){var n=void 0===e?{}:e,t=n.locale,r=n.locObj;return((void 0===r?null:r)||ye.create(void 0===t?null:t)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var n=void 0===e?{}:e,t=n.locale,r=n.locObj;return((void 0===r?null:r)||ye.create(void 0===t?null:t)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var n=void 0===e?{}:e,t=n.locale,r=n.locObj;return((void 0===r?null:r)||ye.create(void 0===t?null:t)).getWeekendDays().slice()},e.months=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj,s=t.outputCalendar;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,void 0===s?"gregory":s)).months(e)},e.monthsFormat=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj,s=t.outputCalendar;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,void 0===s?"gregory":s)).months(e,!0)},e.weekdays=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,null)).weekdays(e)},e.weekdaysFormat=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,null)).weekdays(e,!0)},e.meridiems=function(e){var n=(void 0===e?{}:e).locale;return ye.create(void 0===n?null:n).meridiems()},e.eras=function(e,n){void 0===e&&(e="short");var t=(void 0===n?{}:n).locale;return ye.create(void 0===t?null:t,null,"gregory").eras(e)},e.features=function(){return{relative:Je(),localeWeek:Qe()}},e}();function Yt(e,n){var t=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=t(n)-t(e);return Math.floor(Ut.fromMillis(r).as("days"))}var Gt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$t={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Bt=Gt.hanidec.replace(/[\[|\]]/g,"").split("");function Wt(e,n){return void 0===n&&(n=""),new RegExp(""+Gt[e.numberingSystem||"latn"]+n)}function Vt(e,n){return void 0===n&&(n=function(e){return e}),{regex:e,deser:function(e){return n(function(e){var n=parseInt(e,10);if(isNaN(n)){n="";for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(-1!==e[t].search(Gt.hanidec))n+=Bt.indexOf(e[t]);else for(var i in $t){var u=$t[i],s=u[0];r>=s&&r<=u[1]&&(n+=r-s)}}return parseInt(n,10)}return n}(e[0]))}}}var Zt="[ "+String.fromCharCode(160)+"]",qt=new RegExp(Zt,"g");function Xt(e){return e.replace(/\./g,"\\.?").replace(qt,Zt)}function zt(e){return e.replace(/\./g,"").replace(qt," ").toLowerCase()}function Kt(e,n){return null===e?null:{regex:RegExp(e.map(Xt).join("|")),deser:function(t){var r=t[0];return e.findIndex((function(e){return zt(r)===zt(e)}))+n}}}function jt(e,n){return{regex:e,deser:function(e){return pn(e[1],e[2])},groups:n}}function Jt(e){return{regex:e,deser:function(e){return e[0]}}}var Qt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}},er=null;function nr(e,n){var t;return(t=Array.prototype).concat.apply(t,e.map((function(e){return function(e,n){if(e.literal)return e;var t=rr(Fn.macroTokenToFormatOpts(e.val),n);return null==t||t.includes(void 0)?e:t}(e,n)})))}function tr(e,n,t){var r=nr(Fn.parseFormat(t),e),i=r.map((function(n){return t=n,i=Wt(r=e),u=Wt(r,"{2}"),s=Wt(r,"{3}"),o=Wt(r,"{4}"),a=Wt(r,"{6}"),c=Wt(r,"{1,2}"),l=Wt(r,"{1,3}"),f=Wt(r,"{1,6}"),d=Wt(r,"{1,9}"),h=Wt(r,"{2,4}"),m=Wt(r,"{4,6}"),E=function(e){return{regex:RegExp((n=e.val,n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var n},T=function(e){if(t.literal)return E(e);switch(e.val){case"G":return Kt(r.eras("short"),0);case"GG":return Kt(r.eras("long"),0);case"y":return Vt(f);case"yy":case"kk":return Vt(h,Tn);case"yyyy":case"kkkk":return Vt(o);case"yyyyy":return Vt(m);case"yyyyyy":return Vt(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Vt(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Vt(u);case"MMM":return Kt(r.months("short",!0),1);case"MMMM":return Kt(r.months("long",!0),1);case"LLL":return Kt(r.months("short",!1),1);case"LLLL":return Kt(r.months("long",!1),1);case"o":case"S":return Vt(l);case"ooo":case"SSS":return Vt(s);case"u":return Jt(d);case"uu":return Jt(c);case"uuu":case"E":case"c":return Vt(i);case"a":return Kt(r.meridiems(),0);case"EEE":return Kt(r.weekdays("short",!1),1);case"EEEE":return Kt(r.weekdays("long",!1),1);case"ccc":return Kt(r.weekdays("short",!0),1);case"cccc":return Kt(r.weekdays("long",!0),1);case"Z":case"ZZ":return jt(new RegExp("([+-]"+c.source+")(?::("+u.source+"))?"),2);case"ZZZ":return jt(new RegExp("([+-]"+c.source+")("+u.source+")?"),2);case"z":return Jt(/[a-z_+-/]{1,256}?/i);case" ":return Jt(/[^\S\n\r]/);default:return E(e)}}(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},T.token=t,T;var t,r,i,u,s,o,a,c,l,f,d,h,m,E,T})),u=i.find((function(e){return e.invalidReason}));if(u)return{input:n,tokens:r,invalidReason:u.invalidReason};var s=function(e){return["^"+e.map((function(e){return e.regex})).reduce((function(e,n){return e+"("+n.source+")"}),"")+"$",e]}(i),o=s[1],a=RegExp(s[0],"i"),c=function(e,n,t){var r=e.match(n);if(r){var i={},u=1;for(var s in t)if(nn(t,s)){var o=t[s],a=o.groups?o.groups+1:1;!o.literal&&o.token&&(i[o.token.val[0]]=o.deser(r.slice(u,u+a))),u+=a}return[r,i]}return[r,{}]}(n,a,o),l=c[0],f=c[1],d=f?function(e){var n,t=null;return ze(e.z)||(t=ue.create(e.z)),ze(e.Z)||(t||(t=new Se(e.Z)),n=e.Z),ze(e.q)||(e.M=3*(e.q-1)+1),ze(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),ze(e.u)||(e.S=an(e.u)),[Object.keys(e).reduce((function(n,t){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(t);return r&&(n[r]=e[t]),n}),{}),t,n]}(f):[null,null,void 0],h=d[0],m=d[1],E=d[2];if(nn(f,"a")&&nn(f,"H"))throw new g("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:r,regex:a,rawMatches:l,matches:f,result:h,zone:m,specificOffset:E}}function rr(e,n){if(!e)return null;var t=Fn.create(n,e).dtFormatter((er||(er=br.fromMillis(1555555555555)),er)),r=t.formatToParts(),i=t.resolvedOptions();return r.map((function(n){return function(e,n,t){var r=e.type,i=e.value;if("literal"===r){var u=/^\s+$/.test(i);return{literal:!u,val:u?" ":i}}var s=r;"hour"===r&&(s=null!=n.hour12?n.hour12?"hour12":"hour24":null!=n.hourCycle?"h11"===n.hourCycle||"h12"===n.hourCycle?"hour12":"hour24":t.hour12?"hour12":"hour24");var o=Qt[s];if("object"==typeof o&&(o=o[n[r]]),o)return{literal:!1,val:o}}(n,e,i)}))}var ir="Invalid DateTime",ur=864e13;function sr(e){return new Pe("unsupported zone",'the zone "'+e.name+'" is not supported')}function or(e){return null===e.weekData&&(e.weekData=$e(e.c)),e.weekData}function ar(e){return null===e.localWeekData&&(e.localWeekData=$e(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function cr(e,n){var t={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new br(f({},t,n,{old:t}))}function lr(e,n,t){var r=e-60*n*1e3,i=t.offset(r);if(n===i)return[r,n];var u=t.offset(r-=60*(i-n)*1e3);return i===u?[r,i]:[e-60*Math.min(i,u)*1e3,Math.max(i,u)]}function fr(e,n){var t=new Date(e+=60*n*1e3);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function dr(e,n,t){return lr(hn(e),n,t)}function hr(e,n){var t=e.o,r=e.c.year+Math.trunc(n.years),i=e.c.month+Math.trunc(n.months)+3*Math.trunc(n.quarters),u=f({},e.c,{year:r,month:i,day:Math.min(e.c.day,dn(r,i))+Math.trunc(n.days)+7*Math.trunc(n.weeks)}),s=Ut.fromObject({years:n.years-Math.trunc(n.years),quarters:n.quarters-Math.trunc(n.quarters),months:n.months-Math.trunc(n.months),weeks:n.weeks-Math.trunc(n.weeks),days:n.days-Math.trunc(n.days),hours:n.hours,minutes:n.minutes,seconds:n.seconds,milliseconds:n.milliseconds}).as("milliseconds"),o=lr(hn(u),t,e.zone),a=o[0],c=o[1];return 0!==s&&(c=e.zone.offset(a+=s)),{ts:a,o:c}}function mr(e,n,t,r,i,u){var s=t.setZone,o=t.zone;if(e&&0!==Object.keys(e).length||n){var a=br.fromObject(e,f({},t,{zone:n||o,specificOffset:u}));return s?a:a.setZone(o)}return br.invalid(new Pe("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function Er(e,n,t){return void 0===t&&(t=!0),e.isValid?Fn.create(ye.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(e,n):null}function Tr(e,n){var t=e.c.year>9999||e.c.year<0,r="";return t&&e.c.year>=0&&(r+="+"),r+=un(e.c.year,t?6:4),n?(r+="-",r+=un(e.c.month),r+="-",r+=un(e.c.day)):(r+=un(e.c.month),r+=un(e.c.day)),r}function vr(e,n,t,r,i,u){var s=un(e.c.hour);return n?(s+=":",s+=un(e.c.minute),0===e.c.millisecond&&0===e.c.second&&t||(s+=":")):s+=un(e.c.minute),0===e.c.millisecond&&0===e.c.second&&t||(s+=un(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=un(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!u?s+="Z":e.o<0?(s+="-",s+=un(Math.trunc(-e.o/60)),s+=":",s+=un(Math.trunc(-e.o%60))):(s+="+",s+=un(Math.trunc(e.o/60)),s+=":",s+=un(Math.trunc(e.o%60)))),u&&(s+="["+e.zone.ianaName+"]"),s}var pr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Nr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},yr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Rr=["year","month","day","hour","minute","second","millisecond"],Sr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ir=["year","ordinal","hour","minute","second","millisecond"];function gr(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var n={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!n)throw new A(e);return n}(e)}}function Ar(e,n){var t,r,i=ge(n.zone,ke.defaultZone),u=ye.fromObject(n),s=ke.now();if(ze(e.year))t=s;else{for(var o=0,a=Rr;o<a.length;o++){var c=a[o];ze(e[c])&&(e[c]=pr[c])}var l=qe(e)||Xe(e);if(l)return br.invalid(l);var f=dr(e,i.offset(s),i);t=f[0],r=f[1]}return new br({ts:t,zone:i,loc:u,o:r})}function Or(e,n,t){var r=!!ze(t.round)||t.round,i=function(e,i){return e=cn(e,r||t.calendary?0:2,!0),n.loc.clone(t).relFormatter(t).format(e,i)},u=function(r){return t.calendary?n.hasSame(e,r)?0:n.startOf(r).diff(e.startOf(r),r).get(r):n.diff(e,r).get(r)};if(t.unit)return i(u(t.unit),t.unit);for(var s,o=N(t.units);!(s=o()).done;){var a=s.value,c=u(a);if(Math.abs(c)>=1)return i(c,a)}return i(e>n?-0:0,t.units[t.units.length-1])}function wr(e){var n,t={};return e.length>0&&"object"==typeof e[e.length-1]?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var br=function(e){function n(e){var n=e.zone||ke.defaultZone,t=e.invalid||(Number.isNaN(e.ts)?new Pe("invalid input"):null)||(n.isValid?null:sr(n));this.ts=ze(e.ts)?ke.now():e.ts;var r=null,i=null;if(!t)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n)){var u=[e.old.c,e.old.o];r=u[0],i=u[1]}else{var s=n.offset(this.ts);r=fr(this.ts,s),r=(t=Number.isNaN(r.year)?new Pe("invalid input"):null)?null:r,i=t?null:s}this._zone=n,this.loc=e.loc||ye.create(),this.invalid=t,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}n.now=function(){return new n({})},n.local=function(){var e=wr(arguments),n=e[1];return Ar({year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]},e[0])},n.utc=function(){var e=wr(arguments),n=e[0],t=e[1],r=t[0],i=t[1],u=t[2],s=t[3],o=t[4],a=t[5],c=t[6];return n.zone=Se.utcInstance,Ar({year:r,month:i,day:u,hour:s,minute:o,second:a,millisecond:c},n)},n.fromJSDate=function(e,t){void 0===t&&(t={});var r="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;if(Number.isNaN(r))return n.invalid("invalid input");var i=ge(t.zone,ke.defaultZone);return i.isValid?new n({ts:r,zone:i,loc:ye.fromObject(t)}):n.invalid(sr(i))},n.fromMillis=function(e,t){if(void 0===t&&(t={}),Ke(e))return e<-ur||e>ur?n.invalid("Timestamp out of range"):new n({ts:e,zone:ge(t.zone,ke.defaultZone),loc:ye.fromObject(t)});throw new O("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},n.fromSeconds=function(e,t){if(void 0===t&&(t={}),Ke(e))return new n({ts:1e3*e,zone:ge(t.zone,ke.defaultZone),loc:ye.fromObject(t)});throw new O("fromSeconds requires a numerical input")},n.fromObject=function(e,t){void 0===t&&(t={}),e=e||{};var r=ge(t.zone,ke.defaultZone);if(!r.isValid)return n.invalid(sr(r));var i=ye.fromObject(t),u=yn(e,gr),s=Ze(u,i),o=s.minDaysInFirstWeek,a=s.startOfWeek,c=ke.now(),l=ze(t.specificOffset)?r.offset(c):t.specificOffset,f=!ze(u.ordinal),d=!ze(u.year),h=!ze(u.month)||!ze(u.day),m=d||h,E=u.weekYear||u.weekNumber;if((m||f)&&E)throw new g("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new g("Can't mix ordinal dates with month/day");var T,v,p=E||u.weekday&&!m,y=fr(c,l);p?(T=Sr,v=Nr,y=$e(y,o,a)):f?(T=Ir,v=yr,y=We(y)):(T=Rr,v=pr);for(var R,S=!1,I=N(T);!(R=I()).done;){var A=R.value;ze(u[A])?u[A]=S?v[A]:y[A]:S=!0}var O=p?function(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r=je(e.weekYear),i=rn(e.weekNumber,1,En(e.weekYear,n,t)),u=rn(e.weekday,1,7);return r?i?!u&&_e("weekday",e.weekday):_e("week",e.weekNumber):_e("weekYear",e.weekYear)}(u,o,a):f?function(e){var n=je(e.year),t=rn(e.ordinal,1,fn(e.year));return n?!t&&_e("ordinal",e.ordinal):_e("year",e.year)}(u):qe(u),w=O||Xe(u);if(w)return n.invalid(w);var b=dr(p?Be(u,o,a):f?Ve(u):u,l,r),C=new n({ts:b[0],zone:r,o:b[1],loc:i});return u.weekday&&m&&e.weekday!==C.weekday?n.invalid("mismatched weekday","you can't specify both a weekday of "+u.weekday+" and a date of "+C.toISO()):C},n.fromISO=function(e,n){void 0===n&&(n={});var t=function(e){return $n(e,[mt,pt],[Et,Nt],[Tt,yt],[vt,Rt])}(e);return mr(t[0],t[1],n,"ISO 8601",e)},n.fromRFC2822=function(e,n){void 0===n&&(n={});var t=function(e){return $n(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[ot,at])}(e);return mr(t[0],t[1],n,"RFC 2822",e)},n.fromHTTP=function(e,n){void 0===n&&(n={});var t=function(e){return $n(e,[ct,dt],[lt,dt],[ft,ht])}(e);return mr(t[0],t[1],n,"HTTP",n)},n.fromFormat=function(e,t,r){if(void 0===r&&(r={}),ze(e)||ze(t))throw new O("fromFormat requires an input string and a format");var i,u,s=r.locale,o=r.numberingSystem,a=(i=ye.fromOpts({locale:void 0===s?null:s,numberingSystem:void 0===o?null:o,defaultToEN:!0}),[(u=tr(i,e,t)).result,u.zone,u.specificOffset,u.invalidReason]),c=a[0],l=a[1],f=a[2],d=a[3];return d?n.invalid(d):mr(c,l,r,"format "+t,e,f)},n.fromString=function(e,t,r){return void 0===r&&(r={}),n.fromFormat(e,t,r)},n.fromSQL=function(e,n){void 0===n&&(n={});var t=function(e){return $n(e,[It,pt],[gt,At])}(e);return mr(t[0],t[1],n,"SQL",e)},n.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new O("need to specify a reason the DateTime is invalid");var r=e instanceof Pe?e:new Pe(e,t);if(ke.throwOnInvalid)throw new R(r);return new n({invalid:r})},n.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},n.parseFormatForOpts=function(e,n){void 0===n&&(n={});var t=rr(e,ye.fromObject(n));return t?t.map((function(e){return e?e.val:null})).join(""):null},n.expandFormat=function(e,n){return void 0===n&&(n={}),nr(Fn.parseFormat(e),ye.fromObject(n)).map((function(e){return e.val})).join("")};var t=n.prototype;return t.get=function(e){return this[e]},t.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,n=6e4,t=hn(this.c),r=this.zone.offset(t-e),i=this.zone.offset(t+e),u=this.zone.offset(t-r*n),s=this.zone.offset(t-i*n);if(u===s)return[this];var o=t-u*n,a=t-s*n,c=fr(o,u),l=fr(a,s);return c.hour===l.hour&&c.minute===l.minute&&c.second===l.second&&c.millisecond===l.millisecond?[cr(this,{ts:o}),cr(this,{ts:a})]:[this]},t.resolvedLocaleOptions=function(e){void 0===e&&(e={});var n=Fn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n.locale,numberingSystem:n.numberingSystem,outputCalendar:n.calendar}},t.toUTC=function(e,n){return void 0===e&&(e=0),void 0===n&&(n={}),this.setZone(Se.instance(e),n)},t.toLocal=function(){return this.setZone(ke.defaultZone)},t.setZone=function(e,t){var r=void 0===t?{}:t,i=r.keepLocalTime,u=void 0!==i&&i,s=r.keepCalendarTime,o=void 0!==s&&s;if((e=ge(e,ke.defaultZone)).equals(this.zone))return this;if(e.isValid){var a=this.ts;if(u||o){var c=e.offset(this.ts);a=dr(this.toObject(),c,e)[0]}return cr(this,{ts:a,zone:e})}return n.invalid(sr(e))},t.reconfigure=function(e){var n=void 0===e?{}:e;return cr(this,{loc:this.loc.clone({locale:n.locale,numberingSystem:n.numberingSystem,outputCalendar:n.outputCalendar})})},t.setLocale=function(e){return this.reconfigure({locale:e})},t.set=function(e){if(!this.isValid)return this;var n,t=yn(e,gr),r=Ze(t,this.loc),i=r.minDaysInFirstWeek,u=r.startOfWeek,s=!ze(t.weekYear)||!ze(t.weekNumber)||!ze(t.weekday),o=!ze(t.ordinal),a=!ze(t.year),c=!ze(t.month)||!ze(t.day);if((a||c||o)&&(t.weekYear||t.weekNumber))throw new g("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new g("Can't mix ordinal dates with month/day");s?n=Be(f({},$e(this.c,i,u),t),i,u):ze(t.ordinal)?(n=f({},this.toObject(),t),ze(t.day)&&(n.day=Math.min(dn(n.year,n.month),n.day))):n=Ve(f({},We(this.c),t));var l=dr(n,this.o,this.zone);return cr(this,{ts:l[0],o:l[1]})},t.plus=function(e){return this.isValid?cr(this,hr(this,Ut.fromDurationLike(e))):this},t.minus=function(e){return this.isValid?cr(this,hr(this,Ut.fromDurationLike(e).negate())):this},t.startOf=function(e,n){var t=(void 0===n?{}:n).useLocaleWeeks,r=void 0!==t&&t;if(!this.isValid)return this;var i={},u=Ut.normalizeUnit(e);switch(u){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===u)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===u){var o=Math.ceil(this.month/3);i.month=3*(o-1)+1}return this.set(i)},t.endOf=function(e,n){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e,n).minus(1):this},t.toFormat=function(e,n){return void 0===n&&(n={}),this.isValid?Fn.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):ir},t.toLocaleString=function(e,n){return void 0===e&&(e=M),void 0===n&&(n={}),this.isValid?Fn.create(this.loc.clone(n),e).formatDateTime(this):ir},t.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?Fn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},t.toISO=function(e){var n=void 0===e?{}:e,t=n.format,r=n.suppressSeconds,i=void 0!==r&&r,u=n.suppressMilliseconds,s=void 0!==u&&u,o=n.includeOffset,a=void 0===o||o,c=n.extendedZone,l=void 0!==c&&c;if(!this.isValid)return null;var f="extended"===(void 0===t?"extended":t),d=Tr(this,f);return(d+="T")+vr(this,f,i,s,a,l)},t.toISODate=function(e){var n=(void 0===e?{}:e).format;return this.isValid?Tr(this,"extended"===(void 0===n?"extended":n)):null},t.toISOWeekDate=function(){return Er(this,"kkkk-'W'WW-c")},t.toISOTime=function(e){var n=void 0===e?{}:e,t=n.suppressMilliseconds,r=n.suppressSeconds,i=n.includeOffset,u=n.includePrefix,s=n.extendedZone,o=n.format;return this.isValid?(void 0!==u&&u?"T":"")+vr(this,"extended"===(void 0===o?"extended":o),void 0!==r&&r,void 0!==t&&t,void 0===i||i,void 0!==s&&s):null},t.toRFC2822=function(){return Er(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},t.toHTTP=function(){return Er(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},t.toSQLDate=function(){return this.isValid?Tr(this,!0):null},t.toSQLTime=function(e){var n=void 0===e?{}:e,t=n.includeOffset,r=void 0===t||t,i=n.includeZone,u=void 0!==i&&i,s=n.includeOffsetSpace,o="HH:mm:ss.SSS";return(u||r)&&((void 0===s||s)&&(o+=" "),u?o+="z":r&&(o+="ZZ")),Er(this,o,!0)},t.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},t.toString=function(){return this.isValid?this.toISO():ir},t[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},t.valueOf=function(){return this.toMillis()},t.toMillis=function(){return this.isValid?this.ts:NaN},t.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},t.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},t.toJSON=function(){return this.toISO()},t.toBSON=function(){return this.toJSDate()},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var n=f({},this.c);return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n},t.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},t.diff=function(e,n,t){if(void 0===n&&(n="milliseconds"),void 0===t&&(t={}),!this.isValid||!e.isValid)return Ut.invalid("created by diffing an invalid DateTime");var r,i=f({locale:this.locale,numberingSystem:this.numberingSystem},t),u=(r=n,Array.isArray(r)?r:[r]).map(Ut.normalizeUnit),s=e.valueOf()>this.valueOf(),o=function(e,n,t,r){var i,u=function(e,n,t){for(var r,i,u={},s=e,o=0,a=[["years",function(e,n){return n.year-e.year}],["quarters",function(e,n){return n.quarter-e.quarter+4*(n.year-e.year)}],["months",function(e,n){return n.month-e.month+12*(n.year-e.year)}],["weeks",function(e,n){var t=Yt(e,n);return(t-t%7)/7}],["days",Yt]];o<a.length;o++){var c=a[o],l=c[0],f=c[1];t.indexOf(l)>=0&&(r=l,u[l]=f(e,n),(i=s.plus(u))>n?(u[l]--,(e=s.plus(u))>n&&(i=e,u[l]--,e=s.plus(u))):e=i)}return[e,u,i,r]}(e,n,t),s=u[0],o=u[1],a=u[2],c=u[3],l=n-s,f=t.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));0===f.length&&(a<n&&(a=s.plus(((i={})[c]=1,i))),a!==s&&(o[c]=(o[c]||0)+l/(a-s)));var d,h=Ut.fromObject(o,r);return f.length>0?(d=Ut.fromMillis(l,r)).shiftTo.apply(d,f).plus(h):h}(s?this:e,s?e:this,u,i);return s?o.negate():o},t.diffNow=function(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(n.now(),e,t)},t.until=function(e){return this.isValid?Ft.fromDateTimes(this,e):this},t.hasSame=function(e,n,t){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,t)<=r&&r<=i.endOf(n,t)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=e.base||n.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],u=e.unit;return Array.isArray(e.unit)&&(i=e.unit,u=void 0),Or(t,this.plus(r),f({},e,{numeric:"always",units:i,unit:u}))},t.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?Or(e.base||n.fromObject({},{zone:this.zone}),this,f({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},n.min=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(n.isDateTime))throw new O("min requires all arguments be DateTimes");return en(t,(function(e){return e.valueOf()}),Math.min)},n.max=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(n.isDateTime))throw new O("max requires all arguments be DateTimes");return en(t,(function(e){return e.valueOf()}),Math.max)},n.fromFormatExplain=function(e,n,t){void 0===t&&(t={});var r=t.locale,i=t.numberingSystem;return tr(ye.fromOpts({locale:void 0===r?null:r,numberingSystem:void 0===i?null:i,defaultToEN:!0}),e,n)},n.fromStringExplain=function(e,t,r){return void 0===r&&(r={}),n.fromFormatExplain(e,t,r)},l(n,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?or(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?or(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?or(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?ar(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?ar(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?ar(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?We(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Ht.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Ht.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Ht.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Ht.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return ln(this.year)}},{key:"daysInMonth",get:function(){return dn(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?fn(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?En(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?En(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return M}},{key:"DATE_MED",get:function(){return D}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return k}},{key:"DATE_FULL",get:function(){return P}},{key:"DATE_HUGE",get:function(){return U}},{key:"TIME_SIMPLE",get:function(){return x}},{key:"TIME_WITH_SECONDS",get:function(){return _}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return F}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return H}},{key:"TIME_24_SIMPLE",get:function(){return Y}},{key:"TIME_24_WITH_SECONDS",get:function(){return G}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return $}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return B}},{key:"DATETIME_SHORT",get:function(){return W}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return V}},{key:"DATETIME_MED",get:function(){return Z}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return q}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return X}},{key:"DATETIME_FULL",get:function(){return z}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return K}},{key:"DATETIME_HUGE",get:function(){return j}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return J}}]),n}(Symbol.for("nodejs.util.inspect.custom"));function Cr(e){if(br.isDateTime(e))return e;if(e&&e.valueOf&&Ke(e.valueOf()))return br.fromJSDate(e);if(e&&"object"==typeof e)return br.fromObject(e);throw new O("Unknown datetime argument: "+e+", of type "+typeof e)}var Lr=a.DateTime=br;a.Duration=Ut;var Mr=a.FixedOffsetZone=Se,Dr=a.IANAZone=ue;a.Info=Ht,a.Interval=Ft,a.InvalidZone=Ie,a.Settings=ke,a.SystemZone=ne,a.VERSION="3.4.4";var kr,Pr=a.Zone=Q;!function(e){e.InvalidFunctionParameters="InvalidFunctionParameters",e.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",e.UnsupportedSqlFunction="UnsupportedSqlFunction",e.UnsupportedOperator="UnsupportedOperator",e.UnsupportedSyntax="UnsupportedSyntax",e.UnsupportedIsRhs="UnsupportedIsRhs",e.UnsupportedIsLhs="UnsupportedIsLhs",e.InvalidDataType="InvalidDataType",e.CannotCastValue="CannotCastValue",e.FunctionNotRecognized="FunctionNotRecognized",e.InvalidTime="InvalidTime",e.InvalidParameterCount="InvalidParameterCount",e.InvalidTimeStamp="InvalidTimeStamp",e.InvalidDate="InvalidDate",e.InvalidOperator="InvalidOperator",e.IllegalInterval="IllegalInterval",e.YearMonthIntervals="YearMonthIntervals",e.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",e.MissingStatisticParameters="MissingStatisticParameters"}(kr||(kr={}));const Ur={[kr.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[kr.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[kr.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[kr.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[kr.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[kr.UnsupportedOperator]:"Unsupported operator - {operator}",[kr.UnsupportedSyntax]:"Unsupported syntax - {node}",[kr.UnsupportedSqlFunction]:"Sql function not found = {function}",[kr.InvalidDataType]:"Invalid sql data type",[kr.InvalidDate]:"Invalid date encountered",[kr.InvalidOperator]:"Invalid operator encountered",[kr.InvalidTime]:"Invalid time encountered",[kr.IllegalInterval]:"Illegal interval",[kr.FunctionNotRecognized]:"Function not recognized",[kr.InvalidTimeStamp]:"Invalid timestamp encountered",[kr.InvalidParameterCount]:"Invalid parameter count for call to {name}",[kr.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[kr.YearMonthIntervals]:"Year-Month Intervals not supported",[kr.CannotCastValue]:"Cannot cast value to the required data type"};class xr extends Error{constructor(e,n){super(Hr(Ur[e],n)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,xr)}}const _r=/\{(?:[^}]+)\}/gu;function Fr(e){return e??""}function Hr(e,n){return n?e.replaceAll(_r,"object"==typeof n?(e,t)=>Fr(function(e,n){if(null!=n)return n[e]||function(e,n,t){let r=t;for(const n of e){if(null==r)return;if(!(n in r))return void 0;r=r[n]}return r}(e.split("."),0,n)}(t,n)):(e,t)=>Fr(n(t))):e}var Yr;function Gr(e){return"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e}let $r;!function(e){e[e.Standardised=0]="Standardised",e[e.StandardisedNoInterval=1]="StandardisedNoInterval",e[e.SqlServer=2]="SqlServer",e[e.Oracle=3]="Oracle",e[e.Postgres=4]="Postgres",e[e.PGDB=5]="PGDB",e[e.FILEGDB=6]="FILEGDB",e[e.NotEvaluated=7]="NotEvaluated"}(Yr||(Yr={}));const Br=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function Wr(){return void 0===$r&&($r=Br??globalThis.navigator?.language??"en"),$r}class Vr{}var Zr;Vr.instance=new Dr("Etc/UTC"),function(e){e.TimeZoneNotRecognized="TimeZoneNotRecognized"}(Zr||(Zr={}));const qr={[Zr.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class Xr extends Error{constructor(e,n){super(Hr(qr[e],n)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,Xr)}}function zr(e,n=!0){if(e instanceof Pr)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return Vr.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const n=Mr.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(n)return n}const t=Dr.create(e);if(!t.isValid){if(n)throw new Xr(Zr.TimeZoneNotRecognized);return null}return t}function Kr(e,n,t){return e<n?e-n:e>t?e-t:0}function jr(e,n,t){return e<n?n:e>t?t:e}class Jr{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,n=1,t=1,r=0,i=0,u=0,s=0,o){if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(t)||Number.isNaN(r)||Number.isNaN(i)||Number.isNaN(u)||Number.isNaN(s))return null;const a=Lr.local(e,n).daysInMonth;let c=Lr.fromObject({day:jr(t,1,a),year:e,month:jr(n,1,12),hour:jr(r,0,23),minute:jr(i,0,59),second:jr(u,0,59),millisecond:jr(s,0,999)},{zone:zr(o)});return c=c.plus({months:Kr(n,1,12),days:Kr(t,1,a),hours:Kr(r,0,23),minutes:Kr(i,0,59),seconds:Kr(u,0,59),milliseconds:Kr(s,0,999)}),new Jr(c)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,n){const t=zr(n);return e.isUnknownTimeZone||t===Vr.instance?Jr.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,t):new Jr(e._date.setZone(t))}static dateJSToArcadeDate(e){return new Jr(Lr.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,n="system"){const t=zr(n);return new Jr(Lr.fromJSDate(e,{zone:t}))}static unknownEpochToArcadeDate(e){return new Jr(Lr.fromMillis(e,{zone:Vr.instance}))}static unknownDateJSToArcadeDate(e){return new Jr(Lr.fromMillis(e.getTime(),{zone:Vr.instance}))}static epochToArcadeDate(e,n="system"){const t=zr(n);return new Jr(Lr.fromMillis(e,{zone:t}))}static dateTimeToArcadeDate(e){return new Jr(e)}clone(){return new Jr(this._date)}changeTimeZone(e){const n=zr(e);return Jr.dateTimeToArcadeDate(this._date.setZone(n))}static dateTimeAndZoneToArcadeDate(e,n){const t=zr(n);return e.zone===Vr.instance||t===Vr.instance?Jr.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,t):new Jr(e.setZone(t))}static nowToArcadeDate(e){const n=zr(e);return new Jr(Lr.fromJSDate(new Date,{zone:n}))}static nowUTCToArcadeDate(){return new Jr(Lr.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===Jr.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===Vr.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new Jr(this._date.plus(e))}diff(e,n="milliseconds"){return this._date.diff(e._date,n)[n]}toISODate(){return this._date.toISODate()}toISOString(e){return this._date.toISO(e?{suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}:{includeOffset:!this.isUnknownTimeZone})}toISOTime(e,n){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:n&&!this.isUnknownTimeZone})}toFormat(e,n){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,n)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new Jr(this._date.toUTC())}toLocal(){return new Jr(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const n=Lr.fromISO(e,{setZone:!0});return new Jr(n)}}function Qr(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(t)||[])switch(r){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"X":case"x":n+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?n+=`'${r.slice(1,-1)}'`:n+=`'${r}'`}return n}class ei{constructor(e,n,t){this._year=e,this._month=n,this._day=t,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof ei&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new ei(this._year,this._month,this._day)}toDateTime(e){return Lr.fromObject({day:this.day,month:this.month,year:this.year},{zone:zr(e)})}toDateTimeLuxon(e){return Lr.fromObject({day:this.day,month:this.month,year:this.year},{zone:zr(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null){if(null===e||""===e)return this.toString();if(!(e=Qr(e)))return"";const n=this.toDateTime("unknown");return Jr.dateTimeToArcadeDate(n).toFormat(e,{locale:Wr(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return Jr.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(e,n){return ei.fromDateTime(this.toUTCDateTime().plus({[e]:n}))}toUTCDateTime(){return Lr.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,n){switch(n.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===n?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const n=Lr.fromMillis(e,{zone:Mr.utcInstance});return n.isValid?ei.fromParts(n.year,n.month,n.day):null}static fromSeconds(e){const n=Lr.fromSeconds(e,{zone:Mr.utcInstance});return n.isValid?ei.fromParts(n.year,n.month,n.day):null}static fromReader(e){if(!e)return null;const n=e.split("-");return 3!==n.length?null:new ei(Number.parseInt(n[0]),Number.parseInt(n[1]),Number.parseInt(n[2]))}static fromParts(e,n,t){const r=new ei(e,n,t);return r.isValid?r:null}static fromDateJS(e){return ei.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return ei.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,n=null){if(""===e)return null;if(null===e)return null;const t=[];if(n)(n=Qr(n))&&t.push(n);else if(null===n||""===n){const n=Lr.fromISO(e,{setZone:!0});return n.isValid?ei.fromParts(n.year,n.month,n.day):null}for(const r of t){const t=Lr.fromFormat(e,n??r);if(t.isValid)return new ei(t.year,t.month,t.day)}return null}static fromNow(e="system"){const n=Lr.fromJSDate(new Date).setZone(zr(e));return new ei(n.year,n.month,n.day)}}function ni(e){if(!e)return"";const n=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/gu;let t="";for(const r of e.match(n)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=r;break;case"A":case"a":t+="a";break;default:t+=`'${r}'`}return t}class ti{constructor(e,n,t,r){this._hour=e,this._minute=n,this._second=t,this._millisecond=r,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof ti&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new ti(this.hour,this.minute,this.second,this.millisecond)}isValid(){return Gr(this.hour)&&Gr(this.minute)&&Gr(this.second)&&Gr(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}`}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?`.${this.millisecond.toString().padStart(3,"0")}`:""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=ni(e))?Lr.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:Wr(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,n,t,r){const i=new ti(e,n,t,r);return i.isValid()?i:null}static fromReader(e){if(!e)return null;const n=e.split(":");return 3!==n.length?null:new ti(Number.parseInt(n[0]),Number.parseInt(n[1]),Number.parseInt(n[2]),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const n=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),i=Math.floor(e%1e3);return new ti(r,t,n,i)}static fromDateJS(e){return new ti(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new ti(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,n=null){if(""===e)return null;if(null===e)return null;const t=[];n?(n=ni(n))&&t.push(n):null!==n&&""!==n||(t.push("HH:mm:ss"),t.push("HH:mm:ss.SSS"),t.push("hh:mm:ss a"),t.push("hh:mm:ss.SSS a"),t.push("HH:mm"),t.push("hh:mm a"),t.push("H:mm"),t.push("h:mm a"),t.push("H:mm:ss"),t.push("h:mm:ss a"),t.push("H:mm:ss.SSS"),t.push("h:mm:ss.SSS a"));for(const n of t){const t=Lr.fromFormat(e,n);if(t.isValid)return new ti(t.hour,t.minute,t.second,t.millisecond)}return null}plus(e,n){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return ti.fromDateTime(this.toUTCDateTime().plus({[e]:n}))}return null}toUTCDateTime(){return Lr.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,n){switch(n.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===n?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}function ri(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}class ii{constructor(e){this._timeStampOffset=e,this._date=null}toDateTime(){return this._date??(this._date=Lr.fromISO(this._timeStampOffset,{setZone:!0})),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return ri(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return ri(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 ii.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new ii(Lr.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new ii(e.toISO({includeOffset:!0}))}static fromParts(e,n,t=0,r=0,i=0,u=0,s=0,o=!1,a=0,c=0){const l=`${e.toString().padStart(4,"0")}-${n.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let f="";u<10&&(f="0");let d=`${r.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}:${f+u.toString()}`;0!==s&&(d+="."+s.toString().padStart(3,"0"));const h=`${o?"-":"+"}${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new ii(l+"T"+d+h)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const n=this.toDateTime().plus(e);return ii.fromDateTime(n)}}class ui{}function si(e){return e instanceof Pr?e===ui.instance:"unknown"===e?.toString().toLowerCase()}function oi(e){return si(e)?ui.instance:e}function ai(e,n){return Lr.fromObject({day:e.day,year:e.year,month:e.month,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond},{zone:n})}ui.instance=new Dr("Etc/UTC");const ci=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,li=/^(\d{1,2}):(\d{1,2})$/,fi=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,di=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,hi=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,mi=/^(\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})$/,Ei=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,Ti=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function vi(e){return"number"==typeof e}function pi(e){return"string"==typeof e||e instanceof String}function Ni(e){return e instanceof Date}function yi(e){return e instanceof Lr}function Ri(e){return e instanceof ei}function Si(e){return e instanceof ti}function Ii(e){return e instanceof ii}function gi(e){return!!yi(e)||!!Ii(e)}function Ai(e){if(yi(e))return e.toMillis();if(Ri(e))return e.toNumber();if(Ii(e))return e.toMilliseconds();throw new xr(kr.InvalidDataType)}function Oi(e,n,t){switch(t){case"<>":return e!==n;case"=":return e===n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}}function wi(e){return Ri(e)||Si(e)?e.toString():Ii(e)?e.toSQLValue():yi(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):Ni(e)?wi(Lr.fromJSDate(e)):e?.toString()}function bi(e){return"string"==typeof e||e instanceof String}function Ci(e){return!(Ni(e)||Ri(e)||yi(e)||Si(e)||Ii(e))}const Li={extract:{minParams:2,maxParams:2,evaluate:([e,n])=>{if(null==n)return null;if(Ni(n))switch(e.toUpperCase()){case"SECOND":return n.getSeconds();case"MINUTE":return n.getMinutes();case"HOUR":return n.getHours();case"DAY":return n.getDate();case"MONTH":return n.getMonth()+1;case"YEAR":return n.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(yi(n))switch(e.toUpperCase()){case"SECOND":return n.second;case"MINUTE":return n.minute;case"HOUR":return n.hour;case"DAY":return n.day;case"MONTH":return n.month;case"YEAR":return n.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new xr(kr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(Ri(n))switch(e.toUpperCase()){case"DAY":return n.day;case"MONTH":return n.month;case"YEAR":return n.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new xr(kr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(Si(n))switch(e.toUpperCase()){case"SECOND":return n.second;case"MINUTE":return n.minute;case"HOUR":return n.hour}else if(Ii(n))switch(e.toUpperCase()){case"SECOND":return n.second;case"MINUTE":return n.minute;case"HOUR":return n.hour;case"DAY":return n.day;case"MONTH":return n.month;case"YEAR":return n.year;case"TIMEZONE_HOUR":return n.timezoneOffsetHour;case"TIMEZONE_MINUTE":return n.timezoneOffsetMinutes}throw new xr(kr.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(e.length===Li.substring.minParams){const[n,t]=e;return null==n||null==t?null:n.toString().substring(t-1)}if(e.length===Li.substring.maxParams){const[n,t,r]=e;return null==n||null==t||null==r?null:r<=0?"":n.toString().substring(t-1,t+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,n])=>null==e||null==n?null:n.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const n=e.length===Li.trim.maxParams,t=n?e[1]:" ",r=n?e[2]:e[1];if(null==t||null==r)return null;const i=`(${u=t,u.replaceAll(/(?:[.$?*|{}()[\]\\/+\-^])/gu,(e=>`\\${e}`))})`;var u;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${i}*|${i}*$`,"gu"),"");case"LEADING":return r.replaceAll(new RegExp(`^${i}*`,"gu"),"");case"TRAILING":return r.replaceAll(new RegExp(`${i}*$`,"gu"),"")}throw new xr(kr.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const n=e[0],t=2===e.length?10**e[1]:1;return null==n?null:Math.round(n*t)/t}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length?Number.parseInt(e[0].toFixed(0)):Number.parseFloat(e[0].toFixed(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>bi(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let n="";for(const t of e){if(null==t)return null;n+=t.toString()}return n}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const n of e)if(null!==n)return n;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:e=>function(e,n,t){if(null==e||null==n)return null;if(vi(e)){if(vi(n))return Oi(e,n,t);if(pi(n))return function(e,n,t){const r=Number.parseFloat(n);if(!Number.isNaN(r))return Oi(e,r,t);const i=e.toString();switch(t){case"<>":return i!==n;case"=":return i===n;case">":return i>n;case"<":return i<n;case">=":return i>=n;case"<=":return i<=n}}(e,n,t);if(yi(r=n)||Ri(r)||Ii(r)||Si(r))throw new xr(kr.InvalidOperator);if(Ri(n))throw new xr(kr.InvalidOperator)}else if(pi(e)){if(vi(n))return function(e,n,t){const r=Number.parseFloat(e);if(!Number.isNaN(r))return Oi(r,n,t);const i=n.toString();switch(t){case"<>":return e!==i;case"=":return e===i;case">":return e>i;case"<":return e<i;case">=":return e>=i;case"<=":return e<=i}}(e,n,t);if(pi(n))return function(e,n,t){switch(t){case"<>":return e!==n;case"=":return e===n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}}(e,n,t);if(yi(n))throw new xr(kr.InvalidOperator);if(Ri(n))throw new xr(kr.InvalidOperator);if(Si(n))throw new xr(kr.InvalidOperator);if(Ii(n))throw new xr(kr.InvalidOperator)}else if(yi(e)){if(gi(n))return e instanceof Lr&&si(e.zone)?n instanceof Lr&&!si(n.zone)?e=ai(e,n.zone):n instanceof ii&&(e=ai(e,n.toDateTime().zone)):n instanceof Lr&&si(n.zone)&&(e instanceof Lr&&!si(e.zone)?n=ai(n,e.zone):e instanceof ii&&(n=ai(n,e.toDateTime().zone))),Oi(Ai(e),Ai(n),t);if(pi(n))throw new xr(kr.InvalidOperator);if(Ri(n))return function(e,n,t){const r=n.toDateTimeLuxon(e.zone);return Oi((e=e.startOf("day")).toMillis(),r.toMillis(),t)}(e,n,t);if(Si(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator)}else if(Ri(e)){if(Ii(n))return function(e,n,t){const r=e.toDateTimeLuxon(n.toDateTime().zone);return n=n.startOfDay(),Oi(r.toMillis(),n.toMilliseconds(),t)}(e,n,t);if(yi(n))return function(e,n,t){const r=e.toDateTimeLuxon(n.zone);return n=n.startOf("day"),Oi(r.toMillis(),n.toMillis(),t)}(e,n,t);if(pi(n))throw new xr(kr.InvalidOperator);if(Ri(n))return Oi(e.toNumber(),n.toNumber(),t);if(Si(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator)}else if(Si(e)){if(Si(n))return Oi(e.toNumber(),n.toNumber(),t);if(pi(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator);if(Ri(n))throw new xr(kr.InvalidOperator);if(gi(n))throw new xr(kr.InvalidOperator)}else if(Ii(e)){if(gi(n))return n instanceof Lr&&si(n.zone)&&(n=ai(n,e.toDateTime().zone)),Oi(Ai(e),Ai(n),t);if(pi(n))throw new xr(kr.InvalidOperator);if(Ri(n))return function(e,n,t){const r=n.toDateTimeLuxon(e.toDateTime().zone);return Oi((e=e.startOfDay()).toMilliseconds(),r.toMillis(),t)}(e,n,t);if(Si(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator)}var r;switch(t){case"<>":return e!==n;case"=":return e===n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}}(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,n)=>{const t=e[0],r=e[1];if(null===t)return null;switch(r.type){case"integer":{if(!Ci(t))throw new xr(kr.CannotCastValue);const e=Number.parseInt(t);if(isNaN(e))throw new xr(kr.CannotCastValue);return e}case"smallint":{const e=32767,n=-32767;if(!Ci(t))throw new xr(kr.CannotCastValue);const r=Number.parseInt(t);if(isNaN(r))throw new xr(kr.CannotCastValue);if(r>e||r<n)throw new xr(kr.CannotCastValue);return r}case"float":case"real":{if(!Ci(t))throw new xr(kr.CannotCastValue);const e=parseFloat(t);if(isNaN(e))throw new xr(kr.CannotCastValue);return e}case"time":return function(e){if(Ni(e))return ti.fromDateJS(e);if(yi(e))return ti.fromDateTime(e);if(Ri(e))throw new xr(kr.CannotCastValue);if(Si(e))return e;if(Ii(e))return ti.fromSqlTimeStampOffset(e);if(bi(e))return function(e){let n=ci.exec(e);if(null!==n){const[,e,t,r]=n,i=ti.fromParts(Number.parseInt(e),Number.parseInt(t),Number.parseInt(r),0);if(null!==i)return i;throw new xr(kr.InvalidTime)}if(n=li.exec(e),null!==n){const[,e,t]=n,r=ti.fromParts(Number.parseInt(e),Number.parseInt(t),0,0);if(null!==r)return r;throw new xr(kr.InvalidTime)}if(n=fi.exec(e),null!==n){const[,e,t,r,i]=n,u=ti.fromParts(Number.parseInt(e),Number.parseInt(t),Number.parseInt(r),Number.parseInt(i));if(null!==u)return u;throw new xr(kr.InvalidTime)}throw new xr(kr.InvalidTime)}(e);throw new xr(kr.CannotCastValue)}(t);case"date":return function(e){if(Ni(e))return ei.fromDateJS(e);if(yi(e))return ei.fromParts(e.year,e.month,e.day);if(Ri(e))return e;if(Si(e))throw new xr(kr.CannotCastValue);if(Ii(e)&&null===ei.fromParts(e.year,e.month,e.day))throw new xr(kr.CannotCastValue);if(bi(e)){const n=ei.fromReader(e);if(null!==n&&n.isValid)return n}throw new xr(kr.CannotCastValue)}(t);case"timestamp":return function(e,n){if(Ni(e))return function(e,n){switch(n){case"system":case"local":case null:return Lr.fromJSDate(e);default:return"unknown"===n?.toLowerCase()?Lr.fromMillis(e.getTime(),{zone:ui.instance}):Lr.fromJSDate(e).setZone(n)}}(e,n);if(yi(e))return e;if(Ri(e))return e.toDateTimeLuxon("unknown");if(Si(e))throw new xr(kr.CannotCastValue);if(Ii(e))return e;if(bi(e))return function(e,n){let t=hi.exec(e);if(null!==t){const[,e,r,i,u,s,o,a]=t,c=Lr.fromObject({year:Number.parseInt(e),month:Number.parseInt(r),day:Number.parseInt(i),hour:Number.parseInt(u),minute:Number.parseInt(s),second:Number.parseInt(o),millisecond:a?Number.parseInt(a.replace(".","")):0},{zone:oi(n)});if(!c.isValid)throw new xr(kr.InvalidTimeStamp);return c}if(t=mi.exec(e),null!==t){const[,e,n,r,i,u,s,o,a,c,l]=t,f=ii.fromParts(Number.parseInt(e),Number.parseInt(n),Number.parseInt(r),Number.parseInt(i),Number.parseInt(u),Number.parseInt(s),o?Number.parseInt(o.replace(".","")):0,"-"===a,Number.parseInt(c),Number.parseInt(l));if(!f.isValid)throw new xr(kr.InvalidTimeStamp);return f}if(t=Ei.exec(e),null!==t){const[,e,n,r,i,u,s,o,a]=t,c=ii.fromParts(Number.parseInt(e),Number.parseInt(n),Number.parseInt(r),Number.parseInt(i),Number.parseInt(u),0,0,"-"===s,Number.parseInt(o),Number.parseInt(a));if(!c.isValid)throw new xr(kr.InvalidTimeStamp);return c}if(t=Ti.exec(e),null!==t){const[,e,r,i,u,s]=t,o=Lr.fromObject({year:Number.parseInt(e),month:Number.parseInt(r),day:Number.parseInt(i),hour:Number.parseInt(u),minute:Number.parseInt(s),second:0},{zone:oi(n)});if(!o.isValid)throw new xr(kr.InvalidTimeStamp);return o}if(t=di.exec(e),null!==t){const[,e,r,i]=t,u=Lr.fromObject({year:Number.parseInt(e),month:Number.parseInt(r),day:Number.parseInt(i),hour:0,minute:0,second:0},{zone:oi(n)});if(!u.isValid)throw new xr(kr.InvalidTimeStamp);return u}throw new xr(kr.InvalidTimeStamp)}(e,"unknown");throw new xr(kr.CannotCastValue)}(t,n);case"varchar":{const e=wi(t);if(e.length>r.size)throw new xr(kr.CannotCastValue);return e}default:throw new xr(kr.InvalidDataType)}}}},Mi=function(){function e(n,t,r,i){var u=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(u,e.prototype),u.expected=t,u.found=r,u.location=i,u.name="SyntaxError",u}function n(e,n,t){return t=t||" ",e.length>n?e:e+(t+=t.repeat(n-=e.length)).slice(0,n)}return function(e,n){function t(){this.constructor=e}t.prototype=n.prototype,e.prototype=new t}(e,Error),e.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var u=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(u):u,o=this.location.source+":"+s.line+":"+s.column;if(i){var a=this.location.end,c=n("",s.line.toString().length," "),l=i[u.line-1],f=(u.line===a.line?a.column:l.length+1)-u.column||1;t+="\n --\x3e "+o+"\n"+c+" |\n"+s.line+" | "+l+"\n"+c+" | "+n("",u.column-1," ")+n("",f,"^")}else t+="\n at "+o}return t},e.buildMessage=function(e,n){var t={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var n=e.parts.map((function(e){return Array.isArray(e)?u(e[0])+"-"+u(e[1]):u(e)}));return"["+(e.inverted?"^":"")+n.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function u(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function s(e){return t[e.type](e)}return"Expected "+function(e){var n,t,r=e.map(s);if(r.sort(),r.length>0){for(n=1,t=1;n<r.length;n++)r[n-1]!==r[n]&&(r[t]=r[n],t++);r.length=t}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(n)+" found."},{SyntaxError:e,parse:function(n,t){var r,i={},u=(t=void 0!==t?t:{}).grammarSource,s={start:Wi},o=Wi,a="!",c="=",l=">=",f=">",d="<=",h="<>",m="<",E="!=",T="+",v="-",p="||",N="*",y="/",R="@",S="'",I="N'",g="''",A=".",O="null",w="true",b="false",C="in",L="is",M="like",D="escape",k="not",P="and",U="or",x="between",_="from",F="for",H="substring",Y="extract",G="trim",$="position",B="timestamp",W="date",V="time",Z="leading",q="trailing",X="both",z="cast",K="as",j="integer",J="smallint",Q="float",ee="real",ne="varchar",te="to",re="interval",ie="year",ue="timezone_hour",se="timezone_minute",oe="month",ae="day",ce="hour",le="minute",fe="second",de="case",he="end",me="when",Ee="then",Te="else",ve=",",pe="(",Ne=")",ye="`",Re=/^[A-Za-z_\x80-\uFFFF]/,Se=/^[A-Za-z0-9_]/,Ie=/^[A-Za-z0-9_.\x80-\uFFFF]/,ge=/^["]/,Ae=/^[^']/,Oe=/^[0-9]/,we=/^[eE]/,be=/^[+\-]/,Ce=/^[ \t\n\r]/,Le=/^[^`]/,Me=Hi("!",!1),De=Hi("=",!1),ke=Hi(">=",!1),Pe=Hi(">",!1),Ue=Hi("<=",!1),xe=Hi("<>",!1),_e=Hi("<",!1),Fe=Hi("!=",!1),He=Hi("+",!1),Ye=Hi("-",!1),Ge=Hi("||",!1),$e=Hi("*",!1),Be=Hi("/",!1),We=Yi([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Ve=Yi([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Ze=Yi([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),qe=Yi(['"'],!1,!1),Xe=Hi("@",!1),ze=Hi("'",!1),Ke=Hi("N'",!1),je=Hi("''",!1),Je=Yi(["'"],!0,!1),Qe=Hi(".",!1),en=Yi([["0","9"]],!1,!1),nn=Yi(["e","E"],!1,!1),tn=Yi(["+","-"],!1,!1),rn=Hi("NULL",!0),un=Hi("TRUE",!0),sn=Hi("FALSE",!0),on=Hi("IN",!0),an=Hi("IS",!0),cn=Hi("LIKE",!0),ln=Hi("ESCAPE",!0),fn=Hi("NOT",!0),dn=Hi("AND",!0),hn=Hi("OR",!0),mn=Hi("BETWEEN",!0),En=Hi("FROM",!0),Tn=Hi("FOR",!0),vn=Hi("SUBSTRING",!0),pn=Hi("EXTRACT",!0),Nn=Hi("TRIM",!0),yn=Hi("POSITION",!0),Rn=Hi("TIMESTAMP",!0),Sn=Hi("DATE",!0),In=Hi("TIME",!0),gn=Hi("LEADING",!0),An=Hi("TRAILING",!0),On=Hi("BOTH",!0),wn=Hi("CAST",!0),bn=Hi("AS",!0),Cn=Hi("INTEGER",!0),Ln=Hi("SMALLINT",!0),Mn=Hi("FLOAT",!0),Dn=Hi("REAL",!0),kn=Hi("VARCHAR",!0),Pn=Hi("TO",!0),Un=Hi("INTERVAL",!0),xn=Hi("YEAR",!0),_n=Hi("TIMEZONE_HOUR",!0),Fn=Hi("TIMEZONE_MINUTE",!0),Hn=Hi("MONTH",!0),Yn=Hi("DAY",!0),Gn=Hi("HOUR",!0),$n=Hi("MINUTE",!0),Bn=Hi("SECOND",!0),Wn=Hi("CASE",!0),Vn=Hi("END",!0),Zn=Hi("WHEN",!0),qn=Hi("THEN",!0),Xn=Hi("ELSE",!0),zn=Hi(",",!1),Kn=Hi("(",!1),jn=Hi(")",!1),Jn=Yi([" ","\t","\n","\r"],!1,!1),Qn=Hi("`",!1),et=Yi(["`"],!0,!1),nt=function(e){return e},tt=function(e,n){var t={type:"expression-list"},r=function(e,n){var t=function(e,n){for(var t=[e],r=0;r<n.length;r++)t.push(n[r][3]);return t}(e,n);return t}(e,n);return t.value=r,t.range=_i(),t},rt=function(e,n){return es(e,n)},it=function(e,n){return es(e,n)},ut=function(e){return{type:"unary-expression",operator:"NOT",expr:e,range:_i()}},st=function(e,n){return""==n||null==n||null==n?e:"arithmetic"==n.type?es(e,n.tail):Qu(n.op,e,n.right,n.escape)},ot=function(e){return{type:"arithmetic",tail:e}},at=function(e,n){return{op:e+"NOT",right:n}},ct=function(e,n){return{op:e,right:n}},lt=function(e,n,t){return{op:"NOT"+e,right:{type:"expression-list",value:[n,t],range:_i()}}},ft=function(e,n,t){return{op:e,right:{type:"expression-list",value:[n,t],range:_i()}}},dt=function(e){return e[0]+" "+e[2]},ht=function(e){return e[0]+" "+e[2]},mt=function(e,n,t){return{op:e,right:n,escape:t.value}},Et=function(e,n){return{op:e,right:n,escape:""}},Tt=function(e,n){return{op:e,right:n}},vt=function(e){return{op:e,right:{type:"expression-list",value:[],range:_i()}}},pt=function(e,n){return{op:e,right:n}},Nt=function(e,n){return es(e,n)},yt=function(e,n){return es(e,n)},Rt=function(e){return e.paren=!0,e},St=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",mode:"date",range:_i()}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",mode:"timestamp",range:_i()}:{type:"column-reference",table:"",column:e,range:_i()}},It=function(e){return{type:"column-reference",table:"",column:e,delimited:!0,range:_i()}},gt=function(e){return e},At=function(e,n){return e+n.join("")},Ot=function(e,n){return e+n.join("")},wt=function(e){return e},bt=function(e){return e.join("")},Ct=function(){return'"'},Lt=function(e){return{type:"parameter",value:e[1],range:_i()}},Mt=function(e,n){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:e,range:_i()},n],range:_i()},range:_i()}},Dt=function(e,n,t){return{type:"function",name:"substring",args:{type:"expression-list",value:t?[e,n,t[2]]:[e,n],range:_i()},range:_i()}},kt=function(e,n){return{type:"function",name:"cast",args:{type:"expression-list",value:[e,n],range:_i()},range:_i()}},Pt=function(){return{type:"data-type",value:{type:"integer"},range:_i()}},Ut=function(){return{type:"data-type",value:{type:"smallint"},range:_i()}},xt=function(){return{type:"data-type",value:{type:"float"},range:_i()}},_t=function(){return{type:"data-type",value:{type:"real"},range:_i()}},Ft=function(){return{type:"data-type",value:{type:"date"},range:_i()}},Ht=function(){return{type:"data-type",value:{type:"timestamp"},range:_i()}},Yt=function(){return{type:"data-type",value:{type:"time"},range:_i()}},Gt=function(e){return{type:"data-type",value:{type:"varchar",size:parseInt(e)},range:_i()}},$t=function(e,n,t){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:null==e?"BOTH":e,range:_i()},n,t],range:_i()},range:_i()}},Bt=function(e,n){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:null==e?"BOTH":e,range:_i()},n],range:_i()},range:_i()}},Wt=function(e,n){return{type:"function",name:"position",args:{type:"expression-list",value:[e,n],range:_i()},range:_i()}},Vt=function(e,n){return{type:"function",name:e,args:n||{type:"expression-list",value:[],range:_i()},range:_i()}},Zt=function(e){return"string"===e.type&&!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e.value)&&Fi("Timestamp literal is invalid"),{type:"timestamp",value:e.value,range:_i()}},qt=function(e){return"string"===e.type&&!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e.value)&&Fi("Time literal is invalid"),{type:"time",value:e.value,range:_i()}},Xt=function(e,n,t){return{type:"interval",value:n,qualifier:t,op:e,range:_i()}},zt=function(e,n){return{type:"interval",value:e,qualifier:n,op:"",range:_i()}},Kt=function(e,n){return{type:"interval-qualifier",start:e,end:n,range:_i()}},jt=function(e,n){return{type:"interval-period",period:e.value,precision:n,secondary:null,range:_i()}},Jt=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null,range:_i()}},Qt=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null,range:_i()}},er=function(e,n){return{type:"interval-period",period:"second",precision:e,secondary:n,range:_i()}},nr=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null,range:_i()}},tr=function(){return{type:"interval-period",period:"second",precision:null,secondary:null,range:_i()}},rr=function(e,n){return{type:"interval-period",period:e.value,precision:n,secondary:null,range:_i()}},ir=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null,range:_i()}},ur=function(e,n){return{type:"interval-period",period:"second",precision:e,secondary:n,range:_i()}},sr=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null,range:_i()}},or=function(){return{type:"interval-period",period:"second",precision:null,secondary:null,range:_i()}},ar=function(){return{type:"string",value:"day",range:_i()}},cr=function(){return{type:"string",value:"hour",range:_i()}},lr=function(){return{type:"string",value:"minute",range:_i()}},fr=function(){return{type:"string",value:"month",range:_i()}},dr=function(){return{type:"string",value:"year",range:_i()}},hr=function(e){return parseFloat(e)},mr=function(e){return parseFloat(e)},Er=function(e){return"string"===e.type&&!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e.value)&&Fi("Date literal is invalid"),{type:"date",value:e.value,range:_i()}},Tr=function(){return{type:"null",value:null,range:_i()}},vr=function(){return{type:"boolean",value:!0,range:_i()}},pr=function(){return{type:"boolean",value:!1,range:_i()}},Nr=function(){return"'"},yr=function(e){return{type:"string",value:e.join(""),range:_i()}},Rr=function(e,n){return{type:"case-expression",format:"simple",operand:e,clauses:n,else:null,range:_i()}},Sr=function(e,n,t){return{type:"case-expression",format:"simple",operand:e,clauses:n,else:t.value,range:_i(),elseRange:t.range}},Ir=function(e){return{type:"case-expression",format:"searched",clauses:e,else:null,range:_i()}},gr=function(e,n){return{type:"case-expression",format:"searched",clauses:e,else:n.value,range:_i(),elseRange:n.range}},Ar=function(e,n){return{type:"when-clause",operand:e,value:n,range:_i()}},Or=function(){Fi("Expected 'THEN', but found '"+xi()+"'")},wr=function(e,n){return{type:"when-clause",operand:e,value:n,range:_i()}},br=function(){Fi("Expected 'THEN', but found '"+xi()+"'")},Cr=function(e){return{type:"else-clause",value:e,range:_i()}},Lr=function(e){return{type:"number",value:e,range:_i()}},Mr=function(e,n,t){return parseFloat(e+n+t)},Dr=function(e,n){return parseFloat(e+n)},kr=function(e,n){return parseFloat(e+n)},Pr=function(e){return parseFloat(e)},Ur=function(e,n){return e[0]+n},xr=function(e){return"."+(null!=e?e:"")},_r=function(e,n){return e+n},Fr=function(e){return e.join("")},Hr=function(e,n){return"e"+(null===n?"":n)},Yr=function(){return"IN"},Gr=function(){return"IS"},$r=function(){return"LIKE"},Br=function(){return"ESCAPE"},Wr=function(){return"NOT"},Vr=function(){return"AND"},Zr=function(){return"OR"},qr=function(){return"BETWEEN"},Xr=function(){return"FROM"},zr=function(){return"FOR"},Kr=function(){return"SUBSTRING"},jr=function(){return"EXTRACT"},Jr=function(){return"TRIM"},Qr=function(){return"POSITION"},ei=function(){return"TIMESTAMP"},ni=function(){return"DATE"},ti=function(){return"TIME"},ri=function(){return"LEADING"},ii=function(){return"TRAILING"},ui=function(){return"BOTH"},si=function(){return"CAST"},oi=function(){return"AS"},ai=function(){return"INTEGER"},ci=function(){return"SMALLINT"},li=function(){return"FLOAT"},fi=function(){return"REAL"},di=function(){return"VARCHAR"},hi=function(){return"TO"},mi=function(){return"INTERVAL"},Ei=function(){return"YEAR"},Ti=function(){return"TIMEZONE_HOUR"},vi=function(){return"TIMEZONE_MINUTE"},pi=function(){return"MONTH"},Ni=function(){return"DAY"},yi=function(){return"HOUR"},Ri=function(){return"MINUTE"},Si=function(){return"SECOND"},Ii=function(){return"CASE"},gi=function(){return"END"},Ai=function(){return"WHEN"},Oi=function(){return"THEN"},wi=function(){return"ELSE"},bi=function(e){return e},Ci=function(e){return e.join("")},Li=0,Mi=0,Di=[{line:1,column:1}],ki=0,Pi=[],Ui=0;if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function xi(){return n.substring(Mi,Li)}function _i(){return $i(Mi,Li)}function Fi(n,t){throw function(n,t){return new e(n,null,null,t)}(n,t=void 0!==t?t:$i(Mi,Li))}function Hi(e,n){return{type:"literal",text:e,ignoreCase:n}}function Yi(e,n,t){return{type:"class",parts:e,inverted:n,ignoreCase:t}}function Gi(e){var t,r=Di[e];if(r)return r;for(t=e-1;!Di[t];)t--;for(r={line:(r=Di[t]).line,column:r.column};t<e;)10===n.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return Di[e]=r,r}function $i(e,n,t){var r=Gi(e),i=Gi(n),s={source:u,start:{offset:e,line:r.line,column:r.column},end:{offset:n,line:i.line,column:i.column}};return t&&u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}function Bi(e){Li<ki||(Li>ki&&(ki=Li,Pi=[]),Pi.push(e))}function Wi(){var e,n;return e=Li,ju(),(n=Zi())!==i?(ju(),Mi=e,e=nt(n)):(Li=e,e=i),e}function Vi(){var e,n,t,r,u,s,o,a;if(e=Li,(n=Zi())!==i){for(t=[],r=Li,u=ju(),(s=Xu())!==i?(o=ju(),(a=Zi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Xu())!==i?(o=ju(),(a=Zi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=tt(n,t)}else Li=e,e=i;return e}function Zi(){var e,n,t,r,u,s,o,a;if(e=Li,(n=qi())!==i){for(t=[],r=Li,u=ju(),(s=Lu())!==i?(o=ju(),(a=qi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Lu())!==i?(o=ju(),(a=qi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=rt(n,t)}else Li=e,e=i;return e}function qi(){var e,n,t,r,u,s,o,a;if(e=Li,(n=Xi())!==i){for(t=[],r=Li,u=ju(),(s=Cu())!==i?(o=ju(),(a=Xi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Cu())!==i?(o=ju(),(a=Xi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=it(n,t)}else Li=e,e=i;return e}function Xi(){var e,t,r,u,s;return e=Li,(t=bu())===i&&(t=Li,33===n.charCodeAt(Li)?(r=a,Li++):(r=i,0===Ui&&Bi(Me)),r!==i?(u=Li,Ui++,61===n.charCodeAt(Li)?(s=c,Li++):(s=i,0===Ui&&Bi(De)),Ui--,s===i?u=void 0:(Li=u,u=i),u!==i?t=r=[r,u]:(Li=t,t=i)):(Li=t,t=i)),t!==i?(r=ju(),(u=Xi())!==i?(Mi=e,e=ut(u)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=function(){var e,t,r;return e=Li,(t=Ji())!==i?(ju(),r=function(){var e;return e=function(){var e,n,t,r,u,s,o;if(e=Li,n=[],t=Li,r=ju(),(u=zi())!==i?(s=ju(),(o=Ji())!==i?t=r=[r,u,s,o]:(Li=t,t=i)):(Li=t,t=i),t!==i)for(;t!==i;)n.push(t),t=Li,r=ju(),(u=zi())!==i?(s=ju(),(o=Ji())!==i?t=r=[r,u,s,o]:(Li=t,t=i)):(Li=t,t=i);else n=i;return n!==i&&(Mi=e,n=ot(n)),e=n}(),e===i&&(e=function(){var e,n,t,r;return e=Li,(n=ji())!==i?(ju(),(t=zu())!==i?(ju(),(r=Vi())!==i?(ju(),Ku()!==i?(Mi=e,e=Tt(n,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=ji())!==i?(ju(),(t=zu())!==i?(ju(),(r=Ku())!==i?(Mi=e,e=vt(n)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=ji())!==i?(ju(),(t=cu())!==i?(Mi=e,e=pt(n,t)):(Li=e,e=i)):(Li=e,e=i))),e}(),e===i&&(e=function(){var e,n,t,r,u,s;return e=Li,(n=bu())!==i?(ju(),(t=Mu())!==i?(ju(),(r=Ji())!==i?(ju(),(u=Cu())!==i?(ju(),(s=Ji())!==i?(Mi=e,e=lt(t,r,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Mu())!==i?(ju(),(t=Ji())!==i?(ju(),(r=Cu())!==i?(ju(),(u=Ji())!==i?(Mi=e,e=ft(n,t,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}(),e===i&&(e=function(){var e,n,t,r;return e=Li,(n=Ou())!==i?(ju(),(t=bu())!==i?(ju(),(r=Ji())!==i?(Mi=e,e=at(n,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Ou())!==i?(ju(),(t=Ji())!==i?(Mi=e,e=ct(n,t)):(Li=e,e=i)):(Li=e,e=i)),e}(),e===i&&(e=function(){var e,t,r,u,s;return e=Li,(t=Ki())!==i?(ju(),(r=Eu())!==i?(ju(),u=function(){var e,t,r,u;return e=Li,n.substr(Li,6).toLowerCase()===D?(t=n.substr(Li,6),Li+=6):(t=i,0===Ui&&Bi(ln)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Br()):(Li=e,e=i)):(Li=e,e=i),e}(),u!==i?(ju(),(s=Tu())!==i?(Mi=e,e=mt(t,r,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(t=Ki())!==i?(ju(),(r=Eu())!==i?(Mi=e,e=Et(t,r)):(Li=e,e=i)):(Li=e,e=i)),e}())))),e}(),r===i&&(r=null),Mi=e,e=st(t,r)):(Li=e,e=i),e}()),e}function zi(){var e;return n.substr(Li,2)===l?(e=l,Li+=2):(e=i,0===Ui&&Bi(ke)),e===i&&(62===n.charCodeAt(Li)?(e=f,Li++):(e=i,0===Ui&&Bi(Pe)),e===i&&(n.substr(Li,2)===d?(e=d,Li+=2):(e=i,0===Ui&&Bi(Ue)),e===i&&(n.substr(Li,2)===h?(e=h,Li+=2):(e=i,0===Ui&&Bi(xe)),e===i&&(60===n.charCodeAt(Li)?(e=m,Li++):(e=i,0===Ui&&Bi(_e)),e===i&&(61===n.charCodeAt(Li)?(e=c,Li++):(e=i,0===Ui&&Bi(De)),e===i&&(n.substr(Li,2)===E?(e=E,Li+=2):(e=i,0===Ui&&Bi(Fe)))))))),e}function Ki(){var e,n,t,r,u;return e=Li,n=Li,(t=bu())!==i?(r=ju(),(u=wu())!==i?n=t=[t,r,u]:(Li=n,n=i)):(Li=n,n=i),n!==i&&(Mi=e,n=dt(n)),(e=n)===i&&(e=wu()),e}function ji(){var e,n,t,r,u;return e=Li,n=Li,(t=bu())!==i?(r=ju(),(u=Au())!==i?n=t=[t,r,u]:(Li=n,n=i)):(Li=n,n=i),n!==i&&(Mi=e,n=ht(n)),(e=n)===i&&(e=Au()),e}function Ji(){var e,n,t,r,u,s,o,a;if(e=Li,(n=eu())!==i){for(t=[],r=Li,u=ju(),(s=Qi())!==i?(o=ju(),(a=eu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Qi())!==i?(o=ju(),(a=eu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=Nt(n,t)}else Li=e,e=i;return e}function Qi(){var e;return 43===n.charCodeAt(Li)?(e=T,Li++):(e=i,0===Ui&&Bi(He)),e===i&&(45===n.charCodeAt(Li)?(e=v,Li++):(e=i,0===Ui&&Bi(Ye)),e===i&&(n.substr(Li,2)===p?(e=p,Li+=2):(e=i,0===Ui&&Bi(Ge)))),e}function eu(){var e,n,t,r,u,s,o,a;if(e=Li,(n=tu())!==i){for(t=[],r=Li,u=ju(),(s=nu())!==i?(o=ju(),(a=tu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=nu())!==i?(o=ju(),(a=tu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=yt(n,t)}else Li=e,e=i;return e}function nu(){var e;return 42===n.charCodeAt(Li)?(e=N,Li++):(e=i,0===Ui&&Bi($e)),e===i&&(47===n.charCodeAt(Li)?(e=y,Li++):(e=i,0===Ui&&Bi(Be))),e}function tu(){var e,t;return e=function(){var e;return(e=Tu())===i&&(e=function(){var e,n,t,r;return e=Li,n=function(){var e,n,t,r;return e=Li,(n=yu())!==i&&(t=Ru())!==i&&(r=Su())!==i?(Mi=e,e=Mr(n,t,r)):(Li=e,e=i),e===i&&(e=Li,(n=yu())!==i&&(t=Ru())!==i?(Mi=e,e=Dr(n,t)):(Li=e,e=i),e===i&&(e=Li,(n=yu())!==i&&(t=Su())!==i?(Mi=e,e=kr(n,t)):(Li=e,e=i),e===i&&(e=Li,(n=yu())!==i&&(Mi=e,n=Pr(n)),e=n))),e}(),n!==i?(t=Li,Ui++,r=iu(),Ui--,r===i?t=void 0:(Li=t,t=i),t!==i?(Mi=e,e=Lr(n)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===w?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(un)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?e=t=[t,r]:(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=vr()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,5).toLowerCase()===b?(t=n.substr(Li,5),Li+=5):(t=i,0===Ui&&Bi(sn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?e=t=[t,r]:(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=pr()),e=t),e}(),e===i&&(e=function(){var e,t;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===O?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(rn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?e=t=[t,r]:(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=Tr()),e=t}(),e===i&&(e=function(){var e,n;return e=Li,Uu()!==i?(ju(),(n=Eu())!==i?(Mi=e,e=Er(n)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,n;return e=Li,Pu()!==i?(ju(),(n=Eu())!==i?(Mi=e,e=Zt(n)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u;return e=Li,_u()!==i?(ju(),45===n.charCodeAt(Li)?(t=v,Li++):(t=i,0===Ui&&Bi(Ye)),t===i&&(43===n.charCodeAt(Li)?(t=T,Li++):(t=i,0===Ui&&Bi(He))),t!==i?(ju(),(r=Eu())!==i?(ju(),(u=fu())!==i?(Mi=e,e=Xt(t,r,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,_u()!==i?(ju(),(t=Eu())!==i?(ju(),(r=fu())!==i?(Mi=e,e=zt(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}(),e===i&&(e=function(){var e,n;return e=Li,xu()!==i?(ju(),(n=Eu())!==i?(Mi=e,e=qt(n)):(Li=e,e=i)):(Li=e,e=i),e}()))))))),e}(),e===i&&(e=function(){var e,t,r,u;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===Y?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(pn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=jr()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),r=function(){var e;return(e=Fu())===i&&(e=Hu())===i&&(e=Yu())===i&&(e=Gu())===i&&(e=$u())===i&&(e=Bu())===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,13).toLowerCase()===ue?(t=n.substr(Li,13),Li+=13):(t=i,0===Ui&&Bi(_n)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ti()):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,15).toLowerCase()===se?(t=n.substr(Li,15),Li+=15):(t=i,0===Ui&&Bi(Fn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=vi()):(Li=e,e=i)):(Li=e,e=i),e}())),e}(),r!==i?(ju(),Du()!==i?(ju(),(u=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Mt(r,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u,s,o,a,c;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,9).toLowerCase()===H?(t=n.substr(Li,9),Li+=9):(t=i,0===Ui&&Bi(vn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Kr()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Zi())!==i?(ju(),Du()!==i?(ju(),(u=Zi())!==i?(ju(),s=Li,o=function(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===F?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(Tn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=zr()):(Li=e,e=i)):(Li=e,e=i),e}(),o!==i?(a=ju(),(c=Zi())!==i?s=o=[o,a,c,ju()]:(Li=s,s=i)):(Li=s,s=i),s===i&&(s=null),(o=Ku())!==i?(Mi=e,e=Dt(r,u,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&((e=function(){var e,n,t,r;return e=Li,ku()!==i?(ju(),zu()!==i?(ju(),(n=lu())===i&&(n=null),ju(),(t=Zi())!==i?(ju(),Du()!==i?(ju(),(r=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=$t(n,t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,ku()!==i?(ju(),zu()!==i?(ju(),(n=lu())===i&&(n=null),ju(),(t=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Bt(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}())===i&&(e=function(){var e,t,r,u;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===$?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(yn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Qr()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Zi())!==i?(ju(),Au()!==i?(ju(),(u=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Wt(r,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u,s;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===z?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(wn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=si()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Zi())!==i?(ju(),u=function(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===K?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(bn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=oi()):(Li=e,e=i)):(Li=e,e=i),e}(),u!==i?(ju(),s=function(){var e,t,r;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===j?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(Cn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ai()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=Pt()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===J?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(Ln)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ci()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=Ut()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,5).toLowerCase()===Q?(t=n.substr(Li,5),Li+=5):(t=i,0===Ui&&Bi(Mn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=li()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=xt()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===ee?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Dn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=fi()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=_t()),(e=t)===i&&(e=Li,(t=Uu())!==i&&(Mi=e,t=Ft()),(e=t)===i&&(e=Li,(t=Pu())!==i&&(Mi=e,t=Ht()),(e=t)===i&&(e=Li,(t=xu())!==i&&(Mi=e,t=Yt()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===ne?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(kn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=di()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Iu())!==i?(ju(),Ku()!==i?(Mi=e,e=Gt(r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)))))))),e}(),s!==i?(ju(),Ku()!==i?(Mi=e,e=kt(r,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r;return e=Li,t=function(){var e,t,r,u;if(e=Li,(t=ru())!==i&&(Mi=e,t=bi(t)),(e=t)===i)if(e=Li,96===n.charCodeAt(Li)?(t=ye,Li++):(t=i,0===Ui&&Bi(Qn)),t!==i){if(r=[],Le.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(et)),u!==i)for(;u!==i;)r.push(u),Le.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(et));else r=i;r!==i?(96===n.charCodeAt(Li)?(u=ye,Li++):(u=i,0===Ui&&Bi(Qn)),u!==i?(Mi=e,e=Ci(r)):(Li=e,e=i)):(Li=e,e=i)}else Li=e,e=i;return e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Vi())===i&&(r=null),ju(),Ku()!==i?(Mi=e,e=Vt(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e;return e=function(){var e,n,t,r,u;if(e=Li,Wu()!==i)if(ju(),(n=Zi())!==i){for(ju(),t=[],r=pu();r!==i;)t.push(r),r=pu();r=ju(),(u=Vu())!==i?(Mi=e,e=Rr(n,t)):(Li=e,e=i)}else Li=e,e=i;else Li=e,e=i;if(e===i)if(e=Li,Wu()!==i)if(ju(),(n=Zi())!==i){for(ju(),t=[],r=pu();r!==i;)t.push(r),r=pu();r=ju(),(u=Nu())!==i?(ju(),Vu()!==i?(Mi=e,e=Sr(n,t,u)):(Li=e,e=i)):(Li=e,e=i)}else Li=e,e=i;else Li=e,e=i;return e}(),e===i&&(e=function(){var e,n,t,r;if(e=Li,Wu()!==i){for(ju(),n=[],t=vu();t!==i;)n.push(t),t=vu();t=ju(),(r=Vu())!==i?(Mi=e,e=Ir(n)):(Li=e,e=i)}else Li=e,e=i;if(e===i)if(e=Li,Wu()!==i){for(ju(),n=[],t=vu();t!==i;)n.push(t),t=vu();t=ju(),(r=Nu())!==i?(ju(),Vu()!==i?(Mi=e,e=gr(n,r)):(Li=e,e=i)):(Li=e,e=i)}else Li=e,e=i;return e}()),e}(),e===i&&(e=function(){var e,n;return e=Li,n=function(){var e,n;return e=Li,n=function(){var e,n,t,r;if(e=Li,(n=iu())!==i){for(t=[],r=su();r!==i;)t.push(r),r=su();Mi=e,e=At(n,t)}else Li=e,e=i;return e}(),n!==i&&(Mi=e,n=gt(n)),e=n}(),n!==i&&(Mi=e,n=St(n)),(e=n)===i&&(e=Li,n=function(){var e,n;return e=Li,au()!==i?(n=function(){var e,n,t;for(e=Li,n=[],t=ou();t!==i;)n.push(t),t=ou();return Mi=e,e=n=bt(n)}(),au()!==i?(Mi=e,e=wt(n)):(Li=e,e=i)):(Li=e,e=i),e}(),n!==i&&(Mi=e,n=It(n)),e=n),e}(),e===i&&(e=cu())===i&&(e=Li,zu()!==i?(ju(),(t=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Rt(t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)))))))))),e}function ru(){var e,n,t,r;if(e=Li,(n=iu())!==i){for(t=[],r=uu();r!==i;)t.push(r),r=uu();Mi=e,e=Ot(n,t)}else Li=e,e=i;return e}function iu(){var e;return Re.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(We)),e}function uu(){var e;return Se.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Ve)),e}function su(){var e;return Ie.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Ze)),e}function ou(){var e;return(e=function(){var e;return Ie.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Ze)),e}())===i&&(e=function(){var e;return e=Li,au()!==i&&au()!==i?(Mi=e,e=Ct()):(Li=e,e=i),e}()),e}function au(){var e;return ge.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(qe)),e}function cu(){var e,t,r,u;return e=Li,t=Li,64===n.charCodeAt(Li)?(r=R,Li++):(r=i,0===Ui&&Bi(Xe)),r!==i&&(u=ru())!==i?t=r=[r,u]:(Li=t,t=i),t!==i&&(Mi=e,t=Lt(t)),t}function lu(){var e;return(e=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===Z?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(gn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ri()):(Li=e,e=i)):(Li=e,e=i),e}())===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===q?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(An)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ii()):(Li=e,e=i)):(Li=e,e=i),e}())===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===X?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(On)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ui()):(Li=e,e=i)):(Li=e,e=i),e}()),e}function fu(){var e,t,r,u;return e=Li,t=function(){var e,n,t;return e=Li,(n=du())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Ku()!==i?(Mi=e,e=jt(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=du())!==i&&(Mi=e,n=Jt(n)),e=n),e}(),t!==i?(ju(),r=function(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===te?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(Pn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=hi()):(Li=e,e=i)):(Li=e,e=i),e}(),r!==i?(ju(),u=function(){var e,n,t,r;return e=Li,(n=du())!==i&&(Mi=e,n=Qt(n)),(e=n)===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Xu()!==i?(ju(),(r=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=er(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Ku()!==i?(Mi=e,e=nr(t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i&&(Mi=e,n=tr()),e=n))),e}(),u!==i?(Mi=e,e=Kt(t,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=function(){var e,n,t,r;return e=Li,(n=du())!==i?(ju(),zu()!==i?(ju(),(t=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=rr(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=du())!==i&&(Mi=e,n=ir(n)),(e=n)===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Xu()!==i?(ju(),(r=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=ur(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=sr(t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i&&(Mi=e,n=or()),e=n)))),e}()),e}function du(){var e,n;return e=Li,(n=Yu())!==i&&(Mi=e,n=ar()),(e=n)===i&&(e=Li,(n=Gu())!==i&&(Mi=e,n=cr()),(e=n)===i&&(e=Li,(n=$u())!==i&&(Mi=e,n=lr()),(e=n)===i&&(e=Li,(n=Hu())!==i&&(Mi=e,n=fr()),(e=n)===i&&(e=Li,(n=Fu())!==i&&(Mi=e,n=dr()),e=n)))),e}function hu(){var e,n;return e=Li,(n=Iu())!==i&&(Mi=e,n=hr(n)),n}function mu(){var e,n;return e=Li,(n=Iu())!==i&&(Mi=e,n=mr(n)),n}function Eu(){var e;return(e=Tu())===i&&(e=cu()),e}function Tu(){var e,t,r,u,s;if(e=Li,39===n.charCodeAt(Li)?(t=S,Li++):(t=i,0===Ui&&Bi(ze)),t===i&&(n.substr(Li,2)===I?(t=I,Li+=2):(t=i,0===Ui&&Bi(Ke))),t!==i){for(r=[],u=Li,n.substr(Li,2)===g?(s=g,Li+=2):(s=i,0===Ui&&Bi(je)),s!==i&&(Mi=u,s=Nr()),(u=s)===i&&(Ae.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(Je)));u!==i;)r.push(u),u=Li,n.substr(Li,2)===g?(s=g,Li+=2):(s=i,0===Ui&&Bi(je)),s!==i&&(Mi=u,s=Nr()),(u=s)===i&&(Ae.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(Je)));39===n.charCodeAt(Li)?(u=S,Li++):(u=i,0===Ui&&Bi(ze)),u!==i?(Mi=e,e=yr(r)):(Li=e,e=i)}else Li=e,e=i;return e}function vu(){var e,n,t;return e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),qu()!==i?(ju(),(t=Zi())!==i?(Mi=e,e=Ar(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),Zi()!==i?(Mi=e,e=Or()):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}function pu(){var e,n,t;return e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),qu()!==i?(ju(),(t=Zi())!==i?(Mi=e,e=wr(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),Zi()!==i?(Mi=e,e=br()):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}function Nu(){var e,t,r;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===Te?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Xn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=wi()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),(r=Zi())!==i?(Mi=e,e=Cr(r)):(Li=e,e=i)):(Li=e,e=i),e}function yu(){var e,t,r;return(e=Iu())===i&&(e=Li,45===n.charCodeAt(Li)?(t=v,Li++):(t=i,0===Ui&&Bi(Ye)),t===i&&(43===n.charCodeAt(Li)?(t=T,Li++):(t=i,0===Ui&&Bi(He))),t!==i&&(r=Iu())!==i?(Mi=e,e=Ur(t,r)):(Li=e,e=i)),e}function Ru(){var e,t,r;return e=Li,46===n.charCodeAt(Li)?(t=A,Li++):(t=i,0===Ui&&Bi(Qe)),t!==i?((r=Iu())===i&&(r=null),Mi=e,e=xr(r)):(Li=e,e=i),e}function Su(){var e,t,r;return e=Li,t=function(){var e,t,r;return e=Li,we.test(n.charAt(Li))?(t=n.charAt(Li),Li++):(t=i,0===Ui&&Bi(nn)),t!==i?(be.test(n.charAt(Li))?(r=n.charAt(Li),Li++):(r=i,0===Ui&&Bi(tn)),r===i&&(r=null),Mi=e,e=Hr(t,r)):(Li=e,e=i),e}(),t!==i&&(r=Iu())!==i?(Mi=e,e=_r(t,r)):(Li=e,e=i),e}function Iu(){var e,n,t;if(e=Li,n=[],(t=gu())!==i)for(;t!==i;)n.push(t),t=gu();else n=i;return n!==i&&(Mi=e,n=Fr(n)),n}function gu(){var e;return Oe.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(en)),e}function Au(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===C?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(on)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Yr()):(Li=e,e=i)):(Li=e,e=i),e}function Ou(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===L?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(an)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Gr()):(Li=e,e=i)):(Li=e,e=i),e}function wu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===M?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(cn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=$r()):(Li=e,e=i)):(Li=e,e=i),e}function bu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===k?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(fn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Wr()):(Li=e,e=i)):(Li=e,e=i),e}function Cu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===P?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(dn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Vr()):(Li=e,e=i)):(Li=e,e=i),e}function Lu(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===U?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(hn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Zr()):(Li=e,e=i)):(Li=e,e=i),e}function Mu(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===x?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(mn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=qr()):(Li=e,e=i)):(Li=e,e=i),e}function Du(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===_?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(En)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Xr()):(Li=e,e=i)):(Li=e,e=i),e}function ku(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===G?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Nn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Jr()):(Li=e,e=i)):(Li=e,e=i),e}function Pu(){var e,t,r,u;return e=Li,n.substr(Li,9).toLowerCase()===B?(t=n.substr(Li,9),Li+=9):(t=i,0===Ui&&Bi(Rn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ei()):(Li=e,e=i)):(Li=e,e=i),e}function Uu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===W?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Sn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ni()):(Li=e,e=i)):(Li=e,e=i),e}function xu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===V?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(In)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ti()):(Li=e,e=i)):(Li=e,e=i),e}function _u(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===re?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(Un)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=mi()):(Li=e,e=i)):(Li=e,e=i),e}function Fu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===ie?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(xn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ei()):(Li=e,e=i)):(Li=e,e=i),e}function Hu(){var e,t,r,u;return e=Li,n.substr(Li,5).toLowerCase()===oe?(t=n.substr(Li,5),Li+=5):(t=i,0===Ui&&Bi(Hn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=pi()):(Li=e,e=i)):(Li=e,e=i),e}function Yu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===ae?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(Yn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ni()):(Li=e,e=i)):(Li=e,e=i),e}function Gu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===ce?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Gn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=yi()):(Li=e,e=i)):(Li=e,e=i),e}function $u(){var e,t,r,u;return e=Li,n.substr(Li,6).toLowerCase()===le?(t=n.substr(Li,6),Li+=6):(t=i,0===Ui&&Bi($n)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ri()):(Li=e,e=i)):(Li=e,e=i),e}function Bu(){var e,t,r,u;return e=Li,n.substr(Li,6).toLowerCase()===fe?(t=n.substr(Li,6),Li+=6):(t=i,0===Ui&&Bi(Bn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Si()):(Li=e,e=i)):(Li=e,e=i),e}function Wu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===de?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Wn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ii()):(Li=e,e=i)):(Li=e,e=i),e}function Vu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===he?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(Vn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=gi()):(Li=e,e=i)):(Li=e,e=i),e}function Zu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===me?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Zn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ai()):(Li=e,e=i)):(Li=e,e=i),e}function qu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===Ee?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(qn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Oi()):(Li=e,e=i)):(Li=e,e=i),e}function Xu(){var e;return 44===n.charCodeAt(Li)?(e=ve,Li++):(e=i,0===Ui&&Bi(zn)),e}function zu(){var e;return 40===n.charCodeAt(Li)?(e=pe,Li++):(e=i,0===Ui&&Bi(Kn)),e}function Ku(){var e;return 41===n.charCodeAt(Li)?(e=Ne,Li++):(e=i,0===Ui&&Bi(jn)),e}function ju(){var e,n;for(e=[],n=Ju();n!==i;)e.push(n),n=Ju();return e}function Ju(){var e;return Ce.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Jn)),e}function Qu(e,n,t,r){var i={type:"binary-expression",operator:e,left:n,right:t,range:_i()};return void 0!==r&&(i.escape=r),i}function es(e,n){for(var t=e,r=0;r<n.length;r++)t=Qu(n[r][1],t,n[r][3]);return t}if((r=o())!==i&&Li===n.length)return r;throw r!==i&&Li<n.length&&Bi({type:"end"}),function(n,t,r){return new e(e.buildMessage(n,t),n,t,r)}(Pi,ki<n.length?n.charAt(ki):null,$i(ki,ki<n.length?ki+1:ki))}}}();Mi.SyntaxError.prototype.name="PeggySyntaxError";const Di=Mi.parse,ki=(e,n,t,r,i)=>{switch(n.type){case"interval":{if(!i)return void Ui(r,"INTERVAL",!1);const u=e.findNextMatch(/\)|,/u,{lineNumber:n.range.end.line,column:n.range.end.column},!0,!0,null,!0).range,[s,o]=Zi(t,i,u);return void((s??o)&&Ui(r,"INTERVAL",!1))}case"case-expression":{const e={startColumn:n.range.start.column,endColumn:n.range.start.column+4,startLineNumber:n.range.start.line,endLineNumber:n.range.start.line},i={startColumn:n.range.end.column-3,endColumn:n.range.end.column,startLineNumber:n.range.end.line,endLineNumber:n.range.end.line},[u,s]=Zi(t,e,i);return void((u??s)&&Ui(r,"CASE",!1))}case"expression-list":{const i=n.value;let u;return void i.forEach(((s,o)=>{if(0===o){const t=e.findMatches("(",{startLineNumber:1,endLineNumber:n.range.start.line,startColumn:1,endColumn:n.range.start.column},!1,!0,null,!0);u=t[t.length-1].range}ki(e,s,t,r,u),u=Wi(o+1,s,e,i.length)}))}case"unary-expression":return void ki(e,n.expr,t,r,void 0);case"binary-expression":return ki(e,n.left,t,r,void 0),void ki(e,n.right,t,r,void 0);case"null":case"boolean":case"string":case"timestamp":case"date":case"time":case"number":case"current-time":case"data-type":case"parameter":case"when-clause":case"interval-period":case"interval-qualifier":return;case"column-reference":{const u=n.column,s=Vi(u);if(!i)return void(s&&Ui(r,u,!1));const o=e.getValueInRange(i),a=e.findNextMatch(/\)|,/u,{column:n.range.start.column,lineNumber:n.range.start.line},!0,!0,null,!0).range,[c,l]=Zi(t,i,a);return void((c??l)&&s&&Ui(r,u,"("===o))}case"function":{const i=n.name,u=n.args.value,s={startLineNumber:n.range.start.line,endLineNumber:n.range.start.line,startColumn:n.range.start.column,endColumn:n.range.start.column+i.length},o={startLineNumber:n.range.end.line,endLineNumber:n.range.end.line,startColumn:n.range.end.column,endColumn:n.range.end.column},[a,c]=Zi(t,s,o);let l;return(a??c)&&Ui(r,i,!1),void u.forEach(((i,s)=>{let o=!1;switch(i.type){case"function":case"column-reference":case"interval":case"case-expression":o=!0}0===s&&(l=e.findNextMatch("(",{column:n.range.start.column,lineNumber:n.range.start.line},!1,!0,null,!0).range),!o&&"string"===i.type&&"BOTH"===i.value||(ki(e,i,t,r,l),l=Wi(s+1,i,e,u.length))}))}default:throw new xr(kr.UnsupportedSyntax,{node:n})}},Pi=(e,t,r)=>{const i=Bi(e),u=i?.map((e=>{const i=$i.includes(e.toUpperCase())?n.CompletionItemKind.TypeParameter:n.CompletionItemKind.Keyword;return{label:e,kind:i,insertText:e,range:t,sortText:String.fromCharCode(121-r)}}));return u??[]},Ui=(e,n,t)=>{t?e.additionalContext=n:e.contextString=n},xi=["AND","OR","IS","ISNOT","IN","NOT IN","BETWEEN","NOTBETWEEN","LIKE","NOT LIKE"],_i="ac";class Fi{constructor(e){this._defaults=e}async provideCompletionItems(e,t){const r=this._defaults.getFeatureLayerForModel(e.uri.toString()),i=e.getWordUntilPosition(t),u={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},s=function(e,n,t){try{const r=n.getValue();return((e,n,t,r)=>{const i={contextString:"NONE",additionalContext:"NONE"};ki(e,n,r,i,void 0);const{contextString:u,additionalContext:s}=i;return[...Pi(u,t,0),...Pi(s,t,1)]})(n,Di(r),e,t)}catch{const r=/(?:\(|\)|\s|,)/u,i=e=>{const n=void 0!==zi(e),t=Vi(e),r=""!==e&&"'"!==e,i=["(",")",",","END"].includes(e);return r&&(n||t||i)},u=n.getValueInRange({startColumn:1,endColumn:t.column,startLineNumber:1,endLineNumber:t.lineNumber}).toUpperCase().split(r).map((e=>e.trim())).filter((e=>i(e))),s=[];for(let e=0;e<u.length;e++){const n=u[e],t=s.length>0;if(e<u.length-1){const t=u[e+1];if(zi(n)&&"("!==t)continue}if("("!==n&&","!==n)if(")"!==n&&"END"!==n){if(e!==u.length-1||!zi(n))if(e>0){const t=Vi(u[e-1]);Vi(n)&&t||s.push(n)}else 0===e&&s.push(n)}else t&&s.pop();else t&&Vi(s[s.length-1])&&s.pop()}let o=[];return[...new Set(s)].forEach(((n,t)=>{const r=Pi(n,e,t);o=[...o,...r]})),o}}(u,e,t),{sqlKeywordsCompletion:o,sqlBinOpsCompletion:a,sqlFunctionCompletion:c,fieldsCompletion:l,sqlDataTypeCompletion:f}=function(e,t){const r=e.fields.map((e=>({label:e.name,kind:n.CompletionItemKind.Variable,insertText:e.name,range:t,sortText:"zaa"}))),i=Object.entries(Li).map((([e])=>e.toString().toLowerCase()));return{fieldsCompletion:r,sqlFunctionCompletion:[...Gi.flatMap((e=>{const r=e.toLowerCase(),i=Hi[r],{name:u,snippet:s,parameters:o,returnValue:a,description:c,examples:l}=i,f={kind:n.CompletionItemKind.Function,range:t,sortText:`z${_i}`,detail:qi(u,o,a),documentation:Xi(c,l)};return Array.isArray(s)&&s.length?[{...f,label:u,insertText:s[0]},{...f,label:u.slice(0,-2),insertText:s[1]}]:[{...f,label:u,insertText:s}]})),...i.flatMap((e=>{const r=Hi[e],i=e.toUpperCase();if(!r)return{label:`${i}()`,kind:n.CompletionItemKind.Function,insertText:`${i}(\${1})`,range:t,sortText:`z${_i}`,insertTextRules:n.CompletionItemInsertTextRule.InsertAsSnippet};if(Array.isArray(r)){const e=r.map((({name:e,snippet:r,parameters:i,returnValue:u,description:s,examples:o},a)=>({label:`${e}${" ".repeat(a)}`,kind:n.CompletionItemKind.Function,insertText:r,range:t,sortText:`z${_i}`,insertTextRules:n.CompletionItemInsertTextRule.InsertAsSnippet,detail:qi(e,i,u),documentation:Xi(s,o)})));return e}const{name:u,snippet:s,parameters:o,returnValue:a,description:c,examples:l}=r;return{label:u,kind:n.CompletionItemKind.Function,insertText:s,range:t,sortText:`z${_i}`,insertTextRules:n.CompletionItemInsertTextRule.InsertAsSnippet,detail:qi(u,o,a),documentation:Xi(c,l)}}))],sqlBinOpsCompletion:xi.map((e=>{const r=e=>"ISNOT"===e?"IS NOT":"NOTBETWEEN"===e?"NOT BETWEEN":e;return{label:r(e),kind:n.CompletionItemKind.Keyword,insertText:r(e),range:t,sortText:"zc"}})),sqlKeywordsCompletion:Yi.map((e=>"CASE"===e?{label:e,kind:n.CompletionItemKind.Snippet,insertText:"CASE\n\tWHEN condition1 THEN result1 \n\tELSE result\nEND",range:t,sortText:"zb"}:{label:e,kind:n.CompletionItemKind.Keyword,insertText:e,range:t,sortText:"zc"})),sqlDataTypeCompletion:$i.map((e=>({label:e,kind:n.CompletionItemKind.TypeParameter,insertText:e,range:t,sortText:"zd"})))}}(r,u),d=new Map;return[...o,...a,...f,...c,...l,...s].forEach((e=>{const{sortText:n}=e,t=e.label;d.get(t)||d.set(t,e),n.charCodeAt(0)<d.get(t).sortText.charCodeAt(0)&&d.set(t,e)})),{suggestions:Array.from(d.entries()).map((([,e])=>e))}}}const Hi={...u,...o,char_length:{description:"Returns the number of characters in the text string as an integer.",parameters:[{name:"string",type:"String",description:"The text string to return the length of."}],returnValue:"Number",examples:[{description:"Returns 11",code:"CHAR_LENGTH('Nova Scotia')"}],snippet:"CHAR_LENGTH(${1})",name:"CHAR_LENGTH()",bundle:"String"},coalesce:{description:"Returns the first value in the list that is not `NULL`.",parameters:[{name:"val_1",type:["String","Number"],description:"The first value in the list."},{name:"val_2",type:["String","Number"],description:"The second value in the list."},{name:"val_n",type:["String","Number"],description:"The following values in the list."}],returnValue:["String","Number"],examples:[{description:"Returns 'Green goldfish'",code:"COALESCE(`NULL`, `NULL`, 'Green goldfish', `NULL`, 'Purple cow')"},{description:"Returns -21",code:"COALESCE(`NULL`, -21, 33, `NULL`)"}],snippet:"COALESCE(${1}, ${2},..., ${3})",name:"COALESCE()",bundle:"String"},concat:{description:"Concatenates two strings together.",parameters:[{name:"string1",type:"String",description:"The first text string."},{name:"string2",type:"String",description:"The text string to concatenate to the first text string."}],returnValue:"String",examples:[{description:"Returns 'Maple syrup'",code:"CONCAT('Maple ', 'syrup')"}],snippet:"CONCAT(${1}, ${2})",name:"CONCAT()",bundle:"String"},lower:{description:"Converts all characters in the text string to lowercase.",parameters:[{name:"string",type:"String",description:"The text string to convert to lowercase."}],returnValue:"String",examples:[{description:"Returns 'hello world'",code:"LOWER('HELLO WORLD')"}],snippet:"LOWER(${1})",name:"LOWER()",bundle:"String"},position:{description:"Returns the first occurrence of a substring in another text string. Returns 0 if the substring is not found.",parameters:[{name:"substring",type:"String",description:"The text string to search for in string."},{name:"string",type:"String",description:"The string that will be searched for the substring."}],returnValue:"Number",examples:[{description:"Returns 6",code:"POSITION('com','esri.com')"},{description:"Returns 9",code:"POSITION('SUM', 'Lorem ipsum')"}],snippet:"POSITION(${1}, ${2})",name:"POSITION()",bundle:"String"},substring:[{description:"Returns a subset of characters in a text string from a starting point to the specified string length.",parameters:[{name:"string",type:"String",description:"The text string to extract from."},{name:"start",type:"Number",description:"The integer value that specifies where the returned characters will start."},{name:"length",type:"Number",description:"The number of characters to extract."}],returnValue:"String",examples:[{description:"Returns 'City'",code:"SUBSTRING('New York City', 10, 4)"}],snippet:"SUBSTRING(${1}, ${2}, ${3})",name:"SUBSTRING()",bundle:"String"},{description:"Returns a subset of characters in a text string from a starting point to the specified string length.",parameters:[{name:"string",type:"String",description:"The text string to extract from."},{name:"start",type:"Number",description:"The integer value that specifies where the returned characters will start."},{name:"length",type:"Number",description:"The number of characters to extract."}],returnValue:"String",examples:[{description:"Returns 'City'",code:"SUBSTRING('New York City' FROM 10 FOR 4)"},{description:"Returns 'New York'",code:"SUBSTRING('New York City' FROM 1 FOR 8)"}],snippet:"SUBSTRING(${1} FROM ${2} FOR ${3})",name:"SUBSTRING()",bundle:"String"}],trim:{description:"Returns a text string where all of the leading and/or trailing spaces have been removed. LEADING will trim the leading side of the text string, TRAILING will trim the trailing side of the text string, while BOTH will trim both sides of the text string.",parameters:[{name:"side",type:["LEADING","TRAILING","BOTH"],description:"The side of the text string where spaces will be removed."},{name:"string",type:"String",description:"The text string to trim."}],returnValue:"String",examples:[{description:"Returns 'hello world'",code:"TRIM(LEADING '' FROM ' hello world')"},{description:"Returns ' hello world'",code:"TRIM(TRAILING '' FROM ' hello world ')"},{description:"Returns 'hello world'",code:"TRIM(BOTH '' FROM ' hello world ')"}],snippet:"TRIM(${1} ' ' FROM ${2})",name:"TRIM()",bundle:"String"},upper:{description:"Converts all characters in the text string to uppercase.",parameters:[{name:"string",type:"String",description:"The string to convert to uppercase."}],returnValue:"String",examples:[{description:"Returns 'QUICK RED FOX'",code:"UPPER('quick red fox')"}],snippet:"UPPER(${1})",name:"UPPER()",bundle:"String"}},Yi=["INTERVAL","CASE"],Gi=["CURRENT_TIME","CURRENT_DATE","CURRENT_TIMESTAMP"],$i=Hi.cast.parameters[1]?.type??[],Bi=e=>{switch(e.toLowerCase()){case"extract":case"interval":return[...Hi.extract.parameters[0].type];case"position":return["IN"];case"trim":return["FROM",...Hi.trim.parameters[0].type];case"cast":return["AS",...Hi.cast.parameters[1].type];case"case":return["WHEN","THEN","ELSE","END"];default:return[]}},Wi=(e,n,t,r)=>{let i;const u=n.range.start,s=n.range.end;return i=0===e?t.findNextMatch("(",{lineNumber:u.line,column:u.column},!1,!0,null,!0).range:e===r?{startLineNumber:s.line,endLineNumber:s.line,startColumn:s.column,endColumn:s.column}:t.findNextMatch(",",{lineNumber:u.line,column:u.column},!1,!0,null,!0).range,i},Vi=e=>{const n=e.toUpperCase();return Yi.includes(n)},Zi=(e,n,t)=>{let r=!1,i=!1;const u=e.column,s=e.lineNumber;return n.startLineNumber===t.startLineNumber&&n.startLineNumber===s&&u>n.startColumn&&u<t.endColumn&&(r=!0),n.startLineNumber!==t.startLineNumber&&(s===n.startLineNumber&&u>n.startColumn||s===t.startLineNumber&&u<t.endColumn||s>n.startLineNumber&&s<t.endLineNumber)&&(i=!0),[r,i]},qi=(e,n,t)=>{const r=n.map((e=>`${e.name}: ${Array.isArray(e.type)?e.type.join(" | "):e.type}`)),i=Array.isArray(t)?t.join(" | "):t;return`${e.slice(0,-2)}(${r.join(", ")}): ${i}`},Xi=(e,n)=>`${e}\n\n${n.map((e=>`${e.code} => ${e.description.split("Returns")[1]?.trim()}`)).join("\n")}`;function zi(e){return Li[e.toLowerCase()]}var Ki,ji;!function(e){e.ARGS="args",e.CLAUSES="clauses",e.ELSE="else",e.END="end",e.EXPR="expr",e.LEFT="left",e.OPERAND="operand",e.QUALIFIER="qualifier",e.RIGHT="right",e.START="start",e.VALUE="value"}(Ki||(Ki={})),function(e){e.CASE_EXPRESSION="case-expression",e.EXPRESSION_LIST="expression-list",e.FUNCTION="function",e.INTERVAL="interval",e.INTERVAL_QUALIFIER="interval-qualifier",e.WHEN_CLAUSE="when-clause",e.UNARY_EXPRESSION="unary-expression",e.BINARY_EXPRESSION="binary-expression"}(ji||(ji={}));const Ji={[ji.CASE_EXPRESSION]:[Ki.CLAUSES,Ki.OPERAND,Ki.ELSE],[ji.WHEN_CLAUSE]:[Ki.OPERAND,Ki.VALUE],[ji.EXPRESSION_LIST]:[Ki.VALUE],[ji.UNARY_EXPRESSION]:[Ki.EXPR],[ji.BINARY_EXPRESSION]:[Ki.LEFT,Ki.RIGHT],[ji.FUNCTION]:[Ki.ARGS],[ji.INTERVAL]:[Ki.VALUE,Ki.QUALIFIER],[ji.INTERVAL_QUALIFIER]:[Ki.START,Ki.END]};var Qi;!function(e){e.ExpectedDateTimeValue="ExpectedDateTimeValue",e.ExpectedNumericalLiteral="ExpectedNumericalLiteral",e.ExpectedToken="ExpectedToken",e.FunctionNotSupported="FunctionNotSupported",e.IncompatibleListDataType="IncompatibleListDataType",e.IncorrectArgumentLength="IncorrectArgumentLength",e.IncorrectCastParameters="IncorrectCastParameters",e.IncorrectExtractParameters="IncorrectExtractParameters",e.IncorrectSubstringParameters="IncorrectSubstringParameters",e.IncorrectTrimParameters="IncorrectTrimParameters",e.InvalidElseClause="InvalidElseClause",e.InvalidThenClause="InvalidThenClause",e.InvalidEndOnWhen="InvalidEndOnWhen",e.InvalidTrimCharacter="InvalidTrimCharacter",e.MismatchedTypes="MismatchedTypes",e.MissingValueInCaseClause="MissingValueInCaseClause",e.NotCallable="NotCallable",e.TypeNotAssignable="TypeNotAssignable",e.UnexpectedEnd="UnexpectedEnd.",e.UnexpectedIdentifier="UnexpectedIdentifier",e.UnexpectedNumber="UnexpectedNumber",e.UnexpectedTextLiteral="UnexpectedTextLiteral",e.UnexpectedToken="UnexpectedToken",e.UnknownField="UnknownField",e.UnsupportedOperator="UnsupportedOperator",e.UnsupportedSyntax="UnsupportedSyntax",e.InvalidIntervalQualifier="InvalidIntervalQualifier",e.EmptyCaseExpression="EmptyCaseExpression"}(Qi||(Qi={}));const eu={[Qi.ExpectedDateTimeValue]:`Expected ${Hi.extract.parameters[0].type.map((e=>`'${e}'`)).join(" | ")}.`,[Qi.ExpectedNumericalLiteral]:"Expected a numerical literal.",[Qi.ExpectedToken]:"Expected token ${token}.",[Qi.FunctionNotSupported]:`Function "\${function}" not supported.\n\nSupported SQL functions: ${[...Object.keys(Li),...Gi.filter((e=>!e.endsWith(")"))),...Yi].map((e=>`"${e.toUpperCase()}"`)).sort().join(", ")}.`,[Qi.IncompatibleListDataType]:"Incompatible data types in expression list found. All data items should have the same type.\n\nTypes found: ${types}.",[Qi.IncorrectArgumentLength]:"Expected ${formatMinMaxParams} arguments, but got ${numArgs}.",[Qi.IncorrectCastParameters]:`Expected usage:\n- CAST(<VALUE> AS <${Hi.cast.parameters[1].type.join(" | ")}>)`,[Qi.IncorrectExtractParameters]:`Expected usage:\n- EXTRACT(<${Hi.extract.parameters[0].type.join(" | ")}> FROM <Datetime>)`,[Qi.IncorrectSubstringParameters]:"Expected usage:\n- SUBSTRING(<VALUE> FROM <START> FOR <LENGTH>)\n- SUBSTRING(<VALUE>, <START>, <LENGTH>)",[Qi.IncorrectTrimParameters]:`Expected usage:\n- TRIM(<${Hi.trim.parameters[0].type.join(" | ")}> ' ' FROM <STRING>)`,[Qi.InvalidThenClause]:"THEN clause can only follow after a WHEN clause.",[Qi.InvalidElseClause]:"ELSE clause cannot be used without a WHEN clause.",[Qi.InvalidEndOnWhen]:"Cannot end a CASE expression with a WHEN clause. Requires a following THEN clause.",[Qi.InvalidTrimCharacter]:"Trim character must be the space character ' '.",[Qi.MismatchedTypes]:'Invalid type mismatch between ${leftValue} (type: "${providedType}") and ${rightValue} (type: "${expectedType}").',[Qi.MissingValueInCaseClause]:"Missing value after ${clause} clause in CASE expression.",[Qi.NotCallable]:"${expression} is not callable.",[Qi.TypeNotAssignable]:"Type ${providedType} is not assignable to type ${expectedType}.",[Qi.UnexpectedEnd]:"Unexpected end of SQL expression.",[Qi.UnexpectedIdentifier]:"Unexpected identifier.",[Qi.UnexpectedNumber]:"Unexpected number.",[Qi.UnexpectedTextLiteral]:"Unexpected text literal.",[Qi.UnexpectedToken]:"Unexpected token ${token}.",[Qi.UnknownField]:'No fields with name "${field}" exists.',[Qi.UnsupportedOperator]:"Unsupported SQL operator ${operator}.",[Qi.UnsupportedSyntax]:"Unsupported SQL syntax ${syntax}.",[Qi.InvalidIntervalQualifier]:"Invalid interval qualifier. Expected 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND'.",[Qi.EmptyCaseExpression]:"The CASE expression cannot be empty. Please provide valid conditions and results within the CASE block."},nu=(e,n)=>{const t=eu[e];var r,i;return n&&"minParams"in n&&"maxParams"in n&&(n.formatMinMaxParams=(r=n.minParams)===(i=n.maxParams)?`${r}`:`${r}-${i}`),n?t.replace(/\${(.*?)}/g,((e,t)=>n[t]?.toString()??"")):t};var tu,ru,iu,uu,su;!function(e){e.Single="SINGLE",e.EmptyField="EMPTY_FIELD",e.Error="ERROR",e.Field="FIELD",e.KeywordIn="IN",e.KeywordNotIn="NOT IN",e.KeywordBetween="BETWEEN",e.KeywordNotBetween="NOT BETWEEN",e.List="LIST",e.Negation="NOT",e.Number="NUMBER",e.Operator="OPERATOR",e.Parentheses="PARENTHESES",e.String="STRING",e.Unknown="UNKNOWN"}(tu||(tu={})),function(e){e.Case="CASE",e.CaseElse="ELSE",e.CaseThen="THEN",e.CaseWhen="WHEN",e.Comma=",",e.DoubleQuote='"',e.Empty="",e.End="END",e.Interval="INTERVAL",e.LeftParentheses="(",e.NewLine="\n",e.RightParentheses=")",e.SingleQuote="'",e.WhiteSpace=" "}(ru||(ru={})),function(e){e.And="AND",e.Or="OR",e.Is="IS",e.IsNot="ISNOT",e.In="IN",e.NotIn="NOT IN",e.Between="BETWEEN",e.NotBetween="NOTBETWEEN",e.Like="LIKE",e.NotLike="NOT LIKE",e.NotEquals="<>",e.LessThan="<",e.GreaterThan=">",e.GreaterThanEqual=">=",e.LessThanEqual="<=",e.Equal="=",e.Multiply="*",e.Subtract="-",e.Add="+",e.Divide="/",e.Concatenate="||"}(iu||(iu={})),function(e){e.Boolean="BOOLEAN",e.Double="DOUBLE",e.ExpressionList="EXPRESSION-LIST",e.Float="FLOAT",e.Integer="INTEGER",e.Null="NULL",e.Number="NUMBER",e.Real="REAL",e.String="STRING",e.SmallInt="SMALLINT",e.UnknownFunction="UNKNOWN_FUNCTION"}(uu||(uu={})),function(e){e.Function="FUNCTION",e.ExpressionList="EXPRESSION_LIST",e.Success="SUCCESS",e.NonCallable="NON_CALLABLE"}(su||(su={}));const ou=/\d+/,au=["string","number","integer","number","smallint","float","real","date","time","timestamp","current-time","column-reference"],cu=(e,n)=>{switch(e.type){case"interval":case"interval-period":case"interval-qualifier":case"when-clause":case"case-expression":case"parameter":case"expression-list":case"null":case"boolean":case"string":case"timestamp":case"date":case"time":case"number":case"current-time":case"data-type":return e.type;case"unary-expression":return"boolean";case"binary-expression":return(e=>{switch(e.operator){case"AND":case"OR":case"IS":case"ISNOT":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"*":case"-":case"+":case"/":return"number";case"||":return"string"}})(e);case"column-reference":{const t=n.find((n=>n.name===e.column));if(t)return function(e){switch(e){case"string":case"guid":case"global-id":case"xml":case"geometry":case"blob":case"raster":return"string";case"date":case"timestamp-offset":case"date-only":return"date";case"small-integer":case"integer":case"big-integer":case"oid":return"integer";case"single":case"double":case"long":return"float";case"time-only":return"time"}}(t.type)}return e.type;case"function":switch(e.name.toLowerCase()){case"cast":{if("data-type"!==e.args?.value?.[1]?.type)throw Error("Invalid cast function");const n=e.args?.value?.[1]?.value?.type;switch(n){case"integer":case"smallint":return"integer";case"real":case"float":return"float";case"date":case"timestamp":return e.args.value[1].value?.withtimezone?"date":"timestamp";case"time":return"time-only";case"varchar":return"string"}}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":return"float";case"sign":return"integer";case"ceiling":case"floor":case"abs":case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":case"truncate":return"float";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"current_date":case"current_time":case"current_timestamp":return"date";default:return"unknown_function"}}},lu=e=>{switch(e.toLowerCase()){case"integer":case"double":case"number":case"smallint":case"float":case"real":return!0;default:return!1}},fu=(e,n)=>{const t=n===ru.Comma?", ":" | ";return e.map((e=>`"${e.toLowerCase()}"`)).sort().join(t)},du=e=>`"${e}"`,hu=e=>{switch(e.type){case"interval-qualifier":case"interval":return"INTERVAL";case"when-clause":return"WHEN_CLAUSE";case"case-expression":return"CASE_EXPRESSION";case"unary-expression":return"UNARY_EXPRESSION";case"expression-list":return"EXPRESSION_LIST";case"binary-expression":return"BINARY_EXPRESSION";case"current-time":return du(e.mode);case"interval-period":return du(e.period);case"null":return du("null");case"column-reference":return du(e.column);case"number":return e.value;case"function":return du(`${e.name}()`);case"data-type":return du(e.type);case"boolean":case"date":case"parameter":case"time":case"timestamp":case"string":return du(String(e.value))}},mu=(e,n,r,i)=>{if(i){const i={startColumn:n.start.column,endColumn:n.end.column,startLineNumber:n.start.line,endLineNumber:n.end.line};r.some((n=>n.message===e&&n.startColumn===i.startColumn&&n.startLineNumber===i.startLineNumber&&n.endColumn===i.endColumn&&n.endLineNumber===i.endLineNumber))||r.push({message:e,severity:t.Error,...i})}else{const i=n;r.some((n=>n.message===e&&n.startColumn===i.startColumn&&n.startLineNumber===i.startLineNumber&&n.endColumn===i.endColumn&&n.endLineNumber===i.endLineNumber))||r.push({message:e,severity:t.Error,...i})}},Eu=(e,n,t,r)=>{const i=cu(e,r);let u=i.toUpperCase()===n;if(n===uu.Number&&(u=lu(i)),!u){const r=nu(Qi.TypeNotAssignable,{providedType:du(i),expectedType:du(n.toLowerCase())});mu(r,e.range,t,!0)}},Tu=[iu.Add,iu.Subtract,iu.Multiply,iu.Divide,iu.Concatenate],vu=["cast","extract","substring"];class pu{constructor(e,n){this.layer=e,this.callStack=[],this.markers=[],this._sdkFunctions=n.flatMap((e=>e.items))}validateModel(e){try{const n=Di(e);this.traverse(n)}catch(n){this._handleParserFailure(n,e)}}traverse(e){this.callStack.push(e),this._validateNode(e),this._traverseChildren(e),this.callStack.pop()}_validateNode(e){if(e)switch(e.type){case"interval":if(!ou.test(e.value.value)||"string"!==e.value.type){const n=nu(Qi.ExpectedNumericalLiteral),t=this._getRange(e.value);return void mu(n,t,this.markers)}return;case"interval-period":case"interval-qualifier":case"parameter":case"null":case"boolean":case"string":case"timestamp":case"date":case"time":case"number":case"current-time":case"data-type":case"when-clause":return;case"case-expression":if(0===e.clauses.length){if(e.else){const n=nu(Qi.InvalidElseClause);return void mu(n,{startLineNumber:e.elseRange.start.line,endLineNumber:e.elseRange.end.line,startColumn:e.elseRange.start.column,endColumn:e.elseRange.end.column},this.markers)}const n=nu(Qi.EmptyCaseExpression);return void mu(n,{startLineNumber:e.range.start.line,endLineNumber:e.range.end.line,startColumn:e.range.start.column,endColumn:e.range.end.column},this.markers)}return;case"column-reference":if(Object.values(ru).map((e=>e.toLowerCase())).includes(e.column.toLowerCase()))return;if(!this.layer.fields.find((n=>n.name===e.column))){const n=nu(Qi.UnknownField,{field:e.column});mu(n,e.range,this.markers,!0)}return;case"expression-list":{const n=e.value,t=new Set,r=this.callStack.at(-2);if("function"===r?.type&&vu.includes(r?.name?.toLowerCase()))return;if(n.forEach((e=>{let n=cu(e,this.layer.fields);if("column-reference"!==n&&"time-only"!==n)if("unknown_function"!==n)lu(n)&&(n="number"),t.has(n)||t.add(n);else{const n=nu(Qi.FunctionNotSupported,{function:e.name});mu(n,e.range,this.markers,!0)}})),t.size>1){const n=Array.from(t),r=nu(Qi.IncompatibleListDataType,{types:fu(n,ru.Comma)});mu(r,e.range,this.markers,!0)}return}case"binary-expression":{const n=1===this.callStack.length,t=e.left,r=e.right,i=cu(t,this.layer.fields),u=cu(r,this.layer.fields);if(n&&!Tu.includes(e.operator))return void mu(`Cannot perform binary operation '${e.operator}' at root node.`,e.range,this.markers,!0);switch(e.operator){case iu.And:case iu.Or:Eu(t,uu.Boolean,this.markers,this.layer.fields),Eu(r,uu.Boolean,this.markers,this.layer.fields);break;case iu.Is:case iu.IsNot:Eu(r,uu.Null,this.markers,this.layer.fields);break;case iu.In:case iu.NotIn:case iu.Between:case iu.NotBetween:Eu(r,uu.ExpressionList,this.markers,this.layer.fields);break;case iu.Like:case iu.NotLike:Eu(r,uu.String,this.markers,this.layer.fields);break;case iu.NotEquals:case iu.LessThan:case iu.GreaterThan:case iu.GreaterThanEqual:case iu.LessThanEqual:case iu.Equal:{if(!au.includes(u)){const e=nu(Qi.TypeNotAssignable,{providedType:du(u),expectedType:fu(au,ru.Comma)});mu(e,r.range,this.markers,!0)}const n=lu(i)&&lu(u);if(i!==u&&!n){const n=nu(Qi.MismatchedTypes,{leftValue:hu(t),providedType:i,rightValue:hu(r),expectedType:u});mu(n,e.range,this.markers,!0)}break}case iu.Multiply:case iu.Subtract:case iu.Add:case iu.Divide:Eu(t,uu.Number,this.markers,this.layer.fields),Eu(r,uu.Number,this.markers,this.layer.fields);break;case iu.Concatenate:Eu(t,uu.String,this.markers,this.layer.fields),Eu(r,uu.String,this.markers,this.layer.fields);break;default:{const n=nu(Qi.UnsupportedOperator,{operator:du(e.operator)});mu(n,e.range,this.markers,!0)}}return}case"function":{const n=this._getFunction(e.name);if(!n){const n=nu(Qi.FunctionNotSupported,{function:e.name});return void mu(n,e.range,this.markers,!0)}if("function"===n.type){const{min:t,max:r}=n.parametersInfo,{args:{value:i}}=e,u=i.length;if(u<t||u>r){const n=nu(Qi.IncorrectArgumentLength,{minParams:t,maxParams:r,numArgs:u});mu(n,e.range,this.markers)}}}return;case"unary-expression":return void console.warn("Unexpected unary expression found.")}}_handleParserFailure(e,n){if(e instanceof Error&&(!("location"in e)||!("format"in e)))throw e;if(""===n.trim())return void(this.markers=[]);const t=e;let r=t.message;(function(e){return/^Expected "\S+"/.test(e.message)})(t)&&(r=function(e){const n=e.message.match(/but "(.*)" found/)?.[1];if(n){const t=e.message.match(/Expected (.*) but/),r=t?.[1]?.split(", ").map(((e,n,t)=>(n===t.length-1&&e.startsWith("or ")&&(e=e.slice(3)),"[ \\t\\n\\r]"===(e=e.replace(/^"|"$/g,""))?"• WHITESPACE":`• ${e}`))).join("\n");let i=`Invalid syntax: unexpected token "${n}".`;return r&&(i+=`\n\nExpected one of the following:\n${r}`),i}return e.message.match(/but end of input found/)?"Invalid syntax: unexpected end of SQL Expression.":"Invalid syntax: unexpected token."}(t)),mu(r,{startLineNumber:t.location.start.line,endLineNumber:t.location.end.line,startColumn:t.location.start.column,endColumn:t.location.end.column},this.markers)}_getRange(e){return{startLineNumber:e.range.start.line,endLineNumber:e.range.end.line,startColumn:e.range.start.column,endColumn:e.range.end.column}}_getFunction(e){return this._sdkFunctions.find((n=>n.name.toLowerCase()===e.toLowerCase()))}_traverseChildren(e){if(e)switch(e.type){case ji.CASE_EXPRESSION:{const n=Ji[e.type];"simple"===e.format?n.forEach((n=>{const t=e[n];Array.isArray(t)?t.forEach((e=>{this.traverse(e)})):this.traverse(t)})):"searched"===e.format&&n.forEach((n=>{if(n===Ki.OPERAND)return;const t=e[n];Array.isArray(t)?t.forEach((e=>{this.traverse(e)})):this.traverse(t)}))}break;case ji.WHEN_CLAUSE:Ji[e.type].forEach((n=>{this.traverse(e[n])}));break;case ji.EXPRESSION_LIST:Ji[e.type].forEach((n=>{const t=e[n];Array.isArray(t)?t.forEach((e=>{this.traverse(e)})):this.traverse(t)}));break;case ji.UNARY_EXPRESSION:Ji[e.type].forEach((n=>{const t=e[n];Array.isArray(t)&&this.traverse(t)}));break;case ji.BINARY_EXPRESSION:case ji.FUNCTION:case ji.INTERVAL:case ji.INTERVAL_QUALIFIER:Ji[e.type].forEach((n=>{this.traverse(e[n])}))}}}const Nu={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},yu={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ABORT","ABSOLUTE","ACTION","ADA","ADD","AFTER","ALL","ALLOCATE","ALTER","ALWAYS","ANALYZE","AND","ANY","ARE","AS","ASC","ASSERTION","AT","ATTACH","AUTHORIZATION","AUTOINCREMENT","AVG","BACKUP","BEFORE","BEGIN","BETWEEN","BIT","BIT_LENGTH","BOTH","BREAK","BROWSE","BULK","BY","CASCADE","CASCADED","CASE","CAST","CATALOG","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CHECKPOINT","CLOSE","CLUSTERED","COALESCE","COLLATE","COLLATION","COLUMN","COMMIT","COMPUTE","CONFLICT","CONNECT","CONNECTION","CONSTRAINT","CONSTRAINTS","CONTAINS","CONTAINSTABLE","CONTINUE","CONVERT","CORRESPONDING","COUNT","CREATE","CROSS","CURRENT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURSOR","DATABASE","DATE","DAY","DBCC","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFERRABLE","DEFERRED","DELETE","DENY","DESC","DESCRIBE","DESCRIPTOR","DETACH","DIAGNOSTICS","DISCONNECT","DISK","DISTINCT","DISTRIBUTED","DO","DOMAIN","DOUBLE","DROP","DUMP","EACH","ELSE","END","END-EXEC","ERRLVL","ESCAPE","EXCEPT","EXCEPTION","EXCLUDE","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXPLAIN","EXTERNAL","EXTRACT","FAIL","FALSE","FETCH","FILE","FILLFACTOR","FILTER","FIRST","FLOAT","FOLLOWING","FOR","FOREIGN","FORTRAN","FOUND","FREETEXT","FREETEXTTABLE","FROM","FULL","FUNCTION","GENERATED","GET","GLOB","GLOBAL","GO","GOTO","GRANT","GROUP","GROUPS","HAVING","HOLDLOCK","HOUR","IDENTITY","IDENTITYCOL","IDENTITY_INSERT","IF","IGNORE","IMMEDIATE","IN","INCLUDE","INDEX","INDEXED","INDICATOR","INITIALLY","INNER","INPUT","INSENSITIVE","INSERT","INSTEAD","INT","INTEGER","INTERSECT","INTERVAL","INTO","IS","ISNULL","ISOLATION","JOIN","KEY","KILL","LANGUAGE","LAST","LEADING","LEFT","LEVEL","LIKE","LIMIT","LINENO","LOAD","LOCAL","LOWER","MATCH","MATERIALIZED","MAX","MERGE","MIN","MINUTE","MODULE","MONTH","NAMES","NATIONAL","NATURAL","NCHAR","NEXT","NO","NOCHECK","NONCLUSTERED","NONE","NOT","NOTHING","NOTNULL","NULL","NULLIF","NULLS","NUMERIC","OCTET_LENGTH","OF","OFF","OFFSET","OFFSETS","ON","ONLY","OPEN","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","OPTION","OR","ORDER","OTHERS","OUTER","OUTPUT","OVER","OVERLAPS","PAD","PARTIAL","PARTITION","PASCAL","PERCENT","PIVOT","PLAN","POSITION","PRAGMA","PRECEDING","PRECISION","PREPARE","PRESERVE","PRIMARY","PRINT","PRIOR","PRIVILEGES","PROC","PROCEDURE","PUBLIC","QUERY","RAISE","RAISERROR","RANGE","READ","READTEXT","REAL","RECONFIGURE","RECURSIVE","REFERENCES","REGEXP","REINDEX","RELATIVE","RELEASE","RENAME","REPLACE","REPLICATION","RESTORE","RESTRICT","RETURN","RETURNING","REVERT","REVOKE","RIGHT","ROLLBACK","ROW","ROWCOUNT","ROWGUIDCOL","ROWS","RULE","SAVE","SAVEPOINT","SCHEMA","SCROLL","SECOND","SECTION","SECURITYAUDIT","SELECT","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","SESSION","SESSION_USER","SET","SETUSER","SHUTDOWN","SIZE","SMALLINT","SOME","SPACE","SQL","SQLCA","SQLCODE","SQLERROR","SQLSTATE","SQLWARNING","STATISTICS","SUBSTRING","SUM","SYSTEM_USER","TABLE","TABLESAMPLE","TEMP","TEMPORARY","TEXTSIZE","THEN","TIES","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TOP","TRAILING","TRAN","TRANSACTION","TRANSLATE","TRANSLATION","TRIGGER","TRIM","TRUE","TRUNCATE","TRY_CONVERT","TSEQUAL","UNBOUNDED","UNION","UNIQUE","UNKNOWN","UNPIVOT","UPDATE","UPDATETEXT","UPPER","USAGE","USE","USER","USING","VACUUM","VALUE","VALUES","VARCHAR","VARYING","VIEW","VIRTUAL","WAITFOR","WHEN","WHENEVER","WHERE","WHILE","WINDOW","WITH","WITHIN GROUP","WITHOUT","WORK","WRITE","WRITETEXT","YEAR","ZONE"],operators:["ALL","AND","ANY","BETWEEN","EXISTS","IN","LIKE","NOT","OR","SOME","EXCEPT","INTERSECT","UNION","APPLY","CROSS","FULL","INNER","JOIN","LEFT","OUTER","RIGHT","CONTAINS","FREETEXT","IS","NULL","PIVOT","UNPIVOT","MATCHED"],builtinFunctions:["AVG","CHECKSUM_AGG","COUNT","COUNT_BIG","GROUPING","GROUPING_ID","MAX","MIN","SUM","STDEV","STDEVP","VAR","VARP","CUME_DIST","FIRST_VALUE","LAG","LAST_VALUE","LEAD","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","COLLATE","COLLATIONPROPERTY","TERTIARY_WEIGHTS","FEDERATION_FILTERING_VALUE","CAST","CONVERT","PARSE","TRY_CAST","TRY_CONVERT","TRY_PARSE","ASYMKEY_ID","ASYMKEYPROPERTY","CERTPROPERTY","CERT_ID","CRYPT_GEN_RANDOM","DECRYPTBYASYMKEY","DECRYPTBYCERT","DECRYPTBYKEY","DECRYPTBYKEYAUTOASYMKEY","DECRYPTBYKEYAUTOCERT","DECRYPTBYPASSPHRASE","ENCRYPTBYASYMKEY","ENCRYPTBYCERT","ENCRYPTBYKEY","ENCRYPTBYPASSPHRASE","HASHBYTES","IS_OBJECTSIGNED","KEY_GUID","KEY_ID","KEY_NAME","SIGNBYASYMKEY","SIGNBYCERT","SYMKEYPROPERTY","VERIFYSIGNEDBYCERT","VERIFYSIGNEDBYASYMKEY","CURSOR_STATUS","DATALENGTH","IDENT_CURRENT","IDENT_INCR","IDENT_SEED","IDENTITY","SQL_VARIANT_PROPERTY","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","DATEFROMPARTS","DATENAME","DATEPART","DATETIME2FROMPARTS","DATETIMEFROMPARTS","DATETIMEOFFSETFROMPARTS","DAY","EOMONTH","GETDATE","GETUTCDATE","ISDATE","MONTH","SMALLDATETIMEFROMPARTS","SWITCHOFFSET","SYSDATETIME","SYSDATETIMEOFFSET","SYSUTCDATETIME","TIMEFROMPARTS","TODATETIMEOFFSET","YEAR","CHOOSE","COALESCE","IIF","NULLIF","ABS","ACOS","ASIN","ATAN","ATN2","CEILING","COS","COT","DEGREES","EXP","FLOOR","LOG","LOG10","PI","POWER","RADIANS","RAND","ROUND","SIGN","SIN","SQRT","SQUARE","TAN","APP_NAME","APPLOCK_MODE","APPLOCK_TEST","ASSEMBLYPROPERTY","COL_LENGTH","COL_NAME","COLUMNPROPERTY","DATABASE_PRINCIPAL_ID","DATABASEPROPERTYEX","DB_ID","DB_NAME","FILE_ID","FILE_IDEX","FILE_NAME","FILEGROUP_ID","FILEGROUP_NAME","FILEGROUPPROPERTY","FILEPROPERTY","FULLTEXTCATALOGPROPERTY","FULLTEXTSERVICEPROPERTY","INDEX_COL","INDEXKEY_PROPERTY","INDEXPROPERTY","OBJECT_DEFINITION","OBJECT_ID","OBJECT_NAME","OBJECT_SCHEMA_NAME","OBJECTPROPERTY","OBJECTPROPERTYEX","ORIGINAL_DB_NAME","PARSENAME","SCHEMA_ID","SCHEMA_NAME","SCOPE_IDENTITY","SERVERPROPERTY","STATS_DATE","TYPE_ID","TYPE_NAME","TYPEPROPERTY","DENSE_RANK","NTILE","RANK","ROW_NUMBER","PUBLISHINGSERVERNAME","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","CERTENCODED","CERTPRIVATEKEY","CURRENT_USER","HAS_DBACCESS","HAS_PERMS_BY_NAME","IS_MEMBER","IS_ROLEMEMBER","IS_SRVROLEMEMBER","LOGINPROPERTY","ORIGINAL_LOGIN","PERMISSIONS","PWDENCRYPT","PWDCOMPARE","SESSION_USER","SESSIONPROPERTY","SUSER_ID","SUSER_NAME","SUSER_SID","SUSER_SNAME","SYSTEM_USER","USER","USER_ID","USER_NAME","ASCII","CHAR","CHARINDEX","CONCAT","DIFFERENCE","FORMAT","LEFT","LEN","LOWER","LTRIM","NCHAR","PATINDEX","QUOTENAME","REPLACE","REPLICATE","REVERSE","RIGHT","RTRIM","SOUNDEX","SPACE","STR","STUFF","SUBSTRING","UNICODE","UPPER","BINARY_CHECKSUM","CHECKSUM","CONNECTIONPROPERTY","CONTEXT_INFO","CURRENT_REQUEST_ID","ERROR_LINE","ERROR_NUMBER","ERROR_MESSAGE","ERROR_PROCEDURE","ERROR_SEVERITY","ERROR_STATE","FORMATMESSAGE","GETANSINULL","GET_FILESTREAM_TRANSACTION_CONTEXT","HOST_ID","HOST_NAME","ISNULL","ISNUMERIC","MIN_ACTIVE_ROWVERSION","NEWID","NEWSEQUENTIALID","ROWCOUNT_BIG","XACT_STATE","TEXTPTR","TEXTVALID","COLUMNS_UPDATED","EVENTDATA","TRIGGER_NESTLEVEL","UPDATE","CHANGETABLE","CHANGE_TRACKING_CONTEXT","CHANGE_TRACKING_CURRENT_VERSION","CHANGE_TRACKING_IS_COLUMN_IN_MASK","CHANGE_TRACKING_MIN_VALID_VERSION","CONTAINSTABLE","FREETEXTTABLE","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","FILETABLEROOTPATH","GETFILENAMESPACEPATH","GETPATHLOCATOR","PATHNAME","GET_TRANSMISSION_STATUS"],builtinVariables:["@@DATEFIRST","@@DBTS","@@LANGID","@@LANGUAGE","@@LOCK_TIMEOUT","@@MAX_CONNECTIONS","@@MAX_PRECISION","@@NESTLEVEL","@@OPTIONS","@@REMSERVER","@@SERVERNAME","@@SERVICENAME","@@SPID","@@TEXTSIZE","@@VERSION","@@CURSOR_ROWS","@@FETCH_STATUS","@@DATEFIRST","@@PROCID","@@ERROR","@@IDENTITY","@@ROWCOUNT","@@TRANCOUNT","@@CONNECTIONS","@@CPU_BUSY","@@IDLE","@@IO_BUSY","@@PACKET_ERRORS","@@PACK_RECEIVED","@@PACK_SENT","@@TIMETICKS","@@TOTAL_ERRORS","@@TOTAL_READ","@@TOTAL_WRITE"],pseudoColumns:["$ACTION","$IDENTITY","$ROWGUID","$PARTITION"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i,"keyword"],[/BEGIN\s+TRY\b/i,{token:"keyword.try"}],[/END\s+TRY\b/i,{token:"keyword.try"}],[/BEGIN\s+CATCH\b/i,{token:"keyword.catch"}],[/END\s+CATCH\b/i,{token:"keyword.catch"}],[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}};let Ru;async function Su(...e){return await new Promise(((n,t)=>{Ru?n(Ru(...e)):t(new Error("sql expression worker not registered!"))}))}function Iu(t){const u=new i(t);Ru=async(...e)=>await u.getLanguageServiceWorker(...e),n.setMonarchTokensProvider(r.languageId,yu),n.setLanguageConfiguration(r.languageId,Nu);const s=new Fi(r);n.registerCompletionItemProvider(r.languageId,s);const o=e.getEditors();o.length&&gu(o[0].getModel(),r),e.onDidCreateModel((e=>{gu(e,r)}))}function gu(n,t){const r=n.onDidChangeContent((()=>{n.getLanguageId()===t.languageId&&async function(n,t){if(!n)return;const r=t.getFeatureLayerForModel(n.uri.toString());if(r)try{const i=await t.getApiLibrary(n.uri.toString()),u=new pu(r,i);u.validateModel(n.getValue()),e.setModelMarkers(n,"arcgis-sql-expression",u.markers)}catch(e){console.log("error validating sql expression",e)}}(n,t)}));n.onWillDispose((()=>{r.dispose()}))}export{Su as getSqlExprWorker,Iu as setupMode}
6
+ import{e,u as n,M as t}from"./p-8e61744c.js";import{s as r}from"./p-cd67026d.js";import"./p-f1fab45e.js";class i{constructor(e){this._defaults=e,this._worker=null,this._client=null}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _getClientProxy(){if(!this._client){const{languageId:n}=this._defaults;this._worker=e.createWebWorker({moduleId:"SqlExprWorker",label:n,createData:{languageId:n}}),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const n=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),n}}const u={current_date:{description:"Returns the current date in UTC.",parameters:[],returnValue:"Datetime",examples:[{description:"Returns the current date in UTC.",code:"CURRENT_DATE()"}],snippet:["CURRENT_DATE()","CURRENT_DATE"],name:"CURRENT_DATE()",bundle:"Date"},current_time:{description:"Returns the current UTC date and time in hours, minutes, and seconds.",parameters:[],returnValue:"Datetime",examples:[{description:"Returns the current UTC date and time in hours, minutes, and seconds.",code:"CURRENT_TIME()"}],snippet:["CURRENT_TIME()","CURRENT_TIME"],name:"CURRENT_TIME()",bundle:"Date"},current_timestamp:{description:"Returns the current UTC date and time in hours, minutes, seconds, and milliseconds.",parameters:[],returnValue:"Datetime",examples:[{description:"Returns the current UTC date and time in hours, minutes, seconds, and milliseconds.",code:"CURRENT_TIMESTAMP()"}],snippet:["CURRENT_TIMESTAMP()","CURRENT_TIMESTAMP"],name:"CURRENT_TIMESTAMP()",bundle:"Date"},extract:{description:"Returns a single part of a datetime, such as year, month, day, hour, minute, or second.",parameters:[{name:"part",type:["YEAR","MONTH","DAY","HOUR","MINUTE","SECOND"],description:"The part to extract from the date."},{name:"datetime",type:"Datetime",description:"The date to extract a part from."}],returnValue:"Number",examples:[{description:"Returns 12",code:"EXTRACT(MONTH FROM '12/21/2016')"},{description:"Returns 21",code:"EXTRACT(DAY FROM '12/21/2016 12:00')"},{description:"Returns 30",code:"EXTRACT(MINUTE FROM '12/21/2016 15:30')"}],snippet:"EXTRACT(${1} FROM ${2})",name:"EXTRACT()",bundle:"Date"}},s={description:"Returns the absolute value of the number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 2",code:"ABS(-2)"}],snippet:"ABS(${1})",name:"ABS()",bundle:"Numeric"},o={abs:s,acos:{description:"Returns the arc cosine of a number. If the number is not between -1 and 1 the function will return `NULL`.",parameters:[{name:"number",type:"Number",description:"A number between -1 and 1 on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 1.266104",code:"ACOS(0.3)"}],snippet:"ACOS(${1})",name:"ACOS()",bundle:"Numeric"},asin:s,atan:{description:"Returns the arc tangent of a number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 0.785398",code:"ATAN(1)"}],snippet:"ATAN(${1})",name:"ATAN()",bundle:"Numeric"},cast:{description:"Converts a value from one data type to another. The dataType parameter will determine what type the value is converted to. FLOAT converts the value to a double, INTEGER converts the value to an integer, etc.",parameters:[{name:"value",type:"Number",description:"The value to convert to another data type."},{name:"dataType",type:["DATE","FLOAT","INTEGER","REAL","SMALLINT","TIME","TIMESTAMP","VARCHAR"],description:"The data type to convert the value to."}],returnValue:["Number","Datetime","String"],examples:[{description:"Returns 2",code:"CAST(2.34 AS INT)"},{description:"Returns '1:00 PM'",code:"CAST('13:00' AS TIME)"},{description:"Returns 50",code:"CAST(50 AS VARCHAR(20))"}],snippet:"CAST(${1} AS ${2})",name:"CAST()",bundle:"Numeric"},ceiling:{description:"Returns the smallest integer greater than or equal to the number.",parameters:[{name:"number",type:"Number",description:"The number to round upward."}],returnValue:"Number",examples:[{description:"Returns 235",code:"CEILING(234.042)"}],snippet:"CEILING(${1})",name:"CEILING()",bundle:"Numeric"},cos:{description:"Returns the trigonometric cosine of the number, which is assumed to be an angle in radians.",parameters:[{name:"number",type:"Number",description:"An angle in radians on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns -0.416147",code:"COS(2)"}],snippet:"COS(${1})",name:"COS()",bundle:"Numeric"},floor:{description:"Returns the largest integer that is less than or equal to the number.",parameters:[{name:"number",type:"Number",description:"The number to round downward."}],returnValue:"Number",examples:[{description:"Returns 12",code:"FLOOR(12.9942)"}],snippet:"FLOOR(${1})",name:"FLOOR()",bundle:"Numeric"},log:{description:"Returns the natural logarithm (base e) of the number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 2.302585",code:"LOG(10)"}],snippet:"LOG(${1})",name:"LOG()",bundle:"Numeric"},log10:{description:"Returns the base-10 logarithm of the number.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation that is greater than 0."}],returnValue:"Number",examples:[{description:"Returns 0.301030",code:"LOG10(2)"}],snippet:"LOG10(${1})",name:"LOG10()",bundle:"Numeric"},mod:{description:"Returns the remainder after dividing a dividend by a divisor. Both the divindend and divisor must be integers.",parameters:[{name:"x",type:"Number",description:"The number representing the dividend."},{name:"y",type:"Number",description:"The number representing the divisor."}],returnValue:"Number",examples:[{description:"Returns 2",code:"MOD(18, 4)"}],snippet:"MOD(${1}, ${2})",name:"MOD()",bundle:"Numeric"},nullif:{description:"Returns `NULL` if expression1 is equal to expression2. NULLIF is commonly used to prevent divide-by-zero errors by setting expression2 to 0.",parameters:[{name:"expression1",type:["Number","String","Datetime"],description:"A value on which to perform the operation."},{name:"expression2",type:["Number","String","Datetime"],description:"A value on which to perform the operation."}],returnValue:["Number","String","Datetime"],examples:[{description:"Returns `null`",code:"NULLIF(25, 25)"},{description:"Returns 32",code:"NULLIF(32, 0)"},{description:"Returns `null` if POP18 is equal to 0, otherwise, returns the value of TOTALPOP / POP18.",code:"TOTALPOP / NULLIF(POP18, 0)"}],snippet:"NULLIF(${1}, ${2})",name:"NULLIF()",bundle:"Numeric"},power:{description:"Returns the value of the number raised to the specified power.",parameters:[{name:"x",type:"Number",description:"The number on which to perform the operation."},{name:"y",type:"Number",description:"The exponent indicating the number of times to multiply the number by itself."}],returnValue:"Number",examples:[{description:"Returns 8",code:"POWER(2, 3)"}],snippet:"POWER(${1}, ${2})",name:"POWER()",bundle:"Numeric"},round:{description:"Rounds the number to the specified length.",parameters:[{name:"number",type:"Number",description:"The number to round."},{name:"length",type:"Number",description:"The number of decimal places to round the number to. A positive length rounds the number to the specified decimal place. A negative length will round the number to the left of the decimal point."}],returnValue:"Number",examples:[{description:"Returns 3.98",code:"ROUND(3.98024, 2)"},{description:"Returns 200",code:"ROUND(192.1, -2)"}],snippet:"ROUND(${1}, ${2})",name:"ROUND()",bundle:"Numeric"},sign:{description:"Returns the sign of a given number. A negative number will return -1. A positive number will return 1.",parameters:[{name:"number",type:"Number",description:"A number on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns -1",code:"SIGN(-132)"},{description:"Returns 0",code:"SIGN(0)"},{description:"Returns 1",code:"SIGN(42)"}],snippet:"SIGN(${1})",name:"SIGN()",bundle:"Numeric"},sin:{description:"Returns the trigonometric sine of the number, which is assumed to be an angle in radians.",parameters:[{name:"number",type:"Number",description:"An angle in radians on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 0.841471",code:"SIN(1)"}],snippet:"SIN(${1})",name:"SIN()",bundle:"Numeric"},tan:{description:"Returns the tangent of a number, which is assumed to be an angle in radians.",parameters:[{name:"number",type:"Number",description:"An angle in radians on which to perform the operation."}],returnValue:"Number",examples:[{description:"Returns 2.572152",code:"TAN(1.2)"}],snippet:"TAN(${1})",name:"TAN()",bundle:"Numeric"},truncate:{description:"Returns a truncated number.",parameters:[{name:"number",type:"Number",description:"A number to truncate."},{name:"decimals",type:"Number",description:"A positive value truncates the number to the specified decimal place. A negative value truncates the number to the left of the decimal point."}],returnValue:"Number",examples:[{description:"Returns 91.3",code:"TRUNCATE(91.367, 1)"},{description:"Returns 124",code:"TRUNCATE(124.45, 0)"},{description:"Returns 1900",code:"TRUNCATE(1982.83,-2)"}],snippet:"TRUNCATE(${1}, ${2})",name:"TRUNCATE()",bundle:"Numeric"}};var a={};function c(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(i=function(e){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?i:String(i)),r)}var i}function l(e,n,t){return n&&c(e.prototype,n),t&&c(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f.apply(this,arguments)}function d(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,m(e,n)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function m(e,n){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},m(e,n)}function E(e,n,t){return E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,n,t){var r=[null];r.push.apply(r,n);var i=new(Function.bind.apply(e,r));return t&&m(i,t.prototype),i},E.apply(null,arguments)}function T(e){var n="function"==typeof Map?new Map:void 0;return T=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return E(e,arguments,h(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),m(t,e)},T(e)}function v(e,n){if(null==e)return{};var t,r,i={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(i[t]=e[t]);return i}function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function N(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?p(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(a,"__esModule",{value:!0});var y=function(e){function n(){return e.apply(this,arguments)||this}return d(n,e),n}(T(Error)),R=function(e){function n(n){return e.call(this,"Invalid DateTime: "+n.toMessage())||this}return d(n,e),n}(y),S=function(e){function n(n){return e.call(this,"Invalid Interval: "+n.toMessage())||this}return d(n,e),n}(y),I=function(e){function n(n){return e.call(this,"Invalid Duration: "+n.toMessage())||this}return d(n,e),n}(y),g=function(e){function n(){return e.apply(this,arguments)||this}return d(n,e),n}(y),A=function(e){function n(n){return e.call(this,"Invalid unit "+n)||this}return d(n,e),n}(y),O=function(e){function n(){return e.apply(this,arguments)||this}return d(n,e),n}(y),w=function(e){function n(){return e.call(this,"Zone is an abstract class")||this}return d(n,e),n}(y),b="numeric",C="short",L="long",M={year:b,month:b,day:b},D={year:b,month:C,day:b},k={year:b,month:C,day:b,weekday:C},P={year:b,month:L,day:b},U={year:b,month:L,day:b,weekday:L},x={hour:b,minute:b},_={hour:b,minute:b,second:b},F={hour:b,minute:b,second:b,timeZoneName:C},H={hour:b,minute:b,second:b,timeZoneName:L},Y={hour:b,minute:b,hourCycle:"h23"},G={hour:b,minute:b,second:b,hourCycle:"h23"},$={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:C},B={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:L},W={year:b,month:b,day:b,hour:b,minute:b},V={year:b,month:b,day:b,hour:b,minute:b,second:b},Z={year:b,month:C,day:b,hour:b,minute:b},q={year:b,month:C,day:b,hour:b,minute:b,second:b},X={year:b,month:C,day:b,weekday:C,hour:b,minute:b},z={year:b,month:L,day:b,hour:b,minute:b,timeZoneName:C},K={year:b,month:L,day:b,hour:b,minute:b,second:b,timeZoneName:C},j={year:b,month:L,day:b,weekday:L,hour:b,minute:b,timeZoneName:L},J={year:b,month:L,day:b,weekday:L,hour:b,minute:b,second:b,timeZoneName:L},Q=function(){function e(){}var n=e.prototype;return n.offsetName=function(){throw new w},n.formatOffset=function(){throw new w},n.offset=function(){throw new w},n.equals=function(){throw new w},l(e,[{key:"type",get:function(){throw new w}},{key:"name",get:function(){throw new w}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new w}},{key:"isValid",get:function(){throw new w}}]),e}(),ee=null,ne=function(e){function n(){return e.apply(this,arguments)||this}d(n,e);var t=n.prototype;return t.offsetName=function(e,n){return vn(e,n.format,n.locale)},t.formatOffset=function(e,n){return Rn(this.offset(e),n)},t.offset=function(e){return-new Date(e).getTimezoneOffset()},t.equals=function(e){return"system"===e.type},l(n,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===ee&&(ee=new n),ee}}]),n}(Q),te={},re={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},ie={},ue=function(e){function n(t){var r;return(r=e.call(this)||this).zoneName=t,r.valid=n.isValidZone(t),r}d(n,e),n.create=function(e){return ie[e]||(ie[e]=new n(e)),ie[e]},n.resetCache=function(){ie={},te={}},n.isValidSpecifier=function(e){return this.isValidZone(e)},n.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var t=n.prototype;return t.offsetName=function(e,n){return vn(e,n.format,n.locale,this.name)},t.formatOffset=function(e,n){return Rn(this.offset(e),n)},t.offset=function(e){var n=new Date(e);if(isNaN(n))return NaN;var t,r=(te[t=this.name]||(te[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),te[t]),i=r.formatToParts?function(e,n){for(var t=e.formatToParts(n),r=[],i=0;i<t.length;i++){var u=t[i],s=u.type,o=u.value,a=re[s];"era"===s?r[a]=o:ze(a)||(r[a]=parseInt(o,10))}return r}(r,n):function(e,n){var t=e.format(n).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t);return[r[3],r[1],r[2],r[4],r[5],r[6],r[7]]}(r,n),u=i[0],s=i[1],o=i[2],a=i[4],c=i[5],l=i[6];"BC"===i[3]&&(u=1-Math.abs(u));var f=+n,d=f%1e3;return(hn({year:u,month:s,day:o,hour:24===a?0:a,minute:c,second:l,millisecond:0})-(f-=d>=0?d:1e3+d))/6e4},t.equals=function(e){return"iana"===e.type&&e.name===this.name},l(n,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),n}(Q),se=["base"],oe=["padTo","floor"],ae={},ce={};function le(e,n){void 0===n&&(n={});var t=JSON.stringify([e,n]),r=ce[t];return r||(r=new Intl.DateTimeFormat(e,n),ce[t]=r),r}var fe={},de={},he=null,me={};function Ee(e,n,t,r){var i=e.listingMode();return"error"===i?null:"en"===i?t(n):r(n)}var Te=function(){function e(e,n,t){this.padTo=t.padTo||0,this.floor=t.floor||!1;var r=v(t,oe);if(!n||Object.keys(r).length>0){var i=f({useGrouping:!1},t);t.padTo>0&&(i.minimumIntegerDigits=t.padTo),this.inf=function(e,n){void 0===n&&(n={});var t=JSON.stringify([e,n]),r=fe[t];return r||(r=new Intl.NumberFormat(e,n),fe[t]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var n=this.floor?Math.floor(e):e;return this.inf.format(n)}return un(this.floor?Math.floor(e):cn(e,3),this.padTo)},e}(),ve=function(){function e(e,n,t){this.opts=t,this.originalZone=void 0;var r=void 0;if(this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){var i=e.offset/60*-1,u=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&ue.create(u).valid?(r=u,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);var s=f({},this.opts);s.timeZone=s.timeZone||r,this.dtf=le(n,s)}var n=e.prototype;return n.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},n.formatToParts=function(){var e=this,n=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?n.map((function(n){return"timeZoneName"===n.type?f({},n,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):n})):n},n.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),pe=function(){function e(e,n,t){this.opts=f({style:"long"},t),!n&&Je()&&(this.rtf=function(e,n){void 0===n&&(n={});var t=v(n,se),r=JSON.stringify([e,t]),i=de[r];return i||(i=new Intl.RelativeTimeFormat(e,n),de[r]=i),i}(e,t))}var n=e.prototype;return n.format=function(e,n){return this.rtf?this.rtf.format(e,n):function(e,n,t,r){void 0===t&&(t="always"),void 0===r&&(r=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},u=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===t&&u){var s="days"===e;switch(n){case 1:return s?"tomorrow":"next "+i[e][0];case-1:return s?"yesterday":"last "+i[e][0];case 0:return s?"today":"this "+i[e][0]}}var o=Object.is(n,-0)||n<0,a=Math.abs(n),c=1===a,l=i[e],f=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?a+" "+f+" ago":"in "+a+" "+f}(n,e,this.opts.numeric,"long"!==this.opts.style)},n.formatToParts=function(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]},e}(),Ne={firstDay:1,minimalDays:4,weekend:[6,7]},ye=function(){function e(e,n,t,r,i){var u=function(e){var n=e.indexOf("-x-");-1!==n&&(e=e.substring(0,n));var t,r,i=e.indexOf("-u-");if(-1===i)return[e];try{t=le(e).resolvedOptions(),r=e}catch(n){var u=e.substring(0,i);t=le(u).resolvedOptions(),r=u}return[r,t.numberingSystem,t.calendar]}(e),s=u[1],o=u[2];this.locale=u[0],this.numberingSystem=n||s||null,this.outputCalendar=t||o||null,this.weekSettings=r,this.intl=function(e,n,t){return t||n?(e.includes("-u-")||(e+="-u"),t&&(e+="-ca-"+t),n&&(e+="-nu-"+n),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(n){return e.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)},e.create=function(n,t,r,i,u){void 0===u&&(u=!1);var s=n||ke.defaultLocale;return new e(s||(u?"en-US":he||(he=(new Intl.DateTimeFormat).resolvedOptions().locale)),t||ke.defaultNumberingSystem,r||ke.defaultOutputCalendar,tn(i)||ke.defaultWeekSettings,s)},e.resetCache=function(){he=null,ce={},fe={},de={}},e.fromObject=function(n){var t=void 0===n?{}:n;return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings)};var n=e.prototype;return n.listingMode=function(){return this.isEnglish()&&!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar)?"en":"intl"},n.clone=function(n){return n&&0!==Object.getOwnPropertyNames(n).length?e.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,tn(n.weekSettings)||this.weekSettings,n.defaultToEN||!1):this},n.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(f({},e,{defaultToEN:!0}))},n.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(f({},e,{defaultToEN:!1}))},n.months=function(e,n){var t=this;return void 0===n&&(n=!1),Ee(this,e,On,(function(){var r=n?{month:e,day:"numeric"}:{month:e},i=n?"format":"standalone";return t.monthsCache[i][e]||(t.monthsCache[i][e]=function(e){for(var n=[],t=1;t<=12;t++){var r=br.utc(2009,t,1);n.push(e(r))}return n}((function(e){return t.extract(e,r,"month")}))),t.monthsCache[i][e]}))},n.weekdays=function(e,n){var t=this;return void 0===n&&(n=!1),Ee(this,e,Ln,(function(){var r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return t.weekdaysCache[i][e]||(t.weekdaysCache[i][e]=function(e){for(var n=[],t=1;t<=7;t++){var r=br.utc(2016,11,13+t);n.push(e(r))}return n}((function(e){return t.extract(e,r,"weekday")}))),t.weekdaysCache[i][e]}))},n.meridiems=function(){var e=this;return Ee(this,void 0,(function(){return Mn}),(function(){if(!e.meridiemCache){var n={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[br.utc(2016,11,13,9),br.utc(2016,11,13,19)].map((function(t){return e.extract(t,n,"dayperiod")}))}return e.meridiemCache}))},n.eras=function(e){var n=this;return Ee(this,e,Un,(function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[br.utc(-40,1,1),br.utc(2017,1,1)].map((function(e){return n.extract(e,t,"era")}))),n.eraCache[e]}))},n.extract=function(e,n,t){var r=this.dtFormatter(e,n).formatToParts().find((function(e){return e.type.toLowerCase()===t}));return r?r.value:null},n.numberFormatter=function(e){return void 0===e&&(e={}),new Te(this.intl,e.forceSimple||this.fastNumbers,e)},n.dtFormatter=function(e,n){return void 0===n&&(n={}),new ve(e,this.intl,n)},n.relFormatter=function(e){return void 0===e&&(e={}),new pe(this.intl,this.isEnglish(),e)},n.listFormatter=function(e){return void 0===e&&(e={}),function(e,n){void 0===n&&(n={});var t=JSON.stringify([e,n]),r=ae[t];return r||(r=new Intl.ListFormat(e,n),ae[t]=r),r}(this.intl,e)},n.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},n.getWeekSettings=function(){return this.weekSettings?this.weekSettings:Qe()?function(e){var n=me[e];if(!n){var t=new Intl.Locale(e);n="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,me[e]=n}return n}(this.locale):Ne},n.getStartOfWeek=function(){return this.getWeekSettings().firstDay},n.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},n.getWeekendDays=function(){return this.getWeekSettings().weekend},n.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},l(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),Re=null,Se=function(e){function n(n){var t;return(t=e.call(this)||this).fixed=n,t}d(n,e),n.instance=function(e){return 0===e?n.utcInstance:new n(e)},n.parseSpecifier=function(e){if(e){var t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new n(pn(t[1],t[2]))}return null};var t=n.prototype;return t.offsetName=function(){return this.name},t.formatOffset=function(e,n){return Rn(this.fixed,n)},t.offset=function(){return this.fixed},t.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},l(n,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+Rn(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+Rn(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===Re&&(Re=new n(0)),Re}}]),n}(Q),Ie=function(e){function n(n){var t;return(t=e.call(this)||this).zoneName=n,t}d(n,e);var t=n.prototype;return t.offsetName=function(){return null},t.formatOffset=function(){return""},t.offset=function(){return NaN},t.equals=function(){return!1},l(n,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),n}(Q);function ge(e,n){if(ze(e)||null===e)return n;if(e instanceof Q)return e;if("string"==typeof e){var t=e.toLowerCase();return"default"===t?n:"local"===t||"system"===t?ne.instance:"utc"===t||"gmt"===t?Se.utcInstance:Se.parseSpecifier(t)||ue.create(e)}return Ke(e)?Se.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Ie(e)}var Ae,Oe=function(){return Date.now()},we="system",be=null,Ce=null,Le=null,Me=60,De=null,ke=function(){function e(){}return e.resetCaches=function(){ye.resetCache(),ue.resetCache()},l(e,null,[{key:"now",get:function(){return Oe},set:function(e){Oe=e}},{key:"defaultZone",get:function(){return ge(we,ne.instance)},set:function(e){we=e}},{key:"defaultLocale",get:function(){return be},set:function(e){be=e}},{key:"defaultNumberingSystem",get:function(){return Ce},set:function(e){Ce=e}},{key:"defaultOutputCalendar",get:function(){return Le},set:function(e){Le=e}},{key:"defaultWeekSettings",get:function(){return De},set:function(e){De=tn(e)}},{key:"twoDigitCutoffYear",get:function(){return Me},set:function(e){Me=e%100}},{key:"throwOnInvalid",get:function(){return Ae},set:function(e){Ae=e}}]),e}(),Pe=function(){function e(e,n){this.reason=e,this.explanation=n}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),Ue=[0,31,59,90,120,151,181,212,243,273,304,334],xe=[0,31,60,91,121,152,182,213,244,274,305,335];function _e(e,n){return new Pe("unit out of range","you specified "+n+" (of type "+typeof n+") as a "+e+", which is invalid")}function Fe(e,n,t){var r=new Date(Date.UTC(e,n-1,t));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var i=r.getUTCDay();return 0===i?7:i}function He(e,n,t){return t+(ln(e)?xe:Ue)[n-1]}function Ye(e,n){var t=ln(e)?xe:Ue,r=t.findIndex((function(e){return e<n}));return{month:r+1,day:n-t[r]}}function Ge(e,n){return(e-n+7)%7+1}function $e(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r,i=e.year,u=e.month,s=e.day,o=He(i,u,s),a=Ge(Fe(i,u,s),t),c=Math.floor((o-a+14-n)/7);return c<1?c=En(r=i-1,n,t):c>En(i,n,t)?(r=i+1,c=1):r=i,f({weekYear:r,weekNumber:c,weekday:a},Sn(e))}function Be(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r,i=e.weekYear,u=e.weekNumber,s=e.weekday,o=Ge(Fe(i,1,n),t),a=fn(i),c=7*u+s-o-7+n;c<1?c+=fn(r=i-1):c>a?(r=i+1,c-=fn(i)):r=i;var l=Ye(r,c);return f({year:r,month:l.month,day:l.day},Sn(e))}function We(e){var n=e.year;return f({year:n,ordinal:He(n,e.month,e.day)},Sn(e))}function Ve(e){var n=e.year,t=Ye(n,e.ordinal);return f({year:n,month:t.month,day:t.day},Sn(e))}function Ze(e,n){if(!ze(e.localWeekday)||!ze(e.localWeekNumber)||!ze(e.localWeekYear)){if(!ze(e.weekday)||!ze(e.weekNumber)||!ze(e.weekYear))throw new g("Cannot mix locale-based week fields with ISO-based week fields");return ze(e.localWeekday)||(e.weekday=e.localWeekday),ze(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ze(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:n.getMinDaysInFirstWeek(),startOfWeek:n.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function qe(e){var n=je(e.year),t=rn(e.month,1,12),r=rn(e.day,1,dn(e.year,e.month));return n?t?!r&&_e("day",e.day):_e("month",e.month):_e("year",e.year)}function Xe(e){var n=e.hour,t=e.minute,r=e.second,i=e.millisecond,u=rn(n,0,23)||24===n&&0===t&&0===r&&0===i,s=rn(t,0,59),o=rn(r,0,59),a=rn(i,0,999);return u?s?o?!a&&_e("millisecond",i):_e("second",r):_e("minute",t):_e("hour",n)}function ze(e){return void 0===e}function Ke(e){return"number"==typeof e}function je(e){return"number"==typeof e&&e%1==0}function Je(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Qe(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function en(e,n,t){if(0!==e.length)return e.reduce((function(e,r){var i=[n(r),r];return e&&t(e[0],i[0])===e[0]?e:i}),null)[1]}function nn(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function tn(e){if(null==e)return null;if("object"!=typeof e)throw new O("Week settings must be an object");if(!rn(e.firstDay,1,7)||!rn(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!rn(e,1,7)})))throw new O("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function rn(e,n,t){return je(e)&&e>=n&&e<=t}function un(e,n){return void 0===n&&(n=2),e<0?"-"+(""+-e).padStart(n,"0"):(""+e).padStart(n,"0")}function sn(e){return ze(e)||null===e||""===e?void 0:parseInt(e,10)}function on(e){return ze(e)||null===e||""===e?void 0:parseFloat(e)}function an(e){if(!ze(e)&&null!==e&&""!==e){var n=1e3*parseFloat("0."+e);return Math.floor(n)}}function cn(e,n,t){void 0===t&&(t=!1);var r=Math.pow(10,n);return(t?Math.trunc:Math.round)(e*r)/r}function ln(e){return e%4==0&&(e%100!=0||e%400==0)}function fn(e){return ln(e)?366:365}function dn(e,n){var t,r=(t=n-1)-12*Math.floor(t/12)+1;return 2===r?ln(e+(n-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function hn(e){var n=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(n=new Date(n)).setUTCFullYear(e.year,e.month-1,e.day),+n}function mn(e,n,t){return-Ge(Fe(e,1,n),t)+n-1}function En(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r=mn(e,n,t),i=mn(e+1,n,t);return(fn(e)-r+i)/7}function Tn(e){return e>99?e:e>ke.twoDigitCutoffYear?1900+e:2e3+e}function vn(e,n,t,r){void 0===r&&(r=null);var i=new Date(e),u={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(u.timeZone=r);var s=f({timeZoneName:n},u),o=new Intl.DateTimeFormat(t,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return o?o.value:null}function pn(e,n){var t=parseInt(e,10);Number.isNaN(t)&&(t=0);var r=parseInt(n,10)||0;return 60*t+(t<0||Object.is(t,-0)?-r:r)}function Nn(e){var n=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(n))throw new O("Invalid unit value "+e);return n}function yn(e,n){var t={};for(var r in e)if(nn(e,r)){var i=e[r];if(null==i)continue;t[n(r)]=Nn(i)}return t}function Rn(e,n){var t=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(n){case"short":return""+i+un(t,2)+":"+un(r,2);case"narrow":return""+i+t+(r>0?":"+r:"");case"techie":return""+i+un(t,2)+un(r,2);default:throw new RangeError("Value format "+n+" is out of range for property format")}}function Sn(e){return function(e){return["hour","minute","second","millisecond"].reduce((function(n,t){return n[t]=e[t],n}),{})}(e)}var In=["January","February","March","April","May","June","July","August","September","October","November","December"],gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],An=["J","F","M","A","M","J","J","A","S","O","N","D"];function On(e){switch(e){case"narrow":return[].concat(An);case"short":return[].concat(gn);case"long":return[].concat(In);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var wn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Cn=["M","T","W","T","F","S","S"];function Ln(e){switch(e){case"narrow":return[].concat(Cn);case"short":return[].concat(bn);case"long":return[].concat(wn);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Mn=["AM","PM"],Dn=["Before Christ","Anno Domini"],kn=["BC","AD"],Pn=["B","A"];function Un(e){switch(e){case"narrow":return[].concat(Pn);case"short":return[].concat(kn);case"long":return[].concat(Dn);default:return null}}function xn(e,n){for(var t,r="",i=N(e);!(t=i()).done;){var u=t.value;r+=u.literal?u.val:n(u.val)}return r}var _n={D:M,DD:D,DDD:P,DDDD:U,t:x,tt:_,ttt:F,tttt:H,T:Y,TT:G,TTT:$,TTTT:B,f:W,ff:Z,fff:z,ffff:j,F:V,FF:q,FFF:K,FFFF:J},Fn=function(){function e(e,n){this.opts=n,this.loc=e,this.systemLoc=null}e.create=function(n,t){return void 0===t&&(t={}),new e(n,t)},e.parseFormat=function(e){for(var n=null,t="",r=!1,i=[],u=0;u<e.length;u++){var s=e.charAt(u);"'"===s?(t.length>0&&i.push({literal:r||/^\s+$/.test(t),val:t}),n=null,t="",r=!r):r||s===n?t+=s:(t.length>0&&i.push({literal:/^\s+$/.test(t),val:t}),t=s,n=s)}return t.length>0&&i.push({literal:r||/^\s+$/.test(t),val:t}),i},e.macroTokenToFormatOpts=function(e){return _n[e]};var n=e.prototype;return n.formatWithSystemDefault=function(e,n){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,f({},this.opts,n)).format()},n.dtFormatter=function(e,n){return void 0===n&&(n={}),this.loc.dtFormatter(e,f({},this.opts,n))},n.formatDateTime=function(e,n){return this.dtFormatter(e,n).format()},n.formatDateTimeParts=function(e,n){return this.dtFormatter(e,n).formatToParts()},n.formatInterval=function(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},n.resolvedOptions=function(e,n){return this.dtFormatter(e,n).resolvedOptions()},n.num=function(e,n){if(void 0===n&&(n=0),this.opts.forceSimple)return un(e,n);var t=f({},this.opts);return n>0&&(t.padTo=n),this.loc.numberFormatter(t).format(e)},n.formatDateTimeFromString=function(n,t){var r=this,i="en"===this.loc.listingMode(),u=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,t){return r.loc.extract(n,e,t)},o=function(e){return n.isOffsetFixed&&0===n.offset&&e.allowZ?"Z":n.isValid?n.zone.formatOffset(n.ts,e.format):""},a=function(e,t){return i?function(e,n){return On(n)[e.month-1]}(n,e):s(t?{month:e}:{month:e,day:"numeric"},"month")},c=function(e,t){return i?function(e,n){return Ln(n)[e.weekday-1]}(n,e):s(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},l=function(e){return i?function(e,n){return Un(n)[e.year<0?0:1]}(n,e):s({era:e},"era")};return xn(e.parseFormat(t),(function(t){switch(t){case"S":return r.num(n.millisecond);case"u":case"SSS":return r.num(n.millisecond,3);case"s":return r.num(n.second);case"ss":return r.num(n.second,2);case"uu":return r.num(Math.floor(n.millisecond/10),2);case"uuu":return r.num(Math.floor(n.millisecond/100));case"m":return r.num(n.minute);case"mm":return r.num(n.minute,2);case"h":return r.num(n.hour%12==0?12:n.hour%12);case"hh":return r.num(n.hour%12==0?12:n.hour%12,2);case"H":return r.num(n.hour);case"HH":return r.num(n.hour,2);case"Z":return o({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return o({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:r.loc.locale});case"z":return n.zoneName;case"a":return i?function(e){return Mn[e.hour<12?0:1]}(n):s({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return u?s({day:"numeric"},"day"):r.num(n.day);case"dd":return u?s({day:"2-digit"},"day"):r.num(n.day,2);case"c":case"E":return r.num(n.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return u?s({month:"numeric",day:"numeric"},"month"):r.num(n.month);case"LL":return u?s({month:"2-digit",day:"numeric"},"month"):r.num(n.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return u?s({month:"numeric"},"month"):r.num(n.month);case"MM":return u?s({month:"2-digit"},"month"):r.num(n.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return u?s({year:"numeric"},"year"):r.num(n.year);case"yy":return u?s({year:"2-digit"},"year"):r.num(n.year.toString().slice(-2),2);case"yyyy":return u?s({year:"numeric"},"year"):r.num(n.year,4);case"yyyyyy":return u?s({year:"numeric"},"year"):r.num(n.year,6);case"G":return l("short");case"GG":return l("long");case"GGGGG":return l("narrow");case"kk":return r.num(n.weekYear.toString().slice(-2),2);case"kkkk":return r.num(n.weekYear,4);case"W":return r.num(n.weekNumber);case"WW":return r.num(n.weekNumber,2);case"n":return r.num(n.localWeekNumber);case"nn":return r.num(n.localWeekNumber,2);case"ii":return r.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(n.localWeekYear,4);case"o":return r.num(n.ordinal);case"ooo":return r.num(n.ordinal,3);case"q":return r.num(n.quarter);case"qq":return r.num(n.quarter,2);case"X":return r.num(Math.floor(n.ts/1e3));case"x":return r.num(n.ts);default:return function(t){var i=e.macroTokenToFormatOpts(t);return i?r.formatWithSystemDefault(n,i):t}(t)}}))},n.formatDurationFromString=function(n,t){var r,i=this,u=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(t),o=s.reduce((function(e,n){return n.literal?e:e.concat(n.val)}),[]),a=n.shiftTo.apply(n,o.map(u).filter((function(e){return e})));return xn(s,(r=a,function(e){var n=u(e);return n?i.num(r.get(n),e.length):e}))},e}(),Hn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Yn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=n.reduce((function(e,n){return e+n.source}),"");return RegExp("^"+r+"$")}function Gn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e){return n.reduce((function(n,t){var r=n[0],i=n[1],u=t(e,n[2]),s=u[1],o=u[2];return[f({},r,u[0]),s||i,o]}),[{},null,1]).slice(0,2)}}function $n(e){if(null==e)return[null,null];for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];for(var i=0,u=t;i<u.length;i++){var s=u[i],o=s[1],a=s[0].exec(e);if(a)return o(a)}return[null,null]}function Bn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e,t){var r,i={};for(r=0;r<n.length;r++)i[n[r]]=sn(e[t+r]);return[i,null,t+r]}}var Wn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Vn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zn=RegExp(Vn.source+("(?:"+Wn.source+"?(?:\\[("+Hn.source+")\\])?)?")),qn=RegExp("(?:T"+Zn.source+")?"),Xn=Bn("weekYear","weekNumber","weekDay"),zn=Bn("year","ordinal"),Kn=RegExp(Vn.source+" ?(?:"+Wn.source+"|("+Hn.source+"))?"),jn=RegExp("(?: "+Kn.source+")?");function Jn(e,n,t){var r=e[n];return ze(r)?t:sn(r)}function Qn(e,n){return[{hours:Jn(e,n,0),minutes:Jn(e,n+1,0),seconds:Jn(e,n+2,0),milliseconds:an(e[n+3])},null,n+4]}function et(e,n){var t=!e[n]&&!e[n+1],r=pn(e[n+1],e[n+2]);return[{},t?null:Se.instance(r),n+3]}function nt(e,n){return[{},e[n]?ue.create(e[n]):null,n+1]}var tt=RegExp("^T?"+Vn.source+"$"),rt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function it(e){var n=e[2],t=e[3],r=e[4],i=e[5],u=e[6],s=e[7],o=e[8],a="-"===e[0][0],c=s&&"-"===s[0],l=function(e,n){return void 0===n&&(n=!1),void 0!==e&&(n||e&&a)?-e:e};return[{years:l(on(e[1])),months:l(on(n)),weeks:l(on(t)),days:l(on(r)),hours:l(on(i)),minutes:l(on(u)),seconds:l(on(s),"-0"===s),milliseconds:l(an(o),c)}]}var ut={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function st(e,n,t,r,i,u,s){var o={year:2===n.length?Tn(sn(n)):sn(n),month:gn.indexOf(t)+1,day:sn(r),hour:sn(i),minute:sn(u)};return s&&(o.second=sn(s)),e&&(o.weekday=e.length>3?wn.indexOf(e)+1:bn.indexOf(e)+1),o}var ot=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function at(e){var n,t=e[8],r=e[9],i=e[10],u=e[11],s=st(e[1],e[4],e[3],e[2],e[5],e[6],e[7]);return n=t?ut[t]:r?0:pn(i,u),[s,new Se(n)]}var ct=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,lt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ft=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function dt(e){return[st(e[1],e[4],e[3],e[2],e[5],e[6],e[7]),Se.utcInstance]}function ht(e){return[st(e[1],e[7],e[2],e[3],e[4],e[5],e[6]),Se.utcInstance]}var mt=Yn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,qn),Et=Yn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,qn),Tt=Yn(/(\d{4})-?(\d{3})/,qn),vt=Yn(Zn),pt=Gn((function(e,n){return[{year:Jn(e,n),month:Jn(e,n+1,1),day:Jn(e,n+2,1)},null,n+3]}),Qn,et,nt),Nt=Gn(Xn,Qn,et,nt),yt=Gn(zn,Qn,et,nt),Rt=Gn(Qn,et,nt),St=Gn(Qn),It=Yn(/(\d{4})-(\d\d)-(\d\d)/,jn),gt=Yn(Kn),At=Gn(Qn,et,nt),Ot="Invalid Duration",wt={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},bt=f({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},wt),Ct=f({years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},wt),Lt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Mt=Lt.slice(0).reverse();function Dt(e,n,t){void 0===t&&(t=!1);var r={values:t?n.values:f({},e.values,n.values||{}),loc:e.loc.clone(n.loc),conversionAccuracy:n.conversionAccuracy||e.conversionAccuracy,matrix:n.matrix||e.matrix};return new Ut(r)}function kt(e,n){for(var t,r,i=null!=(t=n.milliseconds)?t:0,u=N(Mt.slice(1));!(r=u()).done;){var s=r.value;n[s]&&(i+=n[s]*e[s].milliseconds)}return i}function Pt(e,n){var t=kt(e,n)<0?-1:1;Lt.reduceRight((function(r,i){if(ze(n[i]))return r;if(r){var u=e[i][r],s=Math.floor(n[r]*t/u);n[i]+=s*t,n[r]-=s*u*t}return i}),null),Lt.reduce((function(t,r){if(ze(n[r]))return t;if(t){var i=n[t]%1;n[t]-=i,n[r]+=i*e[t][r]}return r}),null)}var Ut=function(e){function n(e){var n="longterm"===e.conversionAccuracy||!1,t=n?Ct:bt;e.matrix&&(t=e.matrix),this.values=e.values,this.loc=e.loc||ye.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t,this.isLuxonDuration=!0}n.fromMillis=function(e,t){return n.fromObject({milliseconds:e},t)},n.fromObject=function(e,t){if(void 0===t&&(t={}),null==e||"object"!=typeof e)throw new O("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new n({values:yn(e,n.normalizeUnit),loc:ye.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})},n.fromDurationLike=function(e){if(Ke(e))return n.fromMillis(e);if(n.isDuration(e))return e;if("object"==typeof e)return n.fromObject(e);throw new O("Unknown duration argument "+e+" of type "+typeof e)},n.fromISO=function(e,t){var r=function(e){return $n(e,[rt,it])}(e),i=r[0];return i?n.fromObject(i,t):n.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},n.fromISOTime=function(e,t){var r=function(e){return $n(e,[tt,St])}(e),i=r[0];return i?n.fromObject(i,t):n.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},n.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new O("need to specify a reason the Duration is invalid");var r=e instanceof Pe?e:new Pe(e,t);if(ke.throwOnInvalid)throw new I(r);return new n({invalid:r})},n.normalizeUnit=function(e){var n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!n)throw new A(e);return n},n.isDuration=function(e){return e&&e.isLuxonDuration||!1};var t=n.prototype;return t.toFormat=function(e,n){void 0===n&&(n={});var t=f({},n,{floor:!1!==n.round&&!1!==n.floor});return this.isValid?Fn.create(this.loc,t).formatDurationFromString(this,e):Ot},t.toHuman=function(e){var n=this;if(void 0===e&&(e={}),!this.isValid)return Ot;var t=Lt.map((function(t){var r=n.values[t];return ze(r)?null:n.loc.numberFormatter(f({style:"unit",unitDisplay:"long"},e,{unit:t.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(f({type:"conjunction",style:e.listStyle||"narrow"},e)).format(t)},t.toObject=function(){return this.isValid?f({},this.values):{}},t.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=cn(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},t.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=this.toMillis();return n<0||n>=864e5?null:(e=f({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),br.fromMillis(n,{zone:"UTC"}).toISOTime(e))},t.toJSON=function(){return this.toISO()},t.toString=function(){return this.toISO()},t[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},t.toMillis=function(){return this.isValid?kt(this.matrix,this.values):NaN},t.valueOf=function(){return this.toMillis()},t.plus=function(e){if(!this.isValid)return this;for(var t=n.fromDurationLike(e),r={},i=0,u=Lt;i<u.length;i++){var s=u[i];(nn(t.values,s)||nn(this.values,s))&&(r[s]=t.get(s)+this.get(s))}return Dt(this,{values:r},!0)},t.minus=function(e){if(!this.isValid)return this;var t=n.fromDurationLike(e);return this.plus(t.negate())},t.mapUnits=function(e){if(!this.isValid)return this;for(var n={},t=0,r=Object.keys(this.values);t<r.length;t++){var i=r[t];n[i]=Nn(e(this.values[i],i))}return Dt(this,{values:n},!0)},t.get=function(e){return this[n.normalizeUnit(e)]},t.set=function(e){return this.isValid?Dt(this,{values:f({},this.values,yn(e,n.normalizeUnit))}):this},t.reconfigure=function(e){var n=void 0===e?{}:e,t=n.conversionAccuracy,r=n.matrix;return Dt(this,{loc:this.loc.clone({locale:n.locale,numberingSystem:n.numberingSystem}),matrix:r,conversionAccuracy:t})},t.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},t.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return Pt(this.matrix,e),Dt(this,{values:e},!0)},t.rescale=function(){return this.isValid?Dt(this,{values:function(e){for(var n={},t=0,r=Object.entries(e);t<r.length;t++){var i=r[t],u=i[1];0!==u&&(n[i[0]]=u)}return n}(this.normalize().shiftToAll().toObject())},!0):this},t.shiftTo=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!this.isValid)return this;if(0===t.length)return this;t=t.map((function(e){return n.normalizeUnit(e)}));for(var i,u={},s={},o=this.toObject(),a=0,c=Lt;a<c.length;a++){var l=c[a];if(t.indexOf(l)>=0){i=l;var f=0;for(var d in s)f+=this.matrix[d][l]*s[d],s[d]=0;Ke(o[l])&&(f+=o[l]);var h=Math.trunc(f);u[l]=h,s[l]=(1e3*f-1e3*h)/1e3}else Ke(o[l])&&(s[l]=o[l])}for(var m in s)0!==s[m]&&(u[i]+=m===i?s[m]:s[m]/this.matrix[i][m]);return Pt(this.matrix,u),Dt(this,{values:u},!0)},t.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},t.negate=function(){if(!this.isValid)return this;for(var e={},n=0,t=Object.keys(this.values);n<t.length;n++){var r=t[n];e[r]=0===this.values[r]?0:-this.values[r]}return Dt(this,{values:e},!0)},t.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var n=0,t=Lt;n<t.length;n++){var r=t[n];if(u=e.values[r],!(void 0===(i=this.values[r])||0===i?void 0===u||0===u:i===u))return!1}var i,u;return!0},l(n,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),n}(Symbol.for("nodejs.util.inspect.custom")),xt="Invalid Interval";function _t(e,n){return e&&e.isValid?n&&n.isValid?n<e?Ft.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+n.toISO()):null:Ft.invalid("missing or invalid end"):Ft.invalid("missing or invalid start")}var Ft=function(e){function n(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}n.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new O("need to specify a reason the Interval is invalid");var r=e instanceof Pe?e:new Pe(e,t);if(ke.throwOnInvalid)throw new S(r);return new n({invalid:r})},n.fromDateTimes=function(e,t){var r=Cr(e),i=Cr(t),u=_t(r,i);return null==u?new n({start:r,end:i}):u},n.after=function(e,t){var r=Ut.fromDurationLike(t),i=Cr(e);return n.fromDateTimes(i,i.plus(r))},n.before=function(e,t){var r=Ut.fromDurationLike(t),i=Cr(e);return n.fromDateTimes(i.minus(r),i)},n.fromISO=function(e,t){var r=(e||"").split("/",2),i=r[0],u=r[1];if(i&&u){var s,o,a,c;try{o=(s=br.fromISO(i,t)).isValid}catch(u){o=!1}try{c=(a=br.fromISO(u,t)).isValid}catch(u){c=!1}if(o&&c)return n.fromDateTimes(s,a);if(o){var l=Ut.fromISO(u,t);if(l.isValid)return n.after(s,l)}else if(c){var f=Ut.fromISO(i,t);if(f.isValid)return n.before(a,f)}}return n.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},n.isInterval=function(e){return e&&e.isLuxonInterval||!1};var t=n.prototype;return t.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},t.count=function(e,n){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var t,r=this.start.startOf(e,n);return t=(t=null!=n&&n.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,n),Math.floor(t.diff(r,e).get(e))+(t.valueOf()!==this.end.valueOf())},t.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},t.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},t.isAfter=function(e){return!!this.isValid&&this.s>e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&this.s<=e&&this.e>e},t.set=function(e){var t=void 0===e?{}:e;return this.isValid?n.fromDateTimes(t.start||this.s,t.end||this.e):this},t.splitAt=function(){var e=this;if(!this.isValid)return[];for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];for(var u=r.map(Cr).filter((function(n){return e.contains(n)})).sort((function(e,n){return e.toMillis()-n.toMillis()})),s=[],o=this.s,a=0;o<this.e;){var c=u[a]||this.e,l=+c>+this.e?this.e:c;s.push(n.fromDateTimes(o,l)),o=l,a+=1}return s},t.splitBy=function(e){var t=Ut.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var r,i=this.s,u=1,s=[];i<this.e;){var o=this.start.plus(t.mapUnits((function(e){return e*u})));s.push(n.fromDateTimes(i,r=+o>+this.e?this.e:o)),i=r,u+=1}return s},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s<e.e},t.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},t.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},t.engulfs=function(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e},t.equals=function(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)},t.intersection=function(e){if(!this.isValid)return this;var t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:n.fromDateTimes(t,r)},t.union=function(e){return this.isValid?n.fromDateTimes(this.s<e.s?this.s:e.s,this.e>e.e?this.e:e.e):this},n.merge=function(e){var n=e.sort((function(e,n){return e.s-n.s})).reduce((function(e,n){var t=e[0],r=e[1];return r?r.overlaps(n)||r.abutsStart(n)?[t,r.union(n)]:[t.concat([r]),n]:[t,n]}),[[],null]),t=n[0],r=n[1];return r&&t.push(r),t},n.xor=function(e){for(var t,r,i=null,u=0,s=[],o=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),a=N((t=Array.prototype).concat.apply(t,o).sort((function(e,n){return e.time-n.time})));!(r=a()).done;){var c=r.value;1===(u+="s"===c.type?1:-1)?i=c.time:(i&&+i!=+c.time&&s.push(n.fromDateTimes(i,c.time)),i=null)}return n.merge(s)},t.difference=function(){for(var e=this,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.xor([this].concat(r)).map((function(n){return e.intersection(n)})).filter((function(e){return e&&!e.isEmpty()}))},t.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":xt},t[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},t.toLocaleString=function(e,n){return void 0===e&&(e=M),void 0===n&&(n={}),this.isValid?Fn.create(this.s.loc.clone(n),e).formatInterval(this):xt},t.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):xt},t.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():xt},t.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):xt},t.toFormat=function(e,n){var t=(void 0===n?{}:n).separator,r=void 0===t?" – ":t;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):xt},t.toDuration=function(e,n){return this.isValid?this.e.diff(this.s,e,n):Ut.invalid(this.invalidReason)},t.mapEndpoints=function(e){return n.fromDateTimes(e(this.s),e(this.e))},l(n,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),n}(Symbol.for("nodejs.util.inspect.custom")),Ht=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=ke.defaultZone);var n=br.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset},e.isValidIANAZone=function(e){return ue.isValidZone(e)},e.normalizeZone=function(e){return ge(e,ke.defaultZone)},e.getStartOfWeek=function(e){var n=void 0===e?{}:e,t=n.locale,r=n.locObj;return((void 0===r?null:r)||ye.create(void 0===t?null:t)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var n=void 0===e?{}:e,t=n.locale,r=n.locObj;return((void 0===r?null:r)||ye.create(void 0===t?null:t)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var n=void 0===e?{}:e,t=n.locale,r=n.locObj;return((void 0===r?null:r)||ye.create(void 0===t?null:t)).getWeekendDays().slice()},e.months=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj,s=t.outputCalendar;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,void 0===s?"gregory":s)).months(e)},e.monthsFormat=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj,s=t.outputCalendar;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,void 0===s?"gregory":s)).months(e,!0)},e.weekdays=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,null)).weekdays(e)},e.weekdaysFormat=function(e,n){void 0===e&&(e="long");var t=void 0===n?{}:n,r=t.locale,i=t.numberingSystem,u=t.locObj;return((void 0===u?null:u)||ye.create(void 0===r?null:r,void 0===i?null:i,null)).weekdays(e,!0)},e.meridiems=function(e){var n=(void 0===e?{}:e).locale;return ye.create(void 0===n?null:n).meridiems()},e.eras=function(e,n){void 0===e&&(e="short");var t=(void 0===n?{}:n).locale;return ye.create(void 0===t?null:t,null,"gregory").eras(e)},e.features=function(){return{relative:Je(),localeWeek:Qe()}},e}();function Yt(e,n){var t=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=t(n)-t(e);return Math.floor(Ut.fromMillis(r).as("days"))}var Gt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$t={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Bt=Gt.hanidec.replace(/[\[|\]]/g,"").split("");function Wt(e,n){return void 0===n&&(n=""),new RegExp(""+Gt[e.numberingSystem||"latn"]+n)}function Vt(e,n){return void 0===n&&(n=function(e){return e}),{regex:e,deser:function(e){return n(function(e){var n=parseInt(e,10);if(isNaN(n)){n="";for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(-1!==e[t].search(Gt.hanidec))n+=Bt.indexOf(e[t]);else for(var i in $t){var u=$t[i],s=u[0];r>=s&&r<=u[1]&&(n+=r-s)}}return parseInt(n,10)}return n}(e[0]))}}}var Zt="[ "+String.fromCharCode(160)+"]",qt=new RegExp(Zt,"g");function Xt(e){return e.replace(/\./g,"\\.?").replace(qt,Zt)}function zt(e){return e.replace(/\./g,"").replace(qt," ").toLowerCase()}function Kt(e,n){return null===e?null:{regex:RegExp(e.map(Xt).join("|")),deser:function(t){var r=t[0];return e.findIndex((function(e){return zt(r)===zt(e)}))+n}}}function jt(e,n){return{regex:e,deser:function(e){return pn(e[1],e[2])},groups:n}}function Jt(e){return{regex:e,deser:function(e){return e[0]}}}var Qt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}},er=null;function nr(e,n){var t;return(t=Array.prototype).concat.apply(t,e.map((function(e){return function(e,n){if(e.literal)return e;var t=rr(Fn.macroTokenToFormatOpts(e.val),n);return null==t||t.includes(void 0)?e:t}(e,n)})))}function tr(e,n,t){var r=nr(Fn.parseFormat(t),e),i=r.map((function(n){return t=n,i=Wt(r=e),u=Wt(r,"{2}"),s=Wt(r,"{3}"),o=Wt(r,"{4}"),a=Wt(r,"{6}"),c=Wt(r,"{1,2}"),l=Wt(r,"{1,3}"),f=Wt(r,"{1,6}"),d=Wt(r,"{1,9}"),h=Wt(r,"{2,4}"),m=Wt(r,"{4,6}"),E=function(e){return{regex:RegExp((n=e.val,n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var n},T=function(e){if(t.literal)return E(e);switch(e.val){case"G":return Kt(r.eras("short"),0);case"GG":return Kt(r.eras("long"),0);case"y":return Vt(f);case"yy":case"kk":return Vt(h,Tn);case"yyyy":case"kkkk":return Vt(o);case"yyyyy":return Vt(m);case"yyyyyy":return Vt(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Vt(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Vt(u);case"MMM":return Kt(r.months("short",!0),1);case"MMMM":return Kt(r.months("long",!0),1);case"LLL":return Kt(r.months("short",!1),1);case"LLLL":return Kt(r.months("long",!1),1);case"o":case"S":return Vt(l);case"ooo":case"SSS":return Vt(s);case"u":return Jt(d);case"uu":return Jt(c);case"uuu":case"E":case"c":return Vt(i);case"a":return Kt(r.meridiems(),0);case"EEE":return Kt(r.weekdays("short",!1),1);case"EEEE":return Kt(r.weekdays("long",!1),1);case"ccc":return Kt(r.weekdays("short",!0),1);case"cccc":return Kt(r.weekdays("long",!0),1);case"Z":case"ZZ":return jt(new RegExp("([+-]"+c.source+")(?::("+u.source+"))?"),2);case"ZZZ":return jt(new RegExp("([+-]"+c.source+")("+u.source+")?"),2);case"z":return Jt(/[a-z_+-/]{1,256}?/i);case" ":return Jt(/[^\S\n\r]/);default:return E(e)}}(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},T.token=t,T;var t,r,i,u,s,o,a,c,l,f,d,h,m,E,T})),u=i.find((function(e){return e.invalidReason}));if(u)return{input:n,tokens:r,invalidReason:u.invalidReason};var s=function(e){return["^"+e.map((function(e){return e.regex})).reduce((function(e,n){return e+"("+n.source+")"}),"")+"$",e]}(i),o=s[1],a=RegExp(s[0],"i"),c=function(e,n,t){var r=e.match(n);if(r){var i={},u=1;for(var s in t)if(nn(t,s)){var o=t[s],a=o.groups?o.groups+1:1;!o.literal&&o.token&&(i[o.token.val[0]]=o.deser(r.slice(u,u+a))),u+=a}return[r,i]}return[r,{}]}(n,a,o),l=c[0],f=c[1],d=f?function(e){var n,t=null;return ze(e.z)||(t=ue.create(e.z)),ze(e.Z)||(t||(t=new Se(e.Z)),n=e.Z),ze(e.q)||(e.M=3*(e.q-1)+1),ze(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),ze(e.u)||(e.S=an(e.u)),[Object.keys(e).reduce((function(n,t){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(t);return r&&(n[r]=e[t]),n}),{}),t,n]}(f):[null,null,void 0],h=d[0],m=d[1],E=d[2];if(nn(f,"a")&&nn(f,"H"))throw new g("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:r,regex:a,rawMatches:l,matches:f,result:h,zone:m,specificOffset:E}}function rr(e,n){if(!e)return null;var t=Fn.create(n,e).dtFormatter((er||(er=br.fromMillis(1555555555555)),er)),r=t.formatToParts(),i=t.resolvedOptions();return r.map((function(n){return function(e,n,t){var r=e.type,i=e.value;if("literal"===r){var u=/^\s+$/.test(i);return{literal:!u,val:u?" ":i}}var s=r;"hour"===r&&(s=null!=n.hour12?n.hour12?"hour12":"hour24":null!=n.hourCycle?"h11"===n.hourCycle||"h12"===n.hourCycle?"hour12":"hour24":t.hour12?"hour12":"hour24");var o=Qt[s];if("object"==typeof o&&(o=o[n[r]]),o)return{literal:!1,val:o}}(n,e,i)}))}var ir="Invalid DateTime",ur=864e13;function sr(e){return new Pe("unsupported zone",'the zone "'+e.name+'" is not supported')}function or(e){return null===e.weekData&&(e.weekData=$e(e.c)),e.weekData}function ar(e){return null===e.localWeekData&&(e.localWeekData=$e(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function cr(e,n){var t={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new br(f({},t,n,{old:t}))}function lr(e,n,t){var r=e-60*n*1e3,i=t.offset(r);if(n===i)return[r,n];var u=t.offset(r-=60*(i-n)*1e3);return i===u?[r,i]:[e-60*Math.min(i,u)*1e3,Math.max(i,u)]}function fr(e,n){var t=new Date(e+=60*n*1e3);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function dr(e,n,t){return lr(hn(e),n,t)}function hr(e,n){var t=e.o,r=e.c.year+Math.trunc(n.years),i=e.c.month+Math.trunc(n.months)+3*Math.trunc(n.quarters),u=f({},e.c,{year:r,month:i,day:Math.min(e.c.day,dn(r,i))+Math.trunc(n.days)+7*Math.trunc(n.weeks)}),s=Ut.fromObject({years:n.years-Math.trunc(n.years),quarters:n.quarters-Math.trunc(n.quarters),months:n.months-Math.trunc(n.months),weeks:n.weeks-Math.trunc(n.weeks),days:n.days-Math.trunc(n.days),hours:n.hours,minutes:n.minutes,seconds:n.seconds,milliseconds:n.milliseconds}).as("milliseconds"),o=lr(hn(u),t,e.zone),a=o[0],c=o[1];return 0!==s&&(c=e.zone.offset(a+=s)),{ts:a,o:c}}function mr(e,n,t,r,i,u){var s=t.setZone,o=t.zone;if(e&&0!==Object.keys(e).length||n){var a=br.fromObject(e,f({},t,{zone:n||o,specificOffset:u}));return s?a:a.setZone(o)}return br.invalid(new Pe("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function Er(e,n,t){return void 0===t&&(t=!0),e.isValid?Fn.create(ye.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(e,n):null}function Tr(e,n){var t=e.c.year>9999||e.c.year<0,r="";return t&&e.c.year>=0&&(r+="+"),r+=un(e.c.year,t?6:4),n?(r+="-",r+=un(e.c.month),r+="-",r+=un(e.c.day)):(r+=un(e.c.month),r+=un(e.c.day)),r}function vr(e,n,t,r,i,u){var s=un(e.c.hour);return n?(s+=":",s+=un(e.c.minute),0===e.c.millisecond&&0===e.c.second&&t||(s+=":")):s+=un(e.c.minute),0===e.c.millisecond&&0===e.c.second&&t||(s+=un(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=un(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!u?s+="Z":e.o<0?(s+="-",s+=un(Math.trunc(-e.o/60)),s+=":",s+=un(Math.trunc(-e.o%60))):(s+="+",s+=un(Math.trunc(e.o/60)),s+=":",s+=un(Math.trunc(e.o%60)))),u&&(s+="["+e.zone.ianaName+"]"),s}var pr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Nr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},yr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Rr=["year","month","day","hour","minute","second","millisecond"],Sr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ir=["year","ordinal","hour","minute","second","millisecond"];function gr(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var n={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!n)throw new A(e);return n}(e)}}function Ar(e,n){var t,r,i=ge(n.zone,ke.defaultZone),u=ye.fromObject(n),s=ke.now();if(ze(e.year))t=s;else{for(var o=0,a=Rr;o<a.length;o++){var c=a[o];ze(e[c])&&(e[c]=pr[c])}var l=qe(e)||Xe(e);if(l)return br.invalid(l);var f=dr(e,i.offset(s),i);t=f[0],r=f[1]}return new br({ts:t,zone:i,loc:u,o:r})}function Or(e,n,t){var r=!!ze(t.round)||t.round,i=function(e,i){return e=cn(e,r||t.calendary?0:2,!0),n.loc.clone(t).relFormatter(t).format(e,i)},u=function(r){return t.calendary?n.hasSame(e,r)?0:n.startOf(r).diff(e.startOf(r),r).get(r):n.diff(e,r).get(r)};if(t.unit)return i(u(t.unit),t.unit);for(var s,o=N(t.units);!(s=o()).done;){var a=s.value,c=u(a);if(Math.abs(c)>=1)return i(c,a)}return i(e>n?-0:0,t.units[t.units.length-1])}function wr(e){var n,t={};return e.length>0&&"object"==typeof e[e.length-1]?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var br=function(e){function n(e){var n=e.zone||ke.defaultZone,t=e.invalid||(Number.isNaN(e.ts)?new Pe("invalid input"):null)||(n.isValid?null:sr(n));this.ts=ze(e.ts)?ke.now():e.ts;var r=null,i=null;if(!t)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n)){var u=[e.old.c,e.old.o];r=u[0],i=u[1]}else{var s=n.offset(this.ts);r=fr(this.ts,s),r=(t=Number.isNaN(r.year)?new Pe("invalid input"):null)?null:r,i=t?null:s}this._zone=n,this.loc=e.loc||ye.create(),this.invalid=t,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}n.now=function(){return new n({})},n.local=function(){var e=wr(arguments),n=e[1];return Ar({year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]},e[0])},n.utc=function(){var e=wr(arguments),n=e[0],t=e[1],r=t[0],i=t[1],u=t[2],s=t[3],o=t[4],a=t[5],c=t[6];return n.zone=Se.utcInstance,Ar({year:r,month:i,day:u,hour:s,minute:o,second:a,millisecond:c},n)},n.fromJSDate=function(e,t){void 0===t&&(t={});var r="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;if(Number.isNaN(r))return n.invalid("invalid input");var i=ge(t.zone,ke.defaultZone);return i.isValid?new n({ts:r,zone:i,loc:ye.fromObject(t)}):n.invalid(sr(i))},n.fromMillis=function(e,t){if(void 0===t&&(t={}),Ke(e))return e<-ur||e>ur?n.invalid("Timestamp out of range"):new n({ts:e,zone:ge(t.zone,ke.defaultZone),loc:ye.fromObject(t)});throw new O("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},n.fromSeconds=function(e,t){if(void 0===t&&(t={}),Ke(e))return new n({ts:1e3*e,zone:ge(t.zone,ke.defaultZone),loc:ye.fromObject(t)});throw new O("fromSeconds requires a numerical input")},n.fromObject=function(e,t){void 0===t&&(t={}),e=e||{};var r=ge(t.zone,ke.defaultZone);if(!r.isValid)return n.invalid(sr(r));var i=ye.fromObject(t),u=yn(e,gr),s=Ze(u,i),o=s.minDaysInFirstWeek,a=s.startOfWeek,c=ke.now(),l=ze(t.specificOffset)?r.offset(c):t.specificOffset,f=!ze(u.ordinal),d=!ze(u.year),h=!ze(u.month)||!ze(u.day),m=d||h,E=u.weekYear||u.weekNumber;if((m||f)&&E)throw new g("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new g("Can't mix ordinal dates with month/day");var T,v,p=E||u.weekday&&!m,y=fr(c,l);p?(T=Sr,v=Nr,y=$e(y,o,a)):f?(T=Ir,v=yr,y=We(y)):(T=Rr,v=pr);for(var R,S=!1,I=N(T);!(R=I()).done;){var A=R.value;ze(u[A])?u[A]=S?v[A]:y[A]:S=!0}var O=p?function(e,n,t){void 0===n&&(n=4),void 0===t&&(t=1);var r=je(e.weekYear),i=rn(e.weekNumber,1,En(e.weekYear,n,t)),u=rn(e.weekday,1,7);return r?i?!u&&_e("weekday",e.weekday):_e("week",e.weekNumber):_e("weekYear",e.weekYear)}(u,o,a):f?function(e){var n=je(e.year),t=rn(e.ordinal,1,fn(e.year));return n?!t&&_e("ordinal",e.ordinal):_e("year",e.year)}(u):qe(u),w=O||Xe(u);if(w)return n.invalid(w);var b=dr(p?Be(u,o,a):f?Ve(u):u,l,r),C=new n({ts:b[0],zone:r,o:b[1],loc:i});return u.weekday&&m&&e.weekday!==C.weekday?n.invalid("mismatched weekday","you can't specify both a weekday of "+u.weekday+" and a date of "+C.toISO()):C},n.fromISO=function(e,n){void 0===n&&(n={});var t=function(e){return $n(e,[mt,pt],[Et,Nt],[Tt,yt],[vt,Rt])}(e);return mr(t[0],t[1],n,"ISO 8601",e)},n.fromRFC2822=function(e,n){void 0===n&&(n={});var t=function(e){return $n(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[ot,at])}(e);return mr(t[0],t[1],n,"RFC 2822",e)},n.fromHTTP=function(e,n){void 0===n&&(n={});var t=function(e){return $n(e,[ct,dt],[lt,dt],[ft,ht])}(e);return mr(t[0],t[1],n,"HTTP",n)},n.fromFormat=function(e,t,r){if(void 0===r&&(r={}),ze(e)||ze(t))throw new O("fromFormat requires an input string and a format");var i,u,s=r.locale,o=r.numberingSystem,a=(i=ye.fromOpts({locale:void 0===s?null:s,numberingSystem:void 0===o?null:o,defaultToEN:!0}),[(u=tr(i,e,t)).result,u.zone,u.specificOffset,u.invalidReason]),c=a[0],l=a[1],f=a[2],d=a[3];return d?n.invalid(d):mr(c,l,r,"format "+t,e,f)},n.fromString=function(e,t,r){return void 0===r&&(r={}),n.fromFormat(e,t,r)},n.fromSQL=function(e,n){void 0===n&&(n={});var t=function(e){return $n(e,[It,pt],[gt,At])}(e);return mr(t[0],t[1],n,"SQL",e)},n.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new O("need to specify a reason the DateTime is invalid");var r=e instanceof Pe?e:new Pe(e,t);if(ke.throwOnInvalid)throw new R(r);return new n({invalid:r})},n.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},n.parseFormatForOpts=function(e,n){void 0===n&&(n={});var t=rr(e,ye.fromObject(n));return t?t.map((function(e){return e?e.val:null})).join(""):null},n.expandFormat=function(e,n){return void 0===n&&(n={}),nr(Fn.parseFormat(e),ye.fromObject(n)).map((function(e){return e.val})).join("")};var t=n.prototype;return t.get=function(e){return this[e]},t.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,n=6e4,t=hn(this.c),r=this.zone.offset(t-e),i=this.zone.offset(t+e),u=this.zone.offset(t-r*n),s=this.zone.offset(t-i*n);if(u===s)return[this];var o=t-u*n,a=t-s*n,c=fr(o,u),l=fr(a,s);return c.hour===l.hour&&c.minute===l.minute&&c.second===l.second&&c.millisecond===l.millisecond?[cr(this,{ts:o}),cr(this,{ts:a})]:[this]},t.resolvedLocaleOptions=function(e){void 0===e&&(e={});var n=Fn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n.locale,numberingSystem:n.numberingSystem,outputCalendar:n.calendar}},t.toUTC=function(e,n){return void 0===e&&(e=0),void 0===n&&(n={}),this.setZone(Se.instance(e),n)},t.toLocal=function(){return this.setZone(ke.defaultZone)},t.setZone=function(e,t){var r=void 0===t?{}:t,i=r.keepLocalTime,u=void 0!==i&&i,s=r.keepCalendarTime,o=void 0!==s&&s;if((e=ge(e,ke.defaultZone)).equals(this.zone))return this;if(e.isValid){var a=this.ts;if(u||o){var c=e.offset(this.ts);a=dr(this.toObject(),c,e)[0]}return cr(this,{ts:a,zone:e})}return n.invalid(sr(e))},t.reconfigure=function(e){var n=void 0===e?{}:e;return cr(this,{loc:this.loc.clone({locale:n.locale,numberingSystem:n.numberingSystem,outputCalendar:n.outputCalendar})})},t.setLocale=function(e){return this.reconfigure({locale:e})},t.set=function(e){if(!this.isValid)return this;var n,t=yn(e,gr),r=Ze(t,this.loc),i=r.minDaysInFirstWeek,u=r.startOfWeek,s=!ze(t.weekYear)||!ze(t.weekNumber)||!ze(t.weekday),o=!ze(t.ordinal),a=!ze(t.year),c=!ze(t.month)||!ze(t.day);if((a||c||o)&&(t.weekYear||t.weekNumber))throw new g("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new g("Can't mix ordinal dates with month/day");s?n=Be(f({},$e(this.c,i,u),t),i,u):ze(t.ordinal)?(n=f({},this.toObject(),t),ze(t.day)&&(n.day=Math.min(dn(n.year,n.month),n.day))):n=Ve(f({},We(this.c),t));var l=dr(n,this.o,this.zone);return cr(this,{ts:l[0],o:l[1]})},t.plus=function(e){return this.isValid?cr(this,hr(this,Ut.fromDurationLike(e))):this},t.minus=function(e){return this.isValid?cr(this,hr(this,Ut.fromDurationLike(e).negate())):this},t.startOf=function(e,n){var t=(void 0===n?{}:n).useLocaleWeeks,r=void 0!==t&&t;if(!this.isValid)return this;var i={},u=Ut.normalizeUnit(e);switch(u){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===u)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===u){var o=Math.ceil(this.month/3);i.month=3*(o-1)+1}return this.set(i)},t.endOf=function(e,n){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e,n).minus(1):this},t.toFormat=function(e,n){return void 0===n&&(n={}),this.isValid?Fn.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):ir},t.toLocaleString=function(e,n){return void 0===e&&(e=M),void 0===n&&(n={}),this.isValid?Fn.create(this.loc.clone(n),e).formatDateTime(this):ir},t.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?Fn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},t.toISO=function(e){var n=void 0===e?{}:e,t=n.format,r=n.suppressSeconds,i=void 0!==r&&r,u=n.suppressMilliseconds,s=void 0!==u&&u,o=n.includeOffset,a=void 0===o||o,c=n.extendedZone,l=void 0!==c&&c;if(!this.isValid)return null;var f="extended"===(void 0===t?"extended":t),d=Tr(this,f);return(d+="T")+vr(this,f,i,s,a,l)},t.toISODate=function(e){var n=(void 0===e?{}:e).format;return this.isValid?Tr(this,"extended"===(void 0===n?"extended":n)):null},t.toISOWeekDate=function(){return Er(this,"kkkk-'W'WW-c")},t.toISOTime=function(e){var n=void 0===e?{}:e,t=n.suppressMilliseconds,r=n.suppressSeconds,i=n.includeOffset,u=n.includePrefix,s=n.extendedZone,o=n.format;return this.isValid?(void 0!==u&&u?"T":"")+vr(this,"extended"===(void 0===o?"extended":o),void 0!==r&&r,void 0!==t&&t,void 0===i||i,void 0!==s&&s):null},t.toRFC2822=function(){return Er(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},t.toHTTP=function(){return Er(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},t.toSQLDate=function(){return this.isValid?Tr(this,!0):null},t.toSQLTime=function(e){var n=void 0===e?{}:e,t=n.includeOffset,r=void 0===t||t,i=n.includeZone,u=void 0!==i&&i,s=n.includeOffsetSpace,o="HH:mm:ss.SSS";return(u||r)&&((void 0===s||s)&&(o+=" "),u?o+="z":r&&(o+="ZZ")),Er(this,o,!0)},t.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},t.toString=function(){return this.isValid?this.toISO():ir},t[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},t.valueOf=function(){return this.toMillis()},t.toMillis=function(){return this.isValid?this.ts:NaN},t.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},t.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},t.toJSON=function(){return this.toISO()},t.toBSON=function(){return this.toJSDate()},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var n=f({},this.c);return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n},t.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},t.diff=function(e,n,t){if(void 0===n&&(n="milliseconds"),void 0===t&&(t={}),!this.isValid||!e.isValid)return Ut.invalid("created by diffing an invalid DateTime");var r,i=f({locale:this.locale,numberingSystem:this.numberingSystem},t),u=(r=n,Array.isArray(r)?r:[r]).map(Ut.normalizeUnit),s=e.valueOf()>this.valueOf(),o=function(e,n,t,r){var i,u=function(e,n,t){for(var r,i,u={},s=e,o=0,a=[["years",function(e,n){return n.year-e.year}],["quarters",function(e,n){return n.quarter-e.quarter+4*(n.year-e.year)}],["months",function(e,n){return n.month-e.month+12*(n.year-e.year)}],["weeks",function(e,n){var t=Yt(e,n);return(t-t%7)/7}],["days",Yt]];o<a.length;o++){var c=a[o],l=c[0],f=c[1];t.indexOf(l)>=0&&(r=l,u[l]=f(e,n),(i=s.plus(u))>n?(u[l]--,(e=s.plus(u))>n&&(i=e,u[l]--,e=s.plus(u))):e=i)}return[e,u,i,r]}(e,n,t),s=u[0],o=u[1],a=u[2],c=u[3],l=n-s,f=t.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));0===f.length&&(a<n&&(a=s.plus(((i={})[c]=1,i))),a!==s&&(o[c]=(o[c]||0)+l/(a-s)));var d,h=Ut.fromObject(o,r);return f.length>0?(d=Ut.fromMillis(l,r)).shiftTo.apply(d,f).plus(h):h}(s?this:e,s?e:this,u,i);return s?o.negate():o},t.diffNow=function(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(n.now(),e,t)},t.until=function(e){return this.isValid?Ft.fromDateTimes(this,e):this},t.hasSame=function(e,n,t){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,t)<=r&&r<=i.endOf(n,t)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=e.base||n.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],u=e.unit;return Array.isArray(e.unit)&&(i=e.unit,u=void 0),Or(t,this.plus(r),f({},e,{numeric:"always",units:i,unit:u}))},t.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?Or(e.base||n.fromObject({},{zone:this.zone}),this,f({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},n.min=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(n.isDateTime))throw new O("min requires all arguments be DateTimes");return en(t,(function(e){return e.valueOf()}),Math.min)},n.max=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(n.isDateTime))throw new O("max requires all arguments be DateTimes");return en(t,(function(e){return e.valueOf()}),Math.max)},n.fromFormatExplain=function(e,n,t){void 0===t&&(t={});var r=t.locale,i=t.numberingSystem;return tr(ye.fromOpts({locale:void 0===r?null:r,numberingSystem:void 0===i?null:i,defaultToEN:!0}),e,n)},n.fromStringExplain=function(e,t,r){return void 0===r&&(r={}),n.fromFormatExplain(e,t,r)},l(n,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?or(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?or(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?or(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?ar(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?ar(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?ar(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?We(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Ht.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Ht.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Ht.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Ht.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return ln(this.year)}},{key:"daysInMonth",get:function(){return dn(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?fn(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?En(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?En(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return M}},{key:"DATE_MED",get:function(){return D}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return k}},{key:"DATE_FULL",get:function(){return P}},{key:"DATE_HUGE",get:function(){return U}},{key:"TIME_SIMPLE",get:function(){return x}},{key:"TIME_WITH_SECONDS",get:function(){return _}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return F}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return H}},{key:"TIME_24_SIMPLE",get:function(){return Y}},{key:"TIME_24_WITH_SECONDS",get:function(){return G}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return $}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return B}},{key:"DATETIME_SHORT",get:function(){return W}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return V}},{key:"DATETIME_MED",get:function(){return Z}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return q}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return X}},{key:"DATETIME_FULL",get:function(){return z}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return K}},{key:"DATETIME_HUGE",get:function(){return j}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return J}}]),n}(Symbol.for("nodejs.util.inspect.custom"));function Cr(e){if(br.isDateTime(e))return e;if(e&&e.valueOf&&Ke(e.valueOf()))return br.fromJSDate(e);if(e&&"object"==typeof e)return br.fromObject(e);throw new O("Unknown datetime argument: "+e+", of type "+typeof e)}var Lr=a.DateTime=br;a.Duration=Ut;var Mr=a.FixedOffsetZone=Se,Dr=a.IANAZone=ue;a.Info=Ht,a.Interval=Ft,a.InvalidZone=Ie,a.Settings=ke,a.SystemZone=ne,a.VERSION="3.4.4";var kr,Pr=a.Zone=Q;!function(e){e.InvalidFunctionParameters="InvalidFunctionParameters",e.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",e.UnsupportedSqlFunction="UnsupportedSqlFunction",e.UnsupportedOperator="UnsupportedOperator",e.UnsupportedSyntax="UnsupportedSyntax",e.UnsupportedIsRhs="UnsupportedIsRhs",e.UnsupportedIsLhs="UnsupportedIsLhs",e.InvalidDataType="InvalidDataType",e.CannotCastValue="CannotCastValue",e.FunctionNotRecognized="FunctionNotRecognized",e.InvalidTime="InvalidTime",e.InvalidParameterCount="InvalidParameterCount",e.InvalidTimeStamp="InvalidTimeStamp",e.InvalidDate="InvalidDate",e.InvalidOperator="InvalidOperator",e.IllegalInterval="IllegalInterval",e.YearMonthIntervals="YearMonthIntervals",e.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",e.MissingStatisticParameters="MissingStatisticParameters"}(kr||(kr={}));const Ur={[kr.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[kr.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[kr.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[kr.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[kr.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[kr.UnsupportedOperator]:"Unsupported operator - {operator}",[kr.UnsupportedSyntax]:"Unsupported syntax - {node}",[kr.UnsupportedSqlFunction]:"Sql function not found = {function}",[kr.InvalidDataType]:"Invalid sql data type",[kr.InvalidDate]:"Invalid date encountered",[kr.InvalidOperator]:"Invalid operator encountered",[kr.InvalidTime]:"Invalid time encountered",[kr.IllegalInterval]:"Illegal interval",[kr.FunctionNotRecognized]:"Function not recognized",[kr.InvalidTimeStamp]:"Invalid timestamp encountered",[kr.InvalidParameterCount]:"Invalid parameter count for call to {name}",[kr.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[kr.YearMonthIntervals]:"Year-Month Intervals not supported",[kr.CannotCastValue]:"Cannot cast value to the required data type"};class xr extends Error{constructor(e,n){super(Hr(Ur[e],n)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,xr)}}const _r=/\{(?:[^}]+)\}/gu;function Fr(e){return e??""}function Hr(e,n){return n?e.replaceAll(_r,"object"==typeof n?(e,t)=>Fr(function(e,n){if(null!=n)return n[e]||function(e,n,t){let r=t;for(const n of e){if(null==r)return;if(!(n in r))return void 0;r=r[n]}return r}(e.split("."),0,n)}(t,n)):(e,t)=>Fr(n(t))):e}var Yr;function Gr(e){return"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e}let $r;!function(e){e[e.Standardised=0]="Standardised",e[e.StandardisedNoInterval=1]="StandardisedNoInterval",e[e.SqlServer=2]="SqlServer",e[e.Oracle=3]="Oracle",e[e.Postgres=4]="Postgres",e[e.PGDB=5]="PGDB",e[e.FILEGDB=6]="FILEGDB",e[e.NotEvaluated=7]="NotEvaluated"}(Yr||(Yr={}));const Br=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function Wr(){return void 0===$r&&($r=Br??globalThis.navigator?.language??"en"),$r}class Vr{}var Zr;Vr.instance=new Dr("Etc/UTC"),function(e){e.TimeZoneNotRecognized="TimeZoneNotRecognized"}(Zr||(Zr={}));const qr={[Zr.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class Xr extends Error{constructor(e,n){super(Hr(qr[e],n)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,Xr)}}function zr(e,n=!0){if(e instanceof Pr)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return Vr.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const n=Mr.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(n)return n}const t=Dr.create(e);if(!t.isValid){if(n)throw new Xr(Zr.TimeZoneNotRecognized);return null}return t}function Kr(e,n,t){return e<n?e-n:e>t?e-t:0}function jr(e,n,t){return e<n?n:e>t?t:e}class Jr{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,n=1,t=1,r=0,i=0,u=0,s=0,o){if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(t)||Number.isNaN(r)||Number.isNaN(i)||Number.isNaN(u)||Number.isNaN(s))return null;const a=Lr.local(e,n).daysInMonth;let c=Lr.fromObject({day:jr(t,1,a),year:e,month:jr(n,1,12),hour:jr(r,0,23),minute:jr(i,0,59),second:jr(u,0,59),millisecond:jr(s,0,999)},{zone:zr(o)});return c=c.plus({months:Kr(n,1,12),days:Kr(t,1,a),hours:Kr(r,0,23),minutes:Kr(i,0,59),seconds:Kr(u,0,59),milliseconds:Kr(s,0,999)}),new Jr(c)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,n){const t=zr(n);return e.isUnknownTimeZone||t===Vr.instance?Jr.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,t):new Jr(e._date.setZone(t))}static dateJSToArcadeDate(e){return new Jr(Lr.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,n="system"){const t=zr(n);return new Jr(Lr.fromJSDate(e,{zone:t}))}static unknownEpochToArcadeDate(e){return new Jr(Lr.fromMillis(e,{zone:Vr.instance}))}static unknownDateJSToArcadeDate(e){return new Jr(Lr.fromMillis(e.getTime(),{zone:Vr.instance}))}static epochToArcadeDate(e,n="system"){const t=zr(n);return new Jr(Lr.fromMillis(e,{zone:t}))}static dateTimeToArcadeDate(e){return new Jr(e)}clone(){return new Jr(this._date)}changeTimeZone(e){const n=zr(e);return Jr.dateTimeToArcadeDate(this._date.setZone(n))}static dateTimeAndZoneToArcadeDate(e,n){const t=zr(n);return e.zone===Vr.instance||t===Vr.instance?Jr.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,t):new Jr(e.setZone(t))}static nowToArcadeDate(e){const n=zr(e);return new Jr(Lr.fromJSDate(new Date,{zone:n}))}static nowUTCToArcadeDate(){return new Jr(Lr.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===Jr.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===Vr.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new Jr(this._date.plus(e))}diff(e,n="milliseconds"){return this._date.diff(e._date,n)[n]}toISODate(){return this._date.toISODate()}toISOString(e){return this._date.toISO(e?{suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}:{includeOffset:!this.isUnknownTimeZone})}toISOTime(e,n){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:n&&!this.isUnknownTimeZone})}toFormat(e,n){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,n)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new Jr(this._date.toUTC())}toLocal(){return new Jr(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const n=Lr.fromISO(e,{setZone:!0});return new Jr(n)}}function Qr(e){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(t)||[])switch(r){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"X":case"x":n+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?n+=`'${r.slice(1,-1)}'`:n+=`'${r}'`}return n}class ei{constructor(e,n,t){this._year=e,this._month=n,this._day=t,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof ei&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new ei(this._year,this._month,this._day)}toDateTime(e){return Lr.fromObject({day:this.day,month:this.month,year:this.year},{zone:zr(e)})}toDateTimeLuxon(e){return Lr.fromObject({day:this.day,month:this.month,year:this.year},{zone:zr(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null){if(null===e||""===e)return this.toString();if(!(e=Qr(e)))return"";const n=this.toDateTime("unknown");return Jr.dateTimeToArcadeDate(n).toFormat(e,{locale:Wr(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return Jr.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(e,n){return ei.fromDateTime(this.toUTCDateTime().plus({[e]:n}))}toUTCDateTime(){return Lr.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,n){switch(n.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===n?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const n=Lr.fromMillis(e,{zone:Mr.utcInstance});return n.isValid?ei.fromParts(n.year,n.month,n.day):null}static fromSeconds(e){const n=Lr.fromSeconds(e,{zone:Mr.utcInstance});return n.isValid?ei.fromParts(n.year,n.month,n.day):null}static fromReader(e){if(!e)return null;const n=e.split("-");return 3!==n.length?null:new ei(Number.parseInt(n[0]),Number.parseInt(n[1]),Number.parseInt(n[2]))}static fromParts(e,n,t){const r=new ei(e,n,t);return r.isValid?r:null}static fromDateJS(e){return ei.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return ei.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,n=null){if(""===e)return null;if(null===e)return null;const t=[];if(n)(n=Qr(n))&&t.push(n);else if(null===n||""===n){const n=Lr.fromISO(e,{setZone:!0});return n.isValid?ei.fromParts(n.year,n.month,n.day):null}for(const r of t){const t=Lr.fromFormat(e,n??r);if(t.isValid)return new ei(t.year,t.month,t.day)}return null}static fromNow(e="system"){const n=Lr.fromJSDate(new Date).setZone(zr(e));return new ei(n.year,n.month,n.day)}}function ni(e){if(!e)return"";const n=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/gu;let t="";for(const r of e.match(n)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=r;break;case"A":case"a":t+="a";break;default:t+=`'${r}'`}return t}class ti{constructor(e,n,t,r){this._hour=e,this._minute=n,this._second=t,this._millisecond=r,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof ti&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new ti(this.hour,this.minute,this.second,this.millisecond)}isValid(){return Gr(this.hour)&&Gr(this.minute)&&Gr(this.second)&&Gr(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}`}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?`.${this.millisecond.toString().padStart(3,"0")}`:""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=ni(e))?Lr.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:Wr(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,n,t,r){const i=new ti(e,n,t,r);return i.isValid()?i:null}static fromReader(e){if(!e)return null;const n=e.split(":");return 3!==n.length?null:new ti(Number.parseInt(n[0]),Number.parseInt(n[1]),Number.parseInt(n[2]),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const n=Math.floor(e/1e3%60),t=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),i=Math.floor(e%1e3);return new ti(r,t,n,i)}static fromDateJS(e){return new ti(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new ti(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,n=null){if(""===e)return null;if(null===e)return null;const t=[];n?(n=ni(n))&&t.push(n):null!==n&&""!==n||(t.push("HH:mm:ss"),t.push("HH:mm:ss.SSS"),t.push("hh:mm:ss a"),t.push("hh:mm:ss.SSS a"),t.push("HH:mm"),t.push("hh:mm a"),t.push("H:mm"),t.push("h:mm a"),t.push("H:mm:ss"),t.push("h:mm:ss a"),t.push("H:mm:ss.SSS"),t.push("h:mm:ss.SSS a"));for(const n of t){const t=Lr.fromFormat(e,n);if(t.isValid)return new ti(t.hour,t.minute,t.second,t.millisecond)}return null}plus(e,n){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return ti.fromDateTime(this.toUTCDateTime().plus({[e]:n}))}return null}toUTCDateTime(){return Lr.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,n){switch(n.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===n?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}function ri(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}class ii{constructor(e){this._timeStampOffset=e,this._date=null}toDateTime(){return this._date??(this._date=Lr.fromISO(this._timeStampOffset,{setZone:!0})),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return ri(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return ri(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 ii.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new ii(Lr.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new ii(e.toISO({includeOffset:!0}))}static fromParts(e,n,t=0,r=0,i=0,u=0,s=0,o=!1,a=0,c=0){const l=`${e.toString().padStart(4,"0")}-${n.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let f="";u<10&&(f="0");let d=`${r.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}:${f+u.toString()}`;0!==s&&(d+="."+s.toString().padStart(3,"0"));const h=`${o?"-":"+"}${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new ii(l+"T"+d+h)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const n=this.toDateTime().plus(e);return ii.fromDateTime(n)}}class ui{}function si(e){return e instanceof Pr?e===ui.instance:"unknown"===e?.toString().toLowerCase()}function oi(e){return si(e)?ui.instance:e}function ai(e,n){return Lr.fromObject({day:e.day,year:e.year,month:e.month,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond},{zone:n})}ui.instance=new Dr("Etc/UTC");const ci=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,li=/^(\d{1,2}):(\d{1,2})$/,fi=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,di=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,hi=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,mi=/^(\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})$/,Ei=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,Ti=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function vi(e){return"number"==typeof e}function pi(e){return"string"==typeof e||e instanceof String}function Ni(e){return e instanceof Date}function yi(e){return e instanceof Lr}function Ri(e){return e instanceof ei}function Si(e){return e instanceof ti}function Ii(e){return e instanceof ii}function gi(e){return!!yi(e)||!!Ii(e)}function Ai(e){if(yi(e))return e.toMillis();if(Ri(e))return e.toNumber();if(Ii(e))return e.toMilliseconds();throw new xr(kr.InvalidDataType)}function Oi(e,n,t){switch(t){case"<>":return e!==n;case"=":return e===n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}}function wi(e){return Ri(e)||Si(e)?e.toString():Ii(e)?e.toSQLValue():yi(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):Ni(e)?wi(Lr.fromJSDate(e)):e?.toString()}function bi(e){return"string"==typeof e||e instanceof String}function Ci(e){return!(Ni(e)||Ri(e)||yi(e)||Si(e)||Ii(e))}const Li={extract:{minParams:2,maxParams:2,evaluate:([e,n])=>{if(null==n)return null;if(Ni(n))switch(e.toUpperCase()){case"SECOND":return n.getSeconds();case"MINUTE":return n.getMinutes();case"HOUR":return n.getHours();case"DAY":return n.getDate();case"MONTH":return n.getMonth()+1;case"YEAR":return n.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(yi(n))switch(e.toUpperCase()){case"SECOND":return n.second;case"MINUTE":return n.minute;case"HOUR":return n.hour;case"DAY":return n.day;case"MONTH":return n.month;case"YEAR":return n.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new xr(kr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(Ri(n))switch(e.toUpperCase()){case"DAY":return n.day;case"MONTH":return n.month;case"YEAR":return n.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new xr(kr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(Si(n))switch(e.toUpperCase()){case"SECOND":return n.second;case"MINUTE":return n.minute;case"HOUR":return n.hour}else if(Ii(n))switch(e.toUpperCase()){case"SECOND":return n.second;case"MINUTE":return n.minute;case"HOUR":return n.hour;case"DAY":return n.day;case"MONTH":return n.month;case"YEAR":return n.year;case"TIMEZONE_HOUR":return n.timezoneOffsetHour;case"TIMEZONE_MINUTE":return n.timezoneOffsetMinutes}throw new xr(kr.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(e.length===Li.substring.minParams){const[n,t]=e;return null==n||null==t?null:n.toString().substring(t-1)}if(e.length===Li.substring.maxParams){const[n,t,r]=e;return null==n||null==t||null==r?null:r<=0?"":n.toString().substring(t-1,t+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,n])=>null==e||null==n?null:n.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const n=e.length===Li.trim.maxParams,t=n?e[1]:" ",r=n?e[2]:e[1];if(null==t||null==r)return null;const i=`(${u=t,u.replaceAll(/(?:[.$?*|{}()[\]\\/+\-^])/gu,(e=>`\\${e}`))})`;var u;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${i}*|${i}*$`,"gu"),"");case"LEADING":return r.replaceAll(new RegExp(`^${i}*`,"gu"),"");case"TRAILING":return r.replaceAll(new RegExp(`${i}*$`,"gu"),"")}throw new xr(kr.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const n=e[0],t=2===e.length?10**e[1]:1;return null==n?null:Math.round(n*t)/t}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length?Number.parseInt(e[0].toFixed(0)):Number.parseFloat(e[0].toFixed(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>bi(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let n="";for(const t of e){if(null==t)return null;n+=t.toString()}return n}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const n of e)if(null!==n)return n;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:e=>function(e,n,t){if(null==e||null==n)return null;if(vi(e)){if(vi(n))return Oi(e,n,t);if(pi(n))return function(e,n,t){const r=Number.parseFloat(n);if(!Number.isNaN(r))return Oi(e,r,t);const i=e.toString();switch(t){case"<>":return i!==n;case"=":return i===n;case">":return i>n;case"<":return i<n;case">=":return i>=n;case"<=":return i<=n}}(e,n,t);if(yi(r=n)||Ri(r)||Ii(r)||Si(r))throw new xr(kr.InvalidOperator);if(Ri(n))throw new xr(kr.InvalidOperator)}else if(pi(e)){if(vi(n))return function(e,n,t){const r=Number.parseFloat(e);if(!Number.isNaN(r))return Oi(r,n,t);const i=n.toString();switch(t){case"<>":return e!==i;case"=":return e===i;case">":return e>i;case"<":return e<i;case">=":return e>=i;case"<=":return e<=i}}(e,n,t);if(pi(n))return function(e,n,t){switch(t){case"<>":return e!==n;case"=":return e===n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}}(e,n,t);if(yi(n))throw new xr(kr.InvalidOperator);if(Ri(n))throw new xr(kr.InvalidOperator);if(Si(n))throw new xr(kr.InvalidOperator);if(Ii(n))throw new xr(kr.InvalidOperator)}else if(yi(e)){if(gi(n))return e instanceof Lr&&si(e.zone)?n instanceof Lr&&!si(n.zone)?e=ai(e,n.zone):n instanceof ii&&(e=ai(e,n.toDateTime().zone)):n instanceof Lr&&si(n.zone)&&(e instanceof Lr&&!si(e.zone)?n=ai(n,e.zone):e instanceof ii&&(n=ai(n,e.toDateTime().zone))),Oi(Ai(e),Ai(n),t);if(pi(n))throw new xr(kr.InvalidOperator);if(Ri(n))return function(e,n,t){const r=n.toDateTimeLuxon(e.zone);return Oi((e=e.startOf("day")).toMillis(),r.toMillis(),t)}(e,n,t);if(Si(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator)}else if(Ri(e)){if(Ii(n))return function(e,n,t){const r=e.toDateTimeLuxon(n.toDateTime().zone);return n=n.startOfDay(),Oi(r.toMillis(),n.toMilliseconds(),t)}(e,n,t);if(yi(n))return function(e,n,t){const r=e.toDateTimeLuxon(n.zone);return n=n.startOf("day"),Oi(r.toMillis(),n.toMillis(),t)}(e,n,t);if(pi(n))throw new xr(kr.InvalidOperator);if(Ri(n))return Oi(e.toNumber(),n.toNumber(),t);if(Si(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator)}else if(Si(e)){if(Si(n))return Oi(e.toNumber(),n.toNumber(),t);if(pi(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator);if(Ri(n))throw new xr(kr.InvalidOperator);if(gi(n))throw new xr(kr.InvalidOperator)}else if(Ii(e)){if(gi(n))return n instanceof Lr&&si(n.zone)&&(n=ai(n,e.toDateTime().zone)),Oi(Ai(e),Ai(n),t);if(pi(n))throw new xr(kr.InvalidOperator);if(Ri(n))return function(e,n,t){const r=n.toDateTimeLuxon(e.toDateTime().zone);return Oi((e=e.startOfDay()).toMilliseconds(),r.toMillis(),t)}(e,n,t);if(Si(n))throw new xr(kr.InvalidOperator);if(vi(n))throw new xr(kr.InvalidOperator)}var r;switch(t){case"<>":return e!==n;case"=":return e===n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n}}(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,n)=>{const t=e[0],r=e[1];if(null===t)return null;switch(r.type){case"integer":{if(!Ci(t))throw new xr(kr.CannotCastValue);const e=Number.parseInt(t);if(isNaN(e))throw new xr(kr.CannotCastValue);return e}case"smallint":{const e=32767,n=-32767;if(!Ci(t))throw new xr(kr.CannotCastValue);const r=Number.parseInt(t);if(isNaN(r))throw new xr(kr.CannotCastValue);if(r>e||r<n)throw new xr(kr.CannotCastValue);return r}case"float":case"real":{if(!Ci(t))throw new xr(kr.CannotCastValue);const e=parseFloat(t);if(isNaN(e))throw new xr(kr.CannotCastValue);return e}case"time":return function(e){if(Ni(e))return ti.fromDateJS(e);if(yi(e))return ti.fromDateTime(e);if(Ri(e))throw new xr(kr.CannotCastValue);if(Si(e))return e;if(Ii(e))return ti.fromSqlTimeStampOffset(e);if(bi(e))return function(e){let n=ci.exec(e);if(null!==n){const[,e,t,r]=n,i=ti.fromParts(Number.parseInt(e),Number.parseInt(t),Number.parseInt(r),0);if(null!==i)return i;throw new xr(kr.InvalidTime)}if(n=li.exec(e),null!==n){const[,e,t]=n,r=ti.fromParts(Number.parseInt(e),Number.parseInt(t),0,0);if(null!==r)return r;throw new xr(kr.InvalidTime)}if(n=fi.exec(e),null!==n){const[,e,t,r,i]=n,u=ti.fromParts(Number.parseInt(e),Number.parseInt(t),Number.parseInt(r),Number.parseInt(i));if(null!==u)return u;throw new xr(kr.InvalidTime)}throw new xr(kr.InvalidTime)}(e);throw new xr(kr.CannotCastValue)}(t);case"date":return function(e){if(Ni(e))return ei.fromDateJS(e);if(yi(e))return ei.fromParts(e.year,e.month,e.day);if(Ri(e))return e;if(Si(e))throw new xr(kr.CannotCastValue);if(Ii(e)&&null===ei.fromParts(e.year,e.month,e.day))throw new xr(kr.CannotCastValue);if(bi(e)){const n=ei.fromReader(e);if(null!==n&&n.isValid)return n}throw new xr(kr.CannotCastValue)}(t);case"timestamp":return function(e,n){if(Ni(e))return function(e,n){switch(n){case"system":case"local":case null:return Lr.fromJSDate(e);default:return"unknown"===n?.toLowerCase()?Lr.fromMillis(e.getTime(),{zone:ui.instance}):Lr.fromJSDate(e).setZone(n)}}(e,n);if(yi(e))return e;if(Ri(e))return e.toDateTimeLuxon("unknown");if(Si(e))throw new xr(kr.CannotCastValue);if(Ii(e))return e;if(bi(e))return function(e,n){let t=hi.exec(e);if(null!==t){const[,e,r,i,u,s,o,a]=t,c=Lr.fromObject({year:Number.parseInt(e),month:Number.parseInt(r),day:Number.parseInt(i),hour:Number.parseInt(u),minute:Number.parseInt(s),second:Number.parseInt(o),millisecond:a?Number.parseInt(a.replace(".","")):0},{zone:oi(n)});if(!c.isValid)throw new xr(kr.InvalidTimeStamp);return c}if(t=mi.exec(e),null!==t){const[,e,n,r,i,u,s,o,a,c,l]=t,f=ii.fromParts(Number.parseInt(e),Number.parseInt(n),Number.parseInt(r),Number.parseInt(i),Number.parseInt(u),Number.parseInt(s),o?Number.parseInt(o.replace(".","")):0,"-"===a,Number.parseInt(c),Number.parseInt(l));if(!f.isValid)throw new xr(kr.InvalidTimeStamp);return f}if(t=Ei.exec(e),null!==t){const[,e,n,r,i,u,s,o,a]=t,c=ii.fromParts(Number.parseInt(e),Number.parseInt(n),Number.parseInt(r),Number.parseInt(i),Number.parseInt(u),0,0,"-"===s,Number.parseInt(o),Number.parseInt(a));if(!c.isValid)throw new xr(kr.InvalidTimeStamp);return c}if(t=Ti.exec(e),null!==t){const[,e,r,i,u,s]=t,o=Lr.fromObject({year:Number.parseInt(e),month:Number.parseInt(r),day:Number.parseInt(i),hour:Number.parseInt(u),minute:Number.parseInt(s),second:0},{zone:oi(n)});if(!o.isValid)throw new xr(kr.InvalidTimeStamp);return o}if(t=di.exec(e),null!==t){const[,e,r,i]=t,u=Lr.fromObject({year:Number.parseInt(e),month:Number.parseInt(r),day:Number.parseInt(i),hour:0,minute:0,second:0},{zone:oi(n)});if(!u.isValid)throw new xr(kr.InvalidTimeStamp);return u}throw new xr(kr.InvalidTimeStamp)}(e,"unknown");throw new xr(kr.CannotCastValue)}(t,n);case"varchar":{const e=wi(t);if(e.length>r.size)throw new xr(kr.CannotCastValue);return e}default:throw new xr(kr.InvalidDataType)}}}},Mi=function(){function e(n,t,r,i){var u=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(u,e.prototype),u.expected=t,u.found=r,u.location=i,u.name="SyntaxError",u}function n(e,n,t){return t=t||" ",e.length>n?e:e+(t+=t.repeat(n-=e.length)).slice(0,n)}return function(e,n){function t(){this.constructor=e}t.prototype=n.prototype,e.prototype=new t}(e,Error),e.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var u=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(u):u,o=this.location.source+":"+s.line+":"+s.column;if(i){var a=this.location.end,c=n("",s.line.toString().length," "),l=i[u.line-1],f=(u.line===a.line?a.column:l.length+1)-u.column||1;t+="\n --\x3e "+o+"\n"+c+" |\n"+s.line+" | "+l+"\n"+c+" | "+n("",u.column-1," ")+n("",f,"^")}else t+="\n at "+o}return t},e.buildMessage=function(e,n){var t={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var n=e.parts.map((function(e){return Array.isArray(e)?u(e[0])+"-"+u(e[1]):u(e)}));return"["+(e.inverted?"^":"")+n.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function u(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function s(e){return t[e.type](e)}return"Expected "+function(e){var n,t,r=e.map(s);if(r.sort(),r.length>0){for(n=1,t=1;n<r.length;n++)r[n-1]!==r[n]&&(r[t]=r[n],t++);r.length=t}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(n)+" found."},{SyntaxError:e,parse:function(n,t){var r,i={},u=(t=void 0!==t?t:{}).grammarSource,s={start:Wi},o=Wi,a="!",c="=",l=">=",f=">",d="<=",h="<>",m="<",E="!=",T="+",v="-",p="||",N="*",y="/",R="@",S="'",I="N'",g="''",A=".",O="null",w="true",b="false",C="in",L="is",M="like",D="escape",k="not",P="and",U="or",x="between",_="from",F="for",H="substring",Y="extract",G="trim",$="position",B="timestamp",W="date",V="time",Z="leading",q="trailing",X="both",z="cast",K="as",j="integer",J="smallint",Q="float",ee="real",ne="varchar",te="to",re="interval",ie="year",ue="timezone_hour",se="timezone_minute",oe="month",ae="day",ce="hour",le="minute",fe="second",de="case",he="end",me="when",Ee="then",Te="else",ve=",",pe="(",Ne=")",ye="`",Re=/^[A-Za-z_\x80-\uFFFF]/,Se=/^[A-Za-z0-9_]/,Ie=/^[A-Za-z0-9_.\x80-\uFFFF]/,ge=/^["]/,Ae=/^[^']/,Oe=/^[0-9]/,we=/^[eE]/,be=/^[+\-]/,Ce=/^[ \t\n\r]/,Le=/^[^`]/,Me=Hi("!",!1),De=Hi("=",!1),ke=Hi(">=",!1),Pe=Hi(">",!1),Ue=Hi("<=",!1),xe=Hi("<>",!1),_e=Hi("<",!1),Fe=Hi("!=",!1),He=Hi("+",!1),Ye=Hi("-",!1),Ge=Hi("||",!1),$e=Hi("*",!1),Be=Hi("/",!1),We=Yi([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Ve=Yi([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Ze=Yi([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),qe=Yi(['"'],!1,!1),Xe=Hi("@",!1),ze=Hi("'",!1),Ke=Hi("N'",!1),je=Hi("''",!1),Je=Yi(["'"],!0,!1),Qe=Hi(".",!1),en=Yi([["0","9"]],!1,!1),nn=Yi(["e","E"],!1,!1),tn=Yi(["+","-"],!1,!1),rn=Hi("NULL",!0),un=Hi("TRUE",!0),sn=Hi("FALSE",!0),on=Hi("IN",!0),an=Hi("IS",!0),cn=Hi("LIKE",!0),ln=Hi("ESCAPE",!0),fn=Hi("NOT",!0),dn=Hi("AND",!0),hn=Hi("OR",!0),mn=Hi("BETWEEN",!0),En=Hi("FROM",!0),Tn=Hi("FOR",!0),vn=Hi("SUBSTRING",!0),pn=Hi("EXTRACT",!0),Nn=Hi("TRIM",!0),yn=Hi("POSITION",!0),Rn=Hi("TIMESTAMP",!0),Sn=Hi("DATE",!0),In=Hi("TIME",!0),gn=Hi("LEADING",!0),An=Hi("TRAILING",!0),On=Hi("BOTH",!0),wn=Hi("CAST",!0),bn=Hi("AS",!0),Cn=Hi("INTEGER",!0),Ln=Hi("SMALLINT",!0),Mn=Hi("FLOAT",!0),Dn=Hi("REAL",!0),kn=Hi("VARCHAR",!0),Pn=Hi("TO",!0),Un=Hi("INTERVAL",!0),xn=Hi("YEAR",!0),_n=Hi("TIMEZONE_HOUR",!0),Fn=Hi("TIMEZONE_MINUTE",!0),Hn=Hi("MONTH",!0),Yn=Hi("DAY",!0),Gn=Hi("HOUR",!0),$n=Hi("MINUTE",!0),Bn=Hi("SECOND",!0),Wn=Hi("CASE",!0),Vn=Hi("END",!0),Zn=Hi("WHEN",!0),qn=Hi("THEN",!0),Xn=Hi("ELSE",!0),zn=Hi(",",!1),Kn=Hi("(",!1),jn=Hi(")",!1),Jn=Yi([" ","\t","\n","\r"],!1,!1),Qn=Hi("`",!1),et=Yi(["`"],!0,!1),nt=function(e){return e},tt=function(e,n){var t={type:"expression-list"},r=function(e,n){var t=function(e,n){for(var t=[e],r=0;r<n.length;r++)t.push(n[r][3]);return t}(e,n);return t}(e,n);return t.value=r,t.range=_i(),t},rt=function(e,n){return es(e,n)},it=function(e,n){return es(e,n)},ut=function(e){return{type:"unary-expression",operator:"NOT",expr:e,range:_i()}},st=function(e,n){return""==n||null==n||null==n?e:"arithmetic"==n.type?es(e,n.tail):Qu(n.op,e,n.right,n.escape)},ot=function(e){return{type:"arithmetic",tail:e}},at=function(e,n){return{op:e+"NOT",right:n}},ct=function(e,n){return{op:e,right:n}},lt=function(e,n,t){return{op:"NOT"+e,right:{type:"expression-list",value:[n,t],range:_i()}}},ft=function(e,n,t){return{op:e,right:{type:"expression-list",value:[n,t],range:_i()}}},dt=function(e){return e[0]+" "+e[2]},ht=function(e){return e[0]+" "+e[2]},mt=function(e,n,t){return{op:e,right:n,escape:t.value}},Et=function(e,n){return{op:e,right:n,escape:""}},Tt=function(e,n){return{op:e,right:n}},vt=function(e){return{op:e,right:{type:"expression-list",value:[],range:_i()}}},pt=function(e,n){return{op:e,right:n}},Nt=function(e,n){return es(e,n)},yt=function(e,n){return es(e,n)},Rt=function(e){return e.paren=!0,e},St=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",mode:"date",range:_i()}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",mode:"timestamp",range:_i()}:{type:"column-reference",table:"",column:e,range:_i()}},It=function(e){return{type:"column-reference",table:"",column:e,delimited:!0,range:_i()}},gt=function(e){return e},At=function(e,n){return e+n.join("")},Ot=function(e,n){return e+n.join("")},wt=function(e){return e},bt=function(e){return e.join("")},Ct=function(){return'"'},Lt=function(e){return{type:"parameter",value:e[1],range:_i()}},Mt=function(e,n){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:e,range:_i()},n],range:_i()},range:_i()}},Dt=function(e,n,t){return{type:"function",name:"substring",args:{type:"expression-list",value:t?[e,n,t[2]]:[e,n],range:_i()},range:_i()}},kt=function(e,n){return{type:"function",name:"cast",args:{type:"expression-list",value:[e,n],range:_i()},range:_i()}},Pt=function(){return{type:"data-type",value:{type:"integer"},range:_i()}},Ut=function(){return{type:"data-type",value:{type:"smallint"},range:_i()}},xt=function(){return{type:"data-type",value:{type:"float"},range:_i()}},_t=function(){return{type:"data-type",value:{type:"real"},range:_i()}},Ft=function(){return{type:"data-type",value:{type:"date"},range:_i()}},Ht=function(){return{type:"data-type",value:{type:"timestamp"},range:_i()}},Yt=function(){return{type:"data-type",value:{type:"time"},range:_i()}},Gt=function(e){return{type:"data-type",value:{type:"varchar",size:parseInt(e)},range:_i()}},$t=function(e,n,t){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:null==e?"BOTH":e,range:_i()},n,t],range:_i()},range:_i()}},Bt=function(e,n){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:null==e?"BOTH":e,range:_i()},n],range:_i()},range:_i()}},Wt=function(e,n){return{type:"function",name:"position",args:{type:"expression-list",value:[e,n],range:_i()},range:_i()}},Vt=function(e,n){return{type:"function",name:e,args:n||{type:"expression-list",value:[],range:_i()},range:_i()}},Zt=function(e){return"string"===e.type&&!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e.value)&&Fi("Timestamp literal is invalid"),{type:"timestamp",value:e.value,range:_i()}},qt=function(e){return"string"===e.type&&!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e.value)&&Fi("Time literal is invalid"),{type:"time",value:e.value,range:_i()}},Xt=function(e,n,t){return{type:"interval",value:n,qualifier:t,op:e,range:_i()}},zt=function(e,n){return{type:"interval",value:e,qualifier:n,op:"",range:_i()}},Kt=function(e,n){return{type:"interval-qualifier",start:e,end:n,range:_i()}},jt=function(e,n){return{type:"interval-period",period:e.value,precision:n,secondary:null,range:_i()}},Jt=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null,range:_i()}},Qt=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null,range:_i()}},er=function(e,n){return{type:"interval-period",period:"second",precision:e,secondary:n,range:_i()}},nr=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null,range:_i()}},tr=function(){return{type:"interval-period",period:"second",precision:null,secondary:null,range:_i()}},rr=function(e,n){return{type:"interval-period",period:e.value,precision:n,secondary:null,range:_i()}},ir=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null,range:_i()}},ur=function(e,n){return{type:"interval-period",period:"second",precision:e,secondary:n,range:_i()}},sr=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null,range:_i()}},or=function(){return{type:"interval-period",period:"second",precision:null,secondary:null,range:_i()}},ar=function(){return{type:"string",value:"day",range:_i()}},cr=function(){return{type:"string",value:"hour",range:_i()}},lr=function(){return{type:"string",value:"minute",range:_i()}},fr=function(){return{type:"string",value:"month",range:_i()}},dr=function(){return{type:"string",value:"year",range:_i()}},hr=function(e){return parseFloat(e)},mr=function(e){return parseFloat(e)},Er=function(e){return"string"===e.type&&!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e.value)&&Fi("Date literal is invalid"),{type:"date",value:e.value,range:_i()}},Tr=function(){return{type:"null",value:null,range:_i()}},vr=function(){return{type:"boolean",value:!0,range:_i()}},pr=function(){return{type:"boolean",value:!1,range:_i()}},Nr=function(){return"'"},yr=function(e){return{type:"string",value:e.join(""),range:_i()}},Rr=function(e,n){return{type:"case-expression",format:"simple",operand:e,clauses:n,else:null,range:_i()}},Sr=function(e,n,t){return{type:"case-expression",format:"simple",operand:e,clauses:n,else:t.value,range:_i(),elseRange:t.range}},Ir=function(e){return{type:"case-expression",format:"searched",clauses:e,else:null,range:_i()}},gr=function(e,n){return{type:"case-expression",format:"searched",clauses:e,else:n.value,range:_i(),elseRange:n.range}},Ar=function(e,n){return{type:"when-clause",operand:e,value:n,range:_i()}},Or=function(){Fi("Expected 'THEN', but found '"+xi()+"'")},wr=function(e,n){return{type:"when-clause",operand:e,value:n,range:_i()}},br=function(){Fi("Expected 'THEN', but found '"+xi()+"'")},Cr=function(e){return{type:"else-clause",value:e,range:_i()}},Lr=function(e){return{type:"number",value:e,range:_i()}},Mr=function(e,n,t){return parseFloat(e+n+t)},Dr=function(e,n){return parseFloat(e+n)},kr=function(e,n){return parseFloat(e+n)},Pr=function(e){return parseFloat(e)},Ur=function(e,n){return e[0]+n},xr=function(e){return"."+(null!=e?e:"")},_r=function(e,n){return e+n},Fr=function(e){return e.join("")},Hr=function(e,n){return"e"+(null===n?"":n)},Yr=function(){return"IN"},Gr=function(){return"IS"},$r=function(){return"LIKE"},Br=function(){return"ESCAPE"},Wr=function(){return"NOT"},Vr=function(){return"AND"},Zr=function(){return"OR"},qr=function(){return"BETWEEN"},Xr=function(){return"FROM"},zr=function(){return"FOR"},Kr=function(){return"SUBSTRING"},jr=function(){return"EXTRACT"},Jr=function(){return"TRIM"},Qr=function(){return"POSITION"},ei=function(){return"TIMESTAMP"},ni=function(){return"DATE"},ti=function(){return"TIME"},ri=function(){return"LEADING"},ii=function(){return"TRAILING"},ui=function(){return"BOTH"},si=function(){return"CAST"},oi=function(){return"AS"},ai=function(){return"INTEGER"},ci=function(){return"SMALLINT"},li=function(){return"FLOAT"},fi=function(){return"REAL"},di=function(){return"VARCHAR"},hi=function(){return"TO"},mi=function(){return"INTERVAL"},Ei=function(){return"YEAR"},Ti=function(){return"TIMEZONE_HOUR"},vi=function(){return"TIMEZONE_MINUTE"},pi=function(){return"MONTH"},Ni=function(){return"DAY"},yi=function(){return"HOUR"},Ri=function(){return"MINUTE"},Si=function(){return"SECOND"},Ii=function(){return"CASE"},gi=function(){return"END"},Ai=function(){return"WHEN"},Oi=function(){return"THEN"},wi=function(){return"ELSE"},bi=function(e){return e},Ci=function(e){return e.join("")},Li=0,Mi=0,Di=[{line:1,column:1}],ki=0,Pi=[],Ui=0;if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function xi(){return n.substring(Mi,Li)}function _i(){return $i(Mi,Li)}function Fi(n,t){throw function(n,t){return new e(n,null,null,t)}(n,t=void 0!==t?t:$i(Mi,Li))}function Hi(e,n){return{type:"literal",text:e,ignoreCase:n}}function Yi(e,n,t){return{type:"class",parts:e,inverted:n,ignoreCase:t}}function Gi(e){var t,r=Di[e];if(r)return r;for(t=e-1;!Di[t];)t--;for(r={line:(r=Di[t]).line,column:r.column};t<e;)10===n.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return Di[e]=r,r}function $i(e,n,t){var r=Gi(e),i=Gi(n),s={source:u,start:{offset:e,line:r.line,column:r.column},end:{offset:n,line:i.line,column:i.column}};return t&&u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}function Bi(e){Li<ki||(Li>ki&&(ki=Li,Pi=[]),Pi.push(e))}function Wi(){var e,n;return e=Li,ju(),(n=Zi())!==i?(ju(),Mi=e,e=nt(n)):(Li=e,e=i),e}function Vi(){var e,n,t,r,u,s,o,a;if(e=Li,(n=Zi())!==i){for(t=[],r=Li,u=ju(),(s=Xu())!==i?(o=ju(),(a=Zi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Xu())!==i?(o=ju(),(a=Zi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=tt(n,t)}else Li=e,e=i;return e}function Zi(){var e,n,t,r,u,s,o,a;if(e=Li,(n=qi())!==i){for(t=[],r=Li,u=ju(),(s=Lu())!==i?(o=ju(),(a=qi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Lu())!==i?(o=ju(),(a=qi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=rt(n,t)}else Li=e,e=i;return e}function qi(){var e,n,t,r,u,s,o,a;if(e=Li,(n=Xi())!==i){for(t=[],r=Li,u=ju(),(s=Cu())!==i?(o=ju(),(a=Xi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Cu())!==i?(o=ju(),(a=Xi())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=it(n,t)}else Li=e,e=i;return e}function Xi(){var e,t,r,u,s;return e=Li,(t=bu())===i&&(t=Li,33===n.charCodeAt(Li)?(r=a,Li++):(r=i,0===Ui&&Bi(Me)),r!==i?(u=Li,Ui++,61===n.charCodeAt(Li)?(s=c,Li++):(s=i,0===Ui&&Bi(De)),Ui--,s===i?u=void 0:(Li=u,u=i),u!==i?t=r=[r,u]:(Li=t,t=i)):(Li=t,t=i)),t!==i?(r=ju(),(u=Xi())!==i?(Mi=e,e=ut(u)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=function(){var e,t,r;return e=Li,(t=Ji())!==i?(ju(),r=function(){var e;return e=function(){var e,n,t,r,u,s,o;if(e=Li,n=[],t=Li,r=ju(),(u=zi())!==i?(s=ju(),(o=Ji())!==i?t=r=[r,u,s,o]:(Li=t,t=i)):(Li=t,t=i),t!==i)for(;t!==i;)n.push(t),t=Li,r=ju(),(u=zi())!==i?(s=ju(),(o=Ji())!==i?t=r=[r,u,s,o]:(Li=t,t=i)):(Li=t,t=i);else n=i;return n!==i&&(Mi=e,n=ot(n)),e=n}(),e===i&&(e=function(){var e,n,t,r;return e=Li,(n=ji())!==i?(ju(),(t=zu())!==i?(ju(),(r=Vi())!==i?(ju(),Ku()!==i?(Mi=e,e=Tt(n,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=ji())!==i?(ju(),(t=zu())!==i?(ju(),(r=Ku())!==i?(Mi=e,e=vt(n)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=ji())!==i?(ju(),(t=cu())!==i?(Mi=e,e=pt(n,t)):(Li=e,e=i)):(Li=e,e=i))),e}(),e===i&&(e=function(){var e,n,t,r,u,s;return e=Li,(n=bu())!==i?(ju(),(t=Mu())!==i?(ju(),(r=Ji())!==i?(ju(),(u=Cu())!==i?(ju(),(s=Ji())!==i?(Mi=e,e=lt(t,r,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Mu())!==i?(ju(),(t=Ji())!==i?(ju(),(r=Cu())!==i?(ju(),(u=Ji())!==i?(Mi=e,e=ft(n,t,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}(),e===i&&(e=function(){var e,n,t,r;return e=Li,(n=Ou())!==i?(ju(),(t=bu())!==i?(ju(),(r=Ji())!==i?(Mi=e,e=at(n,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Ou())!==i?(ju(),(t=Ji())!==i?(Mi=e,e=ct(n,t)):(Li=e,e=i)):(Li=e,e=i)),e}(),e===i&&(e=function(){var e,t,r,u,s;return e=Li,(t=Ki())!==i?(ju(),(r=Eu())!==i?(ju(),u=function(){var e,t,r,u;return e=Li,n.substr(Li,6).toLowerCase()===D?(t=n.substr(Li,6),Li+=6):(t=i,0===Ui&&Bi(ln)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Br()):(Li=e,e=i)):(Li=e,e=i),e}(),u!==i?(ju(),(s=Tu())!==i?(Mi=e,e=mt(t,r,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(t=Ki())!==i?(ju(),(r=Eu())!==i?(Mi=e,e=Et(t,r)):(Li=e,e=i)):(Li=e,e=i)),e}())))),e}(),r===i&&(r=null),Mi=e,e=st(t,r)):(Li=e,e=i),e}()),e}function zi(){var e;return n.substr(Li,2)===l?(e=l,Li+=2):(e=i,0===Ui&&Bi(ke)),e===i&&(62===n.charCodeAt(Li)?(e=f,Li++):(e=i,0===Ui&&Bi(Pe)),e===i&&(n.substr(Li,2)===d?(e=d,Li+=2):(e=i,0===Ui&&Bi(Ue)),e===i&&(n.substr(Li,2)===h?(e=h,Li+=2):(e=i,0===Ui&&Bi(xe)),e===i&&(60===n.charCodeAt(Li)?(e=m,Li++):(e=i,0===Ui&&Bi(_e)),e===i&&(61===n.charCodeAt(Li)?(e=c,Li++):(e=i,0===Ui&&Bi(De)),e===i&&(n.substr(Li,2)===E?(e=E,Li+=2):(e=i,0===Ui&&Bi(Fe)))))))),e}function Ki(){var e,n,t,r,u;return e=Li,n=Li,(t=bu())!==i?(r=ju(),(u=wu())!==i?n=t=[t,r,u]:(Li=n,n=i)):(Li=n,n=i),n!==i&&(Mi=e,n=dt(n)),(e=n)===i&&(e=wu()),e}function ji(){var e,n,t,r,u;return e=Li,n=Li,(t=bu())!==i?(r=ju(),(u=Au())!==i?n=t=[t,r,u]:(Li=n,n=i)):(Li=n,n=i),n!==i&&(Mi=e,n=ht(n)),(e=n)===i&&(e=Au()),e}function Ji(){var e,n,t,r,u,s,o,a;if(e=Li,(n=eu())!==i){for(t=[],r=Li,u=ju(),(s=Qi())!==i?(o=ju(),(a=eu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=Qi())!==i?(o=ju(),(a=eu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=Nt(n,t)}else Li=e,e=i;return e}function Qi(){var e;return 43===n.charCodeAt(Li)?(e=T,Li++):(e=i,0===Ui&&Bi(He)),e===i&&(45===n.charCodeAt(Li)?(e=v,Li++):(e=i,0===Ui&&Bi(Ye)),e===i&&(n.substr(Li,2)===p?(e=p,Li+=2):(e=i,0===Ui&&Bi(Ge)))),e}function eu(){var e,n,t,r,u,s,o,a;if(e=Li,(n=tu())!==i){for(t=[],r=Li,u=ju(),(s=nu())!==i?(o=ju(),(a=tu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);r!==i;)t.push(r),r=Li,u=ju(),(s=nu())!==i?(o=ju(),(a=tu())!==i?r=u=[u,s,o,a]:(Li=r,r=i)):(Li=r,r=i);Mi=e,e=yt(n,t)}else Li=e,e=i;return e}function nu(){var e;return 42===n.charCodeAt(Li)?(e=N,Li++):(e=i,0===Ui&&Bi($e)),e===i&&(47===n.charCodeAt(Li)?(e=y,Li++):(e=i,0===Ui&&Bi(Be))),e}function tu(){var e,t;return e=function(){var e;return(e=Tu())===i&&(e=function(){var e,n,t,r;return e=Li,n=function(){var e,n,t,r;return e=Li,(n=yu())!==i&&(t=Ru())!==i&&(r=Su())!==i?(Mi=e,e=Mr(n,t,r)):(Li=e,e=i),e===i&&(e=Li,(n=yu())!==i&&(t=Ru())!==i?(Mi=e,e=Dr(n,t)):(Li=e,e=i),e===i&&(e=Li,(n=yu())!==i&&(t=Su())!==i?(Mi=e,e=kr(n,t)):(Li=e,e=i),e===i&&(e=Li,(n=yu())!==i&&(Mi=e,n=Pr(n)),e=n))),e}(),n!==i?(t=Li,Ui++,r=iu(),Ui--,r===i?t=void 0:(Li=t,t=i),t!==i?(Mi=e,e=Lr(n)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===w?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(un)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?e=t=[t,r]:(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=vr()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,5).toLowerCase()===b?(t=n.substr(Li,5),Li+=5):(t=i,0===Ui&&Bi(sn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?e=t=[t,r]:(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=pr()),e=t),e}(),e===i&&(e=function(){var e,t;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===O?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(rn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?e=t=[t,r]:(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=Tr()),e=t}(),e===i&&(e=function(){var e,n;return e=Li,Uu()!==i?(ju(),(n=Eu())!==i?(Mi=e,e=Er(n)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,n;return e=Li,Pu()!==i?(ju(),(n=Eu())!==i?(Mi=e,e=Zt(n)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u;return e=Li,_u()!==i?(ju(),45===n.charCodeAt(Li)?(t=v,Li++):(t=i,0===Ui&&Bi(Ye)),t===i&&(43===n.charCodeAt(Li)?(t=T,Li++):(t=i,0===Ui&&Bi(He))),t!==i?(ju(),(r=Eu())!==i?(ju(),(u=fu())!==i?(Mi=e,e=Xt(t,r,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,_u()!==i?(ju(),(t=Eu())!==i?(ju(),(r=fu())!==i?(Mi=e,e=zt(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}(),e===i&&(e=function(){var e,n;return e=Li,xu()!==i?(ju(),(n=Eu())!==i?(Mi=e,e=qt(n)):(Li=e,e=i)):(Li=e,e=i),e}()))))))),e}(),e===i&&(e=function(){var e,t,r,u;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===Y?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(pn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=jr()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),r=function(){var e;return(e=Fu())===i&&(e=Hu())===i&&(e=Yu())===i&&(e=Gu())===i&&(e=$u())===i&&(e=Bu())===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,13).toLowerCase()===ue?(t=n.substr(Li,13),Li+=13):(t=i,0===Ui&&Bi(_n)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ti()):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,15).toLowerCase()===se?(t=n.substr(Li,15),Li+=15):(t=i,0===Ui&&Bi(Fn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=vi()):(Li=e,e=i)):(Li=e,e=i),e}())),e}(),r!==i?(ju(),Du()!==i?(ju(),(u=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Mt(r,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u,s,o,a,c;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,9).toLowerCase()===H?(t=n.substr(Li,9),Li+=9):(t=i,0===Ui&&Bi(vn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Kr()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Zi())!==i?(ju(),Du()!==i?(ju(),(u=Zi())!==i?(ju(),s=Li,o=function(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===F?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(Tn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=zr()):(Li=e,e=i)):(Li=e,e=i),e}(),o!==i?(a=ju(),(c=Zi())!==i?s=o=[o,a,c,ju()]:(Li=s,s=i)):(Li=s,s=i),s===i&&(s=null),(o=Ku())!==i?(Mi=e,e=Dt(r,u,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&((e=function(){var e,n,t,r;return e=Li,ku()!==i?(ju(),zu()!==i?(ju(),(n=lu())===i&&(n=null),ju(),(t=Zi())!==i?(ju(),Du()!==i?(ju(),(r=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=$t(n,t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,ku()!==i?(ju(),zu()!==i?(ju(),(n=lu())===i&&(n=null),ju(),(t=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Bt(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}())===i&&(e=function(){var e,t,r,u;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===$?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(yn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Qr()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Zi())!==i?(ju(),Au()!==i?(ju(),(u=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Wt(r,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r,u,s;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===z?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(wn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=si()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Zi())!==i?(ju(),u=function(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===K?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(bn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=oi()):(Li=e,e=i)):(Li=e,e=i),e}(),u!==i?(ju(),s=function(){var e,t,r;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===j?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(Cn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ai()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=Pt()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===J?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(Ln)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ci()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=Ut()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,5).toLowerCase()===Q?(t=n.substr(Li,5),Li+=5):(t=i,0===Ui&&Bi(Mn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=li()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=xt()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===ee?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Dn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=fi()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i&&(Mi=e,t=_t()),(e=t)===i&&(e=Li,(t=Uu())!==i&&(Mi=e,t=Ft()),(e=t)===i&&(e=Li,(t=Pu())!==i&&(Mi=e,t=Ht()),(e=t)===i&&(e=Li,(t=xu())!==i&&(Mi=e,t=Yt()),(e=t)===i&&(e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===ne?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(kn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=di()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Iu())!==i?(ju(),Ku()!==i?(Mi=e,e=Gt(r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)))))))),e}(),s!==i?(ju(),Ku()!==i?(Mi=e,e=kt(r,s)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e,t,r;return e=Li,t=function(){var e,t,r,u;if(e=Li,(t=ru())!==i&&(Mi=e,t=bi(t)),(e=t)===i)if(e=Li,96===n.charCodeAt(Li)?(t=ye,Li++):(t=i,0===Ui&&Bi(Qn)),t!==i){if(r=[],Le.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(et)),u!==i)for(;u!==i;)r.push(u),Le.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(et));else r=i;r!==i?(96===n.charCodeAt(Li)?(u=ye,Li++):(u=i,0===Ui&&Bi(Qn)),u!==i?(Mi=e,e=Ci(r)):(Li=e,e=i)):(Li=e,e=i)}else Li=e,e=i;return e}(),t!==i?(ju(),zu()!==i?(ju(),(r=Vi())===i&&(r=null),ju(),Ku()!==i?(Mi=e,e=Vt(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e}(),e===i&&(e=function(){var e;return e=function(){var e,n,t,r,u;if(e=Li,Wu()!==i)if(ju(),(n=Zi())!==i){for(ju(),t=[],r=pu();r!==i;)t.push(r),r=pu();r=ju(),(u=Vu())!==i?(Mi=e,e=Rr(n,t)):(Li=e,e=i)}else Li=e,e=i;else Li=e,e=i;if(e===i)if(e=Li,Wu()!==i)if(ju(),(n=Zi())!==i){for(ju(),t=[],r=pu();r!==i;)t.push(r),r=pu();r=ju(),(u=Nu())!==i?(ju(),Vu()!==i?(Mi=e,e=Sr(n,t,u)):(Li=e,e=i)):(Li=e,e=i)}else Li=e,e=i;else Li=e,e=i;return e}(),e===i&&(e=function(){var e,n,t,r;if(e=Li,Wu()!==i){for(ju(),n=[],t=vu();t!==i;)n.push(t),t=vu();t=ju(),(r=Vu())!==i?(Mi=e,e=Ir(n)):(Li=e,e=i)}else Li=e,e=i;if(e===i)if(e=Li,Wu()!==i){for(ju(),n=[],t=vu();t!==i;)n.push(t),t=vu();t=ju(),(r=Nu())!==i?(ju(),Vu()!==i?(Mi=e,e=gr(n,r)):(Li=e,e=i)):(Li=e,e=i)}else Li=e,e=i;return e}()),e}(),e===i&&(e=function(){var e,n;return e=Li,n=function(){var e,n;return e=Li,n=function(){var e,n,t,r;if(e=Li,(n=iu())!==i){for(t=[],r=su();r!==i;)t.push(r),r=su();Mi=e,e=At(n,t)}else Li=e,e=i;return e}(),n!==i&&(Mi=e,n=gt(n)),e=n}(),n!==i&&(Mi=e,n=St(n)),(e=n)===i&&(e=Li,n=function(){var e,n;return e=Li,au()!==i?(n=function(){var e,n,t;for(e=Li,n=[],t=ou();t!==i;)n.push(t),t=ou();return Mi=e,e=n=bt(n)}(),au()!==i?(Mi=e,e=wt(n)):(Li=e,e=i)):(Li=e,e=i),e}(),n!==i&&(Mi=e,n=It(n)),e=n),e}(),e===i&&(e=cu())===i&&(e=Li,zu()!==i?(ju(),(t=Zi())!==i?(ju(),Ku()!==i?(Mi=e,e=Rt(t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)))))))))),e}function ru(){var e,n,t,r;if(e=Li,(n=iu())!==i){for(t=[],r=uu();r!==i;)t.push(r),r=uu();Mi=e,e=Ot(n,t)}else Li=e,e=i;return e}function iu(){var e;return Re.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(We)),e}function uu(){var e;return Se.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Ve)),e}function su(){var e;return Ie.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Ze)),e}function ou(){var e;return(e=function(){var e;return Ie.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Ze)),e}())===i&&(e=function(){var e;return e=Li,au()!==i&&au()!==i?(Mi=e,e=Ct()):(Li=e,e=i),e}()),e}function au(){var e;return ge.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(qe)),e}function cu(){var e,t,r,u;return e=Li,t=Li,64===n.charCodeAt(Li)?(r=R,Li++):(r=i,0===Ui&&Bi(Xe)),r!==i&&(u=ru())!==i?t=r=[r,u]:(Li=t,t=i),t!==i&&(Mi=e,t=Lt(t)),t}function lu(){var e;return(e=function(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===Z?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(gn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ri()):(Li=e,e=i)):(Li=e,e=i),e}())===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===q?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(An)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ii()):(Li=e,e=i)):(Li=e,e=i),e}())===i&&(e=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===X?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(On)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ui()):(Li=e,e=i)):(Li=e,e=i),e}()),e}function fu(){var e,t,r,u;return e=Li,t=function(){var e,n,t;return e=Li,(n=du())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Ku()!==i?(Mi=e,e=jt(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=du())!==i&&(Mi=e,n=Jt(n)),e=n),e}(),t!==i?(ju(),r=function(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===te?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(Pn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=hi()):(Li=e,e=i)):(Li=e,e=i),e}(),r!==i?(ju(),u=function(){var e,n,t,r;return e=Li,(n=du())!==i&&(Mi=e,n=Qt(n)),(e=n)===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Xu()!==i?(ju(),(r=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=er(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Ku()!==i?(Mi=e,e=nr(t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i&&(Mi=e,n=tr()),e=n))),e}(),u!==i?(Mi=e,e=Kt(t,u)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=function(){var e,n,t,r;return e=Li,(n=du())!==i?(ju(),zu()!==i?(ju(),(t=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=rr(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=du())!==i&&(Mi=e,n=ir(n)),(e=n)===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=mu())!==i?(ju(),Xu()!==i?(ju(),(r=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=ur(t,r)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i?(ju(),zu()!==i?(ju(),(t=hu())!==i?(ju(),Ku()!==i?(Mi=e,e=sr(t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,(n=Bu())!==i&&(Mi=e,n=or()),e=n)))),e}()),e}function du(){var e,n;return e=Li,(n=Yu())!==i&&(Mi=e,n=ar()),(e=n)===i&&(e=Li,(n=Gu())!==i&&(Mi=e,n=cr()),(e=n)===i&&(e=Li,(n=$u())!==i&&(Mi=e,n=lr()),(e=n)===i&&(e=Li,(n=Hu())!==i&&(Mi=e,n=fr()),(e=n)===i&&(e=Li,(n=Fu())!==i&&(Mi=e,n=dr()),e=n)))),e}function hu(){var e,n;return e=Li,(n=Iu())!==i&&(Mi=e,n=hr(n)),n}function mu(){var e,n;return e=Li,(n=Iu())!==i&&(Mi=e,n=mr(n)),n}function Eu(){var e;return(e=Tu())===i&&(e=cu()),e}function Tu(){var e,t,r,u,s;if(e=Li,39===n.charCodeAt(Li)?(t=S,Li++):(t=i,0===Ui&&Bi(ze)),t===i&&(n.substr(Li,2)===I?(t=I,Li+=2):(t=i,0===Ui&&Bi(Ke))),t!==i){for(r=[],u=Li,n.substr(Li,2)===g?(s=g,Li+=2):(s=i,0===Ui&&Bi(je)),s!==i&&(Mi=u,s=Nr()),(u=s)===i&&(Ae.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(Je)));u!==i;)r.push(u),u=Li,n.substr(Li,2)===g?(s=g,Li+=2):(s=i,0===Ui&&Bi(je)),s!==i&&(Mi=u,s=Nr()),(u=s)===i&&(Ae.test(n.charAt(Li))?(u=n.charAt(Li),Li++):(u=i,0===Ui&&Bi(Je)));39===n.charCodeAt(Li)?(u=S,Li++):(u=i,0===Ui&&Bi(ze)),u!==i?(Mi=e,e=yr(r)):(Li=e,e=i)}else Li=e,e=i;return e}function vu(){var e,n,t;return e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),qu()!==i?(ju(),(t=Zi())!==i?(Mi=e,e=Ar(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),Zi()!==i?(Mi=e,e=Or()):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}function pu(){var e,n,t;return e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),qu()!==i?(ju(),(t=Zi())!==i?(Mi=e,e=wr(n,t)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i),e===i&&(e=Li,Zu()!==i?(ju(),(n=Zi())!==i?(ju(),Zi()!==i?(Mi=e,e=br()):(Li=e,e=i)):(Li=e,e=i)):(Li=e,e=i)),e}function Nu(){var e,t,r;return e=Li,t=function(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===Te?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Xn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=wi()):(Li=e,e=i)):(Li=e,e=i),e}(),t!==i?(ju(),(r=Zi())!==i?(Mi=e,e=Cr(r)):(Li=e,e=i)):(Li=e,e=i),e}function yu(){var e,t,r;return(e=Iu())===i&&(e=Li,45===n.charCodeAt(Li)?(t=v,Li++):(t=i,0===Ui&&Bi(Ye)),t===i&&(43===n.charCodeAt(Li)?(t=T,Li++):(t=i,0===Ui&&Bi(He))),t!==i&&(r=Iu())!==i?(Mi=e,e=Ur(t,r)):(Li=e,e=i)),e}function Ru(){var e,t,r;return e=Li,46===n.charCodeAt(Li)?(t=A,Li++):(t=i,0===Ui&&Bi(Qe)),t!==i?((r=Iu())===i&&(r=null),Mi=e,e=xr(r)):(Li=e,e=i),e}function Su(){var e,t,r;return e=Li,t=function(){var e,t,r;return e=Li,we.test(n.charAt(Li))?(t=n.charAt(Li),Li++):(t=i,0===Ui&&Bi(nn)),t!==i?(be.test(n.charAt(Li))?(r=n.charAt(Li),Li++):(r=i,0===Ui&&Bi(tn)),r===i&&(r=null),Mi=e,e=Hr(t,r)):(Li=e,e=i),e}(),t!==i&&(r=Iu())!==i?(Mi=e,e=_r(t,r)):(Li=e,e=i),e}function Iu(){var e,n,t;if(e=Li,n=[],(t=gu())!==i)for(;t!==i;)n.push(t),t=gu();else n=i;return n!==i&&(Mi=e,n=Fr(n)),n}function gu(){var e;return Oe.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(en)),e}function Au(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===C?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(on)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Yr()):(Li=e,e=i)):(Li=e,e=i),e}function Ou(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===L?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(an)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Gr()):(Li=e,e=i)):(Li=e,e=i),e}function wu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===M?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(cn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=$r()):(Li=e,e=i)):(Li=e,e=i),e}function bu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===k?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(fn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Wr()):(Li=e,e=i)):(Li=e,e=i),e}function Cu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===P?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(dn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Vr()):(Li=e,e=i)):(Li=e,e=i),e}function Lu(){var e,t,r,u;return e=Li,n.substr(Li,2).toLowerCase()===U?(t=n.substr(Li,2),Li+=2):(t=i,0===Ui&&Bi(hn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Zr()):(Li=e,e=i)):(Li=e,e=i),e}function Mu(){var e,t,r,u;return e=Li,n.substr(Li,7).toLowerCase()===x?(t=n.substr(Li,7),Li+=7):(t=i,0===Ui&&Bi(mn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=qr()):(Li=e,e=i)):(Li=e,e=i),e}function Du(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===_?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(En)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Xr()):(Li=e,e=i)):(Li=e,e=i),e}function ku(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===G?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Nn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Jr()):(Li=e,e=i)):(Li=e,e=i),e}function Pu(){var e,t,r,u;return e=Li,n.substr(Li,9).toLowerCase()===B?(t=n.substr(Li,9),Li+=9):(t=i,0===Ui&&Bi(Rn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ei()):(Li=e,e=i)):(Li=e,e=i),e}function Uu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===W?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Sn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ni()):(Li=e,e=i)):(Li=e,e=i),e}function xu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===V?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(In)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=ti()):(Li=e,e=i)):(Li=e,e=i),e}function _u(){var e,t,r,u;return e=Li,n.substr(Li,8).toLowerCase()===re?(t=n.substr(Li,8),Li+=8):(t=i,0===Ui&&Bi(Un)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=mi()):(Li=e,e=i)):(Li=e,e=i),e}function Fu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===ie?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(xn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ei()):(Li=e,e=i)):(Li=e,e=i),e}function Hu(){var e,t,r,u;return e=Li,n.substr(Li,5).toLowerCase()===oe?(t=n.substr(Li,5),Li+=5):(t=i,0===Ui&&Bi(Hn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=pi()):(Li=e,e=i)):(Li=e,e=i),e}function Yu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===ae?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(Yn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ni()):(Li=e,e=i)):(Li=e,e=i),e}function Gu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===ce?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Gn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=yi()):(Li=e,e=i)):(Li=e,e=i),e}function $u(){var e,t,r,u;return e=Li,n.substr(Li,6).toLowerCase()===le?(t=n.substr(Li,6),Li+=6):(t=i,0===Ui&&Bi($n)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ri()):(Li=e,e=i)):(Li=e,e=i),e}function Bu(){var e,t,r,u;return e=Li,n.substr(Li,6).toLowerCase()===fe?(t=n.substr(Li,6),Li+=6):(t=i,0===Ui&&Bi(Bn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Si()):(Li=e,e=i)):(Li=e,e=i),e}function Wu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===de?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Wn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ii()):(Li=e,e=i)):(Li=e,e=i),e}function Vu(){var e,t,r,u;return e=Li,n.substr(Li,3).toLowerCase()===he?(t=n.substr(Li,3),Li+=3):(t=i,0===Ui&&Bi(Vn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=gi()):(Li=e,e=i)):(Li=e,e=i),e}function Zu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===me?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(Zn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Ai()):(Li=e,e=i)):(Li=e,e=i),e}function qu(){var e,t,r,u;return e=Li,n.substr(Li,4).toLowerCase()===Ee?(t=n.substr(Li,4),Li+=4):(t=i,0===Ui&&Bi(qn)),t!==i?(r=Li,Ui++,u=uu(),Ui--,u===i?r=void 0:(Li=r,r=i),r!==i?(Mi=e,e=Oi()):(Li=e,e=i)):(Li=e,e=i),e}function Xu(){var e;return 44===n.charCodeAt(Li)?(e=ve,Li++):(e=i,0===Ui&&Bi(zn)),e}function zu(){var e;return 40===n.charCodeAt(Li)?(e=pe,Li++):(e=i,0===Ui&&Bi(Kn)),e}function Ku(){var e;return 41===n.charCodeAt(Li)?(e=Ne,Li++):(e=i,0===Ui&&Bi(jn)),e}function ju(){var e,n;for(e=[],n=Ju();n!==i;)e.push(n),n=Ju();return e}function Ju(){var e;return Ce.test(n.charAt(Li))?(e=n.charAt(Li),Li++):(e=i,0===Ui&&Bi(Jn)),e}function Qu(e,n,t,r){var i={type:"binary-expression",operator:e,left:n,right:t,range:_i()};return void 0!==r&&(i.escape=r),i}function es(e,n){for(var t=e,r=0;r<n.length;r++)t=Qu(n[r][1],t,n[r][3]);return t}if((r=o())!==i&&Li===n.length)return r;throw r!==i&&Li<n.length&&Bi({type:"end"}),function(n,t,r){return new e(e.buildMessage(n,t),n,t,r)}(Pi,ki<n.length?n.charAt(ki):null,$i(ki,ki<n.length?ki+1:ki))}}}();Mi.SyntaxError.prototype.name="PeggySyntaxError";const Di=Mi.parse,ki=(e,n,t,r,i)=>{switch(n.type){case"interval":{if(!i)return void Ui(r,"INTERVAL",!1);const u=e.findNextMatch(/\)|,/u,{lineNumber:n.range.end.line,column:n.range.end.column},!0,!0,null,!0).range,[s,o]=Zi(t,i,u);return void((s??o)&&Ui(r,"INTERVAL",!1))}case"case-expression":{const e={startColumn:n.range.start.column,endColumn:n.range.start.column+4,startLineNumber:n.range.start.line,endLineNumber:n.range.start.line},i={startColumn:n.range.end.column-3,endColumn:n.range.end.column,startLineNumber:n.range.end.line,endLineNumber:n.range.end.line},[u,s]=Zi(t,e,i);return void((u??s)&&Ui(r,"CASE",!1))}case"expression-list":{const i=n.value;let u;return void i.forEach(((s,o)=>{if(0===o){const t=e.findMatches("(",{startLineNumber:1,endLineNumber:n.range.start.line,startColumn:1,endColumn:n.range.start.column},!1,!0,null,!0);u=t[t.length-1].range}ki(e,s,t,r,u),u=Wi(o+1,s,e,i.length)}))}case"unary-expression":return void ki(e,n.expr,t,r,void 0);case"binary-expression":return ki(e,n.left,t,r,void 0),void ki(e,n.right,t,r,void 0);case"null":case"boolean":case"string":case"timestamp":case"date":case"time":case"number":case"current-time":case"data-type":case"parameter":case"when-clause":case"interval-period":case"interval-qualifier":return;case"column-reference":{const u=n.column,s=Vi(u);if(!i)return void(s&&Ui(r,u,!1));const o=e.getValueInRange(i),a=e.findNextMatch(/\)|,/u,{column:n.range.start.column,lineNumber:n.range.start.line},!0,!0,null,!0).range,[c,l]=Zi(t,i,a);return void((c??l)&&s&&Ui(r,u,"("===o))}case"function":{const i=n.name,u=n.args.value,s={startLineNumber:n.range.start.line,endLineNumber:n.range.start.line,startColumn:n.range.start.column,endColumn:n.range.start.column+i.length},o={startLineNumber:n.range.end.line,endLineNumber:n.range.end.line,startColumn:n.range.end.column,endColumn:n.range.end.column},[a,c]=Zi(t,s,o);let l;return(a??c)&&Ui(r,i,!1),void u.forEach(((i,s)=>{let o=!1;switch(i.type){case"function":case"column-reference":case"interval":case"case-expression":o=!0}0===s&&(l=e.findNextMatch("(",{column:n.range.start.column,lineNumber:n.range.start.line},!1,!0,null,!0).range),!o&&"string"===i.type&&"BOTH"===i.value||(ki(e,i,t,r,l),l=Wi(s+1,i,e,u.length))}))}default:throw new xr(kr.UnsupportedSyntax,{node:n})}},Pi=(e,t,r)=>{const i=Bi(e),u=i?.map((e=>{const i=$i.includes(e.toUpperCase())?n.CompletionItemKind.TypeParameter:n.CompletionItemKind.Keyword;return{label:e,kind:i,insertText:e,range:t,sortText:String.fromCharCode(121-r)}}));return u??[]},Ui=(e,n,t)=>{t?e.additionalContext=n:e.contextString=n},xi=["AND","OR","IS","ISNOT","IN","NOT IN","BETWEEN","NOTBETWEEN","LIKE","NOT LIKE"],_i="ac";class Fi{constructor(e){this._defaults=e}async provideCompletionItems(e,t){const r=this._defaults.getFeatureLayerForModel(e.uri.toString()),i=e.getWordUntilPosition(t),u={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn},s=function(e,n,t){try{const r=n.getValue();return((e,n,t,r)=>{const i={contextString:"NONE",additionalContext:"NONE"};ki(e,n,r,i,void 0);const{contextString:u,additionalContext:s}=i;return[...Pi(u,t,0),...Pi(s,t,1)]})(n,Di(r),e,t)}catch{const r=/(?:\(|\)|\s|,)/u,i=e=>{const n=void 0!==zi(e),t=Vi(e),r=""!==e&&"'"!==e,i=["(",")",",","END"].includes(e);return r&&(n||t||i)},u=n.getValueInRange({startColumn:1,endColumn:t.column,startLineNumber:1,endLineNumber:t.lineNumber}).toUpperCase().split(r).map((e=>e.trim())).filter((e=>i(e))),s=[];for(let e=0;e<u.length;e++){const n=u[e],t=s.length>0;if(e<u.length-1){const t=u[e+1];if(zi(n)&&"("!==t)continue}if("("!==n&&","!==n)if(")"!==n&&"END"!==n){if(e!==u.length-1||!zi(n))if(e>0){const t=Vi(u[e-1]);Vi(n)&&t||s.push(n)}else 0===e&&s.push(n)}else t&&s.pop();else t&&Vi(s[s.length-1])&&s.pop()}let o=[];return[...new Set(s)].forEach(((n,t)=>{const r=Pi(n,e,t);o=[...o,...r]})),o}}(u,e,t),{sqlKeywordsCompletion:o,sqlBinOpsCompletion:a,sqlFunctionCompletion:c,fieldsCompletion:l,sqlDataTypeCompletion:f}=function(e,t){const r=e.fields.map((e=>({label:e.name,kind:n.CompletionItemKind.Variable,insertText:e.name,range:t,sortText:"zaa"}))),i=Object.entries(Li).map((([e])=>e.toString().toLowerCase()));return{fieldsCompletion:r,sqlFunctionCompletion:[...Gi.flatMap((e=>{const r=e.toLowerCase(),i=Hi[r],{name:u,snippet:s,parameters:o,returnValue:a,description:c,examples:l}=i,f={kind:n.CompletionItemKind.Function,range:t,sortText:`z${_i}`,detail:qi(u,o,a),documentation:Xi(c,l)};return Array.isArray(s)&&s.length?[{...f,label:u,insertText:s[0]},{...f,label:u.slice(0,-2),insertText:s[1]}]:[{...f,label:u,insertText:s}]})),...i.flatMap((e=>{const r=Hi[e],i=e.toUpperCase();if(!r)return{label:`${i}()`,kind:n.CompletionItemKind.Function,insertText:`${i}(\${1})`,range:t,sortText:`z${_i}`,insertTextRules:n.CompletionItemInsertTextRule.InsertAsSnippet};if(Array.isArray(r)){const e=r.map((({name:e,snippet:r,parameters:i,returnValue:u,description:s,examples:o},a)=>({label:`${e}${" ".repeat(a)}`,kind:n.CompletionItemKind.Function,insertText:r,range:t,sortText:`z${_i}`,insertTextRules:n.CompletionItemInsertTextRule.InsertAsSnippet,detail:qi(e,i,u),documentation:Xi(s,o)})));return e}const{name:u,snippet:s,parameters:o,returnValue:a,description:c,examples:l}=r;return{label:u,kind:n.CompletionItemKind.Function,insertText:s,range:t,sortText:`z${_i}`,insertTextRules:n.CompletionItemInsertTextRule.InsertAsSnippet,detail:qi(u,o,a),documentation:Xi(c,l)}}))],sqlBinOpsCompletion:xi.map((e=>{const r=e=>"ISNOT"===e?"IS NOT":"NOTBETWEEN"===e?"NOT BETWEEN":e;return{label:r(e),kind:n.CompletionItemKind.Keyword,insertText:r(e),range:t,sortText:"zc"}})),sqlKeywordsCompletion:Yi.map((e=>"CASE"===e?{label:e,kind:n.CompletionItemKind.Snippet,insertText:"CASE\n\tWHEN condition1 THEN result1 \n\tELSE result\nEND",range:t,sortText:"zb"}:{label:e,kind:n.CompletionItemKind.Keyword,insertText:e,range:t,sortText:"zc"})),sqlDataTypeCompletion:$i.map((e=>({label:e,kind:n.CompletionItemKind.TypeParameter,insertText:e,range:t,sortText:"zd"})))}}(r,u),d=new Map;return[...o,...a,...f,...c,...l,...s].forEach((e=>{const{sortText:n}=e,t=e.label;d.get(t)||d.set(t,e),n.charCodeAt(0)<d.get(t).sortText.charCodeAt(0)&&d.set(t,e)})),{suggestions:Array.from(d.entries()).map((([,e])=>e))}}}const Hi={...u,...o,char_length:{description:"Returns the number of characters in the text string as an integer.",parameters:[{name:"string",type:"String",description:"The text string to return the length of."}],returnValue:"Number",examples:[{description:"Returns 11",code:"CHAR_LENGTH('Nova Scotia')"}],snippet:"CHAR_LENGTH(${1})",name:"CHAR_LENGTH()",bundle:"String"},coalesce:{description:"Returns the first value in the list that is not `NULL`.",parameters:[{name:"val_1",type:["String","Number"],description:"The first value in the list."},{name:"val_2",type:["String","Number"],description:"The second value in the list."},{name:"val_n",type:["String","Number"],description:"The following values in the list."}],returnValue:["String","Number"],examples:[{description:"Returns 'Green goldfish'",code:"COALESCE(`NULL`, `NULL`, 'Green goldfish', `NULL`, 'Purple cow')"},{description:"Returns -21",code:"COALESCE(`NULL`, -21, 33, `NULL`)"}],snippet:"COALESCE(${1}, ${2},..., ${3})",name:"COALESCE()",bundle:"String"},concat:{description:"Concatenates two strings together.",parameters:[{name:"string1",type:"String",description:"The first text string."},{name:"string2",type:"String",description:"The text string to concatenate to the first text string."}],returnValue:"String",examples:[{description:"Returns 'Maple syrup'",code:"CONCAT('Maple ', 'syrup')"}],snippet:"CONCAT(${1}, ${2})",name:"CONCAT()",bundle:"String"},lower:{description:"Converts all characters in the text string to lowercase.",parameters:[{name:"string",type:"String",description:"The text string to convert to lowercase."}],returnValue:"String",examples:[{description:"Returns 'hello world'",code:"LOWER('HELLO WORLD')"}],snippet:"LOWER(${1})",name:"LOWER()",bundle:"String"},position:{description:"Returns the first occurrence of a substring in another text string. Returns 0 if the substring is not found.",parameters:[{name:"substring",type:"String",description:"The text string to search for in string."},{name:"string",type:"String",description:"The string that will be searched for the substring."}],returnValue:"Number",examples:[{description:"Returns 6",code:"POSITION('com','esri.com')"},{description:"Returns 9",code:"POSITION('SUM', 'Lorem ipsum')"}],snippet:"POSITION(${1}, ${2})",name:"POSITION()",bundle:"String"},substring:[{description:"Returns a subset of characters in a text string from a starting point to the specified string length.",parameters:[{name:"string",type:"String",description:"The text string to extract from."},{name:"start",type:"Number",description:"The integer value that specifies where the returned characters will start."},{name:"length",type:"Number",description:"The number of characters to extract."}],returnValue:"String",examples:[{description:"Returns 'City'",code:"SUBSTRING('New York City', 10, 4)"}],snippet:"SUBSTRING(${1}, ${2}, ${3})",name:"SUBSTRING()",bundle:"String"},{description:"Returns a subset of characters in a text string from a starting point to the specified string length.",parameters:[{name:"string",type:"String",description:"The text string to extract from."},{name:"start",type:"Number",description:"The integer value that specifies where the returned characters will start."},{name:"length",type:"Number",description:"The number of characters to extract."}],returnValue:"String",examples:[{description:"Returns 'City'",code:"SUBSTRING('New York City' FROM 10 FOR 4)"},{description:"Returns 'New York'",code:"SUBSTRING('New York City' FROM 1 FOR 8)"}],snippet:"SUBSTRING(${1} FROM ${2} FOR ${3})",name:"SUBSTRING()",bundle:"String"}],trim:{description:"Returns a text string where all of the leading and/or trailing spaces have been removed. LEADING will trim the leading side of the text string, TRAILING will trim the trailing side of the text string, while BOTH will trim both sides of the text string.",parameters:[{name:"side",type:["LEADING","TRAILING","BOTH"],description:"The side of the text string where spaces will be removed."},{name:"string",type:"String",description:"The text string to trim."}],returnValue:"String",examples:[{description:"Returns 'hello world'",code:"TRIM(LEADING '' FROM ' hello world')"},{description:"Returns ' hello world'",code:"TRIM(TRAILING '' FROM ' hello world ')"},{description:"Returns 'hello world'",code:"TRIM(BOTH '' FROM ' hello world ')"}],snippet:"TRIM(${1} ' ' FROM ${2})",name:"TRIM()",bundle:"String"},upper:{description:"Converts all characters in the text string to uppercase.",parameters:[{name:"string",type:"String",description:"The string to convert to uppercase."}],returnValue:"String",examples:[{description:"Returns 'QUICK RED FOX'",code:"UPPER('quick red fox')"}],snippet:"UPPER(${1})",name:"UPPER()",bundle:"String"}},Yi=["INTERVAL","CASE"],Gi=["CURRENT_TIME","CURRENT_DATE","CURRENT_TIMESTAMP"],$i=Hi.cast.parameters[1]?.type??[],Bi=e=>{switch(e.toLowerCase()){case"extract":case"interval":return[...Hi.extract.parameters[0].type];case"position":return["IN"];case"trim":return["FROM",...Hi.trim.parameters[0].type];case"cast":return["AS",...Hi.cast.parameters[1].type];case"case":return["WHEN","THEN","ELSE","END"];default:return[]}},Wi=(e,n,t,r)=>{let i;const u=n.range.start,s=n.range.end;return i=0===e?t.findNextMatch("(",{lineNumber:u.line,column:u.column},!1,!0,null,!0).range:e===r?{startLineNumber:s.line,endLineNumber:s.line,startColumn:s.column,endColumn:s.column}:t.findNextMatch(",",{lineNumber:u.line,column:u.column},!1,!0,null,!0).range,i},Vi=e=>{const n=e.toUpperCase();return Yi.includes(n)},Zi=(e,n,t)=>{let r=!1,i=!1;const u=e.column,s=e.lineNumber;return n.startLineNumber===t.startLineNumber&&n.startLineNumber===s&&u>n.startColumn&&u<t.endColumn&&(r=!0),n.startLineNumber!==t.startLineNumber&&(s===n.startLineNumber&&u>n.startColumn||s===t.startLineNumber&&u<t.endColumn||s>n.startLineNumber&&s<t.endLineNumber)&&(i=!0),[r,i]},qi=(e,n,t)=>{const r=n.map((e=>`${e.name}: ${Array.isArray(e.type)?e.type.join(" | "):e.type}`)),i=Array.isArray(t)?t.join(" | "):t;return`${e.slice(0,-2)}(${r.join(", ")}): ${i}`},Xi=(e,n)=>`${e}\n\n${n.map((e=>`${e.code} => ${e.description.split("Returns")[1]?.trim()}`)).join("\n")}`;function zi(e){return Li[e.toLowerCase()]}var Ki,ji;!function(e){e.ARGS="args",e.CLAUSES="clauses",e.ELSE="else",e.END="end",e.EXPR="expr",e.LEFT="left",e.OPERAND="operand",e.QUALIFIER="qualifier",e.RIGHT="right",e.START="start",e.VALUE="value"}(Ki||(Ki={})),function(e){e.CASE_EXPRESSION="case-expression",e.EXPRESSION_LIST="expression-list",e.FUNCTION="function",e.INTERVAL="interval",e.INTERVAL_QUALIFIER="interval-qualifier",e.WHEN_CLAUSE="when-clause",e.UNARY_EXPRESSION="unary-expression",e.BINARY_EXPRESSION="binary-expression"}(ji||(ji={}));const Ji={[ji.CASE_EXPRESSION]:[Ki.CLAUSES,Ki.OPERAND,Ki.ELSE],[ji.WHEN_CLAUSE]:[Ki.OPERAND,Ki.VALUE],[ji.EXPRESSION_LIST]:[Ki.VALUE],[ji.UNARY_EXPRESSION]:[Ki.EXPR],[ji.BINARY_EXPRESSION]:[Ki.LEFT,Ki.RIGHT],[ji.FUNCTION]:[Ki.ARGS],[ji.INTERVAL]:[Ki.VALUE,Ki.QUALIFIER],[ji.INTERVAL_QUALIFIER]:[Ki.START,Ki.END]};var Qi;!function(e){e.ExpectedDateTimeValue="ExpectedDateTimeValue",e.ExpectedNumericalLiteral="ExpectedNumericalLiteral",e.ExpectedToken="ExpectedToken",e.FunctionNotSupported="FunctionNotSupported",e.IncompatibleListDataType="IncompatibleListDataType",e.IncorrectArgumentLength="IncorrectArgumentLength",e.IncorrectCastParameters="IncorrectCastParameters",e.IncorrectExtractParameters="IncorrectExtractParameters",e.IncorrectSubstringParameters="IncorrectSubstringParameters",e.IncorrectTrimParameters="IncorrectTrimParameters",e.InvalidElseClause="InvalidElseClause",e.InvalidThenClause="InvalidThenClause",e.InvalidEndOnWhen="InvalidEndOnWhen",e.InvalidTrimCharacter="InvalidTrimCharacter",e.MismatchedTypes="MismatchedTypes",e.MissingValueInCaseClause="MissingValueInCaseClause",e.NotCallable="NotCallable",e.TypeNotAssignable="TypeNotAssignable",e.UnexpectedEnd="UnexpectedEnd.",e.UnexpectedIdentifier="UnexpectedIdentifier",e.UnexpectedNumber="UnexpectedNumber",e.UnexpectedTextLiteral="UnexpectedTextLiteral",e.UnexpectedToken="UnexpectedToken",e.UnknownField="UnknownField",e.UnsupportedOperator="UnsupportedOperator",e.UnsupportedSyntax="UnsupportedSyntax",e.InvalidIntervalQualifier="InvalidIntervalQualifier",e.EmptyCaseExpression="EmptyCaseExpression"}(Qi||(Qi={}));const eu={[Qi.ExpectedDateTimeValue]:`Expected ${Hi.extract.parameters[0].type.map((e=>`'${e}'`)).join(" | ")}.`,[Qi.ExpectedNumericalLiteral]:"Expected a numerical literal.",[Qi.ExpectedToken]:"Expected token ${token}.",[Qi.FunctionNotSupported]:`Function "\${function}" not supported.\n\nSupported SQL functions: ${[...Object.keys(Li),...Gi.filter((e=>!e.endsWith(")"))),...Yi].map((e=>`"${e.toUpperCase()}"`)).sort().join(", ")}.`,[Qi.IncompatibleListDataType]:"Incompatible data types in expression list found. All data items should have the same type.\n\nTypes found: ${types}.",[Qi.IncorrectArgumentLength]:"Expected ${formatMinMaxParams} arguments, but got ${numArgs}.",[Qi.IncorrectCastParameters]:`Expected usage:\n- CAST(<VALUE> AS <${Hi.cast.parameters[1].type.join(" | ")}>)`,[Qi.IncorrectExtractParameters]:`Expected usage:\n- EXTRACT(<${Hi.extract.parameters[0].type.join(" | ")}> FROM <Datetime>)`,[Qi.IncorrectSubstringParameters]:"Expected usage:\n- SUBSTRING(<VALUE> FROM <START> FOR <LENGTH>)\n- SUBSTRING(<VALUE>, <START>, <LENGTH>)",[Qi.IncorrectTrimParameters]:`Expected usage:\n- TRIM(<${Hi.trim.parameters[0].type.join(" | ")}> ' ' FROM <STRING>)`,[Qi.InvalidThenClause]:"THEN clause can only follow after a WHEN clause.",[Qi.InvalidElseClause]:"ELSE clause cannot be used without a WHEN clause.",[Qi.InvalidEndOnWhen]:"Cannot end a CASE expression with a WHEN clause. Requires a following THEN clause.",[Qi.InvalidTrimCharacter]:"Trim character must be the space character ' '.",[Qi.MismatchedTypes]:'Invalid type mismatch between ${leftValue} (type: "${providedType}") and ${rightValue} (type: "${expectedType}").',[Qi.MissingValueInCaseClause]:"Missing value after ${clause} clause in CASE expression.",[Qi.NotCallable]:"${expression} is not callable.",[Qi.TypeNotAssignable]:"Type ${providedType} is not assignable to type ${expectedType}.",[Qi.UnexpectedEnd]:"Unexpected end of SQL expression.",[Qi.UnexpectedIdentifier]:"Unexpected identifier.",[Qi.UnexpectedNumber]:"Unexpected number.",[Qi.UnexpectedTextLiteral]:"Unexpected text literal.",[Qi.UnexpectedToken]:"Unexpected token ${token}.",[Qi.UnknownField]:'No fields with name "${field}" exists.',[Qi.UnsupportedOperator]:"Unsupported SQL operator ${operator}.",[Qi.UnsupportedSyntax]:"Unsupported SQL syntax ${syntax}.",[Qi.InvalidIntervalQualifier]:"Invalid interval qualifier. Expected 'YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND'.",[Qi.EmptyCaseExpression]:"The CASE expression cannot be empty. Please provide valid conditions and results within the CASE block."},nu=(e,n)=>{const t=eu[e];var r,i;return n&&"minParams"in n&&"maxParams"in n&&(n.formatMinMaxParams=(r=n.minParams)===(i=n.maxParams)?`${r}`:`${r}-${i}`),n?t.replace(/\${(.*?)}/g,((e,t)=>n[t]?.toString()??"")):t};var tu,ru,iu,uu,su;!function(e){e.Single="SINGLE",e.EmptyField="EMPTY_FIELD",e.Error="ERROR",e.Field="FIELD",e.KeywordIn="IN",e.KeywordNotIn="NOT IN",e.KeywordBetween="BETWEEN",e.KeywordNotBetween="NOT BETWEEN",e.List="LIST",e.Negation="NOT",e.Number="NUMBER",e.Operator="OPERATOR",e.Parentheses="PARENTHESES",e.String="STRING",e.Unknown="UNKNOWN"}(tu||(tu={})),function(e){e.Case="CASE",e.CaseElse="ELSE",e.CaseThen="THEN",e.CaseWhen="WHEN",e.Comma=",",e.DoubleQuote='"',e.Empty="",e.End="END",e.Interval="INTERVAL",e.LeftParentheses="(",e.NewLine="\n",e.RightParentheses=")",e.SingleQuote="'",e.WhiteSpace=" "}(ru||(ru={})),function(e){e.And="AND",e.Or="OR",e.Is="IS",e.IsNot="ISNOT",e.In="IN",e.NotIn="NOT IN",e.Between="BETWEEN",e.NotBetween="NOTBETWEEN",e.Like="LIKE",e.NotLike="NOT LIKE",e.NotEquals="<>",e.LessThan="<",e.GreaterThan=">",e.GreaterThanEqual=">=",e.LessThanEqual="<=",e.Equal="=",e.Multiply="*",e.Subtract="-",e.Add="+",e.Divide="/",e.Concatenate="||"}(iu||(iu={})),function(e){e.Boolean="BOOLEAN",e.Double="DOUBLE",e.ExpressionList="EXPRESSION-LIST",e.Float="FLOAT",e.Integer="INTEGER",e.Null="NULL",e.Number="NUMBER",e.Real="REAL",e.String="STRING",e.SmallInt="SMALLINT",e.UnknownFunction="UNKNOWN_FUNCTION"}(uu||(uu={})),function(e){e.Function="FUNCTION",e.ExpressionList="EXPRESSION_LIST",e.Success="SUCCESS",e.NonCallable="NON_CALLABLE"}(su||(su={}));const ou=/\d+/,au=["string","number","integer","number","smallint","float","real","date","time","timestamp","current-time","column-reference"],cu=(e,n)=>{switch(e.type){case"interval":case"interval-period":case"interval-qualifier":case"when-clause":case"case-expression":case"parameter":case"expression-list":case"null":case"boolean":case"string":case"timestamp":case"date":case"time":case"number":case"current-time":case"data-type":return e.type;case"unary-expression":return"boolean";case"binary-expression":return(e=>{switch(e.operator){case"AND":case"OR":case"IS":case"ISNOT":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"*":case"-":case"+":case"/":return"number";case"||":return"string"}})(e);case"column-reference":{const t=n.find((n=>n.name===e.column));if(t)return function(e){switch(e){case"string":case"guid":case"global-id":case"xml":case"geometry":case"blob":case"raster":return"string";case"date":case"timestamp-offset":case"date-only":return"date";case"small-integer":case"integer":case"big-integer":case"oid":return"integer";case"single":case"double":case"long":return"float";case"time-only":return"time"}}(t.type)}return e.type;case"function":switch(e.name.toLowerCase()){case"cast":{if("data-type"!==e.args?.value?.[1]?.type)throw Error("Invalid cast function");const n=e.args?.value?.[1]?.value?.type;switch(n){case"integer":case"smallint":return"integer";case"real":case"float":return"float";case"date":case"timestamp":return e.args.value[1].value?.withtimezone?"date":"timestamp";case"time":return"time-only";case"varchar":return"string"}}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":return"float";case"sign":return"integer";case"ceiling":case"floor":case"abs":case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":case"truncate":return"float";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"current_date":case"current_time":case"current_timestamp":return"date";default:return"unknown_function"}}},lu=e=>{switch(e.toLowerCase()){case"integer":case"double":case"number":case"smallint":case"float":case"real":return!0;default:return!1}},fu=(e,n)=>{const t=n===ru.Comma?", ":" | ";return e.map((e=>`"${e.toLowerCase()}"`)).sort().join(t)},du=e=>`"${e}"`,hu=e=>{switch(e.type){case"interval-qualifier":case"interval":return"INTERVAL";case"when-clause":return"WHEN_CLAUSE";case"case-expression":return"CASE_EXPRESSION";case"unary-expression":return"UNARY_EXPRESSION";case"expression-list":return"EXPRESSION_LIST";case"binary-expression":return"BINARY_EXPRESSION";case"current-time":return du(e.mode);case"interval-period":return du(e.period);case"null":return du("null");case"column-reference":return du(e.column);case"number":return e.value;case"function":return du(`${e.name}()`);case"data-type":return du(e.type);case"boolean":case"date":case"parameter":case"time":case"timestamp":case"string":return du(String(e.value))}},mu=(e,n,r,i)=>{if(i){const i={startColumn:n.start.column,endColumn:n.end.column,startLineNumber:n.start.line,endLineNumber:n.end.line};r.some((n=>n.message===e&&n.startColumn===i.startColumn&&n.startLineNumber===i.startLineNumber&&n.endColumn===i.endColumn&&n.endLineNumber===i.endLineNumber))||r.push({message:e,severity:t.Error,...i})}else{const i=n;r.some((n=>n.message===e&&n.startColumn===i.startColumn&&n.startLineNumber===i.startLineNumber&&n.endColumn===i.endColumn&&n.endLineNumber===i.endLineNumber))||r.push({message:e,severity:t.Error,...i})}},Eu=(e,n,t,r)=>{const i=cu(e,r);let u=i.toUpperCase()===n;if(n===uu.Number&&(u=lu(i)),!u){const r=nu(Qi.TypeNotAssignable,{providedType:du(i),expectedType:du(n.toLowerCase())});mu(r,e.range,t,!0)}},Tu=[iu.Add,iu.Subtract,iu.Multiply,iu.Divide,iu.Concatenate],vu=["cast","extract","substring"];class pu{constructor(e,n){this.layer=e,this.callStack=[],this.markers=[],this._sdkFunctions=n.flatMap((e=>e.items))}validateModel(e){try{const n=Di(e);this.traverse(n)}catch(n){this._handleParserFailure(n,e)}}traverse(e){this.callStack.push(e),this._validateNode(e),this._traverseChildren(e),this.callStack.pop()}_validateNode(e){if(e)switch(e.type){case"interval":if(!ou.test(e.value.value)||"string"!==e.value.type){const n=nu(Qi.ExpectedNumericalLiteral),t=this._getRange(e.value);return void mu(n,t,this.markers)}return;case"interval-period":case"interval-qualifier":case"parameter":case"null":case"boolean":case"string":case"timestamp":case"date":case"time":case"number":case"current-time":case"data-type":case"when-clause":return;case"case-expression":if(0===e.clauses.length){if(e.else){const n=nu(Qi.InvalidElseClause);return void mu(n,{startLineNumber:e.elseRange.start.line,endLineNumber:e.elseRange.end.line,startColumn:e.elseRange.start.column,endColumn:e.elseRange.end.column},this.markers)}const n=nu(Qi.EmptyCaseExpression);return void mu(n,{startLineNumber:e.range.start.line,endLineNumber:e.range.end.line,startColumn:e.range.start.column,endColumn:e.range.end.column},this.markers)}return;case"column-reference":if(Object.values(ru).map((e=>e.toLowerCase())).includes(e.column.toLowerCase()))return;if(!this.layer.fields.find((n=>n.name===e.column))){const n=nu(Qi.UnknownField,{field:e.column});mu(n,e.range,this.markers,!0)}return;case"expression-list":{const n=e.value,t=new Set,r=this.callStack.at(-2);if("function"===r?.type&&vu.includes(r?.name?.toLowerCase()))return;if(n.forEach((e=>{let n=cu(e,this.layer.fields);if("column-reference"!==n&&"time-only"!==n)if("unknown_function"!==n)lu(n)&&(n="number"),t.has(n)||t.add(n);else{const n=nu(Qi.FunctionNotSupported,{function:e.name});mu(n,e.range,this.markers,!0)}})),t.size>1){const n=Array.from(t),r=nu(Qi.IncompatibleListDataType,{types:fu(n,ru.Comma)});mu(r,e.range,this.markers,!0)}return}case"binary-expression":{const n=1===this.callStack.length,t=e.left,r=e.right,i=cu(t,this.layer.fields),u=cu(r,this.layer.fields);if(n&&!Tu.includes(e.operator))return void mu(`Cannot perform binary operation '${e.operator}' at root node.`,e.range,this.markers,!0);switch(e.operator){case iu.And:case iu.Or:Eu(t,uu.Boolean,this.markers,this.layer.fields),Eu(r,uu.Boolean,this.markers,this.layer.fields);break;case iu.Is:case iu.IsNot:Eu(r,uu.Null,this.markers,this.layer.fields);break;case iu.In:case iu.NotIn:case iu.Between:case iu.NotBetween:Eu(r,uu.ExpressionList,this.markers,this.layer.fields);break;case iu.Like:case iu.NotLike:Eu(r,uu.String,this.markers,this.layer.fields);break;case iu.NotEquals:case iu.LessThan:case iu.GreaterThan:case iu.GreaterThanEqual:case iu.LessThanEqual:case iu.Equal:{if(!au.includes(u)){const e=nu(Qi.TypeNotAssignable,{providedType:du(u),expectedType:fu(au,ru.Comma)});mu(e,r.range,this.markers,!0)}const n=lu(i)&&lu(u);if(i!==u&&!n){const n=nu(Qi.MismatchedTypes,{leftValue:hu(t),providedType:i,rightValue:hu(r),expectedType:u});mu(n,e.range,this.markers,!0)}break}case iu.Multiply:case iu.Subtract:case iu.Add:case iu.Divide:Eu(t,uu.Number,this.markers,this.layer.fields),Eu(r,uu.Number,this.markers,this.layer.fields);break;case iu.Concatenate:Eu(t,uu.String,this.markers,this.layer.fields),Eu(r,uu.String,this.markers,this.layer.fields);break;default:{const n=nu(Qi.UnsupportedOperator,{operator:du(e.operator)});mu(n,e.range,this.markers,!0)}}return}case"function":{const n=this._getFunction(e.name);if(!n){const n=nu(Qi.FunctionNotSupported,{function:e.name});return void mu(n,e.range,this.markers,!0)}if("function"===n.type){const{min:t,max:r}=n.parametersInfo,{args:{value:i}}=e,u=i.length;if(u<t||u>r){const n=nu(Qi.IncorrectArgumentLength,{minParams:t,maxParams:r,numArgs:u});mu(n,e.range,this.markers)}}}return;case"unary-expression":return void console.warn("Unexpected unary expression found.")}}_handleParserFailure(e,n){if(e instanceof Error&&(!("location"in e)||!("format"in e)))throw e;if(""===n.trim())return void(this.markers=[]);const t=e;let r=t.message;(function(e){return/^Expected "\S+"/.test(e.message)})(t)&&(r=function(e){const n=e.message.match(/but "(.*)" found/)?.[1];if(n){const t=e.message.match(/Expected (.*) but/),r=t?.[1]?.split(", ").map(((e,n,t)=>(n===t.length-1&&e.startsWith("or ")&&(e=e.slice(3)),"[ \\t\\n\\r]"===(e=e.replace(/^"|"$/g,""))?"• WHITESPACE":`• ${e}`))).join("\n");let i=`Invalid syntax: unexpected token "${n}".`;return r&&(i+=`\n\nExpected one of the following:\n${r}`),i}return e.message.match(/but end of input found/)?"Invalid syntax: unexpected end of SQL Expression.":"Invalid syntax: unexpected token."}(t)),mu(r,{startLineNumber:t.location.start.line,endLineNumber:t.location.end.line,startColumn:t.location.start.column,endColumn:t.location.end.column},this.markers)}_getRange(e){return{startLineNumber:e.range.start.line,endLineNumber:e.range.end.line,startColumn:e.range.start.column,endColumn:e.range.end.column}}_getFunction(e){return this._sdkFunctions.find((n=>n.name.toLowerCase()===e.toLowerCase()))}_traverseChildren(e){if(e)switch(e.type){case ji.CASE_EXPRESSION:{const n=Ji[e.type];"simple"===e.format?n.forEach((n=>{const t=e[n];Array.isArray(t)?t.forEach((e=>{this.traverse(e)})):this.traverse(t)})):"searched"===e.format&&n.forEach((n=>{if(n===Ki.OPERAND)return;const t=e[n];Array.isArray(t)?t.forEach((e=>{this.traverse(e)})):this.traverse(t)}))}break;case ji.WHEN_CLAUSE:Ji[e.type].forEach((n=>{this.traverse(e[n])}));break;case ji.EXPRESSION_LIST:Ji[e.type].forEach((n=>{const t=e[n];Array.isArray(t)?t.forEach((e=>{this.traverse(e)})):this.traverse(t)}));break;case ji.UNARY_EXPRESSION:Ji[e.type].forEach((n=>{const t=e[n];Array.isArray(t)&&this.traverse(t)}));break;case ji.BINARY_EXPRESSION:case ji.FUNCTION:case ji.INTERVAL:case ji.INTERVAL_QUALIFIER:Ji[e.type].forEach((n=>{this.traverse(e[n])}))}}}const Nu={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},yu={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ABORT","ABSOLUTE","ACTION","ADA","ADD","AFTER","ALL","ALLOCATE","ALTER","ALWAYS","ANALYZE","AND","ANY","ARE","AS","ASC","ASSERTION","AT","ATTACH","AUTHORIZATION","AUTOINCREMENT","AVG","BACKUP","BEFORE","BEGIN","BETWEEN","BIT","BIT_LENGTH","BOTH","BREAK","BROWSE","BULK","BY","CASCADE","CASCADED","CASE","CAST","CATALOG","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CHECKPOINT","CLOSE","CLUSTERED","COALESCE","COLLATE","COLLATION","COLUMN","COMMIT","COMPUTE","CONFLICT","CONNECT","CONNECTION","CONSTRAINT","CONSTRAINTS","CONTAINS","CONTAINSTABLE","CONTINUE","CONVERT","CORRESPONDING","COUNT","CREATE","CROSS","CURRENT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURSOR","DATABASE","DATE","DAY","DBCC","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFERRABLE","DEFERRED","DELETE","DENY","DESC","DESCRIBE","DESCRIPTOR","DETACH","DIAGNOSTICS","DISCONNECT","DISK","DISTINCT","DISTRIBUTED","DO","DOMAIN","DOUBLE","DROP","DUMP","EACH","ELSE","END","END-EXEC","ERRLVL","ESCAPE","EXCEPT","EXCEPTION","EXCLUDE","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXPLAIN","EXTERNAL","EXTRACT","FAIL","FALSE","FETCH","FILE","FILLFACTOR","FILTER","FIRST","FLOAT","FOLLOWING","FOR","FOREIGN","FORTRAN","FOUND","FREETEXT","FREETEXTTABLE","FROM","FULL","FUNCTION","GENERATED","GET","GLOB","GLOBAL","GO","GOTO","GRANT","GROUP","GROUPS","HAVING","HOLDLOCK","HOUR","IDENTITY","IDENTITYCOL","IDENTITY_INSERT","IF","IGNORE","IMMEDIATE","IN","INCLUDE","INDEX","INDEXED","INDICATOR","INITIALLY","INNER","INPUT","INSENSITIVE","INSERT","INSTEAD","INT","INTEGER","INTERSECT","INTERVAL","INTO","IS","ISNULL","ISOLATION","JOIN","KEY","KILL","LANGUAGE","LAST","LEADING","LEFT","LEVEL","LIKE","LIMIT","LINENO","LOAD","LOCAL","LOWER","MATCH","MATERIALIZED","MAX","MERGE","MIN","MINUTE","MODULE","MONTH","NAMES","NATIONAL","NATURAL","NCHAR","NEXT","NO","NOCHECK","NONCLUSTERED","NONE","NOT","NOTHING","NOTNULL","NULL","NULLIF","NULLS","NUMERIC","OCTET_LENGTH","OF","OFF","OFFSET","OFFSETS","ON","ONLY","OPEN","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","OPTION","OR","ORDER","OTHERS","OUTER","OUTPUT","OVER","OVERLAPS","PAD","PARTIAL","PARTITION","PASCAL","PERCENT","PIVOT","PLAN","POSITION","PRAGMA","PRECEDING","PRECISION","PREPARE","PRESERVE","PRIMARY","PRINT","PRIOR","PRIVILEGES","PROC","PROCEDURE","PUBLIC","QUERY","RAISE","RAISERROR","RANGE","READ","READTEXT","REAL","RECONFIGURE","RECURSIVE","REFERENCES","REGEXP","REINDEX","RELATIVE","RELEASE","RENAME","REPLACE","REPLICATION","RESTORE","RESTRICT","RETURN","RETURNING","REVERT","REVOKE","RIGHT","ROLLBACK","ROW","ROWCOUNT","ROWGUIDCOL","ROWS","RULE","SAVE","SAVEPOINT","SCHEMA","SCROLL","SECOND","SECTION","SECURITYAUDIT","SELECT","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","SESSION","SESSION_USER","SET","SETUSER","SHUTDOWN","SIZE","SMALLINT","SOME","SPACE","SQL","SQLCA","SQLCODE","SQLERROR","SQLSTATE","SQLWARNING","STATISTICS","SUBSTRING","SUM","SYSTEM_USER","TABLE","TABLESAMPLE","TEMP","TEMPORARY","TEXTSIZE","THEN","TIES","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TOP","TRAILING","TRAN","TRANSACTION","TRANSLATE","TRANSLATION","TRIGGER","TRIM","TRUE","TRUNCATE","TRY_CONVERT","TSEQUAL","UNBOUNDED","UNION","UNIQUE","UNKNOWN","UNPIVOT","UPDATE","UPDATETEXT","UPPER","USAGE","USE","USER","USING","VACUUM","VALUE","VALUES","VARCHAR","VARYING","VIEW","VIRTUAL","WAITFOR","WHEN","WHENEVER","WHERE","WHILE","WINDOW","WITH","WITHIN GROUP","WITHOUT","WORK","WRITE","WRITETEXT","YEAR","ZONE"],operators:["ALL","AND","ANY","BETWEEN","EXISTS","IN","LIKE","NOT","OR","SOME","EXCEPT","INTERSECT","UNION","APPLY","CROSS","FULL","INNER","JOIN","LEFT","OUTER","RIGHT","CONTAINS","FREETEXT","IS","NULL","PIVOT","UNPIVOT","MATCHED"],builtinFunctions:["AVG","CHECKSUM_AGG","COUNT","COUNT_BIG","GROUPING","GROUPING_ID","MAX","MIN","SUM","STDEV","STDEVP","VAR","VARP","CUME_DIST","FIRST_VALUE","LAG","LAST_VALUE","LEAD","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","COLLATE","COLLATIONPROPERTY","TERTIARY_WEIGHTS","FEDERATION_FILTERING_VALUE","CAST","CONVERT","PARSE","TRY_CAST","TRY_CONVERT","TRY_PARSE","ASYMKEY_ID","ASYMKEYPROPERTY","CERTPROPERTY","CERT_ID","CRYPT_GEN_RANDOM","DECRYPTBYASYMKEY","DECRYPTBYCERT","DECRYPTBYKEY","DECRYPTBYKEYAUTOASYMKEY","DECRYPTBYKEYAUTOCERT","DECRYPTBYPASSPHRASE","ENCRYPTBYASYMKEY","ENCRYPTBYCERT","ENCRYPTBYKEY","ENCRYPTBYPASSPHRASE","HASHBYTES","IS_OBJECTSIGNED","KEY_GUID","KEY_ID","KEY_NAME","SIGNBYASYMKEY","SIGNBYCERT","SYMKEYPROPERTY","VERIFYSIGNEDBYCERT","VERIFYSIGNEDBYASYMKEY","CURSOR_STATUS","DATALENGTH","IDENT_CURRENT","IDENT_INCR","IDENT_SEED","IDENTITY","SQL_VARIANT_PROPERTY","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","DATEFROMPARTS","DATENAME","DATEPART","DATETIME2FROMPARTS","DATETIMEFROMPARTS","DATETIMEOFFSETFROMPARTS","DAY","EOMONTH","GETDATE","GETUTCDATE","ISDATE","MONTH","SMALLDATETIMEFROMPARTS","SWITCHOFFSET","SYSDATETIME","SYSDATETIMEOFFSET","SYSUTCDATETIME","TIMEFROMPARTS","TODATETIMEOFFSET","YEAR","CHOOSE","COALESCE","IIF","NULLIF","ABS","ACOS","ASIN","ATAN","ATN2","CEILING","COS","COT","DEGREES","EXP","FLOOR","LOG","LOG10","PI","POWER","RADIANS","RAND","ROUND","SIGN","SIN","SQRT","SQUARE","TAN","APP_NAME","APPLOCK_MODE","APPLOCK_TEST","ASSEMBLYPROPERTY","COL_LENGTH","COL_NAME","COLUMNPROPERTY","DATABASE_PRINCIPAL_ID","DATABASEPROPERTYEX","DB_ID","DB_NAME","FILE_ID","FILE_IDEX","FILE_NAME","FILEGROUP_ID","FILEGROUP_NAME","FILEGROUPPROPERTY","FILEPROPERTY","FULLTEXTCATALOGPROPERTY","FULLTEXTSERVICEPROPERTY","INDEX_COL","INDEXKEY_PROPERTY","INDEXPROPERTY","OBJECT_DEFINITION","OBJECT_ID","OBJECT_NAME","OBJECT_SCHEMA_NAME","OBJECTPROPERTY","OBJECTPROPERTYEX","ORIGINAL_DB_NAME","PARSENAME","SCHEMA_ID","SCHEMA_NAME","SCOPE_IDENTITY","SERVERPROPERTY","STATS_DATE","TYPE_ID","TYPE_NAME","TYPEPROPERTY","DENSE_RANK","NTILE","RANK","ROW_NUMBER","PUBLISHINGSERVERNAME","OPENDATASOURCE","OPENQUERY","OPENROWSET","OPENXML","CERTENCODED","CERTPRIVATEKEY","CURRENT_USER","HAS_DBACCESS","HAS_PERMS_BY_NAME","IS_MEMBER","IS_ROLEMEMBER","IS_SRVROLEMEMBER","LOGINPROPERTY","ORIGINAL_LOGIN","PERMISSIONS","PWDENCRYPT","PWDCOMPARE","SESSION_USER","SESSIONPROPERTY","SUSER_ID","SUSER_NAME","SUSER_SID","SUSER_SNAME","SYSTEM_USER","USER","USER_ID","USER_NAME","ASCII","CHAR","CHARINDEX","CONCAT","DIFFERENCE","FORMAT","LEFT","LEN","LOWER","LTRIM","NCHAR","PATINDEX","QUOTENAME","REPLACE","REPLICATE","REVERSE","RIGHT","RTRIM","SOUNDEX","SPACE","STR","STUFF","SUBSTRING","UNICODE","UPPER","BINARY_CHECKSUM","CHECKSUM","CONNECTIONPROPERTY","CONTEXT_INFO","CURRENT_REQUEST_ID","ERROR_LINE","ERROR_NUMBER","ERROR_MESSAGE","ERROR_PROCEDURE","ERROR_SEVERITY","ERROR_STATE","FORMATMESSAGE","GETANSINULL","GET_FILESTREAM_TRANSACTION_CONTEXT","HOST_ID","HOST_NAME","ISNULL","ISNUMERIC","MIN_ACTIVE_ROWVERSION","NEWID","NEWSEQUENTIALID","ROWCOUNT_BIG","XACT_STATE","TEXTPTR","TEXTVALID","COLUMNS_UPDATED","EVENTDATA","TRIGGER_NESTLEVEL","UPDATE","CHANGETABLE","CHANGE_TRACKING_CONTEXT","CHANGE_TRACKING_CURRENT_VERSION","CHANGE_TRACKING_IS_COLUMN_IN_MASK","CHANGE_TRACKING_MIN_VALID_VERSION","CONTAINSTABLE","FREETEXTTABLE","SEMANTICKEYPHRASETABLE","SEMANTICSIMILARITYDETAILSTABLE","SEMANTICSIMILARITYTABLE","FILETABLEROOTPATH","GETFILENAMESPACEPATH","GETPATHLOCATOR","PATHNAME","GET_TRANSMISSION_STATUS"],builtinVariables:["@@DATEFIRST","@@DBTS","@@LANGID","@@LANGUAGE","@@LOCK_TIMEOUT","@@MAX_CONNECTIONS","@@MAX_PRECISION","@@NESTLEVEL","@@OPTIONS","@@REMSERVER","@@SERVERNAME","@@SERVICENAME","@@SPID","@@TEXTSIZE","@@VERSION","@@CURSOR_ROWS","@@FETCH_STATUS","@@DATEFIRST","@@PROCID","@@ERROR","@@IDENTITY","@@ROWCOUNT","@@TRANCOUNT","@@CONNECTIONS","@@CPU_BUSY","@@IDLE","@@IO_BUSY","@@PACKET_ERRORS","@@PACK_RECEIVED","@@PACK_SENT","@@TIMETICKS","@@TOTAL_ERRORS","@@TOTAL_READ","@@TOTAL_WRITE"],pseudoColumns:["$ACTION","$IDENTITY","$ROWGUID","$PARTITION"],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/\[/,{token:"identifier.quote",next:"@bracketedIdentifier"}],[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],bracketedIdentifier:[[/[^\]]+/,"identifier"],[/]]/,"identifier"],[/]/,{token:"identifier.quote",next:"@pop"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i,"keyword"],[/BEGIN\s+TRY\b/i,{token:"keyword.try"}],[/END\s+TRY\b/i,{token:"keyword.try"}],[/BEGIN\s+CATCH\b/i,{token:"keyword.catch"}],[/END\s+CATCH\b/i,{token:"keyword.catch"}],[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}};let Ru;async function Su(...e){return await new Promise(((n,t)=>{Ru?n(Ru(...e)):t(new Error("sql expression worker not registered!"))}))}function Iu(t){const u=new i(t);Ru=async(...e)=>await u.getLanguageServiceWorker(...e),n.setMonarchTokensProvider(r.languageId,yu),n.setLanguageConfiguration(r.languageId,Nu);const s=new Fi(r);n.registerCompletionItemProvider(r.languageId,s);const o=e.getEditors();o.length&&gu(o[0].getModel(),r),e.onDidCreateModel((e=>{gu(e,r)}))}function gu(n,t){const r=n.onDidChangeContent((()=>{n.getLanguageId()===t.languageId&&async function(n,t){if(!n)return;const r=t.getFeatureLayerForModel(n.uri.toString());if(r)try{const i=await t.getApiLibrary(n.uri.toString()),u=new pu(r,i);u.validateModel(n.getValue()),e.setModelMarkers(n,"arcgis-sql-expression",u.markers)}catch(e){console.log("error validating sql expression",e)}}(n,t)}));n.onWillDispose((()=>{r.dispose()}))}export{Su as getSqlExprWorker,Iu as setupMode}