"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),a=require("../../localization/index.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),s=require("../callbar-button/callbar-button.cjs"),d=require("../dropdown/dropdown.cjs"),u=require("../button/button.cjs"),c=require("../callbar-button/callbar-button-constants.cjs"),p={name:"DtRecipeCallbarButtonWithDropdown",components:{DtRecipeCallbarButton:s.default,DtDropdown:d.default,DtButton:u.default,DtIconChevronUp:l.DtIconChevronUp},inheritAttrs:!1,props:{id:{type:String,default(){return n.default.getUniqueString()}},ariaLabel:{type:String,default:null,validator:e=>e||(void 0).$slots.default},placement:{type:String,default:"top"},fallbackPlacements:{type:Array,default:()=>["auto"]},disabled:{type:Boolean,default:!1},forceShowArrow:{type:Boolean,default:!1},active:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},buttonClass:{type:[String,Array,Object],default:""},textClass:{type:[String,Array,Object],default:""},buttonWidthSize:{type:String,default:"xl",validator:e=>c.CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(e)},invertedTooltip:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:null},tooltipText:{type:String,default:void 0},tooltipDelay:{type:Boolean,default:void 0}},emits:["arrow-click","click","opened"],data(){return{open:!1,i18n:new a.DialtoneLocalization}},computed:{showArrowButton(){return this.forceShowArrow||!this.disabled},isCompactMode(){return this.buttonWidthSize==="sm"||this.buttonWidthSize==="md"},arrowButtonLabel(){return this.i18n.$t("DIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_ARIA_LABEL")}},mounted(){n.warnIfUnmounted(this.$el,this.$options.name)},methods:{arrowClick(e){return this.$emit("arrow-click",e),this.toggleOpen()},toggleOpen(){return this.open=!this.open},syncOpenState(){this.open=this.openDropdown},buttonClick(e){this.$listeners.click?this.$emit("click",e):this.arrowClick(e)},onModalIsOpened(e){this.open=e,this.$emit("opened",e)}}};var b=function(){var t=this,o=t._self._c;return o("div",{staticClass:"dt-recipe--callbar-button-with-dropdown"},[o("dt-recipe-callbar-button",{staticClass:"dt-recipe--callbar-button-with-dropdown--main-button",attrs:{active:t.active,"aria-label":t.ariaLabel,"button-class":t.buttonClass,"button-width-size":t.buttonWidthSize,danger:t.danger,disabled:t.disabled,"inverted-tooltip":t.invertedTooltip,"show-tooltip":t.showTooltip,"text-class":t.textClass,"tooltip-delay":t.tooltipDelay,"tooltip-text":t.tooltipText},on:{click:t.buttonClick},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon")]},proxy:!0},{key:"tooltip",fn:function(){return[t._t("tooltip")]},proxy:!0}],null,!0)},[t._t("default")],2),t.showArrowButton?o("dt-dropdown",t._b({staticClass:"dt-recipe--callbar-button-with-dropdown--dropdown-wrapper",attrs:{id:t.id,modal:!1,"fallback-placements":t.fallbackPlacements,open:t.open,placement:t.placement,padding:"none"},on:{opened:t.onModalIsOpened},scopedSlots:t._u([{key:"anchor",fn:function(){return[o("dt-button",{class:["dt-recipe--callbar-button-with-dropdown--arrow",{"dt-recipe--callbar-button-with-dropdown--arrow--large":!t.isCompactMode}],attrs:{active:t.open,circle:!0,importance:"clear",size:"lg","aria-label":t.arrowButtonLabel,title:t.arrowButtonLabel,width:"2rem"},on:{click:t.arrowClick},scopedSlots:t._u([{key:"icon",fn:function(){return[o("dt-icon-chevron-up",{staticClass:"dt-recipe--callbar-button-with-dropdown--arrow__icon",attrs:{size:"200"}})]},proxy:!0}],null,!1,887776886)})]},proxy:!0},{key:"list",fn:function({close:r}){return[t._t("list",null,{close:r})]}}],null,!0)},"dt-dropdown",t.$attrs,!1)):t._e()],1)},f=[],_=i.n(p,b,f);const w=_.exports;exports.default=w;
//# sourceMappingURL=callbar-button-with-dropdown.cjs.map
