"use strict";const s=require("../../../../../../common/vendor.js"),t=require("../z-paging-utils.js"),h={props:{useChatRecordMode:{type:Boolean,default:t.u.gc("useChatRecordMode",!1)},chatRecordMoreOffset:{type:[Number,String],default:t.u.gc("chatRecordMoreOffset","0rpx")},autoHideKeyboardWhenChat:{type:Boolean,default:t.u.gc("autoHideKeyboardWhenChat",!0)},autoAdjustPositionWhenChat:{type:Boolean,default:t.u.gc("autoAdjustPositionWhenChat",!0)},chatAdjustPositionOffset:{type:[Number,String],default:t.u.gc("chatAdjustPositionOffset","0rpx")},autoToBottomWhenChat:{type:Boolean,default:t.u.gc("autoToBottomWhenChat",!1)},showChatLoadingWhenReload:{type:Boolean,default:t.u.gc("showChatLoadingWhenReload",!1)},chatLoadingMoreDefaultAsLoading:{type:Boolean,default:t.u.gc("chatLoadingMoreDefaultAsLoading",!0)}},data(){return{keyboardHeight:0,isKeyboardHeightChanged:!1}},computed:{finalChatRecordMoreOffset(){return t.u.convertToPx(this.chatRecordMoreOffset)},finalChatAdjustPositionOffset(){return t.u.convertToPx(this.chatAdjustPositionOffset)},chatRecordRotateStyle(){let e;return e=this.useChatRecordMode?{transform:"scaleY(-1)"}:{},this.$emit("update:cellStyle",e),this.$emit("cellStyleChange",e),this.$nextTick(()=>{this.isFirstPage&&this.isChatRecordModeAndNotInversion&&this.$nextTick(()=>{this._scrollToBottom(!1),t.u.delay(()=>{this._scrollToBottom(!1),t.u.delay(()=>{this._scrollToBottom(!1)},50)},50)})}),e},isChatRecordModeHasTransform(){return this.useChatRecordMode&&this.chatRecordRotateStyle&&this.chatRecordRotateStyle.transform},isChatRecordModeAndNotInversion(){return this.isChatRecordModeHasTransform&&this.chatRecordRotateStyle.transform==="scaleY(1)"},isChatRecordModeAndInversion(){return this.isChatRecordModeHasTransform&&this.chatRecordRotateStyle.transform==="scaleY(-1)"},chatRecordModeSafeAreaBottom(){return this.safeAreaInsetBottom&&!this.keyboardHeight?this.safeAreaBottom:0}},mounted(){this.useChatRecordMode&&s.index.onKeyboardHeightChange(this._handleKeyboardHeightChange)},methods:{addChatRecordData(e,o=!0,a=!0){this.useChatRecordMode&&(this.isTotalChangeFromAddData=!0,this.addDataFromTop(e,o,a))},doChatRecordLoadMore(){this.useChatRecordMode&&this._onLoadingMore("click")},_handleKeyboardHeightChange(e){this.$emit("keyboardHeightChange",e),this.autoAdjustPositionWhenChat&&(this.isKeyboardHeightChanged=!0,this.keyboardHeight=e.height>0?e.height+this.finalChatAdjustPositionOffset:e.height),this.autoToBottomWhenChat&&this.keyboardHeight>0&&t.u.delay(()=>{this.scrollToBottom(!1),t.u.delay(()=>{this.scrollToBottom(!1)})})}}};exports.chatRecordModerModule=h;
