@vmscloud/moz-ui-grid-vue 0.1.41

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 (213) hide show
  1. package/README.md +71 -0
  2. package/dist/MozGrid.vue.d.ts +127 -0
  3. package/dist/bridge/VueRenderer.d.ts +37 -0
  4. package/dist/bridge/fieldBuilder.d.ts +9 -0
  5. package/dist/bridge/lifecycle.d.ts +6 -0
  6. package/dist/bridge/templateRegistry.d.ts +8 -0
  7. package/dist/chunks/index-BDQ0HlwR.js +3404 -0
  8. package/dist/chunks/index-D5KJLBGW.cjs +14 -0
  9. package/dist/chunks/notification.contract-BTOch6ed.js +16 -0
  10. package/dist/chunks/notification.contract-oFkBaE2U.cjs +1 -0
  11. package/dist/compat/MozGridVue.vue.d.ts +645 -0
  12. package/dist/compat/MozPivotVue.vue.d.ts +606 -0
  13. package/dist/compat/index.d.ts +9 -0
  14. package/dist/compat/legacyGridAliases.d.ts +8 -0
  15. package/dist/composables/useGridPreset.d.ts +19 -0
  16. package/dist/contracts/UserLayoutInstance.d.ts +38 -0
  17. package/dist/contracts/notification.contract.d.ts +41 -0
  18. package/dist/contracts/userLayout.contract.d.ts +16 -0
  19. package/dist/index.cjs +26 -0
  20. package/dist/index.d.ts +24 -0
  21. package/dist/index.js +90599 -0
  22. package/dist/legacy/components/common/Dragging.d.ts +17 -0
  23. package/dist/legacy/components/common/Dragging.vue.d.ts +49 -0
  24. package/dist/legacy/components/common/custom-cell/FormulaEngine.d.ts +256 -0
  25. package/dist/legacy/components/common/custom-cell/FormulaInput.vue.d.ts +33 -0
  26. package/dist/legacy/components/common/custom-cell/GridCustomCell.vue.d.ts +23 -0
  27. package/dist/legacy/components/common/custom-cell/useFormulaAutocomplete.d.ts +44 -0
  28. package/dist/legacy/components/common/excel/ClientExcelUploadPopup.vue.d.ts +201 -0
  29. package/dist/legacy/components/common/excel/assets/IconDropZone.vue.d.ts +2 -0
  30. package/dist/legacy/components/common/excel/assets/IconFileUpload.vue.d.ts +2 -0
  31. package/dist/legacy/components/common/filter/GridFilter.vue.d.ts +23 -0
  32. package/dist/legacy/components/common/footer/GridFooter.vue.d.ts +29 -0
  33. package/dist/legacy/components/common/sort/GridSort.vue.d.ts +23 -0
  34. package/dist/legacy/components/common/toolbar/GridSearchInput.vue.d.ts +33 -0
  35. package/dist/legacy/components/grid/MozGridVue.vue.d.ts +2041 -0
  36. package/dist/legacy/components/grid/MozGridVueCore.vue.d.ts +118 -0
  37. package/dist/legacy/components/grid/bulk-editor/GridBulkEditor.vue.d.ts +10 -0
  38. package/dist/legacy/components/grid/column-settings/AlignPicker.vue.d.ts +10 -0
  39. package/dist/legacy/components/grid/column-settings/ColorSwatchPicker.vue.d.ts +11 -0
  40. package/dist/legacy/components/grid/column-settings/ColumnListItem.vue.d.ts +17 -0
  41. package/dist/legacy/components/grid/column-settings/ColumnOptionsPanel.vue.d.ts +32 -0
  42. package/dist/legacy/components/grid/column-settings/FontSizePicker.vue.d.ts +10 -0
  43. package/dist/legacy/components/grid/column-settings/FontStyleToggles.vue.d.ts +15 -0
  44. package/dist/legacy/components/grid/column-settings/MaskPresetPicker.vue.d.ts +14 -0
  45. package/dist/legacy/components/grid/context-menu/GridContextMenu.vue.d.ts +208 -0
  46. package/dist/legacy/components/grid/group-panel/GroupPanel.vue.d.ts +18 -0
  47. package/dist/legacy/components/grid/toolbar/ColumnPicker.vue.d.ts +17 -0
  48. package/dist/legacy/components/grid/toolbar/ColumnSettings.vue.d.ts +30 -0
  49. package/dist/legacy/components/grid/toolbar/GridOptionModal.vue.d.ts +211 -0
  50. package/dist/legacy/components/grid/toolbar/GridToolBox.vue.d.ts +69 -0
  51. package/dist/legacy/components/pivot/MozPivotVue.vue.d.ts +1868 -0
  52. package/dist/legacy/components/pivot/PivotContextMenu.vue.d.ts +634 -0
  53. package/dist/legacy/components/pivot/PivotFieldChip.vue.d.ts +16 -0
  54. package/dist/legacy/components/pivot/PivotFieldDropZone.vue.d.ts +26 -0
  55. package/dist/legacy/components/pivot/PivotFieldPanel.vue.d.ts +28 -0
  56. package/dist/legacy/components/pivot/PivotOptionModal.vue.d.ts +534 -0
  57. package/dist/legacy/components/pivot/PivotToolBox.vue.d.ts +79 -0
  58. package/dist/legacy/components/pivot/chart/EChart.vue.d.ts +13 -0
  59. package/dist/legacy/components/pivot/chart/MozPivotChart.types.d.ts +16 -0
  60. package/dist/legacy/components/pivot/chart/MozPivotChart.vue.d.ts +14 -0
  61. package/dist/legacy/components/pivot/chart/PivotChartDetail.vue.d.ts +13 -0
  62. package/dist/legacy/components/pivot/chart/PivotChartMini.vue.d.ts +18 -0
  63. package/dist/legacy/components/pivot/chart/PivotChartMultiple.vue.d.ts +18 -0
  64. package/dist/legacy/components/pivot/chart/PivotChartToolbar.vue.d.ts +38 -0
  65. package/dist/legacy/components/pivot/chart/chartUtils.d.ts +45 -0
  66. package/dist/legacy/components/pivot/chart/useChartData.d.ts +35 -0
  67. package/dist/legacy/composables/useCellTooltip.d.ts +8 -0
  68. package/dist/legacy/composables/useClientExcelExport.d.ts +24 -0
  69. package/dist/legacy/composables/useClientExcelStore.d.ts +16 -0
  70. package/dist/legacy/composables/useColumnFormatter.d.ts +45 -0
  71. package/dist/legacy/composables/useColumnSettings.d.ts +35 -0
  72. package/dist/legacy/composables/useContextMenu.d.ts +71 -0
  73. package/dist/legacy/composables/useGridBulkEditor.d.ts +36 -0
  74. package/dist/legacy/composables/useGridChanges.d.ts +28 -0
  75. package/dist/legacy/composables/useGridColumns.d.ts +37 -0
  76. package/dist/legacy/composables/useGridCustomCell.d.ts +34 -0
  77. package/dist/legacy/composables/useGridEvents.d.ts +14 -0
  78. package/dist/legacy/composables/useGridFilter.d.ts +38 -0
  79. package/dist/legacy/composables/useGridInstance.d.ts +16 -0
  80. package/dist/legacy/composables/useGridSelect.d.ts +18 -0
  81. package/dist/legacy/composables/useGridSelection.d.ts +18 -0
  82. package/dist/legacy/composables/useGridSort.d.ts +38 -0
  83. package/dist/legacy/composables/useGridUndoRedo.d.ts +28 -0
  84. package/dist/legacy/composables/useGridValidation.d.ts +28 -0
  85. package/dist/legacy/composables/useMaskPresets.d.ts +38 -0
  86. package/dist/legacy/composables/useSearchHighlight.d.ts +12 -0
  87. package/dist/legacy/icons/IconAdd.vue.d.ts +11 -0
  88. package/dist/legacy/icons/IconArrowDownWithTail.vue.d.ts +11 -0
  89. package/dist/legacy/icons/IconArrowLeft.vue.d.ts +11 -0
  90. package/dist/legacy/icons/IconArrowLeftWithTail.vue.d.ts +11 -0
  91. package/dist/legacy/icons/IconArrowRight.vue.d.ts +11 -0
  92. package/dist/legacy/icons/IconArrowUpCenter.vue.d.ts +11 -0
  93. package/dist/legacy/icons/IconArrowUpWithTail.vue.d.ts +11 -0
  94. package/dist/legacy/icons/IconChart.vue.d.ts +11 -0
  95. package/dist/legacy/icons/IconClose.vue.d.ts +13 -0
  96. package/dist/legacy/icons/IconColorPicker.vue.d.ts +11 -0
  97. package/dist/legacy/icons/IconCustomCell.vue.d.ts +11 -0
  98. package/dist/legacy/icons/IconDecide.vue.d.ts +11 -0
  99. package/dist/legacy/icons/IconDownload.vue.d.ts +11 -0
  100. package/dist/legacy/icons/IconDragHandler.vue.d.ts +11 -0
  101. package/dist/legacy/icons/IconFilter.vue.d.ts +11 -0
  102. package/dist/legacy/icons/IconInfoFilled.vue.d.ts +11 -0
  103. package/dist/legacy/icons/IconRedo.vue.d.ts +9 -0
  104. package/dist/legacy/icons/IconReset.vue.d.ts +9 -0
  105. package/dist/legacy/icons/IconResetGridToolbar.vue.d.ts +11 -0
  106. package/dist/legacy/icons/IconSearch.vue.d.ts +11 -0
  107. package/dist/legacy/icons/IconSetting.vue.d.ts +11 -0
  108. package/dist/legacy/icons/IconSettingFilled.vue.d.ts +11 -0
  109. package/dist/legacy/icons/IconSort.vue.d.ts +11 -0
  110. package/dist/legacy/icons/IconToastWarning.vue.d.ts +11 -0
  111. package/dist/legacy/icons/IconUndo.vue.d.ts +9 -0
  112. package/dist/legacy/icons/index.d.ts +25 -0
  113. package/dist/legacy/index.d.ts +69 -0
  114. package/dist/legacy/shared/colorPresets.d.ts +36 -0
  115. package/dist/legacy/store/UploadRefreshRegistry.d.ts +5 -0
  116. package/dist/legacy/store/excelStore.d.ts +89 -0
  117. package/dist/legacy/store/index.d.ts +231 -0
  118. package/dist/legacy/stores/index.d.ts +2 -0
  119. package/dist/legacy/stores/projectInfo/projectInfo.contract.d.ts +130 -0
  120. package/dist/legacy/stories/Autofit.stories.d.ts +9 -0
  121. package/dist/legacy/stories/CRUD.stories.d.ts +9 -0
  122. package/dist/legacy/stories/CellAttributes.stories.d.ts +19 -0
  123. package/dist/legacy/stories/CellMask.stories.d.ts +19 -0
  124. package/dist/legacy/stories/ClientExcel.stories.d.ts +8 -0
  125. package/dist/legacy/stories/Clipboard.stories.d.ts +12 -0
  126. package/dist/legacy/stories/ColumnVisibility.stories.d.ts +12 -0
  127. package/dist/legacy/stories/ColumnWidths.stories.d.ts +11 -0
  128. package/dist/legacy/stories/CustomSortFilter.stories.d.ts +7 -0
  129. package/dist/legacy/stories/DynamicRowHeight.stories.d.ts +13 -0
  130. package/dist/legacy/stories/Editors.stories.d.ts +9 -0
  131. package/dist/legacy/stories/EmptyState.stories.d.ts +10 -0
  132. package/dist/legacy/stories/FormatRow.stories.d.ts +20 -0
  133. package/dist/legacy/stories/Grouping.stories.d.ts +14 -0
  134. package/dist/legacy/stories/HeaderGroup.stories.d.ts +11 -0
  135. package/dist/legacy/stories/LargeData.stories.d.ts +19 -0
  136. package/dist/legacy/stories/MasterDetail.stories.d.ts +17 -0
  137. package/dist/legacy/stories/Merge.stories.d.ts +10 -0
  138. package/dist/legacy/stories/MultiRow.stories.d.ts +12 -0
  139. package/dist/legacy/stories/MultiRowCrud.stories.d.ts +11 -0
  140. package/dist/legacy/stories/MultiRowGroup.stories.d.ts +11 -0
  141. package/dist/legacy/stories/Pinning.stories.d.ts +44 -0
  142. package/dist/legacy/stories/Pivot.stories.d.ts +23 -0
  143. package/dist/legacy/stories/PivotAdvanced.stories.d.ts +20 -0
  144. package/dist/legacy/stories/PivotChart.stories.d.ts +23 -0
  145. package/dist/legacy/stories/PivotNonNumeric.stories.d.ts +27 -0
  146. package/dist/legacy/stories/Preset.stories.d.ts +11 -0
  147. package/dist/legacy/stories/ReactiveAPI.stories.d.ts +8 -0
  148. package/dist/legacy/stories/ReactiveSafety.stories.d.ts +28 -0
  149. package/dist/legacy/stories/Repro.stories.d.ts +36 -0
  150. package/dist/legacy/stories/RowAPI.stories.d.ts +12 -0
  151. package/dist/legacy/stories/SelectionModes.stories.d.ts +35 -0
  152. package/dist/legacy/stories/Streaming.stories.d.ts +12 -0
  153. package/dist/legacy/stories/Tree.stories.d.ts +13 -0
  154. package/dist/legacy/stories/WorkerMode.stories.d.ts +15 -0
  155. package/dist/legacy/stories/_helpers/localDataLoader.d.ts +7 -0
  156. package/dist/legacy/stories/_helpers/sampleData.d.ts +117 -0
  157. package/dist/legacy/types/FileParameter.d.ts +31 -0
  158. package/dist/legacy/types/StreamingParameter.d.ts +18 -0
  159. package/dist/legacy/types/excel.types.d.ts +48 -0
  160. package/dist/legacy/types/index.d.ts +10 -0
  161. package/dist/legacy/types/pivot-props.d.ts +140 -0
  162. package/dist/legacy/types/props.d.ts +176 -0
  163. package/dist/legacy/types/toolbar.d.ts +225 -0
  164. package/dist/legacy/utils/async/debounce.d.ts +4 -0
  165. package/dist/legacy/utils/crypto/crypto.d.ts +7 -0
  166. package/dist/legacy/utils/dialog/dialog.d.ts +19 -0
  167. package/dist/legacy/utils/excel/ExcelGuard.d.ts +73 -0
  168. package/dist/legacy/utils/excel/ExcelImportUtil.d.ts +34 -0
  169. package/dist/legacy/utils/excel/ExcelQueueManager.d.ts +57 -0
  170. package/dist/legacy/utils/excel/ExcelTaskRunner.d.ts +17 -0
  171. package/dist/legacy/utils/excel/ExcelTimeoutManager.d.ts +37 -0
  172. package/dist/legacy/utils/file.d.ts +34 -0
  173. package/dist/legacy/utils/http/rest.d.ts +5 -0
  174. package/dist/legacy/utils/id/generator.d.ts +2 -0
  175. package/dist/legacy/utils/index.d.ts +10 -0
  176. package/dist/store.cjs +1 -0
  177. package/dist/store.js +8 -0
  178. package/dist/stories/ColumnLockVisible.stories.d.ts +42 -0
  179. package/dist/stories/DateBooleanFilter.stories.d.ts +42 -0
  180. package/dist/stories/DisplayedRowApi.stories.d.ts +28 -0
  181. package/dist/stories/FieldId.stories.d.ts +113 -0
  182. package/dist/stories/GroupPanelWithoutToolbox.stories.d.ts +28 -0
  183. package/dist/stories/GroupRowRecycle.stories.d.ts +45 -0
  184. package/dist/stories/GroupTreeExpandNav.stories.d.ts +41 -0
  185. package/dist/stories/LargeData.stories.d.ts +20 -0
  186. package/dist/stories/MozGrid.stories.d.ts +51 -0
  187. package/dist/stories/PivotBarInitiallyOpen.stories.d.ts +69 -0
  188. package/dist/stories/PivotBarWithoutToolbox.stories.d.ts +39 -0
  189. package/dist/stories/SelectionApiPlayground.stories.d.ts +28 -0
  190. package/dist/stories/SingleSelectionModes.stories.d.ts +47 -0
  191. package/dist/stories/WideColumns.stories.d.ts +17 -0
  192. package/dist/style.css +1 -0
  193. package/dist/templates/CellEditor.d.ts +27 -0
  194. package/dist/templates/CellTemplate.d.ts +27 -0
  195. package/dist/templates/DetailTemplate.d.ts +60 -0
  196. package/dist/templates/GroupTemplate.d.ts +17 -0
  197. package/dist/templates/HeaderTemplate.d.ts +25 -0
  198. package/dist/types/injection-keys.d.ts +24 -0
  199. package/dist/types/slots.d.ts +49 -0
  200. package/dist/utils/excel/ExcelGuard.cjs +1 -0
  201. package/dist/utils/excel/ExcelGuard.js +74 -0
  202. package/dist/utils/excel/ExcelImportUtil.cjs +1 -0
  203. package/dist/utils/excel/ExcelImportUtil.js +61 -0
  204. package/dist/utils/excel/ExcelQueueManager.cjs +1 -0
  205. package/dist/utils/excel/ExcelQueueManager.js +10 -0
  206. package/dist/utils/excel/ExcelTaskRunner.cjs +1 -0
  207. package/dist/utils/excel/ExcelTaskRunner.js +12 -0
  208. package/dist/utils/excel/ExcelTimeoutManager.cjs +1 -0
  209. package/dist/utils/excel/ExcelTimeoutManager.js +420 -0
  210. package/docs/manual/examples.md +2385 -0
  211. package/docs/manual/reference.md +4695 -0
  212. package/docs/manual/reference_vue.md +709 -0
  213. package/package.json +129 -0
