@sankhyalabs/sankhyablocks 6.9.2 → 7.0.0

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 (188) hide show
  1. package/dist/cjs/{ConfigStorage-3aaa8a9f.js → ConfigStorage-97468a0f.js} +31 -25
  2. package/dist/cjs/{DataFetcher-093c47ae.js → DataFetcher-04c70ba9.js} +88 -24
  3. package/dist/cjs/{PersonalizedFilterUtils-cfcd9af2.js → PersonalizedFilterUtils-9848e09b.js} +18 -64
  4. package/dist/cjs/{SnkFormConfigManager-ddad3cbb.js → SnkFormConfigManager-bef6e022.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-e55c7afa.js → SnkMessageBuilder-f40df6d4.js} +20 -3
  6. package/dist/cjs/{dataunit-fetcher-2f67ac79.js → dataunit-fetcher-4102080d.js} +1 -1
  7. package/dist/cjs/{filter-bar-config-fetcher-81868495.js → filter-bar-config-fetcher-a7747f69.js} +23 -6
  8. package/dist/cjs/{form-config-fetcher-affb0b28.js → form-config-fetcher-56442594.js} +2 -2
  9. package/dist/cjs/index-8d94b7e0.js +7 -0
  10. package/dist/cjs/index-c5771aba.js +44 -0
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{pesquisa-fetcher-21c3afc9.js → pesquisa-fetcher-cab451b6.js} +1 -1
  13. package/dist/cjs/{resource-fetcher-e71a11b8.js → resource-fetcher-260e98a4.js} +1 -1
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/snk-actions-button.cjs.entry.js +2 -2
  16. package/dist/cjs/snk-application.cjs.entry.js +8 -8
  17. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  18. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  19. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  20. package/dist/cjs/{snk-data-unit-26cf970c.js → snk-data-unit-b0cc2d42.js} +1 -1
  21. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  22. package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
  23. package/dist/cjs/snk-expression-group_2.cjs.entry.js +542 -0
  24. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +66 -0
  25. package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -17
  26. package/dist/cjs/snk-filter-detail.cjs.entry.js +5 -5
  27. package/dist/cjs/{snk-expression-item_3.cjs.entry.js → snk-filter-field-search_2.cjs.entry.js} +23 -315
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +5 -5
  29. package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -2
  30. package/dist/cjs/snk-form-config.cjs.entry.js +3 -3
  31. package/dist/cjs/snk-form.cjs.entry.js +6 -6
  32. package/dist/cjs/snk-grid-config.cjs.entry.js +5 -5
  33. package/dist/cjs/snk-grid.cjs.entry.js +5 -5
  34. package/dist/cjs/{snk-guides-viewer-b0f98cf4.js → snk-guides-viewer-897368ea.js} +3 -3
  35. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  36. package/dist/cjs/snk-personalized-filter.cjs.entry.js +125 -34
  37. package/dist/cjs/snk-print-selector.cjs.entry.js +15 -11
  38. package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
  39. package/dist/collection/collection-manifest.json +2 -0
  40. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
  41. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +5 -1
  42. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +114 -23
  43. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +4 -6
  44. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +2 -1
  45. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.css +10 -0
  46. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.js +95 -0
  47. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.css +66 -0
  48. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js +158 -0
  49. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +8 -2
  50. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +14 -23
  51. package/dist/collection/components/snk-print-selector/snk-print-selector.css +9 -1
  52. package/dist/collection/components/snk-print-selector/snk-print-selector.js +17 -14
  53. package/dist/collection/lib/configs/ConfigStorage.js +5 -3
  54. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +22 -5
  55. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +22 -18
  56. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +18 -2
  57. package/dist/collection/lib/message/resources/snk-print-selector.msg.js +2 -1
  58. package/dist/collection/lib/utils/PrintUtils.js +88 -24
  59. package/dist/components/ConfigStorage.js +27 -21
  60. package/dist/components/DataFetcher.js +88 -24
  61. package/dist/components/PersonalizedFilterUtils.js +14 -23
  62. package/dist/components/SnkMessageBuilder.js +20 -3
  63. package/dist/components/filter-bar-config-fetcher.js +22 -5
  64. package/dist/components/index.d.ts +2 -0
  65. package/dist/components/index.js +2 -0
  66. package/dist/components/snk-crud.js +34 -22
  67. package/dist/components/snk-detail-view2.js +49 -27
  68. package/dist/components/snk-expression-group2.js +4 -6
  69. package/dist/components/snk-expression-item2.js +2 -1
  70. package/dist/components/snk-filter-advanced-mode.d.ts +11 -0
  71. package/dist/components/snk-filter-advanced-mode.js +6 -0
  72. package/dist/components/snk-filter-advanced-mode2.js +46 -0
  73. package/dist/components/snk-filter-assistent-mode.d.ts +11 -0
  74. package/dist/components/snk-filter-assistent-mode.js +6 -0
  75. package/dist/components/snk-filter-assistent-mode2.js +77 -0
  76. package/dist/components/snk-filter-bar2.js +17 -5
  77. package/dist/components/snk-filter-param-config2.js +6 -0
  78. package/dist/components/snk-grid2.js +22 -10
  79. package/dist/components/snk-personalized-filter2.js +131 -28
  80. package/dist/components/snk-print-selector.js +14 -10
  81. package/dist/esm/{ConfigStorage-24b221ba.js → ConfigStorage-02f17a26.js} +31 -25
  82. package/dist/esm/{DataFetcher-6153ff3e.js → DataFetcher-fddeb917.js} +88 -24
  83. package/dist/esm/{PersonalizedFilterUtils-1a167d89.js → PersonalizedFilterUtils-731cae01.js} +16 -62
  84. package/dist/esm/{SnkFormConfigManager-fcbefc1a.js → SnkFormConfigManager-cd9e6cab.js} +2 -2
  85. package/dist/esm/{SnkMessageBuilder-96e66d9c.js → SnkMessageBuilder-5be56185.js} +20 -3
  86. package/dist/esm/{dataunit-fetcher-09586248.js → dataunit-fetcher-66f42154.js} +1 -1
  87. package/dist/esm/{filter-bar-config-fetcher-73ebc12f.js → filter-bar-config-fetcher-790283d8.js} +23 -6
  88. package/dist/esm/{form-config-fetcher-01e9985d.js → form-config-fetcher-533b895e.js} +2 -2
  89. package/dist/esm/index-620ac460.js +7 -0
  90. package/dist/esm/index-ae591a44.js +44 -0
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/{pesquisa-fetcher-829ec5a9.js → pesquisa-fetcher-4a702655.js} +1 -1
  93. package/dist/esm/{resource-fetcher-d053e214.js → resource-fetcher-0f20a072.js} +1 -1
  94. package/dist/esm/sankhyablocks.js +1 -1
  95. package/dist/esm/snk-actions-button.entry.js +2 -2
  96. package/dist/esm/snk-application.entry.js +8 -8
  97. package/dist/esm/snk-attach.entry.js +2 -2
  98. package/dist/esm/snk-crud.entry.js +2 -2
  99. package/dist/esm/snk-data-exporter.entry.js +3 -3
  100. package/dist/esm/{snk-data-unit-0f2d3c74.js → snk-data-unit-b9b4bb5f.js} +1 -1
  101. package/dist/esm/snk-data-unit.entry.js +2 -2
  102. package/dist/esm/snk-detail-view.entry.js +9 -9
  103. package/dist/esm/snk-expression-group_2.entry.js +537 -0
  104. package/dist/esm/snk-filter-advanced-mode_2.entry.js +61 -0
  105. package/dist/esm/snk-filter-bar.entry.js +8 -8
  106. package/dist/esm/snk-filter-detail.entry.js +5 -5
  107. package/dist/esm/{snk-expression-item_3.entry.js → snk-filter-field-search_2.entry.js} +12 -303
  108. package/dist/esm/snk-filter-modal-item.entry.js +5 -5
  109. package/dist/esm/snk-filter-modal.entry.js +2 -2
  110. package/dist/esm/snk-form-config.entry.js +3 -3
  111. package/dist/esm/snk-form.entry.js +6 -6
  112. package/dist/esm/snk-grid-config.entry.js +5 -5
  113. package/dist/esm/snk-grid.entry.js +5 -5
  114. package/dist/esm/{snk-guides-viewer-ab5c376c.js → snk-guides-viewer-579c70cc.js} +3 -3
  115. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  116. package/dist/esm/snk-personalized-filter.entry.js +122 -31
  117. package/dist/esm/snk-print-selector.entry.js +15 -11
  118. package/dist/esm/snk-simple-crud.entry.js +2 -2
  119. package/dist/sankhyablocks/{p-e665c93f.entry.js → p-19fdcf88.entry.js} +1 -1
  120. package/dist/sankhyablocks/{p-4ab8d0ee.entry.js → p-1fe2976e.entry.js} +1 -1
  121. package/dist/sankhyablocks/p-2227bb94.js +1 -0
  122. package/dist/sankhyablocks/{p-85e6068d.entry.js → p-2ddf3e87.entry.js} +1 -1
  123. package/dist/sankhyablocks/p-386102a7.entry.js +1 -0
  124. package/dist/sankhyablocks/{p-eaec700d.js → p-3b059f4e.js} +1 -1
  125. package/dist/sankhyablocks/p-4af6cbef.entry.js +1 -0
  126. package/dist/sankhyablocks/p-4bbc7aac.entry.js +1 -0
  127. package/dist/sankhyablocks/p-4f550a1a.js +1 -0
  128. package/dist/sankhyablocks/{p-7dd92fb8.entry.js → p-4f687570.entry.js} +1 -1
  129. package/dist/sankhyablocks/p-5098f618.js +1 -0
  130. package/dist/sankhyablocks/{p-16ad23d5.entry.js → p-5596a2dd.entry.js} +1 -1
  131. package/dist/sankhyablocks/p-7e636457.entry.js +1 -0
  132. package/dist/sankhyablocks/p-7f1c4687.js +56 -0
  133. package/dist/sankhyablocks/p-82800006.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-05d82333.entry.js → p-88f4ef73.entry.js} +1 -1
  135. package/dist/sankhyablocks/{p-d20e2ce3.js → p-8f484733.js} +1 -1
  136. package/dist/sankhyablocks/{p-eb0c9f4c.js → p-90a926c7.js} +1 -1
  137. package/dist/sankhyablocks/{p-432dd007.entry.js → p-90e7c3a2.entry.js} +1 -1
  138. package/dist/sankhyablocks/p-933c0c0b.js +1 -0
  139. package/dist/sankhyablocks/p-9666c0d0.entry.js +1 -0
  140. package/dist/sankhyablocks/p-97720467.entry.js +1 -0
  141. package/dist/sankhyablocks/{p-a4cd60bf.entry.js → p-97c586ab.entry.js} +1 -1
  142. package/dist/sankhyablocks/{p-814f9247.js → p-982107dc.js} +1 -1
  143. package/dist/sankhyablocks/{p-354ce206.entry.js → p-9fa9331b.entry.js} +1 -1
  144. package/dist/sankhyablocks/{p-07cb8a03.entry.js → p-a357d13c.entry.js} +1 -1
  145. package/dist/sankhyablocks/{p-bfe8b96d.js → p-acd8b97b.js} +1 -1
  146. package/dist/sankhyablocks/{p-40a5d35e.entry.js → p-ad6673fb.entry.js} +1 -1
  147. package/dist/sankhyablocks/{p-3e8748b1.entry.js → p-af8ed6d5.entry.js} +1 -1
  148. package/dist/sankhyablocks/{p-bd1f8640.entry.js → p-bc19b890.entry.js} +1 -1
  149. package/dist/sankhyablocks/p-bd86c9d3.entry.js +1 -0
  150. package/dist/sankhyablocks/{p-1b596ea1.entry.js → p-cdbdcf13.entry.js} +1 -1
  151. package/dist/sankhyablocks/{p-89fb7531.js → p-d97eb781.js} +2 -2
  152. package/dist/sankhyablocks/{p-60ad0dea.js → p-f034254e.js} +1 -1
  153. package/dist/sankhyablocks/p-f4184ce7.js +1 -0
  154. package/dist/sankhyablocks/{p-9a7aafe4.js → p-fb1e5b6d.js} +1 -1
  155. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  156. package/dist/types/components/snk-personalized-filter/interfaces/IPersonalizedFilter.d.ts +4 -0
  157. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +17 -6
  158. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +2 -2
  159. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-advanced-mode/snk-filter-advanced-mode.d.ts +20 -0
  160. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.d.ts +31 -0
  161. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.d.ts +6 -0
  162. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +2 -2
  163. package/dist/types/components/snk-print-selector/snk-print-selector.d.ts +7 -1
  164. package/dist/types/components.d.ts +106 -4
  165. package/dist/types/lib/configs/ConfigStorage.d.ts +3 -2
  166. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +2 -1
  167. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
  168. package/dist/types/lib/utils/PrintUtils.d.ts +5 -2
  169. package/package.json +1 -1
  170. package/react/components.d.ts +2 -0
  171. package/react/components.js +2 -0
  172. package/react/components.js.map +1 -1
  173. package/dist/cjs/IExpressionItem-0e32ebb7.js +0 -7
  174. package/dist/cjs/snk-expression-group.cjs.entry.js +0 -250
  175. package/dist/esm/IExpressionItem-21f225bf.js +0 -7
  176. package/dist/esm/snk-expression-group.entry.js +0 -246
  177. package/dist/sankhyablocks/p-13f0ed88.entry.js +0 -1
  178. package/dist/sankhyablocks/p-2b449454.js +0 -1
  179. package/dist/sankhyablocks/p-63bff2a8.js +0 -1
  180. package/dist/sankhyablocks/p-6f49f5d4.entry.js +0 -1
  181. package/dist/sankhyablocks/p-744d0fd2.js +0 -1
  182. package/dist/sankhyablocks/p-7d68a43a.js +0 -1
  183. package/dist/sankhyablocks/p-9404ad4d.entry.js +0 -1
  184. package/dist/sankhyablocks/p-ad4bb9d2.entry.js +0 -1
  185. package/dist/sankhyablocks/p-d9586ead.entry.js +0 -1
  186. package/dist/sankhyablocks/p-e789eb2d.js +0 -68
  187. package/dist/sankhyablocks/p-f8ce17d3.entry.js +0 -1
  188. package/dist/sankhyablocks/p-feb6963e.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{StringUtils as e,ApplicationContext as t,ErrorException as n,WarningException as i,ObjectUtils as r}from"@sankhyalabs/core";import{c as s,a as o}from"./p-112455b1.js";var u=s((function(e,t){var n="undefined"!=typeof self?self:o,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&u.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 l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?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 v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function p(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}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 y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&r&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(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):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(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(p)}),this.text=function(){var e,t,n,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=v(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var n,i,r=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=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 f(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),b.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}})),t}function O(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 f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.prototype),y.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];O.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new O(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 n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(i,s){var o=new w(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function a(){u.abort()}u.onload=function(){var e,t,n={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}})),t)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL"),i(new O("response"in u?u.response:u.responseText,n))},u.onerror=function(){s(new TypeError("Network request failed"))},u.ontimeout=function(){s(new TypeError("Network request failed"))},u.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},u.open(o.method,o.url,!0),"include"===o.credentials?u.withCredentials=!0:"omit"===o.credentials&&(u.withCredentials=!1),"responseType"in u&&r&&(u.responseType="blob"),o.headers.forEach((function(e,t){u.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",a),u.onreadystatechange=function(){4===u.readyState&&o.signal.removeEventListener("abort",a)}),u.send(void 0===o._bodyInit?null:o._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=f,e.Request=w,e.Response=O),t.Headers=f,t.Request=w,t.Response=O,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})),a=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}})),c=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}})),l=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let i=0,r=1;for(const s of e.body.matchAll(n)){if("number"==typeof s.index||(0,c.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,r+=1}return{line:r,column:t+1-i}};const n=/\r\n|[\n\r]/g})),h=s((function(e,t){function n(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,s=t.line-1,o=t.line+(e.locationOffset.line-1),u=t.column+(1===t.line?n:0),a=`${e.name}:${o}:${u}\n`,c=r.split(/\r\n|[\n\r]/g),l=c[s];if(l.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e<l.length;e+=80)n.push(l.slice(e,e+80));return a+i([[`${o} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return a+i([[o-1+" |",c[s-1]],[`${o} |`,l],["|","^".padStart(u)],[`${o+1} |`,c[s+1]]])}function i(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return n(e.source,(0,l.getLocation)(e.source,e.start))},t.printSourceLocation=n})),f=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};class n extends Error{constructor(e,...t){var r,s,o;const{nodes:u,source:c,positions:h,path:f,originalError:d,extensions:v}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=f?f:void 0,this.originalError=null!=d?d:void 0,this.nodes=i(Array.isArray(u)?u:u?[u]:void 0);const p=i(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=c?c:null==p||null===(s=p[0])||void 0===s?void 0:s.source,this.positions=null!=h?h:null==p?void 0:p.map((e=>e.start)),this.locations=h&&c?h.map((e=>(0,l.getLocation)(c,e))):null==p?void 0:p.map((e=>(0,l.getLocation)(e.source,e.start)));const m=(0,a.isObjectLike)(null==d?void 0:d.extensions)?null==d?void 0:d.extensions:void 0;this.extensions=null!==(o=null!=v?v:m)&&void 0!==o?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=d&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,h.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,h.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function i(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=n})),d=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new f.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}})),v=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&s.has(t)};class n{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=n;class i{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=i;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=r;const s=new Set(Object.keys(r));var o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))})),p=s((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))})),m=s((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))})),y=s((function(e,t){function n(e){return e>=48&&e<=57}function i(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=i,t.isNameContinue=function(e){return i(e)||n(e)||95===e},t.isNameStart=function(e){return i(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}})),b=s((function(e,t){function n(e){let t=0;for(;t<e.length&&(0,y.isWhiteSpace)(e.charCodeAt(t));)++t;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){var o;const u=e[t],a=n(u);a!==u.length&&(r=null!==(o=r)&&void 0!==o?o:t,s=t,0!==t&&a<i&&(i=a))}return e.map(((e,t)=>0===t?e:e.slice(i))).slice(null!==(t=r)&&void 0!==t?t:0,s+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,i=!0,r=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!t&&(!i||!r)},t.printBlockString=function(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((e=>0===e.length||(0,y.isWhiteSpace)(e.charCodeAt(0)))),o=n.endsWith('\\"""'),u=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=u||a,l=!(null!=t&&t.minimize)&&(!r||e.length>70||c||s||o);let h="";const f=r&&(0,y.isWhiteSpace)(e.charCodeAt(0));return(l&&!f||s)&&(h+="\n"),h+=n,(l||c)&&(h+="\n"),'"""'+h+'"""'}})),w=s((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))})),g=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===w.TokenKind.BANG||e===w.TokenKind.DOLLAR||e===w.TokenKind.AMP||e===w.TokenKind.PAREN_L||e===w.TokenKind.PAREN_R||e===w.TokenKind.SPREAD||e===w.TokenKind.COLON||e===w.TokenKind.EQUALS||e===w.TokenKind.AT||e===w.TokenKind.BRACKET_L||e===w.TokenKind.BRACKET_R||e===w.TokenKind.BRACE_L||e===w.TokenKind.PIPE||e===w.TokenKind.BRACE_R};class n{constructor(e){const t=new v.Token(w.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==w.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=c(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===w.TokenKind.COMMENT);return e}}function i(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function r(e,t){return s(e.charCodeAt(t))&&o(e.charCodeAt(t+1))}function s(e){return e>=55296&&e<=56319}function o(e){return e>=56320&&e<=57343}function u(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return w.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function a(e,t,n,i,r){return new v.Token(t,n,i,e.line,1+n-e.lineStart,r)}function c(e,t){const n=e.source.body,s=n.length;let o=t;for(;o<s;){const t=n.charCodeAt(o);switch(t){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return l(e,o);case 33:return a(e,w.TokenKind.BANG,o,o+1);case 36:return a(e,w.TokenKind.DOLLAR,o,o+1);case 38:return a(e,w.TokenKind.AMP,o,o+1);case 40:return a(e,w.TokenKind.PAREN_L,o,o+1);case 41:return a(e,w.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return a(e,w.TokenKind.SPREAD,o,o+3);break;case 58:return a(e,w.TokenKind.COLON,o,o+1);case 61:return a(e,w.TokenKind.EQUALS,o,o+1);case 64:return a(e,w.TokenKind.AT,o,o+1);case 91:return a(e,w.TokenKind.BRACKET_L,o,o+1);case 93:return a(e,w.TokenKind.BRACKET_R,o,o+1);case 123:return a(e,w.TokenKind.BRACE_L,o,o+1);case 124:return a(e,w.TokenKind.PIPE,o,o+1);case 125:return a(e,w.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?T(e,o):p(e,o)}if((0,y.isDigit)(t)||45===t)return h(e,o,t);if((0,y.isNameStart)(t))return D(e,o);throw(0,d.syntaxError)(e.source,o,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(t)||r(n,o)?`Unexpected character: ${u(e,o)}.`:`Invalid character: ${u(e,o)}.`)}return a(e,w.TokenKind.EOF,s,s)}function l(e,t){const n=e.source.body,s=n.length;let o=t+1;for(;o<s;){const e=n.charCodeAt(o);if(10===e||13===e)break;if(i(e))++o;else{if(!r(n,o))break;o+=2}}return a(e,w.TokenKind.COMMENT,t,o,n.slice(t+1,o))}function h(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,y.isDigit)(s))throw(0,d.syntaxError)(e.source,r,`Invalid number, unexpected digit after 0: ${u(e,r)}.`)}else r=f(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=f(e,r,s),s=i.charCodeAt(r)),46===s||(0,y.isNameStart)(s))throw(0,d.syntaxError)(e.source,r,`Invalid number, expected digit but got: ${u(e,r)}.`);return a(e,o?w.TokenKind.FLOAT:w.TokenKind.INT,t,r,i.slice(t,r))}function f(e,t,n){if(!(0,y.isDigit)(n))throw(0,d.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${u(e,t)}.`);const i=e.source.body;let r=t+1;for(;(0,y.isDigit)(i.charCodeAt(r));)++r;return r}function p(e,t){const n=e.source.body,s=n.length;let o=t+1,c=o,l="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return l+=n.slice(c,o),a(e,w.TokenKind.STRING,t,o+1,l);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,d.syntaxError)(e.source,o,`Invalid character within String: ${u(e,o)}.`);o+=2}}else{l+=n.slice(c,o);const t=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?m(e,o):g(e,o):S(e,o);l+=t.value,o+=t.size,c=o}}throw(0,d.syntaxError)(e.source,o,"Unterminated string.")}function m(e,t){const n=e.source.body;let r=0,s=3;for(;s<12;){const e=n.charCodeAt(t+s++);if(125===e){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|E(e),r<0)break}throw(0,d.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function g(e,t){const n=e.source.body,r=O(n,t+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=O(n,t+8);if(o(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,d.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function O(e,t){return E(e.charCodeAt(t))<<12|E(e.charCodeAt(t+1))<<8|E(e.charCodeAt(t+2))<<4|E(e.charCodeAt(t+3))}function E(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function S(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,d.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function T(e,t){const n=e.source.body,s=n.length;let o=e.lineStart,c=t+3,l=c,h="";const f=[];for(;c<s;){const s=n.charCodeAt(c);if(34===s&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){h+=n.slice(l,c),f.push(h);const i=a(e,w.TokenKind.BLOCK_STRING,t,c+3,(0,b.dedentBlockStringLines)(f).join("\n"));return e.line+=f.length-1,e.lineStart=o,i}if(92!==s||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==s&&13!==s)if(i(s))++c;else{if(!r(n,c))throw(0,d.syntaxError)(e.source,c,`Invalid character within String: ${u(e,c)}.`);c+=2}else h+=n.slice(l,c),f.push(h),13===s&&10===n.charCodeAt(c+1)?c+=2:++c,h="",l=c,o=c;else h+=n.slice(l,c),l=c+1,c+=4}throw(0,d.syntaxError)(e.source,c,"Unterminated string.")}function D(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(!(0,y.isNameContinue)(e))break;++r}return a(e,w.TokenKind.NAME,t,r,n.slice(t,r))}t.Lexer=n})),O=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}})),E=s((function(e,t){function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const i=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,i)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const i=Math.min(10,e.length),r=e.length-i,s=[];for(let r=0;r<i;++r)s.push(n(e[r],t));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(e,i);return function(e,t){const i=Object.entries(e);if(0===i.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=i.map((([e,i])=>e+": "+n(i,t)));return"{ "+r.join(", ")+" }"}(e,i)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}})),S=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0,t.instanceOf=function(e,t){return e instanceof t}})),T=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,S.instanceOf)(e,n)};class n{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,O.devAssert)(!1,`Body must be a string. Received: ${(0,E.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,O.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,O.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=n})),D=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new n(e,t).parseDocument()},t.parseConstValue=function(e,t){const i=new n(e,t);i.expectToken(w.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(w.TokenKind.EOF),r},t.parseType=function(e,t){const i=new n(e,t);i.expectToken(w.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(w.TokenKind.EOF),r},t.parseValue=function(e,t){const i=new n(e,t);i.expectToken(w.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(w.TokenKind.EOF),r};class n{constructor(e,t={}){const n=(0,T.isSource)(e)?e:new T.Source(e);this._lexer=new g.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(w.TokenKind.NAME);return this.node(e,{kind:m.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m.Kind.DOCUMENT,definitions:this.many(w.TokenKind.SOF,this.parseDefinition,w.TokenKind.EOF)})}parseDefinition(){if(this.peek(w.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===w.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,d.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(w.TokenKind.BRACE_L))return this.node(e,{kind:m.Kind.OPERATION_DEFINITION,operation:v.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(w.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:m.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(w.TokenKind.NAME);switch(e.value){case"query":return v.OperationTypeNode.QUERY;case"mutation":return v.OperationTypeNode.MUTATION;case"subscription":return v.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(w.TokenKind.PAREN_L,this.parseVariableDefinition,w.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:m.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(w.TokenKind.DOLLAR),this.node(e,{kind:m.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:m.Kind.SELECTION_SET,selections:this.many(w.TokenKind.BRACE_L,this.parseSelection,w.TokenKind.BRACE_R)})}parseSelection(){return this.peek(w.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,i;return this.expectOptionalToken(w.TokenKind.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:m.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(w.TokenKind.PAREN_L,e?this.parseConstArgument:this.parseArgument,w.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(w.TokenKind.COLON),this.node(t,{kind:m.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(w.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(w.TokenKind.NAME)?this.node(e,{kind:m.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:m.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:m.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:m.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case w.TokenKind.BRACKET_L:return this.parseList(e);case w.TokenKind.BRACE_L:return this.parseObject(e);case w.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:m.Kind.INT,value:t.value});case w.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:m.Kind.FLOAT,value:t.value});case w.TokenKind.STRING:case w.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case w.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:m.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:m.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:m.Kind.NULL});default:return this.node(t,{kind:m.Kind.ENUM,value:t.value})}case w.TokenKind.DOLLAR:if(e){if(this.expectToken(w.TokenKind.DOLLAR),this._lexer.token.kind===w.TokenKind.NAME)throw(0,d.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:m.Kind.STRING,value:e.value,block:e.kind===w.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:m.Kind.LIST,values:this.any(w.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),w.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:m.Kind.OBJECT,fields:this.any(w.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),w.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(w.TokenKind.COLON),this.node(t,{kind:m.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(w.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(w.TokenKind.AT),this.node(t,{kind:m.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(w.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(w.TokenKind.BRACKET_R),t=this.node(e,{kind:m.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(w.TokenKind.BANG)?this.node(e,{kind:m.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:m.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(w.TokenKind.STRING)||this.peek(w.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(w.TokenKind.BRACE_L,this.parseOperationTypeDefinition,w.TokenKind.BRACE_R);return this.node(e,{kind:m.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(w.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:m.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:m.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:m.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(w.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(w.TokenKind.BRACE_L,this.parseFieldDefinition,w.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(w.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:m.Kind.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(w.TokenKind.PAREN_L,this.parseInputValueDef,w.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(w.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(w.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:m.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:m.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:m.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(w.TokenKind.EQUALS)?this.delimitedMany(w.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:m.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(w.TokenKind.BRACE_L,this.parseEnumValueDefinition,w.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:m.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,d.syntaxError)(this._lexer.source,this._lexer.token.start,`${i(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:m.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(w.TokenKind.BRACE_L,this.parseInputValueDef,w.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===w.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(w.TokenKind.BRACE_L,this.parseOperationTypeDefinition,w.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:m.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:m.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:m.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:m.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:m.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:m.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:m.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(w.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:m.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(w.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(p.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new v.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,d.syntaxError)(this._lexer.source,t.start,`Expected ${r(e)}, found ${i(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==w.TokenKind.NAME||t.value!==e)throw(0,d.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${i(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===w.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,d.syntaxError)(this._lexer.source,t.start,`Unexpected ${i(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==w.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,d.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function i(e){const t=e.value;return r(e.kind)+(null!=t?` "${t}"`:"")}function r(e){return(0,g.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=n})),j=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(e){return r[e.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]})),I=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=i,t.getVisitFn=function(e,t,n){const{enter:r,leave:s}=i(e,t);return n?s:r},t.visit=function(e,t,r=v.QueryDocumentKeys){const s=new Map;for(const e of Object.values(m.Kind))s.set(e,i(t,e));let o,u,a,c=Array.isArray(e),l=[e],h=-1,f=[],d=e;const p=[],y=[];do{h++;const e=h===l.length,i=e&&0!==f.length;if(e){if(u=0===y.length?void 0:p[p.length-1],d=a,a=y.pop(),i)if(c){d=d.slice();let e=0;for(const[t,n]of f){const i=t-e;null===n?(d.splice(i,1),e++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of f)d[e]=t}h=o.index,l=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(a){if(u=c?h:l[h],d=a[u],null==d)continue;p.push(u)}let m;if(!Array.isArray(d)){var b,w;(0,v.isNode)(d)||(0,O.devAssert)(!1,`Invalid AST Node: ${(0,E.inspect)(d)}.`);const i=e?null===(b=s.get(d.kind))||void 0===b?void 0:b.leave:null===(w=s.get(d.kind))||void 0===w?void 0:w.enter;if(m=null==i?void 0:i.call(t,d,u,a,p,y),m===n)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(f.push([u,m]),!e)){if(!(0,v.isNode)(m)){p.pop();continue}d=m}}var g;void 0===m&&i&&f.push([u,d]),e?p.pop():(o={inArray:c,index:h,keys:l,edits:f,prev:o},c=Array.isArray(d),l=c?d:null!==(g=r[d.kind])&&void 0!==g?g:[],h=-1,f=[],a&&y.push(a),a=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),r=Object.create(null);for(const s of Object.values(m.Kind)){let o=!1;const u=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:r}=i(e[t],s);o||(o=null!=n||null!=r),u[t]=n,a[t]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const a=null===(s=u[o])||void 0===s?void 0:s.apply(e[o],i);if(!1===a)t[o]=r;else if(a===n)t[o]=n;else if(void 0!==a)return a}},leave(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const r=null===(s=a[o])||void 0===s?void 0:s.apply(e[o],i);if(r===n)t[o]=n;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}})}return r};const n=Object.freeze({});function i(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=n})),x=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,I.visit)(e,n)};const n={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>i(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=s("(",i(e.variableDefinitions,", "),")"),n=i([e.operation,i([e.name,t]),i(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:e})=>r(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:u}){const a=s("",e,": ")+t;let c=a+s("(",i(n,", "),")");return c.length>80&&(c=a+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),u]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+s(" ",i(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>i(["...",s("on ",e),i(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${e}${s("(",i(n,", "),")")} on ${t} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,b.printBlockString)(e):(0,j.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+i(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+i(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+s("(",i(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>s("",e,"\n")+i(["schema",i(t," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i(["scalar",t,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:u})=>s("",e,"\n")+i(["type",t,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:a})=>s("",e,"\n")+t+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(a," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>s("",e,"\n")+i([t+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:u})=>s("",e,"\n")+i(["interface",t,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>s("",e,"\n")+i(["union",t,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:o})=>s("",e,"\n")+i(["enum",t,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i([t,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:o})=>s("",e,"\n")+i(["input",t,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:a})=>s("",e,"\n")+"directive @"+t+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>i(["extend schema",i(e," "),r(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>i(["extend scalar",e,i(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend type",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend interface",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>i(["extend union",e,i(t," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>i(["extend enum",e,i(t," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>i(["extend input",e,i(t," "),r(n)]," ")}};function i(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function r(e){return s("{\n",o(i(e,"\n")),"\n}")}function s(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function o(e){return s(" ",e.replace(/\n/g,"\n "))}function u(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}})),k=function(e){var t=e.name,n=e.type;this.uri=e.uri,this.name=t,this.type=n},N=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof k},A=function e(t,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=N);var s=new Map;function o(e,t){var n=s.get(t);n?n.push.apply(n,e):s.set(t,e)}if(i(t))r=null,o([n],t);else{var u=n?n+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)r=Array.prototype.map.call(t,(function(e,t){return o([""+u+t],e),null}));else if(Array.isArray(t))r=t.map((function(t,n){var r=e(t,""+u+n,i);return r.files.forEach(o),r.clone}));else if(t&&t.constructor===Object)for(var a in r={},t){var c=e(t[a],""+u+a,i);c.files.forEach(o),r[a]=c.clone}else r=t}return{clone:r,files:s}},_=N,$="object"==typeof self?self.FormData:window.FormData,F=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),P=s((function(e,t){var n=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n($),r=function(e){return _(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,n,s){void 0===s&&(s=F.defaultJsonSerializer);var o=A({query:e,variables:t,operationName:n},"",r),u=o.clone,a=o.files;if(0===a.size){if(!Array.isArray(e))return s.stringify(u);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var c=e.reduce((function(e,n,i){return e.push({query:n,variables:t?t[i]:void 0}),e}),[]);return s.stringify(c)}var l=new("undefined"==typeof FormData?i.default:FormData);l.append("operations",s.stringify(u));var h={},f=0;return a.forEach((function(e){h[++f]=e})),l.append("map",s.stringify(h)),f=0,a.forEach((function(e,t){l.append(""+ ++f,t)})),l}})),U=s((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}},t.parseRawRequestArgs=function(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,n,i){return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,n,i){return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}})),q=s((function(e,t){var n,i=o&&o.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var r=function(e){function t(n,i){var r=this,s=t.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=e.call(this,s)||this,Object.setPrototypeOf(r,t.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return i(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=r})),C=s((function(e,t){var n=o&&o.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},i=o&&o.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{a(i.next(e))}catch(e){s(e)}}function u(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,u)}a((i=i.apply(e,t||[])).next())}))},r=o&&o.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=void 0;var s="ping",u="pong",a="complete",c=function(){function e(e,t,n){this._type=e,this._payload=t,this._id=n}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){var e={type:this.type};return null!=this.id&&null!=this.id&&(e.id=this.id),null!=this.payload&&null!=this.payload&&(e.payload=this.payload),JSON.stringify(e)},enumerable:!1,configurable:!0}),e.parse=function(t,n){var i=JSON.parse(t),r=i.id;return new e(i.type,n(i.payload),r)},e}(),l=function(){function e(e,t){var o=this,l=t.onInit,d=t.onAcknowledged,v=t.onPing,p=t.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=function(){return i(o,void 0,void 0,(function(){var t,n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},n=(t=e).send,i=h,l?[4,l()]:[3,2];case 1:return s=r.sent(),[3,3];case 2:s=null,r.label=3;case 3:return n.apply(t,[i.apply(void 0,[s]).text]),[2]}}))}))},e.onclose=function(){o.socketState.acknowledged=!1,o.socketState.subscriptions={}},e.onerror=function(e){console.error(e)},e.onmessage=function(t){try{var i=(void 0===y&&(y=function(e){return e}),c.parse(t.data,y));switch(i.type){case"connection_ack":return void(o.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(o.socketState.acknowledged=!0,d&&d(i.payload)));case s:return void(v?v(i.payload).then((function(t){return e.send(f(t).text)})):e.send(f(null).text));case u:return void(p&&p(i.payload))}if(!o.socketState.acknowledged)return;if(null==i.id||!o.socketState.subscriptions[i.id])return;var r=o.socketState.subscriptions[i.id],l=r.query,h=r.variables,m=r.subscriber;switch(i.type){case"next":return!i.payload.errors&&i.payload.data&&m.next&&m.next(i.payload.data),void(i.payload.errors&&m.error&&m.error(new q.ClientError(n(n({},i.payload),{status:200}),{query:l,variables:h})));case"error":return void(m.error&&m.error(new q.ClientError({errors:i.payload,status:200},{query:l,variables:h})));case a:return m.complete&&m.complete(),void delete o.socketState.subscriptions[i.id]}}catch(t){console.error(t),e.close(1006)}var y;e.close(4400,"Unknown graphql-ws message.")}}return e.prototype.makeSubscribe=function(e,t,n,i){var r,s,o=this,u=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[u]={query:e,variables:n,subscriber:i},this.socket.send((r=u,s={query:e,operationName:t,variables:n},new c("subscribe",s,r)).text),function(){o.socket.send(function(e){return new c(a,void 0,e)}(u).text),delete o.socketState.subscriptions[u]}},e.prototype.rawRequest=function(e,t){var n=this;return new Promise((function(i,r){var s;n.rawSubscribe(e,{next:function(e,t){return s={data:e,extensions:t}},error:r,complete:function(){return i(s)}},t)}))},e.prototype.request=function(e,t){var n=this;return new Promise((function(i,r){var s;n.subscribe(e,{next:function(e){return s=e},error:r,complete:function(){return i(s)}},t)}))},e.prototype.subscribe=function(e,t,n){var i=V.resolveRequestDocument(e);return this.makeSubscribe(i.query,i.operationName,n,t)},e.prototype.rawSubscribe=function(e,t,n){return this.makeSubscribe(e,void 0,n,t)},e.prototype.ping=function(e){this.socket.send(function(e){return new c(s,e,void 0)}(e).text)},e.prototype.close=function(){this.socket.close(1e3)},e.PROTOCOL="graphql-transport-ws",e}();function h(e){return new c("connection_init",e)}function f(e){return new c(u,e,void 0)}t.GraphQLWebSocketClient=l})),V=s((function(e,t){var n=o&&o.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},i=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=o&&o.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=o&&o.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},a=o&&o.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{a(i.next(e))}catch(e){s(e)}}function u(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,u)}a((i=i.apply(e,t||[])).next())}))},c=o&&o.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},l=o&&o.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},h=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=t.gql=t.resolveRequestDocument=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var f=s(u),d=f,v=h(P);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return q.ClientError}});var p=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof d.Headers?t=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){t[e[0]]=e[1]})):t=e),t},m=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},y=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,o=e.headers,u=e.fetch,l=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=v.default(i,r,s,l.jsonSerializer),[4,u(t,n({method:"POST",headers:n(n({},"string"==typeof e?{"Content-Type":"application/json"}:{}),o),body:e},l))];case 1:return[2,a.sent()]}}))}))},b=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,o=e.headers,u=e.fetch,l=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=function(e){var t=e.query,n=e.variables,i=e.operationName,r=e.jsonSerializer;if(!Array.isArray(t)){var s=["query="+encodeURIComponent(m(t))];return n&&s.push("variables="+encodeURIComponent(r.stringify(n))),i&&s.push("operationName="+encodeURIComponent(i)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,i){return e.push({query:m(t),variables:n?r.stringify(n[i]):void 0}),e}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:i,variables:r,operationName:s,jsonSerializer:l.jsonSerializer}),[4,u(t+"?"+e,n({method:"GET",headers:o},l))];case 1:return[2,a.sent()]}}))}))},w=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,i){return a(this,void 0,void 0,(function(){var r,s,o,u,a,h,d,v,m,y;return c(this,(function(){return r=U.parseRawRequestArgs(e,t,i),o=(s=this.options).headers,a=void 0===(u=s.fetch)?f.default:u,d=void 0===(h=s.method)?"POST":h,v=l(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(v.signal=r.signal),y=T(r.query).operationName,[2,g({url:m,query:r.query,variables:r.variables,headers:n(n({},p(j(o))),p(r.requestHeaders)),operationName:y,fetch:a,method:d,fetchOptions:v})]}))}))},e.prototype.request=function(e,t,i){return a(this,void 0,void 0,(function(){var r,s,o,u,a,h,d,v,m,y,b;return c(this,(function(c){switch(c.label){case 0:return r=U.parseRequestArgs(e,t,i),o=(s=this.options).headers,a=void 0===(u=s.fetch)?f.default:u,d=void 0===(h=s.method)?"POST":h,v=l(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(v.signal=r.signal),y=T(r.document),b=y.operationName,[4,g({url:m,query:y.query,variables:r.variables,headers:n(n({},p(j(o))),p(r.requestHeaders)),operationName:b,fetch:a,method:d,fetchOptions:v})];case 1:return[2,c.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return a(this,void 0,void 0,(function(){var i,r,s,o,u,a,h,d,v,m,y;return c(this,(function(c){switch(c.label){case 0:return i=U.parseBatchRequestArgs(e,t),s=(r=this.options).headers,u=void 0===(o=r.fetch)?f.default:o,h=void 0===(a=r.method)?"POST":a,d=l(r,["headers","fetch","method"]),v=this.url,void 0!==i.signal&&(d.signal=i.signal),m=i.documents.map((function(e){return T(e.document).query})),y=i.documents.map((function(e){return e.variables})),[4,g({url:v,query:m,variables:y,headers:n(n({},p(j(s))),p(i.requestHeaders)),operationName:void 0,fetch:u,method:h,fetchOptions:d})];case 1:return[2,c.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var n,i=this.options.headers;return i?i[e]=t:this.options.headers=((n={})[e]=t,n),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function g(e){var t=e.url,i=e.query,r=e.variables,s=e.headers,o=e.operationName,u=e.fetch,h=e.method,f=void 0===h?"POST":h,d=e.fetchOptions;return a(this,void 0,void 0,(function(){var e,a,h,v,p,m,w,g,O,S;return c(this,(function(c){switch(c.label){case 0:return e="POST"===f.toUpperCase()?y:b,a=Array.isArray(i),[4,e({url:t,query:i,variables:r,operationName:o,headers:s,fetch:u,fetchOptions:d})];case 1:return[4,E(h=c.sent(),d.jsonSerializer)];case 2:if(v=c.sent(),p=a&&Array.isArray(v)?!v.some((function(e){return!e.data})):!!v.data,m=!v.errors||"all"===d.errorPolicy||"ignore"===d.errorPolicy,h.ok&&m&&p)return w=h.headers,g=h.status,O=l(v,["errors"]),S="ignore"===d.errorPolicy?O:v,[2,n(n({},a?{data:S}:S),{headers:w,status:g})];throw new q.ClientError(n(n({},"string"==typeof v?{error:v}:v),{status:h.status,headers:h.headers}),{query:i,variables:r})}}))}))}function O(e,t,i,r){return a(this,void 0,void 0,(function(){var s;return c(this,(function(){return s=U.parseRequestExtendedArgs(e,t,i,r),[2,new w(s.url).request(n({},s))]}))}))}function E(e,t){return void 0===t&&(t=F.defaultJsonSerializer),a(this,void 0,void 0,(function(){var n,i,r;return c(this,(function(s){switch(s.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(n=e)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=t).parse,[4,e.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,e.text()]}}))}))}function S(e){var t,n=void 0,i=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===i.length&&(n=null===(t=i[0].name)||void 0===t?void 0:t.value),n}function T(e){if("string"==typeof e){var t=void 0;try{t=S(D.parse(e))}catch(e){}return{query:e,operationName:t}}var n=S(e);return{query:x.print(e),operationName:n}}function j(e){return"function"==typeof e?e():e}t.GraphQLClient=w,t.rawRequest=function(e,t,i,r){return a(this,void 0,void 0,(function(){var s;return c(this,(function(){return s=U.parseRawRequestExtendedArgs(e,t,i,r),[2,new w(s.url).rawRequest(n({},s))]}))}))},t.request=O,t.batchRequests=function(e,t,i){return a(this,void 0,void 0,(function(){var r;return c(this,(function(){return r=U.parseBatchRequestsExtendedArgs(e,t,i),[2,new w(r.url).batchRequests(n({},r))]}))}))},t.default=O,t.resolveRequestDocument=T,t.gql=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.reduce((function(e,n,i){return""+e+n+(i in t?t[i]:"")}),"")},Object.defineProperty(t,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return C.GraphQLWebSocketClient}})}));class L{static getQueryParams(e){const t=new Map,n=/[?&]?([^=]+)=([^&]*)/g;let i;for(e=(e=window.unescape(e)).split("+").join(" ");i=n.exec(e);)t.set(window.decodeURIComponent(i[1]),i[2]);return t.set("urlBase",this.getUrlBase()),window.moduleID&&window.URIServiceBroker&&(t.set("moduleID",window.moduleID),t.set("URIServiceBroker",window.URIServiceBroker)),t}static getUrlBase(){return window.mock_url?window.mock_url:`${location.protocol}//${location.hostname}${location.port?":"+location.port:""}`}}class M{constructor(e,t,n,i){this.serviceName=e,this.requestBody=t,this.successCallback=n,this.errorCallback=i}reCall(e){return e&&(this.requestBody=e),G.get().callServiceBroker(this.serviceName,this.requestBody).then(this.successCallback,this.errorCallback)}}class R{constructor(e,t,n){this.req=e,this.resolve=t,this.reject=n}putVariable(e,t){this.req.values[e]=t}reCall(){return G.get().callGraphQL(this.req).then(this.resolve,this.reject)}}class B{constructor(){}static getInstance(){return B.instance||(B.instance=new B),B.instance}async processPendingPrinting(e){await this.findPendingPrints(e)}async findPendingPrints(e){const t={transactionIds:[{transactionId:{$:e}}]},n=await G.get().callServiceBroker(B.SERVICE_FIND_PENDING_PRINTS,JSON.stringify(t)),i=this.parsePrintData(n);this.openSnkPrintSelector(i)}findLocalPrinters(){const e=document.getElementById("centralNotaAppletImpressao");if(!e)return[];const t=e.getLocalPrinters();if(!t)return[];const n=[];for(const e of t.split(","))n.push({nome:e,printerUri:B.LOCAL_SERVER_URI+e,isLocal:!0});return n}getLocalPrinters(){return this.findLocalPrinters()}parsePrintData(e){const t=e.pendindPrintJobData;if(!t)return;let{printServers:{printServer:n},pendingPrinters:{pendingPrinter:i}}=t;n=n?Array.isArray(n)?n:[n]:[],i=i?Array.isArray(i)?i:[i]:[];const r=n.map((e=>{const t=Array.isArray(e.printerLocation)?e.printerLocation:[e.printerLocation];return{printServerUri:e.printServerUri,printerList:t.map(this.normalize)}})),s=i.map(this.normalize);return{transactionId:t.transactionId.$,printServers:r,pendingPrinters:s,printServerActive:"true"===t.printServers.printServerActive}}normalize(e){const t={};return Object.keys(e).forEach((n=>{t[n]=B.ENCODED_PROPERTIES.includes(n)?window.atob(e[n].$):e[n].$})),t}processLocalPrinting(e){const t=e.map((e=>e.transactionId));this.doLocalPrinting(t.join())}doLocalPrinting(e){const t=document.getElementById("centralNotaAppletImpressao");t&&t.doLocalPrinting(e)}async openSnkPrintSelector(t){let n=document.querySelector("snk-print-selector");n||(n=document.createElement("snk-print-selector"),n.setAttribute("id",e.generateUUID()),window.document.body.appendChild(n));const i=await n.openPrintSelector(t);i&&await this.saveSubstitutePrinter(t.transactionId,t.pendingPrinters,i)}async saveSubstitutePrinter(e,t,n){const i={substitutePrintersRequest:{substitutePrinters:{pendingPrinter:t.map((e=>({printerUri:{$:n.printerUri},originalPrinterName:{$:e.originalPrinterName},printJobCount:{$:e.printJobCount},docType:{$:e.docType},docTypeDescription:{$:e.docTypeDescription}})))},saveSubstitutePrinters:{$:"false"},transactionId:{$:e}}};await G.get().callServiceBroker(B.SERVICE_SAVE_SUBSTITUTE_PRINTER,JSON.stringify(i))}}B.SERVICE_FIND_PENDING_PRINTS="mge@PrintServiceSP.findPendingPrinters",B.SERVICE_SAVE_SUBSTITUTE_PRINTER="mge@PrintServiceSP.saveSubstitutePrinter",B.LOCAL_SERVER_URI="LOCAL:0/",B.ENCODED_PROPERTIES=["printerName","printerUri"];class G{constructor(){this.GRAPHQL_PATH="/mgefin-bff/graphql",this.watingRequestsById=new Map}static get(){if(!G.instance){G.instance=new G;const e=document.querySelector(this.appTagName);null===e?G.instance.resume():(e.addEventListener("applicationLoading",(()=>G.instance.pause())),e.addEventListener("applicationLoaded",(()=>G.instance.resume())))}return this.instance.application=t.getContextValue("__SNK__APPLICATION__"),this.instance}static addRequestListener(e){G.requestListener.indexOf(e)<0&&G.requestListener.push(e)}static removeRequestListener(e){const t=G.requestListener.indexOf(e);t>-1&&G.requestListener.splice(t,1)}processGraphQlErrorInfo(e){var t,r;const s="Falha detectada",o=e[0];if(o.length>0){const e=o[0],u=(null==e?void 0:e.message)?null==e?void 0:e.message:"Não há mensagem de erro",a=(null===(t=null==e?void 0:e.extensions)||void 0===t?void 0:t.level)?e.extensions.level:"ERROR",c=(null===(r=null==e?void 0:e.extensions)||void 0===r?void 0:r.code)?e.extensions.code:"";return"WARNING"===a?new i(s,u,c):new n(s,u,c)}return new n(s,"Não há informações sobre o erro")}processServiceBrokerErrorInfo(e){const t="Falha detectada";let r,s,{statusMessage:o,tsError:u}=e||{};return o||(o="Não há informações sobre o erro"),u&&(r=u.tsErrorCode,s=u.tsErrorLevel),"WARNING"===s?new i(t,o,r):new n(t,o,r)}async callGraphQL(e){var t;const n=this.getReqKey(e);if(e.queryID=n,e.values.queryID=n,G.clientEventsByID){e.values.registeredEventListeners=[];for(let[t]of G.clientEventsByID)e.values.registeredEventListeners.push(t)}return this.ready?new Promise((async(t,i)=>{let r=this.getQueryTemplate(e);const s=await this.fecthGrapql([{document:r,variables:e.values}]);s.errors.length>0?this.proccesGraphQLClientEvents(null==s?void 0:s.extensions,e,t,i)||i(this.processGraphQlErrorInfo(s.errors)):(t(s.data[0][n]),this.proccesGraphQLClientEvents(null==s?void 0:s.extensions,e,t,i))})):(this.watingRequestsById.has(n)||this.watingRequestsById.set(n,new J(e)),null===(t=this.getWatingRequest(n))||void 0===t?void 0:t.promise)}resolveURL(){return L.getUrlBase()}proccesGraphQLClientEvents(e,t,n,r){if(null==e)return!1;for(const s in e){const{clientEvents:o}=e[s];if(!o)return!1;for(const e in o){if(!G.hasClientEvent(e))throw console.warn(`Client event ${e} not registered`),new i("ClientEvent não registrado",`Ocorreu o client event ${e} porém não há client event registrado na aplicação.`);G.clientEventsByID.get(e).forEach((i=>{i({id:e,content:JSON.parse(o[e])},new R(t,n,r))}))}return Object.keys(o).length>0}return!1}proccessServiceBorkerClientEvents(e,t,n,i,r){(null==e?void 0:e.length)&&e.forEach((e=>{G.hasClientEvent(e.id)&&G.clientEventsByID.get(e.id).forEach((s=>{s({id:e.id,content:e},new M(t,n,i,r))}))}))}processPrinting(e){"true"===(null==e?void 0:e.pendingPrinting)&&B.getInstance().processPendingPrinting(null==e?void 0:e.transactionId),"localPrintings"in e&&B.getInstance().processLocalPrinting(null==e?void 0:e.localPrintings)}getContext(e){var t;const n=L.getQueryParams(location.search);return{baseUrl:`${this.resolveURL()}/${e}/service.sbr`,appName:"SankhyaBlocks",mgeSession:`${window.mgeSession||n.get("mgeSession")}`,globalID:"85C0093DFA240EAB699B4E47A10215BD",resourceID:window.resourceID||(null===(t=window.workspace)||void 0===t?void 0:t.resourceID)}}async callServiceBroker(e,t){return new Promise(((i,s)=>{const o=e.split("@"),[u,a]=2===o.length?o:["mge",e],c=this.getContext(u),l=`${c.baseUrl}?serviceName=${a}&counter=21&application=${c.appName}&outputType=json&preventTransform=false&mgeSession=${c.mgeSession}&resourceID=${c.resourceID}&globalID=${c.globalID}&allowConcurrentCalls=true`;document.cookie=`JSESSIONID=${c.mgeSession};`;const h=new XMLHttpRequest;var f={};"string"==typeof t&&(t=r.stringToObject(t)),t.hasOwnProperty("requestBody")?f=t:f.requestBody=t;for(let[e]of G.clientEventsByID)f.requestBody.hasOwnProperty("clientEventList")||(f.requestBody.clientEventList={clientEvent:[]}),f.requestBody.clientEventList.clientEvent.push({$:e});G.requestListener.forEach((e=>e.onRequestStart({url:l,requestBody:t}))),h.open("POST",l,!0),h.withCredentials=!0,h.send(r.objectToString(f)),h.onreadystatechange=()=>{var r;if(4==h.readyState&&200==h.status)try{const t=JSON.parse(h.responseText);this.isServiceBrokerError(t)?s(this.processServiceBrokerErrorInfo(t)):t.status==G.SERVICE_BROKER_STATUS.SERVICE_CANCELED&&t.statusMessage?console.debug(`[DataFetcher] ${t.statusMessage}`):(i(t.responseBody),t.status==G.SERVICE_BROKER_STATUS.INFO&&(null===(r=this.application)||void 0===r||r.info(t.statusMessage))),this.proccessServiceBorkerClientEvents(null==t?void 0:t.clientEvents,e,f,i,s),this.processPrinting(t)}catch(e){console.warn(`Erro ao executar serviço: ${e}`),s(new n("Erro ao executar serviço",e))}else 4==h.readyState&&200!=h.status&&s(new n(`Erro ao executar serviço: ${e}`,h.responseText));G.requestListener.forEach((e=>e.onRequestEnd({url:l,requestBody:t})))}}))}isServiceBrokerError(e){return!e.hasOwnProperty("status")||e.status==G.SERVICE_BROKER_STATUS.ERROR||e.status==G.SERVICE_BROKER_STATUS.TIMEOUT}getReqKey(t){return window.btoa(e.hashCode(`${t.query}${JSON.stringify(t.values||"")}`)).replace(/=/g,"")}getQueryTemplate(e){return(e.query||"").replaceAll("$queryAlias$",e.queryID)}getWatingRequest(e){return this.watingRequestsById.get(e)}pause(){this.ready=!1}async resume(){if(this.ready=!0,this.watingRequestsById.size>0){const e=[];let t;this.watingRequestsById.forEach((async t=>{let n=this.getQueryTemplate(t.request);e.push({document:n,variables:Object.assign({},t.request.values)})}));let i=[],r=[];t=await this.fecthGrapql(e),i=t.data,r=t.errors,r.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var i;((null===(i=this.getWatingRequest(t.request.variables[t.index].queryID))||void 0===i?void 0:i.reject)||Promise.reject)(new n("Falha detectada",t.message))}))})),i.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(e))||void 0===n?void 0:n.resolve)||Promise.resolve)(t)}))})),this.watingRequestsById.clear()}}async fecthGrapql(e){let t,i=[],r=[],s=`${this.resolveURL()+this.GRAPHQL_PATH}`;const o=[];window.mgeSession&&(s+=`?mgeSession=${window.mgeSession}`),G.requestListener.forEach((t=>t.onRequestStart({url:s,requestBody:e})));try{t=await V.batchRequests(s,e,{"Content-Type":`application/json; charset=${window.SERVER_ENCODING||"UTF-8"}`}),t.forEach(((t,n)=>{var s;(null===(s=null==t?void 0:t.errors)||void 0===s?void 0:s.length)>0?r.push(t.errors.map((t=>this.normalizeErrorResponse(t,e,n)))):i.push(t.data),t.extensions&&o.push(t.extensions)}))}catch(o){if(this.isHttpError(o))throw G.requestListener.forEach((t=>t.onRequestEnd({url:s,requestBody:e}))),new n("Falha de comunicação",o.message);{t=o.response;const e=o.request;Object.entries(t).forEach((([t,n])=>{n.errors?r.push(n.errors.map((n=>(n.request=e,n.index=Number(t),n)))):n.data&&i.push(n.data)}))}}return G.requestListener.forEach((t=>t.onRequestEnd({url:s,requestBody:e}))),{data:i,errors:r,extensions:o}}isHttpError(e){var t;return!e.response&&!e.request||(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)>=300}normalizeErrorResponse(e,t,n){const i=Object.assign({},t[n]),{variables:r}=i;return i.variables=[],i.variables[n]=r,e.request=i,e.index=Number(n),e}static addClientEvent(e,t){let n=G.clientEventsByID.get(e);if(null!=n){if(n.some((e=>e.toString()===t.toString())))return;n.push(t)}else G.clientEventsByID.set(e,[t])}static hasClientEvent(e){return G.clientEventsByID.has(e)}static removeClientEvent(e){return G.clientEventsByID.delete(e)}}G.appTagName="snk-application",G.requestListener=[],G.SERVICE_BROKER_STATUS={ERROR:0,INFO:2,OK:1,TIMEOUT:3,SERVICE_CANCELED:4},G.clientEventsByID=new Map;class J{constructor(e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=e,this._promisse=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}}export{G as D,B as P,L as U,V as d}
@@ -1 +0,0 @@
1
- var a;!function(a){a.AND="AND",a.OR="OR"}(a||(a={}));export{a as F}
@@ -1 +0,0 @@
1
- export{S as snk_guides_viewer}from"./p-eaec700d.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"./p-9a7aafe4.js";import"./p-e789eb2d.js";import"./p-814f9247.js";import"./p-2b449454.js";import"./p-112455b1.js";import"./p-60ad0dea.js";import"./p-744d0fd2.js";import"./p-584d7212.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-c2beb95c.js";import"./p-a2493d11.js";import"./p-5534e08c.js";import"./p-6dc031de.js";import"./p-4a78e118.js";import"./p-89fb7531.js";
@@ -1 +0,0 @@
1
- import{F as e}from"./p-584d7212.js";import{R as t}from"./p-60ad0dea.js";function i(t,r){if(null==t)return t;if(t instanceof Date)return t.toISOString();if("object"==typeof t){if(t instanceof Array)return t.map((t=>i(e.MULTI_LIST===r?function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]])}return i}(t,["label"]):t)));{const e=Object.assign({},t);return Object.keys(t).forEach((n=>{t[n]?e[n]=i(t[n],r):delete e[n]})),e}}return t}class r extends t{normalize(e){return e.map((e=>{const{id:t,value:r,fixed:n,visible:s,type:l,groupedItems:o}=e,u={id:t};if(r&&(u.value=i(r,l)),n&&(u.fixed=n),o){if(0===o.length)return;o.filter((e=>e.visible)).length>0&&(u.visible=!0),u.groupedItems=this.normalize(o)}else s&&(u.visible=!0);return u})).filter((e=>null!=e))}saveConfig(e,t,i){return this.saveResource(this.normalize(e),this.getPath(t,i))}getConfig(e,t){return new Promise(((i,r)=>{this.loadResource(this.getPath(e,t)).then((e=>{let t;if(e){const i=JSON.parse(e);t=this.buildFieldList(i.items)}i(t||[])})).catch((e=>{r(e)}))}))}saveEntityListConfig(e,t,r){return new Promise(((n,s)=>{this.getConfig(t,r).then((l=>{const o=l.map((({id:e,value:t,fixed:r,visible:n,type:s,groupedItems:l})=>Object.assign(Object.assign(Object.assign(Object.assign({id:e},t&&{value:i(t,s)}),r&&{fixed:r}),n&&{visible:!0}),{groupedItems:l}))),u=o.findIndex((({id:t})=>t===e.id)),f={id:e.id,value:i(e.value,e.type),fixed:e.fixed,visible:!0};u>-1?o[u]=f:o.push(f),this.saveResource(o,this.getPath(t,r)).then((e=>{n(e)})).catch((e=>{s(e)}))})).catch((e=>{s(e)}))}))}buildFieldList(t){return t.map((t=>{var i,r;if(t.type===e.MULTI_LIST){const e=t.value;t.value=null!==(r=null!==(i=null==e?void 0:e.elements)&&void 0!==i?i:null==e?void 0:e.members)&&void 0!==r?r:e}return t}))}getPath(e,t){return t?`cfg://filter/FilterBarState:${e}.${t}`:`cfg://filter/FilterBarState:${e}`}}export{r as F}
@@ -1 +0,0 @@
1
- import{DataType as t,NumberUtils as i,DateUtils as r,UserInterface as e}from"@sankhyalabs/core";import"./p-63bff2a8.js";import{F as n}from"./p-584d7212.js";var a,s,l,o;!function(t){t.SYSTEM_CONFIG="S",t.USER_CONFIG="E"}(a||(a={})),function(t){t.DATE="D",t.HORA="H",t.TEXT="S",t.INTEGER="I",t.DECIMAL="F",t.NUMBER="NUMBER"}(s||(s={})),function(t){t.AND="AND",t.OR="OR",t.IN="IN",t.DIFFERENT="<>",t.LIKE="LIKE",t.START_WITH="LIKE_START",t.FINISHED_WITH="LIKE_END",t.NULL="NULL",t.NOT_NULL="NOT NULL",t.EQUAL="=",t.LARGER=">",t.LARGER_EQUAL=">=",t.SMALLER="<",t.SMALLER_EQUAL="<="}(l||(l={})),function(t){t.FIELD="Campo",t.INSTANCE="Instancia"}(o||(o={}));class u{static buildFilterExpression(t,i=!1){if(null==t)return;if(!this.validateExpressionItem(t)&&i)return"";let r=this.buildVariableParameterValue(t),e=t.expression||"",n="'";switch(t.paramVariable&&(n=""),t.operand){case"IN":e+=` ${l[t.operand]} (${r})`;break;case"NULL":case"NOT_NULL":e+=` IS ${l[t.operand]}`;break;case"LIKE":e+=` LIKE '%${r}%'`;break;case"START_WITH":e+=` LIKE '${r}%'`;break;case"FINISHED_WITH":e+=` LIKE '%${r}'`;break;default:r="string"==typeof r?`${n}${r}${n}`:r,e+=` ${l[t.operand]} ${r}`}return e}static buildVariableParameterValue(r){var n;if(null!=r){if(r.paramVariable)return this.proccessVarialbeParameter(r);if(r.operand!==l.NULL&&"NOT_NULL"!==r.operand){let a=r.value;const s=r.type;return e.SEARCH!==r.userInterface&&t.OBJECT!=s||(a=null!==(n=null==a?void 0:a.value)&&void 0!==n?n:a),t.NUMBER==s&&null!=a?(a=i.stringToNumber(a),this.checkIsValidNumber(a)):t.DATE==s?a=this.convertDataValue(a):t.BOOLEAN==s&&(a=a?"S":"N"),a}return r.operand}}static checkIsValidNumber(t){if(isNaN(t))throw new Error("O valor informado não é um número válido.")}static proccessVarialbeParameter(t){if(null!=t.systemConfig){const i=t.systemConfig;return`?:{entidade=${i.entity||""};campo=${i.fieldName||""}}`}if(null!=t.userConfig){const i=t.userConfig;return`?:{desc=${i.description||""};tipo=${i.type||""}}`}return`?:{entidade=${t.entityName||""};campo=${t.fieldName||""}}`}static convertDataValue(t){return"string"==typeof t&&(t=new Date(t)),r.formatDate(t)}static buildGroupExpression(t,i=!1){var r,e;if(!(null===(r=null==t?void 0:t.items)||void 0===r?void 0:r.length))return"";const n=t.items.map((t=>this.buildFilterExpression(t,i))).join(` ${t.operand} `);if((null===(e=null==t?void 0:t.childrenGroups)||void 0===e?void 0:e.length)>0){const i=t.childrenGroups.map((t=>this.buildGroupExpression(t))).join(` ${t.operand} `);return`(${n} ${t.operand} (${i}))`}return`(${n})`}static validateFields(t){const i=this.buildPlainExpressionItems(t);for(const t of i)if(!this.validateExpressionItem(t))return!1;return!0}static buildPlainExpressionItems(t){const{items:i=[],childrenGroups:r=[]}=t||{},e=t=>t.reduce(((t,i)=>{var r;return i.items&&(t=t.concat(i.items)),(null===(r=i.childrenGroups)||void 0===r?void 0:r.length)&&(t=t.concat(e(i.childrenGroups))),t}),[]);return i.concat(e(r))}static validateExpressionItem(t){return Object.entries({fieldName:t=>!!t,value:(t,i)=>!!i||null!=t,operand:t=>!!t}).every((i=>{const[r,e]=i,n=t.paramVariable||"SWITCH"===t.userInterface||["NULL","NOT_NULL"].includes(t.operand);return e(t[r],n)}))}static getNormalizedValue(i,r){return i.reduce(((i,r,e)=>(r.dataType!==t.BOOLEAN||null!=i&&null!=i[e]||((i=i&&!Array.isArray(i)?[i]:i||[])[e]=!1),i)),r)}static validateVariableValues(i,r){if(!i)return!0;let e=r||i.value,a=!0;if(i.type===n.PERSONALIZED){const r=(i.groupedItems||[]).filter((t=>t.visible)).filter((t=>{var i,r,e;return!!(null===(e=null===(r=null===(i=t.props)||void 0===i?void 0:i.personalizedFilter)||void 0===r?void 0:r.parameters)||void 0===e?void 0:e.length)})),n=r.flatMap((t=>{var i;return null===(i=t.props.personalizedFilter)||void 0===i?void 0:i.parameters})),s=r.flatMap((i=>!(i.props.personalizedFilter.parameters[0].dataType===t.BOOLEAN)&&i.value));e=this.getNormalizedValue(n,e),a=n.length===s.length&&s.every((t=>null!=t))}return a}static buildVariableParameters(t){var i,r,e,n;const a=this.buildPlainExpressionItems(t),s=[];for(const t of a)t.paramVariable&&s.push({entityName:t.entityName,fieldName:t.fieldName,dataType:t.type,description:t.description,userInterface:t.userInterface,label:t.fieldLabel,searchContext:{entity:null===(r=null===(i=t.props)||void 0===i?void 0:i.find((t=>"ENTITYNAME"==t.name)))||void 0===r?void 0:r.value,entityDescription:null===(n=null===(e=t.props)||void 0===e?void 0:e.find((t=>"DESCRIPTIONENTITY"==t.name)))||void 0===n?void 0:n.value,searchOptions:{showInactives:!1}}});return s}}export{l as F,u as P,a,o as b,s as c}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as s}from"./p-d2d301a6.js";import{P as l}from"./p-2b449454.js";import{ApplicationUtils as r}from"@sankhyalabs/ezui/dist/collection/utils";import{ElementIDUtils as n,ApplicationContext as h}from"@sankhyalabs/core";import a from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status";import"./p-112455b1.js";const o=class{constructor(e){t(this,e),this.APPLY="OK",this.CANCEL="CANCEL",this.CLOSE="CLOSE",this.REMOTE_PRINTERS_TAB="0",this.LOCAL_PRINTERS_TAB="1",this._hasRemotePrinters=!1,this._hasLocalPrinters=!1,this._localPrinters=[],this._isSingleJob=!1,this.buildIdTabSelector=()=>{const t=[{label:this._application.messagesBuilder.getMessage("snkPrintSelector.title.localPrintersTab",void 0),tabKey:this.LOCAL_PRINTERS_TAB,index:Number(this.LOCAL_PRINTERS_TAB)}];return this._printServerActive&&t.unshift({label:this._application.messagesBuilder.getMessage("snkPrintSelector.title.remotePrintersTab",void 0),tabKey:this.REMOTE_PRINTERS_TAB,index:Number(this.REMOTE_PRINTERS_TAB)}),[...t]},this._printServerActive=!1,this._selectedPrinter=void 0,this._remotePrintersDataSource=[],this._localPrintersDataSource=[],this._printJobData=void 0}async openPrintSelector(t){return new Promise((e=>{this._printJobData=t,this._isSingleJob=1===this._printJobData.pendingPrinters.length,this._printServerActive=this._printJobData.printServerActive,this._printServerActive?this.buildRemotePrinters():(this.buildLocalPrinters(),this._viewStack.show(+this.LOCAL_PRINTERS_TAB)),this._ezPopup.opened=!0,this._printerResolver=e}))}closePrintSelector(){this._ezPopup.opened=!1,this.element.remove()}handleModalAction(t){switch(t){case this.APPLY:this.handleApply();break;case this.CANCEL:case this.CLOSE:this.handleCancel()}}async handleCancel(){await r.confirm(this._application.messagesBuilder.getMessage("snkPrintSelector.title.warning",void 0),this._application.messagesBuilder.getMessage("snkPrintSelector.message.canceledPrint",void 0))&&(this.closePrintSelector(),this._printerResolver(void 0))}handleApply(){this._printerResolver(this._selectedPrinter),this.closePrintSelector()}onChangeTab(t){t.detail.tabKey===this.LOCAL_PRINTERS_TAB&&this.buildLocalPrinters(),this._viewStack.show(+t.detail.tabKey)}buildRemotePrinters(){const t=[];this._printJobData.printServers.forEach((e=>{t.push({group:e.printServerUri,items:e.printerList.map((t=>({label:t.printerName,group:e.printServerUri})))})})),this._remotePrintersDataSource=t,this._hasRemotePrinters=this._remotePrintersDataSource.length>0}buildLocalPrinters(){this._localPrintersDataSource.length>0||(this._localPrinters=l.getInstance().getLocalPrinters(),this._localPrintersDataSource=this._localPrinters.map((t=>({label:t.nome}))),this._hasLocalPrinters=this._localPrintersDataSource.length>0)}onSelectPrinter(t,e){if(e)return this._hasRemotePrinters&&this._remotePrintersList.removeSelection(),void(this._selectedPrinter=this._localPrinters.find((e=>e.nome===t.label)));this._hasLocalPrinters&&this._localPrintersList.removeSelection();const i=this._printJobData.printServers.find((e=>e.printServerUri===t.group));this._selectedPrinter=null==i?void 0:i.printerList.find((e=>e.printerName===t.label))}renderNoPrinters(){return e("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-size-height--full ez-size-width--full"},e("span",{class:"ez-text ez-text--primary ez-text--medium"},this._application.messagesBuilder.getMessage("snkPrintSelector.message.noPrinters",void 0)))}buildPrinterIcon(){return e("ez-icon",{iconName:"print",style:{marginRight:"var(--space--small)"}})}getElementID(t){return{[n.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:n.getInternalIDInfo(t)}}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__")}componentDidLoad(){this.element&&n.addIDInfo(this.element)}render(){return e(i,null,e("ez-popup",Object.assign({size:"small",heightMode:"full",useHeader:!1,ref:t=>this._ezPopup=t},this.getElementID("snk-print-selector")),e("ez-modal-container",{modalTitle:this._application.messagesBuilder.getMessage("snkPrintSelector.title.printerSelection",void 0),okButtonLabel:this._application.messagesBuilder.getMessage("snkPrintSelector.button.print",void 0),okButtonStatus:this._selectedPrinter?a.ENABLED:a.DISABLED,cancelButtonLabel:this._application.messagesBuilder.getMessage("snkPrintSelector.button.cancel",void 0),onEzModalAction:t=>this.handleModalAction(t.detail)},this._isSingleJob&&e("div",{class:"ez-flex ez-margin-bottom--large"},e("div",{class:"ez-flex ez-margin-right--large"},e("span",{class:"ez-text ez-text--bold ez-text--medium ez-padding-right--small"},this._application.messagesBuilder.getMessage("snkPrintSelector.subtitle.document",void 0)),e("span",{class:"ez-text ez-text--primary ez-text--medium"},this._printJobData.pendingPrinters[0].docTypeDescription)),e("div",{class:"ez-flex ez-margin-right--large"},e("span",{class:"ez-text ez-text--bold ez-text--medium ez-padding-right--small"},this._application.messagesBuilder.getMessage("snkPrintSelector.subtitle.jobs",void 0)),e("span",{class:"ez-text ez-text--primary ez-text--medium"},this._printJobData.pendingPrinters[0].printJobCount))),e("ez-tabselector",{tabs:this.buildIdTabSelector(),onEzChange:t=>this.onChangeTab(t),selectedTab:this._printServerActive?this.REMOTE_PRINTERS_TAB:this.LOCAL_PRINTERS_TAB}),e("ez-view-stack",{ref:t=>this._viewStack=t},e("stack-item",{hidePolicy:"hide"},this._printServerActive&&e("div",{class:"list-scroll ez-size-height--full"},e("ez-list",{ref:t=>this._remotePrintersList=t,class:"ez-padding-top--medium "+(this._hasRemotePrinters?"":"hidden"),dataSource:this._remotePrintersDataSource,onEzSelectItem:t=>this.onSelectPrinter(t.detail,!1),itemLeftSlotBuilder:this.buildPrinterIcon,useGroups:!0,ezSelectable:!0,hoverFeedback:!0,"data-element-id":"remotePrintersList"}),!this._hasRemotePrinters&&this.renderNoPrinters())),e("stack-item",{hidePolicy:"hide"},e("div",{class:"list-scroll ez-size-height--full"},e("ez-list",{ref:t=>this._localPrintersList=t,class:"ez-padding-top--medium "+(this._hasLocalPrinters?"":"hidden"),dataSource:this._localPrintersDataSource,onEzSelectItem:t=>this.onSelectPrinter(t.detail,!0),itemLeftSlotBuilder:this.buildPrinterIcon,ezSelectable:!0,hoverFeedback:!0}),!this._hasLocalPrinters&&this.renderNoPrinters()))))))}get element(){return s(this)}};o.style=".sc-snk-print-selector-h{max-height:100%}ez-modal-container.sc-snk-print-selector{--ez-modal-container-overflow-y:hidden}ez-list.sc-snk-print-selector{height:100%}.list-scroll.sc-snk-print-selector{max-height:calc(100% - 90px);overflow-y:auto;padding-right:var(--snk-grid-config__main--padding-right)}.list-scroll.sc-snk-print-selector::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.hidden.sc-snk-print-selector{display:none}";export{o as snk_print_selector}
@@ -1 +0,0 @@
1
- export{S as snk_data_unit}from"./p-bfe8b96d.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-eb0c9f4c.js";
@@ -1 +0,0 @@
1
- import{r as e,c as i,h as t,H as s,g as n}from"./p-d2d301a6.js";import{UserInterface as a,ApplicationContext as r,ElementIDUtils as l,JSUtils as o,StringUtils as h,DataType as d}from"@sankhyalabs/core";import{ApplicationUtils as c,CheckMode as u}from"@sankhyalabs/ezui/dist/collection/utils";import{fieldBuilder as p}from"@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder";import{F as v,a as m,P as b,b as f,c as g}from"./p-7d68a43a.js";import{s as _}from"./p-6dc031de.js";import{convertType as x}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{ModalAction as k}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import"./p-63bff2a8.js";import"./p-584d7212.js";var z;!function(e){e.LINK="LINK",e.FIELD="FIELD"}(z||(z={}));const y=[{label:"Igual (=)",value:"EQUAL"},{label:"Diferente (<>)",value:"DIFFERENT"},{label:"Contendo (LIKE)",value:"LIKE"},{label:"Contido em (IN)",value:"IN"},{label:"Iniciado com (%?)",value:"START_WITH"},{label:"Terminado com (?%)",value:"FINISHED_WITH"},{label:"Vazio (NULL)",value:"NULL"},{label:"Não Vazio (NOT NULL)",value:"NOT_NULL"}],E=y.concat([{label:"Maior (>)",value:"LARGER"},{label:"Maior ou Igual (>=)",value:"LARGER_EQUAL"},{label:"Menor (<)",value:"SMALLER"},{label:"Menor ou Igual (<=)",value:"SMALLER_EQUAL"}]),C=y,F=[a.SEARCH,a.SHORTTEXT,a.PASSWORD,a.MASKEDTEXT,a.LONGTEXT,a.HTML],O=class{constructor(t){e(this,t),this.ezFilterItemChange=i(this,"ezFilterItemChange",7),this.ezFilterItemRemove=i(this,"ezFilterItemRemove",7),this.application=r.getContextValue("__SNK__APPLICATION__"),this.filterOperandDefault=E,this.filterOperandTypeTextSearch=C,this.DEFAULT_FIELD_NAME="NOT_DEFINED",this._showValueVariable=!1,this._fieldSelected=void 0,this._optionNotNull=!1,this.expression=void 0,this.canRemove=!0,this.messagesBuilder=void 0,this.entityURI=void 0}expressionChanged(e,i){e!==i&&(this.ezFilterItemChange.emit(e),this.updateFieldSelected())}componentWillLoad(){this._dataSourceFetcher=_.get(`filterFieldsDataSource.${this.entityURI}`),_.onChange(`filterFieldsDataSource.${this.entityURI}`,(()=>{this._dataSourceFetcher=_.get(`filterFieldsDataSource.${this.entityURI}`)})),this.expression&&(this.updateFieldSelected(),this._optionNotNull="NULL"===this.expression.operand||"NOT_NULL"===this.expression.operand)}componentDidRender(){this._showValueVariable=this._elValueVariable.value}updateFieldSelected(){const e={dataType:this.expression.type,description:this.expression.description,name:this.expression.fieldName,label:this.expression.fieldLabel,entityName:this.expression.entityName,onlyDate:!1,path:this.expression.description,properties:this.expressionPropsToFieldProps(this.expression.props),type:z.FIELD,uri:"",userInterface:this.expression.userInterface};this._fieldSelected=e}buildExpression(e,i,t){return t.length>0&&t.shift(),t.length>0?`${t.join("->")}->${i}`:`${e}.${i}`}setValueExpression(e,i){"fieldName"===e?(this.expression.description=i.path,this.expression.expression=this.buildExpression(i.entityName,i.name,i.entityPath),this.expression.fieldName=i.name,this.expression.fieldLabel=i.label,this.expression.type=i.dataType,this.expression.userInterface=i.userInterface,this.expression.entityName=i.entityName,this.expression.value=void 0,this.expression.props=this.fieldPropsToExpressionProps(i.properties)):this.expression[e]=i,this.expressionChanged(this.expression)}fieldPropsToExpressionProps(e){const i=[];if(!e)return i;for(const t in e){let s=e[t];"object"==typeof s&&(s=JSON.stringify(s)),i.push({name:t,value:s})}return i}expressionPropsToFieldProps(e){const i={};return e?(e.forEach((e=>{try{i[e.name]=JSON.parse(e.value)}catch(t){i[e.name]=e.value}})),i):i}getMessage(e,i){return this.application.messagesBuilder.getMessage(e,i)}handleSelectItem(e){if(this.hasNoChanges(e))this._elFilterInput.value=e.path;else if(e.type===z.FIELD){const i=e;this._fieldSelected=i,this.setValueExpression("fieldName",i)}}hasNoChanges(e){return e.name===this.expression.fieldName&&e.path===this.expression.description}handleFocus(){this._elFilterFieldSearch&&this._elFilterFieldSearch.show()}handleChangeFilterInput(e){this._elFilterFieldSearch.applyFilter(e.detail)}handleChangeValueVariable(e){this._showValueVariable=e,this._elFieldDynamic&&(this._elFieldDynamic.value=void 0,this._elFieldDynamic.enabled=!e),this.expression.paramVariable=e,this.expressionChanged(this.expression)}openSnkFilterParamConfig(){var e;null===(e=this._elFilterParamConfigRef)||void 0===e||e.open(this.expression).then(this.onOpenPromiseReady.bind(this)).catch((e=>{console.error(e)}))}onOpenPromiseReady(e){this.expression=e}buildOptionsOperator(){var e;return F.includes(null===(e=this._fieldSelected)||void 0===e?void 0:e.userInterface)?this.filterOperandTypeTextSearch:this.filterOperandDefault}handleChangeOperator(e){this.checkOptionIsNull(e),this.setValueExpression("operand",e)}checkOptionIsNull(e){[v.NULL,v.NOT_NULL].includes(v[e])?(this._optionNotNull=!0,this._elFieldDynamic&&(this._elFieldDynamic.enabled=!1,this._elFieldDynamic.value=void 0)):(this._optionNotNull=!1,this._elFieldDynamic&&(this._elFieldDynamic.enabled=!this._showValueVariable))}confirmRemove(e){e.preventDefault(),e.stopPropagation(),c.confirm(this.getMessage("snkPersonalizedFilter.confirmExpression.title"),this.getMessage("snkPersonalizedFilter.confirmExpression.description")).then((e=>{e&&this.ezFilterItemRemove.emit(this.expression)}))}buildFieldByType(){var e,i,s;if(!this._fieldSelected)return;const n=null===(e=p(this.configureFieldByType()))||void 0===e?void 0:e.i.shift();return(this._optionNotNull&&n||(null===(i=this._elValueVariable)||void 0===i?void 0:i.value)&&n||this.expression.paramVariable||this._showValueVariable||!(null===(s=this._fieldSelected)||void 0===s?void 0:s.dataType))&&(n.t.enabled=!1),null!=this.expression.value&&(n.t.value=this.getExpressiontValue(this.expression)),n.t.onEzChange=e=>{this.setValueExpression("value",e.target.value)},"SWITCH"===this.expression.userInterface&&null==this.expression.value&&this.setValueExpression("value",!1),t(n.l,Object.assign(Object.assign({},n.t),{ref:e=>{this._elFieldDynamic=e},label:this.expression.fieldLabel||this._fieldSelected.label}))}getExpressiontValue(e){return x(e.type,e.value)}configureFieldByType(){var e,i;const t={userInterface:this._fieldSelected.userInterface,name:this._fieldSelected.name,label:this._fieldSelected.label,canShowError:!1};switch(t.userInterface){case a.OPTIONSELECTOR:t.props={options:null===(i=null===(e=this._fieldSelected)||void 0===e?void 0:e.properties)||void 0===i?void 0:i.options};break;case a.LONGTEXT:t.rows=1;break;case a.SEARCH:t.optionLoader=e=>this.setCriteriaSearch(e,this.application)}return t}setCriteriaSearch({mode:e,argument:i},t){var s,n;if(null==t)return;const a={entity:null===(n=null===(s=this._fieldSelected)||void 0===s?void 0:s.properties)||void 0===n?void 0:n.ENTITYNAME,searchOptions:{showInactives:!1},entityDescription:this._fieldSelected.description};return t.executePreparedSearch(e,i,a)}render(){var e;return t(s,null,t("div",{class:"dashes"}),t("div",{class:"box"},t("div",{class:"box__container"},t("div",{class:"box__container--input-filter"},t("ez-filter-input",Object.assign({ref:e=>this._elFilterInput=e,value:null===(e=this._fieldSelected)||void 0===e?void 0:e.path,label:this.getMessage("snkPersonalizedFilter.info.labelSearchField"),canShowError:!1,onEzChange:e=>this.handleChangeFilterInput(e),onFocus:()=>this.handleFocus()},{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`expressionFilterInput_${this.expression.fieldName||this.DEFAULT_FIELD_NAME}`})),t("snk-filter-field-search",{ref:e=>this._elFilterFieldSearch=e,searchable:!1,onEzSelectFilterItem:e=>this.handleSelectItem(e.detail),fieldsDataSource:this._dataSourceFetcher})),t("div",{class:"box__container--input-operator"},t("ez-combo-box",Object.assign({label:this.getMessage("snkPersonalizedFilter.info.labelOperator"),value:this.expression.operand,canShowError:!1,options:this.buildOptionsOperator(),onEzChange:e=>{var i;return this.handleChangeOperator(null===(i=e.detail)||void 0===i?void 0:i.value)},suppressEmptyOption:!0},{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`comboBoxOperand_${this.expression.fieldName||this.DEFAULT_FIELD_NAME}`}))),t("div",{class:"box__container--input-value"},this._fieldSelected?this.buildFieldByType():t("ez-number-input",{label:"Valor",canShowError:!1,enabled:!this._showValueVariable&&!this._optionNotNull})),t("div",{class:"box__container--input-value-variable"},!this._optionNotNull&&t("ez-check",{ref:e=>this._elValueVariable=e,value:this.expression.paramVariable,label:this.getMessage("snkPersonalizedFilter.info.labelValueVarible"),mode:u.SWITCH,onEzChange:e=>this.handleChangeValueVariable(e.detail)}),this._showValueVariable&&!this._optionNotNull&&t("ez-icon",Object.assign({class:"box__container--input-value-variable--icon",size:"large",iconName:"settings-inverted"},{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:"iconConfig"},{title:this.getMessage("snkPersonalizedFilter.info.titleTooltip"),onClick:()=>this.openSnkFilterParamConfig()})),t("snk-filter-param-config",{ref:e=>this._elFilterParamConfigRef=e,messagesBuilder:this.messagesBuilder})),t("div",{class:"box__container--button-delete"},t("div",{class:"box__container--button-delete--icon"},t("ez-button",{mode:"icon",iconName:"delete",enabled:this.canRemove,label:this.getMessage("snkPersonalizedFilter.info.labelDeleteItem"),onClick:e=>this.confirmRemove(e)}))))))}static get watchers(){return{expression:["expressionChanged"]}}};O.style=".sc-snk-expression-item-h{display:flex;width:100%;--snk-expression-item--background-color:var(--background--xlight, #fff);--snk-expression-item__itens--padding:var(--space--small, 6px);--snk-expression-item__width--input-operator:220px;--snk-expression-item__width--input-value:240px;--snk-expression-item__width--input-value-variable:176px;--snk-expression-item--border-radius:var(--border--radius-medium, 12px);--snk-expression-item--border-color:var(--color--strokes, #DCE0E8);--snk-expression-item--border-style:var(--border--small, 1px solid);--snk-expression-item__background-color-dashed:var(--background--body, #fafcff)}.box.sc-snk-expression-item{width:100%;height:56px;background:var(--snk-expression-item--background-color);border:var(--snk-expression-item--border-color) var(--snk-expression-item--border-style);border-radius:var(--snk-expression-item--border-radius)}.box__container.sc-snk-expression-item{display:flex;align-items:center;justify-content:space-between;white-space:nowrap;margin:var(--space--small, 6px)}.box__container--input-filter.sc-snk-expression-item{width:100%}.box__container--input-operator.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-operator);min-width:var(--snk-expression-item__width--input-operator)}.box__container--input-value.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value);min-width:var(--snk-expression-item__width--input-value)}.box__container--input-value-variable.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value-variable);min-width:var(--snk-expression-item__width--input-value-variable)}.box__container--button-delete.sc-snk-expression-item{display:flex}.box__container.sc-snk-expression-item>div.sc-snk-expression-item{padding-left:var(--snk-expression-item__itens--padding);padding-right:var(--snk-expression-item__itens--padding)}.box__container--button-delete--icon.sc-snk-expression-item{width:42px;min-width:42px}.box__container--input-value-variable--icon.sc-snk-expression-item{cursor:pointer}.dashes.sc-snk-expression-item{z-index:var(--more-visible, 2);background:var(--snk-expression-item__background-color-dashed);border-bottom:2px dashed var(--text-secondary, #A2ABB9);border-left:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:62px;margin-left:-15px;margin-top:-33.5px}";const I={[a.SHORTTEXT]:"text",[a.LONGTEXT]:"text",[a.INTEGERNUMBER]:"number",[a.DECIMALNUMBER]:"number",[a.DATE]:"calendar",[a.DATETIME]:"calendar",[a.SWITCH]:"boolean",[a.CHECKBOX]:"check-circle-inverted",[a.OPTIONSELECTOR]:"list",[a.SEARCH]:"search",[a.HTML]:"tag_code",[a.IMAGE]:"png",[a.FILE]:"edit-file",[a.TIME]:"timer-outline",[a.ELAPSEDTIME]:"timer",[a.MASKEDTEXT]:"text",[a.PASSWORD]:"email"},S=({userInterface:e,description:i})=>t("ez-icon",{iconName:I[e],class:"ez-padding-left--small",title:i}),w="__SNK__APPLICATION__",N=/\w+:\/\/(\w+)/,L=class{constructor(t){e(this,t),this.ezSelectFilterItem=i(this,"ezSelectFilterItem",7),this._currentMetadata=null,this._filterText="",this._isLoading=!1,this.searchable=!0,this.fieldsDataSource=void 0,this.breadcrumbItems=[],this.linkItems=[],this.fieldItems=[],this.searchEmpty=!1,this.groupEmpty=!1}async show(e,i){var t;return e?null===(t=this._ezPopover)||void 0===t||t.showUnder(e,i):this._ezPopover.show(),this.loadData()}async applyFilter(e){if(this.searchable)throw new Error("This method is not available when searchable is true");this.handleFilterChange(e)}async loadData(){var e,i;this._isLoading=!0;let t=await this.fieldsDataSource.fetchData(this._currentLink);this._currentLink=t.currentLink;const{fields:s,links:n}=t||{};if(!Array.isArray(s)||!Array.isArray(n))throw new Error("Invalid metadata");this._currentMetadata=t,this.mapDataSourceToLinkItems(),this.mapDataSourceToFieldItems(),this._isLoading=!1,null===(e=this._ezFieldList)||void 0===e||e.scrollToTop(),null===(i=this._ezLinkList)||void 0===i||i.scrollToTop()}mapDataSourceToLinkItems(){var e;const{links:i}=this._currentMetadata,t=this.getMessage("snkFilterFieldSearch.linkLabel",{link:null===(e=this._currentLink)||void 0===e?void 0:e.description}),s=i.map((e=>Object.assign({label:e.description},e)));this.groupEmpty=Boolean(0===s.length),this.linkItems=[{group:t,items:s}],0===this.breadcrumbItems.length&&(this.breadcrumbItems=[Object.assign({id:o.generateUUID(),label:this._currentLink.description},this._currentLink)])}mapDataSourceToFieldItems(){var e;const i=this._currentMetadata.fields,t=this.getMessage("snkFilterFieldSearch.fieldLabel",{link:null===(e=this._currentLink)||void 0===e?void 0:e.description}),s=i.filter((e=>{if(!this._currentLink)return!0;const i=e.description.toLowerCase().includes(this._filterText.toLowerCase()),t=e.name.toLowerCase().includes(this._filterText.toLowerCase());return i||t})).map((e=>Object.assign({label:e.description},e)));this.searchEmpty=Boolean(this._filterText&&0===s.length),this.fieldItems=[{group:t,items:s}]}handleFilterChange(e){this._isLoading||(this._filterText=e,this.mapDataSourceToFieldItems())}handleSelectLink({detail:e}){if(this._isLoading)return;const i=this.breadcrumbItems.findIndex((i=>i.id===e.id));this.breadcrumbItems=i>-1?this.breadcrumbItems.slice(0,i+1):[...this.breadcrumbItems,Object.assign({id:o.generateUUID(),label:e.description},e)];const t=Object.assign(Object.assign({},e),{type:z.LINK});this._currentLink=t,this.ezSelectFilterItem.emit(t),this.loadData()}getEntityFromBreadCrumbItem(e){const i=N.exec(e.uri);if(i)return i[1]}handleSelectField({detail:e}){var i;const t=this.breadcrumbItems.map((e=>e.label)).join(">>"),s=Object.assign(Object.assign({},e),{type:z.FIELD,entityPath:this.breadcrumbItems.map((e=>this.getEntityFromBreadCrumbItem(e))).filter((e=>null!=e)),path:`${t} >> ${e.description}`});this.ezSelectFilterItem.emit(s),null===(i=this._ezPopover)||void 0===i||i.hide()}getElementID(e){return{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:l.getInternalIDInfo(e)}}getMessage(e,i){var t,s,n;return this._application||(this._application=r.getContextValue(w)),null===(n=null===(s=null===(t=this._application)||void 0===t?void 0:t.messagesBuilder)||void 0===s?void 0:s.getMessage)||void 0===n?void 0:n.call(s,e,i)}componentWillLoad(){this._application=r.getContextValue(w)}componentDidLoad(){l.addIDInfoIfNotExists(this._ezPopover,"popover")}disconnectedCallback(){var e;null===(e=this._ezPopover)||void 0===e||e.hide()}render(){var e;const i=this.getMessage("snkFilterFieldSearch.searchLabel");return t("ez-popover",Object.assign({ref:e=>this._ezPopover=e,role:"dialog",overlayType:"none","aria-hidden":!(null===(e=this._ezPopover)||void 0===e?void 0:e.opened)},this.getElementID("EzPopover")),t("div",{class:"snk-filter-field-search__container"},t("header",{class:"snk-filter-field-search__header"},this.searchable&&!!i&&t("ez-filter-input",Object.assign({class:"snk-filter-field-search__input",label:i,asyncSearch:!0,canShowError:!1,onEzSearching:e=>this.handleFilterChange.bind(this)(e.detail),"aria-label":i,"aria-required":"false","aria-invalid":"false"},this.getElementID("EzFilterInput"))),this.breadcrumbItems.length>0&&t("ez-breadcrumb",Object.assign({items:this.breadcrumbItems,onSelectedItem:this.handleSelectLink.bind(this),role:"navigation","aria-current":"step"},this.getElementID("EzBreadcrumb"))),t("hr",{class:"ez-divider-horizontal ez-margin-vertical--medium"})),t("section",{class:`snk-filter-field-search__section ${this.groupEmpty&&this.searchEmpty&&" ez-margin--auto"}`},this.groupEmpty?t("div",{class:"ez-margin--auto"},t("span",{class:"ez-text ez-text--secondary ez-text--medium"},this.getMessage("snkFilterFieldSearch.groupEmpty"))):t("ez-list",Object.assign({ref:e=>this._ezLinkList=e,class:"snk-filter-field-search__list",id:"filterLinkList",useGroups:!0,dataSource:this.linkItems,onEzSelectItem:this.handleSelectLink.bind(this),hoverFeedback:!0,ezSelectable:!0,itemSlotBuilder:e=>t("ez-badge",{label:e.fieldCount}),"aria-describedby":"filterLinkLabel"},this.getElementID("EzListLinks"))),this.searchEmpty?t("div",{class:"ez-margin--auto"},t("span",{class:"ez-text ez-text--secondary ez-text--medium"},this.getMessage("snkFilterFieldSearch.searchEmpty"))):t("ez-list",Object.assign({ref:e=>this._ezFieldList=e,class:"snk-filter-field-search__list",id:"filterFieldList",useGroups:!0,dataSource:this.fieldItems,onEzSelectItem:this.handleSelectField.bind(this),hoverFeedback:!0,ezSelectable:!0,itemSlotBuilder:S,"aria-describedby":"filterFieldLabel"},this.getElementID("EzListFields"))))))}};L.style=".sc-snk-filter-field-search-h{--snk-filter-field-search--container-width:468px;--snk-filter-field-search--container-height:322px}.snk-filter-field-search__container.sc-snk-filter-field-search{display:flex;flex-direction:column;padding:var(--space--medium);width:var(--snk-filter-field-search--container-width);height:var(--snk-filter-field-search--container-height)}.snk-filter-field-search__section.sc-snk-filter-field-search{display:grid;grid-template-columns:1fr 1fr;place-items:flex-start;overflow:hidden;gap:var(--space--small)}.snk-filter-field-search__input.sc-snk-filter-field-search{margin-bottom:var(--space--medium)}.snk-filter-field-search__list_container.sc-snk-filter-field-search{display:flex;flex-direction:column}.snk-filter-field-search__list.sc-snk-filter-field-search{overflow-y:auto}";const P=class{constructor(i){e(this,i),this._opened=!1,this._configType=m.SYSTEM_CONFIG,this._expressionItem=void 0,this._informedInstance=!1,this._canSave=!1,this.messagesBuilder=void 0}open(e){return this._opened=!0,this._expressionItem=e,this.loadValues(),new Promise((e=>{this._promiseResolver=e}))}close(){return this._opened=!1,new Promise((e=>{this._promiseResolver=e}))}getMessage(e,i){var t;return null===(t=this.messagesBuilder)||void 0===t?void 0:t.getMessage(e,i)}getConfigValue(e,i,t=""){var s,n,a;return(null===(n=null===(s=this._expressionItem)||void 0===s?void 0:s[e])||void 0===n?void 0:n[i])||(null===(a=this._expressionItem)||void 0===a?void 0:a[t||i])}loadValues(){var e;const i=this.getConfigValue("systemConfig","entity","entityName"),t=this.getConfigValue("systemConfig","fieldName"),s=this.getConfigValue("userConfig","description"),n=this.getConfigValue("userConfig","type");this._configType=null!=(null===(e=this._expressionItem)||void 0===e?void 0:e.userConfig)?m.USER_CONFIG:m.SYSTEM_CONFIG,h.isEmpty(i)||h.isEmpty(t)||(this._instanceElement.value={value:i,label:""},this._fieldElement.value={value:t,label:""}),h.isEmpty(s)||h.isEmpty(n)||(this._descriptionElement.value=s,this._typeElement.value=n),this.buildFilterExpression()}changeDefinitionUsed(e){if(this._configType=null!=e?e:m.SYSTEM_CONFIG,this._configType===m.SYSTEM_CONFIG){const e=this.getConfigValue("systemConfig","entity","entityName"),i=this.getConfigValue("systemConfig","fieldName");this._instanceElement.value=this._instanceElement.value||{value:e,label:""},this._fieldElement.value=this._fieldElement.value||{value:i,label:""}}else if(this._configType===m.USER_CONFIG){const e=this.getConfigValue("userConfig","description"),i=this.getConfigValue("userConfig","type");this._descriptionElement.value=this._descriptionElement.value||e,this._typeElement.value=this._typeElement.value||i}this.buildFilterExpression()}getTypeValue(){var e;const i=null===(e=this._typeElement)||void 0===e?void 0:e.value;return(null==i?void 0:i.value)||i}getExpressionValues(){var e,i,t,s,n;let a,r;return this._configType===m.SYSTEM_CONFIG?a={entity:null===(i=null===(e=this._instanceElement)||void 0===e?void 0:e.value)||void 0===i?void 0:i.value,fieldName:null===(s=null===(t=this._fieldElement)||void 0===t?void 0:t.value)||void 0===s?void 0:s.value}:this._configType===m.USER_CONFIG&&(r={description:null===(n=this._descriptionElement)||void 0===n?void 0:n.value,type:this.getTypeValue()}),Object.assign(Object.assign(Object.assign({},this._expressionItem),{systemConfig:a}),{userConfig:r})}isEnabled(e){return this._configType===e}isInformedInstance(){var e,i;return!h.isEmpty(null===(i=null===(e=this._instanceElement)||void 0===e?void 0:e.value)||void 0===i?void 0:i.value)}save(){var e;this._expressionItem=Object.assign(Object.assign({},this.getExpressionValues()),{expression:null===(e=this._expressionElement)||void 0===e?void 0:e.value}),this._promiseResolver(this._expressionItem),this._opened=!1}buildFilterExpression(){var e;this._informedInstance=this.isInformedInstance();const i=b.buildFilterExpression(this.getExpressionValues());this._expressionElement.value=i||(null===(e=this._expressionItem)||void 0===e?void 0:e.expression),this._canSave=this.getCanSave()}handleChangeInstance(){this._informedInstance=this.isInformedInstance(),null==this._fieldElement||h.isEmpty(this._fieldElement.value)||(this._fieldElement.value=null),this.buildFilterExpression()}getInstanceCriteria(){var e,i;const t=null===(i=null===(e=this._instanceElement)||void 0===e?void 0:e.value)||void 0===i?void 0:i.value;return{expression:"this.NOMETAB = (SELECT NOMETAB FROM TDDINS WHERE NOMEINSTANCIA = ?)",params:[{name:"NOMEINSTANCIA",dataType:d.TEXT,value:t}]}}onSearch({mode:e,argument:i},t){if(null==this._application||!this._opened)return;const s=t===f.FIELD,n=s?this.getInstanceCriteria():void 0,a={entity:t,entityDescription:this.getMessage("snkFilterParamConfig.label"+(s?"Field":"Instance")),criteria:n,searchOptions:{descriptionFieldName:s?"DESCRCAMPO":"DESCRINSTANCIA",codeFieldName:s?"NOMECAMPO":"NOMEINSTANCIA",showInactives:!1}};return new Promise((t=>{this._application.executePreparedSearch(e,i,a).then((e=>t(e)))}))}getElementID(e){return{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:l.getInternalIDInfo(e)}}getCanSave(){var e;if(this._configType===m.USER_CONFIG){const i=null===(e=this._descriptionElement)||void 0===e?void 0:e.value,t=this.getTypeValue();return!h.isEmpty(i)&&!h.isEmpty(t)}return!0}componentWillLoad(){this._application=r.getContextValue("__SNK__APPLICATION__")}render(){return l.addIDInfoIfNotExists(this._element,"snkFilterParamConfig"),t("ez-popup",Object.assign({useHeader:!1,size:"small",heightMode:"auto",opened:this._opened},this.getElementID("popup")),t("ez-modal-container",Object.assign({onEzModalAction:e=>{e.detail===k.CLOSE&&this.close()},modalTitle:this.getMessage("snkFilterParamConfig.modalTitle")},this.getElementID("modalContainer")),t("div",{class:"ez-flex"},t("div",{class:"ez-col ez-col--sd-6 ez-flex--column"},t("ez-radio-button",Object.assign({value:this._configType,onEzChange:e=>this.changeDefinitionUsed(e.detail)},this.getElementID("systemConfigOption")),t("ez-radio-button-option",{label:this.getMessage("snkFilterParamConfig.labelSystemConfig"),value:m.SYSTEM_CONFIG})),t("ez-search",Object.assign({ref:e=>this._instanceElement=e,label:this.getMessage("snkFilterParamConfig.labelInstance"),enabled:this.isEnabled(m.SYSTEM_CONFIG),suppressEmptyOption:!0,showOptionValue:!1,showSelectedValue:!1,onEzChange:()=>this.handleChangeInstance(),optionLoader:e=>this.onSearch(e,f.INSTANCE)},this.getElementID("configFindEntity"))),t("ez-search",Object.assign({ref:e=>this._fieldElement=e,label:this.getMessage("snkFilterParamConfig.labelField"),enabled:this.isEnabled(m.SYSTEM_CONFIG)&&this._informedInstance,suppressEmptyOption:!0,showOptionValue:!1,showSelectedValue:!1,onEzChange:()=>this.buildFilterExpression(),optionLoader:e=>this.onSearch(e,f.FIELD)},this.getElementID("configFindField")))),t("div",{class:"ez-flex ez-padding--medium"},t("hr",{class:"ez-divider-vertical"})),t("div",{class:"ez-col ez-col--sd-6 ez-flex--column"},t("ez-radio-button",Object.assign({value:this._configType,onEzChange:e=>this.changeDefinitionUsed(e.detail)},this.getElementID("userConfigOption")),t("ez-radio-button-option",{label:this.getMessage("snkFilterParamConfig.labelUserConfig"),value:m.USER_CONFIG})),t("ez-text-input",Object.assign({ref:e=>this._descriptionElement=e,label:this.getMessage("snkFilterParamConfig.labelDescription"),enabled:this.isEnabled(m.USER_CONFIG),onEzChange:()=>this.buildFilterExpression()},this.getElementID("configParamLabel"))),t("ez-combo-box",Object.assign({ref:e=>this._typeElement=e,label:this.getMessage("snkFilterParamConfig.labelType"),enabled:this.isEnabled(m.USER_CONFIG),suppressEmptyOption:!0,onEzChange:()=>this.buildFilterExpression()},this.getElementID("configParamType")),Object.keys(g).map((e=>t("option",{value:g[e]},this.getMessage(`snkFilterParamConfig.labelTypeValues.${e.toLowerCase()}`))))))),t("ez-text-area",Object.assign({ref:e=>this._expressionElement=e,class:"snk-filter-param-config__expression",label:this.getMessage("snkFilterParamConfig.labelExpression"),enabled:!1},this.getElementID("presentationExpression"))),t("div",{class:"ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small"},t("ez-button",Object.assign({class:"ez-padding-right--medium",label:this.getMessage("snkFilterParamConfig.labelCancel"),onClick:()=>this.close()},this.getElementID("cancelEditParam"))),t("ez-button",Object.assign({class:"ez-button--primary",label:this.getMessage("snkFilterParamConfig.labelSave"),onClick:()=>this.save(),enabled:this._canSave},this.getElementID("saveEditParam"))))))}get _element(){return n(this)}};P.style=":host{--snk-filter-param-config__expression--color:var(--title--primary, #2b3a54);display:flex;position:relative}.snk-filter-param-config__expression{--text-area__input--disabled--color:var(--snk-filter-param-config__expression--color)}";export{O as snk_expression_item,L as snk_filter_field_search,P as snk_filter_param_config}
@@ -1,68 +0,0 @@
1
- import{ApplicationContext as e}from"@sankhyalabs/core";import{F as t}from"./p-814f9247.js";import{R as s}from"./p-60ad0dea.js";import{F as i}from"./p-744d0fd2.js";import{d as r,D as n}from"./p-2b449454.js";class a extends s{constructor(){super(...arguments),this.GRID_CONFIG_VERSION="V3:"}getConfig(e,t){const s=this.getPath(t,e);return new Promise(((e,t)=>{this.loadResource(s).then((t=>{let s;t&&(s=JSON.parse(t)),e(s)})).catch((e=>{t(e)}))}))}saveConfig(e,t,s){const i=this.getPath(s,t);return new Promise(((t,s)=>{this.saveResource(e,i).then((e=>{t(JSON.parse(e.resource))})).catch((e=>{s(e)}))}))}getPath(e,t){return t?`cfg://grid/${this.GRID_CONFIG_VERSION}${e}/${t}`:`cfg://grid/${this.GRID_CONFIG_VERSION}${e}`}}class l{constructor(){this.templateByQuery=new Map,this.buildTemplates()}resolveURI(e,t){let s="filter-assistent-config://"+e;return t&&(s+="."+t),s}buildTemplates(){this.templateByQuery.set("fetchFilterFields",r.gql`
2
- query($name: String!) {
3
- $queryAlias$: fetchFilterFields(name: $name){
4
- currentLink {
5
- description
6
- uri
7
- }
8
- links {
9
- description
10
- uri
11
- fieldCount
12
- }
13
- fields {
14
- name
15
- description
16
- uri
17
- onlyDate
18
- dataType
19
- userInterface
20
- entityName
21
- properties {
22
- name
23
- value
24
- }
25
- }
26
- }
27
- }
28
- `),this.templateByQuery.set("fetchFilterAssistent",r.gql`
29
- query($name: String!) {
30
- $queryAlias$: fetchFilterAssistent(name: $name) {
31
- id
32
- name
33
- active
34
- expression
35
- warningMessage
36
- parameters {
37
- entityName
38
- fieldName
39
- dataType
40
- description
41
- userInterface
42
- label
43
- searchContext {
44
- entity
45
- entityDescription
46
- searchOptions {
47
- rootEntity
48
- descriptionFieldName
49
- codeFieldName
50
- showInactives
51
- }
52
- }
53
- }
54
- assistent
55
- }
56
- }`),this.templateByQuery.set("savePersonalizedFilter",r.gql`
57
- mutation($name: String!, $filterAssistent: InputFilterAssistent!) {
58
- $queryAlias$: savePersonalizedFilter(name: $name, filterAssistent: $filterAssistent) {
59
- id
60
- name
61
- }
62
- }`),this.templateByQuery.set("deletePersonalizedFilter",r.gql`
63
- mutation($name: String!, $filterId: String!) {
64
- $queryAlias$: deletePersonalizedFilter(name: $name, filterId: $filterId) {
65
- id
66
- name
67
- }
68
- }`)}async loadPersonalizedFilter(e,t,s){return new Promise(((i,r)=>{n.get().callGraphQL({values:{name:this.resolveURI(e,s)+"/"+t},query:this.templateByQuery.get("fetchFilterAssistent")}).then((e=>{e.assistent=JSON.parse(e.assistent),i(e)})).catch((e=>{r(e)}))}))}async savePersonalizedFilter(e,t,s){let i=JSON.parse(JSON.stringify(e));return i.assistent=JSON.stringify(i.assistent),new Promise(((e,r)=>{n.get().callGraphQL({values:{name:this.resolveURI(t,s),filterAssistent:i},query:this.templateByQuery.get("savePersonalizedFilter")}).then((t=>{e(t)})).catch((e=>{r(e)}))}))}async removePersonalizedFilter(e,t,s){return new Promise(((i,r)=>{n.get().callGraphQL({values:{name:this.resolveURI(t,s),filterId:e.id},query:this.templateByQuery.get("deletePersonalizedFilter")}).then((e=>{i(e)})).catch((e=>{r(e)}))}))}loadFields(e){return new Promise(((t,s)=>{n.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchFilterFields")}).then((e=>{var s;let i=e.fields;for(const e of i){if(Array.isArray(e.properties)&&e.properties.length>0){const t=e.properties.reduce(((e,t)=>(e[t.name]=t.value,e)),{});e.properties=t}(null===(s=null==e?void 0:e.properties)||void 0===s?void 0:s.options)&&(e.properties.options=JSON.parse(e.properties.options))}t(Object.assign(Object.assign({},e),{fields:i}))})).catch((e=>{s(e)}))}))}}const o="form",c="grid",d="filterBar";class h{static async get(){if(!h.instance){const t=e.getContextValue("__SNK__APPLICATION__");if(null!=t){const e=t.configName,s=await t.getResourceID();h.instance=new h,h.resourceID=s,h.instance.loadFilterBarConfig(e),h.instance.loadFormConfig(e),h.instance.loadGridConfig(e)}}return this.instance}async loadFilterBarConfig(e){const t=h.buildCacheID(e,d);return h.configById.has(t)||h.configById.set(t,h.filterBarConfigFetcher.getConfig(h.resourceID,e)),h.configById.get(t)}async loadFormConfig(e){const t=h.buildCacheID(e,o);return h.configById.has(t)||h.configById.set(t,h.formConfigFetcher.loadFormConfig(e,h.resourceID)),h.configById.get(t)}async loadGridConfig(e){const t=h.buildCacheID(e,c);return h.configById.has(t)||h.configById.set(t,h.gridConfigFetcher.getConfig(e,h.resourceID)),h.configById.get(t)}static async saveFilterBarConfig(e,t){const s=this.buildCacheID(t,d);return this.configById.delete(s),this.filterBarConfigFetcher.saveConfig(e,this.resourceID,t)}static async saveFormConfig(e,t){const s=this.buildCacheID(t,o);return this.configById.delete(s),this.formConfigFetcher.saveConfig(e,t,this.resourceID)}static async saveCardState(e,t){return this.formConfigFetcher.saveCardState(e,t,this.resourceID)}static async saveGridConfig(e,t){if(null==e)return;const s=this.buildCacheID(t,c);return this.configById.delete(s),this.gridConfigFetcher.saveConfig(e,t,this.resourceID)}static async loadPersonalizedFilter(e,t){return this.personalizedFilterFetcher.loadPersonalizedFilter(this.resourceID,e,t)}static async savePersonalizedFilter(e,t){const s=this.buildCacheID(t,d);return this.configById.delete(s),this.personalizedFilterFetcher.savePersonalizedFilter(e,this.resourceID,t)}static async removePersonalizedFilter(e,t){return this.personalizedFilterFetcher.removePersonalizedFilter(e,this.resourceID,t)}static buildCacheID(e,t){return null==e?`req_${t}_${this.resourceID}`:`req_${t}_${e}_${this.resourceID}`}}h.configById=new Map,h.filterBarConfigFetcher=new i,h.formConfigFetcher=new t,h.gridConfigFetcher=new a,h.personalizedFilterFetcher=new l;export{h as C,a as G,l as P}
@@ -1 +0,0 @@
1
- import{r as i,c as e,h as s,f as t,H as o,g as n}from"./p-d2d301a6.js";import{F as r}from"./p-63bff2a8.js";import{ApplicationUtils as a}from"@sankhyalabs/ezui/dist/collection/utils";import{ApplicationContext as d,StringUtils as h,ElementIDUtils as l}from"@sankhyalabs/core";const p=class{constructor(s){i(this,s),this.ezFilterGroupChange=e(this,"ezFilterGroupChange",7),this.ezFilterGroupRemove=e(this,"ezFilterGroupRemove",7),this.ezExpressionGroupLayoutChanged=e(this,"ezExpressionLayoutChanged",7),this.FIRST_LEVEL="0",this.LIMIT_GROUP_LEVEL=4,this.application=d.getContextValue("__SNK__APPLICATION__"),this._conditionOperator=r.AND,this._group=void 0,this._selfTop=0,this.canAddExpression=!0,this._showDashes=!0,this.parentTop=0,this.group=void 0,this.messagesBuilder=void 0,this.filterId=void 0,this.entityURI=void 0}todoCompletedHandler(i){this.updateDashes()}async getExpressionGroup(){return this._group}watchGroup(i){this._group=i,this._conditionOperator=this.getOperand()}componentWillLoad(){this._group=this.group,this._conditionOperator=this.getOperand(),this.getDataGroupLevel()||this._element.setAttribute("data-group-level",this.FIRST_LEVEL),this.filterId||(this.canAddExpression=!1)}componentDidRender(){this.setSelfTop()}changeHandler(){this.ezExpressionGroupLayoutChanged.emit()}setSelfTop(){this._selfTop=this._element.getBoundingClientRect().top}getDashedHeight(){return this._selfTop-this.parentTop}getOperand(){return this._group.operand?this._group.operand:r.AND}getMessage(i,e){return this.application.messagesBuilder.getMessage(i,e)}updateDashes(){this._showDashes=!1,this.setSelfTop(),this._showDashes=!0}renderExpressionItems(){var i;return null===(i=this._group.items)||void 0===i?void 0:i.map((i=>s("snk-expression-item",{key:i.id,class:"ez-padding-top--small snk-expression-group__item",expression:i,canRemove:this._group.items.length>1,onEzFilterItemChange:()=>this.handleFilterItemChange(),onEzFilterItemRemove:e=>this.handleFilterItemRemove(e,i.id),messagesBuilder:this.messagesBuilder,entityURI:this.entityURI})))}renderGroups(){var i;const e=parseInt(this.getDataGroupLevel()||"0")+1;return null===(i=this._group.childrenGroups)||void 0===i?void 0:i.map((i=>s("snk-expression-group",{key:i.id,group:i,messagesBuilder:this.messagesBuilder,parentTop:this._selfTop,"data-group-level":e,onEzFilterGroupRemove:e=>this.handleFilterGroupRemove(e,i.id),entityURI:this.entityURI})))}handleFilterGroupRemove(i,e){this.onStopPropagation(i),this._group.childrenGroups=this._group.childrenGroups.filter((i=>i.id!==e)),t(this),this.ezFilterGroupChange.emit(this._group),this.changeHandler()}handleFilterItemRemove(i,e){this.onStopPropagation(i),this._group.items=this._group.items.filter((i=>i.id!==e)),t(this),this.ezFilterGroupChange.emit(this._group),this.changeHandler(),this.canAddExpression=!0}isFilledItem(i){return!(!i.fieldName||!i.operand||"NULL"!==i.operand&&"NOT_NULL"!==i.operand&&!i.paramVariable&&"SWITCH"!==i.userInterface&&!i.value)}handleFilterItemChange(){this.ezFilterGroupChange.emit(this._group),this.canAddExpression=this.group.items.every(this.isFilledItem)}handleAddExpression(){const i={id:h.generateUUID(),entityName:"",fieldName:"",description:"",label:"Valor",type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null};this._group.items.push(i),t(this),this.ezFilterGroupChange.emit(this.group),this.changeHandler(),this.canAddExpression=!1}handleAddGroup(){var i;const e={id:h.generateUUID(),items:[{id:h.generateUUID(),entityName:"",fieldName:"",description:"",label:"Valor",type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null}],childrenGroups:[],operand:r.AND};this._group.childrenGroups=null!==(i=this._group.childrenGroups)&&void 0!==i?i:[],this._group.childrenGroups.push(e),t(this),this.ezFilterGroupChange.emit(this.group),this.changeHandler()}buildGroupStyle(){return{height:`${this.getDashedHeight()}px`,marginTop:20-this.getDashedHeight()+"px"}}handleConditionOperatorChange(i){this._conditionOperator=i,this._group.operand=r[i],this.ezFilterGroupChange.emit(this._group)}confirmRemoveGroup(i){this.onStopPropagation(i),a.confirm(this.getMessage("snkPersonalizedFilter.confirmGroup.title"),this.getMessage("snkPersonalizedFilter.confirmGroup.description")).then((i=>{i&&this.ezFilterGroupRemove.emit(this._group)}))}getTooltipMessageForOperator(){return this.getDataGroupLevel()===this.FIRST_LEVEL&&1===this._group.items.length?this.getMessage("snkPersonalizedFilter.operador.firstLevel"):this._conditionOperator===r.AND?this.getMessage("snkPersonalizedFilter.operador.and"):this._conditionOperator===r.OR?this.getMessage("snkPersonalizedFilter.operador.or"):void 0}getDataGroupLevel(){return this._element.getAttribute("data-group-level")}canAddGroup(){return Number(this.getDataGroupLevel()||this.FIRST_LEVEL)<this.LIMIT_GROUP_LEVEL}isFirstLevel(){return Boolean(this.getDataGroupLevel()===this.FIRST_LEVEL)}onStopPropagation(i){i.preventDefault(),i.stopPropagation()}getMessageAddTooltip(){if(this.isFirstLevel()){const i=this.group.items.every((i=>!(!i.fieldName||!i.operand)&&(i.paramVariable||!!i.value)));return this.getMessage(i?"snkPersonalizedFilter.info.labelAddNewExpression":"snkPersonalizedFilter.info.labelDisabledAddExpressionButton")}return this.getMessage(this.canAddExpression?"snkPersonalizedFilter.info.labelAddNewExpression":"snkPersonalizedFilter.info.labelDisabledAddExpressionButton")}canChangeGroupCondition(){return this._group.items.length+this._group.childrenGroups.length>1}render(){const i=this.canAddGroup();return s(o,null,s("div",{class:!this.isFirstLevel()&&this._showDashes?"dashes":"hidden",style:this.buildGroupStyle()}),s("div",{class:!this.isFirstLevel()&&this._showDashes?"horizontal-dashes":"hidden"}),s("div",{class:"ez-flex ez-flex--align-items-center"},s("div",{class:"snk-expression-group__container-condition ez-flex ez-flex-item--align-center ez-flex--align-items-center","data-condition":this._conditionOperator,title:this.getTooltipMessageForOperator()},s("label",{class:"ez-label ez-padding-right--medium ez-padding-left--medium ez-title--primary"},this.getMessage("snkPersonalizedFilter.info.condition")),s("div",null,s("ez-combo-box",Object.assign({class:"snk-expression-group__container-option",canShowError:!1,mode:"slim",suppressEmptyOption:!0,enabled:this.canChangeGroupCondition(),value:this._conditionOperator,onEzChange:i=>this.handleConditionOperatorChange(i.detail.value)},{[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`comboBoxConditions_level_${this.getDataGroupLevel()}`}),s("option",{value:r.AND},"E"),s("option",{value:r.OR},"OU")))),s("ez-button",{class:"ez-padding-right--medium ez-padding-left--medium",mode:"icon",iconName:"plus",size:"small",enabled:this.canAddExpression,title:this.getMessageAddTooltip(),onClick:()=>this.handleAddExpression()}),s("ez-button",{label:this.getMessage("snkPersonalizedFilter.info.addGroup"),size:"small",enabled:i,title:i?"":this.getMessage("snkPersonalizedFilter.info.labelDisabledAddGroupButton",{LIMIT_GROUP_LEVEL:this.LIMIT_GROUP_LEVEL+1}),onClick:()=>this.handleAddGroup()},s("ez-icon",{slot:"leftIcon",iconName:"plus"})),!this.isFirstLevel()&&s("ez-button",{title:this.getMessage("snkPersonalizedFilter.info.labelDeleteExpression"),class:"ez-padding-left--medium",mode:"icon",iconName:"delete",size:"small",onClick:i=>this.confirmRemoveGroup(i)})),s("div",{class:"ez-padding-top--small snk-expression-group__container-expression"},s("div",{class:"ez-padding-top--small"},this.renderExpressionItems())),s("div",{class:"ez-padding-top--small snk-expression-group__container-expression"},s("div",{class:"ez-padding-top--small"},this.renderGroups())))}get _element(){return n(this)}static get watchers(){return{group:["watchGroup"]}}};p.style='.sc-snk-expression-group-h{display:block;--snk-expression-group--container-condition--width:184px;--snk-expression-group--container-condition--height:38px;--snk-expression-group--container-condition--border-radius:var(--border--radius-medium, 12px);--snk-expression-group--container-option--width:85px;--snk-expression-group__container-condition--background-and:#66B6A0;--snk-expression-group__container-condition--background-or:#EBC65E;--snk-expression-group__container-expression--padding-left:26px;--snk-expression-group__background-color-dashed:var(--background--body, #fafcff)}.snk-expression-group__container-condition.sc-snk-expression-group{width:var(--snk-expression-group--container-condition--width);height:var(--snk-expression-group--container-condition--height);border-radius:var(--snk-expression-group--container-condition--border-radius);z-index:var(--more-visible--2x, 3)}.snk-expression-group__container-option.sc-snk-expression-group{width:var(--snk-expression-group--container-option--width)}.snk-expression-group__container-condition[data-condition="AND"].sc-snk-expression-group{background-color:var(--snk-expression-group__container-condition--background-and)}.snk-expression-group__container-condition[data-condition="OR"].sc-snk-expression-group{background-color:var(--snk-expression-group__container-condition--background-or)}.snk-expression-group__container-expression.sc-snk-expression-group{padding-left:var(--snk-expression-group__container-expression--padding-left)}.dashes.sc-snk-expression-group{z-index:var(--visible, 1);background:var(--snk-expression-group__background-color-dashed);border-left:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:58px;margin-left:-15px;margin-top:-36.5px}.horizontal-dashes.sc-snk-expression-group{z-index:var(--more-visible, 2);border-bottom:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:54px;margin-left:-15px;margin-top:-33.5px}.hidden.sc-snk-expression-group{display:none}';export{p as snk_expression_group}
@@ -1 +0,0 @@
1
- import{r as i,c as e,h as s,F as t,H as l}from"./p-d2d301a6.js";import{StringUtils as n,ObjectUtils as r,ApplicationContext as a}from"@sankhyalabs/core";import{P as o}from"./p-7d68a43a.js";import{P as h,C as d}from"./p-e789eb2d.js";import{ApplicationUtils as p}from"@sankhyalabs/ezui/dist/collection/utils";import{F as c}from"./p-63bff2a8.js";import{s as z}from"./p-6dc031de.js";import"./p-584d7212.js";import"./p-814f9247.js";import"./p-2b449454.js";import"./p-112455b1.js";import"./p-60ad0dea.js";import"./p-744d0fd2.js";const f=class{constructor(s){i(this,s),this.ezCancel=e(this,"ezCancel",7),this.ezSave=e(this,"ezSave",7),this._personalizedFilterFetcher=new h,this._filterMetadataStorage=new Map,this._dataSourceFetcher={fetchData:async i=>{let e=null==i?void 0:i.uri;if(n.isEmpty(e)&&(e=this.entityUri),!this._filterMetadataStorage.has(e)){const i=await this._personalizedFilterFetcher.loadFields(e);this._filterMetadataStorage.set(e,i)}return this._filterMetadataStorage.get(e)}},this._filterAssistentMode=!0,this._filterAssistent=void 0,this.messagesBuilder=void 0,this.entityUri=void 0,this.filterId=void 0,this.configName=void 0}async createPersonalizedFilter(){const i={name:"",active:!0,expression:"",parameters:[],assistent:{id:n.generateUUID(),items:[{id:n.generateUUID(),entityName:"",fieldName:"",description:"",fieldLabel:"Valor",type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null}],childrenGroups:[],operand:c.AND}};this._originalFilterAssistent=r.copy(i),this._filterAssistent=r.copy(i)}loadFilter(i,e){null!=i&&e!=i&&d.get().then((()=>{d.loadPersonalizedFilter(i,this.configName).then((i=>{const e=this.addLabelToItems(i);this._filterAssistent=e,this._originalFilterAssistent=r.copy(e),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent}))}))}componentWillLoad(){var i;null==z.get(`filterFieldsDataSource.${this.entityUri}`)&&z.set(`filterFieldsDataSource.${this.entityUri}`,this._dataSourceFetcher),this.messagesBuilder||(this._application=a.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder=null===(i=this._application)||void 0===i?void 0:i.messagesBuilder),this.loadFilter(this.filterId,void 0)}getMessage(i,e){return this._application.messagesBuilder.getMessage(i,e)}saveFilter(){d.savePersonalizedFilter(this._filterAssistent,this.configName).then((i=>{this._elButtonSave.enabled=!1,p.info(this.getMessage(`snkPersonalizedFilter.${this._filterAssistent.id?"confirmEdit":"confirmSave"}.title`),{iconName:"check"});const e=Object.assign(Object.assign({},i),this._filterAssistent);e.parameters=o.buildVariableParameters(this._filterAssistent.assistent),this._originalFilterAssistent=r.copy(e),this._filterAssistent=r.copy(e)}))}removeFilter(){d.removePersonalizedFilter(this._filterAssistent,this.configName)}async handleFilterGroupChange(){const i=await this._mainExpressionGroup.getExpressionGroup();this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{assistent:i}),this._filterAssistent.parameters=o.buildVariableParameters(this._filterAssistent.assistent),this._elTextAreaExpression.value=o.buildGroupExpression(this._filterAssistent.assistent,!0),this._elButtonSave.enabled=!this.hasChangesToSave()}hasChangesToSave(){return JSON.stringify(this._filterAssistent)===JSON.stringify(this._originalFilterAssistent)}handleSave(){const{assistent:i,expression:e}=this._filterAssistent;if(!o.validateFields(i)||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));const s=i?o.buildGroupExpression(i):e;this._filterAssistent.expression=s,this.ezSave.emit(s),this.saveFilter()}handleCancel(){if(this.hasChangesToSave())return this.ezCancel.emit();p.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"),this.getMessage("snkPersonalizedFilter.confirmCancel.description")).then((i=>{var e;i&&(this._filterAssistent=r.copy(null!==(e=this._originalFilterAssistent)&&void 0!==e?e:{}),this.ezCancel.emit(),this._elButtonSave.enabled=!1)}))}handleTitleChange(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{name:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}addLabelToItems(i){return i.assistent&&i.assistent.items&&i.assistent.items.length>0&&i.assistent.items.forEach((e=>{if(null==e.fieldLabel){const s=(i.parameters||[]).find((i=>i.fieldName===e.fieldName));s&&(e.fieldLabel=s.label)}})),i}handleExpressionChange(i){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:i}),this._elButtonSave.enabled=!this.hasChangesToSave()}getWarningMessageComponent(){var i;if(!n.isEmpty(null===(i=this._filterAssistent)||void 0===i?void 0:i.warningMessage))return s("div",{class:"ez-flex"},s("ez-alert",{alertType:"warn"},this._filterAssistent.warningMessage))}buildContainerPersonalizedFilter(){var i,e,l;return this._filterAssistentMode?s(t,null,s("div",{class:"ez-padding-top--small snk-personalized-filter__group"},s("snk-expression-group",{ref:i=>this._mainExpressionGroup=i,group:null===(i=this._filterAssistent)||void 0===i?void 0:i.assistent,messagesBuilder:this.messagesBuilder,onEzFilterGroupChange:this.handleFilterGroupChange.bind(this),filterId:this.filterId,entityURI:this.entityUri})),s("div",null,s("div",{class:"snk-personalized-filter__expression-input--line"}),s("ez-collapsible-box",{label:this.getMessage("snkPersonalizedFilter.info.titleCollapsible"),headerSize:"medium",value:!0},s("div",{class:"ez-box"},s("div",{class:"ez-box__container"},s("ez-text-area",{ref:i=>this._elTextAreaExpression=i,enabled:!1,label:this.getMessage("snkPersonalizedFilter.info.labelExpression"),value:null===(e=this._filterAssistent)||void 0===e?void 0:e.expression})))))):s(t,null,s("span",{class:"ez-text ez-text--small ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkPersonalizedFilter.info.applyExpression")),s("ez-text-area",{label:this.getMessage("snkPersonalizedFilter.info.labelExpression"),value:null===(l=this._filterAssistent)||void 0===l?void 0:l.expression,onEzChange:i=>this.handleExpressionChange(i.detail)}),this.getWarningMessageComponent())}render(){var i,e;if((null===(i=this._filterAssistent)||void 0===i?void 0:i.assistent)||!this._filterAssistentMode)return s(l,null,s("div",{class:"snk-personalized-filter"},s("div",null,s("snk-simple-bar",{label:this.getMessage(this.filterId?"snkPersonalizedFilter.info.titleEdit":"snkPersonalizedFilter.info.titleAdd"),onExit:()=>this.handleCancel()},s("div",{class:"snk-personalized-filter__header-actions",slot:"rightSlot"},s("ez-button",{size:"small",label:this.getMessage("snkPersonalizedFilter.info.labelCancel"),onClick:()=>this.handleCancel()}),s("ez-button",{size:"small",ref:i=>this._elButtonSave=i,enabled:!1,class:"ez-button--primary",label:this.getMessage("snkPersonalizedFilter.info.labelSave"),onClick:this.handleSave.bind(this)})))),s("div",{class:"ez-box ez-margin-bottom--medium ez-box__main"},s("div",{class:"ez-box__container"},s("div",{class:"ez-flex ez-flex--column ez-size-width--full"},s("div",{class:"ez-flex"},s("ez-text-input",{class:"ez-padding-right--medium",label:this.getMessage("snkPersonalizedFilter.info.labelNameFilter"),value:null===(e=this._filterAssistent)||void 0===e?void 0:e.name,onEzChange:i=>this.handleTitleChange(i.detail)})),this.buildContainerPersonalizedFilter())))))}static get watchers(){return{filterId:["loadFilter"]}}};f.style=".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}";export{f as snk_personalized_filter}