/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./functions/help/check-number-status.js":
/*!***********************************************!*\
  !*** ./functions/help/check-number-status.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "checkNumberStatus": () => (/* binding */ checkNumberStatus)
/* harmony export */ });
async function checkNumberStatus(id, conn = false) {
    try {

      const err = { error: 404 };

      const connection =
        window.Store &&
        window.Store.State &&
        window.Store.State.Socket &&
        window.Store.State.Socket.state
          ? window.Store.State.Socket.state
          : '';
  
      if (conn === true) {
        if (connection !== 'CONNECTED') {
          Object.assign(err, {
            text: 'No connection with WhatsApp',
            connection: connection,
            numberExists: null,
          });
          throw err;
        }
      }
      if (API.isMD()) {
        return await Store.checkNumberMD
          .queryExists(id)
          .then((result) => {
            if (!!result && typeof result === 'object') {
              const data = {
                status: 200,
                numberExists: true,
                id: result.wid,
              };
              return data;
            }
            throw Object.assign(err, {
              connection: connection,
              numberExists: false,
              text: `The number does not exist`,
            });
          })
          .catch((err) => {
            if (err.text) {
              throw err;
            }
            throw Object.assign(err, {
              connection: connection,
              numberExists: false,
              text: err,
            });
          });
      }
  
      const result = await Store.checkNumber.queryExist(id);
      if (result.status === 200) {
        return {
          status: result.status,
          numberExists: true,
          id: result.jid,
        };
      }
      return {
        status: result.status,
        numberExists: false,
        text: `The number does not exist`,
      };
    } catch (e) {
      return {
        status: e.error,
        text: e.text,
        numberExists: e.numberExists,
        connection: e.connection,
      };
    }
  }

/***/ }),

/***/ "./functions/help/get-chat.js":
/*!************************************!*\
  !*** ./functions/help/get-chat.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "getChat": () => (/* binding */ getChat)
/* harmony export */ });
function getChat(chatId) {

    if (!chatId) return false;

    chatId = typeof chatId == 'string' ? chatId : chatId._serialized;
    let found = window.Store.Chat.get(chatId);

    if (!found) {
        const ConstructChat = new window.Store.UserConstructor(chatId, {
            intentionallyUsePrivateConstructor: !0,
        });
        found = window.Store.Chat.find(ConstructChat) || false;
    }

    return found;
}

/***/ }),

/***/ "./functions/help/get-mew-id.js":
/*!**************************************!*\
  !*** ./functions/help/get-mew-id.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "getNewId": () => (/* binding */ getNewId)
/* harmony export */ });
function getNewId() {
    let text = '';
    const possible =
        'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    for (var i = 0; i < 16; i++)
        text += possible.charAt(Math.floor(Math.random() * possible.length));
    return text;
}

/***/ }),

/***/ "./functions/help/get-new-message.js":
/*!*******************************************!*\
  !*** ./functions/help/get-new-message.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "getNewMessageId": () => (/* binding */ getNewMessageId)
/* harmony export */ });
async function getNewMessageId(chatId) {
    const chat = await window.API.sendExist(chatId);
    if (chat.id) {
        const newMsgId = new Object();
        newMsgId.fromMe = true;
        newMsgId.id = await window.API.getNewId().toUpperCase();
        newMsgId.remote = new window.Store.WidFactory.createWid(chat.id._serialized);
        newMsgId._serialized = `${newMsgId.fromMe}_${newMsgId.remote}_${newMsgId.id}`;
        const Msgkey = new window.Store.MsgKey(newMsgId);
        return Msgkey;
    } else {
        return false;
    }
}

/***/ }),

/***/ "./functions/help/index.js":
/*!*********************************!*\
  !*** ./functions/help/index.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "checkNumberStatus": () => (/* reexport safe */ _check_number_status__WEBPACK_IMPORTED_MODULE_5__.checkNumberStatus),
