const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
require("./types/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
//#region src/components/walletList/model.tsx
const initialState = {
	list: [],
	balance: null,
	loading: false,
	error: null,
	authError: false,
	hasAttempted: false
};
const Context = (0, react.createContext)({
	state: initialState,
	dispatch: () => null
});
const Provider = (Component) => {
	return function ProviderWrapper(props) {
		const [state, dispatch] = (0, react.useReducer)(reducer, initialState);
		return /* @__PURE__ */ react.default.createElement(Context.Provider, { value: {
			state,
			dispatch
		} }, /* @__PURE__ */ react.default.createElement(Component, props));
	};
};
function reducer(state, action) {
	switch (action.type) {
		case "setState": return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), action.payload);
		default: return state;
	}
}
//#endregion
exports.Context = Context;
exports.Provider = Provider;
