"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: ()=>demo1_rslib_entry_
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
require("react");
const client_namespaceObject = require("@tachybase/client");
const external_react_router_dom_namespaceObject = require("react-router-dom");
const Root = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
                to: '/',
                children: "Home"
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
                to: '/hello',
                children: "Hello"
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
                to: '/team',
                children: "Team"
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
                to: '/about',
                children: "About"
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Outlet, {})
        ]
    });
const Home = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
        children: "this is Home"
    });
const Team = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        children: [
            "Team ",
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
                to: '/about',
                children: "About"
            })
        ]
    });
const About = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_router_dom_namespaceObject.Link, {
                to: '/team',
                children: "Team"
            }),
            " About"
        ]
    });
class Test1Plugin extends client_namespaceObject.Plugin {
    async load() {
        this.router.add('root.team', {
            path: 'team',
            Component: 'Team'
        });
    }
}
class Test2Plugin extends client_namespaceObject.Plugin {
    async load() {
        this.router.add('root.about', {
            path: 'about',
            Component: 'About'
        });
    }
}
class TachybasePresetPlugin extends client_namespaceObject.Plugin {
    async afterAdd() {
        await this.addRemotePlugin();
    }
    async addRemotePlugin() {
        await this.pm.add(Test1Plugin);
        await this.pm.add(Test2Plugin);
    }
    async load() {
        this.router.add('root', {
            path: '/',
            Component: 'Root'
        });
        this.router.add('root.home', {
            path: '/',
            Component: 'Home'
        });
    }
}
const app = new client_namespaceObject.Application({
    apiClient: {
        baseURL: process.env.API_BASE_URL
    },
    router: {
        type: 'hash'
    },
    plugins: [
        TachybasePresetPlugin
    ],
    components: {
        Root,
        Home,
        Team,
        About
    }
});
const HelloProvider = (props)=>{
    const location = (0, external_react_router_dom_namespaceObject.useLocation)();
    if ('/hello' === location.pathname) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
        children: "Hello"
    });
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
        children: props.children
    });
};
app.use(HelloProvider);
const demo1_rslib_entry_ = app.getRootComponent();
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
});