/* harmony export */   "getChat": () => (/* reexport safe */ _get_chat__WEBPACK_IMPORTED_MODULE_0__.getChat),
/* harmony export */   "getNewId": () => (/* reexport safe */ _get_mew_id__WEBPACK_IMPORTED_MODULE_2__.getNewId),
/* harmony export */   "getNewMessageId": () => (/* reexport safe */ _get_new_message__WEBPACK_IMPORTED_MODULE_3__.getNewMessageId),
/* harmony export */   "isMD": () => (/* reexport safe */ _is_md__WEBPACK_IMPORTED_MODULE_6__.isMD),
/* harmony export */   "scope": () => (/* reexport safe */ _scope__WEBPACK_IMPORTED_MODULE_1__.scope),
/* harmony export */   "sendExist": () => (/* reexport safe */ _send_exist__WEBPACK_IMPORTED_MODULE_4__.sendExist)
/* harmony export */ });
/* harmony import */ var _get_chat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-chat */ "./functions/help/get-chat.js");
/* harmony import */ var _scope__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scope */ "./functions/help/scope.js");
/* harmony import */ var _get_mew_id__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-mew-id */ "./functions/help/get-mew-id.js");
/* harmony import */ var _get_new_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-new-message */ "./functions/help/get-new-message.js");
/* harmony import */ var _send_exist__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./send-exist */ "./functions/help/send-exist.js");
/* harmony import */ var _check_number_status__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./check-number-status */ "./functions/help/check-number-status.js");
/* harmony import */ var _is_md__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./is-md */ "./functions/help/is-md.js");






 

/***/ }),

/***/ "./functions/help/is-md.js":
/*!*********************************!*\
  !*** ./functions/help/is-md.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "isMD": () => (/* binding */ isMD)
/* harmony export */ });
async function isMD() {
    if (
      !window.localStorage.getItem('WASecretBundle') &&
      !window.localStorage.getItem('WAToken1') &&
      !window.localStorage.getItem('WAToken2')
    ) {
      return true;
    }
    return false;
  }
  

/***/ }),

/***/ "./functions/help/scope.js":
/*!*********************************!*\
  !*** ./functions/help/scope.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "scope": () => (/* binding */ scope)
/* harmony export */ });
async function scope(id, erro, status, text = null, type = null, body = null) {
    let e = {
      to: id,
      erro: erro,
      text: text,
      status: status,
      type: type,
      body: body
    };
    return e;
  }

/***/ }),

/***/ "./functions/help/send-exist.js":
/*!**************************************!*\
  !*** ./functions/help/send-exist.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "sendExist": () => (/* binding */ sendExist)
/* harmony export */ });
async function sendExist(chatId, returnChat = true, Send = true) {

    let ck = await window.API.checkNumberStatus(chatId, false);

    if (
        ck.status === 404 &&
        !chatId.includes('@g.us') &&
        !chatId.includes('@broadcast')
    ) {
        return API.scope(chatId, true, ck.status, 'The number does not exist');
    }

    const chatWid = new window.Store.WidFactory.createWid(chatId);

    let chat =
        ck && ck.id && ck.id._serialized ?
        await window.API.getChat(ck.id._serialized) :
        undefined;

    if (ck.numberExists && chat === undefined) {
        var idUser = new window.Store.UserConstructor(chatId, {
            intentionallyUsePrivateConstructor: true,
        });
        chat = await window.Store.Chat.find(idUser);
    }

    if (!chat) {
        const storeChat = await window.Store.Chat.find(chatWid);
        if (storeChat) {
            chat =
                storeChat && storeChat.id && storeChat.id._serialized ?
                await window.API.getChat(storeChat.id._serialized) :
                undefined;
        }
    }

    if (!ck.numberExists && !chat.t && chat.isUser) {
        return window.API.scope(chatId, true, ck.status, 'The number does not exist');
    }

    if (!ck.numberExists && !chat.t && chat.isGroup) {
        return window.API.scope(
            chatId,
            true,
            ck.status,
            'The group number does not exist on your chat list, or it does not exist at all!'
        );
    }

    if (!chat) {
        return window.API.scope(chatId, true, 404);
    }
    
    if (Send) {
        await window.Store.ReadSeen.sendSeen(chat, false);
    }

    if (returnChat) {
        return chat;
    }
    return window.API.scope(chatId, false, 200);
}

/***/ }),

/***/ "./functions/index.js":
/*!****************************!*\
  !*** ./functions/index.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "baseSendMessage": () => (/* reexport safe */ _send_message__WEBPACK_IMPORTED_MODULE_0__.baseSendMessage),
