PageSourceSearch

https://www.thepuffinhouse.com/_nuxt/BND1HMX3.js

js thepuffinhouse.com collected 2026-10-06 19:12:04 UTC 12,346 bytes, 1 lines download raw bytes

1import{_ as Ke}from"./DTuX238w.js";import{d as Qe,a as Xe,s as Je,T as et,ar as tt,ac as rt,y as at,c as o,C as v,A as ut,K as h,ag as ot,o as g,g as O,f as n,q as lt,n as nt,k as ge,h as it,e as st,M as D,D as y}from"#entry";import{u as vt}from"./CT1hL7fc.js";import{b as ct}from"./D0m3rUg_.js";const dt=L=>{const k=L.split("?")[0].toLowerCase();return k.endsWith(".mp4")?"mp4":k.endsWith(".webm")?"webm":k.endsWith(".mov")?"mov":k.endsWith(".ogg")?"ogg":"unknown"},ft=L=>{switch(dt(L)){case"mp4":return"video/mp4";case"webm":return"video/webm";case"mov":return"video/quicktime";case"ogg":return"video/ogg";default:return"video/mp4"}},pt={class:"element-video"},mt=["src","muted"],yt=["src"],wt=["src","loading"],It=Qe({__name:"Video",props:{src:{},isAutoplay:{type:Boolean,default:!1},isLoop:{type:Boolean,default:!0},isTriggerPlay:{type:Boolean,default:!1},isLoadWhenInView:{type:Boolean,default:!1},isReplayTriggerPlay:{type:Boolean,default:!1},isSoundEnabled:{type:Boolean,default:!0},hasControl:{type:Boolean,default:!1},poster:{},fetchpriority:{default:null},playlist:{}},setup(L){const k=L,ke=Xe(()=>k,"Element","Video"),{previewData:Ie,previewUpdateToken:xe}=Je(et()),r=D(null),B=D(null),I=D(null),_=y(!1),S=D(null),Ve=tt(),Oe=rt(),{t:re}=at(),q=y(!1),ae=y(!1),c=y(!1),x=y(!1),V=y(!1),A=y(!1),j=y(!1),C=y(!1),P=y("maxresdefault");let M=null,U=null,F=null;const s=o(()=>(xe.value,{...ke.value??{},...k})),N=vt(),{image:_e}=ct(),Ae=o(()=>Ie.value?.editorPreview?.autoplayMode==="always"?"always":"off"),b=o(()=>N.value&&Ae.value!=="always"?!1:!!s.value?.isAutoplay),Pe=o(()=>window.location?.origin?window.location.origin:Oe.origin),Te=t=>{try{return new URL(t).searchParams}catch{return new URLSearchParams(t)}},Le=t=>{if(!t||t.indexOf("dropbox.com")===-1)return t;try{const e=new URL(t);return/(^|\.)dropbox\.com$/i.test(e.hostname)?(e.searchParams.set("raw","1"),e.toString()):t}catch{return t.indexOf("raw=")!==-1?t.replace(/([?&])raw=[^&#]*/g,"$1raw=1"):t+(t.indexOf("?")!==-1?"&raw=1":"?raw=1")}},R=o(()=>b.value?!0:!s.value?.isSoundEnabled),Se=t=>{const u=/(?:m|www|vm)?\.?tiktok\.com\/((?:.*\b(?:(?:usr|v|embed|user|video|player\/v1)\/|\?shareId=|&item_id=)(\d+))|\w+)/i.exec(t.trimEnd().replace(/\/+$/,""));return u?.[2]?.length===19?u[2]:null},Re=t=>{const e=/(?:https?:\/\/)?(?:www\.|m\.)?instagram\.com\/(?:p|reel|tv)\/([a-zA-Z0-9_-]+)/,u=t.replace(/\/+$/,""),i=e.exec(u);return i&&i[1]?i[1]:null},Ee=t=>{const e=/(?:https?:\/\/)?(?:www\.|m\.)?(?:youtube\.com\/(?:.*[?&]v=|(?:embed|v|shorts)\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,u=t.match(e);return u?u[1]:null},Be=(t,e,u,i,m,f)=>{if(!e)return t;const w=t.indexOf("youtube.com/embed/")!==-1?t:`https://www.youtube.com/embed/${e}`;try{const W=new URL(w),l=W.searchParams,he=l.get("list"),be=u?.playlist||he||e;return i?l.set("mute","1"):l.set("mute",u?.isSoundEnabled?"0":"1"),l.set("controls",u?.hasControl?"1":"0"),l.set("rel","0"),l.set("disablekb","1"),l.set("modestbranding","1"),l.set("cc_load_policy","0"),l.set("iv_load_policy","3"),l.set("autohide","0"),l.set("showinfo","0"),f?l.set("enablejsapi","1"):l.delete("enablejsapi"),l.set("playsinline","1"),l.set("autoplay",i?"1":"0"),f&&m?l.set("origin",m):l.delete("origin"),u?.isLoop?(l.set("loop","1"),be&&l.set("playlist",be)):(l.set("loop","0"),!u?.playlist&&!he&&l.delete("playlist")),W.search=l.toString(),W.toString()}catch{return"https://www.youtube.com/embed/"+e+"?controls="+(u?.hasControl?"1":"0")+"&loop="+(u?.isLoop?"1":"0")+(u?.isLoop?"&playlist="+(u?.playlist||e):"")+"&mute="+(i?"1":u?.isSoundEnabled?"0":"1")+"&rel=0&disablekb=1&modestbranding=1&cc_load_policy=0&iv_load_policy=3&autohide=0&showinfo=0&playsinline=1"+(f?"&enablejsapi=1":"")+(f&&m?"&origin="+encodeURIComponent(m):"")+(i?"&autoplay=1":"&autoplay=0")}},a=o(()=>{const t=s.value;let e=Le(t?.src||""),u="",i="",m=null,f=b.value;if(e.indexOf("facebook.com")!=-1)u=e.indexOf("reel")!=-1?"reel":"facebook",e="https://www.facebook.com/plugins/video.php?href="+e+"&show_text=0"+(f?"&autoplay=1":"&autoplay=0");else if(e.indexOf("youtube.com")!=-1||e.indexOf("youtu.be")!=-1){const w=Ee(e),l=Te(e).get("autoplay");u=e.indexOf("shorts")!=-1?"shorts":"youtube",m=w,f=N.value?b.value:!!(b.value||l==="1"),e=
1Be(e,w,t,f,Pe.value,f)}else if(e.indexOf("tiktok.com")!==-1){const w=Se(e);u="tiktok",w?e=`https://www.tiktok.com/player/v1/${w}?controls=${t?.hasControl?"1":"0"}&autoplay=${f?"1":"0"}&muted=${f||!t?.isSoundEnabled?"1":"0"}&loop=${t?.isLoop?"1":"0"}`:e=""}else if(e.indexOf("instagram.com")!==-1){const w=Re(e);u="instagram",e="https://www.instagram.com/p/"+w+"/embed"}else e.indexOf("drive.google.com")!==-1?(u="google",e.indexOf("preview")!==-1||(e.indexOf("view")!==-1?e=e.replaceAll("view","preview"):e.indexOf("edit")!=-1?e=e.replaceAll("edit","preview"):e.indexOf("file/d")!=-1&&(e=e.trimEnd().replace(/\/+$/,"")+"/preview"))):(u="file",i=ft(e));return{src:e,type:u,mime_type:i,youtubeId:m,isAutoplay:f}}),ue=o(()=>ae.value?Ve.isGreaterOrEquals("md")?p.value?{w:1024,h:1024}:{w:600,h:600}:p.value?{w:600,h:600}:{w:300,h:300}:p.value?{w:600,h:600}:{w:300,h:300}),p=o(()=>a.value?.type==="file"&&b.value&&s.value?.isTriggerPlay!==!0),d=o(()=>a.value?.type==="file"&&!!s.value?.isLoadWhenInView),oe=o(()=>p.value||d.value),le=o(()=>a.value?.type==="file"&&d.value&&s.value?.isTriggerPlay===!0&&V.value&&c.value),H=o(()=>d.value&&s.value?.isReplayTriggerPlay===!0),Ce=o(()=>a.value?.type!=="file"?!1:d.value?V.value:!0),Me=o(()=>Ce.value?a.value?.src:void 0),ne=o(()=>a.value?.type==="youtube"||a.value?.type==="shorts"),Ue=o(()=>["tiktok","facebook","reel","instagram"].includes(a.value?.type||"")),T=o(()=>a.value?.type!=="file"&&(!!s.value?.isLoadWhenInView||!ne.value&&Ue.value)),Fe=o(()=>a.value?.type==="file"?!1:T.value?A.value:!0),$e=o(()=>Fe.value?a.value?.src:void 0),Ye=o(()=>ne.value&&a.value?.isAutoplay?"eager":"lazy"),$=t=>{if(!t)return!1;const e=t.getBoundingClientRect();return e.bottom>0&&e.right>0&&e.left<window.innerWidth&&e.top<window.innerHeight},ie=()=>{M?.disconnect(),M=null},se=()=>{ie();const t=B.value||r.value;if(!t)return;if(!oe.value){c.value=!0;return}if(typeof IntersectionObserver>"u"){c.value=!0;return}c.value=$(t);const e=d.value?{root:null,rootMargin:"0px",threshold:.01}:{root:null,rootMargin:"200px 0px",threshold:.1};M=new IntersectionObserver(u=>{const i=u.some(m=>m.isIntersecting||m.intersectionRatio>0);c.value=i},e),M.observe(t)},Z=()=>{F?.disconnect(),F=null},ve=()=>{T.value&&(A.value=!0,Z())},G=()=>{if(Z(),!T.value){A.value=!0;return}const t=S.value;if(t){if(typeof IntersectionObserver>"u"){A.value=!0;return}if($(t)){ve();return}F=new IntersectionObserver(e=>{e.some(i=>i.isIntersecting||i.intersectionRatio>0)&&ve()},{root:null,rootMargin:"200px 0px",threshold:.01}),F.observe(t)}},ce=()=>{if(!r.value||!d.value||s.value?.isTriggerPlay!==!0)return;const t=B.value||r.value,e=$(t);c.value=e,e&&J().then(()=>{te()})},ze=o(()=>p.value?c.value:b.value),We=o(()=>{const t=s.value?.fetchpriority;if(typeof t=="string"){const e=t.trim().toLowerCase();if(e==="high"||e==="low"||e==="auto")return e}return p.value&&c.value||le.value?"high":void 0}),De=o(()=>{const t=s.value;return{autoplay:ze.value,loop:t?.isLoop,fetchpriority:We.value,controls:t?.hasControl,poster:t?.poster?_e(t?.poster,ue.value.w,ue.value.h,"","max","webp"):"",preload:p.value&&c.value||le.value?"auto":"metadata"}}),de=o(()=>(a.value?.type==="youtube"||a.value?.type==="shorts")&&!a.value?.isAutoplay&&!!a.value?.youtubeId),K=o(()=>de.value?q.value:!0),Q=o(()=>(a.value?.type==="youtube"||a.value?.type==="shorts")&&!!a.value?.isAutoplay&&K.value),fe=o(()=>a.value?.youtubeId?`https://i.ytimg.com/vi/${a.value.youtubeId}/${P.value}.jpg`:""),qe=()=>{if(P.value==="maxresdefault"){P.value="sddefault";return}P.value==="sddefault"&&(P.value="hqdefault")},je=()=>{q.value=!0},X=t=>{I.value?.contentWindow&&(a.value?.type!=="youtube"&&a.value?.type!=="shorts"||I.value.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:[]}),"*"))},Y=()=>{if(Q.value&&K.value){if(x.value){X("playVideo");return}X("pauseVideo")}},pe=()=>{U?.disconnect(),U=null},Ne=()=>{pe();const t=S.value||I.value;if(t){if(!Q.value){x.value=!0;return}if(typeof IntersectionObserver>"u"){x.value=!0;return}x.value=$(t),U=new IntersectionObserver(e=>{const u=e.some(i=>i.isIntersecting||i.intersectionRatio>0);x.value=u},{root:null,rootMargin:"0px",threshold:.1}),U.observe(t)}},He=()=>{a.value?.type==="tiktok"&&I.value?.contentWindow&&(I.value.contentWindow.postMessage({type:_.value?"mute":"unMute","x-tiktok-player":!0},"https://www.tiktok.com"),_.value=!_.value)},Ze=()=>{h(()=>{Y(),window.setTimeout(()=>{Y()},150)})},z=()=>{ee()},J=async()=>!r.value||!d.value||V.value?!1:(V.value=!0,await h(),a.value?.src&&(r.value.src=a.value.src),r.value.preload="auto",r.value?.load(),!0),ee=()=>{r.value&&p.value&&c.value&&(j.value=!0,r.value.muted=R.value,r.value.defaultMuted=R.value,r.value.preload="auto",r.value.play().then(()=>{j.value=!1}
1).catch(()=>{}))},te=()=>{if(r.value&&d.value&&V.value&&s.value?.isTriggerPlay===!0&&c.value){if(!C.value){C.value=!0,me();return}H.value||r.value.paused&&Ge()}},me=()=>{r.value&&(d.value&&!V.value||(r.value.muted=R.value,r.value.preload="auto",r.value.currentTime=0,r.value.play().catch(()=>{})))},Ge=()=>{r.value&&(r.value.muted=R.value,r.value.preload="auto",r.value.play().catch(()=>{}))},ye=()=>{r.value&&r.value.pause()},we=()=>{r.value&&(r.value.pause(),r.value.currentTime=0,C.value=!1)};v(()=>s.value?.isTriggerPlay,(t,e)=>{if(t===!0){if(d.value&&!c.value)return;d.value?J().then(()=>{te()}):me();return}e===!0&&t!==!0&&(H.value?we():ye())});let E=null;return ut(()=>{ae.value=!0,se(),G(),h(()=>{ce()})}),ot(()=>{ie(),pe(),Z(),E?.(),E=null}),v(()=>[r.value,oe.value],()=>{se()},{immediate:!0}),v(()=>[r.value,B.value],()=>{h(()=>{ce()})},{immediate:!0}),v(()=>[I.value,S.value,Q.value],()=>{Ne(),h(()=>{Y()})},{immediate:!0}),v(()=>[S.value,T.value,a.value?.src],()=>{A.value=!T.value,h(()=>{G()})},{immediate:!0}),v(x,()=>{Y()},{immediate:!0}),v(c,t=>{if(d.value){if(!t){s.value?.isTriggerPlay===!0&&(H.value?we():ye());return}J().then(()=>{te()});return}if(p.value&&r.value){if(t){h(()=>ee());return}r.value.pause()}},{immediate:!0}),v(()=>[a.value?.src,p.value],()=>{h(()=>ee())}),v(b,t=>{t||(r.value&&r.value.pause(),(a.value?.type==="youtube"||a.value?.type==="shorts")&&X("pauseVideo"))}),v(()=>a.value?.src,()=>{V.value=!1,j.value=!1,C.value=!1,r.value&&(r.value.pause(),r.value.removeAttribute("src"),r.value.load())}),v(()=>a.value?.src,()=>{_.value=!1,q.value=!1,x.value=!1,A.value=!T.value,h(()=>{G()})}),v(()=>a.value?.youtubeId,()=>{P.value="maxresdefault"}),v(N,t=>{E?.(),E=null,t&&(E=v(()=>a.value?.src,()=>{r.value&&a.value?.type==="file"&&(r.value.pause(),r.value.currentTime=0,r.value.load(),b.value&&r.value.play().catch(()=>{}))}))},{immediate:!0}),(t,e)=>{const u=Ke;return g(),O("div",pt,[n(a)?.type=="file"?(g(),O("div",{key:0,ref_key:"videoViewportRef",ref:B,class:"video-wrapper"},[(g(),O("video",lt({ref_key:"videoRef",ref:r},n(De),{src:n(Me),key:n(a)?.src,playsinline:"",muted:n(R),onLoadstart:z,onLoadedmetadata:z,onLoadeddata:z,onCanplay:z}),null,16,mt))],512)):(g(),O("div",{key:1,ref_key:"iframeViewportRef",ref:S,class:nt(["iframe-wrapper",[n(a)?.type,n(a)?.type==="tiktok"||n(a)?.type==="shorts"||n(a)?.type==="reel"?"wrapper-9-16":"wrapper-16-9"]])},[n(de)&&!n(K)?(g(),O("button",{key:0,class:"youtube-lite",type:"button",onClick:je,"aria-label":"Play video"},[n(fe)?(g(),O("img",{key:0,class:"youtube-lite-thumb",src:n(fe),alt:"",loading:"lazy",decoding:"async",onError:qe},null,40,yt)):ge("",!0),e[0]||(e[0]=it("span",{class:"youtube-lite-play","aria-hidden":"true"},null,-1))])):(g(),O("iframe",{ref_key:"iframeRef",ref:I,src:n($e),key:n(a)?.src,width:"100%",height:"100%",loading:n(Ye),referrerpolicy:"strict-origin-when-cross-origin",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",scrolling:"no",frameBorder:"0",allowFullScreen:"allowFullScreen",onLoad:Ze},null,40,wt)),n(a)?.type==="tiktok"&&n(a)?.isAutoplay&&!n(s)?.hasControl?(g(),st(u,{key:2,class:"tiktok-unmute-button",iconLeft:n(_)?"volume-2":"volume-x",alt:n(_)?n(re)("ปิดเสียงวิดีโอ"):n(re)("เปิดเสียงวิดีโอ"),iconSize:"xsmall",onClick:He},null,8,["iconLeft","alt"])):ge("",!0)],2))])}}});export{It as _};

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.