1function g(t){return t==null?"":typeof t=="string"?t:Array.isArray(t)?t.map(n=>{if(typeof n=="string")return n;if(n&&typeof n=="object"){const e=n.children;if(Array.isArray(e))return e.map(r=>typeof r=="string"?r:r&&typeof r=="object"&&"text"in r?String(r.text??""):"").join("")}return""}).join(` 2`):String(t)}function y(t){return t.replace(/["'<>].*$/,"").trim()}function d(t,n=""){const e=t.match(/\/video(-?\d+)_(\d+)/i);if(e){const o=new URLSearchParams(n);return o.set("oid",e[1]),o.set("id",e[2]),o.has("hd")||o.set("hd","2"),`https://vk.com/video_ext.php?${o.toString()}`}const r=t.match(/\/clip(-?\d+)_(\d+)/i);if(r){const o=new URLSearchParams(n);return o.set("oid",r[1]),o.set("id",r[2]),`https://vk.com/clip_ext.php?${o.toString()}`}return null}function p(t){const n=y(t);if(!n.startsWith("http"))return null;try{const e=new URL(n),r=e.hostname.toLowerCase(),o=/(^|\.)vk\.(com|ru)$/.test(r)||r.includes("vkvideo.ru");if(o&&(e.hostname="vk.com"),o){if(e.pathname.includes("video_ext.php")||e.pathname.includes("clip_ext.php"))return e.pathname.includes("video_ext.php")&&!e.searchParams.has("hd")&&e.searchParams.set("hd","2"),e.toString();const a=e.searchParams.get("z")||e.searchParams.get("clip");if(a){const i=d(`/${a}`,e.search);if(i)return i}const s=d(e.pathname,e.search);if(s)return s}return n}catch{return null}}function _(t){const n=g(t).trim();if(!n)return null;const e=n.match(/<iframe[^>]+src=["']([^"']+)["']/i);if(e!=null&&e[1])return p(e[1]);const r=n.match(/src=["'](https?:\/\/[^"']+)["']/i);if(r!=null&&r[1])return p(r[1]);const o=n.match(/https?:\/\/[^\s"'<>]+/i);return o!=null&&o[0]?p(o[0]):null}function T(t){try{const n=new URL(t);return n.searchParams.set("autoplay","1"),n.searchParams.set("mute","1"),n.searchParams.set("muted","1"),n.searchParams.set("controls","0"),n.searchParams.set("playsinline","1"),n.searchParams.set("modestbranding","1"),n.searchParams.set("rel","0"),n.searchParams.set("fs","0"),n.searchParams.set("disablekb","1"),n.searchParams.set("iv_load_policy","3"),n.toString()}catch{return t}}const w=["populate[cover]=true","populate[video]=true","populate[keypoints]=true","populate[sections][populate][image]=true","populate[faq]=true","populate[glossary]=true","populate[sources]=true"].join("&"),$=["populate[image]=true","populate[video]=true","populate[content][on][text.text]=*","populate[content][on][image.image][populate]=image","populate[content][on][section.section]=*"].join("&"),h={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",Ñ:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",Ñ:"r",Ñ:"s",Ñ:"t",Ñ:"u",Ñ:"f",Ñ :"h",Ñ:"c",Ñ:"ch",Ñ:"sh",Ñ:"sch",Ñ:"",Ñ:"y",Ñ:"",Ñ:"e",Ñ:"yu",Ñ:"ya"},f=(t,n,e)=>{let r=String(t||"").toLowerCase().split("").map(s=>s in h?h[s]:s).join("").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").split("-").slice(0,5).join("-");r||(r=`razdel-${n+1}`);let o=r,a=2;for(;e.has(o);)o=`${r}-${a++}`;return e.add(o),o},c=t=>String(t??"").replace(/[ï§â¢]/g,"").replace(/\t+/g," ").replace(/[  ]{2,}/g," ").trim(),m=t=>({type:"text",text:t}),x=t=>{const n=String(t||"").split(/\r?\n/),e=[];let r=null;for(const o of n){const a=c(o);if(!a){r=null;continue}const s=a.match(/^[-âââ¢]\s+(.*)$/),i=a.match(/^\d+[.)]\s+(.*)$/);if(s||i){const l=i?"ordered":"unordered";(!r||r.format!==l)&&(r={type:"list",format:l,children:[]},e.push(r)),r.children.push({type:"list-item",children:[m((s||i)[1])]});continue}r=null,e.push({type:"paragraph",children:[m(a)]})}return e},P=t=>Array.isArray(t)?t.map(n=>((n==null?void 0:n.children)||[]).map(e=>(e==null?void 0:e.text)||"").join("")).join(` 3`):String(t??""),u=(t=[])=>t.map(n=>Array.isArray(n.children)?n.children.map(e=>e.text!=null?e.text:u([e])).join(n.type==="list"?" ":""):"").join(" "),S=t=>{const e=[t.answer,t.keypoints.join(" "),u(t.intro),...t.sections.map(r=>`${r.title} ${r.lead} ${u(r.body)}`),u(t.outro),...t.faq.map(r=>`${r.question} ${r.answer}`)].join(" ").split(/\s+/).filter(Boolean).length;return Math.max(1,Math.round(e/180))},A=t=>{const n=new Set;return{source:"articles",documentId:t.documentId,slug:t.slug,type:t.type||"СÑаÑÑÑ",title:c(t.t
3itle),category:t.category||"",date:t.date,updated:t.updated||"",author:t.author||"ÐкÑпеÑÑÑ Ð°Ð³ÐµÐ½ÑÑÑва Welcome",cover:t.cover||null,excerpt:t.excerpt||"",answer:t.answer||"",keypoints:(t.keypoints||[]).map(e=>e.text).filter(Boolean),intro:t.intro||[],sections:(t.sections||[]).map((e,r)=>({id:f(e.title,r,n),title:c(e.title),lead:e.lead||"",body:e.body||[],image:e.image||null,imageCaption:e.image_caption||"",videoUrl:e.video_url||""})),outro:t.outro||[],videoUrl:t.video_url||"",video:t.video||null,faq:(t.faq||[]).filter(e=>e.question&&e.answer),glossary:(t.glossary||[]).filter(e=>e.term),sources:(t.sources||[]).filter(e=>e.url&&e.title),ctaTitle:t.cta_title||"",ctaText:t.cta_text||"",seoTitle:t.seo_title||"",seoDescription:t.seo_description||""}},L=t=>{var a;const n=new Set,e=[],r=[];let o=t.image||null;for(const s of t.content||[]){if(s.__component==="image.image"){!o&&((a=s.image)!=null&&a[0])&&(o=s.image[0]);continue}const i=x(P(s.text));if(s.__component==="section.section"&&c(s.title)){const l=c(s.title);r.push({id:f(l,r.length,n),title:l,lead:"",body:i,image:null,imageCaption:"",videoUrl:""})}else r.length?r[r.length-1].body.push(...i):e.push(...i)}return{source:"legacy",documentId:t.documentId,slug:t.slug,type:t.type||"СÑаÑÑÑ",title:c(t.title),category:"",date:t.date,updated:"",author:"ÐкÑпеÑÑÑ Ð°Ð³ÐµÐ½ÑÑÑва Welcome",cover:Array.isArray(o)?o[0]:o,excerpt:"",answer:"",keypoints:[],intro:e,sections:r,outro:[],videoUrl:"",video:t.video||null,faq:[],glossary:[],sources:[],ctaTitle:"",ctaText:"",seoTitle:"",seoDescription:""}},v=["ÑнваÑÑ","ÑевÑалÑ","маÑÑа","апÑелÑ","маÑ","иÑнÑ","иÑлÑ","авгÑÑÑа","ÑенÑÑбÑÑ","окÑÑбÑÑ","ноÑбÑÑ","декабÑÑ"],j=t=>{if(!t)return"";const[n,e,r]=String(t).slice(0,10).split("-").map(Number);return!n||!e||!r?"":`${r} ${v[e-1]} ${n}`};export{w as B,$ as L,L as a,j as f,A as n,_ as p,S as r,T as w};
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.