require("../_virtual/_rolldown/runtime.js");
const require_defineProperty = require("../_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js");
const require_objectSpread2 = require("../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_asyncToGenerator = require("../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
//#region src/utils/index.ts
var Request = class {
	constructor() {
		require_defineProperty._defineProperty(this, "request", {});
	}
	setRequest(val) {
		this.request = val;
	}
	withCustomToast(config) {
		return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, config || {}), {}, { customToast: (msg) => (0, _pisell_materials.PisellToast)({ content: msg }) });
	}
	getRequest() {
		return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, this.request), {}, {
			get: (url, params, config) => this.request.get(url, params, this.withCustomToast(config)),
			post: (url, params, config) => this.request.post(url, params, this.withCustomToast(config))
		});
	}
};
const request = new Request();
let modal;
(function() {
	var _ref = require_asyncToGenerator._asyncToGenerator(function* () {
		return modal.confirm({
			title: _pisell_utils.locales.getText("pisell2.text.products.unsaved-title"),
			content: _pisell_utils.locales.getText("pisell2.text.products.unsaved-content"),
			cancelText: _pisell_utils.locales.getText("pisell2.text.products.unsaved-back"),
			okText: _pisell_utils.locales.getText("pisell2.text.products.unsaved-yes")
		});
	});
	return function saveConfirm() {
		return _ref.apply(this, arguments);
	};
})();
//#endregion
exports.request = request;