/* harmony export */   "sendMessage": () => (/* reexport safe */ _send_message__WEBPACK_IMPORTED_MODULE_0__.sendMessage)
/* harmony export */ });
/* harmony import */ var _send_message__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./send-message */ "./functions/send-message.js");


/***/ }),

/***/ "./functions/send-message.js":
/*!***********************************!*\
  !*** ./functions/send-message.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "baseSendMessage": () => (/* binding */ baseSendMessage),
/* harmony export */   "sendMessage": () => (/* binding */ sendMessage)
/* harmony export */ });

async function sendMessage(to, body, options = {}) {
    const types = ['text'];

    if (!options.type || options.type && !types.includes(options.type)) {
        return API.scope(undefined, true, null, `pass the message type, examples: ${types.join(',')}`);
    }

    const chat = await API.sendExist(to);
    const merge = {};
    if (chat && chat.status != 404 && chat.id) {
        const newMsgId = await window.API.getNewMessageId(chat.id._serialized);
        const fromwWid = await window.Store.MaybeMeUser.getMaybeMeUser();

        if (options.type === types[0]) {
            merge.type = 'chat';
        }

        const message = API.baseSendMessage({
            to,
            body,
            newMsgId,
            fromwWid,
            chat,
        }, merge);

        try {
            const result = (await Promise.all(window.Store.addAndSendMsgToChat(chat, message)))[1];
            if (result === 'OK') {
                return API.scope(newMsgId, false, result, null, options.type, body);
            }
            throw result;
        } catch (result) {
            return API.scope(newMsgId, true, result, null, options.type, body);
        }
    } else {
        if (!chat.erro) {
            chat.erro = true;
        }
        return chat;
    }
}

function baseSendMessage(param, merge) {
    const message = {
        id: param.newMsgId,
        ack: 0,
        body: param.body,
        from: param.fromwWid,
        to: param.chat.id,
        local: !0,
        self: 'out',
        t: parseInt(new Date().getTime() / 1000),
        isNewMsg: !0,
        ...merge
    };
    return message;
}

/***/ }),

/***/ "./help/filter-object.js":
/*!*******************************!*\
  !*** ./help/filter-object.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "filterObjects": () => (/* binding */ filterObjects)
/* harmony export */ });
const filterObjects = [{
        type: 'Module',
        when: (module) =>
            module.default && module.default.Chat && module.default.Msg ?
            module.default : null,
    },
    {
        type: 'addAndSendMsgToChat',
        when: (module) =>
            module.addAndSendMsgToChat ? module.addAndSendMsgToChat : null,
    },
    {
        type: 'WidFactory',
        when: (module) =>
            module.isWidlike && module.createWid && module.createWidFromWidLike ?
            module : null,
    },
    {
        type: 'UserConstructor',
        when: (module) =>
            module.default &&
            module.default.prototype &&
            module.default.prototype.isServer &&
            module.default.prototype.isUser ?
            module.default : null,
    },
    {
        type: 'WidFactory',
        when: (module) =>
            module.isWidlike && module.createWid && module.createWidFromWidLike ?
            module : null,
    },
    {
        type: 'MsgKey',
        when: (module) =>
            module.default &&
            module.default.toString &&
            typeof module.default.toString === 'function' &&
            module.default.toString().includes('MsgKey error: obj is null/undefined') ?
            module.default : null,
    },
    {
        type: 'MaybeMeUser',
        when: (module) => (module.getMaybeMeUser ? module : null),
    },
    {
        type: 'State',
        when: (module) => (module.Socket ? module : null),
    },
    {
        type: 'addAndSendMsgToChat',
        when: (module) =>
            module.addAndSendMsgToChat ? module.addAndSendMsgToChat : null,
    },
    {
        type: 'checkNumber',
        when: (module) =>
            module.default && module.default.queryExist ? module.default : null,
    },
    {
        type: 'checkNumberMD',
        when: (module) =>
            module.queryExists && module.queryPhoneExists ? module : null,
    },
    {
        type: 'ReadSeen',
        when: (module) => (module.sendSeen ? module : null),
    },
    {
        type: 'Stream',
        when: (module) =>
            module.Stream && module.StreamInfo ? module.Stream : null,
    },
];

/***/ }),

/***/ "./help/index.js":
/*!***********************!*\
  !*** ./help/index.js ***!
  \***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "filterObjects": () => (/* reexport safe */ _filter_object__WEBPACK_IMPORTED_MODULE_3__.filterObjects),
/* harmony export */   "injectConfig": () => (/* reexport safe */ _inject_config__WEBPACK_IMPORTED_MODULE_2__.injectConfig),
/* harmony export */   "injectParasiteSnake": () => (/* reexport safe */ _inject_paresite__WEBPACK_IMPORTED_MODULE_1__.injectParasiteSnake),
/* harmony export */   "sleep": () => (/* reexport safe */ _sleep__WEBPACK_IMPORTED_MODULE_0__.sleep)
/* harmony export */ });
/* harmony import */ var _sleep__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sleep */ "./help/sleep.js");
/* harmony import */ var _inject_paresite__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inject-paresite */ "./help/inject-paresite.js");
/* harmony import */ var _inject_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inject-config */ "./help/inject-config.js");
/* harmony import */ var _filter_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filter-object */ "./help/filter-object.js");










/***/ }),

/***/ "./help/inject-config.js":
/*!*******************************!*\
  !*** ./help/inject-config.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "injectConfig": () => (/* binding */ injectConfig)
/* harmony export */ });
const injectConfig = {
    webpack: 'webpackChunkwhatsapp_web_client',
    parasite: "parasitesnake"
}

/***/ }),

/***/ "./help/inject-paresite.js":
/*!*********************************!*\
  !*** ./help/inject-paresite.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "injectParasiteSnake": () => (/* binding */ injectParasiteSnake)
/* harmony export */ });
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "./help/index.js");

const injectParasiteSnake = async () => {
    window[_index__WEBPACK_IMPORTED_MODULE_0__.injectConfig.webpack].push([
        [_index__WEBPACK_IMPORTED_MODULE_0__.injectConfig.parasite],
        {},
        async function (o) {
            const modules = []; // modules whatsapp array
            for (let idx in o.m) {
                modules.push(o(idx));
            }
            let found = 0;
            for (let i in modules) {
                if (typeof modules[i] === 'object' && modules[i] !== null) {
                    _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.forEach((needObj) => {
                        if (!needObj.when | needObj.yesModule) return;

                        const checkObj = needObj.when(modules[i]);
                        if (checkObj !== null) {
                            found++;
                            needObj.yesModule = checkObj;
                        }
                    });
                    if (found == _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.length) {
                        break;
                    }
                }
            }

            let neededStore = _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.find((e) => e.type === 'Module');

            if (neededStore) {
                window.Store = _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.yesModule ? _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.yesModule : {};
            }

            _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.splice(_index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.indexOf(neededStore), 1);

            _index__WEBPACK_IMPORTED_MODULE_0__.filterObjects.forEach((needObj) => {
                if (needObj.yesModule) {
                    window.Store[needObj.type] = needObj.yesModule;
                }
            });

            if (typeof neededStore?.yesModule === 'object') {
                Object.keys(neededStore.yesModule).forEach((e) => {
                    window.Store[e] = neededStore.yesModule[e];
                })
            }

            if (Store && Store.BusinessProfile) {
                Store.Chat._findAndParse = Store.BusinessProfile._findAndParse;
                Store.Chat._find = Store.BusinessProfile._find;
            }
        },
    ]);
}

/***/ }),

/***/ "./help/sleep.js":
/*!***********************!*\
  !*** ./help/sleep.js ***!
  \***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "sleep": () => (/* binding */ sleep)
/* harmony export */ });
function sleep(time) {
    try {
      return new Promise((resolve) => setTimeout(resolve, time));
    } catch (e) {}
  }
  

/***/ }),

/***/ "./listeners/change-on-stream.js":
/*!***************************************!*\
  !*** ./listeners/change-on-stream.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "addOnStream": () => (/* binding */ addOnStream)
/* harmony export */ });
function addOnStream() {
  let initialized = false;
  const getData = () => {
    return {
      displayInfo: window.Store.Stream.displayInfo,
      mode: window.Store.Stream.mode,
      info: window.Store.Stream.info,
    };
  };

  window.API.interfaceChange = (callback) => {
    window.Store.Stream.on('change:info change:displayInfo change:mode', () => {
      callback(getData());
    });
    if (initialized === false) {
      initialized = true;
      callback(getData());
    }
    return true;
  };
  
}

/***/ }),

