PageSourceSearch

https://otentecnologia.com.br/assets/HomeVideoSection-CHPKnhVU.js

js otentecnologia.com.br collected 2026-09-30 05:27:21 UTC 3,354 bytes, 1 lines download raw bytes

1import{j as e,r as t}from"./framer-DNXtdBgj.js";import{v as r,e as o}from"./index-XTUkK5WH.js";import{S as s}from"./skeleton-Bt0hhFPb.js";import"./supabase-CVkO6afG.js";function l(e){let t=e.trim();t=t.replace(/^\[/,"").replace(/^src=["']/i,"").replace(/["']$/,"");const r=t.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{6,})/);if(r)return`https://www.youtube.com/embed/${r[1]}`;const o=t.match(/^https?:\/\/(?:www\.)?vimeo\.com\/(\d+)(?:[/?#].*)?$/i);return o?`https://player.vimeo.com/video/${o[1]}`:t}const i=()=>{const{data:t,isLoading:i}=r({queryKey:["home-video-url"],queryFn:async()=>{const{data:e,error:t}=await o.from("site_settings").select("value").eq("key","about_video_url").single();if(t)throw t;const r=e.value;let s="";if("string"==typeof r)s=r;else if(r&&"object"==typeof r&&"value"in r){const e=r.value;"string"==typeof e&&(s=e)}return function(e){if(!e)return"";const t=e.trim();if(/<iframe/i.test(t)){const e=t.match(/<iframe[^>]+src=["']([^"']+)["']/i);if(e)return l(e[1])}return l(t)}(s)}});if(i)return e.jsx("div",{className:"relative w-full h-full",children:e.jsx(s,{className:"absolute inset-0 w-full h-full"})});if(!t)return null;const a=/\.(mp4|webm|mov|m4v|ogv)(\?.*)?$/i.test(t),c=a?t:function(e){try{const t=/player\.vimeo\.com\/video\//i.test(e),r=/(?:youtube\.com\/embed\/|youtube-nocookie\.com\/embed\/)/i.test(e);if(!t&&!r)return e;const[o,s]=e.split("#"),[l,i=""]=o.split("?"),n=new URLSearchParams(i);t?(n.set("autoplay","1"),n.set("muted","1"),n.has("loop")||n.set("loop","1"),n.has("background")||n.set("background","0")):r&&(n.set("autoplay","1"),n.set("mute","1"),n.set("playsinline","1"));const a=n.toString();return`${l}${a?`?${a}`:""}${s?`#${s}`:""}`}catch{return e}}(t);return e.jsx("div",{className:"w-full h-full",children:a?e.jsx("video",{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!0,preload:"metadata",className:"w-full h-full object-cover",children:"Seu navegador não suporta a tag de vídeo."}):e.jsx(n,{embedUrl:c})})},n=({embedUrl:r})=>{const o=t.useRef(null),[s,l]=t.useState(!1);return t.useEffect(()=>{if(s)return;const e=o.current;if(!e)return;const t=window,r=()=>l(!0);if("undefined"==typeof IntersectionObserver){const e=setTimeout(r,3500);return()=>clearTimeout(e)}const i=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&("function"==typeof t.requestIdleCallback?t.requestIdleCallback(r,{timeout:2500}):setTimeout(r,1500),i.disconnect())},{rootMargin:"0px"});return i.observe(e),()=>i.disconnect()},[s]),e.jsx("div",{ref:o,className:"relative w-full h-full bg-black/40",children:s?e.jsx("iframe",{src:r,title:"Vídeo Institucional OTEN",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,loading:"lazy",className:"absolute inset-0 w-full h-full border-0"}):e.jsx("button",{type:"button","aria-label":"Reproduzir vídeo institucional",onClick:()=>l(!0),className:"absolute inset-0 w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/30 to-black/60",children:e.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-white/90 shadow-lg",children:e.jsx("svg",{width:"22",height:"26",viewBox:"0 0 22 26",fill:"currentColor",className:"text-primary ml-1",children:e.jsx("path",{d:"M0 0v26l22-13z"})})})})})};export{i as HomeVideoSection};

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.