"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),c=require("vue-router"),o=new WeakMap,l=(e,t)=>{var n;const a=(n=r.getCurrentInstance())==null?void 0:n.proxy;if(a==null)throw new Error("provideLocal must be called in setup");o.has(a)||o.set(a,Object.create(null));const s=o.get(a);s[e]=t,r.provide(e,t)};typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const p=Symbol("RESOURCE_CONTEXT"),u=e=>l(p,e),m=r.defineComponent({name:"FsResource",__name:"Resource",props:{name:{}},setup(e){return u({name:e.name}),(n,a)=>(r.openBlock(),r.createBlock(r.unref(c.RouterView)))}}),i=e=>{const t=[];return e.listView&&t.push({path:"",name:`${e.name}-list`,component:e.listView}),e.editView&&t.push({path:"edit/:id",name:`${e.name}-edit`,component:e.editView}),e.createView&&t.push({path:"create",name:`${e.name}-create`,component:e.createView}),e.detailView&&t.push({path:"detail/:id",name:`${e.name}-detail`,component:e.detailView}),[{path:`/${e.name}`,name:e.name,component:m,props:{name:e.name},children:[...t,...e.otherViews||[]]}]},d=e=>{const t=i(e),n={list:`/${e.name}`,edit:a=>`/${e.name}/edit/${a}`,create:`/${e.name}/create`,detail:a=>`/${e.name}/detail/${a}`,basePath:`/${e.name}`};return{name:e.name,routes:t,routePath:n}};exports.createResourceFactory=d;
//# sourceMappingURL=factory.js.map
