PageSourceSearch

https://ertha.io/dist/c/c-XWN4YWL2.js

js ertha.io collected 2026-10-03 19:48:25 UTC 4,927 bytes, 1 lines download raw bytes

1import{d as R}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-TNYSYG4J.js";import{a as T,b as D}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-DUAXRZ57.js";import{a as E,d as $}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-D56B3M5S.js";import{c as I,o as M}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-EHVXMJY4.js";import{d as w,h as k}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-F5OFZEBH.js";import{b as p,c as x}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-AXWQOV7A.js";import{d as y,f as L}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-3GUQQBC3.js";import{a as C}from"https://st-p.rmcdn1.net/3a2d896f/dist/c/c-R4FZHFKP.js";var P,j,A=C(()=>{"use strict";k();$();D();x();M();R();L();P={setVideoPosition:function(e){if(!e.aspect_poster||!e.$media||!e.$media.length)return;let t=e.$container.css("width"),o=e.$container.css("height");if(/px/.test(t+o))t=parseInt(t),o=parseInt(o);else{if(!e.mag)return;let d=e.mag.getContainerSizeCached();t=d.width,o=d.height}let n=e.aspect_poster,i=e.aspect_real||n,c=e.controls_remove?5:0,u=t+c*2,s=o+c*2,l=u,r=s;if(n){let d,a;u/s>i?(d=u,a=d/i):(a=s,d=a*i),n<i?(l=d,r=l/n):(r=a,l=r*n)}if(e.provider.toLowerCase()=="vimeo"&&e.controls_remove){var m=(r-s)/2,v=(l-u)/2,h=50,f=46,b=h-m,g=f-v;if(b>0||g>0){let d=(r+b*2)/r,a=(l+g*2)/l,V=Math.max(d,a);l*=V,r*=V}}if(e.provider.toLowerCase()=="youtube"&&e.controls_remove){var m=(r-s)/2,h=103,_=h-m;_>0&&(r+=_*2,l=r*n)}let F=-c-(l-u)/2,U=-c-(r-s)/2;e.$media.css({left:F,top:U,width:l,height:r})},getHighResVideoThumbnail:function(e){if(!e.provider||!e.thumbnail_url)return Promise.resolve(e.thumbnail_url||"");function t(o,n){return o.replace(/(\/)(\w*default)(\.\w+$)/i,"$1"+n+"$3")}switch(e.provider.toLowerCase()){case"vimeo":return Promise.resolve(e.thumbnail_url);case"youtube":return Promise.resolve(typeof e.video_url=="string"&&e.video_url.includes("shorts")?e.thumbnail_url:t(e.thumbnail_url,"maxresdefault"));default:return Promise.resolve(e.thumbnail_url)}},getEmbedData:async function(e,t,o,n){fetch(/oembed/i.test(e)?e:this.getEmbedUrl(e)).then(i=>i.json()).then(i=>{i.url=i.url&&w(i.url),i.thumbnail_url=i.thumbnail_url&&w(i.thumbnail_url),typeof t=="function"&&t(i)}).catch(i=>{o(i)}).finally(()=>{typeof n=="function"&&n()})},getEmbedUrl:function(e){if(this.isVimeo(e))return"https://vimeo.com/api/oembed.json?url="+encodeURIComponent(e)+"&width=1280";{let t=P.getYoutubeIdFromUrl(e);if(t)return"https://www.youtube.com/oembed?format=json&url="+encodeURIComponent("https://www.youtube.com/watch?v="+t)}return""},getYoutubeIdFromUrl:function(e){let t=/^.*(youtu.be\/|v\/|u\/\w\/|shorts\/|watch\?v=)([^#\&\?]*).*/,o=e.match(t);if(o&&o[2].length===11)return o[2];let n=/.*(youtu.*\&v=)([^#\&\?]*).*/;return o=e.match(n),o&&o[2].length===11?o[2]:null},getVimeoIdFromUrl:function(e){let t=e.match(/(video\/)(\w+)(_\d+x\d+|_\d+)(\.\w+$)/i);return t&&t[2]?t[2]:null},getVideoProvider:function(e){return this.isVimeo(e)?"Vimeo":this.isYoutube(e)?"YouTube":""},isVimeo:function(e){return/vimeo\.com\/.+/.test(e)},isYoutube:function(e){return e&&!!this.getYoutubeIdFromUrl(e)},brokenVimeoThumbnailRegexp:/\/\d+_[\dx]+(\.\w+)?$/,validateVideoFile:async function(e){let t={isValid:!0};if(!this.allowedVideoFormats.includes(e.type))return t.isValid=!1,t.errorType="FileFormatError",t.errorMessage="Please upload .mp4 or .mov files",t;let o=await this.probeVideoFile(e);
1if(o)t.metadata={size:e.size,duration:Math.floor(o.duration/o.timescale),width:o.videoTracks?.[0]?.video?.width,height:o.videoTracks?.[0]?.video?.height};else return t.isValid=!1,t.errorType="CodecDetectionError",t.errorMessage="Error detecting video codec",t;if(!this.isCodecAllowed(o.videoTracks?.[0]?.codec))return t.isValid=!1,t.errorType="InvalidCodecError",t.errorMessage="Please upload a video with H.264 codec",t;let{video_upload_limit:n}=T.getPermissions();return e.size>p.VIDEO_WIDGET_UPLOAD_SIZE_LIMIT?(t.isValid=!1,t.errorType="TooLargeError",t.errorMessage=`Please upload files smaller than ${E(p.VIDEO_WIDGET_UPLOAD_SIZE_LIMIT)}`,t):(e.size>n&&(t.isValid=!1,t.errorType="SubscriptionLimitError",t.errorMessage=y("constructor.newUploadLimits")?"Upgrade your subscription to increase the video file upload limit":I),t)},async probeVideoFile(e){return new Promise(async(t,o)=>{let{default:n}=await import("https://st-p.rmcdn1.net/3a2d896f/dist/c/c-TLFHTM5I.js"),i=n.createFile(),c=new FileReader,u;i.onReady=function(r){u=r},i.onerror=o;let s=0,l=50*1024;do try{let r=await new Promise((m,v)=>{c.onload=h=>{let f=h.target.result;f.fileStart=s,s+=f.byteLength,m(f)},c.onerror=v,c.readAsArrayBuffer(e.slice(s,s+l))});if(r.byteLength)i.appendBuffer(r);else break}catch(r){console.log("error probing video file: ",r),o(r);break}while(!u);t(u)})},allowedVideoFormats:["video/mp4","video/quicktime"],allowedVideoCodecs:[/^avc1.42/i,/^avc1.4D/i,/^avc1.64/i],isCodecAllowed:function(e){return this.allowedVideoCodecs.some(t=>t.test(e))}},j=P});export{j as a,A as b};

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.