/***/ "./listeners/index.js":
/*!****************************!*\
  !*** ./listeners/index.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "addOnNewMessage": () => (/* reexport safe */ _on_new_message_js__WEBPACK_IMPORTED_MODULE_1__.addOnNewMessage),
/* harmony export */   "addOnStream": () => (/* reexport safe */ _change_on_stream__WEBPACK_IMPORTED_MODULE_0__.addOnStream)
/* harmony export */ });
/* harmony import */ var _change_on_stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./change-on-stream */ "./listeners/change-on-stream.js");
/* harmony import */ var _on_new_message_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./on-new-message.js */ "./listeners/on-new-message.js");



/***/ }),

/***/ "./listeners/on-new-message.js":
/*!*************************************!*\
  !*** ./listeners/on-new-message.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "addOnNewMessage": () => (/* binding */ addOnNewMessage)
/* harmony export */ });
function addOnNewMessage() {
    let isHeroEqual = {};
    window.API.newMessage = (callback) => {
        window.Store.Msg.on('add', (newMessage) => {
            if (!Object.is(isHeroEqual, newMessage)) {
                isHeroEqual = newMessage;
                if (newMessage && newMessage.isNewMsg) {
                    callback(API.serializeMessageObj(newMessage));
                }
            }
        });

        return true;
    };
}

/***/ }),

/***/ "./serializers/index.js":
/*!******************************!*\
  !*** ./serializers/index.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "serializeChatObj": () => (/* reexport safe */ _serialize_chat__WEBPACK_IMPORTED_MODULE_1__.serializeChatObj),
/* harmony export */   "serializeContactObj": () => (/* reexport safe */ _serialize_contact__WEBPACK_IMPORTED_MODULE_2__.serializeContactObj),
/* harmony export */   "serializeMessageObj": () => (/* reexport safe */ _serialize_message__WEBPACK_IMPORTED_MODULE_0__.serializeMessageObj),
/* harmony export */   "serializeProfilePicThumb": () => (/* reexport safe */ _serialize_profile_pic_thumb__WEBPACK_IMPORTED_MODULE_3__.serializeProfilePicThumb),
/* harmony export */   "serializeRawObj": () => (/* reexport safe */ _serialize_raw__WEBPACK_IMPORTED_MODULE_4__.serializeRawObj)
/* harmony export */ });
/* harmony import */ var _serialize_message__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./serialize-message */ "./serializers/serialize-message.js");
/* harmony import */ var _serialize_chat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./serialize-chat */ "./serializers/serialize-chat.js");
/* harmony import */ var _serialize_contact__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./serialize-contact */ "./serializers/serialize-contact.js");
/* harmony import */ var _serialize_profile_pic_thumb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./serialize-profile-pic-thumb */ "./serializers/serialize-profile-pic-thumb.js");
/* harmony import */ var _serialize_raw__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./serialize-raw */ "./serializers/serialize-raw.js");






/***/ }),

/***/ "./serializers/serialize-chat.js":
/*!***************************************!*\
  !*** ./serializers/serialize-chat.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "serializeChatObj": () => (/* binding */ serializeChatObj)
/* harmony export */ });
const serializeChatObj = (obj) => {
    if (obj == undefined) {
      return null;
    }
    return Object.assign(window.API.serializeRawObj(obj), {
      kind: obj.kind,
      isGroup: obj.isGroup,
      contact: obj['contact']
        ? window.API.serializeContactObj(obj['contact'])
        : null,
      groupMetadata: obj['groupMetadata']
        ? window.API.serializeRawObj(obj['groupMetadata'])
        : null,
      presence: obj['presence']
        ? window.API.serializeRawObj(obj['presence'])
        : null,
      msgs: null,
      isOnline: obj.__x_presence.attributes.isOnline || null,
      lastSeen:
        obj &&
        obj.previewMessage &&
        obj.previewMessage.__x_ephemeralStartTimestamp
          ? obj.previewMessage.__x_ephemeralStartTimestamp * 1000
          : null,
    });
  };

/***/ }),

/***/ "./serializers/serialize-contact.js":
/*!******************************************!*\
  !*** ./serializers/serialize-contact.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "serializeContactObj": () => (/* binding */ serializeContactObj)
