@jeromefitz/notion 2.0.0 → 2.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 (49) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +1 -1
  3. package/package.json +1 -1
  4. package/queries/getBlocksByIdChildren/index.cjs +1 -1
  5. package/queries/getBlocksByIdChildren/index.js +1 -1
  6. package/queries/getNotionListing/index.cjs +1 -1
  7. package/queries/getNotionListing/index.js +1 -1
  8. package/queries/getNotionListingByDate/index.cjs +1 -1
  9. package/queries/getNotionListingByDate/index.js +1 -1
  10. package/queries/getNotionSlug/index.cjs +1 -1
  11. package/queries/getNotionSlug/index.js +1 -1
  12. package/queries/getNotionSlugByRoute/index.cjs +1 -1
  13. package/queries/getNotionSlugByRoute/index.js +1 -1
  14. package/queries/getPagesById/index.cjs +1 -1
  15. package/queries/getPagesById/index.js +1 -1
  16. package/queries/getQuery/index.cjs +1 -1
  17. package/queries/getQuery/index.js +1 -1
  18. package/queries/index.cjs +1 -1
  19. package/queries/index.js +1 -1
  20. package/utils/dataNormalized/index.cjs +1 -1
  21. package/utils/dataNormalized/index.js +1 -1
  22. package/utils/dataNormalizedResults/index.cjs +1 -1
  23. package/utils/dataNormalizedResults/index.js +1 -1
  24. package/utils/getTypes/files.cjs +1 -1
  25. package/utils/getTypes/files.js +1 -1
  26. package/utils/getTypes/index.cjs +1 -1
  27. package/utils/getTypes/index.js +1 -1
  28. package/utils/getTypes/relation.cjs +1 -1
  29. package/utils/getTypes/relation.js +1 -1
  30. package/utils/getTypes/rollup.cjs +1 -1
  31. package/utils/getTypes/rollup.js +1 -1
  32. package/utils/index.cjs +1 -1
  33. package/utils/index.d.ts +0 -6
  34. package/utils/index.js +1 -1
  35. package/utils/avoidRateLimit/index.cjs +0 -1
  36. package/utils/avoidRateLimit/index.d.ts +0 -3
  37. package/utils/avoidRateLimit/index.js +0 -1
  38. package/utils/dataSorted/index.cjs +0 -1
  39. package/utils/dataSorted/index.d.ts +0 -5
  40. package/utils/dataSorted/index.js +0 -1
  41. package/utils/isObjectEmpty/index.cjs +0 -1
  42. package/utils/isObjectEmpty/index.d.ts +0 -7
  43. package/utils/isObjectEmpty/index.js +0 -1
  44. package/utils/isUndefined/index.cjs +0 -1
  45. package/utils/isUndefined/index.d.ts +0 -3
  46. package/utils/isUndefined/index.js +0 -1
  47. package/utils/stringToUUID/index.cjs +0 -1
  48. package/utils/stringToUUID/index.d.ts +0 -3
  49. package/utils/stringToUUID/index.js +0 -1
