import{querySelector as o}from"../../utils/dom.js";import{isNumeric as n}from"../../utils/helpers.js";import{Languages as f}from"../code-samples/constants.js";function c(e){if(typeof e>"u")return!1;if(e==="")return!0;if(typeof e!="string")return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map(t=>t.trim()).filter(Boolean)}}function l(e){if(typeof e=="string"&&!n(e)){const t=o(e);t||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");const r=t&&t.getBoundingClientRect().bottom||0;return()=>r}else{if(typeof e=="number"||n(e))return()=>typeof e=="number"?e:parseFloat(e);if(typeof e=="function")return()=>{const t=e();return typeof t!="number"&&console.warn(`scrollYOffset should return number but returned value "${t}" of type ${typeof t}`),t};e!==void 0&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function")}return()=>0}function m(e){const t=Object.values(f).map(r=>({lang:r}));return typeof e=="object"&&e!==null?{languages:t,...e}:{languages:t}}export{m as normalizeCodeSamples,l as normalizeScrollYOffset,c as normalizeShowExtensions};
