"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    default: ()=>apiClient_rslib_entry_
});
const index_js_namespaceObject = require("../../../../testUtils/index.js");
const sleep = (value)=>new Promise((resolve)=>setTimeout(resolve, value));
const { apiClient, mockRequest } = (0, index_js_namespaceObject.mockAPIClient)();
mockRequest.onPost('/attachments:create').reply(async (config)=>{
    const total = 1024;
    for (const progress of [
        0,
        0.2,
        0.4,
        0.6,
        0.8,
        1
    ]){
        await sleep(500);
        if (config.onUploadProgress) config.onUploadProgress({
            loaded: total * progress,
            total
        });
    }
    return [
        200,
        {
            data: {
                id: 2,
                title: 'd9f6ad6669902a9a8a1229d9f362235a (6)',
                filename: '7edb55e4e3145e5ac59ea3a44ca840e9.docx',
                extname: '.docx',
                path: '',
                size: null,
                url: 'https://tachybase.oss-cn-beijing.aliyuncs.com/7edb55e4e3145e5ac59ea3a44ca840e9.docx',
                mimetype: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
                meta: {},
                storage_id: 2,
                updated_at: '2022-01-21T07:21:21.084Z',
                created_at: '2022-01-21T07:21:21.084Z',
                created_by_id: null,
                updated_by_id: null
            }
        }
    ];
});
const apiClient_rslib_entry_ = apiClient;
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
