@bendyline/squisq-react 1.1.1 → 1.2.0

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.
Files changed (46) hide show
  1. package/dist/DocPlayer.d.ts +9 -2
  2. package/dist/DocPlayer.d.ts.map +1 -1
  3. package/dist/DocPlayer.js +33 -9
  4. package/dist/DocPlayer.js.map +1 -1
  5. package/dist/LinearDocView.d.ts +28 -2
  6. package/dist/LinearDocView.d.ts.map +1 -1
  7. package/dist/LinearDocView.js +46 -14
  8. package/dist/LinearDocView.js.map +1 -1
  9. package/dist/MarkdownRenderer.d.ts.map +1 -1
  10. package/dist/MarkdownRenderer.js +20 -3
  11. package/dist/MarkdownRenderer.js.map +1 -1
  12. package/dist/__tests__/LinearDocView.test.js +28 -0
  13. package/dist/__tests__/LinearDocView.test.js.map +1 -1
  14. package/dist/hooks/useAutoSurface.d.ts +11 -0
  15. package/dist/hooks/useAutoSurface.d.ts.map +1 -0
  16. package/dist/hooks/useAutoSurface.js +24 -0
  17. package/dist/hooks/useAutoSurface.js.map +1 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/layers/ImageLayer.js +6 -6
  22. package/dist/layers/ImageLayer.js.map +1 -1
  23. package/dist/layers/ShapeLayer.js +2 -2
  24. package/dist/layers/ShapeLayer.js.map +1 -1
  25. package/dist/layers/TableLayer.js +2 -2
  26. package/dist/layers/TableLayer.js.map +1 -1
  27. package/dist/layers/VideoLayer.js +2 -2
  28. package/dist/layers/VideoLayer.js.map +1 -1
  29. package/dist/squisq-player.global.js +24 -6
  30. package/dist/squisq-player.global.js.map +1 -1
  31. package/dist/standalone-entry.d.ts.map +1 -1
  32. package/dist/standalone-entry.js +14 -1
  33. package/dist/standalone-entry.js.map +1 -1
  34. package/dist/standalone-source.js +1 -1
  35. package/package.json +6 -6
  36. package/src/DocPlayer.tsx +51 -9
  37. package/src/LinearDocView.tsx +73 -15
  38. package/src/MarkdownRenderer.tsx +43 -9
  39. package/src/__tests__/LinearDocView.test.tsx +35 -0
  40. package/src/hooks/useAutoSurface.ts +33 -0
  41. package/src/index.ts +1 -0
  42. package/src/layers/ImageLayer.tsx +6 -6
  43. package/src/layers/ShapeLayer.tsx +2 -2
  44. package/src/layers/TableLayer.tsx +2 -2
  45. package/src/layers/VideoLayer.tsx +2 -2
  46. package/src/standalone-entry.tsx +13 -1
