@bendyline/squisq-react 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CaptionOverlay.d.ts +16 -7
- package/dist/CaptionOverlay.d.ts.map +1 -1
- package/dist/CaptionOverlay.js +7 -3
- package/dist/CaptionOverlay.js.map +1 -1
- package/dist/DocControlsBottom.d.ts.map +1 -1
- package/dist/DocControlsBottom.js +5 -1
- package/dist/DocControlsBottom.js.map +1 -1
- package/dist/DocControlsOverlay.d.ts.map +1 -1
- package/dist/DocControlsOverlay.js +9 -4
- package/dist/DocControlsOverlay.js.map +1 -1
- package/dist/DocControlsSidebar.d.ts.map +1 -1
- package/dist/DocControlsSidebar.js +5 -1
- package/dist/DocControlsSidebar.js.map +1 -1
- package/dist/DocPlayer.d.ts +5 -2
- package/dist/DocPlayer.d.ts.map +1 -1
- package/dist/DocPlayer.js +36 -7
- package/dist/DocPlayer.js.map +1 -1
- package/dist/DocPlayerWithSidebar.d.ts.map +1 -1
- package/dist/DocPlayerWithSidebar.js +1 -0
- package/dist/DocPlayerWithSidebar.js.map +1 -1
- package/dist/DocProgressBar.js +2 -2
- package/dist/LinearDocView.d.ts.map +1 -1
- package/dist/LinearDocView.js +88 -6
- package/dist/LinearDocView.js.map +1 -1
- package/dist/SocialCaptionOverlay.d.ts +27 -0
- package/dist/SocialCaptionOverlay.d.ts.map +1 -0
- package/dist/SocialCaptionOverlay.js +184 -0
- package/dist/SocialCaptionOverlay.js.map +1 -0
- package/dist/__tests__/DocControlsSlideshow.test.js +1 -0
- package/dist/__tests__/DocControlsSlideshow.test.js.map +1 -1
- package/dist/hooks/useAudioSync.d.ts.map +1 -1
- package/dist/hooks/useAudioSync.js +4 -2
- package/dist/hooks/useAudioSync.js.map +1 -1
- package/dist/hooks/useDocPlayback.d.ts.map +1 -1
- package/dist/hooks/useDocPlayback.js +7 -4
- package/dist/hooks/useDocPlayback.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layers/ShapeLayer.d.ts.map +1 -1
- package/dist/layers/ShapeLayer.js +7 -3
- package/dist/layers/ShapeLayer.js.map +1 -1
- package/dist/layers/TextLayer.js +1 -1
- package/dist/layers/TextLayer.js.map +1 -1
- package/dist/squisq-player.global.js +70 -5
- package/dist/squisq-player.global.js.map +1 -1
- package/dist/standalone-entry.d.ts +8 -0
- package/dist/standalone-entry.d.ts.map +1 -1
- package/dist/standalone-entry.js +6 -3
- package/dist/standalone-entry.js.map +1 -1
- package/dist/standalone-source.js +1 -1
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
- package/src/CaptionOverlay.tsx +33 -8
- package/src/DocControlsBottom.tsx +11 -5
- package/src/DocControlsOverlay.tsx +18 -6
- package/src/DocControlsSidebar.tsx +11 -5
- package/src/DocPlayer.tsx +56 -9
- package/src/DocPlayerWithSidebar.tsx +1 -0
- package/src/DocProgressBar.tsx +2 -2
- package/src/LinearDocView.tsx +103 -11
- package/src/SocialCaptionOverlay.tsx +254 -0
- package/src/__tests__/DocControlsSlideshow.test.tsx +1 -0
- package/src/hooks/useAudioSync.ts +5 -2
- package/src/hooks/useDocPlayback.ts +8 -3
- package/src/index.ts +3 -0
- package/src/layers/ShapeLayer.tsx +8 -3
- package/src/layers/TextLayer.tsx +1 -1
- package/src/standalone-entry.tsx +23 -3
- package/src/types.ts +21 -0
|
@@ -1,6 +1,71 @@
|
|
|
1
|
-
var SquisqPlayer=(function(exports){'use strict';var rt,B,hn,ge,pn,gn,yn,bn,St,xt,vt,_n,et={},tt=[],Jr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,De=Array.isArray;function ue(e,t){for(var n in t)e[n]=t[n];return e}function Tt(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function de(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?rt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Je(e,a,r,o,null)}function Je(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++hn,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function te(e){return e.children}function ie(e,t){this.props=e,this.context=t;}function Me(e,t){if(t==null)return e.__?Me(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Me(e):null}function eo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=ue({},t);i.__v=t.__v+1,B.vnode&&B.vnode(i),Ct(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Me(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,wn(r,i,o),t.__e=t.__=null,i.__e!=n&&xn(i);}}function xn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),xn(e)}function kt(e){(!e.__d&&(e.__d=true)&&ge.push(e)&&!nt.__r++||pn!=B.debounceRendering)&&((pn=B.debounceRendering)||gn)(nt);}function nt(){try{for(var e,t=1;ge.length;)ge.length>t&&ge.sort(yn),e=ge.shift(),t=ge.length,eo(e);}finally{ge.length=nt.__r=0;}}function vn(e,t,n,r,o,i,a,s,u,c,f){var d,m,p,y,h,b,v,_=r&&r.__k||tt,S=t.length;for(u=to(n,t,_,u,S),d=0;d<S;d++)(p=n.__k[d])!=null&&(m=p.__i!=-1&&_[p.__i]||et,p.__i=d,b=Ct(e,p,m,o,i,a,s,u,c,f),y=p.__e,p.ref&&m.ref!=p.ref&&(m.ref&&At(m.ref,null,p),f.push(p.ref,p.__c||y,p)),h==null&&y!=null&&(h=y),(v=!!(4&p.__u))||m.__k===p.__k?u=kn(p,u,e,v):typeof p.type=="function"&&b!==void 0?u=b:y&&(u=y.nextSibling),p.__u&=-7);return n.__e=h,u}function to(e,t,n,r,o){var i,a,s,u,c,f=n.length,d=f,m=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=Je(null,a,null,null,null):De(a)?a=e.__k[i]=Je(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=Je(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,u=i+m,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=no(a,n,u,d))!=-1&&(d--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>f?m--:o<f&&m++),typeof a.type!="function"&&(a.__u|=4)):c!=u&&(c==u-1?m--:c==u+1?m++:(c>u?m--:m++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<f;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Me(s)),Tn(s,s));return r}function kn(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=kn(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Me(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Fe(e,t){return t=t||[],e==null||typeof e=="boolean"||(De(e)?e.some(function(n){Fe(n,t);}):t.push(e)),t}function no(e,t,n,r){var o,i,a,s=e.key,u=e.type,c=t[n],f=c!=null&&(2&c.__u)==0;if(c===null&&s==null||f&&s==c.key&&u==c.type)return n;if(r>(f?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((c=t[a=o>=0?o--:i++])!=null&&(2&c.__u)==0&&s==c.key&&u==c.type)return a}return -1}function fn(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Jr.test(t)?n:n+"px";}function Ke(e,t,n,r,o){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else {if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||fn(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||fn(e.style,t,n[t]);}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(bn,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=St,e.addEventListener(t,i?vt:xt,i)):e.removeEventListener(t,i?vt:xt,i);else {if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n));}}function mn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=St++;else if(t.t<n.u)return;return n(B.event?B.event(t):t)}}}function Ct(e,t,n,r,o,i,a,s,u,c){var f,d,m,p,y,h,b,v,_,S,w,A,I,$,N,W=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(f=B.__b)&&f(t);e:if(typeof W=="function")try{if(v=t.props,_=W.prototype&&W.prototype.render,S=(f=W.contextType)&&r[f.__c],w=f?S?S.props.value:f.__:r,n.__c?b=(d=t.__c=n.__c).__=d.__E:(_?t.__c=d=new W(v,w):(t.__c=d=new ie(v,w),d.constructor=W,d.render=oo),S&&S.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),_&&d.__s==null&&(d.__s=d.state),_&&W.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ue({},d.__s)),ue(d.__s,W.getDerivedStateFromProps(v,d.__s))),p=d.props,y=d.state,d.__v=t,m)_&&W.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),_&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(_&&W.getDerivedStateFromProps==null&&v!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,w),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,w)===!1){t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t);}),tt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,w),_&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,y,h);});}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,A=B.__r,I=0,_)d.state=d.__s,d.__d=!1,A&&A(t),f=d.render(d.props,d.state,d.context),tt.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,A&&A(t),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++I<25);d.state=d.__s,d.getChildContext!=null&&(r=ue(ue({},r),d.getChildContext())),_&&!m&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(p,y)),$=f!=null&&f.type===te&&f.key==null?Sn(f.props.children):f,s=vn(e,De($)?$:[$],t,n,r,o,i,a,s,u,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),b&&(d.__E=d.__=null);}catch(U){if(t.__v=null,u||i!=null)if(U.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s;}else {for(N=i.length;N--;)Tt(i[N]);wt(t);}else t.__e=n.__e,t.__k=n.__k,U.then||wt(t);B.__e(U,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ro(n.__e,t,n,r,o,i,a,u,c);return (f=B.diffed)&&f(t),128&t.__u?void 0:s}function wt(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(wt));}function wn(e,t,n){for(var r=0;r<n.length;r++)At(n[r],n[++r],n[++r]);B.__c&&B.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o);});}catch(i){B.__e(i,o.__v);}});}function Sn(e){return typeof e!="object"||e==null||e.__b>0?e:De(e)?e.map(Sn):ue({},e)}function ro(e,t,n,r,o,i,a,s,u){var c,f,d,m,p,y,h,b=n.props||et,v=t.props,_=t.type;if(_=="svg"?o="http://www.w3.org/2000/svg":_=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((p=i[c])&&"setAttribute"in p==!!_&&(_?p.localName==_:p.nodeType==3)){e=p,i[c]=null;break}}if(e==null){if(_==null)return document.createTextNode(v);e=document.createElementNS(o,_,v.is&&v),s&&(B.__m&&B.__m(t,i),s=false),i=null;}if(_==null)b===v||s&&e.data==v||(e.data=v);else {if(i=i&&rt.call(e.childNodes),!s&&i!=null)for(b={},c=0;c<e.attributes.length;c++)b[(p=e.attributes[c]).name]=p.value;for(c in b)p=b[c],c=="dangerouslySetInnerHTML"?d=p:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||Ke(e,c,null,p,o);for(c in v)p=v[c],c=="children"?m=p:c=="dangerouslySetInnerHTML"?f=p:c=="value"?y=p:c=="checked"?h=p:s&&typeof p!="function"||b[c]===p||Ke(e,c,p,b[c],o);if(f)s||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=""),vn(t.type=="template"?e.content:e,De(m)?m:[m],t,n,r,_=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Me(n,0),s,u),i!=null)for(c=i.length;c--;)Tt(i[c]);s||(c="value",_=="progress"&&y==null?e.removeAttribute("value"):y!=null&&(y!==e[c]||_=="progress"&&!y||_=="option"&&y!=b[c])&&Ke(e,c,y,b[c],o),c="checked",h!=null&&h!=e[c]&&Ke(e,c,h,b[c],o));}return e}function At(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t));}else e.current=t;}catch(o){B.__e(o,n);}}function Tn(e,t,n){var r,o;if(B.unmount&&B.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||At(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount();}catch(i){B.__e(i,t);}r.base=r.__P=null;}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Tn(r[o],t,n||typeof e.type!="function");n||Tt(e.__e),e.__c=e.__=e.__e=void 0;}function oo(e,t,n){return this.constructor(e,n)}function Mt(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),o=(r="undefined"=="function")?null:t.__k,i=[],a=[],Ct(t,e=(t).__k=de(te,null,[e]),o||et,et,t.namespaceURI,o?null:t.firstChild?rt.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),wn(i,e,a);}function ot(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null;},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=true,kt(a);});},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i);};}),n.children}return t.__c="__cC"+_n++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}rt=tt.slice,B={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s;}throw e}},hn=0,ie.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ue({},this.state),typeof e=="function"&&(e=e(ue({},n),this.props)),e&&ue(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),kt(this));},ie.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),kt(this));},ie.prototype.render=te,ge=[],gn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yn=function(e,t){return e.__v.__b-t.__v.__b},nt.__r=0,bn=/(PointerCapture)$|Capture$/i,St=0,xt=mn(false),vt=mn(true),_n=0;var Le,V,Lt,Cn,ze=0,Rn=[],Z=B,An=Z.__b,Mn=Z.__r,Ln=Z.diffed,Pn=Z.__c,Bn=Z.unmount,En=Z.__;function at(e,t){Z.__h&&Z.__h(V,e,ze||t),ze=0;var n=V.__H||(V.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function O(e){return ze=1,$n(Dn,e)}function $n(e,t,n){var r=at(Le++,2);if(r.t=e,!r.__c&&(r.__=[Dn(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}));}],r.__c=V,!V.__f)){var o=function(s,u,c){if(!r.__c.__H)return true;var f=r.__c.__H.__.filter(function(m){return m.__c});if(f.every(function(m){return !m.__N}))return !i||i.call(this,s,u,c);var d=r.__c.props!==s;return f.some(function(m){if(m.__N){var p=m.__[0];m.__=m.__N,m.__N=void 0,p!==m.__[0]&&(d=true);}}),i&&i.call(this,s,u,c)||d};V.__f=true;var i=V.shouldComponentUpdate,a=V.componentWillUpdate;V.componentWillUpdate=function(s,u,c){if(this.__e){var f=i;i=void 0,o(s,u,c),i=f;}a&&a.call(this,s,u,c);},V.shouldComponentUpdate=o;}return r.__N||r.__}function D(e,t){var n=at(Le++,3);!Z.__s&&Nn(n.__H,t)&&(n.__=e,n.u=t,V.__H.__h.push(n));}function q(e){return ze=5,F(function(){return {current:e}},[])}function F(e,t){var n=at(Le++,7);return Nn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function j(e,t){return ze=8,F(function(){return e},t)}function Bt(e){var t=V.context[e.__c],n=at(Le++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(V)),t.props.value):e.__}function io(){for(var e;e=Rn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(it),t.__h.some(Pt),t.__h=[];}catch(n){t.__h=[],Z.__e(n,e.__v);}}}Z.__b=function(e){V=null,An&&An(e);},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),En&&En(e,t);},Z.__r=function(e){Mn&&Mn(e),Le=0;var t=(V=e.__c).__H;t&&(Lt===V?(t.__h=[],V.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(it),t.__h.some(Pt),t.__h=[],Le=0)),Lt=V;},Z.diffed=function(e){Ln&&Ln(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Rn.push(t)!==1&&Cn===Z.requestAnimationFrame||((Cn=Z.requestAnimationFrame)||ao)(io)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Lt=V=null;},Z.__c=function(e,t){t.some(function(n){try{n.__h.some(it),n.__h=n.__h.filter(function(r){return !r.__||Pt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],Z.__e(r,n.__v);}}),Pn&&Pn(e,t);},Z.unmount=function(e){Bn&&Bn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{it(r);}catch(o){t=o;}}),n.__H=void 0,t&&Z.__e(t,n.__v));};var In=typeof requestAnimationFrame=="function";function ao(e){var t,n=function(){clearTimeout(r),In&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);In&&(t=requestAnimationFrame(n));}function it(e){var t=V,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),V=t;}function Pt(e){var t=V;e.__c=e.__(),V=t;}function Nn(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Dn(e,t){return typeof t=="function"?t(e):t}function lo(e,t){for(var n in t)e[n]=t[n];return e}function Fn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return true;return false}function zn(e,t){this.props=e,this.context=t;}(zn.prototype=new ie).isPureReactComponent=true,zn.prototype.shouldComponentUpdate=function(e,t){return Fn(this.props,e)||Fn(this.state,t)};var qn=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qn&&qn(e);};var co=B.__e;B.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}co(e,t,n,r);};var On=B.unmount;function jn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c();}),e.__c.__H=null),(e=lo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return jn(r,t,n)})),e}function Xn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Xn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Et(){this.__u=0,this.o=null,this.__b=null;}function Zn(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function st(){this.i=null,this.l=null;}B.unmount=function(e){var t=e.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),On&&On(e);},(Et.prototype=new ie).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Zn(r.__v),i=false,a=function(){i||r.__z||(i=true,n.__R=null,o?o(u):u());};n.__R=a;var s=n.__P;n.__P=null;var u=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=Xn(c,c.__c.__P,c.__c.__O);}var f;for(r.setState({__a:r.__b=null});f=r.o.pop();)f.__P=s,f.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a);},Et.prototype.componentWillUnmount=function(){this.o=[];},Et.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=jn(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&de(te,null,e.fallback);return o&&(o.__u&=-33),[de(te,null,t.__a?null:e.children),o]};var Hn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2];}};(st.prototype=new ie).__a=function(e){var t=this,n=Zn(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Hn(t,e,r)):o();};n?n(i):i();}},st.prototype.render=function(e){this.i=null,this.l=new Map;var t=Fe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},st.prototype.componentDidUpdate=st.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Hn(e,n,t);});};var uo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,po=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,fo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,mo=/[A-Z0-9]/g,ho=typeof document<"u",go=function(e){return (typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Gn(e,t,n){return t.__k==null&&(t.textContent=""),Mt(e,t),e?e.__c:null}ie.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ie.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var Wn=B.event;B.event=function(e){return Wn&&(e=Wn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var yo={configurable:true,get:function(){return this.class}},Vn=B.vnode;B.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||ho&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===true?s="":u==="translate"&&s==="no"?s=false:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||r!=="input"&&r!=="textarea"||go(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":fo.test(a)&&(a=u):u=a="oninput":i&&po.test(a)?a=a.replace(mo,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&o[a=u]&&(a="oninputCapture"),o[a]=s;}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=Fe(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1;})),o.defaultValue!=null&&(o.value=Fe(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",yo)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=uo,Vn&&Vn(e);};var Un=B.__r;B.__r=function(e){Un&&Un(e),e.__c;};var Yn=B.diffed;B.diffed=function(e){Yn&&Yn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value);};function Kn(e){return !!e.__k&&(Mt(null,e),true)}function Jn(e){return {render:function(t){Gn(t,e);},unmount:function(){Kn(e);}}}function It(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t>=r.startTime&&t<r.startTime+r.duration)return r}return e[0]||null}function qe(e,t){if(!e||!e.phrases.length)return null;for(let n of e.phrases)if(t>=n.startTime&&t<n.endTime)return n;return null}var J={landscape:{width:1920,height:1080,name:"16:9 Landscape"},portrait:{width:1080,height:1920,name:"9:16 Portrait"},square:{width:1080,height:1080,name:"1:1 Square"}};var bo=Math.sqrt(1920*1920+1080*1080);function Rt(e){return Math.sqrt(e.width*e.width+e.height*e.height)/bo}function $t(e){let t=e.width/e.height;return Math.abs(t-1)<.05?"square":t>1?"landscape":"portrait"}var _o={landscape:{primaryY:"35%",secondaryY:"55%",tertiaryY:"75%",titleScale:1,bodyScale:1,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"80%",horizontalPadding:"10%",captionY:"85%",captionScale:1},portrait:{primaryY:"25%",secondaryY:"42%",tertiaryY:"58%",titleScale:.7,bodyScale:1.5,columnLeftX:"50%",columnRightX:"50%",columnTopY:"30%",columnBottomY:"55%",stackColumns:true,maxTextWidth:"90%",horizontalPadding:"5%",captionY:"75%",captionScale:.85},square:{primaryY:"30%",secondaryY:"50%",tertiaryY:"70%",titleScale:.85,bodyScale:.9,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"85%",horizontalPadding:"7.5%",captionY:"82%",captionScale:.9}};function Oe(e){return _o[e]}function tr(e,t,n,r=false){let o=Rt(t),i=Oe(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function lt(e){let t=Oe(e);return t.stackColumns?{left:{x:"50%",y:t.columnTopY},right:{x:"50%",y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:"50%"},right:{x:t.columnRightX,y:"50%"}}}var Nt='"PT Serif", Georgia, "Times New Roman", serif';function ne(e){return "template"in e&&typeof e.template=="string"}function pe(e,t,n,r=J.landscape){let o=$t(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:Rt(r),orientation:o,layout:Oe(o)}}function P(e,t,n=false){return tr(e,t.viewport,t.orientation,n)}function Dt(e){return "template"in e&&typeof e.template=="string"}var er='"PT Serif", Georgia, "Times New Roman", serif';var xo={blue:{bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"},green:{bg:"#22543d",text:"#9ae6b4",accent:"#68d391"},purple:{bg:"#44337a",text:"#d6bcfa",accent:"#b794f4"},red:{bg:"#742a2a",text:"#fc8181",accent:"#feb2b2"},orange:{bg:"#744210",text:"#fbd38d",accent:"#f6ad55"},teal:{bg:"#234e52",text:"#81e6d9",accent:"#4fd1c5"}},vo={id:"documentary",name:"Documentary",description:"Classic dark cinematic look with serif typography. The original Squisq style.",colors:{primary:"#3d5a80",secondary:"#63b3ed",background:"#1a202c",backgroundLight:"#2d3748",text:"#ffffff",textMuted:"#a0aec0",highlight:"#63b3ed",warning:"#fc8181"},typography:{bodyFontFamily:er,titleFontFamily:er,titleWeight:"bold"},style:{textShadow:true,overlayOpacity:.5,animationSpeed:1},renderStyle:{name:"documentary",defaultTextAnimation:"fadeIn",defaultImageAnimation:"slowZoom",ambientMotion:true,defaultTransition:{type:"fade",duration:.8}},colorSchemes:xo,persistentLayers:{bottomLayers:[{template:"gradientBackground",config:{type:"gradientBackground",preset:"dark-vignette"}}]}};var fe=vo;function nr(e){return "children"in e&&Array.isArray(e.children)?e.children:[]}function xe(e){return "value"in e&&typeof e.value=="string"?e.value:nr(e).map(xe).join("")}var Co={"dark-vignette":"radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)","radial-dark":"radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)","warm-sunset":"linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)","cool-blue":"linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)","earth-tones":"linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)"};function Ao(e){return {type:"shape",id:"persistent-bg-solid",content:{shape:"rect",fill:e.color},position:{x:0,y:0,width:"100%",height:"100%"}}}function Mo(e){return {type:"shape",id:"persistent-bg-gradient",content:{shape:"rect",fill:e.gradient??Co[e.preset??"dark-vignette"]},position:{x:0,y:0,width:"100%",height:"100%"}}}function Lo(e){let t=[],n=e.opacity??.4,r={type:"image",id:"persistent-bg-image",content:{src:e.src,alt:"Background",fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:e.ambientMotion?{type:e.ambientMotion,duration:30}:void 0};return t.push(r),t.push({type:"shape",id:"persistent-bg-overlay",content:{shape:"rect",fill:`rgba(0,0,0,${.5+(1-n)*.3})`},position:{x:0,y:0,width:"100%",height:"100%"}}),t}function Po(e){let t=e.opacity??.1;return {type:"shape",id:"persistent-bg-pattern",content:{shape:"rect",fill:e.color??`rgba(255,255,255,${t})`},position:{x:0,y:0,width:"100%",height:"100%"}}}function Bo(e){let t=[],n=e.fontSize??18,r=!!e.subtitle,o=e.position.includes("bottom"),i=e.position.includes("left"),a=3,s=r?"15%":"7%",u=o?r?"78%":"84%":"2%",c=i?`${a}%`:"68%",f=r?"6%":"5%",d=r?"10%":"5%",m=1.5,p=e.showThumbnail&&i?`${a+m+6+m}%`:`${a+m}%`,y=e.showThumbnail?"19%":"24%",h=o?r?"80%":"86%":"4%";if(t.push({type:"shape",id:"persistent-caption-bg",content:{shape:"rect",fill:"rgba(0,0,0,0.6)",borderRadius:8},position:{x:c,y:u,width:e.showThumbnail?"30%":"28%",height:s}}),e.showThumbnail&&e.thumbnailSrc){let b=i?`${a+m}%`:"93%",v=o?r?`${78+m}%`:"85%":"3%";t.push({type:"image",id:"persistent-caption-thumb",content:{src:e.thumbnailSrc,alt:"Article thumbnail",fit:"cover"},position:{x:b,y:v,width:f,height:d}});}if(t.push({type:"text",id:"persistent-caption-title",content:{text:e.title,style:{fontSize:n,fontWeight:"bold",color:"rgba(255,255,255,0.9)",textAlign:i?"left":"right",maxLines:1}},position:{x:p,y:h,width:y}}),r){let b=o?"85.5%":"8%";t.push({type:"text",id:"persistent-caption-subtitle",content:{text:e.subtitle,style:{fontSize:18,fontWeight:"normal",color:"rgba(255,255,255,0.55)",textAlign:i?"left":"right"}},position:{x:p,y:b,width:y}});}return t}function Eo(e){let t=e.position.includes("bottom"),r=e.position.includes("left")?"3%":"90%",o=t?"94%":"3%";return e.isImage?{type:"image",id:"persistent-branding",content:{src:e.content,alt:"Branding",fit:"contain"},position:{x:r,y:o,width:"8%",height:"4%"}}:{type:"text",id:"persistent-branding",content:{text:e.content,style:{fontSize:14,fontWeight:"normal",color:"rgba(255,255,255,0.6)"}},position:{x:r,y:o}}}function Io(e){let t=e.color??"rgba(255,255,255,0.3)",n=e.position==="top"?"1%":"98%";return {type:"shape",id:"persistent-progress",content:{shape:"rect",fill:t,borderRadius:2},position:{x:"5%",y:n,width:"90%",height:"0.5%"}}}function Ro(e){if(!Dt(e))return [e];let n=e.config;switch(n.type){case "solidBackground":return [Ao(n)];case "gradientBackground":return [Mo(n)];case "imageBackground":return Lo(n);case "patternBackground":return [Po(n)];case "titleCaption":return Bo(n);case "cornerBranding":return [Eo(n)];case "progressIndicator":return [Io(n)];default:return console.warn("Unknown persistent layer template:",n.type),[]}}function He(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(Ro(n)),[])}function ir(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=P(96,t,true),u=P(36,t,false),f=[{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 40%, ${o||i.colors.primary} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"accent-line",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.2)"},position:{x:"40%",y:r?"28%":"38%",width:"20%",height:"2px"}},{type:"text",id:"title",content:{text:n,style:{fontSize:s,fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:r?a.primaryY:"50%",anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:2}}];return r&&f.push({type:"text",id:"subtitle",content:{text:r,style:{fontSize:u,color:i.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:a.secondaryY,anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:1}}),f}var $o={bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"};function ye(e,t){let n=e.theme.colorSchemes;if(t&&t in n)return n[t];let r=Object.keys(n);return r.length>0?n[r[0]]:$o}function ar(e,t){let{title:n,colorScheme:r="blue",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,u=ye(t,r),c=P(72,t,true),f=[];return o?(f.push({type:"image",id:"bg-image",content:{src:o,alt:i||n,fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:a?{type:a,duration:8}:{type:"slowZoom",duration:8,direction:"in"}}),f.push({type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.5)"},position:{x:0,y:0,width:"100%",height:"100%"}})):(f.push({type:"shape",id:"bg",content:{shape:"rect",fill:u.bg},position:{x:0,y:0,width:"100%",height:"100%"}}),f.push({type:"shape",id:"line-top",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"40%",width:"20%",height:"2px",anchor:"center"}}),f.push({type:"shape",id:"line-bottom",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"60%",width:"20%",height:"2px",anchor:"center"}})),f.push({type:"text",id:"title",content:{text:n,style:{fontSize:c,fontWeight:"bold",color:o?"#ffffff":u.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:s.maxTextWidth},animation:{type:"fadeIn",duration:1.5}}),f}var No=/^(\d+(?:\.\d+)?)\s*%?$/,be={textCenterX:"50%",textWidth:"85%",textYAdjust:0,adjustY:false};function Pe(e,t){if(!e)return;let n=t!==void 0?{duration:t}:{};switch(e){case "zoomIn":case "in":return {type:"slowZoom",direction:"in",...n};case "zoomOut":case "out":return {type:"slowZoom",direction:"out",...n};case "panLeft":case "left":return {type:"slowZoom",panDirection:"left",...n};case "panRight":case "right":return {type:"slowZoom",panDirection:"right",...n};default:return}}var le=35,sr=`${le}%`;function ve(e){switch(e){case "left-strip":return {textCenterX:`${50+le/2}%`,textWidth:`${100-le-8}%`,textYAdjust:0,adjustY:false};case "right-strip":return {textCenterX:`${50-le/2}%`,textWidth:`${100-le-8}%`,textYAdjust:0,adjustY:false};case "bottom-strip":return {textCenterX:"50%",textWidth:"85%",textYAdjust:-10,adjustY:true};case "corner-inset":return {textCenterX:"45%",textWidth:"70%",textYAdjust:0,adjustY:false};default:return be}}function ke(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case "left-strip":n.push(rr(r,o,"left",t,a,s,u)),n.push(or("left",t));break;case "right-strip":n.push(rr(r,o,"right",t,a,s,u)),n.push(or("right",t));break;case "bottom-strip":n.push(Do(r,o,t,a,s,u)),n.push(Fo(t));break;case "corner-inset":n.push(zo(r,o,t,a,s,u)),n.push(qo(t));break}return n}function rr(e,t,n,r,o,i,a){return {type:"image",id:`${r}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:i,license:a},position:{x:n==="left"?0:`${100-le}%`,y:0,width:sr,height:"100%"},animation:Pe(o,15)}}function or(e,t){let n=e==="left"?"accent-gradient-left":"accent-gradient-right";return {type:"shape",id:`${t}-accent-fade`,content:{shape:"rect",fill:`url(#${n})`},position:{x:e==="left"?`${le-8}%`:`${100-le}%`,y:0,width:"10%",height:"100%"}}}function Do(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:0,y:`${100-le}%`,width:"100%",height:sr},animation:Pe(r,15)}}function Fo(e){return {type:"shape",id:`${e}-accent-fade`,content:{shape:"rect",fill:"url(#accent-gradient-bottom)"},position:{x:0,y:`${100-le-8}%`,width:"100%",height:"12%"}}}function zo(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:"70%",y:"60%",width:"28%",height:"38%",anchor:"top-left"},animation:Pe(r,15)??{type:"fadeIn",duration:2,delay:.5}}}function qo(e){return {type:"shape",id:`${e}-accent-vignette`,content:{shape:"rect",fill:"url(#accent-vignette-corner)",borderRadius:8},position:{x:"69%",y:"59%",width:"30%",height:"40%"}}}function G(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e=="number"?`${e}%`:e;let n=typeof e=="number"?`${e}`:e,r=n.match(No);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var Oo=/[.;:!?]+$/;function zt(e){return e.replace(Oo,"").trim()}function ut(e,t){return {type:"shape",id:e,content:{shape:"rect",fill:t},position:{x:0,y:0,width:"100%",height:"100%"}}}function lr(e,t){let{stat:n,description:r,detail:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=ye(t,i),c=a?ve(a.position):be,f=P(148,t,true),d=P(32,t,false),m=P(26,t,false),p=[ut("bg",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&p.push(...ke(a,e.id)),p.push({type:"text",id:"stat",content:{text:n,style:{fontSize:f,fontWeight:"bold",color:u.text,shadow:!!a}},position:{x:c.textCenterX,y:G("32%",c),anchor:"center"},animation:{type:"zoomIn",duration:.6}}),p.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,color:s.colors.textMuted,textAlign:"center",lineHeight:1.6,shadow:!!a}},position:{x:c.textCenterX,y:G("58%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.3}}),o&&p.push({type:"text",id:"detail",content:{text:o,style:{fontSize:m,color:u.accent,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:G("75%",c),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1}}),p}function cr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?ve(o.position):be,u=P(48,t,true),c=P(24,t,false),f=P(280,t,true),d=[ut("bg",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...ke(o,e.id)),d.push({type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:f,color:"rgba(255, 255, 255, 0.06)",textAlign:"center"}},position:{x:s.textCenterX,y:G("18%",s),anchor:"center"}});let m=r?a.primaryY:"50%";return d.push({type:"text",id:"quote",content:{text:n,style:{fontSize:u,color:i.colors.text,textAlign:"center",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:G(m,s),anchor:"center",width:s.textWidth},animation:{type:"fadeIn",duration:2}}),r&&d.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:c,color:i.colors.textMuted,textAlign:"center",shadow:!!o}},position:{x:s.textCenterX,y:G(a.captionY,s),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),d}function ur(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?ve(i.position):be,u=P(56,t,true),c=P(32,t,false),f=P(20,t,false),d=[ut("bg",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...ke(i,e.id)),d.push({type:"text",id:"fact",content:{text:n,style:{fontSize:u,fontWeight:"bold",color:a.colors.text,textAlign:"center",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:G("35%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),d.push({type:"text",id:"explanation",content:{text:r,style:{fontSize:c,color:a.colors.textMuted,textAlign:"center",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:G("60%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&d.push({type:"text",id:"source",content:{text:o,style:{fontSize:f,color:a.colors.textMuted,textAlign:"center",shadow:!!i}},position:{x:s.textCenterX,y:G("85%",s),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),d}function dr(e,t){let{left:n,right:r,header:o,leftColor:i="green",rightColor:a="blue"}=e;if(!n?.label||!r?.label)return [];let{theme:s,layout:u,orientation:c}=t,f=ye(t,i),d=ye(t,a),m=lt(c),p=u.stackColumns,y=p?"85%":"42%",h=P(32,t,false),b=P(44,t,true),v=P(22,t,false),_=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${s.colors.background} 0%, #16202e 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];p||(_.push({type:"shape",id:"left-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"3%",y:"15%",width:"44%",height:"70%"}}),_.push({type:"shape",id:"right-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"53%",y:"15%",width:"44%",height:"70%"}}));let S=p?"12%":"22%";o&&_.push({type:"text",id:"header",content:{text:o,style:{fontSize:h,color:s.colors.textMuted,textAlign:"center"}},position:{x:"50%",y:S,anchor:"center"},animation:{type:"fadeIn",duration:.8}});let w,A,I,$;if(p)w=o?"30%":"25%",A=o?"40%":"35%",I=o?"60%":"55%",$=o?"70%":"65%";else {let se=o?"47%":"45%",k=o?"58%":"56%";w=se,A=k,I=se,$=k;}_.push({type:"text",id:"left-label",content:{text:n.label,style:{fontSize:b,fontWeight:"bold",color:f.text,textAlign:"center",lineHeight:1.3}},position:{x:m.left.x,y:w,anchor:"center",width:y},animation:{type:"fadeIn",duration:1}}),n.sublabel&&_.push({type:"text",id:"left-sublabel",content:{text:n.sublabel,style:{fontSize:v,color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.left.x,y:A,anchor:"center",width:y},animation:{type:"fadeIn",duration:.8,delay:.3}});let N=P(120,t,true),W=p?"48%":"50%",U=p?"\u2193":"\u2192";return _.push({type:"text",id:"connector",content:{text:U,style:{fontSize:N,fontWeight:"bold",color:"rgba(255, 255, 255, 0.6)",textAlign:"center"}},position:{x:"50%",y:W,anchor:"center"},animation:{type:"fadeIn",duration:.6,delay:.4}}),_.push({type:"text",id:"right-label",content:{text:r.label,style:{fontSize:b,fontWeight:"bold",color:d.text,textAlign:"center",lineHeight:1.3}},position:{x:m.right.x,y:I,anchor:"center",width:y},animation:{type:"fadeIn",duration:1,delay:.5}}),r.sublabel&&_.push({type:"text",id:"right-sublabel",content:{text:r.sublabel,style:{fontSize:v,color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.right.x,y:$,anchor:"center",width:y},animation:{type:"fadeIn",duration:.8,delay:.8}}),_}var Ho={neutral:{bg:"#1a202c",date:"#63b3ed",text:"#ffffff"},somber:{bg:"#1a1a2e",date:"#e53e3e",text:"#a0aec0"},celebratory:{bg:"#1a365d",date:"#68d391",text:"#ffffff"}};function pr(e,t){let{date:n,description:r,footer:o,mood:i="neutral",accentImage:a}=e,{theme:s}=t,u=Ho[i],c=a?ve(a.position):be,f=P(96,t,true),d=P(30,t,false),m=P(26,t,false),p=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${u.bg} 0%, #0d1117 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];return a&&p.push(...ke(a,e.id)),p.push({type:"text",id:"date",content:{text:n,style:{fontSize:f,fontWeight:"bold",color:u.date,shadow:!!a}},position:{x:c.textCenterX,y:G("35%",c),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),p.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,color:u.text,textAlign:"center",lineHeight:1.8,shadow:!!a}},position:{x:c.textCenterX,y:G("58%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:2,delay:1}}),o&&p.push({type:"text",id:"footer",content:{text:o,style:{fontSize:m,color:s.colors.textMuted,shadow:!!a}},position:{x:c.textCenterX,y:G("82%",c),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:3}}),p}function fr(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i="bottom",ambientMotion:a,isTitle:s,subtitle:u,imageCredit:c,imageLicense:f}=e,d=o&&zt(o),{theme:m,layout:p}=t,y=P(36,t,false),h=P(96,t,true),b=P(36,t,false),v=e.kenBurns,S=Pe(a||v),w=[{type:"image",id:"bg-image",content:{src:n,alt:r,fit:"cover",credit:c,license:f},position:{x:0,y:0,width:"100%",height:"100%"},animation:S}];return s&&d?(w.push({type:"shape",id:"title-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}}),w.push({type:"text",id:"title",content:{text:d,style:{fontSize:h,fontWeight:"bold",color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:u?"70%":"75%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),u&&w.push({type:"text",id:"subtitle",content:{text:u,style:{fontSize:b,color:m.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),w):(d&&(w.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:"65%",width:"100%",height:"35%"}}),w.push({type:"text",id:"caption",content:{text:d,style:{fontSize:y,color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"82%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}})),w)}function mr(e,t){let{center:n,zoom:r,mapStyle:o="terrain",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:c}=e,{theme:f,layout:d}=t,m=P(64,t,true),p=P(32,t,false),y=Pe(u),h=[{type:"map",id:"map-bg",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:c},position:{x:0,y:0,width:"100%",height:"100%"},animation:y}];return i&&(h.push({type:"shape",id:"title-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:0,width:"100%",height:"18%"}}),h.push({type:"text",id:"title",content:{text:i,style:{fontSize:m,fontWeight:"bold",color:f.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"9%",anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.3}})),a&&(h.push({type:"shape",id:"caption-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:"82%",width:"100%",height:"18%"}}),h.push({type:"text",id:"caption",content:{text:a,style:{fontSize:p,color:f.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:d.captionY,anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.5}})),h}function hr(e,t){let{text:n,colorScheme:r="blue"}=e,{theme:o}=t,i=ye(t,r),a=P(120,t,true);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 50%, ${o.colors.backgroundLight} 0%, #000000 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"impact-text",content:{text:n,style:{fontSize:a,fontWeight:"bold",color:i.text,textAlign:"center",lineHeight:1.2,shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:"85%"},animation:{type:"fadeIn",duration:1.5}}]}function gr(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?ve(o.position):be,s=P(44,t,true),u=P(34,t,false),c=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(155deg, ${i.colors.backgroundLight} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];o&&c.push(...ke(o,e.id));let f=r?30:22;r&&c.push({type:"text",id:"list-title",content:{text:r,style:{fontSize:s,fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:!!o}},position:{x:a.textCenterX,y:G("16%",a),anchor:"center"},animation:{type:"fadeIn",duration:1}});let m=n.length>1?(80-f)/(n.length-1):0;for(let p=0;p<n.length;p++){let y=f+m*p,h=`${p+1}. ${n[p]}`;c.push({type:"text",id:`item-${p}`,content:{text:h,style:{fontSize:u,color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:G(`${y}%`,a),anchor:"center",width:a.textWidth},animation:{type:"fadeIn",duration:.8,delay:.3+.3*p}});}return c}var ee=.5;function yr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&zt(r),{theme:a,layout:s}=t,u=[{type:"shape",id:"bg",content:{shape:"rect",fill:"#000000"},position:{x:0,y:0,width:"100%",height:"100%"}}],c=i?s.stackColumns?18:22:0,f=100-c,d=Wo(n.length,f,s.stackColumns),m=P(24,t,false);for(let p=0;p<Math.min(n.length,4);p++){let y=n[p],h=d[p];u.push({type:"shape",id:`grid-placeholder-${p}`,content:{shape:"rect",fill:a.colors.background},position:{x:`${h.x}%`,y:`${h.y}%`,width:`${h.w}%`,height:`${h.h}%`}}),y.alt&&u.push({type:"text",id:`grid-alt-${p}`,content:{text:y.alt,style:{fontSize:m,color:a.colors.textMuted,textAlign:"center"}},position:{x:`${h.x+h.w/2}%`,y:`${h.y+h.h/2}%`,anchor:"center"}}),u.push({type:"image",id:`grid-img-${p}`,content:{src:y.src,alt:y.alt,fit:"cover",credit:y.credit,license:y.license},position:{x:`${h.x}%`,y:`${h.y}%`,width:`${h.w}%`,height:`${h.h}%`},animation:p===0&&o?{type:o,duration:15}:{type:"fadeIn",duration:1,delay:.2*p}});}if(i){let p=P(s.stackColumns?28:40,t,false);u.push({type:"shape",id:"caption-bg",content:{shape:"rect",fill:"linear-gradient(transparent, rgba(0,0,0,0.8))"},position:{x:0,y:`${f-4}%`,width:"100%",height:`${c+4}%`}}),u.push({type:"text",id:"caption",content:{text:i,style:{fontSize:p,color:a.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:`${f+(s.stackColumns?c/2:c*.3)}%`,anchor:"center",width:"90%"},animation:{type:"fadeIn",duration:1,delay:.5}});}return u}function Wo(e,t,n){let r=50-ee/2,o=t/2-ee/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ee/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ee/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ee*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ee/3,w:100,h:s},{x:0,y:t*2/3+ee*2/3,w:100,h:s}]}let i=60-ee/2,a=40-ee/2;return [{x:0,y:0,w:i,h:t},{x:60+ee/2,y:0,w:a,h:o},{x:60+ee/2,y:t/2+ee/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ee/2,y:0,w:r,h:o},{x:0,y:t/2+ee/2,w:r,h:o},{x:50+ee/2,y:t/2+ee/2,w:r,h:o}]}}function br(e,t){let{term:n,definition:r,origin:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=ye(t,i),c=a?ve(a.position):be,f=P(72,t,true),d=P(32,t,false),m=P(22,t,false),p=[ut("bg",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&p.push(...ke(a,e.id)),p.push({type:"text",id:"term",content:{text:n,style:{fontSize:f,fontWeight:"bold",color:u.text,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:G("30%",c),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),p.push({type:"shape",id:"separator",content:{shape:"rect",fill:`${u.text}33`},position:{x:c.textCenterX,y:G("42%",c),width:"30%",height:"2px",anchor:"center"}}),p.push({type:"text",id:"definition",content:{text:r,style:{fontSize:d,color:s.colors.text,textAlign:"center",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:c.textCenterX,y:G("55%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&p.push({type:"text",id:"origin",content:{text:o,style:{fontSize:m,color:s.colors.textMuted,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:G("78%",c),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),p}function _r(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s="blue"}=e,{theme:u}=t,c=ye(t,s),f=P(28,t,false),d=P(48,t,true),m=Math.max(r,i,1),p=65,y=r/m*p,h=i/m*p,b=15,v=6,_=36,S=58,w=$=>$>=1e6?`${($/1e6).toFixed(1)}M`:$>=1e3?`${($/1e3).toFixed($>=1e4?0:1)}K`:$.toLocaleString(),A=a?`${w(r)} ${a}`:w(r),I=a?`${w(i)} ${a}`:w(i);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(180deg, ${u.colors.background} 0%, #0f1520 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"left-label",content:{text:n,style:{fontSize:f,color:u.colors.textMuted}},position:{x:`${b}%`,y:`${_-8}%`}},{type:"text",id:"left-value",content:{text:A,style:{fontSize:d,fontWeight:"bold",color:c.text}},position:{x:`${b+y+2}%`,y:`${_-1}%`},animation:{type:"fadeIn",duration:.8,delay:.3}},{type:"shape",id:"left-bar",content:{shape:"rect",fill:c.text,borderRadius:4},position:{x:`${b}%`,y:`${_}%`,width:`${y}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1}},{type:"text",id:"right-label",content:{text:o,style:{fontSize:f,color:u.colors.textMuted}},position:{x:`${b}%`,y:`${S-8}%`}},{type:"text",id:"right-value",content:{text:I,style:{fontSize:d,fontWeight:"bold",color:c.accent}},position:{x:`${b+h+2}%`,y:`${S-1}%`},animation:{type:"fadeIn",duration:.8,delay:.6}},{type:"shape",id:"right-bar",content:{shape:"rect",fill:c.accent,borderRadius:4},position:{x:`${b}%`,y:`${S}%`,width:`${h}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1,delay:.3}}]}function xr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=P(52,t,true),s=P(24,t,false),u=P(200,t,true),c=[{type:"image",id:"bg-image",content:{src:o.src,alt:o.alt,fit:"cover",credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"},animation:i?{type:i,duration:15}:void 0},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:u,color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:a,color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&c.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:s,color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),c}function vr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:c="bottom",videoCredit:f,videoLicense:d}=e,m=u&&zt(u),{theme:p,layout:y}=t,h=P(36,t,false),b=P(16,t,false),v=[{type:"video",id:"bg-video",content:{src:n,posterSrc:r,alt:o,fit:"cover",clipStart:i,clipEnd:a,sourceDuration:s,credit:f,license:d},position:{x:0,y:0,width:"100%",height:"100%"}}];if(m){v.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:c==="top"?0:"65%",width:"100%",height:"35%"}});let _=c==="top"?"15%":c==="center"?"50%":"82%";v.push({type:"text",id:"caption",content:{text:m,style:{fontSize:h,color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:_,anchor:"center",width:y.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}});}return f&&v.push({type:"text",id:"credit",content:{text:f,style:{fontSize:b,color:"rgba(255, 255, 255, 0.5)",textAlign:"right"}},position:{x:"96%",y:"96%",anchor:"bottom-right"}}),v}function kr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=P(52,t,true),a=P(24,t,false),s=P(200,t,true),u=[{type:"video",id:"bg-video",content:{src:o.src,posterSrc:o.posterSrc,alt:o.alt,fit:"cover",clipStart:o.clipStart,clipEnd:o.clipEnd,credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:s,color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:i,color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&u.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:a,color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),u}function wr(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:c,layout:f}=t,d=P(96,t,true),m=P(36,t,false),p=Pe(a),y=[{type:"image",id:"cover-hero",content:{src:n,alt:r||o,fit:"cover",credit:s,license:u},position:{x:0,y:0,width:"100%",height:"100%"},animation:p},{type:"shape",id:"cover-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"cover-title",content:{text:o,style:{fontSize:d,fontWeight:"bold",color:c.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:i?"70%":"75%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8}}];return i&&y.push({type:"text",id:"cover-subtitle",content:{text:i,style:{fontSize:m,color:c.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),y}function Vo(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function qt(e,t){let n=Vo(e);return wr(n,t)}var We={titleBlock:ir,sectionHeader:ar,statHighlight:lr,quoteBlock:cr,factCard:ur,twoColumn:dr,dateEvent:pr,imageWithCaption:fr,mapBlock:mr,fullBleedQuote:hr,listBlock:gr,photoGrid:yr,definitionCard:br,comparisonBar:_r,pullQuote:xr,videoWithCaption:vr,videoPullQuote:kr};function ct(e,t){let n=We[e.template];if(!n)return console.warn(`Unknown template: ${e.template}`),{id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,transition:e.transition,template:e.template};let r;try{r=n(e,t),Array.isArray(r)||(console.error(`Template ${e.template} did not return an array, got:`,typeof r),r=[]);}catch(o){console.error(`Error expanding template ${e.template}:`,o),r=[];}return {id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,...r.length>0?{layers:r}:{},transition:e.transition,template:e.template}}function Ot(e,t={}){let n=t,r=n.theme??fe,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=He(i?.bottomLayers),c=He(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((p,y)=>{let h=pe(r,y,s,o),b=ne(p)?ct(p,h):p,v=p,_=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (u.length>0||c.length>0)&&(b.layers=[..._?u:[],...b.layers??[],...S?c:[]]),b.startTime=m,m+=b.duration,b})}let f=new Map;e.forEach((m,p)=>{let y=m.audioSegment??0;f.has(y)||f.set(y,[]),f.get(y).push({block:m,originalIndex:p});});let d=new Array(e.length);for(let[m,p]of f){let y=a[m];if(!y){let g=0;for(let{block:x,originalIndex:C}of p){let R=pe(r,C,s,o),M=ne(x)?ct(x,R):x,E=x,Y=E.useBottomLayer!==false,K=E.useTopLayer!==false;(u.length>0||c.length>0)&&(M.layers=[...Y?u:[],...M.layers??[],...K?c:[]]),M.startTime=g,g+=M.duration,d[C]=M;}continue}let h=[],b=[];for(let g of p)g.block.template==="sectionHeader"?h.push(g):b.push(g);let v=h.reduce((g,{block:x})=>g+(x.duration??0),0),_=b.reduce((g,{block:x})=>g+(x.duration??0),0),S=y.duration-v,w=_>0&&S>0?S/_:1,A=[];for(let{block:g,originalIndex:x}of p){let C=pe(r,x,s,o),R=ne(g)?ct(g,C):g,M=g,E=M.useBottomLayer!==false,Y=M.useTopLayer!==false;(u.length>0||c.length>0)&&(R.layers=[...E?u:[],...R.layers??[],...Y?c:[]]),A.push({block:R,originalIndex:x,templateBlock:M,hasSourceTiming:typeof M.sourceStartTime=="number"});}let I=A.some(g=>g.hasSourceTiming);A.sort((g,x)=>{if(I){let C=g.templateBlock.template==="sectionHeader",R=x.templateBlock.template==="sectionHeader";if(C&&!R)return -1;if(!C&&R)return 1;if(g.hasSourceTiming&&x.hasSourceTiming)return g.templateBlock.sourceStartTime-x.templateBlock.sourceStartTime;if(g.hasSourceTiming&&!x.hasSourceTiming)return -1;if(!g.hasSourceTiming&&x.hasSourceTiming)return 1}return g.originalIndex-x.originalIndex});let $=0;for(let g=0;g<A.length;g++){let x=A[g],{block:C,templateBlock:R}=x;if(x.hasSourceTiming){let M=R.sourceStartTime;C.startTime=y.startTime+M,typeof R.sourceDuration=="number"&&(C.duration=Math.max(5,R.sourceDuration)),$=M+C.duration;}else if(R.template==="sectionHeader")C.startTime=y.startTime+$,$+=C.duration;else {C.startTime=y.startTime+$;let M=C.duration*w;C.duration=M,$+=M;}d[x.originalIndex]=C;}let N=A.map(g=>d[g.originalIndex]).sort((g,x)=>g.startTime-x.startTime);for(let g=0;g<N.length-1;g++){let x=N[g],C=N[g+1],R=x.startTime+x.duration;R>C.startTime?x.duration=C.startTime-x.startTime:R<C.startTime-.5&&(x.duration=Math.max(.1,C.startTime-x.startTime));}let W=5,U=y.startTime+y.duration;for(;N.length>1;){let g=N[N.length-1];if(U-g.startTime<W&&g.template!=="sectionHeader"){let C=N[N.length-2];C.duration=U-C.startTime,g.duration=0,g.startTime=U,N.pop();}else {g.startTime+g.duration<U&&(g.duration=U-g.startTime);break}}if(N.length===1){let g=N[0];g.startTime+g.duration<U&&(g.duration=U-g.startTime);}let se=true;for(;se;){se=false;for(let g=N.length-1;g>=1;g--){let x=N[g];if(x.duration>0&&x.duration<W){let C=N[g-1],R=x.startTime+x.duration;C.duration=R-C.startTime,x.duration=0,x.startTime=U,N.splice(g,1),se=true;break}}}let k=20;for(let g=0;g<N.length;g++){let x=N[g];if(x.duration>k){let C=Math.ceil(x.duration/k),R=x.duration/C;if(R>=W){x.duration=R;for(let M=1;M<C;M++){let E={id:`${x.id}-split-${M}`,startTime:x.startTime+M*R,duration:R,audioSegment:x.audioSegment,layers:(x.layers??[]).map(Y=>({...Y,id:`${Y.id}-split-${M}`})),transition:{type:"dissolve",duration:1},template:x.template};d.push(E);}}}}}return d.filter(m=>m&&m.duration>0)}function Ht(e){return e in We}function ae(e,t=0){if(!e||e.type==="none")return {className:"",style:{}};let n=Uo(e),r=Yo(e);return {className:n,style:r}}function Uo(e){let{type:t,direction:n,panDirection:r}=e;switch(t){case "fadeIn":return "anim-fadeIn";case "fadeOut":return "anim-fadeOut";case "slowZoom":return r==="left"?"anim-slowZoom-panLeft":r==="right"?"anim-slowZoom-panRight":n==="out"?"anim-slowZoom-out":"anim-slowZoom-in";case "zoomIn":return "anim-zoomIn";case "zoomOut":return "anim-zoomOut";case "panLeft":return "anim-panLeft";case "panRight":return "anim-panRight";case "typewriter":return "anim-typewriter";default:return ""}}function Yo(e){let t={};return e.duration!==void 0&&(t["--anim-duration"]=`${e.duration}s`),e.delay!==void 0&&(t["--anim-delay"]=`${e.delay}s`),e.easing&&(t["--anim-easing"]=e.easing),t}function Ve(e,t){return `transition-${e}-${t?"enter":"exit"}`}function Wt(e,t={}){let n=t.theme??fe,r=t.viewport??J.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!ne(e))return Ft(a,e,t);if(ne(e)&&e.template in We){let s=e.template,u=pe(n,o,i,r),c;try{let f=We[s];c=f(e,u),Array.isArray(c)||(console.error(`Template ${s} did not return an array, got:`,typeof c),c=[]);}catch(f){console.error(`Error expanding template ${s}:`,f),c=[];}return Ft(c,e,t)}return Ft([],e,t)}function Ft(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=He(r.bottomLayers),i=He(r.topLayers);if(o.length===0&&i.length===0)return e;let a=t,s=a.useBottomLayer!==false,u=a.useTopLayer!==false;return [...s?o:[],...e,...u?i:[]]}function H(e,t){return typeof e=="number"?e:e.endsWith("%")?parseFloat(e)/100*t:parseFloat(e)}function Be(e,t,n){switch(e){case "center":return {x:-t/2,y:-n/2};case "top-right":return {x:-t,y:0};case "bottom-left":return {x:0,y:-n};case "bottom-right":return {x:-t,y:-n};default:return {x:0,y:0}}}var Vt=ot(null);function Zo(){return Bt(Vt)}function Ue(e,t){let n=Zo(),r=e.startsWith("http")||e.startsWith("/")||e.startsWith("data:")||e.startsWith("blob:"),o=F(()=>r?e:`${t}/${e}`,[r,e,t]),i=!r&&!!n,[a,s]=O(o);return D(()=>{if(!i){s(o);return}let u=false;return n.resolveUrl(e).then(c=>{u||s(c);}),()=>{u=true;}},[i,n,e,o]),i?a:o}var Go=0;function l(e,t,n,r,o,i){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var c={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Go,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return B.vnode&&B.vnode(c),c}function Sr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=H(i.x,n.width),u=H(i.y,n.height),c=i.width?H(i.width,n.width):n.width,f=i.height?H(i.height,n.height):n.height,d=Be(i.anchor,c,f),m=s+d.x,p=u+d.y,y=Ue(o.src,t),h=ae(a,r),b=Qo(o.fit),v=o.fit==="cover",_=a&&Ko.has(a.type);if(v&&_&&a){let S=Jo(a),w=ae(S,r);return l("g",{className:"block-layer block-layer--image","data-layer-id":e.id,children:l("foreignObject",{x:m,y:p,width:c,height:f,children:l("div",{style:{width:"100%",height:"100%",overflow:"hidden"},children:l("img",{src:y,alt:o.alt||"",className:w.className,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none",transformOrigin:"center center",...w.style}})})})})}return v?l("g",{className:`block-layer block-layer--image ${h.className}`,style:h.style,"data-layer-id":e.id,children:l("foreignObject",{x:m,y:p,width:c,height:f,children:l("img",{src:y,alt:o.alt||"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})}):l("g",{className:`block-layer block-layer--image ${h.className}`,style:h.style,"data-layer-id":e.id,children:l("image",{href:y,x:m,y:p,width:c,height:f,preserveAspectRatio:b,style:{pointerEvents:"none"}})})}function Qo(e){switch(e){case "cover":return "xMidYMid slice";case "fill":return "none";default:return "xMidYMid meet"}}var Ko=new Set(["panLeft","panRight","slowZoom","zoomIn","zoomOut"]);function Jo(e){switch(e.type){case "panLeft":return {...e,type:"slowZoom",panDirection:"left"};case "panRight":return {...e,type:"slowZoom",panDirection:"right"};case "zoomIn":return {...e,type:"slowZoom",direction:"in"};case "zoomOut":return {...e,type:"slowZoom",direction:"out"};default:return e}}function Tr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=H(o.x,t.width),c=H(o.y,t.height),f=o.width?H(o.width,t.width):void 0,d=ei(s.textAlign,o.anchor),m=ti(o.anchor),p=ae(i,n),y=a.split(`
|
|
2
|
-
`),h=f?y.reduce((w,A)=>w.concat(ri(A,s.fontSize,f)),[]):y;if(s.maxLines&&h.length>s.maxLines){h=h.slice(0,s.maxLines);let w=h[h.length-1];h[h.length-1]=w.replace(/\s*$/,"")+"...";}let b=s.lineHeight||1.4,v=s.fontSize*b,_={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Nt,fontWeight:s.fontWeight||"normal",fill:s.color,...p.style},S=s.shadow?`shadow-${e.id}`:void 0;return l("g",{className:`block-layer block-layer--text ${p.className}`,"data-layer-id":e.id,children:[s.shadow&&l("defs",{children:l("filter",{id:S,x:"-20%",y:"-20%",width:"140%",height:"140%",children:l("feDropShadow",{dx:"0",dy:"2",stdDeviation:"3",floodColor:"rgba(0,0,0,0.7)"})})}),s.background&&l("rect",{x:u-(s.padding||16),y:c-s.fontSize-(s.padding||16),width:ni(h,s)+(s.padding||16)*2,height:h.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),l("text",{x:u,y:c,textAnchor:d,dominantBaseline:m,style:_,filter:S?`url(#${S})`:void 0,children:h.map((w,A)=>l("tspan",{x:u,dy:A===0?0:v,children:[w||"\xA0"," "]},A))})]})}function ei(e,t){return e==="center"?"middle":e==="right"?"end":e==="left"?"start":t?.includes("right")?"end":t==="center"?"middle":"start"}function ti(e){return e?.includes("bottom")?"text-after-edge":e==="center"?"middle":"text-before-edge"}function ni(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function ri(e,t,n){if(!e.trim())return [""];let r=t*.5,o=Math.floor(n/r);if(o<=0)return [e];let i=e.split(/\s+/),a=[],s="";for(let u of i){let c=s?`${s} ${u}`:u;if(c.length<=o)s=c;else if(s&&a.push(s),u.length>o){let f=u;for(;f.length>o;)a.push(f.slice(0,o)),f=f.slice(o);s=f;}else s=u;}return s&&a.push(s),a.length>0?a:[""]}function Cr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=H(o.x,t.width),s=H(o.y,t.height),u=o.width?H(o.width,t.width):100,c=o.height?H(o.height,t.height):100,f=ae(i,n),d=r.fill||"none",m=typeof d=="string"&&d.includes("gradient(");if(r.shape==="rect"&&m)return l("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:l("foreignObject",{x:a,y:s,width:u,height:c,children:l("div",{style:{width:"100%",height:"100%",background:d,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:"none"}})})});let p={fill:d,stroke:r.stroke,strokeWidth:r.strokeWidth};return l("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:[r.shape==="rect"&&l("rect",{x:a,y:s,width:u,height:c,rx:r.borderRadius,ry:r.borderRadius,...p}),r.shape==="circle"&&l("circle",{cx:a+u/2,cy:s+c/2,r:Math.min(u,c)/2,...p}),r.shape==="line"&&l("line",{x1:a,y1:s,x2:a+u,y2:s+c,stroke:r.stroke||"#ffffff",strokeWidth:r.strokeWidth||2})]})}var oi={terrain:{url:"https://tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"Map: OpenTopoMap (CC-BY-SA)",maxZoom:17},road:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xA9 OpenStreetMap contributors",maxZoom:19},satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"Imagery: Esri, Maxar, Earthstar",maxZoom:18},toner:{url:"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:20},watercolor:{url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:16}};function Ut(e,t,n){let r=Math.pow(2,n),o=Math.floor((t+180)/360*r),i=e*Math.PI/180,a=Math.floor((1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2*r);return {x:o,y:a}}function Yt(e,t,n,r=256){let o=Math.pow(2,n),i=(t+180)/360*o,a=e*Math.PI/180,s=(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*o;return {x:(i-Math.floor(i))*r,y:(s-Math.floor(s))*r}}function ii(e,t,n,r,o,i=256){let a=Ut(e,t,n),s=Yt(e,t,n,i),u=Math.ceil(r/i)+1,c=Math.ceil(o/i)+1,f=a.x-Math.floor(u/2),d=a.y-Math.floor(c/2),m=r/2-s.x,p=o/2-s.y,y=[];for(let h=0;h<c;h++)for(let b=0;b<u;b++){let v=f+b,_=d+h,S=m+(v-a.x)*i,w=p+(_-a.y)*i;y.push({x:v,y:_,screenX:S,screenY:w});}return y}function ai(e,t,n,r){return e.url.replace("{z}",String(r)).replace("{x}",String(t)).replace("{y}",String(n))}async function si(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>n(new Error(`Failed to load tile: ${e}`)),r.src=e;})}async function Ar(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=oi[r],c=u.tileSize||256,f=Math.min(n,u.maxZoom),d=document.createElement("canvas");d.width=o,d.height=i;let m=d.getContext("2d");if(!m)throw new Error("Failed to get canvas context");m.fillStyle=r==="toner"?"#ffffff":"#e5e7eb",m.fillRect(0,0,o,i);let y=ii(t.lat,t.lng,f,o,i,c).map(async h=>{let b=ai(u,h.x,h.y,f);try{let v=await si(b);m.drawImage(v,h.screenX,h.screenY,c,c);}catch(v){console.warn(`Tile load failed: ${b}`,v);}});await Promise.all(y);for(let h of a)li(m,h,t,f,o,i,c);return s&&ui(m,u.attribution,o,i),d.toDataURL("image/png")}function li(e,t,n,r,o,i,a){let s=Ut(n.lat,n.lng,r),u=Ut(t.lat,t.lng,r),c=Yt(n.lat,n.lng,r,a),f=Yt(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(f.x-c.x),m=(u.y-s.y)*a+(f.y-c.y),p=o/2+d,y=i/2+m,h=t.color||"#ef4444",b=t.icon||"pin";e.save(),b==="pin"?(e.fillStyle=h,e.beginPath(),e.arc(p,y-12,8,Math.PI,0,false),e.lineTo(p,y),e.closePath(),e.fill(),e.fillStyle="#ffffff",e.beginPath(),e.arc(p,y-12,3,0,Math.PI*2),e.fill()):b==="circle"?(e.fillStyle=h,e.beginPath(),e.arc(p,y,8,0,Math.PI*2),e.fill(),e.strokeStyle="#ffffff",e.lineWidth=2,e.stroke()):b==="star"&&(e.fillStyle=h,ci(e,p,y,5,10,5),e.fill()),t.label&&(e.fillStyle="#1f2937",e.font="bold 12px system-ui, sans-serif",e.textAlign="center",e.fillText(t.label,p,y+20)),e.restore();}function ci(e,t,n,r,o,i){let a=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-o);for(let u=0;u<r;u++)e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o),a+=s,e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i),a+=s;e.lineTo(t,n-o),e.closePath();}function ui(e,t,n,r){e.save(),e.fillStyle="rgba(255, 255, 255, 0.8)";let o=4;e.font="10px system-ui, sans-serif";let i=e.measureText(t).width;e.fillRect(n-i-o*2-4,r-16,i+o*2,14),e.fillStyle="#374151",e.textAlign="right",e.fillText(t,n-o-4,r-5),e.restore();}function Mr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=O(null),[c,f]=O(true),[d,m]=O(null),p=H(i.x,n.width),y=H(i.y,n.height),h=i.width?H(i.width,n.width):n.width,b=i.height?H(i.height,n.height):n.height,v=Be(i.anchor,h,b),_=p+v.x,S=y+v.y;D(()=>{let A=false;if(o.staticSrc){let I=o.staticSrc.startsWith("http")?o.staticSrc:`${t}/${o.staticSrc}`;u(I),f(false);return}return f(true),m(null),Ar({center:o.center,zoom:o.zoom,style:o.style,width:h,height:b,markers:o.markers,showAttribution:o.showAttribution!==false}).then(I=>{A||(u(I),f(false));}).catch(I=>{A||(console.error("Failed to compose map:",I),m(I instanceof Error?I.message:String(I)),f(false));}),()=>{A=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,h,b,t]);let w=ae(a,r);return c?l("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[l("rect",{x:_,y:S,width:h,height:b,fill:"#e5e7eb"}),l("text",{x:_+h/2,y:S+b/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#9ca3af",fontSize:"24",fontFamily:"system-ui, sans-serif",children:"Loading map..."})]}):d||!s?l("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[l("rect",{x:_,y:S,width:h,height:b,fill:"#fef2f2"}),l("text",{x:_+h/2,y:S+b/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#dc2626",fontSize:"18",fontFamily:"system-ui, sans-serif",children:"Map failed to load"})]}):l("g",{className:`block-layer block-layer--map ${w.className}`,style:w.style,"data-layer-id":e.id,children:[l("defs",{children:l("clipPath",{id:`clip-${e.id}`,children:l("rect",{x:_,y:S,width:h,height:b})})}),l("g",{clipPath:`url(#clip-${e.id})`,children:l("image",{href:s,x:_,y:S,width:h,height:b,preserveAspectRatio:"xMidYMid slice",style:{pointerEvents:"none"}})})]})}function Lr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=q(null),u=q(false),c=H(a.x,n.width),f=H(a.y,n.height),d=a.width?H(a.width,n.width):n.width,m=a.height?H(a.height,n.height):n.height,p=Be(a.anchor,d,m),y=c+p.x,h=f+p.y,b=Ue(i.src,t),v=Ue(i.posterSrc||"",t),_=i.posterSrc?v:void 0;return D(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,u.current=true,o){let A=S.play();A&&A.catch(()=>{});}let w=()=>{S.currentTime>=i.clipEnd&&(S.pause(),S.currentTime=i.clipEnd);};return S.addEventListener("timeupdate",w),()=>{S.removeEventListener("timeupdate",w),S.pause();}},[i.src,i.clipStart,i.clipEnd]),D(()=>{let S=s.current;if(!(!S||!u.current)&&!(S.currentTime>=i.clipEnd))if(o){let w=S.play();w&&w.catch(()=>{});}else S.pause();},[o,i.clipEnd]),l("g",{className:"block-layer block-layer--video","data-layer-id":e.id,children:l("foreignObject",{x:y,y:h,width:d,height:m,children:l("video",{ref:s,src:b,poster:_,muted:true,playsInline:true,preload:"auto","data-clip-start":i.clipStart,"data-clip-end":i.clipEnd,style:{width:"100%",height:"100%",objectFit:i.fit||"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})})}var di={width:1920,height:1080};function Ee({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=di,isPlaying:a}){let s="",u={};e.transition&&r?(s=Ve(e.transition.type,true),u["--transition-duration"]=`${e.transition.duration}s`):e.transition&&o&&(s=Ve(e.transition.type,false),u["--transition-duration"]=`${e.transition.duration}s`);let c=`vb-clip-${e.id}`;return l("svg",{className:`block-svg ${s}`,style:u,viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden","data-block-id":e.id,children:[l("defs",{children:l("clipPath",{id:c,children:l("rect",{x:"0",y:"0",width:i.width,height:i.height})})}),l("g",{clipPath:`url(#${c})`,children:(e.layers??[]).map(f=>l(pi,{layer:f,basePath:n,viewport:i,blockTime:t,isPlaying:a},f.id))})]})}function pi({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case "image":return l(Sr,{layer:e,basePath:t,viewport:n,blockTime:r});case "text":return l(Tr,{layer:e,viewport:n,blockTime:r});case "shape":return l(Cr,{layer:e,viewport:n,blockTime:r});case "map":return l(Mr,{layer:e,basePath:t,viewport:n,blockTime:r});case "video":return l(Lr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});default:return console.warn(`Unknown layer type: ${e.type}`),null}}function Pr({captions:e,currentTime:t,enabled:n=true,fontSize:r=16}){let i=(n&&e?qe(e,t):null)?.text??null;return l("div",{className:"caption-overlay",style:{position:"absolute",top:"6px",left:"50%",transform:"translateX(-50%)",zIndex:50,pointerEvents:"none",maxWidth:"100%",width:"100%",textAlign:"center",opacity:i?1:0,transition:"opacity 0.15s ease-in-out",padding:"0 4px",boxSizing:"border-box"},children:i&&l("div",{style:{display:"inline-block",padding:"3px 10px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"4px",backdropFilter:"blur(4px)"},children:l("span",{style:{color:"#ffffff",fontSize:`${r}px`,fontFamily:"'Hanken Grotesk', system-ui, sans-serif",fontWeight:500,lineHeight:1.25,textShadow:"0 1px 3px rgba(0,0,0,0.5)",whiteSpace:"pre-wrap",wordWrap:"break-word"},children:i})})})}function Br(e,t,n=""){let[r,o]=O(0),[i,a]=O(false),[s,u]=O(0),[c,f]=O(false),[d,m]=O(false),[p,y]=O(0),h=q([]),b=q(null),v=q(false),_=q(new Map),S=q(new Map),w=q(false);D(()=>{if(!t?.segments)return;let k=0;h.current=t.segments.map(g=>{let x=k;return k+=g.duration,x}),y(k);},[t]);let A=j(async k=>{let g=n?`${n}/${k}`:k;if(_.current.has(k))return _.current.get(k);if(S.current.has(k))return S.current.get(k);let x=(async()=>{try{let C=await fetch(g);if(!C.ok)throw new Error(`HTTP ${C.status}`);let R=await C.blob(),M=URL.createObjectURL(R);return _.current.set(k,M),M}catch{return g}finally{S.current.delete(k);}})();return S.current.set(k,x),x},[n]);D(()=>{if(!t?.segments)return;t.segments.forEach(g=>{A(g.src);});let k=_.current;return ()=>{k.forEach(g=>{URL.revokeObjectURL(g);}),k.clear();}},[t,A]),D(()=>{let k=e.current;if(!k)return;let g=()=>{let Y=(h.current[s]||0)+k.currentTime;o(Y);},x=()=>{w.current=false,a(true);},C=()=>a(false),R=()=>{m(true);},M=()=>{t&&s<t.segments.length-1?(v.current=true,u(E=>E+1)):(f(true),a(false));};return k.addEventListener("timeupdate",g),k.addEventListener("play",x),k.addEventListener("pause",C),k.addEventListener("ended",M),k.addEventListener("error",R),()=>{k.removeEventListener("timeupdate",g),k.removeEventListener("play",x),k.removeEventListener("pause",C),k.removeEventListener("ended",M),k.removeEventListener("error",R);}},[e,s,t]),D(()=>{let k=e.current;if(!k||!t?.segments)return;let g=t.segments[s];if(!g)return;let x=()=>{if(b.current!==null){let E=h.current[s]||0,Y=b.current-E;k.currentTime=Math.max(0,Y),o(b.current),b.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},C=k.src,R=_.current.get(g.src);C&&(C===R||C.endsWith(g.src))?x():(async()=>{let Y=await A(g.src),K=()=>{m(true),x(),k.removeEventListener("canplay",K);};k.addEventListener("canplay",K),k.src=Y,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener("canplay",K),m(true),x());})();},[e,s,t,A]);let I=j(()=>{let k=e.current;k&&(c&&(u(0),f(false)),k.play().then(()=>{w.current=false;}).catch(()=>{w.current=true,a(true);}));},[e,c]),$=j(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),N=j(()=>{e.current&&(i?$():I());},[e,i,I,$]),W=j(k=>{let g=e.current;if(!g||!t?.segments)return;let x=Math.max(0,Math.min(k,p)),C=0,R=0;for(let E=0;E<t.segments.length;E++){let Y=R+t.segments[E].duration;if(x<Y){C=E;break}R=Y,E===t.segments.length-1&&(C=E);}let M=!g.paused;if(f(false),C!==s)b.current=x,v.current=M,u(C);else {let E=x-R;g.currentTime=Math.max(0,E),o(x);}},[e,t,s,p]),U=j(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),f(false));},[t]),se=j(async()=>{W(0),await new Promise(k=>setTimeout(k,50)),I();},[W,I]);return D(()=>{if(!i||!w.current||!p)return;let k=performance.now(),g,x=C=>{if(!w.current)return;let R=(C-k)/1e3;k=C,o(M=>{let E=M+R;return E>=p?(w.current=false,f(true),a(false),p):E}),g=requestAnimationFrame(x);};return g=requestAnimationFrame(x),()=>cancelAnimationFrame(g)},[i,p]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:p,isEnded:c,isReady:d,isAvailable:true,play:async()=>I(),pause:async()=>$(),toggle:async()=>N(),seekTo:async k=>W(k),skipToSegment:async k=>U(k),restart:se}}function Er(e,t,n=J.landscape,r=false,o){let [i,a]=O({entering:false,exiting:false,previousBlock:null}),s=F(()=>{if(!e?.blocks)return [];if(e.blocks.some(ne)){let I=e.audio?.segments?.map(N=>({startTime:N.startTime,duration:N.duration}));return Ot(e.blocks,{audioSegments:I,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return e.blocks},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=F(()=>It(s,t),[s,t]),c=F(()=>u?s.indexOf(u):-1,[s,u]),f=F(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=F(()=>!u||u.duration===0?0:Math.min(1,f/u.duration),[u,f]),m=F(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);F(()=>u,[c]);D(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let I=u.transition?.duration||0;if(I>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let $=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},I*1e3);return ()=>clearTimeout($)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let y=q(null);D(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let A=i.previousBlock;y.current=A,a(I=>({...I,previousBlock:u}));}},[u?.id,r]);let h=u?.transition?.duration||0,b=r&&h>0&&f<h,v=b&&y.current!==null,_=j(A=>{if(!e||A<0||A>=s.length)return;let I=s[A];if(I)return I.startTime},[e,s]),S=j(()=>{if(c<s.length-1)return _(c+1)},[c,s.length,_]),w=j(()=>{if(c>0)return _(c-1)},[c,_]);return {currentBlock:u,currentBlockIndex:c,previousBlock:r?v?y.current:null:i.exiting?i.previousBlock:null,isEntering:r?b:i.entering,isExiting:r?v:i.exiting,blockTime:f,blockProgress:d,docProgress:m,nextBlock:S,prevBlock:w,goToBlock:_,blocks:s}}function fi(e,t){let n=e/t;return n>1.2?"landscape":n<.83?"portrait":"landscape"}function mi(e){switch(e){case "portrait":return J.portrait;case "square":return J.square;default:return J.landscape}}function Ir(){let[e,t]=O(()=>({width:typeof window<"u"?window.innerWidth:1920,height:typeof window<"u"?window.innerHeight:1080}));D(()=>{if(typeof window>"u")return;let o=()=>{t({width:window.innerWidth,height:window.innerHeight});},i,a=()=>{clearTimeout(i),i=setTimeout(o,100);};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),clearTimeout(i);}},[]);let n=F(()=>fi(e.width,e.height),[e.width,e.height]);return {viewport:F(()=>mi(n),[n]),orientation:n,windowSize:e}}function Ye(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}function dt({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=q(null),[a,s]=O(null),u=j(d=>{let m=i.current;if(!m)return;let p=m.getBoundingClientRect(),y=d.clientX-p.left,h=Math.max(0,Math.min(1,y/p.width));s(h);},[]),c=j(()=>{s(null);},[]),f=j(d=>{for(let m=r.length-1;m>=0;m--){let p=r[m];if(d>=p.startTime)return {block:p,index:m}}return r.length>0?{block:r[0],index:0}:null},[r]);return l("div",{ref:i,style:{flex:1,height:"24px",cursor:"pointer",position:"relative",display:"flex",alignItems:"center"},onClick:d=>{let m=d.currentTarget.getBoundingClientRect(),y=(d.clientX-m.left)/m.width;t.seekTo(y*e.totalDuration);},onMouseMove:u,onMouseLeave:c,children:[l("div",{style:{position:"absolute",left:0,right:0,height:"6px",background:"rgba(255,255,255,0.2)",borderRadius:"3px"}}),l("div",{style:{position:"absolute",left:0,width:`${e.docProgress*100}%`,height:"6px",background:"#3d5a80",borderRadius:"3px",transition:"width 0.1s"}}),n.map((d,m)=>l("div",{style:{position:"absolute",left:`${d.position}%`,transform:"translateX(-50%)",width:"10px",height:"10px",borderRadius:"50%",background:d.index===e.currentBlockIndex?"#ffffff":"rgba(255,255,255,0.5)",border:"2px solid #3d5a80",cursor:"pointer",zIndex:2,transition:"transform 0.15s, background 0.15s"},title:d.title,onClick:p=>{p.stopPropagation(),t.seekTo(d.block.startTime);},onMouseEnter:p=>{p.currentTarget.style.transform="translateX(-50%) scale(1.3)";},onMouseLeave:p=>{p.currentTarget.style.transform="translateX(-50%)";}},`${d.block.id}-${m}`)),a!==null&&l("div",{style:{position:"absolute",left:`${a*100}%`,bottom:"100%",transform:"translateX(-50%)",marginBottom:"8px",padding:"6px 10px",background:"rgba(0,0,0,0.9)",borderRadius:"4px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[l("div",{style:{color:"white",fontSize:"12px",fontFamily:"monospace"},children:Ye(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=f(d);return m&&o?l("div",{style:{color:"rgba(255,255,255,0.7)",fontSize:"11px",marginTop:"2px"},children:o(m.block)}):null})()]}),a!==null&&l("div",{style:{position:"absolute",left:`${a*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"2px",height:"16px",background:"rgba(255,255,255,0.6)",pointerEvents:"none",zIndex:1}})]})}function Rr({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return l("div",{className:"doc-player__controls",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px",background:"linear-gradient(transparent, rgba(0,0,0,0.8))",display:"flex",alignItems:"center",gap:"8px",zIndex:100},children:[l("button",{onClick:t.restart,style:{background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",padding:"8px",fontSize:"14px",display:"flex",alignItems:"center"},title:"Restart","aria-label":"Restart from beginning",children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})})}),l("button",{onClick:t.toggle,style:{background:"rgba(255,255,255,0.2)",border:"none",borderRadius:"50%",color:"white",cursor:"pointer",padding:"10px",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px"},"aria-label":e.isPlaying?"Pause":"Play",children:e.isPlaying?l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:l("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}):l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:l("path",{d:"M8 5v14l11-7z"})})}),l("span",{style:{color:"white",fontSize:"12px",minWidth:"80px",fontFamily:"monospace"},children:[Ye(e.currentTime)," / ",Ye(e.totalDuration)]}),l(dt,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),l("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"11px",whiteSpace:"nowrap"},children:[e.currentBlockIndex+1,"/",e.totalBlocks]}),e.hasCaptions&&l("button",{onClick:()=>t.setCaptionsEnabled(!e.captionsEnabled),style:{background:e.captionsEnabled?"rgba(255,255,255,0.2)":"none",border:"none",color:e.captionsEnabled?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",fontSize:"12px",display:"flex",alignItems:"center",borderRadius:"4px"},title:e.captionsEnabled?"Hide captions":"Show captions","aria-label":e.captionsEnabled?"Hide captions":"Show captions",children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z"})})}),t.toggleFullscreen&&l("button",{onClick:t.toggleFullscreen,style:{background:e.isFullscreen?"rgba(255,255,255,0.2)":"none",border:"none",color:e.isFullscreen?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",display:"flex",alignItems:"center",borderRadius:"4px"},title:e.isFullscreen?"Exit fullscreen (F)":"Fullscreen (F)","aria-label":e.isFullscreen?"Exit fullscreen":"Enter fullscreen",children:e.isFullscreen?l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}):l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})}function $r({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return l("div",{className:"doc-controls-slideshow","data-testid":"slideshow-controls",style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",alignItems:"center",gap:"2px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"8px",padding:"4px 6px",zIndex:100,userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[l("button",{onClick:a=>{a.stopPropagation(),t.prevSlide();},disabled:o,"data-testid":"slide-prev","aria-label":"Previous slide",title:"Previous slide",style:{background:"none",border:"none",color:o?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:o?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{o||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),l("span",{"data-testid":"slide-counter",style:{color:"rgba(255,255,255,0.9)",fontSize:"13px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontVariantNumeric:"tabular-nums",minWidth:"48px",textAlign:"center",padding:"0 4px",letterSpacing:"0.02em"},children:r>0?`${n+1} / ${r}`:"\u2014"}),l("button",{onClick:a=>{a.stopPropagation(),t.nextSlide();},disabled:i,"data-testid":"slide-next","aria-label":"Next slide",title:"Next slide",style:{background:"none",border:"none",color:i?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:i?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{i||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})})})]})}function re(e,t=""){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case "text":return l(te,{children:n.value},o);case "emphasis":return l("em",{className:"squisq-md-em",children:re(n.children,o)},o);case "strong":return l("strong",{className:"squisq-md-strong",children:re(n.children,o)},o);case "delete":return l("del",{className:"squisq-md-del",children:re(n.children,o)},o);case "inlineCode":return l("code",{className:"squisq-md-inline-code",children:n.value},o);case "link":return l("a",{className:"squisq-md-link",href:n.url,title:n.title??void 0,target:"_blank",rel:"noopener noreferrer",children:re(n.children,o)},o);case "image":return l("img",{className:"squisq-md-image",src:n.url,alt:n.alt??"",title:n.title??void 0},o);case "break":return l("br",{},o);case "inlineMath":return l("code",{className:"squisq-md-inline-math",children:n.value},o);case "htmlInline":return l("span",{className:"squisq-md-html-inline",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case "footnoteReference":return l("sup",{className:"squisq-md-footnote-ref",children:l("a",{href:`#fn-${n.identifier}`,children:["[",n.label??n.identifier,"]"]})},o);case "linkReference":return l("span",{className:"squisq-md-link-ref",children:re(n.children,o)},o);case "imageReference":return l("span",{className:"squisq-md-image-ref",children:["[",n.alt??n.identifier,"]"]},o);case "textDirective":return l("span",{className:"squisq-md-text-directive","data-directive":n.name,children:re(n.children,o)},o);default:return null}})}function gi(e,t){switch(e.type){case "paragraph":return l("p",{className:"squisq-md-p",children:re(e.children,t)},t);case "heading":{let n=`h${e.depth}`;return l(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:re(e.children,t)},t)}case "blockquote":return l("blockquote",{className:"squisq-md-blockquote",children:Ie(e.children,t)},t);case "list":return e.ordered?l("ol",{className:"squisq-md-list squisq-md-ol",start:e.start??void 0,children:e.children.map((n,r)=>Nr(n,`${t}li${r}`))},t):l("ul",{className:"squisq-md-list squisq-md-ul",children:e.children.map((n,r)=>Nr(n,`${t}li${r}`))},t);case "code":return l("pre",{className:"squisq-md-code-block",children:l("code",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case "thematicBreak":return l("hr",{className:"squisq-md-hr"},t);case "table":return yi(e.children,e.align,t);case "htmlBlock":return l("div",{className:"squisq-md-html-block",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case "math":return l("pre",{className:"squisq-md-math-block",children:l("code",{children:e.value})},t);case "definition":return null;case "footnoteDefinition":return l("div",{className:"squisq-md-footnote-def",id:`fn-${e.identifier}`,children:[l("sup",{children:e.label??e.identifier}),Ie(e.children,t)]},t);case "containerDirective":return l("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:[e.label&&l("div",{className:"squisq-md-directive-label",children:e.label}),Ie(e.children,t)]},t);case "leafDirective":return l("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:re(e.children,t)},t);case "definitionList":return l("dl",{className:"squisq-md-dl",children:e.children.map((n,r)=>n.type==="definitionTerm"?l("dt",{className:"squisq-md-dt",children:re(n.children,`${t}dt${r}`)},`${t}dt${r}`):l("dd",{className:"squisq-md-dd",children:Ie(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function Nr(e,t){let n=e.checked!==null&&e.checked!==void 0;return l("li",{className:`squisq-md-li${n?" squisq-md-task":""}`,children:[n&&l("input",{type:"checkbox",checked:!!e.checked,readOnly:true,className:"squisq-md-checkbox"}),Ie(e.children,t)]},t)}function yi(e,t,n){let[r,...o]=e;return l("table",{className:"squisq-md-table",children:[r&&l("thead",{children:l("tr",{children:r.children.map((i,a)=>l("th",{className:"squisq-md-th",style:t?.[a]?{textAlign:t[a]}:void 0,children:re(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&l("tbody",{children:o.map((i,a)=>l("tr",{children:i.children.map((s,u)=>l("td",{className:"squisq-md-td",style:t?.[u]?{textAlign:t[u]}:void 0,children:re(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function Ie(e,t=""){return e.map((n,r)=>gi(n,`${t}b${r}`))}function pt({nodes:e,className:t}){return !e||e.length===0?null:l("div",{className:`squisq-md ${t||""}`,children:Ie(e)})}function bi(e){let t=e.sourceHeading?.templateAnnotation;return t?Ht(t.template):false}function Dr(e){let t=0;for(let n of e)t++,n.children&&(t+=Dr(n.children));return t}function Fr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=bi(e),a=F(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=xe(e.sourceHeading),c=_i(e.contents),f={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...vi(s.template,u,c,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=Wt(f,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return l("div",{className:"squisq-linear-section","data-block-id":e.id,"data-template":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&l(pt,{nodes:[e.sourceHeading]}),i&&a&&l("div",{className:"squisq-linear-card",children:[e.sourceHeading&&l("div",{className:"squisq-linear-card-label squisq-md",children:l(pt,{nodes:[e.sourceHeading]})}),l("div",{className:"squisq-linear-card-svg",style:{width:"100%",aspectRatio:`${n.width} / ${n.height}`,overflow:"hidden",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.12)",marginBottom:"1em"},children:l(Ee,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&l(pt,{nodes:e.contents}),e.children&&e.children.length>0&&l("div",{className:"squisq-linear-children",children:e.children.map((s,u)=>l(Fr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function _i(e){return !e||e.length===0?"":e.map(t=>xe(t)).join(`
|
|
3
|
-
`).trim()}function
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var SquisqPlayer=(function(exports){'use strict';var at,E,vn,be,bn,kn,wn,Sn,It,Tt,Ct,Tn,rt={},ot=[],lo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$e=Array.isArray;function pe(e,t){for(var n in t)e[n]=t[n];return e}function Lt(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function me(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?at.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return nt(e,a,r,o,null)}function nt(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++vn,__i:-1,__u:0};return o==null&&E.vnode!=null&&E.vnode(i),i}function te(e){return e.children}function le(e,t){this.props=e,this.context=t;}function Pe(e,t){if(t==null)return e.__?Pe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Pe(e):null}function co(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=pe({},t);i.__v=t.__v+1,E.vnode&&E.vnode(i),Pt(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Pe(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,In(r,i,o),t.__e=t.__=null,i.__e!=n&&Cn(i);}}function Cn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Cn(e)}function Mt(e){(!e.__d&&(e.__d=true)&&be.push(e)&&!it.__r++||bn!=E.debounceRendering)&&((bn=E.debounceRendering)||kn)(it);}function it(){try{for(var e,t=1;be.length;)be.length>t&&be.sort(wn),e=be.shift(),t=be.length,co(e);}finally{be.length=it.__r=0;}}function Mn(e,t,n,r,o,i,a,s,c,u,p){var d,m,f,h,g,y,v,x=r&&r.__k||ot,S=t.length;for(c=uo(n,t,x,c,S),d=0;d<S;d++)(f=n.__k[d])!=null&&(m=f.__i!=-1&&x[f.__i]||rt,f.__i=d,y=Pt(e,f,m,o,i,a,s,c,u,p),h=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Et(m.ref,null,f),p.push(f.ref,f.__c||h,f)),g==null&&h!=null&&(g=h),(v=!!(4&f.__u))||m.__k===f.__k?c=An(f,c,e,v):typeof f.type=="function"&&y!==void 0?c=y:h&&(c=h.nextSibling),f.__u&=-7);return n.__e=g,c}function uo(e,t,n,r,o){var i,a,s,c,u,p=n.length,d=p,m=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[i]=nt(null,a,null,null,null):$e(a)?a=e.__k[i]=nt(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=nt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,c=i+m,a.__=e,a.__b=e.__b+1,s=null,(u=a.__i=fo(a,n,c,d))!=-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(o>p?m--:o<p&&m++),typeof a.type!="function"&&(a.__u|=4)):u!=c&&(u==c-1?m--:u==c+1?m++:(u>c?m--:m++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<p;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Pe(s)),Pn(s,s));return r}function An(e,t,n,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=An(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Pe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ze(e,t){return t=t||[],e==null||typeof e=="boolean"||($e(e)?e.some(function(n){ze(n,t);}):t.push(e)),t}function fo(e,t,n,r){var o,i,a,s=e.key,c=e.type,u=t[n],p=u!=null&&(2&u.__u)==0;if(u===null&&s==null||p&&s==u.key&&c==u.type)return n;if(r>(p?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((u=t[a=o>=0?o--:i++])!=null&&(2&u.__u)==0&&s==u.key&&c==u.type)return a}return -1}function _n(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||lo.test(t)?n:n+"px";}function tt(e,t,n,r,o){var i,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else {if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||_n(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||_n(e.style,t,n[t]);}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Sn,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=It,e.addEventListener(t,i?Ct:Tt,i)):e.removeEventListener(t,i?Ct:Tt,i);else {if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===false&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n));}}function xn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=It++;else if(t.t<n.u)return;return n(E.event?E.event(t):t)}}}function Pt(e,t,n,r,o,i,a,s,c,u){var p,d,m,f,h,g,y,v,x,S,T,M,P,N,q,V=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=E.__b)&&p(t);e:if(typeof V=="function")try{if(v=t.props,x=V.prototype&&V.prototype.render,S=(p=V.contextType)&&r[p.__c],T=p?S?S.props.value:p.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:(x?t.__c=d=new V(v,T):(t.__c=d=new le(v,T),d.constructor=V,d.render=mo),S&&S.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&V.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=pe({},d.__s)),pe(d.__s,V.getDerivedStateFromProps(v,d.__s))),f=d.props,h=d.state,d.__v=t,m)x&&V.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(x&&V.getDerivedStateFromProps==null&&v!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,T),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,T)===!1){t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(O){O&&(O.__=t);}),ot.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,T),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,h,g);});}if(d.context=T,d.props=v,d.__P=e,d.__e=!1,M=E.__r,P=0,x)d.state=d.__s,d.__d=!1,M&&M(t),p=d.render(d.props,d.state,d.context),ot.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,M&&M(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++P<25);d.state=d.__s,d.getChildContext!=null&&(r=pe(pe({},r),d.getChildContext())),x&&!m&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,h)),N=p!=null&&p.type===te&&p.key==null?Ln(p.props.children):p,s=Mn(e,$e(N)?N:[N],t,n,r,o,i,a,s,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null);}catch(O){if(t.__v=null,c||i!=null)if(O.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s;}else {for(q=i.length;q--;)Lt(i[q]);At(t);}else t.__e=n.__e,t.__k=n.__k,O.then||At(t);E.__e(O,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=po(n.__e,t,n,r,o,i,a,c,u);return (p=E.diffed)&&p(t),128&t.__u?void 0:s}function At(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(At));}function In(e,t,n){for(var r=0;r<n.length;r++)Et(n[r],n[++r],n[++r]);E.__c&&E.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o);});}catch(i){E.__e(i,o.__v);}});}function Ln(e){return typeof e!="object"||e==null||e.__b>0?e:$e(e)?e.map(Ln):pe({},e)}function po(e,t,n,r,o,i,a,s,c){var u,p,d,m,f,h,g,y=n.props||rt,v=t.props,x=t.type;if(x=="svg"?o="http://www.w3.org/2000/svg":x=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(x==null)return document.createTextNode(v);e=document.createElementNS(o,x,v.is&&v),s&&(E.__m&&E.__m(t,i),s=false),i=null;}if(x==null)y===v||s&&e.data==v||(e.data=v);else {if(i=i&&at.call(e.childNodes),!s&&i!=null)for(y={},u=0;u<e.attributes.length;u++)y[(f=e.attributes[u]).name]=f.value;for(u in y)f=y[u],u=="dangerouslySetInnerHTML"?d=f:u=="children"||u in v||u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v||tt(e,u,null,f,o);for(u in v)f=v[u],u=="children"?m=f:u=="dangerouslySetInnerHTML"?p=f:u=="value"?h=f:u=="checked"?g=f:s&&typeof f!="function"||y[u]===f||tt(e,u,f,y[u],o);if(p)s||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Mn(t.type=="template"?e.content:e,$e(m)?m:[m],t,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Pe(n,0),s,c),i!=null)for(u=i.length;u--;)Lt(i[u]);s||(u="value",x=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[u]||x=="progress"&&!h||x=="option"&&h!=y[u])&&tt(e,u,h,y[u],o),u="checked",g!=null&&g!=e[u]&&tt(e,u,g,y[u],o));}return e}function Et(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t));}else e.current=t;}catch(o){E.__e(o,n);}}function Pn(e,t,n){var r,o;if(E.unmount&&E.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Et(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount();}catch(i){E.__e(i,t);}r.base=r.__P=null;}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Pn(r[o],t,n||typeof e.type!="function");n||Lt(e.__e),e.__c=e.__=e.__e=void 0;}function mo(e,t,n){return this.constructor(e,n)}function Bt(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),E.__&&E.__(e,t),o=(r="undefined"=="function")?null:t.__k,i=[],a=[],Pt(t,e=(t).__k=me(te,null,[e]),o||rt,rt,t.namespaceURI,o?null:t.firstChild?at.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),In(i,e,a);}function st(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null;},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=true,Mt(a);});},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i);};}),n.children}return t.__c="__cC"+Tn++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}at=ot.slice,E={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s;}throw e}},vn=0,le.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=pe({},this.state),typeof e=="function"&&(e=e(pe({},n),this.props)),e&&pe(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Mt(this));},le.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),Mt(this));},le.prototype.render=te,be=[],kn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wn=function(e,t){return e.__v.__b-t.__v.__b},it.__r=0,Sn=/(PointerCapture)$|Capture$/i,It=0,Tt=xn(false),Ct=xn(true),Tn=0;var Ee,X,Ft,En,Oe=0,zn=[],G=E,Bn=G.__b,Fn=G.__r,Rn=G.diffed,qn=G.__c,Nn=G.unmount,Dn=G.__;function ct(e,t){G.__h&&G.__h(X,e,Oe||t),Oe=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function H(e){return Oe=1,On(Hn,e)}function On(e,t,n){var r=ct(Ee++,2);if(r.t=e,!r.__c&&(r.__=[Hn(void 0,t),function(s){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,s);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}));}],r.__c=X,!X.__f)){var o=function(s,c,u){if(!r.__c.__H)return true;var p=r.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return !m.__N}))return !i||i.call(this,s,c,u);var d=r.__c.props!==s;return p.some(function(m){if(m.__N){var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(d=true);}}),i&&i.call(this,s,c,u)||d};X.__f=true;var i=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(s,c,u){if(this.__e){var p=i;i=void 0,o(s,c,u),i=p;}a&&a.call(this,s,c,u);},X.shouldComponentUpdate=o;}return r.__N||r.__}function z(e,t){var n=ct(Ee++,3);!G.__s&&Wn(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n));}function U(e){return Oe=5,$(function(){return {current:e}},[])}function $(e,t){var n=ct(Ee++,7);return Wn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Z(e,t){return Oe=8,$(function(){return e},t)}function qt(e){var t=X.context[e.__c],n=ct(Ee++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(X)),t.props.value):e.__}function ho(){for(var e;e=zn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(lt),t.__h.some(Rt),t.__h=[];}catch(n){t.__h=[],G.__e(n,e.__v);}}}G.__b=function(e){X=null,Bn&&Bn(e);},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Dn&&Dn(e,t);},G.__r=function(e){Fn&&Fn(e),Ee=0;var t=(X=e.__c).__H;t&&(Ft===X?(t.__h=[],X.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(lt),t.__h.some(Rt),t.__h=[],Ee=0)),Ft=X;},G.diffed=function(e){Rn&&Rn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zn.push(t)!==1&&En===G.requestAnimationFrame||((En=G.requestAnimationFrame)||go)(ho)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Ft=X=null;},G.__c=function(e,t){t.some(function(n){try{n.__h.some(lt),n.__h=n.__h.filter(function(r){return !r.__||Rt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],G.__e(r,n.__v);}}),qn&&qn(e,t);},G.unmount=function(e){Nn&&Nn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{lt(r);}catch(o){t=o;}}),n.__H=void 0,t&&G.__e(t,n.__v));};var $n=typeof requestAnimationFrame=="function";function go(e){var t,n=function(){clearTimeout(r),$n&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);$n&&(t=requestAnimationFrame(n));}function lt(e){var t=X,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),X=t;}function Rt(e){var t=X;e.__c=e.__(),X=t;}function Wn(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Hn(e,t){return typeof t=="function"?t(e):t}function bo(e,t){for(var n in t)e[n]=t[n];return e}function Un(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return true;return false}function Vn(e,t){this.props=e,this.context=t;}(Vn.prototype=new le).isPureReactComponent=true,Vn.prototype.shouldComponentUpdate=function(e,t){return Un(this.props,e)||Un(this.state,t)};var Yn=E.__b;E.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Yn&&Yn(e);};var _o=E.__e;E.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}_o(e,t,n,r);};var jn=E.unmount;function Jn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c();}),e.__c.__H=null),(e=bo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Jn(r,t,n)})),e}function er(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return er(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Nt(){this.__u=0,this.o=null,this.__b=null;}function tr(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function ut(){this.i=null,this.l=null;}E.unmount=function(e){var t=e.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),jn&&jn(e);},(Nt.prototype=new le).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=tr(r.__v),i=false,a=function(){i||r.__z||(i=true,n.__R=null,o?o(c):c());};n.__R=a;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=er(u,u.__c.__P,u.__c.__O);}var p;for(r.setState({__a:r.__b=null});p=r.o.pop();)p.__P=s,p.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a);},Nt.prototype.componentWillUnmount=function(){this.o=[];},Nt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Jn(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&me(te,null,e.fallback);return o&&(o.__u&=-33),[me(te,null,t.__a?null:e.children),o]};var Xn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2];}};(ut.prototype=new le).__a=function(e){var t=this,n=tr(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Xn(t,e,r)):o();};n?n(i):i();}},ut.prototype.render=function(e){this.i=null,this.l=new Map;var t=ze(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ut.prototype.componentDidUpdate=ut.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xn(e,n,t);});};var xo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,vo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ko=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,wo=/[A-Z0-9]/g,So=typeof document<"u",To=function(e){return (typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function nr(e,t,n){return t.__k==null&&(t.textContent=""),Bt(e,t),e?e.__c:null}le.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(le.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var Zn=E.event;E.event=function(e){return Zn&&(e=Zn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Co={configurable:true,get:function(){return this.class}},Gn=E.vnode;E.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")==-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||So&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var c=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===true?s="":c==="translate"&&s==="no"?s=false:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?a="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||To(n.type)?c==="onfocus"?a="onfocusin":c==="onblur"?a="onfocusout":ko.test(a)&&(a=c):c=a="oninput":i&&vo.test(a)?a=a.replace(wo,"-$&").toLowerCase():s===null&&(s=void 0),c==="oninput"&&o[a=c]&&(a="oninputCapture"),o[a]=s;}}r=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=ze(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1;})),o.defaultValue!=null&&(o.value=ze(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Co)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=xo,Gn&&Gn(e);};var Kn=E.__r;E.__r=function(e){Kn&&Kn(e),e.__c;};var Qn=E.diffed;E.diffed=function(e){Qn&&Qn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value);};function or(e){return !!e.__k&&(Bt(null,e),true)}function ir(e){return {render:function(t){nr(t,e);},unmount:function(){or(e);}}}function Dt(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t>=r.startTime&&t<r.startTime+r.duration)return r}return e[0]||null}function We(e,t){if(!e||!e.phrases.length)return null;for(let n of e.phrases)if(t>=n.startTime&&t<n.endTime)return n;return null}var Mo='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ao='Georgia, "Times New Roman", serif',Io='Consolas, "Courier New", monospace';var Lo={blue:{bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"},green:{bg:"#22543d",text:"#9ae6b4",accent:"#68d391"},purple:{bg:"#44337a",text:"#d6bcfa",accent:"#b794f4"},red:{bg:"#742a2a",text:"#fc8181",accent:"#feb2b2"},orange:{bg:"#744210",text:"#fbd38d",accent:"#f6ad55"},teal:{bg:"#234e52",text:"#81e6d9",accent:"#4fd1c5"}},Po={id:"standard",name:"Standard",description:"Clean and safe. System fonts only \u2014 no external font dependencies.",colors:{primary:"#3182ce",secondary:"#4a5568",background:"#1a202c",backgroundLight:"#2d3748",text:"#f7fafc",textMuted:"#a0aec0",highlight:"#4299e1",warning:"#fc8181"},typography:{bodyFontFamily:Mo,titleFontFamily:Ao,monoFontFamily:Io,titleWeight:"bold"},style:{textShadow:true,overlayOpacity:.45,animationSpeed:1},renderStyle:{name:"standard",defaultTextAnimation:"fadeIn",defaultImageAnimation:"slowZoom",ambientMotion:true,defaultTransition:{type:"fade",duration:.7}},colorSchemes:Lo,persistentLayers:{bottomLayers:[{template:"gradientBackground",config:{type:"gradientBackground",preset:"dark-vignette"}}]}};var ue=Po;var J={landscape:{width:1920,height:1080,name:"16:9 Landscape"},portrait:{width:1080,height:1920,name:"9:16 Portrait"},square:{width:1080,height:1080,name:"1:1 Square"}};var Eo=Math.sqrt(1920*1920+1080*1080);function $t(e){return Math.sqrt(e.width*e.width+e.height*e.height)/Eo}function zt(e){let t=e.width/e.height;return Math.abs(t-1)<.05?"square":t>1?"landscape":"portrait"}var Bo={landscape:{primaryY:"35%",secondaryY:"55%",tertiaryY:"75%",titleScale:1,bodyScale:1,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"80%",horizontalPadding:"10%",captionY:"85%",captionScale:1},portrait:{primaryY:"25%",secondaryY:"42%",tertiaryY:"58%",titleScale:.7,bodyScale:1.5,columnLeftX:"50%",columnRightX:"50%",columnTopY:"30%",columnBottomY:"55%",stackColumns:true,maxTextWidth:"90%",horizontalPadding:"5%",captionY:"75%",captionScale:.85},square:{primaryY:"30%",secondaryY:"50%",tertiaryY:"70%",titleScale:.85,bodyScale:.9,columnLeftX:"25%",columnRightX:"75%",columnTopY:"35%",columnBottomY:"65%",stackColumns:false,maxTextWidth:"85%",horizontalPadding:"7.5%",captionY:"82%",captionScale:.9}};function He(e){return Bo[e]}function ar(e,t,n,r=false){let o=$t(t),i=He(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function dt(e){let t=He(e);return t.stackColumns?{left:{x:"50%",y:t.columnTopY},right:{x:"50%",y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:"50%"},right:{x:t.columnRightX,y:"50%"}}}var Ot='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function ne(e){return "template"in e&&typeof e.template=="string"}function he(e,t,n,r=J.landscape){let o=zt(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:$t(r),orientation:o,layout:He(o)}}function L(e,t,n=false){return ar(e,t.viewport,t.orientation,n)}function Wt(e){return "template"in e&&typeof e.template=="string"}function sr(e){return "children"in e&&Array.isArray(e.children)?e.children:[]}function Se(e){return "value"in e&&typeof e.value=="string"?e.value:sr(e).map(Se).join("")}var Do={"dark-vignette":"radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)","radial-dark":"radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)","warm-sunset":"linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)","cool-blue":"linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)","earth-tones":"linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)"};function $o(e){return {type:"shape",id:"persistent-bg-solid",content:{shape:"rect",fill:e.color},position:{x:0,y:0,width:"100%",height:"100%"}}}function zo(e){return {type:"shape",id:"persistent-bg-gradient",content:{shape:"rect",fill:e.gradient??Do[e.preset??"dark-vignette"]},position:{x:0,y:0,width:"100%",height:"100%"}}}function Oo(e){let t=[],n=e.opacity??.4,r={type:"image",id:"persistent-bg-image",content:{src:e.src,alt:"Background",fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:e.ambientMotion?{type:e.ambientMotion,duration:30}:void 0};return t.push(r),t.push({type:"shape",id:"persistent-bg-overlay",content:{shape:"rect",fill:`rgba(0,0,0,${.5+(1-n)*.3})`},position:{x:0,y:0,width:"100%",height:"100%"}}),t}function Wo(e){let t=e.opacity??.1;return {type:"shape",id:"persistent-bg-pattern",content:{shape:"rect",fill:e.color??`rgba(255,255,255,${t})`},position:{x:0,y:0,width:"100%",height:"100%"}}}function Ho(e){let t=[],n=e.fontSize??18,r=!!e.subtitle,o=e.position.includes("bottom"),i=e.position.includes("left"),a=3,s=r?"15%":"7%",c=o?r?"78%":"84%":"2%",u=i?`${a}%`:"68%",p=r?"6%":"5%",d=r?"10%":"5%",m=1.5,f=e.showThumbnail&&i?`${a+m+6+m}%`:`${a+m}%`,h=e.showThumbnail?"19%":"24%",g=o?r?"80%":"86%":"4%";if(t.push({type:"shape",id:"persistent-caption-bg",content:{shape:"rect",fill:"rgba(0,0,0,0.6)",borderRadius:8},position:{x:u,y:c,width:e.showThumbnail?"30%":"28%",height:s}}),e.showThumbnail&&e.thumbnailSrc){let y=i?`${a+m}%`:"93%",v=o?r?`${78+m}%`:"85%":"3%";t.push({type:"image",id:"persistent-caption-thumb",content:{src:e.thumbnailSrc,alt:"Article thumbnail",fit:"cover"},position:{x:y,y:v,width:p,height:d}});}if(t.push({type:"text",id:"persistent-caption-title",content:{text:e.title,style:{fontSize:n,fontWeight:"bold",color:"rgba(255,255,255,0.9)",textAlign:i?"left":"right",maxLines:1}},position:{x:f,y:g,width:h}}),r){let y=o?"85.5%":"8%";t.push({type:"text",id:"persistent-caption-subtitle",content:{text:e.subtitle,style:{fontSize:18,fontWeight:"normal",color:"rgba(255,255,255,0.55)",textAlign:i?"left":"right"}},position:{x:f,y,width:h}});}return t}function Uo(e){let t=e.position.includes("bottom"),r=e.position.includes("left")?"3%":"90%",o=t?"94%":"3%";return e.isImage?{type:"image",id:"persistent-branding",content:{src:e.content,alt:"Branding",fit:"contain"},position:{x:r,y:o,width:"8%",height:"4%"}}:{type:"text",id:"persistent-branding",content:{text:e.content,style:{fontSize:14,fontWeight:"normal",color:"rgba(255,255,255,0.6)"}},position:{x:r,y:o}}}function Vo(e){let t=e.color??"rgba(255,255,255,0.3)",n=e.position==="top"?"1%":"98%";return {type:"shape",id:"persistent-progress",content:{shape:"rect",fill:t,borderRadius:2},position:{x:"5%",y:n,width:"90%",height:"0.5%"}}}function Yo(e){if(!Wt(e))return [e];let n=e.config;switch(n.type){case "solidBackground":return [$o(n)];case "gradientBackground":return [zo(n)];case "imageBackground":return Oo(n);case "patternBackground":return [Wo(n)];case "titleCaption":return Ho(n);case "cornerBranding":return [Uo(n)];case "progressIndicator":return [Vo(n)];default:return console.warn("Unknown persistent layer template:",n.type),[]}}function Ue(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(Yo(n)),[])}var jo={bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"};function _e(e,t){let n=e.theme.colorSchemes;if(t&&t in n)return n[t];let r=Object.keys(n);return r.length>0?n[r[0]]:jo}var Xo='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Zo='Georgia, "Times New Roman", serif',Go='Consolas, "Courier New", monospace';function I(e,t){let{typography:n}=e.theme;switch(t){case "title":return n.titleFontFamily||Zo;case "body":return n.bodyFontFamily||Xo;case "mono":return n.monoFontFamily||Go}}function ur(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=L(96,t,true),c=L(36,t,false),p=[{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 40%, ${o||i.colors.primary} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"accent-line",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.2)"},position:{x:"40%",y:r?"28%":"38%",width:"20%",height:"2px"}},{type:"text",id:"title",content:{text:n,style:{fontSize:s,fontFamily:I(t,"title"),fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:r?a.primaryY:"50%",anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:2}}];return r&&p.push({type:"text",id:"subtitle",content:{text:r,style:{fontSize:c,fontFamily:I(t,"body"),color:i.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:a.secondaryY,anchor:"center",width:a.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:1}}),p}function dr(e,t){let{title:n="",colorScheme:r="blue",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,c=_e(t,r),u=L(72,t,true),p=[];return o?(p.push({type:"image",id:"bg-image",content:{src:o,alt:i||n,fit:"cover"},position:{x:0,y:0,width:"100%",height:"100%"},animation:a?{type:a,duration:8}:{type:"slowZoom",duration:8,direction:"in"}}),p.push({type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.5)"},position:{x:0,y:0,width:"100%",height:"100%"}})):(p.push({type:"shape",id:"bg",content:{shape:"rect",fill:c.bg},position:{x:0,y:0,width:"100%",height:"100%"}}),p.push({type:"shape",id:"line-top",content:{shape:"rect",fill:`${c.text}33`},position:{x:"50%",y:"40%",width:"20%",height:"2px",anchor:"center"}}),p.push({type:"shape",id:"line-bottom",content:{shape:"rect",fill:`${c.text}33`},position:{x:"50%",y:"60%",width:"20%",height:"2px",anchor:"center"}})),p.push({type:"text",id:"title",content:{text:n,style:{fontSize:u,fontFamily:I(t,"title"),fontWeight:"bold",color:o?"#ffffff":c.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:s.maxTextWidth},animation:{type:"fadeIn",duration:1.5}}),p}var Ko=/^(\d+(?:\.\d+)?)\s*%?$/,xe={textCenterX:"50%",textWidth:"85%",textYAdjust:0,adjustY:false};function Be(e,t){if(!e)return;let n=t!==void 0?{duration:t}:{};switch(e){case "zoomIn":case "in":return {type:"slowZoom",direction:"in",...n};case "zoomOut":case "out":return {type:"slowZoom",direction:"out",...n};case "panLeft":case "left":return {type:"slowZoom",panDirection:"left",...n};case "panRight":case "right":return {type:"slowZoom",panDirection:"right",...n};default:return}}var de=35,fr=`${de}%`;function Te(e){switch(e){case "left-strip":return {textCenterX:`${50+de/2}%`,textWidth:`${100-de-8}%`,textYAdjust:0,adjustY:false};case "right-strip":return {textCenterX:`${50-de/2}%`,textWidth:`${100-de-8}%`,textYAdjust:0,adjustY:false};case "bottom-strip":return {textCenterX:"50%",textWidth:"85%",textYAdjust:-10,adjustY:true};case "corner-inset":return {textCenterX:"45%",textWidth:"70%",textYAdjust:0,adjustY:false};default:return xe}}function Ce(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:c}=e;switch(i){case "left-strip":n.push(lr(r,o,"left",t,a,s,c)),n.push(cr("left",t));break;case "right-strip":n.push(lr(r,o,"right",t,a,s,c)),n.push(cr("right",t));break;case "bottom-strip":n.push(Qo(r,o,t,a,s,c)),n.push(Jo(t));break;case "corner-inset":n.push(ei(r,o,t,a,s,c)),n.push(ti(t));break}return n}function lr(e,t,n,r,o,i,a){return {type:"image",id:`${r}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:i,license:a},position:{x:n==="left"?0:`${100-de}%`,y:0,width:fr,height:"100%"},animation:Be(o,15)}}function cr(e,t){let n=e==="left"?"accent-gradient-left":"accent-gradient-right";return {type:"shape",id:`${t}-accent-fade`,content:{shape:"rect",fill:`url(#${n})`},position:{x:e==="left"?`${de-8}%`:`${100-de}%`,y:0,width:"10%",height:"100%"}}}function Qo(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:0,y:`${100-de}%`,width:"100%",height:fr},animation:Be(r,15)}}function Jo(e){return {type:"shape",id:`${e}-accent-fade`,content:{shape:"rect",fill:"url(#accent-gradient-bottom)"},position:{x:0,y:`${100-de-8}%`,width:"100%",height:"12%"}}}function ei(e,t,n,r,o,i){return {type:"image",id:`${n}-accent-img`,content:{src:e,alt:t,fit:"cover",credit:o,license:i},position:{x:"70%",y:"60%",width:"28%",height:"38%",anchor:"top-left"},animation:Be(r,15)??{type:"fadeIn",duration:2,delay:.5}}}function ti(e){return {type:"shape",id:`${e}-accent-vignette`,content:{shape:"rect",fill:"url(#accent-vignette-corner)",borderRadius:8},position:{x:"69%",y:"59%",width:"30%",height:"40%"}}}function K(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e=="number"?`${e}%`:e;let n=typeof e=="number"?`${e}`:e,r=n.match(Ko);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var ni=/[.;:!?]+$/;function Ut(e){return e.replace(ni,"").trim()}function pt(e,t){return {type:"shape",id:e,content:{shape:"rect",fill:t},position:{x:0,y:0,width:"100%",height:"100%"}}}function pr(e,t){let{stat:n,description:r,detail:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,c=_e(t,i),u=a?Te(a.position):xe,p=L(148,t,true),d=L(32,t,false),m=L(26,t,false),f=[pt("bg",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"stat",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:c.text,shadow:!!a}},position:{x:u.textCenterX,y:K("32%",u),anchor:"center"},animation:{type:"zoomIn",duration:.6}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.6,shadow:!!a}},position:{x:u.textCenterX,y:K("58%",u),width:u.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.3}}),o&&f.push({type:"text",id:"detail",content:{text:o,style:{fontSize:m,fontFamily:I(t,"body"),color:c.accent,textAlign:"center",shadow:!!a}},position:{x:u.textCenterX,y:K("75%",u),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1}}),f}function mr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?Te(o.position):xe,c=L(48,t,true),u=L(24,t,false),p=L(280,t,true),d=[pt("bg",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...Ce(o,e.id)),d.push({type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:p,fontFamily:I(t,"title"),color:"rgba(255, 255, 255, 0.06)",textAlign:"center"}},position:{x:s.textCenterX,y:K("18%",s),anchor:"center"}});let m=r?a.primaryY:"50%";return d.push({type:"text",id:"quote",content:{text:n,style:{fontSize:c,fontFamily:I(t,"title"),color:i.colors.text,textAlign:"center",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:K(m,s),anchor:"center",width:s.textWidth},animation:{type:"fadeIn",duration:2}}),r&&d.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:u,fontFamily:I(t,"body"),color:i.colors.textMuted,textAlign:"center",shadow:!!o}},position:{x:s.textCenterX,y:K(a.captionY,s),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),d}function hr(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?Te(i.position):xe,c=L(56,t,true),u=L(32,t,false),p=L(20,t,false),d=[pt("bg",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...Ce(i,e.id)),d.push({type:"text",id:"fact",content:{text:n,style:{fontSize:c,fontFamily:I(t,"title"),fontWeight:"bold",color:a.colors.text,textAlign:"center",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:K("35%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),d.push({type:"text",id:"explanation",content:{text:r,style:{fontSize:u,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:K("60%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&d.push({type:"text",id:"source",content:{text:o,style:{fontSize:p,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center",shadow:!!i}},position:{x:s.textCenterX,y:K("85%",s),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),d}function gr(e,t){let{left:n,right:r,header:o,leftColor:i="green",rightColor:a="blue"}=e;if(!n?.label||!r?.label)return [];let{theme:s,layout:c,orientation:u}=t,p=_e(t,i),d=_e(t,a),m=dt(u),f=c.stackColumns,h=f?"85%":"42%",g=L(32,t,false),y=L(44,t,true),v=L(22,t,false),x=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${s.colors.background} 0%, #16202e 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];f||(x.push({type:"shape",id:"left-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"3%",y:"15%",width:"44%",height:"70%"}}),x.push({type:"shape",id:"right-panel",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.04)"},position:{x:"53%",y:"15%",width:"44%",height:"70%"}}));let S=f?"12%":"22%";o&&x.push({type:"text",id:"header",content:{text:o,style:{fontSize:g,fontFamily:I(t,"title"),color:s.colors.textMuted,textAlign:"center"}},position:{x:"50%",y:S,anchor:"center"},animation:{type:"fadeIn",duration:.8}});let T,M,P,N;if(f)T=o?"30%":"25%",M=o?"40%":"35%",P=o?"60%":"55%",N=o?"70%":"65%";else {let ie=o?"47%":"45%",k=o?"58%":"56%";T=ie,M=k,P=ie,N=k;}x.push({type:"text",id:"left-label",content:{text:n.label,style:{fontSize:y,fontFamily:I(t,"body"),fontWeight:"bold",color:p.text,textAlign:"center",lineHeight:1.3}},position:{x:m.left.x,y:T,anchor:"center",width:h},animation:{type:"fadeIn",duration:1}}),n.sublabel&&x.push({type:"text",id:"left-sublabel",content:{text:n.sublabel,style:{fontSize:v,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.left.x,y:M,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.3}});let q=L(120,t,true),V=f?"48%":"50%",O=f?"\u2193":"\u2192";return x.push({type:"text",id:"connector",content:{text:O,style:{fontSize:q,fontFamily:I(t,"title"),fontWeight:"bold",color:"rgba(255, 255, 255, 0.6)",textAlign:"center"}},position:{x:"50%",y:V,anchor:"center"},animation:{type:"fadeIn",duration:.6,delay:.4}}),x.push({type:"text",id:"right-label",content:{text:r.label,style:{fontSize:y,fontFamily:I(t,"body"),fontWeight:"bold",color:d.text,textAlign:"center",lineHeight:1.3}},position:{x:m.right.x,y:P,anchor:"center",width:h},animation:{type:"fadeIn",duration:1,delay:.5}}),r.sublabel&&x.push({type:"text",id:"right-sublabel",content:{text:r.sublabel,style:{fontSize:v,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.right.x,y:N,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.8}}),x}var ri={neutral:{bg:"#1a202c",date:"#63b3ed",text:"#ffffff"},somber:{bg:"#1a1a2e",date:"#e53e3e",text:"#a0aec0"},celebratory:{bg:"#1a365d",date:"#68d391",text:"#ffffff"}};function yr(e,t){let{date:n,description:r,footer:o,mood:i="neutral",accentImage:a}=e,{theme:s}=t,c=ri[i],u=a?Te(a.position):xe,p=L(96,t,true),d=L(30,t,false),m=L(26,t,false),f=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(135deg, ${c.bg} 0%, #0d1117 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"date",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:c.date,shadow:!!a}},position:{x:u.textCenterX,y:K("35%",u),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:I(t,"body"),color:c.text,textAlign:"center",lineHeight:1.8,shadow:!!a}},position:{x:u.textCenterX,y:K("58%",u),width:u.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:2,delay:1}}),o&&f.push({type:"text",id:"footer",content:{text:o,style:{fontSize:m,fontFamily:I(t,"body"),color:s.colors.textMuted,shadow:!!a}},position:{x:u.textCenterX,y:K("82%",u),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:3}}),f}function br(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i="bottom",ambientMotion:a,isTitle:s,subtitle:c,imageCredit:u,imageLicense:p}=e,d=o&&Ut(o),{theme:m,layout:f}=t,h=L(36,t,false),g=L(96,t,true),y=L(36,t,false),v=e.kenBurns,S=Be(a||v),T=[{type:"image",id:"bg-image",content:{src:n,alt:r,fit:"cover",credit:u,license:p},position:{x:0,y:0,width:"100%",height:"100%"},animation:S}];return s&&d?(T.push({type:"shape",id:"title-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}}),T.push({type:"text",id:"title",content:{text:d,style:{fontSize:g,fontFamily:I(t,"title"),fontWeight:"bold",color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:c?"70%":"75%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),c&&T.push({type:"text",id:"subtitle",content:{text:c,style:{fontSize:y,fontFamily:I(t,"body"),color:m.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),T):(d&&(T.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:"65%",width:"100%",height:"35%"}}),T.push({type:"text",id:"caption",content:{text:d,style:{fontSize:h,fontFamily:I(t,"body"),color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"82%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}})),T)}function _r(e,t){let{center:n,zoom:r,mapStyle:o="terrain",title:i,caption:a,markers:s,ambientMotion:c,staticSrc:u}=e,{theme:p,layout:d}=t,m=L(64,t,true),f=L(32,t,false),h=Be(c),g=[{type:"map",id:"map-bg",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:u},position:{x:0,y:0,width:"100%",height:"100%"},animation:h}];return i&&(g.push({type:"shape",id:"title-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:0,width:"100%",height:"18%"}}),g.push({type:"text",id:"title",content:{text:i,style:{fontSize:m,fontFamily:I(t,"title"),fontWeight:"bold",color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"9%",anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.3}})),a&&(g.push({type:"shape",id:"caption-overlay",content:{shape:"rect",fill:"rgba(0,0,0,0.6)"},position:{x:0,y:"82%",width:"100%",height:"18%"}}),g.push({type:"text",id:"caption",content:{text:a,style:{fontSize:f,fontFamily:I(t,"body"),color:p.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:d.captionY,anchor:"center",width:d.maxTextWidth},animation:{type:"fadeIn",duration:1,delay:.5}})),g}function xr(e,t){let{text:n,colorScheme:r="blue"}=e,{theme:o}=t,i=_e(t,r),a=L(120,t,true);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 50%, ${o.colors.backgroundLight} 0%, #000000 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"impact-text",content:{text:n,style:{fontSize:a,fontFamily:I(t,"title"),fontWeight:"bold",color:i.text,textAlign:"center",lineHeight:1.2,shadow:true}},position:{x:"50%",y:"50%",anchor:"center",width:"85%"},animation:{type:"fadeIn",duration:1.5}}]}function vr(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?Te(o.position):xe,s=L(44,t,true),c=L(34,t,false),u=[{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(155deg, ${i.colors.backgroundLight} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}];o&&u.push(...Ce(o,e.id));let p=r?30:22;r&&u.push({type:"text",id:"list-title",content:{text:r,style:{fontSize:s,fontFamily:I(t,"title"),fontWeight:"bold",color:i.colors.text,textAlign:"center",shadow:!!o}},position:{x:a.textCenterX,y:K("16%",a),anchor:"center"},animation:{type:"fadeIn",duration:1}});let m=n.length>1?(80-p)/(n.length-1):0;for(let f=0;f<n.length;f++){let h=p+m*f,g=`${f+1}. ${n[f]}`;u.push({type:"text",id:`item-${f}`,content:{text:g,style:{fontSize:c,fontFamily:I(t,"body"),color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:K(`${h}%`,a),anchor:"center",width:a.textWidth},animation:{type:"fadeIn",duration:.8,delay:.3+.3*f}});}return u}var ee=.5;function kr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&Ut(r),{theme:a,layout:s}=t,c=[{type:"shape",id:"bg",content:{shape:"rect",fill:"#000000"},position:{x:0,y:0,width:"100%",height:"100%"}}],u=i?s.stackColumns?18:22:0,p=100-u,d=oi(n.length,p,s.stackColumns),m=L(24,t,false);for(let f=0;f<Math.min(n.length,4);f++){let h=n[f],g=d[f];c.push({type:"shape",id:`grid-placeholder-${f}`,content:{shape:"rect",fill:a.colors.background},position:{x:`${g.x}%`,y:`${g.y}%`,width:`${g.w}%`,height:`${g.h}%`}}),h.alt&&c.push({type:"text",id:`grid-alt-${f}`,content:{text:h.alt,style:{fontSize:m,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center"}},position:{x:`${g.x+g.w/2}%`,y:`${g.y+g.h/2}%`,anchor:"center"}}),c.push({type:"image",id:`grid-img-${f}`,content:{src:h.src,alt:h.alt,fit:"cover",credit:h.credit,license:h.license},position:{x:`${g.x}%`,y:`${g.y}%`,width:`${g.w}%`,height:`${g.h}%`},animation:f===0&&o?{type:o,duration:15}:{type:"fadeIn",duration:1,delay:.2*f}});}if(i){let f=L(s.stackColumns?28:40,t,false);c.push({type:"shape",id:"caption-bg",content:{shape:"rect",fill:"linear-gradient(transparent, rgba(0,0,0,0.8))"},position:{x:0,y:`${p-4}%`,width:"100%",height:`${u+4}%`}}),c.push({type:"text",id:"caption",content:{text:i,style:{fontSize:f,fontFamily:I(t,"body"),color:a.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:`${p+(s.stackColumns?u/2:u*.3)}%`,anchor:"center",width:"90%"},animation:{type:"fadeIn",duration:1,delay:.5}});}return c}function oi(e,t,n){let r=50-ee/2,o=t/2-ee/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ee/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ee/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ee*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ee/3,w:100,h:s},{x:0,y:t*2/3+ee*2/3,w:100,h:s}]}let i=60-ee/2,a=40-ee/2;return [{x:0,y:0,w:i,h:t},{x:60+ee/2,y:0,w:a,h:o},{x:60+ee/2,y:t/2+ee/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ee/2,y:0,w:r,h:o},{x:0,y:t/2+ee/2,w:r,h:o},{x:50+ee/2,y:t/2+ee/2,w:r,h:o}]}}function wr(e,t){let{term:n,definition:r,origin:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,c=_e(t,i),u=a?Te(a.position):xe,p=L(72,t,true),d=L(32,t,false),m=L(22,t,false),f=[pt("bg",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"term",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:c.text,textAlign:"center",shadow:!!a}},position:{x:u.textCenterX,y:K("30%",u),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"shape",id:"separator",content:{shape:"rect",fill:`${c.text}33`},position:{x:u.textCenterX,y:K("42%",u),width:"30%",height:"2px",anchor:"center"}}),f.push({type:"text",id:"definition",content:{text:r,style:{fontSize:d,fontFamily:I(t,"body"),color:s.colors.text,textAlign:"center",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:u.textCenterX,y:K("55%",u),width:u.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&f.push({type:"text",id:"origin",content:{text:o,style:{fontSize:m,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",shadow:!!a}},position:{x:u.textCenterX,y:K("78%",u),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),f}function Sr(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s="blue"}=e,{theme:c}=t,u=_e(t,s),p=L(28,t,false),d=L(48,t,true),m=Math.max(r,i,1),f=65,h=r/m*f,g=i/m*f,y=15,v=6,x=36,S=58,T=N=>N>=1e6?`${(N/1e6).toFixed(1)}M`:N>=1e3?`${(N/1e3).toFixed(N>=1e4?0:1)}K`:N.toLocaleString(),M=a?`${T(r)} ${a}`:T(r),P=a?`${T(i)} ${a}`:T(i);return [{type:"shape",id:"bg",content:{shape:"rect",fill:`linear-gradient(180deg, ${c.colors.background} 0%, #0f1520 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"left-label",content:{text:n,style:{fontSize:p,fontFamily:I(t,"body"),color:c.colors.textMuted}},position:{x:`${y}%`,y:`${x-8}%`}},{type:"text",id:"left-value",content:{text:M,style:{fontSize:d,fontFamily:I(t,"body"),fontWeight:"bold",color:u.text}},position:{x:`${y+h+2}%`,y:`${x-1}%`},animation:{type:"fadeIn",duration:.8,delay:.3}},{type:"shape",id:"left-bar",content:{shape:"rect",fill:u.text,borderRadius:4},position:{x:`${y}%`,y:`${x}%`,width:`${h}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1}},{type:"text",id:"right-label",content:{text:o,style:{fontSize:p,fontFamily:I(t,"body"),color:c.colors.textMuted}},position:{x:`${y}%`,y:`${S-8}%`}},{type:"text",id:"right-value",content:{text:P,style:{fontSize:d,fontFamily:I(t,"body"),fontWeight:"bold",color:u.accent}},position:{x:`${y+g+2}%`,y:`${S-1}%`},animation:{type:"fadeIn",duration:.8,delay:.6}},{type:"shape",id:"right-bar",content:{shape:"rect",fill:u.accent,borderRadius:4},position:{x:`${y}%`,y:`${S}%`,width:`${g}%`,height:`${v}%`},animation:{type:"fadeIn",duration:1,delay:.3}}]}function Tr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=L(52,t,true),s=L(24,t,false),c=L(200,t,true),u=[{type:"image",id:"bg-image",content:{src:o.src,alt:o.alt,fit:"cover",credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"},animation:i?{type:i,duration:15}:void 0},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:c,fontFamily:I(t,"title"),color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:a,fontFamily:I(t,"title"),color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&u.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:s,fontFamily:I(t,"body"),color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),u}function Cr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:c,captionPosition:u="bottom",videoCredit:p,videoLicense:d}=e,m=c&&Ut(c),{theme:f,layout:h}=t,g=L(36,t,false),y=L(16,t,false),v=[{type:"video",id:"bg-video",content:{src:n,posterSrc:r,alt:o,fit:"cover",clipStart:i,clipEnd:a,sourceDuration:s,credit:p,license:d},position:{x:0,y:0,width:"100%",height:"100%"}}];if(m){v.push({type:"shape",id:"caption-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)"},position:{x:0,y:u==="top"?0:"65%",width:"100%",height:"35%"}});let x=u==="top"?"15%":u==="center"?"50%":"82%";v.push({type:"text",id:"caption",content:{text:m,style:{fontSize:g,fontFamily:I(t,"body"),color:f.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:x,anchor:"center",width:h.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}});}return p&&v.push({type:"text",id:"credit",content:{text:p,style:{fontSize:y,fontFamily:I(t,"body"),color:"rgba(255, 255, 255, 0.5)",textAlign:"right"}},position:{x:"96%",y:"96%",anchor:"bottom-right"}}),v}function Mr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=L(52,t,true),a=L(24,t,false),s=L(200,t,true),c=[{type:"video",id:"bg-video",content:{src:o.src,posterSrc:o.posterSrc,alt:o.alt,fit:"cover",clipStart:o.clipStart,clipEnd:o.clipEnd,credit:o.credit,license:o.license},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"shape",id:"overlay",content:{shape:"rect",fill:"rgba(0, 0, 0, 0.55)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"deco-quote",content:{text:"\u201C",style:{fontSize:s,fontFamily:I(t,"title"),color:"rgba(255, 255, 255, 0.08)",textAlign:"center"}},position:{x:"50%",y:"20%",anchor:"center"}},{type:"text",id:"quote-text",content:{text:n,style:{fontSize:i,fontFamily:I(t,"title"),color:"#ffffff",textAlign:"center",lineHeight:1.5,shadow:true}},position:{x:"50%",y:r?"45%":"50%",anchor:"center",width:"80%"},animation:{type:"fadeIn",duration:2}}];return r&&c.push({type:"text",id:"attribution",content:{text:`\u2014 ${r}`,style:{fontSize:a,fontFamily:I(t,"body"),color:"rgba(255, 255, 255, 0.7)",textAlign:"center",shadow:true}},position:{x:"50%",y:"72%",anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),c}function Ar(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:c}=e,{theme:u,layout:p}=t,d=L(96,t,true),m=L(36,t,false),f=Be(a),h=[{type:"image",id:"cover-hero",content:{src:n,alt:r||o,fit:"cover",credit:s,license:c},position:{x:0,y:0,width:"100%",height:"100%"},animation:f},{type:"shape",id:"cover-gradient",content:{shape:"rect",fill:"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)"},position:{x:0,y:0,width:"100%",height:"100%"}},{type:"text",id:"cover-title",content:{text:o,style:{fontSize:d,fontFamily:I(t,"title"),fontWeight:"bold",color:u.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:i?"70%":"75%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8}}];return i&&h.push({type:"text",id:"cover-subtitle",content:{text:i,style:{fontSize:m,fontFamily:I(t,"body"),color:u.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:"82%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),h}function ii(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function Vt(e,t){let n=ii(e);return Ar(n,t)}var Ve={titleBlock:ur,sectionHeader:dr,statHighlight:pr,quoteBlock:mr,factCard:hr,twoColumn:gr,dateEvent:yr,imageWithCaption:br,mapBlock:_r,fullBleedQuote:xr,listBlock:vr,photoGrid:kr,definitionCard:wr,comparisonBar:Sr,pullQuote:Tr,videoWithCaption:Cr,videoPullQuote:Mr};function ft(e,t){let n=Ve[e.template];if(!n)return console.warn(`Unknown template: ${e.template}`),{id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,transition:e.transition,template:e.template};let r;try{r=n(e,t),Array.isArray(r)||(console.error(`Template ${e.template} did not return an array, got:`,typeof r),r=[]);}catch(o){console.error(`Error expanding template ${e.template}:`,o),r=[];}return {id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,...r.length>0?{layers:r}:{},transition:e.transition,template:e.template}}function Yt(e,t={}){let n=t,r=n.theme??ue,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,c=Ue(i?.bottomLayers),u=Ue(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((f,h)=>{let g=he(r,h,s,o),y=ne(f)?ft(f,g):f,v=f,x=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (c.length>0||u.length>0)&&(y.layers=[...x?c:[],...y.layers??[],...S?u:[]]),y.startTime=m,m+=y.duration,y})}let p=new Map;e.forEach((m,f)=>{let h=m.audioSegment??0;p.has(h)||p.set(h,[]),p.get(h).push({block:m,originalIndex:f});});let d=new Array(e.length);for(let[m,f]of p){let h=a[m];if(!h){let b=0;for(let{block:_,originalIndex:C}of f){let F=he(r,C,s,o),R=ne(_)?ft(_,F):_,B=_,D=B.useBottomLayer!==false,re=B.useTopLayer!==false;(c.length>0||u.length>0)&&(R.layers=[...D?c:[],...R.layers??[],...re?u:[]]),R.startTime=b,b+=R.duration,d[C]=R;}continue}let g=[],y=[];for(let b of f)b.block.template==="sectionHeader"?g.push(b):y.push(b);let v=g.reduce((b,{block:_})=>b+(_.duration??0),0),x=y.reduce((b,{block:_})=>b+(_.duration??0),0),S=h.duration-v,T=x>0&&S>0?S/x:1,M=[];for(let{block:b,originalIndex:_}of f){let C=he(r,_,s,o),F=ne(b)?ft(b,C):b,R=b,B=R.useBottomLayer!==false,D=R.useTopLayer!==false;(c.length>0||u.length>0)&&(F.layers=[...B?c:[],...F.layers??[],...D?u:[]]),M.push({block:F,originalIndex:_,templateBlock:R,hasSourceTiming:typeof R.sourceStartTime=="number"});}let P=M.some(b=>b.hasSourceTiming);M.sort((b,_)=>{if(P){let C=b.templateBlock.template==="sectionHeader",F=_.templateBlock.template==="sectionHeader";if(C&&!F)return -1;if(!C&&F)return 1;if(b.hasSourceTiming&&_.hasSourceTiming)return b.templateBlock.sourceStartTime-_.templateBlock.sourceStartTime;if(b.hasSourceTiming&&!_.hasSourceTiming)return -1;if(!b.hasSourceTiming&&_.hasSourceTiming)return 1}return b.originalIndex-_.originalIndex});let N=0;for(let b=0;b<M.length;b++){let _=M[b],{block:C,templateBlock:F}=_;if(_.hasSourceTiming){let R=F.sourceStartTime;C.startTime=h.startTime+R,typeof F.sourceDuration=="number"&&(C.duration=Math.max(5,F.sourceDuration)),N=R+C.duration;}else if(F.template==="sectionHeader")C.startTime=h.startTime+N,N+=C.duration;else {C.startTime=h.startTime+N;let R=C.duration*T;C.duration=R,N+=R;}d[_.originalIndex]=C;}let q=M.map(b=>d[b.originalIndex]).sort((b,_)=>b.startTime-_.startTime);for(let b=0;b<q.length-1;b++){let _=q[b],C=q[b+1],F=_.startTime+_.duration;F>C.startTime?_.duration=C.startTime-_.startTime:F<C.startTime-.5&&(_.duration=Math.max(.1,C.startTime-_.startTime));}let V=5,O=h.startTime+h.duration;for(;q.length>1;){let b=q[q.length-1];if(O-b.startTime<V&&b.template!=="sectionHeader"){let C=q[q.length-2];C.duration=O-C.startTime,b.duration=0,b.startTime=O,q.pop();}else {b.startTime+b.duration<O&&(b.duration=O-b.startTime);break}}if(q.length===1){let b=q[0];b.startTime+b.duration<O&&(b.duration=O-b.startTime);}let ie=true;for(;ie;){ie=false;for(let b=q.length-1;b>=1;b--){let _=q[b];if(_.duration>0&&_.duration<V){let C=q[b-1],F=_.startTime+_.duration;C.duration=F-C.startTime,_.duration=0,_.startTime=O,q.splice(b,1),ie=true;break}}}let k=20;for(let b=0;b<q.length;b++){let _=q[b];if(_.duration>k){let C=Math.ceil(_.duration/k),F=_.duration/C;if(F>=V){_.duration=F;for(let R=1;R<C;R++){let B={id:`${_.id}-split-${R}`,startTime:_.startTime+R*F,duration:F,audioSegment:_.audioSegment,layers:(_.layers??[]).map(D=>({...D,id:`${D.id}-split-${R}`})),transition:{type:"dissolve",duration:1},template:_.template};d.push(B);}}}}}return d.filter(m=>m&&m.duration>0)}function jt(e){return e in Ve}function ce(e,t=0){if(!e||e.type==="none")return {className:"",style:{}};let n=ai(e),r=si(e);return {className:n,style:r}}function ai(e){let{type:t,direction:n,panDirection:r}=e;switch(t){case "fadeIn":return "anim-fadeIn";case "fadeOut":return "anim-fadeOut";case "slowZoom":return r==="left"?"anim-slowZoom-panLeft":r==="right"?"anim-slowZoom-panRight":n==="out"?"anim-slowZoom-out":"anim-slowZoom-in";case "zoomIn":return "anim-zoomIn";case "zoomOut":return "anim-zoomOut";case "panLeft":return "anim-panLeft";case "panRight":return "anim-panRight";case "typewriter":return "anim-typewriter";default:return ""}}function si(e){let t={};return e.duration!==void 0&&(t["--anim-duration"]=`${e.duration}s`),e.delay!==void 0&&(t["--anim-delay"]=`${e.delay}s`),e.easing&&(t["--anim-easing"]=e.easing),t}function Ye(e,t){return `transition-${e}-${t?"enter":"exit"}`}function mt(e){let t=[];for(let n of e)t.push(n),n.children&&t.push(...mt(n.children));return t}function Xt(e,t={}){let n=t.theme??ue,r=t.viewport??J.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!ne(e))return Ht(a,e,t);if(ne(e)&&e.template in Ve){let s=e.template,c=he(n,o,i,r),u;try{let p=Ve[s];u=p(e,c),Array.isArray(u)||(console.error(`Template ${s} did not return an array, got:`,typeof u),u=[]);}catch(p){console.error(`Error expanding template ${s}:`,p),u=[];}return Ht(u,e,t)}return Ht([],e,t)}function Ht(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=Ue(r.bottomLayers),i=Ue(r.topLayers);if(o.length===0&&i.length===0)return e;let a=t,s=a.useBottomLayer!==false,c=a.useTopLayer!==false;return [...s?o:[],...e,...c?i:[]]}function Y(e,t){return typeof e=="number"?e:e.endsWith("%")?parseFloat(e)/100*t:parseFloat(e)}function ve(e,t,n){switch(e){case "center":return {x:-t/2,y:-n/2};case "top-right":return {x:-t,y:0};case "bottom-left":return {x:0,y:-n};case "bottom-right":return {x:-t,y:-n};default:return {x:0,y:0}}}var Zt=st(null);function ui(){return qt(Zt)}function je(e,t){let n=ui(),r=e.startsWith("http")||e.startsWith("/")||e.startsWith("data:")||e.startsWith("blob:"),o=$(()=>r?e:`${t}/${e}`,[r,e,t]),i=!r&&!!n,[a,s]=H(o);return z(()=>{if(!i){s(o);return}let c=false;return n.resolveUrl(e).then(u=>{c||s(u);}),()=>{c=true;}},[i,n,e,o]),i?a:o}var di=0;function l(e,t,n,r,o,i){t||(t={});var a,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?a=t[s]:c[s]=t[s];var u={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--di,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)c[s]===void 0&&(c[s]=a[s]);return E.vnode&&E.vnode(u),u}function Ir({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=Y(i.x,n.width),c=Y(i.y,n.height),u=i.width?Y(i.width,n.width):n.width,p=i.height?Y(i.height,n.height):n.height,d=ve(i.anchor,u,p),m=s+d.x,f=c+d.y,h=je(o.src,t),g=ce(a,r),y=fi(o.fit),v=o.fit==="cover",x=a&&pi.has(a.type);if(v&&x&&a){let S=mi(a),T=ce(S,r);return l("g",{className:"block-layer block-layer--image","data-layer-id":e.id,children:l("foreignObject",{x:m,y:f,width:u,height:p,children:l("div",{style:{width:"100%",height:"100%",overflow:"hidden"},children:l("img",{src:h,alt:o.alt||"",className:T.className,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none",transformOrigin:"center center",...T.style}})})})})}return v?l("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:l("foreignObject",{x:m,y:f,width:u,height:p,children:l("img",{src:h,alt:o.alt||"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})}):l("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:l("image",{href:h,x:m,y:f,width:u,height:p,preserveAspectRatio:y,style:{pointerEvents:"none"}})})}function fi(e){switch(e){case "cover":return "xMidYMid slice";case "fill":return "none";default:return "xMidYMid meet"}}var pi=new Set(["panLeft","panRight","slowZoom","zoomIn","zoomOut"]);function mi(e){switch(e.type){case "panLeft":return {...e,type:"slowZoom",panDirection:"left"};case "panRight":return {...e,type:"slowZoom",panDirection:"right"};case "zoomIn":return {...e,type:"slowZoom",direction:"in"};case "zoomOut":return {...e,type:"slowZoom",direction:"out"};default:return e}}function Lr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,c=Y(o.x,t.width),u=Y(o.y,t.height),p=o.width?Y(o.width,t.width):void 0,d=hi(s.textAlign,o.anchor),m=gi(o.anchor),f=ce(i,n),h=(a??"").split(`
|
|
2
|
+
`),g=p?h.reduce((T,M)=>T.concat(bi(M,s.fontSize,p)),[]):h;if(s.maxLines&&g.length>s.maxLines){g=g.slice(0,s.maxLines);let T=g[g.length-1];g[g.length-1]=T.replace(/\s*$/,"")+"...";}let y=s.lineHeight||1.4,v=s.fontSize*y,x={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Ot,fontWeight:s.fontWeight||"normal",fill:s.color,...f.style},S=s.shadow?`shadow-${e.id}`:void 0;return l("g",{className:`block-layer block-layer--text ${f.className}`,"data-layer-id":e.id,children:[s.shadow&&l("defs",{children:l("filter",{id:S,x:"-20%",y:"-20%",width:"140%",height:"140%",children:l("feDropShadow",{dx:"0",dy:"2",stdDeviation:"3",floodColor:"rgba(0,0,0,0.7)"})})}),s.background&&l("rect",{x:c-(s.padding||16),y:u-s.fontSize-(s.padding||16),width:yi(g,s)+(s.padding||16)*2,height:g.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),l("text",{x:c,y:u,textAnchor:d,dominantBaseline:m,style:x,filter:S?`url(#${S})`:void 0,children:g.map((T,M)=>l("tspan",{x:c,dy:M===0?0:v,children:[T||"\xA0"," "]},M))})]})}function hi(e,t){return e==="center"?"middle":e==="right"?"end":e==="left"?"start":t?.includes("right")?"end":t==="center"?"middle":"start"}function gi(e){return e?.includes("bottom")?"text-after-edge":e==="center"?"middle":"text-before-edge"}function yi(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function bi(e,t,n){if(!e.trim())return [""];let r=t*.5,o=Math.floor(n/r);if(o<=0)return [e];let i=e.split(/\s+/),a=[],s="";for(let c of i){let u=s?`${s} ${c}`:c;if(u.length<=o)s=u;else if(s&&a.push(s),c.length>o){let p=c;for(;p.length>o;)a.push(p.slice(0,o)),p=p.slice(o);s=p;}else s=c;}return s&&a.push(s),a.length>0?a:[""]}function Pr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=Y(o.x,t.width),s=Y(o.y,t.height),c=o.width?Y(o.width,t.width):100,u=o.height?Y(o.height,t.height):100,p=ve(o.anchor,c,u),d=a+p.x,m=s+p.y,f=ce(i,n),h=r.fill||"none",g=typeof h=="string"&&h.includes("gradient(");if(r.shape==="rect"&&g)return l("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:l("foreignObject",{x:d,y:m,width:c,height:u,children:l("div",{style:{width:"100%",height:"100%",background:h,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:"none"}})})});let y={fill:h,stroke:r.stroke,strokeWidth:r.strokeWidth};return l("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:[r.shape==="rect"&&l("rect",{x:d,y:m,width:c,height:u,rx:r.borderRadius,ry:r.borderRadius,...y}),r.shape==="circle"&&l("circle",{cx:d+c/2,cy:m+u/2,r:Math.min(c,u)/2,...y}),r.shape==="line"&&l("line",{x1:d,y1:m,x2:d+c,y2:m+u,stroke:r.stroke||"#ffffff",strokeWidth:r.strokeWidth||2})]})}var _i={terrain:{url:"https://tile.opentopomap.org/{z}/{x}/{y}.png",attribution:"Map: OpenTopoMap (CC-BY-SA)",maxZoom:17},road:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xA9 OpenStreetMap contributors",maxZoom:19},satellite:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"Imagery: Esri, Maxar, Earthstar",maxZoom:18},toner:{url:"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:20},watercolor:{url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"Map: Stadia Maps, Stamen Design",maxZoom:16}};function Gt(e,t,n){let r=Math.pow(2,n),o=Math.floor((t+180)/360*r),i=e*Math.PI/180,a=Math.floor((1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2*r);return {x:o,y:a}}function Kt(e,t,n,r=256){let o=Math.pow(2,n),i=(t+180)/360*o,a=e*Math.PI/180,s=(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*o;return {x:(i-Math.floor(i))*r,y:(s-Math.floor(s))*r}}function xi(e,t,n,r,o,i=256){let a=Gt(e,t,n),s=Kt(e,t,n,i),c=Math.ceil(r/i)+1,u=Math.ceil(o/i)+1,p=a.x-Math.floor(c/2),d=a.y-Math.floor(u/2),m=r/2-s.x,f=o/2-s.y,h=[];for(let g=0;g<u;g++)for(let y=0;y<c;y++){let v=p+y,x=d+g,S=m+(v-a.x)*i,T=f+(x-a.y)*i;h.push({x:v,y:x,screenX:S,screenY:T});}return h}function vi(e,t,n,r){return e.url.replace("{z}",String(r)).replace("{x}",String(t)).replace("{y}",String(n))}async function ki(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>n(new Error(`Failed to load tile: ${e}`)),r.src=e;})}async function Er(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,c=_i[r],u=c.tileSize||256,p=Math.min(n,c.maxZoom),d=document.createElement("canvas");d.width=o,d.height=i;let m=d.getContext("2d");if(!m)throw new Error("Failed to get canvas context");m.fillStyle=r==="toner"?"#ffffff":"#e5e7eb",m.fillRect(0,0,o,i);let h=xi(t.lat,t.lng,p,o,i,u).map(async g=>{let y=vi(c,g.x,g.y,p);try{let v=await ki(y);m.drawImage(v,g.screenX,g.screenY,u,u);}catch(v){console.warn(`Tile load failed: ${y}`,v);}});await Promise.all(h);for(let g of a)wi(m,g,t,p,o,i,u);return s&&Ti(m,c.attribution,o,i),d.toDataURL("image/png")}function wi(e,t,n,r,o,i,a){let s=Gt(n.lat,n.lng,r),c=Gt(t.lat,t.lng,r),u=Kt(n.lat,n.lng,r,a),p=Kt(t.lat,t.lng,r,a),d=(c.x-s.x)*a+(p.x-u.x),m=(c.y-s.y)*a+(p.y-u.y),f=o/2+d,h=i/2+m,g=t.color||"#ef4444",y=t.icon||"pin";e.save(),y==="pin"?(e.fillStyle=g,e.beginPath(),e.arc(f,h-12,8,Math.PI,0,false),e.lineTo(f,h),e.closePath(),e.fill(),e.fillStyle="#ffffff",e.beginPath(),e.arc(f,h-12,3,0,Math.PI*2),e.fill()):y==="circle"?(e.fillStyle=g,e.beginPath(),e.arc(f,h,8,0,Math.PI*2),e.fill(),e.strokeStyle="#ffffff",e.lineWidth=2,e.stroke()):y==="star"&&(e.fillStyle=g,Si(e,f,h,5,10,5),e.fill()),t.label&&(e.fillStyle="#1f2937",e.font="bold 12px system-ui, sans-serif",e.textAlign="center",e.fillText(t.label,f,h+20)),e.restore();}function Si(e,t,n,r,o,i){let a=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-o);for(let c=0;c<r;c++)e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o),a+=s,e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i),a+=s;e.lineTo(t,n-o),e.closePath();}function Ti(e,t,n,r){e.save(),e.fillStyle="rgba(255, 255, 255, 0.8)";let o=4;e.font="10px system-ui, sans-serif";let i=e.measureText(t).width;e.fillRect(n-i-o*2-4,r-16,i+o*2,14),e.fillStyle="#374151",e.textAlign="right",e.fillText(t,n-o-4,r-5),e.restore();}function Br({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,c]=H(null),[u,p]=H(true),[d,m]=H(null),f=Y(i.x,n.width),h=Y(i.y,n.height),g=i.width?Y(i.width,n.width):n.width,y=i.height?Y(i.height,n.height):n.height,v=ve(i.anchor,g,y),x=f+v.x,S=h+v.y;z(()=>{let M=false;if(o.staticSrc){let P=o.staticSrc.startsWith("http")?o.staticSrc:`${t}/${o.staticSrc}`;c(P),p(false);return}return p(true),m(null),Er({center:o.center,zoom:o.zoom,style:o.style,width:g,height:y,markers:o.markers,showAttribution:o.showAttribution!==false}).then(P=>{M||(c(P),p(false));}).catch(P=>{M||(console.error("Failed to compose map:",P),m(P instanceof Error?P.message:String(P)),p(false));}),()=>{M=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,g,y,t]);let T=ce(a,r);return u?l("g",{className:`block-layer block-layer--map ${T.className}`,style:T.style,"data-layer-id":e.id,children:[l("rect",{x,y:S,width:g,height:y,fill:"#e5e7eb"}),l("text",{x:x+g/2,y:S+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#9ca3af",fontSize:"24",fontFamily:"system-ui, sans-serif",children:"Loading map..."})]}):d||!s?l("g",{className:`block-layer block-layer--map ${T.className}`,style:T.style,"data-layer-id":e.id,children:[l("rect",{x,y:S,width:g,height:y,fill:"#fef2f2"}),l("text",{x:x+g/2,y:S+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#dc2626",fontSize:"18",fontFamily:"system-ui, sans-serif",children:"Map failed to load"})]}):l("g",{className:`block-layer block-layer--map ${T.className}`,style:T.style,"data-layer-id":e.id,children:[l("defs",{children:l("clipPath",{id:`clip-${e.id}`,children:l("rect",{x,y:S,width:g,height:y})})}),l("g",{clipPath:`url(#clip-${e.id})`,children:l("image",{href:s,x,y:S,width:g,height:y,preserveAspectRatio:"xMidYMid slice",style:{pointerEvents:"none"}})})]})}function Fr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=U(null),c=U(false),u=Y(a.x,n.width),p=Y(a.y,n.height),d=a.width?Y(a.width,n.width):n.width,m=a.height?Y(a.height,n.height):n.height,f=ve(a.anchor,d,m),h=u+f.x,g=p+f.y,y=je(i.src,t),v=je(i.posterSrc||"",t),x=i.posterSrc?v:void 0;return z(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,c.current=true,o){let M=S.play();M&&M.catch(()=>{});}let T=()=>{S.currentTime>=i.clipEnd&&(S.pause(),S.currentTime=i.clipEnd);};return S.addEventListener("timeupdate",T),()=>{S.removeEventListener("timeupdate",T),S.pause();}},[i.src,i.clipStart,i.clipEnd]),z(()=>{let S=s.current;if(!(!S||!c.current)&&!(S.currentTime>=i.clipEnd))if(o){let T=S.play();T&&T.catch(()=>{});}else S.pause();},[o,i.clipEnd]),l("g",{className:"block-layer block-layer--video","data-layer-id":e.id,children:l("foreignObject",{x:h,y:g,width:d,height:m,children:l("video",{ref:s,src:y,poster:x,muted:true,playsInline:true,preload:"auto","data-clip-start":i.clipStart,"data-clip-end":i.clipEnd,style:{width:"100%",height:"100%",objectFit:i.fit||"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})})}var Ci={width:1920,height:1080};function Fe({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=Ci,isPlaying:a}){let s="",c={};e.transition&&r?(s=Ye(e.transition.type,true),c["--transition-duration"]=`${e.transition.duration}s`):e.transition&&o&&(s=Ye(e.transition.type,false),c["--transition-duration"]=`${e.transition.duration}s`);let u=`vb-clip-${e.id}`;return l("svg",{className:`block-svg ${s}`,style:c,viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden","data-block-id":e.id,children:[l("defs",{children:l("clipPath",{id:u,children:l("rect",{x:"0",y:"0",width:i.width,height:i.height})})}),l("g",{clipPath:`url(#${u})`,children:(e.layers??[]).map(p=>l(Mi,{layer:p,basePath:n,viewport:i,blockTime:t,isPlaying:a},p.id))})]})}function Mi({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case "image":return l(Ir,{layer:e,basePath:t,viewport:n,blockTime:r});case "text":return l(Lr,{layer:e,viewport:n,blockTime:r});case "shape":return l(Pr,{layer:e,viewport:n,blockTime:r});case "map":return l(Br,{layer:e,basePath:t,viewport:n,blockTime:r});case "video":return l(Fr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});default:return console.warn(`Unknown layer type: ${e.type}`),null}}var Ai=4,Rr=2,Ii=6;function Li(e){if(e.words&&e.words.length>0)return e.words.map(o=>({text:o.text,startTime:o.startTime,endTime:o.endTime}));let t=e.text.split(/\s+/).filter(o=>o.length>0);if(t.length===0)return [];let r=(e.endTime-e.startTime)/t.length;return t.map((o,i)=>({text:o,startTime:e.startTime+i*r,endTime:e.startTime+(i+1)*r}))}function Pi(e){let t=[];for(let o of e.phrases)t.push(...Li(o));if(t.length===0)return {words:[],chunks:[]};let n=Ai;if(t.length>n){let o=Math.ceil(t.length/n);n=Math.ceil(t.length/o),n=Math.min(Ii,Math.max(Rr,n));}else n=Math.max(Rr,t.length);let r=[];for(let o=0;o<t.length;o+=n){let i=t.slice(o,o+n);r.push({words:i,startTime:i[0].startTime,endTime:i[i.length-1].endTime});}return {words:t,chunks:r}}function qr({captions:e,currentTime:t,enabled:n=true,theme:r,viewport:o}){let{chunks:i}=$(()=>e?Pi(e):{words:[],chunks:[]},[e]);if(!n||i.length===0)return l("div",{className:"social-caption-overlay",style:{position:"absolute",bottom:"18%",left:0,right:0,zIndex:50,pointerEvents:"none",opacity:0,transition:"opacity 0.15s ease-in-out"}});let a=null,s=-1;for(let f of i)if(t>=f.startTime&&t<f.endTime){a=f;break}if(!a){for(let f=0;f<i.length-1;f++)if(t>=i[f].endTime&&t<i[f+1].startTime){a=i[f],s=a.words.length-1;break}!a&&i.length>0&&t>=i[i.length-1].startTime&&(a=i[i.length-1],s=a.words.length-1);}if(!a)return null;if(s===-1){for(let f=0;f<a.words.length;f++){let h=a.words[f];if(t>=h.startTime&&t<h.endTime){s=f;break}}if(s===-1){for(let f=a.words.length-1;f>=0;f--)if(t>=a.words[f].startTime){s=f;break}}s===-1&&(s=0);}let c=r?.colors?.primary??"#5b9bd5",u=r?.typography?.titleFontFamily?`"${r.typography.titleFontFamily}", system-ui, sans-serif`:'"PT Serif", Georgia, serif',p=o?.height??720,d=Math.round(p*.055),m=Math.max(24,Math.min(72,d));return l("div",{className:"social-caption-overlay",style:{position:"absolute",bottom:"18%",left:0,right:0,zIndex:50,pointerEvents:"none",textAlign:"center",padding:"0 8%",boxSizing:"border-box",opacity:1,transition:"opacity 0.15s ease-in-out"},children:l("div",{style:{display:"inline-block",lineHeight:1.3},children:a.words.map((f,h)=>{let g=h===s;return l("span",{style:{fontFamily:u,fontSize:`${m}px`,fontWeight:g?800:600,color:g?c:"rgba(255, 255, 255, 0.9)",textShadow:"0 2px 8px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.4)",marginRight:h<a.words.length-1?"0.3em":void 0,transition:"color 0.1s ease, font-weight 0.1s ease",textTransform:"uppercase"},children:f.text},`${f.startTime}-${h}`)})})})}function Nr({captions:e,currentTime:t,enabled:n=true,fontSize:r=16,captionStyle:o="standard",theme:i,viewport:a}){if(o==="social")return l(qr,{captions:e,currentTime:t,enabled:n,theme:i,viewport:a});let c=(n&&e?We(e,t):null)?.text??null;return l("div",{className:"caption-overlay",style:{position:"absolute",top:"6px",left:"50%",transform:"translateX(-50%)",zIndex:50,pointerEvents:"none",maxWidth:"100%",width:"100%",textAlign:"center",opacity:c?1:0,transition:"opacity 0.15s ease-in-out",padding:"0 4px",boxSizing:"border-box"},children:c&&l("div",{style:{display:"inline-block",padding:"3px 10px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"4px",backdropFilter:"blur(4px)"},children:l("span",{style:{color:"#ffffff",fontSize:`${r}px`,fontFamily:"'Hanken Grotesk', system-ui, sans-serif",fontWeight:500,lineHeight:1.25,textShadow:"0 1px 3px rgba(0,0,0,0.5)",whiteSpace:"pre-wrap",wordWrap:"break-word"},children:c})})})}function Dr(e,t,n=""){let[r,o]=H(0),[i,a]=H(false),[s,c]=H(0),[u,p]=H(false),[d,m]=H(false),[f,h]=H(0),g=U([]),y=U(null),v=U(false),x=U(new Map),S=U(new Map),T=U(false);z(()=>{if(!t?.segments)return;let k=0;g.current=t.segments.map(b=>{let _=k;return k+=b.duration,_}),h(k);},[t]);let M=Z(async k=>{let b=n?`${n}/${k}`:k;if(x.current.has(k))return x.current.get(k);if(S.current.has(k))return S.current.get(k);let _=(async()=>{try{let C=await fetch(b);if(!C.ok)throw new Error(`HTTP ${C.status}`);let F=await C.blob(),R=URL.createObjectURL(F);return x.current.set(k,R),R}catch{return b}finally{S.current.delete(k);}})();return S.current.set(k,_),_},[n]);z(()=>{if(!t?.segments)return;t.segments.forEach(b=>{M(b.src);});let k=x.current;return ()=>{k.forEach(b=>{URL.revokeObjectURL(b);}),k.clear();}},[t,M]),z(()=>{let k=e.current;if(!k)return;let b=()=>{let D=(g.current[s]||0)+k.currentTime;o(D);},_=()=>{T.current=false,a(true);},C=()=>a(false),F=()=>{m(true);},R=()=>{t&&s<t.segments.length-1?(v.current=true,c(B=>B+1)):(p(true),a(false));};return k.addEventListener("timeupdate",b),k.addEventListener("play",_),k.addEventListener("pause",C),k.addEventListener("ended",R),k.addEventListener("error",F),()=>{k.removeEventListener("timeupdate",b),k.removeEventListener("play",_),k.removeEventListener("pause",C),k.removeEventListener("ended",R),k.removeEventListener("error",F);}},[e,s,t]),z(()=>{let k=e.current;if(!k||!t?.segments)return;let b=t.segments[s];if(!b)return;let _=()=>{if(y.current!==null){let B=g.current[s]||0,D=y.current-B;k.currentTime=Math.max(0,D),o(y.current),y.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},C=k.src,F=x.current.get(b.src);C&&(C===F||C.endsWith(b.src))?_():(async()=>{let D=await M(b.src),re=()=>{m(true),_(),k.removeEventListener("canplay",re);};k.addEventListener("canplay",re),k.src=D,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener("canplay",re),m(true),_());})();},[e,s,t,M]);let P=Z(()=>{let k=e.current;k&&(u&&(c(0),p(false)),k.play().then(()=>{T.current=false;}).catch(()=>{T.current=true,a(true);}));},[e,u]),N=Z(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),q=Z(()=>{e.current&&(i?N():P());},[e,i,P,N]),V=Z(k=>{let b=e.current;if(!b||!t?.segments)return;let _=f>0?Math.max(0,Math.min(k,f)):Math.max(0,k),C=0,F=0;for(let B=0;B<t.segments.length;B++){let D=F+t.segments[B].duration;if(_<D){C=B;break}F=D,B===t.segments.length-1&&(C=B);}let R=!b.paused;if(p(false),C!==s)y.current=_,v.current=R,c(C);else {let B=_-F;b.currentTime=Math.max(0,B),o(_);}},[e,t,s,f]),O=Z(k=>{!t?.segments||k<0||k>=t.segments.length||(c(k),p(false));},[t]),ie=Z(async()=>{V(0),await new Promise(k=>setTimeout(k,50)),P();},[V,P]);return z(()=>{if(!i||!T.current||!f)return;let k=performance.now(),b,_=C=>{if(!T.current)return;let F=(C-k)/1e3;k=C,o(R=>{let B=R+F;return B>=f?(T.current=false,p(true),a(false),f):B}),b=requestAnimationFrame(_);};return b=requestAnimationFrame(_),()=>cancelAnimationFrame(b)},[i,f]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:f,isEnded:u,isReady:d,isAvailable:true,play:async()=>P(),pause:async()=>N(),toggle:async()=>q(),seekTo:async k=>V(k),skipToSegment:async k=>O(k),restart:ie}}function $r(e,t,n=J.landscape,r=false,o){let [i,a]=H({entering:false,exiting:false,previousBlock:null}),s=$(()=>{if(!e?.blocks)return [];let P=e.blocks.some(q=>q.children&&q.children.length>0)?mt(e.blocks):e.blocks;if(P.some(ne)){let q=e.audio?.segments?.map(O=>({startTime:O.startTime,duration:O.duration}));return Yt(P,{audioSegments:q,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return P},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),c=$(()=>Dt(s,t),[s,t]),u=$(()=>c?s.indexOf(c):-1,[s,c]),p=$(()=>c?Math.max(0,t-c.startTime):0,[c,t]),d=$(()=>!c||c.duration===0?0:Math.min(1,p/c.duration),[c,p]),m=$(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);$(()=>c,[u]);z(()=>{if(!(!c||r)&&i.previousBlock?.id!==c.id){let P=c.transition?.duration||0;if(P>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let N=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:c});},P*1e3);return ()=>clearTimeout(N)}else a({entering:false,exiting:false,previousBlock:c});}},[c?.id,r]);let h=U(null);z(()=>{if(!(!r||!c)&&i.previousBlock?.id!==c.id){let M=i.previousBlock;h.current=M,a(P=>({...P,previousBlock:c}));}},[c?.id,r]);let g=c?.transition?.duration||0,y=r&&g>0&&p<g,v=y&&h.current!==null,x=Z(M=>{if(!e||M<0||M>=s.length)return;let P=s[M];if(P)return P.startTime},[e,s]),S=Z(()=>{if(u<s.length-1)return x(u+1)},[u,s.length,x]),T=Z(()=>{if(u>0)return x(u-1)},[u,x]);return {currentBlock:c,currentBlockIndex:u,previousBlock:r?v?h.current:null:i.exiting?i.previousBlock:null,isEntering:r?y:i.entering,isExiting:r?v:i.exiting,blockTime:p,blockProgress:d,docProgress:m,nextBlock:S,prevBlock:T,goToBlock:x,blocks:s}}function Ei(e,t){let n=e/t;return n>1.2?"landscape":n<.83?"portrait":"landscape"}function Bi(e){switch(e){case "portrait":return J.portrait;case "square":return J.square;default:return J.landscape}}function zr(){let[e,t]=H(()=>({width:typeof window<"u"?window.innerWidth:1920,height:typeof window<"u"?window.innerHeight:1080}));z(()=>{if(typeof window>"u")return;let o=()=>{t({width:window.innerWidth,height:window.innerHeight});},i,a=()=>{clearTimeout(i),i=setTimeout(o,100);};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),clearTimeout(i);}},[]);let n=$(()=>Ei(e.width,e.height),[e.width,e.height]);return {viewport:$(()=>Bi(n),[n]),orientation:n,windowSize:e}}function Xe(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}function ht({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=U(null),[a,s]=H(null),c=Z(d=>{let m=i.current;if(!m)return;let f=m.getBoundingClientRect(),h=d.clientX-f.left,g=Math.max(0,Math.min(1,h/f.width));s(g);},[]),u=Z(()=>{s(null);},[]),p=Z(d=>{for(let m=r.length-1;m>=0;m--){let f=r[m];if(d>=f.startTime)return {block:f,index:m}}return r.length>0?{block:r[0],index:0}:null},[r]);return l("div",{ref:i,style:{flex:1,height:"24px",cursor:"pointer",position:"relative",display:"flex",alignItems:"center"},onClick:d=>{let m=d.currentTarget.getBoundingClientRect(),h=(d.clientX-m.left)/m.width;t.seekTo(h*e.totalDuration);},onMouseMove:c,onMouseLeave:u,children:[l("div",{style:{position:"absolute",left:0,right:0,height:"6px",background:"rgba(255,255,255,0.2)",borderRadius:"3px"}}),l("div",{style:{position:"absolute",left:0,width:`${e.docProgress*100}%`,height:"6px",background:"#5b9bd5",borderRadius:"3px",transition:"width 0.1s"}}),n.map((d,m)=>l("div",{style:{position:"absolute",left:`${d.position}%`,transform:"translateX(-50%)",width:"10px",height:"10px",borderRadius:"50%",background:d.index===e.currentBlockIndex?"#ffffff":"rgba(255,255,255,0.5)",border:"2px solid #5b9bd5",cursor:"pointer",zIndex:2,transition:"transform 0.15s, background 0.15s"},title:d.title,onClick:f=>{f.stopPropagation(),t.seekTo(d.block.startTime);},onMouseEnter:f=>{f.currentTarget.style.transform="translateX(-50%) scale(1.3)";},onMouseLeave:f=>{f.currentTarget.style.transform="translateX(-50%)";}},`${d.block.id}-${m}`)),a!==null&&l("div",{style:{position:"absolute",left:`${a*100}%`,bottom:"100%",transform:"translateX(-50%)",marginBottom:"8px",padding:"6px 10px",background:"rgba(0,0,0,0.9)",borderRadius:"4px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10},children:[l("div",{style:{color:"white",fontSize:"12px",fontFamily:"monospace"},children:Xe(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=p(d);return m&&o?l("div",{style:{color:"rgba(255,255,255,0.7)",fontSize:"11px",marginTop:"2px"},children:o(m.block)}):null})()]}),a!==null&&l("div",{style:{position:"absolute",left:`${a*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"2px",height:"16px",background:"rgba(255,255,255,0.6)",pointerEvents:"none",zIndex:1}})]})}function Or({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return l("div",{className:"doc-player__controls",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px",background:"linear-gradient(transparent, rgba(0,0,0,0.8))",display:"flex",alignItems:"center",gap:"8px",zIndex:100},children:[l("button",{onClick:t.restart,style:{background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",padding:"8px",fontSize:"14px",display:"flex",alignItems:"center"},title:"Restart","aria-label":"Restart from beginning",children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})})}),l("button",{onClick:t.toggle,style:{background:"rgba(255,255,255,0.2)",border:"none",borderRadius:"50%",color:"white",cursor:"pointer",padding:"10px",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px"},"aria-label":e.isPlaying?"Pause":"Play",children:e.isPlaying?l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:l("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}):l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:l("path",{d:"M8 5v14l11-7z"})})}),l("span",{style:{color:"white",fontSize:"12px",minWidth:"80px",fontFamily:"monospace"},children:[Xe(e.currentTime)," / ",Xe(e.totalDuration)]}),l(ht,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),l("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"11px",whiteSpace:"nowrap"},children:[e.currentBlockIndex+1,"/",e.totalBlocks]}),e.hasCaptions&&l("button",{onClick:()=>t.cycleCaptionMode(),style:{background:e.captionMode!=="off"?"rgba(255,255,255,0.2)":"none",border:"none",color:e.captionMode!=="off"?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px",borderRadius:"4px"},title:e.captionMode==="off"?"Captions: Off (click for Standard)":e.captionMode==="standard"?"Captions: Standard (click for Social)":"Captions: Social (click to turn off)","aria-label":"Cycle caption style",children:[l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z"})}),e.captionMode!=="off"&&l("span",{style:{fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.captionMode==="standard"?"CC":"SM"})]}),t.toggleFullscreen&&l("button",{onClick:t.toggleFullscreen,style:{background:e.isFullscreen?"rgba(255,255,255,0.2)":"none",border:"none",color:e.isFullscreen?"white":"rgba(255,255,255,0.5)",cursor:"pointer",padding:"8px",display:"flex",alignItems:"center",borderRadius:"4px"},title:e.isFullscreen?"Exit fullscreen (F)":"Fullscreen (F)","aria-label":e.isFullscreen?"Exit fullscreen":"Enter fullscreen",children:e.isFullscreen?l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}):l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})}function Wr({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return l("div",{className:"doc-controls-slideshow","data-testid":"slideshow-controls",style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",alignItems:"center",gap:"2px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"8px",padding:"4px 6px",zIndex:100,userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[l("button",{onClick:a=>{a.stopPropagation(),t.prevSlide();},disabled:o,"data-testid":"slide-prev","aria-label":"Previous slide",title:"Previous slide",style:{background:"none",border:"none",color:o?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:o?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{o||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),l("span",{"data-testid":"slide-counter",style:{color:"rgba(255,255,255,0.9)",fontSize:"13px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontVariantNumeric:"tabular-nums",minWidth:"48px",textAlign:"center",padding:"0 4px",letterSpacing:"0.02em"},children:r>0?`${n+1} / ${r}`:"\u2014"}),l("button",{onClick:a=>{a.stopPropagation(),t.nextSlide();},disabled:i,"data-testid":"slide-next","aria-label":"Next slide",title:"Next slide",style:{background:"none",border:"none",color:i?"rgba(255,255,255,0.3)":"rgba(255,255,255,0.9)",cursor:i?"default":"pointer",padding:"6px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:a=>{i||(a.currentTarget.style.background="rgba(255,255,255,0.1)");},onMouseLeave:a=>{a.currentTarget.style.background="none";},children:l("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:l("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})})})]})}function oe(e,t=""){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case "text":return l(te,{children:n.value},o);case "emphasis":return l("em",{className:"squisq-md-em",children:oe(n.children,o)},o);case "strong":return l("strong",{className:"squisq-md-strong",children:oe(n.children,o)},o);case "delete":return l("del",{className:"squisq-md-del",children:oe(n.children,o)},o);case "inlineCode":return l("code",{className:"squisq-md-inline-code",children:n.value},o);case "link":return l("a",{className:"squisq-md-link",href:n.url,title:n.title??void 0,target:"_blank",rel:"noopener noreferrer",children:oe(n.children,o)},o);case "image":return l("img",{className:"squisq-md-image",src:n.url,alt:n.alt??"",title:n.title??void 0},o);case "break":return l("br",{},o);case "inlineMath":return l("code",{className:"squisq-md-inline-math",children:n.value},o);case "htmlInline":return l("span",{className:"squisq-md-html-inline",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case "footnoteReference":return l("sup",{className:"squisq-md-footnote-ref",children:l("a",{href:`#fn-${n.identifier}`,children:["[",n.label??n.identifier,"]"]})},o);case "linkReference":return l("span",{className:"squisq-md-link-ref",children:oe(n.children,o)},o);case "imageReference":return l("span",{className:"squisq-md-image-ref",children:["[",n.alt??n.identifier,"]"]},o);case "textDirective":return l("span",{className:"squisq-md-text-directive","data-directive":n.name,children:oe(n.children,o)},o);default:return null}})}function Ri(e,t){switch(e.type){case "paragraph":return l("p",{className:"squisq-md-p",children:oe(e.children,t)},t);case "heading":{let n=`h${e.depth}`;return l(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:oe(e.children,t)},t)}case "blockquote":return l("blockquote",{className:"squisq-md-blockquote",children:Re(e.children,t)},t);case "list":return e.ordered?l("ol",{className:"squisq-md-list squisq-md-ol",start:e.start??void 0,children:e.children.map((n,r)=>Hr(n,`${t}li${r}`))},t):l("ul",{className:"squisq-md-list squisq-md-ul",children:e.children.map((n,r)=>Hr(n,`${t}li${r}`))},t);case "code":return l("pre",{className:"squisq-md-code-block",children:l("code",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case "thematicBreak":return l("hr",{className:"squisq-md-hr"},t);case "table":return qi(e.children,e.align,t);case "htmlBlock":return l("div",{className:"squisq-md-html-block",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case "math":return l("pre",{className:"squisq-md-math-block",children:l("code",{children:e.value})},t);case "definition":return null;case "footnoteDefinition":return l("div",{className:"squisq-md-footnote-def",id:`fn-${e.identifier}`,children:[l("sup",{children:e.label??e.identifier}),Re(e.children,t)]},t);case "containerDirective":return l("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:[e.label&&l("div",{className:"squisq-md-directive-label",children:e.label}),Re(e.children,t)]},t);case "leafDirective":return l("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:oe(e.children,t)},t);case "definitionList":return l("dl",{className:"squisq-md-dl",children:e.children.map((n,r)=>n.type==="definitionTerm"?l("dt",{className:"squisq-md-dt",children:oe(n.children,`${t}dt${r}`)},`${t}dt${r}`):l("dd",{className:"squisq-md-dd",children:Re(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function Hr(e,t){let n=e.checked!==null&&e.checked!==void 0;return l("li",{className:`squisq-md-li${n?" squisq-md-task":""}`,children:[n&&l("input",{type:"checkbox",checked:!!e.checked,readOnly:true,className:"squisq-md-checkbox"}),Re(e.children,t)]},t)}function qi(e,t,n){let[r,...o]=e;return l("table",{className:"squisq-md-table",children:[r&&l("thead",{children:l("tr",{children:r.children.map((i,a)=>l("th",{className:"squisq-md-th",style:t?.[a]?{textAlign:t[a]}:void 0,children:oe(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&l("tbody",{children:o.map((i,a)=>l("tr",{children:i.children.map((s,c)=>l("td",{className:"squisq-md-td",style:t?.[c]?{textAlign:t[c]}:void 0,children:oe(s.children,`${n}td${a}-${c}`)},`${n}td${a}-${c}`))},`${n}tr${a}`))})]},n)}function Re(e,t=""){return e.map((n,r)=>Ri(n,`${t}b${r}`))}function gt({nodes:e,className:t}){return !e||e.length===0?null:l("div",{className:`squisq-md ${t||""}`,children:Re(e)})}function Ni(e){let t=e.sourceHeading?.templateAnnotation;return t?!!t.template&&jt(t.template):false}function Ur(e){let t=0;for(let n of e)t++,n.children&&(t+=Ur(n.children));return t}function Vr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=Ni(e),a=$(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,c=Se(e.sourceHeading),u=Di(e.contents),p={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:c,...zi(s.template??"sectionHeader",c,u,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=Xt(p,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return l("div",{className:"squisq-linear-section","data-block-id":e.id,"data-template":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&l(gt,{nodes:[e.sourceHeading]}),i&&a&&l("div",{className:"squisq-linear-card",children:[e.sourceHeading&&l("div",{className:"squisq-linear-card-label squisq-md",children:l(gt,{nodes:[e.sourceHeading]})}),l("div",{className:"squisq-linear-card-svg",style:{width:"100%",aspectRatio:`${n.width} / ${n.height}`,overflow:"hidden",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.12)",marginBottom:"1em"},children:l(Fe,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&l(gt,{nodes:e.contents}),e.children&&e.children.length>0&&l("div",{className:"squisq-linear-children",children:e.children.map((s,c)=>l(Vr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+c+1},s.id))})]})}function Di(e){return !e||e.length===0?"":e.map(t=>Se(t)).join(`
|
|
3
|
+
`).trim()}function $i(e){if(!e)return [];let t=[];for(let n of e)if(n.type==="list")for(let r of n.children){let o=Se(r).trim();o&&t.push(o);}return t}function zi(e,t,n,r){switch(e){case "statHighlight":return {stat:t,description:n||t};case "quoteBlock":case "fullBleedQuote":case "pullQuote":return {quote:n||t};case "factCard":return {fact:t,explanation:n||t};case "comparisonBar":return {leftLabel:"A",leftValue:60,rightLabel:"B",rightValue:40};case "listBlock":return {items:$i(r)||["Item 1","Item 2","Item 3"]};case "definitionCard":return {term:t,definition:n||t};case "dateEvent":return {date:t,description:n||t};default:return {}}}function yt({doc:e,basePath:t="/",viewport:n,className:r,theme:o}){let i=n??J.landscape,a=$(()=>Ur(e.blocks),[e.blocks]),s=$(()=>({theme:o??ue,viewport:i,totalBlocks:a}),[i,a,o]),c=o??ue,u=c.colors.background,p=c.colors.text,d=c.colors.textMuted,m=c.colors.primary,f=c.typography.bodyFontFamily,h=c.typography.titleFontFamily,g=c.typography.lineHeight??1.7;return l("div",{className:`squisq-linear ${r||""}`,style:{width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:u},children:l("div",{className:"squisq-linear-content squisq-md",style:{maxWidth:"720px",margin:"0 auto",padding:"24px 16px",lineHeight:g,fontSize:"16px",fontFamily:f,color:p,"--squisq-linear-title-font":h,"--squisq-linear-body-font":f,"--squisq-linear-text":p,"--squisq-linear-muted":d,"--squisq-linear-primary":m,"--squisq-linear-bg":u},children:[l("style",{children:`
|
|
4
|
+
.squisq-linear-content h1,
|
|
5
|
+
.squisq-linear-content h2,
|
|
6
|
+
.squisq-linear-content h3,
|
|
7
|
+
.squisq-linear-content h4,
|
|
8
|
+
.squisq-linear-content h5,
|
|
9
|
+
.squisq-linear-content h6 {
|
|
10
|
+
font-family: var(--squisq-linear-title-font);
|
|
11
|
+
color: var(--squisq-linear-text);
|
|
12
|
+
margin-top: 1.2em;
|
|
13
|
+
margin-bottom: 0.4em;
|
|
14
|
+
}
|
|
15
|
+
.squisq-linear-content h1 { font-size: 2em; }
|
|
16
|
+
.squisq-linear-content h2 { font-size: 1.5em; }
|
|
17
|
+
.squisq-linear-content h3 { font-size: 1.25em; }
|
|
18
|
+
.squisq-linear-content p {
|
|
19
|
+
margin-bottom: 0.75em;
|
|
20
|
+
}
|
|
21
|
+
.squisq-linear-content ul,
|
|
22
|
+
.squisq-linear-content ol {
|
|
23
|
+
padding-left: 2em;
|
|
24
|
+
margin-bottom: 0.75em;
|
|
25
|
+
}
|
|
26
|
+
.squisq-linear-content li {
|
|
27
|
+
margin-bottom: 0.3em;
|
|
28
|
+
}
|
|
29
|
+
.squisq-linear-content a {
|
|
30
|
+
color: var(--squisq-linear-primary);
|
|
31
|
+
}
|
|
32
|
+
.squisq-linear-content code {
|
|
33
|
+
color: var(--squisq-linear-primary);
|
|
34
|
+
font-size: 0.9em;
|
|
35
|
+
padding: 0.15em 0.3em;
|
|
36
|
+
border-radius: 3px;
|
|
37
|
+
background: rgba(128, 128, 128, 0.15);
|
|
38
|
+
}
|
|
39
|
+
.squisq-linear-content pre {
|
|
40
|
+
padding: 1em;
|
|
41
|
+
border-radius: 6px;
|
|
42
|
+
background: rgba(0, 0, 0, 0.2);
|
|
43
|
+
overflow-x: auto;
|
|
44
|
+
margin-bottom: 0.75em;
|
|
45
|
+
}
|
|
46
|
+
.squisq-linear-content pre code {
|
|
47
|
+
padding: 0;
|
|
48
|
+
background: none;
|
|
49
|
+
}
|
|
50
|
+
.squisq-linear-content blockquote {
|
|
51
|
+
border-left: 3px solid var(--squisq-linear-muted);
|
|
52
|
+
color: var(--squisq-linear-muted);
|
|
53
|
+
padding-left: 1em;
|
|
54
|
+
margin-left: 0;
|
|
55
|
+
margin-bottom: 0.75em;
|
|
56
|
+
}
|
|
57
|
+
.squisq-linear-content hr {
|
|
58
|
+
border: none;
|
|
59
|
+
border-top: 1px solid var(--squisq-linear-muted);
|
|
60
|
+
margin: 1.5em 0;
|
|
61
|
+
}
|
|
62
|
+
.squisq-linear-content strong {
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
}
|
|
65
|
+
.squisq-linear-content em {
|
|
66
|
+
font-style: italic;
|
|
67
|
+
}
|
|
68
|
+
`}),e.blocks.map((y,v)=>l(Vr,{block:y,basePath:t,viewport:i,renderContext:s,blockIndex:v},y.id))]})})}var Oi=new Set(["a","an","the","and","but","or","for","nor","on","at","to","in","of","by","is"]);function Yr(e){let t=new Map;for(let n of e.blocks)if(ne(n)&&n.template==="sectionHeader"&&"title"in n){let r=n.audioSegment;t.has(r)||t.set(r,n.title);}for(let n=0;n<e.audio.segments.length;n++)if(!t.has(n)){let r=e.audio.segments[n].name;if(r==="intro"||r.includes("intro"))t.set(n,"Introduction");else if(r==="flight-context"||r.includes("flight-context"))t.set(n,"Flight Context");else {let i=r.split("-").map((a,s)=>s===0||!Oi.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(" ");t.set(n,i);}}return t}function jr({script:e,basePath:t,renderMode:n=false,autoPlay:r=false,onEnded:o,onTimeUpdate:i,audioProvider:a,showControls:s=true,showScrubber:c=false,muted:u=false,captionsEnabled:p,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:f,isFullscreen:h=false,onFullscreenToggle:g,onBlockMarkers:y,forceViewport:v,displayMode:x="video",theme:S,captionStyle:T="standard"}){let M=x==="slideshow",P=x==="linear",N=U(null),q=U(null),[V,O]=H(null),ie=U(),{viewport:k,orientation:b}=zr(),_=v||(n?J.landscape:k),C=$(()=>typeof window>"u"?false:new URLSearchParams(window.location.search).get("debug")==="true",[]),F=Dr(N,e.audio,t),R=a||F,{currentTime:B,isPlaying:D,currentSegment:re,totalDuration:ae,isEnded:Qt,isReady:Jt,isAvailable:Gr,unavailableMessage:en,play:Ze,pause:Me,toggle:Ae,seekTo:se,skipToSegment:Xi,restart:tn}=R,_t=U(B);_t.current=B;let nn=U(ae);nn.current=ae;let rn=U(0),Kr=Z(w=>{if(n||M||P||w.target.closest("button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow"))return;Ae(),O(D?"play":"pause"),clearTimeout(ie.current),ie.current=setTimeout(()=>O(null),600);},[n,Ae,D,M,P]),{currentBlock:ke,currentBlockIndex:ge,previousBlock:on,isEntering:Qr,isExiting:Jr,blockTime:xt,docProgress:vt,blocks:j}=$r(e,B,_,n,S),ye=$(()=>{let w=e.startBlock;if(!w)return null;let A=he(S??ue,0,1,_);return {id:"cover-block",startTime:-1,duration:0,audioSegment:-1,layers:Vt(w,A)}},[e.startBlock,_,S]),[eo,an]=H(false),[to,sn]=H(false),ln=U(),kt=U(false);ye&&!D&&B===0&&!n&&!r&&(kt.current=true),z(()=>{if(D&&kt.current&&ye&&!n)return kt.current=false,sn(true),ln.current=setTimeout(()=>sn(false),3e3),()=>clearTimeout(ln.current)},[D,ye,n]);let Ge=!M&&!P&&ye&&(eo||to||!D&&B===0&&!n&&!r),cn=U(false);z(()=>{Jt&&r&&!cn.current&&(cn.current=true,Ze());},[Jt,r,Ze]),z(()=>{i?.(B);},[B,i]),z(()=>{Qt&&o?.();},[Qt,o]),z(()=>{if((n||C)&&typeof window<"u"){let w=window;w.seekTo=A=>(se(A),new Promise(W=>{requestAnimationFrame(()=>{let Q=0;for(let fe=j.length-1;fe>=0;fe--)if(A>=j[fe].startTime){Q=j[fe].startTime;break}let mn=(A-Q)*1e3;document.getAnimations().forEach(fe=>{let De=fe.effect?.target;De&&(De.closest(".doc-player__block--active")||De.closest(".doc-player__block--previous"))&&(fe.currentTime=Math.max(0,mn));});let oo=A-Q,hn=[],gn=document.querySelector(".doc-player__block--active");gn&&gn.querySelectorAll("video[data-clip-start]").forEach(De=>{let Le=De,io=parseFloat(Le.dataset.clipStart||"0"),ao=parseFloat(Le.dataset.clipEnd||"0"),yn=Math.min(io+Math.max(0,oo),ao);Le.pause(),Le.currentTime=yn,hn.push(new Promise(St=>{Math.abs(Le.currentTime-yn)<.1?St():(Le.addEventListener("seeked",()=>St(),{once:true}),setTimeout(St,200));}));}),Promise.all(hn).then(()=>{requestAnimationFrame(()=>W());});});})),w.getDuration=()=>{if(ae>0)return ae;if(j.length>0){let A=j[j.length-1];return A.startTime+A.duration}return 0},w.getBlocks=()=>j.map(A=>({id:A.id,template:A.template??"raw",startTime:A.startTime,duration:A.duration})),w.getAudioSegments=()=>e.audio.segments.map(A=>({src:A.src,name:A.name,duration:A.duration,startTime:A.startTime})),w.getCaptions=()=>e.captions?.phrases?.map(A=>({text:A.text,startTime:A.startTime,endTime:A.endTime}))||[],w.getChapters=()=>{let A=Yr(e);return e.audio.segments.map((W,Q)=>({title:A.get(Q)||W.name,startTime:W.startTime,duration:W.duration}))},w.showCover=()=>(an(true),new Promise(A=>requestAnimationFrame(()=>A()))),w.hideCover=()=>(an(false),new Promise(A=>requestAnimationFrame(()=>A()))),w.hasCoverBlock=()=>!!ye;}return ()=>{if(typeof window<"u"){let w=window;delete w.seekTo,delete w.getDuration,delete w.getBlocks,delete w.getAudioSegments,delete w.getCaptions,delete w.getChapters,delete w.showCover,delete w.hideCover,delete w.hasCoverBlock;}}},[n,C,se,ae,j,ye]);let no=p===false?"off":T||"standard",[Ke,un]=H(no),we=Ke!=="off",ro=Ke==="social"?"social":"standard",dn=Z(w=>{un(w?T||"standard":"off"),d?.(w);},[d,T]),fn=Z(()=>{un(w=>{let A=w==="off"?"standard":w==="standard"?"social":"off";return d?.(A!=="off"),A});},[d]),Qe=e.captions&&e.captions.phrases.length>0,pn=$(()=>Yr(e),[e]),qe=$(()=>({isPlaying:D,currentTime:B,totalDuration:ae,currentBlockIndex:ge,totalBlocks:j.length,docProgress:vt,hasCaptions:!!Qe,captionsEnabled:we,captionMode:Ke,isFullscreen:h,currentSegmentIndex:re,currentSegmentName:pn.get(re)??e.audio.segments[re]?.name??null,currentBlock:ke??null}),[D,B,ae,ge,j.length,vt,Qe,we,Ke,h,re,pn,ke]),Je=$(()=>({toggle:Ae,restart:tn,seekTo:se,setCaptionsEnabled:dn,cycleCaptionMode:fn,toggleFullscreen:g}),[Ae,tn,se,dn,fn,g]),Ie=$(()=>({nextSlide:()=>{if(ge<j.length-1){let w=j[ge+1];w&&(se(w.startTime),Me());}},prevSlide:()=>{if(ge>0){let w=j[ge-1];w&&(se(w.startTime),Me());}},goToSlide:w=>{if(w>=0&&w<j.length){let A=j[w];A&&(se(A.startTime),Me());}}}),[ge,j,se,Me]);z(()=>{m?.(qe);},[qe,m]),z(()=>{f?.({play:Ze,pause:Me,...Je});},[Ze,Me,Je,f]);let et=Z(w=>{let A=w;if(ne(A)){let W=A;if(typeof W.title=="string")return W.title;if(typeof W.stat=="string")return W.stat;if(typeof W.quote=="string"){let Q=W.quote.split(`
|
|
69
|
+
`)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}if(typeof W.date=="string")return W.date;if(typeof W.fact=="string")return W.fact}if(w.layers&&Array.isArray(w.layers)){let W=w.layers.find(Q=>Q.type==="text");if(W?.content?.text){let Q=W.content.text.split(`
|
|
70
|
+
`)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}}return w.id.replace(/-/g," ").replace(/\b\w/g,W=>W.toUpperCase())},[]),Ne=$(()=>{if(!ae||!j.length)return [];let w=-1;return j.map((A,W)=>{let Q=A.audioSegment!==w;return w=A.audioSegment,{block:A,index:W,position:A.startTime/ae*100,title:et(A),isSectionStart:Q}})},[j,ae,et]);z(()=>{Ne.length>0&&y?.(Ne);},[Ne,y]),rn.current=j.length;let wt=Z(w=>{let A=document.activeElement;if(!(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.tagName==="SELECT"))&&!P)if(M)switch(w.key){case "ArrowRight":case "ArrowDown":case " ":w.preventDefault(),Ie.nextSlide();break;case "ArrowLeft":case "ArrowUp":w.preventDefault(),Ie.prevSlide();break;case "Home":w.preventDefault(),Ie.goToSlide(0);break;case "End":w.preventDefault(),Ie.goToSlide(rn.current-1);break}else switch(w.key){case " ":w.preventDefault(),Ae();break;case "ArrowRight":se(Math.min(_t.current+10,nn.current));break;case "ArrowLeft":se(Math.max(_t.current-10,0));break}},[M,P,Ae,se,Ie]);return z(()=>{if(!n)return window.addEventListener("keydown",wt),()=>window.removeEventListener("keydown",wt)},[wt,n]),P?l("div",{ref:q,className:"doc-player doc-player--linear",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:l(yt,{doc:e,basePath:t,viewport:_})}):l("div",{ref:q,className:"doc-player",onClick:Kr,style:{position:"relative",width:"100%",aspectRatio:`${_.width} / ${_.height}`,margin:"0 auto",overflow:"hidden",cursor:n?void 0:"pointer"},children:[l("audio",{ref:N,preload:"auto",muted:u}),l("div",{className:"doc-player__viewport",children:[Ge&&ye&&l("div",{className:"doc-player__block doc-player__block--cover",children:l(Fe,{block:ye,blockTime:0,basePath:t,isEntering:false,viewport:_})}),!Ge&&on&&Jr&&l("div",{className:"doc-player__block doc-player__block--previous",children:l(Fe,{block:on,blockTime:xt,basePath:t,isExiting:true,viewport:_})}),!Ge&&ke&&l("div",{className:"doc-player__block doc-player__block--active",children:l(Fe,{block:ke,blockTime:xt,basePath:t,isEntering:Qr,viewport:_,isPlaying:D})}),Qe&&(n?we:true)&&l(Nr,{captions:e.captions,currentTime:B,enabled:we&&(n||D||B>0),fontSize:16,captionStyle:ro,theme:S,viewport:_}),C&&l("div",{className:"doc-player__debug",style:{position:"absolute",top:"8px",right:"8px",padding:"8px 12px",background:"rgba(0, 0, 0, 0.85)",borderRadius:"6px",color:"#00ff00",fontFamily:"monospace",fontSize:"11px",lineHeight:"1.5",zIndex:200,maxWidth:"280px",pointerEvents:"none",textAlign:"left"},children:[l("div",{style:{color:"#ffcc00",fontWeight:"bold",marginBottom:"4px"},children:"DEBUG MODE"}),l("div",{children:[l("span",{style:{color:"#888"},children:"template:"})," ",l("span",{style:{color:"#ff6b6b"},children:ke?.template??"raw"})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"block:"})," ",ge+1,"/",j.length," ",l("span",{style:{color:"#666"},children:["(",ke?.id||"none",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"time:"})," ",B.toFixed(2),"s /"," ",ae.toFixed(1),"s"," ",l("span",{style:{color:"#666"},children:["(progress: ",(vt*100).toFixed(1),"%, scriptDur:"," ",e.duration.toFixed(1),")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"blockTime:"})," ",xt.toFixed(2),"s /"," ",(ke?.duration||0).toFixed(1),"s"]}),l("div",{children:[l("span",{style:{color:"#888"},children:"segment:"})," ",re,"/",e.audio.segments.length-1," ",l("span",{style:{color:"#666"},children:["(",e.audio.segments[re]?.name||"none",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"viewport:"})," ",_.name||`${_.width}x${_.height}`," ",l("span",{style:{color:"#666"},children:["(",b,")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"playing:"})," ",l("span",{style:{color:D?"#4ade80":"#f87171"},children:D?"yes":"no"}),Ge&&l("span",{style:{color:"#60a5fa"},children:" (cover)"})]}),Qe&&(()=>{let w=We(e.captions,B),A=we&&(D||B>0);return l(te,{children:[l("div",{children:[l("span",{style:{color:"#888"},children:"captions:"})," ",e.captions?.phrases.length||0," phrases"," ",l("span",{style:{color:we?"#4ade80":"#666"},children:["(",we?"on":"off",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"cc.enabled:"})," ",l("span",{style:{color:A?"#4ade80":"#f87171"},children:String(A)})," ",l("span",{style:{color:"#666"},children:["(playing=",String(D)," t>0=",String(B>0),")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"cc.phrase:"})," ",l("span",{style:{color:w?"#4ade80":"#f87171"},children:w?`"${w.text.slice(0,30)}..."`:"null"})]}),w&&l("div",{children:[l("span",{style:{color:"#888"},children:"cc.range:"})," ",l("span",{style:{color:"#60a5fa"},children:[w.startTime.toFixed(2),"-",w.endTime.toFixed(2)]})]})]})})()]})]}),!Gr&&en&&l("div",{className:"doc-player__unavailable",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"16px",background:"rgba(0, 0, 0, 0.7)",color:"rgba(255, 255, 255, 0.9)",fontSize:"14px",zIndex:50},children:[l("span",{style:{fontSize:"32px"},children:"\u{1F50A}"}),l("span",{children:en})]}),!n&&!M&&s&&l(Or,{state:qe,actions:Je,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:et}),!n&&!M&&!s&&c&&l("div",{className:"doc-player__scrubber",style:{position:"absolute",bottom:0,left:0,right:0,padding:"12px 16px 8px",background:"linear-gradient(transparent, rgba(0,0,0,0.6))",display:"flex",alignItems:"center",zIndex:100},children:l(ht,{state:qe,actions:Je,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:et})}),!n&&M&&l(Wr,{state:qe,slideNav:Ie}),!M&&V&&l("div",{className:"doc-player__tap-feedback",children:l("svg",{viewBox:"0 0 24 24",fill:"white",width:"48",height:"48",children:V==="pause"?l("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}):l("path",{d:"M8 5v14l11-7z"})})},Date.now())]})}var Xr={};var Zr=false;function Hi(){if(Zr||typeof document>"u")return;let e=document.createElement("style");e.setAttribute("data-squisq-player","animations"),e.textContent=Xr,document.head.appendChild(e),Zr=true;}function Ui(e,t){return {async resolveUrl(n){return n in e?e[n]:n.startsWith("http")||n.startsWith("data:")||n.startsWith("blob:")?n:`${t}/${n}`},async listMedia(){return Object.keys(e).map(n=>({name:n,mimeType:Vi(n),size:0}))},async addMedia(){throw new Error("Standalone player is read-only")},async removeMedia(){throw new Error("Standalone player is read-only")},dispose(){}}}function Vi(e){let t=e.split(".").pop()?.toLowerCase()??"";return {jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp3:"audio/mpeg",mp4:"video/mp4",webm:"video/webm"}[t]??"application/octet-stream"}function Yi(e,t){if(!e.audio?.segments?.length)return e;let n=e.audio.segments.map(r=>{let o=t[r.name]??t[r.src]??r.src;return {...r,src:o}});return {...e,audio:{...e.audio,segments:n}}}var bt=new WeakMap;function ji(e,t,n={}){Hi();let{mode:r="slideshow",basePath:o=".",images:i,audio:a,autoPlay:s=false,theme:c,renderMode:u=false,captionStyle:p}=n,d=a?Yi(t,a):t,m=i?Ui(i,o):null,f;r==="static"?f=me(yt,{doc:d,basePath:o,theme:c}):f=me(jr,{script:d,basePath:o,displayMode:"slideshow",autoPlay:u?false:s,showControls:!u,renderMode:u,theme:c,captionsEnabled:!!p,captionStyle:p??"standard"}),m&&(f=me(Zt.Provider,{value:m},f));let h=bt.get(e);h||(h=ir(e),bt.set(e,h)),h.render(f);}function xc(e,t,n={}){ji(e,t,{...n,mode:"static"});}function vc(e){let t=bt.get(e);t&&(t.unmount(),bt.delete(e));}var kc="1.0.2";exports.mount=ji;exports.mountStatic=xc;exports.unmount=vc;exports.version=kc;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map
|
|
6
71
|
//# sourceMappingURL=squisq-player.global.js.map
|