{"version":3,"file":"BVVYFKAt.js","sources":["../../../../types/Author.ts","../../../../utils/getEstimatedReadTime.ts","../../../../types/Post.ts","../../../../utils/storyblok/mapResultToPosts.ts"],"sourcesContent":["export class Author {\n objectID: number;\n uuid: string;\n name: string;\n tags: string[];\n image: any;\n role: string;\n createdAt: string;\n createdAtTimestamp: number;\n publishedAt: string;\n publishedAtTimestamp: number;\n slug: string;\n fullSlug: string;\n\n constructor(raw: any) {\n this.objectID = raw.id;\n this.uuid = raw.uuid;\n this.name = raw.name;\n this.tags = raw.tag_list;\n this.image = raw.content.image;\n this.role = raw.content.role;\n this.createdAt = raw.created_at;\n this.createdAtTimestamp = new Date(raw.created_at).getTime();\n this.publishedAt = raw.published_at;\n this.publishedAtTimestamp = new Date(raw.published_at).getTime();\n this.slug = raw.slug;\n this.fullSlug = raw.full_slug;\n }\n}\n","export const getEstimatedReadTime = (richText: any, duration?: boolean) => {\n let articleText: string = \"\";\n\n richText.content.forEach((textObj: any) => {\n switch (textObj.type) {\n case \"heading\":\n case \"paragraph\":\n textObj.content?.forEach((textContent: any) => {\n articleText += textContent.text;\n });\n break;\n }\n });\n\n const minutes = Math.ceil(articleText.trim().split(/\\s+/).length / 150);\n\n return duration ? `M(${minutes})` : `${minutes} min`;\n};\n","import { Author } from \"./Author\";\nimport { getEstimatedReadTime } from \"../utils/getEstimatedReadTime\";\n\nexport class Post {\n objectID: number;\n uuid: string;\n title: string;\n featuredImage: any;\n category: string;\n excerpt: any;\n tags: string[];\n createdAt: string;\n createdAtTimestamp: number;\n publishedAt: string;\n publishedAtTimestamp: number;\n firstPublishedAt: number;\n firstPublishedAtTimestamp: number;\n author?: Author;\n specialist?: Author;\n slug: string;\n fullSlug: string;\n estimatedReadTime: string;\n\n constructor(raw: any) {\n this.objectID = raw.id;\n this.uuid = raw.uuid;\n this.title = raw.content.title;\n this.featuredImage = raw.content.featuredImage;\n this.category = raw.content.category;\n this.excerpt = raw.content.excerpt;\n this.tags = raw.tag_list;\n this.createdAt = raw.created_at;\n this.createdAtTimestamp = Date.parse(raw.created_at);\n this.publishedAt = raw.published_at;\n this.publishedAtTimestamp = Date.parse(raw.published_at);\n this.firstPublishedAt = raw.first_published_at;\n this.firstPublishedAtTimestamp = Date.parse(raw.first_published_at);\n if (raw.content.author) {\n this.author = new Author(raw.content.author);\n }\n if (raw.content.specialist) {\n this.specialist = new Author(raw.content.specialist);\n }\n this.slug = raw.slug;\n this.fullSlug = raw.full_slug;\n this.estimatedReadTime = getEstimatedReadTime(raw.content.body);\n }\n}\n","import { ISbResult } from \"storyblok-js-client\";\nimport { Post } from \"@/types/Post\";\n\nexport const mapResultToPosts = (result: ISbResult) => ({\n posts: result.data.stories.map((s: any) => new Post(s)),\n totalPages: Math.ceil(result.total / result.perPage),\n});\n"],"names":["Author","raw","__publicField","getEstimatedReadTime","richText","duration","articleText","textObj","_a","textContent","minutes","Post","mapResultToPosts","result","s"],"mappings":"oKAAO,MAAMA,CAAO,CAclB,YAAYC,EAAU,CAbtBC,EAAA,iBACAA,EAAA,aACAA,EAAA,aACAA,EAAA,aACAA,EAAA,cACAA,EAAA,aACAA,EAAA,kBACAA,EAAA,2BACAA,EAAA,oBACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,iBAGE,KAAK,SAAWD,EAAI,GACpB,KAAK,KAAOA,EAAI,KAChB,KAAK,KAAOA,EAAI,KAChB,KAAK,KAAOA,EAAI,SACX,KAAA,MAAQA,EAAI,QAAQ,MACpB,KAAA,KAAOA,EAAI,QAAQ,KACxB,KAAK,UAAYA,EAAI,WACrB,KAAK,mBAAqB,IAAI,KAAKA,EAAI,UAAU,EAAE,QAAQ,EAC3D,KAAK,YAAcA,EAAI,aACvB,KAAK,qBAAuB,IAAI,KAAKA,EAAI,YAAY,EAAE,QAAQ,EAC/D,KAAK,KAAOA,EAAI,KAChB,KAAK,SAAWA,EAAI,SAAA,CAExB,CC5Ba,MAAAE,EAAuB,CAACC,EAAeC,IAAuB,CACzE,IAAIC,EAAsB,GAE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