1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["errors-CJz_ahKE.js","prod-BhSl5UlA.js","marketing-BOIeHjAk.js","enums-ho3_otb5.js","production-CAxRw_Io.js","AnimatedBubbles-CqvvQIfC.js","CollaboratorModal-BvF5zdI-.js","search-CZH9w59K.js","external-link-C1wylNq-.js","chevron-right-mS2GB_f4.js","PageThumbnailPreview-BIq0wZsT.js","ScaledPlaybillPage-DkXL2b_1.js","role-BbrR7j5m.js","zod-BBo4-T66.js","CoverThumbnail-oKpkew-h.js","marketing-CTYnQDIP.css","marketing-B90WbQqj.css"])))=>i.map(i=>d[i]); 2import{_ as M}from"./marketing-BOIeHjAk.js";import{b as F,p as E}from"./prod-BhSl5UlA.js";import"./enums-ho3_otb5.js";/* empty css */import"./production-CAxRw_Io.js";import"./AnimatedBubbles-CqvvQIfC.js";import"./CollaboratorModal-BvF5zdI-.js";import"./search-CZH9w59K.js";import"./external-link-C1wylNq-.js";import"./chevron-right-mS2GB_f4.js";import"./PageThumbnailPreview-BIq0wZsT.js";import"./ScaledPlaybillPage-DkXL2b_1.js";import"./role-BbrR7j5m.js";import"./zod-BBo4-T66.js";import"./CoverThumbnail-oKpkew-h.js";const m=/^Format:[\s\t]*/,R=/^Style:[\s\t]*/,y=/^Dialogue:[\s\t]*/,b=/[\s\t]*,[\s\t]*/,O=/\{[^}]+\}/g,w=/\\N/g,I=/^\[(.*)[\s\t]?Styles\]$/,S=/^\[(.*)[\s\t]?Events\]$/;class A{h;O=0;c=null;l=[];m=[];N=null;f;P={};async init(e){this.h=e,e.errors&&(this.f=(await M(async()=>{const{ParseErrorBuilder:r}=await import("./errors-CJz_ahKE.js");return{ParseErrorBuilder:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))).ParseErrorBuilder)}parse(e,r){if(this.O)switch(this.O){case 1:if(e==="")this.O=0;else if(R.test(e))if(this.N){const t=e.replace(R,"").split(b);this.S(t)}else this.g(this.f?.T("Style",r));else m.test(e)?this.N=e.replace(m,"").split(b):S.test(e)&&(this.N=null,this.O=2);break;case 2:if(e==="")this.Q();else if(y.test(e))if(this.Q(),this.N){const t=e.replace(y,"").split(b),s=this.U(t,r);s&&(this.c=s)}else this.g(this.f?.T("Dialogue",r));else this.c?this.c.text+=` 3`+e.replace(O,"").replace(w,` 4`):m.test(e)?this.N=e.replace(m,"").split(b):I.test(e)?(this.N=null,this.O=1):S.test(e)&&(this.N=null)}else e===""||(I.test(e)?(this.N=null,this.O=1):S.test(e)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.l,regions:[],errors:this.m}}Q(){this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null)}S(e){let r="Default",t={},s,a="center",l="bottom",g,n=1.2,o,h,c=3,p=[];for(let u=0;u<this.N.length;u++){const x=this.N[u],i=e[u];switch(x){case"Name":r=i;break;case"Fontname":t["font-family"]=i;break;case"Fontsize":t["font-size"]=`calc(${i} / var(--overlay-height))`;break;case"PrimaryColour":const _=k(i);_&&(t["--cue-color"]=_);break;case"BorderStyle":c=parseInt(i,10);break;case"BackColour":h=k(i);break;case"OutlineColour":const N=k(i);N&&(o=N);break;case"Bold":parseInt(i)&&(t["font-weight"]="bold");break;case"Italic":parseInt(i)&&(t["font-style"]="italic");break;case"Underline":parseInt(i)&&(t["text-decoration"]="underline");break;case"StrikeOut":parseInt(i)&&(t["text-decoration"]="line-through");break;case"Spacing":t["letter-spacing"]=i+"px";break;case"AlphaLevel":t.opacity=parseFloat(i);break;case"ScaleX":p.push(`scaleX(${parseFloat(i)/100})`);break;case"ScaleY":p.push(`scaleY(${parseFloat(i)/100})`);break;case"Angle":p.push(`rotate(${i}deg)`);break;case"Shadow":n=parseInt(i,10)*1.2;break;case"MarginL":t["--cue-width"]="auto",t["--cue-left"]=parseFloat(i)+"px";break;case"MarginR":t["--cue-width"]="auto",t["--cue-right"]=parseFloat(i)+"px";break;case"MarginV":g=parseFloat(i);break;case"Outline":s=parseInt(i,10);break;case"Alignment":const d=parseInt(i,10);switch(d>=4&&(l=d>=7?"top":"center"),d%3){case 1:a="start";break;case 2:a="center";break;case 3:a="end";break}}}if(t.R=l,t["--cue-white-space"]="normal",t["--cue-line-height"]="normal",t["--cue-text-align"]=a,l==="center"?(t["--cue-top"]="50%",p.push("translateY(-50%)")):t[`--cue-${l}`]=(g||0)+"px",c===1&&(t["--cue-padding-y"]="0"),(c===1||h)&&(t["--cue-bg-color"]=c===1?"none":h),c===3&&o&&(t["--cue-outline"]=`${s}px solid ${o}`),c===1&&typeof s=="number"){const u=h??"#000";t["--cue-text-shadow"]=[o&&T(s*1.2,n*1.2,o),o?T(s*(s/2),n*(s/2),u):T(s,n,u)].filter(
vendor: 1,362 bytes, lines 4-5
4Boolean).join(", ")}p.length&&(t["--cue-transform"]=p.join(" ")),this.P[r]=t}U(e,r){const t=this.V(e),s=this.q(t.Start,t.End,r);if(!s)return;const a=new F(s[0],s[1],""),l={...this.P[t.Style]||{}},g=t.Name?`<v ${t.Name}>`:"",n=l.R,o=t.MarginL&&parseFloat(t.MarginL),h=t.MarginR&&parseFloat(t.MarginR),c=t.MarginV&&parseFloat(t.MarginV);return o&&(l["--cue-width"]="auto",l["--cue-left"]=o+"px"),h&&(l["--cue-width"]="auto",l["--cue-right"]=h+"px"),c&&n!=="center"&&(l[`--cue-${n}`]=c+"px"),a.text=g+e.slice(this.N.length-1).join(", ").replace(O,"").replace(w,` 5`),delete l.R,Object.keys(l).length&&(a.style=l),a}V(e){const r={};for(let t=0;t<this.N.length;t++)r[this.N[t]]=e[t];return r}q(e,r,t){const s=E(e),a=E(r);if(s!==null&&a!==null&&a>s)return[s,a];s===null&&this.g(this.f?.s(e,t)),a===null&&this.g(this.f?.t(r,t)),s!=null&&a!==null&&a>s&&this.g(this.f?.u(s,a,t))}g(e){if(e){if(this.m.push(e),this.h.strict)throw this.h.cancel(),e;this.h.onError?.(e)}}}function k(f){const e=parseInt(f.replace("&H",""),16);if(e>=0){const t=(e>>24&255^255)/255,s=e>>16&255,a=e>>8&255;return"rgba("+[e&255,a,s,t].join(",")+")"}return null}function T(f,e,r){const t=Math.ceil(2*Math.PI*f);let s="";for(let a=0;a<t;a++){const l=2*Math.PI*a/t;s+=f*Math.cos(l)+"px "+e*Math.sin(l)+"px 0 "+r+(a==t-1?"":",")}return s}function G(){return new A}export{A as SSAParser,G as default};
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.