import{h as e}from"./p-2c9d0870.js";import{P as a}from"./p-0f3698af.js";import{s as t}from"./p-a73b6b00.js";var n,i,s;!function(e){e.PREVIOUS="PREVIOUS",e.NEXT="NEXT",e.REFRESH="REFRESH",e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CANCEL="CANCEL",e.SAVE="SAVE",e.GRID_MODE="GRID_MODE",e.FORM_MODE="FORM_MODE",e.MORE_OPTIONS="MORE_OPTIONS",e.DIVIDER="DIVIDER",e.SPACER="SPACER",e.CONFIGURATOR="CONFIGURATOR",e.DATA_EXPORTER="DATA_EXPORTER",e.ATTACH="ATTACH",e.ACTIONS_BUTTON="ACTIONS_BUTTON",e.UPDATE_MULTIPLE="UPDATE_MULTIPLE"}(n||(n={})),function(e){e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CONFIGURATOR="CONFIGURATOR"}(i||(i={})),function(e){e.CONFIGURATOR="CONFIGURATOR"}(s||(s={}));const c=({def:e,className:a,dataElementId:t,action:n,isEnabled:i,size:s})=>{const{hint:c,text:l,iconName:o}=e;return o?l?m({iconName:o,element:e.name,className:a,dataElementId:t,title:c,action:n,isEnabled:i,size:s}):d({iconName:o,element:e.name,className:a,dataElementId:t,title:c,action:n,isEnabled:i,size:s}):r({element:e.name,className:a,dataElementId:t,title:c,action:n,isEnabled:i,size:s})},l=({element:i,className:s,dataElementId:c,getTitle:l,action:o,isEnabled:b,actions:E,dataExporterStoreKey:u,presentationMode:N,variant:O,size:v})=>{var z,k;const j={element:i,className:s,dataElementId:c,title:l(i),action:o,isEnabled:b,actions:E,variant:O,size:v};switch(i){case n.PREVIOUS:return d(Object.assign({iconName:"chevron-left"},j));case n.NEXT:return d(Object.assign({iconName:"chevron-right"},j));case n.REFRESH:return d(Object.assign({iconName:"sync"},j));case n.UPDATE:return d(Object.assign({iconName:"edit"},j));case n.UPDATE_MULTIPLE:return d(Object.assign({iconName:"edit-table"},j));case n.CLONE:return d(Object.assign({iconName:"copy"},j));case n.REMOVE:return d(Object.assign({iconName:"delete"},j));case n.INSERT:return N===a.PRIMARY?r(Object.assign({},j)):d(Object.assign({iconName:"plus"},j));case n.CANCEL:return r(Object.assign({},j));case n.SAVE:return N===a.PRIMARY?m(Object.assign(Object.assign({iconName:"save"},j),{variant:"primary"})):d(Object.assign(Object.assign({iconName:"save"},j),{variant:"primary"}));case n.GRID_MODE:return d(Object.assign({iconName:"table"},j));case n.FORM_MODE:return d(Object.assign({iconName:"list"},j));case n.CONFIGURATOR:return(null==E?void 0:E.length)>0?function({iconName:a,element:t,className:n,title:i,dataElementId:s,isEnabled:c,actions:l,action:r,size:o}){return l&&l.length>0?e("taskbar-split-button",{key:s,class:n,iconName:a,"data-taskbar-icon":a,"data-taskbar-label":i,title:i,"data-taskbar-element":t,"data-element-id":s,enabled:c(t),actions:l,action:()=>r(t),size:o}):void 0}(Object.assign({iconName:"settings-inverted"},j)):d(Object.assign({iconName:"settings-inverted"},j));case n.MORE_OPTIONS:const l=null!==(z=null==E?void 0:E.filter((e=>void 0!==e)))&&void 0!==z?z:[];return function({element:a,className:t,dataElementId:n,title:i,isEnabled:s,actions:c,action:l,size:r}){return c&&c.length>0?e("taskbar-actions-button",{class:t,key:n,title:i,"data-taskbar-element":a,"data-element-id":n,enabled:s(a),actions:c,onTaskbarActionSelected:e=>l(e.detail.value),size:r}):void 0}(Object.assign(Object.assign({},j),{actions:l}));case n.DIVIDER:return e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin--none ez-margin-left--medium","data-taskbar-divider":!0});case n.DATA_EXPORTER:const o=null===(k=t.get("exporterProviders"))||void 0===k?void 0:k[u];return e("snk-data-exporter",{class:s,provider:o,"data-element-id":c,"data-taskbar-element":i,size:v});case n.ATTACH:return d(Object.assign({iconName:"anexo"},j));case n.ACTIONS_BUTTON:return e("snk-actions-button",{"data-element-id":c,"data-taskbar-element":i,class:s,size:v})}};function r({action:a,className:t,dataElementId:n,title:i,element:s,isEnabled:c,variant:l,size:r}){return e("ez-tooltip",{key:n,message:i,class:t},e("ez-button",{label:i,"data-taskbar-label":i,"data-taskbar-element":s,"data-element-id":n,isDisabled:!c(s),onClick:()=>a(s),variant:l,size:r}))}function o(e){return"string"==typeof e?e:Object.keys(e).filter((a=>e[a])).join(" ")}function d({iconName:a,element:t,className:n,dataElementId:i,title:s,action:c,isEnabled:l,variant:r,size:d}){return e("ez-tooltip",{key:i,message:s,class:{[o(n)]:!0,[`icon-button--${d}`]:!0}},e("ez-button",{mode:"icon","data-taskbar-label":s,"data-taskbar-element":t,"data-taskbar-icon":a,"data-element-id":i,iconName:a,isDisabled:!l(t),onClick:()=>c(t),variant:r,size:d}))}function m({iconName:a,element:t,className:n,dataElementId:i,title:s,action:c,isEnabled:l,variant:r,size:o}){return e("ez-tooltip",{key:i,message:s,class:n},e("ez-button",{label:s,"data-taskbar-label":s,"data-taskbar-icon":a,"data-taskbar-element":t,"data-element-id":i,isDisabled:!l(t),onClick:()=>c(t),variant:r,size:o},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:a})))}export{i as A,n as T,s as V,c as a,l as b}