@@ -0,0 +1,14 @@
1
+ "use strict";var t=Object.defineProperty,e=(e,i,r)=>((e,i,r)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r)(e,"symbol"!=typeof i?i+"":i,r);const i=require("pinia"),r=require("file-saver"),n=require("@vmscloud/moz-ui-components"),s=require("vue"),o=require("axios"),f=1,h=2,a=3,l=4;class u{constructor(t,i){e(this,"sessionId"),e(this,"name",""),e(this,"path",""),e(this,"saveDir",""),e(this,"size",0),e(this,"file"),e(this,"info"),e(this,"type","Upload"),e(this,"offset",0),e(this,"isComplete",!1),e(this,"isCancelable",!1),e(this,"isCanceled",!1),e(this,"blobInfo"),e(this,"onCompleted"),e(this,"onCancelClick"),this.type=t,this.sessionId=i}get ipcObject(){return{sessionId:this.sessionId,name:this.name,path:this.path,saveDir:this.saveDir,size:this.size,info:this.info}}get totalSize(){var t,e;return"Upload"===this.type?+((null==(t=this.file)?void 0:t.size)||this.size):+((null==(e=this.info)?void 0:e.length)||0)}get percent(){return 0===this.offset||0===this.totalSize?0:Math.round(this.offset/this.totalSize*100)}get progressValue(){return+this.offset}get status(){return`${this.percent}% (${this.formatSizeUnits(this.offset)}/${this.formatSizeUnits(this.totalSize)})`}completed(t){this.isCancelable=!1,this.isComplete=!0,this.blobInfo=t,this.onCompleted&&this.onCompleted(this)}formatSizeUnits(t){let e="";return e=t>=1073741824?(t/1073741824).toFixed(2)+" GB":t>=1048576?(t/1048576).toFixed(2)+" MB":t>=1024?(t/1024).toFixed(2)+" KB":t>1?`${t} bytes`:1===t?`${t} byte`:"0 bytes",e}}const g=()=>{const t=()=>(65536*(1+Math.random())|0).toString(16).substring(1);return`${t()+t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`.toUpperCase()};function v(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var c,d,w,b,y,p={exports:{}},m={exports:{}},E=m.exports;const I=v((d||(d=1,
2
+ /**
3
+ * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io>
4
+ * Backing buffer: ArrayBuffer, Accessor: Uint8Array
5
+ * Released under the Apache License, Version 2.0
6
+ * see: https://github.com/dcodeIO/bytebuffer.js for details
7
+ */
8
+ b=p.exports,y=function(t){var e=function(t,i,n){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===i&&(i=e.DEFAULT_ENDIAN),void 0===n&&(n=e.DEFAULT_NOASSERT),!n){if((t|=0)<0)throw RangeError("Illegal capacity");i=!!i,n=!!n}this.buffer=0===t?r:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=i,this.noAssert=n};e.VERSION="5.0.1",e.LITTLE_ENDIAN=!0,e.BIG_ENDIAN=!1,e.DEFAULT_CAPACITY=16,e.DEFAULT_ENDIAN=e.BIG_ENDIAN,e.DEFAULT_NOASSERT=!1,e.Long=t||null;var i=e.prototype;i.__isByteBuffer__,Object.defineProperty(i,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var r=new ArrayBuffer(0),n=String.fromCharCode;function s(t){var e=0;return function(){return e<t.length?t.charCodeAt(e++):null}}function o(){var t=[],e=[];return function(){if(0===arguments.length)return e.join("")+n.apply(String,t);t.length+arguments.length>1024&&(e.push(n.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function f(t,e,i,r,n){var s,o,f=8*n-r-1,h=(1<<f)-1,a=h>>1,l=-7,u=i?n-1:0,g=i?-1:1,v=t[e+u];for(u+=g,s=v&(1<<-l)-1,v>>=-l,l+=f;l>0;s=256*s+t[e+u],u+=g,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+u],u+=g,l-=8);if(0===s)s=1-a;else{if(s===h)return o?NaN:1/0*(v?-1:1);o+=Math.pow(2,r),s-=a}return(v?-1:1)*o*Math.pow(2,s-r)}function h(t,e,i,r,n,s){var o,f,h,a=8*s-n-1,l=(1<<a)-1,u=l>>1,g=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:s-1,c=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),(e+=o+u>=1?g/h:g*Math.pow(2,1-u))*h>=2&&(o++,h/=2),o+u>=l?(f=0,o=l):o+u>=1?(f=(e*h-1)*Math.pow(2,n),o+=u):(f=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;t[i+v]=255&f,v+=c,f/=256,n-=8);for(o=o<<n|f,a+=n;a>0;t[i+v]=255&o,v+=c,o/=256,a-=8);t[i+v-c]|=128*d}e.accessor=function(){return Uint8Array},e.allocate=function(t,i,r){return new e(t,i,r)},e.concat=function(t,i,r,n){"boolean"!=typeof i&&"string"==typeof i||(n=r,r=i,i=void 0);for(var s,o=0,f=0,h=t.length;f<h;++f)e.isByteBuffer(t[f])||(t[f]=e.wrap(t[f],i)),(s=t[f].limit-t[f].offset)>0&&(o+=s);if(0===o)return new e(0,r,n);var a,l=new e(o,r,n);for(f=0;f<h;)(s=(a=t[f++]).limit-a.offset)<=0||(l.view.set(a.view.subarray(a.offset,a.limit),l.offset),l.offset+=s);return l.limit=l.offset,l.offset=0,l},e.isByteBuffer=function(t){return!0===(t&&t.__isByteBuffer__)},e.type=function(){return ArrayBuffer},e.wrap=function(t,r,n,s){if("string"!=typeof r&&(s=n,n=r,r=void 0),"string"==typeof t)switch(void 0===r&&(r="utf8"),r){case"base64":return e.fromBase64(t,n);case"hex":return e.fromHex(t,n);case"binary":return e.fromBinary(t,n);case"utf8":return e.fromUTF8(t,n);case"debug":return e.fromDebug(t,n);default:throw Error("Unsupported encoding: "+r)}if(null===t||"object"!=typeof t)throw TypeError("Illegal buffer");var o;if(e.isByteBuffer(t))return(o=i.clone.call(t)).markedOffset=-1,o;if(t instanceof Uint8Array)o=new e(0,n,s),t.length>0&&(o.buffer=t.buffer,o.offset=t.byteOffset,o.limit=t.byteOffset+t.byteLength,o.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)o=new e(0,n,s),t.byteLength>0&&(o.buffer=t,o.offset=0,o.limit=t.byteLength,o.view=t.byteLength>0?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");(o=new e(t.length,n,s)).limit=t.length;for(var f=0;f<t.length;++f)o.view[f]=t[f]}return o},i.writeBitSet=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if(!(t instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var r,n=e,s=t.length,o=s>>3,f=0;for(e+=this.writeVarint32(s,e);o--;)r=1&!!t[f++]|(1&!!t[f++])<<1|(1&!!t[f++])<<2|(1&!!t[f++])<<3|(1&!!t[f++])<<4|(1&!!t[f++])<<5|(1&!!t[f++])<<6|(1&!!t[f++])<<7,this.writeByte(r,e++);if(f<s){var h=0;for(r=0;f<s;)r|=(1&!!t[f++])<<h++;this.writeByte(r,e++)}return i?(this.offset=e,this):e-n},i.readBitSet=function(t){var e=void 0===t;e&&(t=this.offset);var i,r=this.readVarint32(t),n=r.value,s=n>>3,o=0,f=[];for(t+=r.length;s--;)i=this.readByte(t++),f[o++]=!!(1&i),f[o++]=!!(2&i),f[o++]=!!(4&i),f[o++]=!!(8&i),f[o++]=!!(16&i),f[o++]=!!(32&i),f[o++]=!!(64&i),f[o++]=!!(128&i);if(o<n){var h=0;for(i=this.readByte(t++);o<n;)f[o++]=!!(i>>h++&1)}return e&&(this.offset=t),f},i.readBytes=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var r=this.slice(e,e+t);return i&&(this.offset+=t),r},i.writeBytes=i.append,i.writeInt8=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=1,this.view[e]=t,i&&(this.offset+=1),this},i.writeByte=i.writeInt8,i.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=this.view[t];return 128&~i||(i=-(255-i+1)),e&&(this.offset+=1),i},i.readByte=i.readInt8,i.writeUint8=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=1,this.view[e]=t,i&&(this.offset+=1),this},i.writeUInt8=i.writeUint8,i.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=this.view[t];return e&&(this.offset+=1),i},i.readUInt8=i.readUint8,i.writeInt16=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),i&&(this.offset+=2),this},i.writeShort=i.writeInt16,i.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t],i|=this.view[t+1]<<8):(i=this.view[t]<<8,i|=this.view[t+1]),32768&~i||(i=-(65535-i+1)),e&&(this.offset+=2),i},i.readShort=i.readInt16,i.writeUint16=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),i&&(this.offset+=2),this},i.writeUInt16=i.writeUint16,i.readUint16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t],i|=this.view[t+1]<<8):(i=this.view[t]<<8,i|=this.view[t+1]),e&&(this.offset+=2),i},i.readUInt16=i.readUint16,i.writeInt32=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),i&&(this.offset+=4),this},i.writeInt=i.writeInt32,i.readInt32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0),i|=0,e&&(this.offset+=4),i},i.readInt=i.readInt32,i.writeUint32=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),i&&(this.offset+=4),this},i.writeUInt32=i.writeUint32,i.readUint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0),e&&(this.offset+=4),i},i.readUInt32=i.readUint32,t&&(i.writeInt64=function(e,i){var r=void 0===i;if(r&&(i=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),i+=8;var n=this.buffer.byteLength;i>n&&this.resize((n*=2)>i?n:i),i-=8;var s=e.low,o=e.high;return this.littleEndian?(this.view[i+3]=s>>>24&255,this.view[i+2]=s>>>16&255,this.view[i+1]=s>>>8&255,this.view[i]=255&s,i+=4,this.view[i+3]=o>>>24&255,this.view[i+2]=o>>>16&255,this.view[i+1]=o>>>8&255,this.view[i]=255&o):(this.view[i]=o>>>24&255,this.view[i+1]=o>>>16&255,this.view[i+2]=o>>>8&255,this.view[i+3]=255&o,i+=4,this.view[i]=s>>>24&255,this.view[i+1]=s>>>16&255,this.view[i+2]=s>>>8&255,this.view[i+3]=255&s),r&&(this.offset+=8),this},i.writeLong=i.writeInt64,i.readInt64=function(e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=0,n=0;this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0,e+=4,n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0,e+=4,r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0);var s=new t(r,n,!1);return i&&(this.offset+=8),s},i.readLong=i.readInt64,i.writeUint64=function(e,i){var r=void 0===i;if(r&&(i=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),i+=8;var n=this.buffer.byteLength;i>n&&this.resize((n*=2)>i?n:i),i-=8;var s=e.low,o=e.high;return this.littleEndian?(this.view[i+3]=s>>>24&255,this.view[i+2]=s>>>16&255,this.view[i+1]=s>>>8&255,this.view[i]=255&s,i+=4,this.view[i+3]=o>>>24&255,this.view[i+2]=o>>>16&255,this.view[i+1]=o>>>8&255,this.view[i]=255&o):(this.view[i]=o>>>24&255,this.view[i+1]=o>>>16&255,this.view[i+2]=o>>>8&255,this.view[i+3]=255&o,i+=4,this.view[i]=s>>>24&255,this.view[i+1]=s>>>16&255,this.view[i+2]=s>>>8&255,this.view[i+3]=255&s),r&&(this.offset+=8),this},i.writeUInt64=i.writeUint64,i.readUint64=function(e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=0,n=0;this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0,e+=4,n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0,e+=4,r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0);var s=new t(r,n,!0);return i&&(this.offset+=8),s},i.readUInt64=i.readUint64),i.writeFloat32=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=4,h(this.view,t,e,this.littleEndian,23,4),i&&(this.offset+=4),this},i.writeFloat=i.writeFloat32,i.readFloat32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=f(this.view,t,this.littleEndian,23,4);return e&&(this.offset+=4),i},i.readFloat=i.readFloat32,i.writeFloat64=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=8;var r=this.buffer.byteLength;return e>r&&this.resize((r*=2)>e?r:e),e-=8,h(this.view,t,e,this.littleEndian,52,8),i&&(this.offset+=8),this},i.writeDouble=i.writeFloat64,i.readFloat64=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=f(this.view,t,this.littleEndian,52,8);return e&&(this.offset+=8),i},i.readDouble=i.readFloat64,e.MAX_VARINT32_BYTES=5,e.calculateVarint32=function(t){return(t>>>=0)<128?1:t<16384?2:t<1<<21?3:t<1<<28?4:5},e.zigZagEncode32=function(t){return((t|=0)<<1^t>>31)>>>0},e.zigZagDecode32=function(t){return t>>>1^-(1&t)},i.writeVarint32=function(t,i){var r=void 0===i;if(r&&(i=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var n,s=e.calculateVarint32(t);i+=s;var o=this.buffer.byteLength;for(i>o&&this.resize((o*=2)>i?o:i),i-=s,t>>>=0;t>=128;)n=127&t|128,this.view[i++]=n,t>>>=7;return this.view[i++]=t,r?(this.offset=i,this):s},i.writeVarint32ZigZag=function(t,i){return this.writeVarint32(e.zigZagEncode32(t),i)},i.readVarint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i,r=0,n=0;do{if(!this.noAssert&&t>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}i=this.view[t++],r<5&&(n|=(127&i)<<7*r),++r}while(128&i);return n|=0,e?(this.offset=t,n):{value:n,length:r}},i.readVarint32ZigZag=function(t){var i=this.readVarint32(t);return"object"==typeof i?i.value=e.zigZagDecode32(i.value):i=e.zigZagDecode32(i),i},t&&(e.MAX_VARINT64_BYTES=10,e.calculateVarint64=function(e){"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e));var i=e.toInt()>>>0,r=e.shiftRightUnsigned(28).toInt()>>>0,n=e.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==r?i<16384?i<128?1:2:i<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:n<128?9:10},e.zigZagEncode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},e.zigZagDecode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(t.ONE).toSigned().negate()).toSigned()},i.writeVarint64=function(i,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof i)i=t.fromNumber(i);else if("string"==typeof i)i=t.fromString(i);else if(!(i&&i instanceof t))throw TypeError("Illegal value: "+i+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof i?i=t.fromNumber(i,!1):"string"==typeof i?i=t.fromString(i,!1):!1!==i.unsigned&&(i=i.toSigned());var s=e.calculateVarint64(i),o=i.toInt()>>>0,f=i.shiftRightUnsigned(28).toInt()>>>0,h=i.shiftRightUnsigned(56).toInt()>>>0;r+=s;var a=this.buffer.byteLength;switch(r>a&&this.resize((a*=2)>r?a:r),r-=s,s){case 10:this.view[r+9]=h>>>7&1;case 9:this.view[r+8]=9!==s?128|h:127&h;case 8:this.view[r+7]=8!==s?f>>>21|128:f>>>21&127;case 7:this.view[r+6]=7!==s?f>>>14|128:f>>>14&127;case 6:this.view[r+5]=6!==s?f>>>7|128:f>>>7&127;case 5:this.view[r+4]=5!==s?128|f:127&f;case 4:this.view[r+3]=4!==s?o>>>21|128:o>>>21&127;case 3:this.view[r+2]=3!==s?o>>>14|128:o>>>14&127;case 2:this.view[r+1]=2!==s?o>>>7|128:o>>>7&127;case 1:this.view[r]=1!==s?128|o:127&o}return n?(this.offset+=s,this):s},i.writeVarint64ZigZag=function(t,i){return this.writeVarint64(e.zigZagEncode64(t),i)},i.readVarint64=function(e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=e,n=0,s=0,o=0,f=0;if(n=127&(f=this.view[e++]),128&f&&(n|=(127&(f=this.view[e++]))<<7,(128&f||this.noAssert&&void 0===f)&&(n|=(127&(f=this.view[e++]))<<14,(128&f||this.noAssert&&void 0===f)&&(n|=(127&(f=this.view[e++]))<<21,(128&f||this.noAssert&&void 0===f)&&(s=127&(f=this.view[e++]),(128&f||this.noAssert&&void 0===f)&&(s|=(127&(f=this.view[e++]))<<7,(128&f||this.noAssert&&void 0===f)&&(s|=(127&(f=this.view[e++]))<<14,(128&f||this.noAssert&&void 0===f)&&(s|=(127&(f=this.view[e++]))<<21,(128&f||this.noAssert&&void 0===f)&&(o=127&(f=this.view[e++]),(128&f||this.noAssert&&void 0===f)&&(o|=(127&(f=this.view[e++]))<<7,128&f||this.noAssert&&void 0===f))))))))))throw Error("Buffer overrun");var h=t.fromBits(n|s<<28,s>>>4|o<<24,!1);return i?(this.offset=e,h):{value:h,length:e-r}},i.readVarint64ZigZag=function(i){var r=this.readVarint64(i);return r&&r.value instanceof t?r.value=e.zigZagDecode64(r.value):r=e.zigZagDecode64(r),r}),i.writeCString=function(t,e){var i=void 0===e;i&&(e=this.offset);var r,n=t.length;if(!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");for(r=0;r<n;++r)if(0===t.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}n=u.calculateUTF16asUTF8(s(t))[1],e+=n+1;var o=this.buffer.byteLength;return e>o&&this.resize((o*=2)>e?o:e),e-=n+1,u.encodeUTF16toUTF8(s(t),function(t){this.view[e++]=t}.bind(this)),this.view[e++]=0,i?(this.offset=e,this):n},i.readCString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i,r=t,n=-1;return u.decodeUTF8toUTF16(function(){if(0===n)return null;if(t>=this.limit)throw RangeError("Illegal range: Truncated data, "+t+" < "+this.limit);return 0===(n=this.view[t++])?null:n}.bind(this),i=o(),!0),e?(this.offset=t,i()):{string:i(),length:t-r}},i.writeIString=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var r,n=e;r=u.calculateUTF16asUTF8(s(t),this.noAssert)[1],e+=4+r;var o=this.buffer.byteLength;if(e>o&&this.resize((o*=2)>e?o:e),e-=4+r,this.littleEndian?(this.view[e+3]=r>>>24&255,this.view[e+2]=r>>>16&255,this.view[e+1]=r>>>8&255,this.view[e]=255&r):(this.view[e]=r>>>24&255,this.view[e+1]=r>>>16&255,this.view[e+2]=r>>>8&255,this.view[e+3]=255&r),e+=4,u.encodeUTF16toUTF8(s(t),function(t){this.view[e++]=t}.bind(this)),e!==n+4+r)throw RangeError("Illegal range: Truncated data, "+e+" == "+(e+4+r));return i?(this.offset=e,this):e-n},i.readIString=function(t){var i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=t,n=this.readUint32(t),s=this.readUTF8String(n,e.METRICS_BYTES,t+=4);return t+=s.length,i?(this.offset=t,s.string):{string:s.string,length:t-r}},e.METRICS_CHARS="c",e.METRICS_BYTES="b",i.writeUTF8String=function(t,e){var i,r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n=e;i=u.calculateUTF16asUTF8(s(t))[1],e+=i;var o=this.buffer.byteLength;return e>o&&this.resize((o*=2)>e?o:e),e-=i,u.encodeUTF16toUTF8(s(t),function(t){this.view[e++]=t}.bind(this)),r?(this.offset=e,this):e-n},i.writeString=i.writeUTF8String,e.calculateUTF8Chars=function(t){return u.calculateUTF16asUTF8(s(t))[0]},e.calculateUTF8Bytes=function(t){return u.calculateUTF16asUTF8(s(t))[1]},e.calculateString=e.calculateUTF8Bytes,i.readUTF8String=function(t,i,r){"number"==typeof i&&(r=i,i=void 0);var n=void 0===r;if(n&&(r=this.offset),void 0===i&&(i=e.METRICS_CHARS),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");if(t|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var s,f=0,h=r;if(i===e.METRICS_CHARS){if(s=o(),u.decodeUTF8(function(){return f<t&&r<this.limit?this.view[r++]:null}.bind(this),function(t){++f,u.UTF8toUTF16(t,s)}),f!==t)throw RangeError("Illegal range: Truncated data, "+f+" == "+t);return n?(this.offset=r,s()):{string:s(),length:r-h}}if(i===e.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+t+") <= "+this.buffer.byteLength)}var a=r+t;if(u.decodeUTF8toUTF16(function(){return r<a?this.view[r++]:null}.bind(this),s=o(),this.noAssert),r!==a)throw RangeError("Illegal range: Truncated data, "+r+" == "+a);return n?(this.offset=r,s()):{string:s(),length:r-h}}throw TypeError("Unsupported metrics: "+i)},i.readString=i.readUTF8String,i.writeVString=function(t,i){var r=void 0===i;if(r&&(i=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var n,o,f=i;n=u.calculateUTF16asUTF8(s(t),this.noAssert)[1],o=e.calculateVarint32(n),i+=o+n;var h=this.buffer.byteLength;if(i>h&&this.resize((h*=2)>i?h:i),i-=o+n,i+=this.writeVarint32(n,i),u.encodeUTF16toUTF8(s(t),function(t){this.view[i++]=t}.bind(this)),i!==f+n+o)throw RangeError("Illegal range: Truncated data, "+i+" == "+(i+n+o));return r?(this.offset=i,this):i-f},i.readVString=function(t){var i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,n=this.readVarint32(t),s=this.readUTF8String(n.value,e.METRICS_BYTES,t+=n.length);return t+=s.length,i?(this.offset=t,s.string):{string:s.string,length:t-r}},i.append=function(t,i,r){"number"!=typeof i&&"string"==typeof i||(r=i,i=void 0);var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,i));var s=t.limit-t.offset;if(s<=0)return this;r+=s;var o=this.buffer.byteLength;return r>o&&this.resize((o*=2)>r?o:r),r-=s,this.view.set(t.view.subarray(t.offset,t.limit),r),t.offset+=s,n&&(this.offset+=s),this},i.appendTo=function(t,e){return t.append(this,e),this},i.assert=function(t){return this.noAssert=!t,this},i.capacity=function(){return this.buffer.byteLength},i.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},i.clone=function(t){var i=new e(0,this.littleEndian,this.noAssert);return t?(i.buffer=new ArrayBuffer(this.buffer.byteLength),i.view=new Uint8Array(i.buffer)):(i.buffer=this.buffer,i.view=this.view),i.offset=this.offset,i.markedOffset=this.markedOffset,i.limit=this.limit,i},i.compact=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(0===t&&e===this.buffer.byteLength)return this;var i=e-t;if(0===i)return this.buffer=r,this.view=null,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(i),s=new Uint8Array(n);return s.set(this.view.subarray(t,e)),this.buffer=n,this.view=s,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=i,this},i.copy=function(t,i){if(void 0===t&&(t=this.offset),void 0===i&&(i=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal end: Not an integer");if(i>>>=0,t<0||t>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+i+" <= "+this.buffer.byteLength)}if(t===i)return new e(0,this.littleEndian,this.noAssert);var r=i-t,n=new e(r,this.littleEndian,this.noAssert);return n.offset=0,n.limit=r,n.markedOffset>=0&&(n.markedOffset-=t),this.copyTo(n,0,t,i),n},i.copyTo=function(t,i,r,n){var s,o;if(!this.noAssert&&!e.isByteBuffer(t))throw TypeError("Illegal target: Not a ByteBuffer");if(i=(o=void 0===i)?t.offset:0|i,r=(s=void 0===r)?this.offset:0|r,n=void 0===n?this.limit:0|n,i<0||i>t.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+i+" <= "+t.buffer.byteLength);if(r<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+r+" <= "+this.buffer.byteLength);var f=n-r;return 0===f?t:(t.ensureCapacity(i+f),t.view.set(this.view.subarray(r,n),i),s&&(this.offset+=f),o&&(t.offset+=f),this)},i.ensureCapacity=function(t){var e=this.buffer.byteLength;return e<t?this.resize((e*=2)>t?e:t):this},i.fill=function(t,e,i){var r=void 0===e;if(r&&(e=this.offset),"string"==typeof t&&t.length>0&&(t=t.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===i&&(i=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal end: Not an integer");if(i>>>=0,e<0||e>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+i+" <= "+this.buffer.byteLength)}if(e>=i)return this;for(;e<i;)this.view[e++]=t;return r&&(this.offset=e),this},i.flip=function(){return this.limit=this.offset,this.offset=0,this},i.mark=function(t){if(t=void 0===t?this.offset:t,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=t,this},i.order=function(t){if(!this.noAssert&&"boolean"!=typeof t)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!t,this},i.LE=function(t){return this.littleEndian=void 0===t||!!t,this},i.BE=function(t){return this.littleEndian=void 0!==t&&!t,this},i.prepend=function(t,i,r){"number"!=typeof i&&"string"==typeof i||(r=i,i=void 0);var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,i));var s=t.limit-t.offset;if(s<=0)return this;var o=s-r;if(o>0){var f=new ArrayBuffer(this.buffer.byteLength+o),h=new Uint8Array(f);h.set(this.view.subarray(r,this.buffer.byteLength),s),this.buffer=f,this.view=h,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,r+=o}else new Uint8Array(this.buffer);return this.view.set(t.view.subarray(t.offset,t.limit),r-s),t.offset=t.limit,n&&(this.offset-=s),this},i.prependTo=function(t,e){return t.prepend(this,e),this},i.printDebug=function(t){"function"!=typeof t&&(t=function(){}.bind()),t(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},i.remaining=function(){return this.limit-this.offset},i.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},i.resize=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal capacity: "+t+" (not an integer)");if((t|=0)<0)throw RangeError("Illegal capacity: 0 <= "+t)}if(this.buffer.byteLength<t){var e=new ArrayBuffer(t),i=new Uint8Array(e);i.set(this.view),this.buffer=e,this.view=i}return this},i.reverse=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}return t===e||Array.prototype.reverse.call(this.view.subarray(t,e)),this},i.skip=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");t|=0}var e=this.offset+t;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+t+" <= "+this.buffer.byteLength);return this.offset=e,this},i.slice=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var i=this.clone();return i.offset=t,i.limit=e,i},i.toBuffer=function(t){var e=this.offset,i=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal limit: Not an integer");if(i>>>=0,e<0||e>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+i+" <= "+this.buffer.byteLength)}if(!t&&0===e&&i===this.buffer.byteLength)return this.buffer;if(e===i)return r;var n=new ArrayBuffer(i-e);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(e,i),0),n},i.toArrayBuffer=i.toBuffer,i.toString=function(t,e,i){if(void 0===t)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof t&&(i=e=t="utf8"),t){case"utf8":return this.toUTF8(e,i);case"base64":return this.toBase64(e,i);case"hex":return this.toHex(e,i);case"binary":return this.toBinary(e,i);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+t)}};var a=function(){for(var t={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[],r=0,n=e.length;r<n;++r)i[e[r]]=r;return t.encode=function(t,i){for(var r,n;null!==(r=t());)i(e[r>>2&63]),n=(3&r)<<4,null!==(r=t())?(i(e[63&((n|=r>>4&15)|r>>4&15)]),n=(15&r)<<2,null!==(r=t())?(i(e[63&(n|r>>6&3)]),i(e[63&r])):(i(e[63&n]),i(61))):(i(e[63&n]),i(61),i(61))},t.decode=function(t,e){var r,n,s;function o(t){throw Error("Illegal character code: "+t)}for(;null!==(r=t());)if(void 0===(n=i[r])&&o(r),null!==(r=t())&&(void 0===(s=i[r])&&o(r),e(n<<2>>>0|(48&s)>>4),null!==(r=t()))){if(void 0===(n=i[r])){if(61===r)break;o(r)}if(e((15&s)<<4>>>0|(60&n)>>2),null!==(r=t())){if(void 0===(s=i[r])){if(61===r)break;o(r)}e((3&n)<<6>>>0|s)}}},t.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},t}();i.toBase64=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity||t>e)throw RangeError("begin, end");var i;return a.encode(function(){return t<e?this.view[t++]:null}.bind(this),i=o()),i()},e.fromBase64=function(t,i){if("string"!=typeof t)throw TypeError("str");var r=new e(t.length/4*3,i),n=0;return a.decode(s(t),function(t){r.view[n++]=t}),r.limit=n,r},e.btoa=function(t){return e.fromBinary(t).toBase64()},e.atob=function(t){return e.fromBase64(t).toBinary()},i.toBinary=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity()||t>e)throw RangeError("begin, end");if(t===e)return"";for(var i=[],r=[];t<e;)i.push(this.view[t++]),i.length>=1024&&(r.push(String.fromCharCode.apply(String,i)),i=[]);return r.join("")+String.fromCharCode.apply(String,i)},e.fromBinary=function(t,i){if("string"!=typeof t)throw TypeError("str");for(var r,n=0,s=t.length,o=new e(s,i);n<s;){if((r=t.charCodeAt(n))>255)throw RangeError("illegal char code: "+r);o.view[n++]=r}return o.limit=s,o},i.toDebug=function(t){for(var e,i=-1,r=this.buffer.byteLength,n="",s="",o="";i<r;){if(-1!==i&&(n+=(e=this.view[i])<16?"0"+e.toString(16).toUpperCase():e.toString(16).toUpperCase(),t&&(s+=e>32&&e<127?String.fromCharCode(e):".")),++i,t&&i>0&&i%16==0&&i!==r){for(;n.length<51;)n+=" ";o+=n+s+"\n",n=s=""}i===this.offset&&i===this.limit?n+=i===this.markedOffset?"!":"|":i===this.offset?n+=i===this.markedOffset?"[":"<":i===this.limit?n+=i===this.markedOffset?"]":">":n+=i===this.markedOffset?"'":t||0!==i&&i!==r?" ":""}if(t&&" "!==n){for(;n.length<51;)n+=" ";o+=n+s+"\n"}return t?o:n},e.fromDebug=function(t,i,r){for(var n,s,o=t.length,f=new e((o+1)/3|0,i,r),h=0,a=0,l=!1,u=!1,g=!1,v=!1,c=!1;h<o;){switch(n=t.charAt(h++)){case"!":if(!r){if(u||g||v){c=!0;break}u=g=v=!0}f.offset=f.markedOffset=f.limit=a,l=!1;break;case"|":if(!r){if(u||v){c=!0;break}u=v=!0}f.offset=f.limit=a,l=!1;break;case"[":if(!r){if(u||g){c=!0;break}u=g=!0}f.offset=f.markedOffset=a,l=!1;break;case"<":if(!r){if(u){c=!0;break}u=!0}f.offset=a,l=!1;break;case"]":if(!r){if(v||g){c=!0;break}v=g=!0}f.limit=f.markedOffset=a,l=!1;break;case">":if(!r){if(v){c=!0;break}v=!0}f.limit=a,l=!1;break;case"'":if(!r){if(g){c=!0;break}g=!0}f.markedOffset=a,l=!1;break;case" ":l=!1;break;default:if(!r&&l){c=!0;break}if(s=parseInt(n+t.charAt(h++),16),!r&&(isNaN(s)||s<0||s>255))throw TypeError("Illegal str: Not a debug encoded string");f.view[a++]=s,l=!0}if(c)throw TypeError("Illegal str: Invalid symbol at "+h)}if(!r){if(!u||!v)throw TypeError("Illegal str: Missing offset or limit");if(a<f.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+a+" < "+o)}return f},i.toHex=function(t,e){if(t=void 0===t?this.offset:t,e=void 0===e?this.limit:e,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}for(var i,r=new Array(e-t);t<e;)(i=this.view[t++])<16?r.push("0",i.toString(16)):r.push(i.toString(16));return r.join("")},e.fromHex=function(t,i,r){if(!r){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if(t.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var n,s=t.length,o=new e(s/2|0,i),f=0,h=0;f<s;f+=2){if(n=parseInt(t.substring(f,f+2),16),!r&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[h++]=n}return o.limit=h,o};var l,u=l={MAX_CODEPOINT:1114111,encodeUTF8:function(t,e){var i=null;for("number"==typeof t&&(i=t,t=function(){return null});null!==i||null!==(i=t());)i<128?e(127&i):i<2048?(e(i>>6&31|192),e(63&i|128)):i<65536?(e(i>>12&15|224),e(i>>6&63|128),e(63&i|128)):(e(i>>18&7|240),e(i>>12&63|128),e(i>>6&63|128),e(63&i|128)),i=null},decodeUTF8:function(t,e){for(var i,r,n,s,o=function(t){t=t.slice(0,t.indexOf(null));var e=Error(t.toString());throw e.name="TruncatedError",e.bytes=t,e};null!==(i=t());)if(128&i)if(192==(224&i))null===(r=t())&&o([i,r]),e((31&i)<<6|63&r);else if(224==(240&i))(null===(r=t())||null===(n=t()))&&o([i,r,n]),e((15&i)<<12|(63&r)<<6|63&n);else{if(240!=(248&i))throw RangeError("Illegal starting byte: "+i);(null===(r=t())||null===(n=t())||null===(s=t()))&&o([i,r,n,s]),e((7&i)<<18|(63&r)<<12|(63&n)<<6|63&s)}else e(i)},UTF16toUTF8:function(t,e){for(var i,r=null;null!==(i=null!==r?r:t());)i>=55296&&i<=57343&&null!==(r=t())&&r>=56320&&r<=57343?(e(1024*(i-55296)+r-56320+65536),r=null):e(i);null!==r&&e(r)},UTF8toUTF16:function(t,e){var i=null;for("number"==typeof t&&(i=t,t=function(){return null});null!==i||null!==(i=t());)i<=65535?e(i):(e(55296+((i-=65536)>>10)),e(i%1024+56320)),i=null},encodeUTF16toUTF8:function(t,e){l.UTF16toUTF8(t,function(t){l.encodeUTF8(t,e)})},decodeUTF8toUTF16:function(t,e){l.decodeUTF8(t,function(t){l.UTF8toUTF16(t,e)})},calculateCodePoint:function(t){return t<128?1:t<2048?2:t<65536?3:4},calculateUTF8:function(t){for(var e,i=0;null!==(e=t());)i+=e<128?1:e<2048?2:e<65536?3:4;return i},calculateUTF16asUTF8:function(t){var e=0,i=0;return l.UTF16toUTF8(t,function(t){++e,i+=t<128?1:t<2048?2:t<65536?3:4}),[e,i]}};return i.toUTF8=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var i;try{u.decodeUTF8toUTF16(function(){return t<e?this.view[t++]:null}.bind(this),i=o())}catch(r){if(t!==e)throw RangeError("Illegal range: Truncated data, "+t+" != "+e)}return i()},e.fromUTF8=function(t,i,r){if(!r&&"string"!=typeof t)throw TypeError("Illegal str: Not a string");var n=new e(u.calculateUTF16asUTF8(s(t),!0)[1],i,r),o=0;return u.encodeUTF16toUTF8(s(t),function(t){n.view[o++]=t}),n.limit=o,n},e},(w=p)&&w.exports?w.exports=function(){var t;try{t=function(){return c||(c=1,
9
+ /**
10
+ * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
11
+ * Released under the Apache License, Version 2.0
12
+ * see: https://github.com/dcodeIO/long.js for details
13
+ */
14
+ e=E,i=function(){function t(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var i={},r={};function n(t,e){var n,s,f;return e?(f=0<=(t>>>=0)&&t<256)&&(s=r[t])?s:(n=o(t,(0|t)<0?-1:0,!0),f&&(r[t]=n),n):(f=-128<=(t|=0)&&t<128)&&(s=i[t])?s:(n=o(t,t<0?-1:0,!1),f&&(i[t]=n),n)}function s(t,e){if(isNaN(t)||!isFinite(t))return e?d:c;if(e){if(t<0)return d;if(t>=u)return m}else{if(t<=-g)return E;if(t+1>=g)return p}return t<0?s(-t,e).neg():o(t%l|0,t/l|0,e)}function o(e,i,r){return new t(e,i,r)}t.fromInt=n,t.fromNumber=s,t.fromBits=o;var f=Math.pow;function h(t,e,i){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return c;if("number"==typeof e?(i=e,e=!1):e=!!e,(i=i||10)<2||36<i)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return h(t.substring(1),e,i).neg();for(var n=s(f(i,8)),o=c,a=0;a<t.length;a+=8){var l=Math.min(8,t.length-a),u=parseInt(t.substring(a,a+l),i);if(l<8){var g=s(f(i,l));o=o.mul(g).add(s(u))}else o=(o=o.mul(n)).add(s(u))}return o.unsigned=e,o}function a(e){return e instanceof t?e:"number"==typeof e?s(e):"string"==typeof e?h(e):o(e.low,e.high,e.unsigned)}t.fromString=h,t.fromValue=a;var l=4294967296,u=l*l,g=u/2,v=n(1<<24),c=n(0);t.ZERO=c;var d=n(0,!0);t.UZERO=d;var w=n(1);t.ONE=w;var b=n(1,!0);t.UONE=b;var y=n(-1);t.NEG_ONE=y;var p=o(-1,2147483647,!1);t.MAX_VALUE=p;var m=o(-1,-1,!0);t.MAX_UNSIGNED_VALUE=m;var E=o(0,-2147483648,!1);t.MIN_VALUE=E;var I=t.prototype;return I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},I.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var e=s(t),i=this.div(e),r=i.mul(e).sub(this);return i.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var n=s(f(t,6),this.unsigned),o=this,h="";;){var a=o.div(n),l=(o.sub(a.mul(n)).toInt()>>>0).toString(t);if((o=a).isZero())return l+h;for(;l.length<6;)l="0"+l;h=""+l+h}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&!(t&1<<e);e--);return 0!=this.high?e+33:e+1},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.equals=function(t){return e(t)||(t=a(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},I.eq=I.equals,I.notEquals=function(t){return!this.eq(t)},I.neq=I.notEquals,I.lessThan=function(t){return this.comp(t)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(t){return this.comp(t)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(t){return this.comp(t)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(t){return this.comp(t)>=0},I.gte=I.greaterThanOrEqual,I.compare=function(t){if(e(t)||(t=a(t)),this.eq(t))return 0;var i=this.isNegative(),r=t.isNegative();return i&&!r?-1:!i&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(w)},I.neg=I.negate,I.add=function(t){e(t)||(t=a(t));var i=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,f=t.high>>>16,h=65535&t.high,l=t.low>>>16,u=0,g=0,v=0,c=0;return v+=(c+=s+(65535&t.low))>>>16,g+=(v+=n+l)>>>16,u+=(g+=r+h)>>>16,u+=i+f,o((v&=65535)<<16|(c&=65535),(u&=65535)<<16|(g&=65535),this.unsigned)},I.subtract=function(t){return e(t)||(t=a(t)),this.add(t.neg())},I.sub=I.subtract,I.multiply=function(t){if(this.isZero())return c;if(e(t)||(t=a(t)),t.isZero())return c;if(this.eq(E))return t.isOdd()?E:c;if(t.eq(E))return this.isOdd()?E:c;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(v)&&t.lt(v))return s(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,r=65535&this.high,n=this.low>>>16,f=65535&this.low,h=t.high>>>16,l=65535&t.high,u=t.low>>>16,g=65535&t.low,d=0,w=0,b=0,y=0;return b+=(y+=f*g)>>>16,w+=(b+=n*g)>>>16,b&=65535,w+=(b+=f*u)>>>16,d+=(w+=r*g)>>>16,w&=65535,d+=(w+=n*u)>>>16,w&=65535,d+=(w+=f*l)>>>16,d+=i*g+r*u+n*l+f*h,o((b&=65535)<<16|(y&=65535),(d&=65535)<<16|(w&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(t){if(e(t)||(t=a(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?d:c;var i,r,n;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return d;if(t.gt(this.shru(1)))return b;n=d}else{if(this.eq(E))return t.eq(w)||t.eq(y)?E:t.eq(E)?w:(i=this.shr(1).div(t).shl(1)).eq(c)?t.isNegative()?w:y:(r=this.sub(t.mul(i)),n=i.add(r.div(t)));if(t.eq(E))return this.unsigned?d:c;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=c}for(r=this;r.gte(t);){i=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(i)/Math.LN2),h=o<=48?1:f(2,o-48),l=s(i),u=l.mul(t);u.isNegative()||u.gt(r);)u=(l=s(i-=h,this.unsigned)).mul(t);l.isZero()&&(l=w),n=n.add(l),r=r.sub(u)}return n},I.div=I.divide,I.modulo=function(t){return e(t)||(t=a(t)),this.sub(this.div(t).mul(t))},I.mod=I.modulo,I.not=function(){return o(~this.low,~this.high,this.unsigned)},I.and=function(t){return e(t)||(t=a(t)),o(this.low&t.low,this.high&t.high,this.unsigned)},I.or=function(t){return e(t)||(t=a(t)),o(this.low|t.low,this.high|t.high,this.unsigned)},I.xor=function(t){return e(t)||(t=a(t)),o(this.low^t.low,this.high^t.high,this.unsigned)},I.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?o(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):o(0,this.low<<t-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?o(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):o(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var i=this.high;return t<32?o(this.low>>>t|i<<32-t,i>>>t,this.unsigned):o(32===t?i:i>>>t-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},I.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},I.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t},(t=m)&&t.exports?t.exports=i():(e.dcodeIO=e.dcodeIO||{}).Long=i()),m.exports;var t,e,i}()}catch(e){}return y(t)}():(b.dcodeIO=b.dcodeIO||{}).ByteBuffer=y(b.dcodeIO.Long)),p.exports));async function T(t,e="get",i,r){try{const n="get"===e.toLowerCase()?"params":"data",s={"Content-Type":"application/json",...null==r?void 0:r.headers},f=await o({method:e,url:t,headers:s,[n]:i,...r});if(200!==f.status)throw f;return f}catch(n){return o.isCancel(n)||process.env.NODE_ENV,Promise.reject(n)}}const L={},U=(t,e,i={})=>{var r,s,o;r=t.toString(),s=()=>{let r;r="boolean"==typeof e?e?"success":"error":e,n.useToast().open(Object.assign({},{message:t,type:r},i))},o=300,L[r]&&clearTimeout(L[r]),L[r]=window.setTimeout(()=>{s(),delete L[r]},o)},A=s.reactive(new Map),S=s.reactive(new Map),N=(t,e)=>{t&&e&&A.set(t,e)},R=t=>{t&&A.delete(t)},F=(t,e)=>{t&&e&&S.set(t,e)},B=t=>{t&&S.delete(t)},_=["_RID","createDatetime","createUser","updateDatetime","updateUser"],C=()=>({currentValue:s.ref(0),totalValue:s.ref(0),progressTime:s.ref(0),remainTime:s.ref(0)}),O=t=>{switch(t){case f:return"System.String";case h:return"System.Decimal";case a:return"System.Boolean";case l:return"System.DateTime";default:return"System.String"}},k=t=>decodeURIComponent(t).replace(/\+/g," "),x=i.defineStore("excelPopup",()=>{const t=n.useMozLocale(),i=s.ref(!1),o=s.ref(!1),v=s.ref(void 0),c=s.ref("excel"),d=s.ref({keyColumns:[],columnLayout:"",columnMap:{},apiKey:"",apiParams:{},targetTable:"",refreshKey:"",useDataPreclear:!1,disableMasterProperty:!1,targetStorage:"postgresql"}),w=s.ref({onUpload:t=>{},onAdd:t=>{},onTruncate:()=>{},onValidation:(t,e,i)=>{},onRefresh:()=>{},onDownload:()=>{},onNotify:t=>{}}),b=s.ref(null),y=s.reactive(new Map),p=s.ref("init"),m=s.ref(null),E=async(e={})=>{if(b.value)return U(t.value.Grid.alreadyExcelProgress,!1);const i=g();b.value=new u("Download",i),m.value={current:0,total:100,remainTime:-1,sessionID:i,fileName:""},e.session_id=i;try{const t="/excel/download/"+(e.sample_data?"sample":"fetch");await async function(t,e,i={}){const r=new AbortController,{signal:n}=r,s=await fetch(t,{method:"post",signal:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.body)return;const o=s.body.getReader(),f=new I,h=decodeURI(s.headers.get("content-disposition").split("=")[1]).replaceAll("+"," "),a=new ReadableStream({start(t){!function i(){o.read().then(({done:r,value:n})=>{if(r){f.flip();const i=new Blob([f.toArrayBuffer()]);return t.close(),void e.completed(i?{fileName:h,blob:i}:void 0)}n&&(t.enqueue(n),f.append(n),e.offset+=n.byteLength,i())})}()},cancel(t){f.clear(),r.abort()}});e.isCancelable=!0,e.onCancelClick=async()=>{e.isCanceled=!0,a.cancel(""),e.completed()}}(t,b.value,e),b.value.onCompleted=L,b.value.onCancelClick=C}catch{return b.value=null,U(t.value.Grid.downloadFail,!1)}},L=t=>{t.blobInfo&&(r.saveAs(t.blobInfo.blob,t.blobInfo.fileName),b.value=null,m.value=null)},C=t=>{b.value=null,m.value=null},x=t=>{const e=null==t?void 0:t.columns;if(!e)return[];if("function"==typeof e.getAll){const t={number:h,boolean:a,date:l,string:f};return e.getAll().map(e=>({binding:e.id,header:e.header??e.label??e.id,dataType:t[e.type]??f,visible:!1!==e.visible,format:void 0,isRequired:e.required??!1}))}return"function"==typeof e.filter?Array.from(e):[]},D=(t,e)=>{const i={};return t?(x(t).filter(t=>!_.includes(t.binding)).forEach(t=>{t.header&&t.binding&&(i[t.header]={column_name:t.binding,column_type:O(t.dataType||f),is_required:t.isRequired,is_key:!!t.binding&&(null==e?void 0:e.includes(t.binding))})}),i):i},M=(t,e)=>{const i={};if(!t)return i;const{visibleOnly:r=!1}=e??{};return x(t).filter(t=>!_.includes(t.binding)).filter(t=>!r||!1!==t.visible).forEach(t=>{t.binding&&(i[t.binding]={column_name:t.header,column_type:O(t.dataType||f),column_format:t.format})}),i};class z{constructor(t,i){e(this,"keyColumns"),e(this,"columnLayout"),e(this,"columnMap"),this.keyColumns=t,this.columnLayout=i.columnLayout,this.columnMap=D(i,t)}}return{showPopup:i,isOverwrite:o,exportFormat:c,excelInfo:d,excelAPI:w,file:b,excelFileMap:y,downloadInfo:m,initialize:(t={},e={})=>{d.value={...d.value,...t},w.value={...w.value,...e},p.value="init"},setInfo:t=>{d.value={...d.value,...t}},newExcelInfo:(t,e)=>new z(t,e),setAPI:t=>{w.value={...w.value,...t}},newExcelApi:(e,r,n,s,o,f,h)=>(F(e,o),{onUpload:t=>f(t),onAdd:async t=>{try{return p.value="success",await h({url:e,param:t,method:"POST"})}catch(i){p.value="error"}},onTruncate:async()=>{try{return p.value="success",await h({url:e,param:[],method:"DELETE"})}catch(t){p.value="error"}},onDownload:()=>E({sample_data:n,file_name:s,column_map:M(r)}),onRefresh:()=>{switch(F(e,o),p.value){case"init":break;case"success":U(t.value.Grid.toastSaveSuccess,!0);break;case"error":U(t.value.Grid.toastSaveError,!1)}p.value="init",o()},onNotify:t=>{i.value&&U(t.message,t.type)}}),setExportFormat:t=>{c.value=t},setUploadSuccess:t=>{p.value=t},show:(t=!0)=>{o.value=t,i.value=!0},hide:()=>{i.value=!1},download:E,createColumnMapForImport:D,createColumnMapForExport:M,createFieldMapForExport:t=>{const e={};return t?(t.engine.fields.filter(t=>!_.includes(t.binding)).forEach(t=>{t.binding&&(e[t.binding]={column_name:t.header,column_type:O(t.dataType||f)})}),e):e},updateDownloadStatus:t=>{var e;null!=m.value&&(null==(e=m.value)?void 0:e.sessionID)===t.sessionID&&(m.value.current=t.current,m.value.total=t.total,m.value.remainTime=t.remainTime,m.value.notiDatetime=t.notiDatetime,m.value.isDone=t.isDone)},downloadFromS3:t=>{if(t)try{const e=document.createElement("a");e.setAttribute("href",t),document.body.appendChild(e),e.click(),document.body.removeChild(e),m.value=null}catch(e){throw e}},requestGenerateExcel:async(t={},e={})=>{const i=`/api/module/data-transfer/${t.project_id??"none"}/excel/generate-download-url`,r=await T(i,"post",t,e),n=t.client_id,s=r.data.data.file_name,o=k(s);return y.set(n,o),r},targetTable:v,registerUploadOwner:N,clearUploadOwner:R,registerRefresh:F,unregisterRefresh:B,triggerRefreshBySession:t=>{var e,i;const r=(t=>{const e=A.get(t);return e?S.get(e):void 0})(t);return!!r&&(r(),null==(i=(e=w.value).onRefresh)||i.call(e),!0)}}}),D=i.defineStore("excelDownload",C),M=i.defineStore("excelUpload",C);exports.dataTypeToString=O,exports.generateGUID=g,exports.useExcelDownloadStore=D,exports.useExcelStore=x,exports.useExcelUploadStore=M;
@@ -0,0 +1,16 @@
1
+ import { inject, provide } from "vue";
2
+ const GridNotificationKey = Symbol.for("MozGridNotification");
3
+ let registeredStore = null;
4
+ function provideGridNotification(store) {
5
+ registeredStore = store;
6
+ provide(GridNotificationKey, store);
7
+ }
8
+ function useGridNotificationStore() {
9
+ if (registeredStore) return registeredStore;
10
+ return inject(GridNotificationKey, null);
11
+ }
12
+ export {
13
+ GridNotificationKey as G,
14
+ provideGridNotification as p,
15
+ useGridNotificationStore as u
16
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("vue"),o=Symbol.for("MozGridNotification");let t=null;exports.GridNotificationKey=o,exports.provideGridNotification=function(r){t=r,i.provide(o,r)},exports.useGridNotificationStore=function(){return t||i.inject(o,null)};