package/index.cjs CHANGED
@@ -1 +1 @@
1
- var Rt=Object.create;var z=Object.defineProperty,Ht=Object.defineProperties,Wt=Object.getOwnPropertyDescriptor,Ft=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols,zt=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Te=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))be.call(t,n)&&Te(e,n,t[n]);if(we)for(var n of we(t))$t.call(t,n)&&Te(e,n,t[n]);return e},k=(e,t)=>Ht(e,Ft(t)),ke=e=>z(e,"__esModule",{value:!0});var jt=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},Ie=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qt(t))!be.call(e,r)&&(n||r!=="default")&&z(e,r,{get:()=>t[r],enumerable:!(l=Wt(t,r))||l.enumerable});return e},p=(e,t)=>Ie(ke(z(e!=null?Rt(zt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Yt=(e=>(t,n)=>e&&e.get(t)||(n=Ie(ke({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var De=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var B=(e,t,n)=>(De(e,t,"read from private field"),n?n.call(e):t.get(e)),Ce=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ve=(e,t,n,l)=>(De(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);var Fo={};jt(Fo,{Client:()=>Vt});var Ut=p(require("@notionhq/client"),1);var N=p(require("lodash/filter.js"),1),xe=p(require("lodash/map.js"),1),L=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Oe=[...G],Ne=[...G,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],Le=[...G,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],Ge=[...G],Be=[...G,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],Ae=[...G,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Ue=[...G],Ve=[...G,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],Me=[...G,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],zo={BLOG:(0,N.default)(Oe,{init:!0}),EPISODES:(0,N.default)(Ne,{init:!0}),EVENTS:(0,N.default)(Le,{init:!0}),PAGES:(0,N.default)(Ge,{init:!0}),PEOPLE:(0,N.default)(Be,{init:!0}),PODCASTS:(0,N.default)(Ae,{init:!0}),SEO:(0,N.default)(Ue,{init:!0}),SHOWS:(0,N.default)(Ve,{init:!0}),VENUES:(0,N.default)(Me,{init:!0})},Re={BLOG:Oe.map(e=>L(e)),EPISODES:Ne.map(e=>L(e)),EVENTS:Le.map(e=>L(e)),PAGES:Ge.map(e=>L(e)),PEOPLE:Be.map(e=>L(e)),PODCASTS:Ae.map(e=>L(e)),SEO:Ue.map(e=>L(e)),SHOWS:Ve.map(e=>L(e)),VENUES:Me.map(e=>L(e))},He=(0,xe.default)(o,e=>L(e)),We=new Date().toISOString(),U={dateBefore:{property:o.datePublished.notion,date:{before:We}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:We}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},qt="LISTING",Zt="LISTING_BY_DATE",Kt="SLUG",Jt="SLUG_BY_ROUTE",Xt=[qt,Zt,Kt,Jt],v=Object.assign({},...Xt.map(e=>({[e]:e})).flat(1));var re=p(require("date-fns/addDays/index.js"),1),Fe=p(require("date-fns/addMonths/index.js"),1),Qe=p(require("date-fns/addYears/index.js"),1),eo=(e,t)=>{switch(t){case"year":return(0,Qe.default)(e,1).toISOString();case"month":return(0,Fe.default)(e,1).toISOString();case"day":return(0,re.default)(e,2).toISOString()}return(0,re.default)(e,-1).toISOString()},C=eo;var to=250;async function oo(){await ro()}function ro(e=to){return new Promise(t=>setTimeout(t,e))}var V=oo;var ze=p(require("lodash/map.js"),1);var no=({config:e,data:t,pathVariables:n,pageId:l})=>{var m,c;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:h,routeType:f}=n;s=f===((m=r==null?void 0:r.PODCASTS)==null?void 0:m.routeType)&&h.length>1?(c=r==null?void 0:r.EPISODES)==null?void 0:c.routeType:f}let y=s?Re[s.toUpperCase()]:He;return(0,ze.default)(y,h=>{let f,u=a[h.notion];i[h.key]=null,u&&(f=M[h.type](u,l),i[h.key]=f||null)}),i},I=no;var $e=p(require("lodash/map.js"),1),je=p(require("lodash/omit.js"),1);var io=({config:e,results:t,routeType:n})=>{let l=[];return(0,$e.default)(t,r=>{let i=(0,je.default)(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Ye=io;var qe=p(require("lodash/fromPairs.js"),1),Ze=p(require("lodash/sortBy.js"),1),Ke=p(require("lodash/toPairs.js"),1),so=e=>(0,qe.default)((0,Ze.default)((0,Ke.default)(e))),D=so;var Je=p(require("lodash/filter.js"),1),q=p(require("lodash/map.js"),1),ao=(e,t)=>{switch(t){case"info":let n=[];return(0,q.default)(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&(0,Je.default)(e,{object:"block",type:"image"});case"items":let l=[];return(0,q.default)(e,r=>{var i;(0,q.default)((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},W=ao;var Xe=p(require("github-slugger"),1),Z=p(require("lodash/map.js"),1),K=p(require("plaiceholder"),1);var lo=async({data:e,pathVariables:t})=>{var c,h,f,u,T,E,g;let n=new Xe.default,l={},r=((c=e.info)==null?void 0:c.object)==="page"?W((h=e.info)==null?void 0:h.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&W((T=(u=e.info)==null?void 0:u.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async _=>{if(!_)return null;let w=!!_&&!!(_==null?void 0:_.url)?_==null?void 0:_.url:_;if(!w)return null;let{base64:S,img:P}=await(0,K.getPlaiceholder)(w),O=n.slug(w);return{base64:S,id:O,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&W(e==null?void 0:e.content,"content"),y=!!s&&s.map(async _=>{var A,H;if(!_)return null;let{type:w}=_,S=_[w],P=!!_&&!!((A=S==null?void 0:S.external)==null?void 0:A.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:O,img:F}=await(0,K.getPlaiceholder)(P),R=n.slug(P);return{base64:O,id:R,img:F,url:P}}),m=y?await Promise.all(y):[];if(e.items){let _=e.items.object==="page"?W((E=e.items)==null?void 0:E.data,"items"):W((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let O=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!O)return null;let{base64:F,img:R}=await(0,K.getPlaiceholder)(O),A=n.slug(O);return{base64:F,id:A,img:R,url:O}}),S=await Promise.all(w);!!S&&S[0]&&(0,Z.default)(S,P=>l[P.id]=P)}return!!a&&a[0]&&(0,Z.default)(a,_=>l[_.id]=_),!!m&&m[0]&&(0,Z.default)(m,_=>l[_.id]=_),l},$=lo;var po=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),J=po;var _o=e=>e.checkbox||!1,et=_o;var uo=e=>{let{type:t}=e;return e[t]},X=uo;var co=e=>e.email||null,tt=co;var rt=p(require("github-slugger"),1),nt=p(require("lodash/size.js"),1);var yo=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),ot=yo;var mo="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",ho=(e,t)=>mo.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",ot(t)),So=(e,t)=>{let n=new rt.default,l={};return(0,nt.default)(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:ho(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:s}}}),l},ne=So;var it=p(require("github-slugger"),1),st=p(require("lodash/map.js"),1),Po=e=>{let t=new it.default,n={};return(0,st.default)(e.multi_select,l=>{let r=l;r.slug=t.slug(r.name),n[r.id]=r}),n},at=Po;var fo=e=>(e==null?void 0:e.number)||null,lt=fo;var pt=p(require("github-slugger"),1),Eo=e=>{let t=new pt.default;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},_t=Eo;var go=e=>(e==null?void 0:e.phone_number)||null,ut=go;var ie=p(require("lodash/map.js"),1);var wo=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,ie.default)(e.rollup.array,t=>M[t.type](t))[0]:(0,ie.default)(e.relation,t=>t.id),dt=wo;var bo=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},ct=bo;var yt=p(require("lodash/map.js"),1),mt=p(require("lodash/sortBy.js"),1);var To=e=>{var t;return(0,mt.default)((0,yt.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>M[n.type](n)))},ht=To;var St=p(require("github-slugger"),1),ko=e=>{let t=new St.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Pt=ko;var Io=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},ft=Io;var Do=e=>e.url||null,Et=Do;var Co={checkbox:et,created_by:J,created_time:X,date:X,email:tt,files:ne,formula:J,image:ne,last_edited_by:J,last_edited_time:X,multi_select:at,number:lt,people:_t,phone_number:ut,relation:dt,rich_text:ct,rollup:ht,select:Pt,title:ft,url:Et},M=Co;var vo=e=>Object.entries(e).length===0&&e.constructor===Object,se=vo;var xo=e=>e===void 0&&typeof e=="undefined",j=xo;var Oo=async(e,{block_id:t})=>j(t)?[]:(await V(),await e({block_id:t})),ae=Oo;var gt={sorts:[{property:o.slug.notion,direction:"ascending"}]},No=async(e,{database_id:t,sorts:n=gt.sorts,filter:l=gt.filter})=>t?await e({database_id:t,sorts:n,filter:l}):[],le=No;var wt=async(e,{blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await wt(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},pe=wt;var Lo=({config:e,item:t,routeType:n,meta:l})=>{var m,c,h,f,u;let{NOTION:r}=e,i="",a=(m=t.properties)==null?void 0:m.slug,s="",y="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(h=(c=t.properties)==null?void 0:c.datePublished)==null?void 0:h.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(u=(f=t.properties)==null?void 0:f.dateEvent)==null?void 0:u.start.slice(0,10);let[_,w,S]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${S}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:y,slug:a}},_e=Lo;var bt=p(require("lodash/map.js"),1),ee=p(require("lodash/omit.js"),1);var Go=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},y={},m={},c=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await l({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(y=(0,ee.default)(u,"properties"),y.properties=D(I({config:e,data:u,pathVariables:r,pageId:y.id}))),s=await t({block_id:y.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?c:h}}]}}),E=[];(0,bt.default)(T.results,S=>{let P=S;P=(0,ee.default)(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=(0,ee.default)(T,"results");g.results=E,m=g;let _={info:y,content:s,items:m,images:{}},w=_?await $({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},ue=Go;var Tt=p(require("lodash/map.js"),1),Y=p(require("lodash/omit.js"),1),kt=p(require("lodash/size.js"),1);var Bo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await l({page_id:u});T.object==="page"&&(c=(0,Y.default)(T,"properties"),c.properties=D(I({config:e,data:T,pathVariables:r,pageId:c.id}))),m=await t({block_id:c.id});let E=(0,kt.default)(y),[g,_,w]=y,S=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,O=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}},k(b({},U.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:O}),A=[];(0,Tt.default)(R.results,oe=>{let Q=oe;Q=(0,Y.default)(Q,"properties"),Q.properties=D(I({config:e,data:oe,pathVariables:r,pageId:oe.id})),!!Q&&A.push(Q)});let H=(0,Y.default)(R,"results");H.results=A,h=H,h=(0,Y.default)(H,"data");let te={info:c,content:m,items:h,images:{}},Mt={};return te=k(b({},te),{images:Mt}),te},de=Bo;var It=p(require("lodash/filter.js"),1),Dt=p(require("lodash/omit.js"),1);var Ao=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,y={},m={},c={},h=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(h))return{info:m,content:y,items:c,images:{}};let u=await n({database_id:s[h].database_id,filter:{and:[k(b({},U.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};m=(0,Dt.default)(T,"properties"),m.properties=D(I({config:e,data:T,pathVariables:r,pageId:m.id})),y=await t({block_id:m.id}),y=[...await l({blocks:y.results})],c&&(c.results=(0,It.default)(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},_=g?await $({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},ce=Ao;var ye=p(require("lodash/omit.js"),1),Ct=p(require("lodash/size.js"),1);var Uo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=y,_=(0,Ct.default)(y)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},U.slug),{text:{equals:_?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=(0,ye.default)(S,"properties"),c.properties=D(I({config:e,data:S,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}),_||i===s.PODCASTS.routeType&&(h=await l({config:e,reqQuery:{podcasts:c.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=y,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),S=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(w,"day")}},k(b({},U.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=(0,ye.default)(P,"properties"),c.properties=D(I({config:e,data:P,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}))}let u={info:c,content:m,items:h,images:{}},T={};return u=k(b({},u),{images:T}),u},me=Uo;var Vo=async(e,{page_id:t})=>j(t)?[]:(await V(),await e({page_id:t})),he=Vo;var Se=p(require("lodash/drop.js"),1),vt=p(require("lodash/dropRight.js"),1),xt=p(require("lodash/first.js"),1),Pe=p(require("lodash/includes.js"),1),Ot=p(require("lodash/isInteger.js"),1),Nt=p(require("lodash/join.js"),1),Lt=p(require("lodash/last.js"),1),fe=p(require("lodash/size.js"),1);var Mo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=(0,fe.default)(t),a=(0,xt.default)(t),s=(0,Lt.default)(t),y=i>1&&(0,Pe.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,Se.default)(t):(0,Se.default)((0,vt.default)(t)),m=a===s&&!(0,Pe.default)(r,a)?"pages":a,c=a!==s&&!(0,Ot.default)(parseInt(s))?s:a,h=m==="pages",f=c===a,u=!!y&&(0,fe.default)(y)!==0,T=h&&a===l?"":(0,Nt.default)(t,"/"),E=v.SLUG;return h?E=v.SLUG:f&&!u?E=v.LISTING:f&&u?E=v.LISTING_BY_DATE:u?E=v.SLUG_BY_ROUTE:E=v.SLUG,{dataType:E,hasMeta:u,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},Ee=Mo;var Gt=p(require("lodash/map.js"),1),Bt=p(require("lodash/omit.js"),1),At=p(require("lodash/size.js"),1);var Ro={ASCENDING:"ascending",DESCENDING:"descending"},Ho=[{property:o.slug.notion,direction:Ro.ASCENDING}],Wo=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),y=l[s].database_id;if(!y)return[];let m={},c={},h,f;if(r==="EPISODES"){f=Ho;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,At.default)(E)>0&&(0,Gt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||se(m))){await V();let u;h?((h==null?void 0:h.or.length)===0&&(h={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:y,filter:h,sorts:f}),m=u,c=Ye({config:e,results:u.results,routeType:i}),m=(0,Bt.default)(m,"results"),m.results=c):a=!0}return m},ge=Wo;var x,Vt=class extends Ut.Client{constructor(t){super(t);Ce(this,x,void 0);this.custom={getBlocksByIdChildren:async t=>await ae(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await le(this.databases.query,t),getDeepFetchAllChildren:async t=>await pe(this.blocks.children.list,b({},t)),getInfoType:t=>_e(k(b({},t),{config:B(this,x)})),getPagesById:async t=>await he(this.pages.retrieve,b({},t)),getPathVariables:t=>Ee(k(b({},t),{config:B(this,x)})),getQuery:async t=>await ge(k(b({},t),{config:B(this,x),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[v.LISTING]:async t=>await ue(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.LISTING_BY_DATE]:async t=>await de(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.SLUG]:async t=>await ce(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[v.SLUG_BY_ROUTE]:async t=>await me(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};ve(this,x,t==null?void 0:t.config)}};x=new WeakMap;module.exports=Yt(Fo);0&&(module.exports={Client});
1
+ var Ht=Object.create;var F=Object.defineProperty,Wt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptor,Qt=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,zt=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Ie=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))ke.call(t,n)&&Ie(e,n,t[n]);if(Te)for(var n of Te(t))$t.call(t,n)&&Ie(e,n,t[n]);return e},k=(e,t)=>Wt(e,Qt(t)),De=e=>F(e,"__esModule",{value:!0});var Yt=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},Ce=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jt(t))!ke.call(e,r)&&(n||r!=="default")&&F(e,r,{get:()=>t[r],enumerable:!(p=Ft(t,r))||p.enumerable});return e},l=(e,t)=>Ce(De(F(e!=null?Ht(zt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),qt=(e=>(t,n)=>e&&e.get(t)||(n=Ce(De({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var ve=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var L=(e,t,n)=>(ve(e,t,"read from private field"),n?n.call(e):t.get(e)),xe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Oe=(e,t,n,p)=>(ve(e,t,"write to private field"),p?p.call(e,n):t.set(e,n),n);var Uo={};Yt(Uo,{Client:()=>Mt});var Vt=l(require("@notionhq/client"),1);var O=l(require("lodash/filter.js"),1),Ne=l(require("lodash/map.js"),1),N=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Ge=[...G],Le=[...G,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],Be=[...G,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],Ae=[...G],Ue=[...G,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],Ve=[...G,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Me=[...G],Re=[...G,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],He=[...G,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],Mo={BLOG:(0,O.default)(Ge,{init:!0}),EPISODES:(0,O.default)(Le,{init:!0}),EVENTS:(0,O.default)(Be,{init:!0}),PAGES:(0,O.default)(Ae,{init:!0}),PEOPLE:(0,O.default)(Ue,{init:!0}),PODCASTS:(0,O.default)(Ve,{init:!0}),SEO:(0,O.default)(Me,{init:!0}),SHOWS:(0,O.default)(Re,{init:!0}),VENUES:(0,O.default)(He,{init:!0})},We={BLOG:Ge.map(e=>N(e)),EPISODES:Le.map(e=>N(e)),EVENTS:Be.map(e=>N(e)),PAGES:Ae.map(e=>N(e)),PEOPLE:Ue.map(e=>N(e)),PODCASTS:Ve.map(e=>N(e)),SEO:Me.map(e=>N(e)),SHOWS:Re.map(e=>N(e)),VENUES:He.map(e=>N(e))},Fe=(0,Ne.default)(o,e=>N(e)),Qe=new Date().toISOString(),A={dateBefore:{property:o.datePublished.notion,date:{before:Qe}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:Qe}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Zt="LISTING",Kt="LISTING_BY_DATE",Jt="SLUG",Xt="SLUG_BY_ROUTE",eo=[Zt,Kt,Jt,Xt],C=Object.assign({},...eo.map(e=>({[e]:e})).flat(1));var z=l(require("@jeromefitz/utils"),1),to=async(e,{block_id:t})=>(0,z.isUndefined)(t)?[]:(await(0,z.avoidRateLimit)(),await e({block_id:t})),re=to;var je={sorts:[{property:o.slug.notion,direction:"ascending"}]},oo=async(e,{database_id:t,sorts:n=je.sorts,filter:p=je.filter})=>t?await e({database_id:t,sorts:n,filter:p}):[],ne=oo;var ze=async(e,{blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),p=await Promise.all(n.map(r=>r.promise));for(let r=0;r<p.length;r++){let i=p[r].results;if(await ze(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},ie=ze;var ro=({config:e,item:t,routeType:n,meta:p})=>{var y,d,m,f,u;let{NOTION:r}=e,i="",a=(y=t.properties)==null?void 0:y.slug,s="",c="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(m=(d=t.properties)==null?void 0:d.datePublished)==null?void 0:m.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(u=(f=t.properties)==null?void 0:f.dateEvent)==null?void 0:u.start.slice(0,10);let[_,w,h]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${h}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${p==null?void 0:p.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:c,slug:a}},se=ro;var _e=l(require("@jeromefitz/utils"),1),bt=l(require("lodash/map.js"),1),J=l(require("lodash/omit.js"),1);var ae=l(require("date-fns/addDays/index.js"),1),$e=l(require("date-fns/addMonths/index.js"),1),Ye=l(require("date-fns/addYears/index.js"),1),no=(e,t)=>{switch(t){case"year":return(0,Ye.default)(e,1).toISOString();case"month":return(0,$e.default)(e,1).toISOString();case"day":return(0,ae.default)(e,2).toISOString()}return(0,ae.default)(e,-1).toISOString()},D=no;var qe=l(require("lodash/map.js"),1);var io=({config:e,data:t,pathVariables:n,pageId:p})=>{var y,d;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:m,routeType:f}=n;s=f===((y=r==null?void 0:r.PODCASTS)==null?void 0:y.routeType)&&m.length>1?(d=r==null?void 0:r.EPISODES)==null?void 0:d.routeType:f}let c=s?We[s.toUpperCase()]:Fe;return(0,qe.default)(c,m=>{let f,u=a[m.notion];i[m.key]=null,u&&(f=U[m.type](u,p),i[m.key]=f||null)}),i},I=io;var Ze=l(require("@jeromefitz/utils"),1),Ke=l(require("lodash/map.js"),1),Je=l(require("lodash/omit.js"),1);var so=({config:e,results:t,routeType:n})=>{let p=[];return(0,Ke.default)(t,r=>{let i=(0,Je.default)(r,"properties");i.properties=(0,Ze.sortObject)(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),p.push(i)}),p},Xe=so;var et=l(require("lodash/filter.js"),1),$=l(require("lodash/map.js"),1),ao=(e,t)=>{switch(t){case"info":let n=[];return(0,$.default)(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&(0,et.default)(e,{object:"block",type:"image"});case"items":let p=[];return(0,$.default)(e,r=>{var i;(0,$.default)((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&p.push(a==null?void 0:a.url))}),p;default:return[]}},R=ao;var tt=l(require("github-slugger"),1),Y=l(require("lodash/map.js"),1),q=l(require("plaiceholder"),1);var lo=async({data:e,pathVariables:t})=>{var d,m,f,u,T,E,g;let n=new tt.default,p={},r=((d=e.info)==null?void 0:d.object)==="page"?R((m=e.info)==null?void 0:m.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&R((T=(u=e.info)==null?void 0:u.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async _=>{if(!_)return null;let w=!!_&&!!(_==null?void 0:_.url)?_==null?void 0:_.url:_;if(!w)return null;let{base64:h,img:P}=await(0,q.getPlaiceholder)(w),x=n.slug(w);return{base64:h,id:x,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&R(e==null?void 0:e.content,"content"),c=!!s&&s.map(async _=>{var B,M;if(!_)return null;let{type:w}=_,h=_[w],P=!!_&&!!((B=h==null?void 0:h.external)==null?void 0:B.url)?(M=h==null?void 0:h.external)==null?void 0:M.url:null;if(!P)return null;let{base64:x,img:H}=await(0,q.getPlaiceholder)(P),V=n.slug(P);return{base64:x,id:V,img:H,url:P}}),y=c?await Promise.all(c):[];if(e.items){let _=e.items.object==="page"?R((E=e.items)==null?void 0:E.data,"items"):R((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:H,img:V}=await(0,q.getPlaiceholder)(x),B=n.slug(x);return{base64:H,id:B,img:V,url:x}}),h=await Promise.all(w);!!h&&h[0]&&(0,Y.default)(h,P=>p[P.id]=P)}return!!a&&a[0]&&(0,Y.default)(a,_=>p[_.id]=_),!!y&&y[0]&&(0,Y.default)(y,_=>p[_.id]=_),p},Q=lo;var po=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),Z=po;var _o=e=>e.checkbox||!1,ot=_o;var uo=e=>{let{type:t}=e;return e[t]},K=uo;var co=e=>e.email||null,rt=co;var nt=l(require("@jeromefitz/utils"),1),it=l(require("github-slugger"),1),st=l(require("lodash/size.js"),1),yo="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",mo=(e,t)=>yo.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,nt.stringToUUID)(t)),ho=(e,t)=>{let n=new it.default,p={};return(0,st.default)(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],c=n.slug(s);p[c]={type:r==null?void 0:r.type,url:mo(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],c=n.slug(s);p[c]={type:r==null?void 0:r.type,url:s}}}),p},le=ho;var at=l(require("github-slugger"),1),lt=l(require("lodash/map.js"),1),So=e=>{let t=new at.default,n={};return(0,lt.default)(e.multi_select,p=>{let r=p;r.slug=t.slug(r.name),n[r.id]=r}),n},pt=So;var Po=e=>(e==null?void 0:e.number)||null,_t=Po;var ut=l(require("github-slugger"),1),fo=e=>{let t=new ut.default;return e.people.map(n=>{let{avatar_url:p,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:p,email:s,id:r,name:i}}})[0]},dt=fo;var Eo=e=>(e==null?void 0:e.phone_number)||null,ct=Eo;var pe=l(require("lodash/map.js"),1);var go=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,pe.default)(e.rollup.array,t=>U[t.type](t))[0]:(0,pe.default)(e.relation,t=>t.id),yt=go;var wo=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},mt=wo;var ht=l(require("lodash/map.js"),1),St=l(require("lodash/sortBy.js"),1);var bo=e=>{var t;return(0,St.default)((0,ht.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>U[n.type](n)))},Pt=bo;var ft=l(require("github-slugger"),1),To=e=>{let t=new ft.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Et=To;var ko=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},gt=ko;var Io=e=>e.url||null,wt=Io;var Do={checkbox:ot,created_by:Z,created_time:K,date:K,email:rt,files:le,formula:Z,image:le,last_edited_by:Z,last_edited_time:K,multi_select:pt,number:_t,people:dt,phone_number:ct,relation:yt,rich_text:mt,rollup:Pt,select:Et,title:gt,url:wt},U=Do;var Co=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},c={},y={},d=new Date().toISOString(),m=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await p({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(c=(0,J.default)(u,"properties"),c.properties=(0,_e.sortObject)(I({config:e,data:u,pathVariables:r,pageId:c.id}))),s=await t({block_id:c.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?d:m}}]}}),E=[];(0,bt.default)(T.results,h=>{let P=h;P=(0,J.default)(P,"properties"),P.properties=(0,_e.sortObject)(I({config:e,data:h,pathVariables:r,pageId:h.id})),E.push(P)});let g=(0,J.default)(T,"results");g.results=E,y=g;let _={info:c,content:s,items:y,images:{}},w=_?await Q({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},ue=Co;var de=l(require("@jeromefitz/utils"),1),Tt=l(require("lodash/map.js"),1),j=l(require("lodash/omit.js"),1),kt=l(require("lodash/size.js"),1);var vo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:c}=r,y={},d={},m={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await p({page_id:u});T.object==="page"&&(d=(0,j.default)(T,"properties"),d.properties=(0,de.sortObject)(I({config:e,data:T,pathVariables:r,pageId:d.id}))),y=await t({block_id:d.id});let E=(0,kt.default)(c),[g,_,w]=c,h=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,x=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(h,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(h,"day")}},k(b({},A.slug),{text:{equals:a}})]};break}let H=s[i.toUpperCase()].database_id,V=await n({database_id:H,filter:P,sorts:x}),B=[];(0,Tt.default)(V.results,oe=>{let W=oe;W=(0,j.default)(W,"properties"),W.properties=(0,de.sortObject)(I({config:e,data:oe,pathVariables:r,pageId:oe.id})),!!W&&B.push(W)});let M=(0,j.default)(V,"results");M.results=B,m=M,m=(0,j.default)(M,"data");let te={info:d,content:y,items:m,images:{}},Rt={};return te=k(b({},te),{images:Rt}),te},ce=vo;var It=l(require("@jeromefitz/utils"),1),Dt=l(require("lodash/filter.js"),1),Ct=l(require("lodash/omit.js"),1);var xo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,c={},y={},d={},m=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(m))return{info:y,content:c,items:d,images:{}};let u=await n({database_id:s[m].database_id,filter:{and:[k(b({},A.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};y=(0,Ct.default)(T,"properties"),y.properties=(0,It.sortObject)(I({config:e,data:T,pathVariables:r,pageId:y.id})),c=await t({block_id:y.id}),c=[...await p({blocks:c.results})],d&&(d.results=(0,Dt.default)(d.results,{properties:{isPublished:!0}}));let g={info:y,content:c,items:d,images:{}},_=g?await Q({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},ye=xo;var me=l(require("@jeromefitz/utils"),1),he=l(require("lodash/omit.js"),1),vt=l(require("lodash/size.js"),1);var Oo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:p,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:c}=r,y={},d={},m={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=c,_=(0,vt.default)(c)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},A.slug),{text:{equals:_?g:E}})]}}),h=(w==null?void 0:w.object)==="list"&&w.results[0];if(!h)return{};d=(0,he.default)(h,"properties"),d.properties=(0,me.sortObject)(I({config:e,data:h,pathVariables:r,pageId:d.id})),y=await t({block_id:d.id}),_||i===s.PODCASTS.routeType&&(m=await p({config:e,reqQuery:{podcasts:d.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=c,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),h=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:D(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:D(w,"day")}},k(b({},A.slug),{text:{equals:a}})]}}),P=(h==null?void 0:h.object)==="list"&&h.results[0];P&&(d=(0,he.default)(P,"properties"),d.properties=(0,me.sortObject)(I({config:e,data:P,pathVariables:r,pageId:d.id})),y=await t({block_id:d.id}))}let u={info:d,content:y,items:m,images:{}},T={};return u=k(b({},u),{images:T}),u},Se=Oo;var X=l(require("@jeromefitz/utils"),1),No=async(e,{page_id:t})=>(0,X.isUndefined)(t)?[]:(await(0,X.avoidRateLimit)(),await e({page_id:t})),Pe=No;var fe=l(require("lodash/drop.js"),1),xt=l(require("lodash/dropRight.js"),1),Ot=l(require("lodash/first.js"),1),Ee=l(require("lodash/includes.js"),1),Nt=l(require("lodash/isInteger.js"),1),Gt=l(require("lodash/join.js"),1),Lt=l(require("lodash/last.js"),1),ge=l(require("lodash/size.js"),1);var Go=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:p,ROUTE_TYPES:r}=e,i=(0,ge.default)(t),a=(0,Ot.default)(t),s=(0,Lt.default)(t),c=i>1&&(0,Ee.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,fe.default)(t):(0,fe.default)((0,xt.default)(t)),y=a===s&&!(0,Ee.default)(r,a)?"pages":a,d=a!==s&&!(0,Nt.default)(parseInt(s))?s:a,m=y==="pages",f=d===a,u=!!c&&(0,ge.default)(c)!==0,T=m&&a===p?"":(0,Gt.default)(t,"/"),E=C.SLUG;return m?E=C.SLUG:f&&!u?E=C.LISTING:f&&u?E=C.LISTING_BY_DATE:u?E=C.SLUG_BY_ROUTE:E=C.SLUG,{dataType:E,hasMeta:u,isPage:m,isIndex:f,meta:c,routeType:y,slug:d,url:T}},we=Go;var ee=l(require("@jeromefitz/utils"),1),Bt=l(require("lodash/map.js"),1),At=l(require("lodash/omit.js"),1),Ut=l(require("lodash/size.js"),1);var Lo={ASCENDING:"ascending",DESCENDING:"descending"},Bo=[{property:o.slug.notion,direction:Lo.ASCENDING}],Ao=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:p}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),c=p[s].database_id;if(!c)return[];let y={},d={},m,f;if(r==="EPISODES"){f=Bo;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,Ut.default)(E)>0&&(0,Bt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),m={or:[...T]}}else a=!0;if(!a&&(!y||(0,ee.isObjectEmpty)(y))){await(0,ee.avoidRateLimit)();let u;m?((m==null?void 0:m.or.length)===0&&(m={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:c,filter:m,sorts:f}),y=u,d=Xe({config:e,results:u.results,routeType:i}),y=(0,At.default)(y,"results"),y.results=d):a=!0}return y},be=Ao;var v,Mt=class extends Vt.Client{constructor(t){super(t);xe(this,v,void 0);this.custom={getBlocksByIdChildren:async t=>await re(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await ne(this.databases.query,t),getDeepFetchAllChildren:async t=>await ie(this.blocks.children.list,b({},t)),getInfoType:t=>se(k(b({},t),{config:L(this,v)})),getPagesById:async t=>await Pe(this.pages.retrieve,b({},t)),getPathVariables:t=>we(k(b({},t),{config:L(this,v)})),getQuery:async t=>await be(k(b({},t),{config:L(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[C.LISTING]:async t=>await ue(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.LISTING_BY_DATE]:async t=>await ce(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.SLUG]:async t=>await ye(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[C.SLUG_BY_ROUTE]:async t=>await Se(k(b({},t),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};Oe(this,v,t==null?void 0:t.config)}};v=new WeakMap;module.exports=qt(Uo);0&&(module.exports={Client});
package/index.js CHANGED
@@ -1 +1 @@
1
- var tt=Object.defineProperty,ot=Object.defineProperties;var rt=Object.getOwnPropertyDescriptors;var me=Object.getOwnPropertySymbols;var nt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var he=(e,o,n)=>o in e?tt(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,b=(e,o)=>{for(var n in o||(o={}))nt.call(o,n)&&he(e,n,o[n]);if(me)for(var n of me(o))it.call(o,n)&&he(e,n,o[n]);return e},k=(e,o)=>ot(e,rt(o));var Se=(e,o,n)=>{if(!o.has(e))throw TypeError("Cannot "+n)};var B=(e,o,n)=>(Se(e,o,"read from private field"),n?n.call(e):o.get(e)),Pe=(e,o,n)=>{if(o.has(e))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(e):o.set(e,n)},fe=(e,o,n,l)=>(Se(e,o,"write to private field"),l?l.call(e,n):o.set(e,n),n);import{Client as Lo}from"@notionhq/client";import L from"lodash/filter.js";import st from"lodash/map.js";var N=({key:e,notion:o,type:n})=>({key:e,notion:o,type:n}),t={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[t.authors,t.datePublished,t.isIndexed,t.isPublished,t.slug,t.seoDescription,t.seoImage,t.seoImageDescription,t.title],Ee=[...G],ge=[...G,t.dateRecorded,t.duration,t.episode,t.mp3,t.season,t.relationEpisodes__People_Guest,t.relationEpisodes__People_Sound_Engineer,t.relationEpisodes__People_Thanks,t.relationEpisodes__Podcast,t.relationEpisodes__Venues,t.socialApple,t.socialSpotify,t.type],we=[...G,t.dateEvent,t.relationEvents__People_Guest_Music,t.relationEvents__People_Guest,t.relationEvents__People_Host,t.relationEvents__Shows_Lineup,t.relationEvents__Shows,t.relationEvents__Venues,t.socialFacebook,t.socialWebsite,t.ticketUrl,t.rollupEvents__People_Cast,t.rollupEvents__People_Guest_Music,t.rollupEvents__People_Guest,t.rollupEvents__People_Host,t.rollupEvents__Shows_Lineup,t.rollupEvents__Shows,t.rollupEvents__Venues],be=[...G],Te=[...G,t.email,t.nameFirst,t.nameLast,t.namePreferred,t.relationPeople__Episodes_Guest,t.relationPeople__Episodes_Sound_Engineer,t.relationPeople__Episodes_Thanks,t.relationPeople__Events_Guest,t.relationPeople__Events_Guest_Music,t.relationPeople__Events_Host,t.relationPeople__Podcasts_Host,t.relationPeople__Podcasts_Sound_Engineer,t.relationPeople__Shows_Cast,t.relationPeople__Shows_Cast_Past,t.relationPeople__Shows_Director,t.relationPeople__Shows_Director_Musical,t.relationPeople__Shows_Director_Technical,t.relationPeople__Shows_Producer,t.relationPeople__Shows_Thanks,t.relationPeople__Shows_Writer],ke=[...G,t.categories,t.explicit,t.podcastAuthor,t.podcastAuthorEmail,t.relationPodcasts__People_Host,t.relationPodcasts__People_Sound_Engineer,t.socialApple,t.socialSpotify,t.type,t.relationPodcasts__Episodes],Ie=[...G],De=[...G,t.relationShows__People_Cast,t.relationShows__People_Cast_Past,t.relationShows__People_Director,t.relationShows__People_Director_Musical,t.relationShows__People_Director_Technical,t.relationShows__People_Producer,t.relationShows__People_Thanks,t.relationShows__People_Writer,t.relationShows__Tags,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationShows__Events,t.relationShows__Events_Lineup,t.rollupShows__People_Cast,t.rollupShows__People_Cast_Slug,t.rollupShows__People_Cast_Past,t.rollupShows__People_Crew,t.rollupShows__People_Director,t.rollupShows__People_Director_Musical,t.rollupShows__People_Director_Technical,t.rollupShows__People_Music,t.rollupShows__People_Producer,t.rollupShows__People_Thanks,t.rollupShows__People_Writer,t.rollupShows__Tags],Ce=[...G,t.addressCity,t.addressLatitude,t.addressLongitude,t.addressNeighborhood,t.addressState,t.addressStreet,t.addressZipCode,t.phoneNumber,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationVenues__Episodes,t.relationVenues__Events],Vo={BLOG:L(Ee,{init:!0}),EPISODES:L(ge,{init:!0}),EVENTS:L(we,{init:!0}),PAGES:L(be,{init:!0}),PEOPLE:L(Te,{init:!0}),PODCASTS:L(ke,{init:!0}),SEO:L(Ie,{init:!0}),SHOWS:L(De,{init:!0}),VENUES:L(Ce,{init:!0})},ve={BLOG:Ee.map(e=>N(e)),EPISODES:ge.map(e=>N(e)),EVENTS:we.map(e=>N(e)),PAGES:be.map(e=>N(e)),PEOPLE:Te.map(e=>N(e)),PODCASTS:ke.map(e=>N(e)),SEO:Ie.map(e=>N(e)),SHOWS:De.map(e=>N(e)),VENUES:Ce.map(e=>N(e))},xe=st(t,e=>N(e)),Oe=new Date().toISOString(),U={dateBefore:{property:t.datePublished.notion,date:{before:Oe}},dateOnOrAfter:{property:t.datePublished.notion,date:{on_or_after:Oe}},published:{property:t.isPublished.notion,checkbox:{equals:!1}},slug:{property:t.slug.notion,text:{equals:""}}},at="LISTING",lt="LISTING_BY_DATE",pt="SLUG",_t="SLUG_BY_ROUTE",ut=[at,lt,pt,_t],v=Object.assign({},...ut.map(e=>({[e]:e})).flat(1));import Ne from"date-fns/addDays/index.js";import dt from"date-fns/addMonths/index.js";import ct from"date-fns/addYears/index.js";var yt=(e,o)=>{switch(o){case"year":return ct(e,1).toISOString();case"month":return dt(e,1).toISOString();case"day":return Ne(e,2).toISOString()}return Ne(e,-1).toISOString()},C=yt;var mt=250;async function ht(){await St()}function St(e=mt){return new Promise(o=>setTimeout(o,e))}var V=ht;import Pt from"lodash/map.js";var ft=({config:e,data:o,pathVariables:n,pageId:l})=>{var m,c;let{NOTION:r}=e,i={};if(!(o==null?void 0:o.properties))return i;let{properties:a}=o,s;if(n){let{meta:h,routeType:f}=n;s=f===((m=r==null?void 0:r.PODCASTS)==null?void 0:m.routeType)&&h.length>1?(c=r==null?void 0:r.EPISODES)==null?void 0:c.routeType:f}let y=s?ve[s.toUpperCase()]:xe;return Pt(y,h=>{let f,_=a[h.notion];i[h.key]=null,_&&(f=M[h.type](_,l),i[h.key]=f||null)}),i},I=ft;import Et from"lodash/map.js";import gt from"lodash/omit.js";var wt=({config:e,results:o,routeType:n})=>{let l=[];return Et(o,r=>{let i=gt(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Le=wt;import bt from"lodash/fromPairs.js";import Tt from"lodash/sortBy.js";import kt from"lodash/toPairs.js";var It=e=>bt(Tt(kt(e))),D=It;import Dt from"lodash/filter.js";import J from"lodash/map.js";var Ct=(e,o)=>{switch(o){case"info":let n=[];return J(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&Dt(e,{object:"block",type:"image"});case"items":let l=[];return J(e,r=>{var i;J((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},W=Ct;import vt from"github-slugger";import X from"lodash/map.js";import{getPlaiceholder as ee}from"plaiceholder";var xt=async({data:e,pathVariables:o})=>{var c,h,f,_,T,E,g;let n=new vt,l={},r=((c=e.info)==null?void 0:c.object)==="page"?W((h=e.info)==null?void 0:h.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&W((T=(_=e.info)==null?void 0:_.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async p=>{if(!p)return null;let w=!!p&&!!(p==null?void 0:p.url)?p==null?void 0:p.url:p;if(!w)return null;let{base64:S,img:P}=await ee(w),O=n.slug(w);return{base64:S,id:O,img:P,url:w}}),a=i?await Promise.all(i):[],s=!o.isIndex&&W(e==null?void 0:e.content,"content"),y=!!s&&s.map(async p=>{var A,H;if(!p)return null;let{type:w}=p,S=p[w],P=!!p&&!!((A=S==null?void 0:S.external)==null?void 0:A.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:O,img:F}=await ee(P),R=n.slug(P);return{base64:O,id:R,img:F,url:P}}),m=y?await Promise.all(y):[];if(e.items){let p=e.items.object==="page"?W((E=e.items)==null?void 0:E.data,"items"):W((g=e.items)==null?void 0:g.results,"items"),w=!!p&&p.map(async P=>{if(!P)return null;let O=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!O)return null;let{base64:F,img:R}=await ee(O),A=n.slug(O);return{base64:F,id:A,img:R,url:O}}),S=await Promise.all(w);!!S&&S[0]&&X(S,P=>l[P.id]=P)}return!!a&&a[0]&&X(a,p=>l[p.id]=p),!!m&&m[0]&&X(m,p=>l[p.id]=p),l},z=xt;var Ot=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),j=Ot;var Nt=e=>e.checkbox||!1,Ge=Nt;var Lt=e=>{let{type:o}=e;return e[o]},Y=Lt;var Gt=e=>e.email||null,Be=Gt;import At from"github-slugger";import Ut from"lodash/size.js";var Bt=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),Ae=Bt;var Vt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",Mt=(e,o)=>Vt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",Ae(o)),Rt=(e,o)=>{let n=new At,l={};return Ut(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:Mt(s,o)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:s}}}),l},te=Rt;import Ht from"github-slugger";import Wt from"lodash/map.js";var Ft=e=>{let o=new Ht,n={};return Wt(e.multi_select,l=>{let r=l;r.slug=o.slug(r.name),n[r.id]=r}),n},Ue=Ft;var Qt=e=>(e==null?void 0:e.number)||null,Ve=Qt;import zt from"github-slugger";var $t=e=>{let o=new zt;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[o.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},Me=$t;var jt=e=>(e==null?void 0:e.phone_number)||null,Re=jt;import He from"lodash/map.js";var Yt=e=>e.type==="rollup"?e.rollup.type==="array"&&He(e.rollup.array,o=>M[o.type](o))[0]:He(e.relation,o=>o.id),We=Yt;var qt=e=>{var o;return(e==null?void 0:e.rich_text)?(o=e==null?void 0:e.rich_text[0])==null?void 0:o.plain_text:null},Fe=qt;import Zt from"lodash/map.js";import Kt from"lodash/sortBy.js";var Jt=e=>{var o;return Kt(Zt((o=e==null?void 0:e.rollup)==null?void 0:o.array,n=>M[n.type](n)))},Qe=Jt;import Xt from"github-slugger";var eo=e=>{let o=new Xt,n=e.select;return n?(n.slug=o.slug(e.select.name),{[n.id]:n}):null},ze=eo;var to=e=>{var o;return(e==null?void 0:e.title)?(o=e==null?void 0:e.title[0])==null?void 0:o.plain_text:null},$e=to;var oo=e=>e.url||null,je=oo;var ro={checkbox:Ge,created_by:j,created_time:Y,date:Y,email:Be,files:te,formula:j,image:te,last_edited_by:j,last_edited_time:Y,multi_select:Ue,number:Ve,people:Me,phone_number:Re,relation:We,rich_text:Fe,rollup:Qe,select:ze,title:$e,url:je},M=ro;var no=e=>Object.entries(e).length===0&&e.constructor===Object,oe=no;var io=e=>e===void 0&&typeof e=="undefined",$=io;var so=async(e,{block_id:o})=>$(o)?[]:(await V(),await e({block_id:o})),re=so;var Ye={sorts:[{property:t.slug.notion,direction:"ascending"}]},ao=async(e,{database_id:o,sorts:n=Ye.sorts,filter:l=Ye.filter})=>o?await e({database_id:o,sorts:n,filter:l}):[],ne=ao;var qe=async(e,{blocks:o})=>{if(o==null)return o;let n=o.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await qe(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return o},ie=qe;var lo=({config:e,item:o,routeType:n,meta:l})=>{var m,c,h,f,_;let{NOTION:r}=e,i="",a=(m=o.properties)==null?void 0:m.slug,s="",y="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(h=(c=o.properties)==null?void 0:c.datePublished)==null?void 0:h.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(_=(f=o.properties)==null?void 0:f.dateEvent)==null?void 0:_.start.slice(0,10);let[p,w,S]=i==null?void 0:i.split("-");s=`/${n}/${p}/${w}/${S}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:y,slug:a}},se=lo;import po from"lodash/map.js";import ae from"lodash/omit.js";var _o=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},y={},m={},c=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,_=await l({page_id:f});if(!_)return{};(_==null?void 0:_.object)==="page"&&(y=ae(_,"properties"),y.properties=D(I({config:e,data:_,pathVariables:r,pageId:y.id}))),s=await o({block_id:y.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?c:h}}]}}),E=[];po(T.results,S=>{let P=S;P=ae(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=ae(T,"results");g.results=E,m=g;let p={info:y,content:s,items:m,images:{}},w=p?await z({data:p,pathVariables:r}):{};return p=k(b({},p),{images:w}),p},le=_o;import uo from"lodash/map.js";import q from"lodash/omit.js";import co from"lodash/size.js";var yo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString(),_=s[i.toUpperCase()].page_id__seo,T=await l({page_id:_});T.object==="page"&&(c=q(T,"properties"),c.properties=D(I({config:e,data:T,pathVariables:r,pageId:c.id}))),m=await o({block_id:c.id});let E=co(y),[g,p,w]=y,S=new Date(`${g||f.slice(0,4)}-${p||"01"}-${w||"01"}`),P,O=[{property:t.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(S,"day")}},k(b({},U.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:O}),A=[];uo(R.results,K=>{let Q=K;Q=q(Q,"properties"),Q.properties=D(I({config:e,data:K,pathVariables:r,pageId:K.id})),!!Q&&A.push(Q)});let H=q(R,"results");H.results=A,h=H,h=q(H,"data");let Z={info:c,content:m,items:h,images:{}},et={};return Z=k(b({},Z),{images:et}),Z},pe=yo;import mo from"lodash/filter.js";import ho from"lodash/omit.js";var So=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,y={},m={},c={},h=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(h))return{info:m,content:y,items:c,images:{}};let _=await n({database_id:s[h].database_id,filter:{and:[k(b({},U.slug),{text:{equals:a}})]}}),T=(_==null?void 0:_.object)==="list"&&_.results[0];if(!T)return{};m=ho(T,"properties"),m.properties=D(I({config:e,data:T,pathVariables:r,pageId:m.id})),y=await o({block_id:m.id}),y=[...await l({blocks:y.results})],c&&(c.results=mo(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},p=g?await z({data:g,pathVariables:r}):{};return g=k(b({},g),{images:p}),g},_e=So;import Ze from"lodash/omit.js";import Po from"lodash/size.js";var fo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=y,p=Po(y)===2,w=await n({database_id:s[p?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},U.slug),{text:{equals:p?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=Ze(S,"properties"),c.properties=D(I({config:e,data:S,pathVariables:r,pageId:c.id})),m=await o({block_id:c.id}),p||i===s.PODCASTS.routeType&&(h=await l({config:e,reqQuery:{podcasts:c.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,p]=y,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${p||"01"}`),S=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:C(w,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:C(w,"day")}},k(b({},U.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=Ze(P,"properties"),c.properties=D(I({config:e,data:P,pathVariables:r,pageId:c.id})),m=await o({block_id:c.id}))}let _={info:c,content:m,items:h,images:{}},T={};return _=k(b({},_),{images:T}),_},ue=fo;var Eo=async(e,{page_id:o})=>$(o)?[]:(await V(),await e({page_id:o})),de=Eo;import Ke from"lodash/drop.js";import go from"lodash/dropRight.js";import wo from"lodash/first.js";import Je from"lodash/includes.js";import bo from"lodash/isInteger.js";import To from"lodash/join.js";import ko from"lodash/last.js";import Xe from"lodash/size.js";var Io=({config:e,catchAll:o})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=Xe(o),a=wo(o),s=ko(o),y=i>1&&Je([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?Ke(o):Ke(go(o)),m=a===s&&!Je(r,a)?"pages":a,c=a!==s&&!bo(parseInt(s))?s:a,h=m==="pages",f=c===a,_=!!y&&Xe(y)!==0,T=h&&a===l?"":To(o,"/"),E=v.SLUG;return h?E=v.SLUG:f&&!_?E=v.LISTING:f&&_?E=v.LISTING_BY_DATE:_?E=v.SLUG_BY_ROUTE:E=v.SLUG,{dataType:E,hasMeta:_,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},ce=Io;import Do from"lodash/map.js";import Co from"lodash/omit.js";import vo from"lodash/size.js";var xo={ASCENDING:"ascending",DESCENDING:"descending"},Oo=[{property:t.slug.notion,direction:xo.ASCENDING}],No=async({config:e,reqQuery:o,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=o,i=r,a=!1,s=r.toUpperCase(),y=l[s].database_id;if(!y)return[];let m={},c={},h,f;if(r==="EPISODES"){f=Oo;let{podcasts:_}=o,T=[],E=[];!!_&&E.push(..._==null?void 0:_.split(",")),vo(E)>0&&Do(E,g=>T.push({property:t.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||oe(m))){await V();let _;h?((h==null?void 0:h.or.length)===0&&(h={and:[{property:t.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),_=await n({database_id:y,filter:h,sorts:f}),m=_,c=Le({config:e,results:_.results,routeType:i}),m=Co(m,"results"),m.results=c):a=!0}return m},ye=No;var x,Go=class extends Lo{constructor(o){super(o);Pe(this,x,void 0);this.custom={getBlocksByIdChildren:async o=>await re(this.blocks.children.list,b({},o)),getDatabasesByIdQuery:async o=>await ne(this.databases.query,o),getDeepFetchAllChildren:async o=>await ie(this.blocks.children.list,b({},o)),getInfoType:o=>se(k(b({},o),{config:B(this,x)})),getPagesById:async o=>await de(this.pages.retrieve,b({},o)),getPathVariables:o=>ce(k(b({},o),{config:B(this,x)})),getQuery:async o=>await ye(k(b({},o),{config:B(this,x),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[v.LISTING]:async o=>await le(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.LISTING_BY_DATE]:async o=>await pe(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.SLUG]:async o=>await _e(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[v.SLUG_BY_ROUTE]:async o=>await ue(k(b({},o),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};fe(this,x,o==null?void 0:o.config)}};x=new WeakMap;export{Go as Client};
1
+ var Xe=Object.defineProperty,et=Object.defineProperties;var tt=Object.getOwnPropertyDescriptors;var ue=Object.getOwnPropertySymbols;var ot=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable;var de=(e,o,n)=>o in e?Xe(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,b=(e,o)=>{for(var n in o||(o={}))ot.call(o,n)&&de(e,n,o[n]);if(ue)for(var n of ue(o))rt.call(o,n)&&de(e,n,o[n]);return e},k=(e,o)=>et(e,tt(o));var ce=(e,o,n)=>{if(!o.has(e))throw TypeError("Cannot "+n)};var L=(e,o,n)=>(ce(e,o,"read from private field"),n?n.call(e):o.get(e)),ye=(e,o,n)=>{if(o.has(e))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(e):o.set(e,n)},me=(e,o,n,l)=>(ce(e,o,"write to private field"),l?l.call(e,n):o.set(e,n),n);import{Client as xo}from"@notionhq/client";import N from"lodash/filter.js";import nt from"lodash/map.js";var O=({key:e,notion:o,type:n})=>({key:e,notion:o,type:n}),t={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[t.authors,t.datePublished,t.isIndexed,t.isPublished,t.slug,t.seoDescription,t.seoImage,t.seoImageDescription,t.title],he=[...G],Se=[...G,t.dateRecorded,t.duration,t.episode,t.mp3,t.season,t.relationEpisodes__People_Guest,t.relationEpisodes__People_Sound_Engineer,t.relationEpisodes__People_Thanks,t.relationEpisodes__Podcast,t.relationEpisodes__Venues,t.socialApple,t.socialSpotify,t.type],Pe=[...G,t.dateEvent,t.relationEvents__People_Guest_Music,t.relationEvents__People_Guest,t.relationEvents__People_Host,t.relationEvents__Shows_Lineup,t.relationEvents__Shows,t.relationEvents__Venues,t.socialFacebook,t.socialWebsite,t.ticketUrl,t.rollupEvents__People_Cast,t.rollupEvents__People_Guest_Music,t.rollupEvents__People_Guest,t.rollupEvents__People_Host,t.rollupEvents__Shows_Lineup,t.rollupEvents__Shows,t.rollupEvents__Venues],fe=[...G],Ee=[...G,t.email,t.nameFirst,t.nameLast,t.namePreferred,t.relationPeople__Episodes_Guest,t.relationPeople__Episodes_Sound_Engineer,t.relationPeople__Episodes_Thanks,t.relationPeople__Events_Guest,t.relationPeople__Events_Guest_Music,t.relationPeople__Events_Host,t.relationPeople__Podcasts_Host,t.relationPeople__Podcasts_Sound_Engineer,t.relationPeople__Shows_Cast,t.relationPeople__Shows_Cast_Past,t.relationPeople__Shows_Director,t.relationPeople__Shows_Director_Musical,t.relationPeople__Shows_Director_Technical,t.relationPeople__Shows_Producer,t.relationPeople__Shows_Thanks,t.relationPeople__Shows_Writer],ge=[...G,t.categories,t.explicit,t.podcastAuthor,t.podcastAuthorEmail,t.relationPodcasts__People_Host,t.relationPodcasts__People_Sound_Engineer,t.socialApple,t.socialSpotify,t.type,t.relationPodcasts__Episodes],we=[...G],be=[...G,t.relationShows__People_Cast,t.relationShows__People_Cast_Past,t.relationShows__People_Director,t.relationShows__People_Director_Musical,t.relationShows__People_Director_Technical,t.relationShows__People_Producer,t.relationShows__People_Thanks,t.relationShows__People_Writer,t.relationShows__Tags,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationShows__Events,t.relationShows__Events_Lineup,t.rollupShows__People_Cast,t.rollupShows__People_Cast_Slug,t.rollupShows__People_Cast_Past,t.rollupShows__People_Crew,t.rollupShows__People_Director,t.rollupShows__People_Director_Musical,t.rollupShows__People_Director_Technical,t.rollupShows__People_Music,t.rollupShows__People_Producer,t.rollupShows__People_Thanks,t.rollupShows__People_Writer,t.rollupShows__Tags],Te=[...G,t.addressCity,t.addressLatitude,t.addressLongitude,t.addressNeighborhood,t.addressState,t.addressStreet,t.addressZipCode,t.phoneNumber,t.socialFacebook,t.socialInstagram,t.socialTwitter,t.socialWebsite,t.relationVenues__Episodes,t.relationVenues__Events],Bo={BLOG:N(he,{init:!0}),EPISODES:N(Se,{init:!0}),EVENTS:N(Pe,{init:!0}),PAGES:N(fe,{init:!0}),PEOPLE:N(Ee,{init:!0}),PODCASTS:N(ge,{init:!0}),SEO:N(we,{init:!0}),SHOWS:N(be,{init:!0}),VENUES:N(Te,{init:!0})},ke={BLOG:he.map(e=>O(e)),EPISODES:Se.map(e=>O(e)),EVENTS:Pe.map(e=>O(e)),PAGES:fe.map(e=>O(e)),PEOPLE:Ee.map(e=>O(e)),PODCASTS:ge.map(e=>O(e)),SEO:we.map(e=>O(e)),SHOWS:be.map(e=>O(e)),VENUES:Te.map(e=>O(e))},Ie=nt(t,e=>O(e)),De=new Date().toISOString(),A={dateBefore:{property:t.datePublished.notion,date:{before:De}},dateOnOrAfter:{property:t.datePublished.notion,date:{on_or_after:De}},published:{property:t.isPublished.notion,checkbox:{equals:!1}},slug:{property:t.slug.notion,text:{equals:""}}},it="LISTING",st="LISTING_BY_DATE",at="SLUG",lt="SLUG_BY_ROUTE",pt=[it,st,at,lt],C=Object.assign({},...pt.map(e=>({[e]:e})).flat(1));import{avoidRateLimit as _t,isUndefined as ut}from"@jeromefitz/utils";var dt=async(e,{block_id:o})=>ut(o)?[]:(await _t(),await e({block_id:o})),q=dt;var Ce={sorts:[{property:t.slug.notion,direction:"ascending"}]},ct=async(e,{database_id:o,sorts:n=Ce.sorts,filter:l=Ce.filter})=>o?await e({database_id:o,sorts:n,filter:l}):[],Z=ct;var ve=async(e,{blocks:o})=>{if(o==null)return o;let n=o.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await ve(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return o},K=ve;var yt=({config:e,item:o,routeType:n,meta:l})=>{var c,u,y,f,_;let{NOTION:r}=e,i="",a=(c=o.properties)==null?void 0:c.slug,s="",d="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(y=(u=o.properties)==null?void 0:u.datePublished)==null?void 0:y.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(_=(f=o.properties)==null?void 0:f.dateEvent)==null?void 0:_.start.slice(0,10);let[p,w,m]=i==null?void 0:i.split("-");s=`/${n}/${p}/${w}/${m}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:d,slug:a}},J=yt;import{sortObject as je}from"@jeromefitz/utils";import to from"lodash/map.js";import re from"lodash/omit.js";import xe from"date-fns/addDays/index.js";import mt from"date-fns/addMonths/index.js";import ht from"date-fns/addYears/index.js";var St=(e,o)=>{switch(o){case"year":return ht(e,1).toISOString();case"month":return mt(e,1).toISOString();case"day":return xe(e,2).toISOString()}return xe(e,-1).toISOString()},D=St;import Pt from"lodash/map.js";var ft=({config:e,data:o,pathVariables:n,pageId:l})=>{var c,u;let{NOTION:r}=e,i={};if(!(o==null?void 0:o.properties))return i;let{properties:a}=o,s;if(n){let{meta:y,routeType:f}=n;s=f===((c=r==null?void 0:r.PODCASTS)==null?void 0:c.routeType)&&y.length>1?(u=r==null?void 0:r.EPISODES)==null?void 0:u.routeType:f}let d=s?ke[s.toUpperCase()]:Ie;return Pt(d,y=>{let f,_=a[y.notion];i[y.key]=null,_&&(f=U[y.type](_,l),i[y.key]=f||null)}),i},I=ft;import{sortObject as Et}from"@jeromefitz/utils";import gt from"lodash/map.js";import wt from"lodash/omit.js";var bt=({config:e,results:o,routeType:n})=>{let l=[];return gt(o,r=>{let i=wt(r,"properties");i.properties=Et(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Oe=bt;import Tt from"lodash/filter.js";import X from"lodash/map.js";var kt=(e,o)=>{switch(o){case"info":let n=[];return X(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&Tt(e,{object:"block",type:"image"});case"items":let l=[];return X(e,r=>{var i;X((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},R=kt;import It from"github-slugger";import ee from"lodash/map.js";import{getPlaiceholder as te}from"plaiceholder";var Dt=async({data:e,pathVariables:o})=>{var u,y,f,_,T,E,g;let n=new It,l={},r=((u=e.info)==null?void 0:u.object)==="page"?R((y=e.info)==null?void 0:y.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&R((T=(_=e.info)==null?void 0:_.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async p=>{if(!p)return null;let w=!!p&&!!(p==null?void 0:p.url)?p==null?void 0:p.url:p;if(!w)return null;let{base64:m,img:P}=await te(w),x=n.slug(w);return{base64:m,id:x,img:P,url:w}}),a=i?await Promise.all(i):[],s=!o.isIndex&&R(e==null?void 0:e.content,"content"),d=!!s&&s.map(async p=>{var B,M;if(!p)return null;let{type:w}=p,m=p[w],P=!!p&&!!((B=m==null?void 0:m.external)==null?void 0:B.url)?(M=m==null?void 0:m.external)==null?void 0:M.url:null;if(!P)return null;let{base64:x,img:H}=await te(P),V=n.slug(P);return{base64:x,id:V,img:H,url:P}}),c=d?await Promise.all(d):[];if(e.items){let p=e.items.object==="page"?R((E=e.items)==null?void 0:E.data,"items"):R((g=e.items)==null?void 0:g.results,"items"),w=!!p&&p.map(async P=>{if(!P)return null;let x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:H,img:V}=await te(x),B=n.slug(x);return{base64:H,id:B,img:V,url:x}}),m=await Promise.all(w);!!m&&m[0]&&ee(m,P=>l[P.id]=P)}return!!a&&a[0]&&ee(a,p=>l[p.id]=p),!!c&&c[0]&&ee(c,p=>l[p.id]=p),l},F=Dt;var Ct=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),Q=Ct;var vt=e=>e.checkbox||!1,Ne=vt;var xt=e=>{let{type:o}=e;return e[o]},j=xt;var Ot=e=>e.email||null,Ge=Ot;import{stringToUUID as Nt}from"@jeromefitz/utils";import Gt from"github-slugger";import Lt from"lodash/size.js";var Bt="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",At=(e,o)=>Bt.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",Nt(o)),Ut=(e,o)=>{let n=new Gt,l={};return Lt(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],d=n.slug(s);l[d]={type:r==null?void 0:r.type,url:At(s,o)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],d=n.slug(s);l[d]={type:r==null?void 0:r.type,url:s}}}),l},oe=Ut;import Vt from"github-slugger";import Mt from"lodash/map.js";var Rt=e=>{let o=new Vt,n={};return Mt(e.multi_select,l=>{let r=l;r.slug=o.slug(r.name),n[r.id]=r}),n},Le=Rt;var Ht=e=>(e==null?void 0:e.number)||null,Be=Ht;import Wt from"github-slugger";var Ft=e=>{let o=new Wt;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[o.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},Ae=Ft;var Qt=e=>(e==null?void 0:e.phone_number)||null,Ue=Qt;import Ve from"lodash/map.js";var jt=e=>e.type==="rollup"?e.rollup.type==="array"&&Ve(e.rollup.array,o=>U[o.type](o))[0]:Ve(e.relation,o=>o.id),Me=jt;var zt=e=>{var o;return(e==null?void 0:e.rich_text)?(o=e==null?void 0:e.rich_text[0])==null?void 0:o.plain_text:null},Re=zt;import $t from"lodash/map.js";import Yt from"lodash/sortBy.js";var qt=e=>{var o;return Yt($t((o=e==null?void 0:e.rollup)==null?void 0:o.array,n=>U[n.type](n)))},He=qt;import Zt from"github-slugger";var Kt=e=>{let o=new Zt,n=e.select;return n?(n.slug=o.slug(e.select.name),{[n.id]:n}):null},We=Kt;var Jt=e=>{var o;return(e==null?void 0:e.title)?(o=e==null?void 0:e.title[0])==null?void 0:o.plain_text:null},Fe=Jt;var Xt=e=>e.url||null,Qe=Xt;var eo={checkbox:Ne,created_by:Q,created_time:j,date:j,email:Ge,files:oe,formula:Q,image:oe,last_edited_by:Q,last_edited_time:j,multi_select:Le,number:Be,people:Ae,phone_number:Ue,relation:Me,rich_text:Re,rollup:He,select:We,title:Fe,url:Qe},U=eo;var oo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},d={},c={},u=new Date().toISOString(),y=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,_=await l({page_id:f});if(!_)return{};(_==null?void 0:_.object)==="page"&&(d=re(_,"properties"),d.properties=je(I({config:e,data:_,pathVariables:r,pageId:d.id}))),s=await o({block_id:d.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?u:y}}]}}),E=[];to(T.results,m=>{let P=m;P=re(P,"properties"),P.properties=je(I({config:e,data:m,pathVariables:r,pageId:m.id})),E.push(P)});let g=re(T,"results");g.results=E,c=g;let p={info:d,content:s,items:c,images:{}},w=p?await F({data:p,pathVariables:r}):{};return p=k(b({},p),{images:w}),p},ne=oo;import{sortObject as ze}from"@jeromefitz/utils";import ro from"lodash/map.js";import z from"lodash/omit.js";import no from"lodash/size.js";var io=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:d}=r,c={},u={},y={},f=new Date().toISOString(),_=s[i.toUpperCase()].page_id__seo,T=await l({page_id:_});T.object==="page"&&(u=z(T,"properties"),u.properties=ze(I({config:e,data:T,pathVariables:r,pageId:u.id}))),c=await o({block_id:u.id});let E=no(d),[g,p,w]=d,m=new Date(`${g||f.slice(0,4)}-${p||"01"}-${w||"01"}`),P,x=[{property:t.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(m,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(m,"day")}},k(b({},A.slug),{text:{equals:a}})]};break}let H=s[i.toUpperCase()].database_id,V=await n({database_id:H,filter:P,sorts:x}),B=[];ro(V.results,Y=>{let W=Y;W=z(W,"properties"),W.properties=ze(I({config:e,data:Y,pathVariables:r,pageId:Y.id})),!!W&&B.push(W)});let M=z(V,"results");M.results=B,y=M,y=z(M,"data");let $={info:u,content:c,items:y,images:{}},Je={};return $=k(b({},$),{images:Je}),$},ie=io;import{sortObject as so}from"@jeromefitz/utils";import ao from"lodash/filter.js";import lo from"lodash/omit.js";var po=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,d={},c={},u={},y=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(y))return{info:c,content:d,items:u,images:{}};let _=await n({database_id:s[y].database_id,filter:{and:[k(b({},A.slug),{text:{equals:a}})]}}),T=(_==null?void 0:_.object)==="list"&&_.results[0];if(!T)return{};c=lo(T,"properties"),c.properties=so(I({config:e,data:T,pathVariables:r,pageId:c.id})),d=await o({block_id:c.id}),d=[...await l({blocks:d.results})],u&&(u.results=ao(u.results,{properties:{isPublished:!0}}));let g={info:c,content:d,items:u,images:{}},p=g?await F({data:g,pathVariables:r}):{};return g=k(b({},g),{images:p}),g},se=po;import{sortObject as $e}from"@jeromefitz/utils";import Ye from"lodash/omit.js";import _o from"lodash/size.js";var uo=async({config:e,getBlocksByIdChildren:o,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:d}=r,c={},u={},y={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=d,p=_o(d)===2,w=await n({database_id:s[p?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},A.slug),{text:{equals:p?g:E}})]}}),m=(w==null?void 0:w.object)==="list"&&w.results[0];if(!m)return{};u=Ye(m,"properties"),u.properties=$e(I({config:e,data:m,pathVariables:r,pageId:u.id})),c=await o({block_id:u.id}),p||i===s.PODCASTS.routeType&&(y=await l({config:e,reqQuery:{podcasts:u.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,p]=d,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${p||"01"}`),m=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{on_or_after:D(w,"")}},{property:i===s.EVENTS.routeType?t.dateEvent.notion:t.datePublished.notion,date:{before:D(w,"day")}},k(b({},A.slug),{text:{equals:a}})]}}),P=(m==null?void 0:m.object)==="list"&&m.results[0];P&&(u=Ye(P,"properties"),u.properties=$e(I({config:e,data:P,pathVariables:r,pageId:u.id})),c=await o({block_id:u.id}))}let _={info:u,content:c,items:y,images:{}},T={};return _=k(b({},_),{images:T}),_},ae=uo;import{avoidRateLimit as co,isUndefined as yo}from"@jeromefitz/utils";var mo=async(e,{page_id:o})=>yo(o)?[]:(await co(),await e({page_id:o})),le=mo;import qe from"lodash/drop.js";import ho from"lodash/dropRight.js";import So from"lodash/first.js";import Ze from"lodash/includes.js";import Po from"lodash/isInteger.js";import fo from"lodash/join.js";import Eo from"lodash/last.js";import Ke from"lodash/size.js";var go=({config:e,catchAll:o})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=Ke(o),a=So(o),s=Eo(o),d=i>1&&Ze([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?qe(o):qe(ho(o)),c=a===s&&!Ze(r,a)?"pages":a,u=a!==s&&!Po(parseInt(s))?s:a,y=c==="pages",f=u===a,_=!!d&&Ke(d)!==0,T=y&&a===l?"":fo(o,"/"),E=C.SLUG;return y?E=C.SLUG:f&&!_?E=C.LISTING:f&&_?E=C.LISTING_BY_DATE:_?E=C.SLUG_BY_ROUTE:E=C.SLUG,{dataType:E,hasMeta:_,isPage:y,isIndex:f,meta:d,routeType:c,slug:u,url:T}},pe=go;import{avoidRateLimit as wo,isObjectEmpty as bo}from"@jeromefitz/utils";import To from"lodash/map.js";import ko from"lodash/omit.js";import Io from"lodash/size.js";var Do={ASCENDING:"ascending",DESCENDING:"descending"},Co=[{property:t.slug.notion,direction:Do.ASCENDING}],vo=async({config:e,reqQuery:o,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=o,i=r,a=!1,s=r.toUpperCase(),d=l[s].database_id;if(!d)return[];let c={},u={},y,f;if(r==="EPISODES"){f=Co;let{podcasts:_}=o,T=[],E=[];!!_&&E.push(..._==null?void 0:_.split(",")),Io(E)>0&&To(E,g=>T.push({property:t.relationEpisodes__Podcast.notion,relation:{contains:g}})),y={or:[...T]}}else a=!0;if(!a&&(!c||bo(c))){await wo();let _;y?((y==null?void 0:y.or.length)===0&&(y={and:[{property:t.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),_=await n({database_id:d,filter:y,sorts:f}),c=_,u=Oe({config:e,results:_.results,routeType:i}),c=ko(c,"results"),c.results=u):a=!0}return c},_e=vo;var v,Oo=class extends xo{constructor(o){super(o);ye(this,v,void 0);this.custom={getBlocksByIdChildren:async o=>await q(this.blocks.children.list,b({},o)),getDatabasesByIdQuery:async o=>await Z(this.databases.query,o),getDeepFetchAllChildren:async o=>await K(this.blocks.children.list,b({},o)),getInfoType:o=>J(k(b({},o),{config:L(this,v)})),getPagesById:async o=>await le(this.pages.retrieve,b({},o)),getPathVariables:o=>pe(k(b({},o),{config:L(this,v)})),getQuery:async o=>await _e(k(b({},o),{config:L(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[C.LISTING]:async o=>await ne(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.LISTING_BY_DATE]:async o=>await ie(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[C.SLUG]:async o=>await se(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[C.SLUG_BY_ROUTE]:async o=>await ae(k(b({},o),{config:L(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};me(this,v,o==null?void 0:o.config)}};v=new WeakMap;export{Oo as Client};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeromefitz/notion",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Notion: Custom Client for jeromefitzgerald.com",
5
5
  "author": {
6
6
  "name": "Jerome Fitzgerald",
@@ -1 +1 @@
1
- var r=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var u=t=>r(t,"__esModule",{value:!0});var l=(t,e)=>{for(var i in e)r(t,i,{get:e[i],enumerable:!0})},c=(t,e,i,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!s.call(t,o)&&(i||o!=="default")&&r(t,o,{get:()=>e[o],enumerable:!(d=f(e,o))||d.enumerable});return t};var g=(t=>(e,i)=>t&&t.get(e)||(i=c(u({}),e,1),t&&t.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0);var L={};l(L,{default:()=>I});var y=250;async function T(){await U()}function U(t=y){return new Promise(e=>setTimeout(e,t))}var a=T;var w=t=>t===void 0&&typeof t=="undefined",n=w;var x=async(t,{block_id:e})=>n(e)?[]:(await a(),await t({block_id:e})),I=x;module.exports=g(L);0&&(module.exports={});
1
+ var s=Object.create;var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var o=t=>n(t,"__esModule",{value:!0});var l=(t,a)=>{for(var e in a)n(t,e,{get:a[e],enumerable:!0})},f=(t,a,e,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of u(a))!c.call(t,i)&&(e||i!=="default")&&n(t,i,{get:()=>a[i],enumerable:!(d=m(a,i))||d.enumerable});return t},p=(t,a)=>f(o(n(t!=null?s(y(t)):{},"default",!a&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),w=(t=>(a,e)=>t&&t.get(a)||(e=f(o({}),a,1),t&&t.set(a,e),e))(typeof WeakMap!="undefined"?new WeakMap:0);var h={};l(h,{default:()=>g});var r=p(require("@jeromefitz/utils"),1),B=async(t,{block_id:a})=>(0,r.isUndefined)(a)?[]:(await(0,r.avoidRateLimit)(),await t({block_id:a})),g=B;module.exports=w(h);0&&(module.exports={});
@@ -1 +1 @@
1
- var a=250;async function n(){await d()}function d(t=a){return new Promise(e=>setTimeout(e,t))}var r=n;var f=t=>t===void 0&&typeof t=="undefined",m=f;var p=async(t,{block_id:e})=>m(e)?[]:(await r(),await t({block_id:e})),T=p;export{T as default};
1
+ import{avoidRateLimit as e,isUndefined as i}from"@jeromefitz/utils";var n=async(a,{block_id:t})=>i(t)?[]:(await e(),await a({block_id:t})),f=n;export{f as default};
@@ -1 +1 @@
1
- var We=Object.create;var C=Object.defineProperty,Fe=Object.defineProperties,Re=Object.getOwnPropertyDescriptor,Be=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertyNames,Y=Object.getOwnPropertySymbols,ze=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable;var K=(e,t,r)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q=(e,t)=>{for(var r in t||(t={}))Z.call(t,r)&&K(e,r,t[r]);if(Y)for(var r of Y(t))Ye.call(t,r)&&K(e,r,t[r]);return e},Q=(e,t)=>Fe(e,Be(t)),J=e=>C(e,"__esModule",{value:!0});var Ze=(e,t)=>{for(var r in t)C(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of je(t))!Z.call(e,n)&&(r||n!=="default")&&C(e,n,{get:()=>t[n],enumerable:!(a=Re(t,n))||a.enumerable});return e},p=(e,t)=>X(J(C(e!=null?We(ze(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Ke=(e=>(t,r)=>e&&e.get(t)||(r=X(J({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Do={};Ze(Do,{default:()=>bo});var Ve=p(require("lodash/map.js"),1),V=p(require("lodash/omit.js"),1);var E=p(require("lodash/filter.js"),1),$=p(require("lodash/map.js"),1),w=({key:e,notion:t,type:r})=>({key:e,notion:t,type:r}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},k=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],ee=[...k],oe=[...k,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],te=[...k,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],ne=[...k],re=[...k,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],ie=[...k,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],se=[...k],le=[...k,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],ae=[...k,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],Io={BLOG:(0,E.default)(ee,{init:!0}),EPISODES:(0,E.default)(oe,{init:!0}),EVENTS:(0,E.default)(te,{init:!0}),PAGES:(0,E.default)(ne,{init:!0}),PEOPLE:(0,E.default)(re,{init:!0}),PODCASTS:(0,E.default)(ie,{init:!0}),SEO:(0,E.default)(se,{init:!0}),SHOWS:(0,E.default)(le,{init:!0}),VENUES:(0,E.default)(ae,{init:!0})},_e={BLOG:ee.map(e=>w(e)),EPISODES:oe.map(e=>w(e)),EVENTS:te.map(e=>w(e)),PAGES:ne.map(e=>w(e)),PEOPLE:re.map(e=>w(e)),PODCASTS:ie.map(e=>w(e)),SEO:se.map(e=>w(e)),SHOWS:le.map(e=>w(e)),VENUES:ae.map(e=>w(e))},pe=(0,$.default)(o,e=>w(e)),ue=new Date().toISOString(),xo={dateBefore:{property:o.datePublished.notion,date:{before:ue}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:ue}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},qe="LISTING",Qe="LISTING_BY_DATE",Je="SLUG",Xe="SLUG_BY_ROUTE",$e=[qe,Qe,Je,Xe],Co=Object.assign({},...$e.map(e=>({[e]:e})).flat(1));var ce=p(require("lodash/map.js"),1);var eo=({config:e,data:t,pathVariables:r,pageId:a})=>{var f,T;let{NOTION:n}=e,u={};if(!(t==null?void 0:t.properties))return u;let{properties:s}=t,c;if(r){let{meta:h,routeType:P}=r;c=P===((f=n==null?void 0:n.PODCASTS)==null?void 0:f.routeType)&&h.length>1?(T=n==null?void 0:n.EPISODES)==null?void 0:T.routeType:P}let d=c?_e[c.toUpperCase()]:pe;return(0,ce.default)(d,h=>{let P,m=s[h.notion];u[h.key]=null,m&&(P=b[h.type](m,a),u[h.key]=P||null)}),u},L=eo;var ye=p(require("lodash/fromPairs.js"),1),de=p(require("lodash/sortBy.js"),1),me=p(require("lodash/toPairs.js"),1),oo=e=>(0,ye.default)((0,de.default)((0,me.default)(e))),A=oo;var he=p(require("lodash/filter.js"),1),O=p(require("lodash/map.js"),1),to=(e,t)=>{switch(t){case"info":let r=[];return(0,O.default)(e.seoImage,n=>!!(n==null?void 0:n.url)&&(n==null?void 0:n.type)==="external"&&r.push(n==null?void 0:n.url)),r;case"content":return!!e&&(0,he.default)(e,{object:"block",type:"image"});case"items":let a=[];return(0,O.default)(e,n=>{var u;(0,O.default)((u=n==null?void 0:n.properties)==null?void 0:u.seoImage,s=>!!(s==null?void 0:s.url)&&(s==null?void 0:s.type)==="external"&&a.push(s==null?void 0:s.url))}),a;default:return[]}},D=to;var Pe=p(require("github-slugger"),1),M=p(require("lodash/map.js"),1),U=p(require("plaiceholder"),1);var no=async({data:e,pathVariables:t})=>{var T,h,P,m,v,I,x;let r=new Pe.default,a={},n=((T=e.info)==null?void 0:T.object)==="page"?D((h=e.info)==null?void 0:h.properties,"info"):!!((P=e.info)==null?void 0:P.results)&&D((v=(m=e.info)==null?void 0:m.results[0])==null?void 0:v.properties,"info"),u=!!n&&n.map(async i=>{if(!i)return null;let S=!!i&&!!(i==null?void 0:i.url)?i==null?void 0:i.url:i;if(!S)return null;let{base64:y,img:l}=await(0,U.getPlaiceholder)(S),g=r.slug(S);return{base64:y,id:g,img:l,url:S}}),s=u?await Promise.all(u):[],c=!t.isIndex&&D(e==null?void 0:e.content,"content"),d=!!c&&c.map(async i=>{var G,z;if(!i)return null;let{type:S}=i,y=i[S],l=!!i&&!!((G=y==null?void 0:y.external)==null?void 0:G.url)?(z=y==null?void 0:y.external)==null?void 0:z.url:null;if(!l)return null;let{base64:g,img:W}=await(0,U.getPlaiceholder)(l),F=r.slug(l);return{base64:g,id:F,img:W,url:l}}),f=d?await Promise.all(d):[];if(e.items){let i=e.items.object==="page"?D((I=e.items)==null?void 0:I.data,"items"):D((x=e.items)==null?void 0:x.results,"items"),S=!!i&&i.map(async l=>{if(!l)return null;let g=!!l&&!!(l==null?void 0:l.url)?l==null?void 0:l.url:l;if(!g)return null;let{base64:W,img:F}=await(0,U.getPlaiceholder)(g),G=r.slug(g);return{base64:W,id:G,img:F,url:g}}),y=await Promise.all(S);!!y&&y[0]&&(0,M.default)(y,l=>a[l.id]=l)}return!!s&&s[0]&&(0,M.default)(s,i=>a[i.id]=i),!!f&&f[0]&&(0,M.default)(f,i=>a[i.id]=i),a},R=no;var ro=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),N=ro;var io=e=>e.checkbox||!1,Se=io;var so=e=>{let{type:t}=e;return e[t]},H=so;var lo=e=>e.email||null,Ee=lo;var fe=p(require("github-slugger"),1),ke=p(require("lodash/size.js"),1);var ao=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),we=ao;var _o="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",po=(e,t)=>_o.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",we(t)),uo=(e,t)=>{let r=new fe.default,a={};return(0,ke.default)(e.files)<=0||e.files.map(n=>{var u,s;if((n==null?void 0:n.type)==="file"){let c=(u=n==null?void 0:n.file)==null?void 0:u.url.split("?")[0],d=r.slug(c);a[d]={type:n==null?void 0:n.type,url:po(c,t)}}if((n==null?void 0:n.type)==="external"){let c=(s=n==null?void 0:n.external)==null?void 0:s.url.split("?")[0],d=r.slug(c);a[d]={type:n==null?void 0:n.type,url:c}}}),a},B=uo;var ge=p(require("github-slugger"),1),Te=p(require("lodash/map.js"),1),co=e=>{let t=new ge.default,r={};return(0,Te.default)(e.multi_select,a=>{let n=a;n.slug=t.slug(n.name),r[n.id]=n}),r},be=co;var yo=e=>(e==null?void 0:e.number)||null,De=yo;var ve=p(require("github-slugger"),1),mo=e=>{let t=new ve.default;return e.people.map(r=>{let{avatar_url:a,id:n,name:u,person:s}=r,{email:c}=s;return{[t.slug(u)]:{avatar_url:a,email:c,id:n,name:u}}})[0]},Ie=mo;var ho=e=>(e==null?void 0:e.phone_number)||null,xe=ho;var j=p(require("lodash/map.js"),1);var Po=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,j.default)(e.rollup.array,t=>b[t.type](t))[0]:(0,j.default)(e.relation,t=>t.id),Ce=Po;var So=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},Ge=So;var Le=p(require("lodash/map.js"),1),Ae=p(require("lodash/sortBy.js"),1);var Eo=e=>{var t;return(0,Ae.default)((0,Le.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,r=>b[r.type](r)))},Oe=Eo;var Me=p(require("github-slugger"),1),wo=e=>{let t=new Me.default,r=e.select;return r?(r.slug=t.slug(e.select.name),{[r.id]:r}):null},Ue=wo;var fo=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},Ne=fo;var ko=e=>e.url||null,He=ko;var go={checkbox:Se,created_by:N,created_time:H,date:H,email:Ee,files:B,formula:N,image:B,last_edited_by:N,last_edited_time:H,multi_select:be,number:De,people:Ie,phone_number:xe,relation:Ce,rich_text:Ge,rollup:Oe,select:Ue,title:Ne,url:He},b=go;var To=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:r,getPagesById:a,pathVariables:n,routeType:u})=>{let{NOTION:s}=e,c={},d={},f={},T=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),P=s[u.toUpperCase()].page_id__seo,m=await a({page_id:P});if(!m)return{};(m==null?void 0:m.object)==="page"&&(d=(0,V.default)(m,"properties"),d.properties=A(L({config:e,data:m,pathVariables:n,pageId:d.id}))),c=await t({block_id:d.id});let v=await r({database_id:s[u.toUpperCase()].database_id,filter:{and:[{property:u===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:u===s.EVENTS.routeType?T:h}}]}}),I=[];(0,Ve.default)(v.results,y=>{let l=y;l=(0,V.default)(l,"properties"),l.properties=A(L({config:e,data:y,pathVariables:n,pageId:y.id})),I.push(l)});let x=(0,V.default)(v,"results");x.results=I,f=x;let i={info:d,content:c,items:f,images:{}},S=i?await R({data:i,pathVariables:n}):{};return i=Q(q({},i),{images:S}),i},bo=To;module.exports=Ke(Do);0&&(module.exports={});
1
+ var He=Object.create;var x=Object.defineProperty,Ue=Object.defineProperties,Ve=Object.getOwnPropertyDescriptor,We=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertyNames,Y=Object.getOwnPropertySymbols,Re=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var K=(e,t,r)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q=(e,t)=>{for(var r in t||(t={}))Z.call(t,r)&&K(e,r,t[r]);if(Y)for(var r of Y(t))Be.call(t,r)&&K(e,r,t[r]);return e},Q=(e,t)=>Ue(e,We(t)),J=e=>x(e,"__esModule",{value:!0});var je=(e,t)=>{for(var r in t)x(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Fe(t))!Z.call(e,n)&&(r||n!=="default")&&x(e,n,{get:()=>t[n],enumerable:!(a=Ve(t,n))||a.enumerable});return e},p=(e,t)=>X(J(x(e!=null?He(Re(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),ze=(e=>(t,r)=>e&&e.get(t)||(r=X(J({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var fo={};je(fo,{default:()=>wo});var j=p(require("@jeromefitz/utils"),1),Ne=p(require("lodash/map.js"),1),U=p(require("lodash/omit.js"),1);var E=p(require("lodash/filter.js"),1),$=p(require("lodash/map.js"),1),w=({key:e,notion:t,type:r})=>({key:e,notion:t,type:r}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},k=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],ee=[...k],oe=[...k,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],te=[...k,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],ne=[...k],re=[...k,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],ie=[...k,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],se=[...k],le=[...k,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],ae=[...k,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],go={BLOG:(0,E.default)(ee,{init:!0}),EPISODES:(0,E.default)(oe,{init:!0}),EVENTS:(0,E.default)(te,{init:!0}),PAGES:(0,E.default)(ne,{init:!0}),PEOPLE:(0,E.default)(re,{init:!0}),PODCASTS:(0,E.default)(ie,{init:!0}),SEO:(0,E.default)(se,{init:!0}),SHOWS:(0,E.default)(le,{init:!0}),VENUES:(0,E.default)(ae,{init:!0})},_e={BLOG:ee.map(e=>w(e)),EPISODES:oe.map(e=>w(e)),EVENTS:te.map(e=>w(e)),PAGES:ne.map(e=>w(e)),PEOPLE:re.map(e=>w(e)),PODCASTS:ie.map(e=>w(e)),SEO:se.map(e=>w(e)),SHOWS:le.map(e=>w(e)),VENUES:ae.map(e=>w(e))},pe=(0,$.default)(o,e=>w(e)),ue=new Date().toISOString(),To={dateBefore:{property:o.datePublished.notion,date:{before:ue}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:ue}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Ye="LISTING",Ze="LISTING_BY_DATE",Ke="SLUG",qe="SLUG_BY_ROUTE",Qe=[Ye,Ze,Ke,qe],bo=Object.assign({},...Qe.map(e=>({[e]:e})).flat(1));var ce=p(require("lodash/map.js"),1);var Je=({config:e,data:t,pathVariables:r,pageId:a})=>{var f,T;let{NOTION:n}=e,_={};if(!(t==null?void 0:t.properties))return _;let{properties:s}=t,c;if(r){let{meta:P,routeType:m}=r;c=m===((f=n==null?void 0:n.PODCASTS)==null?void 0:f.routeType)&&P.length>1?(T=n==null?void 0:n.EPISODES)==null?void 0:T.routeType:m}let d=c?_e[c.toUpperCase()]:pe;return(0,ce.default)(d,P=>{let m,h=s[P.notion];_[P.key]=null,h&&(m=b[P.type](h,a),_[P.key]=m||null)}),_},L=Je;var ye=p(require("lodash/filter.js"),1),A=p(require("lodash/map.js"),1),Xe=(e,t)=>{switch(t){case"info":let r=[];return(0,A.default)(e.seoImage,n=>!!(n==null?void 0:n.url)&&(n==null?void 0:n.type)==="external"&&r.push(n==null?void 0:n.url)),r;case"content":return!!e&&(0,ye.default)(e,{object:"block",type:"image"});case"items":let a=[];return(0,A.default)(e,n=>{var _;(0,A.default)((_=n==null?void 0:n.properties)==null?void 0:_.seoImage,s=>!!(s==null?void 0:s.url)&&(s==null?void 0:s.type)==="external"&&a.push(s==null?void 0:s.url))}),a;default:return[]}},D=Xe;var de=p(require("github-slugger"),1),O=p(require("lodash/map.js"),1),M=p(require("plaiceholder"),1);var $e=async({data:e,pathVariables:t})=>{var T,P,m,h,v,C,I;let r=new de.default,a={},n=((T=e.info)==null?void 0:T.object)==="page"?D((P=e.info)==null?void 0:P.properties,"info"):!!((m=e.info)==null?void 0:m.results)&&D((v=(h=e.info)==null?void 0:h.results[0])==null?void 0:v.properties,"info"),_=!!n&&n.map(async i=>{if(!i)return null;let S=!!i&&!!(i==null?void 0:i.url)?i==null?void 0:i.url:i;if(!S)return null;let{base64:y,img:l}=await(0,M.getPlaiceholder)(S),g=r.slug(S);return{base64:y,id:g,img:l,url:S}}),s=_?await Promise.all(_):[],c=!t.isIndex&&D(e==null?void 0:e.content,"content"),d=!!c&&c.map(async i=>{var G,z;if(!i)return null;let{type:S}=i,y=i[S],l=!!i&&!!((G=y==null?void 0:y.external)==null?void 0:G.url)?(z=y==null?void 0:y.external)==null?void 0:z.url:null;if(!l)return null;let{base64:g,img:V}=await(0,M.getPlaiceholder)(l),W=r.slug(l);return{base64:g,id:W,img:V,url:l}}),f=d?await Promise.all(d):[];if(e.items){let i=e.items.object==="page"?D((C=e.items)==null?void 0:C.data,"items"):D((I=e.items)==null?void 0:I.results,"items"),S=!!i&&i.map(async l=>{if(!l)return null;let g=!!l&&!!(l==null?void 0:l.url)?l==null?void 0:l.url:l;if(!g)return null;let{base64:V,img:W}=await(0,M.getPlaiceholder)(g),G=r.slug(g);return{base64:V,id:G,img:W,url:g}}),y=await Promise.all(S);!!y&&y[0]&&(0,O.default)(y,l=>a[l.id]=l)}return!!s&&s[0]&&(0,O.default)(s,i=>a[i.id]=i),!!f&&f[0]&&(0,O.default)(f,i=>a[i.id]=i),a},F=$e;var eo=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),N=eo;var oo=e=>e.checkbox||!1,he=oo;var to=e=>{let{type:t}=e;return e[t]},H=to;var no=e=>e.email||null,Pe=no;var me=p(require("@jeromefitz/utils"),1),Se=p(require("github-slugger"),1),Ee=p(require("lodash/size.js"),1),ro="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",io=(e,t)=>ro.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",(0,me.stringToUUID)(t)),so=(e,t)=>{let r=new Se.default,a={};return(0,Ee.default)(e.files)<=0||e.files.map(n=>{var _,s;if((n==null?void 0:n.type)==="file"){let c=(_=n==null?void 0:n.file)==null?void 0:_.url.split("?")[0],d=r.slug(c);a[d]={type:n==null?void 0:n.type,url:io(c,t)}}if((n==null?void 0:n.type)==="external"){let c=(s=n==null?void 0:n.external)==null?void 0:s.url.split("?")[0],d=r.slug(c);a[d]={type:n==null?void 0:n.type,url:c}}}),a},R=so;var we=p(require("github-slugger"),1),fe=p(require("lodash/map.js"),1),lo=e=>{let t=new we.default,r={};return(0,fe.default)(e.multi_select,a=>{let n=a;n.slug=t.slug(n.name),r[n.id]=n}),r},ke=lo;var ao=e=>(e==null?void 0:e.number)||null,ge=ao;var Te=p(require("github-slugger"),1),_o=e=>{let t=new Te.default;return e.people.map(r=>{let{avatar_url:a,id:n,name:_,person:s}=r,{email:c}=s;return{[t.slug(_)]:{avatar_url:a,email:c,id:n,name:_}}})[0]},be=_o;var po=e=>(e==null?void 0:e.phone_number)||null,De=po;var B=p(require("lodash/map.js"),1);var uo=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,B.default)(e.rollup.array,t=>b[t.type](t))[0]:(0,B.default)(e.relation,t=>t.id),ve=uo;var co=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},Ce=co;var Ie=p(require("lodash/map.js"),1),xe=p(require("lodash/sortBy.js"),1);var yo=e=>{var t;return(0,xe.default)((0,Ie.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,r=>b[r.type](r)))},Ge=yo;var Le=p(require("github-slugger"),1),ho=e=>{let t=new Le.default,r=e.select;return r?(r.slug=t.slug(e.select.name),{[r.id]:r}):null},Ae=ho;var Po=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},Oe=Po;var mo=e=>e.url||null,Me=mo;var So={checkbox:he,created_by:N,created_time:H,date:H,email:Pe,files:R,formula:N,image:R,last_edited_by:N,last_edited_time:H,multi_select:ke,number:ge,people:be,phone_number:De,relation:ve,rich_text:Ce,rollup:Ge,select:Ae,title:Oe,url:Me},b=So;var Eo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:r,getPagesById:a,pathVariables:n,routeType:_})=>{let{NOTION:s}=e,c={},d={},f={},T=new Date().toISOString(),P=new Date("2020-01-01").toISOString(),m=s[_.toUpperCase()].page_id__seo,h=await a({page_id:m});if(!h)return{};(h==null?void 0:h.object)==="page"&&(d=(0,U.default)(h,"properties"),d.properties=(0,j.sortObject)(L({config:e,data:h,pathVariables:n,pageId:d.id}))),c=await t({block_id:d.id});let v=await r({database_id:s[_.toUpperCase()].database_id,filter:{and:[{property:_===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:_===s.EVENTS.routeType?T:P}}]}}),C=[];(0,Ne.default)(v.results,y=>{let l=y;l=(0,U.default)(l,"properties"),l.properties=(0,j.sortObject)(L({config:e,data:y,pathVariables:n,pageId:y.id})),C.push(l)});let I=(0,U.default)(v,"results");I.results=C,f=I;let i={info:d,content:c,items:f,images:{}},S=i?await F({data:i,pathVariables:n}):{};return i=Q(q({},i),{images:S}),i},wo=Eo;module.exports=ze(fo);0&&(module.exports={});