1import{c as h,f as P,b as f,k as A}from"./CQoX0bYS.js";import{e as c,u as I,k as v}from"./hmVibj9W.js";import{r as T}from"./7NBB2vv2.js";import{u as j}from"./CiZV6eIw.js";import{t as U}from"./BtrstzxA.js";function B(e){return e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()}function O(e){let t=[];return e.quantity&&t.push(e.quantity),e.unit_id&&t.push(e.unit_id.title),t.push(e.title),t.join(" ")}function z(e,t){const o=e?.authors??[];return{"@context":"https://schema.org/","@type":"Recipe",name:e.title,image:[h(e),f(e)],author:o.map(r=>({"@type":"Person",name:r.title})),datePublished:e.published_at,description:e.story,totalTime:`PT${e.total_time}M`,recipeYield:[e.servings,t.servings].join(" "),recipeCategory:e.category.title,recipeIngredient:e.ingredients.map(r=>O(r)),recipeInstructions:e.steps.map(r=>({"@type":"HowToStep",text:r.body}))}}function L(e){const o="Text",r=e.body.filter(a=>a.type&&a.type!=="Ad").map(a=>(a?.group??[]).filter(l=>l.type===o).map(l=>l.data).join(" "));return B(r.join(" ").trim())}const C=(e,t,o=!1)=>{const r=I(),a=T(j(c())),m={"@context":"http://schema.org","@type":"WebPage",publisher:{"@type":"Organization",name:r.public.appName}},p=c()?r.public.LV_APP:r.public.RU_APP,g=n=>n.main_category?a.articleUrl(n,p):"",b=n=>{const s=g(n);return s?{"@type":"WebPage","@id":s}:{}};if(["category","tag","page"].includes(e))return{...m,name:t?.title??"",description:t?.description??""};if(e==="article"){let n=[],s=[],y="";const i=t;o||(n=t?.authors??[],y=h(t),s=[P(t),f(t),A(t)].filter(u=>!!u));const d=g(i),_=n.length?n.map(u=>({"@type":"Person",name:u.title})):[{"@type":"Organization",name:r.public.appName}],x=Array.isArray(i?.body)&&i.body.length?L(i):i?.lead??"";return{"@context":"https://schema.org","@type":"NewsArticle",headline:!o&&t?.title?U(t?.title):"",description:!o&&i?.lead?i?.lead:"",url:d,mainEntityOfPage:b(i),image:s,datePublished:!o&&i?.published_at?i?.published_at:"",dateModified:!o&&i?.updated_at?i?.updated_at:"",author:_,publisher:{"@type":"Organization",name:r.public.appName,logo:{"@type":"ImageObject",url:p+(c()?"/jauns/favicon/logo-112x112.png":"/otkrito/favicon/logo-112x112.png")}},articleSection:i?.main_category.title,articleBody:x,thumbnailUrl:y}}if(e==="sorter")return{...m,name:t.title??""};if(e==="website")return{"@context":"https://schema.org","@type":"WebSite",name:r.public.appName,url:p,potentialAction:{"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${p}/search/{search_term_string}`},"query-input":"required name=search_term_string"}};if(e==="organization")return{"@context":"https://schema.org","@type":"Organization",name:r.public.appName,url:p,logo:p+(c()?"/jauns/favicon/logo-112x112.png":"/otkrito/favicon/logo-112x112.png")};if(e==="recipe"){const{t:n}=v();return z(t,{servings:n("recipes.servings")})}return{}};export{C as s};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.