require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_utils = require("./utils.js");
let _pisell_utils = require("@pisell/utils");
//#region src/components/booking/info/model.tsx
const walkInData = {
	id: 1,
	nickname: "Select a customer"
};
const { Provider, Context } = (0, _pisell_utils.miniRedux)({
	namespace: "state",
	state: {},
	effects: {
		setClient(state, payload) {
			state.setGlobalState({ client: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.client), payload) });
		},
		setContactsInfo(state, payload) {
			state.setGlobalState({ contacts_info: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.contacts_info), payload) });
		},
		setService(state, payload) {
			let obj = {};
			if (payload.value) obj.value = require_utils.formatServiceListByTime(payload.value);
			state.setGlobalState({ service: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.service), payload), obj) });
		},
		setPaymentPaid(state, payload) {
			state.setGlobalState({ paymentPaid: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.paymentPaid), payload) });
		},
		setDate(state, payload) {
			state.setGlobalState({ date: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.date), payload) });
		},
		setPet(state, payload) {
			state.setGlobalState({ pet: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.pet), payload) });
		},
		setNotes(state, payload) {
			state.setGlobalState({ notes: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.notes), payload) });
		},
		setPetValue(state, payload) {
			state.setGlobalState({ pet: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.pet), {}, {
				value: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.pet.value), payload),
				edit: false
			}) });
		},
		setStatus(state, payload) {
			let _val = { appointment_status: payload };
			if (payload === "cancelled") _val.disabledEdit = true;
			else _val.disabledEdit = false;
			state.setGlobalState(_val);
		},
		setActiveCartId(state, payload) {
			state.setGlobalState(payload);
		},
		setAddons(state, payload) {
			state.setGlobalState({ addons: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state.addons), payload) });
		}
	},
	reducers: {
		setStateFn(state, payload) {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), payload);
		},
		setState(state, payload) {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), payload);
		}
	}
});
//#endregion
exports.Context = Context;
exports.Provider = Provider;
exports.walkInData = walkInData;