/* harmony export */ });
const serializeContactObj = (obj) => {
    if (obj == undefined) {
      return null;
    }
  
    if (!obj.profilePicThumb && obj.id && window.Store.ProfilePicThumb) {
      obj.profilePicThumb = window.Store.ProfilePicThumb.get(obj.id);
    }
  
    return Object.assign(window.API.serializeRawObj(obj), {
      formattedName: obj.formattedName,
      displayName: obj.displayName,
      formattedShortName: obj.formattedShortName,
      formattedShortNameWithNonBreakingSpaces:
        obj.formattedShortNameWithNonBreakingSpaces,
      isHighLevelVerified: obj.isHighLevelVerified,
      isMe: obj.isMe,
      mentionName: obj.mentionName,
      notifyName: obj.notifyName,
      isMyContact: obj.isMyContact,
      isPSA: obj.isPSA,
      isUser: obj.isUser,
      isVerified: obj.isVerified,
      isWAContact: obj.isWAContact,
      profilePicThumbObj: obj.profilePicThumb
        ? API.serializeProfilePicThumb(obj.profilePicThumb)
        : {},
      statusMute: obj.statusMute,
      msgs: null,
    });
  };

/***/ }),

/***/ "./serializers/serialize-message.js":
/*!******************************************!*\
  !*** ./serializers/serialize-message.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "serializeMessageObj": () => (/* binding */ serializeMessageObj)
/* harmony export */ });
const serializeMessageObj = (obj) => {
    if (obj == undefined) {
        return null;
    }

    const chat = obj['chat'] ? API.serializeChatObj(obj['chat']) : {};
    if (obj.quotedMsg) obj.quotedMsgObj();

    return Object.assign(window.API.serializeRawObj(obj), {
        id: obj.id._serialized,
        from: obj.from._serialized,
        quotedParticipant: obj.quotedParticipant ?
            obj.quotedParticipant._serialized ?
            obj.quotedParticipant._serialized :
            undefined :
            undefined,
        author: obj.author ?
            obj.author._serialized ?
            obj.author._serialized :
            undefined :
            undefined,
        chatId: obj.id && obj.id.remote ?
            obj.id.remote :
            obj.chatId && obj.chatId._serialized ?
            obj.chatId._serialized :
            undefined,
        to: obj.to ?
            obj.to._serialized ?
            obj.to._serialized :
            undefined :
            undefined,
        isSentByMe: obj.isSentByMe,
        fromMe: obj.id.fromMe,
        sender: obj.senderObj ? API.serializeContactObj(obj.senderObj) : null,
        timestamp: obj.t,
        content: obj.body,
        body: obj.body,
        isGroupMsg: obj.isGroupMsg,
        isLink: obj.isLink,
        isMMS: obj.isMMS,
        isMedia: obj.isMedia,
        isNotification: obj.isNotification,
        isPSA: obj.isPSA,
        type: obj.type,
        chat: chat,
        isOnline: chat.isOnline,
        lastSeen: chat.lastSeen,
        quotedMsgObj: obj.quotedMsg,
        quotedStanzaId: obj.quotedStanzaID ? obj.quotedStanzaID : undefined,
        mediaData: window.API.serializeRawObj(obj.mediaData),
        caption: obj.caption,
        deprecatedMms3Url: obj.deprecatedMms3Url,
        directPath: obj.directPath,
        encFilehash: obj.encFilehash,
        filehash: obj.filehash,
        filename: obj.filename,
        mimetype: obj.mimetype,
        clientUrl: obj.clientUrl,
        mediaKey: obj.mediaKey,
        size: obj.size,
        t: obj.t,
        isNewMsg: obj.isNewMsg,
        linkPreview: obj.linkPreview,
        text: obj.text,
        height: obj.height,
        width: obj.width,
        self: obj.self,
        initialPageSize: obj.initialPageSize,
        lat: obj.lat ? obj.lat : undefined,
        lng: obj.lng ? obj.lng : undefined,
        ack: obj.ack,
        scanLengths: undefined,
        scansSidecar: undefined,
        streamingSidecar: undefined,
        waveform: undefined,
        replyButtons: undefined,
        dynamicReplyButtons: undefined,
        buttons: undefined,
        hydratedButtons: undefined
    });
};

/***/ }),

