create-keystone-app 5.0.1 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/create-keystone-app.cjs.dev.js +4 -8
  2. package/dist/create-keystone-app.cjs.prod.js +4 -8
  3. package/package.json +2 -2
  4. package/starter/.keystone/admin/.next/build-manifest.json +17 -79
  5. package/starter/.keystone/admin/.next/cache/webpack/client-development/0.pack +0 -0
  6. package/starter/.keystone/admin/.next/cache/webpack/client-development/index.pack +0 -0
  7. package/starter/.keystone/admin/.next/cache/webpack/server-development/0.pack +0 -0
  8. package/starter/.keystone/admin/.next/cache/webpack/server-development/index.pack +0 -0
  9. package/starter/.keystone/admin/.next/server/middleware-manifest.json +6 -0
  10. package/starter/.keystone/admin/.next/server/pages/_app.js +978 -361
  11. package/starter/.keystone/admin/.next/server/pages/_document.js +73 -1073
  12. package/starter/.keystone/admin/.next/server/pages/_error.js +24 -104
  13. package/starter/.keystone/admin/.next/server/pages/api/__keystone_api_build.js +82 -235
  14. package/starter/.keystone/admin/.next/server/pages-manifest.json +1 -12
  15. package/starter/.keystone/admin/.next/server/webpack-api-runtime.js +168 -0
  16. package/starter/.keystone/admin/.next/server/webpack-runtime.js +12 -4
  17. package/starter/.keystone/admin/.next/static/chunks/amp.js +366 -0
  18. package/starter/.keystone/admin/.next/static/chunks/main.js +1251 -0
  19. package/starter/.keystone/admin/.next/static/chunks/pages/_app.js +10481 -0
  20. package/starter/.keystone/admin/.next/static/chunks/pages/_error.js +28 -0
  21. package/starter/.keystone/admin/.next/static/chunks/{polyfills-a40ef1678bae11e696dba45124eadd70.js → polyfills.js} +0 -0
  22. package/starter/.keystone/admin/.next/static/chunks/react-refresh.js +62 -0
  23. package/starter/.keystone/admin/.next/static/chunks/webpack.js +1202 -0
  24. package/starter/.keystone/admin/.next/static/development/_buildManifest.js +1 -0
  25. package/starter/.keystone/admin/.next/static/development/_middlewareManifest.js +1 -0
  26. package/starter/.keystone/admin/.next/static/development/_ssgManifest.js +1 -0
  27. package/starter/.keystone/admin/.next/trace +26 -22
  28. package/starter/.keystone/admin/pages/_app.js +11 -179
  29. package/starter/.keystone/admin/pages/api/__keystone_api_build.js +3 -4
  30. package/starter/.keystone/admin/pages/init.js +2 -6
  31. package/starter/.keystone/admin/pages/no-access.js +1 -1
  32. package/starter/.keystone/admin/pages/posts/[id].js +1 -1
  33. package/starter/.keystone/admin/pages/posts/index.js +1 -1
  34. package/starter/.keystone/admin/pages/signin.js +2 -8
  35. package/starter/.keystone/admin/pages/tags/[id].js +1 -1
  36. package/starter/.keystone/admin/pages/tags/index.js +1 -1
  37. package/starter/.keystone/admin/pages/users/[id].js +1 -1
  38. package/starter/.keystone/admin/pages/users/index.js +1 -1
  39. package/starter/.keystone/admin/tsconfig.json +2 -1
  40. package/starter/CHANGELOG.md +22 -0
  41. package/starter/auth.ts +2 -2
  42. package/starter/keystone.db +0 -0
  43. package/starter/keystone.ts +1 -1
  44. package/starter/package.json +12 -9
  45. package/starter/schema.graphql +51 -51
  46. package/starter/schema.prisma +4 -5
  47. package/starter/schema.ts +10 -4
  48. package/CHANGELOG.md +0 -157
  49. package/starter/.keystone/admin/.next/BUILD_ID +0 -1
  50. package/starter/.keystone/admin/.next/cache/webpack/client-production/0.pack +0 -0
  51. package/starter/.keystone/admin/.next/cache/webpack/client-production/index.pack +0 -0
  52. package/starter/.keystone/admin/.next/cache/webpack/server-production/0.pack +0 -0
  53. package/starter/.keystone/admin/.next/cache/webpack/server-production/index.pack +0 -0
  54. package/starter/.keystone/admin/.next/export-marker.json +0 -1
  55. package/starter/.keystone/admin/.next/images-manifest.json +0 -1
  56. package/starter/.keystone/admin/.next/prerender-manifest.json +0 -1
  57. package/starter/.keystone/admin/.next/required-server-files.json +0 -1
  58. package/starter/.keystone/admin/.next/routes-manifest.json +0 -1
  59. package/starter/.keystone/admin/.next/server/chunks/240.js +0 -14009
  60. package/starter/.keystone/admin/.next/server/font-manifest.json +0 -1
  61. package/starter/.keystone/admin/.next/server/pages/404.html +0 -1
  62. package/starter/.keystone/admin/.next/server/pages/500.html +0 -1
  63. package/starter/.keystone/admin/.next/server/pages/index.html +0 -1
  64. package/starter/.keystone/admin/.next/server/pages/init.html +0 -1
  65. package/starter/.keystone/admin/.next/server/pages/no-access.html +0 -1
  66. package/starter/.keystone/admin/.next/server/pages/posts/[id].html +0 -1
  67. package/starter/.keystone/admin/.next/server/pages/posts.html +0 -1
  68. package/starter/.keystone/admin/.next/server/pages/signin.html +0 -1
  69. package/starter/.keystone/admin/.next/server/pages/tags/[id].html +0 -1
  70. package/starter/.keystone/admin/.next/server/pages/tags.html +0 -1
  71. package/starter/.keystone/admin/.next/server/pages/users/[id].html +0 -1
  72. package/starter/.keystone/admin/.next/server/pages/users.html +0 -1
  73. package/starter/.keystone/admin/.next/static/chunks/845-5539e5cef7ad50cce2e3.js +0 -29
  74. package/starter/.keystone/admin/.next/static/chunks/882-9860297ca4605e1a1a0a.js +0 -35
  75. package/starter/.keystone/admin/.next/static/chunks/framework-f9027f68f44ebbf3e174.js +0 -1
  76. package/starter/.keystone/admin/.next/static/chunks/main-76a462729396bcfabf1b.js +0 -1
  77. package/starter/.keystone/admin/.next/static/chunks/pages/_app-d509355e2565bcb71899.js +0 -256
  78. package/starter/.keystone/admin/.next/static/chunks/pages/_error-e474cef4d019fc6ee7d4.js +0 -1
  79. package/starter/.keystone/admin/.next/static/chunks/pages/index-298e0c9b59ac630228e4.js +0 -17
  80. package/starter/.keystone/admin/.next/static/chunks/pages/init-94d4b032c41cc3c12e0d.js +0 -9
  81. package/starter/.keystone/admin/.next/static/chunks/pages/no-access-13f9226067042a423dc6.js +0 -1
  82. package/starter/.keystone/admin/.next/static/chunks/pages/posts/[id]-f45c7c270de5326d8339.js +0 -1
  83. package/starter/.keystone/admin/.next/static/chunks/pages/posts-bd996323004b12ae185b.js +0 -1
  84. package/starter/.keystone/admin/.next/static/chunks/pages/signin-b7a27af2c1cca197a4e5.js +0 -14
  85. package/starter/.keystone/admin/.next/static/chunks/pages/tags/[id]-ff349a8664f7df16d190.js +0 -1
  86. package/starter/.keystone/admin/.next/static/chunks/pages/tags-e255b296f4cb3c74438b.js +0 -1
  87. package/starter/.keystone/admin/.next/static/chunks/pages/users/[id]-072af9943b94b1a26491.js +0 -1
  88. package/starter/.keystone/admin/.next/static/chunks/pages/users-2c04aa80b5a8479e8638.js +0 -1
  89. package/starter/.keystone/admin/.next/static/chunks/webpack-613fd858cdb9cf2af3be.js +0 -1
  90. package/starter/.keystone/admin/.next/static/vMUSAlVTH8qaayrNeoQKH/_buildManifest.js +0 -1
  91. package/starter/.keystone/admin/.next/static/vMUSAlVTH8qaayrNeoQKH/_ssgManifest.js +0 -1
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{8549:function(n,_,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return u(9688)}])}},function(n){n.O(0,[774,888,179],(function(){return _=8549,n(n.s=_);var _}));var _=n.O();_N_E=_}]);
@@ -1,17 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{8590:function(t,e,r){"use strict";r.d(e,{H:function(){return $},P:function(){return z}});var n=r(4390),o=r(1862),i=r(1902),a=r(2172),s=r(6653),l=r(3563),c=r(1125),d=r(6656),g=r(6054),u=r(2516),p=r(488),m=r(2836),h=r(3537);const f=()=>{var t;const{spacing:e}=(0,o.Fg)(),{adminConfig:r}=(0,u.jf)();return null!==(t=r.components)&&void 0!==t&&t.Logo?(0,o.tZ)(r.components.Logo,null):(0,o.tZ)(o.H3,null,(0,o.tZ)(h.default,{href:"/",passHref:!0},(0,o.tZ)("a",{css:{backgroundImage:"linear-gradient(to right, #0ea5e9, #6366f1)",backgroundClip:"text",lineHeight:"1.75rem",color:"transparent",verticalAlign:"middle",transition:"color 0.3s ease",textDecoration:"none"}},(0,o.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 220 220",css:{display:"inline-block",width:"2rem",height:"2rem",margin:`0 ${e.medium}px ${e.xsmall}px 0`,verticalAlign:"middle"}},(0,o.tZ)("defs",null,(0,o.tZ)("linearGradient",{id:"logo-a",x1:"0%",x2:"50%",y1:"0%",y2:"71.9%"},(0,o.tZ)("stop",{offset:"0%",stopColor:"#5AE8FA"}),(0,o.tZ)("stop",{offset:"100%",stopColor:"#2684FF"}))),(0,o.tZ)("path",{fill:"url(#logo-a)",fillRule:"evenodd",d:"M290.1 47h117.5c17.8 0 24.3 1.9 30.8 5.3a36.3 36.3 0 0115.1 15.2c3.5 6.5 5.4 13 5.4 30.8v117.4c0 17.9-1.9 24.3-5.4 30.8a36.3 36.3 0 01-15.1 15.2c-6.5 3.4-13 5.3-30.8 5.3H290c-17.8 0-24.3-1.9-30.8-5.3a36.3 36.3 0 01-15.1-15.2c-3.5-6.5-5.3-13-5.3-30.8V98.3c0-17.9 1.8-24.3 5.3-30.8a36.3 36.3 0 0115.1-15.2c6.5-3.4 13-5.3 30.8-5.3zm11.8 56.8V218H327v-36.8l14.4-14.6 34.4 51.4h31.5l-49-69.1 44.7-45.1h-31.3L327 151v-47.3H302z",transform:"translate(-238.9 -47)"})),"Keystone 6")))},Z=["children"],b=({href:t,children:e,isSelected:r})=>{const{colors:n,palette:i,spacing:a,radii:l,typography:c}=(0,o.Fg)(),d=(0,s.useRouter)(),g=void 0!==r?r:d.pathname===t;return(0,o.tZ)("li",null,(0,o.tZ)(p.rU,{"aria-current":!!g&&"location",href:t,css:{background:"transparent",borderBottomRightRadius:l.xsmall,borderTopRightRadius:l.xsmall,color:i.neutral700,display:"block",fontWeight:c.fontWeight.medium,marginBottom:a.xsmall,marginRight:a.xlarge,padding:`${a.small}px ${a.xlarge}px`,position:"relative",textDecoration:"none",":hover":{background:n.backgroundHover,color:n.linkHoverColor},"&[aria-current=location]":{background:i.neutral200,color:i.neutral900}}},e))},v=({item:t})=>{const{apiPath:e}=(0,u.jf)(),{spacing:r,typography:i}=(0,o.Fg)();return(0,o.tZ)("div",{css:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between",margin:r.xlarge,marginBottom:0}},t&&"authenticated"===t.state?(0,o.tZ)("div",{css:{fontSize:i.fontSize.small}},"Signed in as ",(0,o.tZ)("strong",null,t.label)):(0,o.tZ)("div",{css:{fontSize:i.fontSize.small}},"GraphQL Playground and Docs"),(0,o.tZ)(c.J2,{placement:"bottom",triggerRenderer:({triggerProps:t})=>(0,o.tZ)(l.zx,(0,n.Z)({size:"small",style:{padding:0,width:36},"aria-label":"Links and signout"},t),(0,o.tZ)(d.x,null))},(0,o.tZ)(o.Kq,{gap:"medium",padding:"large",dividers:"between"},(0,o.tZ)(x,{target:"_blank",href:e},"API Explorer"),(0,o.tZ)(x,{target:"_blank",href:"https://github.com/keystonejs/keystone"},"GitHub Repository"),(0,o.tZ)(x,{target:"_blank",href:"https://keystonejs.com"},"Keystone Documentation"),t&&"authenticated"===t.state&&(0,o.tZ)(m.S,null))))},x=t=>{let{children:e}=t,r=(0,a.Z)(t,Z);const{typography:i}=(0,o.Fg)();return(0,o.tZ)("a",(0,n.Z)({css:{alignItems:"center",display:"flex",fontSize:i.fontSize.small,textDecoration:"none"}},r),e,(0,o.tZ)(g.X,{size:"small"}))},y=({authenticatedItem:t,children:e})=>{const{spacing:r}=(0,o.Fg)();return(0,o.tZ)("div",{css:{display:"flex",flexDirection:"column",justifyContent:"center",position:"relative"}},(0,o.tZ)(v,{item:t}),(0,o.tZ)("nav",{role:"navigation","aria-label":"Side Navigation",css:{marginTop:r.xlarge}},(0,o.tZ)("ul",{css:{padding:0,margin:0,li:{listStyle:"none"}}},e)))},k=({list:t})=>{const e=(0,s.useRouter)();return(0,o.tZ)(b,{isSelected:e.pathname.split("/")[1]===`/${t.path}`.split("/")[1],href:`/${t.path}`},t.label)},C=({lists:t=[],include:e=[]})=>{const r=e.length>0?t.filter((t=>e.includes(t.key))):t;return(0,o.tZ)(i.Fragment,null,r.map((t=>(0,o.tZ)(k,{key:t.key,list:t}))))},w=()=>{var t;const{adminMeta:{lists:e},adminConfig:r,authenticatedItem:n,visibleLists:i}=(0,u.jf)();if("loading"===i.state)return null;if("error"===i.state)return(0,o.tZ)(o.xv,{as:"span",paddingLeft:"xlarge",css:{color:"red"}},i.error instanceof Error?i.error.message:i.error[0].message);const a=Object.keys(e).map((t=>i.lists.has(t)?e[t]:null)).filter((t=>Boolean(t)));return null!==r&&void 0!==r&&null!==(t=r.components)&&void 0!==t&&t.Navigation?(0,o.tZ)(r.components.Navigation,{authenticatedItem:n,lists:a}):(0,o.tZ)(y,{authenticatedItem:n},(0,o.tZ)(b,{href:"/"},"Dashboard"),(0,o.tZ)(C,{lists:a}))},$=80,R=t=>(0,o.tZ)(i.Fragment,null,(0,o.tZ)("style",null,"body { overflow: hidden; }"),(0,o.tZ)("div",(0,n.Z)({css:{display:"grid",gridTemplateColumns:"minmax(300px, 1fr) 4fr",gridTemplateRows:`${$}px auto`,height:"100vh"}},t))),S=t=>(0,o.tZ)("aside",(0,n.Z)({css:{minWidth:0,overflowY:"auto",WebkitOverflowScrolling:"touch"}},t)),j=t=>{const{colors:e,spacing:r}=(0,o.Fg)();return(0,o.tZ)("main",(0,n.Z)({css:{backgroundColor:e.background,boxSizing:"border-box",minWidth:0,paddingLeft:r.xlarge,paddingRight:r.xlarge,overflowY:"auto",WebkitOverflowScrolling:"touch",position:"relative"}},t))},z=({children:t,header:e})=>{const{colors:r,spacing:n}=(0,o.Fg)();return(0,o.tZ)(R,null,(0,o.tZ)("div",{css:{alignItems:"center",borderBottom:`1px solid ${r.border}`,display:"flex",justifyContent:"space-between",paddingLeft:n.xlarge,paddingRight:n.xlarge}},(0,o.tZ)(f,null)),(0,o.tZ)("header",{css:{alignItems:"center",backgroundColor:r.background,borderBottom:`1px solid ${r.border}`,display:"flex",justifyContent:"space-between",minWidth:0,paddingLeft:n.xlarge,paddingRight:n.xlarge}},e),(0,o.tZ)(S,null,(0,o.tZ)(w,null)),(0,o.tZ)(j,null,t))}},7533:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return v}});var n=r(4390),o=r(1902),i=r(1862),a=r(768),s=r(7445),l=r(1731),c=r(6287),d=(r(1940),r(5500),r(2525)),g=r(8590),u=r(2716),p=r(2271),m=r(2516),h=r(488),f=r(6653);r(6433),r(537),r(6990),r(669),r(3563),r(1125),r(6656),r(6054),r(2836),r(3537),r(2630),r(739),r(7453),r(1839),r(5725),r(938),r(9948),r(6322);const Z=({listKey:t,count:e})=>{const{colors:r,palette:n,radii:c,spacing:g}=(0,i.Fg)(),u=(0,m.sm)(t),[p,Z]=(0,o.useState)(!1),v=(0,f.useRouter)();return(0,i.tZ)("div",{css:{position:"relative"}},(0,i.tZ)(h.rU,{href:`/${u.path}`,css:{backgroundColor:r.background,borderColor:r.border,borderRadius:c.medium,borderWidth:1,display:"inline-block",minWidth:280,padding:g.large,textDecoration:"none",":hover":{borderColor:n.blue400},":hover h3":{textDecoration:"underline"}}},(0,i.tZ)("h3",{css:{margin:`0 0 ${g.small}px 0`}},u.label," "),"success"===e.type?(0,i.tZ)("span",{css:{color:r.foreground,textDecoration:"none"}},e.count," item",1!==e.count?"s":""):"error"===e.type?e.message:"loading"===e.type?(0,i.tZ)(l.xg,{label:`Loading count of ${u.plural}`,size:"small",tone:"passive"}):"No access"),(0,i.tZ)(b,{title:`Create ${u.singular}`,disabled:p,onClick:()=>{Z(!0)}},(0,i.tZ)(a.p,{size:"large"}),(0,i.tZ)(i.TX,null,"Create ",u.singular)),(0,i.tZ)(s.tW,{isOpen:p},(0,i.tZ)(d.C,{listKey:u.key,onCreate:({id:t})=>{v.push(`/${u.path}/${t}`)},onClose:()=>{Z(!1)}})))},b=t=>{const e=(0,i.Fg)();return(0,i.tZ)("button",(0,n.Z)({css:{alignItems:"center",backgroundColor:e.palette.neutral400,border:0,borderRadius:e.radii.xsmall,color:"white",cursor:"pointer",display:"flex",height:32,justifyContent:"center",outline:0,position:"absolute",right:e.spacing.large,top:e.spacing.large,transition:"background-color 80ms linear",width:32,"&:hover, &:focus":{backgroundColor:e.tones.positive.fill[0]}}},t))},v=()=>{const{adminMeta:{lists:t},visibleLists:e}=(0,m.jf)(),r=(0,o.useMemo)((()=>u.Ps`
2
- query {
3
- keystone {
4
- adminMeta {
5
- lists {
6
- key
7
- fields {
8
- path
9
- createView {
10
- fieldMode
11
- }
12
- }
13
- }
14
- }
15
- }
16
- ${Object.entries(t).map((([t,e])=>`${t}: ${e.gqlNames.listQueryCountName}`)).join("\n")}
17
- }`),[t]);let{data:n,error:a}=(0,p.a)(r,{errorPolicy:"all"});const s=(0,c.m)(n,null===a||void 0===a?void 0:a.graphQLErrors);return(0,i.tZ)(g.P,{header:(0,i.tZ)(i.X6,{type:"h3"},"Dashboard")},"loading"===e.state?(0,i.tZ)(i.M5,{css:{height:`calc(100vh - ${g.H}px)`}},(0,i.tZ)(l.xg,{label:"Loading lists",size:"large",tone:"passive"})):(0,i.tZ)(i.gF,{as:"ul",gap:"large",paddingY:"xlarge",css:{paddingLeft:"0px",marginBottom:"0px"}},"error"===e.state?(0,i.tZ)("span",{css:{color:"red"}},e.error instanceof Error?e.error.message:e.error[0].message):Object.keys(t).map((t=>{if(!e.lists.has(t))return null;const r=s.get(t);return(0,i.tZ)(Z,{count:n?r.errors?{type:"error",message:r.errors[0].message}:{type:"success",count:n[t]}:{type:"loading"},key:t,listKey:t})}))))}},5879:function(t,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return r(7533)}])}},function(t){t.O(0,[774,888,179],(function(){return e=5879,t(t.s=e);var e}));var e=t.O();_N_E=e}]);
@@ -1,9 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[464],{3969:function(t,e,r){"use strict";r.d(e,{S:function(){return o}});var n=r(1862);const o=({children:t})=>{const{colors:e,shadow:r}=(0,n.Fg)();return(0,n.tZ)(n.M5,{css:{minWidth:"100vw",minHeight:"100vh",backgroundColor:e.backgroundMuted},rounding:"medium"},(0,n.tZ)(n.xu,{css:{background:e.background,width:600,boxShadow:r.s100},margin:"medium",padding:"xlarge",rounding:"medium"},t))}},8590:function(t,e,r){"use strict";r.d(e,{H:function(){return _},P:function(){return j}});var n=r(4390),o=r(1862),i=r(1902),a=r(2172),s=r(6653),l=r(3563),u=r(1125),c=r(6656),d=r(6054),h=r(2516),f=r(488),p=r(2836),y=r(3537);const g=()=>{var t;const{spacing:e}=(0,o.Fg)(),{adminConfig:r}=(0,h.jf)();return null!==(t=r.components)&&void 0!==t&&t.Logo?(0,o.tZ)(r.components.Logo,null):(0,o.tZ)(o.H3,null,(0,o.tZ)(y.default,{href:"/",passHref:!0},(0,o.tZ)("a",{css:{backgroundImage:"linear-gradient(to right, #0ea5e9, #6366f1)",backgroundClip:"text",lineHeight:"1.75rem",color:"transparent",verticalAlign:"middle",transition:"color 0.3s ease",textDecoration:"none"}},(0,o.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 220 220",css:{display:"inline-block",width:"2rem",height:"2rem",margin:`0 ${e.medium}px ${e.xsmall}px 0`,verticalAlign:"middle"}},(0,o.tZ)("defs",null,(0,o.tZ)("linearGradient",{id:"logo-a",x1:"0%",x2:"50%",y1:"0%",y2:"71.9%"},(0,o.tZ)("stop",{offset:"0%",stopColor:"#5AE8FA"}),(0,o.tZ)("stop",{offset:"100%",stopColor:"#2684FF"}))),(0,o.tZ)("path",{fill:"url(#logo-a)",fillRule:"evenodd",d:"M290.1 47h117.5c17.8 0 24.3 1.9 30.8 5.3a36.3 36.3 0 0115.1 15.2c3.5 6.5 5.4 13 5.4 30.8v117.4c0 17.9-1.9 24.3-5.4 30.8a36.3 36.3 0 01-15.1 15.2c-6.5 3.4-13 5.3-30.8 5.3H290c-17.8 0-24.3-1.9-30.8-5.3a36.3 36.3 0 01-15.1-15.2c-3.5-6.5-5.3-13-5.3-30.8V98.3c0-17.9 1.8-24.3 5.3-30.8a36.3 36.3 0 0115.1-15.2c6.5-3.4 13-5.3 30.8-5.3zm11.8 56.8V218H327v-36.8l14.4-14.6 34.4 51.4h31.5l-49-69.1 44.7-45.1h-31.3L327 151v-47.3H302z",transform:"translate(-238.9 -47)"})),"Keystone 6")))},m=["children"],b=({href:t,children:e,isSelected:r})=>{const{colors:n,palette:i,spacing:a,radii:l,typography:u}=(0,o.Fg)(),c=(0,s.useRouter)(),d=void 0!==r?r:c.pathname===t;return(0,o.tZ)("li",null,(0,o.tZ)(f.rU,{"aria-current":!!d&&"location",href:t,css:{background:"transparent",borderBottomRightRadius:l.xsmall,borderTopRightRadius:l.xsmall,color:i.neutral700,display:"block",fontWeight:u.fontWeight.medium,marginBottom:a.xsmall,marginRight:a.xlarge,padding:`${a.small}px ${a.xlarge}px`,position:"relative",textDecoration:"none",":hover":{background:n.backgroundHover,color:n.linkHoverColor},"&[aria-current=location]":{background:i.neutral200,color:i.neutral900}}},e))},v=({item:t})=>{const{apiPath:e}=(0,h.jf)(),{spacing:r,typography:i}=(0,o.Fg)();return(0,o.tZ)("div",{css:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between",margin:r.xlarge,marginBottom:0}},t&&"authenticated"===t.state?(0,o.tZ)("div",{css:{fontSize:i.fontSize.small}},"Signed in as ",(0,o.tZ)("strong",null,t.label)):(0,o.tZ)("div",{css:{fontSize:i.fontSize.small}},"GraphQL Playground and Docs"),(0,o.tZ)(u.J2,{placement:"bottom",triggerRenderer:({triggerProps:t})=>(0,o.tZ)(l.zx,(0,n.Z)({size:"small",style:{padding:0,width:36},"aria-label":"Links and signout"},t),(0,o.tZ)(c.x,null))},(0,o.tZ)(o.Kq,{gap:"medium",padding:"large",dividers:"between"},(0,o.tZ)(w,{target:"_blank",href:e},"API Explorer"),(0,o.tZ)(w,{target:"_blank",href:"https://github.com/keystonejs/keystone"},"GitHub Repository"),(0,o.tZ)(w,{target:"_blank",href:"https://keystonejs.com"},"Keystone Documentation"),t&&"authenticated"===t.state&&(0,o.tZ)(p.S,null))))},w=t=>{let{children:e}=t,r=(0,a.Z)(t,m);const{typography:i}=(0,o.Fg)();return(0,o.tZ)("a",(0,n.Z)({css:{alignItems:"center",display:"flex",fontSize:i.fontSize.small,textDecoration:"none"}},r),e,(0,o.tZ)(d.X,{size:"small"}))},Z=({authenticatedItem:t,children:e})=>{const{spacing:r}=(0,o.Fg)();return(0,o.tZ)("div",{css:{display:"flex",flexDirection:"column",justifyContent:"center",position:"relative"}},(0,o.tZ)(v,{item:t}),(0,o.tZ)("nav",{role:"navigation","aria-label":"Side Navigation",css:{marginTop:r.xlarge}},(0,o.tZ)("ul",{css:{padding:0,margin:0,li:{listStyle:"none"}}},e)))},x=({list:t})=>{const e=(0,s.useRouter)();return(0,o.tZ)(b,{isSelected:e.pathname.split("/")[1]===`/${t.path}`.split("/")[1],href:`/${t.path}`},t.label)},E=({lists:t=[],include:e=[]})=>{const r=e.length>0?t.filter((t=>e.includes(t.key))):t;return(0,o.tZ)(i.Fragment,null,r.map((t=>(0,o.tZ)(x,{key:t.key,list:t}))))},A=()=>{var t;const{adminMeta:{lists:e},adminConfig:r,authenticatedItem:n,visibleLists:i}=(0,h.jf)();if("loading"===i.state)return null;if("error"===i.state)return(0,o.tZ)(o.xv,{as:"span",paddingLeft:"xlarge",css:{color:"red"}},i.error instanceof Error?i.error.message:i.error[0].message);const a=Object.keys(e).map((t=>i.lists.has(t)?e[t]:null)).filter((t=>Boolean(t)));return null!==r&&void 0!==r&&null!==(t=r.components)&&void 0!==t&&t.Navigation?(0,o.tZ)(r.components.Navigation,{authenticatedItem:n,lists:a}):(0,o.tZ)(Z,{authenticatedItem:n},(0,o.tZ)(b,{href:"/"},"Dashboard"),(0,o.tZ)(E,{lists:a}))},_=80,S=t=>(0,o.tZ)(i.Fragment,null,(0,o.tZ)("style",null,"body { overflow: hidden; }"),(0,o.tZ)("div",(0,n.Z)({css:{display:"grid",gridTemplateColumns:"minmax(300px, 1fr) 4fr",gridTemplateRows:`${_}px auto`,height:"100vh"}},t))),k=t=>(0,o.tZ)("aside",(0,n.Z)({css:{minWidth:0,overflowY:"auto",WebkitOverflowScrolling:"touch"}},t)),T=t=>{const{colors:e,spacing:r}=(0,o.Fg)();return(0,o.tZ)("main",(0,n.Z)({css:{backgroundColor:e.background,boxSizing:"border-box",minWidth:0,paddingLeft:r.xlarge,paddingRight:r.xlarge,overflowY:"auto",WebkitOverflowScrolling:"touch",position:"relative"}},t))},j=({children:t,header:e})=>{const{colors:r,spacing:n}=(0,o.Fg)();return(0,o.tZ)(S,null,(0,o.tZ)("div",{css:{alignItems:"center",borderBottom:`1px solid ${r.border}`,display:"flex",justifyContent:"space-between",paddingLeft:n.xlarge,paddingRight:n.xlarge}},(0,o.tZ)(g,null)),(0,o.tZ)("header",{css:{alignItems:"center",backgroundColor:r.background,borderBottom:`1px solid ${r.border}`,display:"flex",justifyContent:"space-between",minWidth:0,paddingLeft:n.xlarge,paddingRight:n.xlarge}},e),(0,o.tZ)(k,null,(0,o.tZ)(A,null)),(0,o.tZ)(T,null,t))}},7317:function(t,e){var r="undefined"!==typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!==typeof t&&(t=String(t)),t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"===typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=p(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},h.prototype.delete=function(t){delete this.map[u(t)]},h.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},h.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},h.prototype.set=function(t,e){this.map[u(t)]=c(e)},h.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},h.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},h.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},h.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),d(t)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new h(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new h(e.headers)),this.method=function(t){var e=t.toUpperCase();return b.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function Z(t){var e=new h;return t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}})),e}function x(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:0,statusText:""});return t.type="error",t};var E=[301,302,303,307,308];x.redirect=function(t,e){if(-1===E.indexOf(e))throw new RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(_){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function A(t,r){return new Promise((function(n,i){var a=new v(t,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var t={status:s.status,statusText:s.statusText,headers:Z(s.getAllResponseHeaders()||"")};t.url="responseURL"in s?s.responseURL:t.headers.get("X-Request-URL");var e="response"in s?s.response:s.responseText;n(new x(e,t))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}A.polyfill=!0,t.fetch||(t.fetch=A,t.Headers=h,t.Request=v,t.Response=x),e.Headers=h,e.Request=v,e.Response=x,e.fetch=A,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e},9877:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return B}});var n=r(1902),o=r(7317),i=r.n(o),a=r(1862),s=r(3563),l=r(5514),u=r(2516),c=r(5500),d=r.n(c),h=r(6629),f=r(2716),p=r(488),y=(r(4683),r(1863),r(485),r(8590),r(2525),r(6990)),g=(r(6653),r(3537),r(3370),r(1125),r(6656),r(6054),r(6433),r(1731),r(7445),r(2630),r(739),r(7453),r(1839),r(5725),r(938),r(9948),r(6322),r(2836),r(537)),m=(r(669),r(1940),r(5552)),b=r(4390),v=r(2172),w=r(3969);const Z=["email","username"],x=["children"],E=["as"],A=t=>{let{children:e}=t,r=(0,v.Z)(t,x);return(0,a.tZ)("a",(0,b.Z)({css:{color:"#6C798F",display:"flex",alignItems:"center",justifyContent:"center",height:24,width:24,":hover,:focus":{color:"#253858"},svg:{width:"100%"}}},r),e)},_=t=>(0,a.tZ)(A,t,(0,a.tZ)("svg",{viewBox:"0 0 24 20",xmlns:"http://www.w3.org/2000/svg"},(0,a.tZ)("path",{d:"M7.548 20c9.056 0 14.01-7.695 14.01-14.368 0-.219 0-.437-.015-.653.964-.715 1.796-1.6 2.457-2.614a9.638 9.638 0 0 1-2.828.794A5.047 5.047 0 0 0 23.337.366a9.72 9.72 0 0 1-3.127 1.226C18.684-.072 16.258-.48 14.294.598c-1.964 1.078-2.98 3.374-2.475 5.6C7.859 5.994 4.17 4.076 1.67.922.363 3.229 1.031 6.18 3.195 7.662A4.795 4.795 0 0 1 .96 7.032v.064c0 2.403 1.653 4.474 3.95 4.95a4.797 4.797 0 0 1-2.223.087c.645 2.057 2.494 3.466 4.6 3.506A9.725 9.725 0 0 1 0 17.732a13.688 13.688 0 0 0 7.548 2.264",fill:"currentColor",fillRule:"nonzero"})),(0,a.tZ)(k,null,"Hear about KeystoneJS on Twitter")),S=t=>(0,a.tZ)(A,t,(0,a.tZ)("svg",{viewBox:"0 0 16 16",version:"1.1","aria-hidden":"true"},(0,a.tZ)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"})),(0,a.tZ)(k,null,"KeystoneJS repository on GitHub")),k=(0,a.yV)(((t,e)=>{let{as:r="span"}=t,n=(0,v.Z)(t,E);return(0,a.tZ)(r,(0,b.Z)({ref:e,css:{border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1}},n))})),T=({value:t})=>{const[e,r]=(0,n.useState)(!1),[o,u]=(0,n.useState)((t=>{for(const e of Z)if(t[e]&&"string"===typeof t[e].value)return t[e].value})(t)),[c,d]=(0,n.useState)(null),[h,f]=(0,n.useState)(!1),y=(0,p.tv)();return(0,a.tZ)(a.Kq,{gap:"large"},(0,a.tZ)(a.Kq,{gap:"small",align:"center",across:!0,css:{width:"100%",justifyContent:"space-between"}},(0,a.tZ)(a.H1,null,"Welcome"),(0,a.tZ)(a.Kq,{across:!0,gap:"small"},(0,a.tZ)(_,{title:"Twitter Logo"}),(0,a.tZ)(S,{href:"https://github.com/keystonejs/keystone",target:"_blank",title:"Github"}))),(0,a.tZ)("p",{css:{margin:0}},"Thanks for installing KeystoneJS. While you're getting started, check out the docs at"," ",(0,a.tZ)("a",{href:"https://keystonejs.com"},"keystonejs.com")),(0,a.tZ)("div",null,"If you'd like to stay up to date with the exciting things we have planned, join our mailing list (just useful announcements, no spam!)"),(0,a.tZ)("div",null,(0,a.tZ)(l.XZ,{checked:e,onChange:()=>{d(null),r(!e)}},"sign up to our mailing list")),(0,a.tZ)("form",{onSubmit:r=>(r.preventDefault(),d(null),e?(f(!0),(t=>/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t))(o)?i()("https://signup.keystonejs.cloud/api/newsletter-signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t.username,email:o,source:"@keystone-next/auth InitPage"})}).then((t=>{200!==t.status?t.json().then((({error:t})=>{d(t),f(!1)})):y.push(y.query.from||"/")})).catch((t=>{d(t.toString()),f(!1)})):(f(!1),void d("Email is invalid"))):y.push(y.query.from||"/"))},(0,a.tZ)(a.TX,{as:"label",htmlFor:"email-field"},"Email Address"),(0,a.tZ)(l.oi,{id:"email-field",disabled:!e,autoFocus:!0,placeholder:"Email",value:o,onChange:t=>u(t.target.value)}),(0,a.tZ)("p",{css:{color:"red"}},c),(0,a.tZ)(a.gF,{gap:"medium",align:"center"},(0,a.tZ)(s.zx,{isLoading:h,type:"submit",weight:"bold",tone:"active"},c?"Try again":"Continue"),c&&(0,a.tZ)(s.zx,{as:p.rU,href:"/",tone:"active"},"Continue"))))},j=({fieldPaths:t,listKey:e,enableWelcome:r})=>{var o;const{adminMeta:i}=(0,u.jf)(),l=(0,n.useMemo)((()=>{const r={};return t.forEach((t=>{r[t]=i.lists[e].fields[t]})),r}),[t,i.lists,e]),[c,b]=(0,n.useState)((()=>{let t={};return Object.keys(l).forEach((e=>{t[e]={kind:"value",value:l[e].controller.defaultValue}})),t})),v=(0,m.a)(l,c),[Z,x]=(0,n.useState)(!1),[E,A]=(0,n.useState)("init"),[_,{loading:S,error:k,data:j}]=(0,h.D)(f.Ps`mutation($data: CreateInitial${e}Input!) {
2
- authenticate: createInitial${e}(data: $data) {
3
- ... on ${e}AuthenticationWithPasswordSuccess {
4
- item {
5
- id
6
- }
7
- }
8
- }
9
- }`),O=(0,u.Mz)(),B=(0,p.tv)(),C=(0,u.gS)();return(0,n.useEffect)((()=>{"authenticated"===C.authenticatedItem.state&&(r?A("welcome"):B.push(B.query.from||"/"))}),[C.authenticatedItem,r,B]),"init"===E?(0,a.tZ)(w.S,null,(0,a.tZ)(a.H1,null,"Welcome to KeystoneJS"),(0,a.tZ)("p",null,"Create your first user to get started"),(0,a.tZ)("form",{onSubmit:t=>{t.preventDefault();const e=0!==v.size;if(x(e),e)return;const r={},n=(0,m.s)(l,c);Object.keys(n).forEach((t=>{const{controller:e}=l[t],o=n[t];d()(o,e.serialize(e.defaultValue))||Object.assign(r,o)})),_({variables:{data:r}}).then((()=>{O()})).catch((()=>{}))}},(0,a.tZ)(a.Kq,{gap:"large"},k&&(0,a.tZ)(y.G,{errors:null===k||void 0===k?void 0:k.graphQLErrors,networkError:null===k||void 0===k?void 0:k.networkError}),(0,a.tZ)(g.F,{fields:l,fieldModes:null,forceValidation:Z,invalidFields:v,onChange:b,value:c}),(0,a.tZ)(s.zx,{isLoading:S||(null===j||void 0===j||null===(o=j.authenticate)||void 0===o?void 0:o.__typename)===`${e}AuthenticationWithPasswordSuccess`,type:"submit",weight:"bold",tone:"active"},"Get started")))):(0,a.tZ)(w.S,null,(0,a.tZ)(T,{value:c}))};var O,B=(O={listKey:"User",fieldPaths:["name","email","password"],enableWelcome:!0},()=>(0,a.tZ)(j,O))},6686:function(t,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/init",function(){return r(9877)}])}},function(t){t.O(0,[774,888,179],(function(){return e=6686,t(t.s=e);var e}));var e=t.O();_N_E=e}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[568],{2234:function(n,t,e){"use strict";e.r(t),e.d(t,{default:function(){return o}});var s=e(1862),u=e(3370),a=e(2836),i=e(485);e(3563),e(1902);const l=({sessionsEnabled:n})=>(0,s.tZ)(i.a,null,(0,s.tZ)(s.Kq,{align:"center",gap:"medium"},(0,s.tZ)(u.l,{size:"large"}),(0,s.tZ)("div",null,"You don't have access to this page."),n?(0,s.tZ)(a.S,null):null));var c,o=(c={sessionsEnabled:!0},()=>(0,s.tZ)(l,c))},2869:function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/no-access",function(){return e(2234)}])}},function(n){n.O(0,[774,888,179],(function(){return t=2869,n(n.s=t);var t}));var t=n.O();_N_E=t}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[646],{257:function(n,t,u){"use strict";u.r(t);var _=u(5845);t.default=(0,_.p)({listKey:"Post"})},6389:function(n,t,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/posts/[id]",function(){return u(257)}])}},function(n){n.O(0,[845,774,888,179],(function(){return t=6389,n(n.s=t);var t}));var t=n.O();_N_E=t}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[679],{4330:function(n,t,u){"use strict";u.r(t);var _=u(3882);t.default=(0,_.d)({listKey:"Post"})},2798:function(n,t,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/posts",function(){return u(4330)}])}},function(n){n.O(0,[882,774,888,179],(function(){return t=2798,n(n.s=t);var t}));var t=n.O();_N_E=t}]);
@@ -1,14 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[176],{3969:function(t,e,n){"use strict";n.d(e,{S:function(){return a}});var i=n(1862);const a=({children:t})=>{const{colors:e,shadow:n}=(0,i.Fg)();return(0,i.tZ)(i.M5,{css:{minWidth:"100vw",minHeight:"100vh",backgroundColor:e.backgroundMuted},rounding:"medium"},(0,i.tZ)(i.xu,{css:{background:e.background,width:600,boxShadow:n.s100},margin:"medium",padding:"xlarge",rounding:"medium"},t))}},6411:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return p}});var i=n(2165),a=n(1902),r=n(1862),s=n(3563),o=n(5514),u=n(669),d=n(2716),c=n(6629),l=n(2516),m=n(488),g=n(3969);const h=({identityField:t,secretField:e,mutationName:n,successTypename:h,failureTypename:v})=>{var p,f;const y=d.Ps`
2
- mutation($identity: String!, $secret: String!) {
3
- authenticate: ${n}(${t}: $identity, ${e}: $secret) {
4
- ... on ${h} {
5
- item {
6
- id
7
- }
8
- }
9
- ... on ${v} {
10
- message
11
- }
12
- }
13
- }
14
- `,[w,Z]=(0,a.useState)("signin"),[_,b]=(0,a.useState)({identity:"",secret:""}),S=(0,a.useRef)(null);(0,a.useEffect)((()=>{var t;null===(t=S.current)||void 0===t||t.focus()}),[w]);const[k,{error:E,loading:F,data:$}]=(0,c.D)(y),q=(0,l.Mz)(),T=(0,m.tv)(),x=(0,l.gS)();return(0,a.useEffect)((()=>{"authenticated"===x.authenticatedItem.state&&T.push(T.query.from||"/")}),[x.authenticatedItem,T]),(0,r.tZ)(g.S,null,(0,r.tZ)(r.Kq,{gap:"xlarge",as:"form",onSubmit:async t=>{if(t.preventDefault(),"signin"===w){try{var e;if((null===(e=(await k({variables:{identity:_.identity,secret:_.secret}})).data.authenticate)||void 0===e?void 0:e.__typename)!==h)return}catch(n){return}q(),T.push(T.query.from||"/")}}},(0,r.tZ)(r.H1,null,"Sign In"),E&&(0,r.tZ)(u.qX,{title:"Error",tone:"negative"},E.message),(null===$||void 0===$||null===(p=$.authenticate)||void 0===p?void 0:p.__typename)===v&&(0,r.tZ)(u.qX,{title:"Error",tone:"negative"},null===$||void 0===$?void 0:$.authenticate.message),(0,r.tZ)(r.Kq,{gap:"medium"},(0,r.tZ)(r.TX,{as:"label",htmlFor:"identity"},t),(0,r.tZ)(o.oi,{id:"identity",name:"identity",value:_.identity,onChange:t=>b((0,i.Z)((0,i.Z)({},_),{},{identity:t.target.value})),placeholder:t,ref:S}),"signin"===w&&(0,r.tZ)(a.Fragment,null,(0,r.tZ)(r.TX,{as:"label",htmlFor:"password"},e),(0,r.tZ)(o.oi,{id:"password",name:"password",value:_.secret,onChange:t=>b((0,i.Z)((0,i.Z)({},_),{},{secret:t.target.value})),placeholder:e,type:"password"}))),"forgot password"===w?(0,r.tZ)(r.Kq,{gap:"medium",across:!0},(0,r.tZ)(s.zx,{type:"submit",weight:"bold",tone:"active"},"Log reset link"),(0,r.tZ)(s.zx,{weight:"none",tone:"active",onClick:()=>Z("signin")},"Go back")):(0,r.tZ)(r.Kq,{gap:"medium",across:!0},(0,r.tZ)(s.zx,{weight:"bold",tone:"active",isLoading:F||(null===$||void 0===$||null===(f=$.authenticate)||void 0===f?void 0:f.__typename)===h,type:"submit"},"Sign In"))))};var v,p=(v={identityField:"email",secretField:"password",mutationName:"authenticateUserWithPassword",successTypename:"UserAuthenticationWithPasswordSuccess",failureTypename:"UserAuthenticationWithPasswordFailure"},()=>(0,r.tZ)(h,v))},5138:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/signin",function(){return n(6411)}])}},function(t){t.O(0,[774,888,179],(function(){return e=5138,t(t.s=e);var e}));var e=t.O();_N_E=e}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[476],{2322:function(n,u,t){"use strict";t.r(u);var _=t(5845);u.default=(0,_.p)({listKey:"Tag"})},7162:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tags/[id]",function(){return t(2322)}])}},function(n){n.O(0,[845,774,888,179],(function(){return u=7162,n(n.s=u);var u}));var u=n.O();_N_E=u}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{1750:function(n,u,t){"use strict";t.r(u);var _=t(3882);u.default=(0,_.d)({listKey:"Tag"})},1525:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tags",function(){return t(1750)}])}},function(n){n.O(0,[882,774,888,179],(function(){return u=1525,n(n.s=u);var u}));var u=n.O();_N_E=u}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[108],{6787:function(n,u,_){"use strict";_.r(u);var e=_(5845);u.default=(0,e.p)({listKey:"User"})},5460:function(n,u,_){(window.__NEXT_P=window.__NEXT_P||[]).push(["/users/[id]",function(){return _(6787)}])}},function(n){n.O(0,[845,774,888,179],(function(){return u=5460,n(n.s=u);var u}));var u=n.O();_N_E=u}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[892],{8926:function(n,u,_){"use strict";_.r(u);var e=_(3882);u.default=(0,e.d)({listKey:"User"})},3931:function(n,u,_){(window.__NEXT_P=window.__NEXT_P||[]).push(["/users",function(){return _(8926)}])}},function(n){n.O(0,[882,774,888,179],(function(){return u=3931,n(n.s=u);var u}));var u=n.O();_N_E=u}]);
@@ -1 +0,0 @@
1
- !function(){"use strict";var n={},e={};function r(t){var o=e[t];if(void 0!==o)return o.exports;var i=e[t]={id:t,loaded:!1,exports:{}},u=!0;try{n[t].call(i.exports,i,i.exports,r),u=!1}finally{u&&delete e[t]}return i.loaded=!0,i.exports}r.m=n,function(){var n=[];r.O=function(e,t,o,i){if(!t){var u=1/0;for(a=0;a<n.length;a++){t=n[a][0],o=n[a][1],i=n[a][2];for(var f=!0,c=0;c<t.length;c++)(!1&i||u>=i)&&Object.keys(r.O).every((function(n){return r.O[n](t[c])}))?t.splice(c--,1):(f=!1,i<u&&(u=i));if(f){n.splice(a--,1);var l=o();void 0!==l&&(e=l)}}return e}i=i||0;for(var a=n.length;a>0&&n[a-1][2]>i;a--)n[a]=n[a-1];n[a]=[t,o,i]}}(),r.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(e,{a:e}),e},r.d=function(n,e){for(var t in e)r.o(e,t)&&!r.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"===typeof window)return window}}(),r.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},r.r=function(n){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},r.p="/_next/",function(){var n={272:0};r.O.j=function(e){return 0===n[e]};var e=function(e,t){var o,i,u=t[0],f=t[1],c=t[2],l=0;if(u.some((function(e){return 0!==n[e]}))){for(o in f)r.o(f,o)&&(r.m[o]=f[o]);if(c)var a=c(r)}for(e&&e(t);l<u.length;l++)i=u[l],r.o(n,i)&&n[i]&&n[i][0](),n[u[l]]=0;return r.O(a)},t=self.webpackChunk_N_E=self.webpackChunk_N_E||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))}()}();
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,a){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/chunks/pages/index-298e0c9b59ac630228e4.js"],"/_error":["static/chunks/pages/_error-e474cef4d019fc6ee7d4.js"],"/init":["static/chunks/pages/init-94d4b032c41cc3c12e0d.js"],"/no-access":["static/chunks/pages/no-access-13f9226067042a423dc6.js"],"/posts":[s,"static/chunks/pages/posts-bd996323004b12ae185b.js"],"/posts/[id]":[a,"static/chunks/pages/posts/[id]-f45c7c270de5326d8339.js"],"/signin":["static/chunks/pages/signin-b7a27af2c1cca197a4e5.js"],"/tags":[s,"static/chunks/pages/tags-e255b296f4cb3c74438b.js"],"/tags/[id]":[a,"static/chunks/pages/tags/[id]-ff349a8664f7df16d190.js"],"/users":[s,"static/chunks/pages/users-2c04aa80b5a8479e8638.js"],"/users/[id]":[a,"static/chunks/pages/users/[id]-072af9943b94b1a26491.js"],sortedPages:["/","/_app","/_error","/init","/no-access","/posts","/posts/[id]","/signin","/tags","/tags/[id]","/users","/users/[id]"]}}("static/chunks/882-9860297ca4605e1a1a0a.js","static/chunks/845-5539e5cef7ad50cce2e3.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -1 +0,0 @@
1
- self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB();