Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),t=require(`../../localization/index.cjs`),n=require(`../button/button.cjs`),r=require(`../card/card.cjs`),i=require(`../dropdown/dropdown.cjs`),a=require(`./ivr-node-constants.cjs`);let o=require(`vue`),s=require(`@dialpad/dialtone-icons/vue3`);var c=new Map([[a.IVR_NODE_PROMPT_MENU,s.DtIconKeypad],[a.IVR_NODE_PROMPT_COLLECT,s.DtIconDialer],[a.IVR_NODE_PROMPT_PLAY,s.DtIconVolume2],[a.IVR_NODE_EXPERT,s.DtIconExpertNode],[a.IVR_NODE_BRANCH,s.DtIconBranch],[a.IVR_NODE_GO_TO,s.DtIconCallMerge],[a.IVR_NODE_ASSIGN,s.DtIconChevronsRight],[a.IVR_NODE_CUSTOMER_DATA,s.DtIconListBullet],[a.IVR_NODE_TRANSFER,s.DtIconTransfer],[a.IVR_NODE_HANGUP,s.DtIconPhoneHangUp]]),l={compatConfig:{MODE:3},name:`DtRecipeIvrNode`,components:{DtCard:r.default,DtButton:n.default,DtDropdown:i.default,DtIconKeypad:s.DtIconKeypad,DtIconDialer:s.DtIconDialer,DtIconVolume2:s.DtIconVolume2,DtIconExpertNode:s.DtIconExpertNode,DtIconBranch:s.DtIconBranch,DtIconCallMerge:s.DtIconCallMerge,DtIconChevronsRight:s.DtIconChevronsRight,DtIconTransfer:s.DtIconTransfer,DtIconPhoneHangUp:s.DtIconPhoneHangUp,DtIconMoreVertical:s.DtIconMoreVertical,DtIconListBullet:s.DtIconListBullet},props:{nodeType:{type:String,required:!0},nodeLabel:{type:String,required:!0},isSelected:{type:Boolean,default:!1},dtmfKey:{type:String,default:null}},emits:[`click`],data(){return{isOpen:!1,i18n:new t.DialtoneLocalization}},computed:{nodeListeners(){return{click:e=>this.$emit(`click`,e)}},nodeIcon(){return c.get(this.nodeType)},nodeClass(){let{normal:e,selected:t}=a.IVR_NODE_CLASS_MAPPING[this.nodeType];return this.isSelected?t:e},isGotoNode(){return this.nodeType===a.IVR_NODE_GO_TO},nodeAriaLabel(){let e=this.nodeType.toUpperCase();return this.i18n.$t(`DIALTONE_IVR_NODE_${e}_ARIA_LABEL`)},menuButtonAriaLabel(){return this.i18n.$t(`DIALTONE_IVR_NODE_MENU_BUTTON_ARIA_LABEL`)}},methods:{openMenu(){this.isOpen=!0}}},u={class:`d-recipe-ivr-node__header-left`},d={class:`d-recipe-ivr-node__label`,"data-qa":`ivr-node-label`},f={class:`d-recipe-ivr-node__dropdown-list`};function p(e,t,n,r,i,a){let s=(0,o.resolveComponent)(`dt-button`),c=(0,o.resolveComponent)(`dt-icon-more-vertical`),l=(0,o.resolveComponent)(`dt-dropdown`),p=(0,o.resolveComponent)(`dt-card`);return(0,o.openBlock)(),(0,o.createElementBlock)(`div`,(0,o.mergeProps)({class:[`d-recipe-ivr-node`,a.nodeClass]},(0,o.toHandlers)(a.nodeListeners,!0)),[n.dtmfKey?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{key:0,"data-qa":`dt-top-connector-dtmf`,class:(0,o.normalizeClass)([`d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf`,{"d-recipe-ivr-node__connector-dtmf--selected":n.isSelected}])},(0,o.toDisplayString)(n.dtmfKey),3)):(0,o.createCommentVNode)(``,!0),e.$slots.connector?(0,o.renderSlot)(e.$slots,`connector`,{key:1}):(0,o.createCommentVNode)(``,!0),!n.dtmfKey&&!e.$slots.connector?((0,o.openBlock)(),(0,o.createElementBlock)(`div`,{key:2,"data-qa":`dt-top-connector`,class:(0,o.normalizeClass)([`d-recipe-ivr-node__connector`,{"d-recipe-ivr-node__connector--selected":n.isSelected}])},null,2)):(0,o.createCommentVNode)(``,!0),(0,o.createVNode)(p,null,{header:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`div`,u,[(0,o.createVNode)(s,{importance:`clear`,kind:`muted`,"data-qa":`dt-ivr-node-icon`,"aria-label":a.nodeAriaLabel,title:a.nodeAriaLabel},{icon:(0,o.withCtx)(()=>[((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)(a.nodeIcon),{size:`200`,class:(0,o.normalizeClass)([``,{"d-recipe-ivr-node__goto-icon":a.isGotoNode}])},null,8,[`class`]))]),_:1},8,[`aria-label`,`title`]),(0,o.createElementVNode)(`p`,d,(0,o.toDisplayString)(n.nodeLabel),1)]),(0,o.createVNode)(l,{open:i.isOpen,"onUpdate:open":t[0]||(t[0]=e=>i.isOpen=e),placement:`bottom`},{anchor:(0,o.withCtx)(()=>[(0,o.createVNode)(s,{importance:`clear`,kind:`muted`,"aria-label":a.menuButtonAriaLabel,title:a.menuButtonAriaLabel,onClick:(0,o.withModifiers)(a.openMenu,[`stop`,`prevent`])},{icon:(0,o.withCtx)(()=>[(0,o.createVNode)(c,{size:`200`})]),_:1},8,[`aria-label`,`title`,`onClick`])]),list:(0,o.withCtx)(({close:t})=>[(0,o.createElementVNode)(`div`,f,[(0,o.renderSlot)(e.$slots,`menuItems`,{close:t})])]),_:3},8,[`open`])]),content:(0,o.withCtx)(()=>[(0,o.renderSlot)(e.$slots,`content`)]),_:3})],16)}var m=e.t(l,[[`render`,p]]);exports.default=m;
//# sourceMappingURL=ivr-node.cjs.map