/***/ "./serializers/serialize-profile-pic-thumb.js":
/*!****************************************************!*\
  !*** ./serializers/serialize-profile-pic-thumb.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "serializeProfilePicThumb": () => (/* binding */ serializeProfilePicThumb)
/* harmony export */ });
const serializeProfilePicThumb = (obj) => {
    if (obj == undefined) {
      return null;
    }
  
    return Object.assign(
      {},
      {
        eurl: obj.eurl,
        id: obj.id,
        img: obj.img,
        imgFull: obj.imgFull,
        raw: obj.raw,
        tag: obj.tag,
      }
    );
  };

/***/ }),

/***/ "./serializers/serialize-raw.js":
/*!**************************************!*\
  !*** ./serializers/serialize-raw.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "serializeRawObj": () => (/* binding */ serializeRawObj)
/* harmony export */ });
const serializeRawObj = (obj) => {
    if (obj && obj.toJSON) {
      obj.waveform = null;
      return obj.toJSON();
    }
    return {};
  };

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
/*!****************!*\
  !*** ./api.js ***!
  \****************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _help__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./help */ "./help/index.js");
/* harmony import */ var _functions_help__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions/help */ "./functions/help/index.js");
/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./functions */ "./functions/index.js");
/* harmony import */ var _listeners__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./listeners */ "./listeners/index.js");
/* harmony import */ var _serializers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./serializers */ "./serializers/index.js");










//initialized scrap webpack
(async () => {
    window[_help__WEBPACK_IMPORTED_MODULE_0__.injectConfig.webpack] = window[_help__WEBPACK_IMPORTED_MODULE_0__.injectConfig.webpack] || [];
    window.Store = {};
    while (true) {
        try {
            const webPackLast = window[_help__WEBPACK_IMPORTED_MODULE_0__.injectConfig.webpack].length - 1;
            if (!window[_help__WEBPACK_IMPORTED_MODULE_0__.injectConfig.webpack][webPackLast][0].includes(_help__WEBPACK_IMPORTED_MODULE_0__.injectConfig.parasite)) {
                await (0,_help__WEBPACK_IMPORTED_MODULE_0__.injectParasiteSnake)();
                return;
            }
        } catch {
            await (0,_help__WEBPACK_IMPORTED_MODULE_0__.sleep)(1000);
        }
    }
})();

if (typeof window.API === 'undefined') {
    window.API = {};

    // helps
    window.API.getChat = _functions_help__WEBPACK_IMPORTED_MODULE_1__.getChat;
    window.API.scope = _functions_help__WEBPACK_IMPORTED_MODULE_1__.scope;
    window.API.getNewId = _functions_help__WEBPACK_IMPORTED_MODULE_1__.getNewId;
    window.API.getNewMessageId = _functions_help__WEBPACK_IMPORTED_MODULE_1__.getNewMessageId;
    window.API.sendExist = _functions_help__WEBPACK_IMPORTED_MODULE_1__.sendExist;
    window.API.checkNumberStatus = _functions_help__WEBPACK_IMPORTED_MODULE_1__.checkNumberStatus;
    window.API.isMD = _functions_help__WEBPACK_IMPORTED_MODULE_1__.isMD;
    window.API.baseSendMessage = _functions__WEBPACK_IMPORTED_MODULE_2__.baseSendMessage;

    // Functions
    window.API.sendMessage = _functions__WEBPACK_IMPORTED_MODULE_2__.sendMessage;

    // serialize
    window.API.serializeMessageObj = _serializers__WEBPACK_IMPORTED_MODULE_4__.serializeMessageObj;
    window.API.serializeChatObj = _serializers__WEBPACK_IMPORTED_MODULE_4__.serializeChatObj;
    window.API.serializeContactObj = _serializers__WEBPACK_IMPORTED_MODULE_4__.serializeContactObj;
    window.API.serializeProfilePicThumb = _serializers__WEBPACK_IMPORTED_MODULE_4__.serializeProfilePicThumb;
    window.API.serializeRawObj = _serializers__WEBPACK_IMPORTED_MODULE_4__.serializeRawObj;

    // On
    (0,_listeners__WEBPACK_IMPORTED_MODULE_3__.addOnStream)();
    (0,_listeners__WEBPACK_IMPORTED_MODULE_3__.addOnNewMessage)();
}
})();

/******/ })()
;
//# sourceMappingURL=api.js.map