@@ -1,6 +1,9 @@
1
- var SquisqPlayer=(function(exports){'use strict';var st,B,vn,ve,bn,kn,wn,Sn,Lt,Tt,Ct,Tn,ot={},it=[],uo=/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 It(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?st.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 rt(e,a,r,o,null)}function rt(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&&B.vnode!=null&&B.vnode(i),i}function te(e){return e.children}function ce(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 fo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=pe({},t);i.__v=t.__v+1,B.vnode&&B.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,Ln(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)&&ve.push(e)&&!at.__r++||bn!=B.debounceRendering)&&((bn=B.debounceRendering)||kn)(at);}function at(){try{for(var e,t=1;ve.length;)ve.length>t&&ve.sort(wn),e=ve.shift(),t=ve.length,fo(e);}finally{ve.length=at.__r=0;}}function Mn(e,t,n,r,o,i,a,s,u,c,p){var d,m,f,h,g,y,v,x=r&&r.__k||it,S=t.length;for(u=po(n,t,x,u,S),d=0;d<S;d++)(f=n.__k[d])!=null&&(m=f.__i!=-1&&x[f.__i]||ot,f.__i=d,y=Pt(e,f,m,o,i,a,s,u,c,p),h=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Bt(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?u=An(f,u,e,v):typeof f.type=="function"&&y!==void 0?u=y:h&&(u=h.nextSibling),f.__u&=-7);return n.__e=g,u}function po(e,t,n,r,o){var i,a,s,u,c,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]=rt(null,a,null,null,null):$e(a)?a=e.__k[i]=rt(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=rt(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=mo(a,n,u,d))!=-1&&(d--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>p?m--:o<p&&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<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 mo(e,t,n,r){var o,i,a,s=e.key,u=e.type,c=t[n],p=c!=null&&(2&c.__u)==0;if(c===null&&s==null||p&&s==c.key&&u==c.type)return n;if(r>(p?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 _n(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||uo.test(t)?n:n+"px";}function nt(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=Lt,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=Lt++;else if(t.t<n.u)return;return n(B.event?B.event(t):t)}}}function Pt(e,t,n,r,o,i,a,s,u,c){var p,d,m,f,h,g,y,v,x,S,w,C,P,R,N,Y=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=B.__b)&&p(t);e:if(typeof Y=="function")try{if(v=t.props,x=Y.prototype&&Y.prototype.render,S=(p=Y.contextType)&&r[p.__c],w=p?S?S.props.value:p.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:(x?t.__c=d=new Y(v,w):(t.__c=d=new ce(v,w),d.constructor=Y,d.render=go),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&&Y.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=pe({},d.__s)),pe(d.__s,Y.getDerivedStateFromProps(v,d.__s))),f=d.props,h=d.state,d.__v=t,m)x&&Y.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(x&&Y.getDerivedStateFromProps==null&&v!==f&&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(W){W&&(W.__=t);}),it.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),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,h,g);});}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,C=B.__r,P=0,x)d.state=d.__s,d.__d=!1,C&&C(t),p=d.render(d.props,d.state,d.context),it.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,C&&C(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)),R=p!=null&&p.type===te&&p.key==null?In(p.props.children):p,s=Mn(e,$e(R)?R:[R],t,n,r,o,i,a,s,u,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null);}catch(W){if(t.__v=null,u||i!=null)if(W.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--;)It(i[N]);At(t);}else t.__e=n.__e,t.__k=n.__k,W.then||At(t);B.__e(W,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ho(n.__e,t,n,r,o,i,a,u,c);return (p=B.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 Ln(e,t,n){for(var r=0;r<n.length;r++)Bt(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 In(e){return typeof e!="object"||e==null||e.__b>0?e:$e(e)?e.map(In):pe({},e)}function ho(e,t,n,r,o,i,a,s,u){var c,p,d,m,f,h,g,y=n.props||ot,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(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,i[c]=null;break}}if(e==null){if(x==null)return document.createTextNode(v);e=document.createElementNS(o,x,v.is&&v),s&&(B.__m&&B.__m(t,i),s=false),i=null;}if(x==null)y===v||s&&e.data==v||(e.data=v);else {if(i=i&&st.call(e.childNodes),!s&&i!=null)for(y={},c=0;c<e.attributes.length;c++)y[(f=e.attributes[c]).name]=f.value;for(c in y)f=y[c],c=="dangerouslySetInnerHTML"?d=f:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||nt(e,c,null,f,o);for(c in v)f=v[c],c=="children"?m=f:c=="dangerouslySetInnerHTML"?p=f:c=="value"?h=f:c=="checked"?g=f:s&&typeof f!="function"||y[c]===f||nt(e,c,f,y[c],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,u),i!=null)for(c=i.length;c--;)It(i[c]);s||(c="value",x=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[c]||x=="progress"&&!h||x=="option"&&h!=y[c])&&nt(e,c,h,y[c],o),c="checked",g!=null&&g!=e[c]&&nt(e,c,g,y[c],o));}return e}function Bt(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 Pn(e,t,n){var r,o;if(B.unmount&&B.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Bt(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]&&Pn(r[o],t,n||typeof e.type!="function");n||It(e.__e),e.__c=e.__=e.__e=void 0;}function go(e,t,n){return this.constructor(e,n)}function Et(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=[],Pt(t,e=(t).__k=me(te,null,[e]),o||ot,ot,t.namespaceURI,o?null:t.firstChild?st.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),Ln(i,e,a);}function lt(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}st=it.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}},vn=0,ce.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));},ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),Mt(this));},ce.prototype.render=te,ve=[],kn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wn=function(e,t){return e.__v.__b-t.__v.__b},at.__r=0,Sn=/(PointerCapture)$|Capture$/i,Lt=0,Tt=xn(false),Ct=xn(true),Tn=0;var Be,X,Ft,Bn,Oe=0,zn=[],G=B,En=G.__b,Fn=G.__r,Rn=G.diffed,qn=G.__c,Nn=G.unmount,Dn=G.__;function ut(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 U(e){return Oe=1,On(Hn,e)}function On(e,t,n){var r=ut(Be++,2);if(r.t=e,!r.__c&&(r.__=[Hn(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=X,!X.__f)){var o=function(s,u,c){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,u,c);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,u,c)||d};X.__f=true;var i=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(s,u,c){if(this.__e){var p=i;i=void 0,o(s,u,c),i=p;}a&&a.call(this,s,u,c);},X.shouldComponentUpdate=o;}return r.__N||r.__}function z(e,t){var n=ut(Be++,3);!G.__s&&Wn(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n));}function V(e){return Oe=5,$(function(){return {current:e}},[])}function $(e,t){var n=ut(Be++,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=ut(Be++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(X)),t.props.value):e.__}function yo(){for(var e;e=zn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ct),t.__h.some(Rt),t.__h=[];}catch(n){t.__h=[],G.__e(n,e.__v);}}}G.__b=function(e){X=null,En&&En(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),Be=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(ct),t.__h.some(Rt),t.__h=[],Be=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&&Bn===G.requestAnimationFrame||((Bn=G.requestAnimationFrame)||bo)(yo)),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(ct),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{ct(r);}catch(o){t=o;}}),n.__H=void 0,t&&G.__e(t,n.__v));};var $n=typeof requestAnimationFrame=="function";function bo(e){var t,n=function(){clearTimeout(r),$n&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);$n&&(t=requestAnimationFrame(n));}function ct(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 xo(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 ce).isPureReactComponent=true,Vn.prototype.shouldComponentUpdate=function(e,t){return Un(this.props,e)||Un(this.state,t)};var Yn=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Yn&&Yn(e);};var vo=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)}vo(e,t,n,r);};var jn=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=xo({},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 dt(){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),jn&&jn(e);},(Nt.prototype=new ce).__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(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]=er(c,c.__c.__P,c.__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];}};(dt.prototype=new ce).__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();}},dt.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},dt.prototype.componentDidUpdate=dt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xn(e,n,t);});};var ko=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,wo=/^(?: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]/,So=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,To=/[A-Z0-9]/g,Co=typeof document<"u",Mo=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=""),Et(e,t),e?e.__c:null}ce.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ce.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=B.event;B.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 Ao={configurable:true,get:function(){return this.class}},Gn=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||Co&&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"||Mo(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":So.test(a)&&(a=u):u=a="oninput":i&&wo.test(a)?a=a.replace(To,"-$&").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=ze(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1;})),o.defaultValue!=null&&(o.value=ze(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",Ao)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=ko,Gn&&Gn(e);};var Kn=B.__r;B.__r=function(e){Kn&&Kn(e),e.__c;};var Qn=B.diffed;B.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&&(Et(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 Lo='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Io='Georgia, "Times New Roman", serif',Po='Consolas, "Courier New", monospace';var Bo={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"}},Eo={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:Lo,titleFontFamily:Io,monoFontFamily:Po,titleWeight:"bold"},style:{textShadow:true,overlayOpacity:.45,animationSpeed:1},renderStyle:{name:"standard",defaultTextAnimation:"fadeIn",defaultImageAnimation:"slowZoom",ambientMotion:true,defaultTransition:{type:"fade",duration:.7}},colorSchemes:Bo,persistentLayers:{bottomLayers:[{template:"gradientBackground",config:{type:"gradientBackground",preset:"dark-vignette"}}]}};var he=Eo;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 Fo=Math.sqrt(1920*1920+1080*1080);function $t(e){return Math.sqrt(e.width*e.width+e.height*e.height)/Fo}function zt(e){let t=e.width/e.height;return Math.abs(t-1)<.05?"square":t>1?"landscape":"portrait"}var Ro={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 Ro[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 ft(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 ge(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 I(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 ye(e){return "value"in e&&typeof e.value=="string"?e.value:sr(e).map(ye).join("")}var zo={"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 Oo(e){return {type:"shape",id:"persistent-bg-solid",content:{shape:"rect",fill:e.color},position:{x:0,y:0,width:"100%",height:"100%"}}}function Wo(e){return {type:"shape",id:"persistent-bg-gradient",content:{shape:"rect",fill:e.gradient??zo[e.preset??"dark-vignette"]},position:{x:0,y:0,width:"100%",height:"100%"}}}function Ho(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 Uo(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 Vo(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%",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:c,y:u,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 Yo(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 jo(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 Xo(e){if(!Wt(e))return [e];let n=e.config;switch(n.type){case "solidBackground":return [Oo(n)];case "gradientBackground":return [Wo(n)];case "imageBackground":return Ho(n);case "patternBackground":return [Uo(n)];case "titleCaption":return Vo(n);case "cornerBranding":return [Yo(n)];case "progressIndicator":return [jo(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(Xo(n)),[])}var Zo={bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"};function be(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]]:Zo}var Go='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ko='Georgia, "Times New Roman", serif',Qo='Consolas, "Courier New", monospace';function L(e,t){let{typography:n}=e.theme;switch(t){case "title":return n.titleFontFamily||Ko;case "body":return n.bodyFontFamily||Go;case "mono":return n.monoFontFamily||Qo}}function ur(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=I(96,t,true),u=I(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:L(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:u,fontFamily:L(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,u=be(t,r),c=I(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:u.bg},position:{x:0,y:0,width:"100%",height:"100%"}}),p.push({type:"shape",id:"line-top",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"40%",width:"20%",height:"2px",anchor:"center"}}),p.push({type:"shape",id:"line-bottom",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"60%",width:"20%",height:"2px",anchor:"center"}})),p.push({type:"text",id:"title",content:{text:n,style:{fontSize:c,fontFamily:L(t,"title"),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}}),p}var Jo=/^(\d+(?:\.\d+)?)\s*%?$/,ke={textCenterX:"50%",textWidth:"85%",textYAdjust:0,adjustY:false};function Ee(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 ue=35,fr=`${ue}%`;function Te(e){switch(e){case "left-strip":return {textCenterX:`${50+ue/2}%`,textWidth:`${100-ue-8}%`,textYAdjust:0,adjustY:false};case "right-strip":return {textCenterX:`${50-ue/2}%`,textWidth:`${100-ue-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 ke}}function Ce(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case "left-strip":n.push(lr(r,o,"left",t,a,s,u)),n.push(cr("left",t));break;case "right-strip":n.push(lr(r,o,"right",t,a,s,u)),n.push(cr("right",t));break;case "bottom-strip":n.push(ei(r,o,t,a,s,u)),n.push(ti(t));break;case "corner-inset":n.push(ni(r,o,t,a,s,u)),n.push(ri(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-ue}%`,y:0,width:fr,height:"100%"},animation:Ee(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"?`${ue-8}%`:`${100-ue}%`,y:0,width:"10%",height:"100%"}}}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:0,y:`${100-ue}%`,width:"100%",height:fr},animation:Ee(r,15)}}function ti(e){return {type:"shape",id:`${e}-accent-fade`,content:{shape:"rect",fill:"url(#accent-gradient-bottom)"},position:{x:0,y:`${100-ue-8}%`,width:"100%",height:"12%"}}}function ni(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:Ee(r,15)??{type:"fadeIn",duration:2,delay:.5}}}function ri(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(Jo);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var oi=/[.;:!?]+$/;function Ut(e){return e.replace(oi,"").trim()}function Ye(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,u=be(t,i),c=a?Te(a.position):ke,p=I(148,t,true),d=I(32,t,false),m=I(26,t,false),f=[Ye("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:L(t,"title"),fontWeight:"bold",color:u.text,shadow:!!a}},position:{x:c.textCenterX,y:K("32%",c),anchor:"center"},animation:{type:"zoomIn",duration:.6}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:L(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.6,shadow:!!a}},position:{x:c.textCenterX,y:K("58%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.3}}),o&&f.push({type:"text",id:"detail",content:{text:o,style:{fontSize:m,fontFamily:L(t,"body"),color:u.accent,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:K("75%",c),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):ke,u=I(48,t,true),c=I(24,t,false),p=I(280,t,true),d=[Ye("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:L(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:u,fontFamily:L(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:c,fontFamily:L(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):ke,u=I(56,t,true),c=I(32,t,false),p=I(20,t,false),d=[Ye("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:u,fontFamily:L(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:c,fontFamily:L(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:L(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:u,orientation:c}=t,p=be(t,i),d=be(t,a),m=ft(c),f=u.stackColumns,h=f?"85%":"42%",g=I(32,t,false),y=I(44,t,true),v=I(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:L(t,"title"),color:s.colors.textMuted,textAlign:"center"}},position:{x:"50%",y:S,anchor:"center"},animation:{type:"fadeIn",duration:.8}});let w,C,P,R;if(f)w=o?"30%":"25%",C=o?"40%":"35%",P=o?"60%":"55%",R=o?"70%":"65%";else {let ae=o?"47%":"45%",k=o?"58%":"56%";w=ae,C=k,P=ae,R=k;}x.push({type:"text",id:"left-label",content:{text:n.label,style:{fontSize:y,fontFamily:L(t,"body"),fontWeight:"bold",color:p.text,textAlign:"center",lineHeight:1.3}},position:{x:m.left.x,y:w,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:L(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.left.x,y:C,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.3}});let N=I(120,t,true),Y=f?"48%":"50%",W=f?"\u2193":"\u2192";return x.push({type:"text",id:"connector",content:{text:W,style:{fontSize:N,fontFamily:L(t,"title"),fontWeight:"bold",color:"rgba(255, 255, 255, 0.6)",textAlign:"center"}},position:{x:"50%",y:Y,anchor:"center"},animation:{type:"fadeIn",duration:.6,delay:.4}}),x.push({type:"text",id:"right-label",content:{text:r.label,style:{fontSize:y,fontFamily:L(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:L(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.right.x,y:R,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.8}}),x}var ii={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,u=ii[i],c=a?Te(a.position):ke,p=I(96,t,true),d=I(30,t,false),m=I(26,t,false),f=[{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&&f.push(...Ce(a,e.id)),f.push({type:"text",id:"date",content:{text:n,style:{fontSize:p,fontFamily:L(t,"title"),fontWeight:"bold",color:u.date,shadow:!!a}},position:{x:c.textCenterX,y:K("35%",c),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"text",id:"description",content:{text:r,style:{fontSize:d,fontFamily:L(t,"body"),color:u.text,textAlign:"center",lineHeight:1.8,shadow:!!a}},position:{x:c.textCenterX,y:K("58%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:2,delay:1}}),o&&f.push({type:"text",id:"footer",content:{text:o,style:{fontSize:m,fontFamily:L(t,"body"),color:s.colors.textMuted,shadow:!!a}},position:{x:c.textCenterX,y:K("82%",c),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:u,imageCredit:c,imageLicense:p}=e,d=o&&Ut(o),{theme:m,layout:f}=t,h=I(36,t,false),g=I(96,t,true),y=I(36,t,false),v=e.kenBurns,S=Ee(a||v),w=[{type:"image",id:"bg-image",content:{src:n,alt:r,fit:"cover",credit:c,license:p},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:g,fontFamily:L(t,"title"),fontWeight:"bold",color:m.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:u?"70%":"75%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),u&&w.push({type:"text",id:"subtitle",content:{text:u,style:{fontSize:y,fontFamily:L(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}}),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:h,fontFamily:L(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}})),w)}function _r(e,t){let{center:n,zoom:r,mapStyle:o="terrain",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:c}=e,{theme:p,layout:d}=t,m=I(64,t,true),f=I(32,t,false),h=Ee(u),g=[{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: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:L(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:L(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=be(t,r),a=I(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:L(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):ke,s=I(44,t,true),u=I(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(...Ce(o,e.id));let p=r?30:22;r&&c.push({type:"text",id:"list-title",content:{text:r,style:{fontSize:s,fontFamily:L(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]}`;c.push({type:"text",id:`item-${f}`,content:{text:g,style:{fontSize:u,fontFamily:L(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 c}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,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,p=100-c,d=ai(n.length,p,s.stackColumns),m=I(24,t,false);for(let f=0;f<Math.min(n.length,4);f++){let h=n[f],g=d[f];u.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&&u.push({type:"text",id:`grid-alt-${f}`,content:{text:h.alt,style:{fontSize:m,fontFamily:L(t,"body"),color:a.colors.textMuted,textAlign:"center"}},position:{x:`${g.x+g.w/2}%`,y:`${g.y+g.h/2}%`,anchor:"center"}}),u.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=I(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:`${p-4}%`,width:"100%",height:`${c+4}%`}}),u.push({type:"text",id:"caption",content:{text:i,style:{fontSize:f,fontFamily:L(t,"body"),color:a.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:`${p+(s.stackColumns?c/2:c*.3)}%`,anchor:"center",width:"90%"},animation:{type:"fadeIn",duration:1,delay:.5}});}return u}function ai(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,u=be(t,i),c=a?Te(a.position):ke,p=I(72,t,true),d=I(32,t,false),m=I(22,t,false),f=[Ye("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:L(t,"title"),fontWeight:"bold",color:u.text,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:K("30%",c),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"shape",id:"separator",content:{shape:"rect",fill:`${u.text}33`},position:{x:c.textCenterX,y:K("42%",c),width:"30%",height:"2px",anchor:"center"}}),f.push({type:"text",id:"definition",content:{text:r,style:{fontSize:d,fontFamily:L(t,"body"),color:s.colors.text,textAlign:"center",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:c.textCenterX,y:K("55%",c),width:c.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1,delay:.8}}),o&&f.push({type:"text",id:"origin",content:{text:o,style:{fontSize:m,fontFamily:L(t,"body"),color:s.colors.textMuted,textAlign:"center",shadow:!!a}},position:{x:c.textCenterX,y:K("78%",c),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:u}=t,c=be(t,s),p=I(28,t,false),d=I(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,w=R=>R>=1e6?`${(R/1e6).toFixed(1)}M`:R>=1e3?`${(R/1e3).toFixed(R>=1e4?0:1)}K`:R.toLocaleString(),C=a?`${w(r)} ${a}`:w(r),P=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:p,fontFamily:L(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${x-8}%`}},{type:"text",id:"left-value",content:{text:C,style:{fontSize:d,fontFamily:L(t,"body"),fontWeight:"bold",color:c.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:c.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:L(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${S-8}%`}},{type:"text",id:"right-value",content:{text:P,style:{fontSize:d,fontFamily:L(t,"body"),fontWeight:"bold",color:c.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:c.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=I(52,t,true),s=I(24,t,false),u=I(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,fontFamily:L(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:L(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:s,fontFamily:L(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 Cr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:c="bottom",videoCredit:p,videoLicense:d}=e,m=u&&Ut(u),{theme:f,layout:h}=t,g=I(36,t,false),y=I(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:c==="top"?0:"65%",width:"100%",height:"35%"}});let x=c==="top"?"15%":c==="center"?"50%":"82%";v.push({type:"text",id:"caption",content:{text:m,style:{fontSize:g,fontFamily:L(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:L(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=I(52,t,true),a=I(24,t,false),s=I(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,fontFamily:L(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:L(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:a,fontFamily:L(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 Ar(e,t){let{title:n,headers:r,rows:o,align:i,colorScheme:a}=e,{theme:s}=t,u=be(t,a),c=I(48,t,true),p=I(28,t,false),d=[Ye("bg",`linear-gradient(170deg, ${s.colors.background} 0%, #0f1520 100%)`)];return n&&d.push({type:"text",id:"title",content:{text:n,style:{fontSize:c,fontFamily:L(t,"title"),fontWeight:"bold",color:s.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"10%",width:"80%",anchor:"center"},animation:{type:"fadeIn",duration:.8}}),d.push({type:"table",id:"table",content:{headers:r,rows:o,align:i,style:{headerBackground:u.accent,headerColor:u.text,cellBackground:"rgba(255,255,255,0.05)",cellColor:s.colors.text,borderColor:"rgba(255,255,255,0.12)",fontSize:p,fontFamily:L(t,"body"),headerFontFamily:L(t,"title"),borderRadius:8}},position:{x:"10%",y:n?"18%":"8%",width:"80%",height:n?"74%":"84%"},animation:{type:"fadeIn",duration:1,delay:n?.4:0}}),d}function Lr(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:c,layout:p}=t,d=I(96,t,true),m=I(36,t,false),f=Ee(a),h=[{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: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:L(t,"title"),fontWeight:"bold",color:c.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:L(t,"body"),color:c.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 si(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=si(e);return Lr(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,dataTable:Ar};function pt(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??he,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=Ue(i?.bottomLayers),c=Ue(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((f,h)=>{let g=ge(r,h,s,o),y=ne(f)?pt(f,g):f,v=f,x=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (u.length>0||c.length>0)&&(y.layers=[...x?u:[],...y.layers??[],...S?c:[]]),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:M}of f){let F=ge(r,M,s,o),q=ne(_)?pt(_,F):_,E=_,D=E.useBottomLayer!==false,oe=E.useTopLayer!==false;(u.length>0||c.length>0)&&(q.layers=[...D?u:[],...q.layers??[],...oe?c:[]]),q.startTime=b,b+=q.duration,d[M]=q;}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,w=x>0&&S>0?S/x:1,C=[];for(let{block:b,originalIndex:_}of f){let M=ge(r,_,s,o),F=ne(b)?pt(b,M):b,q=b,E=q.useBottomLayer!==false,D=q.useTopLayer!==false;(u.length>0||c.length>0)&&(F.layers=[...E?u:[],...F.layers??[],...D?c:[]]),C.push({block:F,originalIndex:_,templateBlock:q,hasSourceTiming:typeof q.sourceStartTime=="number"});}let P=C.some(b=>b.hasSourceTiming);C.sort((b,_)=>{if(P){let M=b.templateBlock.template==="sectionHeader",F=_.templateBlock.template==="sectionHeader";if(M&&!F)return -1;if(!M&&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 R=0;for(let b=0;b<C.length;b++){let _=C[b],{block:M,templateBlock:F}=_;if(_.hasSourceTiming){let q=F.sourceStartTime;M.startTime=h.startTime+q,typeof F.sourceDuration=="number"&&(M.duration=Math.max(5,F.sourceDuration)),R=q+M.duration;}else if(F.template==="sectionHeader")M.startTime=h.startTime+R,R+=M.duration;else {M.startTime=h.startTime+R;let q=M.duration*w;M.duration=q,R+=q;}d[_.originalIndex]=M;}let N=C.map(b=>d[b.originalIndex]).sort((b,_)=>b.startTime-_.startTime);for(let b=0;b<N.length-1;b++){let _=N[b],M=N[b+1],F=_.startTime+_.duration;F>M.startTime?_.duration=M.startTime-_.startTime:F<M.startTime-.5&&(_.duration=Math.max(.1,M.startTime-_.startTime));}let Y=5,W=h.startTime+h.duration;for(;N.length>1;){let b=N[N.length-1];if(W-b.startTime<Y&&b.template!=="sectionHeader"){let M=N[N.length-2];M.duration=W-M.startTime,b.duration=0,b.startTime=W,N.pop();}else {b.startTime+b.duration<W&&(b.duration=W-b.startTime);break}}if(N.length===1){let b=N[0];b.startTime+b.duration<W&&(b.duration=W-b.startTime);}let ae=true;for(;ae;){ae=false;for(let b=N.length-1;b>=1;b--){let _=N[b];if(_.duration>0&&_.duration<Y){let M=N[b-1],F=_.startTime+_.duration;M.duration=F-M.startTime,_.duration=0,_.startTime=W,N.splice(b,1),ae=true;break}}}let k=20;for(let b=0;b<N.length;b++){let _=N[b];if(_.duration>k){let M=Math.ceil(_.duration/k),F=_.duration/M;if(F>=Y){_.duration=F;for(let q=1;q<M;q++){let E={id:`${_.id}-split-${q}`,startTime:_.startTime+q*F,duration:F,audioSegment:_.audioSegment,layers:(_.layers??[]).map(D=>({...D,id:`${D.id}-split-${q}`})),transition:{type:"dissolve",duration:1},template:_.template};d.push(E);}}}}}return d.filter(m=>m&&m.duration>0)}function jt(e){return e in Ve}function re(e,t=0){if(!e||e.type==="none")return {className:"",style:{}};let n=li(e),r=ci(e);return {className:n,style:r}}function li(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 ci(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 je(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??he,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,u=ge(n,o,i,r),c;try{let p=Ve[s];c=p(e,u),Array.isArray(c)||(console.error(`Template ${s} did not return an array, got:`,typeof c),c=[]);}catch(p){console.error(`Error expanding template ${s}:`,p),c=[];}return Ht(c,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,u=a.useTopLayer!==false;return [...s?o:[],...e,...u?i:[]]}function O(e,t){return typeof e=="number"?e:e.endsWith("%")?parseFloat(e)/100*t:parseFloat(e)}function de(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=lt(null);function fi(){return qt(Zt)}function Xe(e,t){let n=fi(),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]=U(o);return z(()=>{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 pi=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:--pi,__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 Ir({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=O(i.x,n.width),u=O(i.y,n.height),c=i.width?O(i.width,n.width):n.width,p=i.height?O(i.height,n.height):n.height,d=de(i.anchor,c,p),m=s+d.x,f=u+d.y,h=Xe(o.src,t),g=re(a,r),y=mi(o.fit),v=o.fit==="cover",x=a&&hi.has(a.type);if(v&&x&&a){let S=gi(a),w=re(S,r);return l("g",{className:"block-layer block-layer--image","data-layer-id":e.id,children:l("foreignObject",{x:m,y:f,width:c,height:p,children:l("div",{style:{width:"100%",height:"100%",overflow:"hidden"},children:l("img",{src:h,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 ${g.className}`,style:g.style,"data-layer-id":e.id,children:l("foreignObject",{x:m,y:f,width:c,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:c,height:p,preserveAspectRatio:y,style:{pointerEvents:"none"}})})}function mi(e){switch(e){case "cover":return "xMidYMid slice";case "fill":return "none";default:return "xMidYMid meet"}}var hi=new Set(["panLeft","panRight","slowZoom","zoomIn","zoomOut"]);function gi(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 Pr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=O(o.x,t.width),c=O(o.y,t.height),p=o.width?O(o.width,t.width):void 0,d=yi(s.textAlign,o.anchor),m=bi(o.anchor),f=re(i,n),h=(a??"").split(`
2
- `),g=p?h.reduce((w,C)=>w.concat(xi(C,s.fontSize,p)),[]):h;if(s.maxLines&&g.length>s.maxLines){g=g.slice(0,s.maxLines);let w=g[g.length-1];g[g.length-1]=w.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:u-(s.padding||16),y:c-s.fontSize-(s.padding||16),width:_i(g,s)+(s.padding||16)*2,height:g.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),l("text",{x:u,y:c,textAnchor:d,dominantBaseline:m,style:x,filter:S?`url(#${S})`:void 0,children:g.map((w,C)=>l("tspan",{x:u,dy:C===0?0:v,children:[w||"\xA0"," "]},C))})]})}function yi(e,t){return e==="center"?"middle":e==="right"?"end":e==="left"?"start":t?.includes("right")?"end":t==="center"?"middle":"start"}function bi(e){return e?.includes("bottom")?"text-after-edge":e==="center"?"middle":"text-before-edge"}function _i(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function xi(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 p=u;for(;p.length>o;)a.push(p.slice(0,o)),p=p.slice(o);s=p;}else s=u;}return s&&a.push(s),a.length>0?a:[""]}function Br({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=O(o.x,t.width),s=O(o.y,t.height),u=o.width?O(o.width,t.width):100,c=o.height?O(o.height,t.height):100,p=de(o.anchor,u,c),d=a+p.x,m=s+p.y,f=re(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:u,height:c,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:u,height:c,rx:r.borderRadius,ry:r.borderRadius,...y}),r.shape==="circle"&&l("circle",{cx:d+u/2,cy:m+c/2,r:Math.min(u,c)/2,...y}),r.shape==="line"&&l("line",{x1:d,y1:m,x2:d+u,y2:m+c,stroke:r.stroke||"#ffffff",strokeWidth:r.strokeWidth||2})]})}var vi={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 ki(e,t,n,r,o,i=256){let a=Gt(e,t,n),s=Kt(e,t,n,i),u=Math.ceil(r/i)+1,c=Math.ceil(o/i)+1,p=a.x-Math.floor(u/2),d=a.y-Math.floor(c/2),m=r/2-s.x,f=o/2-s.y,h=[];for(let g=0;g<c;g++)for(let y=0;y<u;y++){let v=p+y,x=d+g,S=m+(v-a.x)*i,w=f+(x-a.y)*i;h.push({x:v,y:x,screenX:S,screenY:w});}return h}function wi(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 Er(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=vi[r],c=u.tileSize||256,p=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 h=ki(t.lat,t.lng,p,o,i,c).map(async g=>{let y=wi(u,g.x,g.y,p);try{let v=await Si(y);m.drawImage(v,g.screenX,g.screenY,c,c);}catch(v){console.warn(`Tile load failed: ${y}`,v);}});await Promise.all(h);for(let g of a)Ti(m,g,t,p,o,i,c);return s&&Mi(m,u.attribution,o,i),d.toDataURL("image/png")}function Ti(e,t,n,r,o,i,a){let s=Gt(n.lat,n.lng,r),u=Gt(t.lat,t.lng,r),c=Kt(n.lat,n.lng,r,a),p=Kt(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(p.x-c.x),m=(u.y-s.y)*a+(p.y-c.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,Ci(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 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 Mi(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 Fr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=U(null),[c,p]=U(true),[d,m]=U(null),f=O(i.x,n.width),h=O(i.y,n.height),g=i.width?O(i.width,n.width):n.width,y=i.height?O(i.height,n.height):n.height,v=de(i.anchor,g,y),x=f+v.x,S=h+v.y;z(()=>{let C=false;if(o.staticSrc){let P=o.staticSrc.startsWith("http")?o.staticSrc:`${t}/${o.staticSrc}`;u(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=>{C||(u(P),p(false));}).catch(P=>{C||(console.error("Failed to compose map:",P),m(P instanceof Error?P.message:String(P)),p(false));}),()=>{C=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,g,y,t]);let w=re(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: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 ${w.className}`,style:w.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 ${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: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 Rr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=V(null),u=V(false),c=O(a.x,n.width),p=O(a.y,n.height),d=a.width?O(a.width,n.width):n.width,m=a.height?O(a.height,n.height):n.height,f=de(a.anchor,d,m),h=c+f.x,g=p+f.y,y=Xe(i.src,t),v=Xe(i.posterSrc||"",t),x=i.posterSrc?v:void 0;return z(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,u.current=true,o){let C=S.play();C&&C.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]),z(()=>{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: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"}})})})}function qr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{headers:a,rows:s,align:u,style:c}=r,p=O(o.x,t.width),d=O(o.y,t.height),m=o.width?O(o.width,t.width):t.width,f=o.height?O(o.height,t.height):t.height,h=de(o.anchor,m,f),g=p+h.x,y=d+h.y,v=i?re(i,n):{},x=w=>{let C=u?.[w];return C?{textAlign:C}:void 0},S=c.borderRadius??8;return l("foreignObject",{x:g,y,width:m,height:f,style:v,children:l("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",boxSizing:"border-box"},children:l("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:`${c.fontSize}px`,fontFamily:c.fontFamily??"system-ui, sans-serif",overflow:"hidden",borderRadius:`${S}px`,border:`1px solid ${c.borderColor}`},children:[a.length>0&&l("thead",{children:l("tr",{children:a.map((w,C)=>l("th",{style:{background:c.headerBackground,color:c.headerColor,fontFamily:c.headerFontFamily??c.fontFamily??"system-ui, sans-serif",fontWeight:600,padding:"12px 16px",borderBottom:`2px solid ${c.borderColor}`,borderRight:C<a.length-1?`1px solid ${c.borderColor}`:void 0,...x(C)},children:w},C))})}),s.length>0&&l("tbody",{children:s.map((w,C)=>l("tr",{children:w.map((P,R)=>l("td",{style:{background:c.cellBackground,color:c.cellColor,padding:"10px 16px",borderBottom:C<s.length-1?`1px solid ${c.borderColor}`:void 0,borderRight:R<w.length-1?`1px solid ${c.borderColor}`:void 0,...x(R)},children:P},R))},C))})]})})})}var Ai={width:1920,height:1080};function Fe({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=Ai,isPlaying:a}){let s="",u={};e.transition&&r?(s=je(e.transition.type,true),u["--transition-duration"]=`${e.transition.duration}s`):e.transition&&o&&(s=je(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(p=>l(Li,{layer:p,basePath:n,viewport:i,blockTime:t,isPlaying:a},p.id))})]})}function Li({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(Pr,{layer:e,viewport:n,blockTime:r});case "shape":return l(Br,{layer:e,viewport:n,blockTime:r});case "map":return l(Fr,{layer:e,basePath:t,viewport:n,blockTime:r});case "video":return l(Rr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});case "table":return l(qr,{layer:e,viewport:n,blockTime:r});default:return console.warn(`Unknown layer type: ${e.type}`),null}}var Ii=4,Nr=2,Pi=6;function Bi(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 Ei(e){let t=[];for(let o of e.phrases)t.push(...Bi(o));if(t.length===0)return {words:[],chunks:[]};let n=Ii;if(t.length>n){let o=Math.ceil(t.length/n);n=Math.ceil(t.length/o),n=Math.min(Pi,Math.max(Nr,n));}else n=Math.max(Nr,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 Dr({captions:e,currentTime:t,enabled:n=true,theme:r,viewport:o}){let{chunks:i}=$(()=>e?Ei(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 u=r?.colors?.primary??"#5b9bd5",c=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:c,fontSize:`${m}px`,fontWeight:g?800:600,color:g?u:"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 $r({captions:e,currentTime:t,enabled:n=true,fontSize:r=16,captionStyle:o="standard",theme:i,viewport:a}){if(o==="social")return l(Dr,{captions:e,currentTime:t,enabled:n,theme:i,viewport:a});let u=(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:u?1:0,transition:"opacity 0.15s ease-in-out",padding:"0 4px",boxSizing:"border-box"},children:u&&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:u})})})}function zr(e,t,n=""){let[r,o]=U(0),[i,a]=U(false),[s,u]=U(0),[c,p]=U(false),[d,m]=U(false),[f,h]=U(0),g=V([]),y=V(null),v=V(false),x=V(new Map),S=V(new Map),w=V(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 C=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 M=await fetch(b);if(!M.ok)throw new Error(`HTTP ${M.status}`);let F=await M.blob(),q=URL.createObjectURL(F);return x.current.set(k,q),q}catch{return b}finally{S.current.delete(k);}})();return S.current.set(k,_),_},[n]);z(()=>{if(!t?.segments)return;t.segments.forEach(b=>{C(b.src);});let k=x.current;return ()=>{k.forEach(b=>{URL.revokeObjectURL(b);}),k.clear();}},[t,C]),z(()=>{let k=e.current;if(!k)return;let b=()=>{let D=(g.current[s]||0)+k.currentTime;o(D);},_=()=>{w.current=false,a(true);},M=()=>a(false),F=()=>{m(true);},q=()=>{t&&s<t.segments.length-1?(v.current=true,u(E=>E+1)):(p(true),a(false));};return k.addEventListener("timeupdate",b),k.addEventListener("play",_),k.addEventListener("pause",M),k.addEventListener("ended",q),k.addEventListener("error",F),()=>{k.removeEventListener("timeupdate",b),k.removeEventListener("play",_),k.removeEventListener("pause",M),k.removeEventListener("ended",q),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 E=g.current[s]||0,D=y.current-E;k.currentTime=Math.max(0,D),o(y.current),y.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},M=k.src,F=x.current.get(b.src);M&&(M===F||M.endsWith(b.src))?_():(async()=>{let D=await C(b.src),oe=()=>{m(true),_(),k.removeEventListener("canplay",oe);};k.addEventListener("canplay",oe),k.src=D,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener("canplay",oe),m(true),_());})();},[e,s,t,C]);let P=Z(()=>{let k=e.current;k&&(c&&(u(0),p(false)),k.play().then(()=>{w.current=false;}).catch(()=>{w.current=true,a(true);}));},[e,c]),R=Z(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),N=Z(()=>{e.current&&(i?R():P());},[e,i,P,R]),Y=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),M=0,F=0;for(let E=0;E<t.segments.length;E++){let D=F+t.segments[E].duration;if(_<D){M=E;break}F=D,E===t.segments.length-1&&(M=E);}let q=!b.paused;if(p(false),M!==s)y.current=_,v.current=q,u(M);else {let E=_-F;b.currentTime=Math.max(0,E),o(_);}},[e,t,s,f]),W=Z(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),p(false));},[t]),ae=Z(async()=>{Y(0),await new Promise(k=>setTimeout(k,50)),P();},[Y,P]);return z(()=>{if(!i||!w.current||!f)return;let k=performance.now(),b,_=M=>{if(!w.current)return;let F=(M-k)/1e3;k=M,o(q=>{let E=q+F;return E>=f?(w.current=false,p(true),a(false),f):E}),b=requestAnimationFrame(_);};return b=requestAnimationFrame(_),()=>cancelAnimationFrame(b)},[i,f]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:f,isEnded:c,isReady:d,isAvailable:true,play:async()=>P(),pause:async()=>R(),toggle:async()=>N(),seekTo:async k=>Y(k),skipToSegment:async k=>W(k),restart:ae}}function Or(e,t,n=J.landscape,r=false,o){let [i,a]=U({entering:false,exiting:false,previousBlock:null}),s=$(()=>{if(!e?.blocks)return [];let P=e.blocks.some(N=>N.children&&N.children.length>0)?mt(e.blocks):e.blocks;if(P.some(ne)){let N=e.audio?.segments?.map(W=>({startTime:W.startTime,duration:W.duration}));return Yt(P,{audioSegments:N,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return P},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=$(()=>Dt(s,t),[s,t]),c=$(()=>u?s.indexOf(u):-1,[s,u]),p=$(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=$(()=>!u||u.duration===0?0:Math.min(1,p/u.duration),[u,p]),m=$(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);$(()=>u,[c]);z(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let P=u.transition?.duration||0;if(P>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let R=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},P*1e3);return ()=>clearTimeout(R)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let h=V(null);z(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let C=i.previousBlock;h.current=C,a(P=>({...P,previousBlock:u}));}},[u?.id,r]);let g=u?.transition?.duration||0,y=r&&g>0&&p<g,v=y&&h.current!==null,x=Z(C=>{if(!e||C<0||C>=s.length)return;let P=s[C];if(P)return P.startTime},[e,s]),S=Z(()=>{if(c<s.length-1)return x(c+1)},[c,s.length,x]),w=Z(()=>{if(c>0)return x(c-1)},[c,x]);return {currentBlock:u,currentBlockIndex:c,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:w,goToBlock:x,blocks:s}}function Fi(e,t){let n=e/t;return n>1.2?"landscape":n<.83?"portrait":"landscape"}function Ri(e){switch(e){case "portrait":return J.portrait;case "square":return J.square;default:return J.landscape}}function Wr(){let[e,t]=U(()=>({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=$(()=>Fi(e.width,e.height),[e.width,e.height]);return {viewport:$(()=>Ri(n),[n]),orientation:n,windowSize:e}}function Ze(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=V(null),[a,s]=U(null),u=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);},[]),c=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: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:"#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:Ze(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 Hr({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:[Ze(e.currentTime)," / ",Ze(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 Ur({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 ie(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:ie(n.children,o)},o);case "strong":return l("strong",{className:"squisq-md-strong",children:ie(n.children,o)},o);case "delete":return l("del",{className:"squisq-md-del",children:ie(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:ie(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:ie(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:ie(n.children,o)},o);default:return null}})}function Ni(e,t){switch(e.type){case "paragraph":return l("p",{className:"squisq-md-p",children:ie(e.children,t)},t);case "heading":{let n=`h${e.depth}`;return l(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:ie(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)=>Vr(n,`${t}li${r}`))},t):l("ul",{className:"squisq-md-list squisq-md-ul",children:e.children.map((n,r)=>Vr(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 Di(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:ie(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:ie(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 Vr(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 Di(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:ie(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:ie(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function Re(e,t=""){return e.map((n,r)=>Ni(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 $i(e){let t=e.sourceHeading?.templateAnnotation;return t?!!t.template&&jt(t.template):false}function Yr(e){let t=0;for(let n of e)t++,n.children&&(t+=Yr(n.children));return t}function jr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=$i(e),a=$(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=ye(e.sourceHeading),c=zi(e.contents),p={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...Hi(s.template??"sectionHeader",u,c,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,u)=>l(jr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function zi(e){return !e||e.length===0?"":e.map(t=>ye(t)).join(`
3
- `).trim()}function Oi(e){if(!e)return [];let t=[];for(let n of e)if(n.type==="list")for(let r of n.children){let o=ye(r).trim();o&&t.push(o);}return t}function Wi(e){if(!e)return null;for(let t of e)if(t.type==="table"){let n=t,[r,...o]=n.children;if(!r)return null;let i=r.children.map(s=>ye(s).trim()),a=o.map(s=>s.children.map(u=>ye(u).trim()));return {headers:i,rows:a,align:n.align}}return null}function Hi(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:Oi(r)||["Item 1","Item 2","Item 3"]};case "definitionCard":return {term:t,definition:n||t};case "dateEvent":return {date:t,description:n||t};case "dataTable":return Wi(r)??{headers:["Column"],rows:[["Data"]]};default:return {}}}function yt({doc:e,basePath:t="/",viewport:n,className:r,theme:o}){let i=n??J.landscape,a=$(()=>Yr(e.blocks),[e.blocks]),s=$(()=>({theme:o??he,viewport:i,totalBlocks:a}),[i,a,o]),u=s.theme,c=u.colors.background,p=u.colors.text,d=u.colors.textMuted,m=u.colors.primary,f=u.typography.bodyFontFamily,h=u.typography.titleFontFamily,g=u.typography.lineHeight??1.7;return l("div",{className:`squisq-linear ${r||""}`,style:{width:"100%",height:"100%",overflowY:"auto",overflowX:"hidden",background:c},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":c},children:[l("style",{children:`
1
+ var SquisqPlayer=(function(exports){'use strict';var dt,B,En,ve,An,Bn,Fn,Pn,qt,Bt,Ft,Rn,lt={},ct=[],wo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Oe=Array.isArray;function pe(e,t){for(var n in t)e[n]=t[n];return e}function $t(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?dt.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 st(e,a,r,o,null)}function st(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??++En,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function ee(e){return e.children}function ce(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 So(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=pe({},t);i.__v=t.__v+1,B.vnode&&B.vnode(i),Nt(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,Dn(r,i,o),t.__e=t.__=null,i.__e!=n&&qn(i);}}function qn(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}),qn(e)}function Pt(e){(!e.__d&&(e.__d=true)&&ve.push(e)&&!ut.__r++||An!=B.debounceRendering)&&((An=B.debounceRendering)||Bn)(ut);}function ut(){try{for(var e,t=1;ve.length;)ve.length>t&&ve.sort(Fn),e=ve.shift(),t=ve.length,So(e);}finally{ve.length=ut.__r=0;}}function $n(e,t,n,r,o,i,a,s,u,l,p){var d,m,f,h,g,y,x,_=r&&r.__k||ct,T=t.length;for(u=To(n,t,_,u,T),d=0;d<T;d++)(f=n.__k[d])!=null&&(m=f.__i!=-1&&_[f.__i]||lt,f.__i=d,y=Nt(e,f,m,o,i,a,s,u,l,p),h=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Dt(m.ref,null,f),p.push(f.ref,f.__c||h,f)),g==null&&h!=null&&(g=h),(x=!!(4&f.__u))||m.__k===f.__k?u=Nn(f,u,e,x):typeof f.type=="function"&&y!==void 0?u=y:h&&(u=h.nextSibling),f.__u&=-7);return n.__e=g,u}function To(e,t,n,r,o){var i,a,s,u,l,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]=st(null,a,null,null,null):Oe(a)?a=e.__k[i]=st(ee,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=st(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,(l=a.__i=Co(a,n,u,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(o>p?m--:o<p&&m++),typeof a.type!="function"&&(a.__u|=4)):l!=u&&(l==u-1?m--:l==u+1?m++:(l>u?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)),On(s,s));return r}function Nn(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=Nn(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 We(e,t){return t=t||[],e==null||typeof e=="boolean"||(Oe(e)?e.some(function(n){We(n,t);}):t.push(e)),t}function Co(e,t,n,r){var o,i,a,s=e.key,u=e.type,l=t[n],p=l!=null&&(2&l.__u)==0;if(l===null&&s==null||p&&s==l.key&&u==l.type)return n;if(r>(p?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((l=t[a=o>=0?o--:i++])!=null&&(2&l.__u)==0&&s==l.key&&u==l.type)return a}return -1}function In(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||wo.test(t)?n:n+"px";}function at(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||In(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||In(e.style,t,n[t]);}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Pn,"$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=qt,e.addEventListener(t,i?Ft:Bt,i)):e.removeEventListener(t,i?Ft:Bt,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 Ln(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=qt++;else if(t.t<n.u)return;return n(B.event?B.event(t):t)}}}function Nt(e,t,n,r,o,i,a,s,u,l){var p,d,m,f,h,g,y,x,_,T,v,M,L,P,q,j=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(p=B.__b)&&p(t);e:if(typeof j=="function")try{if(x=t.props,_=j.prototype&&j.prototype.render,T=(p=j.contextType)&&r[p.__c],v=p?T?T.props.value:p.__:r,n.__c?y=(d=t.__c=n.__c).__=d.__E:(_?t.__c=d=new j(x,v):(t.__c=d=new ce(x,v),d.constructor=j,d.render=Ao),T&&T.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),_&&d.__s==null&&(d.__s=d.state),_&&j.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=pe({},d.__s)),pe(d.__s,j.getDerivedStateFromProps(x,d.__s))),f=d.props,h=d.state,d.__v=t,m)_&&j.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),_&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(_&&j.getDerivedStateFromProps==null&&x!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,v),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,v)===!1){t.__v!=n.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(V){V&&(V.__=t);}),ct.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,v),_&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,h,g);});}if(d.context=v,d.props=x,d.__P=e,d.__e=!1,M=B.__r,L=0,_)d.state=d.__s,d.__d=!1,M&&M(t),p=d.render(d.props,d.state,d.context),ct.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&&++L<25);d.state=d.__s,d.getChildContext!=null&&(r=pe(pe({},r),d.getChildContext())),_&&!m&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,h)),P=p!=null&&p.type===ee&&p.key==null?zn(p.props.children):p,s=$n(e,Oe(P)?P:[P],t,n,r,o,i,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null);}catch(V){if(t.__v=null,u||i!=null)if(V.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(q=i.length;q--;)$t(i[q]);Rt(t);}else t.__e=n.__e,t.__k=n.__k,V.then||Rt(t);B.__e(V,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Mo(n.__e,t,n,r,o,i,a,u,l);return (p=B.diffed)&&p(t),128&t.__u?void 0:s}function Rt(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(Rt));}function Dn(e,t,n){for(var r=0;r<n.length;r++)Dt(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 zn(e){return typeof e!="object"||e==null||e.__b>0?e:Oe(e)?e.map(zn):pe({},e)}function Mo(e,t,n,r,o,i,a,s,u){var l,p,d,m,f,h,g,y=n.props||lt,x=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(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!_&&(_?f.localName==_:f.nodeType==3)){e=f,i[l]=null;break}}if(e==null){if(_==null)return document.createTextNode(x);e=document.createElementNS(o,_,x.is&&x),s&&(B.__m&&B.__m(t,i),s=false),i=null;}if(_==null)y===x||s&&e.data==x||(e.data=x);else {if(i=i&&dt.call(e.childNodes),!s&&i!=null)for(y={},l=0;l<e.attributes.length;l++)y[(f=e.attributes[l]).name]=f.value;for(l in y)f=y[l],l=="dangerouslySetInnerHTML"?d=f:l=="children"||l in x||l=="value"&&"defaultValue"in x||l=="checked"&&"defaultChecked"in x||at(e,l,null,f,o);for(l in x)f=x[l],l=="children"?m=f:l=="dangerouslySetInnerHTML"?p=f:l=="value"?h=f:l=="checked"?g=f:s&&typeof f!="function"||y[l]===f||at(e,l,f,y[l],o);if(p)s||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),$n(t.type=="template"?e.content:e,Oe(m)?m:[m],t,n,r,_=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Pe(n,0),s,u),i!=null)for(l=i.length;l--;)$t(i[l]);s||(l="value",_=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[l]||_=="progress"&&!h||_=="option"&&h!=y[l])&&at(e,l,h,y[l],o),l="checked",g!=null&&g!=e[l]&&at(e,l,g,y[l],o));}return e}function Dt(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 On(e,t,n){var r,o;if(B.unmount&&B.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Dt(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]&&On(r[o],t,n||typeof e.type!="function");n||$t(e.__e),e.__c=e.__=e.__e=void 0;}function Ao(e,t,n){return this.constructor(e,n)}function zt(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=[],Nt(t,e=(t).__k=me(ee,null,[e]),o||lt,lt,t.namespaceURI,o?null:t.firstChild?dt.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),Dn(i,e,a);}function ft(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,Pt(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"+Rn++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}dt=ct.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}},En=0,ce.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),Pt(this));},ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),Pt(this));},ce.prototype.render=ee,ve=[],Bn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fn=function(e,t){return e.__v.__b-t.__v.__b},ut.__r=0,Pn=/(PointerCapture)$|Capture$/i,qt=0,Bt=Ln(false),Ft=Ln(true),Rn=0;var Te,X,Ot,Wn,He=0,Gn=[],G=B,Hn=G.__b,Un=G.__r,Vn=G.diffed,Yn=G.__c,jn=G.unmount,Xn=G.__;function Ue(e,t){G.__h&&G.__h(X,e,He||t),He=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function W(e){return He=1,Kn(Jn,e)}function Kn(e,t,n){var r=Ue(Te++,2);if(r.t=e,!r.__c&&(r.__=[Jn(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],l=r.t(u,s);u!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}));}],r.__c=X,!X.__f)){var o=function(s,u,l){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,u,l);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,u,l)||d};X.__f=true;var i=X.shouldComponentUpdate,a=X.componentWillUpdate;X.componentWillUpdate=function(s,u,l){if(this.__e){var p=i;i=void 0,o(s,u,l),i=p;}a&&a.call(this,s,u,l);},X.shouldComponentUpdate=o;}return r.__N||r.__}function D(e,t){var n=Ue(Te++,3);!G.__s&&Ut(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n));}function Qn(e,t){var n=Ue(Te++,4);!G.__s&&Ut(n.__H,t)&&(n.__=e,n.u=t,X.__h.push(n));}function H(e){return He=5,$(function(){return {current:e}},[])}function $(e,t){var n=Ue(Te++,7);return Ut(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function U(e,t){return He=8,$(function(){return e},t)}function Ht(e){var t=X.context[e.__c],n=Ue(Te++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(X)),t.props.value):e.__}function Io(){for(var e;e=Gn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(pt),t.__h.some(Wt),t.__h=[];}catch(n){t.__h=[],G.__e(n,e.__v);}}}G.__b=function(e){X=null,Hn&&Hn(e);},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Xn&&Xn(e,t);},G.__r=function(e){Un&&Un(e),Te=0;var t=(X=e.__c).__H;t&&(Ot===X?(t.__h=[],X.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(pt),t.__h.some(Wt),t.__h=[],Te=0)),Ot=X;},G.diffed=function(e){Vn&&Vn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gn.push(t)!==1&&Wn===G.requestAnimationFrame||((Wn=G.requestAnimationFrame)||Lo)(Io)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Ot=X=null;},G.__c=function(e,t){t.some(function(n){try{n.__h.some(pt),n.__h=n.__h.filter(function(r){return !r.__||Wt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],G.__e(r,n.__v);}}),Yn&&Yn(e,t);},G.unmount=function(e){jn&&jn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{pt(r);}catch(o){t=o;}}),n.__H=void 0,t&&G.__e(t,n.__v));};var Zn=typeof requestAnimationFrame=="function";function Lo(e){var t,n=function(){clearTimeout(r),Zn&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);Zn&&(t=requestAnimationFrame(n));}function pt(e){var t=X,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),X=t;}function Wt(e){var t=X;e.__c=e.__(),X=t;}function Ut(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Jn(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 er(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 cr(e,t){var n=t(),r=W({t:{__:n,u:t}}),o=r[0].t,i=r[1];return Qn(function(){o.__=n,o.u=t,Vt(o)&&i({t:o});},[e,n,t]),D(function(){return Vt(o)&&i({t:o}),e(function(){Vt(o)&&i({t:o});})},[e]),n}function Vt(e){try{return !((t=e.__)===(n=e.u())&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return true}var t,n;}function tr(e,t){this.props=e,this.context=t;}(tr.prototype=new ce).isPureReactComponent=true,tr.prototype.shouldComponentUpdate=function(e,t){return er(this.props,e)||er(this.state,t)};var nr=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),nr&&nr(e);};var Fo=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)}Fo(e,t,n,r);};var rr=B.unmount;function ur(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 ur(r,t,n)})),e}function dr(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return dr(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 Yt(){this.__u=0,this.o=null,this.__b=null;}function fr(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function mt(){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),rr&&rr(e);},(Yt.prototype=new ce).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=fr(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 l=r.state.__a;r.__v.__k[0]=dr(l,l.__c.__P,l.__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);},Yt.prototype.componentWillUnmount=function(){this.o=[];},Yt.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]=ur(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&me(ee,null,e.fallback);return o&&(o.__u&=-33),[me(ee,null,t.__a?null:e.children),o]};var or=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];}};(mt.prototype=new ce).__a=function(e){var t=this,n=fr(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),or(t,e,r)):o();};n?n(i):i();}},mt.prototype.render=function(e){this.i=null,this.l=new Map;var t=We(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},mt.prototype.componentDidUpdate=mt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){or(e,n,t);});};var Po=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Ro=/^(?: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]/,qo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,$o=/[A-Z0-9]/g,No=typeof document<"u",Do=function(e){return (typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function pr(e,t,n){return t.__k==null&&(t.textContent=""),zt(e,t),e?e.__c:null}ce.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ce.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var ir=B.event;B.event=function(e){return ir&&(e=ir(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var zo={configurable:true,get:function(){return this.class}},ar=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||No&&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"||Do(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":qo.test(a)&&(a=u):u=a="oninput":i&&Ro.test(a)?a=a.replace($o,"-$&").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=We(n.children).forEach(function(l){l.props.selected=o.value.indexOf(l.props.value)!=-1;})),o.defaultValue!=null&&(o.value=We(n.children).forEach(function(l){l.props.selected=o.multiple?o.defaultValue.indexOf(l.props.value)!=-1:o.defaultValue==l.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",zo)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=Po,ar&&ar(e);};var sr=B.__r;B.__r=function(e){sr&&sr(e),e.__c;};var lr=B.diffed;B.diffed=function(e){lr&&lr(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 hr(e){return !!e.__k&&(zt(null,e),true)}function gr(e){return {render:function(t){pr(t,e);},unmount:function(){hr(e);}}}function jt(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 Ve(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 ht={id:"light",background:"#ffffff",backgroundLight:"#f5f5f5",text:"#1a1a1a",textMuted:"#666666"},Xt={id:"dark",background:"#1a202c",backgroundLight:"#2d3748",text:"#f0f0f0",textMuted:"#a0aec0"};function Ye(e,t){return {...e,colors:{...e.colors,background:t.background,backgroundLight:t.backgroundLight,text:t.text,textMuted:t.textMuted}}}var Oo='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Wo='Georgia, "Times New Roman", serif',Ho='Consolas, "Courier New", monospace';var Uo={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:"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:Oo,titleFontFamily:Wo,monoFontFamily:Ho,titleWeight:"bold"},style:{textShadow:true,overlayOpacity:.45,animationSpeed:1},renderStyle:{name:"standard",defaultTextAnimation:"fadeIn",defaultImageAnimation:"slowZoom",ambientMotion:true,defaultTransition:{type:"fade",duration:.7}},colorSchemes:Uo,persistentLayers:{bottomLayers:[{template:"gradientBackground",config:{type:"gradientBackground",preset:"dark-vignette"}}]}};var he=Vo;var te={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 Yo=Math.sqrt(1920*1920+1080*1080);function Zt(e){return Math.sqrt(e.width*e.width+e.height*e.height)/Yo}function Gt(e){let t=e.width/e.height;return Math.abs(t-1)<.05?"square":t>1?"landscape":"portrait"}var jo={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 je(e){return jo[e]}function yr(e,t,n,r=false){let o=Zt(t),i=je(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function gt(e){let t=je(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 Kt='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function re(e){return "template"in e&&typeof e.template=="string"}function ge(e,t,n,r=te.landscape){let o=Gt(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:Zt(r),orientation:o,layout:je(o)}}function E(e,t,n=false){return yr(e,t.viewport,t.orientation,n)}function Qt(e){return "template"in e&&typeof e.template=="string"}function br(e){return "children"in e&&Array.isArray(e.children)?e.children:[]}function ye(e){if("value"in e&&typeof e.value=="string")return e.value;let t=br(e),n=e.type==="list"||e.type==="listItem"?`
2
+ `:"";return t.map(ye).join(n)}var Qo={"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 Jo(e){return {type:"shape",id:"persistent-bg-solid",content:{shape:"rect",fill:e.color},position:{x:0,y:0,width:"100%",height:"100%"}}}function ei(e){return {type:"shape",id:"persistent-bg-gradient",content:{shape:"rect",fill:e.gradient??Qo[e.preset??"dark-vignette"]},position:{x:0,y:0,width:"100%",height:"100%"}}}function ti(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 ni(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 ri(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%",l=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:l,y:u,width:e.showThumbnail?"30%":"28%",height:s}}),e.showThumbnail&&e.thumbnailSrc){let y=i?`${a+m}%`:"93%",x=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:x,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 oi(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 ii(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 ai(e){if(!Qt(e))return [e];let n=e.config;switch(n.type){case "solidBackground":return [Jo(n)];case "gradientBackground":return [ei(n)];case "imageBackground":return ti(n);case "patternBackground":return [ni(n)];case "titleCaption":return ri(n);case "cornerBranding":return [oi(n)];case "progressIndicator":return [ii(n)];default:return console.warn("Unknown persistent layer template:",n.type),[]}}function Xe(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(ai(n)),[])}var si={bg:"#1a365d",text:"#63b3ed",accent:"#90cdf4"};function be(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]]:si}var li='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',ci='Georgia, "Times New Roman", serif',ui='Consolas, "Courier New", monospace';function I(e,t){let{typography:n}=e.theme;switch(t){case "title":return n.titleFontFamily||ci;case "body":return n.bodyFontFamily||li;case "mono":return n.monoFontFamily||ui}}function vr(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=E(96,t,true),u=E(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:u,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 kr(e,t){let{title:n="",colorScheme:r="blue",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,u=be(t,r),l=E(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:u.bg},position:{x:0,y:0,width:"100%",height:"100%"}}),p.push({type:"shape",id:"line-top",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"40%",width:"20%",height:"2px",anchor:"center"}}),p.push({type:"shape",id:"line-bottom",content:{shape:"rect",fill:`${u.text}33`},position:{x:"50%",y:"60%",width:"20%",height:"2px",anchor:"center"}})),p.push({type:"text",id:"title",content:{text:n,style:{fontSize:l,fontFamily:I(t,"title"),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}}),p}var di=/^(\d+(?:\.\d+)?)\s*%?$/,ke={textCenterX:"50%",textWidth:"85%",textYAdjust:0,adjustY:false};function Re(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 ue=35,wr=`${ue}%`;function Ce(e){switch(e){case "left-strip":return {textCenterX:`${50+ue/2}%`,textWidth:`${100-ue-8}%`,textYAdjust:0,adjustY:false};case "right-strip":return {textCenterX:`${50-ue/2}%`,textWidth:`${100-ue-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 ke}}function Me(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case "left-strip":n.push(_r(r,o,"left",t,a,s,u)),n.push(xr("left",t));break;case "right-strip":n.push(_r(r,o,"right",t,a,s,u)),n.push(xr("right",t));break;case "bottom-strip":n.push(fi(r,o,t,a,s,u)),n.push(pi(t));break;case "corner-inset":n.push(mi(r,o,t,a,s,u)),n.push(hi(t));break}return n}function _r(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-ue}%`,y:0,width:wr,height:"100%"},animation:Re(o,15)}}function xr(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"?`${ue-8}%`:`${100-ue}%`,y:0,width:"10%",height:"100%"}}}function fi(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-ue}%`,width:"100%",height:wr},animation:Re(r,15)}}function pi(e){return {type:"shape",id:`${e}-accent-fade`,content:{shape:"rect",fill:"url(#accent-gradient-bottom)"},position:{x:0,y:`${100-ue-8}%`,width:"100%",height:"12%"}}}function mi(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:Re(r,15)??{type:"fadeIn",duration:2,delay:.5}}}function hi(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 Q(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e=="number"?`${e}%`:e;let n=typeof e=="number"?`${e}`:e,r=n.match(di);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var gi=/[.;:!?]+$/;function en(e){return e.replace(gi,"").trim()}function Ge(e,t){return {type:"shape",id:e,content:{shape:"rect",fill:t},position:{x:0,y:0,width:"100%",height:"100%"}}}function Sr(e,t){let{stat:n,description:r,detail:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=be(t,i),l=a?Ce(a.position):ke,p=E(148,t,true),d=E(32,t,false),m=E(26,t,false),f=[Ge("bg",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&f.push(...Me(a,e.id)),f.push({type:"text",id:"stat",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:u.text,shadow:!!a}},position:{x:l.textCenterX,y:Q("32%",l),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:l.textCenterX,y:Q("58%",l),width:l.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:u.accent,textAlign:"center",shadow:!!a}},position:{x:l.textCenterX,y:Q("75%",l),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1}}),f}function Tr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?Ce(o.position):ke,u=E(48,t,true),l=E(24,t,false),p=E(280,t,true),d=[Ge("bg",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...Me(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:Q("18%",s),anchor:"center"}});let m=r?a.primaryY:"50%";return d.push({type:"text",id:"quote",content:{text:n,style:{fontSize:u,fontFamily:I(t,"title"),color:i.colors.text,textAlign:"center",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:Q(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:l,fontFamily:I(t,"body"),color:i.colors.textMuted,textAlign:"center",shadow:!!o}},position:{x:s.textCenterX,y:Q(a.captionY,s),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:1.5}}),d}function Cr(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?Ce(i.position):ke,u=E(56,t,true),l=E(32,t,false),p=E(20,t,false),d=[Ge("bg",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...Me(i,e.id)),d.push({type:"text",id:"fact",content:{text:n,style:{fontSize:u,fontFamily:I(t,"title"),fontWeight:"bold",color:a.colors.text,textAlign:"center",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:Q("35%",s),width:s.textWidth,anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),d.push({type:"text",id:"explanation",content:{text:r,style:{fontSize:l,fontFamily:I(t,"body"),color:a.colors.textMuted,textAlign:"center",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:Q("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:Q("85%",s),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),d}function Mr(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:l}=t,p=be(t,i),d=be(t,a),m=gt(l),f=u.stackColumns,h=f?"85%":"42%",g=E(32,t,false),y=E(44,t,true),x=E(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%"}}];f||(_.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 T=f?"12%":"22%";o&&_.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:T,anchor:"center"},animation:{type:"fadeIn",duration:.8}});let v,M,L,P;if(f)v=o?"30%":"25%",M=o?"40%":"35%",L=o?"60%":"55%",P=o?"70%":"65%";else {let ae=o?"47%":"45%",k=o?"58%":"56%";v=ae,M=k,L=ae,P=k;}_.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:v,anchor:"center",width:h},animation:{type:"fadeIn",duration:1}}),n.sublabel&&_.push({type:"text",id:"left-sublabel",content:{text:n.sublabel,style:{fontSize:x,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=E(120,t,true),j=f?"48%":"50%",V=f?"\u2193":"\u2192";return _.push({type:"text",id:"connector",content:{text:V,style:{fontSize:q,fontFamily:I(t,"title"),fontWeight:"bold",color:"rgba(255, 255, 255, 0.6)",textAlign:"center"}},position:{x:"50%",y:j,anchor:"center"},animation:{type:"fadeIn",duration:.6,delay:.4}}),_.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:L,anchor:"center",width:h},animation:{type:"fadeIn",duration:1,delay:.5}}),r.sublabel&&_.push({type:"text",id:"right-sublabel",content:{text:r.sublabel,style:{fontSize:x,fontFamily:I(t,"body"),color:s.colors.textMuted,textAlign:"center",lineHeight:1.4}},position:{x:m.right.x,y:P,anchor:"center",width:h},animation:{type:"fadeIn",duration:.8,delay:.8}}),_}var yi={neutral:{bg:"#1a202c",date:"#63b3ed",text:"#ffffff"},somber:{bg:"#1a1a2e",date:"#e53e3e",text:"#a0aec0"},celebratory:{bg:"#1a365d",date:"#68d391",text:"#ffffff"}};function Ar(e,t){let{date:n,description:r,footer:o,mood:i="neutral",accentImage:a}=e,{theme:s}=t,u=yi[i],l=a?Ce(a.position):ke,p=E(96,t,true),d=E(30,t,false),m=E(26,t,false),f=[{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&&f.push(...Me(a,e.id)),f.push({type:"text",id:"date",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:u.date,shadow:!!a}},position:{x:l.textCenterX,y:Q("35%",l),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:u.text,textAlign:"center",lineHeight:1.8,shadow:!!a}},position:{x:l.textCenterX,y:Q("58%",l),width:l.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:l.textCenterX,y:Q("82%",l),anchor:"center"},animation:{type:"fadeIn",duration:1,delay:3}}),f}function Ir(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i="bottom",ambientMotion:a,isTitle:s,subtitle:u,imageCredit:l,imageLicense:p}=e,d=o&&en(o),{theme:m,layout:f}=t,h=E(36,t,false),g=E(96,t,true),y=E(36,t,false),x=e.kenBurns,T=Re(a||x),v=[{type:"image",id:"bg-image",content:{src:n,alt:r,fit:"cover",credit:l,license:p},position:{x:0,y:0,width:"100%",height:"100%"},animation:T}];return s&&d?(v.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%"}}),v.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:u?"70%":"75%",anchor:"center",width:f.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),u&&v.push({type:"text",id:"subtitle",content:{text:u,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}}),v):(d&&(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:"65%",width:"100%",height:"35%"}}),v.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}})),v)}function Lr(e,t){let{center:n,zoom:r,mapStyle:o="terrain",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:l}=e,{theme:p,layout:d}=t,m=E(64,t,true),f=E(32,t,false),h=Re(u),g=[{type:"map",id:"map-bg",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:l},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 Er(e,t){let{text:n,colorScheme:r="blue"}=e,{theme:o}=t,i=be(t,r),a=E(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 Br(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?Ce(o.position):ke,s=E(44,t,true),u=E(34,t,false),l=[{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&&l.push(...Me(o,e.id));let p=r?30:22;r&&l.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:Q("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]}`;l.push({type:"text",id:`item-${f}`,content:{text:g,style:{fontSize:u,fontFamily:I(t,"body"),color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:Q(`${h}%`,a),anchor:"center",width:a.textWidth},animation:{type:"fadeIn",duration:.8,delay:.3+.3*f}});}return l}var ne=.5;function Fr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&en(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%"}}],l=i?s.stackColumns?18:22:0,p=100-l,d=bi(n.length,p,s.stackColumns),m=E(24,t,false);for(let f=0;f<Math.min(n.length,4);f++){let h=n[f],g=d[f];u.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&&u.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"}}),u.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=E(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:`${p-4}%`,width:"100%",height:`${l+4}%`}}),u.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?l/2:l*.3)}%`,anchor:"center",width:"90%"},animation:{type:"fadeIn",duration:1,delay:.5}});}return u}function bi(e,t,n){let r=50-ne/2,o=t/2-ne/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ne/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ne/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ne*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ne/3,w:100,h:s},{x:0,y:t*2/3+ne*2/3,w:100,h:s}]}let i=60-ne/2,a=40-ne/2;return [{x:0,y:0,w:i,h:t},{x:60+ne/2,y:0,w:a,h:o},{x:60+ne/2,y:t/2+ne/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ne/2,y:0,w:r,h:o},{x:0,y:t/2+ne/2,w:r,h:o},{x:50+ne/2,y:t/2+ne/2,w:r,h:o}]}}function Pr(e,t){let{term:n,definition:r,origin:o,colorScheme:i="blue",accentImage:a}=e,{theme:s}=t,u=be(t,i),l=a?Ce(a.position):ke,p=E(72,t,true),d=E(32,t,false),m=E(22,t,false),f=[Ge("bg",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&f.push(...Me(a,e.id)),f.push({type:"text",id:"term",content:{text:n,style:{fontSize:p,fontFamily:I(t,"title"),fontWeight:"bold",color:u.text,textAlign:"center",shadow:!!a}},position:{x:l.textCenterX,y:Q("30%",l),anchor:"center"},animation:{type:"fadeIn",duration:1.5}}),f.push({type:"shape",id:"separator",content:{shape:"rect",fill:`${u.text}33`},position:{x:l.textCenterX,y:Q("42%",l),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:l.textCenterX,y:Q("55%",l),width:l.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:l.textCenterX,y:Q("78%",l),anchor:"center"},animation:{type:"fadeIn",duration:.8,delay:1.5}}),f}function Rr(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s="blue"}=e,{theme:u}=t,l=be(t,s),p=E(28,t,false),d=E(48,t,true),m=Math.max(r,i,1),f=65,h=r/m*f,g=i/m*f,y=15,x=6,_=36,T=58,v=P=>P>=1e6?`${(P/1e6).toFixed(1)}M`:P>=1e3?`${(P/1e3).toFixed(P>=1e4?0:1)}K`:P.toLocaleString(),M=a?`${v(r)} ${a}`:v(r),L=a?`${v(i)} ${a}`:v(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:p,fontFamily:I(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${_-8}%`}},{type:"text",id:"left-value",content:{text:M,style:{fontSize:d,fontFamily:I(t,"body"),fontWeight:"bold",color:l.text}},position:{x:`${y+h+2}%`,y:`${_-1}%`},animation:{type:"fadeIn",duration:.8,delay:.3}},{type:"shape",id:"left-bar",content:{shape:"rect",fill:l.text,borderRadius:4},position:{x:`${y}%`,y:`${_}%`,width:`${h}%`,height:`${x}%`},animation:{type:"fadeIn",duration:1}},{type:"text",id:"right-label",content:{text:o,style:{fontSize:p,fontFamily:I(t,"body"),color:u.colors.textMuted}},position:{x:`${y}%`,y:`${T-8}%`}},{type:"text",id:"right-value",content:{text:L,style:{fontSize:d,fontFamily:I(t,"body"),fontWeight:"bold",color:l.accent}},position:{x:`${y+g+2}%`,y:`${T-1}%`},animation:{type:"fadeIn",duration:.8,delay:.6}},{type:"shape",id:"right-bar",content:{shape:"rect",fill:l.accent,borderRadius:4},position:{x:`${y}%`,y:`${T}%`,width:`${g}%`,height:`${x}%`},animation:{type:"fadeIn",duration:1,delay:.3}}]}function qr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=E(52,t,true),s=E(24,t,false),u=E(200,t,true),l=[{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,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&&l.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}}),l}function $r(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:l="bottom",videoCredit:p,videoLicense:d}=e,m=u&&en(u),{theme:f,layout:h}=t,g=E(36,t,false),y=E(16,t,false),x=[{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){x.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:l==="top"?0:"65%",width:"100%",height:"35%"}});let _=l==="top"?"15%":l==="center"?"50%":"82%";x.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:_,anchor:"center",width:h.maxTextWidth},animation:{type:"fadeIn",duration:1.5,delay:.5}});}return p&&x.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"}}),x}function Nr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=E(52,t,true),a=E(24,t,false),s=E(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,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&&u.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}}),u}function Dr(e,t){let{title:n,headers:r,rows:o,align:i,colorScheme:a}=e,{theme:s}=t,u=be(t,a),l=E(48,t,true),p=E(28,t,false),d=[Ge("bg",`linear-gradient(170deg, ${s.colors.background} 0%, #0f1520 100%)`)];return n&&d.push({type:"text",id:"title",content:{text:n,style:{fontSize:l,fontFamily:I(t,"title"),fontWeight:"bold",color:s.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:"10%",width:"80%",anchor:"center"},animation:{type:"fadeIn",duration:.8}}),d.push({type:"table",id:"table",content:{headers:r,rows:o,align:i,style:{headerBackground:u.accent,headerColor:u.text,cellBackground:"rgba(255,255,255,0.05)",cellColor:s.colors.text,borderColor:"rgba(255,255,255,0.12)",fontSize:p,fontFamily:I(t,"body"),headerFontFamily:I(t,"title"),borderRadius:8}},position:{x:"10%",y:n?"18%":"8%",width:"80%",height:n?"74%":"84%"},animation:{type:"fadeIn",duration:1,delay:n?.4:0}}),d}function zr(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:l,layout:p}=t,d=E(120,t,true),m=E(40,t,false),f=[];if(n){let h=Re(a);f.push({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:h},{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%"}});}else f.push({type:"shape",id:"cover-bg",content:{shape:"rect",fill:`radial-gradient(ellipse at 50% 40%, ${l.colors.primary} 0%, ${l.colors.background} 100%)`},position:{x:0,y:0,width:"100%",height:"100%"}}),f.push({type:"shape",id:"cover-accent",content:{shape:"rect",fill:"rgba(255, 255, 255, 0.2)"},position:{x:"35%",y:i?"42%":"58%",width:"30%",height:"2px"}});return f.push({type:"text",id:"cover-title",content:{text:o,style:{fontSize:d,fontFamily:I(t,"title"),fontWeight:"bold",color:l.colors.text,textAlign:"center",shadow:true}},position:{x:"50%",y:n?i?"70%":"75%":i?p.primaryY:"50%",anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8}}),i&&f.push({type:"text",id:"cover-subtitle",content:{text:i,style:{fontSize:m,fontFamily:I(t,"body"),color:l.colors.textMuted,textAlign:"center",lineHeight:1.5}},position:{x:"50%",y:n?"82%":p.secondaryY,anchor:"center",width:p.maxTextWidth},animation:{type:"fadeIn",duration:.8,delay:.2}}),f}function _i(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function tn(e,t){let n=_i(e);return zr(n,t)}var Ze={titleBlock:vr,sectionHeader:kr,statHighlight:Sr,quoteBlock:Tr,factCard:Cr,twoColumn:Mr,dateEvent:Ar,imageWithCaption:Ir,mapBlock:Lr,fullBleedQuote:Er,listBlock:Br,photoGrid:Fr,definitionCard:Pr,comparisonBar:Rr,pullQuote:qr,videoWithCaption:$r,videoPullQuote:Nr,dataTable:Dr};function yt(e,t){let n=Ze[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 nn(e,t={}){let n=t,r=n.theme??he,o=n.viewport??te.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=Xe(i?.bottomLayers),l=Xe(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((f,h)=>{let g=ge(r,h,s,o),y=re(f)?yt(f,g):f,x=f,_=x.useBottomLayer!==false,T=x.useTopLayer!==false;return (u.length>0||l.length>0)&&(y.layers=[..._?u:[],...y.layers??[],...T?l:[]]),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:w,originalIndex:C}of f){let F=ge(r,C,s,o),R=re(w)?yt(w,F):w,O=w,N=O.useBottomLayer!==false,K=O.useTopLayer!==false;(u.length>0||l.length>0)&&(R.layers=[...N?u:[],...R.layers??[],...K?l:[]]),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 x=g.reduce((b,{block:w})=>b+(w.duration??0),0),_=y.reduce((b,{block:w})=>b+(w.duration??0),0),T=h.duration-x,v=_>0&&T>0?T/_:1,M=[];for(let{block:b,originalIndex:w}of f){let C=ge(r,w,s,o),F=re(b)?yt(b,C):b,R=b,O=R.useBottomLayer!==false,N=R.useTopLayer!==false;(u.length>0||l.length>0)&&(F.layers=[...O?u:[],...F.layers??[],...N?l:[]]),M.push({block:F,originalIndex:w,templateBlock:R,hasSourceTiming:typeof R.sourceStartTime=="number"});}let L=M.some(b=>b.hasSourceTiming);M.sort((b,w)=>{if(L){let C=b.templateBlock.template==="sectionHeader",F=w.templateBlock.template==="sectionHeader";if(C&&!F)return -1;if(!C&&F)return 1;if(b.hasSourceTiming&&w.hasSourceTiming)return b.templateBlock.sourceStartTime-w.templateBlock.sourceStartTime;if(b.hasSourceTiming&&!w.hasSourceTiming)return -1;if(!b.hasSourceTiming&&w.hasSourceTiming)return 1}return b.originalIndex-w.originalIndex});let P=0;for(let b=0;b<M.length;b++){let w=M[b],{block:C,templateBlock:F}=w;if(w.hasSourceTiming){let R=F.sourceStartTime;C.startTime=h.startTime+R,typeof F.sourceDuration=="number"&&(C.duration=Math.max(5,F.sourceDuration)),P=R+C.duration;}else if(F.template==="sectionHeader")C.startTime=h.startTime+P,P+=C.duration;else {C.startTime=h.startTime+P;let R=C.duration*v;C.duration=R,P+=R;}d[w.originalIndex]=C;}let q=M.map(b=>d[b.originalIndex]).sort((b,w)=>b.startTime-w.startTime);for(let b=0;b<q.length-1;b++){let w=q[b],C=q[b+1],F=w.startTime+w.duration;F>C.startTime?w.duration=C.startTime-w.startTime:F<C.startTime-.5&&(w.duration=Math.max(.1,C.startTime-w.startTime));}let j=5,V=h.startTime+h.duration;for(;q.length>1;){let b=q[q.length-1];if(V-b.startTime<j&&b.template!=="sectionHeader"){let C=q[q.length-2];C.duration=V-C.startTime,b.duration=0,b.startTime=V,q.pop();}else {b.startTime+b.duration<V&&(b.duration=V-b.startTime);break}}if(q.length===1){let b=q[0];b.startTime+b.duration<V&&(b.duration=V-b.startTime);}let ae=true;for(;ae;){ae=false;for(let b=q.length-1;b>=1;b--){let w=q[b];if(w.duration>0&&w.duration<j){let C=q[b-1],F=w.startTime+w.duration;C.duration=F-C.startTime,w.duration=0,w.startTime=V,q.splice(b,1),ae=true;break}}}let k=20;for(let b=0;b<q.length;b++){let w=q[b];if(w.duration>k){let C=Math.ceil(w.duration/k),F=w.duration/C;if(F>=j){w.duration=F;for(let R=1;R<C;R++){let O={id:`${w.id}-split-${R}`,startTime:w.startTime+R*F,duration:F,audioSegment:w.audioSegment,layers:(w.layers??[]).map(N=>({...N,id:`${N.id}-split-${R}`})),transition:{type:"dissolve",duration:1},template:w.template};d.push(O);}}}}}return d.filter(m=>m&&m.duration>0)}function rn(e){return e in Ze}function oe(e,t=0){if(!e||e.type==="none")return {className:"",style:{}};let n=xi(e),r=vi(e);return {className:n,style:r}}function xi(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 vi(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 Ke(e,t){return `transition-${e}-${t?"enter":"exit"}`}function bt(e){let t=[];for(let n of e)t.push(n),n.children&&t.push(...bt(n.children));return t}function on(e,t={}){let n=t.theme??he,r=t.viewport??te.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!re(e))return Jt(a,e,t);if(re(e)&&e.template in Ze){let s=e.template,u=ge(n,o,i,r),l;try{let p=Ze[s];l=p(e,u),Array.isArray(l)||(console.error(`Template ${s} did not return an array, got:`,typeof l),l=[]);}catch(p){console.error(`Error expanding template ${s}:`,p),l=[];}return Jt(l,e,t)}return Jt([],e,t)}function Jt(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=Xe(r.bottomLayers),i=Xe(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 z(e,t){return typeof e=="number"?e:e.endsWith("%")?parseFloat(e)/100*t:parseFloat(e)}function de(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 an=ft(null);function Si(){return Ht(an)}function Ae(e,t){let n=Si(),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]=W(o);return D(()=>{if(!i){s(o);return}let u=false;return n.resolveUrl(e).then(l=>{u||s(l);}),()=>{u=true;}},[i,n,e,o]),i?a:o}var Ti=0;function c(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 l={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ti,__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(l),l}function Or({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=z(i.x,n.width),u=z(i.y,n.height),l=i.width?z(i.width,n.width):n.width,p=i.height?z(i.height,n.height):n.height,d=de(i.anchor,l,p),m=s+d.x,f=u+d.y,h=Ae(o.src,t),g=oe(a,r),y=Ci(o.fit),x=o.fit==="cover",_=a&&Mi.has(a.type);if(x&&_&&a){let T=Ai(a),v=oe(T,r);return c("g",{className:"block-layer block-layer--image","data-layer-id":e.id,children:c("foreignObject",{x:m,y:f,width:l,height:p,children:c("div",{style:{width:`${l}px`,height:`${p}px`,overflow:"hidden"},children:c("img",{src:h,alt:o.alt||"",className:v.className,style:{width:`${l}px`,height:`${p}px`,objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none",transformOrigin:"center center",...v.style}})})})})}return x?c("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:c("foreignObject",{x:m,y:f,width:l,height:p,children:c("img",{src:h,alt:o.alt||"",style:{width:`${l}px`,height:`${p}px`,objectFit:"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})}):c("g",{className:`block-layer block-layer--image ${g.className}`,style:g.style,"data-layer-id":e.id,children:c("image",{href:h,x:m,y:f,width:l,height:p,preserveAspectRatio:y,style:{pointerEvents:"none"}})})}function Ci(e){switch(e){case "cover":return "xMidYMid slice";case "fill":return "none";default:return "xMidYMid meet"}}var Mi=new Set(["panLeft","panRight","slowZoom","zoomIn","zoomOut"]);function Ai(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 Wr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=z(o.x,t.width),l=z(o.y,t.height),p=o.width?z(o.width,t.width):void 0,d=Ii(s.textAlign,o.anchor),m=Li(o.anchor),f=oe(i,n),h=(a??"").split(`
3
+ `),g=p?h.reduce((v,M)=>v.concat(Bi(M,s.fontSize,p)),[]):h;if(s.maxLines&&g.length>s.maxLines){g=g.slice(0,s.maxLines);let v=g[g.length-1];g[g.length-1]=v.replace(/\s*$/,"")+"...";}let y=s.lineHeight||1.4,x=s.fontSize*y,_={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Kt,fontWeight:s.fontWeight||"normal",fill:s.color,...f.style},T=s.shadow?`shadow-${e.id}`:void 0;return c("g",{className:`block-layer block-layer--text ${f.className}`,"data-layer-id":e.id,children:[s.shadow&&c("defs",{children:c("filter",{id:T,x:"-20%",y:"-20%",width:"140%",height:"140%",children:c("feDropShadow",{dx:"0",dy:"2",stdDeviation:"3",floodColor:"rgba(0,0,0,0.7)"})})}),s.background&&c("rect",{x:u-(s.padding||16),y:l-s.fontSize-(s.padding||16),width:Ei(g,s)+(s.padding||16)*2,height:g.length*x+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),c("text",{x:u,y:l,textAnchor:d,dominantBaseline:m,style:_,filter:T?`url(#${T})`:void 0,children:g.map((v,M)=>c("tspan",{x:u,dy:M===0?0:x,children:[v||"\xA0"," "]},M))})]})}function Ii(e,t){return e==="center"?"middle":e==="right"?"end":e==="left"?"start":t?.includes("right")?"end":t==="center"?"middle":"start"}function Li(e){return e?.includes("bottom")?"text-after-edge":e==="center"?"middle":"text-before-edge"}function Ei(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 u of i){let l=s?`${s} ${u}`:u;if(l.length<=o)s=l;else if(s&&a.push(s),u.length>o){let p=u;for(;p.length>o;)a.push(p.slice(0,o)),p=p.slice(o);s=p;}else s=u;}return s&&a.push(s),a.length>0?a:[""]}function Hr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=z(o.x,t.width),s=z(o.y,t.height),u=o.width?z(o.width,t.width):100,l=o.height?z(o.height,t.height):100,p=de(o.anchor,u,l),d=a+p.x,m=s+p.y,f=oe(i,n),h=r.fill||"none",g=typeof h=="string"&&h.includes("gradient(");if(r.shape==="rect"&&g)return c("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:c("foreignObject",{x:d,y:m,width:u,height:l,children:c("div",{style:{width:`${u}px`,height:`${l}px`,background:h,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:"none"}})})});let y={fill:h,stroke:r.stroke,strokeWidth:r.strokeWidth};return c("g",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,"data-layer-id":e.id,children:[r.shape==="rect"&&c("rect",{x:d,y:m,width:u,height:l,rx:r.borderRadius,ry:r.borderRadius,...y}),r.shape==="circle"&&c("circle",{cx:d+u/2,cy:m+l/2,r:Math.min(u,l)/2,...y}),r.shape==="line"&&c("line",{x1:d,y1:m,x2:d+u,y2:m+l,stroke:r.stroke||"#ffffff",strokeWidth:r.strokeWidth||2})]})}var Fi={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 sn(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 ln(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 Pi(e,t,n,r,o,i=256){let a=sn(e,t,n),s=ln(e,t,n,i),u=Math.ceil(r/i)+1,l=Math.ceil(o/i)+1,p=a.x-Math.floor(u/2),d=a.y-Math.floor(l/2),m=r/2-s.x,f=o/2-s.y,h=[];for(let g=0;g<l;g++)for(let y=0;y<u;y++){let x=p+y,_=d+g,T=m+(x-a.x)*i,v=f+(_-a.y)*i;h.push({x,y:_,screenX:T,screenY:v});}return h}function Ri(e,t,n,r){return e.url.replace("{z}",String(r)).replace("{x}",String(t)).replace("{y}",String(n))}async function qi(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 Ur(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=Fi[r],l=u.tileSize||256,p=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 h=Pi(t.lat,t.lng,p,o,i,l).map(async g=>{let y=Ri(u,g.x,g.y,p);try{let x=await qi(y);m.drawImage(x,g.screenX,g.screenY,l,l);}catch(x){console.warn(`Tile load failed: ${y}`,x);}});await Promise.all(h);for(let g of a)$i(m,g,t,p,o,i,l);return s&&Di(m,u.attribution,o,i),d.toDataURL("image/png")}function $i(e,t,n,r,o,i,a){let s=sn(n.lat,n.lng,r),u=sn(t.lat,t.lng,r),l=ln(n.lat,n.lng,r,a),p=ln(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(p.x-l.x),m=(u.y-s.y)*a+(p.y-l.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,Ni(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 Ni(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 Di(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 Vr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=W(null),[l,p]=W(true),[d,m]=W(null),f=z(i.x,n.width),h=z(i.y,n.height),g=i.width?z(i.width,n.width):n.width,y=i.height?z(i.height,n.height):n.height,x=de(i.anchor,g,y),_=f+x.x,T=h+x.y;D(()=>{let M=false;if(o.staticSrc){let L=o.staticSrc.startsWith("http")?o.staticSrc:`${t}/${o.staticSrc}`;u(L),p(false);return}return p(true),m(null),Ur({center:o.center,zoom:o.zoom,style:o.style,width:g,height:y,markers:o.markers,showAttribution:o.showAttribution!==false}).then(L=>{M||(u(L),p(false));}).catch(L=>{M||(console.error("Failed to compose map:",L),m(L instanceof Error?L.message:String(L)),p(false));}),()=>{M=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,g,y,t]);let v=oe(a,r);return l?c("g",{className:`block-layer block-layer--map ${v.className}`,style:v.style,"data-layer-id":e.id,children:[c("rect",{x:_,y:T,width:g,height:y,fill:"#e5e7eb"}),c("text",{x:_+g/2,y:T+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#9ca3af",fontSize:"24",fontFamily:"system-ui, sans-serif",children:"Loading map..."})]}):d||!s?c("g",{className:`block-layer block-layer--map ${v.className}`,style:v.style,"data-layer-id":e.id,children:[c("rect",{x:_,y:T,width:g,height:y,fill:"#fef2f2"}),c("text",{x:_+g/2,y:T+y/2,textAnchor:"middle",dominantBaseline:"middle",fill:"#dc2626",fontSize:"18",fontFamily:"system-ui, sans-serif",children:"Map failed to load"})]}):c("g",{className:`block-layer block-layer--map ${v.className}`,style:v.style,"data-layer-id":e.id,children:[c("defs",{children:c("clipPath",{id:`clip-${e.id}`,children:c("rect",{x:_,y:T,width:g,height:y})})}),c("g",{clipPath:`url(#clip-${e.id})`,children:c("image",{href:s,x:_,y:T,width:g,height:y,preserveAspectRatio:"xMidYMid slice",style:{pointerEvents:"none"}})})]})}function Yr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=H(null),u=H(false),l=z(a.x,n.width),p=z(a.y,n.height),d=a.width?z(a.width,n.width):n.width,m=a.height?z(a.height,n.height):n.height,f=de(a.anchor,d,m),h=l+f.x,g=p+f.y,y=Ae(i.src,t),x=Ae(i.posterSrc||"",t),_=i.posterSrc?x:void 0;return D(()=>{let T=s.current;if(!T)return;if(T.currentTime=i.clipStart,u.current=true,o){let M=T.play();M&&M.catch(()=>{});}let v=()=>{T.currentTime>=i.clipEnd&&(T.pause(),T.currentTime=i.clipEnd);};return T.addEventListener("timeupdate",v),()=>{T.removeEventListener("timeupdate",v),T.pause();}},[i.src,i.clipStart,i.clipEnd]),D(()=>{let T=s.current;if(!(!T||!u.current)&&!(T.currentTime>=i.clipEnd))if(o){let v=T.play();v&&v.catch(()=>{});}else T.pause();},[o,i.clipEnd]),c("g",{className:"block-layer block-layer--video","data-layer-id":e.id,children:c("foreignObject",{x:h,y:g,width:d,height:m,children:c("video",{ref:s,src:y,poster:_,muted:true,playsInline:true,preload:"auto","data-clip-start":i.clipStart,"data-clip-end":i.clipEnd,style:{width:`${d}px`,height:`${m}px`,objectFit:i.fit||"cover",objectPosition:"center",display:"block",pointerEvents:"none"}})})})}function jr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{headers:a,rows:s,align:u,style:l}=r,p=z(o.x,t.width),d=z(o.y,t.height),m=o.width?z(o.width,t.width):t.width,f=o.height?z(o.height,t.height):t.height,h=de(o.anchor,m,f),g=p+h.x,y=d+h.y,x=i?oe(i,n):{},_=v=>{let M=u?.[v];return M?{textAlign:M}:void 0},T=l.borderRadius??8;return c("foreignObject",{x:g,y,width:m,height:f,style:x,children:c("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{width:`${m}px`,height:`${f}px`,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",boxSizing:"border-box"},children:c("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:`${l.fontSize}px`,fontFamily:l.fontFamily??"system-ui, sans-serif",overflow:"hidden",borderRadius:`${T}px`,border:`1px solid ${l.borderColor}`},children:[a.length>0&&c("thead",{children:c("tr",{children:a.map((v,M)=>c("th",{style:{background:l.headerBackground,color:l.headerColor,fontFamily:l.headerFontFamily??l.fontFamily??"system-ui, sans-serif",fontWeight:600,padding:"12px 16px",borderBottom:`2px solid ${l.borderColor}`,borderRight:M<a.length-1?`1px solid ${l.borderColor}`:void 0,..._(M)},children:v},M))})}),s.length>0&&c("tbody",{children:s.map((v,M)=>c("tr",{children:v.map((L,P)=>c("td",{style:{background:l.cellBackground,color:l.cellColor,padding:"10px 16px",borderBottom:M<s.length-1?`1px solid ${l.borderColor}`:void 0,borderRight:P<v.length-1?`1px solid ${l.borderColor}`:void 0,..._(P)},children:L},P))},M))})]})})})}var zi={width:1920,height:1080};function qe({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=zi,isPlaying:a}){let s="",u={};e.transition&&r?(s=Ke(e.transition.type,true),u["--transition-duration"]=`${e.transition.duration}s`):e.transition&&o&&(s=Ke(e.transition.type,false),u["--transition-duration"]=`${e.transition.duration}s`);let l=`vb-clip-${e.id}`;return c("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:[c("defs",{children:c("clipPath",{id:l,children:c("rect",{x:"0",y:"0",width:i.width,height:i.height})})}),c("g",{clipPath:`url(#${l})`,children:(e.layers??[]).map(p=>c(Oi,{layer:p,basePath:n,viewport:i,blockTime:t,isPlaying:a},p.id))})]})}function Oi({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case "image":return c(Or,{layer:e,basePath:t,viewport:n,blockTime:r});case "text":return c(Wr,{layer:e,viewport:n,blockTime:r});case "shape":return c(Hr,{layer:e,viewport:n,blockTime:r});case "map":return c(Vr,{layer:e,basePath:t,viewport:n,blockTime:r});case "video":return c(Yr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});case "table":return c(jr,{layer:e,viewport:n,blockTime:r});default:return console.warn(`Unknown layer type: ${e.type}`),null}}var Wi=4,Xr=2,Hi=6;function Ui(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 Vi(e){let t=[];for(let o of e.phrases)t.push(...Ui(o));if(t.length===0)return {words:[],chunks:[]};let n=Wi;if(t.length>n){let o=Math.ceil(t.length/n);n=Math.ceil(t.length/o),n=Math.min(Hi,Math.max(Xr,n));}else n=Math.max(Xr,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 Zr({captions:e,currentTime:t,enabled:n=true,theme:r,viewport:o}){let{chunks:i}=$(()=>e?Vi(e):{words:[],chunks:[]},[e]);if(!n||i.length===0)return c("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 u=r?.colors?.primary??"#5b9bd5",l=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 c("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:c("div",{style:{display:"inline-block",lineHeight:1.3},children:a.words.map((f,h)=>{let g=h===s;return c("span",{style:{fontFamily:l,fontSize:`${m}px`,fontWeight:g?800:600,color:g?u:"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 Gr({captions:e,currentTime:t,enabled:n=true,fontSize:r=16,captionStyle:o="standard",theme:i,viewport:a}){if(o==="social")return c(Zr,{captions:e,currentTime:t,enabled:n,theme:i,viewport:a});let u=(n&&e?Ve(e,t):null)?.text??null;return c("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:u?1:0,transition:"opacity 0.15s ease-in-out",padding:"0 4px",boxSizing:"border-box"},children:u&&c("div",{style:{display:"inline-block",padding:"3px 10px",background:"rgba(0, 0, 0, 0.65)",borderRadius:"4px",backdropFilter:"blur(4px)"},children:c("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:u})})})}var Yi="(prefers-color-scheme: dark)";function _t(e){let t=$(()=>e&&typeof window<"u"?window.matchMedia(Yi):null,[e]),n=U(o=>t?(t.addEventListener("change",o),()=>t.removeEventListener("change",o)):()=>{},[t]),r=U(()=>t?.matches?Xt:ht,[t]);return cr(n,r)}function Kr(e,t,n=""){let[r,o]=W(0),[i,a]=W(false),[s,u]=W(0),[l,p]=W(false),[d,m]=W(false),[f,h]=W(0),g=H([]),y=H(null),x=H(false),_=H(new Map),T=H(new Map),v=H(false);D(()=>{if(!t?.segments)return;let k=0;g.current=t.segments.map(b=>{let w=k;return k+=b.duration,w}),h(k);},[t]);let M=U(async k=>{let b=n?`${n}/${k}`:k;if(_.current.has(k))return _.current.get(k);if(T.current.has(k))return T.current.get(k);let w=(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 _.current.set(k,R),R}catch{return b}finally{T.current.delete(k);}})();return T.current.set(k,w),w},[n]);D(()=>{if(!t?.segments)return;t.segments.forEach(b=>{M(b.src);});let k=_.current;return ()=>{k.forEach(b=>{URL.revokeObjectURL(b);}),k.clear();}},[t,M]),D(()=>{let k=e.current;if(!k)return;let b=()=>{let N=(g.current[s]||0)+k.currentTime;o(N);},w=()=>{v.current=false,a(true);},C=()=>a(false),F=()=>{m(true);},R=()=>{t&&s<t.segments.length-1?(x.current=true,u(O=>O+1)):(p(true),a(false));};return k.addEventListener("timeupdate",b),k.addEventListener("play",w),k.addEventListener("pause",C),k.addEventListener("ended",R),k.addEventListener("error",F),()=>{k.removeEventListener("timeupdate",b),k.removeEventListener("play",w),k.removeEventListener("pause",C),k.removeEventListener("ended",R),k.removeEventListener("error",F);}},[e,s,t]),D(()=>{let k=e.current;if(!k||!t?.segments)return;let b=t.segments[s];if(!b)return;let w=()=>{if(y.current!==null){let O=g.current[s]||0,N=y.current-O;k.currentTime=Math.max(0,N),o(y.current),y.current=null;}x.current&&(k.play().catch(()=>{}),x.current=false);},C=k.src,F=_.current.get(b.src);C&&(C===F||C.endsWith(b.src))?w():(async()=>{let N=await M(b.src),K=()=>{m(true),w(),k.removeEventListener("canplay",K);};k.addEventListener("canplay",K),k.src=N,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener("canplay",K),m(true),w());})();},[e,s,t,M]);let L=U(()=>{let k=e.current;k&&(l&&(u(0),p(false)),k.play().then(()=>{v.current=false;}).catch(()=>{v.current=true,a(true);}));},[e,l]),P=U(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),q=U(()=>{e.current&&(i?P():L());},[e,i,L,P]),j=U(k=>{let b=e.current;if(!b||!t?.segments)return;let w=f>0?Math.max(0,Math.min(k,f)):Math.max(0,k),C=0,F=0;for(let O=0;O<t.segments.length;O++){let N=F+t.segments[O].duration;if(w<N){C=O;break}F=N,O===t.segments.length-1&&(C=O);}let R=!b.paused;if(p(false),C!==s)y.current=w,x.current=R,u(C);else {let O=w-F;b.currentTime=Math.max(0,O),o(w);}},[e,t,s,f]),V=U(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),p(false));},[t]),ae=U(async()=>{j(0),await new Promise(k=>setTimeout(k,50)),L();},[j,L]);return D(()=>{if(!i||!v.current||!f)return;let k=performance.now(),b,w=C=>{if(!v.current)return;let F=(C-k)/1e3;k=C,o(R=>{let O=R+F;return O>=f?(v.current=false,p(true),a(false),f):O}),b=requestAnimationFrame(w);};return b=requestAnimationFrame(w),()=>cancelAnimationFrame(b)},[i,f]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:f,isEnded:l,isReady:d,isAvailable:true,play:async()=>L(),pause:async()=>P(),toggle:async()=>q(),seekTo:async k=>j(k),skipToSegment:async k=>V(k),restart:ae}}function Qr(e,t,n=te.landscape,r=false,o){let [i,a]=W({entering:false,exiting:false,previousBlock:null}),s=$(()=>{if(!e?.blocks)return [];let L=e.blocks.some(q=>q.children&&q.children.length>0)?bt(e.blocks):e.blocks;if(L.some(re)){let q=e.audio?.segments?.map(V=>({startTime:V.startTime,duration:V.duration}));return nn(L,{audioSegments:q,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return L},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=$(()=>jt(s,t),[s,t]),l=$(()=>u?s.indexOf(u):-1,[s,u]),p=$(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=$(()=>!u||u.duration===0?0:Math.min(1,p/u.duration),[u,p]),m=$(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);$(()=>u,[l]);D(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let L=u.transition?.duration||0;if(L>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let P=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},L*1e3);return ()=>clearTimeout(P)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let h=H(null);D(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let M=i.previousBlock;h.current=M,a(L=>({...L,previousBlock:u}));}},[u?.id,r]);let g=u?.transition?.duration||0,y=r&&g>0&&p<g,x=y&&h.current!==null,_=U(M=>{if(!e||M<0||M>=s.length)return;let L=s[M];if(L)return L.startTime},[e,s]),T=U(()=>{if(l<s.length-1)return _(l+1)},[l,s.length,_]),v=U(()=>{if(l>0)return _(l-1)},[l,_]);return {currentBlock:u,currentBlockIndex:l,previousBlock:r?x?h.current:null:i.exiting?i.previousBlock:null,isEntering:r?y:i.entering,isExiting:r?x:i.exiting,blockTime:p,blockProgress:d,docProgress:m,nextBlock:T,prevBlock:v,goToBlock:_,blocks:s}}function Xi(e,t){let n=e/t;return n>1.2?"landscape":n<.83?"portrait":"landscape"}function Zi(e){switch(e){case "portrait":return te.portrait;case "square":return te.square;default:return te.landscape}}function Jr(){let[e,t]=W(()=>({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=$(()=>Xi(e.width,e.height),[e.width,e.height]);return {viewport:$(()=>Zi(n),[n]),orientation:n,windowSize:e}}function Qe(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}function xt({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=H(null),[a,s]=W(null),u=U(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);},[]),l=U(()=>{s(null);},[]),p=U(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 c("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:u,onMouseLeave:l,children:[c("div",{style:{position:"absolute",left:0,right:0,height:"6px",background:"rgba(255,255,255,0.2)",borderRadius:"3px"}}),c("div",{style:{position:"absolute",left:0,width:`${e.docProgress*100}%`,height:"6px",background:"#5b9bd5",borderRadius:"3px",transition:"width 0.1s"}}),n.map((d,m)=>c("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&&c("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:[c("div",{style:{color:"white",fontSize:"12px",fontFamily:"monospace"},children:Qe(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=p(d);return m&&o?c("div",{style:{color:"rgba(255,255,255,0.7)",fontSize:"11px",marginTop:"2px"},children:o(m.block)}):null})()]}),a!==null&&c("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 eo({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return c("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:[c("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:c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("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"})})}),c("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?c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:c("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}):c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"20",height:"20",children:c("path",{d:"M8 5v14l11-7z"})})}),c("span",{style:{color:"white",fontSize:"12px",minWidth:"80px",fontFamily:"monospace"},children:[Qe(e.currentTime)," / ",Qe(e.totalDuration)]}),c(xt,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),c("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"11px",whiteSpace:"nowrap"},children:[e.currentBlockIndex+1,"/",e.totalBlocks]}),e.hasCaptions&&c("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:[c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("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"&&c("span",{style:{fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.captionMode==="standard"?"CC":"SM"})]}),t.toggleFullscreen&&c("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?c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}):c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})]})}function to({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return c("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:[c("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:c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})})}),c("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"}),c("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:c("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:c("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})})})]})}function ie(e,t=""){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case "text":{if(!n.value.includes(`
4
+ `))return c(ee,{children:n.value},o);let i=n.value.split(`
5
+ `);return c(ee,{children:i.map((a,s)=>c(ee,{children:[s>0&&c("br",{}),a]},s))},o)}case "emphasis":return c("em",{className:"squisq-md-em",children:ie(n.children,o)},o);case "strong":return c("strong",{className:"squisq-md-strong",children:ie(n.children,o)},o);case "delete":return c("del",{className:"squisq-md-del",children:ie(n.children,o)},o);case "inlineCode":return c("code",{className:"squisq-md-inline-code",children:n.value},o);case "link":return c("a",{className:"squisq-md-link",href:n.url,title:n.title??void 0,target:"_blank",rel:"noopener noreferrer",children:ie(n.children,o)},o);case "image":return c(Ji,{src:n.url,alt:n.alt??"",title:n.title??void 0},o);case "break":return c("br",{},o);case "inlineMath":return c("code",{className:"squisq-md-inline-math",children:n.value},o);case "htmlInline":return c("span",{className:"squisq-md-html-inline",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case "footnoteReference":return c("sup",{className:"squisq-md-footnote-ref",children:c("a",{href:`#fn-${n.identifier}`,children:["[",n.label??n.identifier,"]"]})},o);case "linkReference":return c("span",{className:"squisq-md-link-ref",children:ie(n.children,o)},o);case "imageReference":return c("span",{className:"squisq-md-image-ref",children:["[",n.alt??n.identifier,"]"]},o);case "textDirective":return c("span",{className:"squisq-md-text-directive","data-directive":n.name,children:ie(n.children,o)},o);case "mention":return c("span",{className:"squisq-md-mention mention","data-mention":"true","data-kind":n.targetKind,"data-id":n.targetId,"data-label":n.displayName,children:["@",n.displayName]},o);default:return null}})}function Ki(e,t){switch(e.type){case "paragraph":return c("p",{className:"squisq-md-p",children:ie(e.children,t)},t);case "heading":{let n=`h${e.depth}`;return c(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:ie(e.children,t)},t)}case "blockquote":return c("blockquote",{className:"squisq-md-blockquote",children:$e(e.children,t)},t);case "list":return e.ordered?c("ol",{className:"squisq-md-list squisq-md-ol",start:e.start??void 0,children:e.children.map((n,r)=>no(n,`${t}li${r}`))},t):c("ul",{className:"squisq-md-list squisq-md-ul",children:e.children.map((n,r)=>no(n,`${t}li${r}`))},t);case "code":return c("pre",{className:"squisq-md-code-block",children:c("code",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case "thematicBreak":return c("hr",{className:"squisq-md-hr"},t);case "table":return Qi(e.children,e.align,t);case "htmlBlock":return c("div",{className:"squisq-md-html-block",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case "math":return c("pre",{className:"squisq-md-math-block",children:c("code",{children:e.value})},t);case "definition":return null;case "footnoteDefinition":return c("div",{className:"squisq-md-footnote-def",id:`fn-${e.identifier}`,children:[c("sup",{children:e.label??e.identifier}),$e(e.children,t)]},t);case "containerDirective":return c("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:[e.label&&c("div",{className:"squisq-md-directive-label",children:e.label}),$e(e.children,t)]},t);case "leafDirective":return c("div",{className:`squisq-md-directive squisq-md-directive-${e.name}`,"data-directive":e.name,children:ie(e.children,t)},t);case "definitionList":return c("dl",{className:"squisq-md-dl",children:e.children.map((n,r)=>n.type==="definitionTerm"?c("dt",{className:"squisq-md-dt",children:ie(n.children,`${t}dt${r}`)},`${t}dt${r}`):c("dd",{className:"squisq-md-dd",children:$e(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function no(e,t){let n=e.checked!==null&&e.checked!==void 0;return c("li",{className:`squisq-md-li${n?" squisq-md-task":""}`,children:[n&&c("input",{type:"checkbox",checked:!!e.checked,readOnly:true,className:"squisq-md-checkbox"}),$e(e.children,t)]},t)}function Qi(e,t,n){let[r,...o]=e;return c("table",{className:"squisq-md-table",children:[r&&c("thead",{children:c("tr",{children:r.children.map((i,a)=>c("th",{className:"squisq-md-th",style:t?.[a]?{textAlign:t[a]}:void 0,children:ie(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&c("tbody",{children:o.map((i,a)=>c("tr",{children:i.children.map((s,u)=>c("td",{className:"squisq-md-td",style:t?.[u]?{textAlign:t[u]}:void 0,children:ie(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function $e(e,t=""){return e.map((n,r)=>Ki(n,`${t}b${r}`))}function Ji({src:e,alt:t,title:n}){let r=Ae(e,".");return c("img",{className:"squisq-md-image",src:r,alt:t,title:n})}function vt({nodes:e,className:t}){return !e||e.length===0?null:c("div",{className:`squisq-md ${t||""}`,children:$e(e)})}function ea(e){let t=e.sourceHeading?.templateAnnotation;return t?!!t.template&&rn(t.template):false}function ro(e){let t=0;for(let n of e)t++,n.children&&(t+=ro(n.children));return t}function oo({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=ea(e),a=$(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=ye(e.sourceHeading),l=ta(e.contents),p={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...oa(s.template??"sectionHeader",u,l,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=on(p,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return c("div",{className:"squisq-linear-section","data-block-id":e.id,"data-template":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&c(vt,{nodes:[e.sourceHeading]}),i&&a&&c("div",{className:"squisq-linear-card",children:[e.sourceHeading&&c("div",{className:"squisq-linear-card-label squisq-md",children:c(vt,{nodes:[e.sourceHeading]})}),c("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:c(qe,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&c(vt,{nodes:e.contents}),e.children&&e.children.length>0&&c("div",{className:"squisq-linear-children",children:e.children.map((s,u)=>c(oo,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function ta(e){return !e||e.length===0?"":e.map(t=>ye(t)).join(`
6
+ `).trim()}function na(e){if(!e)return [];let t=[];for(let n of e)if(n.type==="list")for(let r of n.children){let o=ye(r).trim();o&&t.push(o);}return t}function ra(e){if(!e)return null;for(let t of e)if(t.type==="table"){let n=t,[r,...o]=n.children;if(!r)return null;let i=r.children.map(s=>ye(s).trim()),a=o.map(s=>s.children.map(u=>ye(u).trim()));return {headers:i,rows:a,align:n.align}}return null}function oa(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":{let o=na(r);return {items:o.length>0?o:["Item 1","Item 2","Item 3"]}}case "definitionCard":return {term:t,definition:n||t};case "dateEvent":return {date:t,description:n||t};case "dataTable":return ra(r)??{headers:["Column"],rows:[["Data"]]};default:return {}}}function kt({doc:e,basePath:t="/",viewport:n,className:r,theme:o,surface:i,thinMargins:a=false,imageDisplayMode:s="inline"}){let u=n??te.landscape,l=$(()=>ro(e.blocks),[e.blocks]),p=_t(i==="auto"),d=i==="auto"?p:i,m=$(()=>{let M=o??he;return {theme:d?Ye(M,d):M,viewport:u,totalBlocks:l}},[u,l,o,d]),f=m.theme,h=f.colors.background,g=f.colors.text,y=f.colors.textMuted,x=f.colors.primary,_=f.typography.bodyFontFamily,T=f.typography.titleFontFamily,v=f.typography.lineHeight??1.7;return c("div",{className:`squisq-linear ${r||""}`,style:{width:"100%",height:a?"auto":"100%",overflowY:a?"visible":"auto",overflowX:"hidden",background:h},children:c("div",{className:`squisq-linear-content squisq-md${a?" squisq-linear-content--thin":""}${s==="thumbnail"?" squisq-linear-content--thumbnail-images":""}`,style:{maxWidth:a?"none":"720px",margin:a?"0":"0 auto",padding:a?"0":"24px 16px",lineHeight:v,fontSize:"16px",fontFamily:_,color:g,"--squisq-linear-title-font":T,"--squisq-linear-body-font":_,"--squisq-linear-text":g,"--squisq-linear-muted":y,"--squisq-linear-primary":x,"--squisq-linear-bg":h},children:[c("style",{children:`
4
7
  .squisq-linear-content h1,
5
8
  .squisq-linear-content h2,
6
9
  .squisq-linear-content h3,
@@ -59,6 +62,20 @@ var SquisqPlayer=(function(exports){'use strict';var st,B,vn,ve,bn,kn,wn,Sn,Lt,T
59
62
  border-top: 1px solid var(--squisq-linear-muted);
60
63
  margin: 1.5em 0;
61
64
  }
65
+ .squisq-linear-content img {
66
+ max-width: 100%;
67
+ height: auto;
68
+ border-radius: 6px;
69
+ margin: 0.5em 0;
70
+ }
71
+ .squisq-linear-content--thumbnail-images img {
72
+ max-width: 100px;
73
+ max-height: 100px;
74
+ width: auto;
75
+ height: auto;
76
+ object-fit: contain;
77
+ display: block;
78
+ }
62
79
  .squisq-linear-content strong {
63
80
  font-weight: 700;
64
81
  }
@@ -86,7 +103,8 @@ var SquisqPlayer=(function(exports){'use strict';var st,B,vn,ve,bn,kn,wn,Sn,Lt,T
86
103
  .squisq-linear-content tbody tr:hover {
87
104
  background: color-mix(in srgb, var(--squisq-linear-primary) 8%, transparent);
88
105
  }
89
- `}),e.blocks.map((y,v)=>l(jr,{block:y,basePath:t,viewport:i,renderContext:s,blockIndex:v},y.id))]})})}var Ui=new Set(["a","an","the","and","but","or","for","nor","on","at","to","in","of","by","is"]);function Xr(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||!Ui.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(" ");t.set(n,i);}}return t}function Zr({script:e,basePath:t,renderMode:n=false,autoPlay:r=false,onEnded:o,onTimeUpdate:i,audioProvider:a,showControls:s=true,showScrubber:u=false,muted:c=false,captionsEnabled:p,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:f,isFullscreen:h=false,onFullscreenToggle:g,onBlockMarkers:y,forceViewport:v,displayMode:x="video",theme:S,captionStyle:w="standard"}){let C=x==="slideshow",P=x==="linear",R=V(null),N=V(null),[Y,W]=U(null),ae=V(),{viewport:k,orientation:b}=Wr(),_=v||(n?J.landscape:k),M=$(()=>typeof window>"u"?false:new URLSearchParams(window.location.search).get("debug")==="true",[]),F=zr(R,e.audio,t),q=a||F,{currentTime:E,isPlaying:D,currentSegment:oe,totalDuration:se,isEnded:Qt,isReady:Jt,isAvailable:Qr,unavailableMessage:en,play:Ge,pause:Me,toggle:Ae,seekTo:le,skipToSegment:Ki,restart:tn}=q,_t=V(E);_t.current=E;let nn=V(se);nn.current=se;let rn=V(0),Jr=Z(T=>{if(n||C||P||T.target.closest("button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow"))return;Ae(),W(D?"play":"pause"),clearTimeout(ae.current),ae.current=setTimeout(()=>W(null),600);},[n,Ae,D,C,P]),{currentBlock:we,currentBlockIndex:_e,previousBlock:on,isEntering:eo,isExiting:to,blockTime:xt,docProgress:vt,blocks:j}=Or(e,E,_,n,S),xe=$(()=>{let T=e.startBlock;if(!T)return null;let A=ge(S??he,0,1,_);return {id:"cover-block",startTime:-1,duration:0,audioSegment:-1,layers:Vt(T,A)}},[e.startBlock,_,S]),[no,an]=U(false),[ro,sn]=U(false),ln=V(),kt=V(false);xe&&!D&&E===0&&!n&&!r&&(kt.current=true),z(()=>{if(D&&kt.current&&xe&&!n)return kt.current=false,sn(true),ln.current=setTimeout(()=>sn(false),3e3),()=>clearTimeout(ln.current)},[D,xe,n]);let Ke=!C&&!P&&xe&&(no||ro||!D&&E===0&&!n&&!r),cn=V(false);z(()=>{Jt&&r&&!cn.current&&(cn.current=true,Ge());},[Jt,r,Ge]),z(()=>{i?.(E);},[E,i]),z(()=>{Qt&&o?.();},[Qt,o]),z(()=>{if((n||M)&&typeof window<"u"){let T=window;T.seekTo=A=>(le(A),new Promise(H=>{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 ao=A-Q,hn=[],gn=document.querySelector(".doc-player__block--active");gn&&gn.querySelectorAll("video[data-clip-start]").forEach(De=>{let Ie=De,so=parseFloat(Ie.dataset.clipStart||"0"),lo=parseFloat(Ie.dataset.clipEnd||"0"),yn=Math.min(so+Math.max(0,ao),lo);Ie.pause(),Ie.currentTime=yn,hn.push(new Promise(St=>{Math.abs(Ie.currentTime-yn)<.1?St():(Ie.addEventListener("seeked",()=>St(),{once:true}),setTimeout(St,200));}));}),Promise.all(hn).then(()=>{requestAnimationFrame(()=>H());});});})),T.getDuration=()=>{if(se>0)return se;if(j.length>0){let A=j[j.length-1];return A.startTime+A.duration}return 0},T.getBlocks=()=>j.map(A=>({id:A.id,template:A.template??"raw",startTime:A.startTime,duration:A.duration})),T.getAudioSegments=()=>e.audio.segments.map(A=>({src:A.src,name:A.name,duration:A.duration,startTime:A.startTime})),T.getCaptions=()=>e.captions?.phrases?.map(A=>({text:A.text,startTime:A.startTime,endTime:A.endTime}))||[],T.getChapters=()=>{let A=Xr(e);return e.audio.segments.map((H,Q)=>({title:A.get(Q)||H.name,startTime:H.startTime,duration:H.duration}))},T.showCover=()=>(an(true),new Promise(A=>requestAnimationFrame(()=>A()))),T.hideCover=()=>(an(false),new Promise(A=>requestAnimationFrame(()=>A()))),T.hasCoverBlock=()=>!!xe;}return ()=>{if(typeof window<"u"){let T=window;delete T.seekTo,delete T.getDuration,delete T.getBlocks,delete T.getAudioSegments,delete T.getCaptions,delete T.getChapters,delete T.showCover,delete T.hideCover,delete T.hasCoverBlock;}}},[n,M,le,se,j,xe]);let oo=p===false?"off":w||"standard",[Qe,un]=U(oo),Se=Qe!=="off",io=Qe==="social"?"social":"standard",dn=Z(T=>{un(T?w||"standard":"off"),d?.(T);},[d,w]),fn=Z(()=>{un(T=>{let A=T==="off"?"standard":T==="standard"?"social":"off";return d?.(A!=="off"),A});},[d]),Je=e.captions&&e.captions.phrases.length>0,pn=$(()=>Xr(e),[e]),qe=$(()=>({isPlaying:D,currentTime:E,totalDuration:se,currentBlockIndex:_e,totalBlocks:j.length,docProgress:vt,hasCaptions:!!Je,captionsEnabled:Se,captionMode:Qe,isFullscreen:h,currentSegmentIndex:oe,currentSegmentName:pn.get(oe)??e.audio.segments[oe]?.name??null,currentBlock:we??null}),[D,E,se,_e,j.length,vt,Je,Se,Qe,h,oe,pn,we]),et=$(()=>({toggle:Ae,restart:tn,seekTo:le,setCaptionsEnabled:dn,cycleCaptionMode:fn,toggleFullscreen:g}),[Ae,tn,le,dn,fn,g]),Le=$(()=>({nextSlide:()=>{if(_e<j.length-1){let T=j[_e+1];T&&(le(T.startTime),Me());}},prevSlide:()=>{if(_e>0){let T=j[_e-1];T&&(le(T.startTime),Me());}},goToSlide:T=>{if(T>=0&&T<j.length){let A=j[T];A&&(le(A.startTime),Me());}}}),[_e,j,le,Me]);z(()=>{m?.(qe);},[qe,m]),z(()=>{f?.({play:Ge,pause:Me,...et});},[Ge,Me,et,f]);let tt=Z(T=>{let A=T;if(ne(A)){let H=A;if(typeof H.title=="string")return H.title;if(typeof H.stat=="string")return H.stat;if(typeof H.quote=="string"){let Q=H.quote.split(`
90
- `)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}if(typeof H.date=="string")return H.date;if(typeof H.fact=="string")return H.fact}if(T.layers&&Array.isArray(T.layers)){let H=T.layers.find(Q=>Q.type==="text");if(H?.content?.text){let Q=H.content.text.split(`
91
- `)[0];return Q.length<=30?Q:Q.slice(0,27)+"..."}}return T.id.replace(/-/g," ").replace(/\b\w/g,H=>H.toUpperCase())},[]),Ne=$(()=>{if(!se||!j.length)return [];let T=-1;return j.map((A,H)=>{let Q=A.audioSegment!==T;return T=A.audioSegment,{block:A,index:H,position:A.startTime/se*100,title:tt(A),isSectionStart:Q}})},[j,se,tt]);z(()=>{Ne.length>0&&y?.(Ne);},[Ne,y]),rn.current=j.length;let wt=Z(T=>{let A=document.activeElement;if(!(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.tagName==="SELECT"))&&!P)if(C)switch(T.key){case "ArrowRight":case "ArrowDown":case " ":T.preventDefault(),Le.nextSlide();break;case "ArrowLeft":case "ArrowUp":T.preventDefault(),Le.prevSlide();break;case "Home":T.preventDefault(),Le.goToSlide(0);break;case "End":T.preventDefault(),Le.goToSlide(rn.current-1);break}else switch(T.key){case " ":T.preventDefault(),Ae();break;case "ArrowRight":le(Math.min(_t.current+10,nn.current));break;case "ArrowLeft":le(Math.max(_t.current-10,0));break}},[C,P,Ae,le,Le]);return z(()=>{if(!n)return window.addEventListener("keydown",wt),()=>window.removeEventListener("keydown",wt)},[wt,n]),P?l("div",{ref:N,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:N,className:"doc-player",onClick:Jr,style:{position:"relative",width:"100%",aspectRatio:`${_.width} / ${_.height}`,margin:"0 auto",overflow:"hidden",cursor:n?void 0:"pointer"},children:[l("audio",{ref:R,preload:"auto",muted:c}),l("div",{className:"doc-player__viewport",children:[Ke&&xe&&l("div",{className:"doc-player__block doc-player__block--cover",children:l(Fe,{block:xe,blockTime:0,basePath:t,isEntering:false,viewport:_})}),!Ke&&on&&to&&l("div",{className:"doc-player__block doc-player__block--previous",children:l(Fe,{block:on,blockTime:xt,basePath:t,isExiting:true,viewport:_})}),!Ke&&we&&l("div",{className:"doc-player__block doc-player__block--active",children:l(Fe,{block:we,blockTime:xt,basePath:t,isEntering:eo,viewport:_,isPlaying:D})}),Je&&(n?Se:true)&&l($r,{captions:e.captions,currentTime:E,enabled:Se&&(n||D||E>0),fontSize:16,captionStyle:io,theme:S,viewport:_}),M&&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:we?.template??"raw"})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"block:"})," ",_e+1,"/",j.length," ",l("span",{style:{color:"#666"},children:["(",we?.id||"none",")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"time:"})," ",E.toFixed(2),"s /"," ",se.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 /"," ",(we?.duration||0).toFixed(1),"s"]}),l("div",{children:[l("span",{style:{color:"#888"},children:"segment:"})," ",oe,"/",e.audio.segments.length-1," ",l("span",{style:{color:"#666"},children:["(",e.audio.segments[oe]?.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"}),Ke&&l("span",{style:{color:"#60a5fa"},children:" (cover)"})]}),Je&&(()=>{let T=We(e.captions,E),A=Se&&(D||E>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:Se?"#4ade80":"#666"},children:["(",Se?"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(E>0),")"]})]}),l("div",{children:[l("span",{style:{color:"#888"},children:"cc.phrase:"})," ",l("span",{style:{color:T?"#4ade80":"#f87171"},children:T?`"${T.text.slice(0,30)}..."`:"null"})]}),T&&l("div",{children:[l("span",{style:{color:"#888"},children:"cc.range:"})," ",l("span",{style:{color:"#60a5fa"},children:[T.startTime.toFixed(2),"-",T.endTime.toFixed(2)]})]})]})})()]})]}),!Qr&&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&&!C&&s&&l(Hr,{state:qe,actions:et,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:tt}),!n&&!C&&!s&&u&&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:et,blockMarkers:Ne,expandedBlocks:j,getBlockTitle:tt})}),!n&&C&&l(Ur,{state:qe,slideNav:Le}),!C&&Y&&l("div",{className:"doc-player__tap-feedback",children:l("svg",{viewBox:"0 0 24 24",fill:"white",width:"48",height:"48",children:Y==="pause"?l("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}):l("path",{d:"M8 5v14l11-7z"})})},Date.now())]})}var Gr={};var Kr=false;function Yi(){if(Kr||typeof document>"u")return;let e=document.createElement("style");e.setAttribute("data-squisq-player","animations"),e.textContent=Gr,document.head.appendChild(e),Kr=true;}function ji(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:Xi(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 Xi(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 Zi(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 Gi(e,t,n={}){Yi();let{mode:r="slideshow",basePath:o=".",images:i,audio:a,autoPlay:s=false,theme:u,renderMode:c=false,captionStyle:p}=n,d=a?Zi(t,a):t,m=i?ji(i,o):null,f;r==="static"?f=me(yt,{doc:d,basePath:o,theme:u}):f=me(Zr,{script:d,basePath:o,displayMode:"slideshow",autoPlay:c?false:s,showControls:!c,renderMode:c,theme:u,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 Ac(e,t,n={}){Gi(e,t,{...n,mode:"static"});}function Lc(e){let t=bt.get(e);t&&(t.unmount(),bt.delete(e));}var Ic="1.1.0";exports.mount=Gi;exports.mountStatic=Ac;exports.unmount=Lc;exports.version=Ic;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map
106
+ `}),e.blocks.map((M,L)=>c(oo,{block:M,basePath:t,viewport:u,renderContext:m,blockIndex:L},M.id))]})})}var ia=new Set(["a","an","the","and","but","or","for","nor","on","at","to","in","of","by","is"]);function io(e){let t=new Map;for(let n of e.blocks)if(re(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||!ia.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(" ");t.set(n,i);}}return t}function ao({script:e,basePath:t,renderMode:n=false,autoPlay:r=false,onEnded:o,onTimeUpdate:i,audioProvider:a,showControls:s=true,showScrubber:u=false,muted:l=false,captionsEnabled:p,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:f,isFullscreen:h=false,onFullscreenToggle:g,onBlockMarkers:y,forceViewport:x,displayMode:_="video",theme:T,surface:v,captionStyle:M="standard"}){let L=_==="slideshow",P=_==="linear",q=H(null),j=H(null),[V,ae]=W(null),k=H(),{viewport:b,orientation:w}=Jr(),C=x||(n?te.landscape:b),F=$(()=>typeof window>"u"?false:new URLSearchParams(window.location.search).get("debug")==="true",[]),R=Kr(q,e.audio,t),O=a||R,{currentTime:N,isPlaying:K,currentSegment:Ie,totalDuration:se,isEnded:cn,isReady:un,isAvailable:co,unavailableMessage:dn,play:Je,pause:Le,toggle:Ee,seekTo:le,skipToSegment:fa,restart:fn}=O,St=H(N);St.current=N;let pn=H(se);pn.current=se;let mn=H(0),uo=U(S=>{if(n||L||P||S.target.closest("button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow"))return;Ee(),ae(K?"play":"pause"),clearTimeout(k.current),k.current=setTimeout(()=>ae(null),600);},[n,Ee,K,L,P]),fo=_t(v==="auto"),Tt=v==="auto"?fo:v,et=$(()=>{let S=T??he;return Tt?Ye(S,Tt):S},[T,Tt]),{currentBlock:we,currentBlockIndex:_e,previousBlock:hn,isEntering:po,isExiting:mo,blockTime:Ct,docProgress:Mt,blocks:Z}=Qr(e,N,C,n,et),xe=$(()=>{let S=e.startBlock;if(!S)return null;let A=ge(et,0,1,C);return {id:"cover-block",startTime:-1,duration:0,audioSegment:-1,layers:tn(S,A)}},[e.startBlock,C,et]),[ho,gn]=W(false),[go,yn]=W(false),bn=H(),At=H(false),It=H(false);xe&&!K&&N===0&&!It.current&&!n&&!r&&(At.current=true),D(()=>{K&&At.current&&xe&&!n&&(At.current=false,It.current=true,yn(true),bn.current=setTimeout(()=>yn(false),3e3));},[K,xe,n]),D(()=>()=>clearTimeout(bn.current),[]);let tt=!L&&!P&&xe&&(ho||go||!K&&N===0&&!It.current&&!n&&!r),_n=H(false);D(()=>{un&&r&&!_n.current&&(_n.current=true,Je());},[un,r,Je]),D(()=>{i?.(N);},[N,i]),D(()=>{cn&&o?.();},[cn,o]),D(()=>{if((n||F)&&typeof window<"u"){let S=window;S.seekTo=A=>(le(A),new Promise(Y=>{requestAnimationFrame(()=>{let J=0;for(let fe=Z.length-1;fe>=0;fe--)if(A>=Z[fe].startTime){J=Z[fe].startTime;break}let Sn=(A-J)*1e3;document.getAnimations().forEach(fe=>{let ze=fe.effect?.target;ze&&(ze.closest(".doc-player__block--active")||ze.closest(".doc-player__block--previous"))&&(fe.currentTime=Math.max(0,Sn));});let _o=A-J,Tn=[],Cn=document.querySelector(".doc-player__block--active");Cn&&Cn.querySelectorAll("video[data-clip-start]").forEach(ze=>{let Fe=ze,xo=parseFloat(Fe.dataset.clipStart||"0"),vo=parseFloat(Fe.dataset.clipEnd||"0"),Mn=Math.min(xo+Math.max(0,_o),vo);Fe.pause(),Fe.currentTime=Mn,Tn.push(new Promise(Et=>{Math.abs(Fe.currentTime-Mn)<.1?Et():(Fe.addEventListener("seeked",()=>Et(),{once:true}),setTimeout(Et,200));}));}),Promise.all(Tn).then(()=>{requestAnimationFrame(()=>Y());});});})),S.getDuration=()=>{if(se>0)return se;if(Z.length>0){let A=Z[Z.length-1];return A.startTime+A.duration}return 0},S.getBlocks=()=>Z.map(A=>({id:A.id,template:A.template??"raw",startTime:A.startTime,duration:A.duration})),S.getAudioSegments=()=>e.audio.segments.map(A=>({src:A.src,name:A.name,duration:A.duration,startTime:A.startTime})),S.getCaptions=()=>e.captions?.phrases?.map(A=>({text:A.text,startTime:A.startTime,endTime:A.endTime}))||[],S.getChapters=()=>{let A=io(e);return e.audio.segments.map((Y,J)=>({title:A.get(J)||Y.name,startTime:Y.startTime,duration:Y.duration}))},S.showCover=()=>(gn(true),new Promise(A=>requestAnimationFrame(()=>A()))),S.hideCover=()=>(gn(false),new Promise(A=>requestAnimationFrame(()=>A()))),S.hasCoverBlock=()=>!!xe;}return ()=>{if(typeof window<"u"){let S=window;delete S.seekTo,delete S.getDuration,delete S.getBlocks,delete S.getAudioSegments,delete S.getCaptions,delete S.getChapters,delete S.showCover,delete S.hideCover,delete S.hasCoverBlock;}}},[n,F,le,se,Z,xe]);let yo=p===false?"off":M||"standard",[nt,xn]=W(yo),Se=nt!=="off",bo=nt==="social"?"social":"standard",vn=U(S=>{xn(S?M||"standard":"off"),d?.(S);},[d,M]),kn=U(()=>{xn(S=>{let A=S==="off"?"standard":S==="standard"?"social":"off";return d?.(A!=="off"),A});},[d]),rt=e.captions&&e.captions.phrases.length>0,wn=$(()=>io(e),[e]),Ne=$(()=>({isPlaying:K,currentTime:N,totalDuration:se,currentBlockIndex:_e,totalBlocks:Z.length,docProgress:Mt,hasCaptions:!!rt,captionsEnabled:Se,captionMode:nt,isFullscreen:h,currentSegmentIndex:Ie,currentSegmentName:wn.get(Ie)??e.audio.segments[Ie]?.name??null,currentBlock:we??null}),[K,N,se,_e,Z.length,Mt,rt,Se,nt,h,Ie,wn,we]),ot=$(()=>({toggle:Ee,restart:fn,seekTo:le,setCaptionsEnabled:vn,cycleCaptionMode:kn,toggleFullscreen:g}),[Ee,fn,le,vn,kn,g]),Be=$(()=>({nextSlide:()=>{if(_e<Z.length-1){let S=Z[_e+1];S&&(le(S.startTime),Le());}},prevSlide:()=>{if(_e>0){let S=Z[_e-1];S&&(le(S.startTime),Le());}},goToSlide:S=>{if(S>=0&&S<Z.length){let A=Z[S];A&&(le(A.startTime),Le());}}}),[_e,Z,le,Le]);D(()=>{m?.(Ne);},[Ne,m]),D(()=>{f?.({play:Je,pause:Le,...ot});},[Je,Le,ot,f]);let it=U(S=>{let A=S;if(re(A)){let Y=A;if(typeof Y.title=="string")return Y.title;if(typeof Y.stat=="string")return Y.stat;if(typeof Y.quote=="string"){let J=Y.quote.split(`
107
+ `)[0];return J.length<=30?J:J.slice(0,27)+"..."}if(typeof Y.date=="string")return Y.date;if(typeof Y.fact=="string")return Y.fact}if(S.layers&&Array.isArray(S.layers)){let Y=S.layers.find(J=>J.type==="text");if(Y?.content?.text){let J=Y.content.text.split(`
108
+ `)[0];return J.length<=30?J:J.slice(0,27)+"..."}}return S.id.replace(/-/g," ").replace(/\b\w/g,Y=>Y.toUpperCase())},[]),De=$(()=>{if(!se||!Z.length)return [];let S=-1;return Z.map((A,Y)=>{let J=A.audioSegment!==S;return S=A.audioSegment,{block:A,index:Y,position:A.startTime/se*100,title:it(A),isSectionStart:J}})},[Z,se,it]);D(()=>{De.length>0&&y?.(De);},[De,y]),mn.current=Z.length;let Lt=U(S=>{let A=document.activeElement;if(!(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.tagName==="SELECT"))&&!P)if(L)switch(S.key){case "ArrowRight":case "ArrowDown":case " ":S.preventDefault(),Be.nextSlide();break;case "ArrowLeft":case "ArrowUp":S.preventDefault(),Be.prevSlide();break;case "Home":S.preventDefault(),Be.goToSlide(0);break;case "End":S.preventDefault(),Be.goToSlide(mn.current-1);break}else switch(S.key){case " ":S.preventDefault(),Ee();break;case "ArrowRight":le(Math.min(St.current+10,pn.current));break;case "ArrowLeft":le(Math.max(St.current-10,0));break}},[L,P,Ee,le,Be]);return D(()=>{if(!n)return window.addEventListener("keydown",Lt),()=>window.removeEventListener("keydown",Lt)},[Lt,n]),P?c("div",{ref:j,className:"doc-player doc-player--linear",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:c(kt,{doc:e,basePath:t,viewport:C,theme:T,surface:v})}):c("div",{ref:j,className:"doc-player",onClick:uo,style:{position:"relative",width:"100%",aspectRatio:`${C.width} / ${C.height}`,margin:"0 auto",overflow:"hidden",cursor:n?void 0:"pointer"},children:[c("audio",{ref:q,preload:"auto",muted:l}),c("div",{className:"doc-player__viewport",children:[tt&&xe&&c("div",{className:"doc-player__block doc-player__block--cover",children:c(qe,{block:xe,blockTime:0,basePath:t,isEntering:false,viewport:C})}),!tt&&hn&&mo&&c("div",{className:"doc-player__block doc-player__block--previous",children:c(qe,{block:hn,blockTime:Ct,basePath:t,isExiting:true,viewport:C})}),!tt&&we&&c("div",{className:"doc-player__block doc-player__block--active",children:c(qe,{block:we,blockTime:Ct,basePath:t,isEntering:po,viewport:C,isPlaying:K})}),rt&&(n?Se:true)&&c(Gr,{captions:e.captions,currentTime:N,enabled:Se&&(n||K||N>0),fontSize:16,captionStyle:bo,theme:et,viewport:C}),F&&c("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:[c("div",{style:{color:"#ffcc00",fontWeight:"bold",marginBottom:"4px"},children:"DEBUG MODE"}),c("div",{children:[c("span",{style:{color:"#888"},children:"template:"})," ",c("span",{style:{color:"#ff6b6b"},children:we?.template??"raw"})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"block:"})," ",_e+1,"/",Z.length," ",c("span",{style:{color:"#666"},children:["(",we?.id||"none",")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"time:"})," ",N.toFixed(2),"s /"," ",se.toFixed(1),"s"," ",c("span",{style:{color:"#666"},children:["(progress: ",(Mt*100).toFixed(1),"%, scriptDur:"," ",e.duration.toFixed(1),")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"blockTime:"})," ",Ct.toFixed(2),"s /"," ",(we?.duration||0).toFixed(1),"s"]}),c("div",{children:[c("span",{style:{color:"#888"},children:"segment:"})," ",Ie,"/",e.audio.segments.length-1," ",c("span",{style:{color:"#666"},children:["(",e.audio.segments[Ie]?.name||"none",")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"viewport:"})," ",C.name||`${C.width}x${C.height}`," ",c("span",{style:{color:"#666"},children:["(",w,")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"playing:"})," ",c("span",{style:{color:K?"#4ade80":"#f87171"},children:K?"yes":"no"}),tt&&c("span",{style:{color:"#60a5fa"},children:" (cover)"})]}),rt&&(()=>{let S=Ve(e.captions,N),A=Se&&(K||N>0);return c(ee,{children:[c("div",{children:[c("span",{style:{color:"#888"},children:"captions:"})," ",e.captions?.phrases.length||0," phrases"," ",c("span",{style:{color:Se?"#4ade80":"#666"},children:["(",Se?"on":"off",")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"cc.enabled:"})," ",c("span",{style:{color:A?"#4ade80":"#f87171"},children:String(A)})," ",c("span",{style:{color:"#666"},children:["(playing=",String(K)," t>0=",String(N>0),")"]})]}),c("div",{children:[c("span",{style:{color:"#888"},children:"cc.phrase:"})," ",c("span",{style:{color:S?"#4ade80":"#f87171"},children:S?`"${S.text.slice(0,30)}..."`:"null"})]}),S&&c("div",{children:[c("span",{style:{color:"#888"},children:"cc.range:"})," ",c("span",{style:{color:"#60a5fa"},children:[S.startTime.toFixed(2),"-",S.endTime.toFixed(2)]})]})]})})()]})]}),!co&&dn&&c("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:[c("span",{style:{fontSize:"32px"},children:"\u{1F50A}"}),c("span",{children:dn})]}),!n&&!L&&s&&c(eo,{state:Ne,actions:ot,blockMarkers:De,expandedBlocks:Z,getBlockTitle:it}),!n&&!L&&!s&&u&&c("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:c(xt,{state:Ne,actions:ot,blockMarkers:De,expandedBlocks:Z,getBlockTitle:it})}),!n&&L&&c(to,{state:Ne,slideNav:Be}),!L&&V&&c("div",{className:"doc-player__tap-feedback",children:c("svg",{viewBox:"0 0 24 24",fill:"white",width:"48",height:"48",children:V==="pause"?c("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}):c("path",{d:"M8 5v14l11-7z"})})},Date.now())]})}var so={};var lo=false;function sa(){if(lo||typeof document>"u")return;let e=document.createElement("style");e.setAttribute("data-squisq-player","animations"),e.textContent=so,document.head.appendChild(e),lo=true;}function la(e,t){let n={};for(let r of Object.keys(e)){let o=r.split("/").pop();n[o]=e[r];}return {async resolveUrl(r){if(r in e)return e[r];let o=r.replace(/^\.\//,"");if(o!==r&&o in e)return e[o];let i=r.split("/").pop();return i in n?n[i]:r.startsWith("http")||r.startsWith("data:")||r.startsWith("blob:")?r:`${t}/${r}`},async listMedia(){return Object.keys(e).map(r=>({name:r,mimeType:ca(r),size:0}))},async addMedia(){throw new Error("Standalone player is read-only")},async removeMedia(){throw new Error("Standalone player is read-only")},dispose(){}}}function ca(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 ua(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 wt=new WeakMap;function da(e,t,n={}){sa();let{mode:r="slideshow",basePath:o=".",images:i,audio:a,autoPlay:s=false,theme:u,renderMode:l=false,captionStyle:p}=n,d=a?ua(t,a):t,m=i?la(i,o):null,f;r==="static"?f=me(kt,{doc:d,basePath:o,theme:u}):f=me(ao,{script:d,basePath:o,displayMode:"slideshow",autoPlay:l?false:s,showControls:!l,renderMode:l,theme:u,captionsEnabled:!!p,captionStyle:p??"standard"}),m&&(f=me(an.Provider,{value:m},f));let h=wt.get(e);h||(h=gr(e),wt.set(e,h)),h.render(f);}function Gc(e,t,n={}){da(e,t,{...n,mode:"static"});}function Kc(e){let t=wt.get(e);t&&(t.unmount(),wt.delete(e));}var Qc="1.1.2";
109
+ exports.mount=da;exports.mountStatic=Gc;exports.unmount=Kc;exports.version=Qc;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map
92
110
  //# sourceMappingURL=squisq-player.global.js.map