@redocly/reference-docs 2.1.15 → 2.1.19

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 (165) hide show
  1. package/bin/cli/commands/redocly-docs-cli.min.js +28 -28
  2. package/dist/console.redocly-reference-docs.min.js +3 -3
  3. package/dist/oauth2-redirect.js +2 -2
  4. package/dist/redocly-reference-docs.min.js +11 -11
  5. package/lib/components/Endpoint/Endpoint.d.ts +2 -2
  6. package/lib/components/Endpoint/Endpoint.js +1 -1
  7. package/lib/components/Endpoint/ServerList.d.ts +2 -2
  8. package/lib/components/Endpoint/ServerList.js +1 -1
  9. package/lib/components/Endpoint/Summary.d.ts +2 -2
  10. package/lib/components/Endpoint/Summary.js +1 -1
  11. package/lib/components/NextSectionButton.js +1 -1
  12. package/lib/components/Overlay.js +1 -1
  13. package/lib/components/Panel/Accordion.js +1 -1
  14. package/lib/components/Panel/PanelBody.d.ts +1 -1
  15. package/lib/components/Panel/PanelBody.js +1 -1
  16. package/lib/components/Panel/PanelComponent.d.ts +2 -3
  17. package/lib/components/Panel/PanelComponent.js +1 -1
  18. package/lib/components/Panel/ResponsePanel.js +1 -1
  19. package/lib/components/ProProviders.js +1 -1
  20. package/lib/components/RedoclyReferenceDocs.d.ts +3 -3
  21. package/lib/components/RedoclyReferenceDocs.js +1 -1
  22. package/lib/components/Samples/ExampleSwitch.d.ts +1 -1
  23. package/lib/components/Samples/ExampleSwitch.js +1 -1
  24. package/lib/components/Samples/SamplesTabs.js +1 -1
  25. package/lib/components/Search/MenuItemProSearch.d.ts +4 -4
  26. package/lib/components/Search/ProSearchBox.d.ts +6 -6
  27. package/lib/components/Search/ProSearchBox.js +1 -1
  28. package/lib/components/Search/SearchField.js +1 -1
  29. package/lib/components/Search/styled.d.ts +3 -3
  30. package/lib/components/StoreProvider.d.ts +4 -4
  31. package/lib/components/StoreProvider.js +1 -1
  32. package/lib/components/Tabs/CollapsingTabs/CollapsingTabs.js +1 -1
  33. package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
  34. package/lib/components/common/Checkbox.js +1 -1
  35. package/lib/components/common/FileUpload/helper.d.ts +1 -1
  36. package/lib/components/common/FileUpload/helper.js +1 -1
  37. package/lib/components/common/TextField.d.ts +3 -3
  38. package/lib/components/common/TextField.js +1 -1
  39. package/lib/components/console/OperationParameters.d.ts +1 -1
  40. package/lib/components/console/OperationParameters.js +1 -1
  41. package/lib/components/console/RequestBody.js +1 -1
  42. package/lib/components/console/ResponsePanel.d.ts +1 -1
  43. package/lib/components/console/ResponsePanel.js +1 -1
  44. package/lib/components/console/ServerDropdown.d.ts +1 -1
  45. package/lib/components/console/ServerDropdown.js +1 -1
  46. package/lib/redoc-lib/src/common-elements/LinkToField.d.ts +3 -2
  47. package/lib/redoc-lib/src/common-elements/LinkToField.js +1 -1
  48. package/lib/redoc-lib/src/components/ApiLogo/ApiLogo.js +1 -1
  49. package/lib/redoc-lib/src/components/ApiLogo/styled.elements.d.ts +5 -2
  50. package/lib/redoc-lib/src/components/ApiLogo/styled.elements.js +1 -1
  51. package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
  52. package/lib/redoc-lib/src/components/ResponseSamples/ResponseSamples.js +1 -1
  53. package/lib/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
  54. package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  55. package/lib/redoc-lib/src/services/models/Example.js +1 -1
  56. package/lib/redoc-lib/src/services/models/Field.d.ts +1 -1
  57. package/lib/redoc-lib/src/services/models/Operation.d.ts +1 -1
  58. package/lib/redoc-lib/src/services/models/Operation.js +1 -1
  59. package/lib/redoc-lib/src/services/models/Schema.d.ts +1 -1
  60. package/lib/redoc-lib/src/services/models/Schema.js +1 -1
  61. package/lib/redoc-lib/src/theme.d.ts +1 -0
  62. package/lib/redoc-lib/src/utils/JsonPointer.d.ts +5 -5
  63. package/lib/redoc-lib/src/utils/JsonPointer.js +1 -1
  64. package/lib/redoc-lib/src/utils/loadAndBundleSpec.js +1 -1
  65. package/lib/redoc-lib/src/utils/memoize.js +1 -1
  66. package/lib/redoc-lib/src/utils/openapi.d.ts +0 -2
  67. package/lib/services/ProMenu.d.ts +2 -5
  68. package/lib/services/ProStore.d.ts +3 -2
  69. package/lib/services/ProStore.js +1 -1
  70. package/lib/services/code-samples/generator.d.ts +1 -1
  71. package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +1 -1
  72. package/lib/services/code-samples/httpsnippet/helpers/reducer.d.ts +1 -1
  73. package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.d.ts +1 -1
  74. package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
  75. package/lib/services/code-samples/httpsnippet/targets/php/utils.d.ts +1 -1
  76. package/lib/services/code-samples/httpsnippet/targets/php/utils.js +1 -1
  77. package/lib/services/extendTheme.d.ts +4 -4
  78. package/lib/services/extendTheme.js +1 -1
  79. package/lib/services/history/ProHashHistoryService.d.ts +1 -1
  80. package/lib/services/history/PushStateHistoryService.d.ts +1 -1
  81. package/lib/services/utils.d.ts +1 -1
  82. package/lib/standalone.d.ts +4 -3
  83. package/lib/standalone.js +1 -1
  84. package/lib/utils.d.ts +1 -1
  85. package/lib-esm/components/Endpoint/Endpoint.d.ts +2 -2
  86. package/lib-esm/components/Endpoint/Endpoint.js +1 -1
  87. package/lib-esm/components/Endpoint/ServerList.d.ts +2 -2
  88. package/lib-esm/components/Endpoint/ServerList.js +1 -1
  89. package/lib-esm/components/Endpoint/Summary.d.ts +2 -2
  90. package/lib-esm/components/Endpoint/Summary.js +1 -1
  91. package/lib-esm/components/NextSectionButton.js +1 -1
  92. package/lib-esm/components/Overlay.js +1 -1
  93. package/lib-esm/components/Panel/Accordion.js +1 -1
  94. package/lib-esm/components/Panel/PanelBody.d.ts +1 -1
  95. package/lib-esm/components/Panel/PanelBody.js +1 -1
  96. package/lib-esm/components/Panel/PanelComponent.d.ts +2 -3
  97. package/lib-esm/components/Panel/PanelComponent.js +1 -1
  98. package/lib-esm/components/Panel/ResponsePanel.js +1 -1
  99. package/lib-esm/components/ProProviders.js +1 -1
  100. package/lib-esm/components/RedoclyReferenceDocs.d.ts +3 -3
  101. package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
  102. package/lib-esm/components/Samples/ExampleSwitch.d.ts +1 -1
  103. package/lib-esm/components/Samples/ExampleSwitch.js +1 -1
  104. package/lib-esm/components/Samples/SamplesTabs.js +1 -1
  105. package/lib-esm/components/Search/MenuItemProSearch.d.ts +4 -4
  106. package/lib-esm/components/Search/ProSearchBox.d.ts +6 -6
  107. package/lib-esm/components/Search/ProSearchBox.js +1 -1
  108. package/lib-esm/components/Search/SearchField.js +1 -1
  109. package/lib-esm/components/Search/styled.d.ts +3 -3
  110. package/lib-esm/components/StoreProvider.d.ts +4 -4
  111. package/lib-esm/components/StoreProvider.js +1 -1
  112. package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabs.js +1 -1
  113. package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
  114. package/lib-esm/components/common/Checkbox.js +1 -1
  115. package/lib-esm/components/common/FileUpload/helper.d.ts +1 -1
  116. package/lib-esm/components/common/FileUpload/helper.js +1 -1
  117. package/lib-esm/components/common/TextField.d.ts +3 -3
  118. package/lib-esm/components/common/TextField.js +1 -1
  119. package/lib-esm/components/console/OperationParameters.d.ts +1 -1
  120. package/lib-esm/components/console/OperationParameters.js +1 -1
  121. package/lib-esm/components/console/RequestBody.js +1 -1
  122. package/lib-esm/components/console/ResponsePanel.d.ts +1 -1
  123. package/lib-esm/components/console/ResponsePanel.js +1 -1
  124. package/lib-esm/components/console/ServerDropdown.d.ts +1 -1
  125. package/lib-esm/components/console/ServerDropdown.js +1 -1
  126. package/lib-esm/redoc-lib/src/common-elements/LinkToField.d.ts +3 -2
  127. package/lib-esm/redoc-lib/src/common-elements/LinkToField.js +1 -1
  128. package/lib-esm/redoc-lib/src/components/ApiLogo/ApiLogo.js +1 -1
  129. package/lib-esm/redoc-lib/src/components/ApiLogo/styled.elements.d.ts +5 -2
  130. package/lib-esm/redoc-lib/src/components/ApiLogo/styled.elements.js +1 -1
  131. package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
  132. package/lib-esm/redoc-lib/src/components/ResponseSamples/ResponseSamples.js +1 -1
  133. package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
  134. package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  135. package/lib-esm/redoc-lib/src/services/models/Example.js +1 -1
  136. package/lib-esm/redoc-lib/src/services/models/Field.d.ts +1 -1
  137. package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +1 -1
  138. package/lib-esm/redoc-lib/src/services/models/Operation.js +1 -1
  139. package/lib-esm/redoc-lib/src/services/models/Schema.d.ts +1 -1
  140. package/lib-esm/redoc-lib/src/services/models/Schema.js +1 -1
  141. package/lib-esm/redoc-lib/src/theme.d.ts +1 -0
  142. package/lib-esm/redoc-lib/src/utils/JsonPointer.d.ts +5 -5
  143. package/lib-esm/redoc-lib/src/utils/JsonPointer.js +1 -1
  144. package/lib-esm/redoc-lib/src/utils/loadAndBundleSpec.js +1 -1
  145. package/lib-esm/redoc-lib/src/utils/memoize.js +1 -1
  146. package/lib-esm/redoc-lib/src/utils/openapi.d.ts +0 -2
  147. package/lib-esm/services/ProMenu.d.ts +2 -5
  148. package/lib-esm/services/ProStore.d.ts +3 -2
  149. package/lib-esm/services/ProStore.js +1 -1
  150. package/lib-esm/services/code-samples/generator.d.ts +1 -1
  151. package/lib-esm/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +1 -1
  152. package/lib-esm/services/code-samples/httpsnippet/helpers/reducer.d.ts +1 -1
  153. package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.d.ts +1 -1
  154. package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
  155. package/lib-esm/services/code-samples/httpsnippet/targets/php/utils.d.ts +1 -1
  156. package/lib-esm/services/code-samples/httpsnippet/targets/php/utils.js +1 -1
  157. package/lib-esm/services/extendTheme.d.ts +4 -4
  158. package/lib-esm/services/extendTheme.js +1 -1
  159. package/lib-esm/services/history/ProHashHistoryService.d.ts +1 -1
  160. package/lib-esm/services/history/PushStateHistoryService.d.ts +1 -1
  161. package/lib-esm/services/utils.d.ts +1 -1
  162. package/lib-esm/standalone.d.ts +4 -3
  163. package/lib-esm/standalone.js +1 -1
  164. package/lib-esm/utils.d.ts +1 -1
  165. package/package.json +2 -2
@@ -2,15 +2,15 @@
2
2
  * Redocly Reference Docs
3
3
  * (c) Copyright 2018 Redocly LLC, all rights reserved.
4
4
  * -------------------------------------------------------------
5
- * Version: "2.1.15"
5
+ * Version: "2.1.19"
6
6
  */
7
- (this.webpackJsonpRedoclyReferenceDocs=this.webpackJsonpRedoclyReferenceDocs||[]).push([[0],Array(564).concat([function(e,t,r){"use strict";r.r(t),r.d(t,"Console",(function(){return Nl}));var n={};r.r(n),r.d(n,"JsonPatchError",(function(){return pa})),r.d(n,"deepClone",(function(){return da})),r.d(n,"getValueByPointer",(function(){return ma})),r.d(n,"applyOperation",(function(){return ga})),r.d(n,"applyPatch",(function(){return ya})),r.d(n,"applyReducer",(function(){return ba})),r.d(n,"validator",(function(){return xa})),r.d(n,"validate",(function(){return wa})),r.d(n,"_areEquals",(function(){return Ca}));var o={};r.r(o),r.d(o,"unobserve",(function(){return Sa})),r.d(o,"observe",(function(){return Ea})),r.d(o,"generate",(function(){return ja})),r.d(o,"compare",(function(){return Ma}));var i={};r.r(i),r.d(i,"path",(function(){return vl})),r.d(i,"query",(function(){return ml})),r.d(i,"header",(function(){return yl})),r.d(i,"cookie",(function(){return bl}));var a=r(1),s=r(0),l=r.n(s),c=r(591),u=r(9),f=r(19),p=r(99),d=r(177),h=r(4),v=r(150),m=r(3),g=Object(m.d)(A||(A=Object(a.f)(["\n border: none;\n outline: none;\n padding: 8px;\n border-radius: ",";\n background-color: ",";\n ","\n\n &::placeholder {\n opacity: 0.6;\n color: ",";\n }\n\n &:-webkit-autofill {\n background-color: ",";\n }\n"],["\n border: none;\n outline: none;\n padding: 8px;\n border-radius: ",";\n background-color: ",";\n ","\n\n &::placeholder {\n opacity: 0.6;\n color: ",";\n }\n\n &:-webkit-autofill {\n background-color: ",";\n }\n"])),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.rightPanel.panelControlsBackgroundColor}),(function(e){var t=e.theme;return Object(m.h)({color:t.colors.text.light,fontFamily:t.typography.code.fontFamily,fontSize:t.typography.fontSize})}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.rightPanel.panelBackgroundColor})),y=m.e.div(O||(O=Object(a.f)(["\n display: ",";\n ","\n"],["\n display: ",";\n ","\n"])),(function(e){return"hidden"===e.type?"none":"inline-block"}),(function(e){return e.fullWidth?"width: 100%;":""})),b=m.e.div(S||(S=Object(a.f)(["\n position: relative;\n"],["\n position: relative;\n"]))),x=m.e.input(E||(E=Object(a.f)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"])),g,(function(e){return"password"===e.inputType?"padding-right: 40px;":""}),(function(e){return e.fullWidth?"width: 100%;":""})),w=m.e.span(j||(j=Object(a.f)(["\n position: absolute;\n right: 0;\n line-height: normal;\n\n font-size: 0.8em;\n padding: calc(8px / 0.8);\n cursor: pointer;\n text-align: center;\n ","\n"],["\n position: absolute;\n right: 0;\n line-height: normal;\n\n font-size: 0.8em;\n padding: calc(8px / 0.8);\n cursor: pointer;\n text-align: center;\n ","\n"])),(function(e){var t=e.theme;return Object(m.h)({color:t.rightPanel.textColor})})),C=l.a.forwardRef((function(e,t){var r=e.fullWidth,n=e.errorMessage,o=l.a.useState("password"===e.type),i=o[0],s=o[1],c=l.a.useCallback((function(){s(!i)}),[i]);return l.a.createElement(y,{fullWidth:r,type:e.type},l.a.createElement(b,null,l.a.createElement(x,Object(a.a)({},e,{type:i?"password":"text",inputType:e.type,ref:t})),"password"===e.type&&l.a.createElement(w,{onClick:c}," ",i?"show":"hide"," ")),n?l.a.createElement(v.b,null,n):null)}));function k(e){var t=Object(c.c)(Object(a.a)({fieldType:"text"},e)),r=t.userProps,n=t.render,o=t.fieldState,i=t.informed;return n(l.a.createElement(C,Object(a.a)({},r,i,{errorMessage:o.error})))}var A,O,S,E,j,T=Object(c.b)((function(e){var t=e.initValue,r=e.options,n=e.fieldApi,o=e.fieldState,i=r.map((function(e,t){return{value:e.title||e.value,idx:t,origValue:e.value}})),a=i.find((function(e){return e.origValue===t})),s=l.a.useState(null==a?void 0:a.value),c=s[0],u=s[1];l.a.useEffect((function(){t&&n.setValue(t)}),[]);var f=l.a.useCallback((function(e){n.setValue(i[e.idx].origValue),u(i[e.idx].value)}),[i]);return l.a.createElement(y,{fullWidth:!0},l.a.createElement(h.f,{fullWidth:!0,variant:"dark",value:c,options:i,onChange:f}),o.error?l.a.createElement(v.b,null,o.error):null)}));function M(e){var t=e.name,r=e.value,n=e.description,o=e.variableEnum,i=e.onChange,a=e.defaultValue,l=o?o.map((function(e,t){return{value:e,idx:t}})):[];return s.createElement(v.a,null,s.createElement(v.d,null,t,":"),l&&l.length?s.createElement(h.f,{fullWidth:!0,variant:"dark",openUp:!0,value:r,options:l,onChange:function(e){return i(e.value)}}):s.createElement(C,{fullWidth:!0,value:r,onChange:function(e){return i(e.target.value)},placeholder:a}),n&&s.createElement(I,null,n))}var P,L,I=h.mb.small(P||(P=Object(a.f)(["\n display: inline-block;\n margin-top: 5px;\n color: #d0d0d0;\n"],["\n display: inline-block;\n margin-top: 5px;\n color: #d0d0d0;\n"]))),F=h.mb.div(L||(L=Object(a.f)(["\n margin-top: 20px;\n"],["\n margin-top: 20px;\n"]))),_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{activeIdx:0,variables:{}}}),Object.defineProperty(t,"handleChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var r=t.props.operation.servers.find((function(t){return t.url===e.serverUrl})),n=r&&V(r)||{};t.props.onChange({url:e.serverUrl,variables:n}),Object(f.p)("serverUrl",e.serverUrl),t.setState({variables:n})}}),Object.defineProperty(t,"handleVariableChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e,r){var n,o,i=Object(a.a)(Object(a.a)({},t.state.variables),((n={})[e]=r,n));t.setState({variables:i});var s=Object(f.e)("variables"),l=s&&JSON.parse(s)||{};Object(f.p)("variables",JSON.stringify(Object(a.a)(Object(a.a)({},l),((o={})[e]=r,o))));var c=t.props.operation.servers[t.state.activeIdx];t.props.onChange(Object(a.a)(Object(a.a)({},c),{variables:i}))}}),t}return Object(a.d)(t,e),Object.defineProperty(t,"getDerivedStateFromProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.operation,r=Object(f.e)("serverUrl"),n=t.servers.findIndex((function(e){return e.url===r}));return{activeIdx:n<0?0:n}}}),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props.operation.servers[this.state.activeIdx],t=V(e);this.props.onChange(Object(a.a)(Object(a.a)({},e),{variables:t})),this.setState({variables:t})}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.state.activeIdx,r=this.props.operation.servers.map((function(t){return{serverUrl:t.url,value:"\n "+D(R(t.url,e.state.variables),t.variables)+"\n - "+(t.description||"Default")+"\n "}})),n=Object.keys(this.state.variables);return s.createElement(F,null,s.createElement(v.d,{htmlFor:"server"},"Target server: "),s.createElement(v.a,null,s.createElement(h.f,{openUp:!0,variant:"dark",value:r[t].value,options:r,onChange:this.handleChange})),n.length?n.map((function(t){var r=e.props.operation.servers[e.state.activeIdx].variables[t];return s.createElement(M,{key:t,name:t,value:e.state.variables[t],defaultValue:r.default,onChange:function(r){return e.handleVariableChange(t,r)},variableEnum:r.enum,description:r.description})})):null)}}),t=Object(a.c)([u.a],t)}(s.Component),N=/(?:{)(\w+)(?:})/g;function R(e,t){return void 0===t&&(t={}),e.replace(N,(function(e,r){return t[r]||e}))}function D(e,t){return void 0===t&&(t={}),e.replace(N,(function(e,r){return t[r]&&t[r].default||e}))}function V(e){if(!e.variables)return{};var t=Object(f.e)("variables"),r=t&&JSON.parse(t)||{},n={};return Object.keys(e.variables).forEach((function(t){n[t]=e.variables[t].default||"",r.hasOwnProperty(t)&&(n[t]=r[t])})),Object(a.a)({},n)}var B,U=Object(c.b)((function(e){var t=e.initValue,r=e.paramEnum,n=e.fieldApi,o=s.useState(t),i=o[0],a=o[1],l=r.map((function(e,t){return{id:String(t),value:e}}));return s.useEffect((function(){t&&n.setValue(t)}),[]),s.createElement(h.f,{fullWidth:!0,variant:"dark",value:i,options:l,onChange:function(e){n.setValue(e.value),a(e.value)}})}));!function(e){e.ARRAY="array",e.OBJECT="object"}(B||(B={}));var z=function(e){return"("+e.schema.type+")"+(e.example?" "+e.example:"")};var W=["path","query","cookie","header"];function H(e){function t(t,r){var n=s.useMemo((function(){return function(e){return function(t){if(e.required&&!t)return"Field is required";if(e.required&&e.schema.type===B.ARRAY&&Array.isArray(t)){if(t.length>(e.schema.rawSchema&&e.schema.rawSchema.maxItems||1/0))return"Too many items selected, maximum "+e.schema.rawSchema.maxItems;if(t.length<(e.schema.rawSchema&&e.schema.rawSchema.minItems||0)){var r=e.schema.rawSchema.minItems;return"You should select at least "+(1===r?r+" item":r+" items")}}}}(r)}),[r]),o=e.values,i=Array.isArray(r.schema.enum)&&r.schema.enum.length?r.schema.enum:void 0,a=function(e){if(e.schema.type===B.ARRAY){var t=e.schema.default||e.schema.example;if(!t&&e.schema.rawSchema.items){if(e.schema.rawSchema.items.default)return[e.schema.rawSchema.items.default];if(e.schema.rawSchema.items.example)return[e.schema.rawSchema.items.example]}return t||[]}return e.schema.default||e.schema.example}(r);return i?s.createElement(v.a,null,s.createElement(U,{initValue:a,paramEnum:i,field:t})):s.createElement(k,{fullWidth:!0,"data-cy":"parameter-input",id:t,field:t,placeholder:z(r),validate:n,initialValue:a||Object(f.f)(o,t),validateOnBlur:!0,validateOnChange:!0})}function r(e,n,o){var i,l,c,u,p,d=o?Object(f.b)(o,e.name):e.name,h=(i=e.schema,l=i.oneOfType,c=i.type,u=i.items,l||c===B.ARRAY&&(null==u?void 0:u.type)===B.OBJECT&&"Array of objects");if(h&&console.warn('Unsupported parameter definition: "'+h+'"'),e.schema.type===B.OBJECT)return null===(p=e.schema.fields)||void 0===p?void 0:p.map((function(e){return r(e,n,d)}));var m=o?[n,o]:[e.in],g=f.b.apply(void 0,Object(a.h)(Object(a.h)([],m,!1),[e.name],!1));return s.createElement(v.a,{key:g},s.createElement(v.d,{required:e.required},d,":"),h?s.createElement(v.e,null,"Unsupported field schema definition"):t(g,e))}var n,o,i=e.operation,l=(n=i.parameters||[],o={},n.forEach((function(e){var t,r,n;t=o,r=e.in,n=e,t[r]||(t[r]=[]),t[r].push(n)})),o);return s.createElement(v.h,null,W.map((function(e){return function(e,t){return t&&t.length?s.createElement(s.Fragment,{key:e},s.createElement(v.a,null,s.createElement(v.g,null," # ",e," parameters "),s.createElement("span",null," ")),t.map((function(t){return r(t,e)}))):null}(e,l[e])})))}var q=r(15),G=r(215),$=r(26);function K(e,t,r){var n=t.path||{},o=t.query||{},i=Object.keys(o),a=R(e,n);return i.length&&(a+="?"+i.map((function(e){if(!o[e])return"";var t=function(e){return r.find((function(t){return t.name===e&&"query"===t.in}))}(e);return t?Object(h.lb)(t,o[e]):e+"="+encodeURIComponent(o[e])})).filter(Boolean).join("&")),a}var J,Y,X,Q,Z,ee,te,re,ne,oe,ie,ae=function(e){var t=e.loading,r=e.operation,n=e.hasResponse,o=e.execute,i=e.params,a=void 0===i?{}:i;return s.createElement(le,null,s.createElement(G.b,null,s.createElement($.c,{type:r.httpVerb},r.httpVerb),s.createElement(G.a,{wrap:"true"},K(r.path,a,r.parameters))),s.createElement(se,{"data-cy":"send-button",color:"primary",blinking:t,onClick:function(){t||o()}},t?"Sending...":n?"Resend":"Send"))},se=Object(h.mb)($.a)(J||(J=Object(a.f)(["\n width: ",";\n"],["\n width: ",";\n"])),(function(e){return e.theme.components.tryItSendButton.fullWidth?"100%":"auto"})),le=Object(h.mb)(q.c)(Y||(Y=Object(a.f)(["\n ",";\n"],["\n ",";\n"])),(function(e){return e.theme.components.tryItSendButton.fullWidth?"\n flex-direction: column;\n align-items: flex-start;":""})),ce=r(8),ue=h.mb.div(X||(X=Object(a.f)(["\n margin-bottom: 10px;\n"],["\n margin-bottom: 10px;\n"]))),fe=h.mb.div(Q||(Q=Object(a.f)(["\n display: inline-block;\n margin-right: 20px;\n padding: 2px 0;\n text-align: center;\n color: ",";\n"],["\n display: inline-block;\n margin-right: 20px;\n padding: 2px 0;\n text-align: center;\n color: ",";\n"])),(function(e){return e.theme.colors.text.light})),pe=Object(h.mb)(fe)(Z||(Z=Object(a.f)(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){var t=e.theme,r=e.code;return r>=200&&r<300?t.colors.responses.success.tabTextColor:r>=300&&r<400?t.colors.responses.redirect.tabTextColor:r>400?t.colors.responses.error.tabTextColor:t.colors.responses.info.tabTextColor})),de=h.mb.strong(ee||(ee=Object(a.f)(["\n text-transform: capitalize;\n display: inline-block;\n padding-right: 5px;\n"],["\n text-transform: capitalize;\n display: inline-block;\n padding-right: 5px;\n"]))),he=h.mb.header(te||(te=Object(a.f)(["\n font-weight: bold;\n margin-bottom: 10px;\n"],["\n font-weight: bold;\n margin-bottom: 10px;\n"]))),ve=h.mb.code(re||(re=Object(a.f)(["\n border-left: 3px solid #ff4040;\n padding-left: 5px;\n"],["\n border-left: 3px solid #ff4040;\n padding-left: 5px;\n"]))),me=h.mb.div(ne||(ne=Object(a.f)(["\n margin-bottom: 10px;\n\n &:not(:first-child) {\n margin-top: 10px;\n }\n"],["\n margin-bottom: 10px;\n\n &:not(:first-child) {\n margin-top: 10px;\n }\n"]))),ge=Object(h.mb)(ce.t)(oe||(oe=Object(a.f)(["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n"],["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n"]))),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this.props,r=t.error,n=t.response,o=t.time,i=n||r&&r.response,a=i&&i.data&&i.data.length||0;if(e=a>1e6?(a/1e6).toFixed(2)+" MB":a>1e3?(a/1e3).toFixed(2)+" KB":a+" B",r&&!r.response||!i)return s.createElement(s.Fragment,null,s.createElement(he,null," Could not get any response "),s.createElement(ve,null,r&&r.message||"Unknown error"),s.createElement("br",null),s.createElement(he,null," Why this might have happened:"),s.createElement("div",null," - CORS is misconfigured on the server"),s.createElement("div",null," - The server couldn't sent a response"),s.createElement("div",null," - No internet access"),s.createElement("div",null," - Documentation issue - contact API owner"),s.createElement("div",null," - Misconfigured security definition"));if(!i)return"Something went wrong";var l=Object.keys(i.headers);return s.createElement(s.Fragment,null,s.createElement(ue,null,s.createElement(pe,{code:i.status},s.createElement("span",null," Status: "),i.status," ",i.statusText),s.createElement(fe,null,s.createElement("span",null," Time: "),o,"ms"),s.createElement(fe,null,s.createElement("span",null," Size: "),e)),s.createElement("div",null,s.createElement(me,null," Headers: "),s.createElement(ge,null,l.map((function(e){return s.createElement("div",{key:e},s.createElement(de,null,e,":"),s.createElement("code",null," ",i.headers[e]))}))),s.createElement(me,null," Body: "),i.body&&s.createElement(h.o,{data:i.body})||null,!i.body&&null!=i.data&&(i.data?s.createElement(h.T,{lang:Object(h.gb)(i.headers["Content-Type"]||"text/plain"),source:i.data}):s.createElement(ge,null,s.createElement("i",null,"(no content)")))||null))}}),t}(s.PureComponent),be=r(77),xe=r.n(be),we=r(777),Ce=r(589);function ke(e,t){void 0===t&&(t=!1);var r=e.length,n=0,o="",i=0,a=16,s=0,l=0,c=0,u=0,f=0;function p(t,r){for(var o=0,i=0;o<t||!r;){var a=e.charCodeAt(n);if(a>=48&&a<=57)i=16*i+a-48;else if(a>=65&&a<=70)i=16*i+a-65+10;else{if(!(a>=97&&a<=102))break;i=16*i+a-97+10}n++,o++}return o<t&&(i=-1),i}function d(){if(o="",f=0,i=n,l=s,u=c,n>=r)return i=r,a=17;var t=e.charCodeAt(n);if(Ae(t)){do{n++,o+=String.fromCharCode(t),t=e.charCodeAt(n)}while(Ae(t));return a=15}if(Oe(t))return n++,o+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,o+="\n"),s++,c=n,a=14;switch(t){case 123:return n++,a=1;case 125:return n++,a=2;case 91:return n++,a=3;case 93:return n++,a=4;case 58:return n++,a=6;case 44:return n++,a=5;case 34:return n++,o=function(){for(var t="",o=n;;){if(n>=r){t+=e.substring(o,n),f=2;break}var i=e.charCodeAt(n);if(34===i){t+=e.substring(o,n),n++;break}if(92!==i){if(i>=0&&i<=31){if(Oe(i)){t+=e.substring(o,n),f=2;break}f=6}n++}else{if(t+=e.substring(o,n),++n>=r){f=2;break}switch(e.charCodeAt(n++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var a=p(4,!0);a>=0?t+=String.fromCharCode(a):f=4;break;default:f=5}o=n}}return t}(),a=10;case 47:var d=n-1;if(47===e.charCodeAt(n+1)){for(n+=2;n<r&&!Oe(e.charCodeAt(n));)n++;return o=e.substring(d,n),a=12}if(42===e.charCodeAt(n+1)){n+=2;for(var v=r-1,m=!1;n<v;){var g=e.charCodeAt(n);if(42===g&&47===e.charCodeAt(n+1)){n+=2,m=!0;break}n++,Oe(g)&&(13===g&&10===e.charCodeAt(n)&&n++,s++,c=n)}return m||(n++,f=1),o=e.substring(d,n),a=13}return o+=String.fromCharCode(t),n++,a=16;case 45:if(o+=String.fromCharCode(t),++n===r||!Se(e.charCodeAt(n)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=function(){var t=n;if(48===e.charCodeAt(n))n++;else for(n++;n<e.length&&Se(e.charCodeAt(n));)n++;if(n<e.length&&46===e.charCodeAt(n)){if(!(++n<e.length&&Se(e.charCodeAt(n))))return f=3,e.substring(t,n);for(n++;n<e.length&&Se(e.charCodeAt(n));)n++}var r=n;if(n<e.length&&(69===e.charCodeAt(n)||101===e.charCodeAt(n)))if((++n<e.length&&43===e.charCodeAt(n)||45===e.charCodeAt(n))&&n++,n<e.length&&Se(e.charCodeAt(n))){for(n++;n<e.length&&Se(e.charCodeAt(n));)n++;r=n}else f=3;return e.substring(t,r)}(),a=11;default:for(;n<r&&h(t);)n++,t=e.charCodeAt(n);if(i!==n){switch(o=e.substring(i,n)){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return o+=String.fromCharCode(t),n++,a=16}}function h(e){if(Ae(e)||Oe(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}return{setPosition:function(e){n=e,o="",i=0,a=16,f=0},getPosition:function(){return n},scan:t?function(){var e;do{e=d()}while(e>=12&&e<=15);return e}:d,getToken:function(){return a},getTokenValue:function(){return o},getTokenOffset:function(){return i},getTokenLength:function(){return n-i},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return i-u},getTokenError:function(){return f}}}function Ae(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function Oe(e){return 10===e||13===e||8232===e||8233===e}function Se(e){return e>=48&&e<=57}function Ee(e,t,r){var n,o,i,a,s;if(t){for(a=t.offset,s=a+t.length,i=a;i>0&&!Te(e,i-1);)i--;for(var l=s;l<e.length&&!Te(e,l);)l++;o=e.substring(i,l),n=function(e,t){var r=0,n=0,o=t.tabSize||4;for(;r<e.length;){var i=e.charAt(r);if(" "===i)n++;else{if("\t"!==i)break;n+=o}r++}return Math.floor(n/o)}(o,r)}else o=e,n=0,i=0,a=0,s=e.length;var c,u=function(e,t){for(var r=0;r<t.length;r++){var n=t.charAt(r);if("\r"===n)return r+1<t.length&&"\n"===t.charAt(r+1)?"\r\n":"\r";if("\n"===n)return"\n"}return e&&e.eol||"\n"}(r,e),f=!1,p=0;c=r.insertSpaces?je(" ",r.tabSize||4):"\t";var d=ke(o,!1),h=!1;function v(){return u+je(c,n+p)}function m(){var e=d.scan();for(f=!1;15===e||14===e;)f=f||14===e,e=d.scan();return h=16===e||0!==d.getTokenError(),e}var g=[];function y(t,r,n){!h&&r<s&&n>a&&e.substring(r,n)!==t&&g.push({offset:r,length:n-r,content:t})}var b=m();if(17!==b){var x=d.getTokenOffset()+i;y(je(c,n),i,x)}for(;17!==b;){for(var w=d.getTokenOffset()+d.getTokenLength()+i,C=m(),k="";!f&&(12===C||13===C);){y(" ",w,d.getTokenOffset()+i),w=d.getTokenOffset()+d.getTokenLength()+i,k=12===C?v():"",C=m()}if(2===C)1!==b&&(p--,k=v());else if(4===C)3!==b&&(p--,k=v());else{switch(b){case 3:case 1:p++,k=v();break;case 5:case 12:k=v();break;case 13:k=f?v():" ";break;case 6:k=" ";break;case 10:if(6===C){k="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===C||13===C?k=" ":5!==C&&17!==C&&(h=!0);break;case 16:h=!0}!f||12!==C&&13!==C||(k=v())}y(k,w,d.getTokenOffset()+i),b=C}return g}function je(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function Te(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}function Me(e,t,r){void 0===r&&(r=ie.DEFAULT);var n=ke(e,!1);function o(e){return e?function(){return e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function i(e){return e?function(t){return e(t,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var a=o(t.onObjectBegin),s=i(t.onObjectProperty),l=o(t.onObjectEnd),c=o(t.onArrayBegin),u=o(t.onArrayEnd),f=i(t.onLiteralValue),p=i(t.onSeparator),d=o(t.onComment),h=i(t.onError),v=r&&r.disallowComments,m=r&&r.allowTrailingComma;function g(){for(;;){var e=n.scan();switch(n.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:v||y(11);break;case 2:y(12);break;case 6:y(16)}switch(e){case 12:case 13:v?y(10):d();break;case 16:y(1);break;case 15:case 14:break;default:return e}}}function y(e,t,r){if(void 0===t&&(t=[]),void 0===r&&(r=[]),h(e),t.length+r.length>0)for(var o=n.getToken();17!==o;){if(-1!==t.indexOf(o)){g();break}if(-1!==r.indexOf(o))break;o=g()}}function b(e){var t=n.getTokenValue();return e?f(t):s(t),g(),!0}function x(){switch(n.getToken()){case 3:return function(){c(),g();for(var e=!1;4!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||y(4,[],[]),p(","),g(),4===n.getToken()&&m)break}else e&&y(6,[],[]);x()||y(4,[],[4,5]),e=!0}return u(),4!==n.getToken()?y(8,[4],[]):g(),!0}();case 1:return function(){a(),g();for(var e=!1;2!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||y(4,[],[]),p(","),g(),2===n.getToken()&&m)break}else e&&y(6,[],[]);(10!==n.getToken()?(y(3,[],[2,5]),0):(b(!1),6===n.getToken()?(p(":"),g(),x()||y(4,[],[2,5])):y(5,[],[2,5]),1))||y(4,[],[2,5]),e=!0}return l(),2!==n.getToken()?y(7,[2],[]):g(),!0}();case 10:return b(!0);default:return function(){switch(n.getToken()){case 11:var e=n.getTokenValue(),t=Number(e);isNaN(t)&&(y(2),t=0),f(t);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return g(),!0}()}}return g(),17===n.getToken()?!!r.allowEmptyContent||(y(4,[],[]),!1):x()?(17!==n.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1)}!function(e){e.DEFAULT={allowTrailingComma:!1}}(ie||(ie={}));var Pe,Le,Ie,Fe,_e,Ne,Re,De,Ve,Be,Ue,ze,We,He,qe,Ge,$e,Ke,Je,Ye,Xe,Qe,Ze,et,tt,rt,nt=ke,ot=function(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=ie.DEFAULT);var n=null,o=[],i=[];function a(e){Array.isArray(o)?o.push(e):null!==n&&(o[n]=e)}return Me(e,{onObjectBegin:function(){var e={};a(e),i.push(o),o=e,n=null},onObjectProperty:function(e){n=e},onObjectEnd:function(){o=i.pop()},onArrayBegin:function(){var e=[];a(e),i.push(o),o=e,n=null},onArrayEnd:function(){o=i.pop()},onLiteralValue:a,onError:function(e,r,n){t.push({error:e,offset:r,length:n})}},r),o[0]},it=function e(t,r,n){if(void 0===n&&(n=!1),function(e,t,r){return void 0===r&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}(t,r,n)){var o=t.children;if(Array.isArray(o))for(var i=0;i<o.length&&o[i].offset<=r;i++){var a=e(o[i],r,n);if(a)return a}return t}},at=function e(t){if(!t.parent||!t.parent.children)return[];var r=e(t.parent);if("property"===t.parent.type){var n=t.parent.children[0].value;r.push(n)}else if("array"===t.parent.type){var o=t.parent.children.indexOf(t);-1!==o&&r.push(o)}return r},st=function e(t){switch(t.type){case"array":return t.children.map(e);case"object":for(var r=Object.create(null),n=0,o=t.children;n<o.length;n++){var i=o[n],a=i.children[1];a&&(r[i.children[0].value]=e(a))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}};function lt(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var r,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!lt(e[r],t[r]))return!1}else{var o=[];for(n in e)o.push(n);o.sort();var i=[];for(n in t)i.push(n);if(i.sort(),!lt(o,i))return!1;for(r=0;r<o.length;r++)if(!lt(e[o[r]],t[o[r]]))return!1}return!0}function ct(e){return"number"==typeof e}function ut(e){return void 0!==e}function ft(e){return"boolean"==typeof e}!function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647}(Pe||(Pe={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(Le||(Le={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=Le.MAX_VALUE),t===Number.MAX_VALUE&&(t=Le.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return qt.objectLiteral(t)&&qt.uinteger(t.line)&&qt.uinteger(t.character)}}(Ie||(Ie={})),function(e){e.create=function(e,t,r,n){if(qt.uinteger(e)&&qt.uinteger(t)&&qt.uinteger(r)&&qt.uinteger(n))return{start:Ie.create(e,t),end:Ie.create(r,n)};if(Ie.is(e)&&Ie.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+r+", "+n+"]")},e.is=function(e){var t=e;return qt.objectLiteral(t)&&Ie.is(t.start)&&Ie.is(t.end)}}(Fe||(Fe={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.range)&&(qt.string(t.uri)||qt.undefined(t.uri))}}(_e||(_e={})),function(e){e.create=function(e,t,r,n){return{targetUri:e,targetRange:t,targetSelectionRange:r,originSelectionRange:n}},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.targetRange)&&qt.string(t.targetUri)&&(Fe.is(t.targetSelectionRange)||qt.undefined(t.targetSelectionRange))&&(Fe.is(t.originSelectionRange)||qt.undefined(t.originSelectionRange))}}(Ne||(Ne={})),function(e){e.create=function(e,t,r,n){return{red:e,green:t,blue:r,alpha:n}},e.is=function(e){var t=e;return qt.numberRange(t.red,0,1)&&qt.numberRange(t.green,0,1)&&qt.numberRange(t.blue,0,1)&&qt.numberRange(t.alpha,0,1)}}(Re||(Re={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Fe.is(t.range)&&Re.is(t.color)}}(De||(De={})),function(e){e.create=function(e,t,r){return{label:e,textEdit:t,additionalTextEdits:r}},e.is=function(e){var t=e;return qt.string(t.label)&&(qt.undefined(t.textEdit)||Ke.is(t))&&(qt.undefined(t.additionalTextEdits)||qt.typedArray(t.additionalTextEdits,Ke.is))}}(Ve||(Ve={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(Be||(Be={})),function(e){e.create=function(e,t,r,n,o){var i={startLine:e,endLine:t};return qt.defined(r)&&(i.startCharacter=r),qt.defined(n)&&(i.endCharacter=n),qt.defined(o)&&(i.kind=o),i},e.is=function(e){var t=e;return qt.uinteger(t.startLine)&&qt.uinteger(t.startLine)&&(qt.undefined(t.startCharacter)||qt.uinteger(t.startCharacter))&&(qt.undefined(t.endCharacter)||qt.uinteger(t.endCharacter))&&(qt.undefined(t.kind)||qt.string(t.kind))}}(Ue||(Ue={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return qt.defined(t)&&_e.is(t.location)&&qt.string(t.message)}}(ze||(ze={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(We||(We={})),function(e){e.Unnecessary=1,e.Deprecated=2}(He||(He={})),function(e){e.is=function(e){var t=e;return null!=t&&qt.string(t.href)}}(qe||(qe={})),function(e){e.create=function(e,t,r,n,o,i){var a={range:e,message:t};return qt.defined(r)&&(a.severity=r),qt.defined(n)&&(a.code=n),qt.defined(o)&&(a.source=o),qt.defined(i)&&(a.relatedInformation=i),a},e.is=function(e){var t,r=e;return qt.defined(r)&&Fe.is(r.range)&&qt.string(r.message)&&(qt.number(r.severity)||qt.undefined(r.severity))&&(qt.integer(r.code)||qt.string(r.code)||qt.undefined(r.code))&&(qt.undefined(r.codeDescription)||qt.string(null===(t=r.codeDescription)||void 0===t?void 0:t.href))&&(qt.string(r.source)||qt.undefined(r.source))&&(qt.undefined(r.relatedInformation)||qt.typedArray(r.relatedInformation,ze.is))}}(Ge||(Ge={})),function(e){e.create=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o={title:e,command:t};return qt.defined(r)&&r.length>0&&(o.arguments=r),o},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.title)&&qt.string(t.command)}}($e||($e={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return qt.objectLiteral(t)&&qt.string(t.newText)&&Fe.is(t.range)}}(Ke||(Ke={})),function(e){e.create=function(e,t,r){var n={label:e};return void 0!==t&&(n.needsConfirmation=t),void 0!==r&&(n.description=r),n},e.is=function(e){var t=e;return void 0!==t&&qt.objectLiteral(t)&&qt.string(t.label)&&(qt.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(qt.string(t.description)||void 0===t.description)}}(Je||(Je={})),function(e){e.is=function(e){return"string"==typeof e}}(Ye||(Ye={})),function(e){e.replace=function(e,t,r){return{range:e,newText:t,annotationId:r}},e.insert=function(e,t,r){return{range:{start:e,end:e},newText:t,annotationId:r}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return Ke.is(t)&&(Je.is(t.annotationId)||Ye.is(t.annotationId))}}(Xe||(Xe={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return qt.defined(t)&&ht.is(t.textDocument)&&Array.isArray(t.edits)}}(Qe||(Qe={})),function(e){e.create=function(e,t,r){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),void 0!==r&&(n.annotationId=r),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&qt.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||qt.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||qt.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Ye.is(t.annotationId))}}(Ze||(Ze={})),function(e){e.create=function(e,t,r,n){var o={kind:"rename",oldUri:e,newUri:t};return void 0===r||void 0===r.overwrite&&void 0===r.ignoreIfExists||(o.options=r),void 0!==n&&(o.annotationId=n),o},e.is=function(e){var t=e;return t&&"rename"===t.kind&&qt.string(t.oldUri)&&qt.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||qt.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||qt.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Ye.is(t.annotationId))}}(et||(et={})),function(e){e.create=function(e,t,r){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),void 0!==r&&(n.annotationId=r),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&qt.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||qt.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||qt.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||Ye.is(t.annotationId))}}(tt||(tt={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return qt.string(e.kind)?Ze.is(e)||et.is(e)||tt.is(e):Qe.is(e)})))}}(rt||(rt={}));var pt,dt,ht,vt,mt,gt,yt,bt,xt,wt,Ct,kt,At,Ot,St,Et,jt,Tt,Mt,Pt,Lt,It,Ft,_t,Nt,Rt,Dt,Vt,Bt,Ut,zt=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,r){var n,o;if(void 0===r?n=Ke.insert(e,t):Ye.is(r)?(o=r,n=Xe.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),n=Xe.insert(e,t,o)),this.edits.push(n),void 0!==o)return o},e.prototype.replace=function(e,t,r){var n,o;if(void 0===r?n=Ke.replace(e,t):Ye.is(r)?(o=r,n=Xe.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),n=Xe.replace(e,t,o)),this.edits.push(n),void 0!==o)return o},e.prototype.delete=function(e,t){var r,n;if(void 0===t?r=Ke.del(e):Ye.is(t)?(n=t,r=Xe.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=Xe.del(e,n)),this.edits.push(r),void 0!==n)return n},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),Wt=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var r;if(Ye.is(e)?r=e:(r=this.nextId(),t=e),void 0!==this._annotations[r])throw new Error("Id "+r+" is already in use.");if(void 0===t)throw new Error("No annotation provided for id "+r);return this._annotations[r]=t,this._size++,r},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Wt(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(Qe.is(e)){var r=new zt(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=r}}))):e.changes&&Object.keys(e.changes).forEach((function(r){var n=new zt(e.changes[r]);t._textEditChanges[r]=n}))):this._workspaceEdit={}}Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(ht.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(n=this._textEditChanges[t.uri])){var r={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(r),n=new zt(o,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var n;if(!(n=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,n=new zt(o),this._textEditChanges[e]=n}return n},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new Wt,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n,o,i;if(Je.is(t)||Ye.is(t)?n=t:r=t,void 0===n?o=Ze.create(e,r):(i=Ye.is(n)?n:this._changeAnnotations.manage(n),o=Ze.create(e,r,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i},e.prototype.renameFile=function(e,t,r,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var o,i,a;if(Je.is(r)||Ye.is(r)?o=r:n=r,void 0===o?i=et.create(e,t,n):(a=Ye.is(o)?o:this._changeAnnotations.manage(o),i=et.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(i),void 0!==a)return a},e.prototype.deleteFile=function(e,t,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n,o,i;if(Je.is(t)||Ye.is(t)?n=t:r=t,void 0===n?o=tt.create(e,r):(i=Ye.is(n)?n:this._changeAnnotations.manage(n),o=tt.create(e,r,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i}}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)}}(pt||(pt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)&&qt.integer(t.version)}}(dt||(dt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)&&(null===t.version||qt.integer(t.version))}}(ht||(ht={})),function(e){e.create=function(e,t,r,n){return{uri:e,languageId:t,version:r,text:n}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)&&qt.string(t.languageId)&&qt.integer(t.version)&&qt.string(t.text)}}(vt||(vt={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(mt||(mt={})),function(e){e.is=function(t){var r=t;return r===e.PlainText||r===e.Markdown}}(mt||(mt={})),function(e){e.is=function(e){var t=e;return qt.objectLiteral(e)&&mt.is(t.kind)&&qt.string(t.value)}}(gt||(gt={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(yt||(yt={})),function(e){e.PlainText=1,e.Snippet=2}(bt||(bt={})),function(e){e.Deprecated=1}(xt||(xt={})),function(e){e.create=function(e,t,r){return{newText:e,insert:t,replace:r}},e.is=function(e){var t=e;return t&&qt.string(t.newText)&&Fe.is(t.insert)&&Fe.is(t.replace)}}(wt||(wt={})),function(e){e.asIs=1,e.adjustIndentation=2}(Ct||(Ct={})),function(e){e.create=function(e){return{label:e}}}(kt||(kt={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(At||(At={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return qt.string(t)||qt.objectLiteral(t)&&qt.string(t.language)&&qt.string(t.value)}}(Ot||(Ot={})),function(e){e.is=function(e){var t=e;return!!t&&qt.objectLiteral(t)&&(gt.is(t.contents)||Ot.is(t.contents)||qt.typedArray(t.contents,Ot.is))&&(void 0===e.range||Fe.is(e.range))}}(St||(St={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Et||(Et={})),function(e){e.create=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o={label:e};return qt.defined(t)&&(o.documentation=t),qt.defined(r)?o.parameters=r:o.parameters=[],o}}(jt||(jt={})),function(e){e.Text=1,e.Read=2,e.Write=3}(Tt||(Tt={})),function(e){e.create=function(e,t){var r={range:e};return qt.number(t)&&(r.kind=t),r}}(Mt||(Mt={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(Pt||(Pt={})),function(e){e.Deprecated=1}(Lt||(Lt={})),function(e){e.create=function(e,t,r,n,o){var i={name:e,kind:t,location:{uri:n,range:r}};return o&&(i.containerName=o),i}}(It||(It={})),function(e){e.create=function(e,t,r,n,o,i){var a={name:e,detail:t,kind:r,range:n,selectionRange:o};return void 0!==i&&(a.children=i),a},e.is=function(e){var t=e;return t&&qt.string(t.name)&&qt.number(t.kind)&&Fe.is(t.range)&&Fe.is(t.selectionRange)&&(void 0===t.detail||qt.string(t.detail))&&(void 0===t.deprecated||qt.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(Ft||(Ft={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(_t||(_t={})),function(e){e.create=function(e,t){var r={diagnostics:e};return null!=t&&(r.only=t),r},e.is=function(e){var t=e;return qt.defined(t)&&qt.typedArray(t.diagnostics,Ge.is)&&(void 0===t.only||qt.typedArray(t.only,qt.string))}}(Nt||(Nt={})),function(e){e.create=function(e,t,r){var n={title:e},o=!0;return"string"==typeof t?(o=!1,n.kind=t):$e.is(t)?n.command=t:n.edit=t,o&&void 0!==r&&(n.kind=r),n},e.is=function(e){var t=e;return t&&qt.string(t.title)&&(void 0===t.diagnostics||qt.typedArray(t.diagnostics,Ge.is))&&(void 0===t.kind||qt.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||$e.is(t.command))&&(void 0===t.isPreferred||qt.boolean(t.isPreferred))&&(void 0===t.edit||rt.is(t.edit))}}(Rt||(Rt={})),function(e){e.create=function(e,t){var r={range:e};return qt.defined(t)&&(r.data=t),r},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.range)&&(qt.undefined(t.command)||$e.is(t.command))}}(Dt||(Dt={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return qt.defined(t)&&qt.uinteger(t.tabSize)&&qt.boolean(t.insertSpaces)}}(Vt||(Vt={})),function(e){e.create=function(e,t,r){return{range:e,target:t,data:r}},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.range)&&(qt.undefined(t.target)||qt.string(t.target))}}(Bt||(Bt={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var r=t;return void 0!==r&&Fe.is(r.range)&&(void 0===r.parent||e.is(r.parent))}}(Ut||(Ut={}));var Ht;!function(e){e.create=function(e,t,r,n){return new Gt(e,t,r,n)},e.is=function(e){var t=e;return!!(qt.defined(t)&&qt.string(t.uri)&&(qt.undefined(t.languageId)||qt.string(t.languageId))&&qt.uinteger(t.lineCount)&&qt.func(t.getText)&&qt.func(t.positionAt)&&qt.func(t.offsetAt))},e.applyEdits=function(e,t){for(var r=e.getText(),n=function e(t,r){if(t.length<=1)return t;var n=t.length/2|0,o=t.slice(0,n),i=t.slice(n);e(o,r),e(i,r);var a=0,s=0,l=0;for(;a<o.length&&s<i.length;){var c=r(o[a],i[s]);t[l++]=c<=0?o[a++]:i[s++]}for(;a<o.length;)t[l++]=o[a++];for(;s<i.length;)t[l++]=i[s++];return t}(t,(function(e,t){var r=e.range.start.line-t.range.start.line;return 0===r?e.range.start.character-t.range.start.character:r})),o=r.length,i=n.length-1;i>=0;i--){var a=n[i],s=e.offsetAt(a.range.start),l=e.offsetAt(a.range.end);if(!(l<=o))throw new Error("Overlapping edit");r=r.substring(0,s)+a.newText+r.substring(l,r.length),o=s}return r}}(Ht||(Ht={}));var qt,Gt=function(){function e(e,t,r,n){this._uri=e,this._languageId=t,this._version=r,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,r=!0,n=0;n<t.length;n++){r&&(e.push(n),r=!1);var o=t.charAt(n);r="\r"===o||"\n"===o,"\r"===o&&n+1<t.length&&"\n"===t.charAt(n+1)&&n++}r&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,n=t.length;if(0===n)return Ie.create(0,e);for(;r<n;){var o=Math.floor((r+n)/2);t[o]>e?n=o:r=o+1}var i=r-1;return Ie.create(i,e-t[i])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var r=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,n),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,r,n){return"[object Number]"===t.call(e)&&r<=e&&e<=n},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(qt||(qt={}));var $t,Kt,Jt,Yt=function(){function e(e,t,r,n){this._uri=e,this._languageId=t,this._version=r,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content},e.prototype.update=function(t,r){for(var n=0,o=t;n<o.length;n++){var i=o[n];if(e.isIncremental(i)){var a=Qt(i.range),s=this.offsetAt(a.start),l=this.offsetAt(a.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(l,this._content.length);var c=Math.max(a.start.line,0),u=Math.max(a.end.line,0),f=this._lineOffsets,p=Xt(i.text,!1,s);if(u-c===p.length)for(var d=0,h=p.length;d<h;d++)f[d+c+1]=p[d];else p.length<1e4?f.splice.apply(f,[c+1,u-c].concat(p)):this._lineOffsets=f=f.slice(0,c+1).concat(p,f.slice(u+1));var v=i.text.length-(l-s);if(0!==v)for(d=c+1+p.length,h=f.length;d<h;d++)f[d]=f[d]+v}else{if(!e.isFull(i))throw new Error("Unknown change event received");this._content=i.text,this._lineOffsets=void 0}}this._version=r},e.prototype.getLineOffsets=function(){return void 0===this._lineOffsets&&(this._lineOffsets=Xt(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,n=t.length;if(0===n)return{line:0,character:e};for(;r<n;){var o=Math.floor((r+n)/2);t[o]>e?n=o:r=o+1}var i=r-1;return{line:i,character:e-t[i]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var r=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,n),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e.isIncremental=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},e.isFull=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},e}();function Xt(e,t,r){void 0===r&&(r=0);for(var n=t?[r]:[],o=0;o<e.length;o++){var i=e.charCodeAt(o);13!==i&&10!==i||(13===i&&o+1<e.length&&10===e.charCodeAt(o+1)&&o++,n.push(r+o+1))}return n}function Qt(e){var t=e.start,r=e.end;return t.line>r.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}function Zt(e){var t=Qt(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,r,n){return new Yt(e,t,r,n)},e.update=function(e,t,r){if(e instanceof Yt)return e.update(t,r),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var r=e.getText(),n=0,o=[],i=0,a=function e(t,r){if(t.length<=1)return t;var n=t.length/2|0,o=t.slice(0,n),i=t.slice(n);e(o,r),e(i,r);var a=0,s=0,l=0;for(;a<o.length&&s<i.length;){var c=r(o[a],i[s]);t[l++]=c<=0?o[a++]:i[s++]}for(;a<o.length;)t[l++]=o[a++];for(;s<i.length;)t[l++]=i[s++];return t}(t.map(Zt),(function(e,t){var r=e.range.start.line-t.range.start.line;return 0===r?e.range.start.character-t.range.start.character:r}));i<a.length;i++){var s=a[i],l=e.offsetAt(s.range.start);if(l<n)throw new Error("Overlapping edit");l>n&&o.push(r.substring(n,l)),s.newText.length&&o.push(s.newText),n=e.offsetAt(s.range.end)}return o.push(r.substr(n)),o.join("")}}($t||($t={})),function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.SchemaResolveError=768]="SchemaResolveError"}(Kt||(Kt={})),(Jt||(Jt={})).LATEST={textDocument:{completion:{completionItem:{documentationFormat:[mt.Markdown,mt.PlainText],commitCharactersSupport:!0}}}};var er,tr,rr=(er=function(e,t){return(er=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}er(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),nr={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},or=function(){function e(e,t,r){this.offset=t,this.length=r,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),ir=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="null",n.value=null,n}return rr(t,e),t}(or),ar=function(e){function t(t,r,n){var o=e.call(this,t,n)||this;return o.type="boolean",o.value=r,o}return rr(t,e),t}(or),sr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="array",n.items=[],n}return rr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),t}(or),lr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="number",n.isInteger=!0,n.value=Number.NaN,n}return rr(t,e),t}(or),cr=function(e){function t(t,r,n){var o=e.call(this,t,r,n)||this;return o.type="string",o.value="",o}return rr(t,e),t}(or),ur=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="property",n.colonOffset=-1,n}return rr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),t}(or),fr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="object",n.properties=[],n}return rr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),t}(or);function pr(e){return ft(e)?e?{}:{not:{}}:e}!function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"}(tr||(tr={}));var dr=function(){function e(e,t){void 0===e&&(e=-1),void 0===t&&(t=null),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){var t;(t=this.schemas).push.apply(t,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||yr(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),hr=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),vr=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.merge(n)}},e.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},e.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,r=this.problems;t<r.length;t++){var n=r[t];n.code===Kt.EnumValueMismatch&&(n.message="Value is not accepted. Valid values: "+this.enumValues.map((function(e){return JSON.stringify(e)})).join(", ")+".")}}},e.prototype.mergePropertyMatch=function(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&1===e.enumValues.length&&this.primaryValueMatches++},e.prototype.compare=function(e){var t=this.hasProblems();return t!==e.hasProblems()?t?-1:1:this.enumValueMatch!==e.enumValueMatch?e.enumValueMatch?-1:1:this.primaryValueMatches!==e.primaryValueMatches?this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches!==e.propertiesValueMatches?this.propertiesValueMatches-e.propertiesValueMatches:this.propertiesMatches-e.propertiesMatches},e}();function mr(e){return st(e)}function gr(e){return at(e)}function yr(e,t,r){return void 0===r&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}var br=function(){function e(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=[]),this.root=e,this.syntaxErrors=t,this.comments=r}return e.prototype.getNodeFromOffset=function(e,t){if(void 0===t&&(t=!1),this.root)return it(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(r){var n=e(r),o=r.children;if(Array.isArray(o))for(var i=0;i<o.length&&n;i++)n=t(o[i]);return n};t(this.root)}},e.prototype.validate=function(e,t){if(this.root&&t){var r=new vr;return xr(this.root,t,r,hr.instance),r.problems.map((function(t){var r=Fe.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length));return Ge.create(r,t.message,t.severity,t.code)}))}return null},e.prototype.getMatchingSchemas=function(e,t,r){void 0===t&&(t=-1),void 0===r&&(r=null);var n=new dr(t,r);return this.root&&e&&xr(this.root,e,new vr,n),n.schemas},e}();function xr(e,t,r,n){if(e&&n.include(e)){switch(e.type){case"object":!function(e,t,r,n){for(var o=Object.create(null),i=[],a=0,s=e.properties;a<s.length;a++){var l=(y=s[a]).keyNode.value;o[l]=y.valueNode,i.push(l)}if(Array.isArray(t.required))for(var c=0,u=t.required;c<u.length;c++){var f=u[c];if(!o[f]){var p=e.parent&&"property"===e.parent.type&&e.parent.keyNode,d=p?{offset:p.offset,length:p.length}:{offset:e.offset,length:1};r.problems.push({location:d,severity:We.Warning,message:'Missing property "'+f+'".'})}}var h=function(e){for(var t=i.indexOf(e);t>=0;)i.splice(t,1),t=i.indexOf(e)};if(t.properties)for(var v=0,m=Object.keys(t.properties);v<m.length;v++){f=m[v];h(f);var g=t.properties[f];if(M=o[f])if(ft(g))if(g)r.propertiesMatches++,r.propertiesValueMatches++;else{var y=M.parent;r.problems.push({location:{offset:y.keyNode.offset,length:y.keyNode.length},severity:We.Warning,message:t.errorMessage||"Property "+f+" is not allowed."})}else{var b=new vr;xr(M,g,b,n),r.mergePropertyMatch(b)}}if(t.patternProperties)for(var x=0,w=Object.keys(t.patternProperties);x<w.length;x++)for(var C=w[x],k=new RegExp(C),A=0,O=i.slice(0);A<O.length;A++){f=O[A];if(k.test(f))if(h(f),M=o[f])if(ft(g=t.patternProperties[C]))if(g)r.propertiesMatches++,r.propertiesValueMatches++;else{y=M.parent;r.problems.push({location:{offset:y.keyNode.offset,length:y.keyNode.length},severity:We.Warning,message:t.errorMessage||"Property "+f+" is not allowed."})}else{b=new vr;xr(M,g,b,n),r.mergePropertyMatch(b)}}if("object"==typeof t.additionalProperties)for(var S=0,E=i;S<E.length;S++){f=E[S];if(M=o[f]){b=new vr;xr(M,t.additionalProperties,b,n),r.mergePropertyMatch(b)}}else if(!1===t.additionalProperties&&i.length>0)for(var j=0,T=i;j<T.length;j++){var M;f=T[j];if(M=o[f]){y=M.parent;r.problems.push({location:{offset:y.keyNode.offset,length:y.keyNode.length},severity:We.Warning,message:t.errorMessage||"Property "+f+" is not allowed."})}}ct(t.maxProperties)&&e.properties.length>t.maxProperties&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Object has more properties than limit of "+t.maxProperties+"."});ct(t.minProperties)&&e.properties.length<t.minProperties&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Object has fewer properties than the required number of "+t.minProperties});if(t.dependencies)for(var P=0,L=Object.keys(t.dependencies);P<L.length;P++){l=L[P];if(o[l]){var I=t.dependencies[l];if(Array.isArray(I))for(var F=0,_=I;F<_.length;F++){var N=_[F];o[N]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Object is missing property "+N+" required by property {$key}."})}else if(g=pr(I)){b=new vr;xr(e,g,b,n),r.mergePropertyMatch(b)}}}var R=pr(t.propertyNames);if(R)for(var D=0,V=e.properties;D<V.length;D++){var B=V[D];(l=B.keyNode)&&xr(l,R,r,hr.instance)}}(e,t,r,n);break;case"array":!function(e,t,r,n){if(Array.isArray(t.items)){for(var o=t.items,i=0;i<o.length;i++){var a=pr(o[i]),s=new vr;(p=e.items[i])?(xr(p,a,s,n),r.mergePropertyMatch(s)):e.items.length>=o.length&&r.propertiesValueMatches++}if(e.items.length>o.length)if("object"==typeof t.additionalItems)for(var l=o.length;l<e.items.length;l++){s=new vr;xr(e.items[l],t.additionalItems,s,n),r.mergePropertyMatch(s)}else!1===t.additionalItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has too many items according to schema. Expected "+o.length+" or fewer."})}else{var c=pr(t.items);if(c)for(var u=0,f=e.items;u<f.length;u++){var p=f[u];s=new vr;xr(p,c,s,n),r.mergePropertyMatch(s)}}var d=pr(t.contains);if(d){e.items.some((function(e){var t=new vr;return xr(e,d,t,hr.instance),!t.hasProblems()}))||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.errorMessage||"Array does not contain required item."})}ct(t.minItems)&&e.items.length<t.minItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has too few items. Expected "+t.minItems+" or more."});ct(t.maxItems)&&e.items.length>t.maxItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has too many items. Expected "+t.maxItems+" or fewer."});if(!0===t.uniqueItems){var h=mr(e);h.some((function(e,t){return t!==h.lastIndexOf(e)}))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has duplicate items."})}}(e,t,r,n);break;case"string":!function(e,t,r,n){ct(t.minLength)&&e.value.length<t.minLength&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"String is shorter than the minimum length of "+t.minLength+"."});ct(t.maxLength)&&e.value.length>t.maxLength&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"String is longer than the maximum length of "+t.maxLength+"."});if(o=t.pattern,"string"==typeof o){new RegExp(t.pattern).test(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.patternErrorMessage||t.errorMessage||'String does not match the pattern of "'+t.pattern+'".'})}var o;if(t.format)switch(t.format){case"uri":case"uri-reference":var i=void 0;if(e.value){var a=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);a?a[2]||"uri"!==t.format||(i="URI with a scheme is expected."):i="URI is expected."}else i="URI expected.";i&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.patternErrorMessage||t.errorMessage||"String is not a URI: "+i});break;case"color-hex":case"date-time":case"date":case"time":case"email":var s=nr[t.format];e.value&&s.pattern.exec(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.patternErrorMessage||t.errorMessage||s.errorMessage})}}(e,t,r);break;case"number":!function(e,t,r,n){var o=e.value;ct(t.multipleOf)&&o%t.multipleOf!=0&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is not divisible by "+t.multipleOf+"."});function i(e,t){return ct(t)?t:ft(t)&&t?e:void 0}function a(e,t){if(!ft(t)||!t)return e}var s=i(t.minimum,t.exclusiveMinimum);ct(s)&&o<=s&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is below the exclusive minimum of "+s+"."});var l=i(t.maximum,t.exclusiveMaximum);ct(l)&&o>=l&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is above the exclusive maximum of "+l+"."});var c=a(t.minimum,t.exclusiveMinimum);ct(c)&&o<c&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is below the minimum of "+c+"."});var u=a(t.maximum,t.exclusiveMaximum);ct(u)&&o>u&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is above the maximum of "+u+"."})}(e,t,r);break;case"property":return xr(e.valueNode,t,r,n)}!function(){function o(r){return e.type===r||"integer"===r&&"number"===e.type&&e.isInteger||t.nullable&&null===e.value}Array.isArray(t.type)?t.type.some(o)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.errorMessage||"Incorrect type. Expected one of "+t.type.join(", ")+"."}):t.type&&(o(t.type)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.errorMessage||'Incorrect type. Expected "'+t.type+'".'}));if(Array.isArray(t.allOf))for(var i=0,a=t.allOf;i<a.length;i++){var s=a[i];xr(e,pr(s),r,n)}var l=pr(t.not);if(l){var c=new vr,u=n.newSub();xr(e,l,c,u),c.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Matches a schema that is not allowed."});for(var f=0,p=u.schemas;f<p.length;f++){var d=p[f];d.inverted=!d.inverted,n.add(d)}}var h=function(t,o){for(var i=[],a=null,s=0,l=t;s<l.length;s++){var c=pr(l[s]),u=new vr,f=n.newSub();if(xr(e,c,u,f),u.hasProblems()||i.push(c),a)if(o||u.hasProblems()||a.validationResult.hasProblems()){var p=u.compare(a.validationResult);p>0?a={schema:c,validationResult:u,matchingSchemas:f}:0===p&&(a.matchingSchemas.merge(f),a.validationResult.mergeEnumValues(u))}else a.matchingSchemas.merge(f),a.validationResult.propertiesMatches+=u.propertiesMatches,a.validationResult.propertiesValueMatches+=u.propertiesValueMatches;else a={schema:c,validationResult:u,matchingSchemas:f}}return i.length>1&&o&&r.problems.push({location:{offset:e.offset,length:1},severity:We.Warning,message:"Matches multiple schemas when only one must validate."}),null!==a&&(r.merge(a.validationResult),r.propertiesMatches+=a.validationResult.propertiesMatches,r.propertiesValueMatches+=a.validationResult.propertiesValueMatches,n.merge(a.matchingSchemas)),i.length};Array.isArray(t.anyOf)&&h(t.anyOf,!1);Array.isArray(t.oneOf)&&h(t.oneOf,!0);var v=function(t){var o=new vr,i=n.newSub();xr(e,pr(t),o,i),r.merge(o),r.propertiesMatches+=o.propertiesMatches,r.propertiesValueMatches+=o.propertiesValueMatches,n.merge(i)},m=pr(t.if);m&&function(t,r,o){var i=pr(t),a=new vr,s=n.newSub();xr(e,i,a,s),n.merge(s),a.hasProblems()?o&&v(o):r&&v(r)}(m,pr(t.then),pr(t.else));if(Array.isArray(t.enum)){for(var g=mr(e),y=!1,b=0,x=t.enum;b<x.length;b++){var w=x[b];if(lt(g,w)){y=!0;break}}r.enumValues=t.enum,r.enumValueMatch=y,y||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,code:Kt.EnumValueMismatch,message:t.errorMessage||"Value is not accepted. Valid values: "+t.enum.map((function(e){return JSON.stringify(e)})).join(", ")+"."})}if(ut(t.const)){lt(g=mr(e),t.const)?r.enumValueMatch=!0:(r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,code:Kt.EnumValueMismatch,message:t.errorMessage||"Value must be "+JSON.stringify(t.const)+"."}),r.enumValueMatch=!1),r.enumValues=[t.const]}t.deprecationMessage&&e.parent&&r.problems.push({location:{offset:e.parent.offset,length:e.parent.length},severity:We.Warning,message:t.deprecationMessage})}(),n.add({node:e,schema:t})}}function wr(e,t){var r=[],n=-1,o=e.getText(),i=nt(o,!1),a=t&&t.collectComments?[]:void 0;function s(){for(;;){var t=i.scan();switch(u(),t){case 12:case 13:Array.isArray(a)&&a.push(Fe.create(e.positionAt(i.getTokenOffset()),e.positionAt(i.getTokenOffset()+i.getTokenLength())));break;case 15:case 14:break;default:return t}}}function l(t,o,i,a,s){if(void 0===s&&(s=We.Error),0===r.length||i!==n){var l=Fe.create(e.positionAt(i),e.positionAt(a));r.push(Ge.create(l,t,s,o,e.languageId)),n=i}}function c(e,t,r,n,a){void 0===r&&(r=null),void 0===n&&(n=[]),void 0===a&&(a=[]);var c=i.getTokenOffset(),u=i.getTokenOffset()+i.getTokenLength();if(c===u&&c>0){for(c--;c>0&&/\s/.test(o.charAt(c));)c--;u=c+1}if(l(e,t,c,u),r&&f(r,!1),n.length+a.length>0)for(var p=i.getToken();17!==p;){if(-1!==n.indexOf(p)){s();break}if(-1!==a.indexOf(p))break;p=s()}return r}function u(){switch(i.getTokenError()){case 4:return c("Invalid unicode sequence in string.",Kt.InvalidUnicode),!0;case 5:return c("Invalid escape character in string.",Kt.InvalidEscapeCharacter),!0;case 3:return c("Unexpected end of number.",Kt.UnexpectedEndOfNumber),!0;case 1:return c("Unexpected end of comment.",Kt.UnexpectedEndOfComment),!0;case 2:return c("Unexpected end of string.",Kt.UnexpectedEndOfString),!0;case 6:return c("Invalid characters in string. Control characters must be escaped.",Kt.InvalidCharacter),!0}return!1}function f(e,t){return e.length=i.getTokenOffset()+i.getTokenLength()-e.offset,t&&s(),e}function p(t,r){var n=new ur(t,i.getTokenOffset()),o=d(n);if(!o){if(16!==i.getToken())return null;c("Property keys must be doublequoted",Kt.Undefined);var a=new cr(n,i.getTokenOffset(),i.getTokenLength());a.value=i.getTokenValue(),o=a,s()}n.keyNode=o;var u=r[o.value];if(u?(l("Duplicate object key",Kt.DuplicateKey,n.keyNode.offset,n.keyNode.offset+n.keyNode.length,We.Warning),"object"==typeof u&&l("DuplicateKeyWarning",Kt.DuplicateKey,u.keyNode.offset,u.keyNode.offset+u.keyNode.length,We.Warning),r[o.value]=!0):r[o.value]=n,6===i.getToken())n.colonOffset=i.getTokenOffset(),s();else if(c("Colon expected",Kt.ColonExpected),10===i.getToken()&&e.positionAt(o.offset+o.length).line<e.positionAt(i.getTokenOffset()).line)return n.length=o.length,n;var f=h(n,o.value);return f?(n.valueNode=f,n.length=f.offset+f.length-n.offset,n):c("Value expected",Kt.ValueExpected,n,[],[2,5])}function d(e){if(10!==i.getToken())return null;var t=new cr(e,i.getTokenOffset());return t.value=i.getTokenValue(),f(t,!0)}function h(e,t){return function(e){if(3!==i.getToken())return null;var t=new sr(e,i.getTokenOffset());s();for(var r=0,n=!1;4!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){n||c("Value expected",Kt.ValueExpected);var o=i.getTokenOffset();if(s(),4===i.getToken()){n&&l("Trailing comma",Kt.TrailingComma,o,o+1);continue}}else n&&c("Expected comma",Kt.CommaExpected);var a=h(t,r++);a?t.items.push(a):c("Value expected",Kt.ValueExpected,null,[],[4,5]),n=!0}return 4!==i.getToken()?c("Expected comma or closing bracket",Kt.CommaOrCloseBacketExpected,t):f(t,!0)}(e)||function(e){if(1!==i.getToken())return null;var t=new fr(e,i.getTokenOffset()),r=Object.create(null);s();for(var n=!1;2!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){n||c("Property expected",Kt.PropertyExpected);var o=i.getTokenOffset();if(s(),2===i.getToken()){n&&l("Trailing comma",Kt.TrailingComma,o,o+1);continue}}else n&&c("Expected comma",Kt.CommaExpected);var a=p(t,r);a?t.properties.push(a):c("Property expected",Kt.PropertyExpected,null,[],[2,5]),n=!0}return 2!==i.getToken()?c("Expected comma or closing brace",Kt.CommaOrCloseBraceExpected,t):f(t,!0)}(e)||d(e)||function(e){if(11!==i.getToken())return null;var t=new lr(e,i.getTokenOffset());if(0===i.getTokenError()){var r=i.getTokenValue();try{var n=JSON.parse(r);if(!ct(n))return c("Invalid number format.",Kt.Undefined,t);t.value=n}catch(e){return c("Invalid number format.",Kt.Undefined,t)}t.isInteger=-1===r.indexOf(".")}return f(t,!0)}(e)||function(e){switch(i.getToken()){case 7:return f(new ir(e,i.getTokenOffset()),!0);case 8:return f(new ar(e,!0,i.getTokenOffset()),!0);case 9:return f(new ar(e,!1,i.getTokenOffset()),!0);default:return null}}(e)}var v=null;return 17!==s()&&((v=h(null))?17!==i.getToken()&&c("End of file expected.",Kt.Undefined):c("Expected a JSON object, array or literal.",Kt.Undefined)),new br(v,r,a)}function Cr(e,t){var r=e.length-t.length;return r>0?e.lastIndexOf(t)===r:0===r&&e===t}var kr=[",","}","]"],Ar=[":"],Or=function(){function e(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=Promise),void 0===n&&(n={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=r,this.clientCapabilities=n,this.templateVarIdCounter=0}return e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--)if(this.contributions[t].resolveCompletion){var r=this.contributions[t].resolveCompletion(e);if(r)return r}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,r){var n=this,o={items:[],isIncomplete:!1},i=e.getText(),a=e.offsetAt(t),s=r.getNodeFromOffset(a,!0);if(this.isInComment(e,s?s.offset:0,a))return Promise.resolve(o);if(s&&a===s.offset+s.length&&a>0){var l=i[a-1];("object"===s.type&&"}"===l||"array"===s.type&&"]"===l)&&(s=s.parent)}var c=this.getCurrentWord(e,a),u=null;if(!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type){var f=a-c.length;f>0&&'"'===i[f-1]&&f--,u=Fe.create(e.positionAt(f),t)}else u=Fe.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length));var p=this.doesSupportsCommitCharacters(),d={},h={add:function(e){var t=d[e.label];t?t.documentation||(t.documentation=e.documentation):(d[e.label]=e,u&&(e.textEdit=Ke.replace(u,e.insertText)),p&&(e.commitCharacters=e.kind===yt.Property?Ar:kr),o.items.push(e))},setAsIncomplete:function(){o.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return o.items.length}};return this.schemaService.getSchemaForResource(e.uri,r).then((function(t){var l=[],f=!0,p="",v=null;if(s&&"string"===s.type){var m=s.parent;m&&"property"===m.type&&m.keyNode===s&&(f=!m.valueNode,v=m,p=i.substr(s.offset+1,s.length-2),m&&(s=m.parent))}if(s&&"object"===s.type){if(s.offset===a)return o;s.properties.forEach((function(e){v&&v===e||(d[e.keyNode.value]=kt.create("__"))}));var g="";f&&(g=n.evaluateSeparatorAfter(e,e.offsetAt(u.end))),t?n.getPropertyCompletions(t,r,s,f,g,h):n.getSchemaLessPropertyCompletions(r,s,p,h);var y=gr(s);n.contributions.forEach((function(t){var r=t.collectPropertyCompletions(e.uri,y,c,f,""===g,h);r&&l.push(r)})),!t&&c.length>0&&'"'!==i.charAt(a-c.length-1)&&(h.add({kind:yt.Property,label:n.getLabelForValue(c),insertText:n.getInsertTextForProperty(c,null,!1,g),insertTextFormat:bt.Snippet,documentation:""}),h.setAsIncomplete())}var b={};return t?n.getValueCompletions(t,r,s,a,e,h,b):n.getSchemaLessValueCompletions(r,s,a,e,h),n.contributions.length>0&&n.getContributedValueCompletions(r,s,a,e,h,l),n.promiseConstructor.all(l).then((function(){if(0===h.getNumberOfProposals()){var t=a;!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type||(t=s.offset+s.length);var r=n.evaluateSeparatorAfter(e,t);n.addFillerValueCompletions(b,r,h)}return o}))}))},e.prototype.getPropertyCompletions=function(e,t,r,n,o,i){var a=this;t.getMatchingSchemas(e.schema,r.offset).forEach((function(e){if(e.node===r&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach((function(e){var r=t[e],s=!1;if("object"==typeof r&&r.allOf)for(var l=0,c=r.allOf;l<c.length;l++){if(c[l].readOnly){s=!0;break}}if("object"==typeof r&&!r.deprecationMessage&&!r.doNotSuggest&&!s){var u={kind:yt.Property,label:a.sanitizeLabel(e),insertText:a.getInsertTextForProperty(e,r,n,o),insertTextFormat:bt.Snippet,filterText:a.getFilterTextForValue(e),documentation:a.fromMarkup(r.markdownDescription)||r.description||""};Cr(u.insertText,"$1"+o)&&(u.command={title:"Suggest",command:"editor.action.triggerSuggest"}),i.add(u)}}))}}))},e.prototype.getSchemaLessPropertyCompletions=function(e,t,r,n){var o=this,i=function(e){e.properties.forEach((function(e){var t=e.keyNode.value;n.add({kind:yt.Property,label:o.sanitizeLabel(t),insertText:o.getInsertTextForValue(t,""),insertTextFormat:bt.Snippet,filterText:o.getFilterTextForValue(t),documentation:""})}))};if(t.parent)if("property"===t.parent.type){var a=t.parent.keyNode.value;e.visit((function(e){return"property"===e.type&&e!==t.parent&&e.keyNode.value===a&&e.valueNode&&"object"===e.valueNode.type&&i(e.valueNode),!0}))}else"array"===t.parent.type&&t.parent.items.forEach((function(e){"object"===e.type&&e!==t&&i(e)}));else"object"===t.type&&n.add({kind:yt.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:bt.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(e,t,r,n,o){var i=this,a=r;if(!t||"string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(a=t.offset+t.length,t=t.parent),!t)return o.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:bt.Snippet,documentation:""}),void o.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:bt.Snippet,documentation:""});var s=this.evaluateSeparatorAfter(n,a),l=function(e){yr(e.parent,r,!0)||o.add({kind:i.getSuggestionKind(e.type),label:i.getLabelTextForMatchingNode(e,n),insertText:i.getInsertTextForMatchingNode(e,n,s),insertTextFormat:bt.Snippet,documentation:""}),"boolean"===e.type&&i.addBooleanValueCompletion(!e.value,s,o)};if("property"===t.type&&r>t.colonOffset){var c=t.valueNode;if(c&&(r>c.offset+c.length||"object"===c.type||"array"===c.type))return;var u=t.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===u&&e.valueNode&&l(e.valueNode),!0})),"$schema"===u&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(s,o)}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var f=t.parent.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===f&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(l),!0}))}else t.items.forEach(l)},e.prototype.getValueCompletions=function(e,t,r,n,o,i,a){var s=this,l=n,c=null,u=null;if(!r||"string"!==r.type&&"number"!==r.type&&"boolean"!==r.type&&"null"!==r.type||(l=r.offset+r.length,u=r,r=r.parent),r){if("property"===r.type&&n>r.colonOffset){var f=r.valueNode;if(f&&n>f.offset+f.length)return;c=r.keyNode.value,r=r.parent}if(r&&(null!==c||"array"===r.type)){var p=this.evaluateSeparatorAfter(o,l);t.getMatchingSchemas(e.schema,r.offset,u).forEach((function(e){if(e.node===r&&!e.inverted&&e.schema){if("array"===r.type&&e.schema.items)if(Array.isArray(e.schema.items)){var t=s.findItemAtOffset(r,o,n);t<e.schema.items.length&&s.addSchemaValueCompletions(e.schema.items[t],p,i,a)}else s.addSchemaValueCompletions(e.schema.items,p,i,a);if(e.schema.properties){var l=e.schema.properties[c];l&&s.addSchemaValueCompletions(l,p,i,a)}}})),"$schema"!==c||r.parent||this.addDollarSchemaCompletions(p,i),a.boolean&&(this.addBooleanValueCompletion(!0,p,i),this.addBooleanValueCompletion(!1,p,i)),a.null&&this.addNullValueCompletion(p,i)}}else this.addSchemaValueCompletions(e.schema,"",i,a)},e.prototype.getContributedValueCompletions=function(e,t,r,n,o,i){if(t){if("string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(t=t.parent),"property"===t.type&&r>t.colonOffset){var a=t.keyNode.value,s=t.valueNode;if(!s||r<=s.offset+s.length){var l=gr(t.parent);this.contributions.forEach((function(e){var t=e.collectValueCompletions(n.uri,l,a,o);t&&i.push(t)}))}}}else this.contributions.forEach((function(e){var t=e.collectDefaultCompletions(n.uri,o);t&&i.push(t)}))},e.prototype.addSchemaValueCompletions=function(e,t,r,n){var o=this;"object"==typeof e&&(this.addEnumValueCompletions(e,t,r),this.addDefaultValueCompletions(e,t,r),this.collectTypes(e,n),Array.isArray(e.allOf)&&e.allOf.forEach((function(e){return o.addSchemaValueCompletions(e,t,r,n)})),Array.isArray(e.anyOf)&&e.anyOf.forEach((function(e){return o.addSchemaValueCompletions(e,t,r,n)})),Array.isArray(e.oneOf)&&e.oneOf.forEach((function(e){return o.addSchemaValueCompletions(e,t,r,n)})))},e.prototype.addDefaultValueCompletions=function(e,t,r,n){var o=this;void 0===n&&(n=0);var i=!1;if(ut(e.default)){for(var a=e.type,s=e.default,l=n;l>0;l--)s=[s],a="array";r.add({kind:this.getSuggestionKind(a),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,t),insertTextFormat:bt.Snippet}),i=!0}Array.isArray(e.examples)&&e.examples.forEach((function(a){for(var s=e.type,l=a,c=n;c>0;c--)l=[l],s="array";r.add({kind:o.getSuggestionKind(s),label:o.getLabelForValue(l),insertText:o.getInsertTextForValue(l,t),insertTextFormat:bt.Snippet}),i=!0})),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach((function(a){var s,l,c=e.type,u=a.body,f=a.label;if(ut(u)){e.type;for(var p=n;p>0;p--)u=[u],"array";s=o.getInsertTextForSnippetValue(u,t),l=o.getFilterTextForSnippetValue(u),f=f||o.getLabelForSnippetValue(u)}else if("string"==typeof a.bodyText){var d="",h="",v="";for(p=n;p>0;p--)d=d+v+"[\n",h=h+"\n"+v+"]",v+="\t",c="array";s=d+v+a.bodyText.split("\n").join("\n"+v)+h+t,f=f||o.sanitizeLabel(s),l=s.replace(/[\n]/g,"")}r.add({kind:o.getSuggestionKind(c),label:f,documentation:o.fromMarkup(a.markdownDescription)||a.description,insertText:s,insertTextFormat:bt.Snippet,filterText:l}),i=!0})),i||"object"!=typeof e.items||Array.isArray(e.items)||this.addDefaultValueCompletions(e.items,t,r,n+1)},e.prototype.addEnumValueCompletions=function(e,t,r){if(ut(e.const)&&r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:bt.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var n=0,o=e.enum.length;n<o;n++){var i=e.enum[n],a=this.fromMarkup(e.markdownDescription)||e.description;e.markdownEnumDescriptions&&n<e.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?a=this.fromMarkup(e.markdownEnumDescriptions[n]):e.enumDescriptions&&n<e.enumDescriptions.length&&(a=e.enumDescriptions[n]),r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(i),insertText:this.getInsertTextForValue(i,t),insertTextFormat:bt.Snippet,documentation:a})}},e.prototype.collectTypes=function(e,t){if(!Array.isArray(e.enum)&&!ut(e.const)){var r=e.type;Array.isArray(r)?r.forEach((function(e){return t[e]=!0})):t[r]=!0}},e.prototype.addFillerValueCompletions=function(e,t,r){e.object&&r.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},t),insertTextFormat:bt.Snippet,detail:"New object",documentation:""}),e.array&&r.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],t),insertTextFormat:bt.Snippet,detail:"New array",documentation:""})},e.prototype.addBooleanValueCompletion=function(e,t,r){r.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t),insertTextFormat:bt.Snippet,documentation:""})},e.prototype.addNullValueCompletion=function(e,t){t.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:bt.Snippet,documentation:""})},e.prototype.addDollarSchemaCompletions=function(e,t){var r=this;this.schemaService.getRegisteredSchemaIds((function(e){return"http"===e||"https"===e})).forEach((function(n){return t.add({kind:yt.Module,label:r.getLabelForValue(n),filterText:r.getFilterTextForValue(n),insertText:r.getInsertTextForValue(n,e),insertTextFormat:bt.Snippet,documentation:""})}))},e.prototype.sanitizeLabel=function(e){return(e=e.replace(/[\n]/g,"↵")).length>57&&(e=e.substr(0,57).trim()+"..."),e},e.prototype.getLabelForValue=function(e){return this.sanitizeLabel(JSON.stringify(e))},e.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},e.prototype.getFilterTextForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(e){var t=JSON.stringify(e);return t=t.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),this.sanitizeLabel(t)},e.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(e,t){var r=JSON.stringify(e,null,"\t");return"{}"===r?"{$1}"+t:"[]"===r?"[$1]"+t:this.getInsertTextForPlainText(r+t)},e.prototype.getInsertTextForSnippetValue=function(e,t){return function e(t,r,n){if(null!==t&&"object"==typeof t){var o=r+"\t";if(Array.isArray(t)){if(0===t.length)return"[]";for(var i="[\n",a=0;a<t.length;a++)i+=o+e(t[a],o,n),a<t.length-1&&(i+=","),i+="\n";return i+=r+"]"}var s=Object.keys(t);if(0===s.length)return"{}";for(i="{\n",a=0;a<s.length;a++){var l=s[a];i+=o+JSON.stringify(l)+": "+e(t[l],o,n),a<s.length-1&&(i+=","),i+="\n"}return i+=r+"}"}return n(t)}(e,"",(function(e){return"string"==typeof e&&"^"===e[0]?e.substr(1):JSON.stringify(e)}))+t},e.prototype.getInsertTextForGuessedValue=function(e,t){switch(typeof e){case"object":return null===e?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":var r=JSON.stringify(e);return r=r.substr(1,r.length-2),'"${1:'+(r=this.getInsertTextForPlainText(r))+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)},e.prototype.getSuggestionKind=function(e){if(Array.isArray(e)){var t=e;e=t.length>0?t[0]:null}if(!e)return yt.Value;switch(e){case"string":return yt.Value;case"object":return yt.Module;case"property":return yt.Property;default:return yt.Value}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getText().substr(e.offset,e.length)}},e.prototype.getInsertTextForMatchingNode=function(e,t,r){switch(e.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:var n=t.getText().substr(e.offset,e.length)+r;return this.getInsertTextForPlainText(n)}},e.prototype.getInsertTextForProperty=function(e,t,r,n){var o=this.getInsertTextForValue(e,"");if(!r)return o;var i,a=o+": ",s=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var l=t.defaultSnippets[0].body;ut(l)&&(i=this.getInsertTextForSnippetValue(l,""))}s+=t.defaultSnippets.length}if(t.enum&&(i||1!==t.enum.length||(i=this.getInsertTextForGuessedValue(t.enum[0],"")),s+=t.enum.length),ut(t.default)&&(i||(i=this.getInsertTextForGuessedValue(t.default,"")),s++),0===s){var c=Array.isArray(t.type)?t.type[0]:t.type;switch(c||(t.properties?c="object":t.items&&(c="array")),c){case"boolean":i="$1";break;case"string":i='"$1"';break;case"object":i="{$1}";break;case"array":i="[$1]";break;case"number":case"integer":i="${1:0}";break;case"null":i="${1:null}";break;default:return o}}}return(!i||s>1)&&(i="$1"),a+i+n},e.prototype.getCurrentWord=function(e,t){for(var r=t-1,n=e.getText();r>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(n.charAt(r));)r--;return n.substring(r+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var r=nt(e.getText(),!0);switch(r.setPosition(t),r.scan()){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(e,t,r){for(var n=nt(t.getText(),!0),o=e.items,i=o.length-1;i>=0;i--){var a=o[i];if(r>a.offset+a.length)return n.setPosition(a.offset+a.length),5===n.scan()&&r>=n.getTokenOffset()+n.getTokenLength()?i+1:i;if(r>=a.offset)return i}return 0},e.prototype.isInComment=function(e,t,r){var n=nt(e.getText(),!1);n.setPosition(t);for(var o=n.scan();17!==o&&n.getTokenOffset()+n.getTokenLength()<r;)o=n.scan();return(12===o||13===o)&&n.getTokenOffset()<=r},e.prototype.fromMarkup=function(e){if(e&&this.doesSupportMarkdown())return{kind:mt.Markdown,value:e}},e.prototype.doesSupportMarkdown=function(){if(!ut(this.supportsMarkdown)){var e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=e&&e.completionItem&&Array.isArray(e.completionItem.documentationFormat)&&-1!==e.completionItem.documentationFormat.indexOf(mt.Markdown)}return this.supportsMarkdown},e.prototype.doesSupportsCommitCharacters=function(){if(!ut(this.supportsCommitCharacters)){var e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=e&&e.completionItem&&!!e.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},e}(),Sr=function(){function e(e,t,r){void 0===t&&(t=[]),this.schemaService=e,this.contributions=t,this.promise=r||Promise}return e.prototype.doHover=function(e,t,r){var n=e.offsetAt(t),o=r.getNodeFromOffset(n);if(!o||("object"===o.type||"array"===o.type)&&n>o.offset+1&&n<o.offset+o.length-1)return this.promise.resolve(null);var i=o;if("string"===o.type){var a=o.parent;if(a&&"property"===a.type&&a.keyNode===o&&!(o=a.valueNode))return this.promise.resolve(null)}for(var s=Fe.create(e.positionAt(i.offset),e.positionAt(i.offset+i.length)),l=function(e){return{contents:e,range:s}},c=gr(o),u=this.contributions.length-1;u>=0;u--){var f=this.contributions[u].getInfoContribution(e.uri,c);if(f)return f.then((function(e){return l(e)}))}return this.schemaService.getSchemaForResource(e.uri,r).then((function(e){if(e){var t=r.getMatchingSchemas(e.schema,o.offset),n=null,i=null,a=null,s=null;t.every((function(e){if(e.node===o&&!e.inverted&&e.schema&&(n=n||e.schema.title,i=i||e.schema.markdownDescription||Er(e.schema.description),e.schema.enum)){var t=e.schema.enum.indexOf(mr(o));e.schema.markdownEnumDescriptions?a=e.schema.markdownEnumDescriptions[t]:e.schema.enumDescriptions&&(a=Er(e.schema.enumDescriptions[t])),a&&"string"!=typeof(s=e.schema.enum[t])&&(s=JSON.stringify(s))}return!0}));var c="";return n&&(c=Er(n)),i&&(c.length>0&&(c+="\n\n"),c+=i),a&&(c.length>0&&(c+="\n\n"),c+="`"+function(e){if(-1!==e.indexOf("`"))return"`` "+e+" ``";return e}(s)+"`: "+a),l([c])}return null}))},e}();function Er(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3").replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}var jr=r(778),Tr=function(){function e(e){try{this.patternRegExp=new RegExp(function(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}(e)+"$")}catch(e){this.patternRegExp=null}this.schemas=[]}return e.prototype.addSchema=function(e){this.schemas.push(e)},e.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},e.prototype.getSchemas=function(){return this.schemas},e}(),Mr=function(){function e(e,t,r){this.service=e,this.url=t,this.dependencies={},r&&(this.unresolvedSchema=this.service.promise.resolve(new Pr(r)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then((function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)}))),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},e}(),Pr=function(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t},Lr=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){return pr(this.getSectionRecursive(e,this.schema))},e.prototype.getSectionRecursive=function(e,t){if(!t||"boolean"==typeof t||0===e.length)return t;var r=e.shift();if(t.properties&&(t.properties[r],1))return this.getSectionRecursive(e,t.properties[r]);if(t.patternProperties)for(var n=0,o=Object.keys(t.patternProperties);n<o.length;n++){var i=o[n];if(new RegExp(i).test(r))return this.getSectionRecursive(e,t.patternProperties[i])}else{if("object"==typeof t.additionalProperties)return this.getSectionRecursive(e,t.additionalProperties);if(r.match("[0-9]+"))if(Array.isArray(t.items)){var a=parseInt(r,10);if(!isNaN(a)&&t.items[a])return this.getSectionRecursive(e,t.items[a])}else if(t.items)return this.getSectionRecursive(e,t.items)}return null},e}(),Ir=function(){function e(e,t,r){this.contextService=t,this.requestService=e,this.promiseConstructor=r||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter((function(t){var r=jr.a.parse(t).scheme;return"schemaservice"!==r&&(!e||e(r))}))},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){for(var t=this,r=!1,n=[e=this.normalizeId(e)],o=Object.keys(this.schemasById).map((function(e){return t.schemasById[e]}));n.length;)for(var i=n.pop(),a=0;a<o.length;a++){var s=o[a];s&&(s.url===i||s.dependencies[i])&&(s.url!==i&&n.push(s.url),s.clearSchema(),o[a]=void 0,r=!0)}return r},e.prototype.normalizeId=function(e){try{return jr.a.parse(e).toString()}catch(t){return e}},e.prototype.setSchemaContributions=function(e){if(e.schemas){var t=e.schemas;for(var r in t){var n=this.normalizeId(r);this.contributionSchemas[n]=this.addSchemaHandle(n,t[r])}}if(e.schemaAssociations){var o=e.schemaAssociations;for(var i in o){var a=o[i];this.contributionAssociations[i]=a;for(var s=this.getOrAddFilePatternAssociation(i),l=0,c=a;l<c.length;l++){var u=c[l];r=this.normalizeId(u);s.addSchema(r)}}}},e.prototype.addSchemaHandle=function(e,t){var r=new Mr(this,e,t);return this.schemasById[e]=r,r},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.getOrAddFilePatternAssociation=function(e){var t=this.filePatternAssociationById[e];return t||(t=new Tr(e),this.filePatternAssociationById[e]=t,this.filePatternAssociations.push(t)),t},e.prototype.registerExternalSchema=function(e,t,r){void 0===t&&(t=null);var n=this.normalizeId(e);if(this.registeredSchemasIds[n]=!0,t)for(var o=0,i=t;o<i.length;o++){var a=i[o];this.getOrAddFilePatternAssociation(a).addSchema(n)}return r?this.addSchemaHandle(n,r):this.getOrAddSchemaHandle(n)},e.prototype.clearExternalSchemas=function(){for(var e in this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={},this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var t in this.contributionAssociations)for(var r=this.getOrAddFilePatternAssociation(t),n=0,o=this.contributionAssociations[t];n<o.length;n++){var i=o[n];e=this.normalizeId(i);r.addSchema(e)}},e.prototype.getResolvedSchema=function(e){var t=this.normalizeId(e),r=this.schemasById[t];return r?r.getResolvedSchema():this.promise.resolve(null)},e.prototype.loadSchema=function(e){if(!this.requestService){var t="Unable to load schema from '"+Fr(e)+"'. No schema request service available";return this.promise.resolve(new Pr({},[t]))}return this.requestService(e).then((function(t){if(!t){var r="Unable to load schema from '"+Fr(e)+"': No content.";return new Pr({},[r])}var n,o=[];n=ot(t,o);var i=o.length?["Unable to parse content from '"+Fr(e)+"': Parse error at offset "+o[0].offset]:[];return new Pr(n,i)}),(function(t){var r="Unable to load schema from '"+Fr(e)+"': "+t.toString();return new Pr({},[r])}))},e.prototype.resolveSchemaContent=function(e,t,r){var n=this,o=e.errors.slice(0),i=e.schema;if(i.$schema){var a=this.normalizeId(i.$schema);if("http://json-schema.org/draft-03/schema"===a)return this.promise.resolve(new Lr({},["Draft-03 schemas are not supported."]));"https://json-schema.org/draft/2019-09/schema"===a&&e.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var s=this.contextService,l=function(e,t,r,n){var i=function(e,t){if(!t)return e;var r=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some((function(e){return!(r=r[e])})),r}(t,n);if(i)for(var a in i)i.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=i[a]);else o.push("$ref '"+n+"' in '"+r+"' can not be resolved.")},c=function(e,t,r,i,a){s&&!/^\w+:\/\/.*/.test(t)&&(t=s.resolveRelativePath(t,i)),t=n.normalizeId(t);var c=n.getOrAddSchemaHandle(t);return c.getUnresolvedSchema().then((function(n){if(a[t]=!0,n.errors.length){var i=r?t+"#"+r:t;o.push("Problems loading reference '"+i+"': "+n.errors[0]+".")}return l(e,n.schema,t,r),u(e,n.schema,t,c.dependencies)}))},u=function(e,t,r,o){if(!e||"object"!=typeof e)return Promise.resolve(null);for(var i=[e],a=[],s=[],u=function(e){for(var n=[];e.$ref;){var a=e.$ref,u=a.split("#",2);if(delete e.$ref,u[0].length>0)return void s.push(c(e,u[0],u[1],r,o));-1===n.indexOf(a)&&(l(e,t,r,u[1]),n.push(a))}!function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];"object"==typeof o&&i.push(o)}}(e.items,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];if("object"==typeof o)for(var a in o){var s=o[a];"object"==typeof s&&i.push(s)}}}(e.definitions,e.properties,e.patternProperties,e.dependencies),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];if(Array.isArray(o))for(var a=0,s=o;a<s.length;a++){var l=s[a];"object"==typeof l&&i.push(l)}}}(e.anyOf,e.allOf,e.oneOf,e.items)};i.length;){var f=i.pop();a.indexOf(f)>=0||(a.push(f),u(f))}return n.promise.all(s)};return u(i,i,t,r).then((function(e){return new Lr(i,o)}))},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var r=t.root.properties.filter((function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type}));if(r.length>0){var n=mr(r[0].valueNode);if(n&&function(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}(n,".")&&this.contextService&&(n=this.contextService.resolveRelativePath(n,e)),n){var o=this.normalizeId(n);return this.getOrAddSchemaHandle(o).getResolvedSchema()}}}for(var i=Object.create(null),a=[],s=0,l=this.filePatternAssociations;s<l.length;s++){var c=l[s];if(c.matchesPattern(e))for(var u=0,f=c.getSchemas();u<f.length;u++){var p=f[u];i[p]||(a.push(p),i[p]=!0)}}return a.length>0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(null)},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var r="schemaservice://combinedSchema/"+encodeURIComponent(e),n={allOf:t.map((function(e){return{$ref:e}}))};return this.addSchemaHandle(r,n)},e}();function Fr(e){return e}var _r=function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:We.Error)},e.prototype.doValidation=function(e,t,r,n){var o=this;if(!this.validationEnabled)return this.promise.resolve([]);var i=[],a={},s=function(e){var t=e.range.start.line+" "+e.range.start.character+" "+e.message;a[t]||(a[t]=!0,i.push(e))},l=function(n){var a=r?Rr(r.trailingCommas):We.Error,l=r?Rr(r.comments):o.commentSeverity;if(n){if(n.errors.length&&t.root){var c=t.root,u="object"===c.type?c.properties[0]:null;if(u&&"$schema"===u.keyNode.value){var f=u.valueNode||u,p=Fe.create(e.positionAt(f.offset),e.positionAt(f.offset+f.length));s(Ge.create(p,n.errors[0],We.Warning,Kt.SchemaResolveError))}else{p=Fe.create(e.positionAt(c.offset),e.positionAt(c.offset+1));s(Ge.create(p,n.errors[0],We.Warning,Kt.SchemaResolveError))}}else{var d=t.validate(e,n.schema);d&&d.forEach(s)}(function e(t){if(t&&"object"==typeof t){if(ft(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,n=t.allOf;r<n.length;r++){var o=n[r],i=e(o);if(ft(i))return i}}return})(n.schema)&&(l=void 0),function e(t){if(t&&"object"==typeof t){if(ft(t.allowTrailingCommas))return t.allowTrailingCommas;if(ft(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,n=t.allOf;r<n.length;r++){var o=n[r],i=e(o);if(ft(i))return i}}return}(n.schema)&&(a=void 0)}for(var h=0,v=t.syntaxErrors;h<v.length;h++){var m=v[h];if(m.code===Kt.TrailingComma){if("number"!=typeof a)continue;m.severity=a}s(m)}if("number"==typeof l){t.comments.forEach((function(e){s(Ge.create(e,"Comments are not permitted in JSON.",l,Kt.CommentNotPermitted))}))}return i};if(n){var c=n.id||"schemaservice://untitled/"+Nr++;return this.jsonSchemaService.resolveSchemaContent(new Pr(n),c,{}).then((function(e){return l(e)}))}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then((function(e){return l(e)}))},e}(),Nr=0;function Rr(e){switch(e){case"error":return We.Error;case"warning":return We.Warning;case"ignore":return}}function Dr(e){return e<48?0:e<=57?e-48:(e<97&&(e+=32),e>=97&&e<=102?e-97+10:0)}function Vr(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*Dr(e.charCodeAt(1))/255,green:17*Dr(e.charCodeAt(2))/255,blue:17*Dr(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*Dr(e.charCodeAt(1))/255,green:17*Dr(e.charCodeAt(2))/255,blue:17*Dr(e.charCodeAt(3))/255,alpha:17*Dr(e.charCodeAt(4))/255};case 7:return{red:(16*Dr(e.charCodeAt(1))+Dr(e.charCodeAt(2)))/255,green:(16*Dr(e.charCodeAt(3))+Dr(e.charCodeAt(4)))/255,blue:(16*Dr(e.charCodeAt(5))+Dr(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*Dr(e.charCodeAt(1))+Dr(e.charCodeAt(2)))/255,green:(16*Dr(e.charCodeAt(3))+Dr(e.charCodeAt(4)))/255,blue:(16*Dr(e.charCodeAt(5))+Dr(e.charCodeAt(6)))/255,alpha:(16*Dr(e.charCodeAt(7))+Dr(e.charCodeAt(8)))/255}}return null}var Br=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t,r){var n=this;void 0===r&&(r={resultLimit:Number.MAX_VALUE});var o=t.root;if(!o)return null;var i=r.resultLimit,a=e.uri;if(("vscode://defaultsettings/keybindings.json"===a||Cr(a.toLowerCase(),"/user/keybindings.json"))&&"array"===o.type){for(var s=[],l=0,c=o.items;l<c.length;l++){var u=c[l];if("object"===u.type)for(var f=0,p=u.properties;f<p.length;f++){var d=p[f];if("key"===d.keyNode.value&&d.valueNode){var h=_e.create(e.uri,Ur(e,u));if(s.push({name:mr(d.valueNode),kind:Pt.Function,location:h}),--i<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),s}}}return s}var v=function(t,r,o){return i>=0&&("array"===r.type?r.items.forEach((function(e){return v(t,e,o)})):"object"===r.type&&r.properties.forEach((function(r){if(i>=0){var a=r.valueNode;if(a){i--;var s=_e.create(e.uri,Ur(e,r)),l=o?o+"."+r.keyNode.value:r.keyNode.value;t.push({name:n.getKeyLabel(r),kind:n.getSymbolKind(a.type),location:s,containerName:o}),v(t,a,l)}}}))),t},m=v([],o,void 0);return i<0&&(m.pop(),r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a)),m},e.prototype.findDocumentSymbols2=function(e,t,r){var n=this;void 0===r&&(r={resultLimit:Number.MAX_VALUE});var o=t.root;if(!o)return null;var i=r.resultLimit,a=e.uri;if(("vscode://defaultsettings/keybindings.json"===a||Cr(a.toLowerCase(),"/user/keybindings.json"))&&"array"===o.type){for(var s=[],l=0,c=o.items;l<c.length;l++){var u=c[l];if("object"===u.type)for(var f=0,p=u.properties;f<p.length;f++){var d=p[f];if("key"===d.keyNode.value&&d.valueNode){var h=Ur(e,u),v=Ur(e,d.keyNode);if(s.push({name:mr(d.valueNode),kind:Pt.Function,range:h,selectionRange:v}),--i<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),s}}}return s}var m=function(t,r){return i>=0&&("array"===r.type?r.items.forEach((function(r,o){if(r&&i>=0){i--;var a=Ur(e,r),s=a,l=String(o),c=m([],r);t.push({name:l,kind:n.getSymbolKind(r.type),range:a,selectionRange:s,children:c})}})):"object"===r.type&&r.properties.forEach((function(r){var o=r.valueNode;if(o&&i>=0){i--;var a=Ur(e,r),s=Ur(e,r.keyNode),l=m([],o);t.push({name:n.getKeyLabel(r),kind:n.getSymbolKind(o.type),range:a,selectionRange:s,children:l})}}))),t},g=m([],o);return i<0&&(g.pop(),r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a)),g},e.prototype.getSymbolKind=function(e){switch(e){case"object":return Pt.Module;case"string":return Pt.String;case"number":return Pt.Number;case"array":return Pt.Array;case"boolean":return Pt.Boolean;default:return Pt.Variable}},e.prototype.getKeyLabel=function(e){var t=e.keyNode.value;return t&&(t=t.replace(/[\n]/g,"↵")),t&&t.trim()?t:'"'+t+'"'},e.prototype.findDocumentColors=function(e,t,r){return this.schemaService.getSchemaForResource(e.uri,t).then((function(n){var o=[];if(n)for(var i=r&&"number"==typeof r.resultLimit?r.resultLimit:Number.MAX_VALUE,a={},s=0,l=t.getMatchingSchemas(n.schema);s<l.length;s++){var c=l[s];if(!c.inverted&&c.schema&&("color"===c.schema.format||"color-hex"===c.schema.format)&&c.node&&"string"===c.node.type){var u=String(c.node.offset);if(!a[u]){var f=Vr(mr(c.node));if(f){var p=Ur(e,c.node);o.push({color:f,range:p})}if(a[u]=!0,--i<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(e.uri),o}}}return o}))},e.prototype.getColorPresentations=function(e,t,r,n){var o,i=[],a=Math.round(255*r.red),s=Math.round(255*r.green),l=Math.round(255*r.blue);function c(e){var t=e.toString(16);return 2!==t.length?"0"+t:t}return o=1===r.alpha?"#"+c(a)+c(s)+c(l):"#"+c(a)+c(s)+c(l)+c(Math.round(255*r.alpha)),i.push({label:o,textEdit:Ke.replace(n,JSON.stringify(o))}),i},e}();function Ur(e,t){return Fe.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}var zr={schemaAssociations:{},schemas:{}};function Wr(e,t){var r=[],n=[],o=[],i=-1,a=nt(e.getText(),!1),s=a.scan();function l(e){r.push(e),n.push(o.length)}for(;17!==s;){switch(s){case 1:case 3:var c={startLine:p=e.positionAt(a.getTokenOffset()).line,endLine:p,kind:1===s?"object":"array"};o.push(c);break;case 2:case 4:var u=2===s?"object":"array";if(o.length>0&&o[o.length-1].kind===u){c=o.pop();var f=e.positionAt(a.getTokenOffset()).line;c&&f>c.startLine+1&&i!==c.startLine&&(c.endLine=f-1,l(c),i=c.startLine)}break;case 13:var p=e.positionAt(a.getTokenOffset()).line,d=e.positionAt(a.getTokenOffset()+a.getTokenLength()).line;1===a.getTokenError()&&p+1<e.lineCount?a.setPosition(e.offsetAt(Ie.create(p+1,0))):p<d&&(l({startLine:p,endLine:d,kind:Be.Comment}),i=p);break;case 12:var h=e.getText().substr(a.getTokenOffset(),a.getTokenLength()).match(/^\/\/\s*#(region\b)|(endregion\b)/);if(h){f=e.positionAt(a.getTokenOffset()).line;if(h[1]){c={startLine:f,endLine:f,kind:Be.Region};o.push(c)}else{for(var v=o.length-1;v>=0&&o[v].kind!==Be.Region;)v--;if(v>=0){c=o[v];o.length=v,f>c.startLine&&i!==c.startLine&&(c.endLine=f,l(c),i=c.startLine)}}}}s=a.scan()}var m=t&&t.rangeLimit;if("number"!=typeof m||r.length<=m)return r;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);for(var g=[],y=0,b=n;y<b.length;y++){(A=b[y])<30&&(g[A]=(g[A]||0)+1)}var x=0,w=0;for(v=0;v<g.length;v++){var C=g[v];if(C){if(C+x>m){w=v;break}x+=C}}var k=[];for(v=0;v<r.length;v++){var A;"number"==typeof(A=n[v])&&(A<w||A===w&&x++<m)&&k.push(r[v])}return k}function Hr(e,t,r){function n(t,r){return Fe.create(e.positionAt(t),e.positionAt(r))}var o=nt(e.getText(),!0);function i(e,t){return o.setPosition(e),o.scan()===t?o.getTokenOffset()+o.getTokenLength():-1}return t.map((function(t){for(var o=e.offsetAt(t),a=r.getNodeFromOffset(o,!0),s=[];a;){switch(a.type){case"string":case"object":case"array":var l=a.offset+1,c=a.offset+a.length-1;l<c&&o>=l&&o<=c&&s.push(n(l,c)),s.push(n(a.offset,a.offset+a.length));break;case"number":case"boolean":case"null":case"property":s.push(n(a.offset,a.offset+a.length))}if("property"===a.type||a.parent&&"array"===a.parent.type){var u=i(a.offset+a.length,5);-1!==u&&s.push(n(a.offset,u))}a=a.parent}for(var f=void 0,p=s.length-1;p>=0;p--)f=Ut.create(s[p],f);return f||(f=Ut.create(Fe.create(t,t))),f}))}r(779),r(780),r(781),r(782),r(783),r(784),r(785),r(787),r(789),r(791);var qr=function(e){var t=e.promiseConstructor||Promise,r=new Ir(e.schemaRequestService,e.workspaceContext,t);r.setSchemaContributions(zr);var n=new Or(r,e.contributions,t,e.clientCapabilities),o=new Sr(r,e.contributions,t),i=new Br(r),a=new _r(r,t);return{configure:function(e){r.clearExternalSchemas(),e.schemas&&e.schemas.forEach((function(e){r.registerExternalSchema(e.uri,e.fileMatch,e.schema)})),a.configure(e)},resetSchema:function(e){return r.onResourceChange(e)},doValidation:a.doValidation.bind(a),parseJSONDocument:function(e){return wr(e,{collectComments:!0})},newJSONDocument:function(e,t){return function(e,t){return void 0===t&&(t=[]),new br(e,t,[])}(e,t)},doComplete:n.doComplete.bind(n),findDocumentSymbols:i.findDocumentSymbols.bind(i),findDocumentSymbols2:i.findDocumentSymbols2.bind(i),findColorSymbols:function(e,t){return i.findDocumentColors(e,t).then((function(e){return e.map((function(e){return e.range}))}))},findDocumentColors:i.findDocumentColors.bind(i),getColorPresentations:i.getColorPresentations.bind(i),doHover:o.doHover.bind(o),getFoldingRanges:Wr,getSelectionRanges:Hr,format:function(e,t,r){var n=void 0;if(t){var o=e.offsetAt(t.start);n={offset:o,length:e.offsetAt(t.end)-o}}var i={tabSize:r?r.tabSize:4,insertSpaces:!r||r.insertSpaces,eol:"\n"};return function(e,t,r){return Ee(e,t,r)}(e.getText(),n,i).map((function(t){return Ke.replace(Fe.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length)),t.content)}))}}}({});Ce.registerHelper("lint","json",(function(e,t){return Object(a.b)(this,void 0,void 0,(function(){var r,n,o,i,s;return Object(a.e)(this,(function(a){switch(a.label){case 0:return r=t.schema,n=t.setError,qr.configure({validate:!0,schemas:[{uri:"stub://"+t.id,fileMatch:["*"],schema:r}]}),o=$t.create(t.id+".json","json",0,e),i=qr.parseJSONDocument(o),[4,qr.doValidation(o,i)];case 1:return(s=a.sent()).length?n&&n(s[0].message):n&&n(void 0),[2,s.map((function(e){return{from:Ce.Pos(e.range.start.line,e.range.start.character),to:Ce.Pos(e.range.end.line,e.range.end.character),message:e.message}}))]}}))}))})),Ce.registerHelper("hint","json",(function(e,t){return Object(a.b)(void 0,void 0,void 0,(function(){var r,n,o,i,s,l,c,u;return Object(a.e)(this,(function(a){switch(a.label){case 0:return(r=t.schema)?(qr.configure({validate:!0,schemas:[{uri:"stub://"+t.id,fileMatch:["*"],schema:r}]}),n=e.getDoc().getCursor(),o=e.getTokenAt(n),i=$t.create(t.id+".json","json",0,e.getValue()),s=qr.parseJSONDocument(i),[4,qr.doComplete(i,{line:n.line,character:n.ch},s)]):[2];case 1:return l=a.sent(),c=function(e){for(var t="";e--;)t+=" ";return t},u=l?l.items.map((function(e){return{text:e.insertText,displayText:e.label,filter:e.filterText||e.label,from:{line:e.textEdit.range.start.line,ch:e.textEdit.range.start.character},to:{line:e.textEdit.range.end.line,ch:e.textEdit.range.end.character},hint:function(e,t,r){var n=r.text.replace(/(\$1|\${1:[^}]+})/,"_$__REDOC_CURSOR_HERE")||"";if(n=n.replace(/(\$\d+|\${[^}]+})/g,"")||"",e.setSelection(r.from,r.to),n.indexOf("\n")>-1){var o=e.getLine(e.getCursor().line).search(/(\S|$)/);n=n.replace(/\n/g,"\n"+c(o))}e.replaceSelection(n);var i=e.getSearchCursor("_$__REDOC_CURSOR_HERE",r.from);i.findNext()&&(e.setCursor(i.from()),i.replace(""))}}})):[],/(property|string)/.test(o.type||"")&&(u=u.filter((function(e){return e.filter.replace(/(^"|"$)/g,"").startsWith(o.string.replace(/(^"|"$)/g,""))}))),[2,{from:Ce.Pos(n.line,o.start),to:Ce.Pos(n.line,n.ch),list:u}]}}))}))}));var Gr,$r,Kr,Jr,Yr,Xr,Qr,Zr,en,tn,rn,nn,on=Object(h.cb)(Gr||(Gr=Object(a.f)(["\n .cm-s-material.CodeMirror {\n background-color: ","!important;\n color: ","!important;\n font-family: ",";\n line-height: 18px;\n padding: 10px;\n }\n\n .CodeMirror-lint-mark-error {\n background-size: 4px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAVUlEQVR42mNgQAL/GRjigPg/EP8FYntkCX4gtoVKgvE/BoabcEVAhj6S5DUgfgFl/wFJ2gPxL6iuT1DF+kD2R5AYA5KRj6CS/FAMYvszIBltz4AFAAD9fz0YtLg13wAAAABJRU5ErkJggg==') !important;\n }\n\n .cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(255, 255, 255, 0.3) !important;\n }\n\n .cm-s-material .CodeMirror-code .cm-string.cm-property {\n color: #9EFAA7;\n }\n\n .cm-s-material .CodeMirror-code .cm-string {\n color: #FEE39E;\n }\n\n .cm-s-material .CodeMirror-code .cm-atom {\n color: ",";\n }\n\n div .cm-s-material .CodeMirror-matchingbracket {\n outline: 1px solid grey;\n text-decoration: none;\n }\n\n .react-codemirror2 {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n overflow: hidden;\n\n flex: 1;\n }\n\n .CodeMirror {\n flex: 1;\n max-height: 65vh !important; /* it fixes performance bug if we pass big data to CodeMirror */\n border-radius: ",";\n }\n"],["\n .cm-s-material.CodeMirror {\n background-color: ","!important;\n color: ","!important;\n font-family: ",";\n line-height: 18px;\n padding: 10px;\n }\n\n .CodeMirror-lint-mark-error {\n background-size: 4px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAVUlEQVR42mNgQAL/GRjigPg/EP8FYntkCX4gtoVKgvE/BoabcEVAhj6S5DUgfgFl/wFJ2gPxL6iuT1DF+kD2R5AYA5KRj6CS/FAMYvszIBltz4AFAAD9fz0YtLg13wAAAABJRU5ErkJggg==') !important;\n }\n\n .cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(255, 255, 255, 0.3) !important;\n }\n\n .cm-s-material .CodeMirror-code .cm-string.cm-property {\n color: #9EFAA7;\n }\n\n .cm-s-material .CodeMirror-code .cm-string {\n color: #FEE39E;\n }\n\n .cm-s-material .CodeMirror-code .cm-atom {\n color: ",";\n }\n\n div .cm-s-material .CodeMirror-matchingbracket {\n outline: 1px solid grey;\n text-decoration: none;\n }\n\n .react-codemirror2 {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n overflow: hidden;\n\n flex: 1;\n }\n\n .CodeMirror {\n flex: 1;\n max-height: 65vh !important; /* it fixes performance bug if we pass big data to CodeMirror */\n border-radius: ",";\n }\n"])),(function(e){return e.theme.rightPanel.panelControlsBackgroundColor}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.typography.code.fontFamily}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius})),an=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"_onKeyUp",{enumerable:!0,configurable:!0,writable:!0,value:function(e,r){/^[a-zA-Z0-9_":]$/.test(r.key)&&t.editor.execCommand("autocomplete")}}),Object.defineProperty(t,"initEditor",{enumerable:!0,configurable:!0,writable:!0,value:function(e){t.editor=e,e.on("keyup",t._onKeyUp)}}),Object.defineProperty(t,"refreshEditor",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.editor.refresh()}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;setTimeout((function(){e.editor.refresh()}),0),document.addEventListener("click",this.refreshEditor)}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){document.removeEventListener("click",this.refreshEditor)}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props.fieldState.value,r=this.props.fieldApi,n=r.setValue,o=r.setTouched,i=r.setError,a=this.props,l=a.onChange,c=a.onBlur,u=a.forwardedRef;return s.createElement(s.Fragment,null,s.createElement(on,null),s.createElement(we.Controlled,{editorDidMount:this.initEditor,value:t||"",ref:u||void 0,onBeforeChange:function(e,t,r){n(r),l&&l(r)},onBlur:function(e){o(),c&&c(e)},options:{mode:this.props.mode||"application/json",theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!0})}},hintOptions:{id:this.props.id,completeSingle:!1,schema:this.props.schema},lint:{id:this.props.id,schema:this.props.schema,setError:i}}}))}}),t}(s.Component),sn=Object(c.b)(an),ln=Object(m.e)($.d)($r||($r=Object(a.f)(["\n border-radius: ",";\n margin-bottom: 10px;\n"],["\n border-radius: ",";\n margin-bottom: 10px;\n"])),(function(e){return e.theme.components.panels.borderRadius})),cn=r(88),un=r(11),fn=["byte","binary","base64"],pn=["string","array"],dn=["image/png","image/jpeg"],hn=["object","string"],vn=function(e){var t=e.items?e.items.format||e.items.contentEncoding:e.format||e.contentEncoding,r=e.type;return!(!r&&!t)&&(fn.includes(t)&&pn.includes(r))},mn=function(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(){var e=n.result.replace(/data:.*\/.*;base64,/g,"");t(e)},n.onerror=function(){return r(n.error)},n.readAsDataURL(e)}))},gn=s.forwardRef((function(e,t){var r=Object(a.g)(e,[]),n=r.schema,o=r.contentName,i=r.onChange,l=r.name;return(0,Object(c.c)(Object(a.a)({field:l},r)).render)(s.createElement("input",{"data-cy":"file-upload-input",type:"file",id:r.id,className:r.className,name:r.name,onChange:function(e){return Object(a.b)(this,void 0,void 0,(function(){var t,r,s,l,c=this;return Object(a.e)(this,(function(u){switch(u.label){case 0:return t=1===e.target.files.length?e.target.files[0]:e.target.files,"string"===(r=n.properties?n.properties[o]:n).type&&r.format?"base64"!==r.format?[3,2]:[4,mn(t)]:[3,2];case 1:t=u.sent(),u.label=2;case 2:return"array"===r.type&&r.items?"base64"!==r.items.format?[3,7]:t.length?[4,Promise.all(Object.keys(t).map((function(e){return Object(a.b)(c,void 0,void 0,(function(){return Object(a.e)(this,(function(r){switch(r.label){case 0:return[4,mn(t[e])];case 1:return[2,r.sent()]}}))}))})))]:[3,4]:[3,11];case 3:return s=u.sent(),[3,6];case 4:return[4,mn(t)];case 5:s=u.sent(),u.label=6;case 6:return t=s,[3,11];case 7:return t.length?[4,Promise.all(Object.keys(t).map((function(e){return t[e]})))]:[3,9];case 8:return l=u.sent(),[3,10];case 9:l=t,u.label=10;case 10:t=l,u.label=11;case 11:return i(o,t),[2]}}))}))},multiple:r.multiple,accept:r.accept,ref:t}))})),yn=Object(h.mb)(gn)(Kr||(Kr=Object(a.f)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"])),g,(function(e){return"password"===e.inputType?"padding-right: 40px;":""}),(function(e){return e.fullWidth?"width: 100%;":""})),bn=h.mb.div(Jr||(Jr=Object(a.f)(["\n > div {\n margin-top: 10px;\n }\n"],["\n > div {\n margin-top: 10px;\n }\n"]))),xn=function(e){var t=Object(a.g)(e,[]),r=t.schema,n=t.mediaType,o=t.onChange;return s.createElement(bn,null,"string"==r.type&&vn(r)&&s.createElement(v.a,null,s.createElement(yn,{fullWidth:!0,id:"body."+n.name,name:"body."+n.name,accept:dn.includes(n.name)?n.name:void 0,schema:r,contentName:n.name,onChange:o}))||null,"object"===r.type&&r.properties&&s.createElement(s.Fragment,null,Object.keys(r.properties).map((function(e,t){return vn(r.properties[e])&&s.createElement(v.a,{key:t},s.createElement(v.d,null,e,":"),s.createElement(yn,{fullWidth:!0,id:"body."+e,name:"body."+e,accept:dn.includes(n.name)?n.name:void 0,multiple:"array"===r.properties[e].type,schema:r,contentName:e,onChange:o}))||s.createElement(v.a,{key:t},s.createElement(v.d,null,e,":"),s.createElement(k,{fullWidth:!0,id:"body."+e,field:"body."+e,placeholder:r.properties[e].description||e}))})))||null)},wn=Object(u.a)((function(e){var t,r,n=e.properties,o=void 0===n?{}:n,i=Object(a.g)(e,["properties"]),l=function(e){var t,r=i.body.content;if(!r||!r.hasSample)return"";var n=null===(t=r.active)||void 0===t?void 0:t.examples;if(null==n||!n[e])return"";var a=xe()(null==n?void 0:n[e].value,o,{arrayMerge:un.a});return JSON.stringify(a,null,2)},c=null===(t=i.body.content)||void 0===t||null===(r=t.operation)||void 0===r?void 0:r.activeExampleName,u=function(e){var t,r;null===(t=i.body.content)||void 0===t||null===(r=t.operation)||void 0===r||r.activateExampleName(e),i.console.formApi.setValue("body",l(e))},f=function(e){if(!e)return"";if("application/x-www-form-urlencoded"===e.mime)return e.value;var t=xe()(e.value,o,{arrayMerge:un.a});return JSON.stringify(t,null,2)},p=function(e,t){return Object(a.b)(void 0,void 0,void 0,(function(){var r;return Object(a.e)(this,(function(n){return r=i.console.formApi,(0,r.setValue)("body."+e,t),[2]}))}))};Object(s.useEffect)((function(){c&&i.console.formApi.setValue("body",l(c))}),[c]);var d=i.validate,v=i.body;return s.createElement(s.Fragment,null,s.createElement(h.t,{content:v.content,renderDropdown:function(e){return s.createElement(h.g,Object(a.a)({},e,{variant:"dark",fullWidth:!0,Label:ln,Dropdown:h.f}))}},(function(e){var t,r=e.examples||{},n=Object.keys(r);i.resolvedBody&&(t=(i.resolvedBody.content[e.name]||{}).schema);var o=Object(cn.c)(e.operation,r).exampleKey,a=r[o];return s.createElement(s.Fragment,null,n.length&&1!==n.length&&s.createElement(cn.a,{examples:r,onChange:u,exampleKey:o})||null,hn.includes(t.type)&&s.createElement(xn,{schema:t,id:i.id,mediaType:e,validate:d,initialSample:f(a),onChange:p.bind(void 0)})||s.createElement(sn,{id:"body"+i.id,field:"body",initialValue:f(a),schema:t,mode:e.name,validate:d}))})))})),Cn=r(10),kn=h.mb.div(Yr||(Yr=Object(a.f)(["\n display: flex;\n font-size: 12px;\n button {\n margin: 0;\n }\n"],["\n display: flex;\n font-size: 12px;\n button {\n margin: 0;\n }\n"]))),An=h.mb.button(Xr||(Xr=Object(a.f)(["\n outline: none;\n border: none;\n background-color: ",";\n text-align: center;\n cursor: pointer;\n color: ",";\n min-width: 80px;\n min-height: 30px;\n border-radius: ",";\n font-size: 12px;\n\n padding: 0 10px;\n\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n\n &:first-child {\n border-top-left-radius: ",";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: ",";\n }\n\n &:last-child {\n border-top-left-radius: 0;\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: 0;\n }\n\n ","\n\n ","\n"],["\n outline: none;\n border: none;\n background-color: ",";\n text-align: center;\n cursor: pointer;\n color: ",";\n min-width: 80px;\n min-height: 30px;\n border-radius: ",";\n font-size: 12px;\n\n padding: 0 10px;\n\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n\n &:first-child {\n border-top-left-radius: ",";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: ",";\n }\n\n &:last-child {\n border-top-left-radius: 0;\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: 0;\n }\n\n ","\n\n ","\n"])),(function(e){return e.theme.rightPanel.panelBackgroundColor}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.active,r=e.theme;return t&&"\n border-bottom: 4px solid "+r.colors.accent.main+";\n background-color: "+Object(Cn.a)(.05,r.rightPanel.panelBackgroundColor)+";\n "||""}),(function(e){var t=e.disabled,r=e.theme;return t&&"\n cursor: default;\n color: "+Object(Cn.f)(.3,r.colors.text.light)+";\n "||""})),On=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.onChange,r=e.active,n=e.hasResponse;return s.createElement(kn,null,s.createElement(An,{onClick:function(){return t(0)},active:0===r},n?"Edit Request":"Request"),s.createElement(An,{onClick:function(){return n&&t(1)},active:1===r,disabled:!n}," ","Response"," "))}}),t}(s.Component),Sn=m.e.input(Qr||(Qr=Object(a.f)(["\n cursor: pointer;\n vertical-align: middle;\n margin-left: 0;\n margin-right: 5px;\n height: 20px;\n"],["\n cursor: pointer;\n vertical-align: middle;\n margin-left: 0;\n margin-right: 5px;\n height: 20px;\n"]))),En=m.e.label(Zr||(Zr=Object(a.f)(["\n display: inline-block;\n cursor: pointer;\n vertical-align: middle;\n margin-bottom: 4px;\n position: relative;\n text-overflow: ellipsis;\n overflow: hidden;\n\n overflow-wrap: break-word;\n line-height: 20px;\n"],["\n display: inline-block;\n cursor: pointer;\n vertical-align: middle;\n margin-bottom: 4px;\n position: relative;\n text-overflow: ellipsis;\n overflow: hidden;\n\n overflow-wrap: break-word;\n line-height: 20px;\n"]))),jn=m.e.div(en||(en=Object(a.f)(["\n width: ",";\n display: inline-flex;\n\n & > label {\n white-space: ",";\n }\n"],["\n width: ",";\n display: inline-flex;\n\n & > label {\n white-space: ",";\n }\n"])),(function(e){return e.fullWidth?"100%":"50%"}),(function(e){return e.nowrap?"nowrap":"normal"})),Tn=s.forwardRef((function(e,t){var r=e.fullWidth,n=e.id,o=e.label,i=e.nowrap;return s.createElement(jn,{fullWidth:r,nowrap:i},s.createElement(Sn,Object(a.a)({},e,{type:"checkbox",ref:t})),s.createElement(En,{htmlFor:n},o))})),Mn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{collapsed:!0}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"onCheckBoxClick",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.target.value,r=e.target.checked;this.props.fieldApi.setTouched(!0);var n,o=this.props.fieldApi.getValue()||[];if(r)n=Object(a.h)(Object(a.h)([],o,!0),[t],!1);else{var i=o.indexOf(t);n=Object(a.h)(Object(a.h)([],o.slice(0,i),!0),o.slice(i+1),!0)}this.props.fieldApi.setValue(n)}}),Object.defineProperty(t.prototype,"isFieldChecked",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.props.fieldApi.getValue().includes(e)}}),Object.defineProperty(t.prototype,"toggle",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setState({collapsed:!this.state.collapsed})}}),Object.defineProperty(t.prototype,"selectAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.fieldApi.setValue(this.props.items)}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.fieldApi.setValue([])}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,r=t.items,n=t.fieldApi,o=t.validateOnChange,i=t.maxDisplayedItems,a=t.showControls,l=t.trimItemsLength,c=this.state.collapsed,u=n.getError(),f=i||11,p=l&&this.state.collapsed?r.slice(0,f):r;return s.createElement(Fn,null,a?s.createElement(Ln,null,s.createElement(ce.p,{onClick:function(){e.selectAll()}},"Select all"),s.createElement(ce.p,{onClick:function(){e.clearAll()}},"Clear")):null,s.createElement("div",null,p.map((function(t){return s.createElement(Tn,{nowrap:!0,id:t,value:t,checked:e.isFieldChecked(t),label:t,key:t,onChange:function(t){e.onCheckBoxClick(t),o&&n.validate()}})})),r.length>f&&l?s.createElement(In,{onClick:function(){e.toggle()}},c?"Show all":"Collapse"):null),u?s.createElement(v.b,null,u):"")}}),t}(s.Component),Pn=Object(c.b)(Mn),Ln=Object(h.mb)(ce.n)(tn||(tn=Object(a.f)(["\n opacity: 1;\n text-align: left;\n"],["\n opacity: 1;\n text-align: left;\n"]))),In=Object(h.mb)(ce.p)(rn||(rn=Object(a.f)(["\n float: right;\n"],["\n float: right;\n"]))),Fn=h.mb.div(nn||(nn=Object(a.f)(["\n margin-top: 10px;\n"],["\n margin-top: 10px;\n"])));function _n(e){var t=e.scopes,r=e.id,n=[];try{n=JSON.parse(Object(f.e)("auth."+r+".scopes"))}catch(e){}return t&&t.length?s.createElement(v.a,null,s.createElement(v.d,null," Scopes: "),s.createElement(Pn,{field:"auth."+r+".scopes",initialValue:n,items:t,showControls:!0,trimItemsLength:!0})):s.createElement(s.Fragment,null)}var Nn=r(170),Rn=function(){function e(){}return Object.defineProperty(e,"authorizeImplicit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t.authorizationUrl,n=t.clientId,o=t.scopes,i=t.extraParams,a=void 0===i?{}:i,s=t.routingBasePath,l=t.redirectUri,c=t.successCallback,u=t.errorCallback,f=Bn({date:(new Date).toString()}),p=new URL(r),d="/"===s?"":s,h=""+window.location.origin+d+"/oauth2-redirect.html";for(var v in p.searchParams.set("client_id",n),p.searchParams.set("redirect_uri",l||h),p.searchParams.set("response_type","token"),p.searchParams.set("state",f),Array.isArray(o)&&p.searchParams.set("scope",o.join(" ")),a)p.searchParams.set(v,a[v]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:n,scopes:o},state:f,successCallback:function(t){c(t),e.clearRedirectData("implicit")},errorCallback:function(t){u(t),e.clearRedirectData("implicit")}},window.open(p.toString())}}),Object.defineProperty(e,"authorizeAuthorizationCode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=t.authorizationUrl,o=t.tokenUrl,i=t.clientId,s=t.clientSecret,l=t.scopes,c=t.extraParams,u=void 0===c?{}:c,f=t.routingBasePath,p=t.redirectUri,d=t.successCallback,h=t.errorCallback,v=new URL(n),m="/"===f?"":f,g=""+window.location.origin+m+"/oauth2-redirect.html",y=Bn({date:(new Date).toString()});for(var b in v.searchParams.set("client_id",i),v.searchParams.set("redirect_uri",p||g),v.searchParams.set("response_type","code"),v.searchParams.set("state",y),Array.isArray(l)&&v.searchParams.set("scope",l.join(" ")),u)v.searchParams.set(b,u[b]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:n,clientId:i,scopes:l},state:y,successCallback:function(t){var n=t.auth_code;return Object(a.b)(r,void 0,void 0,(function(){var t;return Object(a.e)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:Nn.stringify(Object(a.a)({client_id:i,client_secret:s,code:n,grant_type:"authorization_code",redirect_uri:p||g},u))})];case 1:return[4,Dn(r.sent(),d,h)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),h(t),[3,4];case 4:return e.clearRedirectData("authorizationCode"),[2]}}))}))},errorCallback:function(t){h(t),e.clearRedirectData("authorizationCode")}},window.open(v.toString())}}),Object.defineProperty(e,"clearRedirectData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:function(){},errorCallback:function(){}}}}),Object.defineProperty(e,"authorizeClientCredentials",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tokenUrl,r=e.clientId,n=e.clientSecret,o=e.scopes,i=void 0===o?[]:o,s=e.extraParams,l=void 0===s?{}:s,c=e.successCallback,u=e.errorCallback;return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.e)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:Nn.stringify(Object(a.a)({client_id:r,client_secret:n,grant_type:"client_credentials",scope:Array.isArray(i)?i.join(" "):void 0},l))})];case 1:return[4,Dn(o.sent(),c,u)];case 2:return o.sent(),[3,4];case 3:return e=o.sent(),u(e),[3,4];case 4:return[2]}}))}))}}),e}();new Rn;function Dn(e,t,r){return Object(a.b)(this,void 0,void 0,(function(){var n,o,i,s,l,c;return Object(a.e)(this,(function(a){switch(a.label){case 0:return e.ok?[4,e.json()]:[3,2];case 1:return n=a.sent(),t(n),[3,7];case 2:return o=r,i=Error.bind,(e.headers.get("Content-Type")||"").indexOf("json")>-1?(c=(l=JSON).stringify,[4,e.json()]):[3,4];case 3:return s=c.apply(l,[a.sent()]),[3,6];case 4:return[4,e.text()];case 5:s=a.sent(),a.label=6;case 6:o.apply(void 0,[new(i.apply(Error,[void 0,s]))]),a.label=7;case 7:return[2]}}))}))}function Vn(e){void 0===e&&(e=32);for(var t="";t.length<e;)t+=Math.random().toString(32).substring(2);return t.substring(0,e)}function Bn(e){var t=Object(a.a)({randomStr:Vn()},e);return btoa(JSON.stringify(t))}function Un(e){return e.startsWith("//")?"https:"+e:e}function zn(e){if(e.values.auth)for(var t=0,r=Object.keys(e.values.auth);t<r.length;t++){var n=r[t],o=e.values.auth[n];Object(f.m)(n,o)}!function(e){for(var t=0,r=["path","query","header","cookie"];t<r.length;t++){var n,o=r[t];if(null!==(n=e.values)&&void 0!==n&&n[o])for(var i=0,a=Object.keys(e.values[o]);i<a.length;i++){var s=a[i];Object(f.l)(o,s,e.values[o][s])}}}(e)}var Wn=function(e,t){return e.filter((function(e){return e.in===t})).reduce((function(e,t){var r=t.in,n=t.name;return e[n]=Object(f.h)(r,n),e}),{})};function Hn(e){if(!e)return"Token is required"}var qn,Gn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{error:"",loading:!1,tokenMasked:!0}}),Object.defineProperty(t,"clearToken",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.props.formApi.setValue("auth."+t.props.id+".token",""),Object(f.p)("auth."+t.props.id+".token","")}}),Object.defineProperty(t,"toggleTokenMask",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.setState({tokenMasked:!t.state.tokenMasked})}}),Object.defineProperty(t,"requestToken",{enumerable:!0,configurable:!0,writable:!0,value:function(){return Object(a.b)(t,void 0,void 0,(function(){var e,t,r,n,o,i,s,l=this;return Object(a.e)(this,(function(a){switch(a.label){case 0:return this.state.loading?[2]:(e=this.props,t=e.server,r=e.flow,n=e.authCorsProxyUrl,o=n&&r.tokenUrl?n+Un(r.tokenUrl):r.tokenUrl,this.errors.client_id||this.errors.client_secret?(console.log("Provide client_id and client_secret"),[2]):(i=this.values.client_id,s=this.values.client_secret,i&&s?(this.setState({loading:!0}),[4,Rn.authorizeClientCredentials({tokenUrl:o.startsWith("http")?o:t+o,clientId:i,clientSecret:s,scopes:this.values.scopes,successCallback:function(e){l.props.formApi.setValue("auth."+l.props.id+".token",e),l.setState({loading:!1})},errorCallback:function(e){l.clearToken(),l.setState({error:e.message,loading:!1})}})]):(console.log("Provide client_id and client_secret"),[2])));case 1:return a.sent(),[2]}}))}))}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"values",{get:function(){return this.props.form.values&&this.props.form.values.auth&&this.props.form.values.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.props.form.errors&&this.props.form.errors.auth&&this.props.form.errors.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.loading,r=e.error,n=e.tokenMasked,o=this.props.id,i=Object.keys(this.props.flow.scopes),l=Object(f.e)("auth."+o+".token");l=l?JSON.parse(l):"";var c=Object(f.j)(o,"client_id"),u={field:"auth."+o+".client_id",fullWidth:!0,initialValue:Object(f.e)("auth."+o+".client_id")||this.props.clientId,initValue:Object(f.e)("auth."+o+".client_id")||this.props.clientId,placeholder:"Your OAuth2 app Client ID"};return s.createElement(s.Fragment,null,s.createElement(v.f,null,s.createElement(v.a,null,s.createElement(v.d,null,"Client ID:"),c?s.createElement(T,Object(a.a)({},u,{options:c})):s.createElement(k,Object(a.a)({},u,{type:"password"}))),s.createElement(v.a,null,s.createElement(v.d,null,"Client Secret:"),s.createElement(k,{type:"password",fullWidth:!0,field:"auth."+o+".client_secret",initialValue:Object(f.e)("auth."+o+".client_secret")})),s.createElement(k,{fullWidth:!0,field:"auth."+o+".token",type:"hidden",initialValue:l,validate:Hn}),s.createElement(_n,{id:o,scopes:i})),s.createElement($.a,{color:"primary",onClick:this.requestToken,blinking:t},t?"Loading...":"Request Token"),s.createElement(v.c,null," Access Token "),r?s.createElement(v.b,{style:{marginBottom:"1em"}},"Failed to request token: ",s.createElement("pre",null,r)," "):this.values.token&&this.values.token.access_token?s.createElement(v.j,null,s.createElement(v.l,{length:this.values.token.access_token.length,masked:n},this.values.token.access_token),s.createElement(v.k,{onClick:this.toggleTokenMask},n?"Show":"Hide"," "),s.createElement(v.i,{onClick:this.clearToken}," Clear ")):s.createElement(v.b,{style:{marginBottom:"1em"}},"No token"))}}),t}(s.Component),$n=h.mb.div(qn||(qn=Object(a.f)(["\n position: relative;\n height: 4px;\n display: block;\n width: 100%;\n background-color: ",";\n border-radius: ",";\n background-clip: padding-box;\n margin: 0.5rem 0 1rem 0;\n overflow: hidden;\n\n .determinate {\n position: absolute;\n background-color: inherit;\n top: 0;\n bottom: 0;\n background-color: ",";\n transition: width 0.3s linear;\n }\n .indeterminate {\n background-color: ",";\n }\n .indeterminate:before {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n .indeterminate:after {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n -webkit-animation-delay: 1.15s;\n animation-delay: 1.15s;\n }\n\n @-webkit-keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @-webkit-keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n @keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n"],["\n position: relative;\n height: 4px;\n display: block;\n width: 100%;\n background-color: ",";\n border-radius: ",";\n background-clip: padding-box;\n margin: 0.5rem 0 1rem 0;\n overflow: hidden;\n\n .determinate {\n position: absolute;\n background-color: inherit;\n top: 0;\n bottom: 0;\n background-color: ",";\n transition: width 0.3s linear;\n }\n .indeterminate {\n background-color: ",";\n }\n .indeterminate:before {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n .indeterminate:after {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n -webkit-animation-delay: 1.15s;\n animation-delay: 1.15s;\n }\n\n @-webkit-keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @-webkit-keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n @keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n"])),(function(e){return e.theme.colors.accent.light}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.colors.accent.main}),(function(e){return e.theme.colors.accent.main})),Kn=function(){return s.createElement($n,null,s.createElement("div",{className:"indeterminate"}))};function Jn(e){if(!e)return"Field is required"}var Yn,Xn,Qn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{error:null,loading:!1}}),Object.defineProperty(t,"clearToken",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.props.formApi.setValue("auth."+t.props.id+".token","")}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"values",{get:function(){return this.props.form.values&&this.props.form.values.auth&&this.props.form.values.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.props.form.errors&&this.props.form.errors.auth&&this.props.form.errors.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"handleAuthorize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e){this.props.formApi.validate();var r=this.props,n=r.flow,o=r.id,i=r.tokenUrl,s=r.authCorsProxyUrl;if(this.values.client_id&&("authorizationCode"!==n||this.values.client_secret)){this.setState({loading:!0,error:null});var l=s?s+Un(e):e,c=s&&i?s+Un(i):i,u=this.props.formApi.getValue("auth."+o+".scopes"),f={authorizationUrl:l.startsWith("http")?l:this.props.server+l,clientId:this.values.client_id,scopes:u,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:function(e){t.props.formApi.setValue("auth."+t.props.id+".token",e),t.setState({loading:!1,error:null})},errorCallback:function(e){t.setState({loading:!1,error:(null==e?void 0:e.message)||"Failed to retrieve the access token"})}};"implicit"===n&&Rn.authorizeImplicit(f),"authorizationCode"===n&&Rn.authorizeAuthorizationCode(Object(a.a)(Object(a.a)({},f),{tokenUrl:null!=c&&c.startsWith("http")?c:this.props.server+c,clientSecret:this.values.client_secret}))}}}}),Object.defineProperty(t.prototype,"handleLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.clearToken(),this.setState({error:null})}}),Object.defineProperty(t.prototype,"handleCancel",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setState({loading:!1,error:null}),Rn.clearRedirectData(this.props.flow)}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,r=this,n=this.state,o=n.error,i=n.loading,l=this.props,c=l.id,u=l.scopes,p=l.authorizationUrl,d=l.flow;if(!p)return s.createElement(v.b,null,"No flow info");var h=Object(f.e)("auth."+c+".token");h=h?JSON.parse(h):"";var m=Object(f.j)(c,"client_id"),g={field:"auth."+c+".client_id",fullWidth:!0,initialValue:Object(f.e)("auth."+c+".client_id")||this.props.clientId,initValue:Object(f.e)("auth."+c+".client_id")||this.props.clientId,placeholder:"Your OAuth2 app Client ID",validate:Jn,validateOnBlur:!0,validateOnChange:!0};return s.createElement("div",null,s.createElement(v.f,null,s.createElement(v.a,null,s.createElement(v.d,null," Client ID: "),m?s.createElement(T,Object(a.a)({},g,{options:m})):s.createElement(k,Object(a.a)({},g))),"authorizationCode"===d&&s.createElement(v.a,null,s.createElement(v.d,null,"Client Secret:"),s.createElement(k,{type:"password",fullWidth:!0,field:"auth."+c+".client_secret",initialValue:Object(f.e)("auth."+c+".client_secret"),validate:Jn,validateOnBlur:!0,validateOnChange:!0})),s.createElement(k,{fullWidth:!0,field:"auth."+c+".token",type:"hidden",initialValue:h,validate:Jn}),s.createElement(_n,{id:c,scopes:u}),this.values.token&&this.values.token.access_token?s.createElement(v.a,null,s.createElement(v.d,null," Access Token: "),s.createElement(C,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),s.createElement(eo,null,this.values.token&&this.values.token.access_token?s.createElement($.a,{fullWidth:!0,onClick:function(){r.handleLogout()}},"Log out"):s.createElement(s.Fragment,null,i?s.createElement(s.Fragment,null,s.createElement($.a,{fullWidth:!0,onClick:function(){r.handleCancel()}},"Cancel"),s.createElement(Kn,null)):s.createElement($.a,{fullWidth:!0,disabled:(null===(e=this.props)||void 0===e||null===(t=e.formApi)||void 0===t?void 0:t.getTouched("auth."+c+".client_id"))&&!this.values.client_id,onClick:function(){r.handleAuthorize(p)}},"Authorize"))),i||o||!this.values.token||!this.values.token.access_token&&s.createElement(v.f,null,s.createElement(v.a,null,i?s.createElement(v.e,null,"Please, finish your authorization flow or cancel authorization."):o?s.createElement(s.Fragment,null,s.createElement(Zn,null,s.createElement(v.b,null,o))):this.values.token&&this.values.token.access_token?null:s.createElement(v.e,null," No Access Token. Please, Authorize. "))))}}),Object.defineProperty(t,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:h.y}),t}(s.Component),Zn=h.mb.div(Yn||(Yn=Object(a.f)(["\n font-family: monospace;\n margin-top: 10px;\n line-height: 1;\n padding-left: 10px;\n border-left: 1px solid gray;\n"],["\n font-family: monospace;\n margin-top: 10px;\n line-height: 1;\n padding-left: 10px;\n border-left: 1px solid gray;\n"]))),eo=h.mb.div(Xn||(Xn=Object(a.f)(["\n margin-bottom: 15px;\n"],["\n margin-bottom: 15px;\n"])));function to(e){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.e)(this,(function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[2,t.sent().json()]}}))}))}function ro(e){var t,r=this,n=e.scheme,o=s.useState({}),i=o[0],l=o[1],c=s.useState(),u=c[0],f=c[1],p=s.useState(!1),d=p[0],h=p[1];s.useEffect((function(){m(n.openIdConnectUrl)}),[n.openIdConnectUrl]);var m=function(e){return Object(a.b)(r,void 0,void 0,(function(){var t,r;return Object(a.e)(this,(function(n){switch(n.label){case 0:h(!0),f(""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,to(e)];case 2:return t=n.sent(),l(t),[3,4];case 3:return r=n.sent(),f(r.message),[3,4];case 4:return h(!1),[2]}}))}))};return s.createElement("div",null,d?s.createElement("div",null,s.createElement("div",null,"Fetching OpenID Connect metadata..."),s.createElement(Kn,null)):s.createElement("div",null,u?s.createElement(v.b,null,u):null!=i&&null!==(t=i.response_types_supported)&&void 0!==t&&t.includes("token")?s.createElement(s.Fragment,null,s.createElement(oo,null,"OAuth2 Implicit Flow"),s.createElement(Qn,{key:e.id,authorizationUrl:i.authorization_endpoint,authCorsProxyUrl:e.authCorsProxyUrl,scopes:i.scopes_supported,server:e.server,id:e.id,form:e.form,formApi:e.formApi,clientId:e.clientId,flow:"implicit"})):s.createElement("div",null,"Unsupported flow")))}var no,oo=h.mb.div(no||(no=Object(a.f)(["\n margin-top: 5px;\n margin-bottom: 10px;\n"],["\n margin-top: 5px;\n margin-bottom: 10px;\n"]))),io=r(12);function ao(e){if(!e)return"Field is required"}function so(e){var t,r;if("cookie"===e.in)return t=e.name,(r=document.cookie.match("\\b"+t+"=([^;]*)\\b"))?r[1]:void 0}var lo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{activeScheme:0}}),Object.defineProperty(t,"handleSchemeChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){t.setState({activeScheme:e.idx}),Object(f.p)("securityRequirementName",e.value)}}),t}return Object(a.d)(t,e),Object.defineProperty(t,"getDerivedStateFromProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.operation.security.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})),r=Object(f.e)("securityRequirementName"),n=t.findIndex((function(e){return e===r}));return{activeScheme:n<0?0:n}}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.state.activeScheme,r=this.props.operation.security,n=r.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})).map((function(e,t){return{value:e,idx:t}}));return 0===n.length?null:s.createElement(s.Fragment,null,s.createElement(v.f,null,n.length>1&&s.createElement(v.a,null,s.createElement(h.f,{variant:"dark",fullWidth:!0,prefix:"Security scheme: ",options:n,value:n[t].value,onChange:this.handleSchemeChange}))||null,r[t].schemes.map((function(t){var r=Object(f.c)(t.id);if("apiKey"===t.type){var n=Object(f.j)(r,""),o={field:"auth."+r,fullWidth:!0,initialValue:so(t)||Object(f.e)("auth."+r),initValue:so(t)||Object(f.e)("auth."+r),validate:ao,validateOnBlur:!0,validateOnChange:!0};return s.createElement(v.a,{key:r},s.createElement(v.d,null," ",t.name,": "),n?s.createElement(T,Object(a.a)({},o,{options:n})):s.createElement(k,Object(a.a)({},o,{type:"password","data-cy":"apiKey-auth-password"})))}if("http"===t.type){if("basic"===t.scheme){var i=Object(f.j)(r,"username");o={field:"auth."+r+".username",fullWidth:!0,initialValue:Object(f.e)("auth."+r+".username"),initValue:Object(f.e)("auth."+r+".username"),validate:ao,validateOnBlur:!0,validateOnChange:!0};return s.createElement(s.Fragment,{key:r},s.createElement(v.a,null,s.createElement(v.d,null," ",Object(io.a)("tryItAuthBasicUsername"),": "),i?s.createElement(T,Object(a.a)({},o,{options:i})):s.createElement(k,Object(a.a)({},o))),s.createElement(v.a,null,s.createElement(v.d,null," ",Object(io.a)("tryItAuthBasicPassword"),": "),s.createElement(k,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:"auth."+r+".password",validate:ao,initialValue:Object(f.e)("auth."+r+".password"),validateOnBlur:!0,validateOnChange:!0})))}if("bearer"===t.scheme){var l=Object(f.j)(r,"");o={field:"auth."+r,fullWidth:!0,initialValue:Object(f.e)("auth."+r),initValue:Object(f.e)("auth."+r),validate:ao,validateOnBlur:!0,validateOnChange:!0};return s.createElement(s.Fragment,{key:r},s.createElement(v.a,null,s.createElement(v.d,null," Bearer Token: "),l?s.createElement(T,Object(a.a)({},o,{options:l})):s.createElement(k,Object(a.a)({},o,{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if("oauth2"===t.type&&t.flows&&t.flows.clientCredentials)return s.createElement(Gn,{key:r,flow:t.flows.clientCredentials,server:e.props.activeServer,authCorsProxyUrl:e.props.authCorsProxyUrl,id:r,form:e.props.form,formApi:e.props.formApi,clientId:t.flows.clientCredentials["x-defaultClientId"]||t["x-defaultClientId"]});var c,u,p;if("oauth2"===t.type&&t.flows&&t.flows.implicit)return s.createElement(Qn,{key:r,authorizationUrl:t.flows.implicit.authorizationUrl,authCorsProxyUrl:e.props.authCorsProxyUrl,scopes:Object.keys((null==t||null===(c=t.flows)||void 0===c||null===(u=c.implicit)||void 0===u?void 0:u.scopes)||{}),server:e.props.activeServer,id:r,form:e.props.form,formApi:e.props.formApi,clientId:t.flows.implicit["x-defaultClientId"]||t["x-defaultClientId"],flow:"implicit"});if("oauth2"===t.type&&t.flows&&t.flows.authorizationCode)return s.createElement(Qn,{key:r,authorizationUrl:t.flows.authorizationCode.authorizationUrl,tokenUrl:t.flows.authorizationCode.tokenUrl,authCorsProxyUrl:e.props.authCorsProxyUrl,scopes:Object.keys((null===(p=t.flows.authorizationCode)||void 0===p?void 0:p.scopes)||{}),server:e.props.activeServer,id:r,form:e.props.form,formApi:e.props.formApi,clientId:t.flows.authorizationCode["x-defaultClientId"]||t["x-defaultClientId"],flow:"authorizationCode"});if("oauth2"===t.type){var d=Object(f.e)("auth."+r+".token");return d=d?JSON.parse(d):{},s.createElement(s.Fragment,{key:r},s.createElement(v.a,null,s.createElement(v.d,null," Access Token Type: "),s.createElement(k,{fullWidth:!0,field:"auth."+r+".token.token_type",initialValue:d.token_type||"Bearer"})),s.createElement(v.a,null,s.createElement(v.d,null," Access Token: "),s.createElement(k,{type:"password",fullWidth:!0,field:"auth."+r+".token.access_token",validate:ao,initialValue:d.access_token,validateOnBlur:!0,validateOnChange:!0})))}if("openIdConnect"===t.type)return s.createElement(ro,{key:r,server:e.props.activeServer,authCorsProxyUrl:e.props.authCorsProxyUrl,id:r,form:e.props.form,formApi:e.props.formApi,scheme:t,clientId:t["x-defaultClientId"]})}}))),s.createElement("small",null,s.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}),t}(s.Component),co=r(89),uo=r(579),fo=r.n(uo),po=r(670),ho=r.n(po),vo=r(735),mo=r.n(vo),go=r(34),yo=r.n(go),bo=r(676),xo=r.n(bo),wo=r(588),Co=r.n(wo),ko=r(623),Ao=r.n(ko),Oo=r(682),So=r.n(Oo),Eo=r(646),jo=r.n(Eo),To=r(686),Mo=r.n(To),Po=r(920),Lo=r.n(Po),Io=r(924),Fo=r.n(Io),_o=r(687),No=r.n(_o),Ro=r(597),Do=r.n(Ro),Vo=r(586),Bo=r.n(Vo),Uo=r(576),zo=r.n(Uo),Wo=r(757),Ho=r.n(Wo),qo=r(598),Go=r.n(qo),$o=(r(942),r(943)),Ko=r.n($o),Jo=r(185),Yo=r.n(Jo),Xo=r(691),Qo=r.n(Xo),Zo=r(637),ei=r.n(Zo),ti=r(67),ri=r(697),ni=r.n(ri),oi=r(698),ii=r.n(oi),ai=r(984),si=r.n(ai),li=r(699),ci=r.n(li),ui=r(997),fi=r.n(ui),pi=r(1003),di=r.n(pi),hi=r(1011),vi=r.n(hi),mi=r(1016),gi=function(e){var t=function(e,t){return{name:e,value:t}};return ei()(e.prototype.set)||ei()(e.prototype.get)||ei()(e.prototype.getAll)||ei()(e.prototype.has)?e:function(e){fi()(n,e);var r=di()(n);function n(e){var t;return ni()(this,n),(t=r.call(this,e)).entryList=[],t}return ii()(n,[{key:"append",value:function(e,r,o){return this.entryList.push(t(e,r)),si()(ci()(n.prototype),"append",this).call(this,e,r,o)}},{key:"set",value:function(e,r){var n,o=t(e,r);this.entryList=Go()(n=this.entryList).call(n,(function(t){return t.name!==e})),this.entryList.push(o)}},{key:"get",value:function(e){var t,r=vi()(t=this.entryList).call(t,(function(t){return t.name===e}));return void 0===r?null:r}},{key:"getAll",value:function(e){var t,r;return Do()(t=Go()(r=this.entryList).call(r,(function(t){return t.name===e}))).call(t,(function(e){return e.value}))}},{key:"has",value:function(e){return this.entryList.some((function(t){return t.name===e}))}}]),n}(e)}(r.n(mi).a),yi=r(652),bi=r.n(yi),xi=r(599),wi=r.n(xi),Ci=r(67).Buffer,ki=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},Ai=function(e){return/^[a-z0-9\-._~]+$/i.test(e)};function Oi(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.escape,o=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&n?o?JSON.parse(e):Do()(t=bi()(e)).call(t,(function(e){var t,r;return Ai(e)||ki(e)&&"unsafe"===n?e:Do()(t=Do()(r=Ci.from(e).toJSON().data||[]).call(r,(function(e){var t;return wi()(t="0".concat(e.toString(16).toUpperCase())).call(t,-2)}))).call(t,(function(e){return"%".concat(e)})).join("")})).join(""):e}function Si(e){var t=e.value;return Array.isArray(t)?function(e){var t=e.key,r=e.value,n=e.style,o=e.explode,i=e.escape,a=function(e){return Oi(e,{escape:i})};if("simple"===n)return Do()(r).call(r,(function(e){return a(e)})).join(",");if("label"===n)return".".concat(Do()(r).call(r,(function(e){return a(e)})).join("."));if("matrix"===n)return Do()(r).call(r,(function(e){return a(e)})).reduce((function(e,r){var n,i,a;return!e||o?zo()(i=zo()(a="".concat(e||"",";")).call(a,t,"=")).call(i,r):zo()(n="".concat(e,",")).call(n,r)}),"");if("form"===n){var s=o?"&".concat(t,"="):",";return Do()(r).call(r,(function(e){return a(e)})).join(s)}if("spaceDelimited"===n){var l=o?"".concat(t,"="):"";return Do()(r).call(r,(function(e){return a(e)})).join(" ".concat(l))}if("pipeDelimited"===n){var c=o?"".concat(t,"="):"";return Do()(r).call(r,(function(e){return a(e)})).join("|".concat(c))}return}(e):"object"===Co()(t)?function(e){var t=e.key,r=e.value,n=e.style,o=e.explode,i=e.escape,a=function(e){return Oi(e,{escape:i})},s=Bo()(r);if("simple"===n)return s.reduce((function(e,t){var n,i,s,l=a(r[t]),c=o?"=":",",u=e?"".concat(e,","):"";return zo()(n=zo()(i=zo()(s="".concat(u)).call(s,t)).call(i,c)).call(n,l)}),"");if("label"===n)return s.reduce((function(e,t){var n,i,s,l=a(r[t]),c=o?"=":".",u=e?"".concat(e,"."):".";return zo()(n=zo()(i=zo()(s="".concat(u)).call(s,t)).call(i,c)).call(n,l)}),"");if("matrix"===n&&o)return s.reduce((function(e,t){var n,o,i=a(r[t]),s=e?"".concat(e,";"):";";return zo()(n=zo()(o="".concat(s)).call(o,t,"=")).call(n,i)}),"");if("matrix"===n)return s.reduce((function(e,n){var o,i,s=a(r[n]),l=e?"".concat(e,","):";".concat(t,"=");return zo()(o=zo()(i="".concat(l)).call(i,n,",")).call(o,s)}),"");if("form"===n)return s.reduce((function(e,t){var n,i,s,l,c=a(r[t]),u=e?zo()(n="".concat(e)).call(n,o?"&":","):"",f=o?"=":",";return zo()(i=zo()(s=zo()(l="".concat(u)).call(l,t)).call(s,f)).call(i,c)}),"");return}(e):function(e){var t,r=e.key,n=e.value,o=e.style,i=e.escape,a=function(e){return Oi(e,{escape:i})};if("simple"===o)return a(n);if("label"===o)return".".concat(a(n));if("matrix"===o)return zo()(t=";".concat(r,"=")).call(t,a(n));if("form"===o)return a(n);if("deepObject"===o)return a(n);return}(e)}var Ei={serializeRes:Li,mergeInQueryOrForm:Wi};function ji(e){return Ti.apply(this,arguments)}function Ti(){return(Ti=So()(jo.a.mark((function e(t){var r,n,o,i,a,s=arguments;return jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.length>1&&void 0!==s[1]?s[1]:{},"object"===Co()(t)&&(t=(r=t).url),r.headers=r.headers||{},Ei.mergeInQueryOrForm(r),r.headers&&Bo()(r.headers).forEach((function(e){var t=r.headers[e];"string"==typeof t&&(r.headers[e]=t.replace(/\n+/g," "))})),!r.requestInterceptor){e.next=12;break}return e.next=8,r.requestInterceptor(r);case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=r;case 11:r=e.t0;case 12:return n=r.headers["content-type"]||r.headers["Content-Type"],/multipart\/form-data/i.test(n)&&(delete r.headers["content-type"],delete r.headers["Content-Type"]),e.prev=14,e.next=17,(r.userFetch||fetch)(r.url,r);case 17:return o=e.sent,e.next=20,Ei.serializeRes(o,t,r);case 20:if(o=e.sent,!r.responseInterceptor){e.next=28;break}return e.next=24,r.responseInterceptor(o);case 24:if(e.t1=e.sent,e.t1){e.next=27;break}e.t1=o;case 27:o=e.t1;case 28:e.next=39;break;case 30:if(e.prev=30,e.t2=e.catch(14),o){e.next=34;break}throw e.t2;case 34:throw(i=new Error(o.statusText)).status=o.status,i.statusCode=o.status,i.responseError=e.t2,i;case 39:if(o.ok){e.next=45;break}throw(a=new Error(o.statusText)).status=o.status,a.statusCode=o.status,a.response=o,a;case 45:return e.abrupt("return",o);case 46:case"end":return e.stop()}}),e,null,[[14,30]])})))).apply(this,arguments)}var Mi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function Pi(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):Yo.a.safeLoad(e)}function Li(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.loadSpec,o=void 0!==n&&n,i={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:Fi(e.headers)},a=i.headers["content-type"],s=o||Mi(a),l=s?e.text:e.blob||e.buffer;return l.call(e).then((function(e){if(i.text=e,i.data=e,s)try{var t=Pi(e,a);i.body=t,i.obj=t}catch(e){i.parseError=e}return i}))}function Ii(e){return Mo()(e).call(e,", ")?e.split(", "):e}function Fi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ei()(Lo()(e))?Fo()(Lo()(e).call(e)).reduce((function(e,t){var r=Ao()(t,2),n=r[0],o=r[1];return e[n]=Ii(o),e}),{}):{}}function _i(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==Co()(e)||"string"!=typeof e.uri):"undefined"!=typeof File&&e instanceof File||("undefined"!=typeof Blob&&e instanceof Blob||(void 0!==ti.Buffer&&e instanceof ti.Buffer||null!==e&&"object"===Co()(e)&&"function"==typeof e.pipe))}function Ni(e,t){return Array.isArray(e)&&e.some((function(e){return _i(e,t)}))}var Ri={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Di={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function Vi(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.collectionFormat,o=t.allowEmptyValue,i=t.serializationOption,a=t.encoding,s="object"!==Co()(t)||Array.isArray(t)?t:t.value,l=r?function(e){return e.toString()}:function(e){return encodeURIComponent(e)},c=l(e);if(void 0===s&&o)return[[c,""]];if(_i(s)||Ni(s))return[[c,s]];if(i)return Bi(e,s,r,i);if(a){if([Co()(a.style),Co()(a.explode),Co()(a.allowReserved)].some((function(e){return"undefined"!==e})))return Bi(e,s,r,Qo()(a,["style","explode","allowReserved"]));if(a.contentType){if("application/json"===a.contentType){var u="string"==typeof s?s:No()(s);return[[c,l(u)]]}return[[c,l(s.toString())]]}return"object"!==Co()(s)?[[c,l(s)]]:Array.isArray(s)&&s.every((function(e){return"object"!==Co()(e)}))?[[c,Do()(s).call(s,l).join(",")]]:[[c,l(No()(s))]]}return"object"!==Co()(s)?[[c,l(s)]]:Array.isArray(s)?"multi"===n?[[c,Do()(s).call(s,l)]]:[[c,Do()(s).call(s,l).join(Di[n||"csv"])]]:[[c,""]]}function Bi(e,t,r,n){var o,i,a,s=n.style||"form",l=void 0===n.explode?"form"===s:n.explode,c=!r&&(n&&n.allowReserved?"unsafe":"reserved"),u=function(e){return Oi(e,{escape:c})},f=r?function(e){return e}:function(e){return Oi(e,{escape:c})};return"object"!==Co()(t)?[[f(e),u(t)]]:Array.isArray(t)?l?[[f(e),Do()(t).call(t,u)]]:[[f(e),Do()(t).call(t,u).join(Ri[s])]]:"deepObject"===s?Do()(i=Bo()(t)).call(i,(function(r){var n;return[f(zo()(n="".concat(e,"[")).call(n,r,"]")),u(t[r])]})):l?Do()(a=Bo()(t)).call(a,(function(e){return[f(e),u(t[e])]})):[[f(e),Do()(o=Bo()(t)).call(o,(function(e){var r;return[zo()(r="".concat(f(e),",")).call(r,u(t[e]))]})).join(",")]]}function Ui(e){return Ho()(e).reduce((function(e,t){var r,n=Ao()(t,2),o=n[0],i=n[1],a=xo()(Vi(o,i,!0));try{for(a.s();!(r=a.n()).done;){var s=Ao()(r.value,2),l=s[0],c=s[1];if(Array.isArray(c)){var u,f=xo()(c);try{for(f.s();!(u=f.n()).done;){var p=u.value;e.append(l,p)}}catch(e){f.e(e)}finally{f.f()}}else e.append(l,c)}}catch(e){a.e(e)}finally{a.f()}return e}),new gi)}function zi(e){var t=Bo()(e).reduce((function(t,r){var n,o=xo()(Vi(r,e[r]));try{for(o.s();!(n=o.n()).done;){var i=Ao()(n.value,2),a=i[0],s=i[1];t[a]=s}}catch(e){o.e(e)}finally{o.f()}return t}),{});return Ko.a.stringify(t,{encode:!1,indices:!1})||""}function Wi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,n=e.query,o=e.form,i=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Go()(t).call(t,(function(e){return e})).join("&");return n?"?".concat(n):""};if(o){var a=Bo()(o).some((function(e){var t=o[e].value;return _i(t)||Ni(t)})),s=e.headers["content-type"]||e.headers["Content-Type"];a||/multipart\/form-data/i.test(s)?e.body=Ui(e.form):e.body=zi(o),delete e.form}if(n){var l=r.split("?"),c=Ao()(l,2),u=c[0],f=c[1],p="";if(f){var d=Ko.a.parse(f),h=Bo()(n);h.forEach((function(e){return delete d[e]})),p=Ko.a.stringify(d,{encode:!0})}var v=i(p,zi(n));e.url=u+v,delete e.query}return e}var Hi=r(626),qi=r.n(Hi),Gi=r(762),$i=r.n(Gi),Ki=r(1026),Ji=r.n(Ki),Yi=r(1031),Xi=r.n(Yi),Qi=r(1062),Zi=r.n(Qi),ea=r(725),ta=r.n(ea),ra=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),na=Object.prototype.hasOwnProperty;function oa(e,t){return na.call(e,t)}function ia(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);t=[];for(var n in e)oa(e,n)&&t.push(n);return t}function aa(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function sa(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function la(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function ca(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ua(e,t){var r=[e];for(var n in t){var o="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==o&&r.push(n+": "+o)}return r.join("\n")}var fa=function(e){function t(t,r,n,o,i){var a=this.constructor,s=e.call(this,ua(t,{name:r,index:n,operation:o,tree:i}))||this;return s.name=r,s.index=n,s.operation=o,s.tree=i,Object.setPrototypeOf(s,a.prototype),s.message=ua(t,{name:r,index:n,operation:o,tree:i}),s}return ra(t,e),t}(Error),pa=fa,da=aa,ha={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=ma(r,this.path);n&&(n=aa(n));var o=ga(r,{op:"remove",path:this.from}).removed;return ga(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=ma(r,this.from);return ga(r,{op:"add",path:this.path,value:aa(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Ca(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},va={add:function(e,t,r){return sa(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:ha.move,copy:ha.copy,test:ha.test,_get:ha._get};function ma(e,t){if(""==t)return e;var r={op:"_get",path:t};return ga(e,r),r.value}function ga(e,t,r,n,o,i){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===i&&(i=0),r&&("function"==typeof r?r(t,0,e,t.path):xa(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=ma(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=Ca(e,t.value),!1===a.test)throw new pa("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(r)throw new pa("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}n||(e=aa(e));var s=(t.path||"").split("/"),l=e,c=1,u=s.length,f=void 0,p=void 0,d=void 0;for(d="function"==typeof r?r:xa;;){if(p=s[c],o&&"__proto__"==p)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===f&&(void 0===l[p]?f=s.slice(0,c).join("/"):c==u-1&&(f=t.path),void 0!==f&&d(t,0,e,f)),c++,Array.isArray(l)){if("-"===p)p=l.length;else{if(r&&!sa(p))throw new pa("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);sa(p)&&(p=~~p)}if(c>=u){if(r&&"add"===t.op&&p>l.length)throw new pa("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);if(!1===(a=va[t.op].call(t,l,p,e)).test)throw new pa("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(p&&-1!=p.indexOf("~")&&(p=ca(p)),c>=u){if(!1===(a=ha[t.op].call(t,l,p,e)).test)throw new pa("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}l=l[p]}}function ya(e,t,r,n,o){if(void 0===n&&(n=!0),void 0===o&&(o=!0),r&&!Array.isArray(t))throw new pa("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=aa(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=ga(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function ba(e,t,r){var n=ga(e,t);if(!1===n.test)throw new pa("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function xa(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new pa("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!ha[e.op])throw new pa("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new pa("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new pa('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new pa("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new pa("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0}else if("object"==typeof t){var o=ia(t),i=o.length;for(r=0;r<i;r++)if(e(t[o[r]]))return!0}return!1}(e.value))throw new pa("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new pa("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new pa("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var a=wa([{op:"_get",path:e.from,value:void 0}],r);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new pa("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function wa(e,t,r){try{if(!Array.isArray(e))throw new pa("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)ya(aa(t),aa(e),r||!0);else{r=r||xa;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof pa)return e;throw e}}function Ca(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,o,i=Array.isArray(e),a=Array.isArray(t);if(i&&a){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!Ca(e[r],t[r]))return!1;return!0}if(i!=a)return!1;var s=Object.keys(e);if((n=s.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(s[r]))return!1;for(r=n;0!=r--;)if(!Ca(e[o=s[r]],t[o]))return!1;return!0}return e!=e&&t!=t}
7
+ (this.webpackJsonpRedoclyReferenceDocs=this.webpackJsonpRedoclyReferenceDocs||[]).push([[0],Array(564).concat([function(e,t,r){"use strict";r.r(t),r.d(t,"Console",(function(){return _l}));var n={};r.r(n),r.d(n,"JsonPatchError",(function(){return fa})),r.d(n,"deepClone",(function(){return pa})),r.d(n,"getValueByPointer",(function(){return va})),r.d(n,"applyOperation",(function(){return ma})),r.d(n,"applyPatch",(function(){return ga})),r.d(n,"applyReducer",(function(){return ya})),r.d(n,"validator",(function(){return ba})),r.d(n,"validate",(function(){return xa})),r.d(n,"_areEquals",(function(){return wa}));var o={};r.r(o),r.d(o,"unobserve",(function(){return Oa})),r.d(o,"observe",(function(){return Sa})),r.d(o,"generate",(function(){return Ea})),r.d(o,"compare",(function(){return Ta}));var i={};r.r(i),r.d(i,"path",(function(){return hl})),r.d(i,"query",(function(){return vl})),r.d(i,"header",(function(){return gl})),r.d(i,"cookie",(function(){return yl}));var a=r(1),s=r(0),l=r.n(s),c=r(591),u=r(9),f=r(19),p=r(99),d=r(177),h=r(4),v=r(150),m=r(3),g=Object(m.d)(A||(A=Object(a.f)(["\n border: none;\n outline: none;\n padding: 8px;\n border-radius: ",";\n background-color: ",";\n ","\n\n &::placeholder {\n opacity: 0.6;\n color: ",";\n }\n\n &:-webkit-autofill {\n background-color: ",";\n }\n"],["\n border: none;\n outline: none;\n padding: 8px;\n border-radius: ",";\n background-color: ",";\n ","\n\n &::placeholder {\n opacity: 0.6;\n color: ",";\n }\n\n &:-webkit-autofill {\n background-color: ",";\n }\n"])),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.rightPanel.panelControlsBackgroundColor}),(function(e){var t=e.theme;return Object(m.h)({color:t.colors.text.light,fontFamily:t.typography.code.fontFamily,fontSize:t.typography.fontSize})}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.rightPanel.panelBackgroundColor})),y=m.e.div(O||(O=Object(a.f)(["\n display: ",";\n ","\n"],["\n display: ",";\n ","\n"])),(function(e){return"hidden"===e.type?"none":"inline-block"}),(function(e){return e.fullWidth?"width: 100%;":""})),b=m.e.div(S||(S=Object(a.f)(["\n position: relative;\n"],["\n position: relative;\n"]))),x=m.e.input(E||(E=Object(a.f)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"])),g,(function(e){return"password"===e.inputType?"padding-right: 40px;":""}),(function(e){return e.fullWidth?"width: 100%;":""})),w=m.e.span(j||(j=Object(a.f)(["\n position: absolute;\n right: 0;\n line-height: normal;\n\n font-size: 0.8em;\n padding: calc(8px / 0.8);\n cursor: pointer;\n text-align: center;\n ","\n"],["\n position: absolute;\n right: 0;\n line-height: normal;\n\n font-size: 0.8em;\n padding: calc(8px / 0.8);\n cursor: pointer;\n text-align: center;\n ","\n"])),(function(e){var t=e.theme;return Object(m.h)({color:t.rightPanel.textColor})}));var C=l.a.forwardRef((function(e,t){var r=e.fullWidth,n=e.errorMessage,o=e.type,i=l.a.useState("password"===o),s=i[0],c=i[1],u=l.a.useCallback((function(){c(!s)}),[s]);return l.a.createElement(y,{fullWidth:r,type:o},l.a.createElement(b,null,l.a.createElement(x,Object(a.a)({},e,{type:s?"password":"text",inputType:o,ref:t})),"password"===o&&l.a.createElement(w,{onClick:u}," ",s?"show":"hide"," ")),n?l.a.createElement(v.b,null,n):null)}));function k(e){var t=Object(c.c)(Object(a.a)({fieldType:"text"},e)),r=t.userProps,n=t.render,o=t.fieldState,i=t.informed;return n(l.a.createElement(C,Object(a.a)({},r,i,{errorMessage:o.error})))}var A,O,S,E,j,T=Object(c.b)((function(e){var t=e.initValue,r=e.options,n=e.fieldApi,o=e.fieldState,i=r.map((function(e,t){return{value:e.title||e.value,idx:t,origValue:e.value}})),a=i.find((function(e){return e.origValue===t})),s=l.a.useState(null==a?void 0:a.value),c=s[0],u=s[1];l.a.useEffect((function(){t&&n.setValue(t)}),[]);var f=l.a.useCallback((function(e){n.setValue(i[e.idx].origValue),u(i[e.idx].value)}),[i]);return l.a.createElement(y,{fullWidth:!0},l.a.createElement(h.f,{fullWidth:!0,variant:"dark",value:c,options:i,onChange:f}),o.error?l.a.createElement(v.b,null,o.error):null)}));function M(e){var t=e.name,r=e.value,n=e.description,o=e.variableEnum,i=e.onChange,a=e.defaultValue,l=o?o.map((function(e,t){return{value:e,idx:t}})):[];return s.createElement(v.a,null,s.createElement(v.d,null,t,":"),l&&l.length?s.createElement(h.f,{fullWidth:!0,variant:"dark",openUp:!0,value:r,options:l,onChange:function(e){return i(e.value)}}):s.createElement(C,{fullWidth:!0,value:r,onChange:function(e){return i(e.target.value)},placeholder:a}),n&&s.createElement(I,null,n))}var P,L,I=h.mb.small(P||(P=Object(a.f)(["\n display: inline-block;\n margin-top: 5px;\n color: #d0d0d0;\n"],["\n display: inline-block;\n margin-top: 5px;\n color: #d0d0d0;\n"]))),F=h.mb.div(L||(L=Object(a.f)(["\n margin-top: 20px;\n"],["\n margin-top: 20px;\n"]))),_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{activeIdx:0,variables:{}}}),Object.defineProperty(t,"handleChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var r=t.props.operation.servers.find((function(t){return t.url===e.serverUrl})),n=r&&V(r)||{};t.props.onChange({url:e.serverUrl,variables:n}),Object(f.p)("serverUrl",e.serverUrl),t.setState({variables:n})}}),Object.defineProperty(t,"handleVariableChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e,r){var n,o,i=Object(a.a)(Object(a.a)({},t.state.variables),((n={})[e]=r,n));t.setState({variables:i});var s=Object(f.e)("variables"),l=s&&JSON.parse(s)||{};Object(f.p)("variables",JSON.stringify(Object(a.a)(Object(a.a)({},l),((o={})[e]=r,o))));var c=t.props.operation.servers[t.state.activeIdx];t.props.onChange(Object(a.a)(Object(a.a)({},c),{variables:i}))}}),t}return Object(a.d)(t,e),Object.defineProperty(t,"getDerivedStateFromProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.operation,r=Object(f.e)("serverUrl"),n=t.servers.findIndex((function(e){return e.url===r}));return{activeIdx:n<0?0:n}}}),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props.operation.servers[this.state.activeIdx],t=V(e);this.props.onChange(Object(a.a)(Object(a.a)({},e),{variables:t})),this.setState({variables:t})}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.state.activeIdx,r=this.props.operation.servers.map((function(t){return{serverUrl:t.url,value:"\n "+D(R(t.url,e.state.variables),t.variables)+"\n - "+(t.description||"Default")+"\n "}})),n=Object.keys(this.state.variables);return s.createElement(F,null,s.createElement(v.d,{htmlFor:"server"},"Target server: "),s.createElement(v.a,null,s.createElement(h.f,{openUp:!0,variant:"dark",value:r[t].value,options:r,onChange:this.handleChange})),n.length?n.map((function(t){var r=e.props.operation.servers[e.state.activeIdx].variables[t];return s.createElement(M,{key:t,name:t,value:e.state.variables[t],defaultValue:r.default,onChange:function(r){return e.handleVariableChange(t,r)},variableEnum:r.enum,description:r.description})})):null)}}),t=Object(a.c)([u.a],t)}(s.Component),N=/(?:{)(\w+)(?:})/g;function R(e,t){return void 0===t&&(t={}),e.replace(N,(function(e,r){return t[r]||e}))}function D(e,t){return void 0===t&&(t={}),e.replace(N,(function(e,r){return t[r]&&t[r].default||e}))}function V(e){if(!e.variables)return{};var t=Object(f.e)("variables"),r=t&&JSON.parse(t)||{},n={};return Object.keys(e.variables).forEach((function(t){n[t]=e.variables[t].default||"",Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t])})),Object(a.a)({},n)}var B,U=Object(c.b)((function(e){var t=e.initValue,r=e.paramEnum,n=e.fieldApi,o=s.useState(t),i=o[0],a=o[1],l=r.map((function(e,t){return{id:String(t),value:e}}));return s.useEffect((function(){t&&n.setValue(t)}),[]),s.createElement(h.f,{fullWidth:!0,variant:"dark",value:i,options:l,onChange:function(e){n.setValue(e.value),a(e.value)}})}));!function(e){e.ARRAY="array",e.OBJECT="object"}(B||(B={}));var z=function(e){return"("+e.schema.type+")"+(e.example?" "+e.example:"")};var W=["path","query","cookie","header"];function H(e){var t=e.values,r=e.operation;function n(e,r){var n=s.useMemo((function(){return function(e){return function(t){if(e.required&&!t)return"Field is required";if(e.required&&e.schema.type===B.ARRAY&&Array.isArray(t)){if(t.length>(e.schema.rawSchema&&e.schema.rawSchema.maxItems||1/0))return"Too many items selected, maximum "+e.schema.rawSchema.maxItems;if(t.length<(e.schema.rawSchema&&e.schema.rawSchema.minItems||0)){var r=e.schema.rawSchema.minItems;return"You should select at least "+(1===r?r+" item":r+" items")}}}}(r)}),[r]),o=Array.isArray(r.schema.enum)&&r.schema.enum.length?r.schema.enum:void 0,i=function(e){if(e.schema.type===B.ARRAY){var t=e.schema.default||e.schema.example;if(!t&&e.schema.rawSchema.items){if(e.schema.rawSchema.items.default)return[e.schema.rawSchema.items.default];if(e.schema.rawSchema.items.example)return[e.schema.rawSchema.items.example]}return t||[]}return e.schema.default||e.schema.example}(r);return o?s.createElement(v.a,null,s.createElement(U,{initValue:i,paramEnum:o,field:e})):s.createElement(k,{fullWidth:!0,"data-cy":"parameter-input",id:e,field:e,placeholder:z(r),validate:n,initialValue:i||Object(f.f)(t,e),validateOnBlur:!0,validateOnChange:!0})}function o(e,t,r){var i,l=r?Object(f.b)(r,e.name):e.name,c=function(e){var t=e.oneOfType,r=e.type,n=e.items;return t||r===B.ARRAY&&(null==n?void 0:n.type)===B.OBJECT&&"Array of objects"}(e.schema);if(c&&console.warn('Unsupported parameter definition: "'+c+'"'),e.schema.type===B.OBJECT)return null===(i=e.schema.fields)||void 0===i?void 0:i.map((function(e){return o(e,t,l)}));var u=r?[t,r]:[e.in],p=f.b.apply(void 0,Object(a.h)(Object(a.h)([],u,!1),[e.name],!1));return s.createElement(v.a,{key:p},s.createElement(v.d,{required:e.required},l,":"),c?s.createElement(v.e,null,"Unsupported field schema definition"):n(p,e))}var i,l,c=(i=r.parameters||[],l={},i.forEach((function(e){var t,r,n;t=l,r=e.in,n=e,t[r]||(t[r]=[]),t[r].push(n)})),l);return s.createElement(v.h,null,W.map((function(e){return function(e,t){return t&&t.length?s.createElement(s.Fragment,{key:e},s.createElement(v.a,null,s.createElement(v.g,null," # ",e," parameters "),s.createElement("span",null," ")),t.map((function(t){return o(t,e)}))):null}(e,c[e])})))}var q=r(15),G=r(215),$=r(26);function K(e,t,r){var n=t.path||{},o=t.query||{},i=Object.keys(o),a=R(e,n);return i.length&&(a+="?"+i.map((function(e){if(!o[e])return"";var t=function(e){return r.find((function(t){return t.name===e&&"query"===t.in}))}(e);return t?Object(h.lb)(t,o[e]):e+"="+encodeURIComponent(o[e])})).filter(Boolean).join("&")),a}var J,Y,X,Q,Z,ee,te,re,ne,oe,ie,ae=function(e){var t=e.loading,r=e.operation,n=e.hasResponse,o=e.execute,i=e.params,a=void 0===i?{}:i;return s.createElement(le,null,s.createElement(G.b,null,s.createElement($.c,{type:r.httpVerb},r.httpVerb),s.createElement(G.a,{wrap:"true"},K(r.path,a,r.parameters))),s.createElement(se,{"data-cy":"send-button",color:"primary",blinking:t,onClick:function(){t||o()}},t?"Sending...":n?"Resend":"Send"))},se=Object(h.mb)($.a)(J||(J=Object(a.f)(["\n width: ",";\n"],["\n width: ",";\n"])),(function(e){return e.theme.components.tryItSendButton.fullWidth?"100%":"auto"})),le=Object(h.mb)(q.c)(Y||(Y=Object(a.f)(["\n ",";\n"],["\n ",";\n"])),(function(e){return e.theme.components.tryItSendButton.fullWidth?"\n flex-direction: column;\n align-items: flex-start;":""})),ce=r(8),ue=h.mb.div(X||(X=Object(a.f)(["\n margin-bottom: 10px;\n"],["\n margin-bottom: 10px;\n"]))),fe=h.mb.div(Q||(Q=Object(a.f)(["\n display: inline-block;\n margin-right: 20px;\n padding: 2px 0;\n text-align: center;\n color: ",";\n"],["\n display: inline-block;\n margin-right: 20px;\n padding: 2px 0;\n text-align: center;\n color: ",";\n"])),(function(e){return e.theme.colors.text.light})),pe=Object(h.mb)(fe)(Z||(Z=Object(a.f)(["\n color: ",";\n"],["\n color: ",";\n"])),(function(e){var t=e.theme,r=e.code;return r>=200&&r<300?t.colors.responses.success.tabTextColor:r>=300&&r<400?t.colors.responses.redirect.tabTextColor:r>400?t.colors.responses.error.tabTextColor:t.colors.responses.info.tabTextColor})),de=h.mb.strong(ee||(ee=Object(a.f)(["\n text-transform: capitalize;\n display: inline-block;\n padding-right: 5px;\n"],["\n text-transform: capitalize;\n display: inline-block;\n padding-right: 5px;\n"]))),he=h.mb.header(te||(te=Object(a.f)(["\n font-weight: bold;\n margin-bottom: 10px;\n"],["\n font-weight: bold;\n margin-bottom: 10px;\n"]))),ve=h.mb.code(re||(re=Object(a.f)(["\n border-left: 3px solid #ff4040;\n padding-left: 5px;\n"],["\n border-left: 3px solid #ff4040;\n padding-left: 5px;\n"]))),me=h.mb.div(ne||(ne=Object(a.f)(["\n margin-bottom: 10px;\n\n &:not(:first-child) {\n margin-top: 10px;\n }\n"],["\n margin-bottom: 10px;\n\n &:not(:first-child) {\n margin-top: 10px;\n }\n"]))),ge=Object(h.mb)(ce.t)(oe||(oe=Object(a.f)(["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n"],["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n"]))),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this.props,r=t.error,n=t.response,o=t.time,i=n||r&&r.response,a=i&&i.data&&i.data.length||0;if(e=a>1e6?(a/1e6).toFixed(2)+" MB":a>1e3?(a/1e3).toFixed(2)+" KB":a+" B",r&&!r.response||!i)return s.createElement(s.Fragment,null,s.createElement(he,null," Could not get any response "),s.createElement(ve,null,r&&r.message||"Unknown error"),s.createElement("br",null),s.createElement(he,null," Why this might have happened:"),s.createElement("div",null," - CORS is misconfigured on the server"),s.createElement("div",null," - ","The server couldn't sent a response"),s.createElement("div",null," - No internet access"),s.createElement("div",null," - Documentation issue - contact API owner"),s.createElement("div",null," - Misconfigured security definition"));if(!i)return"Something went wrong";var l=Object.keys(i.headers);return s.createElement(s.Fragment,null,s.createElement(ue,null,s.createElement(pe,{code:i.status},s.createElement("span",null," Status: "),i.status," ",i.statusText),s.createElement(fe,null,s.createElement("span",null," Time: "),o,"ms"),s.createElement(fe,null,s.createElement("span",null," Size: "),e)),s.createElement("div",null,s.createElement(me,null," Headers: "),s.createElement(ge,null,l.map((function(e){return s.createElement("div",{key:e},s.createElement(de,null,e,":"),s.createElement("code",null," ",i.headers[e]))}))),s.createElement(me,null," Body: "),i.body&&s.createElement(h.o,{data:i.body})||null,!i.body&&null!=i.data&&(i.data?s.createElement(h.T,{lang:Object(h.gb)(i.headers["Content-Type"]||"text/plain"),source:i.data}):s.createElement(ge,null,s.createElement("i",null,"(no content)")))||null))}}),t}(s.PureComponent),be=r(77),xe=r.n(be),we=r(777),Ce=r(589);function ke(e,t){void 0===t&&(t=!1);var r=e.length,n=0,o="",i=0,a=16,s=0,l=0,c=0,u=0,f=0;function p(t,r){for(var o=0,i=0;o<t||!r;){var a=e.charCodeAt(n);if(a>=48&&a<=57)i=16*i+a-48;else if(a>=65&&a<=70)i=16*i+a-65+10;else{if(!(a>=97&&a<=102))break;i=16*i+a-97+10}n++,o++}return o<t&&(i=-1),i}function d(){if(o="",f=0,i=n,l=s,u=c,n>=r)return i=r,a=17;var t=e.charCodeAt(n);if(Ae(t)){do{n++,o+=String.fromCharCode(t),t=e.charCodeAt(n)}while(Ae(t));return a=15}if(Oe(t))return n++,o+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,o+="\n"),s++,c=n,a=14;switch(t){case 123:return n++,a=1;case 125:return n++,a=2;case 91:return n++,a=3;case 93:return n++,a=4;case 58:return n++,a=6;case 44:return n++,a=5;case 34:return n++,o=function(){for(var t="",o=n;;){if(n>=r){t+=e.substring(o,n),f=2;break}var i=e.charCodeAt(n);if(34===i){t+=e.substring(o,n),n++;break}if(92!==i){if(i>=0&&i<=31){if(Oe(i)){t+=e.substring(o,n),f=2;break}f=6}n++}else{if(t+=e.substring(o,n),++n>=r){f=2;break}switch(e.charCodeAt(n++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var a=p(4,!0);a>=0?t+=String.fromCharCode(a):f=4;break;default:f=5}o=n}}return t}(),a=10;case 47:var d=n-1;if(47===e.charCodeAt(n+1)){for(n+=2;n<r&&!Oe(e.charCodeAt(n));)n++;return o=e.substring(d,n),a=12}if(42===e.charCodeAt(n+1)){n+=2;for(var v=r-1,m=!1;n<v;){var g=e.charCodeAt(n);if(42===g&&47===e.charCodeAt(n+1)){n+=2,m=!0;break}n++,Oe(g)&&(13===g&&10===e.charCodeAt(n)&&n++,s++,c=n)}return m||(n++,f=1),o=e.substring(d,n),a=13}return o+=String.fromCharCode(t),n++,a=16;case 45:if(o+=String.fromCharCode(t),++n===r||!Se(e.charCodeAt(n)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=function(){var t=n;if(48===e.charCodeAt(n))n++;else for(n++;n<e.length&&Se(e.charCodeAt(n));)n++;if(n<e.length&&46===e.charCodeAt(n)){if(!(++n<e.length&&Se(e.charCodeAt(n))))return f=3,e.substring(t,n);for(n++;n<e.length&&Se(e.charCodeAt(n));)n++}var r=n;if(n<e.length&&(69===e.charCodeAt(n)||101===e.charCodeAt(n)))if((++n<e.length&&43===e.charCodeAt(n)||45===e.charCodeAt(n))&&n++,n<e.length&&Se(e.charCodeAt(n))){for(n++;n<e.length&&Se(e.charCodeAt(n));)n++;r=n}else f=3;return e.substring(t,r)}(),a=11;default:for(;n<r&&h(t);)n++,t=e.charCodeAt(n);if(i!==n){switch(o=e.substring(i,n)){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return o+=String.fromCharCode(t),n++,a=16}}function h(e){if(Ae(e)||Oe(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}return{setPosition:function(e){n=e,o="",i=0,a=16,f=0},getPosition:function(){return n},scan:t?function(){var e;do{e=d()}while(e>=12&&e<=15);return e}:d,getToken:function(){return a},getTokenValue:function(){return o},getTokenOffset:function(){return i},getTokenLength:function(){return n-i},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return i-u},getTokenError:function(){return f}}}function Ae(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function Oe(e){return 10===e||13===e||8232===e||8233===e}function Se(e){return e>=48&&e<=57}function Ee(e,t,r){var n,o,i,a,s;if(t){for(a=t.offset,s=a+t.length,i=a;i>0&&!Te(e,i-1);)i--;for(var l=s;l<e.length&&!Te(e,l);)l++;o=e.substring(i,l),n=function(e,t){var r=0,n=0,o=t.tabSize||4;for(;r<e.length;){var i=e.charAt(r);if(" "===i)n++;else{if("\t"!==i)break;n+=o}r++}return Math.floor(n/o)}(o,r)}else o=e,n=0,i=0,a=0,s=e.length;var c,u=function(e,t){for(var r=0;r<t.length;r++){var n=t.charAt(r);if("\r"===n)return r+1<t.length&&"\n"===t.charAt(r+1)?"\r\n":"\r";if("\n"===n)return"\n"}return e&&e.eol||"\n"}(r,e),f=!1,p=0;c=r.insertSpaces?je(" ",r.tabSize||4):"\t";var d=ke(o,!1),h=!1;function v(){return u+je(c,n+p)}function m(){var e=d.scan();for(f=!1;15===e||14===e;)f=f||14===e,e=d.scan();return h=16===e||0!==d.getTokenError(),e}var g=[];function y(t,r,n){!h&&r<s&&n>a&&e.substring(r,n)!==t&&g.push({offset:r,length:n-r,content:t})}var b=m();if(17!==b){var x=d.getTokenOffset()+i;y(je(c,n),i,x)}for(;17!==b;){for(var w=d.getTokenOffset()+d.getTokenLength()+i,C=m(),k="";!f&&(12===C||13===C);){y(" ",w,d.getTokenOffset()+i),w=d.getTokenOffset()+d.getTokenLength()+i,k=12===C?v():"",C=m()}if(2===C)1!==b&&(p--,k=v());else if(4===C)3!==b&&(p--,k=v());else{switch(b){case 3:case 1:p++,k=v();break;case 5:case 12:k=v();break;case 13:k=f?v():" ";break;case 6:k=" ";break;case 10:if(6===C){k="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===C||13===C?k=" ":5!==C&&17!==C&&(h=!0);break;case 16:h=!0}!f||12!==C&&13!==C||(k=v())}y(k,w,d.getTokenOffset()+i),b=C}return g}function je(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function Te(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}function Me(e,t,r){void 0===r&&(r=ie.DEFAULT);var n=ke(e,!1);function o(e){return e?function(){return e(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function i(e){return e?function(t){return e(t,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var a=o(t.onObjectBegin),s=i(t.onObjectProperty),l=o(t.onObjectEnd),c=o(t.onArrayBegin),u=o(t.onArrayEnd),f=i(t.onLiteralValue),p=i(t.onSeparator),d=o(t.onComment),h=i(t.onError),v=r&&r.disallowComments,m=r&&r.allowTrailingComma;function g(){for(;;){var e=n.scan();switch(n.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:v||y(11);break;case 2:y(12);break;case 6:y(16)}switch(e){case 12:case 13:v?y(10):d();break;case 16:y(1);break;case 15:case 14:break;default:return e}}}function y(e,t,r){if(void 0===t&&(t=[]),void 0===r&&(r=[]),h(e),t.length+r.length>0)for(var o=n.getToken();17!==o;){if(-1!==t.indexOf(o)){g();break}if(-1!==r.indexOf(o))break;o=g()}}function b(e){var t=n.getTokenValue();return e?f(t):s(t),g(),!0}function x(){switch(n.getToken()){case 3:return function(){c(),g();for(var e=!1;4!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||y(4,[],[]),p(","),g(),4===n.getToken()&&m)break}else e&&y(6,[],[]);x()||y(4,[],[4,5]),e=!0}return u(),4!==n.getToken()?y(8,[4],[]):g(),!0}();case 1:return function(){a(),g();for(var e=!1;2!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||y(4,[],[]),p(","),g(),2===n.getToken()&&m)break}else e&&y(6,[],[]);(10!==n.getToken()?(y(3,[],[2,5]),0):(b(!1),6===n.getToken()?(p(":"),g(),x()||y(4,[],[2,5])):y(5,[],[2,5]),1))||y(4,[],[2,5]),e=!0}return l(),2!==n.getToken()?y(7,[2],[]):g(),!0}();case 10:return b(!0);default:return function(){switch(n.getToken()){case 11:var e=n.getTokenValue(),t=Number(e);isNaN(t)&&(y(2),t=0),f(t);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return g(),!0}()}}return g(),17===n.getToken()?!!r.allowEmptyContent||(y(4,[],[]),!1):x()?(17!==n.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1)}!function(e){e.DEFAULT={allowTrailingComma:!1}}(ie||(ie={}));var Pe,Le,Ie,Fe,_e,Ne,Re,De,Ve,Be,Ue,ze,We,He,qe,Ge,$e,Ke,Je,Ye,Xe,Qe,Ze,et,tt,rt,nt=ke,ot=function(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=ie.DEFAULT);var n=null,o=[],i=[];function a(e){Array.isArray(o)?o.push(e):null!==n&&(o[n]=e)}return Me(e,{onObjectBegin:function(){var e={};a(e),i.push(o),o=e,n=null},onObjectProperty:function(e){n=e},onObjectEnd:function(){o=i.pop()},onArrayBegin:function(){var e=[];a(e),i.push(o),o=e,n=null},onArrayEnd:function(){o=i.pop()},onLiteralValue:a,onError:function(e,r,n){t.push({error:e,offset:r,length:n})}},r),o[0]},it=function e(t,r,n){if(void 0===n&&(n=!1),function(e,t,r){return void 0===r&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}(t,r,n)){var o=t.children;if(Array.isArray(o))for(var i=0;i<o.length&&o[i].offset<=r;i++){var a=e(o[i],r,n);if(a)return a}return t}},at=function e(t){if(!t.parent||!t.parent.children)return[];var r=e(t.parent);if("property"===t.parent.type){var n=t.parent.children[0].value;r.push(n)}else if("array"===t.parent.type){var o=t.parent.children.indexOf(t);-1!==o&&r.push(o)}return r},st=function e(t){switch(t.type){case"array":return t.children.map(e);case"object":for(var r=Object.create(null),n=0,o=t.children;n<o.length;n++){var i=o[n],a=i.children[1];a&&(r[i.children[0].value]=e(a))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}};function lt(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var r,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!lt(e[r],t[r]))return!1}else{var o=[];for(n in e)o.push(n);o.sort();var i=[];for(n in t)i.push(n);if(i.sort(),!lt(o,i))return!1;for(r=0;r<o.length;r++)if(!lt(e[o[r]],t[o[r]]))return!1}return!0}function ct(e){return"number"==typeof e}function ut(e){return void 0!==e}function ft(e){return"boolean"==typeof e}!function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647}(Pe||(Pe={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(Le||(Le={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=Le.MAX_VALUE),t===Number.MAX_VALUE&&(t=Le.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return qt.objectLiteral(t)&&qt.uinteger(t.line)&&qt.uinteger(t.character)}}(Ie||(Ie={})),function(e){e.create=function(e,t,r,n){if(qt.uinteger(e)&&qt.uinteger(t)&&qt.uinteger(r)&&qt.uinteger(n))return{start:Ie.create(e,t),end:Ie.create(r,n)};if(Ie.is(e)&&Ie.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+r+", "+n+"]")},e.is=function(e){var t=e;return qt.objectLiteral(t)&&Ie.is(t.start)&&Ie.is(t.end)}}(Fe||(Fe={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.range)&&(qt.string(t.uri)||qt.undefined(t.uri))}}(_e||(_e={})),function(e){e.create=function(e,t,r,n){return{targetUri:e,targetRange:t,targetSelectionRange:r,originSelectionRange:n}},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.targetRange)&&qt.string(t.targetUri)&&(Fe.is(t.targetSelectionRange)||qt.undefined(t.targetSelectionRange))&&(Fe.is(t.originSelectionRange)||qt.undefined(t.originSelectionRange))}}(Ne||(Ne={})),function(e){e.create=function(e,t,r,n){return{red:e,green:t,blue:r,alpha:n}},e.is=function(e){var t=e;return qt.numberRange(t.red,0,1)&&qt.numberRange(t.green,0,1)&&qt.numberRange(t.blue,0,1)&&qt.numberRange(t.alpha,0,1)}}(Re||(Re={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Fe.is(t.range)&&Re.is(t.color)}}(De||(De={})),function(e){e.create=function(e,t,r){return{label:e,textEdit:t,additionalTextEdits:r}},e.is=function(e){var t=e;return qt.string(t.label)&&(qt.undefined(t.textEdit)||Ke.is(t))&&(qt.undefined(t.additionalTextEdits)||qt.typedArray(t.additionalTextEdits,Ke.is))}}(Ve||(Ve={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(Be||(Be={})),function(e){e.create=function(e,t,r,n,o){var i={startLine:e,endLine:t};return qt.defined(r)&&(i.startCharacter=r),qt.defined(n)&&(i.endCharacter=n),qt.defined(o)&&(i.kind=o),i},e.is=function(e){var t=e;return qt.uinteger(t.startLine)&&qt.uinteger(t.startLine)&&(qt.undefined(t.startCharacter)||qt.uinteger(t.startCharacter))&&(qt.undefined(t.endCharacter)||qt.uinteger(t.endCharacter))&&(qt.undefined(t.kind)||qt.string(t.kind))}}(Ue||(Ue={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return qt.defined(t)&&_e.is(t.location)&&qt.string(t.message)}}(ze||(ze={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(We||(We={})),function(e){e.Unnecessary=1,e.Deprecated=2}(He||(He={})),function(e){e.is=function(e){var t=e;return null!=t&&qt.string(t.href)}}(qe||(qe={})),function(e){e.create=function(e,t,r,n,o,i){var a={range:e,message:t};return qt.defined(r)&&(a.severity=r),qt.defined(n)&&(a.code=n),qt.defined(o)&&(a.source=o),qt.defined(i)&&(a.relatedInformation=i),a},e.is=function(e){var t,r=e;return qt.defined(r)&&Fe.is(r.range)&&qt.string(r.message)&&(qt.number(r.severity)||qt.undefined(r.severity))&&(qt.integer(r.code)||qt.string(r.code)||qt.undefined(r.code))&&(qt.undefined(r.codeDescription)||qt.string(null===(t=r.codeDescription)||void 0===t?void 0:t.href))&&(qt.string(r.source)||qt.undefined(r.source))&&(qt.undefined(r.relatedInformation)||qt.typedArray(r.relatedInformation,ze.is))}}(Ge||(Ge={})),function(e){e.create=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o={title:e,command:t};return qt.defined(r)&&r.length>0&&(o.arguments=r),o},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.title)&&qt.string(t.command)}}($e||($e={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return qt.objectLiteral(t)&&qt.string(t.newText)&&Fe.is(t.range)}}(Ke||(Ke={})),function(e){e.create=function(e,t,r){var n={label:e};return void 0!==t&&(n.needsConfirmation=t),void 0!==r&&(n.description=r),n},e.is=function(e){var t=e;return void 0!==t&&qt.objectLiteral(t)&&qt.string(t.label)&&(qt.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(qt.string(t.description)||void 0===t.description)}}(Je||(Je={})),function(e){e.is=function(e){return"string"==typeof e}}(Ye||(Ye={})),function(e){e.replace=function(e,t,r){return{range:e,newText:t,annotationId:r}},e.insert=function(e,t,r){return{range:{start:e,end:e},newText:t,annotationId:r}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return Ke.is(t)&&(Je.is(t.annotationId)||Ye.is(t.annotationId))}}(Xe||(Xe={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return qt.defined(t)&&ht.is(t.textDocument)&&Array.isArray(t.edits)}}(Qe||(Qe={})),function(e){e.create=function(e,t,r){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),void 0!==r&&(n.annotationId=r),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&qt.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||qt.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||qt.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Ye.is(t.annotationId))}}(Ze||(Ze={})),function(e){e.create=function(e,t,r,n){var o={kind:"rename",oldUri:e,newUri:t};return void 0===r||void 0===r.overwrite&&void 0===r.ignoreIfExists||(o.options=r),void 0!==n&&(o.annotationId=n),o},e.is=function(e){var t=e;return t&&"rename"===t.kind&&qt.string(t.oldUri)&&qt.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||qt.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||qt.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Ye.is(t.annotationId))}}(et||(et={})),function(e){e.create=function(e,t,r){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),void 0!==r&&(n.annotationId=r),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&qt.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||qt.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||qt.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||Ye.is(t.annotationId))}}(tt||(tt={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return qt.string(e.kind)?Ze.is(e)||et.is(e)||tt.is(e):Qe.is(e)})))}}(rt||(rt={}));var pt,dt,ht,vt,mt,gt,yt,bt,xt,wt,Ct,kt,At,Ot,St,Et,jt,Tt,Mt,Pt,Lt,It,Ft,_t,Nt,Rt,Dt,Vt,Bt,Ut,zt=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,r){var n,o;if(void 0===r?n=Ke.insert(e,t):Ye.is(r)?(o=r,n=Xe.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),n=Xe.insert(e,t,o)),this.edits.push(n),void 0!==o)return o},e.prototype.replace=function(e,t,r){var n,o;if(void 0===r?n=Ke.replace(e,t):Ye.is(r)?(o=r,n=Xe.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),n=Xe.replace(e,t,o)),this.edits.push(n),void 0!==o)return o},e.prototype.delete=function(e,t){var r,n;if(void 0===t?r=Ke.del(e):Ye.is(t)?(n=t,r=Xe.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=Xe.del(e,n)),this.edits.push(r),void 0!==n)return n},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),Wt=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var r;if(Ye.is(e)?r=e:(r=this.nextId(),t=e),void 0!==this._annotations[r])throw new Error("Id "+r+" is already in use.");if(void 0===t)throw new Error("No annotation provided for id "+r);return this._annotations[r]=t,this._size++,r},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Wt(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(Qe.is(e)){var r=new zt(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=r}}))):e.changes&&Object.keys(e.changes).forEach((function(r){var n=new zt(e.changes[r]);t._textEditChanges[r]=n}))):this._workspaceEdit={}}Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(ht.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(n=this._textEditChanges[t.uri])){var r={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(r),n=new zt(o,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var n;if(!(n=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,n=new zt(o),this._textEditChanges[e]=n}return n},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new Wt,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n,o,i;if(Je.is(t)||Ye.is(t)?n=t:r=t,void 0===n?o=Ze.create(e,r):(i=Ye.is(n)?n:this._changeAnnotations.manage(n),o=Ze.create(e,r,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i},e.prototype.renameFile=function(e,t,r,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var o,i,a;if(Je.is(r)||Ye.is(r)?o=r:n=r,void 0===o?i=et.create(e,t,n):(a=Ye.is(o)?o:this._changeAnnotations.manage(o),i=et.create(e,t,n,a)),this._workspaceEdit.documentChanges.push(i),void 0!==a)return a},e.prototype.deleteFile=function(e,t,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n,o,i;if(Je.is(t)||Ye.is(t)?n=t:r=t,void 0===n?o=tt.create(e,r):(i=Ye.is(n)?n:this._changeAnnotations.manage(n),o=tt.create(e,r,i)),this._workspaceEdit.documentChanges.push(o),void 0!==i)return i}}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)}}(pt||(pt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)&&qt.integer(t.version)}}(dt||(dt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)&&(null===t.version||qt.integer(t.version))}}(ht||(ht={})),function(e){e.create=function(e,t,r,n){return{uri:e,languageId:t,version:r,text:n}},e.is=function(e){var t=e;return qt.defined(t)&&qt.string(t.uri)&&qt.string(t.languageId)&&qt.integer(t.version)&&qt.string(t.text)}}(vt||(vt={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(mt||(mt={})),function(e){e.is=function(t){var r=t;return r===e.PlainText||r===e.Markdown}}(mt||(mt={})),function(e){e.is=function(e){var t=e;return qt.objectLiteral(e)&&mt.is(t.kind)&&qt.string(t.value)}}(gt||(gt={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(yt||(yt={})),function(e){e.PlainText=1,e.Snippet=2}(bt||(bt={})),function(e){e.Deprecated=1}(xt||(xt={})),function(e){e.create=function(e,t,r){return{newText:e,insert:t,replace:r}},e.is=function(e){var t=e;return t&&qt.string(t.newText)&&Fe.is(t.insert)&&Fe.is(t.replace)}}(wt||(wt={})),function(e){e.asIs=1,e.adjustIndentation=2}(Ct||(Ct={})),function(e){e.create=function(e){return{label:e}}}(kt||(kt={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(At||(At={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return qt.string(t)||qt.objectLiteral(t)&&qt.string(t.language)&&qt.string(t.value)}}(Ot||(Ot={})),function(e){e.is=function(e){var t=e;return!!t&&qt.objectLiteral(t)&&(gt.is(t.contents)||Ot.is(t.contents)||qt.typedArray(t.contents,Ot.is))&&(void 0===e.range||Fe.is(e.range))}}(St||(St={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Et||(Et={})),function(e){e.create=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o={label:e};return qt.defined(t)&&(o.documentation=t),qt.defined(r)?o.parameters=r:o.parameters=[],o}}(jt||(jt={})),function(e){e.Text=1,e.Read=2,e.Write=3}(Tt||(Tt={})),function(e){e.create=function(e,t){var r={range:e};return qt.number(t)&&(r.kind=t),r}}(Mt||(Mt={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(Pt||(Pt={})),function(e){e.Deprecated=1}(Lt||(Lt={})),function(e){e.create=function(e,t,r,n,o){var i={name:e,kind:t,location:{uri:n,range:r}};return o&&(i.containerName=o),i}}(It||(It={})),function(e){e.create=function(e,t,r,n,o,i){var a={name:e,detail:t,kind:r,range:n,selectionRange:o};return void 0!==i&&(a.children=i),a},e.is=function(e){var t=e;return t&&qt.string(t.name)&&qt.number(t.kind)&&Fe.is(t.range)&&Fe.is(t.selectionRange)&&(void 0===t.detail||qt.string(t.detail))&&(void 0===t.deprecated||qt.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(Ft||(Ft={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(_t||(_t={})),function(e){e.create=function(e,t){var r={diagnostics:e};return null!=t&&(r.only=t),r},e.is=function(e){var t=e;return qt.defined(t)&&qt.typedArray(t.diagnostics,Ge.is)&&(void 0===t.only||qt.typedArray(t.only,qt.string))}}(Nt||(Nt={})),function(e){e.create=function(e,t,r){var n={title:e},o=!0;return"string"==typeof t?(o=!1,n.kind=t):$e.is(t)?n.command=t:n.edit=t,o&&void 0!==r&&(n.kind=r),n},e.is=function(e){var t=e;return t&&qt.string(t.title)&&(void 0===t.diagnostics||qt.typedArray(t.diagnostics,Ge.is))&&(void 0===t.kind||qt.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||$e.is(t.command))&&(void 0===t.isPreferred||qt.boolean(t.isPreferred))&&(void 0===t.edit||rt.is(t.edit))}}(Rt||(Rt={})),function(e){e.create=function(e,t){var r={range:e};return qt.defined(t)&&(r.data=t),r},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.range)&&(qt.undefined(t.command)||$e.is(t.command))}}(Dt||(Dt={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return qt.defined(t)&&qt.uinteger(t.tabSize)&&qt.boolean(t.insertSpaces)}}(Vt||(Vt={})),function(e){e.create=function(e,t,r){return{range:e,target:t,data:r}},e.is=function(e){var t=e;return qt.defined(t)&&Fe.is(t.range)&&(qt.undefined(t.target)||qt.string(t.target))}}(Bt||(Bt={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var r=t;return void 0!==r&&Fe.is(r.range)&&(void 0===r.parent||e.is(r.parent))}}(Ut||(Ut={}));var Ht;!function(e){e.create=function(e,t,r,n){return new Gt(e,t,r,n)},e.is=function(e){var t=e;return!!(qt.defined(t)&&qt.string(t.uri)&&(qt.undefined(t.languageId)||qt.string(t.languageId))&&qt.uinteger(t.lineCount)&&qt.func(t.getText)&&qt.func(t.positionAt)&&qt.func(t.offsetAt))},e.applyEdits=function(e,t){for(var r=e.getText(),n=function e(t,r){if(t.length<=1)return t;var n=t.length/2|0,o=t.slice(0,n),i=t.slice(n);e(o,r),e(i,r);var a=0,s=0,l=0;for(;a<o.length&&s<i.length;){var c=r(o[a],i[s]);t[l++]=c<=0?o[a++]:i[s++]}for(;a<o.length;)t[l++]=o[a++];for(;s<i.length;)t[l++]=i[s++];return t}(t,(function(e,t){var r=e.range.start.line-t.range.start.line;return 0===r?e.range.start.character-t.range.start.character:r})),o=r.length,i=n.length-1;i>=0;i--){var a=n[i],s=e.offsetAt(a.range.start),l=e.offsetAt(a.range.end);if(!(l<=o))throw new Error("Overlapping edit");r=r.substring(0,s)+a.newText+r.substring(l,r.length),o=s}return r}}(Ht||(Ht={}));var qt,Gt=function(){function e(e,t,r,n){this._uri=e,this._languageId=t,this._version=r,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,r=!0,n=0;n<t.length;n++){r&&(e.push(n),r=!1);var o=t.charAt(n);r="\r"===o||"\n"===o,"\r"===o&&n+1<t.length&&"\n"===t.charAt(n+1)&&n++}r&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,n=t.length;if(0===n)return Ie.create(0,e);for(;r<n;){var o=Math.floor((r+n)/2);t[o]>e?n=o:r=o+1}var i=r-1;return Ie.create(i,e-t[i])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var r=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,n),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,r,n){return"[object Number]"===t.call(e)&&r<=e&&e<=n},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(qt||(qt={}));var $t,Kt,Jt,Yt=function(){function e(e,t,r,n){this._uri=e,this._languageId=t,this._version=r,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content},e.prototype.update=function(t,r){for(var n=0,o=t;n<o.length;n++){var i=o[n];if(e.isIncremental(i)){var a=Qt(i.range),s=this.offsetAt(a.start),l=this.offsetAt(a.end);this._content=this._content.substring(0,s)+i.text+this._content.substring(l,this._content.length);var c=Math.max(a.start.line,0),u=Math.max(a.end.line,0),f=this._lineOffsets,p=Xt(i.text,!1,s);if(u-c===p.length)for(var d=0,h=p.length;d<h;d++)f[d+c+1]=p[d];else p.length<1e4?f.splice.apply(f,[c+1,u-c].concat(p)):this._lineOffsets=f=f.slice(0,c+1).concat(p,f.slice(u+1));var v=i.text.length-(l-s);if(0!==v)for(d=c+1+p.length,h=f.length;d<h;d++)f[d]=f[d]+v}else{if(!e.isFull(i))throw new Error("Unknown change event received");this._content=i.text,this._lineOffsets=void 0}}this._version=r},e.prototype.getLineOffsets=function(){return void 0===this._lineOffsets&&(this._lineOffsets=Xt(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,n=t.length;if(0===n)return{line:0,character:e};for(;r<n;){var o=Math.floor((r+n)/2);t[o]>e?n=o:r=o+1}var i=r-1;return{line:i,character:e-t[i]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var r=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,n),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e.isIncremental=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},e.isFull=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},e}();function Xt(e,t,r){void 0===r&&(r=0);for(var n=t?[r]:[],o=0;o<e.length;o++){var i=e.charCodeAt(o);13!==i&&10!==i||(13===i&&o+1<e.length&&10===e.charCodeAt(o+1)&&o++,n.push(r+o+1))}return n}function Qt(e){var t=e.start,r=e.end;return t.line>r.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}function Zt(e){var t=Qt(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,r,n){return new Yt(e,t,r,n)},e.update=function(e,t,r){if(e instanceof Yt)return e.update(t,r),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var r=e.getText(),n=0,o=[],i=0,a=function e(t,r){if(t.length<=1)return t;var n=t.length/2|0,o=t.slice(0,n),i=t.slice(n);e(o,r),e(i,r);var a=0,s=0,l=0;for(;a<o.length&&s<i.length;){var c=r(o[a],i[s]);t[l++]=c<=0?o[a++]:i[s++]}for(;a<o.length;)t[l++]=o[a++];for(;s<i.length;)t[l++]=i[s++];return t}(t.map(Zt),(function(e,t){var r=e.range.start.line-t.range.start.line;return 0===r?e.range.start.character-t.range.start.character:r}));i<a.length;i++){var s=a[i],l=e.offsetAt(s.range.start);if(l<n)throw new Error("Overlapping edit");l>n&&o.push(r.substring(n,l)),s.newText.length&&o.push(s.newText),n=e.offsetAt(s.range.end)}return o.push(r.substr(n)),o.join("")}}($t||($t={})),function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.SchemaResolveError=768]="SchemaResolveError"}(Kt||(Kt={})),(Jt||(Jt={})).LATEST={textDocument:{completion:{completionItem:{documentationFormat:[mt.Markdown,mt.PlainText],commitCharactersSupport:!0}}}};var er,tr,rr=(er=function(e,t){return(er=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}er(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),nr={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},or=function(){function e(e,t,r){this.offset=t,this.length=r,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),ir=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="null",n.value=null,n}return rr(t,e),t}(or),ar=function(e){function t(t,r,n){var o=e.call(this,t,n)||this;return o.type="boolean",o.value=r,o}return rr(t,e),t}(or),sr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="array",n.items=[],n}return rr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),t}(or),lr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="number",n.isInteger=!0,n.value=Number.NaN,n}return rr(t,e),t}(or),cr=function(e){function t(t,r,n){var o=e.call(this,t,r,n)||this;return o.type="string",o.value="",o}return rr(t,e),t}(or),ur=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="property",n.colonOffset=-1,n}return rr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),t}(or),fr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="object",n.properties=[],n}return rr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),t}(or);function pr(e){return ft(e)?e?{}:{not:{}}:e}!function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"}(tr||(tr={}));var dr=function(){function e(e,t){void 0===e&&(e=-1),void 0===t&&(t=null),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){var t;(t=this.schemas).push.apply(t,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||yr(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),hr=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),vr=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];this.merge(n)}},e.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},e.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,r=this.problems;t<r.length;t++){var n=r[t];n.code===Kt.EnumValueMismatch&&(n.message="Value is not accepted. Valid values: "+this.enumValues.map((function(e){return JSON.stringify(e)})).join(", ")+".")}}},e.prototype.mergePropertyMatch=function(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&1===e.enumValues.length&&this.primaryValueMatches++},e.prototype.compare=function(e){var t=this.hasProblems();return t!==e.hasProblems()?t?-1:1:this.enumValueMatch!==e.enumValueMatch?e.enumValueMatch?-1:1:this.primaryValueMatches!==e.primaryValueMatches?this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches!==e.propertiesValueMatches?this.propertiesValueMatches-e.propertiesValueMatches:this.propertiesMatches-e.propertiesMatches},e}();function mr(e){return st(e)}function gr(e){return at(e)}function yr(e,t,r){return void 0===r&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}var br=function(){function e(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=[]),this.root=e,this.syntaxErrors=t,this.comments=r}return e.prototype.getNodeFromOffset=function(e,t){if(void 0===t&&(t=!1),this.root)return it(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(r){var n=e(r),o=r.children;if(Array.isArray(o))for(var i=0;i<o.length&&n;i++)n=t(o[i]);return n};t(this.root)}},e.prototype.validate=function(e,t){if(this.root&&t){var r=new vr;return xr(this.root,t,r,hr.instance),r.problems.map((function(t){var r=Fe.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length));return Ge.create(r,t.message,t.severity,t.code)}))}return null},e.prototype.getMatchingSchemas=function(e,t,r){void 0===t&&(t=-1),void 0===r&&(r=null);var n=new dr(t,r);return this.root&&e&&xr(this.root,e,new vr,n),n.schemas},e}();function xr(e,t,r,n){if(e&&n.include(e)){switch(e.type){case"object":!function(e,t,r,n){for(var o=Object.create(null),i=[],a=0,s=e.properties;a<s.length;a++){var l=(y=s[a]).keyNode.value;o[l]=y.valueNode,i.push(l)}if(Array.isArray(t.required))for(var c=0,u=t.required;c<u.length;c++){var f=u[c];if(!o[f]){var p=e.parent&&"property"===e.parent.type&&e.parent.keyNode,d=p?{offset:p.offset,length:p.length}:{offset:e.offset,length:1};r.problems.push({location:d,severity:We.Warning,message:'Missing property "'+f+'".'})}}var h=function(e){for(var t=i.indexOf(e);t>=0;)i.splice(t,1),t=i.indexOf(e)};if(t.properties)for(var v=0,m=Object.keys(t.properties);v<m.length;v++){f=m[v];h(f);var g=t.properties[f];if(M=o[f])if(ft(g))if(g)r.propertiesMatches++,r.propertiesValueMatches++;else{var y=M.parent;r.problems.push({location:{offset:y.keyNode.offset,length:y.keyNode.length},severity:We.Warning,message:t.errorMessage||"Property "+f+" is not allowed."})}else{var b=new vr;xr(M,g,b,n),r.mergePropertyMatch(b)}}if(t.patternProperties)for(var x=0,w=Object.keys(t.patternProperties);x<w.length;x++)for(var C=w[x],k=new RegExp(C),A=0,O=i.slice(0);A<O.length;A++){f=O[A];if(k.test(f))if(h(f),M=o[f])if(ft(g=t.patternProperties[C]))if(g)r.propertiesMatches++,r.propertiesValueMatches++;else{y=M.parent;r.problems.push({location:{offset:y.keyNode.offset,length:y.keyNode.length},severity:We.Warning,message:t.errorMessage||"Property "+f+" is not allowed."})}else{b=new vr;xr(M,g,b,n),r.mergePropertyMatch(b)}}if("object"==typeof t.additionalProperties)for(var S=0,E=i;S<E.length;S++){f=E[S];if(M=o[f]){b=new vr;xr(M,t.additionalProperties,b,n),r.mergePropertyMatch(b)}}else if(!1===t.additionalProperties&&i.length>0)for(var j=0,T=i;j<T.length;j++){var M;f=T[j];if(M=o[f]){y=M.parent;r.problems.push({location:{offset:y.keyNode.offset,length:y.keyNode.length},severity:We.Warning,message:t.errorMessage||"Property "+f+" is not allowed."})}}ct(t.maxProperties)&&e.properties.length>t.maxProperties&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Object has more properties than limit of "+t.maxProperties+"."});ct(t.minProperties)&&e.properties.length<t.minProperties&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Object has fewer properties than the required number of "+t.minProperties});if(t.dependencies)for(var P=0,L=Object.keys(t.dependencies);P<L.length;P++){l=L[P];if(o[l]){var I=t.dependencies[l];if(Array.isArray(I))for(var F=0,_=I;F<_.length;F++){var N=_[F];o[N]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Object is missing property "+N+" required by property {$key}."})}else if(g=pr(I)){b=new vr;xr(e,g,b,n),r.mergePropertyMatch(b)}}}var R=pr(t.propertyNames);if(R)for(var D=0,V=e.properties;D<V.length;D++){var B=V[D];(l=B.keyNode)&&xr(l,R,r,hr.instance)}}(e,t,r,n);break;case"array":!function(e,t,r,n){if(Array.isArray(t.items)){for(var o=t.items,i=0;i<o.length;i++){var a=pr(o[i]),s=new vr;(p=e.items[i])?(xr(p,a,s,n),r.mergePropertyMatch(s)):e.items.length>=o.length&&r.propertiesValueMatches++}if(e.items.length>o.length)if("object"==typeof t.additionalItems)for(var l=o.length;l<e.items.length;l++){s=new vr;xr(e.items[l],t.additionalItems,s,n),r.mergePropertyMatch(s)}else!1===t.additionalItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has too many items according to schema. Expected "+o.length+" or fewer."})}else{var c=pr(t.items);if(c)for(var u=0,f=e.items;u<f.length;u++){var p=f[u];s=new vr;xr(p,c,s,n),r.mergePropertyMatch(s)}}var d=pr(t.contains);if(d){e.items.some((function(e){var t=new vr;return xr(e,d,t,hr.instance),!t.hasProblems()}))||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.errorMessage||"Array does not contain required item."})}ct(t.minItems)&&e.items.length<t.minItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has too few items. Expected "+t.minItems+" or more."});ct(t.maxItems)&&e.items.length>t.maxItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has too many items. Expected "+t.maxItems+" or fewer."});if(!0===t.uniqueItems){var h=mr(e);h.some((function(e,t){return t!==h.lastIndexOf(e)}))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Array has duplicate items."})}}(e,t,r,n);break;case"string":!function(e,t,r,n){ct(t.minLength)&&e.value.length<t.minLength&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"String is shorter than the minimum length of "+t.minLength+"."});ct(t.maxLength)&&e.value.length>t.maxLength&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"String is longer than the maximum length of "+t.maxLength+"."});if(o=t.pattern,"string"==typeof o){new RegExp(t.pattern).test(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.patternErrorMessage||t.errorMessage||'String does not match the pattern of "'+t.pattern+'".'})}var o;if(t.format)switch(t.format){case"uri":case"uri-reference":var i=void 0;if(e.value){var a=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);a?a[2]||"uri"!==t.format||(i="URI with a scheme is expected."):i="URI is expected."}else i="URI expected.";i&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.patternErrorMessage||t.errorMessage||"String is not a URI: "+i});break;case"color-hex":case"date-time":case"date":case"time":case"email":var s=nr[t.format];e.value&&s.pattern.exec(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.patternErrorMessage||t.errorMessage||s.errorMessage})}}(e,t,r);break;case"number":!function(e,t,r,n){var o=e.value;ct(t.multipleOf)&&o%t.multipleOf!=0&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is not divisible by "+t.multipleOf+"."});function i(e,t){return ct(t)?t:ft(t)&&t?e:void 0}function a(e,t){if(!ft(t)||!t)return e}var s=i(t.minimum,t.exclusiveMinimum);ct(s)&&o<=s&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is below the exclusive minimum of "+s+"."});var l=i(t.maximum,t.exclusiveMaximum);ct(l)&&o>=l&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is above the exclusive maximum of "+l+"."});var c=a(t.minimum,t.exclusiveMinimum);ct(c)&&o<c&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is below the minimum of "+c+"."});var u=a(t.maximum,t.exclusiveMaximum);ct(u)&&o>u&&r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Value is above the maximum of "+u+"."})}(e,t,r);break;case"property":return xr(e.valueNode,t,r,n)}!function(){function o(r){return e.type===r||"integer"===r&&"number"===e.type&&e.isInteger||t.nullable&&null===e.value}Array.isArray(t.type)?t.type.some(o)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.errorMessage||"Incorrect type. Expected one of "+t.type.join(", ")+"."}):t.type&&(o(t.type)||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:t.errorMessage||'Incorrect type. Expected "'+t.type+'".'}));if(Array.isArray(t.allOf))for(var i=0,a=t.allOf;i<a.length;i++){var s=a[i];xr(e,pr(s),r,n)}var l=pr(t.not);if(l){var c=new vr,u=n.newSub();xr(e,l,c,u),c.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,message:"Matches a schema that is not allowed."});for(var f=0,p=u.schemas;f<p.length;f++){var d=p[f];d.inverted=!d.inverted,n.add(d)}}var h=function(t,o){for(var i=[],a=null,s=0,l=t;s<l.length;s++){var c=pr(l[s]),u=new vr,f=n.newSub();if(xr(e,c,u,f),u.hasProblems()||i.push(c),a)if(o||u.hasProblems()||a.validationResult.hasProblems()){var p=u.compare(a.validationResult);p>0?a={schema:c,validationResult:u,matchingSchemas:f}:0===p&&(a.matchingSchemas.merge(f),a.validationResult.mergeEnumValues(u))}else a.matchingSchemas.merge(f),a.validationResult.propertiesMatches+=u.propertiesMatches,a.validationResult.propertiesValueMatches+=u.propertiesValueMatches;else a={schema:c,validationResult:u,matchingSchemas:f}}return i.length>1&&o&&r.problems.push({location:{offset:e.offset,length:1},severity:We.Warning,message:"Matches multiple schemas when only one must validate."}),null!==a&&(r.merge(a.validationResult),r.propertiesMatches+=a.validationResult.propertiesMatches,r.propertiesValueMatches+=a.validationResult.propertiesValueMatches,n.merge(a.matchingSchemas)),i.length};Array.isArray(t.anyOf)&&h(t.anyOf,!1);Array.isArray(t.oneOf)&&h(t.oneOf,!0);var v=function(t){var o=new vr,i=n.newSub();xr(e,pr(t),o,i),r.merge(o),r.propertiesMatches+=o.propertiesMatches,r.propertiesValueMatches+=o.propertiesValueMatches,n.merge(i)},m=pr(t.if);m&&function(t,r,o){var i=pr(t),a=new vr,s=n.newSub();xr(e,i,a,s),n.merge(s),a.hasProblems()?o&&v(o):r&&v(r)}(m,pr(t.then),pr(t.else));if(Array.isArray(t.enum)){for(var g=mr(e),y=!1,b=0,x=t.enum;b<x.length;b++){var w=x[b];if(lt(g,w)){y=!0;break}}r.enumValues=t.enum,r.enumValueMatch=y,y||r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,code:Kt.EnumValueMismatch,message:t.errorMessage||"Value is not accepted. Valid values: "+t.enum.map((function(e){return JSON.stringify(e)})).join(", ")+"."})}if(ut(t.const)){lt(g=mr(e),t.const)?r.enumValueMatch=!0:(r.problems.push({location:{offset:e.offset,length:e.length},severity:We.Warning,code:Kt.EnumValueMismatch,message:t.errorMessage||"Value must be "+JSON.stringify(t.const)+"."}),r.enumValueMatch=!1),r.enumValues=[t.const]}t.deprecationMessage&&e.parent&&r.problems.push({location:{offset:e.parent.offset,length:e.parent.length},severity:We.Warning,message:t.deprecationMessage})}(),n.add({node:e,schema:t})}}function wr(e,t){var r=[],n=-1,o=e.getText(),i=nt(o,!1),a=t&&t.collectComments?[]:void 0;function s(){for(;;){var t=i.scan();switch(u(),t){case 12:case 13:Array.isArray(a)&&a.push(Fe.create(e.positionAt(i.getTokenOffset()),e.positionAt(i.getTokenOffset()+i.getTokenLength())));break;case 15:case 14:break;default:return t}}}function l(t,o,i,a,s){if(void 0===s&&(s=We.Error),0===r.length||i!==n){var l=Fe.create(e.positionAt(i),e.positionAt(a));r.push(Ge.create(l,t,s,o,e.languageId)),n=i}}function c(e,t,r,n,a){void 0===r&&(r=null),void 0===n&&(n=[]),void 0===a&&(a=[]);var c=i.getTokenOffset(),u=i.getTokenOffset()+i.getTokenLength();if(c===u&&c>0){for(c--;c>0&&/\s/.test(o.charAt(c));)c--;u=c+1}if(l(e,t,c,u),r&&f(r,!1),n.length+a.length>0)for(var p=i.getToken();17!==p;){if(-1!==n.indexOf(p)){s();break}if(-1!==a.indexOf(p))break;p=s()}return r}function u(){switch(i.getTokenError()){case 4:return c("Invalid unicode sequence in string.",Kt.InvalidUnicode),!0;case 5:return c("Invalid escape character in string.",Kt.InvalidEscapeCharacter),!0;case 3:return c("Unexpected end of number.",Kt.UnexpectedEndOfNumber),!0;case 1:return c("Unexpected end of comment.",Kt.UnexpectedEndOfComment),!0;case 2:return c("Unexpected end of string.",Kt.UnexpectedEndOfString),!0;case 6:return c("Invalid characters in string. Control characters must be escaped.",Kt.InvalidCharacter),!0}return!1}function f(e,t){return e.length=i.getTokenOffset()+i.getTokenLength()-e.offset,t&&s(),e}function p(t,r){var n=new ur(t,i.getTokenOffset()),o=d(n);if(!o){if(16!==i.getToken())return null;c("Property keys must be doublequoted",Kt.Undefined);var a=new cr(n,i.getTokenOffset(),i.getTokenLength());a.value=i.getTokenValue(),o=a,s()}n.keyNode=o;var u=r[o.value];if(u?(l("Duplicate object key",Kt.DuplicateKey,n.keyNode.offset,n.keyNode.offset+n.keyNode.length,We.Warning),"object"==typeof u&&l("DuplicateKeyWarning",Kt.DuplicateKey,u.keyNode.offset,u.keyNode.offset+u.keyNode.length,We.Warning),r[o.value]=!0):r[o.value]=n,6===i.getToken())n.colonOffset=i.getTokenOffset(),s();else if(c("Colon expected",Kt.ColonExpected),10===i.getToken()&&e.positionAt(o.offset+o.length).line<e.positionAt(i.getTokenOffset()).line)return n.length=o.length,n;var f=h(n,o.value);return f?(n.valueNode=f,n.length=f.offset+f.length-n.offset,n):c("Value expected",Kt.ValueExpected,n,[],[2,5])}function d(e){if(10!==i.getToken())return null;var t=new cr(e,i.getTokenOffset());return t.value=i.getTokenValue(),f(t,!0)}function h(e,t){return function(e){if(3!==i.getToken())return null;var t=new sr(e,i.getTokenOffset());s();for(var r=0,n=!1;4!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){n||c("Value expected",Kt.ValueExpected);var o=i.getTokenOffset();if(s(),4===i.getToken()){n&&l("Trailing comma",Kt.TrailingComma,o,o+1);continue}}else n&&c("Expected comma",Kt.CommaExpected);var a=h(t,r++);a?t.items.push(a):c("Value expected",Kt.ValueExpected,null,[],[4,5]),n=!0}return 4!==i.getToken()?c("Expected comma or closing bracket",Kt.CommaOrCloseBacketExpected,t):f(t,!0)}(e)||function(e){if(1!==i.getToken())return null;var t=new fr(e,i.getTokenOffset()),r=Object.create(null);s();for(var n=!1;2!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){n||c("Property expected",Kt.PropertyExpected);var o=i.getTokenOffset();if(s(),2===i.getToken()){n&&l("Trailing comma",Kt.TrailingComma,o,o+1);continue}}else n&&c("Expected comma",Kt.CommaExpected);var a=p(t,r);a?t.properties.push(a):c("Property expected",Kt.PropertyExpected,null,[],[2,5]),n=!0}return 2!==i.getToken()?c("Expected comma or closing brace",Kt.CommaOrCloseBraceExpected,t):f(t,!0)}(e)||d(e)||function(e){if(11!==i.getToken())return null;var t=new lr(e,i.getTokenOffset());if(0===i.getTokenError()){var r=i.getTokenValue();try{var n=JSON.parse(r);if(!ct(n))return c("Invalid number format.",Kt.Undefined,t);t.value=n}catch(e){return c("Invalid number format.",Kt.Undefined,t)}t.isInteger=-1===r.indexOf(".")}return f(t,!0)}(e)||function(e){switch(i.getToken()){case 7:return f(new ir(e,i.getTokenOffset()),!0);case 8:return f(new ar(e,!0,i.getTokenOffset()),!0);case 9:return f(new ar(e,!1,i.getTokenOffset()),!0);default:return null}}(e)}var v=null;return 17!==s()&&((v=h(null))?17!==i.getToken()&&c("End of file expected.",Kt.Undefined):c("Expected a JSON object, array or literal.",Kt.Undefined)),new br(v,r,a)}function Cr(e,t){var r=e.length-t.length;return r>0?e.lastIndexOf(t)===r:0===r&&e===t}var kr=[",","}","]"],Ar=[":"],Or=function(){function e(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=Promise),void 0===n&&(n={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=r,this.clientCapabilities=n,this.templateVarIdCounter=0}return e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--)if(this.contributions[t].resolveCompletion){var r=this.contributions[t].resolveCompletion(e);if(r)return r}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,r){var n=this,o={items:[],isIncomplete:!1},i=e.getText(),a=e.offsetAt(t),s=r.getNodeFromOffset(a,!0);if(this.isInComment(e,s?s.offset:0,a))return Promise.resolve(o);if(s&&a===s.offset+s.length&&a>0){var l=i[a-1];("object"===s.type&&"}"===l||"array"===s.type&&"]"===l)&&(s=s.parent)}var c=this.getCurrentWord(e,a),u=null;if(!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type){var f=a-c.length;f>0&&'"'===i[f-1]&&f--,u=Fe.create(e.positionAt(f),t)}else u=Fe.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length));var p=this.doesSupportsCommitCharacters(),d={},h={add:function(e){var t=d[e.label];t?t.documentation||(t.documentation=e.documentation):(d[e.label]=e,u&&(e.textEdit=Ke.replace(u,e.insertText)),p&&(e.commitCharacters=e.kind===yt.Property?Ar:kr),o.items.push(e))},setAsIncomplete:function(){o.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return o.items.length}};return this.schemaService.getSchemaForResource(e.uri,r).then((function(t){var l=[],f=!0,p="",v=null;if(s&&"string"===s.type){var m=s.parent;m&&"property"===m.type&&m.keyNode===s&&(f=!m.valueNode,v=m,p=i.substr(s.offset+1,s.length-2),m&&(s=m.parent))}if(s&&"object"===s.type){if(s.offset===a)return o;s.properties.forEach((function(e){v&&v===e||(d[e.keyNode.value]=kt.create("__"))}));var g="";f&&(g=n.evaluateSeparatorAfter(e,e.offsetAt(u.end))),t?n.getPropertyCompletions(t,r,s,f,g,h):n.getSchemaLessPropertyCompletions(r,s,p,h);var y=gr(s);n.contributions.forEach((function(t){var r=t.collectPropertyCompletions(e.uri,y,c,f,""===g,h);r&&l.push(r)})),!t&&c.length>0&&'"'!==i.charAt(a-c.length-1)&&(h.add({kind:yt.Property,label:n.getLabelForValue(c),insertText:n.getInsertTextForProperty(c,null,!1,g),insertTextFormat:bt.Snippet,documentation:""}),h.setAsIncomplete())}var b={};return t?n.getValueCompletions(t,r,s,a,e,h,b):n.getSchemaLessValueCompletions(r,s,a,e,h),n.contributions.length>0&&n.getContributedValueCompletions(r,s,a,e,h,l),n.promiseConstructor.all(l).then((function(){if(0===h.getNumberOfProposals()){var t=a;!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type||(t=s.offset+s.length);var r=n.evaluateSeparatorAfter(e,t);n.addFillerValueCompletions(b,r,h)}return o}))}))},e.prototype.getPropertyCompletions=function(e,t,r,n,o,i){var a=this;t.getMatchingSchemas(e.schema,r.offset).forEach((function(e){if(e.node===r&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach((function(e){var r=t[e],s=!1;if("object"==typeof r&&r.allOf)for(var l=0,c=r.allOf;l<c.length;l++){if(c[l].readOnly){s=!0;break}}if("object"==typeof r&&!r.deprecationMessage&&!r.doNotSuggest&&!s){var u={kind:yt.Property,label:a.sanitizeLabel(e),insertText:a.getInsertTextForProperty(e,r,n,o),insertTextFormat:bt.Snippet,filterText:a.getFilterTextForValue(e),documentation:a.fromMarkup(r.markdownDescription)||r.description||""};Cr(u.insertText,"$1"+o)&&(u.command={title:"Suggest",command:"editor.action.triggerSuggest"}),i.add(u)}}))}}))},e.prototype.getSchemaLessPropertyCompletions=function(e,t,r,n){var o=this,i=function(e){e.properties.forEach((function(e){var t=e.keyNode.value;n.add({kind:yt.Property,label:o.sanitizeLabel(t),insertText:o.getInsertTextForValue(t,""),insertTextFormat:bt.Snippet,filterText:o.getFilterTextForValue(t),documentation:""})}))};if(t.parent)if("property"===t.parent.type){var a=t.parent.keyNode.value;e.visit((function(e){return"property"===e.type&&e!==t.parent&&e.keyNode.value===a&&e.valueNode&&"object"===e.valueNode.type&&i(e.valueNode),!0}))}else"array"===t.parent.type&&t.parent.items.forEach((function(e){"object"===e.type&&e!==t&&i(e)}));else"object"===t.type&&n.add({kind:yt.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:bt.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(e,t,r,n,o){var i=this,a=r;if(!t||"string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(a=t.offset+t.length,t=t.parent),!t)return o.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:bt.Snippet,documentation:""}),void o.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:bt.Snippet,documentation:""});var s=this.evaluateSeparatorAfter(n,a),l=function(e){yr(e.parent,r,!0)||o.add({kind:i.getSuggestionKind(e.type),label:i.getLabelTextForMatchingNode(e,n),insertText:i.getInsertTextForMatchingNode(e,n,s),insertTextFormat:bt.Snippet,documentation:""}),"boolean"===e.type&&i.addBooleanValueCompletion(!e.value,s,o)};if("property"===t.type&&r>t.colonOffset){var c=t.valueNode;if(c&&(r>c.offset+c.length||"object"===c.type||"array"===c.type))return;var u=t.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===u&&e.valueNode&&l(e.valueNode),!0})),"$schema"===u&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(s,o)}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var f=t.parent.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===f&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(l),!0}))}else t.items.forEach(l)},e.prototype.getValueCompletions=function(e,t,r,n,o,i,a){var s=this,l=n,c=null,u=null;if(!r||"string"!==r.type&&"number"!==r.type&&"boolean"!==r.type&&"null"!==r.type||(l=r.offset+r.length,u=r,r=r.parent),r){if("property"===r.type&&n>r.colonOffset){var f=r.valueNode;if(f&&n>f.offset+f.length)return;c=r.keyNode.value,r=r.parent}if(r&&(null!==c||"array"===r.type)){var p=this.evaluateSeparatorAfter(o,l);t.getMatchingSchemas(e.schema,r.offset,u).forEach((function(e){if(e.node===r&&!e.inverted&&e.schema){if("array"===r.type&&e.schema.items)if(Array.isArray(e.schema.items)){var t=s.findItemAtOffset(r,o,n);t<e.schema.items.length&&s.addSchemaValueCompletions(e.schema.items[t],p,i,a)}else s.addSchemaValueCompletions(e.schema.items,p,i,a);if(e.schema.properties){var l=e.schema.properties[c];l&&s.addSchemaValueCompletions(l,p,i,a)}}})),"$schema"!==c||r.parent||this.addDollarSchemaCompletions(p,i),a.boolean&&(this.addBooleanValueCompletion(!0,p,i),this.addBooleanValueCompletion(!1,p,i)),a.null&&this.addNullValueCompletion(p,i)}}else this.addSchemaValueCompletions(e.schema,"",i,a)},e.prototype.getContributedValueCompletions=function(e,t,r,n,o,i){if(t){if("string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(t=t.parent),"property"===t.type&&r>t.colonOffset){var a=t.keyNode.value,s=t.valueNode;if(!s||r<=s.offset+s.length){var l=gr(t.parent);this.contributions.forEach((function(e){var t=e.collectValueCompletions(n.uri,l,a,o);t&&i.push(t)}))}}}else this.contributions.forEach((function(e){var t=e.collectDefaultCompletions(n.uri,o);t&&i.push(t)}))},e.prototype.addSchemaValueCompletions=function(e,t,r,n){var o=this;"object"==typeof e&&(this.addEnumValueCompletions(e,t,r),this.addDefaultValueCompletions(e,t,r),this.collectTypes(e,n),Array.isArray(e.allOf)&&e.allOf.forEach((function(e){return o.addSchemaValueCompletions(e,t,r,n)})),Array.isArray(e.anyOf)&&e.anyOf.forEach((function(e){return o.addSchemaValueCompletions(e,t,r,n)})),Array.isArray(e.oneOf)&&e.oneOf.forEach((function(e){return o.addSchemaValueCompletions(e,t,r,n)})))},e.prototype.addDefaultValueCompletions=function(e,t,r,n){var o=this;void 0===n&&(n=0);var i=!1;if(ut(e.default)){for(var a=e.type,s=e.default,l=n;l>0;l--)s=[s],a="array";r.add({kind:this.getSuggestionKind(a),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,t),insertTextFormat:bt.Snippet}),i=!0}Array.isArray(e.examples)&&e.examples.forEach((function(a){for(var s=e.type,l=a,c=n;c>0;c--)l=[l],s="array";r.add({kind:o.getSuggestionKind(s),label:o.getLabelForValue(l),insertText:o.getInsertTextForValue(l,t),insertTextFormat:bt.Snippet}),i=!0})),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach((function(a){var s,l,c=e.type,u=a.body,f=a.label;if(ut(u)){e.type;for(var p=n;p>0;p--)u=[u],"array";s=o.getInsertTextForSnippetValue(u,t),l=o.getFilterTextForSnippetValue(u),f=f||o.getLabelForSnippetValue(u)}else if("string"==typeof a.bodyText){var d="",h="",v="";for(p=n;p>0;p--)d=d+v+"[\n",h=h+"\n"+v+"]",v+="\t",c="array";s=d+v+a.bodyText.split("\n").join("\n"+v)+h+t,f=f||o.sanitizeLabel(s),l=s.replace(/[\n]/g,"")}r.add({kind:o.getSuggestionKind(c),label:f,documentation:o.fromMarkup(a.markdownDescription)||a.description,insertText:s,insertTextFormat:bt.Snippet,filterText:l}),i=!0})),i||"object"!=typeof e.items||Array.isArray(e.items)||this.addDefaultValueCompletions(e.items,t,r,n+1)},e.prototype.addEnumValueCompletions=function(e,t,r){if(ut(e.const)&&r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:bt.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var n=0,o=e.enum.length;n<o;n++){var i=e.enum[n],a=this.fromMarkup(e.markdownDescription)||e.description;e.markdownEnumDescriptions&&n<e.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?a=this.fromMarkup(e.markdownEnumDescriptions[n]):e.enumDescriptions&&n<e.enumDescriptions.length&&(a=e.enumDescriptions[n]),r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(i),insertText:this.getInsertTextForValue(i,t),insertTextFormat:bt.Snippet,documentation:a})}},e.prototype.collectTypes=function(e,t){if(!Array.isArray(e.enum)&&!ut(e.const)){var r=e.type;Array.isArray(r)?r.forEach((function(e){return t[e]=!0})):t[r]=!0}},e.prototype.addFillerValueCompletions=function(e,t,r){e.object&&r.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},t),insertTextFormat:bt.Snippet,detail:"New object",documentation:""}),e.array&&r.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],t),insertTextFormat:bt.Snippet,detail:"New array",documentation:""})},e.prototype.addBooleanValueCompletion=function(e,t,r){r.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t),insertTextFormat:bt.Snippet,documentation:""})},e.prototype.addNullValueCompletion=function(e,t){t.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:bt.Snippet,documentation:""})},e.prototype.addDollarSchemaCompletions=function(e,t){var r=this;this.schemaService.getRegisteredSchemaIds((function(e){return"http"===e||"https"===e})).forEach((function(n){return t.add({kind:yt.Module,label:r.getLabelForValue(n),filterText:r.getFilterTextForValue(n),insertText:r.getInsertTextForValue(n,e),insertTextFormat:bt.Snippet,documentation:""})}))},e.prototype.sanitizeLabel=function(e){return(e=e.replace(/[\n]/g,"↵")).length>57&&(e=e.substr(0,57).trim()+"..."),e},e.prototype.getLabelForValue=function(e){return this.sanitizeLabel(JSON.stringify(e))},e.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},e.prototype.getFilterTextForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(e){var t=JSON.stringify(e);return t=t.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),this.sanitizeLabel(t)},e.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(e,t){var r=JSON.stringify(e,null,"\t");return"{}"===r?"{$1}"+t:"[]"===r?"[$1]"+t:this.getInsertTextForPlainText(r+t)},e.prototype.getInsertTextForSnippetValue=function(e,t){return function e(t,r,n){if(null!==t&&"object"==typeof t){var o=r+"\t";if(Array.isArray(t)){if(0===t.length)return"[]";for(var i="[\n",a=0;a<t.length;a++)i+=o+e(t[a],o,n),a<t.length-1&&(i+=","),i+="\n";return i+=r+"]"}var s=Object.keys(t);if(0===s.length)return"{}";for(i="{\n",a=0;a<s.length;a++){var l=s[a];i+=o+JSON.stringify(l)+": "+e(t[l],o,n),a<s.length-1&&(i+=","),i+="\n"}return i+=r+"}"}return n(t)}(e,"",(function(e){return"string"==typeof e&&"^"===e[0]?e.substr(1):JSON.stringify(e)}))+t},e.prototype.getInsertTextForGuessedValue=function(e,t){switch(typeof e){case"object":return null===e?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":var r=JSON.stringify(e);return r=r.substr(1,r.length-2),'"${1:'+(r=this.getInsertTextForPlainText(r))+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)},e.prototype.getSuggestionKind=function(e){if(Array.isArray(e)){var t=e;e=t.length>0?t[0]:null}if(!e)return yt.Value;switch(e){case"string":return yt.Value;case"object":return yt.Module;case"property":return yt.Property;default:return yt.Value}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getText().substr(e.offset,e.length)}},e.prototype.getInsertTextForMatchingNode=function(e,t,r){switch(e.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:var n=t.getText().substr(e.offset,e.length)+r;return this.getInsertTextForPlainText(n)}},e.prototype.getInsertTextForProperty=function(e,t,r,n){var o=this.getInsertTextForValue(e,"");if(!r)return o;var i,a=o+": ",s=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var l=t.defaultSnippets[0].body;ut(l)&&(i=this.getInsertTextForSnippetValue(l,""))}s+=t.defaultSnippets.length}if(t.enum&&(i||1!==t.enum.length||(i=this.getInsertTextForGuessedValue(t.enum[0],"")),s+=t.enum.length),ut(t.default)&&(i||(i=this.getInsertTextForGuessedValue(t.default,"")),s++),0===s){var c=Array.isArray(t.type)?t.type[0]:t.type;switch(c||(t.properties?c="object":t.items&&(c="array")),c){case"boolean":i="$1";break;case"string":i='"$1"';break;case"object":i="{$1}";break;case"array":i="[$1]";break;case"number":case"integer":i="${1:0}";break;case"null":i="${1:null}";break;default:return o}}}return(!i||s>1)&&(i="$1"),a+i+n},e.prototype.getCurrentWord=function(e,t){for(var r=t-1,n=e.getText();r>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(n.charAt(r));)r--;return n.substring(r+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var r=nt(e.getText(),!0);switch(r.setPosition(t),r.scan()){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(e,t,r){for(var n=nt(t.getText(),!0),o=e.items,i=o.length-1;i>=0;i--){var a=o[i];if(r>a.offset+a.length)return n.setPosition(a.offset+a.length),5===n.scan()&&r>=n.getTokenOffset()+n.getTokenLength()?i+1:i;if(r>=a.offset)return i}return 0},e.prototype.isInComment=function(e,t,r){var n=nt(e.getText(),!1);n.setPosition(t);for(var o=n.scan();17!==o&&n.getTokenOffset()+n.getTokenLength()<r;)o=n.scan();return(12===o||13===o)&&n.getTokenOffset()<=r},e.prototype.fromMarkup=function(e){if(e&&this.doesSupportMarkdown())return{kind:mt.Markdown,value:e}},e.prototype.doesSupportMarkdown=function(){if(!ut(this.supportsMarkdown)){var e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=e&&e.completionItem&&Array.isArray(e.completionItem.documentationFormat)&&-1!==e.completionItem.documentationFormat.indexOf(mt.Markdown)}return this.supportsMarkdown},e.prototype.doesSupportsCommitCharacters=function(){if(!ut(this.supportsCommitCharacters)){var e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=e&&e.completionItem&&!!e.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},e}(),Sr=function(){function e(e,t,r){void 0===t&&(t=[]),this.schemaService=e,this.contributions=t,this.promise=r||Promise}return e.prototype.doHover=function(e,t,r){var n=e.offsetAt(t),o=r.getNodeFromOffset(n);if(!o||("object"===o.type||"array"===o.type)&&n>o.offset+1&&n<o.offset+o.length-1)return this.promise.resolve(null);var i=o;if("string"===o.type){var a=o.parent;if(a&&"property"===a.type&&a.keyNode===o&&!(o=a.valueNode))return this.promise.resolve(null)}for(var s=Fe.create(e.positionAt(i.offset),e.positionAt(i.offset+i.length)),l=function(e){return{contents:e,range:s}},c=gr(o),u=this.contributions.length-1;u>=0;u--){var f=this.contributions[u].getInfoContribution(e.uri,c);if(f)return f.then((function(e){return l(e)}))}return this.schemaService.getSchemaForResource(e.uri,r).then((function(e){if(e){var t=r.getMatchingSchemas(e.schema,o.offset),n=null,i=null,a=null,s=null;t.every((function(e){if(e.node===o&&!e.inverted&&e.schema&&(n=n||e.schema.title,i=i||e.schema.markdownDescription||Er(e.schema.description),e.schema.enum)){var t=e.schema.enum.indexOf(mr(o));e.schema.markdownEnumDescriptions?a=e.schema.markdownEnumDescriptions[t]:e.schema.enumDescriptions&&(a=Er(e.schema.enumDescriptions[t])),a&&"string"!=typeof(s=e.schema.enum[t])&&(s=JSON.stringify(s))}return!0}));var c="";return n&&(c=Er(n)),i&&(c.length>0&&(c+="\n\n"),c+=i),a&&(c.length>0&&(c+="\n\n"),c+="`"+function(e){if(-1!==e.indexOf("`"))return"`` "+e+" ``";return e}(s)+"`: "+a),l([c])}return null}))},e}();function Er(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3").replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}var jr=r(778),Tr=function(){function e(e){try{this.patternRegExp=new RegExp(function(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}(e)+"$")}catch(e){this.patternRegExp=null}this.schemas=[]}return e.prototype.addSchema=function(e){this.schemas.push(e)},e.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},e.prototype.getSchemas=function(){return this.schemas},e}(),Mr=function(){function e(e,t,r){this.service=e,this.url=t,this.dependencies={},r&&(this.unresolvedSchema=this.service.promise.resolve(new Pr(r)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then((function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)}))),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},e}(),Pr=function(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t},Lr=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){return pr(this.getSectionRecursive(e,this.schema))},e.prototype.getSectionRecursive=function(e,t){if(!t||"boolean"==typeof t||0===e.length)return t;var r=e.shift();if(t.properties&&(t.properties[r],1))return this.getSectionRecursive(e,t.properties[r]);if(t.patternProperties)for(var n=0,o=Object.keys(t.patternProperties);n<o.length;n++){var i=o[n];if(new RegExp(i).test(r))return this.getSectionRecursive(e,t.patternProperties[i])}else{if("object"==typeof t.additionalProperties)return this.getSectionRecursive(e,t.additionalProperties);if(r.match("[0-9]+"))if(Array.isArray(t.items)){var a=parseInt(r,10);if(!isNaN(a)&&t.items[a])return this.getSectionRecursive(e,t.items[a])}else if(t.items)return this.getSectionRecursive(e,t.items)}return null},e}(),Ir=function(){function e(e,t,r){this.contextService=t,this.requestService=e,this.promiseConstructor=r||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter((function(t){var r=jr.a.parse(t).scheme;return"schemaservice"!==r&&(!e||e(r))}))},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){for(var t=this,r=!1,n=[e=this.normalizeId(e)],o=Object.keys(this.schemasById).map((function(e){return t.schemasById[e]}));n.length;)for(var i=n.pop(),a=0;a<o.length;a++){var s=o[a];s&&(s.url===i||s.dependencies[i])&&(s.url!==i&&n.push(s.url),s.clearSchema(),o[a]=void 0,r=!0)}return r},e.prototype.normalizeId=function(e){try{return jr.a.parse(e).toString()}catch(t){return e}},e.prototype.setSchemaContributions=function(e){if(e.schemas){var t=e.schemas;for(var r in t){var n=this.normalizeId(r);this.contributionSchemas[n]=this.addSchemaHandle(n,t[r])}}if(e.schemaAssociations){var o=e.schemaAssociations;for(var i in o){var a=o[i];this.contributionAssociations[i]=a;for(var s=this.getOrAddFilePatternAssociation(i),l=0,c=a;l<c.length;l++){var u=c[l];r=this.normalizeId(u);s.addSchema(r)}}}},e.prototype.addSchemaHandle=function(e,t){var r=new Mr(this,e,t);return this.schemasById[e]=r,r},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.getOrAddFilePatternAssociation=function(e){var t=this.filePatternAssociationById[e];return t||(t=new Tr(e),this.filePatternAssociationById[e]=t,this.filePatternAssociations.push(t)),t},e.prototype.registerExternalSchema=function(e,t,r){void 0===t&&(t=null);var n=this.normalizeId(e);if(this.registeredSchemasIds[n]=!0,t)for(var o=0,i=t;o<i.length;o++){var a=i[o];this.getOrAddFilePatternAssociation(a).addSchema(n)}return r?this.addSchemaHandle(n,r):this.getOrAddSchemaHandle(n)},e.prototype.clearExternalSchemas=function(){for(var e in this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={},this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var t in this.contributionAssociations)for(var r=this.getOrAddFilePatternAssociation(t),n=0,o=this.contributionAssociations[t];n<o.length;n++){var i=o[n];e=this.normalizeId(i);r.addSchema(e)}},e.prototype.getResolvedSchema=function(e){var t=this.normalizeId(e),r=this.schemasById[t];return r?r.getResolvedSchema():this.promise.resolve(null)},e.prototype.loadSchema=function(e){if(!this.requestService){var t="Unable to load schema from '"+Fr(e)+"'. No schema request service available";return this.promise.resolve(new Pr({},[t]))}return this.requestService(e).then((function(t){if(!t){var r="Unable to load schema from '"+Fr(e)+"': No content.";return new Pr({},[r])}var n,o=[];n=ot(t,o);var i=o.length?["Unable to parse content from '"+Fr(e)+"': Parse error at offset "+o[0].offset]:[];return new Pr(n,i)}),(function(t){var r="Unable to load schema from '"+Fr(e)+"': "+t.toString();return new Pr({},[r])}))},e.prototype.resolveSchemaContent=function(e,t,r){var n=this,o=e.errors.slice(0),i=e.schema;if(i.$schema){var a=this.normalizeId(i.$schema);if("http://json-schema.org/draft-03/schema"===a)return this.promise.resolve(new Lr({},["Draft-03 schemas are not supported."]));"https://json-schema.org/draft/2019-09/schema"===a&&e.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var s=this.contextService,l=function(e,t,r,n){var i=function(e,t){if(!t)return e;var r=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some((function(e){return!(r=r[e])})),r}(t,n);if(i)for(var a in i)i.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=i[a]);else o.push("$ref '"+n+"' in '"+r+"' can not be resolved.")},c=function(e,t,r,i,a){s&&!/^\w+:\/\/.*/.test(t)&&(t=s.resolveRelativePath(t,i)),t=n.normalizeId(t);var c=n.getOrAddSchemaHandle(t);return c.getUnresolvedSchema().then((function(n){if(a[t]=!0,n.errors.length){var i=r?t+"#"+r:t;o.push("Problems loading reference '"+i+"': "+n.errors[0]+".")}return l(e,n.schema,t,r),u(e,n.schema,t,c.dependencies)}))},u=function(e,t,r,o){if(!e||"object"!=typeof e)return Promise.resolve(null);for(var i=[e],a=[],s=[],u=function(e){for(var n=[];e.$ref;){var a=e.$ref,u=a.split("#",2);if(delete e.$ref,u[0].length>0)return void s.push(c(e,u[0],u[1],r,o));-1===n.indexOf(a)&&(l(e,t,r,u[1]),n.push(a))}!function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];"object"==typeof o&&i.push(o)}}(e.items,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];if("object"==typeof o)for(var a in o){var s=o[a];"object"==typeof s&&i.push(s)}}}(e.definitions,e.properties,e.patternProperties,e.dependencies),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];if(Array.isArray(o))for(var a=0,s=o;a<s.length;a++){var l=s[a];"object"==typeof l&&i.push(l)}}}(e.anyOf,e.allOf,e.oneOf,e.items)};i.length;){var f=i.pop();a.indexOf(f)>=0||(a.push(f),u(f))}return n.promise.all(s)};return u(i,i,t,r).then((function(e){return new Lr(i,o)}))},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var r=t.root.properties.filter((function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type}));if(r.length>0){var n=mr(r[0].valueNode);if(n&&function(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}(n,".")&&this.contextService&&(n=this.contextService.resolveRelativePath(n,e)),n){var o=this.normalizeId(n);return this.getOrAddSchemaHandle(o).getResolvedSchema()}}}for(var i=Object.create(null),a=[],s=0,l=this.filePatternAssociations;s<l.length;s++){var c=l[s];if(c.matchesPattern(e))for(var u=0,f=c.getSchemas();u<f.length;u++){var p=f[u];i[p]||(a.push(p),i[p]=!0)}}return a.length>0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(null)},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var r="schemaservice://combinedSchema/"+encodeURIComponent(e),n={allOf:t.map((function(e){return{$ref:e}}))};return this.addSchemaHandle(r,n)},e}();function Fr(e){return e}var _r=function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:We.Error)},e.prototype.doValidation=function(e,t,r,n){var o=this;if(!this.validationEnabled)return this.promise.resolve([]);var i=[],a={},s=function(e){var t=e.range.start.line+" "+e.range.start.character+" "+e.message;a[t]||(a[t]=!0,i.push(e))},l=function(n){var a=r?Rr(r.trailingCommas):We.Error,l=r?Rr(r.comments):o.commentSeverity;if(n){if(n.errors.length&&t.root){var c=t.root,u="object"===c.type?c.properties[0]:null;if(u&&"$schema"===u.keyNode.value){var f=u.valueNode||u,p=Fe.create(e.positionAt(f.offset),e.positionAt(f.offset+f.length));s(Ge.create(p,n.errors[0],We.Warning,Kt.SchemaResolveError))}else{p=Fe.create(e.positionAt(c.offset),e.positionAt(c.offset+1));s(Ge.create(p,n.errors[0],We.Warning,Kt.SchemaResolveError))}}else{var d=t.validate(e,n.schema);d&&d.forEach(s)}(function e(t){if(t&&"object"==typeof t){if(ft(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,n=t.allOf;r<n.length;r++){var o=n[r],i=e(o);if(ft(i))return i}}return})(n.schema)&&(l=void 0),function e(t){if(t&&"object"==typeof t){if(ft(t.allowTrailingCommas))return t.allowTrailingCommas;if(ft(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,n=t.allOf;r<n.length;r++){var o=n[r],i=e(o);if(ft(i))return i}}return}(n.schema)&&(a=void 0)}for(var h=0,v=t.syntaxErrors;h<v.length;h++){var m=v[h];if(m.code===Kt.TrailingComma){if("number"!=typeof a)continue;m.severity=a}s(m)}if("number"==typeof l){t.comments.forEach((function(e){s(Ge.create(e,"Comments are not permitted in JSON.",l,Kt.CommentNotPermitted))}))}return i};if(n){var c=n.id||"schemaservice://untitled/"+Nr++;return this.jsonSchemaService.resolveSchemaContent(new Pr(n),c,{}).then((function(e){return l(e)}))}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then((function(e){return l(e)}))},e}(),Nr=0;function Rr(e){switch(e){case"error":return We.Error;case"warning":return We.Warning;case"ignore":return}}function Dr(e){return e<48?0:e<=57?e-48:(e<97&&(e+=32),e>=97&&e<=102?e-97+10:0)}function Vr(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*Dr(e.charCodeAt(1))/255,green:17*Dr(e.charCodeAt(2))/255,blue:17*Dr(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*Dr(e.charCodeAt(1))/255,green:17*Dr(e.charCodeAt(2))/255,blue:17*Dr(e.charCodeAt(3))/255,alpha:17*Dr(e.charCodeAt(4))/255};case 7:return{red:(16*Dr(e.charCodeAt(1))+Dr(e.charCodeAt(2)))/255,green:(16*Dr(e.charCodeAt(3))+Dr(e.charCodeAt(4)))/255,blue:(16*Dr(e.charCodeAt(5))+Dr(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*Dr(e.charCodeAt(1))+Dr(e.charCodeAt(2)))/255,green:(16*Dr(e.charCodeAt(3))+Dr(e.charCodeAt(4)))/255,blue:(16*Dr(e.charCodeAt(5))+Dr(e.charCodeAt(6)))/255,alpha:(16*Dr(e.charCodeAt(7))+Dr(e.charCodeAt(8)))/255}}return null}var Br=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t,r){var n=this;void 0===r&&(r={resultLimit:Number.MAX_VALUE});var o=t.root;if(!o)return null;var i=r.resultLimit,a=e.uri;if(("vscode://defaultsettings/keybindings.json"===a||Cr(a.toLowerCase(),"/user/keybindings.json"))&&"array"===o.type){for(var s=[],l=0,c=o.items;l<c.length;l++){var u=c[l];if("object"===u.type)for(var f=0,p=u.properties;f<p.length;f++){var d=p[f];if("key"===d.keyNode.value&&d.valueNode){var h=_e.create(e.uri,Ur(e,u));if(s.push({name:mr(d.valueNode),kind:Pt.Function,location:h}),--i<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),s}}}return s}var v=function(t,r,o){return i>=0&&("array"===r.type?r.items.forEach((function(e){return v(t,e,o)})):"object"===r.type&&r.properties.forEach((function(r){if(i>=0){var a=r.valueNode;if(a){i--;var s=_e.create(e.uri,Ur(e,r)),l=o?o+"."+r.keyNode.value:r.keyNode.value;t.push({name:n.getKeyLabel(r),kind:n.getSymbolKind(a.type),location:s,containerName:o}),v(t,a,l)}}}))),t},m=v([],o,void 0);return i<0&&(m.pop(),r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a)),m},e.prototype.findDocumentSymbols2=function(e,t,r){var n=this;void 0===r&&(r={resultLimit:Number.MAX_VALUE});var o=t.root;if(!o)return null;var i=r.resultLimit,a=e.uri;if(("vscode://defaultsettings/keybindings.json"===a||Cr(a.toLowerCase(),"/user/keybindings.json"))&&"array"===o.type){for(var s=[],l=0,c=o.items;l<c.length;l++){var u=c[l];if("object"===u.type)for(var f=0,p=u.properties;f<p.length;f++){var d=p[f];if("key"===d.keyNode.value&&d.valueNode){var h=Ur(e,u),v=Ur(e,d.keyNode);if(s.push({name:mr(d.valueNode),kind:Pt.Function,range:h,selectionRange:v}),--i<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a),s}}}return s}var m=function(t,r){return i>=0&&("array"===r.type?r.items.forEach((function(r,o){if(r&&i>=0){i--;var a=Ur(e,r),s=a,l=String(o),c=m([],r);t.push({name:l,kind:n.getSymbolKind(r.type),range:a,selectionRange:s,children:c})}})):"object"===r.type&&r.properties.forEach((function(r){var o=r.valueNode;if(o&&i>=0){i--;var a=Ur(e,r),s=Ur(e,r.keyNode),l=m([],o);t.push({name:n.getKeyLabel(r),kind:n.getSymbolKind(o.type),range:a,selectionRange:s,children:l})}}))),t},g=m([],o);return i<0&&(g.pop(),r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(a)),g},e.prototype.getSymbolKind=function(e){switch(e){case"object":return Pt.Module;case"string":return Pt.String;case"number":return Pt.Number;case"array":return Pt.Array;case"boolean":return Pt.Boolean;default:return Pt.Variable}},e.prototype.getKeyLabel=function(e){var t=e.keyNode.value;return t&&(t=t.replace(/[\n]/g,"↵")),t&&t.trim()?t:'"'+t+'"'},e.prototype.findDocumentColors=function(e,t,r){return this.schemaService.getSchemaForResource(e.uri,t).then((function(n){var o=[];if(n)for(var i=r&&"number"==typeof r.resultLimit?r.resultLimit:Number.MAX_VALUE,a={},s=0,l=t.getMatchingSchemas(n.schema);s<l.length;s++){var c=l[s];if(!c.inverted&&c.schema&&("color"===c.schema.format||"color-hex"===c.schema.format)&&c.node&&"string"===c.node.type){var u=String(c.node.offset);if(!a[u]){var f=Vr(mr(c.node));if(f){var p=Ur(e,c.node);o.push({color:f,range:p})}if(a[u]=!0,--i<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(e.uri),o}}}return o}))},e.prototype.getColorPresentations=function(e,t,r,n){var o,i=[],a=Math.round(255*r.red),s=Math.round(255*r.green),l=Math.round(255*r.blue);function c(e){var t=e.toString(16);return 2!==t.length?"0"+t:t}return o=1===r.alpha?"#"+c(a)+c(s)+c(l):"#"+c(a)+c(s)+c(l)+c(Math.round(255*r.alpha)),i.push({label:o,textEdit:Ke.replace(n,JSON.stringify(o))}),i},e}();function Ur(e,t){return Fe.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}var zr={schemaAssociations:{},schemas:{}};function Wr(e,t){var r=[],n=[],o=[],i=-1,a=nt(e.getText(),!1),s=a.scan();function l(e){r.push(e),n.push(o.length)}for(;17!==s;){switch(s){case 1:case 3:var c={startLine:p=e.positionAt(a.getTokenOffset()).line,endLine:p,kind:1===s?"object":"array"};o.push(c);break;case 2:case 4:var u=2===s?"object":"array";if(o.length>0&&o[o.length-1].kind===u){c=o.pop();var f=e.positionAt(a.getTokenOffset()).line;c&&f>c.startLine+1&&i!==c.startLine&&(c.endLine=f-1,l(c),i=c.startLine)}break;case 13:var p=e.positionAt(a.getTokenOffset()).line,d=e.positionAt(a.getTokenOffset()+a.getTokenLength()).line;1===a.getTokenError()&&p+1<e.lineCount?a.setPosition(e.offsetAt(Ie.create(p+1,0))):p<d&&(l({startLine:p,endLine:d,kind:Be.Comment}),i=p);break;case 12:var h=e.getText().substr(a.getTokenOffset(),a.getTokenLength()).match(/^\/\/\s*#(region\b)|(endregion\b)/);if(h){f=e.positionAt(a.getTokenOffset()).line;if(h[1]){c={startLine:f,endLine:f,kind:Be.Region};o.push(c)}else{for(var v=o.length-1;v>=0&&o[v].kind!==Be.Region;)v--;if(v>=0){c=o[v];o.length=v,f>c.startLine&&i!==c.startLine&&(c.endLine=f,l(c),i=c.startLine)}}}}s=a.scan()}var m=t&&t.rangeLimit;if("number"!=typeof m||r.length<=m)return r;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);for(var g=[],y=0,b=n;y<b.length;y++){(A=b[y])<30&&(g[A]=(g[A]||0)+1)}var x=0,w=0;for(v=0;v<g.length;v++){var C=g[v];if(C){if(C+x>m){w=v;break}x+=C}}var k=[];for(v=0;v<r.length;v++){var A;"number"==typeof(A=n[v])&&(A<w||A===w&&x++<m)&&k.push(r[v])}return k}function Hr(e,t,r){function n(t,r){return Fe.create(e.positionAt(t),e.positionAt(r))}var o=nt(e.getText(),!0);function i(e,t){return o.setPosition(e),o.scan()===t?o.getTokenOffset()+o.getTokenLength():-1}return t.map((function(t){for(var o=e.offsetAt(t),a=r.getNodeFromOffset(o,!0),s=[];a;){switch(a.type){case"string":case"object":case"array":var l=a.offset+1,c=a.offset+a.length-1;l<c&&o>=l&&o<=c&&s.push(n(l,c)),s.push(n(a.offset,a.offset+a.length));break;case"number":case"boolean":case"null":case"property":s.push(n(a.offset,a.offset+a.length))}if("property"===a.type||a.parent&&"array"===a.parent.type){var u=i(a.offset+a.length,5);-1!==u&&s.push(n(a.offset,u))}a=a.parent}for(var f=void 0,p=s.length-1;p>=0;p--)f=Ut.create(s[p],f);return f||(f=Ut.create(Fe.create(t,t))),f}))}r(779),r(780),r(781),r(782),r(783),r(784),r(785),r(787),r(789),r(791);var qr=function(e){var t=e.promiseConstructor||Promise,r=new Ir(e.schemaRequestService,e.workspaceContext,t);r.setSchemaContributions(zr);var n=new Or(r,e.contributions,t,e.clientCapabilities),o=new Sr(r,e.contributions,t),i=new Br(r),a=new _r(r,t);return{configure:function(e){r.clearExternalSchemas(),e.schemas&&e.schemas.forEach((function(e){r.registerExternalSchema(e.uri,e.fileMatch,e.schema)})),a.configure(e)},resetSchema:function(e){return r.onResourceChange(e)},doValidation:a.doValidation.bind(a),parseJSONDocument:function(e){return wr(e,{collectComments:!0})},newJSONDocument:function(e,t){return function(e,t){return void 0===t&&(t=[]),new br(e,t,[])}(e,t)},doComplete:n.doComplete.bind(n),findDocumentSymbols:i.findDocumentSymbols.bind(i),findDocumentSymbols2:i.findDocumentSymbols2.bind(i),findColorSymbols:function(e,t){return i.findDocumentColors(e,t).then((function(e){return e.map((function(e){return e.range}))}))},findDocumentColors:i.findDocumentColors.bind(i),getColorPresentations:i.getColorPresentations.bind(i),doHover:o.doHover.bind(o),getFoldingRanges:Wr,getSelectionRanges:Hr,format:function(e,t,r){var n=void 0;if(t){var o=e.offsetAt(t.start);n={offset:o,length:e.offsetAt(t.end)-o}}var i={tabSize:r?r.tabSize:4,insertSpaces:!r||r.insertSpaces,eol:"\n"};return function(e,t,r){return Ee(e,t,r)}(e.getText(),n,i).map((function(t){return Ke.replace(Fe.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length)),t.content)}))}}}({});Ce.registerHelper("lint","json",(function(e,t){return Object(a.b)(this,void 0,void 0,(function(){var r,n,o,i,s;return Object(a.e)(this,(function(a){switch(a.label){case 0:return r=t.schema,n=t.setError,qr.configure({validate:!0,schemas:[{uri:"stub://"+t.id,fileMatch:["*"],schema:r}]}),o=$t.create(t.id+".json","json",0,e),i=qr.parseJSONDocument(o),[4,qr.doValidation(o,i)];case 1:return(s=a.sent()).length?n&&n(s[0].message):n&&n(void 0),[2,s.map((function(e){return{from:Ce.Pos(e.range.start.line,e.range.start.character),to:Ce.Pos(e.range.end.line,e.range.end.character),message:e.message}}))]}}))}))})),Ce.registerHelper("hint","json",(function(e,t){return Object(a.b)(void 0,void 0,void 0,(function(){var r,n,o,i,s,l,c,u;return Object(a.e)(this,(function(a){switch(a.label){case 0:return(r=t.schema)?(qr.configure({validate:!0,schemas:[{uri:"stub://"+t.id,fileMatch:["*"],schema:r}]}),n=e.getDoc().getCursor(),o=e.getTokenAt(n),i=$t.create(t.id+".json","json",0,e.getValue()),s=qr.parseJSONDocument(i),[4,qr.doComplete(i,{line:n.line,character:n.ch},s)]):[2];case 1:return l=a.sent(),c=function(e){for(var t="";e--;)t+=" ";return t},u=l?l.items.map((function(e){return{text:e.insertText,displayText:e.label,filter:e.filterText||e.label,from:{line:e.textEdit.range.start.line,ch:e.textEdit.range.start.character},to:{line:e.textEdit.range.end.line,ch:e.textEdit.range.end.character},hint:function(e,t,r){var n=r.text.replace(/(\$1|\${1:[^}]+})/,"_$__REDOC_CURSOR_HERE")||"";if(n=n.replace(/(\$\d+|\${[^}]+})/g,"")||"",e.setSelection(r.from,r.to),n.indexOf("\n")>-1){var o=e.getLine(e.getCursor().line).search(/(\S|$)/);n=n.replace(/\n/g,"\n"+c(o))}e.replaceSelection(n);var i=e.getSearchCursor("_$__REDOC_CURSOR_HERE",r.from);i.findNext()&&(e.setCursor(i.from()),i.replace(""))}}})):[],/(property|string)/.test(o.type||"")&&(u=u.filter((function(e){return e.filter.replace(/(^"|"$)/g,"").startsWith(o.string.replace(/(^"|"$)/g,""))}))),[2,{from:Ce.Pos(n.line,o.start),to:Ce.Pos(n.line,n.ch),list:u}]}}))}))}));var Gr,$r,Kr,Jr,Yr,Xr,Qr=Object(h.cb)(Gr||(Gr=Object(a.f)(["\n .cm-s-material.CodeMirror {\n background-color: ","!important;\n color: ","!important;\n font-family: ",";\n line-height: 18px;\n padding: 10px;\n }\n\n .CodeMirror-lint-mark-error {\n background-size: 4px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAVUlEQVR42mNgQAL/GRjigPg/EP8FYntkCX4gtoVKgvE/BoabcEVAhj6S5DUgfgFl/wFJ2gPxL6iuT1DF+kD2R5AYA5KRj6CS/FAMYvszIBltz4AFAAD9fz0YtLg13wAAAABJRU5ErkJggg==') !important;\n }\n\n .cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(255, 255, 255, 0.3) !important;\n }\n\n .cm-s-material .CodeMirror-code .cm-string.cm-property {\n color: #9EFAA7;\n }\n\n .cm-s-material .CodeMirror-code .cm-string {\n color: #FEE39E;\n }\n\n .cm-s-material .CodeMirror-code .cm-atom {\n color: ",";\n }\n\n div .cm-s-material .CodeMirror-matchingbracket {\n outline: 1px solid grey;\n text-decoration: none;\n }\n\n .react-codemirror2 {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n overflow: hidden;\n\n flex: 1;\n }\n\n .CodeMirror {\n flex: 1;\n max-height: 65vh !important; /* it fixes performance bug if we pass big data to CodeMirror */\n border-radius: ",";\n }\n"],["\n .cm-s-material.CodeMirror {\n background-color: ","!important;\n color: ","!important;\n font-family: ",";\n line-height: 18px;\n padding: 10px;\n }\n\n .CodeMirror-lint-mark-error {\n background-size: 4px;\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAVUlEQVR42mNgQAL/GRjigPg/EP8FYntkCX4gtoVKgvE/BoabcEVAhj6S5DUgfgFl/wFJ2gPxL6iuT1DF+kD2R5AYA5KRj6CS/FAMYvszIBltz4AFAAD9fz0YtLg13wAAAABJRU5ErkJggg==') !important;\n }\n\n .cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(255, 255, 255, 0.3) !important;\n }\n\n .cm-s-material .CodeMirror-code .cm-string.cm-property {\n color: #9EFAA7;\n }\n\n .cm-s-material .CodeMirror-code .cm-string {\n color: #FEE39E;\n }\n\n .cm-s-material .CodeMirror-code .cm-atom {\n color: ",";\n }\n\n div .cm-s-material .CodeMirror-matchingbracket {\n outline: 1px solid grey;\n text-decoration: none;\n }\n\n .react-codemirror2 {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n overflow: hidden;\n\n flex: 1;\n }\n\n .CodeMirror {\n flex: 1;\n max-height: 65vh !important; /* it fixes performance bug if we pass big data to CodeMirror */\n border-radius: ",";\n }\n"])),(function(e){return e.theme.rightPanel.panelControlsBackgroundColor}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.typography.code.fontFamily}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius})),Zr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"_onKeyUp",{enumerable:!0,configurable:!0,writable:!0,value:function(e,r){/^[a-zA-Z0-9_":]$/.test(r.key)&&t.editor.execCommand("autocomplete")}}),Object.defineProperty(t,"initEditor",{enumerable:!0,configurable:!0,writable:!0,value:function(e){t.editor=e,e.on("keyup",t._onKeyUp)}}),Object.defineProperty(t,"refreshEditor",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.editor.refresh()}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;setTimeout((function(){e.editor.refresh()}),0),document.addEventListener("click",this.refreshEditor)}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){document.removeEventListener("click",this.refreshEditor)}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props.fieldState.value,r=this.props.fieldApi,n=r.setValue,o=r.setTouched,i=r.setError,a=this.props,l=a.onChange,c=a.onBlur,u=a.forwardedRef;return s.createElement(s.Fragment,null,s.createElement(Qr,null),s.createElement(we.Controlled,{editorDidMount:this.initEditor,value:t||"",ref:u||void 0,onBeforeChange:function(e,t,r){n(r),l&&l(r)},onBlur:function(e){o(),c&&c(e)},options:{mode:this.props.mode||"application/json",theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!0})}},hintOptions:{id:this.props.id,completeSingle:!1,schema:this.props.schema},lint:{id:this.props.id,schema:this.props.schema,setError:i}}}))}}),t}(s.Component),en=Object(c.b)(Zr),tn=Object(m.e)($.d)($r||($r=Object(a.f)(["\n border-radius: ",";\n margin-bottom: 10px;\n"],["\n border-radius: ",";\n margin-bottom: 10px;\n"])),(function(e){return e.theme.components.panels.borderRadius})),rn=r(88),nn=r(11),on=["byte","binary","base64"],an=["string","array"],sn=["image/png","image/jpeg"],ln=function(e){var t=e.items?e.items.format||e.items.contentEncoding:e.format||e.contentEncoding,r=e.type;return!(!r&&!t)&&(on.includes(t)&&an.includes(r))},cn=function(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(){var e=n.result.replace(/data:.*\/.*;base64,/g,"");t(e)},n.onerror=function(){return r(n.error)},n.readAsDataURL(e)}))},un=s.forwardRef((function(e,t){var r=Object(a.g)(e,[]),n=r.schema,o=r.contentName,i=r.onChange,l=r.name;return(0,Object(c.c)(Object(a.a)({field:l},r)).render)(s.createElement("input",{"data-cy":"file-upload-input",type:"file",id:r.id,className:r.className,name:r.name,onChange:function(e){return Object(a.b)(this,void 0,void 0,(function(){var t,r,s,l,c=this;return Object(a.e)(this,(function(u){switch(u.label){case 0:return t=1===e.target.files.length?e.target.files[0]:e.target.files,"string"===(r=n.properties?n.properties[o]:n).type&&r.format?"base64"!==r.format?[3,2]:[4,cn(t)]:[3,2];case 1:t=u.sent(),u.label=2;case 2:return"array"===r.type&&r.items?"base64"!==r.items.format?[3,7]:t.length?[4,Promise.all(Object.keys(t).map((function(e){return Object(a.b)(c,void 0,void 0,(function(){return Object(a.e)(this,(function(r){switch(r.label){case 0:return[4,cn(t[e])];case 1:return[2,r.sent()]}}))}))})))]:[3,4]:[3,11];case 3:return s=u.sent(),[3,6];case 4:return[4,cn(t)];case 5:s=u.sent(),u.label=6;case 6:return t=s,[3,11];case 7:return t.length?[4,Promise.all(Object.keys(t).map((function(e){return t[e]})))]:[3,9];case 8:return l=u.sent(),[3,10];case 9:l=t,u.label=10;case 10:t=l,u.label=11;case 11:return i(o,t),[2]}}))}))},multiple:r.multiple,accept:r.accept,ref:t}))})),fn=Object(h.mb)(un)(Kr||(Kr=Object(a.f)(["\n ","\n ",";\n ","\n"],["\n ","\n ",";\n ","\n"])),g,(function(e){return"password"===e.inputType?"padding-right: 40px;":""}),(function(e){return e.fullWidth?"width: 100%;":""})),pn=h.mb.div(Jr||(Jr=Object(a.f)(["\n > div {\n margin-top: 10px;\n }\n"],["\n > div {\n margin-top: 10px;\n }\n"]))),dn=function(e){var t=Object(a.g)(e,[]),r=t.schema,n=t.mediaType,o=t.onChange;return s.createElement(pn,null,"string"==r.type&&ln(r)&&s.createElement(v.a,null,s.createElement(fn,{fullWidth:!0,id:"body."+n.name,name:"body."+n.name,accept:sn.includes(n.name)?n.name:void 0,schema:r,contentName:n.name,onChange:o}))||null,"object"===r.type&&r.properties&&s.createElement(s.Fragment,null,Object.keys(r.properties).map((function(e,t){return ln(r.properties[e])&&s.createElement(v.a,{key:t},s.createElement(v.d,null,e,":"),s.createElement(fn,{fullWidth:!0,id:"body."+e,name:"body."+e,accept:sn.includes(n.name)?n.name:void 0,multiple:"array"===r.properties[e].type,schema:r,contentName:e,onChange:o}))||s.createElement(v.a,{key:t},s.createElement(v.d,null,e,":"),s.createElement(k,{fullWidth:!0,id:"body."+e,field:"body."+e,placeholder:r.properties[e].description||e}))})))||null)},hn=Object(u.a)((function(e){var t,r,n=e.properties,o=void 0===n?{}:n,i=Object(a.g)(e,["properties"]),l=function(e){var t,r=i.body.content;if(!r||!r.hasSample)return"";var n=null===(t=r.active)||void 0===t?void 0:t.examples;if(null==n||!n[e])return"";var a=xe()(null==n?void 0:n[e].value,o,{arrayMerge:nn.a});return JSON.stringify(a,null,2)},c=null===(t=i.body.content)||void 0===t||null===(r=t.operation)||void 0===r?void 0:r.activeExampleName,u=function(e){var t,r;null===(t=i.body.content)||void 0===t||null===(r=t.operation)||void 0===r||r.activateExampleName(e),i.console.formApi.setValue("body",l(e))},f=function(e){if(!e)return"";if("application/x-www-form-urlencoded"===e.mime)return e.value;var t=xe()(e.value,o,{arrayMerge:nn.a});return JSON.stringify(t,null,2)},p=function(e,t){return Object(a.b)(void 0,void 0,void 0,(function(){var r;return Object(a.e)(this,(function(n){return r=i.console.formApi,(0,r.setValue)("body."+e,t),[2]}))}))};Object(s.useEffect)((function(){c&&i.console.formApi.setValue("body",l(c))}),[c]);var d=i.validate,v=i.body;return s.createElement(s.Fragment,null,s.createElement(h.t,{content:v.content,renderDropdown:function(e){return s.createElement(h.g,Object(a.a)({},e,{variant:"dark",fullWidth:!0,Label:tn,Dropdown:h.f}))}},(function(e){var t,r=e.examples||{},n=Object.keys(r);i.resolvedBody&&(t=(i.resolvedBody.content[e.name]||{}).schema);var o=Object(rn.c)(e.operation,r).exampleKey,a=r[o];return s.createElement(s.Fragment,null,n.length&&1!==n.length&&s.createElement(rn.a,{examples:r,onChange:u,exampleKey:o})||null,function(e){return"string"==e.type?ln(e):!("object"!==e.type||!e.properties)&&Object.values(e.properties).some(ln)}(t)&&s.createElement(dn,{schema:t,id:i.id,mediaType:e,validate:d,initialSample:f(a),onChange:p.bind(void 0)})||s.createElement(en,{id:"body"+i.id,field:"body",initialValue:f(a),schema:t,mode:e.name,validate:d}))})))})),vn=r(10),mn=h.mb.div(Yr||(Yr=Object(a.f)(["\n display: flex;\n font-size: 12px;\n button {\n margin: 0;\n }\n"],["\n display: flex;\n font-size: 12px;\n button {\n margin: 0;\n }\n"]))),gn=h.mb.button(Xr||(Xr=Object(a.f)(["\n outline: none;\n border: none;\n background-color: ",";\n text-align: center;\n cursor: pointer;\n color: ",";\n min-width: 80px;\n min-height: 30px;\n border-radius: ",";\n font-size: 12px;\n\n padding: 0 10px;\n\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n\n &:first-child {\n border-top-left-radius: ",";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: ",";\n }\n\n &:last-child {\n border-top-left-radius: 0;\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: 0;\n }\n\n ","\n\n ","\n"],["\n outline: none;\n border: none;\n background-color: ",";\n text-align: center;\n cursor: pointer;\n color: ",";\n min-width: 80px;\n min-height: 30px;\n border-radius: ",";\n font-size: 12px;\n\n padding: 0 10px;\n\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n\n &:first-child {\n border-top-left-radius: ",";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: ",";\n }\n\n &:last-child {\n border-top-left-radius: 0;\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: 0;\n }\n\n ","\n\n ","\n"])),(function(e){return e.theme.rightPanel.panelBackgroundColor}),(function(e){return e.theme.colors.text.light}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.shape.borderRadius}),(function(e){var t=e.active,r=e.theme;return t&&"\n border-bottom: 4px solid "+r.colors.accent.main+";\n background-color: "+Object(vn.a)(.05,r.rightPanel.panelBackgroundColor)+";\n "||""}),(function(e){var t=e.disabled,r=e.theme;return t&&"\n cursor: default;\n color: "+Object(vn.f)(.3,r.colors.text.light)+";\n "||""})),yn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.onChange,r=e.active,n=e.hasResponse;return s.createElement(mn,null,s.createElement(gn,{onClick:function(){return t(0)},active:0===r},n?"Edit Request":"Request"),s.createElement(gn,{onClick:function(){return n&&t(1)},active:1===r,disabled:!n}," ","Response"," "))}}),t}(s.Component),bn=m.e.input(Cn||(Cn=Object(a.f)(["\n cursor: pointer;\n vertical-align: middle;\n margin-left: 0;\n margin-right: 5px;\n height: 20px;\n"],["\n cursor: pointer;\n vertical-align: middle;\n margin-left: 0;\n margin-right: 5px;\n height: 20px;\n"]))),xn=m.e.label(kn||(kn=Object(a.f)(["\n display: inline-block;\n cursor: pointer;\n vertical-align: middle;\n margin-bottom: 4px;\n position: relative;\n text-overflow: ellipsis;\n overflow: hidden;\n\n overflow-wrap: break-word;\n line-height: 20px;\n"],["\n display: inline-block;\n cursor: pointer;\n vertical-align: middle;\n margin-bottom: 4px;\n position: relative;\n text-overflow: ellipsis;\n overflow: hidden;\n\n overflow-wrap: break-word;\n line-height: 20px;\n"]))),wn=m.e.div(An||(An=Object(a.f)(["\n width: ",";\n display: inline-flex;\n\n & > label {\n white-space: ",";\n }\n"],["\n width: ",";\n display: inline-flex;\n\n & > label {\n white-space: ",";\n }\n"])),(function(e){return e.fullWidth?"100%":"50%"}),(function(e){return e.nowrap?"nowrap":"normal"}));var Cn,kn,An,On,Sn,En,jn=s.forwardRef((function(e,t){var r=e.fullWidth,n=e.id,o=e.label,i=e.nowrap;return s.createElement(wn,{fullWidth:r,nowrap:i},s.createElement(bn,Object(a.a)({},e,{type:"checkbox",ref:t})),s.createElement(xn,{htmlFor:n},o))})),Tn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{collapsed:!0}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"onCheckBoxClick",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.target.value,r=e.target.checked;this.props.fieldApi.setTouched(!0);var n,o=this.props.fieldApi.getValue()||[];if(r)n=Object(a.h)(Object(a.h)([],o,!0),[t],!1);else{var i=o.indexOf(t);n=Object(a.h)(Object(a.h)([],o.slice(0,i),!0),o.slice(i+1),!0)}this.props.fieldApi.setValue(n)}}),Object.defineProperty(t.prototype,"isFieldChecked",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.props.fieldApi.getValue().includes(e)}}),Object.defineProperty(t.prototype,"toggle",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setState({collapsed:!this.state.collapsed})}}),Object.defineProperty(t.prototype,"selectAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.fieldApi.setValue(this.props.items)}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.fieldApi.setValue([])}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.props,r=t.items,n=t.fieldApi,o=t.validateOnChange,i=t.maxDisplayedItems,a=t.showControls,l=t.trimItemsLength,c=this.state.collapsed,u=n.getError(),f=i||11,p=l&&this.state.collapsed?r.slice(0,f):r;return s.createElement(In,null,a?s.createElement(Pn,null,s.createElement(ce.p,{onClick:function(){e.selectAll()}},"Select all"),s.createElement(ce.p,{onClick:function(){e.clearAll()}},"Clear")):null,s.createElement("div",null,p.map((function(t){return s.createElement(jn,{nowrap:!0,id:t,value:t,checked:e.isFieldChecked(t),label:t,key:t,onChange:function(t){e.onCheckBoxClick(t),o&&n.validate()}})})),r.length>f&&l?s.createElement(Ln,{onClick:function(){e.toggle()}},c?"Show all":"Collapse"):null),u?s.createElement(v.b,null,u):"")}}),t}(s.Component),Mn=Object(c.b)(Tn),Pn=Object(h.mb)(ce.n)(On||(On=Object(a.f)(["\n opacity: 1;\n text-align: left;\n"],["\n opacity: 1;\n text-align: left;\n"]))),Ln=Object(h.mb)(ce.p)(Sn||(Sn=Object(a.f)(["\n float: right;\n"],["\n float: right;\n"]))),In=h.mb.div(En||(En=Object(a.f)(["\n margin-top: 10px;\n"],["\n margin-top: 10px;\n"])));function Fn(e){var t=e.scopes,r=e.id,n=[];try{n=JSON.parse(Object(f.e)("auth."+r+".scopes"))}catch(e){}return t&&t.length?s.createElement(v.a,null,s.createElement(v.d,null," Scopes: "),s.createElement(Mn,{field:"auth."+r+".scopes",initialValue:n,items:t,showControls:!0,trimItemsLength:!0})):s.createElement(s.Fragment,null)}var _n=r(170),Nn=function(){function e(){}return Object.defineProperty(e,"authorizeImplicit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t.authorizationUrl,n=t.clientId,o=t.scopes,i=t.extraParams,a=void 0===i?{}:i,s=t.routingBasePath,l=t.redirectUri,c=t.successCallback,u=t.errorCallback,f=Vn({date:(new Date).toString()}),p=new URL(r),d="/"===s?"":s,h=""+window.location.origin+d+"/oauth2-redirect.html";for(var v in p.searchParams.set("client_id",n),p.searchParams.set("redirect_uri",l||h),p.searchParams.set("response_type","token"),p.searchParams.set("state",f),Array.isArray(o)&&p.searchParams.set("scope",o.join(" ")),a)p.searchParams.set(v,a[v]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:n,scopes:o},state:f,successCallback:function(t){c(t),e.clearRedirectData("implicit")},errorCallback:function(t){u(t),e.clearRedirectData("implicit")}},window.open(p.toString())}}),Object.defineProperty(e,"authorizeAuthorizationCode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=t.authorizationUrl,o=t.tokenUrl,i=t.clientId,s=t.clientSecret,l=t.scopes,c=t.extraParams,u=void 0===c?{}:c,f=t.routingBasePath,p=t.redirectUri,d=t.successCallback,h=t.errorCallback,v=new URL(n),m="/"===f?"":f,g=""+window.location.origin+m+"/oauth2-redirect.html",y=Vn({date:(new Date).toString()});for(var b in v.searchParams.set("client_id",i),v.searchParams.set("redirect_uri",p||g),v.searchParams.set("response_type","code"),v.searchParams.set("state",y),Array.isArray(l)&&v.searchParams.set("scope",l.join(" ")),u)v.searchParams.set(b,u[b]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:n,clientId:i,scopes:l},state:y,successCallback:function(t){var n=t.auth_code;return Object(a.b)(r,void 0,void 0,(function(){var t;return Object(a.e)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:_n.stringify(Object(a.a)({client_id:i,client_secret:s,code:n,grant_type:"authorization_code",redirect_uri:p||g},u))})];case 1:return[4,Rn(r.sent(),d,h)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),h(t),[3,4];case 4:return e.clearRedirectData("authorizationCode"),[2]}}))}))},errorCallback:function(t){h(t),e.clearRedirectData("authorizationCode")}},window.open(v.toString())}}),Object.defineProperty(e,"clearRedirectData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:function(){},errorCallback:function(){}}}}),Object.defineProperty(e,"authorizeClientCredentials",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tokenUrl,r=e.clientId,n=e.clientSecret,o=e.scopes,i=void 0===o?[]:o,s=e.extraParams,l=void 0===s?{}:s,c=e.successCallback,u=e.errorCallback;return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.e)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:_n.stringify(Object(a.a)({client_id:r,client_secret:n,grant_type:"client_credentials",scope:Array.isArray(i)?i.join(" "):void 0},l))})];case 1:return[4,Rn(o.sent(),c,u)];case 2:return o.sent(),[3,4];case 3:return e=o.sent(),u(e),[3,4];case 4:return[2]}}))}))}}),e}();new Nn;function Rn(e,t,r){return Object(a.b)(this,void 0,void 0,(function(){var n,o,i,s,l,c;return Object(a.e)(this,(function(a){switch(a.label){case 0:return e.ok?[4,e.json()]:[3,2];case 1:return n=a.sent(),t(n),[3,7];case 2:return o=r,i=Error.bind,(e.headers.get("Content-Type")||"").indexOf("json")>-1?(c=(l=JSON).stringify,[4,e.json()]):[3,4];case 3:return s=c.apply(l,[a.sent()]),[3,6];case 4:return[4,e.text()];case 5:s=a.sent(),a.label=6;case 6:o.apply(void 0,[new(i.apply(Error,[void 0,s]))]),a.label=7;case 7:return[2]}}))}))}function Dn(e){void 0===e&&(e=32);for(var t="";t.length<e;)t+=Math.random().toString(32).substring(2);return t.substring(0,e)}function Vn(e){var t=Object(a.a)({randomStr:Dn()},e);return btoa(JSON.stringify(t))}function Bn(e){return e.startsWith("//")?"https:"+e:e}function Un(e){if(e.values.auth)for(var t=0,r=Object.keys(e.values.auth);t<r.length;t++){var n=r[t],o=e.values.auth[n];Object(f.m)(n,o)}!function(e){for(var t=0,r=["path","query","header","cookie"];t<r.length;t++){var n,o=r[t];if(null!==(n=e.values)&&void 0!==n&&n[o])for(var i=0,a=Object.keys(e.values[o]);i<a.length;i++){var s=a[i];Object(f.l)(o,s,e.values[o][s])}}}(e)}var zn=function(e,t){return e.filter((function(e){return e.in===t})).reduce((function(e,t){var r=t.in,n=t.name;return e[n]=Object(f.h)(r,n),e}),{})};function Wn(e){if(!e)return"Token is required"}var Hn,qn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{error:"",loading:!1,tokenMasked:!0}}),Object.defineProperty(t,"clearToken",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.props.formApi.setValue("auth."+t.props.id+".token",""),Object(f.p)("auth."+t.props.id+".token","")}}),Object.defineProperty(t,"toggleTokenMask",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.setState({tokenMasked:!t.state.tokenMasked})}}),Object.defineProperty(t,"requestToken",{enumerable:!0,configurable:!0,writable:!0,value:function(){return Object(a.b)(t,void 0,void 0,(function(){var e,t,r,n,o,i,s,l=this;return Object(a.e)(this,(function(a){switch(a.label){case 0:return this.state.loading?[2]:(e=this.props,t=e.server,r=e.flow,n=e.authCorsProxyUrl,o=n&&r.tokenUrl?n+Bn(r.tokenUrl):r.tokenUrl,this.errors.client_id||this.errors.client_secret?(console.log("Provide client_id and client_secret"),[2]):(i=this.values.client_id,s=this.values.client_secret,i&&s?(this.setState({loading:!0}),[4,Nn.authorizeClientCredentials({tokenUrl:o.startsWith("http")?o:t+o,clientId:i,clientSecret:s,scopes:this.values.scopes,successCallback:function(e){l.props.formApi.setValue("auth."+l.props.id+".token",e),l.setState({loading:!1})},errorCallback:function(e){l.clearToken(),l.setState({error:e.message,loading:!1})}})]):(console.log("Provide client_id and client_secret"),[2])));case 1:return a.sent(),[2]}}))}))}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"values",{get:function(){return this.props.form.values&&this.props.form.values.auth&&this.props.form.values.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.props.form.errors&&this.props.form.errors.auth&&this.props.form.errors.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.loading,r=e.error,n=e.tokenMasked,o=this.props.id,i=Object.keys(this.props.flow.scopes),l=Object(f.e)("auth."+o+".token");l=l?JSON.parse(l):"";var c=Object(f.j)(o,"client_id"),u={field:"auth."+o+".client_id",fullWidth:!0,initialValue:Object(f.e)("auth."+o+".client_id")||this.props.clientId,initValue:Object(f.e)("auth."+o+".client_id")||this.props.clientId,placeholder:"Your OAuth2 app Client ID"};return s.createElement(s.Fragment,null,s.createElement(v.f,null,s.createElement(v.a,null,s.createElement(v.d,null,"Client ID:"),c?s.createElement(T,Object(a.a)({},u,{options:c})):s.createElement(k,Object(a.a)({},u,{type:"password"}))),s.createElement(v.a,null,s.createElement(v.d,null,"Client Secret:"),s.createElement(k,{type:"password",fullWidth:!0,field:"auth."+o+".client_secret",initialValue:Object(f.e)("auth."+o+".client_secret")})),s.createElement(k,{fullWidth:!0,field:"auth."+o+".token",type:"hidden",initialValue:l,validate:Wn}),s.createElement(Fn,{id:o,scopes:i})),s.createElement($.a,{color:"primary",onClick:this.requestToken,blinking:t},t?"Loading...":"Request Token"),s.createElement(v.c,null," Access Token "),r?s.createElement(v.b,{style:{marginBottom:"1em"}},"Failed to request token: ",s.createElement("pre",null,r)," "):this.values.token&&this.values.token.access_token?s.createElement(v.j,null,s.createElement(v.l,{length:this.values.token.access_token.length,masked:n},this.values.token.access_token),s.createElement(v.k,{onClick:this.toggleTokenMask},n?"Show":"Hide"," "),s.createElement(v.i,{onClick:this.clearToken}," Clear ")):s.createElement(v.b,{style:{marginBottom:"1em"}},"No token"))}}),t}(s.Component),Gn=h.mb.div(Hn||(Hn=Object(a.f)(["\n position: relative;\n height: 4px;\n display: block;\n width: 100%;\n background-color: ",";\n border-radius: ",";\n background-clip: padding-box;\n margin: 0.5rem 0 1rem 0;\n overflow: hidden;\n\n .determinate {\n position: absolute;\n background-color: inherit;\n top: 0;\n bottom: 0;\n background-color: ",";\n transition: width 0.3s linear;\n }\n .indeterminate {\n background-color: ",";\n }\n .indeterminate:before {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n .indeterminate:after {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n -webkit-animation-delay: 1.15s;\n animation-delay: 1.15s;\n }\n\n @-webkit-keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @-webkit-keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n @keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n"],["\n position: relative;\n height: 4px;\n display: block;\n width: 100%;\n background-color: ",";\n border-radius: ",";\n background-clip: padding-box;\n margin: 0.5rem 0 1rem 0;\n overflow: hidden;\n\n .determinate {\n position: absolute;\n background-color: inherit;\n top: 0;\n bottom: 0;\n background-color: ",";\n transition: width 0.3s linear;\n }\n .indeterminate {\n background-color: ",";\n }\n .indeterminate:before {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n .indeterminate:after {\n content: '';\n position: absolute;\n background-color: inherit;\n top: 0;\n left: 0;\n bottom: 0;\n will-change: left, right;\n -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n -webkit-animation-delay: 1.15s;\n animation-delay: 1.15s;\n }\n\n @-webkit-keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @keyframes indeterminate {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n @-webkit-keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n @keyframes indeterminate-short {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n"])),(function(e){return e.theme.colors.accent.light}),(function(e){return e.theme.shape.borderRadius}),(function(e){return e.theme.colors.accent.main}),(function(e){return e.theme.colors.accent.main})),$n=function(){return s.createElement(Gn,null,s.createElement("div",{className:"indeterminate"}))};function Kn(e){if(!e)return"Field is required"}var Jn,Yn,Xn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{error:null,loading:!1}}),Object.defineProperty(t,"clearToken",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.props.formApi.setValue("auth."+t.props.id+".token","")}}),t}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"values",{get:function(){return this.props.form.values&&this.props.form.values.auth&&this.props.form.values.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.props.form.errors&&this.props.form.errors.auth&&this.props.form.errors.auth[this.props.id]||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"handleAuthorize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(e){this.props.formApi.validate();var r=this.props,n=r.flow,o=r.id,i=r.tokenUrl,s=r.authCorsProxyUrl;if(this.values.client_id&&("authorizationCode"!==n||this.values.client_secret)){this.setState({loading:!0,error:null});var l=s?s+Bn(e):e,c=s&&i?s+Bn(i):i,u=this.props.formApi.getValue("auth."+o+".scopes"),f={authorizationUrl:l.startsWith("http")?l:this.props.server+l,clientId:this.values.client_id,scopes:u,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:function(e){t.props.formApi.setValue("auth."+t.props.id+".token",e),t.setState({loading:!1,error:null})},errorCallback:function(e){t.setState({loading:!1,error:(null==e?void 0:e.message)||"Failed to retrieve the access token"})}};"implicit"===n&&Nn.authorizeImplicit(f),"authorizationCode"===n&&Nn.authorizeAuthorizationCode(Object(a.a)(Object(a.a)({},f),{tokenUrl:null!=c&&c.startsWith("http")?c:this.props.server+c,clientSecret:this.values.client_secret}))}}}}),Object.defineProperty(t.prototype,"handleLogout",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.clearToken(),this.setState({error:null})}}),Object.defineProperty(t.prototype,"handleCancel",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setState({loading:!1,error:null}),Nn.clearRedirectData(this.props.flow)}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,r=this,n=this.state,o=n.error,i=n.loading,l=this.props,c=l.id,u=l.scopes,p=l.authorizationUrl,d=l.flow;if(!p)return s.createElement(v.b,null,"No flow info");var h=Object(f.e)("auth."+c+".token");h=h?JSON.parse(h):"";var m=Object(f.j)(c,"client_id"),g={field:"auth."+c+".client_id",fullWidth:!0,initialValue:Object(f.e)("auth."+c+".client_id")||this.props.clientId,initValue:Object(f.e)("auth."+c+".client_id")||this.props.clientId,placeholder:"Your OAuth2 app Client ID",validate:Kn,validateOnBlur:!0,validateOnChange:!0};return s.createElement("div",null,s.createElement(v.f,null,s.createElement(v.a,null,s.createElement(v.d,null," Client ID: "),m?s.createElement(T,Object(a.a)({},g,{options:m})):s.createElement(k,Object(a.a)({},g))),"authorizationCode"===d&&s.createElement(v.a,null,s.createElement(v.d,null,"Client Secret:"),s.createElement(k,{type:"password",fullWidth:!0,field:"auth."+c+".client_secret",initialValue:Object(f.e)("auth."+c+".client_secret"),validate:Kn,validateOnBlur:!0,validateOnChange:!0})),s.createElement(k,{fullWidth:!0,field:"auth."+c+".token",type:"hidden",initialValue:h,validate:Kn}),s.createElement(Fn,{id:c,scopes:u}),this.values.token&&this.values.token.access_token?s.createElement(v.a,null,s.createElement(v.d,null," Access Token: "),s.createElement(C,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),s.createElement(Zn,null,this.values.token&&this.values.token.access_token?s.createElement($.a,{fullWidth:!0,onClick:function(){r.handleLogout()}},"Log out"):s.createElement(s.Fragment,null,i?s.createElement(s.Fragment,null,s.createElement($.a,{fullWidth:!0,onClick:function(){r.handleCancel()}},"Cancel"),s.createElement($n,null)):s.createElement($.a,{fullWidth:!0,disabled:(null===(e=this.props)||void 0===e||null===(t=e.formApi)||void 0===t?void 0:t.getTouched("auth."+c+".client_id"))&&!this.values.client_id,onClick:function(){r.handleAuthorize(p)}},"Authorize"))),i||o||!this.values.token||!this.values.token.access_token&&s.createElement(v.f,null,s.createElement(v.a,null,i?s.createElement(v.e,null,"Please, finish your authorization flow or cancel authorization."):o?s.createElement(s.Fragment,null,s.createElement(Qn,null,s.createElement(v.b,null,o))):this.values.token&&this.values.token.access_token?null:s.createElement(v.e,null," No Access Token. Please, Authorize. "))))}}),Object.defineProperty(t,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:h.y}),t}(s.Component),Qn=h.mb.div(Jn||(Jn=Object(a.f)(["\n font-family: monospace;\n margin-top: 10px;\n line-height: 1;\n padding-left: 10px;\n border-left: 1px solid gray;\n"],["\n font-family: monospace;\n margin-top: 10px;\n line-height: 1;\n padding-left: 10px;\n border-left: 1px solid gray;\n"]))),Zn=h.mb.div(Yn||(Yn=Object(a.f)(["\n margin-bottom: 15px;\n"],["\n margin-bottom: 15px;\n"])));function eo(e){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.e)(this,(function(t){switch(t.label){case 0:return[4,fetch(e)];case 1:return[2,t.sent().json()]}}))}))}function to(e){var t,r=this,n=e.scheme,o=s.useState({}),i=o[0],l=o[1],c=s.useState(),u=c[0],f=c[1],p=s.useState(!1),d=p[0],h=p[1];s.useEffect((function(){m(n.openIdConnectUrl)}),[n.openIdConnectUrl]);var m=function(e){return Object(a.b)(r,void 0,void 0,(function(){var t,r;return Object(a.e)(this,(function(n){switch(n.label){case 0:h(!0),f(""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,eo(e)];case 2:return t=n.sent(),l(t),[3,4];case 3:return r=n.sent(),f(r.message),[3,4];case 4:return h(!1),[2]}}))}))};return s.createElement("div",null,d?s.createElement("div",null,s.createElement("div",null,"Fetching OpenID Connect metadata..."),s.createElement($n,null)):s.createElement("div",null,u?s.createElement(v.b,null,u):null!=i&&null!==(t=i.response_types_supported)&&void 0!==t&&t.includes("token")?s.createElement(s.Fragment,null,s.createElement(no,null,"OAuth2 Implicit Flow"),s.createElement(Xn,{key:e.id,authorizationUrl:i.authorization_endpoint,authCorsProxyUrl:e.authCorsProxyUrl,scopes:i.scopes_supported,server:e.server,id:e.id,form:e.form,formApi:e.formApi,clientId:e.clientId,flow:"implicit"})):s.createElement("div",null,"Unsupported flow")))}var ro,no=h.mb.div(ro||(ro=Object(a.f)(["\n margin-top: 5px;\n margin-bottom: 10px;\n"],["\n margin-top: 5px;\n margin-bottom: 10px;\n"]))),oo=r(12);function io(e){if(!e)return"Field is required"}function ao(e){var t,r;if("cookie"===e.in)return t=e.name,(r=document.cookie.match("\\b"+t+"=([^;]*)\\b"))?r[1]:void 0}var so=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"state",{enumerable:!0,configurable:!0,writable:!0,value:{activeScheme:0}}),Object.defineProperty(t,"handleSchemeChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){t.setState({activeScheme:e.idx}),Object(f.p)("securityRequirementName",e.value)}}),t}return Object(a.d)(t,e),Object.defineProperty(t,"getDerivedStateFromProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.operation.security.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})),r=Object(f.e)("securityRequirementName"),n=t.findIndex((function(e){return e===r}));return{activeScheme:n<0?0:n}}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=this.state.activeScheme,r=this.props.operation.security,n=r.map((function(e){return e.schemes.map((function(e){return e.id})).join(" and ")})).map((function(e,t){return{value:e,idx:t}}));return 0===n.length?null:s.createElement(s.Fragment,null,s.createElement(v.f,null,n.length>1&&s.createElement(v.a,null,s.createElement(h.f,{variant:"dark",fullWidth:!0,prefix:"Security scheme: ",options:n,value:n[t].value,onChange:this.handleSchemeChange}))||null,r[t].schemes.map((function(t){var r=Object(f.c)(t.id);if("apiKey"===t.type){var n=Object(f.j)(r,""),o={field:"auth."+r,fullWidth:!0,initialValue:ao(t)||Object(f.e)("auth."+r),initValue:ao(t)||Object(f.e)("auth."+r),validate:io,validateOnBlur:!0,validateOnChange:!0};return s.createElement(v.a,{key:r},s.createElement(v.d,null," ",t.name,": "),n?s.createElement(T,Object(a.a)({},o,{options:n})):s.createElement(k,Object(a.a)({},o,{type:"password","data-cy":"apiKey-auth-password"})))}if("http"===t.type){if("basic"===t.scheme){var i=Object(f.j)(r,"username");o={field:"auth."+r+".username",fullWidth:!0,initialValue:Object(f.e)("auth."+r+".username"),initValue:Object(f.e)("auth."+r+".username"),validate:io,validateOnBlur:!0,validateOnChange:!0};return s.createElement(s.Fragment,{key:r},s.createElement(v.a,null,s.createElement(v.d,null," ",Object(oo.a)("tryItAuthBasicUsername"),": "),i?s.createElement(T,Object(a.a)({},o,{options:i})):s.createElement(k,Object(a.a)({},o))),s.createElement(v.a,null,s.createElement(v.d,null," ",Object(oo.a)("tryItAuthBasicPassword"),": "),s.createElement(k,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:"auth."+r+".password",validate:io,initialValue:Object(f.e)("auth."+r+".password"),validateOnBlur:!0,validateOnChange:!0})))}if("bearer"===t.scheme){var l=Object(f.j)(r,"");o={field:"auth."+r,fullWidth:!0,initialValue:Object(f.e)("auth."+r),initValue:Object(f.e)("auth."+r),validate:io,validateOnBlur:!0,validateOnChange:!0};return s.createElement(s.Fragment,{key:r},s.createElement(v.a,null,s.createElement(v.d,null," Bearer Token: "),l?s.createElement(T,Object(a.a)({},o,{options:l})):s.createElement(k,Object(a.a)({},o,{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if("oauth2"===t.type&&t.flows&&t.flows.clientCredentials)return s.createElement(qn,{key:r,flow:t.flows.clientCredentials,server:e.props.activeServer,authCorsProxyUrl:e.props.authCorsProxyUrl,id:r,form:e.props.form,formApi:e.props.formApi,clientId:t.flows.clientCredentials["x-defaultClientId"]||t["x-defaultClientId"]});var c,u,p;if("oauth2"===t.type&&t.flows&&t.flows.implicit)return s.createElement(Xn,{key:r,authorizationUrl:t.flows.implicit.authorizationUrl,authCorsProxyUrl:e.props.authCorsProxyUrl,scopes:Object.keys((null==t||null===(c=t.flows)||void 0===c||null===(u=c.implicit)||void 0===u?void 0:u.scopes)||{}),server:e.props.activeServer,id:r,form:e.props.form,formApi:e.props.formApi,clientId:t.flows.implicit["x-defaultClientId"]||t["x-defaultClientId"],flow:"implicit"});if("oauth2"===t.type&&t.flows&&t.flows.authorizationCode)return s.createElement(Xn,{key:r,authorizationUrl:t.flows.authorizationCode.authorizationUrl,tokenUrl:t.flows.authorizationCode.tokenUrl,authCorsProxyUrl:e.props.authCorsProxyUrl,scopes:Object.keys((null===(p=t.flows.authorizationCode)||void 0===p?void 0:p.scopes)||{}),server:e.props.activeServer,id:r,form:e.props.form,formApi:e.props.formApi,clientId:t.flows.authorizationCode["x-defaultClientId"]||t["x-defaultClientId"],flow:"authorizationCode"});if("oauth2"===t.type){var d=Object(f.e)("auth."+r+".token");return d=d?JSON.parse(d):{},s.createElement(s.Fragment,{key:r},s.createElement(v.a,null,s.createElement(v.d,null," Access Token Type: "),s.createElement(k,{fullWidth:!0,field:"auth."+r+".token.token_type",initialValue:d.token_type||"Bearer"})),s.createElement(v.a,null,s.createElement(v.d,null," Access Token: "),s.createElement(k,{type:"password",fullWidth:!0,field:"auth."+r+".token.access_token",validate:io,initialValue:d.access_token,validateOnBlur:!0,validateOnChange:!0})))}if("openIdConnect"===t.type)return s.createElement(to,{key:r,server:e.props.activeServer,authCorsProxyUrl:e.props.authCorsProxyUrl,id:r,form:e.props.form,formApi:e.props.formApi,scheme:t,clientId:t["x-defaultClientId"]})}}))),s.createElement("small",null,s.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}),t}(s.Component),lo=r(89),co=r(579),uo=r.n(co),fo=r(670),po=r.n(fo),ho=r(735),vo=r.n(ho),mo=r(34),go=r.n(mo),yo=r(676),bo=r.n(yo),xo=r(588),wo=r.n(xo),Co=r(623),ko=r.n(Co),Ao=r(682),Oo=r.n(Ao),So=r(646),Eo=r.n(So),jo=r(686),To=r.n(jo),Mo=r(920),Po=r.n(Mo),Lo=r(924),Io=r.n(Lo),Fo=r(687),_o=r.n(Fo),No=r(597),Ro=r.n(No),Do=r(586),Vo=r.n(Do),Bo=r(576),Uo=r.n(Bo),zo=r(757),Wo=r.n(zo),Ho=r(598),qo=r.n(Ho),Go=(r(942),r(943)),$o=r.n(Go),Ko=r(185),Jo=r.n(Ko),Yo=r(691),Xo=r.n(Yo),Qo=r(637),Zo=r.n(Qo),ei=r(67),ti=r(697),ri=r.n(ti),ni=r(698),oi=r.n(ni),ii=r(984),ai=r.n(ii),si=r(699),li=r.n(si),ci=r(997),ui=r.n(ci),fi=r(1003),pi=r.n(fi),di=r(1011),hi=r.n(di),vi=r(1016),mi=function(e){var t=function(e,t){return{name:e,value:t}};return Zo()(e.prototype.set)||Zo()(e.prototype.get)||Zo()(e.prototype.getAll)||Zo()(e.prototype.has)?e:function(e){ui()(n,e);var r=pi()(n);function n(e){var t;return ri()(this,n),(t=r.call(this,e)).entryList=[],t}return oi()(n,[{key:"append",value:function(e,r,o){return this.entryList.push(t(e,r)),ai()(li()(n.prototype),"append",this).call(this,e,r,o)}},{key:"set",value:function(e,r){var n,o=t(e,r);this.entryList=qo()(n=this.entryList).call(n,(function(t){return t.name!==e})),this.entryList.push(o)}},{key:"get",value:function(e){var t,r=hi()(t=this.entryList).call(t,(function(t){return t.name===e}));return void 0===r?null:r}},{key:"getAll",value:function(e){var t,r;return Ro()(t=qo()(r=this.entryList).call(r,(function(t){return t.name===e}))).call(t,(function(e){return e.value}))}},{key:"has",value:function(e){return this.entryList.some((function(t){return t.name===e}))}}]),n}(e)}(r.n(vi).a),gi=r(652),yi=r.n(gi),bi=r(599),xi=r.n(bi),wi=r(67).Buffer,Ci=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},ki=function(e){return/^[a-z0-9\-._~]+$/i.test(e)};function Ai(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.escape,o=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&n?o?JSON.parse(e):Ro()(t=yi()(e)).call(t,(function(e){var t,r;return ki(e)||Ci(e)&&"unsafe"===n?e:Ro()(t=Ro()(r=wi.from(e).toJSON().data||[]).call(r,(function(e){var t;return xi()(t="0".concat(e.toString(16).toUpperCase())).call(t,-2)}))).call(t,(function(e){return"%".concat(e)})).join("")})).join(""):e}function Oi(e){var t=e.value;return Array.isArray(t)?function(e){var t=e.key,r=e.value,n=e.style,o=e.explode,i=e.escape,a=function(e){return Ai(e,{escape:i})};if("simple"===n)return Ro()(r).call(r,(function(e){return a(e)})).join(",");if("label"===n)return".".concat(Ro()(r).call(r,(function(e){return a(e)})).join("."));if("matrix"===n)return Ro()(r).call(r,(function(e){return a(e)})).reduce((function(e,r){var n,i,a;return!e||o?Uo()(i=Uo()(a="".concat(e||"",";")).call(a,t,"=")).call(i,r):Uo()(n="".concat(e,",")).call(n,r)}),"");if("form"===n){var s=o?"&".concat(t,"="):",";return Ro()(r).call(r,(function(e){return a(e)})).join(s)}if("spaceDelimited"===n){var l=o?"".concat(t,"="):"";return Ro()(r).call(r,(function(e){return a(e)})).join(" ".concat(l))}if("pipeDelimited"===n){var c=o?"".concat(t,"="):"";return Ro()(r).call(r,(function(e){return a(e)})).join("|".concat(c))}return}(e):"object"===wo()(t)?function(e){var t=e.key,r=e.value,n=e.style,o=e.explode,i=e.escape,a=function(e){return Ai(e,{escape:i})},s=Vo()(r);if("simple"===n)return s.reduce((function(e,t){var n,i,s,l=a(r[t]),c=o?"=":",",u=e?"".concat(e,","):"";return Uo()(n=Uo()(i=Uo()(s="".concat(u)).call(s,t)).call(i,c)).call(n,l)}),"");if("label"===n)return s.reduce((function(e,t){var n,i,s,l=a(r[t]),c=o?"=":".",u=e?"".concat(e,"."):".";return Uo()(n=Uo()(i=Uo()(s="".concat(u)).call(s,t)).call(i,c)).call(n,l)}),"");if("matrix"===n&&o)return s.reduce((function(e,t){var n,o,i=a(r[t]),s=e?"".concat(e,";"):";";return Uo()(n=Uo()(o="".concat(s)).call(o,t,"=")).call(n,i)}),"");if("matrix"===n)return s.reduce((function(e,n){var o,i,s=a(r[n]),l=e?"".concat(e,","):";".concat(t,"=");return Uo()(o=Uo()(i="".concat(l)).call(i,n,",")).call(o,s)}),"");if("form"===n)return s.reduce((function(e,t){var n,i,s,l,c=a(r[t]),u=e?Uo()(n="".concat(e)).call(n,o?"&":","):"",f=o?"=":",";return Uo()(i=Uo()(s=Uo()(l="".concat(u)).call(l,t)).call(s,f)).call(i,c)}),"");return}(e):function(e){var t,r=e.key,n=e.value,o=e.style,i=e.escape,a=function(e){return Ai(e,{escape:i})};if("simple"===o)return a(n);if("label"===o)return".".concat(a(n));if("matrix"===o)return Uo()(t=";".concat(r,"=")).call(t,a(n));if("form"===o)return a(n);if("deepObject"===o)return a(n);return}(e)}var Si={serializeRes:Pi,mergeInQueryOrForm:zi};function Ei(e){return ji.apply(this,arguments)}function ji(){return(ji=Oo()(Eo.a.mark((function e(t){var r,n,o,i,a,s=arguments;return Eo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.length>1&&void 0!==s[1]?s[1]:{},"object"===wo()(t)&&(t=(r=t).url),r.headers=r.headers||{},Si.mergeInQueryOrForm(r),r.headers&&Vo()(r.headers).forEach((function(e){var t=r.headers[e];"string"==typeof t&&(r.headers[e]=t.replace(/\n+/g," "))})),!r.requestInterceptor){e.next=12;break}return e.next=8,r.requestInterceptor(r);case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=r;case 11:r=e.t0;case 12:return n=r.headers["content-type"]||r.headers["Content-Type"],/multipart\/form-data/i.test(n)&&(delete r.headers["content-type"],delete r.headers["Content-Type"]),e.prev=14,e.next=17,(r.userFetch||fetch)(r.url,r);case 17:return o=e.sent,e.next=20,Si.serializeRes(o,t,r);case 20:if(o=e.sent,!r.responseInterceptor){e.next=28;break}return e.next=24,r.responseInterceptor(o);case 24:if(e.t1=e.sent,e.t1){e.next=27;break}e.t1=o;case 27:o=e.t1;case 28:e.next=39;break;case 30:if(e.prev=30,e.t2=e.catch(14),o){e.next=34;break}throw e.t2;case 34:throw(i=new Error(o.statusText)).status=o.status,i.statusCode=o.status,i.responseError=e.t2,i;case 39:if(o.ok){e.next=45;break}throw(a=new Error(o.statusText)).status=o.status,a.statusCode=o.status,a.response=o,a;case 45:return e.abrupt("return",o);case 46:case"end":return e.stop()}}),e,null,[[14,30]])})))).apply(this,arguments)}var Ti=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function Mi(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):Jo.a.safeLoad(e)}function Pi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.loadSpec,o=void 0!==n&&n,i={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:Ii(e.headers)},a=i.headers["content-type"],s=o||Ti(a),l=s?e.text:e.blob||e.buffer;return l.call(e).then((function(e){if(i.text=e,i.data=e,s)try{var t=Mi(e,a);i.body=t,i.obj=t}catch(e){i.parseError=e}return i}))}function Li(e){return To()(e).call(e,", ")?e.split(", "):e}function Ii(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Zo()(Po()(e))?Io()(Po()(e).call(e)).reduce((function(e,t){var r=ko()(t,2),n=r[0],o=r[1];return e[n]=Li(o),e}),{}):{}}function Fi(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==wo()(e)||"string"!=typeof e.uri):"undefined"!=typeof File&&e instanceof File||("undefined"!=typeof Blob&&e instanceof Blob||(void 0!==ei.Buffer&&e instanceof ei.Buffer||null!==e&&"object"===wo()(e)&&"function"==typeof e.pipe))}function _i(e,t){return Array.isArray(e)&&e.some((function(e){return Fi(e,t)}))}var Ni={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Ri={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function Di(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.collectionFormat,o=t.allowEmptyValue,i=t.serializationOption,a=t.encoding,s="object"!==wo()(t)||Array.isArray(t)?t:t.value,l=r?function(e){return e.toString()}:function(e){return encodeURIComponent(e)},c=l(e);if(void 0===s&&o)return[[c,""]];if(Fi(s)||_i(s))return[[c,s]];if(i)return Vi(e,s,r,i);if(a){if([wo()(a.style),wo()(a.explode),wo()(a.allowReserved)].some((function(e){return"undefined"!==e})))return Vi(e,s,r,Xo()(a,["style","explode","allowReserved"]));if(a.contentType){if("application/json"===a.contentType){var u="string"==typeof s?s:_o()(s);return[[c,l(u)]]}return[[c,l(s.toString())]]}return"object"!==wo()(s)?[[c,l(s)]]:Array.isArray(s)&&s.every((function(e){return"object"!==wo()(e)}))?[[c,Ro()(s).call(s,l).join(",")]]:[[c,l(_o()(s))]]}return"object"!==wo()(s)?[[c,l(s)]]:Array.isArray(s)?"multi"===n?[[c,Ro()(s).call(s,l)]]:[[c,Ro()(s).call(s,l).join(Ri[n||"csv"])]]:[[c,""]]}function Vi(e,t,r,n){var o,i,a,s=n.style||"form",l=void 0===n.explode?"form"===s:n.explode,c=!r&&(n&&n.allowReserved?"unsafe":"reserved"),u=function(e){return Ai(e,{escape:c})},f=r?function(e){return e}:function(e){return Ai(e,{escape:c})};return"object"!==wo()(t)?[[f(e),u(t)]]:Array.isArray(t)?l?[[f(e),Ro()(t).call(t,u)]]:[[f(e),Ro()(t).call(t,u).join(Ni[s])]]:"deepObject"===s?Ro()(i=Vo()(t)).call(i,(function(r){var n;return[f(Uo()(n="".concat(e,"[")).call(n,r,"]")),u(t[r])]})):l?Ro()(a=Vo()(t)).call(a,(function(e){return[f(e),u(t[e])]})):[[f(e),Ro()(o=Vo()(t)).call(o,(function(e){var r;return[Uo()(r="".concat(f(e),",")).call(r,u(t[e]))]})).join(",")]]}function Bi(e){return Wo()(e).reduce((function(e,t){var r,n=ko()(t,2),o=n[0],i=n[1],a=bo()(Di(o,i,!0));try{for(a.s();!(r=a.n()).done;){var s=ko()(r.value,2),l=s[0],c=s[1];if(Array.isArray(c)){var u,f=bo()(c);try{for(f.s();!(u=f.n()).done;){var p=u.value;e.append(l,p)}}catch(e){f.e(e)}finally{f.f()}}else e.append(l,c)}}catch(e){a.e(e)}finally{a.f()}return e}),new mi)}function Ui(e){var t=Vo()(e).reduce((function(t,r){var n,o=bo()(Di(r,e[r]));try{for(o.s();!(n=o.n()).done;){var i=ko()(n.value,2),a=i[0],s=i[1];t[a]=s}}catch(e){o.e(e)}finally{o.f()}return t}),{});return $o.a.stringify(t,{encode:!1,indices:!1})||""}function zi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,n=e.query,o=e.form,i=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=qo()(t).call(t,(function(e){return e})).join("&");return n?"?".concat(n):""};if(o){var a=Vo()(o).some((function(e){var t=o[e].value;return Fi(t)||_i(t)})),s=e.headers["content-type"]||e.headers["Content-Type"];a||/multipart\/form-data/i.test(s)?e.body=Bi(e.form):e.body=Ui(o),delete e.form}if(n){var l=r.split("?"),c=ko()(l,2),u=c[0],f=c[1],p="";if(f){var d=$o.a.parse(f),h=Vo()(n);h.forEach((function(e){return delete d[e]})),p=$o.a.stringify(d,{encode:!0})}var v=i(p,Ui(n));e.url=u+v,delete e.query}return e}var Wi=r(626),Hi=r.n(Wi),qi=r(762),Gi=r.n(qi),$i=r(1026),Ki=r.n($i),Ji=r(1031),Yi=r.n(Ji),Xi=r(1062),Qi=r.n(Xi),Zi=r(725),ea=r.n(Zi),ta=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ra=Object.prototype.hasOwnProperty;function na(e,t){return ra.call(e,t)}function oa(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);t=[];for(var n in e)na(e,n)&&t.push(n);return t}function ia(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function aa(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function sa(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function la(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ca(e,t){var r=[e];for(var n in t){var o="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==o&&r.push(n+": "+o)}return r.join("\n")}var ua=function(e){function t(t,r,n,o,i){var a=this.constructor,s=e.call(this,ca(t,{name:r,index:n,operation:o,tree:i}))||this;return s.name=r,s.index=n,s.operation=o,s.tree=i,Object.setPrototypeOf(s,a.prototype),s.message=ca(t,{name:r,index:n,operation:o,tree:i}),s}return ta(t,e),t}(Error),fa=ua,pa=ia,da={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=va(r,this.path);n&&(n=ia(n));var o=ma(r,{op:"remove",path:this.from}).removed;return ma(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=va(r,this.from);return ma(r,{op:"add",path:this.path,value:ia(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:wa(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},ha={add:function(e,t,r){return aa(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:da.move,copy:da.copy,test:da.test,_get:da._get};function va(e,t){if(""==t)return e;var r={op:"_get",path:t};return ma(e,r),r.value}function ma(e,t,r,n,o,i){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===i&&(i=0),r&&("function"==typeof r?r(t,0,e,t.path):ba(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=va(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=wa(e,t.value),!1===a.test)throw new fa("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(r)throw new fa("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}n||(e=ia(e));var s=(t.path||"").split("/"),l=e,c=1,u=s.length,f=void 0,p=void 0,d=void 0;for(d="function"==typeof r?r:ba;;){if(p=s[c],o&&"__proto__"==p)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===f&&(void 0===l[p]?f=s.slice(0,c).join("/"):c==u-1&&(f=t.path),void 0!==f&&d(t,0,e,f)),c++,Array.isArray(l)){if("-"===p)p=l.length;else{if(r&&!aa(p))throw new fa("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);aa(p)&&(p=~~p)}if(c>=u){if(r&&"add"===t.op&&p>l.length)throw new fa("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);if(!1===(a=ha[t.op].call(t,l,p,e)).test)throw new fa("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(p&&-1!=p.indexOf("~")&&(p=la(p)),c>=u){if(!1===(a=da[t.op].call(t,l,p,e)).test)throw new fa("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}l=l[p]}}function ga(e,t,r,n,o){if(void 0===n&&(n=!0),void 0===o&&(o=!0),r&&!Array.isArray(t))throw new fa("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=ia(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=ma(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function ya(e,t,r){var n=ma(e,t);if(!1===n.test)throw new fa("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function ba(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new fa("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!da[e.op])throw new fa("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new fa("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new fa('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new fa("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new fa("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0}else if("object"==typeof t){var o=oa(t),i=o.length;for(r=0;r<i;r++)if(e(t[o[r]]))return!0}return!1}(e.value))throw new fa("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new fa("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new fa("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var a=xa([{op:"_get",path:e.from,value:void 0}],r);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new fa("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function xa(e,t,r){try{if(!Array.isArray(e))throw new fa("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)ga(ia(t),ia(e),r||!0);else{r=r||ba;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof fa)return e;throw e}}function wa(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,o,i=Array.isArray(e),a=Array.isArray(t);if(i&&a){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!wa(e[r],t[r]))return!1;return!0}if(i!=a)return!1;var s=Object.keys(e);if((n=s.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(s[r]))return!1;for(r=n;0!=r--;)if(!wa(e[o=s[r]],t[o]))return!1;return!0}return e!=e&&t!=t}
8
8
  /*!
9
9
  * https://github.com/Starcounter-Jack/JSON-Patch
10
10
  * (c) 2017 Joachim Wester
11
11
  * MIT license
12
12
  */
13
- var ka=new WeakMap,Aa=function(e){this.observers=new Map,this.obj=e},Oa=function(e,t){this.callback=e,this.observer=t};function Sa(e,t){t.unobserve()}function Ea(e,t){var r,n=function(e){return ka.get(e)}(e);if(n){var o=function(e,t){return e.observers.get(t)}(n,t);r=o&&o.observer}else n=new Aa(e),ka.set(e,n);if(r)return r;if(r={},n.value=aa(e),t){r.callback=t,r.next=null;var i=function(){ja(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(i)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=[],r.object=e,r.unobserve=function(){ja(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},n.observers.set(t,new Oa(t,r)),r}function ja(e,t){void 0===t&&(t=!1);var r=ka.get(e.object);Ta(r.value,e.object,e.patches,"",t),e.patches.length&&ya(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Ta(e,t,r,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=ia(t),a=ia(e),s=!1,l=a.length-1;l>=0;l--){var c=e[f=a[l]];if(!oa(t,f)||void 0===t[f]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+la(f),value:aa(c)}),r.push({op:"remove",path:n+"/"+la(f)}),s=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),!0);else{var u=t[f];"object"==typeof c&&null!=c&&"object"==typeof u&&null!=u?Ta(c,u,r,n+"/"+la(f),o):c!==u&&(!0,o&&r.push({op:"test",path:n+"/"+la(f),value:aa(c)}),r.push({op:"replace",path:n+"/"+la(f),value:aa(u)}))}}if(s||i.length!=a.length)for(l=0;l<i.length;l++){var f;oa(e,f=i[l])||void 0===t[f]||r.push({op:"add",path:n+"/"+la(f),value:aa(t[f])})}}}function Ma(e,t,r){void 0===r&&(r=!1);var n=[];return Ta(e,t,n,"",r),n}Object.assign({},n,o,{JsonPatchError:fa,deepClone:aa,escapePathComponent:la,unescapePathComponent:ca});var Pa=r(1063),La=r.n(Pa),Ia=r(1064),Fa=r.n(Ia),_a={add:function(e,t){return{op:"add",path:e,value:t}},replace:Ra,remove:function(e){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce((function(e,t){return void 0!==t&&e?e[t]:e}),e)},applyPatch:function(e,t,r){if(r=r||{},"merge"===(t=fo()(fo()({},t),{},{path:t.path&&Na(t.path)})).op){var n=Ya(e,t.path);qi()(n,t.value),ya(e,[Ra(t.path,n)])}else if("mergeDeep"===t.op){var o=Ya(e,t.path);for(var i in t.value){var a=t.value[i],s=Array.isArray(a);if(s){var l=o[i]||[];o[i]=zo()(l).call(l,a)}else if(Ha(a)&&!s){var c=fo()({},o[i]);for(var u in a){if(Object.prototype.hasOwnProperty.call(c,u)){c=La()(Fa()(c),a);break}qi()(c,ta()({},u,a[u]))}o[i]=c}else o[i]=a}}else if("add"===t.op&&""===t.path&&Ha(t.value)){var f=Bo()(t.value).reduce((function(e,r){return e.push({op:"add",path:"/".concat(Na(r)),value:t.value[r]}),e}),[]);ya(e,f)}else if("replace"===t.op&&""===t.path){var p=t.value;r.allowMetaPatches&&t.meta&&Ka(t)&&(Array.isArray(t.value)||Ha(t.value))&&(p=fo()(fo()({},p),t.meta)),e=p}else if(ya(e,[t]),r.allowMetaPatches&&t.meta&&Ka(t)&&(Array.isArray(t.value)||Ha(t.value))){var d=Ya(e,t.path),h=fo()(fo()({},d),t.meta);ya(e,[Ra(t.path,h)])}return e},parentPathMatch:function(e,t){if(!Array.isArray(t))return!1;for(var r=0,n=t.length;r<n;r+=1)if(t[r]!==e[r])return!1;return!0},flatten:za,fullyNormalizeArray:function(e){return Wa(za(Ua(e)))},normalizeArray:Ua,isPromise:function(e){return Ha(e)&&qa(e.then)},forEachNew:function(e,t){try{return Da(e,Ba,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return Da(e,Va,t)}catch(e){return e}},isJsonPatch:Ga,isContextPatch:function(e){return Ja(e)&&"context"===e.type},isPatch:Ja,isMutation:$a,isAdditiveMutation:Ka,isGenerator:function(e){return"[object GeneratorFunction]"===Object.prototype.toString.call(e)},isFunction:qa,isObject:Ha,isError:function(e){return e instanceof Error}};function Na(e){return Array.isArray(e)?e.length<1?"":"/".concat(Do()(e).call(e,(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")})).join("/")):e}function Ra(e,t,r){return{op:"replace",path:e,value:t,meta:r}}function Da(e,t,r){var n;return Wa(za(Do()(n=Go()(e).call(e,Ka)).call(n,(function(e){return t(e.value,r,e.path)}))||[]))}function Va(e,t,r){return r=r||[],Array.isArray(e)?Do()(e).call(e,(function(e,n){return Va(e,t,zo()(r).call(r,n))})):Ha(e)?Do()(n=Bo()(e)).call(n,(function(n){return Va(e[n],t,zo()(r).call(r,n))})):t(e,r[r.length-1],r);var n}function Ba(e,t,r){var n=[];if((r=r||[]).length>0){var o=t(e,r[r.length-1],r);o&&(n=zo()(n).call(n,o))}if(Array.isArray(e)){var i=Do()(e).call(e,(function(e,n){return Ba(e,t,zo()(r).call(r,n))}));i&&(n=zo()(n).call(n,i))}else if(Ha(e)){var a,s=Do()(a=Bo()(e)).call(a,(function(n){return Ba(e[n],t,zo()(r).call(r,n))}));s&&(n=zo()(n).call(n,s))}return n=za(n)}function Ua(e){return Array.isArray(e)?e:[e]}function za(e){var t;return zo()(t=[]).apply(t,bi()(Do()(e).call(e,(function(e){return Array.isArray(e)?za(e):e}))))}function Wa(e){return Go()(e).call(e,(function(e){return void 0!==e}))}function Ha(e){return e&&"object"===Co()(e)}function qa(e){return e&&"function"==typeof e}function Ga(e){if(Ja(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function $a(e){return Ga(e)||Ja(e)&&"mutation"===e.type}function Ka(e){return $a(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ja(e){return e&&"object"===Co()(e)}function Ya(e,t){try{return ma(e,t)}catch(e){return console.error(e),{}}}var Xa=r(1088),Qa=r.n(Xa),Za=r(773),es=r(1095),ts=r.n(es);function rs(e,t){function r(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.message=r[0],t&&t.apply(this,r)}return r.prototype=new Error,r.prototype.name=e,r.prototype.constructor=r,r}var ns=r(1096),os=r.n(ns),is=r(1097),as=r.n(is),ss=["properties"],ls=["properties"],cs=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],us=["schema/example","items/example"];function fs(e){var t=e[e.length-1],r=e[e.length-2],n=e.join("/");return ss.indexOf(t)>-1&&-1===ls.indexOf(r)||cs.indexOf(n)>-1||us.some((function(e){return n.indexOf(e)>-1}))}function ps(e,t){var r,n=e.split("#"),o=Ao()(n,2),i=o[0],a=o[1],s=yo.a.resolve(i||"",t||"");return a?zo()(r="".concat(s,"#")).call(r,a):s}var ds=new RegExp("^([a-z]+://|//)","i"),hs=rs("JSONRefError",(function(e,t,r){this.originalError=r,qi()(this,t||{})})),vs={},ms=new Qa.a,gs=[function(e){return"paths"===e[0]&&"responses"===e[3]&&"examples"===e[5]},function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7]},function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"examples"===e[7]&&"value"===e[9]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"examples"===e[6]&&"value"===e[8]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"example"===e[4]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"example"===e[5]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"examples"===e[4]&&"value"===e[6]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"examples"===e[5]&&"value"===e[7]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"content"===e[4]&&"example"===e[6]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"content"===e[4]&&"examples"===e[6]&&"value"===e[8]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"content"===e[4]&&"example"===e[7]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"content"===e[5]&&"examples"===e[7]&&"value"===e[9]}],ys={key:"$ref",plugin:function(e,t,r,n){var o=n.getInstance(),i=wi()(r).call(r,0,-1);if(!fs(i)&&(a=i,!gs.some((function(e){return e(a)})))){var a,s=n.getContext(r).baseDoc;if("string"!=typeof e)return new hs("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:s,fullPath:r});var l,c,u,f=ks(e),p=f[0],d=f[1]||"";try{l=s||p?ws(p,s):null}catch(t){return Cs(t,{pointer:d,$ref:e,basePath:l,fullPath:r})}if(function(e,t,r,n){var o,i,a=ms.get(n);a||(a={},ms.set(n,a));var s=function(e){if(0===e.length)return"";return"/".concat(Do()(e).call(e,Ts).join("/"))}(r),l=zo()(o="".concat(t||"<specmap-base>","#")).call(o,e),c=s.replace(/allOf\/\d+\/?/g,""),u=n.contextTree.get([]).baseDoc;if(t==u&&Ms(c,e))return!0;var f="";if(r.some((function(e){var t;return f=zo()(t="".concat(f,"/")).call(t,Ts(e)),a[f]&&a[f].some((function(e){return Ms(e,l)||Ms(l,e)}))})))return!0;return void(a[c]=zo()(i=a[c]||[]).call(i,l))}(d,l,i,n)&&!o.useCircularStructures){var h=ps(e,l);return e===h?null:_a.replace(r,h)}if(null==l?(u=Es(d),void 0===(c=n.get(u))&&(c=new hs("Could not resolve reference: ".concat(e),{pointer:d,$ref:e,baseDoc:s,fullPath:r}))):c=null!=(c=As(l,d)).__value?c.__value:c.catch((function(t){throw Cs(t,{pointer:d,$ref:e,baseDoc:s,fullPath:r})})),c instanceof Error)return[_a.remove(r),c];var v=ps(e,l),m=_a.replace(i,c,{$$ref:v});if(l&&l!==s)return[m,_a.context(i,{baseDoc:l})];try{if(!function(e,t){var r=[e];return t.path.reduce((function(e,t){return r.push(e[t]),e[t]}),e),function e(t){return _a.isObject(t)&&(r.indexOf(t)>=0||Bo()(t).some((function(r){return e(t[r])})))}(t.value)}(n.state,m)||o.useCircularStructures)return m}catch(e){return null}}}},bs=qi()(ys,{docCache:vs,absoluteify:ws,clearCache:function(e){void 0!==e?delete vs[e]:Bo()(vs).forEach((function(e){delete vs[e]}))},JSONRefError:hs,wrapError:Cs,getDoc:Os,split:ks,extractFromDoc:As,fetchJSON:function(e){return Object(Za.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then((function(e){return e.text()})).then((function(e){return Yo.a.safeLoad(e)}))},extract:Ss,jsonPointerToArray:Es,unescapeJsonPointerToken:js}),xs=bs;function ws(e,t){if(!ds.test(e)){var r;if(!t)throw new hs(zo()(r="Tried to resolve a relative URL, without having a basePath. path: '".concat(e,"' basePath: '")).call(r,t,"'"));return yo.a.resolve(t,e)}return e}function Cs(e,t){var r,n;e&&e.response&&e.response.body?r=zo()(n="".concat(e.response.body.code," ")).call(n,e.response.body.message):r=e.message;return new hs("Could not resolve reference: ".concat(r),t,e)}function ks(e){return(e+"").split("#")}function As(e,t){var r=vs[e];if(r&&!_a.isPromise(r))try{var n=Ss(t,r);return qi()($i.a.resolve(n),{__value:n})}catch(e){return $i.a.reject(e)}return Os(e).then((function(e){return Ss(t,e)}))}function Os(e){var t=vs[e];return t?_a.isPromise(t)?t:$i.a.resolve(t):(vs[e]=bs.fetchJSON(e).then((function(t){return vs[e]=t,t})),vs[e])}function Ss(e,t){var r=Es(e);if(r.length<1)return t;var n=_a.getIn(t,r);if(void 0===n)throw new hs("Could not resolve pointer: ".concat(e," does not exist in document"),{pointer:e});return n}function Es(e){var t;if("string"!=typeof e)throw new TypeError("Expected a string, got a ".concat(Co()(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:Do()(t=e.split("/")).call(t,js)}function js(e){return"string"!=typeof e?e:ts.a.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function Ts(e){return ts.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}function Ms(e,t){if(!(r=t)||"/"===r||"#"===r)return!0;var r,n=e.charAt(t.length),o=wi()(t).call(t,-1);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)&&"#"!==o}var Ps=r(1098),Ls=r.n(Ps),Is={key:"allOf",plugin:function(e,t,r,n,o){if(!o.meta||!o.meta.$$ref){var i=wi()(r).call(r,0,-1);if(!fs(i)){if(!Array.isArray(e)){var a=new TypeError("allOf must be an array");return a.fullPath=r,a}var s=!1,l=o.value;if(i.forEach((function(e){l&&(l=l[e])})),l=fo()({},l),!Ls()(l)){delete l.allOf;var c,u=[];if(u.push(n.replace(i,{})),e.forEach((function(e,t){if(!n.isObject(e)){if(s)return null;s=!0;var o=new TypeError("Elements in allOf must be objects");return o.fullPath=r,u.push(o)}u.push(n.mergeDeep(i,e));var a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.specmap,o=r.getBaseUrlForNodePath,i=void 0===o?function(e){var r;return n.getContext(zo()(r=[]).call(r,bi()(t),bi()(e))).baseDoc}:o,a=r.targetKeys,s=void 0===a?["$ref","$$ref"]:a,l=[];return os()(e).forEach((function(){if(Mo()(s).call(s,this.key)&&as()(this.node)){var e=this.path,r=zo()(t).call(t,this.path),o=ps(this.node,i(e));l.push(n.replace(r,o))}})),l}(e,wi()(r).call(r,0,-1),{getBaseUrlForNodePath:function(e){var o;return n.getContext(zo()(o=[]).call(o,bi()(r),[t],bi()(e))).baseDoc},specmap:n});u.push.apply(u,bi()(a))})),u.push(n.mergeDeep(i,l)),!l.$$ref)u.push(n.remove(zo()(c=[]).call(c,i,"$$ref")));return u}}}}},Fs={key:"parameters",plugin:function(e,t,r,n){if(Array.isArray(e)&&e.length){var o=qi()([],e),i=wi()(r).call(r,0,-1),a=fo()({},_a.getIn(n.spec,i));return e.forEach((function(e,t){try{o[t].default=n.parameterMacro(a,e)}catch(e){var i=new Error(e);return i.fullPath=r,i}})),_a.replace(r,o)}return _a.replace(r,e)}},_s={key:"properties",plugin:function(e,t,r,n){var o=fo()({},e);for(var i in e)try{o[i].default=n.modelPropertyMacro(o[i])}catch(e){var a=new Error(e);return a.fullPath=r,a}return _a.replace(r,o)}},Ns=function(){function e(t){ni()(this,e),this.root=Rs(t||{})}return ii()(e,[{key:"set",value:function(e,t){var r=this.getParent(e,!0);if(r){var n=e[e.length-1],o=r.children;o[n]?Ds(o[n],t,r):o[n]=Rs(t,r)}else Ds(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t,r,n=this.root,o=0;o<e.length&&(r=e[o],(t=n.children)[r]);o+=1)n=t[r];return n&&n.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:wi()(e).call(e,0,-1).reduce((function(e,r){if(!e)return e;var n=e.children;return!n[r]&&t&&(n[r]=Rs(null,e)),n[r]}),this.root)}}]),e}();function Rs(e,t){return Ds({children:{}},e,t)}function Ds(e,t,r){return e.value=t||{},e.protoValue=r?fo()(fo()({},r.protoValue),e.value):e.value,Bo()(e.children).forEach((function(t){var r=e.children[t];e.children[t]=Ds(r,r.value,e)})),e}var Vs=function(){function e(t){var r,n,o=this;ni()(this,e),qi()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new Ns,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:qi()(Object.create(this),_a,{getInstance:function(){return o}}),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=Go()(r=Do()(n=this.plugins).call(n,this.wrapPlugin.bind(this))).call(r,_a.isFunction),this.patches.push(_a.add([],this.spec)),this.patches.push(_a.context([],this.context)),this.updatePatches(this.patches)}return ii()(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,n)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];(t=console).log.apply(t,zo()(r=["[".concat(e,"] ")]).call(r,o))}}},{key:"wrapPlugin",value:function(e,t){var r,n,o,i=this.pathDiscriminator,a=null;return e[this.pluginProp]?(a=e,r=e[this.pluginProp]):_a.isFunction(e)?r=e:_a.isObject(e)&&(n=e,o=function(e,t){return!Array.isArray(e)||e.every((function(e,r){return e===t[r]}))},r=jo.a.mark((function e(t,r){var a,s,l,c,u,f;return jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f=function(e,t,l){var c,u,p,d,h,v,m,g,y,b,x,w,C;return jo.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(_a.isObject(e)){a.next=6;break}if(n.key!==t[t.length-1]){a.next=4;break}return a.next=4,n.plugin(e,n.key,t,r);case 4:a.next=30;break;case 6:c=t.length-1,u=t[c],p=t.indexOf("properties"),d="properties"===u&&c===p,h=r.allowMetaPatches&&s[e.$$ref],v=0,m=Bo()(e);case 12:if(!(v<m.length)){a.next=30;break}if(g=m[v],y=e[g],b=zo()(t).call(t,g),x=_a.isObject(y),w=e.$$ref,h){a.next=22;break}if(!x){a.next=22;break}return r.allowMetaPatches&&w&&(s[w]=!0),a.delegateYield(f(y,b,l),"t0",22);case 22:if(d||g!==n.key){a.next=27;break}if(C=o(i,t),i&&!C){a.next=27;break}return a.next=27,n.plugin(y,g,b,r,l);case 27:v++,a.next=12;break;case 30:case"end":return a.stop()}}),a)},a=jo.a.mark(f),s={},l=xo()(Go()(t).call(t,_a.isAdditiveMutation)),e.prev=4,l.s();case 6:if((c=l.n()).done){e.next=11;break}return u=c.value,e.delegateYield(f(u.value,u.path,u),"t0",9);case 9:e.next=6;break;case 11:e.next=16;break;case 13:e.prev=13,e.t1=e.catch(4),l.e(e.t1);case 16:return e.prev=16,l.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])}))),qi()(r.bind(a),{pluginName:e.name||t,isGenerator:_a.isGenerator(r)})}},{key:"nextPlugin",value:function(){var e=this;return Xi()(this.wrappedPlugins,(function(t){return e.getMutationsForPlugin(t).length>0}))}},{key:"nextPromisedPatch",value:function(){var e;if(this.promisedPatches.length>0)return $i.a.race(Do()(e=this.promisedPatches).call(e,(function(e){return e.value})))}},{key:"getPluginHistory",value:function(e){var t=this.constructor.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"updatePluginHistory",value:function(e,t){var r=this.constructor.getPluginName(e);this.pluginHistory[r]=this.pluginHistory[r]||[],this.pluginHistory[r].push(t)}},{key:"updatePatches",value:function(e){var t=this;_a.normalizeArray(e).forEach((function(e){if(e instanceof Error)t.errors.push(e);else try{if(!_a.isObject(e))return void t.debug("updatePatches","Got a non-object patch",e);if(t.showDebug&&t.allPatches.push(e),_a.isPromise(e.value))return t.promisedPatches.push(e),void t.promisedPatchThen(e);if(_a.isContextPatch(e))return void t.setContext(e.path,e.value);if(_a.isMutation(e))return void t.updateMutations(e)}catch(e){console.error(e),t.errors.push(e)}}))}},{key:"updateMutations",value:function(e){"object"===Co()(e.value)&&!Array.isArray(e.value)&&this.allowMetaPatches&&(e.value=fo()({},e.value));var t=_a.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t,r=this.promisedPatches.indexOf(e);r<0?this.debug("Tried to remove a promisedPatch that isn't there!"):Ji()(t=this.promisedPatches).call(t,r,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then((function(r){var n=fo()(fo()({},e),{},{value:r});t.removePromisedPatch(e),t.updatePatches(n)})).catch((function(r){t.removePromisedPatch(e),t.updatePatches(r)})),e.value}},{key:"getMutations",value:function(e,t){var r;return e=e||0,"number"!=typeof t&&(t=this.mutations.length),wi()(r=this.mutations).call(r,e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return _a.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"dispatch",value:function(){var e,t=this,r=this,n=this.nextPlugin();if(!n){var o=this.nextPromisedPatch();if(o)return o.then((function(){return t.dispatch()})).catch((function(){return t.dispatch()}));var i={spec:this.state,errors:this.errors};return this.showDebug&&(i.patches=this.allPatches),$i.a.resolve(i)}if(r.pluginCount=r.pluginCount||{},r.pluginCount[n]=(r.pluginCount[n]||0)+1,r.pluginCount[n]>100)return $i.a.resolve({spec:r.state,errors:zo()(e=r.errors).call(e,new Error("We've reached a hard limit of ".concat(100," plugin runs")))});if(n!==this.currentPlugin&&this.promisedPatches.length){var a,s=Do()(a=this.promisedPatches).call(a,(function(e){return e.value}));return $i.a.all(Do()(s).call(s,(function(e){return e.then(Zi.a,Zi.a)}))).then((function(){return t.dispatch()}))}return function(){r.currentPlugin=n;var e=r.getCurrentMutations(),t=r.mutations.length-1;try{if(n.isGenerator){var o,i=xo()(n(e,r.getLib()));try{for(i.s();!(o=i.n()).done;){l(o.value)}}catch(e){i.e(e)}finally{i.f()}}else{l(n(e,r.getLib()))}}catch(e){console.error(e),l([qi()(Object.create(e),{plugin:n})])}finally{r.updatePluginHistory(n,{mutationIndex:t})}return r.dispatch()}();function l(e){e&&(e=_a.fullyNormalizeArray(e),r.updatePatches(e,n))}}}],[{key:"getPluginName",value:function(e){return e.pluginName}},{key:"getPatchesOfType",value:function(e,t){return Go()(e).call(e,t)}}]),e}();var Bs={refs:xs,allOf:Is,parameters:Fs,properties:_s},Us=r(585),zs=r.n(Us),Ws=function(e){return String.prototype.toLowerCase.call(e)},Hs=function(e){return e.replace(/[^\w]/gi,"_")};function qs(e){var t=e.openapi;return!!t&&mo()(t,"3")}function Gs(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n.v2OperationIdCompatibilityMode;if(!e||"object"!==Co()(e))return null;var i=(e.operationId||"").replace(/\s/g,"");return i.length?Hs(e.operationId):$s(t,r,{v2OperationIdCompatibilityMode:o})}function $s(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.v2OperationIdCompatibilityMode;if(o){var i,a,s=zo()(i="".concat(t.toLowerCase(),"_")).call(i,e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return(s=s||zo()(a="".concat(e.substring(1),"_")).call(a,t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return zo()(r="".concat(Ws(t))).call(r,Hs(e))}function Ks(e,t){var r;return zo()(r="".concat(Ws(t),"-")).call(r,e)}function Js(e,t){return e&&e.paths?function(e,t){return Ys(e,t,!0)||null}(e,(function(e){var r=e.pathName,n=e.method,o=e.operation;if(!o||"object"!==Co()(o))return!1;var i=o.operationId;return[Gs(o,r,n),Ks(r,n),i].some((function(e){return e&&e===t}))})):null}function Ys(e,t,r){if(!e||"object"!==Co()(e)||!e.paths||"object"!==Co()(e.paths))return null;var n=e.paths;for(var o in n)for(var i in n[o])if("PARAMETERS"!==i.toUpperCase()){var a=n[o][i];if(a&&"object"===Co()(a)){var s={spec:e,pathName:o,method:i.toUpperCase(),operation:a},l=t(s);if(r&&l)return s}}}function Xs(e){var t=e.spec,r=t.paths,n={};if(!r||t.$$normalized)return e;for(var o in r){var i=r[o];if(zs()(i)){var a=i.parameters,s=function(e){var r=i[e];if(!zs()(r))return"continue";var s=Gs(r,o,e);if(s){n[s]?n[s].push(r):n[s]=[r];var l=n[s];if(l.length>1)l.forEach((function(e,t){var r;e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=zo()(r="".concat(s)).call(r,t+1)}));else if(void 0!==r.operationId){var c=l[0];c.__originalOperationId=c.__originalOperationId||r.operationId,c.operationId=s}}if("parameters"!==e){var u=[],f={};for(var p in t)"produces"!==p&&"consumes"!==p&&"security"!==p||(f[p]=t[p],u.push(f));if(a&&(f.parameters=a,u.push(f)),u.length){var d,h=xo()(u);try{for(h.s();!(d=h.n()).done;){var v=d.value;for(var m in v)if(r[m]){if("parameters"===m){var g,y=xo()(v[m]);try{var b=function(){var e=g.value;r[m].some((function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e}))||r[m].push(e)};for(y.s();!(g=y.n()).done;)b()}catch(e){y.e(e)}finally{y.f()}}}else r[m]=v[m]}}catch(e){h.e(e)}finally{h.f()}}}};for(var l in i)s(l)}}return t.$$normalized=!0,e}function Qs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.requestInterceptor,n=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:r,responseInterceptor:n,headers:{Accept:"application/json, application/yaml"},credentials:o}).then((function(e){return e.body}))}}function Zs(e){var t=e.fetch,r=e.spec,n=e.url,o=e.mode,i=e.allowMetaPatches,a=void 0===i||i,s=e.pathDiscriminator,l=e.modelPropertyMacro,c=e.parameterMacro,u=e.requestInterceptor,f=e.responseInterceptor,p=e.skipNormalization,d=e.useCircularStructures,h=e.http,v=e.baseDoc;return v=v||n,h=t||h||ji,r?m(r):Qs(h,{requestInterceptor:u,responseInterceptor:f})(v).then(m);function m(e){v&&(Bs.refs.docCache[v]=e),Bs.refs.fetchJSON=Qs(h,{requestInterceptor:u,responseInterceptor:f});var t,r=[Bs.refs];return"function"==typeof c&&r.push(Bs.parameters),"function"==typeof l&&r.push(Bs.properties),"strict"!==o&&r.push(Bs.allOf),(t={spec:e,context:{baseDoc:v},plugins:r,allowMetaPatches:a,pathDiscriminator:s,parameterMacro:c,modelPropertyMacro:l,useCircularStructures:d},new Vs(t).dispatch()).then(p?function(){var e=So()(jo.a.mark((function e(t){return jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}():Xs)}}var el=r(653),tl=r.n(el);function rl(){return(rl=So()(jo.a.mark((function e(t,r){var n,o,i,a,s,l,c,u,f,p,d,h,v=arguments;return jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=v.length>2&&void 0!==v[2]?v[2]:{},o=n.returnEntireTree,i=n.baseDoc,a=n.requestInterceptor,s=n.responseInterceptor,l=n.parameterMacro,c=n.modelPropertyMacro,u=n.useCircularStructures,f={pathDiscriminator:r,baseDoc:i,requestInterceptor:a,responseInterceptor:s,parameterMacro:l,modelPropertyMacro:c,useCircularStructures:u},p=Xs({spec:t}),d=p.spec,e.next=6,Zs(fo()(fo()({},f),{},{spec:d,allowMetaPatches:!0,skipNormalization:!0}));case 6:return h=e.sent,!o&&Array.isArray(r)&&r.length&&(h.spec=tl()(h.spec,r)||null),e.abrupt("return",h);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nl=function(){return null},ol={mapTagOperations:function(e){var t=e.spec,r=e.cb,n=void 0===r?nl:r,o=e.defaultTag,i=void 0===o?"default":o,a=e.v2OperationIdCompatibilityMode,s={},l={};return Ys(t,(function(e){var r,o=e.pathName,c=e.method,u=e.operation;(u.tags?(r=u.tags,Array.isArray(r)?r:[r]):[i]).forEach((function(e){if("string"==typeof e){l[e]=l[e]||{};var r,i=l[e],f=Gs(u,o,c,{v2OperationIdCompatibilityMode:a}),p=n({spec:t,pathName:o,method:c,operation:u,operationId:f});if(s[f])s[f]+=1,i[zo()(r="".concat(f)).call(r,s[f])]=p;else if(void 0!==i[f]){var d,h,v=s[f]||1;s[f]=v+1,i[zo()(d="".concat(f)).call(d,s[f])]=p;var m=i[f];delete i[f],i[zo()(h="".concat(f)).call(h,v)]=m}else i[f]=p}}))})),l},makeExecute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=t.pathName,n=t.method,o=t.operationId;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute(fo()(fo()({spec:e.spec},Qo()(e,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:r,method:n,parameters:t,operationId:o},i))}}}};var il=r(1099),al=r.n(il),sl=r(775),ll=r.n(sl),cl=r(575),ul=r.n(cl),fl=r(1105),pl=r.n(fl),dl={body:function(e){var t=e.req,r=e.value;t.body=r},header:function(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{},void 0!==n&&(t.headers[r.name]=n)},query:function(e){var t=e.req,r=e.value,n=e.parameter;t.query=t.query||{},!1===r&&"boolean"===n.type&&(r="false");0===r&&["number","integer"].indexOf(n.type)>-1&&(r="0");if(r)t.query[n.name]={collectionFormat:n.collectionFormat,value:r};else if(n.allowEmptyValue&&void 0!==r){var o=n.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},path:function(e){var t=e.req,r=e.value,n=e.parameter;t.url=t.url.split("{".concat(n.name,"}")).join(encodeURIComponent(r))},formData:function(e){var t=e.req,r=e.value,n=e.parameter;(r||n.allowEmptyValue)&&(t.form=t.form||{},t.form[n.name]={value:r,allowEmptyValue:n.allowEmptyValue,collectionFormat:n.collectionFormat})}};function hl(e,t){return Mo()(t).call(t,"application/json")?"string"==typeof e?e:No()(e):e.toString()}function vl(e){var t=e.req,r=e.value,n=e.parameter,o=n.name,i=n.style,a=n.explode,s=n.content;if(s){var l=Bo()(s)[0];t.url=t.url.split("{".concat(o,"}")).join(Oi(hl(r,l),{escape:!0}))}else{var c=Si({key:n.name,value:r,style:i||"simple",explode:a||!1,escape:!0});t.url=t.url.split("{".concat(o,"}")).join(c)}}function ml(e){var t=e.req,r=e.value,n=e.parameter;if(t.query=t.query||{},n.content){var o=Bo()(n.content)[0];t.query[n.name]=hl(r,o)}else if(!1===r&&(r="false"),0===r&&(r="0"),r)t.query[n.name]={value:r,serializationOption:Qo()(n,["style","explode","allowReserved"])};else if(n.allowEmptyValue&&void 0!==r){var i=n.name;t.query[i]=t.query[i]||{},t.query[i].allowEmptyValue=!0}}var gl=["accept","authorization","content-type"];function yl(e){var t=e.req,r=e.parameter,n=e.value;if(t.headers=t.headers||{},!(gl.indexOf(r.name.toLowerCase())>-1))if(r.content){var o=Bo()(r.content)[0];t.headers[r.name]=hl(n,o)}else void 0!==n&&(t.headers[r.name]=Si({key:r.name,value:n,style:r.style||"simple",explode:void 0!==r.explode&&r.explode,escape:!1}))}function bl(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{};var o=Co()(n);if(r.content){var i,a=Bo()(r.content)[0];t.headers.Cookie=zo()(i="".concat(r.name,"=")).call(i,hl(n,a))}else if("undefined"!==o){var s="object"===o&&!Array.isArray(n)&&r.explode?"":"".concat(r.name,"=");t.headers.Cookie=s+Si({key:r.name,value:n,escape:!1,style:r.style||"form",explode:void 0!==r.explode&&r.explode})}}var xl=r(776),wl=r.n(xl);function Cl(e,t){var r=e.operation,n=e.requestBody,o=e.securities,i=e.spec,a=e.attachContentTypeForEmptyPayload,s=e.requestContentType;t=function(e){var t=e.request,r=e.securities,n=void 0===r?{}:r,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=ho()({},t),l=n.authorized,c=void 0===l?{}:l,u=i.security||a.security||[],f=c&&!!Bo()(c).length,p=tl()(a,["components","securitySchemes"])||{};if(s.headers=s.headers||{},s.query=s.query||{},!Bo()(n).length||!f||!u||Array.isArray(i.security)&&!i.security.length)return t;return u.forEach((function(e){Bo()(e).forEach((function(e){var t=c[e],r=p[e];if(t){var n=t.value||t,o=r.type;if(t)if("apiKey"===o)"query"===r.in&&(s.query[r.name]=n),"header"===r.in&&(s.headers[r.name]=n),"cookie"===r.in&&(s.cookies[r.name]=n);else if("http"===o){if(/^basic$/i.test(r.scheme)){var i,a=n.username||"",l=n.password||"",u=wl()(zo()(i="".concat(a,":")).call(i,l));s.headers.Authorization="Basic ".concat(u)}/^bearer$/i.test(r.scheme)&&(s.headers.Authorization="Bearer ".concat(n))}else if("oauth2"===o||"openIdConnect"===o){var f,d=t.token||{},h=d[r["x-tokenName"]||"access_token"],v=d.token_type;v&&"bearer"!==v.toLowerCase()||(v="Bearer"),s.headers.Authorization=zo()(f="".concat(v," ")).call(f,h)}}}))})),s}({request:t,securities:o,operation:r,spec:i});var l=r.requestBody||{},c=Bo()(l.content||{}),u=s&&c.indexOf(s)>-1;if(n||a){if(s&&u)t.headers["Content-Type"]=s;else if(!s){var f=c[0];f&&(t.headers["Content-Type"]=f,s=f)}}else s&&u&&(t.headers["Content-Type"]=s);if(!e.responseContentType&&r.responses){var p,d=Go()(p=Ho()(r.responses)).call(p,(function(e){var t=Ao()(e,2),r=t[0],n=t[1],o=parseInt(r,10);return o>=200&&o<300&&ll()(n.content)})).reduce((function(e,t){var r=Ao()(t,2)[1];return zo()(e).call(e,Bo()(r.content))}),[]);d.length>0&&(t.headers.accept=d.join(", "))}if(n)if(s){if(c.indexOf(s)>-1)if("application/x-www-form-urlencoded"===s||"multipart/form-data"===s)if("object"===Co()(n)){var h=(l.content[s]||{}).encoding||{};t.form={},Bo()(n).forEach((function(e){t.form[e]={value:n[e],encoding:h[e]||{}}}))}else t.form=n;else t.body=n}else t.body=n;return t}function kl(e,t){var r,n,o=e.spec,i=e.operation,a=e.securities,s=e.requestContentType,l=e.responseContentType,c=e.attachContentTypeForEmptyPayload;if((t=function(e){var t=e.request,r=e.securities,n=void 0===r?{}:r,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=ho()({},t),l=n.authorized,c=void 0===l?{}:l,u=n.specSecurity,f=void 0===u?[]:u,p=i.security||f,d=c&&!!Bo()(c).length,h=a.securityDefinitions;if(s.headers=s.headers||{},s.query=s.query||{},!Bo()(n).length||!d||!p||Array.isArray(i.security)&&!i.security.length)return t;return p.forEach((function(e){Bo()(e).forEach((function(e){var t=c[e];if(t){var r=t.token,n=t.value||t,o=h[e],i=o.type,a=o["x-tokenName"]||"access_token",l=r&&r[a],u=r&&r.token_type;if(t)if("apiKey"===i){var f="query"===o.in?"query":"headers";s[f]=s[f]||{},s[f][o.name]=n}else if("basic"===i)if(n.header)s.headers.authorization=n.header;else{var p,d=n.username||"",v=n.password||"";n.base64=wl()(zo()(p="".concat(d,":")).call(p,v)),s.headers.authorization="Basic ".concat(n.base64)}else if("oauth2"===i&&l){var m;u=u&&"bearer"!==u.toLowerCase()?u:"Bearer",s.headers.authorization=zo()(m="".concat(u," ")).call(m,l)}}}))})),s}({request:t,securities:a,operation:i,spec:o})).body||t.form||c)if(s)t.headers["Content-Type"]=s;else if(Array.isArray(i.consumes)){var u=Ao()(i.consumes,1);t.headers["Content-Type"]=u[0]}else if(Array.isArray(o.consumes)){var f=Ao()(o.consumes,1);t.headers["Content-Type"]=f[0]}else i.parameters&&Go()(r=i.parameters).call(r,(function(e){return"file"===e.type})).length?t.headers["Content-Type"]="multipart/form-data":i.parameters&&Go()(n=i.parameters).call(n,(function(e){return"formData"===e.in})).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(s){var p,d,h=i.parameters&&Go()(p=i.parameters).call(p,(function(e){return"body"===e.in})).length>0,v=i.parameters&&Go()(d=i.parameters).call(d,(function(e){return"formData"===e.in})).length>0;(h||v)&&(t.headers["Content-Type"]=s)}return!l&&Array.isArray(i.produces)&&i.produces.length>0&&(t.headers.accept=i.produces.join(", ")),t}var Al=function(e){return Array.isArray(e)?e:[]},Ol=rs("OperationNotFoundError",(function(e,t,r){this.originalError=r,qi()(this,t||{})})),Sl={buildRequest:El};function El(e){var t,r,n=e.spec,o=e.operationId,a=e.responseContentType,s=e.scheme,l=e.requestInterceptor,c=e.responseInterceptor,u=e.contextUrl,f=e.userFetch,p=e.server,d=e.serverVariables,h=e.http,v=e.parameters,m=e.parameterBuilders,g=qs(n);m||(m=g?i:dl);var y={url:"",credentials:h&&h.withCredentials?"include":"same-origin",headers:{},cookies:{}};l&&(y.requestInterceptor=l),c&&(y.responseInterceptor=c),f&&(y.userFetch=f);var b=Js(n,o);if(!b)throw new Ol("Operation ".concat(o," not found"));var x=b.operation,w=void 0===x?{}:x,C=b.method,k=b.pathName;if(y.url+=Tl({spec:n,scheme:s,contextUrl:u,server:p,serverVariables:d,pathName:k,method:C}),!o)return delete y.cookies,y;y.url+=k,y.method="".concat(C).toUpperCase(),v=v||{};var A=n.paths[k]||{};a&&(y.headers.accept=a);var O=function(e){var t={};e.forEach((function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e}));var r=[];return Bo()(t).forEach((function(e){Bo()(t[e]).forEach((function(n){r.push(t[e][n])}))})),r}(zo()(t=zo()(r=[]).call(r,Al(w.parameters))).call(t,Al(A.parameters)));O.forEach((function(e){var t,r,o=m[e.in];if("body"===e.in&&e.schema&&e.schema.properties&&(t=v),void 0===(t=e&&e.name&&v[e.name]))t=e&&e.name&&v[zo()(r="".concat(e.in,".")).call(r,e.name)];else if(function(e,t){return Go()(t).call(t,(function(t){return t.name===e}))}(e.name,O).length>1){var i;console.warn(zo()(i="Parameter '".concat(e.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(i,e.name,"' and the passed-in parameter values did not define an 'in' value."))}if(null!==t){if(void 0!==e.default&&void 0===t&&(t=e.default),void 0===t&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter ".concat(e.name," is not provided"));if(g&&e.schema&&"object"===e.schema.type&&"string"==typeof t)try{t=JSON.parse(t)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}o&&o({req:y,parameter:e,value:t,operation:w,spec:n})}}));var S=fo()(fo()({},e),{},{operation:w});if((y=g?Cl(S,y):kl(S,y)).cookies&&Bo()(y.cookies).length){var E=Bo()(y.cookies).reduce((function(e,t){var r=y.cookies[t];return e+(e?"&":"")+pl.a.serialize(t,r)}),"");y.headers.Cookie=E}return y.cookies&&delete y.cookies,Wi(y),y}var jl=function(e){return e?e.replace(/\W/g,""):null};function Tl(e){return qs(e.spec)?function(e){var t=e.spec,r=e.pathName,n=e.method,o=e.server,i=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,l=tl()(t,["paths",r,(n||"").toLowerCase(),"servers"])||tl()(t,["paths",r,"servers"])||tl()(t,["servers"]),c="",u=null;if(o&&l&&l.length){var f=Do()(l).call(l,(function(e){return e.url}));f.indexOf(o)>-1&&(c=o,u=l[f.indexOf(o)])}if(!c&&l&&l.length){c=l[0].url;var p=Ao()(l,1);u=p[0]}if(c.indexOf("{")>-1){(function(e){var t,r=[],n=/{([^}]+)}/g;for(;t=n.exec(e);)r.push(t[1]);return r})(c).forEach((function(e){if(u.variables&&u.variables[e]){var t=u.variables[e],r=s[e]||t.default,n=new RegExp("{".concat(e,"}"),"g");c=c.replace(n,r)}}))}return function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=r&&n?yo.a.parse(yo.a.resolve(n,r)):yo.a.parse(r),i=yo.a.parse(n),a=jl(o.protocol)||jl(i.protocol)||"",s=o.host||i.host,l=o.pathname||"";e=a&&s?zo()(t="".concat(a,"://")).call(t,s+l):l;return"/"===e[e.length-1]?wi()(e).call(e,0,-1):e}(c,i)}(e):function(e){var t,r,n=e.spec,o=e.scheme,i=e.contextUrl,a=void 0===i?"":i,s=yo.a.parse(a),l=Array.isArray(n.schemes)?n.schemes[0]:null,c=o||l||jl(s.protocol)||"http",u=n.host||s.host||"",f=n.basePath||"";t=c&&u?zo()(r="".concat(c,"://")).call(r,u+f):f;return"/"===t[t.length-1]?wi()(t).call(t,0,-1):t}(e)}function Ml(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?r.url=e:r=e,!(this instanceof Ml))return new Ml(r);ho()(this,r);var n=this.resolve().then((function(){return t.disableInterfaces||ho()(t,Ml.makeApisTagOperation(t)),t}));return n.client=this,n}Ml.http=ji,Ml.makeHttp=function(e,t,r){return r=r||function(e){return e},t=t||function(e){return e},function(n){return"string"==typeof n&&(n={url:n}),Ei.mergeInQueryOrForm(n),n=t(n),r(e(n))}}.bind(null,Ml.http),Ml.resolve=Zs,Ml.resolveSubtree=function(e,t){return rl.apply(this,arguments)},Ml.execute=function(e){var t=e.http,r=e.fetch,n=e.spec,o=e.operationId,i=e.pathName,a=e.method,s=e.parameters,l=e.securities,c=al()(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),u=t||r||ji;i&&a&&!o&&(o=Ks(i,a));var f=Sl.buildRequest(fo()({spec:n,operationId:o,parameters:s,securities:l,http:u},c));return f.body&&(ll()(f.body)||ul()(f.body))&&(f.body=No()(f.body)),u(f)},Ml.serializeRes=Li,Ml.serializeHeaders=Fi,Ml.clearCache=function(){Bs.refs.clearCache()},Ml.makeApisTagOperation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ol.makeExecute(e);return{apis:ol.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},Ml.buildRequest=El,Ml.helpers={opId:Gs},Ml.getBaseUrl=Tl,Ml.prototype={http:ji,execute:function(e){return this.applyDefaults(),Ml.execute(fo()({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},e))},resolve:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ml.resolve(fo()({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},t)).then((function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e}))}},Ml.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&mo()(t,"http")){var r=yo.a.parse(t);e.host||(e.host=r.host),e.schemes||(e.schemes=[r.protocol.replace(":","")]),e.basePath||(e.basePath="/")}};Ml.helpers;var Pl=Ml,Ll=r(148),Il=r(58);function Fl(e){return e.startsWith("//")?"https:"+e:e}var _l={flex:1,display:"flex",flexDirection:"column"},Nl=function(e){function t(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"formApi",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"setFormApi",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.formApi=e,setTimeout((function(){n.setState({form:n.formApi.getState()})}),0)}}),Object.defineProperty(n,"handleChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.setState({form:e}),zn(e)}}),Object.defineProperty(n,"handleTabChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.setState({activeTab:e})}}),Object.defineProperty(n,"handleServerChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.setState({server:e})}}),Object.defineProperty(n,"handleExecute",{enumerable:!0,configurable:!0,writable:!0,value:function(){return Object(a.b)(n,void 0,void 0,(function(){var e,t,n,o,i,s,l,c,u,d,h,v,m,g,y,b,x,w,C,k,A,O,S,E,j,T,M,P,L,I,F,_,N,R,D,V=this;return Object(a.e)(this,(function(B){switch(B.label){case 0:if(n=this.props,o=n.store,i=n.operation,this.formApi.submitForm(),s=this.formApi.getState(),l=s.values,s.invalid)return this.setState({shaking:!0}),setTimeout((function(){return V.setState({shaking:!1})}),1e3),null==o||null===(c=o.options.events)||void 0===c||null===(u=c.tryItSent)||void 0===u||u.call(c,{eventType:co.a.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:i.operationId,operationPath:i.path,operationHttpVerb:i.httpVerb,operationSummary:i.description}),[2];if(d=this.props.operation.requestBody,h=d&&d.content&&d.content.active&&d.content.active.name||"",v=l.body,/json/.test(h))try{v=JSON.parse(v)}catch(e){console.error(e)}if(this.setState({loading:!0}),m=o.dereferencedRawSpec,!(g=Object(f.f)(m,["paths",i.path,(i.httpVerb||"").toLowerCase(),"servers"])||Object(f.f)(m,["paths",i.path,"servers"])||Object(f.f)(m,["servers"])))throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");y=g.find((function(e){return V.state.server.url.endsWith(e.url.endsWith("/")?e.url.substring(0,e.url.length-1):e.url)})),b=Date.now(),x=!!window.document.documentMode,C=l.auth,l.auth?(k=Object.keys(l.auth)[0],A=Object(f.q)(k),w=Object(a.a)(Object(a.a)({},m),{components:Object(a.a)(Object(a.a)({},m.components),{securitySchemes:Object(a.a)(Object(a.a)({},m.components.securitySchemes),(R={},R[A]=Object(a.a)(Object(a.a)({},m.components.securitySchemes[A]),{type:"openIdConnect"===m.components.securitySchemes[A].type?"oauth2":m.components.securitySchemes[A].type}),R))})}),C=Object(a.a)(Object(a.a)({},C),((D={})[A]=C[k],D))):w=Object(a.a)({},m),(O=o.options.corsProxyUrl)&&m.servers&&m.servers.length&&(w.servers=m.servers.map((function(e){return Object(a.a)(Object(a.a)({},e),{url:O+Fl(e.url)})}))),S=(null==d||null===(e=d.content)||void 0===e||null===(t=e.active)||void 0===t?void 0:t.name)||null,E="application/x-www-form-urlencoded"===S?Object(p.parse)(v):v,S&&["image/jpeg","image/png","application/octet-stream"].includes(S)&&(j=Object.keys(v).map((function(e){return v[e]})),E=j.length>1?j:j[0]),B.label=1;case 1:return B.trys.push([1,5,8,9]),M={userFetch:x&&r(773).fetch,server:O?O+Fl(y.url):y.url,serverVariables:this.state.server.variables,spec:w,pathName:i.path,method:i.httpVerb,parameters:Object(a.a)(Object(a.a)(Object(a.a)(Object(a.a)({},l.path),l.query),l.header),l.cookie),securities:{authorized:C},requestBody:E,requestContentType:S,responseContentType:(null===(T=l.header)||void 0===T?void 0:T.Accept)||null,requestInterceptor:o.options.requestInterceptor&&function(e){var t,r;return null===(t=(r=o.options).requestInterceptor)||void 0===t?void 0:t.call(r,e,i)}||void 0},[4,Pl.execute(M)];case 2:return(P=B.sent())&&P.data instanceof Blob?(L=P,[4,P.data.text()]):[3,4];case 3:L.data=B.sent(),B.label=4;case 4:return this.setState({response:P,error:void 0}),[3,9];case 5:return(I=B.sent())&&I.response&&I.response.data instanceof Blob?(F=I.response,[4,I.response.data.text()]):[3,7];case 6:F.data=B.sent(),B.label=7;case 7:return this.setState({response:void 0,error:I}),[3,9];case 8:return this.setState({loading:!1,activeTab:1,time:Date.now()-b}),null==o||null===(_=o.options.events)||void 0===_||null===(N=_.tryItSent)||void 0===N||N.call(_,{eventType:co.a.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:i.operationId,operationPath:i.path,operationHttpVerb:i.httpVerb,operationSummary:i.description}),[7];case 9:return[2]}}))}))}}),Object.defineProperty(n,"validateBody",{enumerable:!0,configurable:!0,writable:!0,value:function(){}}),n.state={form:{values:{path:Wn(t.operation.parameters,"path"),cookie:Wn(t.operation.parameters,"cookie"),header:Wn(t.operation.parameters,"header"),query:Wn(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}},n}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Object(a.b)(this,void 0,void 0,(function(){var e,t,r,n,o;return Object(a.e)(this,(function(i){switch(i.label){case 0:return e=this.props,t=e.store,r=e.specIdx,n=e.operation,[4,t.dereferenceSpecForTryIt(r||0,n)];case 1:return o=i.sent(),this.setState({resolvedRawSpec:o}),this.formApi.setValues({}),[2]}}))}))}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.operation,r=e.className,n=e.rootElement,o=this.state,i=o.shaking,l=o.activeTab,c=o.form,u=o.response,f=o.loading,p=o.error,h=!(!u&&!p);return s.createElement(Rl,{shaking:i,className:r,rootElement:n},s.createElement(q.c,null,s.createElement(On,{active:l,hasResponse:h,onChange:this.handleTabChange}),this.props.onClose&&s.createElement(d.a,{onClick:this.props.onClose}," ✕ ")),s.createElement(d.b,{hidden:0!==l},this.renderRequest()),s.createElement(d.b,{hidden:1!==l},this.renderResponse()),s.createElement(ae,{hasResponse:h,params:c.values&&Object(a.a)({},c.values),operation:t,loading:f,execute:this.handleExecute}))}}),Object.defineProperty(t.prototype,"renderRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this.props,r=t.operation,n=t.store,o=t.properties,i=this.state,l=i.form,u=i.resolvedRawSpec,f=i.server,p=l.errors||{},d=p.path||p.cookie||p.header||p.query,v=u&&h.n.get(u,r.pointer),m=l.values&&l.values.auth&&Object.keys(l.values.auth)[0];m&&l.values.auth[m]||(m=void 0),!m||void 0===l.values.auth[m].token&&void 0===l.values.auth[m].client_id&&void 0===l.values.auth[m].client_secret||l.values.auth[m].token&&l.values.auth[m].token.access_token||(m=void 0),m&&null!=l.values.auth[m].username&&(l.values.auth[m].username&&l.values.auth[m].password||(m=void 0));var g=r.parameters||[],y=null==n||null===(e=n.options.hooks)||void 0===e?void 0:e.ReplaceTryItAuthPanel;return u?s.createElement(s.Fragment,null,s.createElement(c.a,{onChange:this.handleChange,getApi:this.setFormApi,style:Object(a.a)(Object(a.a)({},_l),{margin:0})},s.createElement(q.a,{initialActiveIdx:r.security.length&&m?1:0},r.security.length&&s.createElement(Vl,{header:Object(io.a)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!m&&!!p.auth,success:!!m},y?s.createElement(Dl,{field:"auth",validate:ao},(function(e){return s.createElement(Ll.a,{Hook:y,props:{server:f,operation:r,onChange:e,OAuth2:Rn}})})):s.createElement(lo,{formApi:this.formApi,form:l,operation:r,activeServer:f.url,authCorsProxyUrl:n.options.authCorsProxyUrl}))||null,r.requestBody&&s.createElement(Vl,{header:Object(io.a)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!p.body},s.createElement(wn,{validate:this.validateBody,console:this,body:r.requestBody,id:r.id,resolvedBody:v.requestBody,properties:o}))||null,g.length&&s.createElement(Vl,{header:Object(io.a)("tryItParameters"),"data-cy":"parameters-trigger",error:d,renderChildrenHidden:!0},s.createElement(H,{operation:r,values:l.values,errors:l.errors||{}}))||null)),s.createElement(_,{operation:r,onChange:this.handleServerChange})):"Loading..."}}),Object.defineProperty(t.prototype,"renderResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.response,r=e.error,n=e.time;return s.createElement(ye,{response:t,error:r,time:n})}}),t=Object(a.c)([u.a],t)}(s.Component);function Rl(e){var t=e.shaking,r=e.className,n=e.children,o=e.rootElement,i=Object(f.r)(o)[0];return s.createElement(d.c,{shaking:t,className:r,"data-cy":"console",fullWidth:null==i?void 0:i.width},n)}function Dl(e){var t=Object(c.c)(Object(a.a)({},e)),r=t.fieldApi,n=t.render,o=t.userProps,i=r.setValue,l=o.children;return n(s.createElement(s.Fragment,null,l(i)))}function Vl(e){return s.createElement(Ul,Object(a.a)({},e,{header:function(t){var r=t.toggle,n=t.expanded;return s.createElement(q.f,{onClick:r,isExpanded:n,"data-cy":e["data-cy"]},s.createElement(q.k,null,s.createElement(q.j,null,e.header),s.createElement(h.R,{direction:n?"down":"right"})),e.error&&s.createElement(h.e,{size:"14px",color:"#ff908b"})||null,e.success&&s.createElement(h.q,{size:"14px",color:"#56ff26"})||null)}}))}var Bl,Ul=Object(m.e)(q.g)(Bl||(Bl=Object(a.f)(["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"],["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"])),q.f,(function(e){return e.error?"#ff908b":"#89949f"}),h.R,Il.a,(function(e){return e.error?"#ff908b":"#89949f"}))},function(e,t,r){"use strict";var n=r(569),o=r(600).f,i=r(709),a=r(566),s=r(611),l=r(577),c=r(574),u=function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,f,p,d,h,v,m,g,y=e.target,b=e.global,x=e.stat,w=e.proto,C=b?n:x?n[y]:(n[y]||{}).prototype,k=b?a:a[y]||(a[y]={}),A=k.prototype;for(p in t)r=!i(b?p:y+(x?".":"#")+p,e.forced)&&C&&c(C,p),h=k[p],r&&(v=e.noTargetGet?(g=o(C,p))&&g.value:C[p]),d=r&&v?v:t[p],r&&typeof h==typeof d||(m=e.bind&&r?s(d,n):e.wrap&&r?u(d):w&&"function"==typeof d?s(Function.call,d):d,(e.sham||d&&d.sham||h&&h.sham)&&l(m,"sham",!0),k[p]=m,w&&(c(a,f=y+"Prototype")||l(a,f,{}),a[f][p]=d,e.real&&A&&!A[p]&&l(A,p,d)))}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(566),o=r(574),i=r(665),a=r(582).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,r(25))},function(e,t,r){var n=r(569),o=r(661),i=r(574),a=r(634),s=r(659),l=r(713),c=o("wks"),u=n.Symbol,f=l?u:u&&u.withoutSetter||a;e.exports=function(e){return i(c,e)&&(s||"string"==typeof c[e])||(s&&i(u,e)?c[e]=u[e]:c[e]=f("Symbol."+e)),c[e]}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(567);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,r){var n=r(571);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(581),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(n(e),t)}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){e.exports=r(934)},function(e,t,r){var n=r(572),o=r(582),i=r(601);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(566);e.exports=function(e){return n[e+"Prototype"]}},function(e,t,r){var n=r(706),o=r(711),i=r(800),a=r(719),s=r(807),l=r(817),c=r(822),u=r(669),f=r(725);function p(e,t){var r=n(e);if(o){var s=o(e);t&&(s=i(s).call(s,(function(t){return a(e,t).enumerable}))),r.push.apply(r,s)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r,n=null!=arguments[t]?arguments[t]:{};if(t%2)s(r=p(Object(n),!0)).call(r,(function(t){f(e,t,n[t])}));else if(l)c(e,l(n));else{var o;s(o=p(Object(n))).call(o,(function(t){u(e,t,a(n,t))}))}}return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(654),o=r(629);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(629);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(572),o=r(708),i=r(573),a=r(630),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(i(e),t=a(t,!0),i(r),o)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(566),o=r(569),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e])||i(o[e]):n[e]&&n[e][t]||o[e]&&o[e][t]}},function(e,t,r){var n=r(728),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,r){e.exports=r(933)},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,r){var n=r(643),o=r(891);function i(t){return"function"==typeof n&&"symbol"==typeof o?(e.exports=i=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e){return e&&"function"==typeof n&&e.constructor===n&&e!==n.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=n||o||i,s=a&&(n?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),v=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),g=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=v||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,l=!0);var C=y&&(c||f&&(null==w||w<12.11)),k=r||a&&s>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O,S=function(e,t){var r=e.className,n=A(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return E(e).appendChild(t)}function T(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function M(e,t,r,n){var o=T(e,t,r,n);return o.setAttribute("role","presentation"),o}function P(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function I(e,t){var r=e.className;A(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!A(r[n]).test(t)&&(t+=" "+r[n]);return t}O=document.createRange?function(e,t,r,n){var o=document.createRange();return o.setEnd(n||e,r),o.setStart(e,t),o}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var _=function(e){e.select()};function N(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function D(e,t,r,n,o){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var i=n||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=r-a%r,i=s+1}}v?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(e){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var U={toString:function(){return"CodeMirror.Pass"}},z={scroll:!1},W={origin:"*mouse"},H={origin:"+move"};function q(e,t,r){for(var n=0,o=0;;){var i=e.indexOf("\t",n);-1==i&&(i=e.length);var a=i-n;if(i==e.length||o+a>=t)return n+Math.min(a,t-o);if(o+=i-n,n=i+1,(o+=r-o%r)>=t)return n}}var G=[""];function $(e){for(;G.length<=e;)G.push(K(G)+" ");return G[e]}function K(e){return e[e.length-1]}function J(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Y(){}function X(e,t){var r;return Object.create?r=Object.create(e):(Y.prototype=e,r=new Y),t&&R(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Z(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Z(e))||t.test(e):Z(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ne(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,r){for(;(r<0?t>0:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function ie(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var o=(t+r)/2,i=n<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:r;e(i)?r=i:t=i+n}}var ae=null;function se(e,t,r){var n;ae=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==r?n=o:ae=o),i.from==t&&(i.from!=i.to&&"before"!=r?n=o:ae=o)}return null!=n?n:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,o=/[1n]/;function i(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,f=[],p=0;p<u;++p)f.push((c=a.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var d=0,h=l;d<u;++d){var v=f[d];"m"==v?f[d]=h:h=v}for(var m=0,g=l;m<u;++m){var y=f[m];"1"==y&&"r"==g?f[m]="n":r.test(y)&&(g=y,"r"==y&&(f[m]="R"))}for(var b=1,x=f[0];b<u-1;++b){var w=f[b];"+"==w&&"1"==x&&"1"==f[b+1]?f[b]="1":","!=w||x!=f[b+1]||"1"!=x&&"n"!=x||(f[b]=x),x=w}for(var C=0;C<u;++C){var k=f[C];if(","==k)f[C]="N";else if("%"==k){var A=void 0;for(A=C+1;A<u&&"%"==f[A];++A);for(var O=C&&"!"==f[C-1]||A<u&&"1"==f[A]?"1":"N",S=C;S<A;++S)f[S]=O;C=A-1}}for(var E=0,j=l;E<u;++E){var T=f[E];"L"==j&&"1"==T?f[E]="L":r.test(T)&&(j=T)}for(var M=0;M<u;++M)if(t.test(f[M])){var P=void 0;for(P=M+1;P<u&&t.test(f[P]);++P);for(var L="L"==(M?f[M-1]:l),I=L==("L"==(P<u?f[P]:l))?L?"L":"R":l,F=M;F<P;++F)f[F]=I;M=P-1}for(var _,N=[],R=0;R<u;)if(n.test(f[R])){var D=R;for(++R;R<u&&n.test(f[R]);++R);N.push(new i(0,D,R))}else{var V=R,B=N.length,U="rtl"==s?1:0;for(++R;R<u&&"L"!=f[R];++R);for(var z=V;z<R;)if(o.test(f[z])){V<z&&(N.splice(B,0,new i(1,V,z)),B+=U);var W=z;for(++z;z<R&&o.test(f[z]);++z);N.splice(B,0,new i(2,W,z)),B+=U,V=z}else++z;V<R&&N.splice(B,0,new i(1,V,R))}return"ltr"==s&&(1==N[0].level&&(_=a.match(/^\s+/))&&(N[0].from=_[0].length,N.unshift(new i(0,0,_[0].length))),1==K(N).level&&(_=a.match(/\s+$/))&&(K(N).to-=_[0].length,N.push(new i(0,u-_[0].length,u)))),"rtl"==s?N.reverse():N}}();function ce(e,t){var r=e.order;return null==r&&(r=e.order=le(e.text,t)),r}var ue=[],fe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ue).concat(r)}};function pe(e,t){return e._handlers&&e._handlers[t]||ue}function de(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,o=n&&n[t];if(o){var i=B(o,r);i>-1&&(n[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function he(e,t){var r=pe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o<r.length;++o)r[o].apply(null,n)}function ve(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,r||t.type,e,t),we(t)||t.codemirrorIgnore}function me(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function ge(e,t){return pe(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){de(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),xe(e)}function ke(e){return e.target||e.srcElement}function Ae(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Se,Ee=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function je(e){if(null==Oe){var t=T("span","​");j(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var r=Oe?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Te(e){if(null!=Se)return Se;var t=j(e,document.createTextNode("AخA")),r=O(t,0,1).getBoundingClientRect(),n=O(t,1,2).getBoundingClientRect();return E(e),!(!r||r.left==r.right)&&(Se=n.right-r.right<3)}var Me,Pe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(r.push(i.slice(0,a)),t+=a+1):(r.push(i),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Le=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Me=T("div"))||(Me.setAttribute("oncopy","return;"),"function"==typeof Me.oncopy),Fe=null,_e={},Ne={};function Re(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function De(e){if("string"==typeof e&&Ne.hasOwnProperty(e))e=Ne[e];else if(e&&"string"==typeof e.name&&Ne.hasOwnProperty(e.name)){var t=Ne[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return De("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return De("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=De(t);var r=_e[t.name];if(!r)return Ve(e,"text/plain");var n=r(e,t);if(Be.hasOwnProperty(t.name)){var o=Be[t.name];for(var i in o)o.hasOwnProperty(i)&&(n.hasOwnProperty(i)&&(n["_"+i]=n[i]),n[i]=o[i])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Be={};function Ue(e,t){R(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function We(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function He(e,t,r){return!e.startState||e.startState(t,r)}var qe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],i=o.chunkSize();if(t<i){r=o;break}t-=i}return r.lines[t]}function $e(e,t,r){var n=[],o=t.line;return e.iter(t.line,r.line+1,(function(e){var i=e.text;o==r.line&&(i=i.slice(0,r.ch)),o==t.line&&(i=i.slice(t.ch)),n.push(i),++o})),n}function Ke(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function Je(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var o=0;n.children[o]!=t;++o)r+=n.children[o].chunkSize();return r+t.first}function Xe(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var o=e.children[n],i=o.height;if(t<i){e=o;continue e}t-=i,r+=o.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return r+a}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Ze(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,r){if(void 0===r&&(r=null),!(this instanceof et))return new et(e,t,r);this.line=e,this.ch=t,this.sticky=r}function tt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function nt(e){return et(e.line,e.ch)}function ot(e,t){return tt(e,t)<0?t:e}function it(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var r=e.first+e.size-1;return t.line>r?et(r,Ge(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?et(e.line,t):r<0?et(e.line,0):e}(t,Ge(e,t.line).text.length)}function lt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=st(e,t[n]);return r}qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=D(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?D(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return D(this.string,null,this.tabSize)-(this.lineStart?D(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return r?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,r,n){var o=[e.state.modeGen],i={};xt(e,t.text,e.doc.mode,r,(function(e,t){return o.push(e,t)}),i,n);for(var a=r.state,s=function(n){r.baseTokens=o;var s=e.state.overlays[n],l=1,c=0;r.state=!0,xt(e,t.text,s.mode,r,(function(e,t){for(var r=l;c<e;){var n=o[l];n>e&&o.splice(l,1,e,o[l+1],n),l+=2,c=Math.min(e,n)}if(t)if(s.opaque)o.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var i=o[r+1];o[r+1]=(i?i+" ":"")+"overlay "+t}}),i),r.state=a,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function pt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=dt(e,Ye(t)),o=t.text.length>e.options.maxHighlightLength&&ze(e.doc.mode,n.state),i=ft(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function dt(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new ut(n,!0,t);var i=function(e,t,r){for(var n,o,i=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ge(i,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof ct?c.lookAhead:0)<=i.modeFrontier))return s;var u=D(l.text,null,e.options.tabSize);(null==o||n>u)&&(o=s-1,n=u)}return o}(e,t,r),a=i>n.first&&Ge(n,i-1).stateAfter,s=a?ut.fromSaved(n,a,i):new ut(n,He(n.mode),i);return n.iter(i,t,(function(r){ht(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&n<o.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function ht(e,t,r,n){var o=e.doc.mode,i=new qe(t,e.options.tabSize,r);for(i.start=i.pos=n||0,""==t&&vt(o,r.state);!i.eol();)mt(o,i,r.state),i.start=i.pos}function vt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=We(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function mt(e,t,r,n){for(var o=0;o<10;o++){n&&(n[0]=We(e,r).mode);var i=e.token(t,r);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,r){return t instanceof ct?new ut(e,ze(e.mode,t.state),r,t.lookAhead):new ut(e,ze(e.mode,t),r)},ut.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function yt(e,t,r,n){var o,i,a=e.doc,s=a.mode,l=Ge(a,(t=st(a,t)).line),c=dt(e,t.line,r),u=new qe(l.text,e.options.tabSize,c);for(n&&(i=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=mt(s,u,c.state),n&&i.push(new gt(u,o,ze(a.mode,c.state)));return n?i:new gt(u,o,c.state)}function bt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function xt(e,t,r,n,o,i,a){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,f=new qe(t,e.options.tabSize,n),p=e.options.addModeClass&&[null];for(""==t&&bt(vt(r,n.state),i);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,a&&ht(e,t,n,f.pos),f.pos=t.length,l=null):l=bt(mt(r,f,n.state,p),i),p){var d=p[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||u!=l){for(;c<f.start;)o(c=Math.min(f.start,c+5e3),u);u=l}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e3);o(h,u),c=h}}var wt=!1,Ct=!1;function kt(e,t,r){this.marker=e,this.from=t,this.to=r}function At(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ot(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function St(e,t){if(t.full)return null;var r=Qe(e,t.from.line)&&Ge(e,t.from.line).markedSpans,n=Qe(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!r&&!n)return null;var o=t.from.ch,i=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t)||i.from==t&&"bookmark"==a.type&&(!r||!i.marker.insertLeft)){var s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(n||(n=[])).push(new kt(a,i.from,s?null:i.to))}}return n}(r,o,a),l=function(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.to||(a.inclusiveRight?i.to>=t:i.to>t)||i.from==t&&"bookmark"==a.type&&(!r||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(n||(n=[])).push(new kt(a,s?null:i.from-t,null==i.to?null:i.to-t))}}return n}(n,i,a),c=1==t.text.length,u=K(t.text).length+(c?o:0);if(s)for(var f=0;f<s.length;++f){var p=s[f];if(null==p.to){var d=At(l,p.marker);d?c&&(p.to=null==d.to?null:d.to+u):p.to=o}}if(l)for(var h=0;h<l.length;++h){var v=l[h];null!=v.to&&(v.to+=u),null==v.from?At(s,v.marker)||(v.from=u,c&&(s||(s=[])).push(v)):(v.from+=u,c&&(s||(s=[])).push(v))}s&&(s=Et(s)),l&&l!=s&&(l=Et(l));var m=[s];if(!c){var g,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(g||(g=[])).push(new kt(s[b].marker,null,null));for(var x=0;x<y;++x)m.push(g);m.push(l)}return m}function Et(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function jt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Mt(e){return e.inclusiveLeft?-1:0}function Pt(e){return e.inclusiveRight?1:0}function Lt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),o=t.find(),i=tt(n.from,o.from)||Mt(e)-Mt(t);if(i)return-i;var a=tt(n.to,o.to)||Pt(e)-Pt(t);return a||t.id-e.id}function It(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var o=void 0,i=0;i<n.length;++i)(o=n[i]).marker.collapsed&&null==(t?o.from:o.to)&&(!r||Lt(r,o.marker)<0)&&(r=o.marker);return r}function Ft(e){return It(e,!0)}function _t(e){return It(e,!1)}function Nt(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var o=0;o<n.length;++o){var i=n[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!r||Lt(r,i.marker)<0)&&(r=i.marker)}return r}function Rt(e,t,r,n,o){var i=Ge(e,t),a=Ct&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,r)||Mt(l.marker)-Mt(o),f=tt(c.to,n)||Pt(l.marker)-Pt(o);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.to,r)>=0:tt(c.to,r)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.from,n)<=0:tt(c.from,n)<0)))return!0}}}function Dt(e){for(var t;t=Ft(e);)e=t.find(-1,!0).line;return e}function Vt(e,t){var r=Ge(e,t),n=Dt(r);return r==n?t:Ye(n)}function Bt(e,t){if(t>e.lastLine())return t;var r,n=Ge(e,t);if(!Ut(e,n))return t;for(;r=_t(n);)n=r.find(1,!0).line;return Ye(n)+1}function Ut(e,t){var r=Ct&&t.markedSpans;if(r)for(var n=void 0,o=0;o<r.length;++o)if((n=r[o]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&zt(e,t,n))return!0}}function zt(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return zt(e,n.line,At(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if((o=t.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==r.to&&(null==o.to||o.to!=r.from)&&(o.marker.inclusiveLeft||r.marker.inclusiveRight)&&zt(e,t,o))return!0}function Wt(e){for(var t=0,r=(e=Dt(e)).parent,n=0;n<r.lines.length;++n){var o=r.lines[n];if(o==e)break;t+=o.height}for(var i=r.parent;i;i=(r=i).parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==r)break;t+=s.height}return t}function Ht(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ft(n);){var o=t.find(0,!0);n=o.from.line,r+=o.from.ch-o.to.ch}for(n=e;t=_t(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,r+=(n=i.to.line).text.length-i.to.ch}return r}function qt(e){var t=e.display,r=e.doc;t.maxLine=Ge(r,r.first),t.maxLineLength=Ht(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Ht(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Gt=function(e,t,r){this.text=e,Tt(this,t),this.height=r?r(this):1};function $t(e){e.parent=null,jt(e)}Gt.prototype.lineNo=function(){return Ye(this)},ye(Gt);var Kt={},Jt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Jt:Kt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var r=M("span",null,null,l?"padding-right: .1px":null),n={pre:M("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;n.pos=0,n.addToken=Zt,Te(e.display.measure)&&(a=ce(i,e.doc.direction))&&(n.addToken=er(n.addToken,a)),n.map=[],rr(i,n,pt(e,i,t!=e.display.externalMeasured&&Ye(i))),i.styleClasses&&(i.styleClasses.bgClass&&(n.bgClass=F(i.styleClasses.bgClass,n.bgClass||"")),i.styleClasses.textClass&&(n.textClass=F(i.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,r,n,o,i,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!r||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),n+=i,r=" "==i}return n}(t,e.trailingSpace):t,f=e.cm.state.specialChars,p=!1;if(f.test(t)){c=document.createDocumentFragment();for(var d=0;;){f.lastIndex=d;var h=f.exec(t),v=h?h.index-d:t.length-d;if(v){var m=document.createTextNode(u.slice(d,d+v));a&&s<9?c.appendChild(T("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+v,m),e.col+=v,e.pos+=v}if(!h)break;d+=v+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=c.appendChild(T("span",$(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((g=c.appendChild(T("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(T("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||o||p||i||l){var x=r||"";n&&(x+=n),o&&(x+=o);var w=T("span",[c],x,i);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,l[C]);return e.content.appendChild(w)}e.content.appendChild(c)}}function er(e,t){return function(r,n,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var f=void 0,p=0;p<t.length&&!((f=t[p]).to>c&&f.from<=c);p++);if(f.to>=u)return e(r,n,o,i,a,s,l);e(r,n.slice(0,f.to-c),o,i,null,s,l),i=null,n=n.slice(f.to-c),c=f.to}}}function tr(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,o=e.text,i=0;if(n)for(var a,s,l,c,u,f,p,d=o.length,h=0,v=1,m="",g=0;;){if(g==h){l=c=u=s="",p=null,f=null,g=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var w=n[x],C=w.marker;if("bookmark"==C.type&&w.from==h&&C.widgetNode)y.push(C);else if(w.from<=h&&(null==w.to||w.to>h||C.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&g>w.to&&(g=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&w.from==h&&(u+=" "+C.startStyle),C.endStyle&&w.to==g&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((p||(p={})).title=C.title),C.attributes)for(var k in C.attributes)(p||(p={}))[k]=C.attributes[k];C.collapsed&&(!f||Lt(f.marker,C)<0)&&(f=w)}else w.from>h&&g>w.from&&(g=w.from)}if(b)for(var A=0;A<b.length;A+=2)b[A+1]==g&&(c+=" "+b[A]);if(!f||f.from==h)for(var O=0;O<y.length;++O)tr(t,0,y[O]);if(f&&(f.from||0)==h){if(tr(t,(null==f.to?d+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=d)break;for(var S=Math.min(d,g);;){if(m){var E=h+m.length;if(!f){var j=E>S?m.slice(0,S-h):m;t.addToken(t,j,a?a+l:l,u,h+j.length==g?c:"",s,p)}if(E>=S){m=m.slice(S-h),h=S;break}h=E,u=""}m=o.slice(i,i=r[v++]),a=Yt(r[v++],t.cm.options)}}else for(var T=1;T<r.length;T+=2)t.addToken(t,o.slice(i,i=r[T]),Yt(r[T+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=_t(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?Ye(K(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function or(e,t,r){for(var n,o=[],i=t;i<r;i=n){var a=new nr(e.doc,Ge(e.doc,i),i);n=i+a.size,o.push(a)}return o}var ir=null,ar=null;function sr(e,t){var r=pe(e,t);if(r.length){var n,o=Array.prototype.slice.call(arguments,2);ir?n=ir.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(lr,0));for(var i=function(e){n.push((function(){return r[e].apply(null,o)}))},a=0;a<r.length;++a)i(a)}}function lr(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?pr(e,t):"gutter"==i?hr(e,t,r,n):"class"==i?dr(e,t):"widget"==i&&vr(e,t,n)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Xt(e,t)}function pr(e,t){var r=t.text.className,n=fr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,dr(e,t)):r&&(t.text.className=r)}function dr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=ur(t);t.background=n.insertBefore(T("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function hr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=ur(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=ur(t),s=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(T("div",Ze(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function vr(e,t,r){t.alignable&&(t.alignable=null);for(var n=A("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,n.test(o.className)&&t.node.removeChild(o);gr(e,t,r)}function mr(e,t,r,n){var o=fr(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),dr(e,t),hr(e,t,r,n),gr(e,t,n),t.node}function gr(e,t,r){if(yr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)yr(e,t.rest[n],t,r,!1)}function yr(e,t,r,n,o){if(t.widgets)for(var i=ur(r),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),br(l,c,r,n),e.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,r.gutter||r.text):i.appendChild(c),sr(l,"redraw")}}function br(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var o=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(o-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function xr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),j(t.display.measure,T("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function wr(e,t){for(var r=ke(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Cr(e){return e.lineSpace.offsetTop}function kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ar(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=j(e.measure,T("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Or(e){return 50-e.display.nativeBarWidth}function Sr(e){return e.display.scroller.clientWidth-Or(e)-e.display.barWidth}function Er(e){return e.display.scroller.clientHeight-Or(e)-e.display.barHeight}function jr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var o=0;o<e.rest.length;o++)if(Ye(e.rest[o])>r)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Tr(e,t,r,n){return Lr(e,Pr(e,t),r,n)}function Mr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[un(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Pr(e,t){var r=Ye(t),n=Mr(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,on(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=Ye(t=Dt(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var o=n.built=Xt(e,n);return n.text=o.pre,j(e.display.lineMeasure,o.pre),n}(e,t));var o=jr(n,t,r);return{line:t,view:n,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Lr(e,t,r,n,o){t.before&&(r=-1);var i,l=r+(n||"");return t.cache.hasOwnProperty(l)?i=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,o=n&&Sr(e);if(!t.measure.heights||n&&t.measure.width!=o){var i=t.measure.heights=[];if(n){t.measure.width=o;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-r.top)}}i.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,r,n){var o,i=_r(t.map,r,n),l=i.node,c=i.start,u=i.end,f=i.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;c&&ne(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&ne(t.line.text.charAt(i.coverStart+u));)++u;if((o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():Nr(O(l,c,u).getClientRects(),n)).left||o.right||0==c)break;u=c,c-=1,f="right"}a&&s<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Fe)return Fe;var t=j(e,T("span","x")),r=t.getBoundingClientRect(),n=O(t,0,1).getBoundingClientRect();return Fe=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,o))}else{var d;c>0&&(f=n="right"),o=e.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==n?d.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+nn(e.display),top:h.top,bottom:h.bottom}:Fr}for(var v=o.top-t.rect.top,m=o.bottom-t.rect.top,g=(v+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var x=b?y[b-1]:0,w=y[b],C={left:("right"==f?o.right:o.left)-t.rect.left,right:("left"==f?o.left:o.right)-t.rect.left,top:x,bottom:w};return o.left||o.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=v,C.rbottom=m),C}(e,t,r,n)).bogus||(t.cache[l]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var Ir,Fr={left:0,right:0,top:0,bottom:0};function _r(e,t,r){for(var n,o,i,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(o=0,i=1,a="left"):t<l?i=1+(o=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(n=e[c+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&o==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function Nr(e,t){var r=Fr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var o=e.length-1;o>=0&&(r=e[o]).left==r.right;o--);return r}function Rr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Dr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Rr(e.display.view[t])}function Vr(e){Dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Br(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ur(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function zr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=xr(e.widgets[r]));return t}function Wr(e,t,r,n,o){if(!o){var i=zr(t);r.top+=i,r.bottom+=i}if("line"==n)return r;n||(n="local");var a=Wt(t);if("local"==n?a+=Cr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==n?0:Ur());var l=s.left+("window"==n?0:Br());r.left+=l,r.right+=l}return r.top+=a,r.bottom+=a,r}function Hr(e,t,r){if("div"==r)return t;var n=t.left,o=t.top;if("page"==r)n-=Br(),o-=Ur();else if("local"==r||!r){var i=e.display.sizer.getBoundingClientRect();n+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:o-a.top}}function qr(e,t,r,n,o){return n||(n=Ge(e.doc,t.line)),Wr(e,n,Tr(e,n,t.ch,o),r)}function Gr(e,t,r,n,o,i){function a(t,a){var s=Lr(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,Wr(e,n,s,r)}n=n||Ge(e.doc,t.line),o||(o=Pr(e,n));var s=ce(n,e.doc.direction),l=t.ch,c=t.sticky;if(l>=n.text.length?(l=n.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var f=se(s,l,c),p=ae,d=u(l,f,"before"==c);return null!=p&&(d.other=u(l,p,"before"!=c)),d}function $r(e,t){var r=0;t=st(e.doc,t),e.options.lineWrapping||(r=nn(e.display)*t.ch);var n=Ge(e.doc,t.line),o=Wt(n)+Cr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function Kr(e,t,r,n,o){var i=et(e,t,r);return i.xRel=o,n&&(i.outside=n),i}function Jr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Kr(n.first,0,null,-1,-1);var o=Xe(n,r),i=n.first+n.size-1;if(o>i)return Kr(n.first+n.size-1,Ge(n,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ge(n,o);;){var s=Zr(e,a,o,t,r),l=Nt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=Ge(n,o=c.line)}}function Yr(e,t,r,n){n-=zr(t);var o=t.text.length,i=ie((function(t){return Lr(e,r,t-1).bottom<=n}),o,0);return{begin:i,end:o=ie((function(t){return Lr(e,r,t).top>n}),i,o)}}function Xr(e,t,r,n){return r||(r=Pr(e,t)),Yr(e,t,r,Wr(e,t,Lr(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Zr(e,t,r,n,o){o-=Wt(t);var i=Pr(e,t),a=zr(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?tn:en)(e,t,r,i,u,n,o);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var p,d,h=null,v=null,m=ie((function(t){var r=Lr(e,i,t);return r.top+=a,r.bottom+=a,!!Qr(r,n,o,!1)&&(r.top<=o&&r.left<=n&&(h=t,v=r),!0)}),s,l),g=!1;if(v){var y=n-v.left<v.right-n,b=y==c;m=h+(b?0:1),d=b?"after":"before",p=y?v.left:v.right}else{c||m!=l&&m!=s||m++,d=0==m?"after":m==t.text.length?"before":Lr(e,i,m-(c?1:0)).bottom+a<=o==c?"after":"before";var x=Gr(e,et(r,m,d),"line",t,i);p=x.left,g=o<x.top?-1:o>=x.bottom?1:0}return Kr(r,m=oe(t.text,m,1),d,g,n-p)}function en(e,t,r,n,o,i,a){var s=ie((function(s){var l=o[s],c=1!=l.level;return Qr(Gr(e,et(r,c?l.to:l.from,c?"before":"after"),"line",t,n),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=Gr(e,et(r,c?l.from:l.to,c?"after":"before"),"line",t,n);Qr(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function tn(e,t,r,n,o,i,a){var s=Yr(e,t,n,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,p=0;p<o.length;p++){var d=o[p];if(!(d.from>=c||d.to<=l)){var h=Lr(e,n,1!=d.level?Math.min(c,d.to)-1:Math.max(l,d.from)).right,v=h<i?i-h+1e9:h-i;(!u||f>v)&&(u=d,f=v)}}return u||(u=o[o.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(T("br"));Ir.appendChild(document.createTextNode("x"))}j(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),E(e.measure),r||1}function nn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),r=T("pre",[t],"CodeMirror-line-like");j(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function on(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=i.offsetLeft+i.clientLeft+o,n[s]=i.clientWidth}return{fixedPos:an(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function an(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sn(e){var t=rn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(o){if(Ut(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return r?i+(Math.ceil(o.text.length/n)||1)*t:i+t}}function ln(e){var t=e.doc,r=sn(e);t.iter((function(e){var t=r(e);t!=e.height&&Je(e,t)}))}function cn(e,t,r,n){var o=e.display;if(!r&&"true"==ke(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=Jr(e,i,a);if(n&&c.xRel>0&&(l=Ge(e.doc,c.line).text).length==c.ch){var u=D(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((i-Ar(e.display).left)/nn(e.display))-u))}return c}function un(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function fn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var o=e.display;if(n&&r<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Ct&&Vt(e.doc,t)<o.viewTo&&dn(e);else if(r<=o.viewFrom)Ct&&Bt(e.doc,r+n)>o.viewFrom?dn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)dn(e);else if(t<=o.viewFrom){var i=hn(e,r,r+n,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=n):dn(e)}else if(r>=o.viewTo){var a=hn(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):dn(e)}else{var s=hn(e,t,t,-1),l=hn(e,r,r+n,1);s&&l?(o.view=o.view.slice(0,s.index).concat(or(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=n):dn(e)}var c=o.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(o.externalMeasured=null))}function pn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var i=n.view[un(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==B(a,r)&&a.push(r)}}}function dn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hn(e,t,r,n){var o,i=un(e,t),a=e.display.view;if(!Ct||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(n>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,r+=o}for(;Vt(e.doc,r)!=r;){if(i==(n<0?0:a.length-1))return null;r+=n*a[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function vn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var o=t[n];o.hidden||o.node&&!o.changes||++r}return r}function mn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function gn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},o=n.cursors=document.createDocumentFragment(),i=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var s=r.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&yn(e,s.head,o),l||xn(e,s,i)}}return n}function yn(e,t,r){var n=Gr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(T("div"," ","CodeMirror-cursor"));if(o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var i=r.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));i.style.display="",i.style.left=n.other.left+"px",i.style.top=n.other.top+"px",i.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function bn(e,t){return e.top-t.top||e.left-t.left}function xn(e,t,r){var n=e.display,o=e.doc,i=document.createDocumentFragment(),a=Ar(e.display),s=a.left,l=Math.max(n.sizerWidth,Sr(e)-n.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?l-e:r)+"px;\n height: "+(n-t)+"px"))}function f(t,r,n){var i,a,f=Ge(o,t),p=f.text.length;function d(r,n){return qr(e,et(t,r),"div",f,n)}function h(t,r,n){var o=Xr(e,f,null,t),i="ltr"==r==("after"==n)?"left":"right";return d("after"==n?o.begin:o.end-(/\s/.test(f.text.charAt(o.end-1))?2:1),i)[i]}var v=ce(f,o.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",i),o=!0)}o||n(t,r,"ltr")}(v,r||0,null==n?p:n,(function(e,t,o,f){var m="ltr"==o,g=d(e,m?"left":"right"),y=d(t-1,m?"right":"left"),b=null==r&&0==e,x=null==n&&t==p,w=0==f,C=!v||f==v.length-1;if(y.top-g.top<=3){var k=(c?x:b)&&C,A=(c?b:x)&&w?s:(m?g:y).left,O=k?l:(m?y:g).right;u(A,g.top,O-A,g.bottom)}else{var S,E,j,T;m?(S=c&&b&&w?s:g.left,E=c?l:h(e,o,"before"),j=c?s:h(t,o,"after"),T=c&&x&&C?l:y.right):(S=c?h(e,o,"before"):s,E=!c&&b&&w?l:g.right,j=!c&&x&&C?s:y.left,T=c?h(t,o,"after"):l),u(S,g.top,E-S,g.bottom),g.bottom<y.top&&u(s,g.bottom,null,y.top),u(j,y.top,T-j,y.bottom)}(!i||bn(g,i)<0)&&(i=g),bn(y,i)<0&&(i=y),(!a||bn(g,a)<0)&&(a=g),bn(y,a)<0&&(a=y)})),{start:i,end:a}}var p=t.from(),d=t.to();if(p.line==d.line)f(p.line,p.ch,d.ch);else{var h=Ge(o,p.line),v=Ge(o,d.line),m=Dt(h)==Dt(v),g=f(p.line,p.ch,m?h.text.length+1:null).end,y=f(d.line,m?0:null,d.ch).start;m&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(s,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(s,g.bottom,null,y.top)}r.appendChild(i)}function wn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||On(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cn(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||An(e))}function kn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&On(e))}),100)}function An(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wn(e))}function On(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Sn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var o=t.view[n],i=e.options.lineWrapping,l=void 0,c=0;if(!o.hidden){if(a&&s<8){var u=o.node.offsetTop+o.node.offsetHeight;l=u-r,r=u}else{var f=o.node.getBoundingClientRect();l=f.bottom-f.top,!i&&o.text.firstChild&&(c=o.text.firstChild.getBoundingClientRect().right-f.left-1)}var p=o.line.height-l;if((p>.005||p<-.005)&&(Je(o.line,l),En(o.line),o.rest))for(var d=0;d<o.rest.length;d++)En(o.rest[d]);if(c>e.display.sizerWidth){var h=Math.ceil(c/nn(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}}function En(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function jn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Cr(e));var o=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,i=Xe(t,n),a=Xe(t,o);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<i?(i=s,a=Xe(t,Wt(Ge(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=Xe(t,Wt(Ge(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Tn(e,t){var r=e.display,n=rn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,i=Er(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+kr(r),l=t.top<n,c=t.bottom>s-n;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?s:t.bottom)-i);u!=o&&(a.scrollTop=u)}var f=e.options.fixedGutter?0:r.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-f,d=Sr(e)-r.gutters.offsetWidth,h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left+f-(h?0:10)):t.right>d+p-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function Mn(e,t){null!=t&&(In(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pn(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ln(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function In(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fn(e,$r(e,t.from),$r(e,t.to),t.margin))}function Fn(e,t,r,n){var o=Tn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ln(e,o.scrollLeft,o.scrollTop)}function _n(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||lo(e,{top:t}),Nn(e,t,!0),r&&lo(e),no(e,100))}function Nn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Rn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,fo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Or(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Vn=function(e,t,r){this.cm=r;var n=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),fe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),fe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Vn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vn.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},Vn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var o=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Vn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Bn=function(){};function Un(e,t){t||(t=Dn(e));var r=e.display.barWidth,n=e.display.barHeight;zn(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&Sn(e),zn(e,Dn(e)),r=e.display.barWidth,n=e.display.barHeight}function zn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Bn.prototype.update=function(){return{bottom:0,right:0}},Bn.prototype.setScrollLeft=function(){},Bn.prototype.setScrollTop=function(){},Bn.prototype.clear=function(){};var Wn={native:Vn,null:Bn};function Hn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Rn(e,t):_n(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var qn=0;function Gn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qn,markArrays:null},t=e.curOp,ir?ir.ops.push(t):t.ownsGroup=ir={ops:[t],delayedCallbacks:[]}}function $n(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var o=e.ops[n];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(r<t.length)}(r)}finally{ir=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Kn(t[r]);for(var n=0;n<t.length;n++)Jn(t[n]);for(var o=0;o<t.length;o++)Yn(t[o]);for(var i=0;i<t.length;i++)Xn(t[i]);for(var a=0;a<t.length;a++)Qn(t[a])}(e)}))}function Kn(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Or(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Or(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&qt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jn(e){e.updatedDisplay=e.mustUpdate&&ao(e.cm,e.update)}function Yn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Sn(t),e.barMeasure=Dn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Tr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Or(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Sr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Xn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Un(t,e.barMeasure),e.updatedDisplay&&uo(t,e.barMeasure),e.selectionChanged&&wn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Cn(e.cm)}function Qn(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&so(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Nn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Rn(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ve(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),o=null;if(t.top+n.top<0?o=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=T("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+Or(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,r,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var a=!1,s=Gr(e,t),l=r&&r!=t?Gr(e,r):s,c=Tn(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(_n(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Rn(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return o}(t,st(n,e.scrollToPos.from),st(n,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||he(o[a],"hide");if(i)for(var s=0;s<i.length;++s)i[s].lines.length&&he(i[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zn(e,t){if(e.curOp)return t();Gn(e);try{return t()}finally{$n(e)}}function eo(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gn(e);try{return t.apply(e,arguments)}finally{$n(e)}}}function to(e){return function(){if(this.curOp)return e.apply(this,arguments);Gn(this);try{return e.apply(this,arguments)}finally{$n(this)}}}function ro(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gn(t);try{return e.apply(this,arguments)}finally{$n(t)}}}function no(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,N(oo,e))}function oo(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=dt(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(n.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?ze(t.mode,n.state):null,l=ft(e,i,n,!0);s&&(n.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!f&&p<a.length;++p)f=a[p]!=i.styles[p];f&&o.push(n.line),i.stateAfter=n.save(),n.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ht(e,i.text,n),i.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return no(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Zn(e,(function(){for(var t=0;t<o.length;t++)pn(e,o[t],"text")}))}}var io=function(e,t,r){var n=e.display;this.viewport=t,this.visible=jn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Sr(e),this.force=r,this.dims=on(e),this.events=[]};function ao(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return dn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==vn(e))return!1;po(e)&&(dn(e),t.dims=on(e));var o=n.first+n.size,i=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFrom<i&&i-r.viewFrom<20&&(i=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),Ct&&(i=Vt(e.doc,i),a=Bt(e.doc,a));var s=i!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=or(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(un(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(or(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,un(e,r)))),n.viewTo=r}(e,i,a),r.viewOffset=Wt(Ge(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=vn(e);if(!s&&0==c&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=L();if(!t||!P(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&P(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return c>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,o=e.options.lineNumbers,i=n.lineDiv,a=i.firstChild;function s(t){var r=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var c=n.view,u=n.viewFrom,f=0;f<c.length;f++){var p=c[f];if(p.hidden);else if(p.node&&p.node.parentNode==i){for(;a!=p.node;)a=s(a);var d=o&&null!=t&&t<=u&&p.lineNumber;p.changes&&(B(p.changes,"gutter")>-1&&(d=!1),cr(e,p,u,r)),d&&(E(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Ze(e.options,u)))),a=p.node.nextSibling}else{var h=mr(e,p,u,r);i.insertBefore(h,a)}u+=p.size}for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(u),E(r.cursorDiv),E(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,no(e,400)),r.updateLineNumbers=null,!0}function so(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Sr(e))n&&(t.visible=jn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Er(e),r.top)}),t.visible=jn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ao(e,t))break;Sn(e);var o=Dn(e);mn(e),Un(e,o),uo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function lo(e,t){var r=new io(e,t);if(ao(e,r)){Sn(e),so(e,r);var n=Dn(e);mn(e),Un(e,n),uo(e,n),r.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",sr(e,"gutterChanged",e)}function uo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Or(e)+"px"}function fo(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=an(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=i),r[a].gutterBackground&&(r[a].gutterBackground.style.left=i));var s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=n+o+"px")}}function po(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Ze(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var o=n.measure.appendChild(T("div",[T("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(i,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",co(e.display),!0}return!1}function ho(e,t){for(var r=[],n=!1,o=0;o<e.length;o++){var i=e[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;n=!0}r.push({className:i,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function vo(e){var t=e.gutters,r=e.gutterSpecs;E(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var o=r[n],i=o.className,a=o.style,s=t.appendChild(T("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",co(e)}function mo(e){vo(e.display),fn(e),fo(e)}function go(e,t,n,o){var i=this;this.input=n,i.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=M("div",null,"CodeMirror-code"),i.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=T("div",null,"CodeMirror-cursors"),i.measure=T("div",null,"CodeMirror-measure"),i.lineMeasure=T("div",null,"CodeMirror-measure"),i.lineSpace=M("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=M("div",[i.lineSpace],"CodeMirror-lines");i.mover=T("div",[c],null,"position: relative"),i.sizer=T("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),i.gutters=T("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=T("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=T("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||r&&g||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=ho(o.gutters,o.lineNumbers),vo(i),n.init(i)}io.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var yo=0,bo=null;function xo(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function wo(e){var t=xo(e);return t.x*=bo,t.y*=bo,t}function Co(e,t){var n=xo(t),o=n.x,i=n.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(o&&c||i&&u){if(i&&y&&l)e:for(var p=t.target,d=a.view;p!=s;p=p.parentNode)for(var h=0;h<d.length;h++)if(d[h].node==p){e.display.currentWheelTarget=p;break e}if(o&&!r&&!f&&null!=bo)return i&&u&&_n(e,Math.max(0,s.scrollTop+i*bo)),Rn(e,Math.max(0,s.scrollLeft+o*bo)),(!i||i&&u)&&be(t),void(a.wheelStartX=null);if(i&&null!=bo){var v=i*bo,m=e.doc.scrollTop,g=m+a.wrapper.clientHeight;v<0?m=Math.max(0,m+v-50):g=Math.min(e.doc.height,g+v+50),lo(e,{top:m,bottom:g})}yo<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=o,a.wheelDY=i,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,r=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,r&&(bo=(bo*yo+r)/(yo+1),++yo)}}),200)):(a.wheelDX+=o,a.wheelDY+=i))}}a?bo=-.53:r?bo=15:u?bo=-.7:p&&(bo=-1/3);var ko=function(e,t){this.ranges=e,this.primIndex=t};ko.prototype.primary=function(){return this.ranges[this.primIndex]},ko.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!rt(r.anchor,n.anchor)||!rt(r.head,n.head))return!1}return!0},ko.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ao(nt(this.ranges[t].anchor),nt(this.ranges[t].head));return new ko(e,this.primIndex)},ko.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ko.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(tt(t,n.from())>=0&&tt(e,n.to())<=0)return r}return-1};var Ao=function(e,t){this.anchor=e,this.head=t};function Oo(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort((function(e,t){return tt(e.from(),t.from())})),r=B(t,o);for(var i=1;i<t.length;i++){var a=t[i],s=t[i-1],l=tt(s.to(),a.from());if(n&&!a.empty()?l>0:l>=0){var c=it(s.from(),a.from()),u=ot(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;i<=r&&--r,t.splice(--i,2,new Ao(f?u:c,f?c:u))}}return new ko(t,r)}function So(e,t){return new ko([new Ao(e,t||e)],0)}function Eo(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function jo(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Eo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Eo(t).ch-t.to.ch),et(r,n)}function To(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var o=e.sel.ranges[n];r.push(new Ao(jo(o.anchor,t),jo(o.head,t)))}return Oo(e.cm,r,e.sel.primIndex)}function Mo(e,t,r){return e.line==t.line?et(r.line,e.ch-t.ch+r.ch):et(r.line+(e.line-t.line),e.ch)}function Po(e){e.doc.mode=Ve(e.options,e.doc.modeOption),Lo(e)}function Lo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,no(e,100),e.state.modeGen++,e.curOp&&fn(e)}function Io(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fo(e,t,r,n){function o(e){return r?r[e]:null}function i(e,r,o){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),jt(e),Tt(e,r);var o=n?n(e):1;o!=e.height&&Je(e,o)}(e,r,o,n),sr(e,"change",e,t)}function a(e,t){for(var r=[],i=e;i<t;++i)r.push(new Gt(c[i],o(i),n));return r}var s=t.from,l=t.to,c=t.text,u=Ge(e,s.line),f=Ge(e,l.line),p=K(c),d=o(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Io(e,t)){var v=a(0,c.length-1);i(f,f.text,d),h&&e.remove(s.line,h),v.length&&e.insert(s.line,v)}else if(u==f)if(1==c.length)i(u,u.text.slice(0,s.ch)+p+u.text.slice(l.ch),d);else{var m=a(1,c.length-1);m.push(new Gt(p+u.text.slice(l.ch),d,n)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,m)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),o(0)),e.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(f,p+f.text.slice(l.ch),d);var g=a(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}sr(e,"change",e,t)}function _o(e,t,r){!function e(n,o,i){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;r&&!l||(t(s.doc,l),e(s.doc,n,l))}}}(e,null,!0)}function No(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ln(e),Po(e),Ro(e),e.options.direction=t.direction,e.options.lineWrapping||qt(e),e.options.mode=t.modeOption,fn(e)}function Ro(e){("rtl"==e.doc.direction?I:S)(e.display.lineDiv,"CodeMirror-rtl")}function Do(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Vo(e,t){var r={from:nt(t.from),to:Eo(t),text:$e(e,t.from,t.to)};return Ho(e,r,t.from.line,t.to.line+1),_o(e,(function(e){return Ho(e,r,t.from.line,t.to.line+1)}),!0),r}function Bo(e){for(;e.length&&K(e).ranges;)e.pop()}function Uo(e,t,r,n){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Bo(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(o,o.lastOp==n)))a=K(i.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Eo(t):i.changes.push(Vo(e,t));else{var l=K(o.done);for(l&&l.ranges||Wo(e.sel,o.done),i={changes:[Vo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,a||he(e,"historyAdded")}function zo(e,t,r,n){var o=e.history,i=n&&n.origin;r==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,r,n){var o=t.charAt(0);return"*"==o||"+"==o&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,K(o.done),t))?o.done[o.done.length-1]=t:Wo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=r,n&&!1!==n.clearRedo&&Bo(o.undone)}function Wo(e,t){var r=K(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ho(e,t,r,n){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=r.markedSpans),++i}))}function qo(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Go(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],o=0;o<t.text.length;++o)n.push(qo(r[o]));return n}(e,t),n=St(e,t);if(!r)return n;if(!n)return r;for(var o=0;o<r.length;++o){var i=r[o],a=n[o];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue e;i.push(l)}else a&&(r[o]=a)}return r}function $o(e,t,r){for(var n=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)n.push(r?ko.prototype.deepCopy.call(i):i);else{var a=i.changes,s=[];n.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(K(s)[f]=c[f],delete c[f])}}}return n}function Ko(e,t,r,n){if(n){var o=e.anchor;if(r){var i=tt(t,o)<0;i!=tt(r,o)<0?(o=t,t=r):i!=tt(t,r)<0&&(t=r)}return new Ao(o,t)}return new Ao(r||t,t)}function Jo(e,t,r,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ei(e,new ko([Ko(e.sel.primary(),t,r,o)],0),n)}function Yo(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)n[i]=Ko(e.sel.ranges[i],t[i],null,o);ei(e,Oo(e.cm,n,e.sel.primIndex),r)}function Xo(e,t,r,n){var o=e.sel.ranges.slice(0);o[t]=r,ei(e,Oo(e.cm,o,e.sel.primIndex),n)}function Qo(e,t,r,n){ei(e,So(t,r),n)}function Zo(e,t,r){var n=e.history.done,o=K(n);o&&o.ranges?(n[n.length-1]=t,ti(e,t,r)):ei(e,t,r)}function ei(e,t,r){ti(e,t,r),zo(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ti(e,t,r){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Ao(st(e,t[r].anchor),st(e,t[r].head))},origin:r&&r.origin};return he(e,"beforeSelectionChange",e,n),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Oo(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ri(e,oi(e,t,n,!0)),r&&!1===r.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Pn(e.cm)}function ri(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,me(e.cm)),sr(e,"cursorActivity",e))}function ni(e){ri(e,oi(e,e.sel,null,!1))}function oi(e,t,r,n){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=ai(e,a.anchor,s&&s.anchor,r,n),c=ai(e,a.head,s&&s.head,r,n);(o||l!=a.anchor||c!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new Ao(l,c))}return o?Oo(e.cm,o,t.primIndex):t}function ii(e,t,r,n,o){var i=Ge(e,t.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(o&&(he(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var f=l.find(n<0?1:-1),p=void 0;if((n<0?u:c)&&(f=si(e,f,-n,f&&f.line==t.line?i:null)),f&&f.line==t.line&&(p=tt(f,r))&&(n<0?p<0:p>0))return ii(e,f,t,n,o)}var d=l.find(n<0?-1:1);return(n<0?c:u)&&(d=si(e,d,n,d.line==t.line?i:null)),d?ii(e,d,t,n,o):null}}return t}function ai(e,t,r,n,o){var i=n||1,a=ii(e,t,r,i,o)||!o&&ii(e,t,r,i,!0)||ii(e,t,r,-i,o)||!o&&ii(e,t,r,-i,!0);return a||(e.cantEdit=!0,et(e.first,0))}function si(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:r>0&&t.ch==(n||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+r)}function li(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),z)}function ci(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,o,i){t&&(n.from=st(e,t)),r&&(n.to=st(e,r)),o&&(n.text=o),void 0!==i&&(n.origin=i)}),he(e,"beforeChange",e,n),e.cm&&he(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ui(e,t,r){if(e.cm){if(!e.cm.curOp)return eo(e.cm,ui)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))||(t=ci(e,t,!0))){var n=wt&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var o=[{from:t,to:r}],i=0;i<n.length;++i)for(var a=n[i],s=a.find(0),l=0;l<o.length;++l){var c=o[l];if(!(tt(c.to,s.from)<0||tt(c.from,s.to)>0)){var u=[l,1],f=tt(c.from,s.from),p=tt(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)fi(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else fi(e,t)}}function fi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var r=To(e,t);Uo(e,t,r,e.cm?e.cm.curOp.id:NaN),hi(e,t,r,St(e,t));var n=[];_o(e,(function(e,r){r||-1!=B(n,e.history)||(yi(e.history,t),n.push(e.history)),hi(e,t,null,St(e,t))}))}}function pi(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,c=0;c<s.length&&(o=s[c],r?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=s.pop()).ranges){if(n)return void s.push(o);break}if(Wo(o,l),r&&!o.equals(e.sel))return void ei(e,o,{clearRedo:!1});a=o}var u=[];Wo(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var f=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),p=function(r){var n=o.changes[r];if(n.origin=t,f&&!ci(e,n,!1))return s.length=0,{};u.push(Vo(e,n));var i=r?To(e,n):K(s);hi(e,n,i,Go(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:Eo(n)});var a=[];_o(e,(function(e,t){t||-1!=B(a,e.history)||(yi(e.history,n),a.push(e.history)),hi(e,n,null,Go(e,n))}))},d=o.changes.length-1;d>=0;--d){var h=p(d);if(h)return h.v}}}}function di(e,t){if(0!=t&&(e.first+=t,e.sel=new ko(J(e.sel.ranges,(function(e){return new Ao(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)pn(e.cm,n,"gutter")}}function hi(e,t,r,n){if(e.cm&&!e.cm.curOp)return eo(e.cm,hi)(e,t,r,n);if(t.to.line<e.first)di(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);di(e,o),t={from:et(e.first,0),to:et(t.to.line+o,t.to.ch),text:[K(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:et(i,Ge(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$e(e,t.from,t.to),r||(r=To(e,t)),e.cm?function(e,t,r){var n=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Ye(Dt(Ge(n,i.line))),n.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&me(e),Fo(n,t,r,sn(e)),e.options.lineWrapping||(n.iter(l,i.line+t.text.length,(function(e){var t=Ht(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var o=Ge(e,n).stateAfter;if(o&&(!(o instanceof ct)||n+o.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,i.line),no(e,400);var c=t.text.length-(a.line-i.line)-1;t.full?fn(e):i.line!=a.line||1!=t.text.length||Io(e.doc,t)?fn(e,i.line,a.line+1,c):pn(e,i.line,"text");var u=ge(e,"changes"),f=ge(e,"change");if(f||u){var p={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&sr(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}(e.cm,t,n):Fo(e,t,n),ti(e,r,z),e.cantEdit&&ai(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function vi(e,t,r,n,o){var i;n||(n=r),tt(n,r)<0&&(r=(i=[n,r])[0],n=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ui(e,{from:r,to:n,text:t,origin:o})}function mi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function gi(e,t,r,n){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)mi(i.ranges[s].anchor,t,r,n),mi(i.ranges[s].head,t,r,n)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(r<c.from.line)c.from=et(c.from.line+n,c.from.ch),c.to=et(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function yi(e,t){var r=t.from.line,n=t.to.line,o=t.text.length-(n-r)-1;gi(e.done,r,n,o),gi(e.undone,r,n,o)}function bi(e,t,r,n){var o=t,i=t;return"number"==typeof t?i=Ge(e,at(e,t)):o=Ye(t),null==o?null:(n(i,o)&&e.cm&&pn(e.cm,o,r),i)}function xi(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function wi(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var o=e[n];t+=o.chunkSize(),r+=o.height,o.parent=this}this.size=t,this.height=r,this.parent=null}Ao.prototype.from=function(){return it(this.anchor,this.head)},Ao.prototype.to=function(){return ot(this.anchor,this.head)},Ao.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},xi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var o=this.lines[r];this.height-=o.height,$t(o),sr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},wi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var i=Math.min(t,o-e),a=n.height;if(n.removeInner(e,i),this.height-=a-n.height,o==i&&(this.children.splice(r--,1),n.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xi))){var s=[];this.collapse(s),this.children=[new xi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var o=this.children[n],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new xi(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++n,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wi(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new wi(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var o=this.children[n],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var Ci=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function ki(e,t,r){Wt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Mn(e,r)}Ci.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Ye(r);if(null!=n&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(r.widgets=null);var i=xr(this);Je(r,Math.max(0,r.height-i)),e&&(Zn(e,(function(){ki(e,r,-i),pn(e,n,"widget")})),sr(e,"lineWidgetCleared",e,this,n))}},Ci.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var o=xr(this)-t;o&&(Ut(this.doc,n)||Je(n,n.height+o),r&&Zn(r,(function(){r.curOp.forceUpdate=!0,ki(r,n,o),sr(r,"lineWidgetChanged",r,e,Ye(n))})))},ye(Ci);var Ai=0,Oi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ai};function Si(e,t,r,n,o){if(n&&n.shared)return function(e,t,r,n,o){(n=R(n)).shared=!1;var i=[Si(e,t,r,n,o)],a=i[0],s=n.widgetNode;return _o(e,(function(e){s&&(n.widgetNode=s.cloneNode(!0)),i.push(Si(e,st(e,t),st(e,r),n,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=K(i)})),new Ei(i,a)}(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return eo(e.cm,Si)(e,t,r,n,o);var i=new Oi(e,o),a=tt(t,r);if(n&&R(n,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=M("span",[i.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Rt(e,t.line,t,r,i)||t.line!=r.line&&Rt(e,r.line,t,r,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}i.addToHistory&&Uo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,r.line+1,(function(n){c&&i.collapsed&&!c.options.lineWrapping&&Dt(n)==c.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Je(n,0),function(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}(n,new kt(i,l==t.line?t.ch:null,l==r.line?r.ch:null),e.cm&&e.cm.curOp),++l})),i.collapsed&&e.iter(t.line,r.line+1,(function(t){Ut(e,t)&&Je(t,0)})),i.clearOnEnter&&fe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Ai,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)fn(c,t.line,r.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=r.line;u++)pn(c,u,"text");i.atomic&&ni(c.doc),sr(c,"markerAdded",c,i)}return i}Oi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gn(e),ge(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=At(a.markedSpans,this);e&&!this.collapsed?pn(e,Ye(a),"text"):e&&(null!=s.to&&(o=Ye(a)),null!=s.from&&(n=Ye(a))),a.markedSpans=Ot(a.markedSpans,s),null==s.from&&this.collapsed&&!Ut(this.doc,a)&&e&&Je(a,rn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Dt(this.lines[l]),u=Ht(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&fn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ni(e.doc)),e&&sr(e,"markerCleared",e,this,n,o),t&&$n(e),this.parent&&this.parent.clear()}},Oi.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=At(i.markedSpans,this);if(null!=a.from&&(r=et(t?i:Ye(i),a.from),-1==e))return r;if(null!=a.to&&(n=et(t?i:Ye(i),a.to),1==e))return n}return r&&{from:r,to:n}},Oi.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Zn(n,(function(){var o=t.line,i=Ye(t.line),a=Mr(n,i);if(a&&(Rr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ut(r.doc,o)&&null!=r.height){var s=r.height;r.height=null;var l=xr(r)-s;l&&Je(o,o.height+l)}sr(n,"markerChanged",n,e)}))},Oi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Oi.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Oi);var Ei=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ji(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ti(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];_o(r.primary.doc,(function(e){return n.push(e)}));for(var o=0;o<r.markers.length;o++){var i=r.markers[o];-1==B(n,i.doc)&&(i.parent=null,r.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}Ei.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},Ei.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Ei);var Mi=0,Pi=function(e,t,r,n,o){if(!(this instanceof Pi))return new Pi(e,t,r,n,o);null==r&&(r=0),wi.call(this,[new xi([new Gt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var i=et(r,0);this.sel=So(i),this.history=new Do(null),this.id=++Mi,this.modeOption=t,this.lineSep=n,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Fo(this,{from:i,to:i,text:e}),ei(this,So(i),z)};Pi.prototype=X(wi.prototype,{constructor:Pi,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ro((function(e){var t=et(this.first,0),r=this.first+this.size-1;ui(this,{from:t,to:et(r,Ge(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ln(this.cm,0,0),ei(this,So(t),z)})),replaceRange:function(e,t,r,n){vi(this,e,t=st(this,t),r=r?st(this,r):t,n)},getRange:function(e,t,r){var n=$e(this,st(this,e),st(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ge(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),Dt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ro((function(e,t,r){Qo(this,st(this,"number"==typeof e?et(e,t||0):e),null,r)})),setSelection:ro((function(e,t,r){Qo(this,st(this,e),st(this,t||e),r)})),extendSelection:ro((function(e,t,r){Jo(this,st(this,e),t&&st(this,t),r)})),extendSelections:ro((function(e,t){Yo(this,lt(this,e),t)})),extendSelectionsBy:ro((function(e,t){Yo(this,lt(this,J(this.sel.ranges,e)),t)})),setSelections:ro((function(e,t,r){if(e.length){for(var n=[],o=0;o<e.length;o++)n[o]=new Ao(st(this,e[o].anchor),st(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ei(this,Oo(this.cm,n,t),r)}})),addSelection:ro((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ao(st(this,e),st(this,t||e))),ei(this,Oo(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var o=$e(this,r[n].from(),r[n].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var o=$e(this,r[n].from(),r[n].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[n]=o}return t},replaceSelection:function(e,t,r){for(var n=[],o=0;o<this.sel.ranges.length;o++)n[o]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ro((function(e,t,r){for(var n=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];n[i]={from:a.from(),to:a.to(),text:this.splitLines(e[i]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],o=et(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=Mo(s.from,o,i),c=Mo(Eo(s),o,i);if(o=s.to,i=c,"around"==r){var u=e.sel.ranges[a],f=tt(u.head,u.anchor)<0;n[a]=new Ao(f?c:l,f?l:c)}else n[a]=new Ao(l,l)}return new ko(n,e.sel.primIndex)}(this,n,t),l=n.length-1;l>=0;l--)ui(this,n[l]);s?Zo(this,s):this.cm&&Pn(this.cm)})),undo:ro((function(){pi(this,"undo")})),redo:ro((function(){pi(this,"redo")})),undoSelection:ro((function(){pi(this,"undo",!0)})),redoSelection:ro((function(){pi(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Do(this.history),_o(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:$o(this.history.done),undone:$o(this.history.undone)}},setHistory:function(e){var t=this.history=new Do(this.history);t.done=$o(e.done.slice(0),null,!0),t.undone=$o(e.undone.slice(0),null,!0)},setGutterMarker:ro((function(e,t,r){return bi(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&te(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ro((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&bi(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Ye(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ro((function(e,t,r){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(A(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:ro((function(e,t,r){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[n];if(!o)return!1;if(null==r)e[n]=null;else{var i=o.match(A(r));if(!i)return!1;var a=i.index+i[0].length;e[n]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:ro((function(e,t,r){return function(e,t,r,n){var o=new Ci(e,r,n),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),bi(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==o.insertAt?r.push(o):r.splice(Math.min(r.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!Ut(e,t)){var n=Wt(t)<e.scrollTop;Je(t,t.height+xr(o)),n&&Mn(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&sr(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Ye(t)),o}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Si(this,st(this,e),st(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Si(this,e=st(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Ge(this,(e=st(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var o=r[n];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=st(this,e),t=st(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++o})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+n;if(i>e)return t=e,!0;e-=i,++r})),st(this,et(r,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Pi(Ke(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Pi(Ke(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],o=n.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(tt(i,a)){var s=Si(e,i,a,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,ji(this)),n},unlinkDoc:function(e){if(e instanceof Ea&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ti(ji(this));break}if(e.history==this.history){var r=[e.id];_o(e,(function(e){return r.push(e.id)}),!0),e.history=new Do(null),e.history.done=$o(this.history.done,r),e.history.undone=$o(this.history.undone,r)}},iterLinkedDocs:function(e){_o(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Pe(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ro((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Zn(t=this.cm,(function(){Ro(t),fn(t)})))}))}),Pi.prototype.eachLine=Pi.prototype.iter;var Li=0;function Ii(e){var t=this;if(Fi(t),!ve(t,e)&&!wr(t.display,e)){be(e),a&&(Li=+new Date);var r=cn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,i=Array(o),s=0,l=function(){++s==o&&eo(t,(function(){var e={from:r=st(t.doc,r),to:r,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ui(t.doc,e),Zo(t.doc,So(st(t.doc,r),st(t.doc,Eo(e))))}))()},c=function(e,r){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[r]=e),l()},n.readAsText(e)}},u=0;u<n.length;u++)c(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ti(t.doc,So(r,r)),p)for(var d=0;d<p.length;++d)vi(t.doc,"",p[d].anchor,p[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Fi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _i(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var o=t[n].CodeMirror;o&&r.push(o)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Ni=!1;function Ri(){var e;Ni||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_i(Di)}),100))})),fe(window,"blur",(function(){return _i(On)})),Ni=!0)}function Di(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Bi=0;Bi<10;Bi++)Vi[Bi+48]=Vi[Bi+96]=String(Bi);for(var Ui=65;Ui<=90;Ui++)Vi[Ui]=String.fromCharCode(Ui);for(var zi=1;zi<=12;zi++)Vi[zi+111]=Vi[zi+63235]="F"+zi;var Wi={};function Hi(e){var t,r,n,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function qi(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var o=J(r.split(" "),Hi),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=n):(s=o.slice(0,i+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Gi(e,t,r,n){var o=(t=Yi(t)).call?t.call(e,n):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&r(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Gi(e,t.fallthrough,r,n);for(var i=0;i<t.fallthrough.length;i++){var a=Gi(e,t.fallthrough[i],r,n);if(a)return a}}}function $i(e){var t="string"==typeof e?e:Vi[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ki(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Ji(e,t){if(f&&34==e.keyCode&&e.char)return!1;var r=Vi[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Ki(r,e,t))}function Yi(e){return"string"==typeof e?Wi[e]:e}function Xi(e,t){for(var r=e.doc.sel.ranges,n=[],o=0;o<r.length;o++){for(var i=t(r[o]);n.length&&tt(i.from,K(n).to)<=0;){var a=n.pop();if(tt(a.from,i.from)<0){i.from=a.from;break}}n.push(i)}Zn(e,(function(){for(var t=n.length-1;t>=0;t--)vi(e.doc,"",n[t].from,n[t].to,"+delete");Pn(e)}))}function Qi(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Zi(e,t,r){var n=Qi(e,t.ch,r);return null==n?null:new et(t.line,n,r<0?"after":"before")}function ea(e,t,r,n,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(r,t.doc.direction);if(i){var a,s=o<0?K(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Pr(t,r);a=o<0?r.text.length-1:0;var u=Lr(t,c,a).top;a=ie((function(e){return Lr(t,c,e).top==u}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Qi(r,a,1))}else a=o<0?s.to:s.from;return new et(n,a,l)}}return new et(n,o<0?r.text.length:0,o<0?"before":"after")}Wi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wi.default=y?Wi.macDefault:Wi.pcDefault;var ta={selectAll:li,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Xi(e,(function(t){if(t.empty()){var r=Ge(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Xi(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Xi(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Xi(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Xi(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Ge(e.doc,t),n=function(e){for(var t;t=_t(e);)e=t.find(1,!0).line;return e}(r);return n!=r&&(t=Ye(n)),ea(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),H)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),H)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?na(e,t.head):n}),H)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,o=0;o<r.length;o++){var i=r[o].from(),a=D(e.getLine(i.line),i.ch,n);t.push($(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zn(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var o=t[n].head,i=Ge(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new et(o.line,o.ch-1)),o.ch>0)o=new et(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ge(e.doc,o.line-1).text;a&&(o=new et(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(o.line-1,a.length-1),o,"+transpose"))}r.push(new Ao(o,o))}e.setSelections(r)}))},newlineAndIndent:function(e){return Zn(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Pn(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ra(e,t){var r=Ge(e.doc,t),n=Dt(r);return n!=r&&(t=Ye(n)),ea(!0,e,n,t,1)}function na(e,t){var r=ra(e,t.line),n=Ge(e.doc,r.line),o=ce(n,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(r.ch,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=i&&t.ch;return et(r.line,a?0:i,r.sticky)}return r}function oa(e,t,r){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),o=t(e)!=U}finally{e.display.shift=n,e.state.suppressEdits=!1}return o}var ia=new V;function aa(e,t,r,n){var o=e.state.keySeq;if(o){if($i(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ia.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,o+" "+t,r,n))return!0}return sa(e,t,r,n)}function sa(e,t,r,n){var o=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var o=Gi(t,e.state.keyMaps[n],r,e);if(o)return o}return e.options.extraKeys&&Gi(t,e.options.extraKeys,r,e)||Gi(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&sr(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(be(r),wn(e)),!!o}function la(e,t){var r=Ji(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+r,t,(function(t){return oa(e,t,!0)}))||aa(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return oa(e,t)})):aa(e,r,t,(function(t){return oa(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=L(),ve(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var o=la(t,e);f&&(ca=o?n:null,o||88!=n||Ie||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),r&&!y&&!o&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),de(document,"keyup",r),de(document,"mouseover",r))}I(t,"CodeMirror-crosshair"),fe(document,"keyup",r),fe(document,"mouseover",r)}(t)}}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ve(this,e)}function pa(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||wr(t.display,e)||ve(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(f&&r==ca)return ca=null,void be(e);if(!f||e.which&&!(e.which<10)||!la(t,e)){var o=String.fromCharCode(null==n?r:n);"\b"!=o&&(function(e,t,r){return aa(e,"'"+r+"'",t,(function(t){return oa(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var da,ha,va=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ma(e){var t=this,r=t.display;if(!(ve(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,wr(r,e))l||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!ba(t,e)){var n=cn(t,e),o=Ae(e),i=n?function(e,t){var r=+new Date;return ha&&ha.compare(r,e,t)?(da=ha=null,"triple"):da&&da.compare(r,e,t)?(ha=new va(r,e,t),da=null,"double"):(da=new va(r,e,t),ha=null,"single")}(n,o):"single";window.focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,o){var i="Click";return"double"==n?i="Double"+i:"triple"==n&&(i="Triple"+i),aa(e,Ki(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=U}finally{e.state.suppressEdits=!1}return n}))}(t,o,n,i,e)||(1==o?n?function(e,t,r,n){a?setTimeout(N(Cn,e),0):e.curOp.focus=L();var o,i=function(e,t,r){var n=e.getOption("configureMouse"),o=n?n(e,t,r):{};if(null==o.unit){var i=b?r.shiftKey&&r.metaKey:r.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||r.shiftKey),null==o.addNew&&(o.addNew=y?r.metaKey:r.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(y?r.altKey:r.ctrlKey)),o}(e,r,n),c=e.doc.sel;e.options.dragDrop&&Ee&&!e.isReadOnly()&&"single"==r&&(o=c.contains(t))>-1&&(tt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(tt(o.to(),t)>0||t.xRel<0)?function(e,t,r,n){var o=e.display,i=!1,c=eo(e,(function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:kn(e)),de(o.wrapper.ownerDocument,"mouseup",c),de(o.wrapper.ownerDocument,"mousemove",u),de(o.scroller,"dragstart",f),de(o.scroller,"drop",c),i||(be(t),n.addNew||Jo(e.doc,r,null,null,n.extend),l&&!p||a&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!n.moveOnDrag,fe(o.wrapper.ownerDocument,"mouseup",c),fe(o.wrapper.ownerDocument,"mousemove",u),fe(o.scroller,"dragstart",f),fe(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,n,t,i):function(e,t,r,n){a&&kn(e);var o=e.display,i=e.doc;be(t);var s,l,c=i.sel,u=c.ranges;if(n.addNew&&!n.extend?(l=i.sel.contains(r),s=l>-1?u[l]:new Ao(r,r)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new Ao(r,r)),r=cn(e,t,!0,!0),l=-1;else{var f=ga(e,r,n.unit);s=n.extend?Ko(s,f.anchor,f.head,n.extend):f}n.addNew?-1==l?(l=u.length,ei(i,Oo(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==n.unit&&!n.extend?(ei(i,Oo(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Xo(i,l,s,W):(l=0,ei(i,new ko([s],0),W),c=i.sel);var p=r;function d(t){if(0!=tt(p,t))if(p=t,"rectangle"==n.unit){for(var o=[],a=e.options.tabSize,u=D(Ge(i,r.line).text,r.ch,a),f=D(Ge(i,t.line).text,t.ch,a),d=Math.min(u,f),h=Math.max(u,f),v=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));v<=m;v++){var g=Ge(i,v).text,y=q(g,d,a);d==h?o.push(new Ao(et(v,y),et(v,y))):g.length>y&&o.push(new Ao(et(v,y),et(v,q(g,h,a))))}o.length||o.push(new Ao(r,r)),ei(i,Oo(e,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,w=ga(e,t,n.unit),C=x.anchor;tt(w.anchor,C)>0?(b=w.head,C=it(x.from(),w.anchor)):(b=w.anchor,C=ot(x.to(),w.head));var k=c.ranges.slice(0);k[l]=function(e,t){var r=t.anchor,n=t.head,o=Ge(e.doc,r.line);if(0==tt(r,n)&&r.sticky==n.sticky)return t;var i=ce(o);if(!i)return t;var a=se(i,r.ch,r.sticky),s=i[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,c=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(i,n.ch,n.sticky),f=u-a||(n.ch-r.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var p=i[c+(l?-1:0)],d=l==(1==p.level),h=d?p.from:p.to,v=d?"after":"before";return r.ch==h&&r.sticky==v?t:new Ao(new et(r.line,h,v),n)}(e,new Ao(st(i,C),b)),ei(i,Oo(e,k,l),W)}}var h=o.wrapper.getBoundingClientRect(),v=0;function m(t){e.state.selectingText=!1,v=1/0,t&&(be(t),o.input.focus()),de(o.wrapper.ownerDocument,"mousemove",g),de(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var g=eo(e,(function(t){0!==t.buttons&&Ae(t)?function t(r){var a=++v,s=cn(e,r,!0,"rectangle"==n.unit);if(s)if(0!=tt(s,p)){e.curOp.focus=L(),d(s);var l=jn(o,i);(s.line>=l.to||s.line<l.from)&&setTimeout(eo(e,(function(){v==a&&t(r)})),150)}else{var c=r.clientY<h.top?-20:r.clientY>h.bottom?20:0;c&&setTimeout(eo(e,(function(){v==a&&(o.scroller.scrollTop+=c,t(r))})),50)}}(t):m(t)})),y=eo(e,m);e.state.selectingText=y,fe(o.wrapper.ownerDocument,"mousemove",g),fe(o.wrapper.ownerDocument,"mouseup",y)}(e,n,t,i)}(t,n,i,e):ke(e)==r.scroller&&be(e):2==o?(n&&Jo(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==o&&(k?t.display.input.onContextMenu(e):kn(t)))}}function ga(e,t,r){if("char"==r)return new Ao(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ao(et(t.line,0),st(e.doc,et(t.line+1,0)));var n=r(e,t);return new Ao(n.from,n.to)}function ya(e,t,r,n){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ge(e,r))return we(t);i-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o)return he(e,r,e,Xe(e.doc,i),e.display.gutterSpecs[l].className,t),we(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function xa(e,t){wr(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||ve(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vr(e)}va.prototype.compare=function(e,t,r){return this.time+400>e&&0==tt(t,this.pos)&&r==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},ka={},Aa={};function Oa(e,t,r){if(!t!=!(r&&r!=Ca)){var n=e.display.dragFunctions,o=t?fe:de;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Sa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),qt(e)),ln(e),fn(e),Vr(e),setTimeout((function(){return Un(e)}),100)}function Ea(e,t){var r=this;if(!(this instanceof Ea))return new Ea(e,t);this.options=t=t?R(t):{},R(ka,t,!1);var n=t.value;"string"==typeof n?n=new Pi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Ea.inputStyles[t.inputStyle](this),i=this.display=new go(e,n,o,t);for(var c in i.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new V,keySeq:null,specialChars:null},t.autofocus&&!g&&i.input.focus(),a&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",eo(e,ma)),fe(t.scroller,"dblclick",a&&s<11?eo(e,(function(t){if(!ve(e,t)){var r=cn(e,t);if(r&&!ba(e,t)&&!wr(e.display,t)){be(t);var n=e.findWordAt(r);Jo(e.doc,n.anchor,n.head)}}})):function(t){return ve(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return xa(e,t)})),fe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||xa(e,r)}));var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}fe(t.scroller,"touchstart",(function(o){if(!ve(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!ba(e,o)){t.input.ensurePolled(),clearTimeout(r);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!wr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!n.prev||i(n,n.prev)?new Ao(s,s):!n.prev.prev||i(n,n.prev.prev)?e.findWordAt(s):new Ao(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(r)}o()})),fe(t.scroller,"touchcancel",o),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(_n(e,t.scroller.scrollTop),Rn(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return Co(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return Co(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||Ce(t)},over:function(t){ve(e,t)||(function(e,t){var r=cn(e,t);if(r){var n=document.createDocumentFragment();yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),j(e.display.dragCursor,n)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Li<100))Ce(t);else if(!ve(e,t)&&!wr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var r=T("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}(e,t)},drop:eo(e,Ii),leave:function(t){ve(e,t)||Fi(e)}};var l=t.input.getField();fe(l,"keyup",(function(t){return fa.call(e,t)})),fe(l,"keydown",eo(e,ua)),fe(l,"keypress",eo(e,pa)),fe(l,"focus",(function(t){return An(e,t)})),fe(l,"blur",(function(t){return On(e,t)}))}(this),Ri(),Gn(this),this.curOp.forceUpdate=!0,No(this,n),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&An(r)}),20):On(this),Aa)Aa.hasOwnProperty(c)&&Aa[c](this,t[c],Ca);po(this),t.finishInit&&t.finishInit(this);for(var u=0;u<ja.length;++u)ja[u](this);$n(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}Ea.defaults=ka,Ea.optionHandlers=Aa;var ja=[];function Ta(e,t,r,n){var o,i=e.doc;null==r&&(r="add"),"smart"==r&&(i.mode.indent?o=dt(e,t).state:r="prev");var a=e.options.tabSize,s=Ge(i,t),l=D(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((c=i.mode.indent(o,s.text.slice(u.length),s.text))==U||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>i.first?D(Ge(i,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var f="",p=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)p+=a,f+="\t";if(p<c&&(f+=$(c-p)),f!=u)return vi(i,f,et(t,0),et(t,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var v=i.sel.ranges[h];if(v.head.line==t&&v.head.ch<u.length){var m=et(t,u.length);Xo(i,h,new Ao(m,m));break}}}Ea.defineInitHook=function(e){return ja.push(e)};var Ma=null;function Pa(e){Ma=e}function La(e,t,r,n,o){var i=e.doc;e.display.shift=!1,n||(n=i.sel);var a=+new Date-200,s="paste"==o||e.state.pasteIncoming>a,l=Pe(t),c=null;if(s&&n.ranges.length>1)if(Ma&&Ma.text.join("\n")==t){if(n.ranges.length%Ma.text.length==0){c=[];for(var u=0;u<Ma.text.length;u++)c.push(i.splitLines(Ma.text[u]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=J(l,(function(e){return[e]})));for(var f=e.curOp.updateInput,p=n.ranges.length-1;p>=0;p--){var d=n.ranges[p],h=d.from(),v=d.to();d.empty()&&(r&&r>0?h=et(h.line,h.ch-r):e.state.overwrite&&!s?v=et(v.line,Math.min(Ge(i,v.line).text.length,v.ch+K(l).length)):s&&Ma&&Ma.lineWise&&Ma.text.join("\n")==l.join("\n")&&(h=v=et(h.line,0)));var m={from:h,to:v,text:c?c[p%c.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ui(e.doc,m),sr(e,"inputRead",e,m)}t&&!s&&Fa(e,t),Pn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zn(t,(function(){return La(t,r,0,null,"paste")})),!0}function Fa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(!(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=Ta(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ge(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Ta(e,o.head.line,"smart"));a&&sr(e,"electricInput",e,o.head.line)}}}function _a(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,i={anchor:et(o,0),head:et(o+1,0)};r.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:r}}function Na(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ra(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),Na(e),t}function Da(e,t,r,n,o){var i=t,a=r,s=Ge(e,t.line),l=o&&"rtl"==e.direction?-r:r;function c(i){var a,c;if("codepoint"==n){var u=s.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(u))a=null;else{var f=r>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(f?2:1))),-r)}}else a=o?function(e,t,r,n){var o=ce(t,e.doc.direction);if(!o)return Zi(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var i=se(o,r.ch,r.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Zi(t,r,n);var s,l=function(e,r){return Qi(t,e instanceof et?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(s=s||Pr(e,t),Xr(e,t,s,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?l(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==n<0,p=l(r,f?1:-1);if(null!=p&&(f?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var d=f?"before":"after";return new et(r.line,p,d)}}var h=function(e,t,n){for(var i=function(e,t){return t?new et(r.line,l(e,1),"before"):new et(r.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>0==(1!=a.level),c=s?n.begin:l(n.end,-1);if(a.from<=c&&c<a.to)return i(c,s);if(c=s?a.from:l(a.to,-1),n.begin<=c&&c<n.end)return i(c,s)}},v=h(i+n,n,u);if(v)return v;var m=n>0?u.end:l(u.begin,-1);return null==m||n>0&&m==t.text.length||!(v=h(n>0?0:o.length-1,n,c(m)))?null:v}(e.cm,s,t,r):Zi(s,t,r);if(null==a){if(i||(c=t.line+l)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ge(e,c))))return!1;t=ea(o,e.cm,s,t.line,l)}else t=a;return!0}if("char"==n||"codepoint"==n)c();else if("column"==n)c(!0);else if("word"==n||"group"==n)for(var u=null,f="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||c(!d);d=!1){var h=s.text.charAt(t.ch)||"\n",v=ee(h,p)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||d||v||(v="s"),u&&u!=v){r<0&&(r=1,c(),t.sticky="after");break}if(v&&(u=v),r>0&&!c(!d))break}var m=ai(e,t,i,a,!0);return rt(i,m)&&(m.hitSide=!0),m}function Va(e,t,r,n){var o,i,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*rn(e.display),3);o=(r>0?t.bottom:t.top)+r*c}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(i=Jr(e,s,o)).outside;){if(r<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*r}return i}var Ba=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(e,t){var r=Mr(e,t.line);if(!r||r.hidden)return null;var n=Ge(e.doc,t.line),o=jr(r,n,t.line),i=ce(n,e.doc.direction),a="left";i&&(a=se(i,t.ch)%2?"right":"left");var s=_r(o.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function za(e,t){return t&&(e.bad=!0),e}function Wa(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return za(e.clipPos(et(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==n)return Ha(i,t,r)}}function Ha(e,t,r){var n=e.text.firstChild,o=!1;if(!t||!P(n,t))return za(et(Ye(e.line),0),!0);if(t==n&&(o=!0,t=n.childNodes[r],r=0,!t)){var i=e.rest?K(e.rest):e.line;return za(et(Ye(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,r,n){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==t||s==r){var u=Ye(o<0?e.line:e.rest[o]),f=i[a]+n;return(n<0||s!=t)&&(f=i[a+(n?1:0)]),et(u,f)}}}var f=u(a,s,r);if(f)return za(f,o);for(var p=s.nextSibling,d=a?a.nodeValue.length-r:0;p;p=p.nextSibling){if(f=u(p,p.firstChild,0))return za(et(f.line,f.ch-d),o);d+=p.textContent.length}for(var h=s.previousSibling,v=r;h;h=h.previousSibling){if(f=u(h,h.firstChild,-1))return za(et(f.line,f.ch+v),o);v+=h.textContent.length}}Ba.prototype.init=function(e){var t=this,r=this,n=r.cm,o=r.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(i(e)&&!ve(n,e)){if(n.somethingSelected())Pa({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=_a(n);Pa({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,z),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ma.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ra(),l=s.firstChild;n.display.lineSpace.insertBefore(s,n.display.lineSpace.firstChild),l.value=Ma.text.join("\n");var c=L();_(l),setTimeout((function(){n.display.lineSpace.removeChild(s),c.focus(),c==o&&r.showPrimarySelection()}),50)}}o.contentEditable=!0,Na(o,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),fe(o,"paste",(function(e){!i(e)||ve(n,e)||Ia(e,n)||s<=11&&setTimeout(eo(n,(function(){return t.updateFromDOM()})),20)})),fe(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(o,"touchstart",(function(){return r.forceCompositionEnd()})),fe(o,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(o,"copy",a),fe(o,"cut",a)},Ba.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ba.prototype.prepareSelection=function(){var e=gn(this.cm,!1);return e.focus=L()==this.div,e},Ba.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ba.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ba.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),o=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=Wa(t,e.anchorNode,e.anchorOffset),s=Wa(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(it(a,s),o)||0!=tt(ot(a,s),i)){var l=t.display.view,c=o.line>=t.display.viewFrom&&Ua(t,o)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Ua(t,i);if(!u){var f=l[l.length-1].measure,p=f.maps?f.maps[f.maps.length-1]:f.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(c&&u){var d,h=e.rangeCount&&e.getRangeAt(0);try{d=O(c.node,c.offset,u.offset,u.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(c.node,c.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),h&&null==e.anchorNode?e.addRange(h):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ba.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ba.prototype.showMultipleSelections=function(e){j(this.cm.display.cursorDiv,e.cursors),j(this.cm.display.selectionDiv,e.selection)},Ba.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ba.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},Ba.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&L()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ba.prototype.blur=function(){this.div.blur()},Ba.prototype.getField=function(){return this.div},Ba.prototype.supportsTouch=function(){return!0},Ba.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zn(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ba.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ba.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Wa(t,e.anchorNode,e.anchorOffset),n=Wa(t,e.focusNode,e.focusOffset);r&&n&&Zn(t,(function(){ei(t.doc,So(r,n),z),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ba.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,o=n.display,i=n.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>n.firstLine()&&(a=et(a.line-1,Ge(n.doc,a.line-1).length)),s.ch==Ge(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=et(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=un(n,a.line))?(t=Ye(o.view[0].line),r=o.view[0].node):(t=Ye(o.view[e].line),r=o.view[e-1].node.nextSibling);var l,c,u=un(n,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Ye(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(e){e&&(c(),i+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void u(r);var i,p=t.getAttribute("cm-marker");if(p){var d=e.findMarks(et(n,0),et(o+1,0),(m=+p,function(e){return e.id==m}));return void(d.length&&(i=d[0].find(0))&&u($e(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var v=0;v<t.childNodes.length;v++)f(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),h&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;f(t),t!=r;)t=t.nextSibling,l=!1;return i}(n,r,c,t,l)),p=$e(n.doc,et(t,0),et(l,Ge(n.doc,l).text.length));f.length>1&&p.length>1;)if(K(f)==K(p))f.pop(),p.pop(),l--;else{if(f[0]!=p[0])break;f.shift(),p.shift(),t++}for(var d=0,h=0,v=f[0],m=p[0],g=Math.min(v.length,m.length);d<g&&v.charCodeAt(d)==m.charCodeAt(d);)++d;for(var y=K(f),b=K(p),x=Math.min(y.length-(1==f.length?d:0),b.length-(1==p.length?d:0));h<x&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==f.length&&1==p.length&&t==a.line)for(;d&&d>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;f[f.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var w=et(t,d),C=et(l,p.length?K(p).length-h:0);return f.length>1||f[0]||tt(w,C)?(vi(n.doc,f,w,C,"+input"),!0):void 0},Ba.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ba.prototype.reset=function(){this.forceCompositionEnd()},Ba.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ba.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ba.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zn(this.cm,(function(){return fn(e.cm)}))},Ba.prototype.setUneditable=function(e){e.contentEditable="false"},Ba.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||eo(this.cm,La)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ba.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ba.prototype.onContextMenu=function(){},Ba.prototype.resetPosition=function(){},Ba.prototype.needsContentAttribute=!0;var qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!ve(n,e)){if(n.somethingSelected())Pa({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=_a(n);Pa({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,z):(r.prevInput="",o.value=t.text.join("\n"),_(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(o.style.width="0px"),fe(o,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),fe(o,"paste",(function(e){ve(n,e)||Ia(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),fe(o,"cut",i),fe(o,"copy",i),fe(e.scroller,"paste",(function(t){if(!wr(e,t)&&!ve(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),fe(e.lineSpace,"selectstart",(function(t){wr(e,t)||be(t)})),fe(o,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(o,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},qa.prototype.createField=function(e){this.wrapper=Ra(),this.textarea=this.wrapper.firstChild},qa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=gn(e);if(e.options.moveInputWithCursor){var o=Gr(e,r.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return n},qa.prototype.showSelection=function(e){var t=this.cm.display;j(t.cursorDiv,e.cursors),j(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&_(this.textarea),a&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},qa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},qa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Le(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(n.length,o.length);l<c&&n.charCodeAt(l)==o.charCodeAt(l);)++l;return Zn(t,(function(){La(t,o.slice(l),n.length-l,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cn(r,e),c=n.scroller.scrollTop;if(i&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(i)&&eo(r,ei)(r.doc,So(i),z);var u,p=o.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),n.input.focus(),l&&window.scrollTo(null,u),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&s>=9&&m(),k){Ce(e);var v=function(){de(window,"mouseup",v),setTimeout(g,20)};fe(window,"mouseup",v)}else setTimeout(g,50)}function m(){if(null!=o.selectionStart){var e=r.somethingSelected(),i="​"+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=i.length,n.selForContextMenu=r.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,o.style.cssText=p,a&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&m();var e=0,i=function(){n.selForContextMenu==r.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?eo(r,li)(r):e++<10?n.detectingSelectAll=setTimeout(i,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(i,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,o,i){e.defaults[r]=n,o&&(t[r]=i?function(e,t,r){r!=Ca&&o(e,t,r)}:o)}e.defineOption=r,e.Init=Ca,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Po(e)}),!0),r("indentUnit",2,Po,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Lo(e),Vr(e),fn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,r.push(et(n,i))}n++}));for(var o=r.length-1;o>=0;o--)vi(e.doc,t,r[o],et(r[o].line,r[o].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ca&&e.refresh()})),r("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!x),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){wa(e),mo(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Yi(t),o=r!=Ca&&Yi(r);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Sa,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=ho(t,e.options.lineNumbers),mo(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?an(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Un(e)}),!0),r("scrollbarStyle","native",(function(e){Hn(e),Un(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=ho(e.options.gutters,t),mo(e)}),!0),r("firstLineNumber",1,mo,!0),r("lineNumberFormatter",(function(e){return e}),mo,!0),r("showCursorWhenSelecting",!1,mn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(On(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Oa),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,mn,!0),r("singleCursorHeightPerLine",!0,mn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Lo,!0),r("addModeClass",!1,Lo,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Lo,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Ea),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,o=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&eo(this,t[e])(this,r,o),he(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:to((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,o=r(t);n<e.length&&r(e[n])<=o;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,fn(this)})),removeOverlay:to((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void fn(this)}})),indentLine:to((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ta(this,e,t,r)})),indentSelection:to((function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var o=t[n];if(o.empty())o.head.line>r&&(Ta(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&Pn(this));else{var i=o.from(),a=o.to(),s=Math.max(r,i.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<r;++l)Ta(this,l,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[n].from().ch>0&&Xo(this.doc,n,new Ao(i,c[n].to()),z)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,r=pt(this,Ge(this.doc,e.line)),n=0,o=(r.length-1)/2,i=e.ch;if(0==i)t=r[2];else for(;;){var a=n+o>>1;if((a?r[2*a-1]:0)>=i)o=a;else{if(!(r[2*a+1]<i)){t=r[2*a+2];break}n=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var o=r[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&n.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][a]];s&&n.push(s)}else i.helperType&&o[i.helperType]?n.push(o[i.helperType]):o[i.name]&&n.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==B(n,c.val)&&n.push(c.val)}return n},getStateAfter:function(e,t){var r=this.doc;return dt(this,(e=at(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Gr(this,null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return qr(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Jr(this,(e=Hr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Hr(this,{top:e,left:0},t||"page").top,Xe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),n=Ge(this.doc,e)}else n=e;return Wr(this,n,{top:0,left:0},t||"page",r||o).top+(o?this.doc.height-Wt(n):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,o){var i,a,s,l=this.display,c=(e=Gr(this,st(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>p&&(u=p-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(i=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Tn(i,a)).scrollTop&&_n(i,s.scrollTop),null!=s.scrollLeft&&Rn(i,s.scrollLeft))},triggerOnKeyDown:to(ua),triggerOnKeyPress:to(pa),triggerOnKeyUp:fa,triggerOnMouseDown:to(ma),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:to((function(e){Fa(this,e)})),findPosH:function(e,t,r,n){var o=1;t<0&&(o=-1,t=-t);for(var i=st(this.doc,e),a=0;a<t&&!(i=Da(this.doc,i,o,r,n)).hitSide;++a);return i},moveH:to((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Da(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),H)})),deleteH:to((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Xi(this,(function(r){var o=Da(n,r.head,e,t,!1);return e<0?{from:o,to:r.head}:{from:r.head,to:o}}))})),findPosV:function(e,t,r,n){var o=1,i=n;t<0&&(o=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var l=Gr(this,a,"div");if(null==i?i=l.left:l.left=i,(a=Va(this,l,o,r)).hitSide)break}return a},moveV:to((function(e,t){var r=this,n=this.doc,o=[],i=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(i)return e<0?a.from():a.to();var s=Gr(r,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=Va(r,s,e,t);return"page"==t&&a==n.sel.primary()&&Mn(r,qr(r,l,"div").top-s.top),l}),H),o.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var i=t.charAt(r),a=ee(i,o)?function(e){return ee(e,o)}:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new Ao(et(e.line,r),et(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:to((function(e,t){Ln(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Or(this)-this.display.barHeight,width:e.scrollWidth-Or(this)-this.display.barWidth,clientHeight:Er(this),clientWidth:Sr(this)}},scrollIntoView:to((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){In(e),e.curOp.scrollToPos=t}(this,e):Fn(this,e.from,e.to,e.margin)})),setSize:to((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Dr(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){pn(r,o,"widget");break}++o})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Zn(this,e)},startOperation:function(){return Gn(this)},endOperation:function(){return $n(this)},refresh:to((function(){var e=this.display.cachedTextHeight;fn(this),this.curOp.forceUpdate=!0,Vr(this),Ln(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(null==e||Math.abs(e-rn(this.display))>.5||this.options.lineWrapping)&&ln(this),he(this,"refresh",this)})),swapDoc:to((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),No(this,e),Vr(this),this.display.input.reset(),Ln(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,n,o){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=o},e.registerGlobalHelper=function(t,n,o,i){e.registerHelper(t,n,i),r[t]._global.push({pred:o,val:i})}}(Ea);var Ga="iter insert remove copy getEditor constructor".split(" ");for(var $a in Pi.prototype)Pi.prototype.hasOwnProperty($a)&&B(Ga,$a)<0&&(Ea.prototype[$a]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pi.prototype[$a]));return ye(Pi),Ea.inputStyles={textarea:qa,contenteditable:Ba},Ea.defineMode=function(e){Ea.defaults.mode||"null"==e||(Ea.defaults.mode=e),Re.apply(this,arguments)},Ea.defineMIME=function(e,t){Ne[e]=t},Ea.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ea.defineMIME("text/plain","null"),Ea.defineExtension=function(e,t){Ea.prototype[e]=t},Ea.defineDocExtension=function(e,t){Pi.prototype[e]=t},Ea.fromTextArea=function(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=L();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(fe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){n(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Ea((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=de,e.on=fe,e.wheelEventPixels=wo,e.Doc=Pi,e.splitLines=Pe,e.countColumn=D,e.findColumn=q,e.isWordChar=Z,e.Pass=U,e.signal=he,e.Line=Gt,e.changeEnd=Eo,e.scrollbarModel=Wn,e.Pos=et,e.cmpPos=tt,e.modes=_e,e.mimeModes=Ne,e.resolveMode=De,e.getMode=Ve,e.modeExtensions=Be,e.extendMode=Ue,e.copyState=ze,e.startState=He,e.innerMode=We,e.commands=ta,e.keyMap=Wi,e.keyName=Ji,e.isModifierKey=$i,e.lookupKey=Gi,e.normalizeKeyMap=qi,e.StringStream=qe,e.SharedTextMarker=Ei,e.TextMarker=Oi,e.LineWidget=Ci,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=Ce,e.addClass=I,e.contains=P,e.rmClass=S,e.keyNames=Vi}(Ea),Ea.version="5.61.1",Ea}()},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return He})),r.d(t,"b",(function(){return de})),r.d(t,"c",(function(){return fe}));var n=r(0),o=r.n(n);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function v(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p(e);if(t){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return v(this,r)}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var w=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(t){function r(e,t){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t[Math.abs(r)%t.length]}function n(e,t){var r=t.namespace;if(t.useColors){var n=t.color,o=" ".concat("[3"+(n<8?n:"8;5;"+n),";1m").concat(r," ");e[0]=o+e[0].split("\n").join("\n"+o)}else e[0]=r+" "+e[0]}function o(e,t){if(e[0]=(t.useColors?"%c":"")+t.namespace,t.useColors){var r="color: "+t.color,n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))})),e.splice(o,0,r)}}var i=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];e&&o.unshift(e);var a=t.namespaces.split(",").map((function(e){return"*"===e[e.length-1]?new RegExp("^"+e.slice(0,e.length-1)+".*$"):new RegExp("^"+e+"$")}));a.some((function(t){return t.test(e)})),r(e,t.colors),t.useColors}}void 0===e||"renderer"===e.type||!0===e.browser||e.__nwjs?t.exports=function(t){return a(t,function(){var t;try{t=localStorage.getItem("debug")}catch(e){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),{namespaces:t||"",colors:i,useColors:!0,formatArgs:o}}())}:t.exports=function(t){return a(t,{namespaces:e.env.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:n})}})),C=w("informed:ObjMap\t"),k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String.prototype.replace.call(e,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n=String.prototype.replace.call(t,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e);return void 0===n||n===e?r:n},O=function(e){return".".concat(e).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},S=function(e,t){var r=O(t),n=function(e){return e.replace(O(e),"").replace(/\./,"")}(t),o=r?A(e,r):e;return!(!o||!Object.hasOwnProperty.call(o,n.replace(/\[(.*)\]/,"$1")))},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(t,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,t,n,o){return n===o.length-1?(e[t]=r,e[t]):void 0===e[t]?(Number.isInteger(+o[n+1])?e[t]=[]:e[t]={},e[t]):(Number.isInteger(+o[n+1])&&!Array.isArray(e[t])&&(e[t]=[]),e[t])}),e)},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=!1;return String.prototype.replace.call(t,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,t,n,o){return void 0===e?e:n===o.length-1?(delete e[t],r=!0,e[t]):e[t]}),e),r},T=function(e){var t=k(e);return Number.isInteger(+t[t.length-1])},M=function(){function e(){i(this,e)}return s(e,null,[{key:"empty",value:function(e){return 0===function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e);return t.map((function(t){return e[t]}))}(e).length}},{key:"get",value:function(e,t){return A(e,t)}},{key:"has",value:function(e,t){return S(e,t)}},{key:"set",value:function(t,r,n){if(void 0!==n)C("SETTING",r,n),E(t,r,n);else if(T(r)&&void 0!==e.get(t,r)){C("Special case SETTING",r,"to undefined"),E(t,r,void 0);var o=k(r);P(t,o=o.slice(0,o.length-1))}else T(r)||void 0===e.get(t,r)||(C("Special case REMOVING",r,"from object completley"),e.delete(t,r))}},{key:"delete",value:function(e,t){C("DELETE",t),T(t)?(C("ARRAY",t),this.pullOut(e,t)):j(e,t);var r=k(t);P(e,r=r.slice(0,r.length-1))}},{key:"pullOut",value:function(e,t){var r=k(t),n=r[r.length-1];r=r.slice(0,r.length-1),C("Pulling out:",r,"index",n);var o=A(e,r);C("Array",o),Array.isArray(o)&&function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,r,n,o){return void 0===e?e:n===o.length-1&&Array.isArray(e)?(t=e.splice(r,1),e[r]):e[r]}),e)}(o,n),P(e,r)}}]),e}();function P(e,t){if(0!==t.length){var r=A(e,t);(Array.isArray(r)?r.every((function(e){return null==e})):"{}"===JSON.stringify(r))&&j(e,t),P(e,t.slice(0,t.length-1))}}var L=o.a.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),I=o.a.createContext({}),F=o.a.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),_=o.a.createContext(),N=o.a.createContext(),R=o.a.createContext(),D=o.a.createContext(),V=o.a.createContext(),B=o.a.createContext();function U(){return Object(n.useContext)(F)}function z(e){var t=Object(n.useRef)(),r=Object(n.useRef)(!0),o=g(Object(n.useState)(e),2),i=o[0],a=o[1];t.current=i;return Object(n.useEffect)((function(){return function(){r.current=!1}}),[]),[i,function(e){t.current=e,r.current&&a(e)},function(){return t.current}]}var W=function(e){return e.type&&e.type.name?e.type.name:e.displayName||e.name||"Component"},H=function(e){var t={};if(e.inner){if(0===e.inner.length)return void M.set(t,e.path,e.message);var r,n=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=b(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e.inner);try{for(n.s();!(r=n.n()).done;){var o=r.value;M.get(t,o.path)||M.set(t,o.path,o.message)}}catch(o){n.e(o)}finally{n.f()}}return t},q=function(e,t){try{e.validateSync(t,{abortEarly:!1})}catch(e){return H(e)}},G=function(e){if(e.inner){if(0===e.inner.length)return;return e.inner[0].message}},$=function(e,t){try{e.validateSync(t,{abortEarly:!1})}catch(e){return G(e)}},K=function(e,t){e(t);var r={};return e.errors&&e.errors.forEach((function(e){var t=e.message,n=e.dataPath,o=e.keyword,i=e.params,a=n;"required"===o&&(a="".concat(a,".").concat(i.missingProperty)),a=a.replace(".",""),M.set(r,a,t)})),r},J=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},Y=function(e,t,r){var n=t["ui:control"],o=t["informed:props"],i=t["input:props"],a=t["ui:before"],s=t["ui:after"],l=t.oneOf,c=t.items,u=t.enum,p=t.title,d=t.minimum,h=t.maximum,v=t.minLength,m=t.maxLength,g=t.pattern,y=t.type,b=t.properties,x=J();i&&i.id&&(x=i.id);var w={componentType:n,field:r?"".concat(r,".").concat(e):e,type:y,uiBefore:a,uiAfter:s,properties:"object"===y?b:void 0,items:"array"===y?c:void 0,props:f(f({label:p,id:x,min:d,max:h,minLength:v,maxLength:m,pattern:g},o),i)};if(l){var C=t.oneOf.map((function(e){var t=e["input:props"],r=void 0===t?{}:t;return f({value:e.const,label:e.title},r)}));w.props.options=C}if(u){var k=t.enum.map((function(e){return{value:e,label:e}}));w.props.options=k}if(c&&c.oneOf){var A=c.oneOf.map((function(e){var t=e["input:props"],r=void 0===t?{}:t;return f({value:e.const,label:e.title},r)}));w.props.options=A}return w},X=function(e,t,r){if(!e||t)return[];var n=e.properties,o=void 0===n?{}:n,i=e.allOf,a=e.propertyOrder,s=void 0===a?[]:a;if(Object.keys(o).length>0){var l=Object.keys(o).sort((function(e,t){var r=s.indexOf(e),n=s.indexOf(t);return(r>-1?r:s.length+1)-(n>-1?n:s.length+1)})).map((function(e){var t=o[e];return Y(e,t,r)}));return i&&l.push({componentType:"conditionals",allOf:i}),l}return[]},Q=function(e,t){if(!e)return{val:e,offset:0};var r="".concat(e),n=function(e,t){if("string"==typeof e)return e.split("").map((function(e){return"#"===e?/\d/:"*"===e?/[\w]/:e}));if("function"==typeof e)return e(t);if(Array.isArray(e))return e;throw new Error("Formatter must be string, array, or function")}(t,r),o=n.findIndex((function(e){return"string"!=typeof e})),i=n.length-y(n).reverse().findIndex((function(e){return"string"!=typeof e})),a=[],s=r.split(""),l=0,c=0,u=function(e,t){for(var r=0,n=-1,o=!0;o&&r<e.length;)e[r]==t[r]?n=r:o=!1,r+=1;return n}(n.slice(0,o),s.slice(0,o));u>-1&&(l=u+1,a=a.concat(n.slice(0,u+1)),c=u+1),u<0&&(a=a.concat(n.slice(0,o)),c=o);for(var f=c;f<n.length;f++){var p=n[f];if(l!=s.length){var d=s[l];if("function"==typeof p)a.push(p(d)),l+=1;else{var h="string"==typeof p?p===d:p.test(d);h&&"string"==typeof p?(a.push(p),l+=1):h||"string"!=typeof p?h&&"string"!=typeof p?(a.push(d),l+=1):h||"string"==typeof p||(l+=1,f-=1):l!=s.length&&a.push(p)}}else{if(!("string"==typeof p&&f>=i))break;a.push(p)}}return{value:a.join(""),offset:r?a.length-r.length:0}},Z="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect,ee=function(e){var t=e.value,r=e.inputRef,n=e.maintainCursor,o=void 0===n||n,i=g(z(0),3),a=i[0],s=i[1],l=i[2],c=g(z(0),3),u=c[0],f=c[1],p=c[2];return Z((function(){if(null!=r.current&&l()){var e=l()+p();0!=p()&&o?r.current.setSelectionRange(e+1,e+1):o&&r.current.setSelectionRange(e,e)}}),[t]),{setCursorOffset:f,setCursor:s,cursor:a,getCursor:l,cursorOffset:u}},te=function(e,t){var r=Object(n.useRef)(!0),o=r.current;Object(n.useEffect)((function(){if(!o)return e();r.current=!1}),t)},re=w("informed:useField\t"),ne=function(e,t,r,n,o){if(null!=e)return o?o(e):t?t(e):r&&!n?Q(e,r).value:e},oe=function(e,t,r,n){return t&&r?t(e):n?Q(e,n).value:e},ie=function(e,t,r){var n=r.required;return e||t?function(r,n){return t?$(t,r):e?e(r,n):void 0}:n?function(e){return ue(e,n)}:void 0},ae=function(e){var t=e.fieldType,r=e.setValue,n=e.onChange,o=e.multiple,i=e.ref,a=function(e){return r(e)};return"text"!==t&&"textArea"!==t&&"number"!==t||(a=function(e){return r(e.target.value,e)}),"select"===t&&(a=function(){var e=Array.from(i.current).filter((function(e){return e.selected})).map((function(e){return e.value}));r(o?e:e[0]||"")}),"checkbox"===t&&(a=function(e){r(e.target.checked),n&&n(e)}),function(e){a(e)}},se=function(e){var t=e.setTouched,r=e.onBlur;return function(e){t(!0),r&&r(e)}},le=function(e){var t=e.fieldType,r=e.maskedValue,n=e.multiple,o=e.value;switch(t){case"text":case"number":return r||0===r?r:"";case"textArea":return r||"";case"select":return o||(n?[]:"");case"checkbox":return!!o;default:return o}},ce=function(e){switch(e){case"text":case"number":case"checkbox":return e;default:return}},ue=function(e,t){if(t&&(null==e||""===e))return"string"==typeof t?t:"This field is required"};function fe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=e.field,i=e.validate,a=e.asyncValidate,s=e.validationSchema,l=e.mask,c=e.maskWithCursorOffset,u=e.format,p=e.parse,d=e.formatter,v=e.parser,m=e.initialValue,b=e.validateOnChange,x=e.validateOnBlur,w=e.validateOnMount,C=e.asyncValidateOnBlur,k=e.maskOnBlur,A=e.allowEmptyString,O=e.onValueChange,S=e.notify,E=e.keepState,j=e.maintainCursor,T=e.debug,P=e.shadow,I=e.step,F=e.fieldType,_=e.multiple,N=e.onChange,R=e.onBlur,D=e.formController,V=e.relevant,W=e.required,H=e.keepStateIfRelevant,q=e.initialize,G=e.formatterDependencies,$=void 0===G?[]:G,K=h(e,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),Y=Object(n.useState)(J()),X=g(Y,1),ue=X[0],fe=Object(n.useContext)(L),pe=Object(n.useContext)(B),de=pe||H,he=U(),ve=Object(n.useRef)(),me=Object(n.useRef)(!0),ge=Object(n.useRef)(),ye=Object(n.useRef)(!1),be=function(){return!ye.current},xe=function(){return ye.current};D&&(fe=D.updater,he=D.getFormApi());var we,Ce,ke=ie(i,s,{required:W}),Ae=Object(n.useState)((function(){return fe.getInitialValue(r)})),Oe=g(Ae,1),Se=Oe[0],Ee=fe.getSavedValue(r);(E||de)&&Ee?(re("Setting field ".concat(kt,"'s kept state"),Ee),we=Ee.value,Ce=Ee.touched,he.removeSavedState(kt)):we=null!=m?m:Se;var je=z(ne(we,l,d,v,q)),Te=g(je,3),Me=Te[0],Pe=Te[1],Le=Te[2],Ie=z(w?ke(Me):void 0),Fe=g(Ie,3),_e=Fe[0],Ne=Fe[1],Re=Fe[2],De=z(Ce),Ve=g(De,3),Be=Ve[0],Ue=Ve[1],ze=Ve[2],We=Object(n.useState)((function(){return oe(Me,u,p,d)})),He=g(We,2),qe=He[0],Ge=He[1],$e=Object(n.useRef)();$e.current=qe;var Ke=Object(n.useRef)(m),Je=Object(n.useRef)(r),Ye=Object(n.useRef)();Ke.current=m,Je.current=r;var Xe=Object(n.useRef)(null),Qe=o.a.useMemo((function(){return t||Xe}),[]),Ze=ee({value:Me,inputRef:Qe,maintainCursor:!!j}),et=Ze.getCursor,tt=Ze.setCursor,rt=Ze.setCursorOffset,nt=function(){return!0},ot=function(e){var t=V||nt,r=he.getFullField(Je.current)||Je.current,n={path:r,parentPath:r.replace(/(.*)[.[].*/,"$1"),get:function(e,t){return M.get(e,t)}};return pe&&pe.relevant?t(e,n)&&pe.relevant(e,n):t(e,n)},it=z(ot(he.getValues())),at=g(it,3),st=at[0],lt=at[1],ct=at[2],ut=function(e){return!pe||!pe.relevant||pe.relevant(e)},ft=function(){var e=ot(he.getValues());return e!=ct()&&lt(e),e};Object(n.useEffect)((function(){st||E||ve.current.reset()}),[st]);var pt=function(){return P?he.getDerrivedValue(r):Le()},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preventUpdate;I&&he.getStep()<I?(re("Setting ".concat(r,"'s error to undefined as we are not at that step")),Ne(void 0),fe.setError(ue,void 0,!n)):(re("Setting ".concat(r,"'s error to ").concat(e)),Ne(e),fe.setError(ue,e,!n))},ht=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t;ye.current=!0,re("Setting ".concat(r," to ").concat(i)),q&&(i=q(i));var a=he.getOptions(),s=i;if(""!==i||A||o.allowEmptyString||a.allowEmptyStrings||(i=void 0),"number"!==e.type&&"number"!==F||void 0===i||(i=+i),n&&n.target&&n.target.selectionStart&&tt(n.target.selectionStart),l&&!k&&(s=l(i,et()),i=l(i,et())),c&&!k){var f=c(i,et());s=f.value,i=f.value,rt(f.offset)}if(u&&p&&(i=p(i),s=u(i)),d){var h=Q(i,d);rt(h.offset),i=s=h.value}v&&(i=null!=i?v(i):i),ke&&b&&!o.initial&&(re("Validating after change ".concat(r," ").concat(i)),dt(ke(i,he.getValues()))),Pe(i),Ge(s),O&&O(i),fe.setValue(ue,i,!o.preventUpdate)};te((function(){ve.current.setValue($e.current)}),y($));var vt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.preventUpdate;if(re("Field ".concat(r," has been touched")),ke&&x&&!t&&e&&(re("Validating after blur ".concat(r," ").concat(pt())),dt(ke(pt(),he.getValues()))),a&&C&&!t&&e&&(re("Validating async after blur ".concat(r," ").concat(pt())),a(pt(),he.getValues())),l&&k){var i=l(pt());Pe(i),Ge(i),O&&O(i),fe.setValue(ue,i,!o)}if(c&&k){var s=c(pt());rt(s.offset),Pe(s.value),Ge(s.value),O&&O(s.value),fe.setValue(ue,s.value,!o)}Ue(e),fe.setTouched(ue,e,!o)},mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.preventUpdate,r=ne(Ke.current||fe.getInitialValue(Je.current),l,d,v,q);ht(r,null,{initial:!0,preventUpdate:t}),dt(w?ke(r):void 0,{preventUpdate:t}),vt(void 0,!0,{preventUpdate:t}),ye.current=!1},gt=function(e){ke&&(re("Field validating ".concat(r," ").concat(pt())),dt(ke(pt(),e||he.getValues())))},yt=function(e){a&&(re("Field async validating ".concat(r," ").concat(pt())),a(pt(),e||he.getValues()))},bt={setValue:ht,setTouched:vt,setError:dt,reset:mt,validate:gt,asyncValidate:yt,getValue:pt,getTouched:ze,getError:Re,getIsRelevant:ct,getDirty:xe,getPristine:be,getFieldState:function(){return{value:pt(),touched:ze(),dirty:xe(),pristine:be()}},relevant:ot,multistepRelevant:ut,checkRelevant:ft};ve.current=bt;var xt={value:Me,error:_e,touched:Be,maskedValue:qe,isRelevant:st,dirty:ye.current,pristine:!ye.current};P&&(xt={error:_e,touched:Be}),re("Render",he.getFullField(r),xt),Z((function(){var e=he.getFullField(Je.current);return re("Register",ue,Je.current),ge.current={field:e,fieldId:ue,fieldApi:bt,fieldState:xt,notify:S,keepState:E,inMultistep:de,shadow:P},fe.register(ue,ge.current),function(){var e=he.getFullField(Je.current);re("Deregister",ue,e),fe.deregister(ue)}}),[]),Object(n.useEffect)((function(){var e=he.getFullField(r);return me.current?me.current=!1:(re("Update",r,de),ge.current.field=e,fe.update(ue,ge.current,Ye.current)),function(){Ye.current=e}}),[r]),Z((function(){T&&Qe&&(Qe.current.style.border="5px solid orange",setTimeout((function(){Qe.current.style.borderWidth="2px",Qe.current.style.borderStyle="inset",Qe.current.style.borderColor="initial",Qe.current.style.borderImage="initial"}),500))}));var wt=[].concat(y(Object.values(xt)),y(Object.values(e)),y(Object.values(K))),Ct=function(e){return Object(n.useMemo)((function(){return st?e:null}),y(wt))},kt=r,At=ae({fieldType:F,setValue:ht,onChange:N,multiple:_,ref:Qe}),Ot=se({setTouched:vt,onBlur:R}),St=le({fieldType:F,maskedValue:qe,multiple:_,value:Me}),Et=ce(F);return{fieldState:xt,fieldApi:bt,render:Ct,ref:Qe,userProps:f(f({},K),{},{multiple:_,onChange:N,onBlur:R,id:K.id||ue}),informed:f({name:kt,multiple:_,onChange:At,onBlur:Ot,value:St,ref:Qe,type:Et,id:K.id||ue},K)}}var pe,de=function(e){var t=o.a.forwardRef((function(t,r){var n=fe(t,r),i=n.fieldState,a=n.fieldApi,s=n.render,l=n.ref,u=n.userProps;return s(o.a.createElement(e,c({fieldApi:a,fieldState:i,field:t.field,forwardedRef:l,debug:t.debug,type:t.type},u)))}));return t.displayName="asField(".concat(W(e),")"),t},he=w("informed:Text\t"),ve=de((function(e){var t=e.fieldApi,r=e.fieldState,n=h(e,["fieldApi","fieldState"]),i=r.maskedValue,a=t.setValue,s=t.setTouched,l=n.onChange,u=n.onBlur,f=n.field,p=(n.initialValue,n.forwardedRef),d=n.debug,v=n.label,m=(n.title,n.id),g=h(n,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return he("Render",f),Z((function(){d&&p&&(p.current.style.background="red",setTimeout((function(){p.current.style.background="white"}),500))})),o.a.createElement(o.a.Fragment,null,v?o.a.createElement("label",{htmlFor:m}," ",v," "):null,o.a.createElement("input",c({},g,{id:m,name:f,ref:p,value:i||0===i?i:"",onChange:function(e){a(e.target.value,e),l&&l(e)},onBlur:function(e){s(!0),u&&u(e)}})))})),me=de((function(e){var t=e.fieldApi,r=e.fieldState,n=h(e,["fieldApi","fieldState"]),i=r.maskedValue,a=t.setValue,s=t.setTouched,l=n.onChange,u=n.onBlur,f=n.field,p=(n.initialValue,n.forwardedRef),d=n.debug,v=n.label,m=n.id,g=h(n,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return Z((function(){d&&p&&(p.current.style.background="red",setTimeout((function(){p.current.style.background="white"}),500))})),o.a.createElement(o.a.Fragment,null,v?o.a.createElement("label",{htmlFor:m}," ",v," "):null,o.a.createElement("textarea",c({},g,{id:m,name:f,ref:p,value:i||"",onChange:function(e){a(e.target.value,e),l&&l(e)},onBlur:function(e){s(!0),u&&u(e)}})))})),ge=w("informed:Select\t"),ye=de((function(e){var t=e.fieldApi,r=e.fieldState,i=h(e,["fieldApi","fieldState"]),a=r.value,s=t.setTouched,l=i.onChange,u=i.onBlur,f=i.field,p=(i.initialValue,i.options),d=i.children,v=i.forwardedRef,m=i.debug,g=i.multiple,y=i.label,b=i.id,x=h(i,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),w=Object(n.useRef)();return Z((function(){m&&v&&(v.current.style.background="red",setTimeout((function(){v.current.style.background="white"}),500))})),ge("Render",f,a),o.a.createElement(o.a.Fragment,null,y?o.a.createElement("label",{htmlFor:b}," ",y," "):null,o.a.createElement("select",c({},x,{id:b,multiple:g,name:f,ref:v||w,value:a||(g?[]:""),onChange:function(e){var r=Array.from((v||w).current).filter((function(e){return e.selected})).map((function(e){return e.value}));t.setValue(g?r:r[0]||""),l&&e&&l(e)},onBlur:function(e){s(!0),u&&u(e)}}),p?p.map((function(e){return o.a.createElement("option",{key:e.value,value:e.value,disabled:e.disabled},e.label)})):d))})),be=de((function(e){var t=e.fieldApi,r=e.fieldState,n=h(e,["fieldApi","fieldState"]),i=r.value,a=t.setValue,s=t.setTouched,l=n.onChange,u=n.onBlur,f=n.field,p=(n.initialValue,n.debug,n.forwardedRef),d=n.id,v=n.label,m=h(n,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return o.a.createElement(o.a.Fragment,null,v?o.a.createElement("label",{htmlFor:d}," ",v," "):null,o.a.createElement("input",c({},m,{id:d,name:f,ref:p,checked:!!i,onChange:function(e){a(e.target.checked),l&&l(e)},onBlur:function(e){s(!0),u&&u(e)},type:"checkbox"})))})),xe=(pe=function(e){var t=e.radioGroupApi,r=e.radioGroupState,n=h(e,["radioGroupApi","radioGroupState"]),i=r.value,a=t.setValue,s=t.setTouched,l=t.onChange,u=t.onBlur,f=n.value,p=n.onChange,d=n.onBlur,v=n.field,m=(n.initialValue,n.forwardedRef),g=h(n,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return o.a.createElement("input",c({},g,{name:v,ref:m,value:f,checked:i===f,onChange:function(e){e.target.checked&&(a(f),p&&p(e),l&&l(e))},onBlur:function(e){s(!0),d&&d(e),u&&u(e)},type:"radio"}))},o.a.forwardRef((function(e,t){return o.a.createElement(_.Consumer,null,(function(r){var n=r.radioGroupApi,i=r.radioGroupState;return o.a.createElement(pe,c({radioGroupApi:n,radioGroupState:i,ref:t},e))}))}))),we=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(r,e);var t=m(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"render",value:function(){var e=this.props,t=e.options,r=e.children;return o.a.createElement(_.Provider,{value:this.groupContext},t?t.map((function(e){return o.a.createElement("label",{key:e.value},e.label," ",o.a.createElement(xe,{value:e.value}))})):r)}},{key:"groupContext",get:function(){return{radioGroupApi:f(f({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),r}(n.Component),Ce=de(we);var ke=w("informed:useArrayField\t"),Ae=function(e){var t=e.field,r=e.initialValue,i=e.validate,a=e.arrayFieldApiRef,s=h(e,["field","initialValue","validate","arrayFieldApiRef"]),l=U(),c=g(Object(n.useState)(new Map),1)[0],u=Object(n.useContext)(L),p=l.getFullField(t),d=u.getInitialValue(t)||r||[],v=g(z(l.getSavedValue(p)&&l.getSavedValue(p).value||d),3),m=v[0],b=v[1],x=v[2],w=g(z(m?m.map((function(){return J()})):[]),3),C=w[0],k=w[1],A=w[2],O=Object(n.useMemo)((function(){return function(e,t){var r=null==A()?0:A().length;return i?i(e,r,t):void 0}})),S=fe(f({field:t,validate:i?O:void 0,shadow:!0},s)).fieldApi;Z((function(){var e=function(e){e!==p&&(ke("".concat(p," changed")),RegExp("".concat(p,"\\[[0-9]+\\]")).test(e)&&S.validate())};return l.emitter.on("value",e),function(){l.emitter.removeListener("value",e)}}),[t]);var E=function(e,r){ke("Swapping","".concat(t,"[").concat(e,"] and ").concat(t,"[").concat(r,"]"));var n=y(C);C[e]&&C[r]?(n[e]=C[r],n[r]=C[e]):console.warn("Attempted to swap ".concat(e," with ").concat(r," but one of them does not exist :(")),k(n)},j=function(){C.push(J()),k(y(C))},T=function(e){C.push(J()),k(y(C));var t=y(x());t[C.length-1]=e,b(t)},P=C.map((function(e,r){var n={remove:function(){return function(e){ke("EXPECTING REMOVAL OF","".concat(t,"[").concat(e,"] and ").concat(t,"[").concat(C.length-1,"]")),u.expectRemoval("".concat(t,"[").concat(e,"]")),u.expectRemoval("".concat(t,"[").concat(C.length-1,"]"));var r=C.slice(0,e).concat(C.slice(e+1,C.length));k(r);var n=x(),o=n.slice(0,e).concat(n.slice(e+1,n.length));b(o)}(r)}},o={initialValue:m&&m[r],key:e,field:"".concat(t,"[").concat(r,"]"),index:r};return f(f({arrayFieldItemApi:n,arrayFieldItemState:o},n),o)})),I={add:j,swap:E,addWithInitialValue:T,reset:function(){var e=u.getInitialValue(t)||r||[];b(e);var n=e?e.map((function(){return J()})):[];k(n)}};a&&(a.current=I);var F={fields:P,field:t},_=f(f({},u),{},{register:function(e,t){c.set(e,t);for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];u.register.apply(u,[e,t].concat(n))},deregister:function(e){c.delete(e);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];u.deregister.apply(u,[e].concat(r))},getInitialValue:function(e){if(RegExp("".concat(p,"\\[[0-9]+\\]")).test(e)){var r=e.replace(t,""),n=M.get(x(),r);return ke("Resetting ".concat(r," to ").concat(n)),n}return u.getInitialValue(e)}});return{render:function(e){return o.a.createElement(L.Provider,{value:_},o.a.createElement(R.Provider,{value:I},o.a.createElement(N.Provider,{value:F},e)))},add:j,swap:E,addWithInitialValue:T,fields:P,arrayFieldState:F,arrayFieldApi:I,field:t}};function Oe(e){var t=U();return Object(n.useMemo)((function(){return function(e,t){return f(f({},t),{},{getValue:function(r){return t.getValue("".concat(e,".").concat(r))},getTouched:function(r){return t.getTouched("".concat(e,".").concat(r))},getError:function(r){return t.getError("".concat(e,".").concat(r))},setValue:function(r,n){return t.setValue("".concat(e,".").concat(r),n)},setTouched:function(r,n){return t.setTouched("".concat(e,".").concat(r),n)},setError:function(r,n){return t.setError("".concat(e,".").concat(r),n)},getInitialValue:function(r){return t.getInitialValue("".concat(e,".").concat(r))},getSavedValue:function(r){return t.getSavedValue("".concat(e,".").concat(r))},getFullField:function(r){return"".concat(t.getFullField(e),".").concat(r)}})}(e,t)}),[e])}function Se(){return Object(n.useContext)(I)}var Ee=function(e){var t=e.when,r=e.children;return t(Se())?r:null},je=function(e){var t=e.relevant,r=e.field,n=h(e,["relevant","field"]),i=U();if(t){var a=i.getFullField(r),s={path:a,parentPath:a.replace(/(.*)[.[].*/,"$1"),get:function(e,t){return M.get(e,t)}};return o.a.createElement(Ee,{when:function(e){var r=e.values;return t(r,s)}},o.a.createElement(Te,c({field:r},n)))}return o.a.createElement(Te,c({field:r},n))},Te=function(e){var t=e.children,r=h(e,["children"]),n=Ae(r),o=n.render,i=n.arrayFieldState,a=n.arrayFieldApi,s=n.field;return o("function"==typeof t?t(f(f({field:s,arrayFieldApi:a,arrayFieldState:i},a),i)):t)},Me=function(e){var t=e.arrayFieldItemState,r=e.arrayFieldItemApi,i=e.children,a=Object(n.useContext)(L),s=U(),l=g(Object(n.useState)(0),2),c=(l[0],l[1]),u=g(Object(n.useState)(new Map),1)[0],p=t.field,d=Oe(p);Object(n.useEffect)((function(){var e=function(e){e.slice(0,-1!=e.lastIndexOf("[")?e.lastIndexOf("]")+1:e.length)===p&&c(Math.random())};return s.emitter.on("value",e),function(){s.emitter.removeListener("value",e)}}),[p]);var h,v,m,y,b=(h=s.getState(),v=h.values,m=h.errors,y=h.touched,{values:M.get(v,p),errors:M.get(m,p),touched:M.get(y,p)}),x=f(f({},a),{},{register:function(e,t,r){u.set(e,t),a.register(e,t,r)},deregister:function(e){u.delete(e);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];a.deregister.apply(a,[e].concat(r))}}),w=f(f(f({},r),d),{},{reset:function(){u.forEach((function(e){e.fieldApi.reset()}))}}),C=f(f({},t),b);return"function"==typeof i?o.a.createElement(L.Provider,{value:x},o.a.createElement(D.Provider,{value:w},o.a.createElement(V.Provider,{value:C},i(f(f({arrayFieldItemApi:w,arrayFieldItemState:C},w),C))))):o.a.createElement(L.Provider,{value:x},o.a.createElement(D.Provider,{value:w},o.a.createElement(V.Provider,{value:C},i)))};je.Items=function(e){var t=e.children;return Object(n.useContext)(N).fields.map((function(e){var r=e.arrayFieldItemState,n=e.arrayFieldItemApi,i=r.key;return o.a.createElement(Me,{key:i,arrayFieldItemApi:n,arrayFieldItemState:r},t)}))};var Pe=function(e){var t=e.components,r=Object(n.useContext)(L).fieldMap;return t?t.map((function(e,t){var n=e["ui:control"],i=r[n];return o.a.createElement(i,{key:"ui-comp-".concat(t)})})):null},Le=w("informed:FormFields\t"),Ie=function e(t){var r=t.schema,i=t.prefix,a=t.onlyValidateSchema,s=Object(n.useContext)(L).fieldMap;return Object(n.useMemo)((function(){return X(r,a,i).map((function(t,r){var n=t.field,i=t.props,a=t.type,l=t.properties,u=t.items,f=t.componentType,p=t.uiBefore,d=t.uiAfter,h=t.allOf,v=s[f];return Le("Rendering Field",n,t),!v&&"object"===a&&l?o.a.createElement(e,{schema:t,prefix:n,key:"ScheamField-".concat(r)}):!v&&"array"===a&&u?o.a.createElement(Fe,c({key:"ScheamField-".concat(r),field:n,items:u,uiBefore:p,uiAfter:d},i)):v&&"array"===f&&u&&"array"===a?o.a.createElement(v,c({key:"ScheamField-".concat(r),field:n,items:u,uiBefore:p,uiAfter:d},i)):"conditionals"===f?h.map((function(t){var n=t.then,i=t.if.properties;return o.a.createElement(Ee,{key:"ScheamField-".concat(r),when:function(e){var t=e.values;return Object.keys(i).every((function(e){var r=i[e];return t[e]===r.const}))}},o.a.createElement(e,{schema:n}))})):v?o.a.createElement(v,c({key:"ScheamField-".concat(r),field:n},i)):null}))}),[r,i])},Fe=function(e){var t=e.field,r=e.items,n=e.uiBefore,i=e.uiAfter,a=h(e,["field","items","uiBefore","uiAfter"]);return o.a.createElement(je,c({field:t},a),o.a.createElement(Pe,{components:n}),o.a.createElement(je.Items,null,(function(e){var t=e.field;return o.a.createElement(o.a.Fragment,null,o.a.createElement(Pe,{components:r["ui:before"]}),o.a.createElement(Ie,{schema:r,prefix:t}),o.a.createElement(Pe,{components:r["ui:after"]}))})),o.a.createElement(Pe,{components:i}))},_e={select:ye,input:ve,textarea:me,checkbox:be,radio:Ce,add:function(){var e=Object(n.useContext)(R).add;return o.a.createElement("button",{onClick:function(){e()},type:"button"},"Add")},remove:function(){var e=Object(n.useContext)(D).remove;return o.a.createElement("button",{onClick:function(){e()},type:"button"},"Remove")},array:Fe},Ne=w("informed:Controller\t"),Re=function(){},De=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.options=r,this.subscriptions=new Map;var n=r.ajv,o=r.schema,a=r.fieldMap;this.ajv=n?new n({allErrors:!0}):null,this.ajvValidate=n?this.ajv.compile(o):null,this.fieldMap=a||_e,this.fieldsById=new Map,this.fieldsByName={get:function(e){var r;return t.fieldsById.forEach((function(t){t&&t.field===e&&(r=t)})),r}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:Re,setTouched:Re,setError:Re,reset:Re,validate:Re,getValue:Re,getTouched:Re,getError:Re,getFieldState:Re,checkRelevant:Re,getPristine:Re,getDirty:Re}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=t.fieldsById.get(e);o.shadow||M.set(t.state.values,o.field,o.fieldApi.getValue()),o.fieldApi.relevant(t.state.values)||M.delete(t.state.values,o.field),t.fieldsById.forEach((function(e){var r=e.fieldApi.checkRelevant();e.fieldApi.multistepRelevant(t.state.values)&&(r||e.keepState)||(M.delete(t.state.values,e.field),M.delete(t.state.touched,e.field),M.delete(t.state.errors,e.field))})),n&&(t.emit("change"),t.emit("field",o.field),t.emit("value",o.field,r))},setTouched:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=t.fieldsById.get(e);!o.shadow&&o.fieldApi.getIsRelevant()&&M.set(t.state.touched,o.field,o.fieldApi.getTouched()),o.shadow&&null!=o.fieldApi.getError()&&o.fieldApi.relevant(t.state.values)&&M.set(t.state.touched,o.field,o.fieldApi.getTouched()),n&&(t.emit("change"),t.emit("field",o.field))},setError:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=t.fieldsById.get(e);!o.shadow&&o.fieldApi.getIsRelevant()&&M.set(t.state.errors,o.field,o.fieldApi.getError());var i=M.get(t.state.errors,o.field);(o.shadow&&null!=o.fieldApi.getError()&&o.fieldApi.relevant(t.state.values)||o.shadow&&void 0===o.fieldApi.getError()&&o.fieldApi.relevant(t.state.values)&&"string"==typeof i)&&M.set(t.state.errors,o.field,o.fieldApi.getError()),n&&(t.emit("change"),t.emit("field",o.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",(function(e){delete t.state.error,t.notify(e)}))}return s(e,[{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=this.subscriptions.get(e);o&&o.forEach((function(e){return e.apply(void 0,r)}))}},{key:"on",value:function(e,t){this.subscriptions.get(e)||this.subscriptions.set(e,new Set),this.subscriptions.get(e).add(t)}},{key:"removeListener",value:function(e,t){this.subscriptions.get(e).delete(t)}},{key:"setOptions",value:function(e){this.options=e}},{key:"setValue",value:function(e,t,r){this.getField(e).fieldApi.setValue(t,null,f({allowEmptyString:this.options.allowEmptyStrings},r))}},{key:"setTouched",value:function(e,t){this.getField(e).fieldApi.setTouched(t)}},{key:"setError",value:function(e,t){this.getField(e).fieldApi.setError(t)}},{key:"setFormError",value:function(e){this.state.error=e,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(e,t){this.state.validating=this.state.validating-1,this.getError(e)||this.setError(e,t),this.state.validating>0||this.state.submitting&&(this.valid()?(Ne("Submit",this.state),this.emit("submit")):(Ne("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(e){this.state.step=e,this.emit("change")}},{key:"setCurrent",value:function(e){this.state.Current=e,this.emit("change")}},{key:"back",value:function(e){this.state.step=this.state.step-1,this.state.Current=e,this.emit("change")}},{key:"next",value:function(e){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=e),this.emit("change")}},{key:"setInitialValue",value:function(e,t){M.set(this.options.initialValues,e,t)}},{key:"getFormState",value:function(){return Ne("Returning form state"),f(f({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(e){var t=this.getValues();return M.get(t,e)}},{key:"getValue",value:function(e){var t=this.getField(e).fieldApi.getValue();return Ne("Getting value for",e,t),t}},{key:"getTouched",value:function(e){var t=this.getField(e).fieldApi.getTouched();return Ne("Getting touched for",e,t),t}},{key:"getError",value:function(e){var t=this.getField(e).fieldApi.getError();return Ne("Getting error for",e,t),t}},{key:"getDirty",value:function(e){var t=this.getField(e).fieldApi.getDirty();return Ne("Getting dirty for",e,t),t}},{key:"getPristine",value:function(e){var t=this.getField(e).fieldApi.getPristine();return Ne("Getting pristine for",e,t),t}},{key:"getValues",value:function(){return Ne("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return Ne("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return Ne("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(e){var t=this.fieldsByName.get(e);return t&&t.shadow?M.get(this.savedValues,"shadow-".concat(e)):M.get(this.savedValues,e)}},{key:"removeSavedState",value:function(e){var t=this.fieldsByName.get(e);return t&&t.shadow?M.delete(this.savedValues,"shadow-".concat(e)):M.delete(this.savedValues,e)}},{key:"getFullField",value:function(e){return e}},{key:"getInitialValue",value:function(e){return M.get(this.options.initialValues,e)}},{key:"getField",value:function(e){Ne("Getting Field",e);var t=this.fieldsByName.get(e);return t||(console.warn("Attempting to get field ".concat(e," but it does not exist")),this.dummyField)}},{key:"notify",value:function(e){var t=this,r=this.getField(e);r&&r.notify&&r.notify.forEach((function(r){var n=".".concat(e),o="".concat(n.replace(/(.*)[.[].*/,"$1"),".").concat(r).slice(1),i=t.getField(o);i&&(Ne("Notifying",i.field),i.fieldApi.validate(),i.fieldApi.checkRelevant())}))}},{key:"validateField",value:function(e){this.getField(e).fieldApi.validate()}},{key:"resetField",value:function(e){this.getField(e).fieldApi.reset()}},{key:"fieldExists",value:function(e){return null!=this.fieldsByName.get(e)}},{key:"valid",value:function(){var e=this.getErrors();return!(!M.empty(e)||this.state.error)}},{key:"screenValid",value:function(){return!Object.entries(this.onScreen).some((function(e){return g(e,2)[1].fieldApi.getError()}))}},{key:"invalid",value:function(){var e=this.getErrors();return!(M.empty(e)&&!this.state.error)}},{key:"pristine",value:function(){var e=!0;return this.fieldsById.forEach((function(t){t.fieldApi.getPristine()||(e=!1)})),e}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){Ne("Resetting"),this.fieldsById.forEach((function(e){e.fieldApi.reset({preventUpdate:!0})})),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(e){Ne("Setting values"),this.fieldsById.forEach((function(t){var r=M.get(e,t.field);void 0!==r&&t.fieldApi.setValue(r,null,{preventUpdate:!0})})),this.emit("change")}},{key:"validate",value:function(){var e=this;Ne("Validating all fields");var t=this.getValues();if(this.options.validationSchema){var r=q(this.options.validationSchema,t);this.fieldsById.forEach((function(t){if(M.has(r,t.field)){var n=M.get(r,t.field);e.setError(t.field,n)}else e.setError(t.field,void 0)}))}if(this.options.schema&&this.options.ajv){var n=K(this.ajvValidate,t);this.fieldsById.forEach((function(t){if(M.has(n,t.field)){var r=M.get(n,t.field);e.setError(t.field,r)}else e.setError(t.field,void 0)}))}if(this.fieldsById.forEach((function(e){e.fieldApi.validate(t),e.fieldApi.setTouched(!0,!0)})),this.options.validate){var o=this.options.validate(t);this.setFormError(o)}if(this.options.validateFields){var i=this.options.validateFields(t);this.fieldsById.forEach((function(t){if(M.has(i,t.field)){var r=M.get(i,t.field);e.setError(t.field,r)}}))}}},{key:"asyncValidate",value:function(){Ne("Async Validating all fields");var e=this.getValues();this.fieldsById.forEach((function(t){t.fieldApi.asyncValidate(e)}))}},{key:"keyDown",value:function(e){if(13==e.keyCode&&this.options.preventEnter)return e.preventDefault(e),!1}},{key:"submitForm",value:function(e){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&e&&e.preventDefault(e),this.validate(),this.emit("change"),this.asyncValidate(),this.state.validating>0||(this.valid()?(Ne("Submit",this.state),this.emit("submit")):(Ne("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var e=this;this.fieldsById.forEach((function(t){e.emit("field",t.field)}))}},{key:"register",value:function(e,t,r){var n=t.field,o=t.state;Ne("Register ID:",e,"Name:",n,o,"Initial",r);var i,a=n.slice(0,-1!=n.lastIndexOf("[")?n.lastIndexOf("]")+1:n.length);this.fieldsById.forEach((function(e,t){e&&e.field===n&&(i=t)})),//!this.expectedRemovals[magicValue] &&
13
+ var Ca=new WeakMap,ka=function(e){this.observers=new Map,this.obj=e},Aa=function(e,t){this.callback=e,this.observer=t};function Oa(e,t){t.unobserve()}function Sa(e,t){var r,n=function(e){return Ca.get(e)}(e);if(n){var o=function(e,t){return e.observers.get(t)}(n,t);r=o&&o.observer}else n=new ka(e),Ca.set(e,n);if(r)return r;if(r={},n.value=ia(e),t){r.callback=t,r.next=null;var i=function(){Ea(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(i)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=[],r.object=e,r.unobserve=function(){Ea(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},n.observers.set(t,new Aa(t,r)),r}function Ea(e,t){void 0===t&&(t=!1);var r=Ca.get(e.object);ja(r.value,e.object,e.patches,"",t),e.patches.length&&ga(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function ja(e,t,r,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=oa(t),a=oa(e),s=!1,l=a.length-1;l>=0;l--){var c=e[f=a[l]];if(!na(t,f)||void 0===t[f]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+sa(f),value:ia(c)}),r.push({op:"remove",path:n+"/"+sa(f)}),s=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),!0);else{var u=t[f];"object"==typeof c&&null!=c&&"object"==typeof u&&null!=u?ja(c,u,r,n+"/"+sa(f),o):c!==u&&(!0,o&&r.push({op:"test",path:n+"/"+sa(f),value:ia(c)}),r.push({op:"replace",path:n+"/"+sa(f),value:ia(u)}))}}if(s||i.length!=a.length)for(l=0;l<i.length;l++){var f;na(e,f=i[l])||void 0===t[f]||r.push({op:"add",path:n+"/"+sa(f),value:ia(t[f])})}}}function Ta(e,t,r){void 0===r&&(r=!1);var n=[];return ja(e,t,n,"",r),n}Object.assign({},n,o,{JsonPatchError:ua,deepClone:ia,escapePathComponent:sa,unescapePathComponent:la});var Ma=r(1063),Pa=r.n(Ma),La=r(1064),Ia=r.n(La),Fa={add:function(e,t){return{op:"add",path:e,value:t}},replace:Na,remove:function(e){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce((function(e,t){return void 0!==t&&e?e[t]:e}),e)},applyPatch:function(e,t,r){if(r=r||{},"merge"===(t=uo()(uo()({},t),{},{path:t.path&&_a(t.path)})).op){var n=Ja(e,t.path);Hi()(n,t.value),ga(e,[Na(t.path,n)])}else if("mergeDeep"===t.op){var o=Ja(e,t.path);for(var i in t.value){var a=t.value[i],s=Array.isArray(a);if(s){var l=o[i]||[];o[i]=Uo()(l).call(l,a)}else if(Wa(a)&&!s){var c=uo()({},o[i]);for(var u in a){if(Object.prototype.hasOwnProperty.call(c,u)){c=Pa()(Ia()(c),a);break}Hi()(c,ea()({},u,a[u]))}o[i]=c}else o[i]=a}}else if("add"===t.op&&""===t.path&&Wa(t.value)){var f=Vo()(t.value).reduce((function(e,r){return e.push({op:"add",path:"/".concat(_a(r)),value:t.value[r]}),e}),[]);ga(e,f)}else if("replace"===t.op&&""===t.path){var p=t.value;r.allowMetaPatches&&t.meta&&$a(t)&&(Array.isArray(t.value)||Wa(t.value))&&(p=uo()(uo()({},p),t.meta)),e=p}else if(ga(e,[t]),r.allowMetaPatches&&t.meta&&$a(t)&&(Array.isArray(t.value)||Wa(t.value))){var d=Ja(e,t.path),h=uo()(uo()({},d),t.meta);ga(e,[Na(t.path,h)])}return e},parentPathMatch:function(e,t){if(!Array.isArray(t))return!1;for(var r=0,n=t.length;r<n;r+=1)if(t[r]!==e[r])return!1;return!0},flatten:Ua,fullyNormalizeArray:function(e){return za(Ua(Ba(e)))},normalizeArray:Ba,isPromise:function(e){return Wa(e)&&Ha(e.then)},forEachNew:function(e,t){try{return Ra(e,Va,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return Ra(e,Da,t)}catch(e){return e}},isJsonPatch:qa,isContextPatch:function(e){return Ka(e)&&"context"===e.type},isPatch:Ka,isMutation:Ga,isAdditiveMutation:$a,isGenerator:function(e){return"[object GeneratorFunction]"===Object.prototype.toString.call(e)},isFunction:Ha,isObject:Wa,isError:function(e){return e instanceof Error}};function _a(e){return Array.isArray(e)?e.length<1?"":"/".concat(Ro()(e).call(e,(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")})).join("/")):e}function Na(e,t,r){return{op:"replace",path:e,value:t,meta:r}}function Ra(e,t,r){var n;return za(Ua(Ro()(n=qo()(e).call(e,$a)).call(n,(function(e){return t(e.value,r,e.path)}))||[]))}function Da(e,t,r){return r=r||[],Array.isArray(e)?Ro()(e).call(e,(function(e,n){return Da(e,t,Uo()(r).call(r,n))})):Wa(e)?Ro()(n=Vo()(e)).call(n,(function(n){return Da(e[n],t,Uo()(r).call(r,n))})):t(e,r[r.length-1],r);var n}function Va(e,t,r){var n=[];if((r=r||[]).length>0){var o=t(e,r[r.length-1],r);o&&(n=Uo()(n).call(n,o))}if(Array.isArray(e)){var i=Ro()(e).call(e,(function(e,n){return Va(e,t,Uo()(r).call(r,n))}));i&&(n=Uo()(n).call(n,i))}else if(Wa(e)){var a,s=Ro()(a=Vo()(e)).call(a,(function(n){return Va(e[n],t,Uo()(r).call(r,n))}));s&&(n=Uo()(n).call(n,s))}return n=Ua(n)}function Ba(e){return Array.isArray(e)?e:[e]}function Ua(e){var t;return Uo()(t=[]).apply(t,yi()(Ro()(e).call(e,(function(e){return Array.isArray(e)?Ua(e):e}))))}function za(e){return qo()(e).call(e,(function(e){return void 0!==e}))}function Wa(e){return e&&"object"===wo()(e)}function Ha(e){return e&&"function"==typeof e}function qa(e){if(Ka(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function Ga(e){return qa(e)||Ka(e)&&"mutation"===e.type}function $a(e){return Ga(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ka(e){return e&&"object"===wo()(e)}function Ja(e,t){try{return va(e,t)}catch(e){return console.error(e),{}}}var Ya=r(1088),Xa=r.n(Ya),Qa=r(773),Za=r(1095),es=r.n(Za);function ts(e,t){function r(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.message=r[0],t&&t.apply(this,r)}return r.prototype=new Error,r.prototype.name=e,r.prototype.constructor=r,r}var rs=r(1096),ns=r.n(rs),os=r(1097),is=r.n(os),as=["properties"],ss=["properties"],ls=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],cs=["schema/example","items/example"];function us(e){var t=e[e.length-1],r=e[e.length-2],n=e.join("/");return as.indexOf(t)>-1&&-1===ss.indexOf(r)||ls.indexOf(n)>-1||cs.some((function(e){return n.indexOf(e)>-1}))}function fs(e,t){var r,n=e.split("#"),o=ko()(n,2),i=o[0],a=o[1],s=go.a.resolve(i||"",t||"");return a?Uo()(r="".concat(s,"#")).call(r,a):s}var ps=new RegExp("^([a-z]+://|//)","i"),ds=ts("JSONRefError",(function(e,t,r){this.originalError=r,Hi()(this,t||{})})),hs={},vs=new Xa.a,ms=[function(e){return"paths"===e[0]&&"responses"===e[3]&&"examples"===e[5]},function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7]},function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"examples"===e[7]&&"value"===e[9]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"examples"===e[6]&&"value"===e[8]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"example"===e[4]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"example"===e[5]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"examples"===e[4]&&"value"===e[6]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"examples"===e[5]&&"value"===e[7]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"content"===e[4]&&"example"===e[6]},function(e){return"paths"===e[0]&&"parameters"===e[2]&&"content"===e[4]&&"examples"===e[6]&&"value"===e[8]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"content"===e[4]&&"example"===e[7]},function(e){return"paths"===e[0]&&"parameters"===e[3]&&"content"===e[5]&&"examples"===e[7]&&"value"===e[9]}],gs={key:"$ref",plugin:function(e,t,r,n){var o=n.getInstance(),i=xi()(r).call(r,0,-1);if(!us(i)&&(a=i,!ms.some((function(e){return e(a)})))){var a,s=n.getContext(r).baseDoc;if("string"!=typeof e)return new ds("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:s,fullPath:r});var l,c,u,f=Cs(e),p=f[0],d=f[1]||"";try{l=s||p?xs(p,s):null}catch(t){return ws(t,{pointer:d,$ref:e,basePath:l,fullPath:r})}if(function(e,t,r,n){var o,i,a=vs.get(n);a||(a={},vs.set(n,a));var s=function(e){if(0===e.length)return"";return"/".concat(Ro()(e).call(e,js).join("/"))}(r),l=Uo()(o="".concat(t||"<specmap-base>","#")).call(o,e),c=s.replace(/allOf\/\d+\/?/g,""),u=n.contextTree.get([]).baseDoc;if(t==u&&Ts(c,e))return!0;var f="";if(r.some((function(e){var t;return f=Uo()(t="".concat(f,"/")).call(t,js(e)),a[f]&&a[f].some((function(e){return Ts(e,l)||Ts(l,e)}))})))return!0;return void(a[c]=Uo()(i=a[c]||[]).call(i,l))}(d,l,i,n)&&!o.useCircularStructures){var h=fs(e,l);return e===h?null:Fa.replace(r,h)}if(null==l?(u=Ss(d),void 0===(c=n.get(u))&&(c=new ds("Could not resolve reference: ".concat(e),{pointer:d,$ref:e,baseDoc:s,fullPath:r}))):c=null!=(c=ks(l,d)).__value?c.__value:c.catch((function(t){throw ws(t,{pointer:d,$ref:e,baseDoc:s,fullPath:r})})),c instanceof Error)return[Fa.remove(r),c];var v=fs(e,l),m=Fa.replace(i,c,{$$ref:v});if(l&&l!==s)return[m,Fa.context(i,{baseDoc:l})];try{if(!function(e,t){var r=[e];return t.path.reduce((function(e,t){return r.push(e[t]),e[t]}),e),function e(t){return Fa.isObject(t)&&(r.indexOf(t)>=0||Vo()(t).some((function(r){return e(t[r])})))}(t.value)}(n.state,m)||o.useCircularStructures)return m}catch(e){return null}}}},ys=Hi()(gs,{docCache:hs,absoluteify:xs,clearCache:function(e){void 0!==e?delete hs[e]:Vo()(hs).forEach((function(e){delete hs[e]}))},JSONRefError:ds,wrapError:ws,getDoc:As,split:Cs,extractFromDoc:ks,fetchJSON:function(e){return Object(Qa.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then((function(e){return e.text()})).then((function(e){return Jo.a.safeLoad(e)}))},extract:Os,jsonPointerToArray:Ss,unescapeJsonPointerToken:Es}),bs=ys;function xs(e,t){if(!ps.test(e)){var r;if(!t)throw new ds(Uo()(r="Tried to resolve a relative URL, without having a basePath. path: '".concat(e,"' basePath: '")).call(r,t,"'"));return go.a.resolve(t,e)}return e}function ws(e,t){var r,n;e&&e.response&&e.response.body?r=Uo()(n="".concat(e.response.body.code," ")).call(n,e.response.body.message):r=e.message;return new ds("Could not resolve reference: ".concat(r),t,e)}function Cs(e){return(e+"").split("#")}function ks(e,t){var r=hs[e];if(r&&!Fa.isPromise(r))try{var n=Os(t,r);return Hi()(Gi.a.resolve(n),{__value:n})}catch(e){return Gi.a.reject(e)}return As(e).then((function(e){return Os(t,e)}))}function As(e){var t=hs[e];return t?Fa.isPromise(t)?t:Gi.a.resolve(t):(hs[e]=ys.fetchJSON(e).then((function(t){return hs[e]=t,t})),hs[e])}function Os(e,t){var r=Ss(e);if(r.length<1)return t;var n=Fa.getIn(t,r);if(void 0===n)throw new ds("Could not resolve pointer: ".concat(e," does not exist in document"),{pointer:e});return n}function Ss(e){var t;if("string"!=typeof e)throw new TypeError("Expected a string, got a ".concat(wo()(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:Ro()(t=e.split("/")).call(t,Es)}function Es(e){return"string"!=typeof e?e:es.a.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function js(e){return es.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}function Ts(e,t){if(!(r=t)||"/"===r||"#"===r)return!0;var r,n=e.charAt(t.length),o=xi()(t).call(t,-1);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)&&"#"!==o}var Ms=r(1098),Ps=r.n(Ms),Ls={key:"allOf",plugin:function(e,t,r,n,o){if(!o.meta||!o.meta.$$ref){var i=xi()(r).call(r,0,-1);if(!us(i)){if(!Array.isArray(e)){var a=new TypeError("allOf must be an array");return a.fullPath=r,a}var s=!1,l=o.value;if(i.forEach((function(e){l&&(l=l[e])})),l=uo()({},l),!Ps()(l)){delete l.allOf;var c,u=[];if(u.push(n.replace(i,{})),e.forEach((function(e,t){if(!n.isObject(e)){if(s)return null;s=!0;var o=new TypeError("Elements in allOf must be objects");return o.fullPath=r,u.push(o)}u.push(n.mergeDeep(i,e));var a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.specmap,o=r.getBaseUrlForNodePath,i=void 0===o?function(e){var r;return n.getContext(Uo()(r=[]).call(r,yi()(t),yi()(e))).baseDoc}:o,a=r.targetKeys,s=void 0===a?["$ref","$$ref"]:a,l=[];return ns()(e).forEach((function(){if(To()(s).call(s,this.key)&&is()(this.node)){var e=this.path,r=Uo()(t).call(t,this.path),o=fs(this.node,i(e));l.push(n.replace(r,o))}})),l}(e,xi()(r).call(r,0,-1),{getBaseUrlForNodePath:function(e){var o;return n.getContext(Uo()(o=[]).call(o,yi()(r),[t],yi()(e))).baseDoc},specmap:n});u.push.apply(u,yi()(a))})),u.push(n.mergeDeep(i,l)),!l.$$ref)u.push(n.remove(Uo()(c=[]).call(c,i,"$$ref")));return u}}}}},Is={key:"parameters",plugin:function(e,t,r,n){if(Array.isArray(e)&&e.length){var o=Hi()([],e),i=xi()(r).call(r,0,-1),a=uo()({},Fa.getIn(n.spec,i));return e.forEach((function(e,t){try{o[t].default=n.parameterMacro(a,e)}catch(e){var i=new Error(e);return i.fullPath=r,i}})),Fa.replace(r,o)}return Fa.replace(r,e)}},Fs={key:"properties",plugin:function(e,t,r,n){var o=uo()({},e);for(var i in e)try{o[i].default=n.modelPropertyMacro(o[i])}catch(e){var a=new Error(e);return a.fullPath=r,a}return Fa.replace(r,o)}},_s=function(){function e(t){ri()(this,e),this.root=Ns(t||{})}return oi()(e,[{key:"set",value:function(e,t){var r=this.getParent(e,!0);if(r){var n=e[e.length-1],o=r.children;o[n]?Rs(o[n],t,r):o[n]=Ns(t,r)}else Rs(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t,r,n=this.root,o=0;o<e.length&&(r=e[o],(t=n.children)[r]);o+=1)n=t[r];return n&&n.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:xi()(e).call(e,0,-1).reduce((function(e,r){if(!e)return e;var n=e.children;return!n[r]&&t&&(n[r]=Ns(null,e)),n[r]}),this.root)}}]),e}();function Ns(e,t){return Rs({children:{}},e,t)}function Rs(e,t,r){return e.value=t||{},e.protoValue=r?uo()(uo()({},r.protoValue),e.value):e.value,Vo()(e.children).forEach((function(t){var r=e.children[t];e.children[t]=Rs(r,r.value,e)})),e}var Ds=function(){function e(t){var r,n,o=this;ri()(this,e),Hi()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new _s,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:Hi()(Object.create(this),Fa,{getInstance:function(){return o}}),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=qo()(r=Ro()(n=this.plugins).call(n,this.wrapPlugin.bind(this))).call(r,Fa.isFunction),this.patches.push(Fa.add([],this.spec)),this.patches.push(Fa.context([],this.context)),this.updatePatches(this.patches)}return oi()(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];(t=console).log.apply(t,n)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];(t=console).log.apply(t,Uo()(r=["[".concat(e,"] ")]).call(r,o))}}},{key:"wrapPlugin",value:function(e,t){var r,n,o,i=this.pathDiscriminator,a=null;return e[this.pluginProp]?(a=e,r=e[this.pluginProp]):Fa.isFunction(e)?r=e:Fa.isObject(e)&&(n=e,o=function(e,t){return!Array.isArray(e)||e.every((function(e,r){return e===t[r]}))},r=Eo.a.mark((function e(t,r){var a,s,l,c,u,f;return Eo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f=function(e,t,l){var c,u,p,d,h,v,m,g,y,b,x,w,C;return Eo.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(Fa.isObject(e)){a.next=6;break}if(n.key!==t[t.length-1]){a.next=4;break}return a.next=4,n.plugin(e,n.key,t,r);case 4:a.next=30;break;case 6:c=t.length-1,u=t[c],p=t.indexOf("properties"),d="properties"===u&&c===p,h=r.allowMetaPatches&&s[e.$$ref],v=0,m=Vo()(e);case 12:if(!(v<m.length)){a.next=30;break}if(g=m[v],y=e[g],b=Uo()(t).call(t,g),x=Fa.isObject(y),w=e.$$ref,h){a.next=22;break}if(!x){a.next=22;break}return r.allowMetaPatches&&w&&(s[w]=!0),a.delegateYield(f(y,b,l),"t0",22);case 22:if(d||g!==n.key){a.next=27;break}if(C=o(i,t),i&&!C){a.next=27;break}return a.next=27,n.plugin(y,g,b,r,l);case 27:v++,a.next=12;break;case 30:case"end":return a.stop()}}),a)},a=Eo.a.mark(f),s={},l=bo()(qo()(t).call(t,Fa.isAdditiveMutation)),e.prev=4,l.s();case 6:if((c=l.n()).done){e.next=11;break}return u=c.value,e.delegateYield(f(u.value,u.path,u),"t0",9);case 9:e.next=6;break;case 11:e.next=16;break;case 13:e.prev=13,e.t1=e.catch(4),l.e(e.t1);case 16:return e.prev=16,l.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])}))),Hi()(r.bind(a),{pluginName:e.name||t,isGenerator:Fa.isGenerator(r)})}},{key:"nextPlugin",value:function(){var e=this;return Yi()(this.wrappedPlugins,(function(t){return e.getMutationsForPlugin(t).length>0}))}},{key:"nextPromisedPatch",value:function(){var e;if(this.promisedPatches.length>0)return Gi.a.race(Ro()(e=this.promisedPatches).call(e,(function(e){return e.value})))}},{key:"getPluginHistory",value:function(e){var t=this.constructor.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"updatePluginHistory",value:function(e,t){var r=this.constructor.getPluginName(e);this.pluginHistory[r]=this.pluginHistory[r]||[],this.pluginHistory[r].push(t)}},{key:"updatePatches",value:function(e){var t=this;Fa.normalizeArray(e).forEach((function(e){if(e instanceof Error)t.errors.push(e);else try{if(!Fa.isObject(e))return void t.debug("updatePatches","Got a non-object patch",e);if(t.showDebug&&t.allPatches.push(e),Fa.isPromise(e.value))return t.promisedPatches.push(e),void t.promisedPatchThen(e);if(Fa.isContextPatch(e))return void t.setContext(e.path,e.value);if(Fa.isMutation(e))return void t.updateMutations(e)}catch(e){console.error(e),t.errors.push(e)}}))}},{key:"updateMutations",value:function(e){"object"===wo()(e.value)&&!Array.isArray(e.value)&&this.allowMetaPatches&&(e.value=uo()({},e.value));var t=Fa.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t,r=this.promisedPatches.indexOf(e);r<0?this.debug("Tried to remove a promisedPatch that isn't there!"):Ki()(t=this.promisedPatches).call(t,r,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then((function(r){var n=uo()(uo()({},e),{},{value:r});t.removePromisedPatch(e),t.updatePatches(n)})).catch((function(r){t.removePromisedPatch(e),t.updatePatches(r)})),e.value}},{key:"getMutations",value:function(e,t){var r;return e=e||0,"number"!=typeof t&&(t=this.mutations.length),xi()(r=this.mutations).call(r,e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return Fa.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"dispatch",value:function(){var e,t=this,r=this,n=this.nextPlugin();if(!n){var o=this.nextPromisedPatch();if(o)return o.then((function(){return t.dispatch()})).catch((function(){return t.dispatch()}));var i={spec:this.state,errors:this.errors};return this.showDebug&&(i.patches=this.allPatches),Gi.a.resolve(i)}if(r.pluginCount=r.pluginCount||{},r.pluginCount[n]=(r.pluginCount[n]||0)+1,r.pluginCount[n]>100)return Gi.a.resolve({spec:r.state,errors:Uo()(e=r.errors).call(e,new Error("We've reached a hard limit of ".concat(100," plugin runs")))});if(n!==this.currentPlugin&&this.promisedPatches.length){var a,s=Ro()(a=this.promisedPatches).call(a,(function(e){return e.value}));return Gi.a.all(Ro()(s).call(s,(function(e){return e.then(Qi.a,Qi.a)}))).then((function(){return t.dispatch()}))}return function(){r.currentPlugin=n;var e=r.getCurrentMutations(),t=r.mutations.length-1;try{if(n.isGenerator){var o,i=bo()(n(e,r.getLib()));try{for(i.s();!(o=i.n()).done;){l(o.value)}}catch(e){i.e(e)}finally{i.f()}}else{l(n(e,r.getLib()))}}catch(e){console.error(e),l([Hi()(Object.create(e),{plugin:n})])}finally{r.updatePluginHistory(n,{mutationIndex:t})}return r.dispatch()}();function l(e){e&&(e=Fa.fullyNormalizeArray(e),r.updatePatches(e,n))}}}],[{key:"getPluginName",value:function(e){return e.pluginName}},{key:"getPatchesOfType",value:function(e,t){return qo()(e).call(e,t)}}]),e}();var Vs={refs:bs,allOf:Ls,parameters:Is,properties:Fs},Bs=r(585),Us=r.n(Bs),zs=function(e){return String.prototype.toLowerCase.call(e)},Ws=function(e){return e.replace(/[^\w]/gi,"_")};function Hs(e){var t=e.openapi;return!!t&&vo()(t,"3")}function qs(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n.v2OperationIdCompatibilityMode;if(!e||"object"!==wo()(e))return null;var i=(e.operationId||"").replace(/\s/g,"");return i.length?Ws(e.operationId):Gs(t,r,{v2OperationIdCompatibilityMode:o})}function Gs(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.v2OperationIdCompatibilityMode;if(o){var i,a,s=Uo()(i="".concat(t.toLowerCase(),"_")).call(i,e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return(s=s||Uo()(a="".concat(e.substring(1),"_")).call(a,t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Uo()(r="".concat(zs(t))).call(r,Ws(e))}function $s(e,t){var r;return Uo()(r="".concat(zs(t),"-")).call(r,e)}function Ks(e,t){return e&&e.paths?function(e,t){return Js(e,t,!0)||null}(e,(function(e){var r=e.pathName,n=e.method,o=e.operation;if(!o||"object"!==wo()(o))return!1;var i=o.operationId;return[qs(o,r,n),$s(r,n),i].some((function(e){return e&&e===t}))})):null}function Js(e,t,r){if(!e||"object"!==wo()(e)||!e.paths||"object"!==wo()(e.paths))return null;var n=e.paths;for(var o in n)for(var i in n[o])if("PARAMETERS"!==i.toUpperCase()){var a=n[o][i];if(a&&"object"===wo()(a)){var s={spec:e,pathName:o,method:i.toUpperCase(),operation:a},l=t(s);if(r&&l)return s}}}function Ys(e){var t=e.spec,r=t.paths,n={};if(!r||t.$$normalized)return e;for(var o in r){var i=r[o];if(Us()(i)){var a=i.parameters,s=function(e){var r=i[e];if(!Us()(r))return"continue";var s=qs(r,o,e);if(s){n[s]?n[s].push(r):n[s]=[r];var l=n[s];if(l.length>1)l.forEach((function(e,t){var r;e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=Uo()(r="".concat(s)).call(r,t+1)}));else if(void 0!==r.operationId){var c=l[0];c.__originalOperationId=c.__originalOperationId||r.operationId,c.operationId=s}}if("parameters"!==e){var u=[],f={};for(var p in t)"produces"!==p&&"consumes"!==p&&"security"!==p||(f[p]=t[p],u.push(f));if(a&&(f.parameters=a,u.push(f)),u.length){var d,h=bo()(u);try{for(h.s();!(d=h.n()).done;){var v=d.value;for(var m in v)if(r[m]){if("parameters"===m){var g,y=bo()(v[m]);try{var b=function(){var e=g.value;r[m].some((function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e}))||r[m].push(e)};for(y.s();!(g=y.n()).done;)b()}catch(e){y.e(e)}finally{y.f()}}}else r[m]=v[m]}}catch(e){h.e(e)}finally{h.f()}}}};for(var l in i)s(l)}}return t.$$normalized=!0,e}function Xs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.requestInterceptor,n=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:r,responseInterceptor:n,headers:{Accept:"application/json, application/yaml"},credentials:o}).then((function(e){return e.body}))}}function Qs(e){var t=e.fetch,r=e.spec,n=e.url,o=e.mode,i=e.allowMetaPatches,a=void 0===i||i,s=e.pathDiscriminator,l=e.modelPropertyMacro,c=e.parameterMacro,u=e.requestInterceptor,f=e.responseInterceptor,p=e.skipNormalization,d=e.useCircularStructures,h=e.http,v=e.baseDoc;return v=v||n,h=t||h||Ei,r?m(r):Xs(h,{requestInterceptor:u,responseInterceptor:f})(v).then(m);function m(e){v&&(Vs.refs.docCache[v]=e),Vs.refs.fetchJSON=Xs(h,{requestInterceptor:u,responseInterceptor:f});var t,r=[Vs.refs];return"function"==typeof c&&r.push(Vs.parameters),"function"==typeof l&&r.push(Vs.properties),"strict"!==o&&r.push(Vs.allOf),(t={spec:e,context:{baseDoc:v},plugins:r,allowMetaPatches:a,pathDiscriminator:s,parameterMacro:c,modelPropertyMacro:l,useCircularStructures:d},new Ds(t).dispatch()).then(p?function(){var e=Oo()(Eo.a.mark((function e(t){return Eo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}():Ys)}}var Zs=r(653),el=r.n(Zs);function tl(){return(tl=Oo()(Eo.a.mark((function e(t,r){var n,o,i,a,s,l,c,u,f,p,d,h,v=arguments;return Eo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=v.length>2&&void 0!==v[2]?v[2]:{},o=n.returnEntireTree,i=n.baseDoc,a=n.requestInterceptor,s=n.responseInterceptor,l=n.parameterMacro,c=n.modelPropertyMacro,u=n.useCircularStructures,f={pathDiscriminator:r,baseDoc:i,requestInterceptor:a,responseInterceptor:s,parameterMacro:l,modelPropertyMacro:c,useCircularStructures:u},p=Ys({spec:t}),d=p.spec,e.next=6,Qs(uo()(uo()({},f),{},{spec:d,allowMetaPatches:!0,skipNormalization:!0}));case 6:return h=e.sent,!o&&Array.isArray(r)&&r.length&&(h.spec=el()(h.spec,r)||null),e.abrupt("return",h);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rl=function(){return null},nl={mapTagOperations:function(e){var t=e.spec,r=e.cb,n=void 0===r?rl:r,o=e.defaultTag,i=void 0===o?"default":o,a=e.v2OperationIdCompatibilityMode,s={},l={};return Js(t,(function(e){var r,o=e.pathName,c=e.method,u=e.operation;(u.tags?(r=u.tags,Array.isArray(r)?r:[r]):[i]).forEach((function(e){if("string"==typeof e){l[e]=l[e]||{};var r,i=l[e],f=qs(u,o,c,{v2OperationIdCompatibilityMode:a}),p=n({spec:t,pathName:o,method:c,operation:u,operationId:f});if(s[f])s[f]+=1,i[Uo()(r="".concat(f)).call(r,s[f])]=p;else if(void 0!==i[f]){var d,h,v=s[f]||1;s[f]=v+1,i[Uo()(d="".concat(f)).call(d,s[f])]=p;var m=i[f];delete i[f],i[Uo()(h="".concat(f)).call(h,v)]=m}else i[f]=p}}))})),l},makeExecute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=t.pathName,n=t.method,o=t.operationId;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute(uo()(uo()({spec:e.spec},Xo()(e,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:r,method:n,parameters:t,operationId:o},i))}}}};var ol=r(1099),il=r.n(ol),al=r(775),sl=r.n(al),ll=r(575),cl=r.n(ll),ul=r(1105),fl=r.n(ul),pl={body:function(e){var t=e.req,r=e.value;t.body=r},header:function(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{},void 0!==n&&(t.headers[r.name]=n)},query:function(e){var t=e.req,r=e.value,n=e.parameter;t.query=t.query||{},!1===r&&"boolean"===n.type&&(r="false");0===r&&["number","integer"].indexOf(n.type)>-1&&(r="0");if(r)t.query[n.name]={collectionFormat:n.collectionFormat,value:r};else if(n.allowEmptyValue&&void 0!==r){var o=n.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},path:function(e){var t=e.req,r=e.value,n=e.parameter;t.url=t.url.split("{".concat(n.name,"}")).join(encodeURIComponent(r))},formData:function(e){var t=e.req,r=e.value,n=e.parameter;(r||n.allowEmptyValue)&&(t.form=t.form||{},t.form[n.name]={value:r,allowEmptyValue:n.allowEmptyValue,collectionFormat:n.collectionFormat})}};function dl(e,t){return To()(t).call(t,"application/json")?"string"==typeof e?e:_o()(e):e.toString()}function hl(e){var t=e.req,r=e.value,n=e.parameter,o=n.name,i=n.style,a=n.explode,s=n.content;if(s){var l=Vo()(s)[0];t.url=t.url.split("{".concat(o,"}")).join(Ai(dl(r,l),{escape:!0}))}else{var c=Oi({key:n.name,value:r,style:i||"simple",explode:a||!1,escape:!0});t.url=t.url.split("{".concat(o,"}")).join(c)}}function vl(e){var t=e.req,r=e.value,n=e.parameter;if(t.query=t.query||{},n.content){var o=Vo()(n.content)[0];t.query[n.name]=dl(r,o)}else if(!1===r&&(r="false"),0===r&&(r="0"),r)t.query[n.name]={value:r,serializationOption:Xo()(n,["style","explode","allowReserved"])};else if(n.allowEmptyValue&&void 0!==r){var i=n.name;t.query[i]=t.query[i]||{},t.query[i].allowEmptyValue=!0}}var ml=["accept","authorization","content-type"];function gl(e){var t=e.req,r=e.parameter,n=e.value;if(t.headers=t.headers||{},!(ml.indexOf(r.name.toLowerCase())>-1))if(r.content){var o=Vo()(r.content)[0];t.headers[r.name]=dl(n,o)}else void 0!==n&&(t.headers[r.name]=Oi({key:r.name,value:n,style:r.style||"simple",explode:void 0!==r.explode&&r.explode,escape:!1}))}function yl(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{};var o=wo()(n);if(r.content){var i,a=Vo()(r.content)[0];t.headers.Cookie=Uo()(i="".concat(r.name,"=")).call(i,dl(n,a))}else if("undefined"!==o){var s="object"===o&&!Array.isArray(n)&&r.explode?"":"".concat(r.name,"=");t.headers.Cookie=s+Oi({key:r.name,value:n,escape:!1,style:r.style||"form",explode:void 0!==r.explode&&r.explode})}}var bl=r(776),xl=r.n(bl);function wl(e,t){var r=e.operation,n=e.requestBody,o=e.securities,i=e.spec,a=e.attachContentTypeForEmptyPayload,s=e.requestContentType;t=function(e){var t=e.request,r=e.securities,n=void 0===r?{}:r,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=po()({},t),l=n.authorized,c=void 0===l?{}:l,u=i.security||a.security||[],f=c&&!!Vo()(c).length,p=el()(a,["components","securitySchemes"])||{};if(s.headers=s.headers||{},s.query=s.query||{},!Vo()(n).length||!f||!u||Array.isArray(i.security)&&!i.security.length)return t;return u.forEach((function(e){Vo()(e).forEach((function(e){var t=c[e],r=p[e];if(t){var n=t.value||t,o=r.type;if(t)if("apiKey"===o)"query"===r.in&&(s.query[r.name]=n),"header"===r.in&&(s.headers[r.name]=n),"cookie"===r.in&&(s.cookies[r.name]=n);else if("http"===o){if(/^basic$/i.test(r.scheme)){var i,a=n.username||"",l=n.password||"",u=xl()(Uo()(i="".concat(a,":")).call(i,l));s.headers.Authorization="Basic ".concat(u)}/^bearer$/i.test(r.scheme)&&(s.headers.Authorization="Bearer ".concat(n))}else if("oauth2"===o||"openIdConnect"===o){var f,d=t.token||{},h=d[r["x-tokenName"]||"access_token"],v=d.token_type;v&&"bearer"!==v.toLowerCase()||(v="Bearer"),s.headers.Authorization=Uo()(f="".concat(v," ")).call(f,h)}}}))})),s}({request:t,securities:o,operation:r,spec:i});var l=r.requestBody||{},c=Vo()(l.content||{}),u=s&&c.indexOf(s)>-1;if(n||a){if(s&&u)t.headers["Content-Type"]=s;else if(!s){var f=c[0];f&&(t.headers["Content-Type"]=f,s=f)}}else s&&u&&(t.headers["Content-Type"]=s);if(!e.responseContentType&&r.responses){var p,d=qo()(p=Wo()(r.responses)).call(p,(function(e){var t=ko()(e,2),r=t[0],n=t[1],o=parseInt(r,10);return o>=200&&o<300&&sl()(n.content)})).reduce((function(e,t){var r=ko()(t,2)[1];return Uo()(e).call(e,Vo()(r.content))}),[]);d.length>0&&(t.headers.accept=d.join(", "))}if(n)if(s){if(c.indexOf(s)>-1)if("application/x-www-form-urlencoded"===s||"multipart/form-data"===s)if("object"===wo()(n)){var h=(l.content[s]||{}).encoding||{};t.form={},Vo()(n).forEach((function(e){t.form[e]={value:n[e],encoding:h[e]||{}}}))}else t.form=n;else t.body=n}else t.body=n;return t}function Cl(e,t){var r,n,o=e.spec,i=e.operation,a=e.securities,s=e.requestContentType,l=e.responseContentType,c=e.attachContentTypeForEmptyPayload;if((t=function(e){var t=e.request,r=e.securities,n=void 0===r?{}:r,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=po()({},t),l=n.authorized,c=void 0===l?{}:l,u=n.specSecurity,f=void 0===u?[]:u,p=i.security||f,d=c&&!!Vo()(c).length,h=a.securityDefinitions;if(s.headers=s.headers||{},s.query=s.query||{},!Vo()(n).length||!d||!p||Array.isArray(i.security)&&!i.security.length)return t;return p.forEach((function(e){Vo()(e).forEach((function(e){var t=c[e];if(t){var r=t.token,n=t.value||t,o=h[e],i=o.type,a=o["x-tokenName"]||"access_token",l=r&&r[a],u=r&&r.token_type;if(t)if("apiKey"===i){var f="query"===o.in?"query":"headers";s[f]=s[f]||{},s[f][o.name]=n}else if("basic"===i)if(n.header)s.headers.authorization=n.header;else{var p,d=n.username||"",v=n.password||"";n.base64=xl()(Uo()(p="".concat(d,":")).call(p,v)),s.headers.authorization="Basic ".concat(n.base64)}else if("oauth2"===i&&l){var m;u=u&&"bearer"!==u.toLowerCase()?u:"Bearer",s.headers.authorization=Uo()(m="".concat(u," ")).call(m,l)}}}))})),s}({request:t,securities:a,operation:i,spec:o})).body||t.form||c)if(s)t.headers["Content-Type"]=s;else if(Array.isArray(i.consumes)){var u=ko()(i.consumes,1);t.headers["Content-Type"]=u[0]}else if(Array.isArray(o.consumes)){var f=ko()(o.consumes,1);t.headers["Content-Type"]=f[0]}else i.parameters&&qo()(r=i.parameters).call(r,(function(e){return"file"===e.type})).length?t.headers["Content-Type"]="multipart/form-data":i.parameters&&qo()(n=i.parameters).call(n,(function(e){return"formData"===e.in})).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(s){var p,d,h=i.parameters&&qo()(p=i.parameters).call(p,(function(e){return"body"===e.in})).length>0,v=i.parameters&&qo()(d=i.parameters).call(d,(function(e){return"formData"===e.in})).length>0;(h||v)&&(t.headers["Content-Type"]=s)}return!l&&Array.isArray(i.produces)&&i.produces.length>0&&(t.headers.accept=i.produces.join(", ")),t}var kl=function(e){return Array.isArray(e)?e:[]},Al=ts("OperationNotFoundError",(function(e,t,r){this.originalError=r,Hi()(this,t||{})})),Ol={buildRequest:Sl};function Sl(e){var t,r,n=e.spec,o=e.operationId,a=e.responseContentType,s=e.scheme,l=e.requestInterceptor,c=e.responseInterceptor,u=e.contextUrl,f=e.userFetch,p=e.server,d=e.serverVariables,h=e.http,v=e.parameters,m=e.parameterBuilders,g=Hs(n);m||(m=g?i:pl);var y={url:"",credentials:h&&h.withCredentials?"include":"same-origin",headers:{},cookies:{}};l&&(y.requestInterceptor=l),c&&(y.responseInterceptor=c),f&&(y.userFetch=f);var b=Ks(n,o);if(!b)throw new Al("Operation ".concat(o," not found"));var x=b.operation,w=void 0===x?{}:x,C=b.method,k=b.pathName;if(y.url+=jl({spec:n,scheme:s,contextUrl:u,server:p,serverVariables:d,pathName:k,method:C}),!o)return delete y.cookies,y;y.url+=k,y.method="".concat(C).toUpperCase(),v=v||{};var A=n.paths[k]||{};a&&(y.headers.accept=a);var O=function(e){var t={};e.forEach((function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e}));var r=[];return Vo()(t).forEach((function(e){Vo()(t[e]).forEach((function(n){r.push(t[e][n])}))})),r}(Uo()(t=Uo()(r=[]).call(r,kl(w.parameters))).call(t,kl(A.parameters)));O.forEach((function(e){var t,r,o=m[e.in];if("body"===e.in&&e.schema&&e.schema.properties&&(t=v),void 0===(t=e&&e.name&&v[e.name]))t=e&&e.name&&v[Uo()(r="".concat(e.in,".")).call(r,e.name)];else if(function(e,t){return qo()(t).call(t,(function(t){return t.name===e}))}(e.name,O).length>1){var i;console.warn(Uo()(i="Parameter '".concat(e.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(i,e.name,"' and the passed-in parameter values did not define an 'in' value."))}if(null!==t){if(void 0!==e.default&&void 0===t&&(t=e.default),void 0===t&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter ".concat(e.name," is not provided"));if(g&&e.schema&&"object"===e.schema.type&&"string"==typeof t)try{t=JSON.parse(t)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}o&&o({req:y,parameter:e,value:t,operation:w,spec:n})}}));var S=uo()(uo()({},e),{},{operation:w});if((y=g?wl(S,y):Cl(S,y)).cookies&&Vo()(y.cookies).length){var E=Vo()(y.cookies).reduce((function(e,t){var r=y.cookies[t];return e+(e?"&":"")+fl.a.serialize(t,r)}),"");y.headers.Cookie=E}return y.cookies&&delete y.cookies,zi(y),y}var El=function(e){return e?e.replace(/\W/g,""):null};function jl(e){return Hs(e.spec)?function(e){var t=e.spec,r=e.pathName,n=e.method,o=e.server,i=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,l=el()(t,["paths",r,(n||"").toLowerCase(),"servers"])||el()(t,["paths",r,"servers"])||el()(t,["servers"]),c="",u=null;if(o&&l&&l.length){var f=Ro()(l).call(l,(function(e){return e.url}));f.indexOf(o)>-1&&(c=o,u=l[f.indexOf(o)])}if(!c&&l&&l.length){c=l[0].url;var p=ko()(l,1);u=p[0]}if(c.indexOf("{")>-1){(function(e){var t,r=[],n=/{([^}]+)}/g;for(;t=n.exec(e);)r.push(t[1]);return r})(c).forEach((function(e){if(u.variables&&u.variables[e]){var t=u.variables[e],r=s[e]||t.default,n=new RegExp("{".concat(e,"}"),"g");c=c.replace(n,r)}}))}return function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=r&&n?go.a.parse(go.a.resolve(n,r)):go.a.parse(r),i=go.a.parse(n),a=El(o.protocol)||El(i.protocol)||"",s=o.host||i.host,l=o.pathname||"";e=a&&s?Uo()(t="".concat(a,"://")).call(t,s+l):l;return"/"===e[e.length-1]?xi()(e).call(e,0,-1):e}(c,i)}(e):function(e){var t,r,n=e.spec,o=e.scheme,i=e.contextUrl,a=void 0===i?"":i,s=go.a.parse(a),l=Array.isArray(n.schemes)?n.schemes[0]:null,c=o||l||El(s.protocol)||"http",u=n.host||s.host||"",f=n.basePath||"";t=c&&u?Uo()(r="".concat(c,"://")).call(r,u+f):f;return"/"===t[t.length-1]?xi()(t).call(t,0,-1):t}(e)}function Tl(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?r.url=e:r=e,!(this instanceof Tl))return new Tl(r);po()(this,r);var n=this.resolve().then((function(){return t.disableInterfaces||po()(t,Tl.makeApisTagOperation(t)),t}));return n.client=this,n}Tl.http=Ei,Tl.makeHttp=function(e,t,r){return r=r||function(e){return e},t=t||function(e){return e},function(n){return"string"==typeof n&&(n={url:n}),Si.mergeInQueryOrForm(n),n=t(n),r(e(n))}}.bind(null,Tl.http),Tl.resolve=Qs,Tl.resolveSubtree=function(e,t){return tl.apply(this,arguments)},Tl.execute=function(e){var t=e.http,r=e.fetch,n=e.spec,o=e.operationId,i=e.pathName,a=e.method,s=e.parameters,l=e.securities,c=il()(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),u=t||r||Ei;i&&a&&!o&&(o=$s(i,a));var f=Ol.buildRequest(uo()({spec:n,operationId:o,parameters:s,securities:l,http:u},c));return f.body&&(sl()(f.body)||cl()(f.body))&&(f.body=_o()(f.body)),u(f)},Tl.serializeRes=Pi,Tl.serializeHeaders=Ii,Tl.clearCache=function(){Vs.refs.clearCache()},Tl.makeApisTagOperation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=nl.makeExecute(e);return{apis:nl.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},Tl.buildRequest=Sl,Tl.helpers={opId:qs},Tl.getBaseUrl=jl,Tl.prototype={http:Ei,execute:function(e){return this.applyDefaults(),Tl.execute(uo()({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},e))},resolve:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Tl.resolve(uo()({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},t)).then((function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e}))}},Tl.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&vo()(t,"http")){var r=go.a.parse(t);e.host||(e.host=r.host),e.schemes||(e.schemes=[r.protocol.replace(":","")]),e.basePath||(e.basePath="/")}};Tl.helpers;var Ml=Tl,Pl=r(148),Ll=r(56);function Il(e){return e.startsWith("//")?"https:"+e:e}var Fl={flex:1,display:"flex",flexDirection:"column"},_l=function(e){function t(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"formApi",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"setFormApi",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.formApi=e,setTimeout((function(){n.setState({form:n.formApi.getState()})}),0)}}),Object.defineProperty(n,"handleChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.setState({form:e}),Un(e)}}),Object.defineProperty(n,"handleTabChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.setState({activeTab:e})}}),Object.defineProperty(n,"handleServerChange",{enumerable:!0,configurable:!0,writable:!0,value:function(e){n.setState({server:e})}}),Object.defineProperty(n,"handleExecute",{enumerable:!0,configurable:!0,writable:!0,value:function(){return Object(a.b)(n,void 0,void 0,(function(){var e,t,n,o,i,s,l,c,u,d,h,v,m,g,y,b,x,w,C,k,A,O,S,E,j,T,M,P,L,I,F,_,N,R,D,V=this;return Object(a.e)(this,(function(B){switch(B.label){case 0:if(n=this.props,o=n.store,i=n.operation,this.formApi.submitForm(),s=this.formApi.getState(),l=s.values,s.invalid)return this.setState({shaking:!0}),setTimeout((function(){return V.setState({shaking:!1})}),1e3),null==o||null===(c=o.options.events)||void 0===c||null===(u=c.tryItSent)||void 0===u||u.call(c,{eventType:lo.a.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:i.operationId,operationPath:i.path,operationHttpVerb:i.httpVerb,operationSummary:i.description}),[2];if(d=this.props.operation.requestBody,h=d&&d.content&&d.content.active&&d.content.active.name||"",v=l.body,/json/.test(h))try{v=JSON.parse(v)}catch(e){console.error(e)}if(this.setState({loading:!0}),m=o.dereferencedRawSpec,!(g=Object(f.f)(m,["paths",i.path,(i.httpVerb||"").toLowerCase(),"servers"])||Object(f.f)(m,["paths",i.path,"servers"])||Object(f.f)(m,["servers"])))throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");y=g.find((function(e){return V.state.server.url.endsWith(e.url.endsWith("/")?e.url.substring(0,e.url.length-1):e.url)})),b=Date.now(),x=!!window.document.documentMode,C=l.auth,l.auth?(k=Object.keys(l.auth)[0],A=Object(f.q)(k),w=Object(a.a)(Object(a.a)({},m),{components:Object(a.a)(Object(a.a)({},m.components),{securitySchemes:Object(a.a)(Object(a.a)({},m.components.securitySchemes),(R={},R[A]=Object(a.a)(Object(a.a)({},m.components.securitySchemes[A]),{type:"openIdConnect"===m.components.securitySchemes[A].type?"oauth2":m.components.securitySchemes[A].type}),R))})}),C=Object(a.a)(Object(a.a)({},C),((D={})[A]=C[k],D))):w=Object(a.a)({},m),(O=o.options.corsProxyUrl)&&m.servers&&m.servers.length&&(w.servers=m.servers.map((function(e){return Object(a.a)(Object(a.a)({},e),{url:O+Il(e.url)})}))),S=(null==d||null===(e=d.content)||void 0===e||null===(t=e.active)||void 0===t?void 0:t.name)||null,E="application/x-www-form-urlencoded"===S?Object(p.parse)(v):v,S&&["image/jpeg","image/png","application/octet-stream"].includes(S)&&(j=Object.keys(v).map((function(e){return v[e]})),E=j.length>1?j:j[0]),B.label=1;case 1:return B.trys.push([1,5,8,9]),M={userFetch:x&&r(773).fetch,server:O?O+Il(y.url):y.url,serverVariables:this.state.server.variables,spec:w,pathName:i.path,method:i.httpVerb,parameters:Object(a.a)(Object(a.a)(Object(a.a)(Object(a.a)({},l.path),l.query),l.header),l.cookie),securities:{authorized:C},requestBody:E,requestContentType:S,responseContentType:(null===(T=l.header)||void 0===T?void 0:T.Accept)||null,requestInterceptor:o.options.requestInterceptor&&function(e){var t,r;return null===(t=(r=o.options).requestInterceptor)||void 0===t?void 0:t.call(r,e,i)}||void 0},[4,Ml.execute(M)];case 2:return(P=B.sent())&&P.data instanceof Blob?(L=P,[4,P.data.text()]):[3,4];case 3:L.data=B.sent(),B.label=4;case 4:return this.setState({response:P,error:void 0}),[3,9];case 5:return(I=B.sent())&&I.response&&I.response.data instanceof Blob?(F=I.response,[4,I.response.data.text()]):[3,7];case 6:F.data=B.sent(),B.label=7;case 7:return this.setState({response:void 0,error:I}),[3,9];case 8:return this.setState({loading:!1,activeTab:1,time:Date.now()-b}),null==o||null===(_=o.options.events)||void 0===_||null===(N=_.tryItSent)||void 0===N||N.call(_,{eventType:lo.a.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:i.operationId,operationPath:i.path,operationHttpVerb:i.httpVerb,operationSummary:i.description}),[7];case 9:return[2]}}))}))}}),Object.defineProperty(n,"validateBody",{enumerable:!0,configurable:!0,writable:!0,value:function(){}}),n.state={form:{values:{path:zn(t.operation.parameters,"path"),cookie:zn(t.operation.parameters,"cookie"),header:zn(t.operation.parameters,"header"),query:zn(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}},n}return Object(a.d)(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Object(a.b)(this,void 0,void 0,(function(){var e,t,r,n,o;return Object(a.e)(this,(function(i){switch(i.label){case 0:return e=this.props,t=e.store,r=e.specIdx,n=e.operation,[4,t.dereferenceSpecForTryIt(r||0,n)];case 1:return o=i.sent(),this.setState({resolvedRawSpec:o}),this.formApi.setValues({}),[2]}}))}))}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}}),Object.defineProperty(t.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.operation,r=e.className,n=e.rootElement,o=this.state,i=o.shaking,l=o.activeTab,c=o.form,u=o.response,f=o.loading,p=o.error,h=!(!u&&!p);return s.createElement(Nl,{shaking:i,className:r,rootElement:n},s.createElement(q.c,null,s.createElement(yn,{active:l,hasResponse:h,onChange:this.handleTabChange}),this.props.onClose&&s.createElement(d.a,{onClick:this.props.onClose}," ✕ ")),s.createElement(d.b,{hidden:0!==l},this.renderRequest()),s.createElement(d.b,{hidden:1!==l},this.renderResponse()),s.createElement(ae,{hasResponse:h,params:c.values&&Object(a.a)({},c.values),operation:t,loading:f,execute:this.handleExecute}))}}),Object.defineProperty(t.prototype,"renderRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this.props,r=t.operation,n=t.store,o=t.properties,i=this.state,l=i.form,u=i.resolvedRawSpec,f=i.server,p=l.errors||{},d=p.path||p.cookie||p.header||p.query,v=u&&h.n.get(u,r.pointer),m=l.values&&l.values.auth&&Object.keys(l.values.auth)[0];m&&l.values.auth[m]||(m=void 0),!m||void 0===l.values.auth[m].token&&void 0===l.values.auth[m].client_id&&void 0===l.values.auth[m].client_secret||l.values.auth[m].token&&l.values.auth[m].token.access_token||(m=void 0),m&&null!=l.values.auth[m].username&&(l.values.auth[m].username&&l.values.auth[m].password||(m=void 0));var g=r.parameters||[],y=null==n||null===(e=n.options.hooks)||void 0===e?void 0:e.ReplaceTryItAuthPanel;return u?s.createElement(s.Fragment,null,s.createElement(c.a,{onChange:this.handleChange,getApi:this.setFormApi,style:Object(a.a)(Object(a.a)({},Fl),{margin:0})},s.createElement(q.a,{initialActiveIdx:r.security.length&&m?1:0},r.security.length&&s.createElement(Dl,{header:Object(oo.a)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!m&&!!p.auth,success:!!m},y?s.createElement(Rl,{field:"auth",validate:io},(function(e){return s.createElement(Pl.a,{Hook:y,props:{server:f,operation:r,onChange:e,OAuth2:Nn}})})):s.createElement(so,{formApi:this.formApi,form:l,operation:r,activeServer:f.url,authCorsProxyUrl:n.options.authCorsProxyUrl}))||null,r.requestBody&&s.createElement(Dl,{header:Object(oo.a)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!p.body},s.createElement(hn,{validate:this.validateBody,console:this,body:r.requestBody,id:r.id,resolvedBody:v.requestBody,properties:o}))||null,g.length&&s.createElement(Dl,{header:Object(oo.a)("tryItParameters"),"data-cy":"parameters-trigger",error:d,renderChildrenHidden:!0},s.createElement(H,{operation:r,values:l.values,errors:l.errors||{}}))||null)),s.createElement(_,{operation:r,onChange:this.handleServerChange})):"Loading..."}}),Object.defineProperty(t.prototype,"renderResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.state,t=e.response,r=e.error,n=e.time;return s.createElement(ye,{response:t,error:r,time:n})}}),t=Object(a.c)([u.a],t)}(s.Component);function Nl(e){var t=e.shaking,r=e.className,n=e.children,o=e.rootElement,i=Object(f.r)(o)[0];return s.createElement(d.c,{shaking:t,className:r,"data-cy":"console",fullWidth:null==i?void 0:i.width},n)}function Rl(e){var t=Object(c.c)(Object(a.a)({},e)),r=t.fieldApi,n=t.render,o=t.userProps,i=r.setValue,l=o.children;return n(s.createElement(s.Fragment,null,l(i)))}function Dl(e){return s.createElement(Bl,Object(a.a)({},e,{header:function(t){var r=t.toggle,n=t.expanded;return s.createElement(q.f,{onClick:r,isExpanded:n,"data-cy":e["data-cy"]},s.createElement(q.k,null,s.createElement(q.j,null,e.header),s.createElement(h.R,{direction:n?"down":"right"})),e.error&&s.createElement(h.e,{size:"14px",color:"#ff908b"})||null,e.success&&s.createElement(h.q,{size:"14px",color:"#56ff26"})||null)}}))}var Vl,Bl=Object(m.e)(q.g)(Vl||(Vl=Object(a.f)(["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"],["\n "," {\n color: white;\n border: 1px solid ",";\n padding: 10px;\n }\n\n "," path {\n fill: white;\n }\n\n "," {\n padding: 15px 10px;\n background-color: #3e4c59;\n border: 1px solid ",";\n border-top: 0;\n }\n"])),q.f,(function(e){return e.error?"#ff908b":"#89949f"}),h.R,Ll.a,(function(e){return e.error?"#ff908b":"#89949f"}))},function(e,t,r){"use strict";var n=r(569),o=r(600).f,i=r(709),a=r(566),s=r(611),l=r(577),c=r(574),u=function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,f,p,d,h,v,m,g,y=e.target,b=e.global,x=e.stat,w=e.proto,C=b?n:x?n[y]:(n[y]||{}).prototype,k=b?a:a[y]||(a[y]={}),A=k.prototype;for(p in t)r=!i(b?p:y+(x?".":"#")+p,e.forced)&&C&&c(C,p),h=k[p],r&&(v=e.noTargetGet?(g=o(C,p))&&g.value:C[p]),d=r&&v?v:t[p],r&&typeof h==typeof d||(m=e.bind&&r?s(d,n):e.wrap&&r?u(d):w&&"function"==typeof d?s(Function.call,d):d,(e.sham||d&&d.sham||h&&h.sham)&&l(m,"sham",!0),k[p]=m,w&&(c(a,f=y+"Prototype")||l(a,f,{}),a[f][p]=d,e.real&&A&&!A[p]&&l(A,p,d)))}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(566),o=r(574),i=r(665),a=r(582).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,r(25))},function(e,t,r){var n=r(569),o=r(661),i=r(574),a=r(634),s=r(659),l=r(713),c=o("wks"),u=n.Symbol,f=l?u:u&&u.withoutSetter||a;e.exports=function(e){return i(c,e)&&(s||"string"==typeof c[e])||(s&&i(u,e)?c[e]=u[e]:c[e]=f("Symbol."+e)),c[e]}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(567);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,r){var n=r(571);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(581),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(n(e),t)}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){e.exports=r(934)},function(e,t,r){var n=r(572),o=r(582),i=r(601);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(566);e.exports=function(e){return n[e+"Prototype"]}},function(e,t,r){var n=r(706),o=r(711),i=r(800),a=r(719),s=r(807),l=r(817),c=r(822),u=r(669),f=r(725);function p(e,t){var r=n(e);if(o){var s=o(e);t&&(s=i(s).call(s,(function(t){return a(e,t).enumerable}))),r.push.apply(r,s)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r,n=null!=arguments[t]?arguments[t]:{};if(t%2)s(r=p(Object(n),!0)).call(r,(function(t){f(e,t,n[t])}));else if(l)c(e,l(n));else{var o;s(o=p(Object(n))).call(o,(function(t){u(e,t,a(n,t))}))}}return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(654),o=r(629);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(629);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(572),o=r(708),i=r(573),a=r(630),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(i(e),t=a(t,!0),i(r),o)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(566),o=r(569),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e])||i(o[e]):n[e]&&n[e][t]||o[e]&&o[e][t]}},function(e,t,r){var n=r(728),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,r){e.exports=r(933)},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,r){var n=r(643),o=r(891);function i(t){return"function"==typeof n&&"symbol"==typeof o?(e.exports=i=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e){return e&&"function"==typeof n&&e.constructor===n&&e!==n.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=n||o||i,s=a&&(n?document.documentMode||6:+(i||o)[1]),l=!i&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!i&&/Chrome\//.test(e),f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),v=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),g=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=v||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,l=!0);var C=y&&(c||f&&(null==w||w<12.11)),k=r||a&&s>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O,S=function(e,t){var r=e.className,n=A(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return E(e).appendChild(t)}function T(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i<t.length;++i)o.appendChild(t[i]);return o}function M(e,t,r,n){var o=T(e,t,r,n);return o.setAttribute("role","presentation"),o}function P(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function I(e,t){var r=e.className;A(t).test(r)||(e.className+=(r?" ":"")+t)}function F(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!A(r[n]).test(t)&&(t+=" "+r[n]);return t}O=document.createRange?function(e,t,r,n){var o=document.createRange();return o.setEnd(n||e,r),o.setStart(e,t),o}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var _=function(e){e.select()};function N(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function D(e,t,r,n,o){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var i=n||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=r-a%r,i=s+1}}v?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(e){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var U={toString:function(){return"CodeMirror.Pass"}},z={scroll:!1},W={origin:"*mouse"},H={origin:"+move"};function q(e,t,r){for(var n=0,o=0;;){var i=e.indexOf("\t",n);-1==i&&(i=e.length);var a=i-n;if(i==e.length||o+a>=t)return n+Math.min(a,t-o);if(o+=i-n,n=i+1,(o+=r-o%r)>=t)return n}}var G=[""];function $(e){for(;G.length<=e;)G.push(K(G)+" ");return G[e]}function K(e){return e[e.length-1]}function J(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Y(){}function X(e,t){var r;return Object.create?r=Object.create(e):(Y.prototype=e,r=new Y),t&&R(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Z(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Z(e))||t.test(e):Z(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ne(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,r){for(;(r<0?t>0:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function ie(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var o=(t+r)/2,i=n<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:r;e(i)?r=i:t=i+n}}var ae=null;function se(e,t,r){var n;ae=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==r?n=o:ae=o),i.from==t&&(i.from!=i.to&&"before"!=r?n=o:ae=o)}return null!=n?n:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,o=/[1n]/;function i(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,f=[],p=0;p<u;++p)f.push((c=a.charCodeAt(p))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var d=0,h=l;d<u;++d){var v=f[d];"m"==v?f[d]=h:h=v}for(var m=0,g=l;m<u;++m){var y=f[m];"1"==y&&"r"==g?f[m]="n":r.test(y)&&(g=y,"r"==y&&(f[m]="R"))}for(var b=1,x=f[0];b<u-1;++b){var w=f[b];"+"==w&&"1"==x&&"1"==f[b+1]?f[b]="1":","!=w||x!=f[b+1]||"1"!=x&&"n"!=x||(f[b]=x),x=w}for(var C=0;C<u;++C){var k=f[C];if(","==k)f[C]="N";else if("%"==k){var A=void 0;for(A=C+1;A<u&&"%"==f[A];++A);for(var O=C&&"!"==f[C-1]||A<u&&"1"==f[A]?"1":"N",S=C;S<A;++S)f[S]=O;C=A-1}}for(var E=0,j=l;E<u;++E){var T=f[E];"L"==j&&"1"==T?f[E]="L":r.test(T)&&(j=T)}for(var M=0;M<u;++M)if(t.test(f[M])){var P=void 0;for(P=M+1;P<u&&t.test(f[P]);++P);for(var L="L"==(M?f[M-1]:l),I=L==("L"==(P<u?f[P]:l))?L?"L":"R":l,F=M;F<P;++F)f[F]=I;M=P-1}for(var _,N=[],R=0;R<u;)if(n.test(f[R])){var D=R;for(++R;R<u&&n.test(f[R]);++R);N.push(new i(0,D,R))}else{var V=R,B=N.length,U="rtl"==s?1:0;for(++R;R<u&&"L"!=f[R];++R);for(var z=V;z<R;)if(o.test(f[z])){V<z&&(N.splice(B,0,new i(1,V,z)),B+=U);var W=z;for(++z;z<R&&o.test(f[z]);++z);N.splice(B,0,new i(2,W,z)),B+=U,V=z}else++z;V<R&&N.splice(B,0,new i(1,V,R))}return"ltr"==s&&(1==N[0].level&&(_=a.match(/^\s+/))&&(N[0].from=_[0].length,N.unshift(new i(0,0,_[0].length))),1==K(N).level&&(_=a.match(/\s+$/))&&(K(N).to-=_[0].length,N.push(new i(0,u-_[0].length,u)))),"rtl"==s?N.reverse():N}}();function ce(e,t){var r=e.order;return null==r&&(r=e.order=le(e.text,t)),r}var ue=[],fe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ue).concat(r)}};function pe(e,t){return e._handlers&&e._handlers[t]||ue}function de(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,o=n&&n[t];if(o){var i=B(o,r);i>-1&&(n[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function he(e,t){var r=pe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),o=0;o<r.length;++o)r[o].apply(null,n)}function ve(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),he(e,r||t.type,e,t),we(t)||t.codemirrorIgnore}function me(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function ge(e,t){return pe(e,t).length>0}function ye(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){de(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){be(e),xe(e)}function ke(e){return e.target||e.srcElement}function Ae(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Se,Ee=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function je(e){if(null==Oe){var t=T("span","​");j(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var r=Oe?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Te(e){if(null!=Se)return Se;var t=j(e,document.createTextNode("AخA")),r=O(t,0,1).getBoundingClientRect(),n=O(t,1,2).getBoundingClientRect();return E(e),!(!r||r.left==r.right)&&(Se=n.right-r.right<3)}var Me,Pe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(r.push(i.slice(0,a)),t+=a+1):(r.push(i),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Le=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Me=T("div"))||(Me.setAttribute("oncopy","return;"),"function"==typeof Me.oncopy),Fe=null,_e={},Ne={};function Re(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function De(e){if("string"==typeof e&&Ne.hasOwnProperty(e))e=Ne[e];else if(e&&"string"==typeof e.name&&Ne.hasOwnProperty(e.name)){var t=Ne[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return De("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return De("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=De(t);var r=_e[t.name];if(!r)return Ve(e,"text/plain");var n=r(e,t);if(Be.hasOwnProperty(t.name)){var o=Be[t.name];for(var i in o)o.hasOwnProperty(i)&&(n.hasOwnProperty(i)&&(n["_"+i]=n[i]),n[i]=o[i])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Be={};function Ue(e,t){R(t,Be.hasOwnProperty(e)?Be[e]:Be[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function We(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function He(e,t,r){return!e.startState||e.startState(t,r)}var qe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],i=o.chunkSize();if(t<i){r=o;break}t-=i}return r.lines[t]}function $e(e,t,r){var n=[],o=t.line;return e.iter(t.line,r.line+1,(function(e){var i=e.text;o==r.line&&(i=i.slice(0,r.ch)),o==t.line&&(i=i.slice(t.ch)),n.push(i),++o})),n}function Ke(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function Je(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var o=0;n.children[o]!=t;++o)r+=n.children[o].chunkSize();return r+t.first}function Xe(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var o=e.children[n],i=o.height;if(t<i){e=o;continue e}t-=i,r+=o.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return r+a}function Qe(e,t){return t>=e.first&&t<e.first+e.size}function Ze(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,r){if(void 0===r&&(r=null),!(this instanceof et))return new et(e,t,r);this.line=e,this.ch=t,this.sticky=r}function tt(e,t){return e.line-t.line||e.ch-t.ch}function rt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function nt(e){return et(e.line,e.ch)}function ot(e,t){return tt(e,t)<0?t:e}function it(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var r=e.first+e.size-1;return t.line>r?et(r,Ge(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?et(e.line,t):r<0?et(e.line,0):e}(t,Ge(e,t.line).text.length)}function lt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=st(e,t[n]);return r}qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=D(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?D(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return D(this.string,null,this.tabSize)-(this.lineStart?D(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var o=function(e){return r?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,r,n){var o=[e.state.modeGen],i={};xt(e,t.text,e.doc.mode,r,(function(e,t){return o.push(e,t)}),i,n);for(var a=r.state,s=function(n){r.baseTokens=o;var s=e.state.overlays[n],l=1,c=0;r.state=!0,xt(e,t.text,s.mode,r,(function(e,t){for(var r=l;c<e;){var n=o[l];n>e&&o.splice(l,1,e,o[l+1],n),l+=2,c=Math.min(e,n)}if(t)if(s.opaque)o.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var i=o[r+1];o[r+1]=(i?i+" ":"")+"overlay "+t}}),i),r.state=a,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function pt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=dt(e,Ye(t)),o=t.text.length>e.options.maxHighlightLength&&ze(e.doc.mode,n.state),i=ft(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function dt(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new ut(n,!0,t);var i=function(e,t,r){for(var n,o,i=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=Ge(i,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof ct?c.lookAhead:0)<=i.modeFrontier))return s;var u=D(l.text,null,e.options.tabSize);(null==o||n>u)&&(o=s-1,n=u)}return o}(e,t,r),a=i>n.first&&Ge(n,i-1).stateAfter,s=a?ut.fromSaved(n,a,i):new ut(n,He(n.mode),i);return n.iter(i,t,(function(r){ht(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=o.viewFrom&&n<o.viewTo?s.save():null,s.nextLine()})),r&&(n.modeFrontier=s.line),s}function ht(e,t,r,n){var o=e.doc.mode,i=new qe(t,e.options.tabSize,r);for(i.start=i.pos=n||0,""==t&&vt(o,r.state);!i.eol();)mt(o,i,r.state),i.start=i.pos}function vt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=We(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function mt(e,t,r,n){for(var o=0;o<10;o++){n&&(n[0]=We(e,r).mode);var i=e.token(t,r);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,r){return t instanceof ct?new ut(e,ze(e.mode,t.state),r,t.lookAhead):new ut(e,ze(e.mode,t),r)},ut.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var gt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function yt(e,t,r,n){var o,i,a=e.doc,s=a.mode,l=Ge(a,(t=st(a,t)).line),c=dt(e,t.line,r),u=new qe(l.text,e.options.tabSize,c);for(n&&(i=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=mt(s,u,c.state),n&&i.push(new gt(u,o,ze(a.mode,c.state)));return n?i:new gt(u,o,c.state)}function bt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function xt(e,t,r,n,o,i,a){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,f=new qe(t,e.options.tabSize,n),p=e.options.addModeClass&&[null];for(""==t&&bt(vt(r,n.state),i);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,a&&ht(e,t,n,f.pos),f.pos=t.length,l=null):l=bt(mt(r,f,n.state,p),i),p){var d=p[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||u!=l){for(;c<f.start;)o(c=Math.min(f.start,c+5e3),u);u=l}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e3);o(h,u),c=h}}var wt=!1,Ct=!1;function kt(e,t,r){this.marker=e,this.from=t,this.to=r}function At(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ot(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function St(e,t){if(t.full)return null;var r=Qe(e,t.from.line)&&Ge(e,t.from.line).markedSpans,n=Qe(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!r&&!n)return null;var o=t.from.ch,i=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t)||i.from==t&&"bookmark"==a.type&&(!r||!i.marker.insertLeft)){var s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(n||(n=[])).push(new kt(a,i.from,s?null:i.to))}}return n}(r,o,a),l=function(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker;if(null==i.to||(a.inclusiveRight?i.to>=t:i.to>t)||i.from==t&&"bookmark"==a.type&&(!r||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(n||(n=[])).push(new kt(a,s?null:i.from-t,null==i.to?null:i.to-t))}}return n}(n,i,a),c=1==t.text.length,u=K(t.text).length+(c?o:0);if(s)for(var f=0;f<s.length;++f){var p=s[f];if(null==p.to){var d=At(l,p.marker);d?c&&(p.to=null==d.to?null:d.to+u):p.to=o}}if(l)for(var h=0;h<l.length;++h){var v=l[h];null!=v.to&&(v.to+=u),null==v.from?At(s,v.marker)||(v.from=u,c&&(s||(s=[])).push(v)):(v.from+=u,c&&(s||(s=[])).push(v))}s&&(s=Et(s)),l&&l!=s&&(l=Et(l));var m=[s];if(!c){var g,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(g||(g=[])).push(new kt(s[b].marker,null,null));for(var x=0;x<y;++x)m.push(g);m.push(l)}return m}function Et(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function jt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Tt(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Mt(e){return e.inclusiveLeft?-1:0}function Pt(e){return e.inclusiveRight?1:0}function Lt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),o=t.find(),i=tt(n.from,o.from)||Mt(e)-Mt(t);if(i)return-i;var a=tt(n.to,o.to)||Pt(e)-Pt(t);return a||t.id-e.id}function It(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var o=void 0,i=0;i<n.length;++i)(o=n[i]).marker.collapsed&&null==(t?o.from:o.to)&&(!r||Lt(r,o.marker)<0)&&(r=o.marker);return r}function Ft(e){return It(e,!0)}function _t(e){return It(e,!1)}function Nt(e,t){var r,n=Ct&&e.markedSpans;if(n)for(var o=0;o<n.length;++o){var i=n[o];i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!r||Lt(r,i.marker)<0)&&(r=i.marker)}return r}function Rt(e,t,r,n,o){var i=Ge(e,t),a=Ct&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,r)||Mt(l.marker)-Mt(o),f=tt(c.to,n)||Pt(l.marker)-Pt(o);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.to,r)>=0:tt(c.to,r)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?tt(c.from,n)<=0:tt(c.from,n)<0)))return!0}}}function Dt(e){for(var t;t=Ft(e);)e=t.find(-1,!0).line;return e}function Vt(e,t){var r=Ge(e,t),n=Dt(r);return r==n?t:Ye(n)}function Bt(e,t){if(t>e.lastLine())return t;var r,n=Ge(e,t);if(!Ut(e,n))return t;for(;r=_t(n);)n=r.find(1,!0).line;return Ye(n)+1}function Ut(e,t){var r=Ct&&t.markedSpans;if(r)for(var n=void 0,o=0;o<r.length;++o)if((n=r[o]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&zt(e,t,n))return!0}}function zt(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return zt(e,n.line,At(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if((o=t.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==r.to&&(null==o.to||o.to!=r.from)&&(o.marker.inclusiveLeft||r.marker.inclusiveRight)&&zt(e,t,o))return!0}function Wt(e){for(var t=0,r=(e=Dt(e)).parent,n=0;n<r.lines.length;++n){var o=r.lines[n];if(o==e)break;t+=o.height}for(var i=r.parent;i;i=(r=i).parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==r)break;t+=s.height}return t}function Ht(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ft(n);){var o=t.find(0,!0);n=o.from.line,r+=o.from.ch-o.to.ch}for(n=e;t=_t(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,r+=(n=i.to.line).text.length-i.to.ch}return r}function qt(e){var t=e.display,r=e.doc;t.maxLine=Ge(r,r.first),t.maxLineLength=Ht(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Ht(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Gt=function(e,t,r){this.text=e,Tt(this,t),this.height=r?r(this):1};function $t(e){e.parent=null,jt(e)}Gt.prototype.lineNo=function(){return Ye(this)},ye(Gt);var Kt={},Jt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Jt:Kt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var r=M("span",null,null,l?"padding-right: .1px":null),n={pre:M("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;n.pos=0,n.addToken=Zt,Te(e.display.measure)&&(a=ce(i,e.doc.direction))&&(n.addToken=er(n.addToken,a)),n.map=[],rr(i,n,pt(e,i,t!=e.display.externalMeasured&&Ye(i))),i.styleClasses&&(i.styleClasses.bgClass&&(n.bgClass=F(i.styleClasses.bgClass,n.bgClass||"")),i.styleClasses.textClass&&(n.textClass=F(i.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return he(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=F(n.pre.className,n.textClass||"")),n}function Qt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Zt(e,t,r,n,o,i,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!r||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i=" "),n+=i,r=" "==i}return n}(t,e.trailingSpace):t,f=e.cm.state.specialChars,p=!1;if(f.test(t)){c=document.createDocumentFragment();for(var d=0;;){f.lastIndex=d;var h=f.exec(t),v=h?h.index-d:t.length-d;if(v){var m=document.createTextNode(u.slice(d,d+v));a&&s<9?c.appendChild(T("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+v,m),e.col+=v,e.pos+=v}if(!h)break;d+=v+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=c.appendChild(T("span",$(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((g=c.appendChild(T("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(T("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||o||p||i||l){var x=r||"";n&&(x+=n),o&&(x+=o);var w=T("span",[c],x,i);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,l[C]);return e.content.appendChild(w)}e.content.appendChild(c)}}function er(e,t){return function(r,n,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var f=void 0,p=0;p<t.length&&!((f=t[p]).to>c&&f.from<=c);p++);if(f.to>=u)return e(r,n,o,i,a,s,l);e(r,n.slice(0,f.to-c),o,i,null,s,l),i=null,n=n.slice(f.to-c),c=f.to}}}function tr(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,o=e.text,i=0;if(n)for(var a,s,l,c,u,f,p,d=o.length,h=0,v=1,m="",g=0;;){if(g==h){l=c=u=s="",p=null,f=null,g=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var w=n[x],C=w.marker;if("bookmark"==C.type&&w.from==h&&C.widgetNode)y.push(C);else if(w.from<=h&&(null==w.to||w.to>h||C.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&g>w.to&&(g=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&w.from==h&&(u+=" "+C.startStyle),C.endStyle&&w.to==g&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((p||(p={})).title=C.title),C.attributes)for(var k in C.attributes)(p||(p={}))[k]=C.attributes[k];C.collapsed&&(!f||Lt(f.marker,C)<0)&&(f=w)}else w.from>h&&g>w.from&&(g=w.from)}if(b)for(var A=0;A<b.length;A+=2)b[A+1]==g&&(c+=" "+b[A]);if(!f||f.from==h)for(var O=0;O<y.length;++O)tr(t,0,y[O]);if(f&&(f.from||0)==h){if(tr(t,(null==f.to?d+1:f.to)-h,f.marker,null==f.from),null==f.to)return;f.to==h&&(f=!1)}}if(h>=d)break;for(var S=Math.min(d,g);;){if(m){var E=h+m.length;if(!f){var j=E>S?m.slice(0,S-h):m;t.addToken(t,j,a?a+l:l,u,h+j.length==g?c:"",s,p)}if(E>=S){m=m.slice(S-h),h=S;break}h=E,u=""}m=o.slice(i,i=r[v++]),a=Yt(r[v++],t.cm.options)}}else for(var T=1;T<r.length;T+=2)t.addToken(t,o.slice(i,i=r[T]),Yt(r[T+1],t.cm.options))}function nr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=_t(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?Ye(K(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function or(e,t,r){for(var n,o=[],i=t;i<r;i=n){var a=new nr(e.doc,Ge(e.doc,i),i);n=i+a.size,o.push(a)}return o}var ir=null,ar=null;function sr(e,t){var r=pe(e,t);if(r.length){var n,o=Array.prototype.slice.call(arguments,2);ir?n=ir.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(lr,0));for(var i=function(e){n.push((function(){return r[e].apply(null,o)}))},a=0;a<r.length;++a)i(a)}}function lr(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cr(e,t,r,n){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?pr(e,t):"gutter"==i?hr(e,t,r,n):"class"==i?dr(e,t):"widget"==i&&vr(e,t,n)}t.changes=null}function ur(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Xt(e,t)}function pr(e,t){var r=t.text.className,n=fr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,dr(e,t)):r&&(t.text.className=r)}function dr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=ur(t);t.background=n.insertBefore(T("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ur(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function hr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=ur(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=ur(t),s=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(T("div",Ze(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=i.hasOwnProperty(c)&&i[c];u&&s.appendChild(T("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function vr(e,t,r){t.alignable&&(t.alignable=null);for(var n=A("CodeMirror-linewidget"),o=t.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,n.test(o.className)&&t.node.removeChild(o);gr(e,t,r)}function mr(e,t,r,n){var o=fr(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),dr(e,t),hr(e,t,r,n),gr(e,t,n),t.node}function gr(e,t,r){if(yr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)yr(e,t.rest[n],t,r,!1)}function yr(e,t,r,n,o){if(t.widgets)for(var i=ur(r),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),br(l,c,r,n),e.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,r.gutter||r.text):i.appendChild(c),sr(l,"redraw")}}function br(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var o=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(o-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function xr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),j(t.display.measure,T("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function wr(e,t){for(var r=ke(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Cr(e){return e.lineSpace.offsetTop}function kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ar(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=j(e.measure,T("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Or(e){return 50-e.display.nativeBarWidth}function Sr(e){return e.display.scroller.clientWidth-Or(e)-e.display.barWidth}function Er(e){return e.display.scroller.clientHeight-Or(e)-e.display.barHeight}function jr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var o=0;o<e.rest.length;o++)if(Ye(e.rest[o])>r)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Tr(e,t,r,n){return Lr(e,Pr(e,t),r,n)}function Mr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[un(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Pr(e,t){var r=Ye(t),n=Mr(e,r);n&&!n.text?n=null:n&&n.changes&&(cr(e,n,r,on(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=Ye(t=Dt(t)),n=e.display.externalMeasured=new nr(e.doc,t,r);n.lineN=r;var o=n.built=Xt(e,n);return n.text=o.pre,j(e.display.lineMeasure,o.pre),n}(e,t));var o=jr(n,t,r);return{line:t,view:n,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Lr(e,t,r,n,o){t.before&&(r=-1);var i,l=r+(n||"");return t.cache.hasOwnProperty(l)?i=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,o=n&&Sr(e);if(!t.measure.heights||n&&t.measure.width!=o){var i=t.measure.heights=[];if(n){t.measure.width=o;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-r.top)}}i.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,r,n){var o,i=_r(t.map,r,n),l=i.node,c=i.start,u=i.end,f=i.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){for(;c&&ne(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&ne(t.line.text.charAt(i.coverStart+u));)++u;if((o=a&&s<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():Nr(O(l,c,u).getClientRects(),n)).left||o.right||0==c)break;u=c,c-=1,f="right"}a&&s<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Fe)return Fe;var t=j(e,T("span","x")),r=t.getBoundingClientRect(),n=O(t,0,1).getBoundingClientRect();return Fe=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,o))}else{var d;c>0&&(f=n="right"),o=e.options.lineWrapping&&(d=l.getClientRects()).length>1?d["right"==n?d.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+nn(e.display),top:h.top,bottom:h.bottom}:Fr}for(var v=o.top-t.rect.top,m=o.bottom-t.rect.top,g=(v+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var x=b?y[b-1]:0,w=y[b],C={left:("right"==f?o.right:o.left)-t.rect.left,right:("left"==f?o.left:o.right)-t.rect.left,top:x,bottom:w};return o.left||o.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=v,C.rbottom=m),C}(e,t,r,n)).bogus||(t.cache[l]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var Ir,Fr={left:0,right:0,top:0,bottom:0};function _r(e,t,r){for(var n,o,i,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(o=0,i=1,a="left"):t<l?i=1+(o=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(n=e[c+2],s==l&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&o==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function Nr(e,t){var r=Fr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var o=e.length-1;o>=0&&(r=e[o]).left==r.right;o--);return r}function Rr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Dr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Rr(e.display.view[t])}function Vr(e){Dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Br(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ur(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function zr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=xr(e.widgets[r]));return t}function Wr(e,t,r,n,o){if(!o){var i=zr(t);r.top+=i,r.bottom+=i}if("line"==n)return r;n||(n="local");var a=Wt(t);if("local"==n?a+=Cr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==n?0:Ur());var l=s.left+("window"==n?0:Br());r.left+=l,r.right+=l}return r.top+=a,r.bottom+=a,r}function Hr(e,t,r){if("div"==r)return t;var n=t.left,o=t.top;if("page"==r)n-=Br(),o-=Ur();else if("local"==r||!r){var i=e.display.sizer.getBoundingClientRect();n+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:o-a.top}}function qr(e,t,r,n,o){return n||(n=Ge(e.doc,t.line)),Wr(e,n,Tr(e,n,t.ch,o),r)}function Gr(e,t,r,n,o,i){function a(t,a){var s=Lr(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,Wr(e,n,s,r)}n=n||Ge(e.doc,t.line),o||(o=Pr(e,n));var s=ce(n,e.doc.direction),l=t.ch,c=t.sticky;if(l>=n.text.length?(l=n.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var f=se(s,l,c),p=ae,d=u(l,f,"before"==c);return null!=p&&(d.other=u(l,p,"before"!=c)),d}function $r(e,t){var r=0;t=st(e.doc,t),e.options.lineWrapping||(r=nn(e.display)*t.ch);var n=Ge(e.doc,t.line),o=Wt(n)+Cr(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function Kr(e,t,r,n,o){var i=et(e,t,r);return i.xRel=o,n&&(i.outside=n),i}function Jr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Kr(n.first,0,null,-1,-1);var o=Xe(n,r),i=n.first+n.size-1;if(o>i)return Kr(n.first+n.size-1,Ge(n,i).text.length,null,1,1);t<0&&(t=0);for(var a=Ge(n,o);;){var s=Zr(e,a,o,t,r),l=Nt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==o)return c;a=Ge(n,o=c.line)}}function Yr(e,t,r,n){n-=zr(t);var o=t.text.length,i=ie((function(t){return Lr(e,r,t-1).bottom<=n}),o,0);return{begin:i,end:o=ie((function(t){return Lr(e,r,t).top>n}),i,o)}}function Xr(e,t,r,n){return r||(r=Pr(e,t)),Yr(e,t,r,Wr(e,t,Lr(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Zr(e,t,r,n,o){o-=Wt(t);var i=Pr(e,t),a=zr(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?tn:en)(e,t,r,i,u,n,o);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var p,d,h=null,v=null,m=ie((function(t){var r=Lr(e,i,t);return r.top+=a,r.bottom+=a,!!Qr(r,n,o,!1)&&(r.top<=o&&r.left<=n&&(h=t,v=r),!0)}),s,l),g=!1;if(v){var y=n-v.left<v.right-n,b=y==c;m=h+(b?0:1),d=b?"after":"before",p=y?v.left:v.right}else{c||m!=l&&m!=s||m++,d=0==m?"after":m==t.text.length?"before":Lr(e,i,m-(c?1:0)).bottom+a<=o==c?"after":"before";var x=Gr(e,et(r,m,d),"line",t,i);p=x.left,g=o<x.top?-1:o>=x.bottom?1:0}return Kr(r,m=oe(t.text,m,1),d,g,n-p)}function en(e,t,r,n,o,i,a){var s=ie((function(s){var l=o[s],c=1!=l.level;return Qr(Gr(e,et(r,c?l.to:l.from,c?"before":"after"),"line",t,n),i,a,!0)}),0,o.length-1),l=o[s];if(s>0){var c=1!=l.level,u=Gr(e,et(r,c?l.from:l.to,c?"after":"before"),"line",t,n);Qr(u,i,a,!0)&&u.top>a&&(l=o[s-1])}return l}function tn(e,t,r,n,o,i,a){var s=Yr(e,t,n,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,p=0;p<o.length;p++){var d=o[p];if(!(d.from>=c||d.to<=l)){var h=Lr(e,n,1!=d.level?Math.min(c,d.to)-1:Math.max(l,d.from)).right,v=h<i?i-h+1e9:h-i;(!u||f>v)&&(u=d,f=v)}}return u||(u=o[o.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(T("br"));Ir.appendChild(document.createTextNode("x"))}j(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),E(e.measure),r||1}function nn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),r=T("pre",[t],"CodeMirror-line-like");j(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function on(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=i.offsetLeft+i.clientLeft+o,n[s]=i.clientWidth}return{fixedPos:an(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function an(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sn(e){var t=rn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(o){if(Ut(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return r?i+(Math.ceil(o.text.length/n)||1)*t:i+t}}function ln(e){var t=e.doc,r=sn(e);t.iter((function(e){var t=r(e);t!=e.height&&Je(e,t)}))}function cn(e,t,r,n){var o=e.display;if(!r&&"true"==ke(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=Jr(e,i,a);if(n&&c.xRel>0&&(l=Ge(e.doc,c.line).text).length==c.ch){var u=D(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((i-Ar(e.display).left)/nn(e.display))-u))}return c}function un(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function fn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var o=e.display;if(n&&r<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Ct&&Vt(e.doc,t)<o.viewTo&&dn(e);else if(r<=o.viewFrom)Ct&&Bt(e.doc,r+n)>o.viewFrom?dn(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)dn(e);else if(t<=o.viewFrom){var i=hn(e,r,r+n,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=n):dn(e)}else if(r>=o.viewTo){var a=hn(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):dn(e)}else{var s=hn(e,t,t,-1),l=hn(e,r,r+n,1);s&&l?(o.view=o.view.slice(0,s.index).concat(or(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=n):dn(e)}var c=o.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(o.externalMeasured=null))}function pn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var i=n.view[un(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==B(a,r)&&a.push(r)}}}function dn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hn(e,t,r,n){var o,i=un(e,t),a=e.display.view;if(!Ct||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(n>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,r+=o}for(;Vt(e.doc,r)!=r;){if(i==(n<0?0:a.length-1))return null;r+=n*a[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function vn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var o=t[n];o.hidden||o.node&&!o.changes||++r}return r}function mn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function gn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},o=n.cursors=document.createDocumentFragment(),i=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var s=r.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&yn(e,s.head,o),l||xn(e,s,i)}}return n}function yn(e,t,r){var n=Gr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(T("div"," ","CodeMirror-cursor"));if(o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var i=r.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));i.style.display="",i.style.left=n.other.left+"px",i.style.top=n.other.top+"px",i.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function bn(e,t){return e.top-t.top||e.left-t.left}function xn(e,t,r){var n=e.display,o=e.doc,i=document.createDocumentFragment(),a=Ar(e.display),s=a.left,l=Math.max(n.sizerWidth,Sr(e)-n.sizer.offsetLeft)-a.right,c="ltr"==o.direction;function u(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?l-e:r)+"px;\n height: "+(n-t)+"px"))}function f(t,r,n){var i,a,f=Ge(o,t),p=f.text.length;function d(r,n){return qr(e,et(t,r),"div",f,n)}function h(t,r,n){var o=Xr(e,f,null,t),i="ltr"==r==("after"==n)?"left":"right";return d("after"==n?o.begin:o.end-(/\s/.test(f.text.charAt(o.end-1))?2:1),i)[i]}var v=ce(f,o.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",i),o=!0)}o||n(t,r,"ltr")}(v,r||0,null==n?p:n,(function(e,t,o,f){var m="ltr"==o,g=d(e,m?"left":"right"),y=d(t-1,m?"right":"left"),b=null==r&&0==e,x=null==n&&t==p,w=0==f,C=!v||f==v.length-1;if(y.top-g.top<=3){var k=(c?x:b)&&C,A=(c?b:x)&&w?s:(m?g:y).left,O=k?l:(m?y:g).right;u(A,g.top,O-A,g.bottom)}else{var S,E,j,T;m?(S=c&&b&&w?s:g.left,E=c?l:h(e,o,"before"),j=c?s:h(t,o,"after"),T=c&&x&&C?l:y.right):(S=c?h(e,o,"before"):s,E=!c&&b&&w?l:g.right,j=!c&&x&&C?s:y.left,T=c?h(t,o,"after"):l),u(S,g.top,E-S,g.bottom),g.bottom<y.top&&u(s,g.bottom,null,y.top),u(j,y.top,T-j,y.bottom)}(!i||bn(g,i)<0)&&(i=g),bn(y,i)<0&&(i=y),(!a||bn(g,a)<0)&&(a=g),bn(y,a)<0&&(a=y)})),{start:i,end:a}}var p=t.from(),d=t.to();if(p.line==d.line)f(p.line,p.ch,d.ch);else{var h=Ge(o,p.line),v=Ge(o,d.line),m=Dt(h)==Dt(v),g=f(p.line,p.ch,m?h.text.length+1:null).end,y=f(d.line,m?0:null,d.ch).start;m&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(s,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(s,g.bottom,null,y.top)}r.appendChild(i)}function wn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||On(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Cn(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||An(e))}function kn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&On(e))}),100)}function An(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(he(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),wn(e))}function On(e,t){e.state.delayingBlurEvent||(e.state.focused&&(he(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Sn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var o=t.view[n],i=e.options.lineWrapping,l=void 0,c=0;if(!o.hidden){if(a&&s<8){var u=o.node.offsetTop+o.node.offsetHeight;l=u-r,r=u}else{var f=o.node.getBoundingClientRect();l=f.bottom-f.top,!i&&o.text.firstChild&&(c=o.text.firstChild.getBoundingClientRect().right-f.left-1)}var p=o.line.height-l;if((p>.005||p<-.005)&&(Je(o.line,l),En(o.line),o.rest))for(var d=0;d<o.rest.length;d++)En(o.rest[d]);if(c>e.display.sizerWidth){var h=Math.ceil(c/nn(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}}function En(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function jn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Cr(e));var o=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,i=Xe(t,n),a=Xe(t,o);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<i?(i=s,a=Xe(t,Wt(Ge(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=Xe(t,Wt(Ge(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Tn(e,t){var r=e.display,n=rn(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,i=Er(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+kr(r),l=t.top<n,c=t.bottom>s-n;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var u=Math.min(t.top,(c?s:t.bottom)-i);u!=o&&(a.scrollTop=u)}var f=e.options.fixedGutter?0:r.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-f,d=Sr(e)-r.gutters.offsetWidth,h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left+f-(h?0:10)):t.right>d+p-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function Mn(e,t){null!=t&&(In(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Pn(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ln(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function In(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fn(e,$r(e,t.from),$r(e,t.to),t.margin))}function Fn(e,t,r,n){var o=Tn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Ln(e,o.scrollLeft,o.scrollTop)}function _n(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||lo(e,{top:t}),Nn(e,t,!0),r&&lo(e),no(e,100))}function Nn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Rn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,fo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+kr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Or(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Vn=function(e,t,r){this.cm=r;var n=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),fe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),fe(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Vn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vn.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},Vn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var o=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Vn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Bn=function(){};function Un(e,t){t||(t=Dn(e));var r=e.display.barWidth,n=e.display.barHeight;zn(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&Sn(e),zn(e,Dn(e)),r=e.display.barWidth,n=e.display.barHeight}function zn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Bn.prototype.update=function(){return{bottom:0,right:0}},Bn.prototype.setScrollLeft=function(){},Bn.prototype.setScrollTop=function(){},Bn.prototype.clear=function(){};var Wn={native:Vn,null:Bn};function Hn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Rn(e,t):_n(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var qn=0;function Gn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qn,markArrays:null},t=e.curOp,ir?ir.ops.push(t):t.ownsGroup=ir={ops:[t],delayedCallbacks:[]}}function $n(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var o=e.ops[n];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(r<t.length)}(r)}finally{ir=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Kn(t[r]);for(var n=0;n<t.length;n++)Jn(t[n]);for(var o=0;o<t.length;o++)Yn(t[o]);for(var i=0;i<t.length;i++)Xn(t[i]);for(var a=0;a<t.length;a++)Qn(t[a])}(e)}))}function Kn(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Or(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Or(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&qt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jn(e){e.updatedDisplay=e.mustUpdate&&ao(e.cm,e.update)}function Yn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Sn(t),e.barMeasure=Dn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Tr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Or(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Sr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Xn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Un(t,e.barMeasure),e.updatedDisplay&&uo(t,e.barMeasure),e.selectionChanged&&wn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Cn(e.cm)}function Qn(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&so(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Nn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Rn(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ve(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),o=null;if(t.top+n.top<0?o=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=T("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Cr(e.display))+"px;\n height: "+(t.bottom-t.top+Or(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,r,n){var o;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var a=!1,s=Gr(e,t),l=r&&r!=t?Gr(e,r):s,c=Tn(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(_n(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Rn(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return o}(t,st(n,e.scrollToPos.from),st(n,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||he(o[a],"hide");if(i)for(var s=0;s<i.length;++s)i[s].lines.length&&he(i[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&he(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zn(e,t){if(e.curOp)return t();Gn(e);try{return t()}finally{$n(e)}}function eo(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gn(e);try{return t.apply(e,arguments)}finally{$n(e)}}}function to(e){return function(){if(this.curOp)return e.apply(this,arguments);Gn(this);try{return e.apply(this,arguments)}finally{$n(this)}}}function ro(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gn(t);try{return e.apply(this,arguments)}finally{$n(t)}}}function no(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,N(oo,e))}function oo(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=dt(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(n.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?ze(t.mode,n.state):null,l=ft(e,i,n,!0);s&&(n.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!f&&p<a.length;++p)f=a[p]!=i.styles[p];f&&o.push(n.line),i.stateAfter=n.save(),n.nextLine()}else i.text.length<=e.options.maxHighlightLength&&ht(e,i.text,n),i.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return no(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Zn(e,(function(){for(var t=0;t<o.length;t++)pn(e,o[t],"text")}))}}var io=function(e,t,r){var n=e.display;this.viewport=t,this.visible=jn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Sr(e),this.force=r,this.dims=on(e),this.events=[]};function ao(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return dn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==vn(e))return!1;po(e)&&(dn(e),t.dims=on(e));var o=n.first+n.size,i=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFrom<i&&i-r.viewFrom<20&&(i=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),Ct&&(i=Vt(e.doc,i),a=Bt(e.doc,a));var s=i!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=or(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(un(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(or(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,un(e,r)))),n.viewTo=r}(e,i,a),r.viewOffset=Wt(Ge(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=vn(e);if(!s&&0==c&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=L();if(!t||!P(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&P(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return c>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,o=e.options.lineNumbers,i=n.lineDiv,a=i.firstChild;function s(t){var r=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var c=n.view,u=n.viewFrom,f=0;f<c.length;f++){var p=c[f];if(p.hidden);else if(p.node&&p.node.parentNode==i){for(;a!=p.node;)a=s(a);var d=o&&null!=t&&t<=u&&p.lineNumber;p.changes&&(B(p.changes,"gutter")>-1&&(d=!1),cr(e,p,u,r)),d&&(E(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Ze(e.options,u)))),a=p.node.nextSibling}else{var h=mr(e,p,u,r);i.insertBefore(h,a)}u+=p.size}for(;a;)a=s(a)}(e,r.updateLineNumbers,t.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(u),E(r.cursorDiv),E(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,no(e,400)),r.updateLineNumbers=null,!0}function so(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Sr(e))n&&(t.visible=jn(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+kr(e.display)-Er(e),r.top)}),t.visible=jn(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ao(e,t))break;Sn(e);var o=Dn(e);mn(e),Un(e,o),uo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function lo(e,t){var r=new io(e,t);if(ao(e,r)){Sn(e),so(e,r);var n=Dn(e);mn(e),Un(e,n),uo(e,n),r.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",sr(e,"gutterChanged",e)}function uo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Or(e)+"px"}function fo(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=an(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=i),r[a].gutterBackground&&(r[a].gutterBackground.style.left=i));var s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=n+o+"px")}}function po(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Ze(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var o=n.measure.appendChild(T("div",[T("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(i,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",co(e.display),!0}return!1}function ho(e,t){for(var r=[],n=!1,o=0;o<e.length;o++){var i=e[o],a=null;if("string"!=typeof i&&(a=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;n=!0}r.push({className:i,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function vo(e){var t=e.gutters,r=e.gutterSpecs;E(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var o=r[n],i=o.className,a=o.style,s=t.appendChild(T("div",null,"CodeMirror-gutter "+i));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==i&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",co(e)}function mo(e){vo(e.display),fn(e),fo(e)}function go(e,t,n,o){var i=this;this.input=n,i.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=M("div",null,"CodeMirror-code"),i.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=T("div",null,"CodeMirror-cursors"),i.measure=T("div",null,"CodeMirror-measure"),i.lineMeasure=T("div",null,"CodeMirror-measure"),i.lineSpace=M("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=M("div",[i.lineSpace],"CodeMirror-lines");i.mover=T("div",[c],null,"position: relative"),i.sizer=T("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=T("div",null,null,"position: absolute; height: 50px; width: 1px;"),i.gutters=T("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=T("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=T("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||r&&g||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=ho(o.gutters,o.lineNumbers),vo(i),n.init(i)}io.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)he.apply(null,this.events[e])};var yo=0,bo=null;function xo(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function wo(e){var t=xo(e);return t.x*=bo,t.y*=bo,t}function Co(e,t){var n=xo(t),o=n.x,i=n.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(o&&c||i&&u){if(i&&y&&l)e:for(var p=t.target,d=a.view;p!=s;p=p.parentNode)for(var h=0;h<d.length;h++)if(d[h].node==p){e.display.currentWheelTarget=p;break e}if(o&&!r&&!f&&null!=bo)return i&&u&&_n(e,Math.max(0,s.scrollTop+i*bo)),Rn(e,Math.max(0,s.scrollLeft+o*bo)),(!i||i&&u)&&be(t),void(a.wheelStartX=null);if(i&&null!=bo){var v=i*bo,m=e.doc.scrollTop,g=m+a.wrapper.clientHeight;v<0?m=Math.max(0,m+v-50):g=Math.min(e.doc.height,g+v+50),lo(e,{top:m,bottom:g})}yo<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=o,a.wheelDY=i,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,r=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,r&&(bo=(bo*yo+r)/(yo+1),++yo)}}),200)):(a.wheelDX+=o,a.wheelDY+=i))}}a?bo=-.53:r?bo=15:u?bo=-.7:p&&(bo=-1/3);var ko=function(e,t){this.ranges=e,this.primIndex=t};ko.prototype.primary=function(){return this.ranges[this.primIndex]},ko.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!rt(r.anchor,n.anchor)||!rt(r.head,n.head))return!1}return!0},ko.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ao(nt(this.ranges[t].anchor),nt(this.ranges[t].head));return new ko(e,this.primIndex)},ko.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ko.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(tt(t,n.from())>=0&&tt(e,n.to())<=0)return r}return-1};var Ao=function(e,t){this.anchor=e,this.head=t};function Oo(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort((function(e,t){return tt(e.from(),t.from())})),r=B(t,o);for(var i=1;i<t.length;i++){var a=t[i],s=t[i-1],l=tt(s.to(),a.from());if(n&&!a.empty()?l>0:l>=0){var c=it(s.from(),a.from()),u=ot(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;i<=r&&--r,t.splice(--i,2,new Ao(f?u:c,f?c:u))}}return new ko(t,r)}function So(e,t){return new ko([new Ao(e,t||e)],0)}function Eo(e){return e.text?et(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function jo(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Eo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Eo(t).ch-t.to.ch),et(r,n)}function To(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var o=e.sel.ranges[n];r.push(new Ao(jo(o.anchor,t),jo(o.head,t)))}return Oo(e.cm,r,e.sel.primIndex)}function Mo(e,t,r){return e.line==t.line?et(r.line,e.ch-t.ch+r.ch):et(r.line+(e.line-t.line),e.ch)}function Po(e){e.doc.mode=Ve(e.options,e.doc.modeOption),Lo(e)}function Lo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,no(e,100),e.state.modeGen++,e.curOp&&fn(e)}function Io(e,t){return 0==t.from.ch&&0==t.to.ch&&""==K(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fo(e,t,r,n){function o(e){return r?r[e]:null}function i(e,r,o){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),jt(e),Tt(e,r);var o=n?n(e):1;o!=e.height&&Je(e,o)}(e,r,o,n),sr(e,"change",e,t)}function a(e,t){for(var r=[],i=e;i<t;++i)r.push(new Gt(c[i],o(i),n));return r}var s=t.from,l=t.to,c=t.text,u=Ge(e,s.line),f=Ge(e,l.line),p=K(c),d=o(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Io(e,t)){var v=a(0,c.length-1);i(f,f.text,d),h&&e.remove(s.line,h),v.length&&e.insert(s.line,v)}else if(u==f)if(1==c.length)i(u,u.text.slice(0,s.ch)+p+u.text.slice(l.ch),d);else{var m=a(1,c.length-1);m.push(new Gt(p+u.text.slice(l.ch),d,n)),i(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,m)}else if(1==c.length)i(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),o(0)),e.remove(s.line+1,h);else{i(u,u.text.slice(0,s.ch)+c[0],o(0)),i(f,p+f.text.slice(l.ch),d);var g=a(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}sr(e,"change",e,t)}function _o(e,t,r){!function e(n,o,i){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;r&&!l||(t(s.doc,l),e(s.doc,n,l))}}}(e,null,!0)}function No(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ln(e),Po(e),Ro(e),e.options.direction=t.direction,e.options.lineWrapping||qt(e),e.options.mode=t.modeOption,fn(e)}function Ro(e){("rtl"==e.doc.direction?I:S)(e.display.lineDiv,"CodeMirror-rtl")}function Do(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Vo(e,t){var r={from:nt(t.from),to:Eo(t),text:$e(e,t.from,t.to)};return Ho(e,r,t.from.line,t.to.line+1),_o(e,(function(e){return Ho(e,r,t.from.line,t.to.line+1)}),!0),r}function Bo(e){for(;e.length&&K(e).ranges;)e.pop()}function Uo(e,t,r,n){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(Bo(e.done),K(e.done)):e.done.length&&!K(e.done).ranges?K(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}(o,o.lastOp==n)))a=K(i.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Eo(t):i.changes.push(Vo(e,t));else{var l=K(o.done);for(l&&l.ranges||Wo(e.sel,o.done),i={changes:[Vo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,a||he(e,"historyAdded")}function zo(e,t,r,n){var o=e.history,i=n&&n.origin;r==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,r,n){var o=t.charAt(0);return"*"==o||"+"==o&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,K(o.done),t))?o.done[o.done.length-1]=t:Wo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=r,n&&!1!==n.clearRedo&&Bo(o.undone)}function Wo(e,t){var r=K(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ho(e,t,r,n){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=r.markedSpans),++i}))}function qo(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Go(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],o=0;o<t.text.length;++o)n.push(qo(r[o]));return n}(e,t),n=St(e,t);if(!r)return n;if(!n)return r;for(var o=0;o<r.length;++o){var i=r[o],a=n[o];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue e;i.push(l)}else a&&(r[o]=a)}return r}function $o(e,t,r){for(var n=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)n.push(r?ko.prototype.deepCopy.call(i):i);else{var a=i.changes,s=[];n.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&B(t,Number(u[1]))>-1&&(K(s)[f]=c[f],delete c[f])}}}return n}function Ko(e,t,r,n){if(n){var o=e.anchor;if(r){var i=tt(t,o)<0;i!=tt(r,o)<0?(o=t,t=r):i!=tt(t,r)<0&&(t=r)}return new Ao(o,t)}return new Ao(r||t,t)}function Jo(e,t,r,n,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ei(e,new ko([Ko(e.sel.primary(),t,r,o)],0),n)}function Yo(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)n[i]=Ko(e.sel.ranges[i],t[i],null,o);ei(e,Oo(e.cm,n,e.sel.primIndex),r)}function Xo(e,t,r,n){var o=e.sel.ranges.slice(0);o[t]=r,ei(e,Oo(e.cm,o,e.sel.primIndex),n)}function Qo(e,t,r,n){ei(e,So(t,r),n)}function Zo(e,t,r){var n=e.history.done,o=K(n);o&&o.ranges?(n[n.length-1]=t,ti(e,t,r)):ei(e,t,r)}function ei(e,t,r){ti(e,t,r),zo(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ti(e,t,r){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Ao(st(e,t[r].anchor),st(e,t[r].head))},origin:r&&r.origin};return he(e,"beforeSelectionChange",e,n),e.cm&&he(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Oo(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ri(e,oi(e,t,n,!0)),r&&!1===r.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Pn(e.cm)}function ri(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,me(e.cm)),sr(e,"cursorActivity",e))}function ni(e){ri(e,oi(e,e.sel,null,!1))}function oi(e,t,r,n){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=ai(e,a.anchor,s&&s.anchor,r,n),c=ai(e,a.head,s&&s.head,r,n);(o||l!=a.anchor||c!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new Ao(l,c))}return o?Oo(e.cm,o,t.primIndex):t}function ii(e,t,r,n,o){var i=Ge(e,t.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(o&&(he(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var f=l.find(n<0?1:-1),p=void 0;if((n<0?u:c)&&(f=si(e,f,-n,f&&f.line==t.line?i:null)),f&&f.line==t.line&&(p=tt(f,r))&&(n<0?p<0:p>0))return ii(e,f,t,n,o)}var d=l.find(n<0?-1:1);return(n<0?c:u)&&(d=si(e,d,n,d.line==t.line?i:null)),d?ii(e,d,t,n,o):null}}return t}function ai(e,t,r,n,o){var i=n||1,a=ii(e,t,r,i,o)||!o&&ii(e,t,r,i,!0)||ii(e,t,r,-i,o)||!o&&ii(e,t,r,-i,!0);return a||(e.cantEdit=!0,et(e.first,0))}function si(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:r>0&&t.ch==(n||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+r)}function li(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),z)}function ci(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,o,i){t&&(n.from=st(e,t)),r&&(n.to=st(e,r)),o&&(n.text=o),void 0!==i&&(n.origin=i)}),he(e,"beforeChange",e,n),e.cm&&he(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ui(e,t,r){if(e.cm){if(!e.cm.curOp)return eo(e.cm,ui)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))||(t=ci(e,t,!0))){var n=wt&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var o=[{from:t,to:r}],i=0;i<n.length;++i)for(var a=n[i],s=a.find(0),l=0;l<o.length;++l){var c=o[l];if(!(tt(c.to,s.from)<0||tt(c.from,s.to)>0)){var u=[l,1],f=tt(c.from,s.from),p=tt(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)fi(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else fi(e,t)}}function fi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var r=To(e,t);Uo(e,t,r,e.cm?e.cm.curOp.id:NaN),hi(e,t,r,St(e,t));var n=[];_o(e,(function(e,r){r||-1!=B(n,e.history)||(yi(e.history,t),n.push(e.history)),hi(e,t,null,St(e,t))}))}}function pi(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var o,i=e.history,a=e.sel,s="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,c=0;c<s.length&&(o=s[c],r?!o.ranges||o.equals(e.sel):o.ranges);c++);if(c!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=s.pop()).ranges){if(n)return void s.push(o);break}if(Wo(o,l),r&&!o.equals(e.sel))return void ei(e,o,{clearRedo:!1});a=o}var u=[];Wo(a,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var f=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),p=function(r){var n=o.changes[r];if(n.origin=t,f&&!ci(e,n,!1))return s.length=0,{};u.push(Vo(e,n));var i=r?To(e,n):K(s);hi(e,n,i,Go(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:Eo(n)});var a=[];_o(e,(function(e,t){t||-1!=B(a,e.history)||(yi(e.history,n),a.push(e.history)),hi(e,n,null,Go(e,n))}))},d=o.changes.length-1;d>=0;--d){var h=p(d);if(h)return h.v}}}}function di(e,t){if(0!=t&&(e.first+=t,e.sel=new ko(J(e.sel.ranges,(function(e){return new Ao(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){fn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)pn(e.cm,n,"gutter")}}function hi(e,t,r,n){if(e.cm&&!e.cm.curOp)return eo(e.cm,hi)(e,t,r,n);if(t.to.line<e.first)di(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);di(e,o),t={from:et(e.first,0),to:et(t.to.line+o,t.to.ch),text:[K(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:et(i,Ge(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$e(e,t.from,t.to),r||(r=To(e,t)),e.cm?function(e,t,r){var n=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=Ye(Dt(Ge(n,i.line))),n.iter(l,a.line+1,(function(e){if(e==o.maxLine)return s=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&me(e),Fo(n,t,r,sn(e)),e.options.lineWrapping||(n.iter(l,i.line+t.text.length,(function(e){var t=Ht(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var o=Ge(e,n).stateAfter;if(o&&(!(o instanceof ct)||n+o.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,i.line),no(e,400);var c=t.text.length-(a.line-i.line)-1;t.full?fn(e):i.line!=a.line||1!=t.text.length||Io(e.doc,t)?fn(e,i.line,a.line+1,c):pn(e,i.line,"text");var u=ge(e,"changes"),f=ge(e,"change");if(f||u){var p={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&sr(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}(e.cm,t,n):Fo(e,t,n),ti(e,r,z),e.cantEdit&&ai(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function vi(e,t,r,n,o){var i;n||(n=r),tt(n,r)<0&&(r=(i=[n,r])[0],n=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ui(e,{from:r,to:n,text:t,origin:o})}function mi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function gi(e,t,r,n){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)mi(i.ranges[s].anchor,t,r,n),mi(i.ranges[s].head,t,r,n)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(r<c.from.line)c.from=et(c.from.line+n,c.from.ch),c.to=et(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function yi(e,t){var r=t.from.line,n=t.to.line,o=t.text.length-(n-r)-1;gi(e.done,r,n,o),gi(e.undone,r,n,o)}function bi(e,t,r,n){var o=t,i=t;return"number"==typeof t?i=Ge(e,at(e,t)):o=Ye(t),null==o?null:(n(i,o)&&e.cm&&pn(e.cm,o,r),i)}function xi(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function wi(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var o=e[n];t+=o.chunkSize(),r+=o.height,o.parent=this}this.size=t,this.height=r,this.parent=null}Ao.prototype.from=function(){return it(this.anchor,this.head)},Ao.prototype.to=function(){return ot(this.anchor,this.head)},Ao.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},xi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var o=this.lines[r];this.height-=o.height,$t(o),sr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},wi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var i=Math.min(t,o-e),a=n.height;if(n.removeInner(e,i),this.height-=a-n.height,o==i&&(this.children.splice(r--,1),n.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof xi))){var s=[];this.collapse(s),this.children=[new xi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var o=this.children[n],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new xi(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++n,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new wi(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new wi(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var o=this.children[n],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var Ci=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function ki(e,t,r){Wt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Mn(e,r)}Ci.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Ye(r);if(null!=n&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(r.widgets=null);var i=xr(this);Je(r,Math.max(0,r.height-i)),e&&(Zn(e,(function(){ki(e,r,-i),pn(e,n,"widget")})),sr(e,"lineWidgetCleared",e,this,n))}},Ci.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var o=xr(this)-t;o&&(Ut(this.doc,n)||Je(n,n.height+o),r&&Zn(r,(function(){r.curOp.forceUpdate=!0,ki(r,n,o),sr(r,"lineWidgetChanged",r,e,Ye(n))})))},ye(Ci);var Ai=0,Oi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ai};function Si(e,t,r,n,o){if(n&&n.shared)return function(e,t,r,n,o){(n=R(n)).shared=!1;var i=[Si(e,t,r,n,o)],a=i[0],s=n.widgetNode;return _o(e,(function(e){s&&(n.widgetNode=s.cloneNode(!0)),i.push(Si(e,st(e,t),st(e,r),n,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=K(i)})),new Ei(i,a)}(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return eo(e.cm,Si)(e,t,r,n,o);var i=new Oi(e,o),a=tt(t,r);if(n&&R(n,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=M("span",[i.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Rt(e,t.line,t,r,i)||t.line!=r.line&&Rt(e,r.line,t,r,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}i.addToHistory&&Uo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,r.line+1,(function(n){c&&i.collapsed&&!c.options.lineWrapping&&Dt(n)==c.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&Je(n,0),function(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}(n,new kt(i,l==t.line?t.ch:null,l==r.line?r.ch:null),e.cm&&e.cm.curOp),++l})),i.collapsed&&e.iter(t.line,r.line+1,(function(t){Ut(e,t)&&Je(t,0)})),i.clearOnEnter&&fe(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(wt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Ai,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)fn(c,t.line,r.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=r.line;u++)pn(c,u,"text");i.atomic&&ni(c.doc),sr(c,"markerAdded",c,i)}return i}Oi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gn(e),ge(this,"clear")){var r=this.find();r&&sr(this,"clear",r.from,r.to)}for(var n=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=At(a.markedSpans,this);e&&!this.collapsed?pn(e,Ye(a),"text"):e&&(null!=s.to&&(o=Ye(a)),null!=s.from&&(n=Ye(a))),a.markedSpans=Ot(a.markedSpans,s),null==s.from&&this.collapsed&&!Ut(this.doc,a)&&e&&Je(a,rn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Dt(this.lines[l]),u=Ht(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&fn(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ni(e.doc)),e&&sr(e,"markerCleared",e,this,n,o),t&&$n(e),this.parent&&this.parent.clear()}},Oi.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=At(i.markedSpans,this);if(null!=a.from&&(r=et(t?i:Ye(i),a.from),-1==e))return r;if(null!=a.to&&(n=et(t?i:Ye(i),a.to),1==e))return n}return r&&{from:r,to:n}},Oi.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Zn(n,(function(){var o=t.line,i=Ye(t.line),a=Mr(n,i);if(a&&(Rr(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ut(r.doc,o)&&null!=r.height){var s=r.height;r.height=null;var l=xr(r)-s;l&&Je(o,o.height+l)}sr(n,"markerChanged",n,e)}))},Oi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Oi.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(Oi);var Ei=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ji(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ti(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];_o(r.primary.doc,(function(e){return n.push(e)}));for(var o=0;o<r.markers.length;o++){var i=r.markers[o];-1==B(n,i.doc)&&(i.parent=null,r.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}Ei.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();sr(this,"clear")}},Ei.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Ei);var Mi=0,Pi=function(e,t,r,n,o){if(!(this instanceof Pi))return new Pi(e,t,r,n,o);null==r&&(r=0),wi.call(this,[new xi([new Gt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var i=et(r,0);this.sel=So(i),this.history=new Do(null),this.id=++Mi,this.modeOption=t,this.lineSep=n,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Fo(this,{from:i,to:i,text:e}),ei(this,So(i),z)};Pi.prototype=X(wi.prototype,{constructor:Pi,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ke(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ro((function(e){var t=et(this.first,0),r=this.first+this.size-1;ui(this,{from:t,to:et(r,Ge(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ln(this.cm,0,0),ei(this,So(t),z)})),replaceRange:function(e,t,r,n){vi(this,e,t=st(this,t),r=r?st(this,r):t,n)},getRange:function(e,t,r){var n=$e(this,st(this,e),st(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Qe(this,e))return Ge(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),Dt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ro((function(e,t,r){Qo(this,st(this,"number"==typeof e?et(e,t||0):e),null,r)})),setSelection:ro((function(e,t,r){Qo(this,st(this,e),st(this,t||e),r)})),extendSelection:ro((function(e,t,r){Jo(this,st(this,e),t&&st(this,t),r)})),extendSelections:ro((function(e,t){Yo(this,lt(this,e),t)})),extendSelectionsBy:ro((function(e,t){Yo(this,lt(this,J(this.sel.ranges,e)),t)})),setSelections:ro((function(e,t,r){if(e.length){for(var n=[],o=0;o<e.length;o++)n[o]=new Ao(st(this,e[o].anchor),st(this,e[o].head||e[o].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ei(this,Oo(this.cm,n,t),r)}})),addSelection:ro((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ao(st(this,e),st(this,t||e))),ei(this,Oo(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var o=$e(this,r[n].from(),r[n].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var o=$e(this,r[n].from(),r[n].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[n]=o}return t},replaceSelection:function(e,t,r){for(var n=[],o=0;o<this.sel.ranges.length;o++)n[o]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ro((function(e,t,r){for(var n=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];n[i]={from:a.from(),to:a.to(),text:this.splitLines(e[i]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],o=et(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=Mo(s.from,o,i),c=Mo(Eo(s),o,i);if(o=s.to,i=c,"around"==r){var u=e.sel.ranges[a],f=tt(u.head,u.anchor)<0;n[a]=new Ao(f?c:l,f?l:c)}else n[a]=new Ao(l,l)}return new ko(n,e.sel.primIndex)}(this,n,t),l=n.length-1;l>=0;l--)ui(this,n[l]);s?Zo(this,s):this.cm&&Pn(this.cm)})),undo:ro((function(){pi(this,"undo")})),redo:ro((function(){pi(this,"redo")})),undoSelection:ro((function(){pi(this,"undo",!0)})),redoSelection:ro((function(){pi(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Do(this.history),_o(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:$o(this.history.done),undone:$o(this.history.undone)}},setHistory:function(e){var t=this.history=new Do(this.history);t.done=$o(e.done.slice(0),null,!0),t.undone=$o(e.undone.slice(0),null,!0)},setGutterMarker:ro((function(e,t,r){return bi(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&te(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ro((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&bi(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,te(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Qe(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Ye(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ro((function(e,t,r){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(A(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:ro((function(e,t,r){return bi(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[n];if(!o)return!1;if(null==r)e[n]=null;else{var i=o.match(A(r));if(!i)return!1;var a=i.index+i[0].length;e[n]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0}))})),addLineWidget:ro((function(e,t,r){return function(e,t,r,n){var o=new Ci(e,r,n),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),bi(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==o.insertAt?r.push(o):r.splice(Math.min(r.length,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!Ut(e,t)){var n=Wt(t)<e.scrollTop;Je(t,t.height+xr(o)),n&&Mn(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&sr(i,"lineWidgetAdded",i,o,"number"==typeof t?t:Ye(t)),o}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Si(this,st(this,e),st(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Si(this,e=st(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Ge(this,(e=st(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var o=r[n];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=st(this,e),t=st(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++o})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+n;if(i>e)return t=e,!0;e-=i,++r})),st(this,et(r,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new Pi(Ke(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Pi(Ke(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],o=n.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(tt(i,a)){var s=Si(e,i,a,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,ji(this)),n},unlinkDoc:function(e){if(e instanceof Ea&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ti(ji(this));break}if(e.history==this.history){var r=[e.id];_o(e,(function(e){return r.push(e.id)}),!0),e.history=new Do(null),e.history.done=$o(this.history.done,r),e.history.undone=$o(this.history.undone,r)}},iterLinkedDocs:function(e){_o(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Pe(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ro((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Zn(t=this.cm,(function(){Ro(t),fn(t)})))}))}),Pi.prototype.eachLine=Pi.prototype.iter;var Li=0;function Ii(e){var t=this;if(Fi(t),!ve(t,e)&&!wr(t.display,e)){be(e),a&&(Li=+new Date);var r=cn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,i=Array(o),s=0,l=function(){++s==o&&eo(t,(function(){var e={from:r=st(t.doc,r),to:r,text:t.doc.splitLines(i.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};ui(t.doc,e),Zo(t.doc,So(st(t.doc,r),st(t.doc,Eo(e))))}))()},c=function(e,r){if(t.options.allowDropFileTypes&&-1==B(t.options.allowDropFileTypes,e.type))l();else{var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(i[r]=e),l()},n.readAsText(e)}},u=0;u<n.length;u++)c(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ti(t.doc,So(r,r)),p)for(var d=0;d<p.length;++d)vi(t.doc,"",p[d].anchor,p[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Fi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _i(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var o=t[n].CodeMirror;o&&r.push(o)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Ni=!1;function Ri(){var e;Ni||(fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_i(Di)}),100))})),fe(window,"blur",(function(){return _i(On)})),Ni=!0)}function Di(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Bi=0;Bi<10;Bi++)Vi[Bi+48]=Vi[Bi+96]=String(Bi);for(var Ui=65;Ui<=90;Ui++)Vi[Ui]=String.fromCharCode(Ui);for(var zi=1;zi<=12;zi++)Vi[zi+111]=Vi[zi+63235]="F"+zi;var Wi={};function Hi(e){var t,r,n,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function qi(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var o=J(r.split(" "),Hi),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=n):(s=o.slice(0,i+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Gi(e,t,r,n){var o=(t=Yi(t)).call?t.call(e,n):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&r(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Gi(e,t.fallthrough,r,n);for(var i=0;i<t.fallthrough.length;i++){var a=Gi(e,t.fallthrough[i],r,n);if(a)return a}}}function $i(e){var t="string"==typeof e?e:Vi[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ki(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Ji(e,t){if(f&&34==e.keyCode&&e.char)return!1;var r=Vi[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Ki(r,e,t))}function Yi(e){return"string"==typeof e?Wi[e]:e}function Xi(e,t){for(var r=e.doc.sel.ranges,n=[],o=0;o<r.length;o++){for(var i=t(r[o]);n.length&&tt(i.from,K(n).to)<=0;){var a=n.pop();if(tt(a.from,i.from)<0){i.from=a.from;break}}n.push(i)}Zn(e,(function(){for(var t=n.length-1;t>=0;t--)vi(e.doc,"",n[t].from,n[t].to,"+delete");Pn(e)}))}function Qi(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Zi(e,t,r){var n=Qi(e,t.ch,r);return null==n?null:new et(t.line,n,r<0?"after":"before")}function ea(e,t,r,n,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(r,t.doc.direction);if(i){var a,s=o<0?K(i):i[0],l=o<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Pr(t,r);a=o<0?r.text.length-1:0;var u=Lr(t,c,a).top;a=ie((function(e){return Lr(t,c,e).top==u}),o<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Qi(r,a,1))}else a=o<0?s.to:s.from;return new et(n,a,l)}}return new et(n,o<0?r.text.length:0,o<0?"before":"after")}Wi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wi.default=y?Wi.macDefault:Wi.pcDefault;var ta={selectAll:li,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Xi(e,(function(t){if(t.empty()){var r=Ge(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Xi(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Xi(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Xi(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Xi(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Ge(e.doc,t),n=function(e){for(var t;t=_t(e);)e=t.find(1,!0).line;return e}(r);return n!=r&&(t=Ye(n)),ea(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),H)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),H)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?na(e,t.head):n}),H)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,o=0;o<r.length;o++){var i=r[o].from(),a=D(e.getLine(i.line),i.ch,n);t.push($(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zn(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var o=t[n].head,i=Ge(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new et(o.line,o.ch-1)),o.ch>0)o=new et(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Ge(e.doc,o.line-1).text;a&&(o=new et(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(o.line-1,a.length-1),o,"+transpose"))}r.push(new Ao(o,o))}e.setSelections(r)}))},newlineAndIndent:function(e){return Zn(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Pn(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ra(e,t){var r=Ge(e.doc,t),n=Dt(r);return n!=r&&(t=Ye(n)),ea(!0,e,n,t,1)}function na(e,t){var r=ra(e,t.line),n=Ge(e.doc,r.line),o=ce(n,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(r.ch,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=i&&t.ch;return et(r.line,a?0:i,r.sticky)}return r}function oa(e,t,r){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),o=t(e)!=U}finally{e.display.shift=n,e.state.suppressEdits=!1}return o}var ia=new V;function aa(e,t,r,n){var o=e.state.keySeq;if(o){if($i(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ia.set(50,(function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,o+" "+t,r,n))return!0}return sa(e,t,r,n)}function sa(e,t,r,n){var o=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var o=Gi(t,e.state.keyMaps[n],r,e);if(o)return o}return e.options.extraKeys&&Gi(t,e.options.extraKeys,r,e)||Gi(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&sr(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(be(r),wn(e)),!!o}function la(e,t){var r=Ji(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+r,t,(function(t){return oa(e,t,!0)}))||aa(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return oa(e,t)})):aa(e,r,t,(function(t){return oa(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=L(),ve(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var o=la(t,e);f&&(ca=o?n:null,o||88!=n||Ie||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),r&&!y&&!o&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(S(t,"CodeMirror-crosshair"),de(document,"keyup",r),de(document,"mouseover",r))}I(t,"CodeMirror-crosshair"),fe(document,"keyup",r),fe(document,"mouseover",r)}(t)}}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ve(this,e)}function pa(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||wr(t.display,e)||ve(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(f&&r==ca)return ca=null,void be(e);if(!f||e.which&&!(e.which<10)||!la(t,e)){var o=String.fromCharCode(null==n?r:n);"\b"!=o&&(function(e,t,r){return aa(e,"'"+r+"'",t,(function(t){return oa(e,t,!0)}))}(t,e,o)||t.display.input.onKeyPress(e))}}}var da,ha,va=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ma(e){var t=this,r=t.display;if(!(ve(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,wr(r,e))l||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!ba(t,e)){var n=cn(t,e),o=Ae(e),i=n?function(e,t){var r=+new Date;return ha&&ha.compare(r,e,t)?(da=ha=null,"triple"):da&&da.compare(r,e,t)?(ha=new va(r,e,t),da=null,"double"):(da=new va(r,e,t),ha=null,"single")}(n,o):"single";window.focus(),1==o&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,o){var i="Click";return"double"==n?i="Double"+i:"triple"==n&&(i="Triple"+i),aa(e,Ki(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=U}finally{e.state.suppressEdits=!1}return n}))}(t,o,n,i,e)||(1==o?n?function(e,t,r,n){a?setTimeout(N(Cn,e),0):e.curOp.focus=L();var o,i=function(e,t,r){var n=e.getOption("configureMouse"),o=n?n(e,t,r):{};if(null==o.unit){var i=b?r.shiftKey&&r.metaKey:r.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||r.shiftKey),null==o.addNew&&(o.addNew=y?r.metaKey:r.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(y?r.altKey:r.ctrlKey)),o}(e,r,n),c=e.doc.sel;e.options.dragDrop&&Ee&&!e.isReadOnly()&&"single"==r&&(o=c.contains(t))>-1&&(tt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(tt(o.to(),t)>0||t.xRel<0)?function(e,t,r,n){var o=e.display,i=!1,c=eo(e,(function(t){l&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:kn(e)),de(o.wrapper.ownerDocument,"mouseup",c),de(o.wrapper.ownerDocument,"mousemove",u),de(o.scroller,"dragstart",f),de(o.scroller,"drop",c),i||(be(t),n.addNew||Jo(e.doc,r,null,null,n.extend),l&&!p||a&&9==s?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return i=!0};l&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!n.moveOnDrag,fe(o.wrapper.ownerDocument,"mouseup",c),fe(o.wrapper.ownerDocument,"mousemove",u),fe(o.scroller,"dragstart",f),fe(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,n,t,i):function(e,t,r,n){a&&kn(e);var o=e.display,i=e.doc;be(t);var s,l,c=i.sel,u=c.ranges;if(n.addNew&&!n.extend?(l=i.sel.contains(r),s=l>-1?u[l]:new Ao(r,r)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new Ao(r,r)),r=cn(e,t,!0,!0),l=-1;else{var f=ga(e,r,n.unit);s=n.extend?Ko(s,f.anchor,f.head,n.extend):f}n.addNew?-1==l?(l=u.length,ei(i,Oo(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==n.unit&&!n.extend?(ei(i,Oo(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Xo(i,l,s,W):(l=0,ei(i,new ko([s],0),W),c=i.sel);var p=r;function d(t){if(0!=tt(p,t))if(p=t,"rectangle"==n.unit){for(var o=[],a=e.options.tabSize,u=D(Ge(i,r.line).text,r.ch,a),f=D(Ge(i,t.line).text,t.ch,a),d=Math.min(u,f),h=Math.max(u,f),v=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));v<=m;v++){var g=Ge(i,v).text,y=q(g,d,a);d==h?o.push(new Ao(et(v,y),et(v,y))):g.length>y&&o.push(new Ao(et(v,y),et(v,q(g,h,a))))}o.length||o.push(new Ao(r,r)),ei(i,Oo(e,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,w=ga(e,t,n.unit),C=x.anchor;tt(w.anchor,C)>0?(b=w.head,C=it(x.from(),w.anchor)):(b=w.anchor,C=ot(x.to(),w.head));var k=c.ranges.slice(0);k[l]=function(e,t){var r=t.anchor,n=t.head,o=Ge(e.doc,r.line);if(0==tt(r,n)&&r.sticky==n.sticky)return t;var i=ce(o);if(!i)return t;var a=se(i,r.ch,r.sticky),s=i[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,c=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(i,n.ch,n.sticky),f=u-a||(n.ch-r.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var p=i[c+(l?-1:0)],d=l==(1==p.level),h=d?p.from:p.to,v=d?"after":"before";return r.ch==h&&r.sticky==v?t:new Ao(new et(r.line,h,v),n)}(e,new Ao(st(i,C),b)),ei(i,Oo(e,k,l),W)}}var h=o.wrapper.getBoundingClientRect(),v=0;function m(t){e.state.selectingText=!1,v=1/0,t&&(be(t),o.input.focus()),de(o.wrapper.ownerDocument,"mousemove",g),de(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var g=eo(e,(function(t){0!==t.buttons&&Ae(t)?function t(r){var a=++v,s=cn(e,r,!0,"rectangle"==n.unit);if(s)if(0!=tt(s,p)){e.curOp.focus=L(),d(s);var l=jn(o,i);(s.line>=l.to||s.line<l.from)&&setTimeout(eo(e,(function(){v==a&&t(r)})),150)}else{var c=r.clientY<h.top?-20:r.clientY>h.bottom?20:0;c&&setTimeout(eo(e,(function(){v==a&&(o.scroller.scrollTop+=c,t(r))})),50)}}(t):m(t)})),y=eo(e,m);e.state.selectingText=y,fe(o.wrapper.ownerDocument,"mousemove",g),fe(o.wrapper.ownerDocument,"mouseup",y)}(e,n,t,i)}(t,n,i,e):ke(e)==r.scroller&&be(e):2==o?(n&&Jo(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==o&&(k?t.display.input.onContextMenu(e):kn(t)))}}function ga(e,t,r){if("char"==r)return new Ao(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ao(et(t.line,0),st(e.doc,et(t.line+1,0)));var n=r(e,t);return new Ao(n.from,n.to)}function ya(e,t,r,n){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!ge(e,r))return we(t);i-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o)return he(e,r,e,Xe(e.doc,i),e.display.gutterSpecs[l].className,t),we(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function xa(e,t){wr(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||ve(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function wa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vr(e)}va.prototype.compare=function(e,t,r){return this.time+400>e&&0==tt(t,this.pos)&&r==this.button};var Ca={toString:function(){return"CodeMirror.Init"}},ka={},Aa={};function Oa(e,t,r){if(!t!=!(r&&r!=Ca)){var n=e.display.dragFunctions,o=t?fe:de;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Sa(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),qt(e)),ln(e),fn(e),Vr(e),setTimeout((function(){return Un(e)}),100)}function Ea(e,t){var r=this;if(!(this instanceof Ea))return new Ea(e,t);this.options=t=t?R(t):{},R(ka,t,!1);var n=t.value;"string"==typeof n?n=new Pi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Ea.inputStyles[t.inputStyle](this),i=this.display=new go(e,n,o,t);for(var c in i.wrapper.CodeMirror=this,wa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new V,keySeq:null,specialChars:null},t.autofocus&&!g&&i.input.focus(),a&&s<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",eo(e,ma)),fe(t.scroller,"dblclick",a&&s<11?eo(e,(function(t){if(!ve(e,t)){var r=cn(e,t);if(r&&!ba(e,t)&&!wr(e.display,t)){be(t);var n=e.findWordAt(r);Jo(e.doc,n.anchor,n.head)}}})):function(t){return ve(e,t)||be(t)}),fe(t.scroller,"contextmenu",(function(t){return xa(e,t)})),fe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||xa(e,r)}));var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function i(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}fe(t.scroller,"touchstart",(function(o){if(!ve(e,o)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(o)&&!ba(e,o)){t.input.ensurePolled(),clearTimeout(r);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-n.end<=300?n:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!wr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!n.prev||i(n,n.prev)?new Ao(s,s):!n.prev.prev||i(n,n.prev.prev)?e.findWordAt(s):new Ao(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(r)}o()})),fe(t.scroller,"touchcancel",o),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(_n(e,t.scroller.scrollTop),Rn(e,t.scroller.scrollLeft,!0),he(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return Co(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return Co(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||Ce(t)},over:function(t){ve(e,t)||(function(e,t){var r=cn(e,t);if(r){var n=document.createDocumentFragment();yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),j(e.display.dragCursor,n)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Li<100))Ce(t);else if(!ve(e,t)&&!wr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var r=T("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}(e,t)},drop:eo(e,Ii),leave:function(t){ve(e,t)||Fi(e)}};var l=t.input.getField();fe(l,"keyup",(function(t){return fa.call(e,t)})),fe(l,"keydown",eo(e,ua)),fe(l,"keypress",eo(e,pa)),fe(l,"focus",(function(t){return An(e,t)})),fe(l,"blur",(function(t){return On(e,t)}))}(this),Ri(),Gn(this),this.curOp.forceUpdate=!0,No(this,n),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&An(r)}),20):On(this),Aa)Aa.hasOwnProperty(c)&&Aa[c](this,t[c],Ca);po(this),t.finishInit&&t.finishInit(this);for(var u=0;u<ja.length;++u)ja[u](this);$n(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}Ea.defaults=ka,Ea.optionHandlers=Aa;var ja=[];function Ta(e,t,r,n){var o,i=e.doc;null==r&&(r="add"),"smart"==r&&(i.mode.indent?o=dt(e,t).state:r="prev");var a=e.options.tabSize,s=Ge(i,t),l=D(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((c=i.mode.indent(o,s.text.slice(u.length),s.text))==U||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>i.first?D(Ge(i,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var f="",p=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)p+=a,f+="\t";if(p<c&&(f+=$(c-p)),f!=u)return vi(i,f,et(t,0),et(t,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var v=i.sel.ranges[h];if(v.head.line==t&&v.head.ch<u.length){var m=et(t,u.length);Xo(i,h,new Ao(m,m));break}}}Ea.defineInitHook=function(e){return ja.push(e)};var Ma=null;function Pa(e){Ma=e}function La(e,t,r,n,o){var i=e.doc;e.display.shift=!1,n||(n=i.sel);var a=+new Date-200,s="paste"==o||e.state.pasteIncoming>a,l=Pe(t),c=null;if(s&&n.ranges.length>1)if(Ma&&Ma.text.join("\n")==t){if(n.ranges.length%Ma.text.length==0){c=[];for(var u=0;u<Ma.text.length;u++)c.push(i.splitLines(Ma.text[u]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=J(l,(function(e){return[e]})));for(var f=e.curOp.updateInput,p=n.ranges.length-1;p>=0;p--){var d=n.ranges[p],h=d.from(),v=d.to();d.empty()&&(r&&r>0?h=et(h.line,h.ch-r):e.state.overwrite&&!s?v=et(v.line,Math.min(Ge(i,v.line).text.length,v.ch+K(l).length)):s&&Ma&&Ma.lineWise&&Ma.text.join("\n")==l.join("\n")&&(h=v=et(h.line,0)));var m={from:h,to:v,text:c?c[p%c.length]:l,origin:o||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ui(e.doc,m),sr(e,"inputRead",e,m)}t&&!s&&Fa(e,t),Pn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zn(t,(function(){return La(t,r,0,null,"paste")})),!0}function Fa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(!(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=Ta(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ge(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Ta(e,o.head.line,"smart"));a&&sr(e,"electricInput",e,o.head.line)}}}function _a(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,i={anchor:et(o,0),head:et(o+1,0)};r.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:r}}function Na(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ra(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),Na(e),t}function Da(e,t,r,n,o){var i=t,a=r,s=Ge(e,t.line),l=o&&"rtl"==e.direction?-r:r;function c(i){var a,c;if("codepoint"==n){var u=s.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(u))a=null;else{var f=r>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(f?2:1))),-r)}}else a=o?function(e,t,r,n){var o=ce(t,e.doc.direction);if(!o)return Zi(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var i=se(o,r.ch,r.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Zi(t,r,n);var s,l=function(e,r){return Qi(t,e instanceof et?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(s=s||Pr(e,t),Xr(e,t,s,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?l(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var f=1==a.level==n<0,p=l(r,f?1:-1);if(null!=p&&(f?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var d=f?"before":"after";return new et(r.line,p,d)}}var h=function(e,t,n){for(var i=function(e,t){return t?new et(r.line,l(e,1),"before"):new et(r.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>0==(1!=a.level),c=s?n.begin:l(n.end,-1);if(a.from<=c&&c<a.to)return i(c,s);if(c=s?a.from:l(a.to,-1),n.begin<=c&&c<n.end)return i(c,s)}},v=h(i+n,n,u);if(v)return v;var m=n>0?u.end:l(u.begin,-1);return null==m||n>0&&m==t.text.length||!(v=h(n>0?0:o.length-1,n,c(m)))?null:v}(e.cm,s,t,r):Zi(s,t,r);if(null==a){if(i||(c=t.line+l)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ge(e,c))))return!1;t=ea(o,e.cm,s,t.line,l)}else t=a;return!0}if("char"==n||"codepoint"==n)c();else if("column"==n)c(!0);else if("word"==n||"group"==n)for(var u=null,f="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||c(!d);d=!1){var h=s.text.charAt(t.ch)||"\n",v=ee(h,p)?"w":f&&"\n"==h?"n":!f||/\s/.test(h)?null:"p";if(!f||d||v||(v="s"),u&&u!=v){r<0&&(r=1,c(),t.sticky="after");break}if(v&&(u=v),r>0&&!c(!d))break}var m=ai(e,t,i,a,!0);return rt(i,m)&&(m.hitSide=!0),m}function Va(e,t,r,n){var o,i,a=e.doc,s=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*rn(e.display),3);o=(r>0?t.bottom:t.top)+r*c}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(i=Jr(e,s,o)).outside;){if(r<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*r}return i}var Ba=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(e,t){var r=Mr(e,t.line);if(!r||r.hidden)return null;var n=Ge(e.doc,t.line),o=jr(r,n,t.line),i=ce(n,e.doc.direction),a="left";i&&(a=se(i,t.ch)%2?"right":"left");var s=_r(o.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function za(e,t){return t&&(e.bad=!0),e}function Wa(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return za(e.clipPos(et(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==n)return Ha(i,t,r)}}function Ha(e,t,r){var n=e.text.firstChild,o=!1;if(!t||!P(n,t))return za(et(Ye(e.line),0),!0);if(t==n&&(o=!0,t=n.childNodes[r],r=0,!t)){var i=e.rest?K(e.rest):e.line;return za(et(Ye(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,r,n){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==t||s==r){var u=Ye(o<0?e.line:e.rest[o]),f=i[a]+n;return(n<0||s!=t)&&(f=i[a+(n?1:0)]),et(u,f)}}}var f=u(a,s,r);if(f)return za(f,o);for(var p=s.nextSibling,d=a?a.nodeValue.length-r:0;p;p=p.nextSibling){if(f=u(p,p.firstChild,0))return za(et(f.line,f.ch-d),o);d+=p.textContent.length}for(var h=s.previousSibling,v=r;h;h=h.previousSibling){if(f=u(h,h.firstChild,-1))return za(et(f.line,f.ch+v),o);v+=h.textContent.length}}Ba.prototype.init=function(e){var t=this,r=this,n=r.cm,o=r.div=e.lineDiv;function i(e){for(var t=e.target;t;t=t.parentNode){if(t==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(i(e)&&!ve(n,e)){if(n.somethingSelected())Pa({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=_a(n);Pa({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,z),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ma.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ra(),l=s.firstChild;n.display.lineSpace.insertBefore(s,n.display.lineSpace.firstChild),l.value=Ma.text.join("\n");var c=L();_(l),setTimeout((function(){n.display.lineSpace.removeChild(s),c.focus(),c==o&&r.showPrimarySelection()}),50)}}o.contentEditable=!0,Na(o,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),fe(o,"paste",(function(e){!i(e)||ve(n,e)||Ia(e,n)||s<=11&&setTimeout(eo(n,(function(){return t.updateFromDOM()})),20)})),fe(o,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(o,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(o,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(o,"touchstart",(function(){return r.forceCompositionEnd()})),fe(o,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(o,"copy",a),fe(o,"cut",a)},Ba.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ba.prototype.prepareSelection=function(){var e=gn(this.cm,!1);return e.focus=L()==this.div,e},Ba.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ba.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ba.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),o=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=Wa(t,e.anchorNode,e.anchorOffset),s=Wa(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(it(a,s),o)||0!=tt(ot(a,s),i)){var l=t.display.view,c=o.line>=t.display.viewFrom&&Ua(t,o)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Ua(t,i);if(!u){var f=l[l.length-1].measure,p=f.maps?f.maps[f.maps.length-1]:f.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(c&&u){var d,h=e.rangeCount&&e.getRangeAt(0);try{d=O(c.node,c.offset,u.offset,u.node)}catch(e){}d&&(!r&&t.state.focused?(e.collapse(c.node,c.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),h&&null==e.anchorNode?e.addRange(h):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ba.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ba.prototype.showMultipleSelections=function(e){j(this.cm.display.cursorDiv,e.cursors),j(this.cm.display.selectionDiv,e.selection)},Ba.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ba.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},Ba.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&L()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ba.prototype.blur=function(){this.div.blur()},Ba.prototype.getField=function(){return this.div},Ba.prototype.supportsTouch=function(){return!0},Ba.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zn(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ba.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ba.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Wa(t,e.anchorNode,e.anchorOffset),n=Wa(t,e.focusNode,e.focusOffset);r&&n&&Zn(t,(function(){ei(t.doc,So(r,n),z),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ba.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,o=n.display,i=n.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>n.firstLine()&&(a=et(a.line-1,Ge(n.doc,a.line-1).length)),s.ch==Ge(n.doc,s.line).text.length&&s.line<n.lastLine()&&(s=et(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=un(n,a.line))?(t=Ye(o.view[0].line),r=o.view[0].node):(t=Ye(o.view[e].line),r=o.view[e-1].node.nextSibling);var l,c,u=un(n,s.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Ye(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,o){var i="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(i+=s,l&&(i+=s),a=l=!1)}function u(e){e&&(c(),i+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void u(r);var i,p=t.getAttribute("cm-marker");if(p){var d=e.findMarks(et(n,0),et(o+1,0),(m=+p,function(e){return e.id==m}));return void(d.length&&(i=d[0].find(0))&&u($e(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&c();for(var v=0;v<t.childNodes.length;v++)f(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),h&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;f(t),t!=r;)t=t.nextSibling,l=!1;return i}(n,r,c,t,l)),p=$e(n.doc,et(t,0),et(l,Ge(n.doc,l).text.length));f.length>1&&p.length>1;)if(K(f)==K(p))f.pop(),p.pop(),l--;else{if(f[0]!=p[0])break;f.shift(),p.shift(),t++}for(var d=0,h=0,v=f[0],m=p[0],g=Math.min(v.length,m.length);d<g&&v.charCodeAt(d)==m.charCodeAt(d);)++d;for(var y=K(f),b=K(p),x=Math.min(y.length-(1==f.length?d:0),b.length-(1==p.length?d:0));h<x&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==f.length&&1==p.length&&t==a.line)for(;d&&d>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;f[f.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var w=et(t,d),C=et(l,p.length?K(p).length-h:0);return f.length>1||f[0]||tt(w,C)?(vi(n.doc,f,w,C,"+input"),!0):void 0},Ba.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ba.prototype.reset=function(){this.forceCompositionEnd()},Ba.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ba.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ba.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zn(this.cm,(function(){return fn(e.cm)}))},Ba.prototype.setUneditable=function(e){e.contentEditable="false"},Ba.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||eo(this.cm,La)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ba.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ba.prototype.onContextMenu=function(){},Ba.prototype.resetPosition=function(){},Ba.prototype.needsContentAttribute=!0;var qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!ve(n,e)){if(n.somethingSelected())Pa({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=_a(n);Pa({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,z):(r.prevInput="",o.value=t.text.join("\n"),_(o))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(o.style.width="0px"),fe(o,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),fe(o,"paste",(function(e){ve(n,e)||Ia(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),fe(o,"cut",i),fe(o,"copy",i),fe(e.scroller,"paste",(function(t){if(!wr(e,t)&&!ve(n,t)){if(!o.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),fe(e.lineSpace,"selectstart",(function(t){wr(e,t)||be(t)})),fe(o,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(o,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},qa.prototype.createField=function(e){this.wrapper=Ra(),this.textarea=this.wrapper.firstChild},qa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=gn(e);if(e.options.moveInputWithCursor){var o=Gr(e,r.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return n},qa.prototype.showSelection=function(e){var t=this.cm.display;j(t.cursorDiv,e.cursors),j(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&_(this.textarea),a&&s>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},qa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},qa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Le(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(n.length,o.length);l<c&&n.charCodeAt(l)==o.charCodeAt(l);)++l;return Zn(t,(function(){La(t,o.slice(l),n.length-l,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cn(r,e),c=n.scroller.scrollTop;if(i&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(i)&&eo(r,ei)(r.doc,So(i),z);var u,p=o.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),n.input.focus(),l&&window.scrollTo(null,u),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&s>=9&&m(),k){Ce(e);var v=function(){de(window,"mouseup",v),setTimeout(g,20)};fe(window,"mouseup",v)}else setTimeout(g,50)}function m(){if(null!=o.selectionStart){var e=r.somethingSelected(),i="​"+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=i.length,n.selForContextMenu=r.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,o.style.cssText=p,a&&s<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=c),null!=o.selectionStart)){(!a||a&&s<9)&&m();var e=0,i=function(){n.selForContextMenu==r.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?eo(r,li)(r):e++<10?n.detectingSelectAll=setTimeout(i,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(i,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,o,i){e.defaults[r]=n,o&&(t[r]=i?function(e,t,r){r!=Ca&&o(e,t,r)}:o)}e.defineOption=r,e.Init=Ca,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Po(e)}),!0),r("indentUnit",2,Po,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){Lo(e),Vr(e),fn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,r.push(et(n,i))}n++}));for(var o=r.length-1;o>=0;o--)vi(e.doc,t,r[o],et(r[o].line,r[o].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ca&&e.refresh()})),r("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!x),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){wa(e),mo(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Yi(t),o=r!=Ca&&Yi(r);o&&o.detach&&o.detach(e,n),n.attach&&n.attach(e,o||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Sa,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=ho(t,e.options.lineNumbers),mo(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?an(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Un(e)}),!0),r("scrollbarStyle","native",(function(e){Hn(e),Un(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=ho(e.options.gutters,t),mo(e)}),!0),r("firstLineNumber",1,mo,!0),r("lineNumberFormatter",(function(e){return e}),mo,!0),r("showCursorWhenSelecting",!1,mn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(On(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Oa),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,mn,!0),r("singleCursorHeightPerLine",!0,mn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Lo,!0),r("addModeClass",!1,Lo,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,Lo,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Ea),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,o=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&eo(this,t[e])(this,r,o),he(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:to((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,o=r(t);n<e.length&&r(e[n])<=o;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,fn(this)})),removeOverlay:to((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void fn(this)}})),indentLine:to((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qe(this.doc,e)&&Ta(this,e,t,r)})),indentSelection:to((function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var o=t[n];if(o.empty())o.head.line>r&&(Ta(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&Pn(this));else{var i=o.from(),a=o.to(),s=Math.max(r,i.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<r;++l)Ta(this,l,e);var c=this.doc.sel.ranges;0==i.ch&&t.length==c.length&&c[n].from().ch>0&&Xo(this.doc,n,new Ao(i,c[n].to()),z)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,r=pt(this,Ge(this.doc,e.line)),n=0,o=(r.length-1)/2,i=e.ch;if(0==i)t=r[2];else for(;;){var a=n+o>>1;if((a?r[2*a-1]:0)>=i)o=a;else{if(!(r[2*a+1]<i)){t=r[2*a+2];break}n=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var o=r[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&n.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][a]];s&&n.push(s)}else i.helperType&&o[i.helperType]?n.push(o[i.helperType]):o[i.name]&&n.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==B(n,c.val)&&n.push(c.val)}return n},getStateAfter:function(e,t){var r=this.doc;return dt(this,(e=at(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Gr(this,null==e?r.head:"object"==typeof e?st(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return qr(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return Jr(this,(e=Hr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Hr(this,{top:e,left:0},t||"page").top,Xe(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),n=Ge(this.doc,e)}else n=e;return Wr(this,n,{top:0,left:0},t||"page",r||o).top+(o?this.doc.height-Wt(n):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,o){var i,a,s,l=this.display,c=(e=Gr(this,st(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var f=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>p&&(u=p-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),r&&(i=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Tn(i,a)).scrollTop&&_n(i,s.scrollTop),null!=s.scrollLeft&&Rn(i,s.scrollLeft))},triggerOnKeyDown:to(ua),triggerOnKeyPress:to(pa),triggerOnKeyUp:fa,triggerOnMouseDown:to(ma),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:to((function(e){Fa(this,e)})),findPosH:function(e,t,r,n){var o=1;t<0&&(o=-1,t=-t);for(var i=st(this.doc,e),a=0;a<t&&!(i=Da(this.doc,i,o,r,n)).hitSide;++a);return i},moveH:to((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Da(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),H)})),deleteH:to((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Xi(this,(function(r){var o=Da(n,r.head,e,t,!1);return e<0?{from:o,to:r.head}:{from:r.head,to:o}}))})),findPosV:function(e,t,r,n){var o=1,i=n;t<0&&(o=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var l=Gr(this,a,"div");if(null==i?i=l.left:l.left=i,(a=Va(this,l,o,r)).hitSide)break}return a},moveV:to((function(e,t){var r=this,n=this.doc,o=[],i=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(i)return e<0?a.from():a.to();var s=Gr(r,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=Va(r,s,e,t);return"page"==t&&a==n.sel.primary()&&Mn(r,qr(r,l,"div").top-s.top),l}),H),o.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=o[a]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var i=t.charAt(r),a=ee(i,o)?function(e){return ee(e,o)}:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};r>0&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new Ao(et(e.line,r),et(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),he(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:to((function(e,t){Ln(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Or(this)-this.display.barHeight,width:e.scrollWidth-Or(this)-this.display.barWidth,clientHeight:Er(this),clientWidth:Sr(this)}},scrollIntoView:to((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){In(e),e.curOp.scrollToPos=t}(this,e):Fn(this,e.from,e.to,e.margin)})),setSize:to((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Dr(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){pn(r,o,"widget");break}++o})),this.curOp.forceUpdate=!0,he(this,"refresh",this)})),operation:function(e){return Zn(this,e)},startOperation:function(){return Gn(this)},endOperation:function(){return $n(this)},refresh:to((function(){var e=this.display.cachedTextHeight;fn(this),this.curOp.forceUpdate=!0,Vr(this),Ln(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(null==e||Math.abs(e-rn(this.display))>.5||this.options.lineWrapping)&&ln(this),he(this,"refresh",this)})),swapDoc:to((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),No(this,e),Vr(this),this.display.input.reset(),Ln(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sr(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,n,o){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=o},e.registerGlobalHelper=function(t,n,o,i){e.registerHelper(t,n,i),r[t]._global.push({pred:o,val:i})}}(Ea);var Ga="iter insert remove copy getEditor constructor".split(" ");for(var $a in Pi.prototype)Pi.prototype.hasOwnProperty($a)&&B(Ga,$a)<0&&(Ea.prototype[$a]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pi.prototype[$a]));return ye(Pi),Ea.inputStyles={textarea:qa,contenteditable:Ba},Ea.defineMode=function(e){Ea.defaults.mode||"null"==e||(Ea.defaults.mode=e),Re.apply(this,arguments)},Ea.defineMIME=function(e,t){Ne[e]=t},Ea.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ea.defineMIME("text/plain","null"),Ea.defineExtension=function(e,t){Ea.prototype[e]=t},Ea.defineDocExtension=function(e,t){Pi.prototype[e]=t},Ea.fromTextArea=function(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=L();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=s.getValue()}var o;if(e.form&&(fe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var a=i.submit=function(){n(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(de(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=Ea((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=de,e.on=fe,e.wheelEventPixels=wo,e.Doc=Pi,e.splitLines=Pe,e.countColumn=D,e.findColumn=q,e.isWordChar=Z,e.Pass=U,e.signal=he,e.Line=Gt,e.changeEnd=Eo,e.scrollbarModel=Wn,e.Pos=et,e.cmpPos=tt,e.modes=_e,e.mimeModes=Ne,e.resolveMode=De,e.getMode=Ve,e.modeExtensions=Be,e.extendMode=Ue,e.copyState=ze,e.startState=He,e.innerMode=We,e.commands=ta,e.keyMap=Wi,e.keyName=Ji,e.isModifierKey=$i,e.lookupKey=Gi,e.normalizeKeyMap=qi,e.StringStream=qe,e.SharedTextMarker=Ei,e.TextMarker=Oi,e.LineWidget=Ci,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=Ce,e.addClass=I,e.contains=P,e.rmClass=S,e.keyNames=Vi}(Ea),Ea.version="5.61.1",Ea}()},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return He})),r.d(t,"b",(function(){return de})),r.d(t,"c",(function(){return fe}));var n=r(0),o=r.n(n);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function v(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p(e);if(t){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return v(this,r)}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var w=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(t){function r(e,t){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t[Math.abs(r)%t.length]}function n(e,t){var r=t.namespace;if(t.useColors){var n=t.color,o=" ".concat("[3"+(n<8?n:"8;5;"+n),";1m").concat(r," ");e[0]=o+e[0].split("\n").join("\n"+o)}else e[0]=r+" "+e[0]}function o(e,t){if(e[0]=(t.useColors?"%c":"")+t.namespace,t.useColors){var r="color: "+t.color,n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))})),e.splice(o,0,r)}}var i=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];e&&o.unshift(e);var a=t.namespaces.split(",").map((function(e){return"*"===e[e.length-1]?new RegExp("^"+e.slice(0,e.length-1)+".*$"):new RegExp("^"+e+"$")}));a.some((function(t){return t.test(e)})),r(e,t.colors),t.useColors}}void 0===e||"renderer"===e.type||!0===e.browser||e.__nwjs?t.exports=function(t){return a(t,function(){var t;try{t=localStorage.getItem("debug")}catch(e){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),{namespaces:t||"",colors:i,useColors:!0,formatArgs:o}}())}:t.exports=function(t){return a(t,{namespaces:e.env.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:n})}})),C=w("informed:ObjMap\t"),k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String.prototype.replace.call(e,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n=String.prototype.replace.call(t,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e);return void 0===n||n===e?r:n},O=function(e){return".".concat(e).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},S=function(e,t){var r=O(t),n=function(e){return e.replace(O(e),"").replace(/\./,"")}(t),o=r?A(e,r):e;return!(!o||!Object.hasOwnProperty.call(o,n.replace(/\[(.*)\]/,"$1")))},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(t,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,t,n,o){return n===o.length-1?(e[t]=r,e[t]):void 0===e[t]?(Number.isInteger(+o[n+1])?e[t]=[]:e[t]={},e[t]):(Number.isInteger(+o[n+1])&&!Array.isArray(e[t])&&(e[t]=[]),e[t])}),e)},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=!1;return String.prototype.replace.call(t,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,t,n,o){return void 0===e?e:n===o.length-1?(delete e[t],r=!0,e[t]):e[t]}),e),r},T=function(e){var t=k(e);return Number.isInteger(+t[t.length-1])},M=function(){function e(){i(this,e)}return s(e,null,[{key:"empty",value:function(e){return 0===function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e);return t.map((function(t){return e[t]}))}(e).length}},{key:"get",value:function(e,t){return A(e,t)}},{key:"has",value:function(e,t){return S(e,t)}},{key:"set",value:function(t,r,n){if(void 0!==n)C("SETTING",r,n),E(t,r,n);else if(T(r)&&void 0!==e.get(t,r)){C("Special case SETTING",r,"to undefined"),E(t,r,void 0);var o=k(r);P(t,o=o.slice(0,o.length-1))}else T(r)||void 0===e.get(t,r)||(C("Special case REMOVING",r,"from object completley"),e.delete(t,r))}},{key:"delete",value:function(e,t){C("DELETE",t),T(t)?(C("ARRAY",t),this.pullOut(e,t)):j(e,t);var r=k(t);P(e,r=r.slice(0,r.length-1))}},{key:"pullOut",value:function(e,t){var r=k(t),n=r[r.length-1];r=r.slice(0,r.length-1),C("Pulling out:",r,"index",n);var o=A(e,r);C("Array",o),Array.isArray(o)&&function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce((function(e,r,n,o){return void 0===e?e:n===o.length-1&&Array.isArray(e)?(t=e.splice(r,1),e[r]):e[r]}),e)}(o,n),P(e,r)}}]),e}();function P(e,t){if(0!==t.length){var r=A(e,t);(Array.isArray(r)?r.every((function(e){return null==e})):"{}"===JSON.stringify(r))&&j(e,t),P(e,t.slice(0,t.length-1))}}var L=o.a.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),I=o.a.createContext({}),F=o.a.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),_=o.a.createContext(),N=o.a.createContext(),R=o.a.createContext(),D=o.a.createContext(),V=o.a.createContext(),B=o.a.createContext();function U(){return Object(n.useContext)(F)}function z(e){var t=Object(n.useRef)(),r=Object(n.useRef)(!0),o=g(Object(n.useState)(e),2),i=o[0],a=o[1];t.current=i;return Object(n.useEffect)((function(){return function(){r.current=!1}}),[]),[i,function(e){t.current=e,r.current&&a(e)},function(){return t.current}]}var W=function(e){return e.type&&e.type.name?e.type.name:e.displayName||e.name||"Component"},H=function(e){var t={};if(e.inner){if(0===e.inner.length)return void M.set(t,e.path,e.message);var r,n=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=b(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e.inner);try{for(n.s();!(r=n.n()).done;){var o=r.value;M.get(t,o.path)||M.set(t,o.path,o.message)}}catch(o){n.e(o)}finally{n.f()}}return t},q=function(e,t){try{e.validateSync(t,{abortEarly:!1})}catch(e){return H(e)}},G=function(e){if(e.inner){if(0===e.inner.length)return;return e.inner[0].message}},$=function(e,t){try{e.validateSync(t,{abortEarly:!1})}catch(e){return G(e)}},K=function(e,t){e(t);var r={};return e.errors&&e.errors.forEach((function(e){var t=e.message,n=e.dataPath,o=e.keyword,i=e.params,a=n;"required"===o&&(a="".concat(a,".").concat(i.missingProperty)),a=a.replace(".",""),M.set(r,a,t)})),r},J=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},Y=function(e,t,r){var n=t["ui:control"],o=t["informed:props"],i=t["input:props"],a=t["ui:before"],s=t["ui:after"],l=t.oneOf,c=t.items,u=t.enum,p=t.title,d=t.minimum,h=t.maximum,v=t.minLength,m=t.maxLength,g=t.pattern,y=t.type,b=t.properties,x=J();i&&i.id&&(x=i.id);var w={componentType:n,field:r?"".concat(r,".").concat(e):e,type:y,uiBefore:a,uiAfter:s,properties:"object"===y?b:void 0,items:"array"===y?c:void 0,props:f(f({label:p,id:x,min:d,max:h,minLength:v,maxLength:m,pattern:g},o),i)};if(l){var C=t.oneOf.map((function(e){var t=e["input:props"],r=void 0===t?{}:t;return f({value:e.const,label:e.title},r)}));w.props.options=C}if(u){var k=t.enum.map((function(e){return{value:e,label:e}}));w.props.options=k}if(c&&c.oneOf){var A=c.oneOf.map((function(e){var t=e["input:props"],r=void 0===t?{}:t;return f({value:e.const,label:e.title},r)}));w.props.options=A}return w},X=function(e,t,r){if(!e||t)return[];var n=e.properties,o=void 0===n?{}:n,i=e.allOf,a=e.propertyOrder,s=void 0===a?[]:a;if(Object.keys(o).length>0){var l=Object.keys(o).sort((function(e,t){var r=s.indexOf(e),n=s.indexOf(t);return(r>-1?r:s.length+1)-(n>-1?n:s.length+1)})).map((function(e){var t=o[e];return Y(e,t,r)}));return i&&l.push({componentType:"conditionals",allOf:i}),l}return[]},Q=function(e,t){if(!e)return{val:e,offset:0};var r="".concat(e),n=function(e,t){if("string"==typeof e)return e.split("").map((function(e){return"#"===e?/\d/:"*"===e?/[\w]/:e}));if("function"==typeof e)return e(t);if(Array.isArray(e))return e;throw new Error("Formatter must be string, array, or function")}(t,r),o=n.findIndex((function(e){return"string"!=typeof e})),i=n.length-y(n).reverse().findIndex((function(e){return"string"!=typeof e})),a=[],s=r.split(""),l=0,c=0,u=function(e,t){for(var r=0,n=-1,o=!0;o&&r<e.length;)e[r]==t[r]?n=r:o=!1,r+=1;return n}(n.slice(0,o),s.slice(0,o));u>-1&&(l=u+1,a=a.concat(n.slice(0,u+1)),c=u+1),u<0&&(a=a.concat(n.slice(0,o)),c=o);for(var f=c;f<n.length;f++){var p=n[f];if(l!=s.length){var d=s[l];if("function"==typeof p)a.push(p(d)),l+=1;else{var h="string"==typeof p?p===d:p.test(d);h&&"string"==typeof p?(a.push(p),l+=1):h||"string"!=typeof p?h&&"string"!=typeof p?(a.push(d),l+=1):h||"string"==typeof p||(l+=1,f-=1):l!=s.length&&a.push(p)}}else{if(!("string"==typeof p&&f>=i))break;a.push(p)}}return{value:a.join(""),offset:r?a.length-r.length:0}},Z="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect,ee=function(e){var t=e.value,r=e.inputRef,n=e.maintainCursor,o=void 0===n||n,i=g(z(0),3),a=i[0],s=i[1],l=i[2],c=g(z(0),3),u=c[0],f=c[1],p=c[2];return Z((function(){if(null!=r.current&&l()){var e=l()+p();0!=p()&&o?r.current.setSelectionRange(e+1,e+1):o&&r.current.setSelectionRange(e,e)}}),[t]),{setCursorOffset:f,setCursor:s,cursor:a,getCursor:l,cursorOffset:u}},te=function(e,t){var r=Object(n.useRef)(!0),o=r.current;Object(n.useEffect)((function(){if(!o)return e();r.current=!1}),t)},re=w("informed:useField\t"),ne=function(e,t,r,n,o){if(null!=e)return o?o(e):t?t(e):r&&!n?Q(e,r).value:e},oe=function(e,t,r,n){return t&&r?t(e):n?Q(e,n).value:e},ie=function(e,t,r){var n=r.required;return e||t?function(r,n){return t?$(t,r):e?e(r,n):void 0}:n?function(e){return ue(e,n)}:void 0},ae=function(e){var t=e.fieldType,r=e.setValue,n=e.onChange,o=e.multiple,i=e.ref,a=function(e){return r(e)};return"text"!==t&&"textArea"!==t&&"number"!==t||(a=function(e){return r(e.target.value,e)}),"select"===t&&(a=function(){var e=Array.from(i.current).filter((function(e){return e.selected})).map((function(e){return e.value}));r(o?e:e[0]||"")}),"checkbox"===t&&(a=function(e){r(e.target.checked),n&&n(e)}),function(e){a(e)}},se=function(e){var t=e.setTouched,r=e.onBlur;return function(e){t(!0),r&&r(e)}},le=function(e){var t=e.fieldType,r=e.maskedValue,n=e.multiple,o=e.value;switch(t){case"text":case"number":return r||0===r?r:"";case"textArea":return r||"";case"select":return o||(n?[]:"");case"checkbox":return!!o;default:return o}},ce=function(e){switch(e){case"text":case"number":case"checkbox":return e;default:return}},ue=function(e,t){if(t&&(null==e||""===e))return"string"==typeof t?t:"This field is required"};function fe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=e.field,i=e.validate,a=e.asyncValidate,s=e.validationSchema,l=e.mask,c=e.maskWithCursorOffset,u=e.format,p=e.parse,d=e.formatter,v=e.parser,m=e.initialValue,b=e.validateOnChange,x=e.validateOnBlur,w=e.validateOnMount,C=e.asyncValidateOnBlur,k=e.maskOnBlur,A=e.allowEmptyString,O=e.onValueChange,S=e.notify,E=e.keepState,j=e.maintainCursor,T=e.debug,P=e.shadow,I=e.step,F=e.fieldType,_=e.multiple,N=e.onChange,R=e.onBlur,D=e.formController,V=e.relevant,W=e.required,H=e.keepStateIfRelevant,q=e.initialize,G=e.formatterDependencies,$=void 0===G?[]:G,K=h(e,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),Y=Object(n.useState)(J()),X=g(Y,1),ue=X[0],fe=Object(n.useContext)(L),pe=Object(n.useContext)(B),de=pe||H,he=U(),ve=Object(n.useRef)(),me=Object(n.useRef)(!0),ge=Object(n.useRef)(),ye=Object(n.useRef)(!1),be=function(){return!ye.current},xe=function(){return ye.current};D&&(fe=D.updater,he=D.getFormApi());var we,Ce,ke=ie(i,s,{required:W}),Ae=Object(n.useState)((function(){return fe.getInitialValue(r)})),Oe=g(Ae,1),Se=Oe[0],Ee=fe.getSavedValue(r);(E||de)&&Ee?(re("Setting field ".concat(kt,"'s kept state"),Ee),we=Ee.value,Ce=Ee.touched,he.removeSavedState(kt)):we=null!=m?m:Se;var je=z(ne(we,l,d,v,q)),Te=g(je,3),Me=Te[0],Pe=Te[1],Le=Te[2],Ie=z(w?ke(Me):void 0),Fe=g(Ie,3),_e=Fe[0],Ne=Fe[1],Re=Fe[2],De=z(Ce),Ve=g(De,3),Be=Ve[0],Ue=Ve[1],ze=Ve[2],We=Object(n.useState)((function(){return oe(Me,u,p,d)})),He=g(We,2),qe=He[0],Ge=He[1],$e=Object(n.useRef)();$e.current=qe;var Ke=Object(n.useRef)(m),Je=Object(n.useRef)(r),Ye=Object(n.useRef)();Ke.current=m,Je.current=r;var Xe=Object(n.useRef)(null),Qe=o.a.useMemo((function(){return t||Xe}),[]),Ze=ee({value:Me,inputRef:Qe,maintainCursor:!!j}),et=Ze.getCursor,tt=Ze.setCursor,rt=Ze.setCursorOffset,nt=function(){return!0},ot=function(e){var t=V||nt,r=he.getFullField(Je.current)||Je.current,n={path:r,parentPath:r.replace(/(.*)[.[].*/,"$1"),get:function(e,t){return M.get(e,t)}};return pe&&pe.relevant?t(e,n)&&pe.relevant(e,n):t(e,n)},it=z(ot(he.getValues())),at=g(it,3),st=at[0],lt=at[1],ct=at[2],ut=function(e){return!pe||!pe.relevant||pe.relevant(e)},ft=function(){var e=ot(he.getValues());return e!=ct()&&lt(e),e};Object(n.useEffect)((function(){st||E||ve.current.reset()}),[st]);var pt=function(){return P?he.getDerrivedValue(r):Le()},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preventUpdate;I&&he.getStep()<I?(re("Setting ".concat(r,"'s error to undefined as we are not at that step")),Ne(void 0),fe.setError(ue,void 0,!n)):(re("Setting ".concat(r,"'s error to ").concat(e)),Ne(e),fe.setError(ue,e,!n))},ht=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t;ye.current=!0,re("Setting ".concat(r," to ").concat(i)),q&&(i=q(i));var a=he.getOptions(),s=i;if(""!==i||A||o.allowEmptyString||a.allowEmptyStrings||(i=void 0),"number"!==e.type&&"number"!==F||void 0===i||(i=+i),n&&n.target&&n.target.selectionStart&&tt(n.target.selectionStart),l&&!k&&(s=l(i,et()),i=l(i,et())),c&&!k){var f=c(i,et());s=f.value,i=f.value,rt(f.offset)}if(u&&p&&(i=p(i),s=u(i)),d){var h=Q(i,d);rt(h.offset),i=s=h.value}v&&(i=null!=i?v(i):i),ke&&b&&!o.initial&&(re("Validating after change ".concat(r," ").concat(i)),dt(ke(i,he.getValues()))),Pe(i),Ge(s),O&&O(i),fe.setValue(ue,i,!o.preventUpdate)};te((function(){ve.current.setValue($e.current)}),y($));var vt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.preventUpdate;if(re("Field ".concat(r," has been touched")),ke&&x&&!t&&e&&(re("Validating after blur ".concat(r," ").concat(pt())),dt(ke(pt(),he.getValues()))),a&&C&&!t&&e&&(re("Validating async after blur ".concat(r," ").concat(pt())),a(pt(),he.getValues())),l&&k){var i=l(pt());Pe(i),Ge(i),O&&O(i),fe.setValue(ue,i,!o)}if(c&&k){var s=c(pt());rt(s.offset),Pe(s.value),Ge(s.value),O&&O(s.value),fe.setValue(ue,s.value,!o)}Ue(e),fe.setTouched(ue,e,!o)},mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.preventUpdate,r=ne(Ke.current||fe.getInitialValue(Je.current),l,d,v,q);ht(r,null,{initial:!0,preventUpdate:t}),dt(w?ke(r):void 0,{preventUpdate:t}),vt(void 0,!0,{preventUpdate:t}),ye.current=!1},gt=function(e){ke&&(re("Field validating ".concat(r," ").concat(pt())),dt(ke(pt(),e||he.getValues())))},yt=function(e){a&&(re("Field async validating ".concat(r," ").concat(pt())),a(pt(),e||he.getValues()))},bt={setValue:ht,setTouched:vt,setError:dt,reset:mt,validate:gt,asyncValidate:yt,getValue:pt,getTouched:ze,getError:Re,getIsRelevant:ct,getDirty:xe,getPristine:be,getFieldState:function(){return{value:pt(),touched:ze(),dirty:xe(),pristine:be()}},relevant:ot,multistepRelevant:ut,checkRelevant:ft};ve.current=bt;var xt={value:Me,error:_e,touched:Be,maskedValue:qe,isRelevant:st,dirty:ye.current,pristine:!ye.current};P&&(xt={error:_e,touched:Be}),re("Render",he.getFullField(r),xt),Z((function(){var e=he.getFullField(Je.current);return re("Register",ue,Je.current),ge.current={field:e,fieldId:ue,fieldApi:bt,fieldState:xt,notify:S,keepState:E,inMultistep:de,shadow:P},fe.register(ue,ge.current),function(){var e=he.getFullField(Je.current);re("Deregister",ue,e),fe.deregister(ue)}}),[]),Object(n.useEffect)((function(){var e=he.getFullField(r);return me.current?me.current=!1:(re("Update",r,de),ge.current.field=e,fe.update(ue,ge.current,Ye.current)),function(){Ye.current=e}}),[r]),Z((function(){T&&Qe&&(Qe.current.style.border="5px solid orange",setTimeout((function(){Qe.current.style.borderWidth="2px",Qe.current.style.borderStyle="inset",Qe.current.style.borderColor="initial",Qe.current.style.borderImage="initial"}),500))}));var wt=[].concat(y(Object.values(xt)),y(Object.values(e)),y(Object.values(K))),Ct=function(e){return Object(n.useMemo)((function(){return st?e:null}),y(wt))},kt=r,At=ae({fieldType:F,setValue:ht,onChange:N,multiple:_,ref:Qe}),Ot=se({setTouched:vt,onBlur:R}),St=le({fieldType:F,maskedValue:qe,multiple:_,value:Me}),Et=ce(F);return{fieldState:xt,fieldApi:bt,render:Ct,ref:Qe,userProps:f(f({},K),{},{multiple:_,onChange:N,onBlur:R,id:K.id||ue}),informed:f({name:kt,multiple:_,onChange:At,onBlur:Ot,value:St,ref:Qe,type:Et,id:K.id||ue},K)}}var pe,de=function(e){var t=o.a.forwardRef((function(t,r){var n=fe(t,r),i=n.fieldState,a=n.fieldApi,s=n.render,l=n.ref,u=n.userProps;return s(o.a.createElement(e,c({fieldApi:a,fieldState:i,field:t.field,forwardedRef:l,debug:t.debug,type:t.type},u)))}));return t.displayName="asField(".concat(W(e),")"),t},he=w("informed:Text\t"),ve=de((function(e){var t=e.fieldApi,r=e.fieldState,n=h(e,["fieldApi","fieldState"]),i=r.maskedValue,a=t.setValue,s=t.setTouched,l=n.onChange,u=n.onBlur,f=n.field,p=(n.initialValue,n.forwardedRef),d=n.debug,v=n.label,m=(n.title,n.id),g=h(n,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return he("Render",f),Z((function(){d&&p&&(p.current.style.background="red",setTimeout((function(){p.current.style.background="white"}),500))})),o.a.createElement(o.a.Fragment,null,v?o.a.createElement("label",{htmlFor:m}," ",v," "):null,o.a.createElement("input",c({},g,{id:m,name:f,ref:p,value:i||0===i?i:"",onChange:function(e){a(e.target.value,e),l&&l(e)},onBlur:function(e){s(!0),u&&u(e)}})))})),me=de((function(e){var t=e.fieldApi,r=e.fieldState,n=h(e,["fieldApi","fieldState"]),i=r.maskedValue,a=t.setValue,s=t.setTouched,l=n.onChange,u=n.onBlur,f=n.field,p=(n.initialValue,n.forwardedRef),d=n.debug,v=n.label,m=n.id,g=h(n,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return Z((function(){d&&p&&(p.current.style.background="red",setTimeout((function(){p.current.style.background="white"}),500))})),o.a.createElement(o.a.Fragment,null,v?o.a.createElement("label",{htmlFor:m}," ",v," "):null,o.a.createElement("textarea",c({},g,{id:m,name:f,ref:p,value:i||"",onChange:function(e){a(e.target.value,e),l&&l(e)},onBlur:function(e){s(!0),u&&u(e)}})))})),ge=w("informed:Select\t"),ye=de((function(e){var t=e.fieldApi,r=e.fieldState,i=h(e,["fieldApi","fieldState"]),a=r.value,s=t.setTouched,l=i.onChange,u=i.onBlur,f=i.field,p=(i.initialValue,i.options),d=i.children,v=i.forwardedRef,m=i.debug,g=i.multiple,y=i.label,b=i.id,x=h(i,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),w=Object(n.useRef)();return Z((function(){m&&v&&(v.current.style.background="red",setTimeout((function(){v.current.style.background="white"}),500))})),ge("Render",f,a),o.a.createElement(o.a.Fragment,null,y?o.a.createElement("label",{htmlFor:b}," ",y," "):null,o.a.createElement("select",c({},x,{id:b,multiple:g,name:f,ref:v||w,value:a||(g?[]:""),onChange:function(e){var r=Array.from((v||w).current).filter((function(e){return e.selected})).map((function(e){return e.value}));t.setValue(g?r:r[0]||""),l&&e&&l(e)},onBlur:function(e){s(!0),u&&u(e)}}),p?p.map((function(e){return o.a.createElement("option",{key:e.value,value:e.value,disabled:e.disabled},e.label)})):d))})),be=de((function(e){var t=e.fieldApi,r=e.fieldState,n=h(e,["fieldApi","fieldState"]),i=r.value,a=t.setValue,s=t.setTouched,l=n.onChange,u=n.onBlur,f=n.field,p=(n.initialValue,n.debug,n.forwardedRef),d=n.id,v=n.label,m=h(n,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return o.a.createElement(o.a.Fragment,null,v?o.a.createElement("label",{htmlFor:d}," ",v," "):null,o.a.createElement("input",c({},m,{id:d,name:f,ref:p,checked:!!i,onChange:function(e){a(e.target.checked),l&&l(e)},onBlur:function(e){s(!0),u&&u(e)},type:"checkbox"})))})),xe=(pe=function(e){var t=e.radioGroupApi,r=e.radioGroupState,n=h(e,["radioGroupApi","radioGroupState"]),i=r.value,a=t.setValue,s=t.setTouched,l=t.onChange,u=t.onBlur,f=n.value,p=n.onChange,d=n.onBlur,v=n.field,m=(n.initialValue,n.forwardedRef),g=h(n,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return o.a.createElement("input",c({},g,{name:v,ref:m,value:f,checked:i===f,onChange:function(e){e.target.checked&&(a(f),p&&p(e),l&&l(e))},onBlur:function(e){s(!0),d&&d(e),u&&u(e)},type:"radio"}))},o.a.forwardRef((function(e,t){return o.a.createElement(_.Consumer,null,(function(r){var n=r.radioGroupApi,i=r.radioGroupState;return o.a.createElement(pe,c({radioGroupApi:n,radioGroupState:i,ref:t},e))}))}))),we=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(r,e);var t=m(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"render",value:function(){var e=this.props,t=e.options,r=e.children;return o.a.createElement(_.Provider,{value:this.groupContext},t?t.map((function(e){return o.a.createElement("label",{key:e.value},e.label," ",o.a.createElement(xe,{value:e.value}))})):r)}},{key:"groupContext",get:function(){return{radioGroupApi:f(f({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),r}(n.Component),Ce=de(we);var ke=w("informed:useArrayField\t"),Ae=function(e){var t=e.field,r=e.initialValue,i=e.validate,a=e.arrayFieldApiRef,s=h(e,["field","initialValue","validate","arrayFieldApiRef"]),l=U(),c=g(Object(n.useState)(new Map),1)[0],u=Object(n.useContext)(L),p=l.getFullField(t),d=u.getInitialValue(t)||r||[],v=g(z(l.getSavedValue(p)&&l.getSavedValue(p).value||d),3),m=v[0],b=v[1],x=v[2],w=g(z(m?m.map((function(){return J()})):[]),3),C=w[0],k=w[1],A=w[2],O=Object(n.useMemo)((function(){return function(e,t){var r=null==A()?0:A().length;return i?i(e,r,t):void 0}})),S=fe(f({field:t,validate:i?O:void 0,shadow:!0},s)).fieldApi;Z((function(){var e=function(e){e!==p&&(ke("".concat(p," changed")),RegExp("".concat(p,"\\[[0-9]+\\]")).test(e)&&S.validate())};return l.emitter.on("value",e),function(){l.emitter.removeListener("value",e)}}),[t]);var E=function(e,r){ke("Swapping","".concat(t,"[").concat(e,"] and ").concat(t,"[").concat(r,"]"));var n=y(C);C[e]&&C[r]?(n[e]=C[r],n[r]=C[e]):console.warn("Attempted to swap ".concat(e," with ").concat(r," but one of them does not exist :(")),k(n)},j=function(){C.push(J()),k(y(C))},T=function(e){C.push(J()),k(y(C));var t=y(x());t[C.length-1]=e,b(t)},P=C.map((function(e,r){var n={remove:function(){return function(e){ke("EXPECTING REMOVAL OF","".concat(t,"[").concat(e,"] and ").concat(t,"[").concat(C.length-1,"]")),u.expectRemoval("".concat(t,"[").concat(e,"]")),u.expectRemoval("".concat(t,"[").concat(C.length-1,"]"));var r=C.slice(0,e).concat(C.slice(e+1,C.length));k(r);var n=x(),o=n.slice(0,e).concat(n.slice(e+1,n.length));b(o)}(r)}},o={initialValue:m&&m[r],key:e,field:"".concat(t,"[").concat(r,"]"),index:r};return f(f({arrayFieldItemApi:n,arrayFieldItemState:o},n),o)})),I={add:j,swap:E,addWithInitialValue:T,reset:function(){var e=u.getInitialValue(t)||r||[];b(e);var n=e?e.map((function(){return J()})):[];k(n)}};a&&(a.current=I);var F={fields:P,field:t},_=f(f({},u),{},{register:function(e,t){c.set(e,t);for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];u.register.apply(u,[e,t].concat(n))},deregister:function(e){c.delete(e);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];u.deregister.apply(u,[e].concat(r))},getInitialValue:function(e){if(RegExp("".concat(p,"\\[[0-9]+\\]")).test(e)){var r=e.replace(t,""),n=M.get(x(),r);return ke("Resetting ".concat(r," to ").concat(n)),n}return u.getInitialValue(e)}});return{render:function(e){return o.a.createElement(L.Provider,{value:_},o.a.createElement(R.Provider,{value:I},o.a.createElement(N.Provider,{value:F},e)))},add:j,swap:E,addWithInitialValue:T,fields:P,arrayFieldState:F,arrayFieldApi:I,field:t}};function Oe(e){var t=U();return Object(n.useMemo)((function(){return function(e,t){return f(f({},t),{},{getValue:function(r){return t.getValue("".concat(e,".").concat(r))},getTouched:function(r){return t.getTouched("".concat(e,".").concat(r))},getError:function(r){return t.getError("".concat(e,".").concat(r))},setValue:function(r,n){return t.setValue("".concat(e,".").concat(r),n)},setTouched:function(r,n){return t.setTouched("".concat(e,".").concat(r),n)},setError:function(r,n){return t.setError("".concat(e,".").concat(r),n)},getInitialValue:function(r){return t.getInitialValue("".concat(e,".").concat(r))},getSavedValue:function(r){return t.getSavedValue("".concat(e,".").concat(r))},getFullField:function(r){return"".concat(t.getFullField(e),".").concat(r)}})}(e,t)}),[e])}function Se(){return Object(n.useContext)(I)}var Ee=function(e){var t=e.when,r=e.children;return t(Se())?r:null},je=function(e){var t=e.relevant,r=e.field,n=h(e,["relevant","field"]),i=U();if(t){var a=i.getFullField(r),s={path:a,parentPath:a.replace(/(.*)[.[].*/,"$1"),get:function(e,t){return M.get(e,t)}};return o.a.createElement(Ee,{when:function(e){var r=e.values;return t(r,s)}},o.a.createElement(Te,c({field:r},n)))}return o.a.createElement(Te,c({field:r},n))},Te=function(e){var t=e.children,r=h(e,["children"]),n=Ae(r),o=n.render,i=n.arrayFieldState,a=n.arrayFieldApi,s=n.field;return o("function"==typeof t?t(f(f({field:s,arrayFieldApi:a,arrayFieldState:i},a),i)):t)},Me=function(e){var t=e.arrayFieldItemState,r=e.arrayFieldItemApi,i=e.children,a=Object(n.useContext)(L),s=U(),l=g(Object(n.useState)(0),2),c=(l[0],l[1]),u=g(Object(n.useState)(new Map),1)[0],p=t.field,d=Oe(p);Object(n.useEffect)((function(){var e=function(e){e.slice(0,-1!=e.lastIndexOf("[")?e.lastIndexOf("]")+1:e.length)===p&&c(Math.random())};return s.emitter.on("value",e),function(){s.emitter.removeListener("value",e)}}),[p]);var h,v,m,y,b=(h=s.getState(),v=h.values,m=h.errors,y=h.touched,{values:M.get(v,p),errors:M.get(m,p),touched:M.get(y,p)}),x=f(f({},a),{},{register:function(e,t,r){u.set(e,t),a.register(e,t,r)},deregister:function(e){u.delete(e);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];a.deregister.apply(a,[e].concat(r))}}),w=f(f(f({},r),d),{},{reset:function(){u.forEach((function(e){e.fieldApi.reset()}))}}),C=f(f({},t),b);return"function"==typeof i?o.a.createElement(L.Provider,{value:x},o.a.createElement(D.Provider,{value:w},o.a.createElement(V.Provider,{value:C},i(f(f({arrayFieldItemApi:w,arrayFieldItemState:C},w),C))))):o.a.createElement(L.Provider,{value:x},o.a.createElement(D.Provider,{value:w},o.a.createElement(V.Provider,{value:C},i)))};je.Items=function(e){var t=e.children;return Object(n.useContext)(N).fields.map((function(e){var r=e.arrayFieldItemState,n=e.arrayFieldItemApi,i=r.key;return o.a.createElement(Me,{key:i,arrayFieldItemApi:n,arrayFieldItemState:r},t)}))};var Pe=function(e){var t=e.components,r=Object(n.useContext)(L).fieldMap;return t?t.map((function(e,t){var n=e["ui:control"],i=r[n];return o.a.createElement(i,{key:"ui-comp-".concat(t)})})):null},Le=w("informed:FormFields\t"),Ie=function e(t){var r=t.schema,i=t.prefix,a=t.onlyValidateSchema,s=Object(n.useContext)(L).fieldMap;return Object(n.useMemo)((function(){return X(r,a,i).map((function(t,r){var n=t.field,i=t.props,a=t.type,l=t.properties,u=t.items,f=t.componentType,p=t.uiBefore,d=t.uiAfter,h=t.allOf,v=s[f];return Le("Rendering Field",n,t),!v&&"object"===a&&l?o.a.createElement(e,{schema:t,prefix:n,key:"ScheamField-".concat(r)}):!v&&"array"===a&&u?o.a.createElement(Fe,c({key:"ScheamField-".concat(r),field:n,items:u,uiBefore:p,uiAfter:d},i)):v&&"array"===f&&u&&"array"===a?o.a.createElement(v,c({key:"ScheamField-".concat(r),field:n,items:u,uiBefore:p,uiAfter:d},i)):"conditionals"===f?h.map((function(t){var n=t.then,i=t.if.properties;return o.a.createElement(Ee,{key:"ScheamField-".concat(r),when:function(e){var t=e.values;return Object.keys(i).every((function(e){var r=i[e];return t[e]===r.const}))}},o.a.createElement(e,{schema:n}))})):v?o.a.createElement(v,c({key:"ScheamField-".concat(r),field:n},i)):null}))}),[r,i])},Fe=function(e){var t=e.field,r=e.items,n=e.uiBefore,i=e.uiAfter,a=h(e,["field","items","uiBefore","uiAfter"]);return o.a.createElement(je,c({field:t},a),o.a.createElement(Pe,{components:n}),o.a.createElement(je.Items,null,(function(e){var t=e.field;return o.a.createElement(o.a.Fragment,null,o.a.createElement(Pe,{components:r["ui:before"]}),o.a.createElement(Ie,{schema:r,prefix:t}),o.a.createElement(Pe,{components:r["ui:after"]}))})),o.a.createElement(Pe,{components:i}))},_e={select:ye,input:ve,textarea:me,checkbox:be,radio:Ce,add:function(){var e=Object(n.useContext)(R).add;return o.a.createElement("button",{onClick:function(){e()},type:"button"},"Add")},remove:function(){var e=Object(n.useContext)(D).remove;return o.a.createElement("button",{onClick:function(){e()},type:"button"},"Remove")},array:Fe},Ne=w("informed:Controller\t"),Re=function(){},De=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.options=r,this.subscriptions=new Map;var n=r.ajv,o=r.schema,a=r.fieldMap;this.ajv=n?new n({allErrors:!0}):null,this.ajvValidate=n?this.ajv.compile(o):null,this.fieldMap=a||_e,this.fieldsById=new Map,this.fieldsByName={get:function(e){var r;return t.fieldsById.forEach((function(t){t&&t.field===e&&(r=t)})),r}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:Re,setTouched:Re,setError:Re,reset:Re,validate:Re,getValue:Re,getTouched:Re,getError:Re,getFieldState:Re,checkRelevant:Re,getPristine:Re,getDirty:Re}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=t.fieldsById.get(e);o.shadow||M.set(t.state.values,o.field,o.fieldApi.getValue()),o.fieldApi.relevant(t.state.values)||M.delete(t.state.values,o.field),t.fieldsById.forEach((function(e){var r=e.fieldApi.checkRelevant();e.fieldApi.multistepRelevant(t.state.values)&&(r||e.keepState)||(M.delete(t.state.values,e.field),M.delete(t.state.touched,e.field),M.delete(t.state.errors,e.field))})),n&&(t.emit("change"),t.emit("field",o.field),t.emit("value",o.field,r))},setTouched:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=t.fieldsById.get(e);!o.shadow&&o.fieldApi.getIsRelevant()&&M.set(t.state.touched,o.field,o.fieldApi.getTouched()),o.shadow&&null!=o.fieldApi.getError()&&o.fieldApi.relevant(t.state.values)&&M.set(t.state.touched,o.field,o.fieldApi.getTouched()),n&&(t.emit("change"),t.emit("field",o.field))},setError:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=t.fieldsById.get(e);!o.shadow&&o.fieldApi.getIsRelevant()&&M.set(t.state.errors,o.field,o.fieldApi.getError());var i=M.get(t.state.errors,o.field);(o.shadow&&null!=o.fieldApi.getError()&&o.fieldApi.relevant(t.state.values)||o.shadow&&void 0===o.fieldApi.getError()&&o.fieldApi.relevant(t.state.values)&&"string"==typeof i)&&M.set(t.state.errors,o.field,o.fieldApi.getError()),n&&(t.emit("change"),t.emit("field",o.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",(function(e){delete t.state.error,t.notify(e)}))}return s(e,[{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=this.subscriptions.get(e);o&&o.forEach((function(e){return e.apply(void 0,r)}))}},{key:"on",value:function(e,t){this.subscriptions.get(e)||this.subscriptions.set(e,new Set),this.subscriptions.get(e).add(t)}},{key:"removeListener",value:function(e,t){this.subscriptions.get(e).delete(t)}},{key:"setOptions",value:function(e){this.options=e}},{key:"setValue",value:function(e,t,r){this.getField(e).fieldApi.setValue(t,null,f({allowEmptyString:this.options.allowEmptyStrings},r))}},{key:"setTouched",value:function(e,t){this.getField(e).fieldApi.setTouched(t)}},{key:"setError",value:function(e,t){this.getField(e).fieldApi.setError(t)}},{key:"setFormError",value:function(e){this.state.error=e,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(e,t){this.state.validating=this.state.validating-1,this.getError(e)||this.setError(e,t),this.state.validating>0||this.state.submitting&&(this.valid()?(Ne("Submit",this.state),this.emit("submit")):(Ne("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(e){this.state.step=e,this.emit("change")}},{key:"setCurrent",value:function(e){this.state.Current=e,this.emit("change")}},{key:"back",value:function(e){this.state.step=this.state.step-1,this.state.Current=e,this.emit("change")}},{key:"next",value:function(e){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=e),this.emit("change")}},{key:"setInitialValue",value:function(e,t){M.set(this.options.initialValues,e,t)}},{key:"getFormState",value:function(){return Ne("Returning form state"),f(f({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(e){var t=this.getValues();return M.get(t,e)}},{key:"getValue",value:function(e){var t=this.getField(e).fieldApi.getValue();return Ne("Getting value for",e,t),t}},{key:"getTouched",value:function(e){var t=this.getField(e).fieldApi.getTouched();return Ne("Getting touched for",e,t),t}},{key:"getError",value:function(e){var t=this.getField(e).fieldApi.getError();return Ne("Getting error for",e,t),t}},{key:"getDirty",value:function(e){var t=this.getField(e).fieldApi.getDirty();return Ne("Getting dirty for",e,t),t}},{key:"getPristine",value:function(e){var t=this.getField(e).fieldApi.getPristine();return Ne("Getting pristine for",e,t),t}},{key:"getValues",value:function(){return Ne("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return Ne("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return Ne("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(e){var t=this.fieldsByName.get(e);return t&&t.shadow?M.get(this.savedValues,"shadow-".concat(e)):M.get(this.savedValues,e)}},{key:"removeSavedState",value:function(e){var t=this.fieldsByName.get(e);return t&&t.shadow?M.delete(this.savedValues,"shadow-".concat(e)):M.delete(this.savedValues,e)}},{key:"getFullField",value:function(e){return e}},{key:"getInitialValue",value:function(e){return M.get(this.options.initialValues,e)}},{key:"getField",value:function(e){Ne("Getting Field",e);var t=this.fieldsByName.get(e);return t||(console.warn("Attempting to get field ".concat(e," but it does not exist")),this.dummyField)}},{key:"notify",value:function(e){var t=this,r=this.getField(e);r&&r.notify&&r.notify.forEach((function(r){var n=".".concat(e),o="".concat(n.replace(/(.*)[.[].*/,"$1"),".").concat(r).slice(1),i=t.getField(o);i&&(Ne("Notifying",i.field),i.fieldApi.validate(),i.fieldApi.checkRelevant())}))}},{key:"validateField",value:function(e){this.getField(e).fieldApi.validate()}},{key:"resetField",value:function(e){this.getField(e).fieldApi.reset()}},{key:"fieldExists",value:function(e){return null!=this.fieldsByName.get(e)}},{key:"valid",value:function(){var e=this.getErrors();return!(!M.empty(e)||this.state.error)}},{key:"screenValid",value:function(){return!Object.entries(this.onScreen).some((function(e){return g(e,2)[1].fieldApi.getError()}))}},{key:"invalid",value:function(){var e=this.getErrors();return!(M.empty(e)&&!this.state.error)}},{key:"pristine",value:function(){var e=!0;return this.fieldsById.forEach((function(t){t.fieldApi.getPristine()||(e=!1)})),e}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){Ne("Resetting"),this.fieldsById.forEach((function(e){e.fieldApi.reset({preventUpdate:!0})})),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(e){Ne("Setting values"),this.fieldsById.forEach((function(t){var r=M.get(e,t.field);void 0!==r&&t.fieldApi.setValue(r,null,{preventUpdate:!0})})),this.emit("change")}},{key:"validate",value:function(){var e=this;Ne("Validating all fields");var t=this.getValues();if(this.options.validationSchema){var r=q(this.options.validationSchema,t);this.fieldsById.forEach((function(t){if(M.has(r,t.field)){var n=M.get(r,t.field);e.setError(t.field,n)}else e.setError(t.field,void 0)}))}if(this.options.schema&&this.options.ajv){var n=K(this.ajvValidate,t);this.fieldsById.forEach((function(t){if(M.has(n,t.field)){var r=M.get(n,t.field);e.setError(t.field,r)}else e.setError(t.field,void 0)}))}if(this.fieldsById.forEach((function(e){e.fieldApi.validate(t),e.fieldApi.setTouched(!0,!0)})),this.options.validate){var o=this.options.validate(t);this.setFormError(o)}if(this.options.validateFields){var i=this.options.validateFields(t);this.fieldsById.forEach((function(t){if(M.has(i,t.field)){var r=M.get(i,t.field);e.setError(t.field,r)}}))}}},{key:"asyncValidate",value:function(){Ne("Async Validating all fields");var e=this.getValues();this.fieldsById.forEach((function(t){t.fieldApi.asyncValidate(e)}))}},{key:"keyDown",value:function(e){if(13==e.keyCode&&this.options.preventEnter)return e.preventDefault(e),!1}},{key:"submitForm",value:function(e){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&e&&e.preventDefault(e),this.validate(),this.emit("change"),this.asyncValidate(),this.state.validating>0||(this.valid()?(Ne("Submit",this.state),this.emit("submit")):(Ne("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var e=this;this.fieldsById.forEach((function(t){e.emit("field",t.field)}))}},{key:"register",value:function(e,t,r){var n=t.field,o=t.state;Ne("Register ID:",e,"Name:",n,o,"Initial",r);var i,a=n.slice(0,-1!=n.lastIndexOf("[")?n.lastIndexOf("]")+1:n.length);this.fieldsById.forEach((function(e,t){e&&e.field===n&&(i=t)})),//!this.expectedRemovals[magicValue] &&
14
14
  i&&(t.keepState||t.inMultistep)?(Ne("Already Registered",n),this.fieldsById.delete(i))://!this.expectedRemovals[magicValue] &&
15
15
  !i||t.keepState&&t.inMultistep||console.warn("Check to make sure you have not registered two fields with the fieldName",n),Ne("Fields Registered",this.fieldsById.size),this.onScreen[e]=t,this.fieldsById.set(e,t),Ne("clearing expected removal",a),delete this.expectedRemovals[a],delete this.pulledOut[a],t.shadow||(this.updater.setValue(e,t.fieldApi.getValue(),!1),this.updater.setError(e,t.fieldApi.getError(),!1),this.updater.setTouched(e,t.fieldApi.getTouched(),!1),r||this.emit("change"),this.emit("field",n))}},{key:"deregister",value:function(e){var t=this.fieldsById.get(e),r=t.field;Ne("Deregister",e,r),delete this.onScreen[e];var n=function(e,t){var r=Object.keys(t).find((function(t){return e.includes(t)}));if(r)return e.slice(0,r.length)===r}(r,this.expectedRemovals),o=r.slice(0,-1!=r.lastIndexOf("[")?r.lastIndexOf("]")+1:r.length);!t.keepState&&!t.inMultistep||n||(Ne("Saving field ".concat(r,"'s value"),t.fieldApi.getFieldState()),t.shadow?M.set(this.savedValues,"shadow-".concat(r),t.fieldApi.getFieldState()):M.set(this.savedValues,r,t.fieldApi.getFieldState())),(n||!t.keepState&&!t.inMultistep||!t.fieldApi.getIsRelevant()&&!t.keepState)&&(Ne("Removing field",r),this.fieldsById.delete(e),n||(M.delete(this.state.values,r),M.delete(this.state.touched,r),M.delete(this.state.errors,r),t.shadow?M.delete(this.savedValues,"shadow-".concat(r)):M.delete(this.savedValues,r)),n&&this.pulledOut[o]&&(Ne("Pulling out",r,"with magic value",o),M.pullOut(this.state.values,o),M.pullOut(this.state.touched,o),M.pullOut(this.state.errors,o),M.pullOut(this.savedValues,o),delete this.pulledOut[o])),this.emit("change")}},{key:"expectRemoval",value:function(e){Ne("Expecting removal of",e),this.expectedRemovals[e]=!0,this.pulledOut[e]=!0}},{key:"update",value:function(e,t,r){Ne("Update",e,t.field,r,t.fieldState.value);var n=t.fieldApi.getValue(),o=t.fieldApi.getError(),i=t.fieldApi.getTouched(),a=this.fieldsByName.get(r);r&&!a&&(M.set(this.state.values,r),M.set(this.state.errors,r),M.set(this.state.touched,r)),M.set(this.state.values,t.field,n),M.set(this.state.errors,t.field,o),M.set(this.state.touched,t.field,i),this.emit("change")}}]),e}(),Ve=w("informed:FormProvider\t\t"),Be=function(e){var t=e.children,r=e.formApi,n=e.formController,i=e.formState,a=h(e,["children","formApi","formController","formState"]);if(Ve("Render FormProvider"),r)return Ve("Render FormProvider with given values"),o.a.createElement(L.Provider,{value:n.updater},o.a.createElement(F.Provider,{value:r},o.a.createElement(I.Provider,{value:i},t)));Ve("Render FormProvider with generated values");var s=ze(a);return o.a.createElement(L.Provider,{value:s.formController.updater},o.a.createElement(F.Provider,{value:s.formApi},o.a.createElement(I.Provider,{value:s.formState},t)))},Ue=w("informed:useForm\t\t"),ze=function(e){var t=e.dontPreventDefault,r=e.initialValues,i=e.validate,a=e.validateFields,s=e.allowEmptyStrings,l=e.preventEnter,c=e.getApi,u=e.apiRef,f=e.onChange,p=e.onReset,d=e.onSubmit,v=e.onValueChange,m=e.onSubmitFailure,y=e.validationSchema,b=e.schema,x=e.ajv,w=e.fieldMap,C=e.onlyValidateSchema,k=h(e,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);Ue("Render useForm");var A=Object(n.useMemo)((function(){return{dontPreventDefault:t,initialValues:r,validate:i,validateFields:a,allowEmptyStrings:s,preventEnter:l,validationSchema:y,schema:b,ajv:x,fieldMap:w}}),[t,r,i,a,s,l,y,b,x,w]),O=g(Object(n.useState)((function(){return new De(A)})),1)[0];Object(n.useEffect)((function(){O.setOptions(A)}),[A]),Z((function(){O.mount()}),[]);var S=g(Object(n.useState)((function(){return O.getFormState()})),2),E=S[0],j=S[1];Z((function(){var e=function(){return f&&f(O.getFormState())},t=function(){return p&&p()},r=function(){return d&&d(O.getFormState().values)},n=function(){return v&&v(O.getFormState().values)},o=function(){return m&&m(O.getFormState().errors)};return O.on("change",e),O.on("reset",t),O.on("submit",r),O.on("value",n),O.on("failure",o),function(){O.removeListener("change",e),O.removeListener("reset",t),O.removeListener("submit",r),O.removeListener("value",n),O.removeListener("failure",o)}}),[f,p,d,v,m]),Object(n.useState)((function(){O.on("change",(function(){Ue("Setting form state"),j(O.getFormState())})),c&&c(O.getFormApi()),u&&(u.current=O.getFormApi())}));var T=g(Object(n.useState)((function(){return O.getFormApi()})),1)[0];return{formApi:T,formState:E,formController:O,render:function(e){return o.a.createElement(Be,{formApi:T,formState:E,formController:O},o.a.createElement(o.a.Fragment,null,e||o.a.createElement(Ie,{schema:b,onlyValidateSchema:C})))},userProps:k}},We=w("informed:Form\t\t"),He=function(e){var t=e.children,r=e.render,n=e.component,i=h(e,["children","render","component"]);We("Render FORM");var a,s=ze(i),l=s.formApi,u=s.formController,f=s.formState,p=s.render,d=s.userProps;return p(o.a.createElement("form",c({},d,{onReset:u.reset,onSubmit:u.submitForm,onKeyDown:u.keyDown}),(a={formState:f,formApi:l},n?o.a.createElement(n,a,t):r?r(a):"function"==typeof t?t(a):t)))}}).call(this,r(24))},function(e,t,r){var n=r(631),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,r){var n,o,i,a=r(716),s=r(569),l=r(571),c=r(577),u=r(574),f=r(662),p=r(633),d=r(613),h=s.WeakMap;if(a||f.state){var v=f.state||(f.state=new h),m=v.get,g=v.has,y=v.set;n=function(e,t){if(g.call(v,e))throw new TypeError("Object already initialized");return t.facade=e,y.call(v,e,t),t},o=function(e){return m.call(v,e)||{}},i=function(e){return g.call(v,e)}}else{var b=p("state");d[b]=!0,n=function(e,t){if(u(e,b))throw new TypeError("Object already initialized");return t.facade=e,c(e,b,t),t},o=function(e){return u(e,b)?e[b]:{}},i=function(e){return u(e,b)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},function(e,t,r){var n=r(611),o=r(654),i=r(581),a=r(592),s=r(667),l=[].push,c=function(e){var t=1==e,r=2==e,c=3==e,u=4==e,f=6==e,p=7==e,d=5==e||f;return function(h,v,m,g){for(var y,b,x=i(h),w=o(x),C=n(v,m,3),k=a(w.length),A=0,O=g||s,S=t?O(h,k):r||p?O(h,0):void 0;k>A;A++)if((d||A in w)&&(b=C(y=w[A],A,x),e))if(t)S[A]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return A;case 2:l.call(S,y)}else switch(e){case 4:return!1;case 7:l.call(S,y)}return f?-1:c||u?u:S}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},function(e,t,r){var n=r(829),o=r(834);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},function(e,t,r){var n=r(606),o=r(830),i=r(831),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,r){e.exports=r(929)},function(e,t,r){e.exports=r(941)},function(e,t,r){e.exports=r(1020)},function(e,t,r){var n=r(572),o=r(628),i=r(601),a=r(580),s=r(630),l=r(574),c=r(708),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=a(e),t=s(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=!0},function(e,t,r){var n=r(666),o=r(582).f,i=r(577),a=r(574),s=r(799),l=r(570)("toStringTag");e.exports=function(e,t,r,c){if(e){var u=r?e:e.prototype;a(u,l)||o(u,l,{configurable:!0,value:t}),c&&!n&&i(u,"toString",s)}}},function(e,t,r){r(720);var n=r(812),o=r(569),i=r(617),a=r(577),s=r(605),l=r(570)("toStringTag");for(var c in n){var u=o[c],f=u&&u.prototype;f&&i(f)!==l&&a(f,l,c),s[c]=s.Array}},function(e,t){e.exports={}},function(e,t,r){var n=r(584).Symbol;e.exports=n},function(e,t,r){var n=r(637),o=r(672);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},function(e,t,r){var n=r(732),o=r(733),i=r(607);e.exports=function(e){return i(e)?n(e):o(e)}},function(e,t,r){var n=r(573),o=r(745),i=r(592),a=r(611),s=r(679),l=r(744),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,r){var u,f,p,d,h,v,m,g=r&&r.that,y=!(!r||!r.AS_ENTRIES),b=!(!r||!r.IS_ITERATOR),x=!(!r||!r.INTERRUPTED),w=a(t,g,1+y+x),C=function(e){return u&&l(u),new c(!0,e)},k=function(e){return y?(n(e),x?w(e[0],e[1],C):w(e[0],e[1])):x?w(e,C):w(e)};if(b)u=e;else{if("function"!=typeof(f=s(e)))throw TypeError("Target is not iterable");if(o(f)){for(p=0,d=i(e.length);d>p;p++)if((h=k(e[p]))&&h instanceof c)return h;return new c(!1)}u=f.call(e)}for(v=u.next;!(m=v.call(u)).done;){try{h=k(m.value)}catch(e){throw l(u),e}if("object"==typeof h&&h&&h instanceof c)return h}return new c(!1)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(590);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){var n=r(710),o=r(658);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t){e.exports={}},function(e,t,r){var n=r(610);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n,o=r(573),i=r(714),a=r(658),s=r(613),l=r(715),c=r(655),u=r(633),f=u("IE_PROTO"),p=function(){},d=function(e){return"<script>"+e+"<\/script>"},h=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;h=n?function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t}(n):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F);for(var r=a.length;r--;)delete h.prototype[a[r]];return h()};s[f]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p.prototype=o(e),r=new p,p.prototype=null,r[f]=e):r=h(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(577);e.exports=function(e,t,r,o){o&&o.enumerable?e[t]=r:n(e,t,r)}},function(e,t,r){var n=r(666),o=r(610),i=r(570)("toStringTag"),a="Arguments"==o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:a?o(t):"Object"==(n=o(t))&&"function"==typeof t.callee?"Arguments":n}},function(e,t,r){var n=r(567),o=r(570),i=r(632),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,r){var n=r(574),o=r(581),i=r(633),a=r(723),s=i("IE_PROTO"),l=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=o(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},function(e,t,r){"use strict";var n=r(630),o=r(582),i=r(601);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},function(e,t,r){var n=r(636),o=r(726);e.exports=function(e,t,r,i){var a=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=i?i(r[c],e[c],c,r,e):void 0;void 0===u&&(u=e[c]),a?o(r,c,u):n(r,c,u)}return r}},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(894),o=r(895),i=r(681),a=r(896);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(590),o=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new o(e)}},function(e,t,r){var n=r(642);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,r){e.exports=r(1021)},function(e,t,r){var n=r(1051),o=r(695),i=r(1052),a=r(1053),s=r(1054),l=r(596),c=r(729),u=c(n),f=c(o),p=c(i),d=c(a),h=c(s),v=l;(n&&"[object DataView]"!=v(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||i&&"[object Promise]"!=v(i.resolve())||a&&"[object Set]"!=v(new a)||s&&"[object WeakMap]"!=v(new s))&&(v=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case u:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:n},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(571);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n,o,i=r(569),a=r(660),s=i.process,l=s&&s.versions,c=l&&l.v8;c?o=(n=c.split("."))[0]<4?1:n[0]+n[1]:a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=n[1]),e.exports=o&&+o},function(e,t,r){var n=r(661),o=r(634),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t,r){var n=r(573),o=r(811);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,i){return n(r),o(i),t?e.call(r,i):r.__proto__=i,r}}():void 0)},function(e,t,r){var n=r(726),o=r(638),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];i.call(e,t)&&o(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(596),o=r(585);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t){var r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,r){var n=r(843),o=r(587),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},function(e,t,r){(function(e){var n=r(584),o=r(844),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l}).call(this,r(184)(e))},function(e,t,r){var n=r(596),o=r(587);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},function(e,t,r){e.exports=r(853)},function(e,t,r){"use strict";var n=r(879).charAt,o=r(593),i=r(721),a=o.set,s=o.getterFor("String Iterator");i(String,"String",(function(e){a(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=s(this),r=t.string,o=t.index;return o>=r.length?{value:void 0,done:!0}:(e=n(r,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,r){e.exports=r(910)},function(e,t,r){var n=r(575),o=r(693),i=r(957),a=r(738);e.exports=function(e,t){return n(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,r){var n=r(595)(Object,"create");e.exports=n},function(e,t,r){var n=r(967),o=r(968),i=r(969),a=r(970),s=r(971);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},function(e,t,r){var n=r(638);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},function(e,t,r){var n=r(973);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},function(e,t,r){var n=r(1017),o=r(1018),i=r(681),a=r(1019);e.exports=function(e){return n(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(692);e.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},function(e,t,r){var n=r(567),o=r(610),i="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t,r){var n=r(569),o=r(571),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){var n=r(580),o=r(592),i=r(657),a=function(e){return function(t,r,a){var s,l=n(t),c=o(l.length),u=i(a,c);if(e&&r!=r){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t,r){var n=r(631),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,r){var n=r(632),o=r(567);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(e,t,r){var n=r(583);e.exports=n("navigator","userAgent")||""},function(e,t,r){var n=r(602),o=r(662);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.14.0",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(569),o=r(797),i=n["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,r){var n=r(710),o=r(658).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(570);t.f=n},function(e,t,r){var n={};n[r(570)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,r){var n=r(571),o=r(614),i=r(570)("species");e.exports=function(e,t){var r;return o(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!o(r.prototype)?n(r)&&null===(r=r[i])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},function(e,t){e.exports=function(){}},function(e,t,r){e.exports=r(826)},function(e,t,r){var n=r(636),o=r(621),i=r(835),a=r(607),s=r(622),l=r(608),c=Object.prototype.hasOwnProperty,u=i((function(e,t){if(s(t)||a(t))o(t,l(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=u},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,r){var n=r(845),o=r(674),i=r(675),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(728),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,r(184)(e))},function(e,t,r){var n=r(643),o=r(678),i=r(680),a=r(681);e.exports=function(e,t){var r=void 0!==n&&o(e)||e["@@iterator"];if(!r){if(i(e)||(r=a(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var s=0,l=function(){};return{s:l,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){f=!0,c=e},f:function(){try{u||null==r.return||r.return()}finally{if(f)throw c}}}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t,r){e.exports=r(878)},function(e,t,r){var n=r(617),o=r(605),i=r(570)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t,r){e.exports=r(880)},function(e,t,r){var n=r(883),o=r(742),i=r(747);e.exports=function(e,t){var r;if(e){if("string"==typeof e)return i(e,t);var a=n(r=Object.prototype.toString.call(e)).call(r,8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?o(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(897);function o(e,t,r,o,i,a,s){try{var l=e[a](s),c=l.value}catch(e){return void r(e)}l.done?t(c):n.resolve(c).then(o,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new n((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(616);e.exports=function(e,t,r){for(var o in t)r&&r.unsafe&&e[o]?e[o]=t[o]:n(e,o,t[o],r);return e}},function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},function(e,t,r){var n=r(610),o=r(569);e.exports="process"==n(o.process)},function(e,t,r){e.exports=r(911)},function(e,t,r){e.exports=r(926)},function(e,t,r){"use strict";var n=SyntaxError,o=Function,i=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(e){s=null}var l=function(){throw new i},c=s?function(){try{return l}catch(e){try{return s(arguments,"callee").get}catch(e){return l}}}():l,u=r(946)(),f=Object.getPrototypeOf||function(e){return e.__proto__},p={},d="undefined"==typeof Uint8Array?void 0:f(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":u?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u?f(""[Symbol.iterator]()):void 0,"%Symbol%":u?Symbol:void 0,"%SyntaxError%":n,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(689),g=r(949),y=m.call(Function.call,Array.prototype.concat),b=m.call(Function.apply,Array.prototype.splice),x=m.call(Function.call,String.prototype.replace),w=m.call(Function.call,String.prototype.slice),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,A=function(e){var t=w(e,0,1),r=w(e,-1);if("%"===t&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var o=[];return x(e,C,(function(e,t,r,n){o[o.length]=r?x(n,k,"$1"):t||e})),o},O=function(e,t){var r,o=e;if(g(v,o)&&(o="%"+(r=v[o])[0]+"%"),g(h,o)){var s=h[o];if(s===p&&(s=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=f(o.prototype))}return h[t]=r,r}(o)),void 0===s&&!t)throw new i("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:s}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new i('"allowMissing" argument must be a boolean');var r=A(e),o=r.length>0?r[0]:"",a=O("%"+o+"%",t),l=a.name,c=a.value,u=!1,f=a.alias;f&&(o=f[0],b(r,y([0,1],f)));for(var p=1,d=!0;p<r.length;p+=1){var v=r[p],m=w(v,0,1),x=w(v,-1);if(('"'===m||"'"===m||"`"===m||'"'===x||"'"===x||"`"===x)&&m!==x)throw new n("property names with quotes must have matching quotes");if("constructor"!==v&&d||(u=!0),g(h,l="%"+(o+="."+v)+"%"))c=h[l];else if(null!=c){if(!(v in c)){if(!t)throw new i("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&p+1>=r.length){var C=s(c,v);c=(d=!!C)&&"get"in C&&!("originalValue"in C.get)?C.get:c[v]}else d=g(c,v),c=c[v];d&&!u&&(h[l]=c)}}return c}},function(e,t,r){"use strict";var n=r(948);e.exports=Function.prototype.bind||n},function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g,i="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:i,RFC3986:a}},function(e,t,r){var n=r(955),o=r(980)((function(e,t){return null==e?{}:n(e,t)}));e.exports=o},function(e,t,r){var n=r(647),o=r(625);e.exports=function(e,t){for(var r=0,i=(t=n(t,e)).length;null!=e&&r<i;)e=e[o(t[r++])];return r&&r==i?e:void 0}},function(e,t,r){var n=r(575),o=r(642),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t,r){var n=r(960),o=r(972),i=r(974),a=r(975),s=r(976);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},function(e,t,r){var n=r(595)(r(584),"Map");e.exports=n},function(e,t){e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(669);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),n(e,o.key,o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(760),o=r(993);function i(t){return e.exports=i=n?o:function(e){return e.__proto__||o(e)},e.exports.default=e.exports,e.exports.__esModule=!0,i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(649),o=r(1035),i=r(1036),a=r(1037),s=r(1038),l=r(1039);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=l,e.exports=c},function(e,t,r){var n=r(1050),o=r(769),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},function(e,t,r){var n=r(732),o=r(1069),i=r(607);e.exports=function(e){return i(e)?n(e,!0):o(e)}},function(e,t,r){var n=r(734)(Object.getPrototypeOf,Object);e.exports=n},function(e,t,r){var n=r(766);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t,r){var n=r(613),o=r(571),i=r(574),a=r(582).f,s=r(634),l=r(1092),c=s("meta"),u=0,f=Object.isExtensible||function(){return!0},p=function(e){a(e,c,{value:{objectID:"O"+ ++u,weakData:{}}})},d=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,c)){if(!f(e))return"F";if(!t)return"E";p(e)}return e[c].objectID},getWeakData:function(e,t){if(!i(e,c)){if(!f(e))return!0;if(!t)return!1;p(e)}return e[c].weakData},onFreeze:function(e){return l&&d.REQUIRED&&f(e)&&!i(e,c)&&p(e),e}};n[c]=!0},function(e,t,r){e.exports=r(793)},function(e,t,r){r(794);var n=r(566);e.exports=n.Object.keys},function(e,t,r){var n=r(572),o=r(567),i=r(655);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(567),o=/#|\.prototype\./,i=function(e,t){var r=s[a(e)];return r==c||r!=l&&("function"==typeof t?n(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=i.data={},l=i.NATIVE="N",c=i.POLYFILL="P";e.exports=i},function(e,t,r){var n=r(574),o=r(580),i=r(656).indexOf,a=r(613);e.exports=function(e,t){var r,s=o(e),l=0,c=[];for(r in s)!n(a,r)&&n(s,r)&&c.push(r);for(;t.length>l;)n(s,r=t[l++])&&(~i(c,r)||c.push(r));return c}},function(e,t,r){e.exports=r(795)},function(e,t,r){"use strict";var n=r(565),o=r(569),i=r(583),a=r(602),s=r(572),l=r(659),c=r(713),u=r(567),f=r(574),p=r(614),d=r(571),h=r(573),v=r(581),m=r(580),g=r(630),y=r(601),b=r(615),x=r(612),w=r(663),C=r(798),k=r(664),A=r(600),O=r(582),S=r(628),E=r(577),j=r(616),T=r(661),M=r(633),P=r(613),L=r(634),I=r(570),F=r(665),_=r(568),N=r(603),R=r(593),D=r(594).forEach,V=M("hidden"),B=I("toPrimitive"),U=R.set,z=R.getterFor("Symbol"),W=Object.prototype,H=o.Symbol,q=i("JSON","stringify"),G=A.f,$=O.f,K=C.f,J=S.f,Y=T("symbols"),X=T("op-symbols"),Q=T("string-to-symbol-registry"),Z=T("symbol-to-string-registry"),ee=T("wks"),te=o.QObject,re=!te||!te.prototype||!te.prototype.findChild,ne=s&&u((function(){return 7!=b($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=G(W,t);n&&delete W[t],$(e,t,r),n&&e!==W&&$(W,t,n)}:$,oe=function(e,t){var r=Y[e]=b(H.prototype);return U(r,{type:"Symbol",tag:e,description:t}),s||(r.description=t),r},ie=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof H},ae=function(e,t,r){e===W&&ae(X,t,r),h(e);var n=g(t,!0);return h(r),f(Y,n)?(r.enumerable?(f(e,V)&&e[V][n]&&(e[V][n]=!1),r=b(r,{enumerable:y(0,!1)})):(f(e,V)||$(e,V,y(1,{})),e[V][n]=!0),ne(e,n,r)):$(e,n,r)},se=function(e,t){h(e);var r=m(t),n=x(r).concat(fe(r));return D(n,(function(t){s&&!le.call(r,t)||ae(e,t,r[t])})),e},le=function(e){var t=g(e,!0),r=J.call(this,t);return!(this===W&&f(Y,t)&&!f(X,t))&&(!(r||!f(this,t)||!f(Y,t)||f(this,V)&&this[V][t])||r)},ce=function(e,t){var r=m(e),n=g(t,!0);if(r!==W||!f(Y,n)||f(X,n)){var o=G(r,n);return!o||!f(Y,n)||f(r,V)&&r[V][n]||(o.enumerable=!0),o}},ue=function(e){var t=K(m(e)),r=[];return D(t,(function(e){f(Y,e)||f(P,e)||r.push(e)})),r},fe=function(e){var t=e===W,r=K(t?X:m(e)),n=[];return D(r,(function(e){!f(Y,e)||t&&!f(W,e)||n.push(Y[e])})),n};(l||(j((H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=L(e),r=function(e){this===W&&r.call(X,e),f(this,V)&&f(this[V],t)&&(this[V][t]=!1),ne(this,t,y(1,e))};return s&&re&&ne(W,t,{configurable:!0,set:r}),oe(t,e)}).prototype,"toString",(function(){return z(this).tag})),j(H,"withoutSetter",(function(e){return oe(L(e),e)})),S.f=le,O.f=ae,A.f=ce,w.f=C.f=ue,k.f=fe,F.f=function(e){return oe(I(e),e)},s&&($(H.prototype,"description",{configurable:!0,get:function(){return z(this).description}}),a||j(W,"propertyIsEnumerable",le,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:H}),D(x(ee),(function(e){_(e)})),n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=String(e);if(f(Q,t))return Q[t];var r=H(t);return Q[t]=r,Z[r]=t,r},keyFor:function(e){if(!ie(e))throw TypeError(e+" is not a symbol");if(f(Z,e))return Z[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!s},{create:function(e,t){return void 0===t?b(e):se(b(e),t)},defineProperty:ae,defineProperties:se,getOwnPropertyDescriptor:ce}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ue,getOwnPropertySymbols:fe}),n({target:"Object",stat:!0,forced:u((function(){k.f(1)}))},{getOwnPropertySymbols:function(e){return k.f(v(e))}}),q)&&n({target:"JSON",stat:!0,forced:!l||u((function(){var e=H();return"[null]"!=q([e])||"{}"!=q({a:e})||"{}"!=q(Object(e))}))},{stringify:function(e,t,r){for(var n,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=t,(d(t)||void 0!==e)&&!ie(e))return p(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ie(t))return t}),o[1]=t,q.apply(null,o)}});H.prototype[B]||E(H.prototype,B,H.prototype.valueOf),N(H,"Symbol"),P[V]=!0},function(e,t,r){var n=r(659);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){var n=r(572),o=r(582),i=r(573),a=r(612);e.exports=n?Object.defineProperties:function(e,t){i(e);for(var r,n=a(t),s=n.length,l=0;s>l;)o.f(e,r=n[l++],t[r]);return e}},function(e,t,r){var n=r(583);e.exports=n("document","documentElement")},function(e,t,r){var n=r(569),o=r(717),i=n.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},function(e,t,r){var n=r(662),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return o.call(e)}),e.exports=n.inspectSource},function(e,t,r){var n=r(802),o=Array.prototype;e.exports=function(e){var t=e.filter;return e===o||e instanceof Array&&t===o.filter?n:t}},function(e,t,r){e.exports=r(804)},function(e,t,r){"use strict";var n=r(580),o=r(668),i=r(605),a=r(593),s=r(721),l=a.set,c=a.getterFor("Array Iterator");e.exports=s(Array,"Array",(function(e,t){l(this,{type:"Array Iterator",target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,r){"use strict";var n=r(565),o=r(810),i=r(619),a=r(635),s=r(603),l=r(577),c=r(616),u=r(570),f=r(602),p=r(605),d=r(722),h=d.IteratorPrototype,v=d.BUGGY_SAFARI_ITERATORS,m=u("iterator"),g=function(){return this};e.exports=function(e,t,r,u,d,y,b){o(r,t,u);var x,w,C,k=function(e){if(e===d&&j)return j;if(!v&&e in S)return S[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},A=t+" Iterator",O=!1,S=e.prototype,E=S[m]||S["@@iterator"]||d&&S[d],j=!v&&E||k(d),T="Array"==t&&S.entries||E;if(T&&(x=i(T.call(new e)),h!==Object.prototype&&x.next&&(f||i(x)===h||(a?a(x,h):"function"!=typeof x[m]&&l(x,m,g)),s(x,A,!0,!0),f&&(p[A]=g))),"values"==d&&E&&"values"!==E.name&&(O=!0,j=function(){return E.call(this)}),f&&!b||S[m]===j||l(S,m,j),p[t]=j,d)if(w={values:k("values"),keys:y?j:k("keys"),entries:k("entries")},b)for(C in w)(v||O||!(C in S))&&c(S,C,w[C]);else n({target:t,proto:!0,forced:v||O},w);return w}},function(e,t,r){"use strict";var n,o,i,a=r(567),s=r(619),l=r(577),c=r(574),u=r(570),f=r(602),p=u("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(n=o):d=!0);var h=null==n||a((function(){var e={};return n[p].call(e)!==e}));h&&(n={}),f&&!h||c(n,p)||l(n,p,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},function(e,t,r){var n=r(567);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,r){"use strict";var n=r(567);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},function(e,t,r){var n=r(669);e.exports=function(e,t,r){return t in e?n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(727);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},function(e,t,r){var n=r(595),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(25))},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(837),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),l=Array(s);++a<s;)l[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=r(l),n(e,this,c)}}},function(e,t,r){var n=r(838),o=r(840)(n);e.exports=o},function(e,t,r){var n=r(842),o=r(640),i=r(575),a=r(641),s=r(639),l=r(673),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),u=!r&&o(e),f=!r&&!u&&a(e),p=!r&&!u&&!f&&l(e),d=r||u||f||p,h=d?n(e.length,String):[],v=h.length;for(var m in e)!t&&!c.call(e,m)||d&&("length"==m||f&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,v))||h.push(m);return h}},function(e,t,r){var n=r(622),o=r(846),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(847),o=r(736),i=r(737),a=r(738);e.exports=function(e,t,r){return e=a(e),r=null==r?0:n(i(r),0,e.length),t=o(t),e.slice(r,r+t.length)==t}},function(e,t,r){var n=r(606),o=r(848),i=r(575),a=r(642),s=n?n.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return l?l.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},function(e,t,r){var n=r(849);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},function(e,t,r){var n=r(736);e.exports=function(e){return null==e?"":n(e)}},function(e,t,r){"use strict";var n=r(565),o=r(567),i=r(614),a=r(571),s=r(581),l=r(592),c=r(620),u=r(667),f=r(618),p=r(570),d=r(632),h=p("isConcatSpreadable"),v=d>=51||!o((function(){var e=[];return e[h]=!1,e.concat()[0]!==e})),m=f("concat"),g=function(e){if(!a(e))return!1;var t=e[h];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,forced:!v||!m},{concat:function(e){var t,r,n,o,i,a=s(this),f=u(a,0),p=0;for(t=-1,n=arguments.length;t<n;t++)if(g(i=-1===t?a:arguments[t])){if(p+(o=l(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<o;r++,p++)r in i&&c(f,p,i[r])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");c(f,p++,i)}return f.length=p,f}})},function(e,t,r){r(568)("iterator")},function(e,t,r){var n=r(885),o=Array.prototype;e.exports=function(e){var t=e.slice;return e===o||e instanceof Array&&t===o.slice?n:t}},function(e,t,r){e.exports=r(887)},function(e,t,r){r(644),r(888);var n=r(566);e.exports=n.Array.from},function(e,t,r){var n=r(573);e.exports=function(e){var t=e.return;if(void 0!==t)return n(t.call(e)).value}},function(e,t,r){var n=r(570),o=r(605),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},function(e,t,r){var n=r(570)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){r(749),r(677),r(899),r(755),r(756),r(905),r(644),r(604);var n=r(566);e.exports=n.Promise},function(e,t,r){"use strict";var n=r(565),o=r(619),i=r(635),a=r(615),s=r(577),l=r(601),c=r(609),u=function(e,t){var r=this;if(!(r instanceof u))return new u(e,t);i&&(r=i(new Error(void 0),o(r))),void 0!==t&&s(r,"message",String(t));var n=[];return c(e,n.push,{that:n}),s(r,"errors",n),r};u.prototype=a(Error.prototype,{constructor:l(5,u),message:l(5,""),name:l(5,"AggregateError")}),n({global:!0},{AggregateError:u})},function(e,t,r){var n=r(569);e.exports=n.Promise},function(e,t,r){var n=r(573),o=r(590),i=r(570)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[i])?t:o(r)}},function(e,t,r){var n,o,i,a=r(569),s=r(567),l=r(611),c=r(715),u=r(655),f=r(753),p=r(685),d=a.location,h=a.setImmediate,v=a.clearImmediate,m=a.process,g=a.MessageChannel,y=a.Dispatch,b=0,x={},w=function(e){if(x.hasOwnProperty(e)){var t=x[e];delete x[e],t()}},C=function(e){return function(){w(e)}},k=function(e){w(e.data)},A=function(e){a.postMessage(e+"",d.protocol+"//"+d.host)};h&&v||(h=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return x[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(b),b},v=function(e){delete x[e]},p?n=function(e){m.nextTick(C(e))}:y&&y.now?n=function(e){y.now(C(e))}:g&&!f?(i=(o=new g).port2,o.port1.onmessage=k,n=l(i.postMessage,i,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&d&&"file:"!==d.protocol&&!s(A)?(n=A,a.addEventListener("message",k,!1)):n="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),w(e)}}:function(e){setTimeout(C(e),0)}),e.exports={set:h,clear:v}},function(e,t,r){var n=r(660);e.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(n)},function(e,t,r){var n=r(573),o=r(571),i=r(624);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){"use strict";var n=r(565),o=r(590),i=r(624),a=r(645),s=r(609);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=i.f(t),n=r.resolve,l=r.reject,c=a((function(){var r=o(t.resolve),i=[],a=0,l=1;s(e,(function(e){var o=a++,s=!1;i.push(void 0),l++,r.call(t,e).then((function(e){s||(s=!0,i[o]={status:"fulfilled",value:e},--l||n(i))}),(function(e){s||(s=!0,i[o]={status:"rejected",reason:e},--l||n(i))}))})),--l||n(i)}));return c.error&&l(c.value),r.promise}})},function(e,t,r){"use strict";var n=r(565),o=r(590),i=r(583),a=r(624),s=r(645),l=r(609);n({target:"Promise",stat:!0},{any:function(e){var t=this,r=a.f(t),n=r.resolve,c=r.reject,u=s((function(){var r=o(t.resolve),a=[],s=0,u=1,f=!1;l(e,(function(e){var o=s++,l=!1;a.push(void 0),u++,r.call(t,e).then((function(e){l||f||(f=!0,n(e))}),(function(e){l||f||(l=!0,a[o]=e,--u||c(new(i("AggregateError"))(a,"No one promise resolved")))}))})),--u||c(new(i("AggregateError"))(a,"No one promise resolved"))}));return u.error&&c(u.value),r.promise}})},function(e,t,r){e.exports=r(937)},function(e,t,r){"use strict";var n=r(690),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],a=o.obj[o.prop],s=Object.keys(a),l=0;l<s.length;++l){var c=s[l],u=a[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:a,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var l="",c=0;c<s.length;++c){var u=s.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===n.RFC1738&&(40===u||41===u)?l+=s.charAt(c):u<128?l+=a[u]:u<2048?l+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?l+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(c)),l+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return l},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!o.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var a=t;return i(t)&&!i(r)&&(a=s(t,n)),i(t)&&i(r)?(r.forEach((function(r,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&r&&"object"==typeof r?t[i]=e(a,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var a=r[i];return o.call(t,i)?t[i]=e(t[i],a,n):t[i]=a,t}),a)}}},function(e,t,r){var n=r(978),o=r(979);e.exports=function(e,t){return null!=e&&o(e,t,n)}},function(e,t,r){e.exports=r(990)},function(e,t,r){e.exports=r(1004)},function(e,t,r){e.exports=r(1025)},function(e,t,r){var n=r(1033),o=r(1056),i=r(671),a=r(575),s=r(1057);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):n(e):s(e)}},function(e,t,r){var n=r(1040),o=r(587);e.exports=function e(t,r,i,a,s){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,i,a,e,s))}},function(e,t,r){var n=r(1041),o=r(1044),i=r(1045);e.exports=function(e,t,r,a,s,l){var c=1&r,u=e.length,f=t.length;if(u!=f&&!(c&&f>u))return!1;var p=l.get(e),d=l.get(t);if(p&&d)return p==t&&d==e;var h=-1,v=!0,m=2&r?new n:void 0;for(l.set(e,t),l.set(t,e);++h<u;){var g=e[h],y=t[h];if(a)var b=c?a(y,g,h,t,e,l):a(g,y,h,e,t,l);if(void 0!==b){if(b)continue;v=!1;break}if(m){if(!o(t,(function(e,t){if(!i(m,t)&&(g===e||s(g,e,r,a,l)))return m.push(t)}))){v=!1;break}}else if(g!==y&&!s(g,y,r,a,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},function(e,t,r){var n=r(584).Uint8Array;e.exports=n},function(e,t,r){var n=r(768),o=r(701),i=r(608);e.exports=function(e){return n(e,i,o)}},function(e,t,r){var n=r(696),o=r(575);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,r){var n=r(585);e.exports=function(e){return e==e&&!n(e)}},function(e,t){e.exports=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}},function(e,t,r){var n=r(696),o=r(703),i=r(701),a=r(769),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=o(e);return t}:a;e.exports=s},function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[c(e)]},p.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},p.prototype.set=function(e,t){this.map[c(e)]=u(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),y.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];w.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function k(e,r){return new Promise((function(n,i){var a=new b(e,r);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;n(new w(o,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}k.polyfill=!0,e.fetch||(e.fetch=k,e.Headers=p,e.Request=b,e.Response=w),t.Headers=p,t.Request=b,t.Response=w,t.fetch=k,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},function(e,t,r){e.exports=r(1100)},function(e,t,r){var n=r(596),o=r(703),i=r(587),a=Function.prototype,s=Object.prototype,l=a.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==u}},function(e,t,r){(function(t){!function(){"use strict";e.exports=function(e){return(e instanceof t?e:t.from(e.toString(),"binary")).toString("base64")}}()}).call(this,r(67).Buffer)},function(e,t,r){"use strict";(function(e){function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,a=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UnControlled=t.Controlled=void 0;var s,l=r(0),c="undefined"==typeof navigator||!0===e.PREVENT_CODEMIRROR_RENDER;c||(s=r(589));var u=function(){function e(){}return e.equals=function(e,t){var r=this,n=Object.keys,i=o(e),a=o(t);return e&&t&&"object"===i&&i===a?n(e).length===n(t).length&&n(e).every((function(n){return r.equals(e[n],t[n])})):e===t},e}(),f=function(){function e(e,t){this.editor=e,this.props=t}return e.prototype.delegateCursor=function(e,t,r){var n=this.editor.getDoc();r&&this.editor.focus(),t?n.setCursor(e):n.setCursor(e,null,{scroll:!1})},e.prototype.delegateScroll=function(e){this.editor.scrollTo(e.x,e.y)},e.prototype.delegateSelection=function(e,t){this.editor.getDoc().setSelections(e),t&&this.editor.focus()},e.prototype.apply=function(e){e&&e.selection&&e.selection.ranges&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),e&&e.cursor&&this.delegateCursor(e.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1),e&&e.scroll&&this.delegateScroll(e.scroll)},e.prototype.applyNext=function(e,t,r){e&&e.selection&&e.selection.ranges&&t&&t.selection&&t.selection.ranges&&!u.equals(e.selection.ranges,t.selection.ranges)&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),e&&e.cursor&&t&&t.cursor&&!u.equals(e.cursor,t.cursor)&&this.delegateCursor(r.cursor||t.cursor,t.autoScroll||!1,t.autoCursor||!1),e&&e.scroll&&t&&t.scroll&&!u.equals(e.scroll,t.scroll)&&this.delegateScroll(t.scroll)},e.prototype.applyUserDefined=function(e,t){t&&t.cursor&&this.delegateCursor(t.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1)},e.prototype.wire=function(e){var t=this;Object.keys(e||{}).filter((function(e){return/^on/.test(e)})).forEach((function(e){switch(e){case"onBlur":t.editor.on("blur",(function(e,r){t.props.onBlur(t.editor,r)}));break;case"onContextMenu":t.editor.on("contextmenu",(function(e,r){t.props.onContextMenu(t.editor,r)}));break;case"onCopy":t.editor.on("copy",(function(e,r){t.props.onCopy(t.editor,r)}));break;case"onCursor":t.editor.on("cursorActivity",(function(e){t.props.onCursor(t.editor,t.editor.getDoc().getCursor())}));break;case"onCursorActivity":t.editor.on("cursorActivity",(function(e){t.props.onCursorActivity(t.editor)}));break;case"onCut":t.editor.on("cut",(function(e,r){t.props.onCut(t.editor,r)}));break;case"onDblClick":t.editor.on("dblclick",(function(e,r){t.props.onDblClick(t.editor,r)}));break;case"onDragEnter":t.editor.on("dragenter",(function(e,r){t.props.onDragEnter(t.editor,r)}));break;case"onDragLeave":t.editor.on("dragleave",(function(e,r){t.props.onDragLeave(t.editor,r)}));break;case"onDragOver":t.editor.on("dragover",(function(e,r){t.props.onDragOver(t.editor,r)}));break;case"onDragStart":t.editor.on("dragstart",(function(e,r){t.props.onDragStart(t.editor,r)}));break;case"onDrop":t.editor.on("drop",(function(e,r){t.props.onDrop(t.editor,r)}));break;case"onFocus":t.editor.on("focus",(function(e,r){t.props.onFocus(t.editor,r)}));break;case"onGutterClick":t.editor.on("gutterClick",(function(e,r,n,o){t.props.onGutterClick(t.editor,r,n,o)}));break;case"onInputRead":t.editor.on("inputRead",(function(e,r){t.props.onInputRead(t.editor,r)}));break;case"onKeyDown":t.editor.on("keydown",(function(e,r){t.props.onKeyDown(t.editor,r)}));break;case"onKeyHandled":t.editor.on("keyHandled",(function(e,r,n){t.props.onKeyHandled(t.editor,r,n)}));break;case"onKeyPress":t.editor.on("keypress",(function(e,r){t.props.onKeyPress(t.editor,r)}));break;case"onKeyUp":t.editor.on("keyup",(function(e,r){t.props.onKeyUp(t.editor,r)}));break;case"onMouseDown":t.editor.on("mousedown",(function(e,r){t.props.onMouseDown(t.editor,r)}));break;case"onPaste":t.editor.on("paste",(function(e,r){t.props.onPaste(t.editor,r)}));break;case"onRenderLine":t.editor.on("renderLine",(function(e,r,n){t.props.onRenderLine(t.editor,r,n)}));break;case"onScroll":t.editor.on("scroll",(function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())}));break;case"onSelection":t.editor.on("beforeSelectionChange",(function(e,r){t.props.onSelection(t.editor,r)}));break;case"onTouchStart":t.editor.on("touchstart",(function(e,r){t.props.onTouchStart(t.editor,r)}));break;case"onUpdate":t.editor.on("update",(function(e){t.props.onUpdate(t.editor)}));break;case"onViewportChange":t.editor.on("viewportChange",(function(e,r,n){t.props.onViewportChange(t.editor,r,n)}))}}))},e}(),p=function(e){function t(t){var r=e.call(this,t)||this;return c||(r.applied=!1,r.appliedNext=!1,r.appliedUserDefined=!1,r.deferred=null,r.emulating=!1,r.hydrated=!1,r.initCb=function(){r.props.editorDidConfigure&&r.props.editorDidConfigure(r.editor)},r.mounted=!1),r}return a(t,e),t.prototype.hydrate=function(e){var t=this,r=e&&e.options?e.options:{},o=n({},s.defaults,this.editor.options,r);Object.keys(o).some((function(e){return t.editor.getOption(e)!==o[e]}))&&Object.keys(o).forEach((function(e){r.hasOwnProperty(e)&&t.editor.getOption(e)!==o[e]&&(t.editor.setOption(e,o[e]),t.mirror.setOption(e,o[e]))})),this.hydrated||(this.deferred?this.resolveChange(e.value):this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.getDoc(),r=t.lastLine(),n=t.getLine(t.lastLine()).length;t.replaceRange(e||"",{line:0,ch:0},{line:r,ch:n}),this.mirror.setValue(e),t.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(e){this.emulating=!0;var t=this.editor.getDoc();if("undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),e&&e!==t.getValue()){var r=t.getCursor();t.setValue(e),t.setCursor(r)}this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){var t=this.editor.getDoc();return"undo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentDidMount=function(){var e=this;c||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.mirror=s((function(){}),this.props.options),this.editor.on("electricInput",(function(){e.mirror.setHistory(e.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(function(){e.mirror.setCursor(e.editor.getDoc().getCursor())})),this.editor.on("beforeChange",(function(t,r){if(!e.emulating){r.cancel(),e.deferred=r;var n=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,n)}})),this.editor.on("change",(function(t,r){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,r,e.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(!c){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(e,this.props,t),this.appliedNext=!0),this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0}},t.prototype.componentWillUnmount=function(){c||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){return!c},t.prototype.render=function(){var e=this;if(c)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.Controlled=p;var d=function(e){function t(t){var r=e.call(this,t)||this;return c||(r.applied=!1,r.appliedUserDefined=!1,r.continueChange=!1,r.detached=!1,r.hydrated=!1,r.initCb=function(){r.props.editorDidConfigure&&r.props.editorDidConfigure(r.editor)},r.mounted=!1,r.onBeforeChangeCb=function(){r.continueChange=!0}),r}return a(t,e),t.prototype.hydrate=function(e){var t=this,r=e&&e.options?e.options:{},o=n({},s.defaults,this.editor.options,r);if(Object.keys(o).some((function(e){return t.editor.getOption(e)!==o[e]}))&&Object.keys(o).forEach((function(e){r.hasOwnProperty(e)&&t.editor.getOption(e)!==o[e]&&t.editor.setOption(e,o[e])})),!this.hydrated){var i=this.editor.getDoc(),a=i.lastLine(),l=i.getLine(i.lastLine()).length;i.replaceRange(e.value||"",{line:0,ch:0},{line:a,ch:l})}this.hydrated=!0},t.prototype.componentDidMount=function(){var e=this;c||(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.editor.on("beforeChange",(function(t,r){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,r,e.editor.getValue(),e.onBeforeChangeCb)})),this.editor.on("change",(function(t,r){e.mounted&&e.props.onChange&&(e.props.onBeforeChange?e.continueChange&&e.props.onChange(e.editor,r,e.editor.getValue()):e.props.onChange(e.editor,r,e.editor.getValue()))})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(this.detached&&!1===this.props.detach&&(this.detached=!1,e.editorDidAttach&&e.editorDidAttach(this.editor)),this.detached||!0!==this.props.detach||(this.detached=!0,e.editorDidDetach&&e.editorDidDetach(this.editor)),!c&&!this.detached){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),e.autoCursor||void 0===e.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(e),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0)}},t.prototype.componentWillUnmount=function(){c||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){var r=!0;return c&&(r=!1),this.detached&&e.detach&&(r=!1),r},t.prototype.render=function(){var e=this;if(c)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.UnControlled=d}).call(this,r(25))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return d}));var n,o,i,a=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});if("object"==typeof e)i="win32"===e.platform;else if("object"==typeof navigator){var s=navigator.userAgent;i=s.indexOf("Windows")>=0}var l=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//;var f="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,d=function(){function e(e,t,r,n,o,i){void 0===i&&(i=!1),"object"==typeof e?(this.scheme=e.scheme||"",this.authority=e.authority||"",this.path=e.path||"",this.query=e.query||"",this.fragment=e.fragment||""):(this.scheme=function(e,t){return e||t?e:"file"}(e,i),this.authority=t||"",this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==f&&(t=f+t):t=f}return t}(this.scheme,r||""),this.query=n||"",this.fragment=o||"",function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!l.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return e.isUri=function(t){return t instanceof e||!!t&&("string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return b(this,!1)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,r=e.authority,n=e.path,o=e.query,i=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=""),void 0===r?r=this.authority:null===r&&(r=""),void 0===n?n=this.path:null===n&&(n=""),void 0===o?o=this.query:null===o&&(o=""),void 0===i?i=this.fragment:null===i&&(i=""),t===this.scheme&&r===this.authority&&n===this.path&&o===this.query&&i===this.fragment?this:new v(t,r,n,o,i)},e.parse=function(e,t){void 0===t&&(t=!1);var r=p.exec(e);return r?new v(r[2]||"",C(r[4]||""),C(r[5]||""),C(r[7]||""),C(r[9]||""),t):new v("","","","","")},e.file=function(e){var t="";if(i&&(e=e.replace(/\\/g,f)),e[0]===f&&e[1]===f){var r=e.indexOf(f,2);-1===r?(t=e.substring(2),e=f):(t=e.substring(2,r),e=e.substring(r)||f)}return new v("file",t,e,"","")},e.from=function(e){return new v(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),x(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var r=new v(t);return r._formatted=t.external,r._fsPath=t._sep===h?t.fsPath:null,r}return t},e}(),h=i?1:void 0,v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?x(this,!0):(this._formatted||(this._formatted=x(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=h),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(d),m=((o={})[58]="%3A",o[47]="%2F",o[63]="%3F",o[35]="%23",o[91]="%5B",o[93]="%5D",o[64]="%40",o[33]="%21",o[36]="%24",o[38]="%26",o[39]="%27",o[40]="%28",o[41]="%29",o[42]="%2A",o[43]="%2B",o[44]="%2C",o[59]="%3B",o[61]="%3D",o[32]="%20",o);function g(e,t){for(var r=void 0,n=-1,o=0;o<e.length;o++){var i=e.charCodeAt(o);if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||t&&47===i)-1!==n&&(r+=encodeURIComponent(e.substring(n,o)),n=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));var a=m[i];void 0!==a?(-1!==n&&(r+=encodeURIComponent(e.substring(n,o)),n=-1),r+=a):-1===n&&(n=o)}}return-1!==n&&(r+=encodeURIComponent(e.substring(n))),void 0!==r?r:e}function y(e){for(var t=void 0,r=0;r<e.length;r++){var n=e.charCodeAt(r);35===n||63===n?(void 0===t&&(t=e.substr(0,r)),t+=m[n]):void 0!==t&&(t+=e[r])}return void 0!==t?t:e}function b(e,t){var r;return r=e.authority&&e.path.length>1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,i&&(r=r.replace(/\//g,"\\")),r}function x(e,t){var r=t?y:g,n="",o=e.scheme,i=e.authority,a=e.path,s=e.query,l=e.fragment;if(o&&(n+=o,n+=":"),(i||"file"===o)&&(n+=f,n+=f),i){var c=i.indexOf("@");if(-1!==c){var u=i.substr(0,c);i=i.substr(c+1),-1===(c=u.indexOf(":"))?n+=r(u,!1):(n+=r(u.substr(0,c),!1),n+=":",n+=r(u.substr(c+1),!1)),n+="@"}-1===(c=(i=i.toLowerCase()).indexOf(":"))?n+=r(i,!1):(n+=r(i.substr(0,c),!1),n+=i.substr(c))}if(a){if(a.length>=3&&47===a.charCodeAt(0)&&58===a.charCodeAt(2))(p=a.charCodeAt(1))>=65&&p<=90&&(a="/"+String.fromCharCode(p+32)+":"+a.substr(3));else if(a.length>=2&&58===a.charCodeAt(1)){var p;(p=a.charCodeAt(0))>=65&&p<=90&&(a=String.fromCharCode(p+32)+":"+a.substr(2))}n+=r(a,!0)}return s&&(n+="?",n+=r(s,!1)),l&&(n+="#",n+=t?l:g(l,!1)),n}var w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(e){return e.match(w)?e.replace(w,(function(e){return function e(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}}(e)})):e}}).call(this,r(24))},function(e,t,r){!function(e){"use strict";e.defineMode("javascript",(function(t,r){var n,o,i=t.indentUnit,a=r.statementIndent,s=r.jsonld,l=r.json||s,c=!1!==r.trackScope,u=r.typescript,f=r.wordCharacters||/[\w$\xa1-\uffff]/,p=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),o=e("keyword d"),i=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:o,break:o,continue:o,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),d=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function v(e,t,r){return n=e,o=r,t}function m(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,o=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=m,v("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||o);)o=!o&&"\\"==n;return o||(t.tokenize=m),v("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&e.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&e.eat(">"))return v("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return e.eat("*")?(t.tokenize=g,g(e,t)):e.eat("/")?(e.skipToEnd(),v("comment","comment")):Qe(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(e.eat("="),v("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),v("meta","meta");if("#"==n&&e.eatWhile(f))return v("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),v("comment","comment");if(d.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?v("."):v("operator","operator",e.current());if(f.test(n)){e.eatWhile(f);var o=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(o)){var i=p[o];return v(i.type,i.style,o)}if("async"==o&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",o)}return v("variable","variable",o)}}function g(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=m;break}n="*"==r}return v("comment","comment")}function y(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=m;break}n=!n&&"\\"==r}return v("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var o=0,i=!1,a=r-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!o){++a;break}if(0==--o){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(f.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(i&&!o){++a;break}}i&&!o&&(t.fatArrowAt=a)}}var x={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,r,n,o,i){this.indented=e,this.column=t,this.type=r,this.prev=o,this.info=i,null!=n&&(this.align=n)}function C(e,t){if(!c)return!1;for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}function k(e,t,r,n,o){var i=e.cc;for(A.state=e,A.stream=o,A.marked=null,A.cc=i,A.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((i.length?i.pop():l?U:V)(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return A.marked?A.marked:"variable"==r&&C(e,n)?"variable-2":t}}var A={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)A.cc.push(arguments[e])}function S(){return O.apply(null,arguments),!0}function E(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function j(e){var t=A.state;if(A.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,r){if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new M(n,r.vars,!0):null}return E(t,r.vars)?r:new M(r.prev,new P(t,r.vars),!1)}return null}(e,t.context);if(null!=n)return void(t.context=n)}else if(!E(e,t.localVars))return void(t.localVars=new P(e,t.localVars));r.globalVars&&!E(e,t.globalVars)&&(t.globalVars=new P(e,t.globalVars))}}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function M(e,t,r){this.prev=e,this.vars=t,this.block=r}function P(e,t){this.name=e,this.next=t}var L=new P("this",new P("arguments",null));function I(){A.state.context=new M(A.state.context,A.state.localVars,!1),A.state.localVars=L}function F(){A.state.context=new M(A.state.context,A.state.localVars,!0),A.state.localVars=null}function _(){A.state.localVars=A.state.context.vars,A.state.context=A.state.context.prev}function N(e,t){var r=function(){var r=A.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var o=r.lexical;o&&")"==o.type&&o.align;o=o.prev)n=o.indented;r.lexical=new w(n,A.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function R(){var e=A.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function D(e){return function t(r){return r==e?S():";"==e||"}"==r||")"==r||"]"==r?O():S(t)}}function V(e,t){return"var"==e?S(N("vardef",t),ke,D(";"),R):"keyword a"==e?S(N("form"),W,V,R):"keyword b"==e?S(N("form"),V,R):"keyword d"==e?A.stream.match(/^\s*$/,!1)?S():S(N("stat"),q,D(";"),R):"debugger"==e?S(D(";")):"{"==e?S(N("}"),F,se,R,_):";"==e?S():"if"==e?("else"==A.state.lexical.info&&A.state.cc[A.state.cc.length-1]==R&&A.state.cc.pop()(),S(N("form"),W,V,R,Te)):"function"==e?S(Ie):"for"==e?S(N("form"),F,Me,V,_,R):"class"==e||u&&"interface"==t?(A.marked="keyword",S(N("form","class"==e?e:t),De,R)):"variable"==e?u&&"declare"==t?(A.marked="keyword",S(V)):u&&("module"==t||"enum"==t||"type"==t)&&A.stream.match(/^\s*\w/,!1)?(A.marked="keyword","enum"==t?S(Ye):"type"==t?S(_e,D("operator"),pe,D(";")):S(N("form"),Ae,D("{"),N("}"),se,R,R)):u&&"namespace"==t?(A.marked="keyword",S(N("form"),U,V,R)):u&&"abstract"==t?(A.marked="keyword",S(V)):S(N("stat"),ee):"switch"==e?S(N("form"),W,D("{"),N("}","switch"),F,se,R,R,_):"case"==e?S(U,D(":")):"default"==e?S(D(":")):"catch"==e?S(N("form"),I,B,V,R,_):"export"==e?S(N("stat"),ze,R):"import"==e?S(N("stat"),He,R):"async"==e?S(V):"@"==t?S(U,V):O(N("stat"),U,D(";"),R)}function B(e){if("("==e)return S(Ne,D(")"))}function U(e,t){return H(e,t,!1)}function z(e,t){return H(e,t,!0)}function W(e){return"("!=e?O():S(N(")"),q,D(")"),R)}function H(e,t,r){if(A.state.fatArrowAt==A.stream.start){var n=r?X:Y;if("("==e)return S(I,N(")"),ie(Ne,")"),R,D("=>"),n,_);if("variable"==e)return O(I,Ae,D("=>"),n,_)}var o=r?$:G;return x.hasOwnProperty(e)?S(o):"function"==e?S(Ie,o):"class"==e||u&&"interface"==t?(A.marked="keyword",S(N("form"),Re,R)):"keyword c"==e||"async"==e?S(r?z:U):"("==e?S(N(")"),q,D(")"),R,o):"operator"==e||"spread"==e?S(r?z:U):"["==e?S(N("]"),Je,R,o):"{"==e?ae(re,"}",null,o):"quasi"==e?O(K,o):"new"==e?S(function(e){return function(t){return"."==t?S(e?Z:Q):"variable"==t&&u?S(xe,e?$:G):O(e?z:U)}}(r)):S()}function q(e){return e.match(/[;\}\)\],]/)?O():O(U)}function G(e,t){return","==e?S(q):$(e,t,!1)}function $(e,t,r){var n=0==r?G:$,o=0==r?U:z;return"=>"==e?S(I,r?X:Y,_):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?S(n):u&&"<"==t&&A.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?S(N(">"),ie(pe,">"),R,n):"?"==t?S(U,D(":"),o):S(o):"quasi"==e?O(K,n):";"!=e?"("==e?ae(z,")","call",n):"."==e?S(te,n):"["==e?S(N("]"),q,D("]"),R,n):u&&"as"==t?(A.marked="keyword",S(pe,n)):"regexp"==e?(A.state.lastType=A.marked="operator",A.stream.backUp(A.stream.pos-A.stream.start-1),S(o)):void 0:void 0}function K(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?S(K):S(U,J)}function J(e){if("}"==e)return A.marked="string-2",A.state.tokenize=y,S(K)}function Y(e){return b(A.stream,A.state),O("{"==e?V:U)}function X(e){return b(A.stream,A.state),O("{"==e?V:z)}function Q(e,t){if("target"==t)return A.marked="keyword",S(G)}function Z(e,t){if("target"==t)return A.marked="keyword",S($)}function ee(e){return":"==e?S(R,V):O(G,D(";"),R)}function te(e){if("variable"==e)return A.marked="property",S()}function re(e,t){return"async"==e?(A.marked="property",S(re)):"variable"==e||"keyword"==A.style?(A.marked="property","get"==t||"set"==t?S(ne):(u&&A.state.fatArrowAt==A.stream.start&&(r=A.stream.match(/^\s*:\s*/,!1))&&(A.state.fatArrowAt=A.stream.pos+r[0].length),S(oe))):"number"==e||"string"==e?(A.marked=s?"property":A.style+" property",S(oe)):"jsonld-keyword"==e?S(oe):u&&T(t)?(A.marked="keyword",S(re)):"["==e?S(U,le,D("]"),oe):"spread"==e?S(z,oe):"*"==t?(A.marked="keyword",S(re)):":"==e?O(oe):void 0;var r}function ne(e){return"variable"!=e?O(oe):(A.marked="property",S(Ie))}function oe(e){return":"==e?S(z):"("==e?O(Ie):void 0}function ie(e,t,r){function n(o,i){if(r?r.indexOf(o)>-1:","==o){var a=A.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),S((function(r,n){return r==t||n==t?O():O(e)}),n)}return o==t||i==t?S():r&&r.indexOf(";")>-1?O(e):S(D(t))}return function(r,o){return r==t||o==t?S():O(e,n)}}function ae(e,t,r){for(var n=3;n<arguments.length;n++)A.cc.push(arguments[n]);return S(N(t,r),ie(e,t),R)}function se(e){return"}"==e?S():O(V,se)}function le(e,t){if(u){if(":"==e)return S(pe);if("?"==t)return S(le)}}function ce(e,t){if(u&&(":"==e||"in"==t))return S(pe)}function ue(e){if(u&&":"==e)return A.stream.match(/^\s*\w+\s+is\b/,!1)?S(U,fe,pe):S(pe)}function fe(e,t){if("is"==t)return A.marked="keyword",S()}function pe(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(A.marked="keyword",S("typeof"==t?z:pe)):"variable"==e||"void"==t?(A.marked="type",S(be)):"|"==t||"&"==t?S(pe):"string"==e||"number"==e||"atom"==e?S(be):"["==e?S(N("]"),ie(pe,"]",","),R,be):"{"==e?S(N("}"),he,R,be):"("==e?S(ie(ye,")"),de,be):"<"==e?S(ie(pe,">"),pe):"quasi"==e?O(me,be):void 0}function de(e){if("=>"==e)return S(pe)}function he(e){return e.match(/[\}\)\]]/)?S():","==e||";"==e?S(he):O(ve,he)}function ve(e,t){return"variable"==e||"keyword"==A.style?(A.marked="property",S(ve)):"?"==t||"number"==e||"string"==e?S(ve):":"==e?S(pe):"["==e?S(D("variable"),ce,D("]"),ve):"("==e?O(Fe,ve):e.match(/[;\}\)\],]/)?void 0:S()}function me(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?S(me):S(pe,ge)}function ge(e){if("}"==e)return A.marked="string-2",A.state.tokenize=y,S(me)}function ye(e,t){return"variable"==e&&A.stream.match(/^\s*[?:]/,!1)||"?"==t?S(ye):":"==e?S(pe):"spread"==e?S(ye):O(pe)}function be(e,t){return"<"==t?S(N(">"),ie(pe,">"),R,be):"|"==t||"."==e||"&"==t?S(pe):"["==e?S(pe,D("]"),be):"extends"==t||"implements"==t?(A.marked="keyword",S(pe)):"?"==t?S(pe,D(":"),pe):void 0}function xe(e,t){if("<"==t)return S(N(">"),ie(pe,">"),R,be)}function we(){return O(pe,Ce)}function Ce(e,t){if("="==t)return S(pe)}function ke(e,t){return"enum"==t?(A.marked="keyword",S(Ye)):O(Ae,le,Ee,je)}function Ae(e,t){return u&&T(t)?(A.marked="keyword",S(Ae)):"variable"==e?(j(t),S()):"spread"==e?S(Ae):"["==e?ae(Se,"]"):"{"==e?ae(Oe,"}"):void 0}function Oe(e,t){return"variable"!=e||A.stream.match(/^\s*:/,!1)?("variable"==e&&(A.marked="property"),"spread"==e?S(Ae):"}"==e?O():"["==e?S(U,D("]"),D(":"),Oe):S(D(":"),Ae,Ee)):(j(t),S(Ee))}function Se(){return O(Ae,Ee)}function Ee(e,t){if("="==t)return S(z)}function je(e){if(","==e)return S(ke)}function Te(e,t){if("keyword b"==e&&"else"==t)return S(N("form","else"),V,R)}function Me(e,t){return"await"==t?S(Me):"("==e?S(N(")"),Pe,R):void 0}function Pe(e){return"var"==e?S(ke,Le):"variable"==e?S(Le):O(Le)}function Le(e,t){return")"==e?S():";"==e?S(Le):"in"==t||"of"==t?(A.marked="keyword",S(U,Le)):O(U,Le)}function Ie(e,t){return"*"==t?(A.marked="keyword",S(Ie)):"variable"==e?(j(t),S(Ie)):"("==e?S(I,N(")"),ie(Ne,")"),R,ue,V,_):u&&"<"==t?S(N(">"),ie(we,">"),R,Ie):void 0}function Fe(e,t){return"*"==t?(A.marked="keyword",S(Fe)):"variable"==e?(j(t),S(Fe)):"("==e?S(I,N(")"),ie(Ne,")"),R,ue,_):u&&"<"==t?S(N(">"),ie(we,">"),R,Fe):void 0}function _e(e,t){return"keyword"==e||"variable"==e?(A.marked="type",S(_e)):"<"==t?S(N(">"),ie(we,">"),R):void 0}function Ne(e,t){return"@"==t&&S(U,Ne),"spread"==e?S(Ne):u&&T(t)?(A.marked="keyword",S(Ne)):u&&"this"==e?S(le,Ee):O(Ae,le,Ee)}function Re(e,t){return"variable"==e?De(e,t):Ve(e,t)}function De(e,t){if("variable"==e)return j(t),S(Ve)}function Ve(e,t){return"<"==t?S(N(">"),ie(we,">"),R,Ve):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(A.marked="keyword"),S(u?pe:U,Ve)):"{"==e?S(N("}"),Be,R):void 0}function Be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&T(t))&&A.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(A.marked="keyword",S(Be)):"variable"==e||"keyword"==A.style?(A.marked="property",S(Ue,Be)):"number"==e||"string"==e?S(Ue,Be):"["==e?S(U,le,D("]"),Ue,Be):"*"==t?(A.marked="keyword",S(Be)):u&&"("==e?O(Fe,Be):";"==e||","==e?S(Be):"}"==e?S():"@"==t?S(U,Be):void 0}function Ue(e,t){if("!"==t)return S(Ue);if("?"==t)return S(Ue);if(":"==e)return S(pe,Ee);if("="==t)return S(z);var r=A.state.lexical.prev;return O(r&&"interface"==r.info?Fe:Ie)}function ze(e,t){return"*"==t?(A.marked="keyword",S(Ke,D(";"))):"default"==t?(A.marked="keyword",S(U,D(";"))):"{"==e?S(ie(We,"}"),Ke,D(";")):O(V)}function We(e,t){return"as"==t?(A.marked="keyword",S(D("variable"))):"variable"==e?O(z,We):void 0}function He(e){return"string"==e?S():"("==e?O(U):"."==e?O(G):O(qe,Ge,Ke)}function qe(e,t){return"{"==e?ae(qe,"}"):("variable"==e&&j(t),"*"==t&&(A.marked="keyword"),S($e))}function Ge(e){if(","==e)return S(qe,Ge)}function $e(e,t){if("as"==t)return A.marked="keyword",S(qe)}function Ke(e,t){if("from"==t)return A.marked="keyword",S(U)}function Je(e){return"]"==e?S():O(ie(z,"]"))}function Ye(){return O(N("form"),Ae,D("{"),N("}"),ie(Xe,"}"),R,R)}function Xe(){return O(Ae,Ee)}function Qe(e,t,r){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return _.lex=!0,R.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new w((e||0)-i,0,"block",!1),localVars:r.localVars,context:r.localVars&&new M(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=o&&"--"!=o?n:"incdec",k(t,r,n,o,e))},indent:function(t,n){if(t.tokenize==g||t.tokenize==y)return e.Pass;if(t.tokenize!=m)return 0;var o,s=n&&n.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==R)l=l.prev;else if(u!=Te&&u!=_)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==G||o==$)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,p=s==f;return"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==f&&"{"==s?l.indented:"form"==f?l.indented+i:"stat"==f?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?a||i:0):"switch"!=l.info||p||0==r.doubleIndentSwitch?l.align?l.column+(p?0:1):l.indented+(p?0:i):l.indented+(/^(?:case|default)\b/.test(n)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Qe,skipExpression:function(t){k(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(r(589))},function(e,t,r){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function o(e){return e&&e.bracketRegex||/[(){}[\]]/}function i(e,t,i){var s=e.getLineHandle(t.line),l=t.ch-1,c=i&&i.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=o(i),f=!c&&l>=0&&u.test(s.text.charAt(l))&&n[s.text.charAt(l)]||u.test(s.text.charAt(l+1))&&n[s.text.charAt(++l)];if(!f)return null;var p=">"==f.charAt(1)?1:-1;if(i&&i.strict&&p>0!=(l==t.ch))return null;var d=e.getTokenTypeAt(r(t.line,l+1)),h=a(e,r(t.line,l+(p>0?1:0)),p,d,i);return null==h?null:{from:r(t.line,l),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:p>0}}function a(e,t,i,a,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],f=o(s),p=i>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),d=t.line;d!=p;d+=i){var h=e.getLine(d);if(h){var v=i>0?0:h.length-1,m=i>0?h.length:-1;if(!(h.length>l))for(d==t.line&&(v=t.ch-(i<0?1:0));v!=m;v+=i){var g=h.charAt(v);if(f.test(g)&&(void 0===a||(e.getTokenTypeAt(r(d,v+1))||"")==(a||""))){var y=n[g];if(y&&">"==y.charAt(1)==i>0)u.push(g);else{if(!u.length)return{pos:r(d,v),ch:g};u.pop()}}}}}return d-i!=(i>0?e.lastLine():e.firstLine())&&null}function s(e,n,o){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=o&&o.highlightNonMatching,l=[],c=e.listSelections(),u=0;u<c.length;u++){var f=c[u].empty()&&i(e,c[u].head,o);if(f&&(f.match||!1!==s)&&e.getLine(f.from.line).length<=a){var p=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(f.from,r(f.from.line,f.from.ch+1),{className:p})),f.to&&e.getLine(f.to.line).length<=a&&l.push(e.markText(f.to,r(f.to.line,f.to.ch+1),{className:p}))}}if(l.length){t&&e.state.focused&&e.focus();var d=function(){e.operation((function(){for(var e=0;e<l.length;e++)l[e].clear()}))};if(!n)return d;setTimeout(d,800)}}function l(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=s(e,!1,e.state.matchBrackets)}))}function c(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}e.defineOption("matchBrackets",!1,(function(t,r,n){n&&n!=e.Init&&(t.off("cursorActivity",l),t.off("focus",l),t.off("blur",c),c(t)),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",l),t.on("focus",l),t.on("blur",c))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,r){return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),i(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,r,n){return a(this,e,t,r,n)}))}(r(589))},function(e,t,r){!function(e){"use strict";var t="CodeMirror-lint-markers";function r(e){e.parentNode&&e.parentNode.removeChild(e)}function n(t,n,o,i){var a=function(t,r,n){var o=document.createElement("div");function i(t){if(!o.parentNode)return e.off(document,"mousemove",i);o.style.top=Math.max(0,t.clientY-o.offsetHeight-5)+"px",o.style.left=t.clientX+5+"px"}return o.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,o.appendChild(n.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(o):document.body.appendChild(o),e.on(document,"mousemove",i),i(r),null!=o.style.opacity&&(o.style.opacity=1),o}(t,n,o);function s(){var t;e.off(i,"mouseout",s),a&&((t=a).parentNode&&(null==t.style.opacity&&r(t),t.style.opacity=0,setTimeout((function(){r(t)}),600)),a=null)}var l=setInterval((function(){if(a)for(var e=i;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){s();break}}if(!a)return clearInterval(l)}),400);e.on(i,"mouseout",s)}function o(e,t,r){this.marked=[],this.options=t,this.timeout=null,this.hasGutter=r,this.onMouseOver=function(t){!function(e,t){var r=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(r.className)){for(var o=r.getBoundingClientRect(),i=(o.left+o.right)/2,a=(o.top+o.bottom)/2,l=e.findMarksAt(e.coordsChar({left:i,top:a},"client")),c=[],u=0;u<l.length;++u){var f=l[u].__annotation;f&&c.push(f)}c.length&&function(e,t,r){for(var o=r.target||r.srcElement,i=document.createDocumentFragment(),a=0;a<t.length;a++){var l=t[a];i.appendChild(s(l))}n(e,r,i,o)}(e,c,t)}}(e,t)},this.waitingFor=0}function i(e){var r=e.state.lint;r.hasGutter&&e.clearGutter(t);for(var n=0;n<r.marked.length;++n)r.marked[n].clear();r.marked.length=0}function a(t,r,o,i,a){var s=document.createElement("div"),l=s;return s.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+o,i&&((l=s.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=a&&e.on(l,"mouseover",(function(e){n(t,e,r,l)})),s}function s(e){var t=e.severity;t||(t="error");var r=document.createElement("div");return r.className="CodeMirror-lint-message CodeMirror-lint-message-"+t,void 0!==e.messageHTML?r.innerHTML=e.messageHTML:r.appendChild(document.createTextNode(e.message)),r}function l(t){var r=t.state.lint.options,n=r.options||r,o=r.getAnnotations||t.getHelper(e.Pos(0,0),"lint");if(o)if(r.async||o.async)!function(t,r,n){var o=t.state.lint,i=++o.waitingFor;function a(){i=-1,t.off("change",a)}t.on("change",a),r(t.getValue(),(function(r,n){t.off("change",a),o.waitingFor==i&&(n&&r instanceof e&&(r=n),t.operation((function(){c(t,r)})))}),n,t)}(t,o,n);else{var i=o(t.getValue(),n,t);if(!i)return;i.then?i.then((function(e){t.operation((function(){c(t,e)}))})):t.operation((function(){c(t,i)}))}}function c(e,r){i(e);for(var n,o,l=e.state.lint,c=l.options,u=function(e){for(var t=[],r=0;r<e.length;++r){var n=e[r],o=n.from.line;(t[o]||(t[o]=[])).push(n)}return t}(r),f=0;f<u.length;++f){var p=u[f];if(p){var d=[];p=p.filter((function(e){return!(d.indexOf(e.message)>-1)&&d.push(e.message)}));for(var h=null,v=l.hasGutter&&document.createDocumentFragment(),m=0;m<p.length;++m){var g=p[m],y=g.severity;y||(y="error"),o=y,h="error"==(n=h)?n:o,c.formatAnnotation&&(g=c.formatAnnotation(g)),l.hasGutter&&v.appendChild(s(g)),g.to&&l.marked.push(e.markText(g.from,g.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+y,__annotation:g}))}l.hasGutter&&e.setGutterMarker(f,t,a(e,v,h,u[f].length>1,l.options.tooltips))}}c.onUpdateLinting&&c.onUpdateLinting(r,u,e)}function u(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){l(e)}),t.options.delay||500))}e.defineOption("lint",!1,(function(r,n,a){if(a&&a!=e.Init&&(i(r),!1!==r.state.lint.options.lintOnChange&&r.off("change",u),e.off(r.getWrapperElement(),"mouseover",r.state.lint.onMouseOver),clearTimeout(r.state.lint.timeout),delete r.state.lint),n){for(var s=r.getOption("gutters"),c=!1,f=0;f<s.length;++f)s[f]==t&&(c=!0);var p=r.state.lint=new o(r,(d=n)instanceof Function?{getAnnotations:d}:(d&&!0!==d||(d={}),d),c);!1!==p.options.lintOnChange&&r.on("change",u),0!=p.options.tooltips&&"gutter"!=p.options.tooltips&&e.on(r.getWrapperElement(),"mouseover",p.onMouseOver),l(r)}var d})),e.defineExtension("performLint",(function(){this.state.lint&&l(this)}))}(r(589))},function(e,t,r){!function(e){"use strict";function t(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var r=this;e.on("cursorActivity",this.activityFunc=function(){r.cursorActivity()})}}e.showHint=function(e,t,r){if(!t)return e.showHint(r);r&&r.async&&(t.async=!0);var n={hint:t};if(r)for(var o in r)n[o]=r[o];return e.showHint(n)},e.defineExtension("showHint",(function(r){r=function(e,t,r){var n=e.options.hintOptions,o={};for(var i in l)o[i]=l[i];if(n)for(var i in n)void 0!==n[i]&&(o[i]=n[i]);if(r)for(var i in r)void 0!==r[i]&&(o[i]=r[i]);return o.hint.resolve&&(o.hint=o.hint.resolve(e,t)),o}(this,this.getCursor("start"),r);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!r.hint.supportsSelection)return;for(var o=0;o<n.length;o++)if(n[o].head.line!=n[o].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var i=this.state.completionActive=new t(this,r);i.options.hint&&(e.signal(this,"startCompletion",this),i.update(!0))}})),e.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var r=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},n=window.cancelAnimationFrame||clearTimeout;function o(e){return"string"==typeof e?e:e.text}function i(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function a(t,r){this.completion=t,this.data=r,this.picked=!1;var n=this,a=t.cm,s=a.getInputField().ownerDocument,l=s.defaultView||s.parentWindow,c=this.hints=s.createElement("ul"),u=t.cm.options.theme;c.className="CodeMirror-hints "+u,this.selectedHint=r.selectedHint||0;for(var f=r.list,p=0;p<f.length;++p){var d=c.appendChild(s.createElement("li")),h=f[p],v="CodeMirror-hint"+(p!=this.selectedHint?"":" CodeMirror-hint-active");null!=h.className&&(v=h.className+" "+v),d.className=v,h.render?h.render(d,r,h):d.appendChild(s.createTextNode(h.displayText||o(h))),d.hintId=p}var m=t.options.container||s.body,g=a.cursorCoords(t.options.alignWithWord?r.from:null),y=g.left,b=g.bottom,x=!0,w=0,C=0;if(m!==s.body){var k=-1!==["absolute","relative","fixed"].indexOf(l.getComputedStyle(m).position)?m:m.offsetParent,A=k.getBoundingClientRect(),O=s.body.getBoundingClientRect();w=A.left-O.left-k.scrollLeft,C=A.top-O.top-k.scrollTop}c.style.left=y-w+"px",c.style.top=b-C+"px";var S=l.innerWidth||Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),E=l.innerHeight||Math.max(s.body.offsetHeight,s.documentElement.offsetHeight);m.appendChild(c);var j,T=t.options.moveOnOverlap?c.getBoundingClientRect():new DOMRect,M=!!t.options.paddingForScrollbar&&c.scrollHeight>c.clientHeight+1;if(setTimeout((function(){j=a.getScrollInfo()})),T.bottom-E>0){var P=T.bottom-T.top;if(g.top-(g.bottom-T.top)-P>0)c.style.top=(b=g.top-P-C)+"px",x=!1;else if(P>E){c.style.height=E-5+"px",c.style.top=(b=g.bottom-T.top-C)+"px";var L=a.getCursor();r.from.ch!=L.ch&&(g=a.cursorCoords(L),c.style.left=(y=g.left-w)+"px",T=c.getBoundingClientRect())}}var I,F=T.right-S;if(M&&(F+=a.display.nativeBarWidth),F>0&&(T.right-T.left>S&&(c.style.width=S-5+"px",F-=T.right-T.left-S),c.style.left=(y=g.left-F-w)+"px"),M)for(var _=c.firstChild;_;_=_.nextSibling)_.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=function(e,t){var r={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(r["Ctrl-P"]=function(){t.moveFocus(-1)},r["Ctrl-N"]=function(){t.moveFocus(1)});var n=e.options.customKeys,o=n?{}:r;function i(e,n){var i;i="string"!=typeof n?function(e){return n(e,t)}:r.hasOwnProperty(n)?r[n]:n,o[e]=i}if(n)for(var a in n)n.hasOwnProperty(a)&&i(a,n[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&i(a,s[a]);return o}(t,{moveFocus:function(e,t){n.changeActive(n.selectedHint+e,t)},setFocus:function(e){n.changeActive(e)},menuSize:function(){return n.screenAmount()},length:f.length,close:function(){t.close()},pick:function(){n.pick()},data:r})),t.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){I=setTimeout((function(){t.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(I)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),r=a.getWrapperElement().getBoundingClientRect();j||(j=a.getScrollInfo());var n=b+j.top-e.top,o=n-(l.pageYOffset||(s.documentElement||s.body).scrollTop);if(x||(o+=c.offsetHeight),o<=r.top||o>=r.bottom)return t.close();c.style.top=n+"px",c.style.left=y+j.left-e.left+"px"}),e.on(c,"dblclick",(function(e){var t=i(c,e.target||e.srcElement);t&&null!=t.hintId&&(n.changeActive(t.hintId),n.pick())})),e.on(c,"click",(function(e){var r=i(c,e.target||e.srcElement);r&&null!=r.hintId&&(n.changeActive(r.hintId),t.options.completeOnSingleClick&&n.pick())})),e.on(c,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var N=this.getSelectedHintRange();return 0===N.from&&0===N.to||this.scrollToActive(),e.signal(r,"select",f[this.selectedHint],c.childNodes[this.selectedHint]),!0}function s(e,t,r,n){if(e.async)e(t,n,r);else{var o=e(t,r);o&&o.then?o.then(n):n(o)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,r){var n=t.list[r],i=this;this.cm.operation((function(){n.hint?n.hint(i.cm,t,n):i.cm.replaceRange(o(n),n.from||t.from,n.to||t.to,"complete"),e.signal(t,"pick",n),i.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(n(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),o=this.cm.getLine(t.line);if(t.line!=this.startPos.line||o.length-t.ch!=this.startLen-this.startPos.ch||t.ch<e.ch||this.cm.somethingSelected()||!t.ch||this.options.closeCharacters.test(o.charAt(t.ch-1)))this.close();else{var i=this;this.debounce=r((function(){i.update()})),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,r=++this.tick;s(this.options.hint,this.cm,this.options,(function(n){t.tick==r&&t.finishUpdate(n,e)}))}},finishUpdate:function(t,r){this.data&&e.signal(this.data,"update");var n=this.widget&&this.widget.picked||r&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(n&&1==t.list.length?this.pick(t,0):(this.widget=new a(this,t),e.signal(t,"shown")))}},a.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){if(t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var n=this.hints.childNodes[this.selectedHint];n&&(n.className=n.className.replace(" CodeMirror-hint-active","")),(n=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],n)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],r=this.hints.childNodes[e.to],n=this.hints.firstChild;t.offsetTop<this.hints.scrollTop?this.hints.scrollTop=t.offsetTop-n.offsetTop:r.offsetTop+r.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=r.offsetTop+r.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,r){var n,o=t.getHelpers(r,"hint");if(o.length){var i=function(e,t,r){var n=function(e,t){if(!e.somethingSelected())return t;for(var r=[],n=0;n<t.length;n++)t[n].supportsSelection&&r.push(t[n]);return r}(e,o);!function o(i){if(i==n.length)return t(null);s(n[i],e,r,(function(e){e&&e.list.length>0?t(e):o(i+1)}))}(0)};return i.async=!0,i.supportsSelection=!0,i}return(n=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:n})}:e.hint.anyword?function(t,r){return e.hint.anyword(t,r)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,r){var n,o=t.getCursor(),i=t.getTokenAt(o),a=e.Pos(o.line,i.start),s=o;i.start<o.ch&&/\w/.test(i.string.charAt(o.ch-i.start-1))?n=i.string.substr(0,o.ch-i.start):(n="",a=o);for(var l=[],c=0;c<r.words.length;c++){var u=r.words[c];u.slice(0,n.length)==n&&l.push(u)}if(l.length)return{list:l,from:a,to:s}})),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(r(589))},function(e,t,r){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},r=e.Pos;function n(e,r){return"pairs"==r&&"string"==typeof e?e:"object"==typeof e&&null!=e[r]?e[r]:t[r]}e.defineOption("autoCloseBrackets",!1,(function(t,r,a){a&&a!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),r&&(i(n(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(o))}));var o={Backspace:function(t){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;for(var i=n(o,"pairs"),a=t.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var u=c(t,a[l].head);if(!u||i.indexOf(u)%2!=0)return e.Pass}for(l=a.length-1;l>=0;l--){var f=a[l].head;t.replaceRange("",r(f.line,f.ch-1),r(f.line,f.ch+1),"+delete")}},Enter:function(t){var r=s(t),o=r&&n(r,"explode");if(!o||t.getOption("disableInput"))return e.Pass;for(var i=t.listSelections(),a=0;a<i.length;a++){if(!i[a].empty())return e.Pass;var u=c(t,i[a].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),l(t,-1),i=t.listSelections();for(var r=0;r<i.length;r++){var n=i[r].head.line;t.indentLine(n,null,!0),t.indentLine(n+1,null,!0)}}))}};function i(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n="'"+r+"'";o[n]||(o[n]=a(r))}}function a(t){return function(o){return function(t,o){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;var a=n(i,"pairs"),c=a.indexOf(o);if(-1==c)return e.Pass;for(var f,p=n(i,"closeBefore"),d=n(i,"triples"),h=a.charAt(c+1)==o,v=t.listSelections(),m=c%2==0,g=0;g<v.length;g++){var y,b=v[g],x=b.head,w=t.getRange(x,r(x.line,x.ch+1));if(m&&!b.empty())y="surround";else if(!h&&m||w!=o)if(h&&x.ch>1&&d.indexOf(o)>=0&&t.getRange(r(x.line,x.ch-2),x)==o+o){if(x.ch>2&&/\bstring/.test(t.getTokenTypeAt(r(x.line,x.ch-2))))return e.Pass;y="addFour"}else if(h){var C=0==x.ch?" ":t.getRange(r(x.line,x.ch-1),x);if(e.isWordChar(w)||C==o||e.isWordChar(C))return e.Pass;y="both"}else{if(!m||!(0===w.length||/\s/.test(w)||p.indexOf(w)>-1))return e.Pass;y="both"}else y=h&&u(t,x)?"both":d.indexOf(o)>=0&&t.getRange(x,r(x.line,x.ch+3))==o+o+o?"skipThree":"skip";if(f){if(f!=y)return e.Pass}else f=y}var k=c%2?a.charAt(c-1):o,A=c%2?o:a.charAt(c+1);t.operation((function(){if("skip"==f)l(t,1);else if("skipThree"==f)l(t,3);else if("surround"==f){for(var n=t.getSelections(),o=0;o<n.length;o++)n[o]=k+n[o]+A;for(t.replaceSelections(n,"around"),n=t.listSelections().slice(),o=0;o<n.length;o++)n[o]=(i=n[o],a=void 0,a=e.cmpPos(i.anchor,i.head)>0,{anchor:new r(i.anchor.line,i.anchor.ch+(a?-1:1)),head:new r(i.head.line,i.head.ch+(a?1:-1))});t.setSelections(n)}else"both"==f?(t.replaceSelection(k+A,null),t.triggerElectric(k+A),l(t,-1)):"addFour"==f&&(t.replaceSelection(k+k+k+k,"before"),l(t,1));var i,a}))}(o,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){for(var r=[],n=e.listSelections(),o=0,i=0;i<n.length;i++){var a=n[i];a.head==e.getCursor()&&(o=i);var s=a.head.ch||t>0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};r.push({anchor:s,head:s})}e.setSelections(r,o)}function c(e,t){var n=e.getRange(r(t.line,t.ch-1),r(t.line,t.ch+1));return 2==n.length?n:null}function u(e,t){var n=e.getTokenAt(r(t.line,t.ch+1));return/\bstring/.test(n.type)&&n.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}i(t.pairs+"`")}(r(589))},function(e,t,r){!function(e){"use strict";var t,r,n=e.Pos;function o(e,t){for(var r=function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e),n=r,o=0;o<t.length;o++)-1==n.indexOf(t.charAt(o))&&(n+=t.charAt(o));return r==n?e:new RegExp(e.source,n)}function i(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function a(e,t,r){t=o(t,"g");for(var i=r.line,a=r.ch,s=e.lastLine();i<=s;i++,a=0){t.lastIndex=a;var l=e.getLine(i),c=t.exec(l);if(c)return{from:n(i,c.index),to:n(i,c.index+c[0].length),match:c}}}function s(e,t,r){if(!i(t))return a(e,t,r);t=o(t,"gm");for(var s,l=1,c=r.line,u=e.lastLine();c<=u;){for(var f=0;f<l&&!(c>u);f++){var p=e.getLine(c++);s=null==s?p:s+"\n"+p}l*=2,t.lastIndex=r.ch;var d=t.exec(s);if(d){var h=s.slice(0,d.index).split("\n"),v=d[0].split("\n"),m=r.line+h.length-1,g=h[h.length-1].length;return{from:n(m,g),to:n(m+v.length-1,1==v.length?g+v[0].length:v[v.length-1].length),match:d}}}}function l(e,t,r){for(var n,o=0;o<=e.length;){t.lastIndex=o;var i=t.exec(e);if(!i)break;var a=i.index+i[0].length;if(a>e.length-r)break;(!n||a>n.index+n[0].length)&&(n=i),o=i.index+1}return n}function c(e,t,r){t=o(t,"g");for(var i=r.line,a=r.ch,s=e.firstLine();i>=s;i--,a=-1){var c=e.getLine(i),u=l(c,t,a<0?0:c.length-a);if(u)return{from:n(i,u.index),to:n(i,u.index+u[0].length),match:u}}}function u(e,t,r){if(!i(t))return c(e,t,r);t=o(t,"gm");for(var a,s=1,u=e.getLine(r.line).length-r.ch,f=r.line,p=e.firstLine();f>=p;){for(var d=0;d<s&&f>=p;d++){var h=e.getLine(f--);a=null==a?h:h+"\n"+a}s*=2;var v=l(a,t,u);if(v){var m=a.slice(0,v.index).split("\n"),g=v[0].split("\n"),y=f+m.length,b=m[m.length-1].length;return{from:n(y,b),to:n(y+g.length-1,1==g.length?b+g[0].length:g[g.length-1].length),match:v}}}}function f(e,t,r,n){if(e.length==t.length)return r;for(var o=0,i=r+Math.max(0,e.length-t.length);;){if(o==i)return o;var a=o+i>>1,s=n(e.slice(0,a)).length;if(s==r)return a;s>r?i=a:o=a+1}}function p(e,o,i,a){if(!o.length)return null;var s=a?t:r,l=s(o).split(/\r|\n\r?/);e:for(var c=i.line,u=i.ch,p=e.lastLine()+1-l.length;c<=p;c++,u=0){var d=e.getLine(c).slice(u),h=s(d);if(1==l.length){var v=h.indexOf(l[0]);if(-1==v)continue e;return i=f(d,h,v,s)+u,{from:n(c,f(d,h,v,s)+u),to:n(c,f(d,h,v+l[0].length,s)+u)}}var m=h.length-l[0].length;if(h.slice(m)==l[0]){for(var g=1;g<l.length-1;g++)if(s(e.getLine(c+g))!=l[g])continue e;var y=e.getLine(c+l.length-1),b=s(y),x=l[l.length-1];if(b.slice(0,x.length)==x)return{from:n(c,f(d,h,m,s)+u),to:n(c+l.length-1,f(y,b,x.length,s))}}}}function d(e,o,i,a){if(!o.length)return null;var s=a?t:r,l=s(o).split(/\r|\n\r?/);e:for(var c=i.line,u=i.ch,p=e.firstLine()-1+l.length;c>=p;c--,u=-1){var d=e.getLine(c);u>-1&&(d=d.slice(0,u));var h=s(d);if(1==l.length){var v=h.lastIndexOf(l[0]);if(-1==v)continue e;return{from:n(c,f(d,h,v,s)),to:n(c,f(d,h,v+l[0].length,s))}}var m=l[l.length-1];if(h.slice(0,m.length)==m){var g=1;for(i=c-l.length+1;g<l.length-1;g++)if(s(e.getLine(i+g))!=l[g])continue e;var y=e.getLine(c+1-l.length),b=s(y);if(b.slice(b.length-l[0].length)==l[0])return{from:n(c+1-l.length,f(y,b,y.length-l[0].length,s)),to:n(c,f(d,h,m.length,s))}}}}function h(e,t,r,i){var l;this.atOccurrence=!1,this.doc=e,r=r?e.clipPos(r):n(0,0),this.pos={from:r,to:r},"object"==typeof i?l=i.caseFold:(l=i,i=null),"string"==typeof t?(null==l&&(l=!1),this.matches=function(r,n){return(r?d:p)(e,t,n,l)}):(t=o(t,"gm"),i&&!1===i.multiline?this.matches=function(r,n){return(r?c:a)(e,t,n)}:this.matches=function(r,n){return(r?u:s)(e,t,n)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},r=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},r=function(e){return e}),h.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var r=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));r&&0==e.cmpPos(r.from,r.to);)t?r.from.ch?r.from=n(r.from.line,r.from.ch-1):r=r.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(n(r.from.line-1))):r.to.ch<this.doc.getLine(r.to.line).length?r.to=n(r.to.line,r.to.ch+1):r=r.to.line==this.doc.lastLine()?null:this.matches(t,n(r.to.line+1,0));if(r)return this.pos=r,this.atOccurrence=!0,this.pos.match||!0;var o=n(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var o=e.splitLines(t);this.doc.replaceRange(o,this.pos.from,this.pos.to,r),this.pos.to=n(this.pos.from.line+o.length-1,o[o.length-1].length+(1==o.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,r){return new h(this.doc,e,t,r)})),e.defineDocExtension("getSearchCursor",(function(e,t,r){return new h(this,e,t,r)})),e.defineExtension("selectMatches",(function(t,r){for(var n=[],o=this.getSearchCursor(t,this.getCursor("from"),r);o.findNext()&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)n.push({anchor:o.from(),head:o.to()});n.length&&this.setSelections(n,0)}))}(r(589))},function(e,t,r){var n=r(309),o=r(786);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(310)(!1)).push([e.i,"/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n outline: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n",""]),e.exports=t},function(e,t,r){var n=r(309),o=r(788);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(310)(!1)).push([e.i,"/*\n Name: material\n Author: Mattia Astorino (http://github.com/equinusocio)\n Website: https://material-theme.site/\n*/\n\n.cm-s-material.CodeMirror {\n background-color: #263238;\n color: #EEFFFF;\n}\n\n.cm-s-material .CodeMirror-gutters {\n background: #263238;\n color: #546E7A;\n border: none;\n}\n\n.cm-s-material .CodeMirror-guttermarker,\n.cm-s-material .CodeMirror-guttermarker-subtle,\n.cm-s-material .CodeMirror-linenumber {\n color: #546E7A;\n}\n\n.cm-s-material .CodeMirror-cursor {\n border-left: 1px solid #FFCC00;\n}\n\n.cm-s-material div.CodeMirror-selected {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-line::selection,\n.cm-s-material .CodeMirror-line>span::selection,\n.cm-s-material .CodeMirror-line>span>span::selection {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-line::-moz-selection,\n.cm-s-material .CodeMirror-line>span::-moz-selection,\n.cm-s-material .CodeMirror-line>span>span::-moz-selection {\n background: rgba(128, 203, 196, 0.2);\n}\n\n.cm-s-material .CodeMirror-activeline-background {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.cm-s-material .cm-keyword {\n color: #C792EA;\n}\n\n.cm-s-material .cm-operator {\n color: #89DDFF;\n}\n\n.cm-s-material .cm-variable-2 {\n color: #EEFFFF;\n}\n\n.cm-s-material .cm-variable-3,\n.cm-s-material .cm-type {\n color: #f07178;\n}\n\n.cm-s-material .cm-builtin {\n color: #FFCB6B;\n}\n\n.cm-s-material .cm-atom {\n color: #F78C6C;\n}\n\n.cm-s-material .cm-number {\n color: #FF5370;\n}\n\n.cm-s-material .cm-def {\n color: #82AAFF;\n}\n\n.cm-s-material .cm-string {\n color: #C3E88D;\n}\n\n.cm-s-material .cm-string-2 {\n color: #f07178;\n}\n\n.cm-s-material .cm-comment {\n color: #546E7A;\n}\n\n.cm-s-material .cm-variable {\n color: #f07178;\n}\n\n.cm-s-material .cm-tag {\n color: #FF5370;\n}\n\n.cm-s-material .cm-meta {\n color: #FFCB6B;\n}\n\n.cm-s-material .cm-attribute {\n color: #C792EA;\n}\n\n.cm-s-material .cm-property {\n color: #C792EA;\n}\n\n.cm-s-material .cm-qualifier {\n color: #DECB6B;\n}\n\n.cm-s-material .cm-variable-3,\n.cm-s-material .cm-type {\n color: #DECB6B;\n}\n\n\n.cm-s-material .cm-error {\n color: rgba(255, 255, 255, 1.0);\n background-color: #FF5370;\n}\n\n.cm-s-material .CodeMirror-matchingbracket {\n text-decoration: underline;\n color: white !important;\n}",""]),e.exports=t},function(e,t,r){var n=r(309),o=r(790);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(310)(!1)).push([e.i,'/* The lint marker gutter */\n.CodeMirror-lint-markers {\n width: 16px;\n}\n\n.CodeMirror-lint-tooltip {\n background-color: #ffd;\n border: 1px solid black;\n border-radius: 4px 4px 4px 4px;\n color: black;\n font-family: monospace;\n font-size: 10pt;\n overflow: hidden;\n padding: 2px 5px;\n position: fixed;\n white-space: pre;\n white-space: pre-wrap;\n z-index: 100;\n max-width: 600px;\n opacity: 0;\n transition: opacity .4s;\n -moz-transition: opacity .4s;\n -webkit-transition: opacity .4s;\n -o-transition: opacity .4s;\n -ms-transition: opacity .4s;\n}\n\n.CodeMirror-lint-mark {\n background-position: left bottom;\n background-repeat: repeat-x;\n}\n\n.CodeMirror-lint-mark-warning {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");\n}\n\n.CodeMirror-lint-mark-error {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");\n}\n\n.CodeMirror-lint-marker {\n background-position: center center;\n background-repeat: no-repeat;\n cursor: pointer;\n display: inline-block;\n height: 16px;\n width: 16px;\n vertical-align: middle;\n position: relative;\n}\n\n.CodeMirror-lint-message {\n padding-left: 18px;\n background-position: top left;\n background-repeat: no-repeat;\n}\n\n.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");\n}\n\n.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");\n}\n\n.CodeMirror-lint-marker-multiple {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");\n background-repeat: no-repeat;\n background-position: right bottom;\n width: 100%; height: 100%;\n}\n',""]),e.exports=t},function(e,t,r){var n=r(309),o=r(792);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},function(e,t,r){(t=r(310)(!1)).push([e.i,".CodeMirror-hints {\n position: absolute;\n z-index: 10;\n overflow: hidden;\n list-style: none;\n\n margin: 0;\n padding: 2px;\n\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n border-radius: 3px;\n border: 1px solid silver;\n\n background: white;\n font-size: 90%;\n font-family: monospace;\n\n max-height: 20em;\n overflow-y: auto;\n}\n\n.CodeMirror-hint {\n margin: 0;\n padding: 0 4px;\n border-radius: 2px;\n white-space: pre;\n color: black;\n cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n background: #08f;\n color: white;\n}\n",""]),e.exports=t},function(e,t,r){var n=r(707);e.exports=n},function(e,t,r){var n=r(565),o=r(581),i=r(612);n({target:"Object",stat:!0,forced:r(567)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},function(e,t,r){var n=r(796);e.exports=n},function(e,t,r){r(712);var n=r(566);e.exports=n.Object.getOwnPropertySymbols},function(e,t,r){var n=r(569),o=r(577);e.exports=function(e,t){try{o(n,e,t)}catch(r){n[e]=t}return t}},function(e,t,r){var n=r(580),o=r(663).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(n(e))}},function(e,t,r){"use strict";var n=r(666),o=r(617);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t,r){e.exports=r(801)},function(e,t,r){var n=r(718);e.exports=n},function(e,t,r){r(803);var n=r(578);e.exports=n("Array").filter},function(e,t,r){"use strict";var n=r(565),o=r(594).filter;n({target:"Array",proto:!0,forced:!r(618)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(805);e.exports=n},function(e,t,r){r(806);var n=r(566).Object,o=e.exports=function(e,t){return n.getOwnPropertyDescriptor(e,t)};n.getOwnPropertyDescriptor.sham&&(o.sham=!0)},function(e,t,r){var n=r(565),o=r(567),i=r(580),a=r(600).f,s=r(572),l=o((function(){a(1)}));n({target:"Object",stat:!0,forced:!s||l,sham:!s},{getOwnPropertyDescriptor:function(e,t){return a(i(e),t)}})},function(e,t,r){e.exports=r(808)},function(e,t,r){var n=r(809);e.exports=n},function(e,t,r){r(604);var n=r(813),o=r(617),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.forEach;return e===i||e instanceof Array&&t===i.forEach||a.hasOwnProperty(o(e))?n:t}},function(e,t,r){"use strict";var n=r(722).IteratorPrototype,o=r(615),i=r(601),a=r(603),s=r(605),l=function(){return this};e.exports=function(e,t,r){var c=t+" Iterator";return e.prototype=o(n,{next:i(1,r)}),a(e,c,!1,!0),s[c]=l,e}},function(e,t,r){var n=r(571);e.exports=function(e){if(!n(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,r){var n=r(814);e.exports=n},function(e,t,r){r(815);var n=r(578);e.exports=n("Array").forEach},function(e,t,r){"use strict";var n=r(565),o=r(816);n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},function(e,t,r){"use strict";var n=r(594).forEach,o=r(724)("forEach");e.exports=o?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},function(e,t,r){e.exports=r(818)},function(e,t,r){var n=r(819);e.exports=n},function(e,t,r){r(820);var n=r(566);e.exports=n.Object.getOwnPropertyDescriptors},function(e,t,r){var n=r(565),o=r(572),i=r(821),a=r(580),s=r(600),l=r(620);n({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(e){for(var t,r,n=a(e),o=s.f,c=i(n),u={},f=0;c.length>f;)void 0!==(r=o(n,t=c[f++]))&&l(u,t,r);return u}})},function(e,t,r){var n=r(583),o=r(663),i=r(664),a=r(573);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=i.f;return r?t.concat(r(e)):t}},function(e,t,r){e.exports=r(823)},function(e,t,r){var n=r(824);e.exports=n},function(e,t,r){r(825);var n=r(566).Object,o=e.exports=function(e,t){return n.defineProperties(e,t)};n.defineProperties.sham&&(o.sham=!0)},function(e,t,r){var n=r(565),o=r(572);n({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperties:r(714)})},function(e,t,r){var n=r(827);e.exports=n},function(e,t,r){r(828);var n=r(566).Object,o=e.exports=function(e,t,r){return n.defineProperty(e,t,r)};n.defineProperty.sham&&(o.sham=!0)},function(e,t,r){var n=r(565),o=r(572);n({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:r(582).f})},function(e,t,r){var n=r(637),o=r(832),i=r(585),a=r(729),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,f=c.hasOwnProperty,p=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?p:s).test(a(e))}},function(e,t,r){var n=r(606),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,o=r(833),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},function(e,t,r){var n=r(584)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(836),o=r(841);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,a)}return t}))}},function(e,t,r){var n=r(671),o=r(730),i=r(731);e.exports=function(e,t){return i(o(e,t,n),e+"")}},function(e,t){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},function(e,t,r){var n=r(839),o=r(727),i=r(671),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var r=Date.now;e.exports=function(e){var t=0,n=0;return function(){var o=r(),i=16-(o-n);if(n=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,r){var n=r(638),o=r(607),i=r(639),a=r(585);e.exports=function(e,t,r){if(!a(r))return!1;var s=typeof t;return!!("number"==s?o(r)&&i(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},function(e,t){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},function(e,t,r){var n=r(596),o=r(587);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,r){var n=r(596),o=r(672),i=r(587),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},function(e,t,r){var n=r(734)(Object.keys,Object);e.exports=n},function(e,t){e.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}},function(e,t,r){var n=r(850);e.exports=function(e){return e?(e=n(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,r){var n=r(851),o=r(585),i=r(642),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||l.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},function(e,t,r){var n=r(852),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},function(e,t){var r=/\s/;e.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},function(e,t,r){var n=r(854);r(871),r(872),r(873),r(874),r(875),r(876),r(877),e.exports=n},function(e,t,r){r(739),r(677),r(712),r(855),r(856),r(857),r(858),r(740),r(859),r(860),r(861),r(862),r(863),r(864),r(865),r(866),r(867),r(868),r(869),r(870);var n=r(566);e.exports=n.Symbol},function(e,t,r){r(568)("asyncIterator")},function(e,t){},function(e,t,r){r(568)("hasInstance")},function(e,t,r){r(568)("isConcatSpreadable")},function(e,t,r){r(568)("match")},function(e,t,r){r(568)("matchAll")},function(e,t,r){r(568)("replace")},function(e,t,r){r(568)("search")},function(e,t,r){r(568)("species")},function(e,t,r){r(568)("split")},function(e,t,r){r(568)("toPrimitive")},function(e,t,r){r(568)("toStringTag")},function(e,t,r){r(568)("unscopables")},function(e,t,r){var n=r(569);r(603)(n.JSON,"JSON",!0)},function(e,t){},function(e,t){},function(e,t,r){r(568)("asyncDispose")},function(e,t,r){r(568)("dispose")},function(e,t,r){r(568)("matcher")},function(e,t,r){r(568)("metadata")},function(e,t,r){r(568)("observable")},function(e,t,r){r(568)("patternMatch")},function(e,t,r){r(568)("replaceAll")},function(e,t,r){r(604),r(644);var n=r(679);e.exports=n},function(e,t,r){var n=r(631),o=r(629),i=function(e){return function(t,r){var i,a,s=String(o(t)),l=n(r),c=s.length;return l<0||l>=c?e?"":void 0:(i=s.charCodeAt(l))<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,r){var n=r(881);e.exports=n},function(e,t,r){r(882);var n=r(566);e.exports=n.Array.isArray},function(e,t,r){r(565)({target:"Array",stat:!0},{isArray:r(614)})},function(e,t,r){e.exports=r(884)},function(e,t,r){var n=r(741);e.exports=n},function(e,t,r){r(886);var n=r(578);e.exports=n("Array").slice},function(e,t,r){"use strict";var n=r(565),o=r(571),i=r(614),a=r(657),s=r(592),l=r(580),c=r(620),u=r(570),f=r(618)("slice"),p=u("species"),d=[].slice,h=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,u,f=l(this),v=s(f.length),m=a(e,v),g=a(void 0===t?v:t,v);if(i(f)&&("function"!=typeof(r=f.constructor)||r!==Array&&!i(r.prototype)?o(r)&&null===(r=r[p])&&(r=void 0):r=void 0,r===Array||void 0===r))return d.call(f,m,g);for(n=new(void 0===r?Array:r)(h(g-m,0)),u=0;m<g;m++,u++)m in f&&c(n,u,f[m]);return n.length=u,n}})},function(e,t,r){var n=r(743);e.exports=n},function(e,t,r){var n=r(565),o=r(889);n({target:"Array",stat:!0,forced:!r(746)((function(e){Array.from(e)}))},{from:o})},function(e,t,r){"use strict";var n=r(611),o=r(581),i=r(890),a=r(745),s=r(592),l=r(620),c=r(679);e.exports=function(e){var t,r,u,f,p,d,h=o(e),v="function"==typeof this?this:Array,m=arguments.length,g=m>1?arguments[1]:void 0,y=void 0!==g,b=c(h),x=0;if(y&&(g=n(g,m>2?arguments[2]:void 0,2)),null==b||v==Array&&a(b))for(r=new v(t=s(h.length));t>x;x++)d=y?g(h[x],x):h[x],l(r,x,d);else for(p=(f=b.call(h)).next,r=new v;!(u=p.call(f)).done;x++)d=y?i(f,g,[u.value,x],!0):u.value,l(r,x,d);return r.length=x,r}},function(e,t,r){var n=r(573),o=r(744);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){throw o(e),t}}},function(e,t,r){e.exports=r(892)},function(e,t,r){var n=r(893);e.exports=n},function(e,t,r){r(740),r(644),r(604);var n=r(665);e.exports=n.f("iterator")},function(e,t,r){var n=r(680);e.exports=function(e){if(n(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(643),o=r(678);e.exports=function(e,t){var r=e&&(void 0!==n&&o(e)||e["@@iterator"]);if(null!=r){var i,a,s=[],l=!0,c=!1;try{for(r=r.call(e);!(l=(i=r.next()).done)&&(s.push(i.value),!t||s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{l||null==r.return||r.return()}finally{if(c)throw a}}return s}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=r(898)},function(e,t,r){var n=r(748);r(906),r(907),r(908),r(909),e.exports=n},function(e,t,r){"use strict";var n,o,i,a,s=r(565),l=r(602),c=r(569),u=r(583),f=r(750),p=r(616),d=r(683),h=r(635),v=r(603),m=r(900),g=r(571),y=r(590),b=r(684),x=r(717),w=r(609),C=r(746),k=r(751),A=r(752).set,O=r(901),S=r(754),E=r(903),j=r(624),T=r(645),M=r(593),P=r(709),L=r(570),I=r(904),F=r(685),_=r(632),N=L("species"),R="Promise",D=M.get,V=M.set,B=M.getterFor(R),U=f&&f.prototype,z=f,W=U,H=c.TypeError,q=c.document,G=c.process,$=j.f,K=$,J=!!(q&&q.createEvent&&c.dispatchEvent),Y="function"==typeof PromiseRejectionEvent,X=!1,Q=P(R,(function(){var e=x(z)!==String(z);if(!e&&66===_)return!0;if(l&&!W.finally)return!0;if(_>=51&&/native code/.test(z))return!1;var t=new z((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(t.constructor={})[N]=r,!(X=t.then((function(){}))instanceof r)||!e&&I&&!Y})),Z=Q||!C((function(e){z.all(e).catch((function(){}))})),ee=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},te=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;O((function(){for(var n=e.value,o=1==e.state,i=0;r.length>i;){var a,s,l,c=r[i++],u=o?c.ok:c.fail,f=c.resolve,p=c.reject,d=c.domain;try{u?(o||(2===e.rejection&&ie(e),e.rejection=1),!0===u?a=n:(d&&d.enter(),a=u(n),d&&(d.exit(),l=!0)),a===c.promise?p(H("Promise-chain cycle")):(s=ee(a))?s.call(a,f,p):f(a)):p(n)}catch(e){d&&!l&&d.exit(),p(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&ne(e)}))}},re=function(e,t,r){var n,o;J?((n=q.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!Y&&(o=c["on"+e])?o(n):"unhandledrejection"===e&&E("Unhandled promise rejection",r)},ne=function(e){A.call(c,(function(){var t,r=e.facade,n=e.value;if(oe(e)&&(t=T((function(){F?G.emit("unhandledRejection",n,r):re("unhandledrejection",r,n)})),e.rejection=F||oe(e)?2:1,t.error))throw t.value}))},oe=function(e){return 1!==e.rejection&&!e.parent},ie=function(e){A.call(c,(function(){var t=e.facade;F?G.emit("rejectionHandled",t):re("rejectionhandled",t,e.value)}))},ae=function(e,t,r){return function(n){e(t,n,r)}},se=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,te(e,!0))},le=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw H("Promise can't be resolved itself");var n=ee(t);n?O((function(){var r={done:!1};try{n.call(t,ae(le,r,e),ae(se,r,e))}catch(t){se(r,t,e)}})):(e.value=t,e.state=1,te(e,!1))}catch(t){se({done:!1},t,e)}}};if(Q&&(W=(z=function(e){b(this,z,R),y(e),n.call(this);var t=D(this);try{e(ae(le,t),ae(se,t))}catch(e){se(t,e)}}).prototype,(n=function(e){V(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(W,{then:function(e,t){var r=B(this),n=$(k(this,z));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=F?G.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&te(r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=D(e);this.promise=e,this.resolve=ae(le,t),this.reject=ae(se,t)},j.f=$=function(e){return e===z||e===i?new o(e):K(e)},!l&&"function"==typeof f&&U!==Object.prototype)){a=U.then,X||(p(U,"then",(function(e,t){var r=this;return new z((function(e,t){a.call(r,e,t)})).then(e,t)}),{unsafe:!0}),p(U,"catch",W.catch,{unsafe:!0}));try{delete U.constructor}catch(e){}h&&h(U,W)}s({global:!0,wrap:!0,forced:Q},{Promise:z}),v(z,R,!1,!0),m(R),i=u(R),s({target:R,stat:!0,forced:Q},{reject:function(e){var t=$(this);return t.reject.call(void 0,e),t.promise}}),s({target:R,stat:!0,forced:l||Q},{resolve:function(e){return S(l&&this===i?z:this,e)}}),s({target:R,stat:!0,forced:Z},{all:function(e){var t=this,r=$(t),n=r.resolve,o=r.reject,i=T((function(){var r=y(t.resolve),i=[],a=0,s=1;w(e,(function(e){var l=a++,c=!1;i.push(void 0),s++,r.call(t,e).then((function(e){c||(c=!0,i[l]=e,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise},race:function(e){var t=this,r=$(t),n=r.reject,o=T((function(){var o=y(t.resolve);w(e,(function(e){o.call(t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}})},function(e,t,r){"use strict";var n=r(583),o=r(582),i=r(570),a=r(572),s=i("species");e.exports=function(e){var t=n(e),r=o.f;a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,r){var n,o,i,a,s,l,c,u,f=r(569),p=r(600).f,d=r(752).set,h=r(753),v=r(902),m=r(685),g=f.MutationObserver||f.WebKitMutationObserver,y=f.document,b=f.process,x=f.Promise,w=p(f,"queueMicrotask"),C=w&&w.value;C||(n=function(){var e,t;for(m&&(e=b.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():i=void 0,e}}i=void 0,e&&e.enter()},h||m||v||!g||!y?x&&x.resolve?((c=x.resolve(void 0)).constructor=x,u=c.then,a=function(){u.call(c,n)}):a=m?function(){b.nextTick(n)}:function(){d.call(f,n)}:(s=!0,l=y.createTextNode(""),new g(n).observe(l,{characterData:!0}),a=function(){l.data=s=!s})),e.exports=C||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},function(e,t,r){var n=r(660);e.exports=/web0s(?!.*chrome)/i.test(n)},function(e,t,r){var n=r(569);e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},function(e,t){e.exports="object"==typeof window},function(e,t,r){"use strict";var n=r(565),o=r(602),i=r(750),a=r(567),s=r(583),l=r(751),c=r(754),u=r(616);if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=l(this,s("Promise")),r="function"==typeof e;return this.then(r?function(r){return c(t,e()).then((function(){return r}))}:e,r?function(r){return c(t,e()).then((function(){throw r}))}:e)}}),!o&&"function"==typeof i){var f=s("Promise").prototype.finally;i.prototype.finally!==f&&u(i.prototype,"finally",f,{unsafe:!0})}},function(e,t,r){r(749)},function(e,t,r){r(755)},function(e,t,r){"use strict";var n=r(565),o=r(624),i=r(645);n({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),r=i(e);return(r.error?t.reject:t.resolve)(r.value),t.promise}})},function(e,t,r){r(756)},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===u)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=c(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),i}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function f(){}function p(){}function d(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,m=v&&v(v(A([])));m&&m!==t&&r.call(m,o)&&(h=m);var g=d.prototype=f.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,s){var l=c(e[o],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,u;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=g.constructor=d,d.constructor=p,p.displayName=s(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),s(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=A,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){var n=r(912);e.exports=n},function(e,t,r){var n=r(913),o=r(915),i=Array.prototype,a=String.prototype;e.exports=function(e){var t=e.includes;return e===i||e instanceof Array&&t===i.includes?n:"string"==typeof e||e===a||e instanceof String&&t===a.includes?o:t}},function(e,t,r){r(914);var n=r(578);e.exports=n("Array").includes},function(e,t,r){"use strict";var n=r(565),o=r(656).includes,i=r(668);n({target:"Array",proto:!0},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(e,t,r){r(916);var n=r(578);e.exports=n("String").includes},function(e,t,r){"use strict";var n=r(565),o=r(917),i=r(629);n({target:"String",proto:!0,forced:!r(919)("includes")},{includes:function(e){return!!~String(i(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(918);e.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,r){var n=r(571),o=r(610),i=r(570)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,r){var n=r(570)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,r){e.exports=r(921)},function(e,t,r){r(604);var n=r(922),o=r(617),i=Array.prototype,a={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.entries;return e===i||e instanceof Array&&t===i.entries||a.hasOwnProperty(o(e))?n:t}},function(e,t,r){var n=r(923);e.exports=n},function(e,t,r){r(720);var n=r(578);e.exports=n("Array").entries},function(e,t,r){e.exports=r(925)},function(e,t,r){var n=r(743);e.exports=n},function(e,t,r){var n=r(927);e.exports=n},function(e,t,r){r(928);var n=r(566);n.JSON||(n.JSON={stringify:JSON.stringify}),e.exports=function(e,t,r){return n.JSON.stringify.apply(null,arguments)}},function(e,t,r){var n=r(565),o=r(583),i=r(567),a=o("JSON","stringify"),s=/[\uD800-\uDFFF]/g,l=/^[\uD800-\uDBFF]$/,c=/^[\uDC00-\uDFFF]$/,u=function(e,t,r){var n=r.charAt(t-1),o=r.charAt(t+1);return l.test(e)&&!c.test(o)||c.test(e)&&!l.test(n)?"\\u"+e.charCodeAt(0).toString(16):e},f=i((function(){return'"\\udf06\\ud834"'!==a("\udf06\ud834")||'"\\udead"'!==a("\udead")}));a&&n({target:"JSON",stat:!0,forced:f},{stringify:function(e,t,r){var n=a.apply(null,arguments);return"string"==typeof n?n.replace(s,u):n}})},function(e,t,r){var n=r(930);e.exports=n},function(e,t,r){var n=r(931),o=Array.prototype;e.exports=function(e){var t=e.map;return e===o||e instanceof Array&&t===o.map?n:t}},function(e,t,r){r(932);var n=r(578);e.exports=n("Array").map},function(e,t,r){"use strict";var n=r(565),o=r(594).map;n({target:"Array",proto:!0,forced:!r(618)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(707);e.exports=n},function(e,t,r){var n=r(935);e.exports=n},function(e,t,r){var n=r(936),o=Array.prototype;e.exports=function(e){var t=e.concat;return e===o||e instanceof Array&&t===o.concat?n:t}},function(e,t,r){r(739);var n=r(578);e.exports=n("Array").concat},function(e,t,r){var n=r(938);e.exports=n},function(e,t,r){r(939);var n=r(566);e.exports=n.Object.entries},function(e,t,r){var n=r(565),o=r(940).entries;n({target:"Object",stat:!0},{entries:function(e){return o(e)}})},function(e,t,r){var n=r(572),o=r(612),i=r(580),a=r(628).f,s=function(e){return function(t){for(var r,s=i(t),l=o(s),c=l.length,u=0,f=[];c>u;)r=l[u++],n&&!a.call(s,r)||f.push(e?[r,s[r]]:s[r]);return f}};e.exports={entries:s(!0),values:s(!1)}},function(e,t,r){var n=r(718);e.exports=n},function(e,t){!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},p.prototype.delete=function(e){delete this.map[c(e)]},p.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},p.prototype.set=function(e,t){this.map[c(e)]=u(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(p.prototype[Symbol.iterator]=p.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),y.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];w.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function k(e,r){return new Promise((function(n,i){var a=new b(e,r);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;n(new w(o,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}k.polyfill=!0,e.fetch||(e.fetch=k,e.Headers=p,e.Request=b,e.Response=w),t.Headers=p,t.Request=b,t.Response=w,t.fetch=k,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:this)},function(e,t,r){"use strict";var n=r(944),o=r(954),i=r(690);e.exports={formats:i,parse:o,stringify:n}},function(e,t,r){"use strict";var n=r(945),o=r(758),i=r(690),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},f=Date.prototype.toISOString,p=i.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},h=function e(t,r,i,a,s,c,f,p,h,v,m,g,y,b,x){var w,C=t;if(x.has(t))throw new RangeError("Cyclic object value");if("function"==typeof f?C=f(r,C):C instanceof Date?C=v(C):"comma"===i&&l(C)&&(C=o.maybeMap(C,(function(e){return e instanceof Date?v(e):e}))),null===C){if(a)return c&&!y?c(r,d.encoder,b,"key",m):r;C=""}if("string"==typeof(w=C)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||o.isBuffer(C))return c?[g(y?r:c(r,d.encoder,b,"key",m))+"="+g(c(C,d.encoder,b,"value",m))]:[g(r)+"="+g(String(C))];var k,A=[];if(void 0===C)return A;if("comma"===i&&l(C))k=[{value:C.length>0?C.join(",")||null:void 0}];else if(l(f))k=f;else{var O=Object.keys(C);k=p?O.sort(p):O}for(var S=0;S<k.length;++S){var E=k[S],j="object"==typeof E&&void 0!==E.value?E.value:C[E];if(!s||null!==j){var T=l(C)?"function"==typeof i?i(r,E):r:r+(h?"."+E:"["+E+"]");x.set(t,!0);var M=n();u(A,e(j,T,i,a,s,c,f,p,h,v,m,g,y,b,M))}}return A};e.exports=function(e,t){var r,o=e,c=function(e){if(!e)return d;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],o=d.filter;return("function"==typeof e.filter||l(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===e.allowDots?d.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):l(c.filter)&&(r=c.filter);var f,p=[];if("object"!=typeof o||null===o)return"";f=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var v=s[f];r||(r=Object.keys(o)),c.sort&&r.sort(c.sort);for(var m=n(),g=0;g<r.length;++g){var y=r[g];c.skipNulls&&null===o[y]||u(p,h(o[y],y,v,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,m))}var b=p.join(c.delimiter),x=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?x+="utf8=%26%2310003%3B&":x+="utf8=%E2%9C%93&"),b.length>0?x+b:""}},function(e,t,r){"use strict";var n=r(688),o=r(950),i=r(952),a=n("%TypeError%"),s=n("%WeakMap%",!0),l=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),d=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),v=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+i(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(l){if(t)return p(t,n)}else if(r)return function(e,t){var r=v(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return f(e,n)}else if(l){if(t)return h(t,n)}else if(r)return function(e,t){return!!v(e,t)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,o)):l?(t||(t=new l),d(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=v(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(947);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},function(e,t,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,r){"use strict";var n="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,i=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==i.call(t))throw new TypeError(n+t);for(var r,a=o.call(arguments,1),s=function(){if(this instanceof r){var n=t.apply(this,a.concat(o.call(arguments)));return Object(n)===n?n:this}return t.apply(e,a.concat(o.call(arguments)))},l=Math.max(0,t.length-a.length),c=[],u=0;u<l;u++)c.push("$"+u);if(r=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var f=function(){};f.prototype=t.prototype,r.prototype=new f,f.prototype=null}return r}},function(e,t,r){"use strict";var n=r(689);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,r){"use strict";var n=r(688),o=r(951),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},function(e,t,r){"use strict";var n=r(689),o=r(688),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),l=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,a,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var f=function(){return s(n,i,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},function(e,t,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"==typeof l.get?l.get:null,u=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,v=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,y="function"==typeof BigInt?BigInt.prototype.valueOf:null,b=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,w="function"==typeof Symbol&&"object"==typeof Symbol.iterator,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),A=r(953).custom,O=A&&M(A)?A:null,S="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function E(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function j(e){return String(e).replace(/"/g,"&quot;")}function T(e){return!("[object Array]"!==I(e)||S&&"object"==typeof e&&S in e)}function M(e){if(w)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!x)return!1;try{return x.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var s=r||{};if(L(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(L(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!L(s,"customInspect")||s.customInspect;if("boolean"!=typeof l)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(L(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return e(t.slice(0,r.maxStringLength),r)+o}return E(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,_),"single",r)}(t,s);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var v=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=v&&v>0&&"object"==typeof t)return T(t)?"[Array]":"[Object]";var b=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=Array(e.indent+1).join(" ")}return{base:r,prev:Array(t+1).join(r)}}(s,n);if(void 0===o)o=[];else if(F(o,t)>=0)return"[Circular]";function C(t,r,i){if(r&&(o=o.slice()).push(r),i){var a={depth:s.depth};return L(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,n+1,o)}return e(t,s,n+1,o)}if("function"==typeof t){var A=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),P=B(t,C);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(P.length>0?" { "+P.join(", ")+" }":"")}if(M(t)){var U=w?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(t);return"object"!=typeof t||w?U:N(U)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var z="<"+String(t.nodeName).toLowerCase(),W=t.attributes||[],H=0;H<W.length;H++)z+=" "+W[H].name+"="+E(j(W[H].value),"double",s);return z+=">",t.childNodes&&t.childNodes.length&&(z+="..."),z+="</"+String(t.nodeName).toLowerCase()+">"}if(T(t)){if(0===t.length)return"[]";var q=B(t,C);return b&&!function(e){for(var t=0;t<e.length;t++)if(F(e[t],"\n")>=0)return!1;return!0}(q)?"["+V(q,b)+"]":"[ "+q.join(", ")+" ]"}if(function(e){return!("[object Error]"!==I(e)||S&&"object"==typeof e&&S in e)}(t)){var G=B(t,C);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"==typeof t&&l){if(O&&"function"==typeof t[O])return t[O]();if("function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var $=[];return a.call(t,(function(e,r){$.push(C(r,t,!0)+" => "+C(e,t))})),D("Map",i.call(t),$,b)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var K=[];return u.call(t,(function(e){K.push(C(e,t))})),D("Set",c.call(t),K,b)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return R("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return R("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return R("WeakRef");if(function(e){return!("[object Number]"!==I(e)||S&&"object"==typeof e&&S in e)}(t))return N(C(Number(t)));if(function(e){if(!e||"object"!=typeof e||!y)return!1;try{return y.call(e),!0}catch(e){}return!1}(t))return N(C(y.call(t)));if(function(e){return!("[object Boolean]"!==I(e)||S&&"object"==typeof e&&S in e)}(t))return N(h.call(t));if(function(e){return!("[object String]"!==I(e)||S&&"object"==typeof e&&S in e)}(t))return N(C(String(t)));if(!function(e){return!("[object Date]"!==I(e)||S&&"object"==typeof e&&S in e)}(t)&&!function(e){return!("[object RegExp]"!==I(e)||S&&"object"==typeof e&&S in e)}(t)){var J=B(t,C),Y=k?k(t)===Object.prototype:t instanceof Object||t.constructor===Object,X=t instanceof Object?"":"null prototype",Q=!Y&&S&&Object(t)===t&&S in t?I(t).slice(8,-1):X?"Object":"",Z=(Y||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(Q||X?"["+[].concat(Q||[],X||[]).join(": ")+"] ":"");return 0===J.length?Z+"{}":b?Z+"{"+V(J,b)+"}":Z+"{ "+J.join(", ")+" }"}return String(t)};var P=Object.prototype.hasOwnProperty||function(e){return e in this};function L(e,t){return P.call(e,t)}function I(e){return v.call(e)}function F(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function _(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function N(e){return"Object("+e+")"}function R(e){return e+" { ? }"}function D(e,t,r,n){return e+" ("+t+") {"+(n?V(r,n):r.join(", "))+"}"}function V(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+e.join(","+r)+"\n"+t.prev}function B(e,t){var r=T(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=L(e,o)?t(e[o],e):""}var i,a="function"==typeof b?b(e):[];if(w){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var l in e)L(e,l)&&(r&&String(Number(l))===l&&l<e.length||w&&i["$"+l]instanceof Symbol||(/[^\w$]/.test(l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof b)for(var c=0;c<a.length;c++)C.call(e,a[c])&&n.push("["+t(a[c])+"]: "+t(e[a[c]],e));return n}},function(e,t){},function(e,t,r){"use strict";var n=r(758),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),c=s?i.slice(0,s.index):i,u=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var f=0;r.depth>0&&null!==(s=a.exec(i))&&f<r.depth;){if(f+=1,!r.plainObjects&&o.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(e,t,r,n){for(var o=n?t:l(t,r),i=e.length-1;i>=0;--i){var a,s=e[i];if("[]"===s&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=o:a[c]=o:a={0:o}}o=a}return o}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,c={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=u.split(t.delimiter,f),d=-1,h=t.charset;if(t.charsetSentinel)for(r=0;r<p.length;++r)0===p[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[r]?h="utf-8":"utf8=%26%2310003%3B"===p[r]&&(h="iso-8859-1"),d=r,r=p.length);for(r=0;r<p.length;++r)if(r!==d){var v,m,g=p[r],y=g.indexOf("]="),b=-1===y?g.indexOf("="):y+1;-1===b?(v=t.decoder(g,a.decoder,h,"key"),m=t.strictNullHandling?null:""):(v=t.decoder(g.slice(0,b),a.decoder,h,"key"),m=n.maybeMap(l(g.slice(b+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===h&&(m=s(m)),g.indexOf("[]=")>-1&&(m=i(m)?[m]:m),o.call(c,v)?c[v]=n.combine(c[v],m):c[v]=m}return c}(e,r):e,f=r.plainObjects?Object.create(null):{},p=Object.keys(u),d=0;d<p.length;++d){var h=p[d],v=c(h,u[h],r,"string"==typeof e);f=n.merge(f,v,r)}return!0===r.allowSparse?f:n.compact(f)}},function(e,t,r){var n=r(956),o=r(759);e.exports=function(e,t){return n(e,t,(function(t,r){return o(e,r)}))}},function(e,t,r){var n=r(692),o=r(977),i=r(647);e.exports=function(e,t,r){for(var a=-1,s=t.length,l={};++a<s;){var c=t[a],u=n(e,c);r(u,c)&&o(l,i(c,e),u)}return l}},function(e,t,r){var n=r(958),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,r,n,o){t.push(n?o.replace(i,"$1"):r||e)})),t}));e.exports=a},function(e,t,r){var n=r(959);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},function(e,t,r){var n=r(694);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(o.Cache||n),r}o.Cache=n,e.exports=o},function(e,t,r){var n=r(961),o=r(649),i=r(695);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(e,t,r){var n=r(962),o=r(963),i=r(964),a=r(965),s=r(966);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},function(e,t,r){var n=r(648);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,r){var n=r(648),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},function(e,t,r){var n=r(648),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},function(e,t,r){var n=r(648);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(650),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(650);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(650);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(650);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,r){var n=r(651);e.exports=function(e){return n(this,e).get(e)}},function(e,t,r){var n=r(651);e.exports=function(e){return n(this,e).has(e)}},function(e,t,r){var n=r(651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},function(e,t,r){var n=r(636),o=r(647),i=r(639),a=r(585),s=r(625);e.exports=function(e,t,r,l){if(!a(e))return e;for(var c=-1,u=(t=o(t,e)).length,f=u-1,p=e;null!=p&&++c<u;){var d=s(t[c]),h=r;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(c!=f){var v=p[d];void 0===(h=l?l(v,d,p):void 0)&&(h=a(v)?v:i(t[c+1])?[]:{})}n(p,d,h),p=p[d]}return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,r){var n=r(647),o=r(640),i=r(575),a=r(639),s=r(672),l=r(625);e.exports=function(e,t,r){for(var c=-1,u=(t=n(t,e)).length,f=!1;++c<u;){var p=l(t[c]);if(!(f=null!=e&&r(e,p)))break;e=e[p]}return f||++c!=u?f:!!(u=null==e?0:e.length)&&s(u)&&a(p,u)&&(i(e)||o(e))}},function(e,t,r){var n=r(981),o=r(730),i=r(731);e.exports=function(e){return i(o(e,void 0,n),e+"")}},function(e,t,r){var n=r(982);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},function(e,t,r){var n=r(696),o=r(983);e.exports=function e(t,r,i,a,s){var l=-1,c=t.length;for(i||(i=o),s||(s=[]);++l<c;){var u=t[l];r>0&&i(u)?r>1?e(u,r-1,i,a,s):n(s,u):a||(s[s.length]=u)}return s}},function(e,t,r){var n=r(606),o=r(640),i=r(575),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t,r){var n=r(985),o=r(719),i=r(989);function a(t,r,s){return"undefined"!=typeof Reflect&&n?(e.exports=a=n,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=a=function(e,t,r){var n=i(e,t);if(n){var a=o(n,t);return a.get?a.get.call(r):a.value}},e.exports.default=e.exports,e.exports.__esModule=!0),a(t,r,s||t)}e.exports=a,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=r(986)},function(e,t,r){var n=r(987);e.exports=n},function(e,t,r){r(988);var n=r(566);e.exports=n.Reflect.get},function(e,t,r){var n=r(565),o=r(571),i=r(573),a=r(574),s=r(600),l=r(619);n({target:"Reflect",stat:!0},{get:function e(t,r){var n,c,u=arguments.length<3?t:arguments[2];return i(t)===u?t[r]:(n=s.f(t,r))?a(n,"value")?n.value:void 0===n.get?void 0:n.get.call(u):o(c=l(t))?e(c,r,u):void 0}})},function(e,t,r){var n=r(699);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(991);e.exports=n},function(e,t,r){r(992);var n=r(566);e.exports=n.Object.setPrototypeOf},function(e,t,r){r(565)({target:"Object",stat:!0},{setPrototypeOf:r(635)})},function(e,t,r){e.exports=r(994)},function(e,t,r){var n=r(995);e.exports=n},function(e,t,r){r(996);var n=r(566);e.exports=n.Object.getPrototypeOf},function(e,t,r){var n=r(565),o=r(567),i=r(581),a=r(619),s=r(723);n({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!s},{getPrototypeOf:function(e){return a(i(e))}})},function(e,t,r){var n=r(998),o=r(1002);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=n(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=r(999)},function(e,t,r){var n=r(1e3);e.exports=n},function(e,t,r){r(1001);var n=r(566).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,r){r(565)({target:"Object",stat:!0,sham:!r(572)},{create:r(615)})},function(e,t,r){var n=r(760);function o(t,r){return e.exports=o=n||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,o(t,r)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(761),o=r(699),i=r(1008),a=r(1009);e.exports=function(e){var t=i();return function(){var r,i=o(e);if(t){var s=o(this).constructor;r=n(i,arguments,s)}else r=i.apply(this,arguments);return a(this,r)}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(1005);e.exports=n},function(e,t,r){r(1006);var n=r(566);e.exports=n.Reflect.construct},function(e,t,r){var n=r(565),o=r(583),i=r(590),a=r(573),s=r(571),l=r(615),c=r(1007),u=r(567),f=o("Reflect","construct"),p=u((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),d=!u((function(){f((function(){}))})),h=p||d;n({target:"Reflect",stat:!0,forced:h,sham:h},{construct:function(e,t){i(e),a(t);var r=arguments.length<3?e:i(arguments[2]);if(d&&!p)return f(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(c.apply(e,n))}var o=r.prototype,u=l(s(o)?o:Object.prototype),h=Function.apply.call(e,u,t);return s(h)?h:u}})},function(e,t,r){"use strict";var n=r(590),o=r(571),i=[].slice,a={},s=function(e,t,r){if(!(t in a)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";a[t]=Function("C,a","return new C("+n.join(",")+")")}return a[t](e,r)};e.exports=Function.bind||function(e){var t=n(this),r=i.call(arguments,1),a=function(){var n=r.concat(i.call(arguments));return this instanceof a?s(t,n.length,n):t.apply(e,n)};return o(t.prototype)&&(a.prototype=t.prototype),a}},function(e,t,r){var n=r(761);e.exports=function(){if("undefined"==typeof Reflect||!n)return!1;if(n.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(n(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(588).default,o=r(1010);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=r(1012)},function(e,t,r){var n=r(1013);e.exports=n},function(e,t,r){var n=r(1014),o=Array.prototype;e.exports=function(e){var t=e.find;return e===o||e instanceof Array&&t===o.find?n:t}},function(e,t,r){r(1015);var n=r(578);e.exports=n("Array").find},function(e,t,r){"use strict";var n=r(565),o=r(594).find,i=r(668),a=!0;"find"in[]&&Array(1).find((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(e,t){e.exports=window.FormData},function(e,t,r){var n=r(680),o=r(747);e.exports=function(e){if(n(e))return o(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(643),o=r(678),i=r(742);e.exports=function(e){if(void 0!==n&&null!=o(e)||null!=e["@@iterator"])return i(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(741);e.exports=n},function(e,t,r){var n=r(1022);e.exports=n},function(e,t,r){r(1023);var n=r(566);e.exports=n.Object.assign},function(e,t,r){var n=r(565),o=r(1024);n({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,r){"use strict";var n=r(572),o=r(567),i=r(612),a=r(664),s=r(628),l=r(581),c=r(654),u=Object.assign,f=Object.defineProperty;e.exports=!u||o((function(){if(n&&1!==u({b:1},u(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=u({},e)[r]||"abcdefghijklmnopqrst"!=i(u({},t)).join("")}))?function(e,t){for(var r=l(e),o=arguments.length,u=1,f=a.f,p=s.f;o>u;)for(var d,h=c(arguments[u++]),v=f?i(h).concat(f(h)):i(h),m=v.length,g=0;m>g;)d=v[g++],n&&!p.call(h,d)||(r[d]=h[d]);return r}:u},function(e,t,r){var n=r(748);e.exports=n},function(e,t,r){e.exports=r(1027)},function(e,t,r){var n=r(1028);e.exports=n},function(e,t,r){var n=r(1029),o=Array.prototype;e.exports=function(e){var t=e.splice;return e===o||e instanceof Array&&t===o.splice?n:t}},function(e,t,r){r(1030);var n=r(578);e.exports=n("Array").splice},function(e,t,r){"use strict";var n=r(565),o=r(657),i=r(631),a=r(592),s=r(581),l=r(667),c=r(620),u=r(618)("splice"),f=Math.max,p=Math.min;n({target:"Array",proto:!0,forced:!u},{splice:function(e,t){var r,n,u,d,h,v,m=s(this),g=a(m.length),y=o(e,g),b=arguments.length;if(0===b?r=n=0:1===b?(r=0,n=g-y):(r=b-2,n=p(f(i(t),0),g-y)),g+r-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(u=l(m,n),d=0;d<n;d++)(h=y+d)in m&&c(u,d,m[h]);if(u.length=n,r<n){for(d=y;d<g-n;d++)v=d+r,(h=d+n)in m?m[v]=m[h]:delete m[v];for(d=g;d>g-n+r;d--)delete m[d-1]}else if(r>n)for(d=g-n;d>y;d--)v=d+r-1,(h=d+n-1)in m?m[v]=m[h]:delete m[v];for(d=0;d<r;d++)m[d+y]=arguments[d+2];return m.length=g-n+r,u}})},function(e,t,r){var n=r(1032)(r(1060));e.exports=n},function(e,t,r){var n=r(763),o=r(607),i=r(608);e.exports=function(e){return function(t,r,a){var s=Object(t);if(!o(t)){var l=n(r,3);t=i(t),r=function(e){return l(s[e],e,s)}}var c=e(t,r,a);return c>-1?s[l?t[c]:c]:void 0}}},function(e,t,r){var n=r(1034),o=r(1055),i=r(771);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},function(e,t,r){var n=r(700),o=r(764);e.exports=function(e,t,r,i){var a=r.length,s=a,l=!i;if(null==e)return!s;for(e=Object(e);a--;){var c=r[a];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var u=(c=r[a])[0],f=e[u],p=c[1];if(l&&c[2]){if(void 0===f&&!(u in e))return!1}else{var d=new n;if(i)var h=i(f,p,u,e,t,d);if(!(void 0===h?o(p,f,3,i,d):h))return!1}}return!0}},function(e,t,r){var n=r(649);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(649),o=r(695),i=r(694);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(700),o=r(765),i=r(1046),a=r(1049),s=r(627),l=r(575),c=r(641),u=r(673),f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,d,h,v){var m=l(e),g=l(t),y=m?"[object Array]":s(e),b=g?"[object Array]":s(t),x=(y="[object Arguments]"==y?f:y)==f,w=(b="[object Arguments]"==b?f:b)==f,C=y==b;if(C&&c(e)){if(!c(t))return!1;m=!0,x=!1}if(C&&!x)return v||(v=new n),m||u(e)?o(e,t,r,d,h,v):i(e,t,y,r,d,h,v);if(!(1&r)){var k=x&&p.call(e,"__wrapped__"),A=w&&p.call(t,"__wrapped__");if(k||A){var O=k?e.value():e,S=A?t.value():t;return v||(v=new n),h(O,S,r,d,v)}}return!!C&&(v||(v=new n),a(e,t,r,d,h,v))}},function(e,t,r){var n=r(694),o=r(1042),i=r(1043);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,r){var n=r(606),o=r(766),i=r(638),a=r(765),s=r(1047),l=r(1048),c=n?n.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,r,n,c,f,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var d=s;case"[object Set]":var h=1&n;if(d||(d=l),e.size!=t.size&&!h)return!1;var v=p.get(e);if(v)return v==t;n|=2,p.set(e,t);var m=a(d(e),d(t),n,c,f,p);return p.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},function(e,t){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},function(e,t,r){var n=r(767),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,a,s){var l=1&r,c=n(e),u=c.length;if(u!=n(t).length&&!l)return!1;for(var f=u;f--;){var p=c[f];if(!(l?p in t:o.call(t,p)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var v=!0;s.set(e,t),s.set(t,e);for(var m=l;++f<u;){var g=e[p=c[f]],y=t[p];if(i)var b=l?i(y,g,p,t,e,s):i(g,y,p,e,t,s);if(!(void 0===b?g===y||a(g,y,r,i,s):b)){v=!1;break}m||(m="constructor"==p)}if(v&&!m){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},function(e,t,r){var n=r(595)(r(584),"DataView");e.exports=n},function(e,t,r){var n=r(595)(r(584),"Promise");e.exports=n},function(e,t,r){var n=r(595)(r(584),"Set");e.exports=n},function(e,t,r){var n=r(595)(r(584),"WeakMap");e.exports=n},function(e,t,r){var n=r(770),o=r(608);e.exports=function(e){for(var t=o(e),r=t.length;r--;){var i=t[r],a=e[i];t[r]=[i,a,n(a)]}return t}},function(e,t,r){var n=r(764),o=r(653),i=r(759),a=r(693),s=r(770),l=r(771),c=r(625);e.exports=function(e,t){return a(e)&&s(t)?l(c(e),t):function(r){var a=o(r,e);return void 0===a&&a===t?i(r,e):n(t,a,3)}}},function(e,t,r){var n=r(1058),o=r(1059),i=r(693),a=r(625);e.exports=function(e){return i(e)?n(a(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,r){var n=r(692);e.exports=function(e){return function(t){return n(t,e)}}},function(e,t,r){var n=r(1061),o=r(763),i=r(737),a=Math.max;e.exports=function(e,t,r){var s=null==e?0:e.length;if(!s)return-1;var l=null==r?0:i(r);return l<0&&(l=a(s+l,0)),n(e,o(t,3),l)}},function(e,t){e.exports=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t){e.exports=function(){}},function(e,t,r){"use strict";(function(t){
16
16
  /*!