"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/libs/classNames")),_props=require("./props");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(0,_baseComponent.default)({properties:_props.props,computed:{classes:["prefixCls, buttons",function(t,e){return{wrap:(0,_classNames2.default)(t),button:e.map(function(e){return{wrap:(0,_classNames2.default)("".concat(t,"__button"),_defineProperty(_defineProperty({},"".concat(t,"__button--disabled"),e.disabled),"".concat(e.className),e.className)),hover:e.hoverClass&&"default"!==e.hoverClass?e.hoverClass:"".concat(t,"__button--hover")}}),bd:"".concat(t,"__bd"),icon:"".concat(t,"__icon"),title:"".concat(t,"__title"),buttons:"".concat(t,"__buttons")}}]},methods:{onTap:function(e){var t=this.data.buttons,e=e.currentTarget.dataset.index,r=this.data.buttons[e];r.disabled||this.triggerEvent("click",{index:e,value:r,buttons:t})},bindgetuserinfo:function(e){this.triggerEvent("getuserinfo",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))},bindcontact:function(e){this.triggerEvent("contact",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))},bindgetphonenumber:function(e){this.triggerEvent("getphonenumber",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))},bindopensetting:function(e){this.triggerEvent("opensetting",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))},bindlaunchapp:function(e){this.triggerEvent("launchapp",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))},bindchooseavatar:function(e){this.triggerEvent("chooseavatar",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))},onError:function(e){this.triggerEvent("error",_objectSpread(_objectSpread({},e.detail),e.currentTarget.dataset))}}});