@sankhyalabs/sankhyablocks 8.9.0-rc.1 → 8.9.0-rc.3

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 (139) hide show
  1. package/dist/cjs/{ConfigStorage-c15716fd.js → ConfigStorage-90552fe8.js} +2 -2
  2. package/dist/cjs/{DataFetcher-713f0749.js → DataFetcher-1b1e9ff0.js} +58 -43
  3. package/dist/cjs/{SnkFormConfigManager-29101e20.js → SnkFormConfigManager-0561602d.js} +2 -2
  4. package/dist/cjs/Sortable-fb1c4cbb.js +2853 -0
  5. package/dist/cjs/{auth-fetcher-555ff856.js → auth-fetcher-eee6ec18.js} +1 -1
  6. package/dist/cjs/{constants-d187e03e.js → constants-35ddd366.js} +4 -0
  7. package/dist/cjs/{dataunit-fetcher-55f98541.js → dataunit-fetcher-38233d72.js} +3 -2
  8. package/dist/cjs/{form-config-fetcher-17775a75.js → form-config-fetcher-00372ac0.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-34922b83.js → pesquisa-fetcher-8bc6d0a5.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +4 -5
  13. package/dist/cjs/snk-application.cjs.entry.js +6 -7
  14. package/dist/cjs/snk-attach.cjs.entry.js +3 -4
  15. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-crud.cjs.entry.js +12 -7
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -3
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
  20. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -4
  22. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -4
  23. package/dist/cjs/snk-form-config.cjs.entry.js +15 -14
  24. package/dist/cjs/snk-form.cjs.entry.js +4 -5
  25. package/dist/cjs/snk-grid-config.cjs.entry.js +4 -5
  26. package/dist/cjs/snk-grid.cjs.entry.js +9 -4
  27. package/dist/cjs/{snk-guides-viewer-6dfeec5c.js → snk-guides-viewer-676dd526.js} +6 -6
  28. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
  29. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -4
  30. package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
  31. package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -6
  32. package/dist/cjs/snk-tab-config.cjs.entry.js +12 -11
  33. package/dist/collection/components/snk-crud/snk-crud.js +25 -0
  34. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +10 -8
  35. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +10 -8
  36. package/dist/collection/components/snk-grid/snk-grid.js +25 -0
  37. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +2 -1
  38. package/dist/collection/lib/utils/constants.js +3 -0
  39. package/dist/components/DataFetcher.js +16 -1
  40. package/dist/components/constants.js +4 -1
  41. package/dist/components/dataunit-fetcher.js +2 -1
  42. package/dist/components/snk-crud.js +8 -1
  43. package/dist/components/snk-form-config2.js +13 -11
  44. package/dist/components/snk-grid2.js +8 -1
  45. package/dist/components/snk-tab-config2.js +2203 -6233
  46. package/dist/esm/{ConfigStorage-79c81f36.js → ConfigStorage-84abda58.js} +2 -2
  47. package/dist/esm/{DataFetcher-79f78222.js → DataFetcher-7814568f.js} +16 -1
  48. package/dist/esm/{SnkFormConfigManager-7723f3ec.js → SnkFormConfigManager-655943d0.js} +2 -2
  49. package/dist/esm/Sortable-83960219.js +2851 -0
  50. package/dist/esm/{auth-fetcher-e260d0cd.js → auth-fetcher-06354710.js} +1 -1
  51. package/dist/esm/{constants-3644f1b6.js → constants-8457af36.js} +4 -1
  52. package/dist/esm/{dataunit-fetcher-6725cb0e.js → dataunit-fetcher-aa70ea72.js} +3 -2
  53. package/dist/esm/{form-config-fetcher-e1603e66.js → form-config-fetcher-24f43afd.js} +1 -1
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/{pesquisa-fetcher-8e922c9d.js → pesquisa-fetcher-f7aaf727.js} +1 -1
  56. package/dist/esm/sankhyablocks.js +1 -1
  57. package/dist/esm/snk-actions-button.entry.js +4 -5
  58. package/dist/esm/snk-application.entry.js +6 -7
  59. package/dist/esm/snk-attach.entry.js +3 -4
  60. package/dist/esm/snk-config-options.entry.js +1 -1
  61. package/dist/esm/snk-configurator.entry.js +1 -1
  62. package/dist/esm/snk-crud.entry.js +12 -7
  63. package/dist/esm/snk-data-exporter.entry.js +2 -3
  64. package/dist/esm/snk-detail-view.entry.js +8 -9
  65. package/dist/esm/snk-field-config.entry.js +1 -1
  66. package/dist/esm/snk-filter-bar.entry.js +3 -4
  67. package/dist/esm/snk-filter-modal-item.entry.js +3 -4
  68. package/dist/esm/snk-form-config.entry.js +15 -14
  69. package/dist/esm/snk-form.entry.js +4 -5
  70. package/dist/esm/snk-grid-config.entry.js +4 -5
  71. package/dist/esm/snk-grid.entry.js +9 -4
  72. package/dist/esm/{snk-guides-viewer-8b47f38c.js → snk-guides-viewer-746e2547.js} +6 -6
  73. package/dist/esm/snk-guides-viewer.entry.js +8 -9
  74. package/dist/esm/snk-personalized-filter.entry.js +3 -4
  75. package/dist/esm/snk-select-box.entry.js +1 -1
  76. package/dist/esm/snk-simple-crud.entry.js +5 -6
  77. package/dist/esm/snk-tab-config.entry.js +12 -11
  78. package/dist/sankhyablocks/p-0d5e8a37.entry.js +1 -0
  79. package/dist/sankhyablocks/p-1a991d41.entry.js +1 -0
  80. package/dist/sankhyablocks/p-1ae31937.entry.js +1 -0
  81. package/dist/sankhyablocks/p-25df73bf.entry.js +1 -0
  82. package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
  83. package/dist/sankhyablocks/p-3f0fe056.js +1 -0
  84. package/dist/sankhyablocks/{p-2e6f1666.js → p-5eb3ac18.js} +1 -1
  85. package/dist/sankhyablocks/{p-73d3daa8.entry.js → p-5f74c859.entry.js} +1 -1
  86. package/dist/sankhyablocks/p-6e32de4b.entry.js +1 -0
  87. package/dist/sankhyablocks/p-718ecd01.entry.js +1 -0
  88. package/dist/sankhyablocks/p-809a09ac.entry.js +1 -0
  89. package/dist/sankhyablocks/p-88039a7f.js +1 -0
  90. package/dist/sankhyablocks/p-8eb67fa4.entry.js +1 -0
  91. package/dist/sankhyablocks/p-8f307ef2.entry.js +1 -0
  92. package/dist/sankhyablocks/{p-f30526a7.entry.js → p-95df461f.entry.js} +1 -1
  93. package/dist/sankhyablocks/{p-838f8234.entry.js → p-98674137.entry.js} +1 -1
  94. package/dist/sankhyablocks/p-993e27ad.entry.js +1 -0
  95. package/dist/sankhyablocks/p-a3868fbc.entry.js +1 -0
  96. package/dist/sankhyablocks/p-a3fbded7.entry.js +1 -0
  97. package/dist/sankhyablocks/p-a4401f5f.entry.js +1 -0
  98. package/dist/sankhyablocks/{p-29176742.js → p-a9b6acf1.js} +1 -1
  99. package/dist/sankhyablocks/p-b0ef4383.js +1 -0
  100. package/dist/sankhyablocks/{p-08fca9d1.js → p-b54e06ca.js} +1 -1
  101. package/dist/sankhyablocks/p-c6800fd4.entry.js +1 -0
  102. package/dist/sankhyablocks/p-d7665a57.entry.js +1 -0
  103. package/dist/sankhyablocks/{p-41d156dd.js → p-e38f28ae.js} +2 -2
  104. package/dist/sankhyablocks/{p-4651b43f.js → p-e47d966c.js} +1 -1
  105. package/dist/sankhyablocks/{p-73407f35.js → p-ee49df44.js} +1 -1
  106. package/dist/sankhyablocks/{p-de84a3d5.entry.js → p-f3479d53.entry.js} +2 -2
  107. package/dist/sankhyablocks/p-fa816fb2.js +1 -0
  108. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  109. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  110. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  111. package/dist/types/components.d.ts +8 -0
  112. package/dist/types/lib/utils/constants.d.ts +3 -4
  113. package/package.json +2 -2
  114. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  115. package/dist/cjs/draggable.bundle-82a25c06.js +0 -6886
  116. package/dist/components/_commonjsHelpers.js +0 -17
  117. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  118. package/dist/esm/draggable.bundle-41d56f06.js +0 -6884
  119. package/dist/sankhyablocks/p-06e76ed2.entry.js +0 -1
  120. package/dist/sankhyablocks/p-112455b1.js +0 -1
  121. package/dist/sankhyablocks/p-44865ff1.entry.js +0 -1
  122. package/dist/sankhyablocks/p-47d20cb0.entry.js +0 -1
  123. package/dist/sankhyablocks/p-47e4b6c9.entry.js +0 -1
  124. package/dist/sankhyablocks/p-4a78e118.js +0 -1
  125. package/dist/sankhyablocks/p-651b4f89.entry.js +0 -1
  126. package/dist/sankhyablocks/p-7749c662.entry.js +0 -1
  127. package/dist/sankhyablocks/p-80692cbd.entry.js +0 -1
  128. package/dist/sankhyablocks/p-94c532bb.entry.js +0 -1
  129. package/dist/sankhyablocks/p-b2ce189a.entry.js +0 -1
  130. package/dist/sankhyablocks/p-b6d6b172.js +0 -1
  131. package/dist/sankhyablocks/p-bbcd3b4d.entry.js +0 -1
  132. package/dist/sankhyablocks/p-bd628455.entry.js +0 -1
  133. package/dist/sankhyablocks/p-c9399ce6.js +0 -1
  134. package/dist/sankhyablocks/p-cab6a969.entry.js +0 -1
  135. package/dist/sankhyablocks/p-d0b36421.js +0 -1
  136. package/dist/sankhyablocks/p-d3ec3586.entry.js +0 -1
  137. package/dist/sankhyablocks/p-e60325bc.entry.js +0 -1
  138. package/dist/sankhyablocks/p-eac8b93f.entry.js +0 -1
  139. package/dist/sankhyablocks/p-fda8c84c.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as i,c as e,h as t,F as s}from"./p-d2d301a6.js";import{Action as r,ElementIDUtils as a}from"@sankhyalabs/core";import{S as n}from"./p-2e6f1666.js";import{buildFormMetadata as d,FormMetadata as o}from"@sankhyalabs/ezui/dist/collection/utils/form";import{T as h}from"./p-c2beb95c.js";import{T as l}from"./p-c9841939.js";import{c as u}from"./p-4a78e118.js";import"./p-c9399ce6.js";import"./p-41d156dd.js";import{P as c}from"./p-5534e08c.js";import"./p-9e7d65a4.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-73407f35.js";import"./p-c22c1d8e.js";import"./p-584d7212.js";import"./p-4651b43f.js";import{SelectionMode as v}from"@sankhyalabs/core/dist/dataunit/DataUnit";const g="__FORM:",m=class{constructor(t){i(this,t),this.exit=e(this,"exit",7),this.actionClick=e(this,"actionClick",7),this.formItemsReady=e(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,e){const t=null==i?void 0:i.selectedRecord,s=null==e?void 0:e.selectedRecord;(null==t?void 0:t.__record__id__)!==(null==s?void 0:s.__record__id__)&&this.loadGuides((null==e?void 0:e.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected())}async showFormConfig(i=!1){const e=!i||null==this._currentDetail;this._formEditorConfigManager=e?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=e?this.dataUnit:this._currentDetail.dataUnit}exitViewer(){this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===l.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){m.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataState.insertionMode,this.dataUnit)))}getMessage(i){return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=d(this.masterFormConfig,this.dataUnit,!0);const e=this._masterFormMetadata.getAllSheets(),t=this.dataUnit.getSelectedRecord(),s=!t||this.dataUnit.isNewRecord(t.__record__id__),r=[];Array.from(e.values()).forEach((i=>{const e={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(e.tooltip="Para alterar detalhes é necessário estar com um registro selecionado.",e.disabled=!0),r.push(e)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}isDetail(i){return null!=o.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const e=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(e).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===e.id?Object.assign(Object.assign({},i),e):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"snkGuideViewer.finish_edition":"snkGuideViewer.regular"}loadTaskbarProcessor(){var i;const e=this.getTaskBarId(),t=[];this.dataState&&this.dataState.hasPrevious||t.push("PREVIOUS"),this.dataState&&this.dataState.hasNext||t.push("NEXT"),(null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)&&(this.dataState.selectionInfo.length>1&&t.push("CLONE"),this.dataState.selectionInfo.isAllRecords()&&t.push("REMOVE"));const s=["PREVIOUS","NEXT","DIVIDER","ATTACH","CLONE","REMOVE","MORE_OPTIONS","ACTIONS_BUTTON","DIVIDER","GRID_MODE","CONFIGURATOR"];this.presentationMode==c.SECONDARY?s.unshift("INSERT"):s.push("INSERT");const r=this.getInvisibleButtons();this._taskbarProcessor=new h({"snkGuideViewer.regular":s,"snkGuideViewer.finish_edition":["CANCEL","SAVE"]}),this._taskbarProcessor.process(e,this.taskbarManager,this.dataState,t,r)}getInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===v.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}static updateContentCard(i,e,t,s){return s.saveCardState(i,e,t)}static buildFixedForms(i,e,r,a,n,d){const o=null==i?void 0:i.cardsState;if(null!=o)return t(s,null,Array.from(o.entries()).filter((([i,e])=>(null==e?void 0:e.fixed)&&i!=r)).sort((([,i],[,e])=>((null==i?void 0:i.fixSequence)||0)-((null==e?void 0:e.fixSequence)||0))).map((([s,r])=>{var o;const h=e.getSheet(s);if(null!=h)return t("snk-form-view",{levelPath:d,label:h.label,name:s,fields:h.fields,formMetadata:e,dataUnit:a,recordsValidator:n,contracted:"CONTRACTED"===(null==r?void 0:r.presentation),fixed:null==r?void 0:r.fixed,summaryFields:null===(o=null==i?void 0:i.summary)||void 0===o?void 0:o.get(s),key:s})})))}wrapDetail(i,e){if(0===i.length)return e;const s=i.pop(),r=o.getDetailName(s);return r?this.wrapDetail(i,t("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},e)):void 0}getDataUnitName(i,e){if(i.length>0){const t=i.map((i=>o.getDetailName(i)));return`${this.entityPath}/${t.join("/")}/${e}`}return`${this.entityPath}/${e}`}getContent(){var i,e,s,r,a;if(!this.selectedGuide)return;const n=this.selectedGuide.id;let d;const h=n.split("::"),l=h.pop(),u=o.getDetailName(l);let v=n;if(u||h.length>0){let e,s;if(n.includes(g)){[v,e]=n.split(g);const t=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=t>1?this._breadcrumbItems[t-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(h,t("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(h,u),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:u,selectedForm:e,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${v}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(e=this.masterFormConfig)||void 0===e?void 0:e.cardsState)||void 0===s?void 0:s.get(i);d=t("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(a=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===a?void 0:a.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,key:n},this.presentationMode==c.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}resetGuideBadge(i){var e;this._guides=[...null===(e=this._guides)||void 0===e?void 0:e.map((e=>this.canClearGuideBadge(e,i.id)?Object.assign(Object.assign({},e),{badge:null}):e))]}canClearGuideBadge(i,e){return i.id===e||this.isIncludedInChildrenList(i,e)}isIncludedInChildrenList(i,e){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(e)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return u.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===u.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}componentWillLoad(){if(null==this.resourceID)throw new Error("Erro interno: resourceID não informado");this._configManager=new n(this.configName,this.resourceID,(i=>this.masterFormConfig=i)),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getActionsList(){return null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList):this.actionsList}buildTaskBar(){var i;return t("div",{class:"ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 "+(this.presentationMode!=c.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},t("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT","data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"},t("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var e;if(i.type===r.FIELD_INVALIDATED){const t=this.getGuideName(null===(e=i.payload)||void 0===e?void 0:e.fieldName);await this.addErrorBadgeToGuide(t),await this.openGuideNavigator(t)}}async addErrorBadgeToGuide(i){var e;this._guides=[...null===(e=this._guides)||void 0===e?void 0:e.map((e=>Object.assign(Object.assign({},e),{badge:this.getBadge(e,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,e){var t;return this.selectedGuide.id===e?null:e===i.id?"error":null!==(t=i.badge)&&void 0!==t?t:null}getGuideName(i){var e;for(const t of this._masterFormMetadata.getAllSheets()){const s=null===(e=t[1])||void 0===e?void 0:e.fields;for(const e of s)if(e.name===i)return t[0]}return""}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}render(){var i,e;if(null!=this._formEditorConfigManager)return t("snk-form-config",{dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return t("section",{class:"snk-guides-viewer"},t("div",{class:"ez-row snk-guides-viewer__header"},t("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6 ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},t("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),t("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},t("h1",{class:"ez-title ez-title--primary ez-title--xlarge"},this.getMessage("snkCrud.title")),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&t("div",{class:"ez-margin-top--extra-small"},t("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${a.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=c.SECONDARY&&this.buildTaskBar()),t("div",{class:"snk-guides-viewer__container"},s?t("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):t("div",null),t("div",{class:"snk-guides-viewer__detail-container"},m.buildFixedForms(this.masterFormConfig,this._masterFormMetadata,null===(e=this.selectedGuide)||void 0===e?void 0:e.id,this.dataUnit,this.recordsValidator),this.getContent())),t("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};m.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{m as S}
1
+ import{r as i,c as e,h as t,F as s}from"./p-d2d301a6.js";import{Action as r,ElementIDUtils as a}from"@sankhyalabs/core";import{S as n}from"./p-5eb3ac18.js";import{buildFormMetadata as d,FormMetadata as o}from"@sankhyalabs/ezui/dist/collection/utils/form";import{T as h}from"./p-c2beb95c.js";import{T as l}from"./p-c9841939.js";import{d as u}from"./p-b0ef4383.js";import"./p-88039a7f.js";import"./p-e38f28ae.js";import{P as c}from"./p-5534e08c.js";import"./p-9e7d65a4.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ee49df44.js";import"./p-c22c1d8e.js";import"./p-584d7212.js";import"./p-e47d966c.js";import{SelectionMode as v}from"@sankhyalabs/core/dist/dataunit/DataUnit";const g="__FORM:",m=class{constructor(t){i(this,t),this.exit=e(this,"exit",7),this.actionClick=e(this,"actionClick",7),this.formItemsReady=e(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,e){const t=null==i?void 0:i.selectedRecord,s=null==e?void 0:e.selectedRecord;(null==t?void 0:t.__record__id__)!==(null==s?void 0:s.__record__id__)&&this.loadGuides((null==e?void 0:e.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected())}async showFormConfig(i=!1){const e=!i||null==this._currentDetail;this._formEditorConfigManager=e?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=e?this.dataUnit:this._currentDetail.dataUnit}exitViewer(){this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===l.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){m.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataState.insertionMode,this.dataUnit)))}getMessage(i){return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=d(this.masterFormConfig,this.dataUnit,!0);const e=this._masterFormMetadata.getAllSheets(),t=this.dataUnit.getSelectedRecord(),s=!t||this.dataUnit.isNewRecord(t.__record__id__),r=[];Array.from(e.values()).forEach((i=>{const e={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(e.tooltip="Para alterar detalhes é necessário estar com um registro selecionado.",e.disabled=!0),r.push(e)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}isDetail(i){return null!=o.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const e=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(e).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===e.id?Object.assign(Object.assign({},i),e):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"snkGuideViewer.finish_edition":"snkGuideViewer.regular"}loadTaskbarProcessor(){var i;const e=this.getTaskBarId(),t=[];this.dataState&&this.dataState.hasPrevious||t.push("PREVIOUS"),this.dataState&&this.dataState.hasNext||t.push("NEXT"),(null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)&&(this.dataState.selectionInfo.length>1&&t.push("CLONE"),this.dataState.selectionInfo.isAllRecords()&&t.push("REMOVE"));const s=["PREVIOUS","NEXT","DIVIDER","ATTACH","CLONE","REMOVE","MORE_OPTIONS","ACTIONS_BUTTON","DIVIDER","GRID_MODE","CONFIGURATOR"];this.presentationMode==c.SECONDARY?s.unshift("INSERT"):s.push("INSERT");const r=this.getInvisibleButtons();this._taskbarProcessor=new h({"snkGuideViewer.regular":s,"snkGuideViewer.finish_edition":["CANCEL","SAVE"]}),this._taskbarProcessor.process(e,this.taskbarManager,this.dataState,t,r)}getInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===v.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}static updateContentCard(i,e,t,s){return s.saveCardState(i,e,t)}static buildFixedForms(i,e,r,a,n,d){const o=null==i?void 0:i.cardsState;if(null!=o)return t(s,null,Array.from(o.entries()).filter((([i,e])=>(null==e?void 0:e.fixed)&&i!=r)).sort((([,i],[,e])=>((null==i?void 0:i.fixSequence)||0)-((null==e?void 0:e.fixSequence)||0))).map((([s,r])=>{var o;const h=e.getSheet(s);if(null!=h)return t("snk-form-view",{levelPath:d,label:h.label,name:s,fields:h.fields,formMetadata:e,dataUnit:a,recordsValidator:n,contracted:"CONTRACTED"===(null==r?void 0:r.presentation),fixed:null==r?void 0:r.fixed,summaryFields:null===(o=null==i?void 0:i.summary)||void 0===o?void 0:o.get(s),key:s})})))}wrapDetail(i,e){if(0===i.length)return e;const s=i.pop(),r=o.getDetailName(s);return r?this.wrapDetail(i,t("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},e)):void 0}getDataUnitName(i,e){if(i.length>0){const t=i.map((i=>o.getDetailName(i)));return`${this.entityPath}/${t.join("/")}/${e}`}return`${this.entityPath}/${e}`}getContent(){var i,e,s,r,a;if(!this.selectedGuide)return;const n=this.selectedGuide.id;let d;const h=n.split("::"),l=h.pop(),u=o.getDetailName(l);let v=n;if(u||h.length>0){let e,s;if(n.includes(g)){[v,e]=n.split(g);const t=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=t>1?this._breadcrumbItems[t-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(h,t("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(h,u),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:u,selectedForm:e,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${v}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(e=this.masterFormConfig)||void 0===e?void 0:e.cardsState)||void 0===s?void 0:s.get(i);d=t("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(a=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===a?void 0:a.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,key:n},this.presentationMode==c.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}resetGuideBadge(i){var e;this._guides=[...null===(e=this._guides)||void 0===e?void 0:e.map((e=>this.canClearGuideBadge(e,i.id)?Object.assign(Object.assign({},e),{badge:null}):e))]}canClearGuideBadge(i,e){return i.id===e||this.isIncludedInChildrenList(i,e)}isIncludedInChildrenList(i,e){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(e)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return u.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===u.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}componentWillLoad(){if(null==this.resourceID)throw new Error("Erro interno: resourceID não informado");this._configManager=new n(this.configName,this.resourceID,(i=>this.masterFormConfig=i)),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getActionsList(){return null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList):this.actionsList}buildTaskBar(){var i;return t("div",{class:"ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 "+(this.presentationMode!=c.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},t("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT","data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"},t("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var e;if(i.type===r.FIELD_INVALIDATED){const t=this.getGuideName(null===(e=i.payload)||void 0===e?void 0:e.fieldName);await this.addErrorBadgeToGuide(t),await this.openGuideNavigator(t)}}async addErrorBadgeToGuide(i){var e;this._guides=[...null===(e=this._guides)||void 0===e?void 0:e.map((e=>Object.assign(Object.assign({},e),{badge:this.getBadge(e,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,e){var t;return this.selectedGuide.id===e?null:e===i.id?"error":null!==(t=i.badge)&&void 0!==t?t:null}getGuideName(i){var e;for(const t of this._masterFormMetadata.getAllSheets()){const s=null===(e=t[1])||void 0===e?void 0:e.fields;for(const e of s)if(e.name===i)return t[0]}return""}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}render(){var i,e;if(null!=this._formEditorConfigManager)return t("snk-form-config",{dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return t("section",{class:"snk-guides-viewer"},t("div",{class:"ez-row snk-guides-viewer__header"},t("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6 ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},t("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),t("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},t("h1",{class:"ez-title ez-title--primary ez-title--xlarge"},this.getMessage("snkCrud.title")),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&t("div",{class:"ez-margin-top--extra-small"},t("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${a.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=c.SECONDARY&&this.buildTaskBar()),t("div",{class:"snk-guides-viewer__container"},s?t("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):t("div",null),t("div",{class:"snk-guides-viewer__detail-container"},m.buildFixedForms(this.masterFormConfig,this._masterFormMetadata,null===(e=this.selectedGuide)||void 0===e?void 0:e.id,this.dataUnit,this.recordsValidator),this.getContent())),t("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};m.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{m as S}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,F as e,g as r}from"./p-d2d301a6.js";import{SortMode as n,ElementIDUtils as a,ApplicationContext as o,DataType as d}from"@sankhyalabs/core";import{UserInterface as h}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{T as l}from"./p-c9841939.js";import{C as c}from"./p-a9b6acf1.js";import{P as u}from"./p-5534e08c.js";import{T as g}from"./p-c2beb95c.js";import{s as v}from"./p-6dc031de.js";import{S as m}from"./p-094c30cb.js";import{SelectionMode as f}from"@sankhyalabs/core/dist/dataunit/DataUnit";import"./p-e47d966c.js";import"./p-88039a7f.js";import"./p-8d884fab.js";import"./p-584d7212.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import"./p-c22c1d8e.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";const T=class{constructor(s){i(this,s),this.actionClick=t(this,"actionClick",7),this.gridDoubleClick=t(this,"gridDoubleClick",7),this._topTaskbarProcessor=new g({"snkGridTopTaskbar.regular":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.secondary":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.finish_edition":["CANCEL","SAVE"],"snkGridTopTaskbar.finish_edition.secondary":[]}),this._headerTaskbarProcessor=new g({"snkGridHeaderTaskbar.unselected":["REFRESH","DATA_EXPORTER","ACTIONS_BUTTON","MORE_OPTIONS"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.detail.unselected":["REFRESH","MORE_OPTIONS"],"snkGridHeaderTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"]}),this._dataUnit=void 0,this._dataState=void 0,this._gridConfig=void 0,this._popUpGridConfig=!1,this._showSnkFilterBar=!0,this.columnFilterDataSource=new m,this.configName=void 0,this.resourceID=void 0,this.selectionToastConfig=void 0,this.actionsList=void 0,this.isDetail=void 0,this.taskbarManager=void 0,this.statusResolver=void 0,this.multipleSelection=void 0,this.presentationMode=u.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.recordsValidator=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.gridHeaderCustomSlotId="GRID_HEADER_CUSTOM_ELEMENTS",this.topTaskbarCustomSlotId="GRID_TASKBAR_CUSTOM_ELEMENTS"}async showConfig(){null!=this._grid&&this.openGridConfig()}async hideConfig(){null!=this._grid&&this.closeGridConfig()}async setConfig(i){this.setGridConfig(i)}async reloadFilterBar(){var i;null===(i=this._snkFilterBar)||void 0===i||i.reload()}async getFilterBar(){return this._snkFilterBar}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._popUpGridConfig=!0}))}closeGridConfig(){this._popUpGridConfig=!1}setGridConfig(i){this._gridConfig=i,this.assertDefaultSorting()}assertDefaultSorting(){this._gridConfig&&this._dataUnit&&(this._dataUnit.defaultSorting=this._gridConfig.columns.filter((i=>null!=i.ascending)).sort(((i,t)=>i.orderIndex-t.orderIndex)).map((({name:i,ascending:t})=>{const{dataType:s}=this._dataUnit.getField(i);return{field:i,dataType:s,mode:t?n.ASC:n.DESC}})))}loadConfig(){c.loadGridConfig(this.configName,this.resourceID).then((i=>{this.setGridConfig(i)})).catch((i=>{console.warn(i)}))}gridConfigChangeHandler(i){c.saveGridConfig(i.detail,this.configName,this.resourceID),i.stopPropagation()}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}buildColumnsMetadata(i){const t=[];return null==i||i.forEach((i=>{var s,e;if(i.hidden&&"RECDESP"!==i.name)return;const r=null===(s=this._dataUnit)||void 0===s?void 0:s.getField(i.name);if(t.push({label:i.label,id:i.name,width:i.width,type:null==r?void 0:r.dataType,userInterface:null==r?void 0:r.userInterface}),null!=(null===(e=null==r?void 0:r.properties)||void 0===e?void 0:e.DESCRIPTIONFIELD)){const i=r.properties.mergedFrom;t.push({label:r.properties.DESCRIPTIONENTITY,id:`${i?i+".":""}${r.properties.ENTITYNAME}.${r.properties.DESCRIPTIONFIELD}`,width:200,type:d.TEXT,userInterface:h.LONGTEXT})}})),t||[]}getPaginationInfo(){var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo()}getExporterOffset(i){if(null==i)return;const t=i.firstRecord;return t>0?t-1:t}async dataExporterProviderStore(){var i;const t=await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getSelectedRecordsIDsInfo()),s={getFilters:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},getColumnsMetadata:async()=>{var i;const t=await(null===(i=this._grid)||void 0===i?void 0:i.getColumnsState());return this.buildColumnsMetadata(t)},getOrders:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getSort()},getResourceURI:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.name},getSelectedNumber:()=>{var i,t;return null===(t=null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length},getTotalRecords:()=>{var i,t,s;const{total:e}=(null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo())||{};return null!=e?e:null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length},getSelectedIDs:()=>t||[],getOffset:()=>this.getExporterOffset(this.getPaginationInfo()),getLimit:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.pageSize},getRecordID:()=>{var i,t,s;return null===(s=null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.records)||void 0===t?void 0:t[0])||void 0===s?void 0:s.__record__id__}};v.set("exporterProviders",Object.assign(Object.assign({},v.get("exporterProviders")),{[this.configName]:s}))}addElementID(){a.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}finshLoading(){this.assertDefaultSorting(),this.addElementID(),null!=this.columnFilterDataSource&&(this.columnFilterDataSource.setApplication(this._application),this.columnFilterDataSource.setDataUnit(this._dataUnit))}componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit?this.finshLoading():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this.finshLoading()})),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),this._snkDataUnit.addEventListener("dataStateChange",(i=>{this._dataState=i.detail})),this._snkDataUnit.addEventListener("cancelEdition",(()=>{var i;(null===(i=this._dataState)||void 0===i?void 0:i.recordsIsEmpty)&&this._dataUnit.clearSelection()}));break}i=i.parentElement}this.loadConfig()}getHeaderDisabledButtons(){var i;const t=[];return(null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)&&(this._dataState.selectionInfo.length>1&&t.push(l.CLONE,"ATTACH"),this._dataState.selectionInfo.isAllRecords()&&t.push("REMOVE")),t}getInvisibleButtons(){let i=[];return this._dataUnit&&0!==this._dataUnit.records.length||i.push("DATA_EXPORTER"),this._dataState&&this._dataState.selectionInfo.mode===f.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}componentWillRender(){var i;const t=this.getInvisibleButtons();let s;s=this._dataState&&(null===(i=this._dataState.selectionInfo)||void 0===i?void 0:i.length)?this.isDetail?"snkGridHeaderTaskbar.detail.selected":"snkGridHeaderTaskbar.selected":this.isDetail?"snkGridHeaderTaskbar.detail.unselected":"snkGridHeaderTaskbar.unselected",this._headerTaskbarProcessor.process(s,this.taskbarManager,this._dataState,this.getHeaderDisabledButtons(),t),this._topTaskbarProcessor.process(this.getTopTaskBarId(),this.taskbarManager,this._dataState,void 0,t),this.dataExporterProviderStore()}getTopTaskBarId(){var i;const t=this.presentationMode===u.SECONDARY?".secondary":"";return(null===(i=this._dataState)||void 0===i?void 0:i.isDirty)?`snkGridTopTaskbar.finish_edition${t}`:`snkGridTopTaskbar.regular${t}`}getPrimaryButton(){return this.presentationMode===u.PRIMARY?"INSERT":""}getActionsList(){if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const i=this.getTopTaskBarId();return this.taskbarManager.getMoreOptions(i,this.configName,this._dataState,this.actionsList)}return this.actionsList}handleFilterConfigUpdated(i){this._showSnkFilterBar=!!i.length&&(1!==i.length||"PERSONALIZED_FILTER_GROUP"!==i[0].id||i[0].groupedItems.length>0)}render(){if(this._dataUnit)return s("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},s("div",{class:"snk-grid__header ez-margin-bottom--medium"},this._showSnkFilterBar&&s(e,null,s("snk-filter-bar",{ref:i=>this._snkFilterBar=i,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder,resourceID:this.resourceID,onConfigUpdated:i=>this.handleFilterConfigUpdated(i.detail)}),s("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"})),s("snk-taskbar",{class:"ez-padding-left--medium","data-element-id":"grid_top",key:"topTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:this.getPrimaryButton(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.topTaskbarCustomSlotId},s("slot",{name:this.topTaskbarCustomSlotId}))),s("ez-grid",{ref:i=>this._grid=i,class:(this.presentationMode===u.SECONDARY?"snk-grid-container__without-shadow ":"")+"snk-grid__table","data-element-id":"embedded",dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:i=>{this.gridConfigChangeHandler(i)},onEzDoubleClick:()=>this.gridDoubleClick.emit(),statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,columnfilterDataSource:this.columnFilterDataSource,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,recordsValidator:this.recordsValidator,canEdit:this.canEdit},s("snk-taskbar",{dataUnit:this._dataUnit,configName:this.configName,messagesBuilder:this.messagesBuilder,"data-element-id":"grid_left",buttons:this._headerTaskbarProcessor.buttons,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.getActionsList(),resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:this.gridHeaderCustomSlotId},s("slot",{name:this.gridHeaderCustomSlotId}))),s("div",{class:"ez-col ez-col--sd-12"},s("slot",{name:"SnkGridFooter"})),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._popUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this._gridConfig,"data-element-id":this._element.getAttribute(a.DATA_ELEMENT_ID_ATTRIBUTE_NAME),application:this._application,selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resourceID})))}get _element(){return r(this)}};T.style=".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";export{T as snk_grid}
@@ -0,0 +1 @@
1
+ import{r as s,c as i,h as t,g as a}from"./p-d2d301a6.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{S as o}from"./p-5eb3ac18.js";import{R as e}from"./p-688dcb4c.js";import"./p-a9b6acf1.js";import"./p-e47d966c.js";import"./p-88039a7f.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"./p-584d7212.js";const n=class{constructor(t){s(this,t),this.exit=i(this,"exit",7),this.actionClick=i(this,"actionClick",7),this.formItemsReady=i(this,"formItemsReady",7),this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}closeConfig(){this.hideConfig()}dataunitReady(){h.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}async componentWillLoad(){let s=this._element.parentElement;for(;s;){if("SNK-DATA-UNIT"===s.tagName.toUpperCase()){this._snkDataUnit=s,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(s=>{this._dataUnit=s.detail})),this._snkDataUnit.addEventListener("dataStateChange",(s=>{this._dataState=s.detail}));break}s=s.parentElement}null==this.resourceID&&(this.resourceID=await e.getResourceID()),this._configManager=new o(this.configName,this.resourceID),this._configManager.loadConfig()}render(){if(this._dataUnit&&this._dataState)return t("section",null,t("div",{class:"ez-row"},t("div",{class:"ez-col ez-col--sd-12"},t("ez-form",{key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataState.insertionMode,this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&t("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return a(this)}};n.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";export{n as snk_form}
@@ -1,6 +1,6 @@
1
- import{DataType as e}from"@sankhyalabs/core";import{d as t,D as i}from"./p-c9399ce6.js";class r{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",t.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
1
+ import{DataType as e}from"@sankhyalabs/core";import{d as t,D as i}from"./p-88039a7f.js";class r{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this._searchListenersByDataUnit=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",t.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
2
2
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
3
3
  value
4
4
  label
5
5
  }
6
- }`)}loadSearchOptions(t,r,o,s){var a;const l=(null==r?void 0:r.toString().trim())||void 0;r=isNaN(Number(l))&&l?`%${l}`:l,null==o||o.params.forEach((t=>{t.dataType===e.OBJECT&&(t.value=JSON.stringify(t.value))}));const u=this.applySearchListener(n.beforeSearch,t,r,o,s),c={argument:(null==u?void 0:u.argument)||r,entityName:t,criteria:(null==u?void 0:u.criteria)||o,options:(null==u?void 0:u.searchOptions)||s};return c.options&&(null===(a=c.options)||void 0===a||delete a.dataUnitId),new Promise(((e,t)=>{i.get().callGraphQL({values:c,query:this._templateByQuery.get("search")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}loadAdvancedSearch(t,r,o,s){var a,l,u;const c=this.applySearchListener(n.beforeSearch,t,r,o,s),d={argument:(null==c?void 0:c.argument)||r,criteria:(null==c?void 0:c.criteria)||o,searchOptions:(null==c?void 0:c.searchOptions)||s},v={query:{$:null===(a=d.criteria)||void 0===a?void 0:a.expression}};(null===(l=d.criteria)||void 0===l?void 0:l.params.length)>0&&(v.params={param:d.criteria.params.map((t=>{let i=t.value,r=t.dataType;return r===e.OBJECT?(i=i.value,r="S"):r=function(t){switch(t){case e.NUMBER:return"I";case e.DATE:return"D";default:return"S"}}(t.dataType),{$:i,type:r}}))});const h={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:Object.assign({entityName:t,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:d.argument},orderByDesc:!1,externalCriteria:v,localEntityName:null===(u=d.searchOptions)||void 0===u?void 0:u.rootEntity},{options:null!=s?{pkFieldName:s.codeFieldName,label:s.descriptionFieldName,fieldName:s.codeFieldName,useDescriptionOptions:!1,enableRowsCounter:!0}:void 0}),clientEventList:{clientEvent:[]}}};return new Promise(((e,t)=>{i.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(h)).then((t=>e(t))).catch((e=>t(e)))}))}addSearchListener(e,t,i){var r;const n=this._searchListenersByDataUnit.get(t)||[],o=n.find((t=>t.entity===e));if(o){for(const e of Object.keys(i))if(e in o.listener){if((null===(r=o.listener[e])||void 0===r?void 0:r.toString())===i[e].toString())continue;o.listener[e]=i[e]}}else this._searchListenersByDataUnit.set(t,[...n,{entity:e,listener:i}]);return()=>{const i=n.filter((t=>t.entity!==e));i.length?this._searchListenersByDataUnit.set(t,i):this._searchListenersByDataUnit.delete(t)}}applySearchListener(e,t,i,r,n){var o;const s=null==n?void 0:n.dataUnitId;if(!s)return;const a=null===(o=this._searchListenersByDataUnit.get(s))||void 0===o?void 0:o.find((({entity:e})=>e===t));if(!a)return;const{listener:l}=a;return e in l?l[e]({argument:i,criteria:r,searchOptions:n}):void 0}}var n;!function(e){e.beforeSearch="beforeSearch"}(n||(n={}));export{r as P}
6
+ }`)}loadSearchOptions(t,r,a,o){var s;const l=(null==r?void 0:r.toString().trim())||void 0;r=isNaN(Number(l))&&l?`%${l}`:l,null==a||a.params.forEach((t=>{t.dataType===e.OBJECT&&(t.value=JSON.stringify(t.value))}));const u=this.applySearchListener(n.beforeSearch,t,r,a,o),c={argument:(null==u?void 0:u.argument)||r,entityName:t,criteria:(null==u?void 0:u.criteria)||a,options:(null==u?void 0:u.searchOptions)||o};return c.options&&(null===(s=c.options)||void 0===s||delete s.dataUnitId),new Promise(((e,t)=>{i.get().callGraphQL({values:c,query:this._templateByQuery.get("search")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}loadAdvancedSearch(t,r,a,o){var s,l,u;const c=this.applySearchListener(n.beforeSearch,t,r,a,o),d={argument:(null==c?void 0:c.argument)||r,criteria:(null==c?void 0:c.criteria)||a,searchOptions:(null==c?void 0:c.searchOptions)||o},v={query:{$:null===(s=d.criteria)||void 0===s?void 0:s.expression}};(null===(l=d.criteria)||void 0===l?void 0:l.params.length)>0&&(v.params={param:d.criteria.params.map((t=>{let i=t.value,r=t.dataType;return r===e.OBJECT?(i=i.value,r="S"):r=function(t){switch(t){case e.NUMBER:return"I";case e.DATE:return"D";default:return"S"}}(t.dataType),{$:i,type:r}}))});const h={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:Object.assign({entityName:t,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:d.argument},orderByDesc:!1,externalCriteria:v,localEntityName:null===(u=d.searchOptions)||void 0===u?void 0:u.rootEntity},{options:null!=o?{pkFieldName:o.codeFieldName,label:o.descriptionFieldName,fieldName:o.codeFieldName,useDescriptionOptions:!1,enableRowsCounter:!0}:void 0}),clientEventList:{clientEvent:[]}}};return new Promise(((e,t)=>{i.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(h)).then((t=>e(t))).catch((e=>t(e)))}))}addSearchListener(e,t,i){var r;const n=this._searchListenersByDataUnit.get(t)||[],a=n.find((t=>t.entity===e));if(a){for(const e of Object.keys(i))if(e in a.listener){if((null===(r=a.listener[e])||void 0===r?void 0:r.toString())===i[e].toString())continue;a.listener[e]=i[e]}}else this._searchListenersByDataUnit.set(t,[...n,{entity:e,listener:i}]);return()=>{const i=n.filter((t=>t.entity!==e));i.length?this._searchListenersByDataUnit.set(t,i):this._searchListenersByDataUnit.delete(t)}}applySearchListener(e,t,i,r,n){var a;const o=null==n?void 0:n.dataUnitId;if(!o)return;const s=null===(a=this._searchListenersByDataUnit.get(o))||void 0===a?void 0:a.find((({entity:e})=>e===t));if(!s)return;const{listener:l}=s;return e in l?l[e]({argument:i,criteria:r,searchOptions:n}):void 0}}var n;!function(e){e.beforeSearch="beforeSearch"}(n||(n={}));export{r as P}
@@ -1,4 +1,4 @@
1
- import{d as e,D as s}from"./p-c9399ce6.js";import{ObjectUtils as t}from"@sankhyalabs/core";class r{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
1
+ import{d as e,D as s}from"./p-88039a7f.js";import{ObjectUtils as t}from"@sankhyalabs/core";class r{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  resource
4
4
  }
@@ -1,4 +1,4 @@
1
- import{DataUnit as e,DataType as t,DateUtils as r,StringUtils as n,ChangeOperation as a,UserInterface as s,DataUnitStorage as i}from"@sankhyalabs/core";import{D as o,d as l}from"./p-c9399ce6.js";import{DISTINCT_FILTER_NAME_PREFIX as c}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as d}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{P as u}from"./p-c22c1d8e.js";import{R as h}from"./p-688dcb4c.js";import{ColumnFilterManager as m}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";class f{constructor(t,r){this.metadata=t,this.records=r,this._dataUnit=new e(f.IN_MEMORY_DATA_UNIT_NAME),this._dataUnit.metadataLoader=()=>this.metadaLoader(),this._dataUnit.dataLoader=(e,t)=>this.inMemoryLoader(e,t,this.getRecordsToLoad()),this._dataUnit.saveLoader=(e,t)=>this.saveLoader(e,t),this._dataUnit.removeLoader=(e,t)=>this.removeLoader(e,t),this.dataUnit.loadMetadata().then((()=>this.dataUnit.loadData()))}getRecordsToLoad(){return null==this._initialRecords&&this.dataUnit.records.length>0&&(this._initialRecords=this.dataUnit.records),this._initialRecords}get dataUnit(){return this._dataUnit}get records(){return this.dataUnit.records}static getConvertedValue(e,n){return e.dataType===t.BOOLEAN?"S"===n:e.dataType===t.NUMBER?Number(n):e.dataType===t.DATE?r.strToDate(n,!0):n}set records(e){const t=this._metadata?new Map(this._metadata.fields.map((e=>[e.name,e]))):void 0,r=null==e?void 0:e.map((e=>{if(e.__record__id__||(e.__record__id__=this.generateUniqueId()),null!=t)for(const r in e){const n=e[r];"string"==typeof n&&t.has(r)&&(e[r]=f.getConvertedValue(t.get(r),n))}return e}));this._initialRecords=r,this._dataUnit&&this._dataUnit.gotoPage(0)}get metadata(){return this._metadata}set metadata(e){this._metadata=e,this._dataUnit&&(this._dataUnit.metadata=this._metadata)}generateUniqueId(){return n.generateUUID()}inMemoryLoader(e,t,r){let n=this.applyFilter(r,e,t.filters);return n=this.applySorting(n,e,t.sort),Promise.resolve({records:n,paginationInfo:_(t,n)})}applyFilter(e,t,r){const n=m.getColumnFilters(r,"");if(null==n||0==n.size)return e;const a=m.getFilterFunction(t,Array.from(n.values()));return null==a?e:e.filter(a)}applySorting(e,t,r){if(null==r||0==r.length)return e;const n=u.getSortingFunction(t,r);return null==n?e:e.sort(n)}metadaLoader(){return Promise.resolve(this._metadata)}saveLoader(e,t){return new Promise((e=>{let r=[];t.forEach((e=>{let{record:t,updatingFields:n,operation:s}=e;const i=Object.assign(Object.assign({},t),n);if(s===a.INSERT||s===a.COPY)i.__old__id__=t.__record__id__,i.__record__id__=this.generateUniqueId(),this.records.push(i);else{const e=this.records.findIndex((e=>e.__record__id__==i.__record__id__));this.records[e]=i}r.push(i)})),e(r)}))}removeLoader(e,t){return new Promise((e=>{e(t)}))}}function _({offset:e,limit:t},r){if(void 0===e||void 0===t)return;const n=Math.min(e+t,r.length);return{currentPage:Math.ceil(e/t),firstRecord:e,lastRecord:n,total:r.length,hasMore:!!(r.length-n)}}f.IN_MEMORY_DATA_UNIT_NAME="InMemoryDataUnit";class p{canSlice(){return!1}async load(e,t,r){if(null==e.metadata)return Promise.resolve({records:[],loadingInfo:r});try{const n=[],a=[];if(null!=t.sort)for(const r of t.sort){const t=e.getField(r.field);null!=t&&null!=t.properties&&"true"===t.properties.calculated?n.push(r):a.push(r)}const s=this.getFieldsList(e),i="DatasetSP.loadRecords",l=this.buildRequestBody(i,s,e,t,r,a),c=r.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:d,pagerID:u}=await o.get().callServiceBroker(i,l,c),h=this.processRecords(e,s,d),m=null!=u,f=r.count+h.length,_=!m&&n.length>0;return Promise.resolve({records:h,loadingInfo:Object.assign(Object.assign({},r),{pagerId:u,loadingInProgress:m,total:m?void 0:f,count:f,needReload:_})})}catch(e){return console.error(e),Promise.reject(e)}}getFieldsList(e){let t=["__record__id__","__record__label__"];return e.metadata.fields.forEach((e=>{e.standAlone||(t=t.concat(this.getFieldNames(e)))})),t}getFieldNames(e){const t=this.getSearchDescriptionField(e);return null==t?e.name:[e.name,t]}buildRequestBody(e,t,r,n,a,s){const i=r.name,o={serviceName:e,requestBody:{dataSetID:r.dataUnitId,fields:t,entityName:y.parseDataUnitName(i).entityName,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:{__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},tryJoinedFields:!0,parallelLoader:!0,crudListener:"br.com.sankhya.modelcore.dataset.DataUnitDatasetAdapter",txProperties:this.getTxProperties(i,n,s),useDefaultRowsLimit:!1}};return JSON.stringify(o)}getTxProperties(e,t,r){const n={"__DATA_UNIT_ADAPTER__[dataUnitName]":e},a=t.filters.filter((e=>!e.name.startsWith("FILTRO_COLUNA_")));return 0!==a.length&&(n["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(a)),null!=r&&0!==r.length&&(n["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(r)),null!=t.parentRecordId&&(n["__DATA_UNIT_ADAPTER__[parentRecordId]"]=t.parentRecordId),n}processRecords(e,t,r){return r.map((r=>{const n={__record__id__:r[0],__record__label__:r[1]};return e.metadata.fields.forEach((e=>{n[e.name]=this.buildFieldValue(e,t,r)})),n}))}buildFieldValue(e,t,r){const a=t.indexOf(e.name);if(a<0)return null;const i=r[a];if(n.isEmpty(i))return null;const o=this.getSearchDescriptionField(e);if(null!=o){const e=t.indexOf(o);if(e>=0)return{value:i,label:r[e]}}return e.userInterface===s.SEARCH?isNaN(Number(i))?i:Number(i):f.getConvertedValue(e,i)}getSearchDescriptionField(e){if(e.userInterface===s.SEARCH){const{ENTITYNAME:t,mergedFrom:r,DESCRIPTIONFIELD:a}=e.properties;if(!n.isEmpty(a))return null!=r?`${r}.${t}.${a}`:`${t}.${a}`}}}class g{static async debounce(e,t){const r=e.name;g._debouncingTimeouts[r]&&(clearTimeout(g._debouncingTimeouts[r]),delete g._debouncingTimeouts[r]),g._debouncingTimeouts[r]=setTimeout((()=>{delete g._debouncingTimeouts[r],t()}),100)}static async loadData(e,t){return new Promise(((r,n)=>{g.debounce(e,(()=>{u.loadData(e,t,this.loadFromServer).then((e=>r(e))).catch((e=>n(e)))}))}))}static async loadFromServer(e,t,r){try{r=g.registryLoading(e,r);const n=await g.callLoader(e,t,r);if(null==n)return;const a=n.records,s=g.buildPaginationInfo(a.length,t,n.loadingInfo),i=null==s?a:a.slice(0,s.lastRecord);return Promise.resolve({records:i,paginationInfo:s})}catch(e){return console.error(e),Promise.reject(e)}}static async callLoader(e,t,r,n){null==n&&(n=new p);const a=await n.load(e,t,r),{records:s,loadingInfo:i}=a;if(g.isOldRequest(e,i))return Promise.resolve(void 0);const o=!n.canSlice()||0===i.count;if(u.cacheRecords(e,s,o,i.loadingInProgress),u.isCacheEnabled(e)&&i.loadingInProgress){const r=Object.assign(Object.assign({},t),{offset:i.count}),a=Object.assign(Object.assign({},i),{pageNumber:(i.pageNumber||0)+1,quiet:!0});this.callLoader(e,r,a,n).then((t=>g.afterLoadingPage(e,t.loadingInfo))).catch((e=>console.error(e)))}return Promise.resolve(a)}static afterLoadingPage(e,t){u.setLoadingStatus(e,t.loadingInProgress);const r=e.getPaginationInfo();if(null==r)return;const n=t.count;t.loadingInProgress?e.updatePagination(Object.assign(Object.assign({},r),{count:n})):t.needReload?e.gotoPage(0):e.updatePagination(Object.assign(Object.assign({},r),{total:n,count:n}))}static registryLoading(e,t){return null==t&&(t={requestTime:(new Date).getTime(),count:0}),g._requestTimeByDataUnit.set(e.name,t.requestTime),t}static isOldRequest(e,t){return g._requestTimeByDataUnit.get(e.name)>t.requestTime}static buildPaginationInfo(e,t,r){let{limit:n,offset:a}=t;if(!n)return;1===r.pageNumber&&(a=0);const{total:s,count:i,loadingInProgress:o}=r,l=0===i||0===e?0:a+1,c=a+Math.min(e,n);return{total:s,count:i,lastRecord:c,firstRecord:l,currentPage:a/n,hasMore:c<i||o}}}g._requestTimeByDataUnit=new Map,g._debouncingTimeouts={};const b=/dd:\/\/([^/]+)\/([^/?]+)/;class y{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",l.gql`query($name: String!) {
1
+ import{DataUnit as e,DataType as t,DateUtils as r,StringUtils as n,ChangeOperation as a,UserInterface as s,DataUnitStorage as i}from"@sankhyalabs/core";import{D as o,d as l}from"./p-88039a7f.js";import{DISTINCT_FILTER_NAME_PREFIX as c}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as d}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{P as u}from"./p-c22c1d8e.js";import{R as h}from"./p-688dcb4c.js";import{ColumnFilterManager as m}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";class f{constructor(t,r){this.metadata=t,this.records=r,this._dataUnit=new e(f.IN_MEMORY_DATA_UNIT_NAME),this._dataUnit.metadataLoader=()=>this.metadaLoader(),this._dataUnit.dataLoader=(e,t)=>this.inMemoryLoader(e,t,this.getRecordsToLoad()),this._dataUnit.saveLoader=(e,t)=>this.saveLoader(e,t),this._dataUnit.removeLoader=(e,t)=>this.removeLoader(e,t),this.dataUnit.loadMetadata().then((()=>this.dataUnit.loadData()))}getRecordsToLoad(){return null==this._initialRecords&&this.dataUnit.records.length>0&&(this._initialRecords=this.dataUnit.records),this._initialRecords}get dataUnit(){return this._dataUnit}get records(){return this.dataUnit.records}static getConvertedValue(e,n){return e.dataType===t.BOOLEAN?"S"===n:e.dataType===t.NUMBER?Number(n):e.dataType===t.DATE?r.strToDate(n,!0):n}set records(e){const t=this._metadata?new Map(this._metadata.fields.map((e=>[e.name,e]))):void 0,r=null==e?void 0:e.map((e=>{if(e.__record__id__||(e.__record__id__=this.generateUniqueId()),null!=t)for(const r in e){const n=e[r];"string"==typeof n&&t.has(r)&&(e[r]=f.getConvertedValue(t.get(r),n))}return e}));this._initialRecords=r,this._dataUnit&&this._dataUnit.gotoPage(0)}get metadata(){return this._metadata}set metadata(e){this._metadata=e,this._dataUnit&&(this._dataUnit.metadata=this._metadata)}generateUniqueId(){return n.generateUUID()}inMemoryLoader(e,t,r){let n=this.applyFilter(r,e,t.filters);return n=this.applySorting(n,e,t.sort),Promise.resolve({records:n,paginationInfo:_(t,n)})}applyFilter(e,t,r){const n=m.getColumnFilters(r,"");if(null==n||0==n.size)return e;const a=m.getFilterFunction(t,Array.from(n.values()));return null==a?e:e.filter(a)}applySorting(e,t,r){if(null==r||0==r.length)return e;const n=u.getSortingFunction(t,r);return null==n?e:e.sort(n)}metadaLoader(){return Promise.resolve(this._metadata)}saveLoader(e,t){return new Promise((e=>{let r=[];t.forEach((e=>{let{record:t,updatingFields:n,operation:s}=e;const i=Object.assign(Object.assign({},t),n);if(s===a.INSERT||s===a.COPY)i.__old__id__=t.__record__id__,i.__record__id__=this.generateUniqueId(),this.records.push(i);else{const e=this.records.findIndex((e=>e.__record__id__==i.__record__id__));this.records[e]=i}r.push(i)})),e(r)}))}removeLoader(e,t){return new Promise((e=>{e(t)}))}}function _({offset:e,limit:t},r){if(void 0===e||void 0===t)return;const n=Math.min(e+t,r.length);return{currentPage:Math.ceil(e/t),firstRecord:e,lastRecord:n,total:r.length,hasMore:!!(r.length-n)}}f.IN_MEMORY_DATA_UNIT_NAME="InMemoryDataUnit";class p{canSlice(){return!1}async load(e,t,r){if(null==e.metadata)return Promise.resolve({records:[],loadingInfo:r});try{const n=[],a=[];if(null!=t.sort)for(const r of t.sort){const t=e.getField(r.field);null!=t&&null!=t.properties&&"true"===t.properties.calculated?n.push(r):a.push(r)}const s=this.getFieldsList(e),i="DatasetSP.loadRecords",l=this.buildRequestBody(i,s,e,t,r,a),c=r.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:d,pagerID:u}=await o.get().callServiceBroker(i,l,c),h=this.processRecords(e,s,d),m=null!=u,f=r.count+h.length,_=!m&&n.length>0;return Promise.resolve({records:h,loadingInfo:Object.assign(Object.assign({},r),{pagerId:u,loadingInProgress:m,total:m?void 0:f,count:f,needReload:_})})}catch(e){return console.error(e),Promise.reject(e)}}getFieldsList(e){let t=["__record__id__","__record__label__"];return e.metadata.fields.forEach((e=>{e.standAlone||(t=t.concat(this.getFieldNames(e)))})),t}getFieldNames(e){const t=this.getSearchDescriptionField(e);return null==t?e.name:[e.name,t]}buildRequestBody(e,t,r,n,a,s){const i=r.name,o={serviceName:e,requestBody:{dataSetID:r.dataUnitId,fields:t,entityName:y.parseDataUnitName(i).entityName,pageNumber:a.pageNumber,totalRecordsCount:a.count,pagerID:a.pagerId,standAlone:!1,standAloneFieldsMD:{__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},tryJoinedFields:!0,parallelLoader:!(!n.limit&&!n.offset),crudListener:"br.com.sankhya.modelcore.dataset.DataUnitDatasetAdapter",txProperties:this.getTxProperties(i,n,s),useDefaultRowsLimit:!1}};return JSON.stringify(o)}getTxProperties(e,t,r){const n={"__DATA_UNIT_ADAPTER__[dataUnitName]":e},a=t.filters.filter((e=>!e.name.startsWith("FILTRO_COLUNA_")));return 0!==a.length&&(n["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(a)),null!=r&&0!==r.length&&(n["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(r)),null!=t.parentRecordId&&(n["__DATA_UNIT_ADAPTER__[parentRecordId]"]=t.parentRecordId),n}processRecords(e,t,r){return r.map((r=>{const n={__record__id__:r[0],__record__label__:r[1]};return e.metadata.fields.forEach((e=>{n[e.name]=this.buildFieldValue(e,t,r)})),n}))}buildFieldValue(e,t,r){const a=t.indexOf(e.name);if(a<0)return null;const i=r[a];if(n.isEmpty(i))return null;const o=this.getSearchDescriptionField(e);if(null!=o){const e=t.indexOf(o);if(e>=0)return{value:i,label:r[e]}}return e.userInterface===s.SEARCH?isNaN(Number(i))?i:Number(i):f.getConvertedValue(e,i)}getSearchDescriptionField(e){if(e.userInterface===s.SEARCH){const{ENTITYNAME:t,mergedFrom:r,DESCRIPTIONFIELD:a}=e.properties;if(!n.isEmpty(a))return null!=r?`${r}.${t}.${a}`:`${t}.${a}`}}}class g{static async debounce(e,t){const r=e.name;g._debouncingTimeouts[r]&&(clearTimeout(g._debouncingTimeouts[r]),delete g._debouncingTimeouts[r]),g._debouncingTimeouts[r]=setTimeout((()=>{delete g._debouncingTimeouts[r],t()}),100)}static async loadData(e,t){return new Promise(((r,n)=>{g.debounce(e,(()=>{u.loadData(e,t,this.loadFromServer).then((e=>r(e))).catch((e=>n(e)))}))}))}static async loadFromServer(e,t,r){try{r=g.registryLoading(e,r);const n=await g.callLoader(e,t,r);if(null==n)return;const a=n.records,s=g.buildPaginationInfo(a.length,t,n.loadingInfo),i=null==s?a:a.slice(0,s.lastRecord);return Promise.resolve({records:i,paginationInfo:s})}catch(e){return console.error(e),Promise.reject(e)}}static async callLoader(e,t,r,n){null==n&&(n=new p);const a=await n.load(e,t,r),{records:s,loadingInfo:i}=a;if(g.isOldRequest(e,i))return Promise.resolve(void 0);const o=!n.canSlice()||0===i.count;if(u.cacheRecords(e,s,o,i.loadingInProgress),u.isCacheEnabled(e)&&i.loadingInProgress){const r=Object.assign(Object.assign({},t),{offset:i.count}),a=Object.assign(Object.assign({},i),{pageNumber:(i.pageNumber||0)+1,quiet:!0});this.callLoader(e,r,a,n).then((t=>g.afterLoadingPage(e,t.loadingInfo))).catch((e=>console.error(e)))}return Promise.resolve(a)}static afterLoadingPage(e,t){u.setLoadingStatus(e,t.loadingInProgress);const r=e.getPaginationInfo();if(null==r)return;const n=t.count;t.loadingInProgress?e.updatePagination(Object.assign(Object.assign({},r),{count:n})):t.needReload?e.gotoPage(0):e.updatePagination(Object.assign(Object.assign({},r),{total:n,count:n}))}static registryLoading(e,t){return null==t&&(t={requestTime:(new Date).getTime(),count:0}),g._requestTimeByDataUnit.set(e.name,t.requestTime),t}static isOldRequest(e,t){return g._requestTimeByDataUnit.get(e.name)>t.requestTime}static buildPaginationInfo(e,t,r){let{limit:n,offset:a}=t;if(!n)return;1===r.pageNumber&&(a=0);const{total:s,count:i,loadingInProgress:o}=r,l=0===i||0===e?0:a+1,c=a+Math.min(e,n);return{total:s,count:i,lastRecord:c,firstRecord:l,currentPage:a/n,hasMore:c<i||o}}}g._requestTimeByDataUnit=new Map,g._debouncingTimeouts={};const b=/dd:\/\/([^/]+)\/([^/?]+)/;class y{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",l.gql`query($name: String!) {
2
2
  $queryAlias$: fetchDataUnit(name: $name){
3
3
  name
4
4
  fields{
@@ -1,4 +1,4 @@
1
- import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as a,WaitingChangeException as o,WarningException as c,ErrorException as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,DataType as d,ApplicationContext as m,ErrorTracking as w}from"@sankhyalabs/core";import{ApplicationUtils as y}from"@sankhyalabs/ezui/dist/collection/utils";import{C as f}from"./p-29176742.js";import{d as P,D as g,U as v}from"./p-c9399ce6.js";import{A,a as I}from"./p-d0b36421.js";import{D as _}from"./p-73407f35.js";import{P as S}from"./p-41d156dd.js";import{S as C}from"./p-aa3b0d19.js";import"./p-4651b43f.js";import"./p-584d7212.js";import"./p-112455b1.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-c22c1d8e.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";class D{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const E=N;function N(t,s){const e=b();return(N=function(t){return e[t-=378]})(t,s)}function b(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(b=function(){return t})()}!function(){const t=N,s=b();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class k{[E(397)](t){const s=E;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new L("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class L{constructor(t){const s=E;this.isSup=t,this[s(384)]={}}[E(378)](t,s){this[E(384)][t]=s}[E(393)](t){const s=E;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class T{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",P.gql`query($name: String!) {
1
+ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as a,WaitingChangeException as o,WarningException as c,ErrorException as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,DataType as d,ApplicationContext as m,ErrorTracking as w}from"@sankhyalabs/core";import{ApplicationUtils as f}from"@sankhyalabs/ezui/dist/collection/utils";import{C as y}from"./p-a9b6acf1.js";import{d as P,D as g,U as v}from"./p-88039a7f.js";import{A,a as I}from"./p-3f0fe056.js";import{D as _}from"./p-ee49df44.js";import{P as S}from"./p-e38f28ae.js";import{S as C}from"./p-aa3b0d19.js";import"./p-e47d966c.js";import"./p-584d7212.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-c22c1d8e.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";class D{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const E=N;function N(t,s){const e=k();return(N=function(t){return e[t-=378]})(t,s)}function k(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(k=function(){return t})()}!function(){const t=N,s=k();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class L{[E(397)](t){const s=E;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new T("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class T{constructor(t){const s=E;this.isSup=t,this[s(384)]={}}[E(378)](t,s){this[E(384)][t]=s}[E(393)](t){const s=E;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class b{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",P.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  name
4
4
  resource
@@ -8,4 +8,4 @@ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,S
8
8
  name
9
9
  value
10
10
  }
11
- }`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{g.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}function j(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(j=function(){return t})()}const U=$;function $(t,s){const e=j();return($=function(t){return e[t-=392]})(t,s)}!function(){const t=$,s=j();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const R=U(396);var M;class F{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static applicationClick(){var t,s;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(s=window.workspace)||void 0===s||s.applicationClick())}}F.resourceID=null===(M=window.workspace)||void 0===M?void 0:M.resourceID;class z{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof o||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof o||t instanceof c?this._app.alert(t.title,t.message):t instanceof h?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${a.objectToString(t)}"`;this._app.error(s,e)}}))}}const q=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new x,this._pendingActions=new Map,this._isLoadedByPk=!1,this.messagesBuilder=void 0,this.configName=void 0,this.loadByPK=void 0}async processPendingActions(t){const s=this._pendingActions.get(t);s&&s.length&&(s.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new T),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new B(t,s)),e||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async addPendingAction(t,s){var e;const i=null!==(e=this._pendingActions.get(t))&&void 0!==e?e:[];this._pendingActions.set(t,[...i,s])}async callServiceBroker(t,s,e){return g.get().callServiceBroker(t,s,e)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){u.getInstance().init(t,window.envContext)}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(A).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return y.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{g.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{g.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){F.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{D.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new B(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,r);o.length>0;)o.pop().resolve(r)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,s){return new Promise((e=>{g.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{g.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(g.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||F.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return y.alert(t,s,e,i)}async error(t,s,e,i){return y.error(t,s,e,i)}async success(t,s,e,i){return y.success(t,s,e,i)}async message(t,s,e,i){return y.message(t,s,e,i)}async confirm(t,s,e,i,n){return y.confirm(t,s,e,i,n)}async info(t,s){return y.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async getAuthList(t){return await(new k).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=v.getQueryParams(location.search)),this._urlParams}getMessage(t,s){var e;return null===(e=this.messagesBuilder)||void 0===e?void 0:e.getMessage(t,s)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new _),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new O),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new S),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new I),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let p;const m={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||d.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,n,{entity:r,entityDescription:h,criteria:p,searchOptions:m})}}async executePreparedSearch(t,s,e){const{entity:i,entityDescription:n,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(n),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(i,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return F.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(g.get())}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const s=this.getResourceIdFromToken(),e=v.getPkObjectFromUrlToken(top.window.location.hash);if(null==e||s!==this.applicationResourceID)return;const i={pk:e};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(i),void(this._currentPkParameter=t);this.defaultLoadByPK(i,t)}getResourceIdFromToken(){return top.window.location.pathname.indexOf("tabContent.jsp")>-1?v.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):v.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,s){if(!(null==t?void 0:t.pk))return;const e=this.getFirstDataUnitFromDOM(),i=e.dataUnit;if(!i)return console.warn("Dataunit não inicializado"),void e.addEventListener("dataUnitReady",(e=>{this.loadDataWithPKFilter(t,e.detail),this._currentPkParameter=s}));this.loadDataWithPKFilter(t,i),this._currentPkParameter=s}loadDataWithPKFilter(t,s){const e={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,s)}};s.loadData(e)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,s){var e;const i=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&i.push({name:n,dataType:(null===(e=s.getField(n))||void 0===e?void 0:e.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return i}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?d.NUMBER:"boolean"==typeof t||t instanceof Boolean?d.BOOLEAN:t instanceof Date?d.DATE:d.TEXT}buildFilterExpressionByPkObject(t){let s="";for(const e in t.pk)r.isEmpty(s)||(s+=" AND "),Array.isArray(t.pk[e])?s+=`${e} IN (${t.pk[e].toString()})`:s+=`${e} = :${e}`;return s}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),s=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:s}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const e=document.createElement("p");e.innerText=this.getMessage("snkApplication.newVersionPopup.info"),e.className="ez-text",t.appendChild(e),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const i=await y.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await i(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&F.setScreenToUseV3Layout(),"CANCEL"===t.detail&&F.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){m.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new z(this),this.messagesBuilder=new C,m.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${v.getUrlBase()}/mge/upload/file`),m.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),m.setContextValue("__EZUI__GRID_LICENSE__",R),this.registerPkChangeListener(),w.init(),f.preload(this.applicationResourceID,this.configName),document.addEventListener("click",(()=>F.applicationClick()))}connectedCallback(){m.setContextValue("__SNK__APPLICATION__",this),g.addRequestListener(this._requestListener)}disconnectedCallback(){g.removeRequestListener(this._requestListener)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{m.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),p.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup()}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class x{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class B{constructor(t,s){this.resolve=t,this.reject=s}}q.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{q as snk_application}
11
+ }`)}fetchTotals(t,s,e=[]){const i=`${t}_${s}`,n=this.cancel.findIndex((t=>t[i]));return n>=0&&(this.cancel[n][i](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[i]:t}))),this.getTotals(t,s,e)]).then((t=>{let s=new Map;if(t){s=t;const e=this.cancel.findIndex((t=>t[i]));e>=0&&this.cancel.splice(e,1)}return s}))}getTotals(t,s,e=[]){return new Promise(((i,n)=>{g.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${s}`,filters:e}}).then((t=>{if(t.length>0){const s=new Map;return t.forEach((t=>s.set(t.name,parseFloat(t.value)))),i(s)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}function U(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(U=function(){return t})()}const j=$;function $(t,s){const e=U();return($=function(t){return e[t-=392]})(t,s)}!function(){const t=$,s=U();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const R=j(396);var M;class F{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static applicationClick(){var t,s;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(s=window.workspace)||void 0===s||s.applicationClick())}}F.resourceID=null===(M=window.workspace)||void 0===M?void 0:M.resourceID;class z{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof o||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof o||t instanceof c?this._app.alert(t.title,t.message):t instanceof h?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${a.objectToString(t)}"`;this._app.error(s,e)}}))}}const q=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new x,this._pendingActions=new Map,this._isLoadedByPk=!1,this.messagesBuilder=void 0,this.configName=void 0,this.loadByPK=void 0}async processPendingActions(t){const s=this._pendingActions.get(t);s&&s.length&&(s.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new b),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((s,e)=>{this.authFetcher.getData(t).then((t=>{s(t)})).catch((t=>{e(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new B(t,s)),e||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,s)=>{this.getAuth().then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}async addPendingAction(t,s){var e;const i=null!==(e=this._pendingActions.get(t))&&void 0!==e?e:[];this._pendingActions.set(t,[...i,s])}async callServiceBroker(t,s,e){return g.get().callServiceBroker(t,s,e)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){u.getInstance().init(t,window.envContext)}async hasAccess(t,s){return new Promise(((e,i)=>{this.getAuth(s).then((s=>{this.getAuthList(s).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>i(t)))}))}))}async getAllAccess(t){return new Promise(((s,e)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const e={};e.isSup=t.isSup,Object.entries(A).forEach((s=>{e[s[0]]=t.actions[s[1]]||!1})),s(e)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return f.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{g.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{g.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){F.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{D.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e,i,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(s),c=o.length>0;if(o.push(new B(r,a)),!c){const r=this.dataUnitFetcher.getDataUnit(t,n,e,i);r.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,r);o.length>0;)o.pop().resolve(r)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e,i,n){return new Promise(((r,a)=>{const o=this._duCache.get(s);o?r(o):this.createDataunit(t,s,e,i,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,s){return new Promise((e=>{g.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{g.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(g.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||F.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return f.alert(t,s,e,i)}async error(t,s,e,i){return f.error(t,s,e,i)}async success(t,s,e,i){return f.success(t,s,e,i)}async message(t,s,e,i){return f.message(t,s,e,i)}async confirm(t,s,e,i,n){return f.confirm(t,s,e,i,n)}async info(t,s){return f.info(t,s)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async getAuthList(t){return await(new L).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=v.getQueryParams(location.search)),this._urlParams}getMessage(t,s){var e;return null===(e=this.messagesBuilder)||void 0===e?void 0:e.getMessage(t,s)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new _),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new O),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new S),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new I),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let p;const m={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||d.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,n,{entity:r,entityDescription:h,criteria:p,searchOptions:m})}}async executePreparedSearch(t,s,e){const{entity:i,entityDescription:n,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(n),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(i,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return F.getAppLabel(this.applicationResourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}importScript(t){return new Promise((s=>{this.getApplicationPath().then((e=>{let i=[];Array.isArray(t)||(i=[t]),i.forEach((t=>{const s=document.createElement("script");s.src=`${e}/${t}`,s.async=!0,document.body.appendChild(s)})),s()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}getDataFetcher(){return Promise.resolve(g.get())}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const s=this.getResourceIdFromToken(),e=v.getPkObjectFromUrlToken(top.window.location.hash);if(null==e||s!==this.applicationResourceID)return;const i={pk:e};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(i),void(this._currentPkParameter=t);this.defaultLoadByPK(i,t)}getResourceIdFromToken(){return top.window.location.pathname.indexOf("tabContent.jsp")>-1?v.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):v.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,s){if(!(null==t?void 0:t.pk))return;const e=this.getFirstDataUnitFromDOM(),i=e.dataUnit;if(!i)return console.warn("Dataunit não inicializado"),void e.addEventListener("dataUnitReady",(e=>{this.loadDataWithPKFilter(t,e.detail),this._currentPkParameter=s}));this.loadDataWithPKFilter(t,i),this._currentPkParameter=s}loadDataWithPKFilter(t,s){const e={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,s)}};s.loadData(e)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,s){var e;const i=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&i.push({name:n,dataType:(null===(e=s.getField(n))||void 0===e?void 0:e.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return i}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?d.NUMBER:"boolean"==typeof t||t instanceof Boolean?d.BOOLEAN:t instanceof Date?d.DATE:d.TEXT}buildFilterExpressionByPkObject(t){let s="";for(const e in t.pk)r.isEmpty(s)||(s+=" AND "),Array.isArray(t.pk[e])?s+=`${e} IN (${t.pk[e].toString()})`:s+=`${e} = :${e}`;return s}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),s=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:s}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const e=document.createElement("p");e.innerText=this.getMessage("snkApplication.newVersionPopup.info"),e.className="ez-text",t.appendChild(e),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const i=await f.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await i(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&F.setScreenToUseV3Layout(),"CANCEL"===t.detail&&F.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){m.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new z(this),this.messagesBuilder=new C,m.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${v.getUrlBase()}/mge/upload/file`),m.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),m.setContextValue("__EZUI__GRID_LICENSE__",R),this.registerPkChangeListener(),w.init(),y.preload(this.applicationResourceID,this.configName),document.addEventListener("click",(()=>F.applicationClick()))}connectedCallback(){m.setContextValue("__SNK__APPLICATION__",this),g.addRequestListener(this._requestListener)}disconnectedCallback(){g.removeRequestListener(this._requestListener)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{m.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),p.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup()}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class x{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class B{constructor(t,s){this.resolve=t,this.reject=s}}q.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{q as snk_application}
@@ -0,0 +1 @@
1
+ class t{constructor(t){this._canceled=!1,this.data=t}get type(){return this.constructor.type}get cancelable(){return this.constructor.cancelable}cancel(){this._canceled=!0}canceled(){return this._canceled}clone(t){return new this.constructor({...this.data,...t})}}t.type="event",t.cancelable=!1;class e{constructor(t){this.draggable=t}attach(){throw new Error("Not Implemented")}detach(){throw new Error("Not Implemented")}}const s={mouse:0,drag:0,touch:100};class i{constructor(t=[],e={}){this.containers=[...t],this.options={...e},this.dragging=!1,this.currentContainer=null,this.originalSource=null,this.startEvent=null,this.delay=function(t){const e={};if(void 0===t)return{...s};if("number"==typeof t){for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=t);return e}for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=void 0===t[i]?s[i]:t[i]);return e}(e.delay)}attach(){return this}detach(){return this}addContainer(...t){this.containers=[...this.containers,...t]}removeContainer(...t){this.containers=this.containers.filter((e=>!t.includes(e)))}trigger(t,e){const s=document.createEvent("Event");return s.detail=e,s.initEvent(e.type,!0,!0),t.dispatchEvent(s),this.lastEvent=e,e}}function r(t,e){if(null==t)return null;let s=t;do{if(s=s.correspondingUseElement||s.correspondingElement||s,null!=(i=s)&&null!=e&&(function(t){return Boolean("string"==typeof t)}(e)?Element.prototype.matches.call(i,e):function(t){return Boolean(t instanceof NodeList||t instanceof Array)}(e)?[...e].includes(i):function(t){return Boolean(t instanceof Node)}(e)?e===i:function(t){return Boolean("function"==typeof t)}(e)&&e(i)))return s;s=s?.parentNode||null}while(null!=s&&s!==document.body&&s!==document);var i;return null}function n(t,e,s,i){return Math.sqrt((s-t)**2+(i-e)**2)}class o extends t{get originalEvent(){return this.data.originalEvent}get clientX(){return this.data.clientX}get clientY(){return this.data.clientY}get target(){return this.data.target}get container(){return this.data.container}get originalSource(){return this.data.originalSource}get pressure(){return this.data.pressure}}class h extends o{}h.type="drag:start";class a extends o{}a.type="drag:move";class c extends o{}c.type="drag:stop";const u=Symbol("onContextMenuWhileDragging"),l=Symbol("onMouseDown"),d=Symbol("onMouseMove"),g=Symbol("onMouseUp"),m=Symbol("startDrag"),f=Symbol("onDistanceChange");function v(t){t.preventDefault()}function p(t){const{touches:e,changedTouches:s}=t;return e&&e[0]||s&&s[0]}const b=Symbol("onTouchStart"),w=Symbol("onTouchEnd"),y=Symbol("onTouchMove"),x=Symbol("startDrag"),S=Symbol("onDistanceChange");let C=!1;function E(t){t.preventDefault(),t.stopPropagation()}function M(t,e){return function(s){(function(t){if(t.v)throw new Error("attempted to call addInitializer after decoration was finished")})(e),O(s,"An initializer"),t.push(s)}}function D(t,e){if(!t(e))throw new TypeError("Attempted to access private element on non-instance")}function T(t,e,s,i,r,n,o,h,a,c,u){var l;switch(n){case 1:l="accessor";break;case 2:l="method";break;case 3:l="getter";break;case 4:l="setter";break;default:l="field"}var d,g,m={kind:l,name:h?"#"+s:s,static:o,private:h,metadata:u},f={v:!1};if(0!==n&&(m.addInitializer=M(r,f)),h||0!==n&&2!==n)if(2===n)d=function(t){return D(c,t),i.value};else{var v=0===n||1===n;(v||3===n)&&(d=h?function(t){return D(c,t),i.get.call(t)}:function(t){return i.get.call(t)}),(v||4===n)&&(g=h?function(t,e){D(c,t),i.set.call(t,e)}:function(t,e){i.set.call(t,e)})}else d=function(t){return t[s]},0===n&&(g=function(t,e){t[s]=e});var p=h?c.bind():function(t){return s in t};m.access=d&&g?{get:d,set:g,has:p}:d?{get:d,has:p}:{set:g,has:p};try{return t.call(e,a,m)}finally{f.v=!0}}function O(t,e){if("function"!=typeof t)throw new TypeError(e+" must be a function")}function X(t,e){var s=typeof e;if(1===t){if("object"!==s||null===e)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==e.get&&O(e.get,"accessor.get"),void 0!==e.set&&O(e.set,"accessor.set"),void 0!==e.init&&O(e.init,"accessor.init")}else if("function"!==s)throw new TypeError((0===t?"field":5===t?"class":"method")+" decorators must return a function or void 0")}function Y(t){return function(){return t(this)}}function A(t){return function(e){t(this,e)}}function F(t,e,s,i,r,n,o,h,a,c,u){var l,d,g,m,f=s[0];i||Array.isArray(f)||(f=[f]),h?l=0===n||1===n?{get:Y(s[3]),set:A(s[4])}:3===n?{get:s[3]}:4===n?{set:s[3]}:{value:s[3]}:0!==n&&(l=Object.getOwnPropertyDescriptor(e,r)),1===n?g={get:l.get,set:l.set}:2===n?g=l.value:3===n?g=l.get:4===n&&(g=l.set);for(var v=i?2:1,p=f.length-1;p>=0;p-=v){var b;void 0!==(m=T(f[p],i?f[p-1]:void 0,r,l,a,n,o,h,g,c,u))&&(X(n,m),0===n?b=m:1===n?(b=m.init,g={get:m.get||g.get,set:m.set||g.set}):g=m,void 0!==b&&(void 0===d?d=b:"function"==typeof d?d=[d,b]:d.push(b)))}if(0===n||1===n){if(void 0===d)d=function(t,e){return e};else if("function"!=typeof d){var w=d;d=function(t,e){for(var s=e,i=w.length-1;i>=0;i--)s=w[i].call(t,s);return s}}else{var y=d;d=function(t,e){return y.call(t,e)}}t.push(d)}0!==n&&(1===n?(l.get=g.get,l.set=g.set):2===n?l.value=g:3===n?l.get=g:4===n&&(l.set=g),h?1===n?(t.push((function(t,e){return g.get.call(t,e)})),t.push((function(t,e){return g.set.call(t,e)}))):t.push(2===n?g:function(t,e){return g.call(t,e)}):Object.defineProperty(e,r,l))}function I(t,e,s,i){for(var r,n,o,h=[],a=new Map,c=new Map,u=0;u<e.length;u++){var l=e[u];if(Array.isArray(l)){var d,g,m=l[1],f=l[2],v=l.length>3,p=16&m,b=!!(8&m),w=s;if(m&=7,b?(d=t,0!==m&&(g=n=n||[]),v&&!o&&(o=function(e){return P(e)===t}),w=o):(d=t.prototype,0!==m&&(g=r=r||[])),0!==m&&!v){var y=b?c:a,x=y.get(f)||0;if(!0===x||3===x&&4!==m||4===x&&3!==m)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+f);y.set(f,!(!x&&m>2)||m)}F(h,d,l,p,f,m,b,v,g,w,i)}}return $(h,r),$(h,n),h}function $(t,e){e&&t.push((function(t){for(var s=0;s<e.length;s++)e[s].call(t);return t}))}function j(t,e,s,i){if(e.length){for(var r=[],n=t,o=t.name,h=s?2:1,a=e.length-1;a>=0;a-=h){var c={v:!1};try{var u=e[a].call(s?e[a-1]:void 0,n,{kind:"class",name:o,addInitializer:M(r,c),metadata:i})}finally{c.v=!0}void 0!==u&&(X(5,u),n=u)}return[q(n,i),function(){for(var t=0;t<r.length;t++)r[t].call(n)}]}}function q(t,e){return Object.defineProperty(t,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:e})}function z(t,e,s,i,r,n){if(arguments.length>=6)var o=n[Symbol.metadata||Symbol.for("Symbol.metadata")];var h=Object.create(void 0===o?null:o),a=I(t,e,r,h);return s.length||q(t,h),{e:a,get c(){return j(t,s,i,h)}}}function P(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}function N(t,{name:e,addInitializer:s}){s((function(){this[e]=t.bind(this)}))}window.addEventListener("touchmove",(t=>{C&&t.preventDefault()}),{passive:!1});class B extends t{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get mirror(){return this.data.mirror}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}B.type="drag";class L extends B{}L.type="drag:start",L.cancelable=!0;class k extends B{}k.type="drag:move";class H extends B{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}H.type="drag:over",H.cancelable=!0;class R extends B{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}R.type="drag:out";class W extends B{get overContainer(){return this.data.overContainer}}W.type="drag:over:container";class U extends B{get overContainer(){return this.data.overContainer}}U.type="drag:out:container";class G extends B{get pressure(){return this.data.pressure}}G.type="drag:pressure";class J extends B{}J.type="drag:stop",J.cancelable=!0;class K extends B{}var Q,V,Z,_;K.type="drag:stopped",V=class extends e{constructor(t){Q(super(t)),this.lastWidth=0,this.lastHeight=0,this.mirror=null}attach(){this.draggable.on("mirror:created",this.onMirrorCreated).on("drag:over",this.onDragOver).on("drag:over:container",this.onDragOver)}detach(){this.draggable.off("mirror:created",this.onMirrorCreated).off("mirror:destroy",this.onMirrorDestroy).off("drag:over",this.onDragOver).off("drag:over:container",this.onDragOver)}getOptions(){return this.draggable.options.resizeMirror||{}}onMirrorCreated({mirror:t}){this.mirror=t}onMirrorDestroy(){this.mirror=null}onDragOver(t){this.resize(t)}resize(t){requestAnimationFrame((()=>{let e=null;const{overContainer:s}=t;if(null==this.mirror||null==this.mirror.parentNode)return;this.mirror.parentNode!==s&&s.appendChild(this.mirror),t.type===H.type&&(e=t.over);const i=e||this.draggable.getDraggableElementsForContainer(s)[0];var r;i&&(r=()=>{const t=i.getBoundingClientRect();null==this.mirror||this.lastHeight===t.height&&this.lastWidth===t.width||(this.mirror.style.width=`${t.width}px`,this.mirror.style.height=`${t.height}px`,this.lastWidth=t.width,this.lastHeight=t.height)},requestAnimationFrame((()=>{requestAnimationFrame(r)})))}))}},[Q]=z(V,[[N,2,"onMirrorCreated"],[N,2,"onMirrorDestroy"],[N,2,"onDragOver"]],[],0,void 0,e).e;const tt={duration:150,easingFunction:"ease-in-out",horizontal:!1};function et(t,e,{duration:s,easingFunction:i,horizontal:r}){for(const s of[t,e])s.style.pointerEvents="none";if(r){const s=t.offsetWidth;t.style.transform=`translate3d(${s}px, 0, 0)`,e.style.transform=`translate3d(-${s}px, 0, 0)`}else{const s=t.offsetHeight;t.style.transform=`translate3d(0, ${s}px, 0)`,e.style.transform=`translate3d(0, -${s}px, 0)`}requestAnimationFrame((()=>{for(const r of[t,e])r.addEventListener("transitionend",st),r.style.transition=`transform ${s}ms ${i}`,r.style.transform=""}))}function st(t){null!=t.target&&Boolean("style"in t.target)&&(t.target.style.transition="",t.target.style.pointerEvents="",t.target.removeEventListener("transitionend",st))}_=class extends e{constructor(t){Z(super(t)),this.options={...tt,...this.getOptions()},this.lastAnimationFrame=null}attach(){this.draggable.on("sortable:sorted",this.onSortableSorted)}detach(){this.draggable.off("sortable:sorted",this.onSortableSorted)}getOptions(){return this.draggable.options.swapAnimation||{}}onSortableSorted({oldIndex:t,newIndex:e,dragEvent:s}){const{source:i,over:r}=s;this.lastAnimationFrame&&cancelAnimationFrame(this.lastAnimationFrame),this.lastAnimationFrame=requestAnimationFrame((()=>{t>=e?et(i,r,this.options):et(r,i,this.options)}))}},[Z]=z(_,[[N,2,"onSortableSorted"]],[],0,void 0,e).e;const it=Symbol("onInitialize"),rt=Symbol("onDestroy"),nt=Symbol("announceEvent"),ot=Symbol("announceMessage"),ht={expire:7e3},at=function(){const t=document.createElement("div");return t.setAttribute("id","draggable-live-region"),t.setAttribute("aria-relevant","additions"),t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","assertive"),t.setAttribute("role","log"),t.style.position="fixed",t.style.width="1px",t.style.height="1px",t.style.top="-1px",t.style.overflow="hidden",t}();document.addEventListener("DOMContentLoaded",(()=>{document.body.appendChild(at)}));const ct=Symbol("onInitialize"),ut=Symbol("onDestroy"),lt={},dt=[];class gt extends t{constructor(t){super(t),this.data=t}get source(){return this.data.source}get originalSource(){return this.data.originalSource}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get dragEvent(){return this.data.dragEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}class mt extends gt{}mt.type="mirror:create";class ft extends gt{get mirror(){return this.data.mirror}}ft.type="mirror:created";class vt extends gt{get mirror(){return this.data.mirror}}vt.type="mirror:attached";class pt extends gt{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}pt.type="mirror:move",pt.cancelable=!0;class bt extends gt{get mirror(){return this.data.mirror}get passedThreshX(){return this.data.passedThreshX}get passedThreshY(){return this.data.passedThreshY}}bt.type="mirror:moved";class wt extends gt{get mirror(){return this.data.mirror}}wt.type="mirror:destroy",wt.cancelable=!0;const yt=Symbol("onDragStart"),xt=Symbol("onDragMove"),St=Symbol("onDragStop"),Ct=Symbol("onMirrorCreated"),Et=Symbol("onMirrorMove"),Mt=Symbol("onScroll"),Dt=Symbol("getAppendableContainer"),Tt={constrainDimensions:!1,xAxis:!0,yAxis:!0,cursorOffsetX:null,cursorOffsetY:null,thresholdX:null,thresholdY:null};function Ot({source:t,...e}){return $t((s=>{const i=t.getBoundingClientRect();s({source:t,sourceRect:i,...e})}))}function Xt({sensorEvent:t,sourceRect:e,options:s,...i}){return $t((r=>{r({sensorEvent:t,sourceRect:e,mirrorOffset:{top:null===s.cursorOffsetY?t.clientY-e.top:s.cursorOffsetY,left:null===s.cursorOffsetX?t.clientX-e.left:s.cursorOffsetX},options:s,...i})}))}function Yt({mirror:t,source:e,options:s,...i}){return $t((r=>{let n,o;if(s.constrainDimensions){const t=getComputedStyle(e);n=t.getPropertyValue("height"),o=t.getPropertyValue("width")}t.style.display=null,t.style.position="fixed",t.style.pointerEvents="none",t.style.top=0,t.style.left=0,t.style.margin=0,s.constrainDimensions&&(t.style.height=n,t.style.width=o),r({mirror:t,source:e,options:s,...i})}))}function At({mirror:t,mirrorClasses:e,...s}){return $t((i=>{t.classList.add(...e),i({mirror:t,mirrorClasses:e,...s})}))}function Ft({mirror:t,...e}){return $t((s=>{t.removeAttribute("id"),delete t.id,s({mirror:t,...e})}))}function It({withFrame:t=!1,initial:e=!1}={}){return({mirror:s,sensorEvent:i,mirrorOffset:r,initialY:n,initialX:o,scrollOffset:h,options:a,passedThreshX:c,passedThreshY:u,lastMovedX:l,lastMovedY:d,...g})=>$t((t=>{const m={mirror:s,sensorEvent:i,mirrorOffset:r,options:a,...g};if(r){const t=c?Math.round((i.clientX-r.left-h.x)/(a.thresholdX||1))*(a.thresholdX||1):Math.round(l),g=u?Math.round((i.clientY-r.top-h.y)/(a.thresholdY||1))*(a.thresholdY||1):Math.round(d);a.xAxis&&a.yAxis||e?s.style.transform=`translate3d(${t}px, ${g}px, 0)`:a.xAxis&&!a.yAxis?s.style.transform=`translate3d(${t}px, ${n}px, 0)`:a.yAxis&&!a.xAxis&&(s.style.transform=`translate3d(${o}px, ${g}px, 0)`),e&&(m.initialX=t,m.initialY=g),m.lastMovedX=t,m.lastMovedY=g}t(m)}),{frame:t})}function $t(t,{raf:e=!1}={}){return new Promise(((s,i)=>{e?requestAnimationFrame((()=>{t(s,i)})):t(s,i)}))}const jt=Symbol("onDragStart"),qt=Symbol("onDragMove"),zt=Symbol("onDragStop"),Pt=Symbol("scroll"),Nt={speed:6,sensitivity:50,scrollableElements:[]};function Bt(){return document.scrollingElement||document.documentElement}class Lt{constructor(){this.callbacks={}}on(t,...e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(...e),this}off(t,e){if(!this.callbacks[t])return null;const s=this.callbacks[t].slice(0);for(let i=0;i<s.length;i++)e===s[i]&&this.callbacks[t].splice(i,1);return this}trigger(t){if(!this.callbacks[t.type])return null;const e=[...this.callbacks[t.type]],s=[];for(let i=e.length-1;i>=0;i--){const r=e[i];try{r(t)}catch(t){s.push(t)}}return s.length&&console.error(`Draggable caught errors while triggering '${t.type}'`,s),this}}class kt extends t{get draggable(){return this.data.draggable}}kt.type="draggable";class Ht extends kt{}Ht.type="draggable:initialize";class Rt extends kt{}Rt.type="draggable:destroy";const Wt=Symbol("onDragStart"),Ut=Symbol("onDragMove"),Gt=Symbol("onDragStop"),Jt=Symbol("onDragPressure"),Kt=Symbol("dragStop"),Qt={"drag:start":t=>`Picked up ${t.source.textContent.trim()||t.source.id||"draggable element"}`,"drag:stop":t=>`Released ${t.source.textContent.trim()||t.source.id||"draggable element"}`},Vt={"container:dragging":"draggable-container--is-dragging","source:dragging":"draggable-source--is-dragging","source:placed":"draggable-source--placed","container:placed":"draggable-container--placed","body:dragging":"draggable--is-dragging","draggable:over":"draggable--over","container:over":"draggable-container--over","source:original":"draggable--original",mirror:"draggable-mirror"},Zt={draggable:".draggable-source",handle:null,delay:{},distance:0,placedTimeout:800,plugins:[],sensors:[],exclude:{plugins:[],sensors:[]}};class _t{constructor(t=[document.body],e={}){if(t instanceof NodeList||t instanceof Array)this.containers=[...t];else{if(!(t instanceof HTMLElement))throw new Error("Draggable containers are expected to be of type `NodeList`, `HTMLElement[]` or `HTMLElement`");this.containers=[t]}this.options={...Zt,...e,classes:{...Vt,...e.classes||{}},announcements:{...Qt,...e.announcements||{}},exclude:{plugins:e.exclude&&e.exclude.plugins||[],sensors:e.exclude&&e.exclude.sensors||[]}},this.emitter=new Lt,this.dragging=!1,this.plugins=[],this.sensors=[],this[Wt]=this[Wt].bind(this),this[Ut]=this[Ut].bind(this),this[Gt]=this[Gt].bind(this),this[Jt]=this[Jt].bind(this),this[Kt]=this[Kt].bind(this),document.addEventListener("drag:start",this[Wt],!0),document.addEventListener("drag:move",this[Ut],!0),document.addEventListener("drag:stop",this[Gt],!0),document.addEventListener("drag:pressure",this[Jt],!0);const s=Object.values(_t.Plugins).filter((t=>!this.options.exclude.plugins.includes(t))),i=Object.values(_t.Sensors).filter((t=>!this.options.exclude.sensors.includes(t)));this.addPlugin(...s,...this.options.plugins),this.addSensor(...i,...this.options.sensors);const r=new Ht({draggable:this});this.on("mirror:created",(({mirror:t})=>this.mirror=t)),this.on("mirror:destroy",(()=>this.mirror=null)),this.trigger(r)}destroy(){document.removeEventListener("drag:start",this[Wt],!0),document.removeEventListener("drag:move",this[Ut],!0),document.removeEventListener("drag:stop",this[Gt],!0),document.removeEventListener("drag:pressure",this[Jt],!0);const t=new Rt({draggable:this});this.trigger(t),this.removePlugin(...this.plugins.map((t=>t.constructor))),this.removeSensor(...this.sensors.map((t=>t.constructor)))}addPlugin(...t){const e=t.map((t=>new t(this)));return e.forEach((t=>t.attach())),this.plugins=[...this.plugins,...e],this}removePlugin(...t){return this.plugins.filter((e=>t.includes(e.constructor))).forEach((t=>t.detach())),this.plugins=this.plugins.filter((e=>!t.includes(e.constructor))),this}addSensor(...t){const e=t.map((t=>new t(this.containers,this.options)));return e.forEach((t=>t.attach())),this.sensors=[...this.sensors,...e],this}removeSensor(...t){return this.sensors.filter((e=>t.includes(e.constructor))).forEach((t=>t.detach())),this.sensors=this.sensors.filter((e=>!t.includes(e.constructor))),this}addContainer(...t){return this.containers=[...this.containers,...t],this.sensors.forEach((e=>e.addContainer(...t))),this}removeContainer(...t){return this.containers=this.containers.filter((e=>!t.includes(e))),this.sensors.forEach((e=>e.removeContainer(...t))),this}on(t,...e){return this.emitter.on(t,...e),this}off(t,e){return this.emitter.off(t,e),this}trigger(t){return this.emitter.trigger(t),this}getClassNameFor(t){return this.getClassNamesFor(t)[0]}getClassNamesFor(t){const e=this.options.classes[t];return e instanceof Array?e:"string"==typeof e||e instanceof String?[e]:[]}isDragging(){return Boolean(this.dragging)}getDraggableElements(){return this.containers.reduce(((t,e)=>[...t,...this.getDraggableElementsForContainer(e)]),[])}getDraggableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter((t=>t!==this.originalSource&&t!==this.mirror))}cancel(){this[Kt]()}[Wt](t){const e=te(t),{target:s,container:i,originalSource:n}=e;if(!this.containers.includes(i))return;if(this.options.handle&&s&&!r(s,this.options.handle))return void e.cancel();this.originalSource=n,this.sourceContainer=i,this.lastPlacedSource&&this.lastPlacedContainer&&(clearTimeout(this.placedTimeoutID),this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed"))),this.source=this.originalSource.cloneNode(!0),this.originalSource.parentNode.insertBefore(this.source,this.originalSource),this.originalSource.style.display="none";const o=new L({source:this.source,originalSource:this.originalSource,sourceContainer:i,sensorEvent:e});if(this.trigger(o),this.dragging=!o.canceled(),o.canceled())return this.source.remove(),void(this.originalSource.style.display=null);this.originalSource.classList.add(...this.getClassNamesFor("source:original")),this.source.classList.add(...this.getClassNamesFor("source:dragging")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:dragging")),document.body.classList.add(...this.getClassNamesFor("body:dragging")),ee(document.body,"none"),requestAnimationFrame((()=>{const e=te(t).clone({target:this.source});this[Ut]({...t,detail:e})}))}[Ut](t){if(!this.dragging)return;const e=te(t),{container:s}=e;let i=e.target;const n=new k({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e});this.trigger(n),n.canceled()&&e.cancel(),i=r(i,this.options.draggable);const o=r(e.target,this.containers),h=e.overContainer||o,a=this.currentOverContainer&&h!==this.currentOverContainer,c=h&&this.currentOverContainer!==h,u=o&&i&&this.currentOver!==i;if(this.currentOver&&i!==this.currentOver){const t=new R({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,over:this.currentOver,overContainer:this.currentOverContainer});this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOver=null,this.trigger(t)}if(a){const t=new U({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,overContainer:this.currentOverContainer});this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.currentOverContainer=null,this.trigger(t)}if(c){h.classList.add(...this.getClassNamesFor("container:over"));const t=new W({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,overContainer:h});this.currentOverContainer=h,this.trigger(t)}if(u){i.classList.add(...this.getClassNamesFor("draggable:over"));const t=new H({source:this.source,originalSource:this.originalSource,sourceContainer:s,sensorEvent:e,overContainer:h,over:i});this.currentOver=i,this.trigger(t)}}[Kt](t){if(!this.dragging)return;this.dragging=!1;const e=new J({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(e),e.canceled()||this.source.parentNode.insertBefore(this.originalSource,this.source),this.source.remove(),this.originalSource.style.display="",this.source.classList.remove(...this.getClassNamesFor("source:dragging")),this.originalSource.classList.remove(...this.getClassNamesFor("source:original")),this.originalSource.classList.add(...this.getClassNamesFor("source:placed")),this.sourceContainer.classList.add(...this.getClassNamesFor("container:placed")),this.sourceContainer.classList.remove(...this.getClassNamesFor("container:dragging")),document.body.classList.remove(...this.getClassNamesFor("body:dragging")),ee(document.body,""),this.currentOver&&this.currentOver.classList.remove(...this.getClassNamesFor("draggable:over")),this.currentOverContainer&&this.currentOverContainer.classList.remove(...this.getClassNamesFor("container:over")),this.lastPlacedSource=this.originalSource,this.lastPlacedContainer=this.sourceContainer,this.placedTimeoutID=setTimeout((()=>{this.lastPlacedSource&&this.lastPlacedSource.classList.remove(...this.getClassNamesFor("source:placed")),this.lastPlacedContainer&&this.lastPlacedContainer.classList.remove(...this.getClassNamesFor("container:placed")),this.lastPlacedSource=null,this.lastPlacedContainer=null}),this.options.placedTimeout);const s=new K({source:this.source,originalSource:this.originalSource,sensorEvent:t?t.sensorEvent:null,sourceContainer:this.sourceContainer});this.trigger(s),this.source=null,this.originalSource=null,this.currentOverContainer=null,this.currentOver=null,this.sourceContainer=null}[Gt](t){this[Kt](t)}[Jt](t){if(!this.dragging)return;const e=te(t),s=this.source||r(e.originalEvent.target,this.options.draggable),i=new G({sensorEvent:e,source:s,pressure:e.pressure});this.trigger(i)}}function te(t){return t.detail}function ee(t,e){t.style.webkitUserSelect=e,t.style.mozUserSelect=e,t.style.msUserSelect=e,t.style.oUserSelect=e,t.style.userSelect=e}_t.Plugins={Announcement:class extends e{constructor(t){super(t),this.options={...ht,...this.getOptions()},this.originalTriggerMethod=this.draggable.trigger,this[it]=this[it].bind(this),this[rt]=this[rt].bind(this)}attach(){this.draggable.on("draggable:initialize",this[it])}detach(){this.draggable.off("draggable:destroy",this[rt])}getOptions(){return this.draggable.options.announcements||{}}[nt](t){const e=this.options[t.type];e&&"string"==typeof e&&this[ot](e),e&&"function"==typeof e&&this[ot](e(t))}[ot](t){!function(t,{expire:e}){const s=document.createElement("div");s.textContent=t,at.appendChild(s),setTimeout((()=>{at.removeChild(s)}),e)}(t,{expire:this.options.expire})}[it](){this.draggable.trigger=t=>{try{this[nt](t)}finally{this.originalTriggerMethod.call(this.draggable,t)}}}[rt](){this.draggable.trigger=this.originalTriggerMethod}},Focusable:class extends e{constructor(t){super(t),this.options={...lt,...this.getOptions()},this[ct]=this[ct].bind(this),this[ut]=this[ut].bind(this)}attach(){this.draggable.on("draggable:initialize",this[ct]).on("draggable:destroy",this[ut])}detach(){this.draggable.off("draggable:initialize",this[ct]).off("draggable:destroy",this[ut]),this[ut]()}getOptions(){return this.draggable.options.focusable||{}}getElements(){return[...this.draggable.containers,...this.draggable.getDraggableElements()]}[ct](){requestAnimationFrame((()=>{this.getElements().forEach((t=>function(t){Boolean(!t.getAttribute("tabindex")&&-1===t.tabIndex)&&(dt.push(t),t.tabIndex=0)}(t)))}))}[ut](){requestAnimationFrame((()=>{this.getElements().forEach((t=>function(t){const e=dt.indexOf(t);-1!==e&&(t.tabIndex=-1,dt.splice(e,1))}(t)))}))}},Mirror:class extends e{constructor(t){super(t),this.options={...Tt,...this.getOptions()},this.scrollOffset={x:0,y:0},this.initialScrollOffset={x:window.scrollX,y:window.scrollY},this[yt]=this[yt].bind(this),this[xt]=this[xt].bind(this),this[St]=this[St].bind(this),this[Ct]=this[Ct].bind(this),this[Et]=this[Et].bind(this),this[Mt]=this[Mt].bind(this)}attach(){this.draggable.on("drag:start",this[yt]).on("drag:move",this[xt]).on("drag:stop",this[St]).on("mirror:created",this[Ct]).on("mirror:move",this[Et])}detach(){this.draggable.off("drag:start",this[yt]).off("drag:move",this[xt]).off("drag:stop",this[St]).off("mirror:created",this[Ct]).off("mirror:move",this[Et])}getOptions(){return this.draggable.options.mirror||{}}[yt](t){if(t.canceled())return;"ontouchstart"in window&&document.addEventListener("scroll",this[Mt],!0),this.initialScrollOffset={x:window.scrollX,y:window.scrollY};const{source:e,originalSource:s,sourceContainer:i,sensorEvent:r}=t;this.lastMirrorMovedClient={x:r.clientX,y:r.clientY};const n=new mt({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t});if(this.draggable.trigger(n),function(t){return/^drag/.test(t.originalEvent.type)}(r)||n.canceled())return;const o=this[Dt](e)||i;this.mirror=e.cloneNode(!0);const h=new ft({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t,mirror:this.mirror}),a=new vt({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t,mirror:this.mirror});this.draggable.trigger(h),o.appendChild(this.mirror),this.draggable.trigger(a)}[xt](t){if(!this.mirror||t.canceled())return;const{source:e,originalSource:s,sourceContainer:i,sensorEvent:r}=t;let n=!0,o=!0;if(this.options.thresholdX||this.options.thresholdY){const{x:t,y:e}=this.lastMirrorMovedClient;if(Math.abs(t-r.clientX)<this.options.thresholdX?n=!1:this.lastMirrorMovedClient.x=r.clientX,Math.abs(e-r.clientY)<this.options.thresholdY?o=!1:this.lastMirrorMovedClient.y=r.clientY,!n&&!o)return}const h=new pt({source:e,originalSource:s,sourceContainer:i,sensorEvent:r,dragEvent:t,mirror:this.mirror,passedThreshX:n,passedThreshY:o});this.draggable.trigger(h)}[St](t){if("ontouchstart"in window&&document.removeEventListener("scroll",this[Mt],!0),this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},!this.mirror)return;const{source:e,sourceContainer:s,sensorEvent:i}=t,r=new wt({source:e,mirror:this.mirror,sourceContainer:s,sensorEvent:i,dragEvent:t});this.draggable.trigger(r),r.canceled()||this.mirror.remove()}[Mt](){this.scrollOffset={x:window.scrollX-this.initialScrollOffset.x,y:window.scrollY-this.initialScrollOffset.y}}[Ct]({mirror:t,source:e,sensorEvent:s}){const i=this.draggable.getClassNamesFor("mirror");return t.style.display="none",Promise.resolve({mirror:t,source:e,sensorEvent:s,mirrorClasses:i,scrollOffset:this.scrollOffset,options:this.options,passedThreshX:!0,passedThreshY:!0}).then(Ot).then(Xt).then(Yt).then(At).then(It({initial:!0})).then(Ft).then((({mirrorOffset:t,initialX:e,initialY:s,...i})=>(this.mirrorOffset=t,this.initialX=e,this.initialY=s,this.lastMovedX=e,this.lastMovedY=s,{mirrorOffset:t,initialX:e,initialY:s,...i})))}[Et](t){return t.canceled()?null:Promise.resolve({mirror:t.mirror,sensorEvent:t.sensorEvent,mirrorOffset:this.mirrorOffset,options:this.options,initialX:this.initialX,initialY:this.initialY,scrollOffset:this.scrollOffset,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY,lastMovedX:this.lastMovedX,lastMovedY:this.lastMovedY}).then(It({raf:!0})).then((({lastMovedX:t,lastMovedY:e,...s})=>(this.lastMovedX=t,this.lastMovedY=e,{lastMovedX:t,lastMovedY:e,...s}))).then((e=>{const s=new bt({source:t.source,originalSource:t.originalSource,sourceContainer:t.sourceContainer,sensorEvent:t.sensorEvent,dragEvent:t.dragEvent,mirror:this.mirror,passedThreshX:t.passedThreshX,passedThreshY:t.passedThreshY});return this.draggable.trigger(s),e}))}[Dt](t){const e=this.options.appendTo;return"string"==typeof e?document.querySelector(e):e instanceof HTMLElement?e:"function"==typeof e?e(t):t.parentNode}},Scrollable:class extends e{constructor(t){super(t),this.options={...Nt,...this.getOptions()},this.currentMousePosition=null,this.scrollAnimationFrame=null,this.scrollableElement=null,this.findScrollableElementFrame=null,this[jt]=this[jt].bind(this),this[qt]=this[qt].bind(this),this[zt]=this[zt].bind(this),this[Pt]=this[Pt].bind(this)}attach(){this.draggable.on("drag:start",this[jt]).on("drag:move",this[qt]).on("drag:stop",this[zt])}detach(){this.draggable.off("drag:start",this[jt]).off("drag:move",this[qt]).off("drag:stop",this[zt])}getOptions(){return this.draggable.options.scrollable||{}}getScrollableElement(t){return this.hasDefinedScrollableElements()?r(t,this.options.scrollableElements)||document.documentElement:function(t){if(!t)return Bt();const e=getComputedStyle(t).getPropertyValue("position"),s="absolute"===e,i=r(t,(t=>(!s||!function(t){return"static"===getComputedStyle(t).getPropertyValue("position")}(t))&&function(t){const e=getComputedStyle(t,null),s=e.getPropertyValue("overflow")+e.getPropertyValue("overflow-y")+e.getPropertyValue("overflow-x");return/(auto|scroll)/.test(s)}(t)));return"fixed"!==e&&i?i:Bt()}(t)}hasDefinedScrollableElements(){return Boolean(0!==this.options.scrollableElements.length)}[jt](t){this.findScrollableElementFrame=requestAnimationFrame((()=>{this.scrollableElement=this.getScrollableElement(t.source)}))}[qt](t){if(this.findScrollableElementFrame=requestAnimationFrame((()=>{this.scrollableElement=this.getScrollableElement(t.sensorEvent.target)})),!this.scrollableElement)return;const e=t.sensorEvent,s={x:0,y:0};"ontouchstart"in window&&(s.y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,s.x=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),this.currentMousePosition={clientX:e.clientX-s.x,clientY:e.clientY-s.y},this.scrollAnimationFrame=requestAnimationFrame(this[Pt])}[zt](){cancelAnimationFrame(this.scrollAnimationFrame),cancelAnimationFrame(this.findScrollableElementFrame),this.scrollableElement=null,this.scrollAnimationFrame=null,this.findScrollableElementFrame=null,this.currentMousePosition=null}[Pt](){if(!this.scrollableElement||!this.currentMousePosition)return;cancelAnimationFrame(this.scrollAnimationFrame);const{speed:t,sensitivity:e}=this.options,s=this.scrollableElement.getBoundingClientRect(),i=s.bottom>window.innerHeight,r=s.top<0||i,n=Bt(),o=this.scrollableElement,h=this.currentMousePosition.clientX,a=this.currentMousePosition.clientY;if(o===document.body||o===document.documentElement||r){const{innerHeight:s,innerWidth:i}=window;a<e?n.scrollTop-=t:s-a<e&&(n.scrollTop+=t),h<e?n.scrollLeft-=t:i-h<e&&(n.scrollLeft+=t)}else{const{offsetHeight:i,offsetWidth:r}=o;s.top+i-a<e?o.scrollTop+=t:a-s.top<e&&(o.scrollTop-=t),s.left+r-h<e?o.scrollLeft+=t:h-s.left<e&&(o.scrollLeft-=t)}this.scrollAnimationFrame=requestAnimationFrame(this[Pt])}}},_t.Sensors={MouseSensor:class extends i{constructor(t=[],e={}){super(t,e),this.mouseDownTimeout=null,this.pageX=null,this.pageY=null,this[u]=this[u].bind(this),this[l]=this[l].bind(this),this[d]=this[d].bind(this),this[g]=this[g].bind(this),this[m]=this[m].bind(this),this[f]=this[f].bind(this)}attach(){document.addEventListener("mousedown",this[l],!0)}detach(){document.removeEventListener("mousedown",this[l],!0)}[l](t){if(0!==t.button||t.ctrlKey||t.metaKey)return;const e=r(t.target,this.containers);if(!e)return;if(this.options.handle&&t.target&&!r(t.target,this.options.handle))return;const s=r(t.target,this.options.draggable);if(!s)return;const{delay:i}=this,{pageX:n,pageY:o}=t;Object.assign(this,{pageX:n,pageY:o}),this.onMouseDownAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=s,document.addEventListener("mouseup",this[g]),document.addEventListener("dragstart",v),document.addEventListener("mousemove",this[f]),this.mouseDownTimeout=window.setTimeout((()=>{this[f]({pageX:this.pageX,pageY:this.pageY})}),i.mouse)}[m](){const t=this.startEvent,e=new h({clientX:t.clientX,clientY:t.clientY,target:t.target,container:this.currentContainer,originalSource:this.originalSource,originalEvent:t});this.trigger(this.currentContainer,e),this.dragging=!e.canceled(),this.dragging&&(document.addEventListener("contextmenu",this[u],!0),document.addEventListener("mousemove",this[d]))}[f](t){const{pageX:e,pageY:s}=t,{distance:i}=this.options,{startEvent:r,delay:o}=this;if(Object.assign(this,{pageX:e,pageY:s}),!this.currentContainer)return;const h=Date.now()-this.onMouseDownAt,a=n(r.pageX,r.pageY,e,s)||0;clearTimeout(this.mouseDownTimeout),h<o.mouse?document.removeEventListener("mousemove",this[f]):a>=i&&(document.removeEventListener("mousemove",this[f]),this[m]())}[d](t){if(!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),s=new a({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s)}[g](t){if(clearTimeout(this.mouseDownTimeout),0!==t.button)return;if(document.removeEventListener("mouseup",this[g]),document.removeEventListener("dragstart",v),document.removeEventListener("mousemove",this[f]),!this.dragging)return;const e=document.elementFromPoint(t.clientX,t.clientY),s=new c({clientX:t.clientX,clientY:t.clientY,target:e,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,s),document.removeEventListener("contextmenu",this[u],!0),document.removeEventListener("mousemove",this[d]),this.currentContainer=null,this.dragging=!1,this.startEvent=null}[u](t){t.preventDefault()}},TouchSensor:class extends i{constructor(t=[],e={}){super(t,e),this.currentScrollableParent=null,this.tapTimeout=null,this.touchMoved=!1,this.pageX=null,this.pageY=null,this[b]=this[b].bind(this),this[w]=this[w].bind(this),this[y]=this[y].bind(this),this[x]=this[x].bind(this),this[S]=this[S].bind(this)}attach(){document.addEventListener("touchstart",this[b])}detach(){document.removeEventListener("touchstart",this[b])}[b](t){const e=r(t.target,this.containers);if(!e)return;if(this.options.handle&&t.target&&!r(t.target,this.options.handle))return;const s=r(t.target,this.options.draggable);if(!s)return;const{distance:i=0}=this.options,{delay:n}=this,{pageX:o,pageY:h}=p(t);Object.assign(this,{pageX:o,pageY:h}),this.onTouchStartAt=Date.now(),this.startEvent=t,this.currentContainer=e,this.originalSource=s,document.addEventListener("touchend",this[w]),document.addEventListener("touchcancel",this[w]),document.addEventListener("touchmove",this[S]),e.addEventListener("contextmenu",E),i&&(C=!0),this.tapTimeout=window.setTimeout((()=>{this[S]({touches:[{pageX:this.pageX,pageY:this.pageY}]})}),n.touch)}[x](){const t=this.startEvent,e=this.currentContainer,s=p(t),i=new h({clientX:s.pageX,clientY:s.pageY,target:t.target,container:e,originalSource:this.originalSource,originalEvent:t});this.trigger(this.currentContainer,i),this.dragging=!i.canceled(),this.dragging&&document.addEventListener("touchmove",this[y]),C=this.dragging}[S](t){const{distance:e}=this.options,{startEvent:s,delay:i}=this,r=p(s),o=p(t),h=Date.now()-this.onTouchStartAt,a=n(r.pageX,r.pageY,o.pageX,o.pageY);Object.assign(this,o),clearTimeout(this.tapTimeout),h<i.touch?document.removeEventListener("touchmove",this[S]):a>=e&&(document.removeEventListener("touchmove",this[S]),this[x]())}[y](t){if(!this.dragging)return;const{pageX:e,pageY:s}=p(t),i=document.elementFromPoint(e-window.scrollX,s-window.scrollY),r=new a({clientX:e,clientY:s,target:i,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r)}[w](t){if(clearTimeout(this.tapTimeout),C=!1,document.removeEventListener("touchend",this[w]),document.removeEventListener("touchcancel",this[w]),document.removeEventListener("touchmove",this[S]),this.currentContainer&&this.currentContainer.removeEventListener("contextmenu",E),!this.dragging)return;document.removeEventListener("touchmove",this[y]);const{pageX:e,pageY:s}=p(t),i=document.elementFromPoint(e-window.scrollX,s-window.scrollY);t.preventDefault();const r=new c({clientX:e,clientY:s,target:i,container:this.currentContainer,originalEvent:t});this.trigger(this.currentContainer,r),this.currentContainer=null,this.dragging=!1,this.startEvent=null}}};class se extends t{constructor(t){super(t),this.data=t}get dragEvent(){return this.data.dragEvent}}se.type="sortable";class ie extends se{get startIndex(){return this.data.startIndex}get startContainer(){return this.data.startContainer}}ie.type="sortable:start",ie.cancelable=!0;class re extends se{get currentIndex(){return this.data.currentIndex}get over(){return this.data.over}get overContainer(){return this.data.dragEvent.overContainer}}re.type="sortable:sort",re.cancelable=!0;class ne extends se{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}ne.type="sortable:sorted";class oe extends se{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}oe.type="sortable:stop";const he=Symbol("onDragStart"),ae=Symbol("onDragOverContainer"),ce=Symbol("onDragOver"),ue=Symbol("onDragStop"),le={"sortable:sorted":function({dragEvent:t}){const e=t.source.textContent.trim()||t.source.id||"sortable element";if(t.over){const s=t.over.textContent.trim()||t.over.id||"sortable element";return t.source.compareDocumentPosition(t.over)&Node.DOCUMENT_POSITION_FOLLOWING?`Placed ${e} after ${s}`:`Placed ${e} before ${s}`}return`Placed ${e} into a different container`}};class de extends _t{constructor(t=[],e={}){super(t,{...e,announcements:{...le,...e.announcements||{}}}),this.startIndex=null,this.startContainer=null,this[he]=this[he].bind(this),this[ae]=this[ae].bind(this),this[ce]=this[ce].bind(this),this[ue]=this[ue].bind(this),this.on("drag:start",this[he]).on("drag:over:container",this[ae]).on("drag:over",this[ce]).on("drag:stop",this[ue])}destroy(){super.destroy(),this.off("drag:start",this[he]).off("drag:over:container",this[ae]).off("drag:over",this[ce]).off("drag:stop",this[ue])}index(t){return this.getSortableElementsForContainer(t.parentNode).indexOf(t)}getSortableElementsForContainer(t){return[...t.querySelectorAll(this.options.draggable)].filter((e=>e!==this.originalSource&&e!==this.mirror&&e.parentNode===t))}[he](t){this.startContainer=t.source.parentNode,this.startIndex=this.index(t.source);const e=new ie({dragEvent:t,startIndex:this.startIndex,startContainer:this.startContainer});this.trigger(e),e.canceled()&&t.cancel()}[ae](t){if(t.canceled())return;const{source:e,over:s,overContainer:i}=t,r=this.index(e),n=new re({dragEvent:t,currentIndex:r,source:e,over:s});if(this.trigger(n),n.canceled())return;const o=me({source:e,over:s,overContainer:i,children:this.getSortableElementsForContainer(i)});if(!o)return;const{oldContainer:h,newContainer:a}=o,c=this.index(t.source),u=new ne({dragEvent:t,oldIndex:r,newIndex:c,oldContainer:h,newContainer:a});this.trigger(u)}[ce](t){if(t.over===t.originalSource||t.over===t.source)return;const{source:e,over:s,overContainer:i}=t,r=this.index(e),n=new re({dragEvent:t,currentIndex:r,source:e,over:s});if(this.trigger(n),n.canceled())return;const o=me({source:e,over:s,overContainer:i,children:this.getDraggableElementsForContainer(i)});if(!o)return;const{oldContainer:h,newContainer:a}=o,c=this.index(e),u=new ne({dragEvent:t,oldIndex:r,newIndex:c,oldContainer:h,newContainer:a});this.trigger(u)}[ue](t){const e=new oe({dragEvent:t,oldIndex:this.startIndex,newIndex:this.index(t.source),oldContainer:this.startContainer,newContainer:t.source.parentNode});this.trigger(e),this.startIndex=null,this.startContainer=null}}function ge(t){return Array.prototype.indexOf.call(t.parentNode.children,t)}function me({source:t,over:e,overContainer:s,children:i}){const r=t.parentNode!==s;return i.length?e&&t.parentNode===e.parentNode?function(t,e){const s=ge(t),i=ge(e);return t.parentNode.insertBefore(t,s<i?e.nextElementSibling:e),{oldContainer:t.parentNode,newContainer:t.parentNode}}(t,e):r?function(t,e,s){const i=t.parentNode;return e?e.parentNode.insertBefore(t,e):s.appendChild(t),{oldContainer:i,newContainer:t.parentNode}}(t,e,s):null:function(t,e){const s=t.parentNode;return e.appendChild(t),{oldContainer:s,newContainer:e}}(t,s)}export{de as S}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-2640ba03",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16]}]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-69754d94",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-d4f9ee17",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-eb636e15",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d3f53df2",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["p-cb37982f",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-29529c8f",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fc257290",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fe49067d",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-26ad62b9",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-72fc257b",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-fda8c84c",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-c606c748",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["p-88aa931b",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-bbcd3b4d",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-73d3daa8",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-247a8b36",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-c0931902",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-c78a80ae",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-e60325bc",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-94c532bb",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-bd628455",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-f30526a7",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-d3ec3586",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-80692cbd",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-838f8234",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["p-47e4b6c9",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d4c72815",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-cd024328",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["p-219f888d",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-b2ce189a",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["p-d4fb9642",[[6,"snk-taskbar",{"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32]}]]],["p-eac8b93f",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64]}]]],["p-cab6a969",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-7749c662",[[6,"snk-crud",{"configName":[1025,"config-name"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64]}]]],["p-06e76ed2",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["p-de84a3d5",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"loadByPK":[16],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64]}]]],["p-651b4f89",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-44865ff1",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-c555075c",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["p-47d20cb0",[[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}]]]]'),e)));
1
+ import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-2640ba03",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16]}]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-69754d94",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-d4f9ee17",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-eb636e15",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d3f53df2",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["p-cb37982f",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-29529c8f",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fc257290",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fe49067d",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-26ad62b9",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-72fc257b",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-25df73bf",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-c606c748",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["p-88aa931b",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-718ecd01",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-5f74c859",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-247a8b36",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-c0931902",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-c78a80ae",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-a3fbded7",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-993e27ad",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-3b60db06",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-95df461f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-8eb67fa4",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-a3868fbc",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-98674137",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["p-8f307ef2",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d4c72815",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-cd024328",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["p-219f888d",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-1a991d41",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["p-d4fb9642",[[6,"snk-taskbar",{"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32]}]]],["p-c6800fd4",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64]}]]],["p-a4401f5f",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-1ae31937",[[6,"snk-crud",{"configName":[1025,"config-name"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64]}]]],["p-d7665a57",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["p-f3479d53",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"loadByPK":[16],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64]}]]],["p-0d5e8a37",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-809a09ac",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-c555075c",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["p-6e32de4b",[[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}]]]]'),e)));
@@ -103,6 +103,10 @@ export declare class SnkCrud {
103
103
  * Faz o recarregamento da filter-bar do crud, buscando o state no servidor.
104
104
  */
105
105
  reloadFilterBar(): Promise<void>;
106
+ /**
107
+ * Retorna o elemento da filter-bar da grade.
108
+ */
109
+ getFilterBar(): Promise<HTMLSnkFilterBarElement>;
106
110
  currentViewModeWatcher(currentView: VIEW_MODE): void;
107
111
  gridToForm(keepFormMode?: boolean): Promise<void>;
108
112
  executeAction(act: string): Promise<void>;
@@ -116,6 +116,10 @@ export declare class SnkGrid {
116
116
  * Faz o recarregamento da filter-bar da grade buscando o state no servidor.
117
117
  */
118
118
  reloadFilterBar(): Promise<void>;
119
+ /**
120
+ * Retorna o elemento da filter-bar da grade.
121
+ */
122
+ getFilterBar(): Promise<HTMLSnkFilterBarElement>;
119
123
  private openGridConfig;
120
124
  private closeGridConfig;
121
125
  private setGridConfig;
@@ -384,6 +384,10 @@ export namespace Components {
384
384
  * Usado para salvar as configurações dos blocos de construção.
385
385
  */
386
386
  "configName": string;
387
+ /**
388
+ * Retorna o elemento da filter-bar da grade.
389
+ */
390
+ "getFilterBar": () => Promise<HTMLSnkFilterBarElement>;
387
391
  /**
388
392
  * Usado para alternar a visão entre GRID e FORM externamente.
389
393
  */
@@ -1080,6 +1084,10 @@ export namespace Components {
1080
1084
  * Nome usado para salvar/recuperar a configuração.
1081
1085
  */
1082
1086
  "configName": string;
1087
+ /**
1088
+ * Retorna o elemento da filter-bar da grade.
1089
+ */
1090
+ "getFilterBar": () => Promise<HTMLSnkFilterBarElement>;
1083
1091
  /**
1084
1092
  * Nome do slot de elementos customizados da Taskbar do cabeçalho da grade.
1085
1093
  */
@@ -1,3 +1,4 @@
1
+ import { SortableEventNames } from '@shopify/draggable';
1
2
  export declare const REPORT_LAUNCHER_RESOURCE_ID = "br.com.sankhya.controls.ReportLauncher";
2
3
  export declare const KEY_PORT_EXPORT = "global.porta.app.impressao";
3
4
  export declare const ALL_RECORD = "ALL_RECORD";
@@ -37,11 +38,9 @@ export declare const CONFIG_EVENTS: {
37
38
  changeConfig: string;
38
39
  configChanged: string;
39
40
  fieldChanged: string;
40
- dragStart: string;
41
- dragSort: string;
42
- dragSorted: string;
43
- dragStop: string;
41
+ dragStartDistance: number;
44
42
  };
43
+ export declare const CONFIG_SORTABLE_EVENTS: Record<string, SortableEventNames>;
45
44
  export declare const KEY_EVENTS: {
46
45
  enter: string;
47
46
  arrowLeft: string;